@babsey/code-graph 0.10.2 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/code-graph.js +1856 -1845
- package/dist/code-graph.umd.cjs +8 -8
- package/dist/code.d.ts +0 -1
- package/dist/codeGraph/codeGraph.d.ts +5 -3
- package/dist/codeNode/codeNode.d.ts +2 -7
- package/dist/codeNodeInterfaces/codeNode/codeNodeInterface.d.ts +2 -0
- package/dist/codeNodeInterfaces/formatInputs.d.ts +7 -0
- package/dist/codeNodeInterfaces/index.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/subgraph/graphInterface.d.ts +14 -8
- package/dist/subgraph/subgraphInterfaceNodes.d.ts +4 -10
- package/dist/utils/index.d.ts +2 -0
- package/package.json +1 -1
- package/.vscode/extensions.json +0 -3
package/dist/code-graph.umd.cjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
(function(m,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("@baklavajs/renderer-vue"),require("@baklavajs/core"),require("@vueuse/core"),require("mustache"),require("uuid"),require("@baklavajs/interface-types"),require("@baklavajs/engine"),require("toposort"),require("@baklavajs/events")):typeof define=="function"&&define.amd?define(["exports","vue","@baklavajs/renderer-vue","@baklavajs/core","@vueuse/core","mustache","uuid","@baklavajs/interface-types","@baklavajs/engine","toposort","@baklavajs/events"],r):(m=typeof globalThis<"u"?globalThis:m||self,r(m["@babsey/code-graph"]={},m.vue,m["@baklavajs/renderer-vue"],m["@baklavajs/core"],m["@vueuse/core"],m.mustache,m.uuid,m["@baklavajs/interface-types"],m["@baklavajs/engine"],m.toposort,m["@baklavajs/events"]))})(this,(function(m,r,O,Z,Jn,Le,De,G,ye,$a,Qn){"use strict";const H=(e,t)=>{const n=e.__vccOpts||e;for(const[s,a]of t)n[s]=a;return n},Ua={},Fa={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-check"};function Wa(e,t){return r.openBlock(),r.createElementBlock("svg",Fa,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)])])}const es=H(Ua,[["render",Wa]]),Ha={},ja={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-chevron-down"};function Ga(e,t){return r.openBlock(),r.createElementBlock("svg",ja,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none",style:{fill:"none",stroke:"none"}},null,-1),r.createElementVNode("path",{d:"M6 9l6 6l6 -6",fill:"none",style:{fill:"none"}},null,-1)])])}const ts=H(Ha,[["render",Ga]]),za={},qa={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-code-variable"};function Za(e,t){return r.openBlock(),r.createElementBlock("svg",qa,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M4 8m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z"},null,-1)])])}const ns=H(za,[["render",Za]]),Ka={},Xa={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-copy"};function Ja(e,t){return r.openBlock(),r.createElementBlock("svg",Xa,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z"},null,-1),r.createElementVNode("path",{d:"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1"},null,-1)])])}const ss=H(Ka,[["render",Ja]]),Qa={},er={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-dots-vertical"};function tr(e,t){return r.openBlock(),r.createElementBlock("svg",er,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),r.createElementVNode("path",{d:"M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),r.createElementVNode("path",{d:"M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1)])])}const as=H(Qa,[["render",tr]]),nr={},sr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-download"};function ar(e,t){return r.openBlock(),r.createElementBlock("svg",sr,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),r.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),r.createElementVNode("path",{d:"M12 4l0 12"},null,-1)])])}const rs=H(nr,[["render",ar]]),rr={},or={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",class:"baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-left-collapse"};function ir(e,t){return r.openBlock(),r.createElementBlock("svg",or,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M18 3a3 3 0 0 1 2.995 2.824l.005 .176v12a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-12a3 3 0 0 1 2.824 -2.995l.176 -.005h12zm0 2h-9v14h9a1 1 0 0 0 .993 -.883l.007 -.117v-12a1 1 0 0 0 -.883 -.993l-.117 -.007zm-2.293 4.293a1 1 0 0 1 .083 1.32l-.083 .094l-1.292 1.293l1.292 1.293a1 1 0 0 1 .083 1.32l-.083 .094a1 1 0 0 1 -1.32 .083l-.094 -.083l-2 -2a1 1 0 0 1 -.083 -1.32l.083 -.094l2 -2a1 1 0 0 1 1.414 0z"},null,-1)])])}const lr=H(rr,[["render",ir]]),dr={},cr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",class:"baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-left-expand"};function ur(e,t){return r.openBlock(),r.createElementBlock("svg",cr,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M18 3a3 3 0 0 1 2.995 2.824l.005 .176v12a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-12a3 3 0 0 1 2.824 -2.995l.176 -.005h12zm0 2h-9v14h9a1 1 0 0 0 .993 -.883l.007 -.117v-12a1 1 0 0 0 -.883 -.993l-.117 -.007zm-4.387 4.21l.094 .083l2 2a1 1 0 0 1 .083 1.32l-.083 .094l-2 2a1 1 0 0 1 -1.497 -1.32l.083 -.094l1.292 -1.293l-1.292 -1.293a1 1 0 0 1 -.083 -1.32l.083 -.094a1 1 0 0 1 1.32 -.083z"},null,-1)])])}const hr=H(dr,[["render",ur]]),fr={},pr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",class:"baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-right"};function mr(e,t){return r.openBlock(),r.createElementBlock("svg",pr,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M6 21a3 3 0 0 1 -3 -3v-12a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3zm8 -16h-8a1 1 0 0 0 -1 1v12a1 1 0 0 0 1 1h8z"},null,-1)])])}const _r=H(fr,[["render",mr]]),yr={},gr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",class:"baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-right-collapse"};function kr(e,t){return r.openBlock(),r.createElementBlock("svg",gr,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M18 3a3 3 0 0 1 2.995 2.824l.005 .176v12a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-12a3 3 0 0 1 2.824 -2.995l.176 -.005h12zm-3 2h-9a1 1 0 0 0 -.993 .883l-.007 .117v12a1 1 0 0 0 .883 .993l.117 .007h9v-14zm-5.387 4.21l.094 .083l2 2a1 1 0 0 1 .083 1.32l-.083 .094l-2 2a1 1 0 0 1 -1.497 -1.32l.083 -.094l1.292 -1.293l-1.292 -1.293a1 1 0 0 1 -.083 -1.32l.083 -.094a1 1 0 0 1 1.32 -.083z"},null,-1)])])}const os=H(yr,[["render",kr]]),br={},wr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",class:"baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-right-expand"};function vr(e,t){return r.openBlock(),r.createElementBlock("svg",wr,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M18 3a3 3 0 0 1 2.995 2.824l.005 .176v12a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-12a3 3 0 0 1 2.824 -2.995l.176 -.005h12zm-3 2h-9a1 1 0 0 0 -.993 .883l-.007 .117v12a1 1 0 0 0 .883 .993l.117 .007h9v-14zm-3.293 4.293a1 1 0 0 1 .083 1.32l-.083 .094l-1.292 1.293l1.292 1.293a1 1 0 0 1 .083 1.32l-.083 .094a1 1 0 0 1 -1.32 .083l-.094 -.083l-2 -2a1 1 0 0 1 -.083 -1.32l.083 -.094l2 -2a1 1 0 0 1 1.414 0z"},null,-1)])])}const Ft=H(br,[["render",vr]]),Nr={},Cr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-lock-code"};function Sr(e,t){return r.openBlock(),r.createElementBlock("svg",Cr,[...t[0]||(t[0]=[r.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M11.5 21h-4.5a2 2 0 0 1 -2 -2v-6a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2"></path><path d="M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0"></path><path d="M8 11v-4a4 4 0 1 1 8 0v4"></path><path d="M20 21l2 -2l-2 -2"></path><path d="M17 17l-2 2l2 2"></path>',6)])])}const Wt=H(Nr,[["render",Sr]]),Mr={},Or={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-player-play"};function Er(e,t){return r.openBlock(),r.createElementBlock("svg",Or,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M7 4v16l13 -8z"},null,-1)])])}const Tr=H(Mr,[["render",Er]]),Ir={},xr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-plus"};function Dr(e,t){return r.openBlock(),r.createElementBlock("svg",xr,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M12 5l0 14"},null,-1),r.createElementVNode("path",{d:"M5 12l14 0"},null,-1)])])}const is=H(Ir,[["render",Dr]]),Yr={},Rr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-restore"};function Br(e,t){return r.openBlock(),r.createElementBlock("svg",Rr,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M3.06 13a9 9 0 1 0 .49 -4.087"},null,-1),r.createElementVNode("path",{d:"M3 4.001v5h5"},null,-1),r.createElementVNode("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1)])])}const ls=H(Yr,[["render",Br]]),Vr={},Pr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-schema"};function Lr(e,t){return r.openBlock(),r.createElementBlock("svg",Pr,[...t[0]||(t[0]=[r.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M5 2h5v4h-5z"></path><path d="M15 10h5v4h-5z"></path><path d="M5 18h5v4h-5z"></path><path d="M5 10h5v4h-5z"></path><path d="M10 12h5"></path><path d="M7.5 6v4"></path><path d="M7.5 14v4"></path>',8)])])}const ds=H(Vr,[["render",Lr]]),Ar={},$r={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-schema-off"};function Ur(e,t){return r.openBlock(),r.createElementBlock("svg",$r,[...t[0]||(t[0]=[r.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M6 2h4v4m-4 0h-1v-1"></path><path d="M15 11v-1h5v4h-2"></path><path d="M5 18h5v4h-5z"></path><path d="M5 10h5v4h-5z"></path><path d="M10 12h2"></path><path d="M7.5 7.5v2.5"></path><path d="M7.5 14v4"></path><path d="M3 3l18 18"></path>',9)])])}const cs=H(Ar,[["render",Ur]]),Fr={},Wr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-transition-bottom"};function Hr(e,t){return r.openBlock(),r.createElementBlock("svg",Wr,[...t[0]||(t[0]=[r.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M21 18a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3"></path><path d="M3 3m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v0a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z"></path><path d="M12 9v8"></path><path d="M9 14l3 3l3 -3"></path>',5)])])}const us=H(Fr,[["render",Hr]]),jr={},Gr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-upload"};function zr(e,t){return r.openBlock(),r.createElementBlock("svg",Gr,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),r.createElementVNode("path",{d:"M7 9l5 -5l5 5"},null,-1),r.createElementVNode("path",{d:"M12 4l0 12"},null,-1)])])}const hs=H(jr,[["render",zr]]),qr={},Zr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-x"};function Kr(e,t){return r.openBlock(),r.createElementBlock("svg",Zr,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),r.createElementVNode("path",{d:"M6 6l12 12"},null,-1)])])}const fs=H(qr,[["render",Kr]]),Xr=Object.freeze(Object.defineProperty({__proto__:null,Check:es,ChevronDown:ts,CodeVariable:ns,Copy:ss,DotsVertical:as,Download:rs,LayoutSidebarLeftCollapse:lr,LayoutSidebarLeftExpand:hr,LayoutSidebarRight:_r,LayoutSidebarRightCollapse:os,LayoutSidebarRightExpand:Ft,LockCode:Wt,PlayerPlay:Tr,Plus:is,Restore:ls,Schema:ds,SchemaOff:cs,TransitionBottom:us,Upload:hs,X:fs},Symbol.toStringTag,{value:"Module"}));function Jr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ut={exports:{}};var Qr=ut.exports,ps;function eo(){return ps||(ps=1,(function(e,t){(function(s,a){e.exports=a()})(Qr,function(){return(function(){var n={686:(function(o,i,l){l.d(i,{default:function(){return z}});var d=l(279),c=l.n(d),u=l(370),y=l.n(u),p=l(817),I=l.n(p);function k(w){try{return document.execCommand(w)}catch{return!1}}var S=function(N){var v=I()(N);return k("cut"),v},f=S;function b(w){var N=document.documentElement.getAttribute("dir")==="rtl",v=document.createElement("textarea");v.style.fontSize="12pt",v.style.border="0",v.style.padding="0",v.style.margin="0",v.style.position="absolute",v.style[N?"right":"left"]="-9999px";var E=window.pageYOffset||document.documentElement.scrollTop;return v.style.top="".concat(E,"px"),v.setAttribute("readonly",""),v.value=w,v}var A=function(N,v){var E=b(N);v.container.appendChild(E);var x=I()(E);return k("copy"),E.remove(),x},P=function(N){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},E="";return typeof N=="string"?E=A(N,v):N instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(N?.type)?E=A(N.value,v):(E=I()(N),k("copy")),E},W=P;function Oe(w){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Oe=function(v){return typeof v}:Oe=function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},Oe(w)}var Ee=function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},v=N.action,E=v===void 0?"copy":v,x=N.container,R=N.target,ue=N.text;if(E!=="copy"&&E!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(R!==void 0)if(R&&Oe(R)==="object"&&R.nodeType===1){if(E==="copy"&&R.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(E==="cut"&&(R.hasAttribute("readonly")||R.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if(ue)return W(ue,{container:x});if(R)return E==="cut"?f(R):W(R,{container:x})},dt=Ee;function _e(w){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_e=function(v){return typeof v}:_e=function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},_e(w)}function M(w,N){if(!(w instanceof N))throw new TypeError("Cannot call a class as a function")}function X(w,N){for(var v=0;v<N.length;v++){var E=N[v];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(w,E.key,E)}}function te(w,N,v){return N&&X(w.prototype,N),v&&X(w,v),w}function Kn(w,N){if(typeof N!="function"&&N!==null)throw new TypeError("Super expression must either be null or a function");w.prototype=Object.create(N&&N.prototype,{constructor:{value:w,writable:!0,configurable:!0}}),N&&ct(w,N)}function ct(w,N){return ct=Object.setPrototypeOf||function(E,x){return E.__proto__=x,E},ct(w,N)}function Lt(w){var N=$t();return function(){var E=Pe(w),x;if(N){var R=Pe(this).constructor;x=Reflect.construct(E,arguments,R)}else x=E.apply(this,arguments);return At(this,x)}}function At(w,N){return N&&(_e(N)==="object"||typeof N=="function")?N:Xn(w)}function Xn(w){if(w===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w}function $t(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Pe(w){return Pe=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},Pe(w)}function Ke(w,N){var v="data-clipboard-".concat(w);if(N.hasAttribute(v))return N.getAttribute(v)}var $=(function(w){Kn(v,w);var N=Lt(v);function v(E,x){var R;return M(this,v),R=N.call(this),R.resolveOptions(x),R.listenClick(E),R}return te(v,[{key:"resolveOptions",value:function(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof x.action=="function"?x.action:this.defaultAction,this.target=typeof x.target=="function"?x.target:this.defaultTarget,this.text=typeof x.text=="function"?x.text:this.defaultText,this.container=_e(x.container)==="object"?x.container:document.body}},{key:"listenClick",value:function(x){var R=this;this.listener=y()(x,"click",function(ue){return R.onClick(ue)})}},{key:"onClick",value:function(x){var R=x.delegateTarget||x.currentTarget,ue=this.action(R)||"copy",Ut=dt({action:ue,container:this.container,target:this.target(R),text:this.text(R)});this.emit(Ut?"success":"error",{action:ue,text:Ut,trigger:R,clearSelection:function(){R&&R.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(x){return Ke("action",x)}},{key:"defaultTarget",value:function(x){var R=Ke("target",x);if(R)return document.querySelector(R)}},{key:"defaultText",value:function(x){return Ke("text",x)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(x){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return W(x,R)}},{key:"cut",value:function(x){return f(x)}},{key:"isSupported",value:function(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],R=typeof x=="string"?[x]:x,ue=!!document.queryCommandSupported;return R.forEach(function(Ut){ue=ue&&!!document.queryCommandSupported(Ut)}),ue}}]),v})(c()),z=$}),828:(function(o){var i=9;if(typeof Element<"u"&&!Element.prototype.matches){var l=Element.prototype;l.matches=l.matchesSelector||l.mozMatchesSelector||l.msMatchesSelector||l.oMatchesSelector||l.webkitMatchesSelector}function d(c,u){for(;c&&c.nodeType!==i;){if(typeof c.matches=="function"&&c.matches(u))return c;c=c.parentNode}}o.exports=d}),438:(function(o,i,l){var d=l(828);function c(p,I,k,S,f){var b=y.apply(this,arguments);return p.addEventListener(k,b,f),{destroy:function(){p.removeEventListener(k,b,f)}}}function u(p,I,k,S,f){return typeof p.addEventListener=="function"?c.apply(null,arguments):typeof k=="function"?c.bind(null,document).apply(null,arguments):(typeof p=="string"&&(p=document.querySelectorAll(p)),Array.prototype.map.call(p,function(b){return c(b,I,k,S,f)}))}function y(p,I,k,S){return function(f){f.delegateTarget=d(f.target,I),f.delegateTarget&&S.call(p,f)}}o.exports=u}),879:(function(o,i){i.node=function(l){return l!==void 0&&l instanceof HTMLElement&&l.nodeType===1},i.nodeList=function(l){var d=Object.prototype.toString.call(l);return l!==void 0&&(d==="[object NodeList]"||d==="[object HTMLCollection]")&&"length"in l&&(l.length===0||i.node(l[0]))},i.string=function(l){return typeof l=="string"||l instanceof String},i.fn=function(l){var d=Object.prototype.toString.call(l);return d==="[object Function]"}}),370:(function(o,i,l){var d=l(879),c=l(438);function u(k,S,f){if(!k&&!S&&!f)throw new Error("Missing required arguments");if(!d.string(S))throw new TypeError("Second argument must be a String");if(!d.fn(f))throw new TypeError("Third argument must be a Function");if(d.node(k))return y(k,S,f);if(d.nodeList(k))return p(k,S,f);if(d.string(k))return I(k,S,f);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function y(k,S,f){return k.addEventListener(S,f),{destroy:function(){k.removeEventListener(S,f)}}}function p(k,S,f){return Array.prototype.forEach.call(k,function(b){b.addEventListener(S,f)}),{destroy:function(){Array.prototype.forEach.call(k,function(b){b.removeEventListener(S,f)})}}}function I(k,S,f){return c(document.body,k,S,f)}o.exports=u}),817:(function(o){function i(l){var d;if(l.nodeName==="SELECT")l.focus(),d=l.value;else if(l.nodeName==="INPUT"||l.nodeName==="TEXTAREA"){var c=l.hasAttribute("readonly");c||l.setAttribute("readonly",""),l.select(),l.setSelectionRange(0,l.value.length),c||l.removeAttribute("readonly"),d=l.value}else{l.hasAttribute("contenteditable")&&l.focus();var u=window.getSelection(),y=document.createRange();y.selectNodeContents(l),u.removeAllRanges(),u.addRange(y),d=u.toString()}return d}o.exports=i}),279:(function(o){function i(){}i.prototype={on:function(l,d,c){var u=this.e||(this.e={});return(u[l]||(u[l]=[])).push({fn:d,ctx:c}),this},once:function(l,d,c){var u=this;function y(){u.off(l,y),d.apply(c,arguments)}return y._=d,this.on(l,y,c)},emit:function(l){var d=[].slice.call(arguments,1),c=((this.e||(this.e={}))[l]||[]).slice(),u=0,y=c.length;for(u;u<y;u++)c[u].fn.apply(c[u].ctx,d);return this},off:function(l,d){var c=this.e||(this.e={}),u=c[l],y=[];if(u&&d)for(var p=0,I=u.length;p<I;p++)u[p].fn!==d&&u[p].fn._!==d&&y.push(u[p]);return y.length?c[l]=y:delete c[l],this}},o.exports=i,o.exports.TinyEmitter=i})},s={};function a(o){if(s[o])return s[o].exports;var i=s[o]={exports:{}};return n[o](i,i.exports,a),i.exports}return(function(){a.n=function(o){var i=o&&o.__esModule?function(){return o.default}:function(){return o};return a.d(i,{a:i}),i}})(),(function(){a.d=function(o,i){for(var l in i)a.o(i,l)&&!a.o(o,l)&&Object.defineProperty(o,l,{enumerable:!0,get:i[l]})}})(),(function(){a.o=function(o,i){return Object.prototype.hasOwnProperty.call(o,i)}})(),a(686)})().default})})(ut)),ut.exports}var to=eo();const no=Jr(to),so=e=>({toClipboard(t,n){return new Promise((s,a)=>{const o=document.createElement("button"),i=new no(o,{text:()=>t,action:()=>"copy",container:n!==void 0?n:document.body});i.on("success",l=>{i.destroy(),s(l)}),i.on("error",l=>{i.destroy(),a(l)}),document.body.appendChild(o),o.click(),document.body.removeChild(o)})}}),ao={key:0,class:"baklava-button"},ms=r.defineComponent({__name:"CopyToClipboard",props:{text:String},setup(e){const{toClipboard:t}=so(),n=e,s=r.toRef(n,"text"),a=r.ref(!1),o=async()=>{try{await t(s.value),a.value=!0,setTimeout(()=>a.value=!1,1500),console.log("Copied to clipboard")}catch(i){console.error(i)}};return(i,l)=>(r.openBlock(),r.createElementBlock("div",null,[a.value?(r.openBlock(),r.createElementBlock("button",ao,[r.createVNode(r.unref(es))])):(r.openBlock(),r.createElementBlock("button",{key:1,onClick:o,class:"baklava-button"},[r.createVNode(r.unref(ss))]))]))}}),ro={class:"code-editor"},oo={class:"code-buttons"},io=r.defineComponent({__name:"CodeEditor",props:r.mergeModels({locked:{type:Boolean},extensions:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:r.mergeModels(["update:locked"],["update:modelValue"]),setup(e,{emit:t}){const n=r.useModel(e,"modelValue"),s=t,a=o=>s("update:locked",o);return(o,i)=>{const l=r.resolveComponent("codemirror");return r.openBlock(),r.createElementBlock("div",ro,[r.createElementVNode("div",oo,[e.locked?(r.openBlock(),r.createElementBlock("button",{key:0,class:"baklava-button",title:"The code is locked.",onClick:i[0]||(i[0]=d=>a(!1))},[r.createVNode(r.unref(Wt))])):r.createCommentVNode("",!0),r.createVNode(ms,{text:e.modelValue},null,8,["text"])]),r.createVNode(l,{modelValue:n.value,"onUpdate:modelValue":i[1]||(i[1]=d=>n.value=d),extensions:e.extensions,class:"codemirror",style:{height:"100%"},onKeydown:i[2]||(i[2]=d=>a(!0))},null,8,["modelValue","extensions"])])}}}),lo=r.defineComponent({__name:"CodeGraphEditor",props:{viewModel:{}},setup(e){const t=e,n=r.toRef(t,"viewModel"),s=a=>a.events.update.emit(null);return r.onMounted(n.value.onMounted),r.onBeforeUnmount(n.value.onBeforeUnmount),r.watch(n,(a,o)=>{o&&o.onBeforeUnmount(),a&&a.onMounted()}),(a,o)=>(r.openBlock(),r.createBlock(r.unref(O.BaklavaEditor),{viewModel:n.value},{palette:r.withCtx(()=>[r.createVNode(r.unref(gs))]),node:r.withCtx(i=>[r.createVNode(r.unref(_s),r.mergeProps(i,{onUpdate:l=>s(i.node)}),null,16,["onUpdate"])]),sidebar:r.withCtx(i=>[r.createVNode(r.unref(ys),r.normalizeProps(r.guardReactiveProps(i)),{codeEditor:r.withCtx(({node:l})=>[r.renderSlot(a.$slots,"sidebarCodeEditor",{node:l})]),_:3},16)]),_:3},8,["viewModel"]))}}),co={class:"code-graph-info"},uo=r.defineComponent({__name:"CodeGraphInfo",props:{viewModel:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("div",co,[r.createElementVNode("div",null,"Editor graph: "+r.toDisplayString(e.viewModel.editor.graph.shortId),1),r.createElementVNode("div",null,"Displayed graph: "+r.toDisplayString(e.viewModel.displayedGraph.shortId),1),r.createElementVNode("div",null,"Graphs: "+r.toDisplayString(e.viewModel.editor.graphIds),1),r.createElementVNode("div",null,"Graph templates: "+r.toDisplayString(e.viewModel.editor.graphTemplateIds),1),r.createElementVNode("div",null,"Engine status: "+r.toDisplayString(e.viewModel.engine?.status),1)]))}}),ho=["data-node-type","id"],fo={class:"__title-label",style:{"flex-grow":"1"}},po={key:0},mo={class:"__menu",style:{display:"flex"}},_o={class:"__outputs"},yo={key:0},go=["id","title"],ko={class:"__inputs"},bo={key:0},wo=["id","title"],_s=r.defineComponent({__name:"CodeGraphNode",props:{node:{},selected:{type:Boolean,default:!1},dragging:{type:Boolean}},emits:["select","start-drag","update"],setup(e,{emit:t}){const n=O.Components.ContextMenu,s=O.Components.NodeInterface,a=e,o=r.computed(()=>a.node),i=t,{viewModel:l}=O.useViewModel(),{graph:d,switchGraph:c}=O.useGraph(),u=r.ref(null),y=r.ref(!1),p=r.ref(""),I=r.ref(null),k=r.ref(!1);let S=0,f=0;const b=r.ref(!1),A=r.computed(()=>{const $=[{value:"edit",label:"Edit"},{value:"rename",label:"Rename"},{value:"delete",label:"Delete"}];return a.node.type.startsWith(Z.GRAPH_NODE_TYPE_PREFIX)&&$.push({value:"editSubgraph",label:"Edit Subgraph"}),$}),P=r.computed(()=>({"--selected":a.selected,"--dragging":a.dragging,"--two-column":!!a.node.twoColumn,"--hidden":o.value.state?.hidden})),W=r.computed(()=>({"--reverse-y":a.node.reverseY??l.value.settings.nodes.reverseY})),Oe=r.computed(()=>({top:`${a.node.position?.y??0}px`,left:`${a.node.position?.x??0}px`,"--width":`${a.node.width??l.value.settings.nodes.defaultWidth}px`})),Ee=r.computed(()=>Object.values(a.node.inputs).filter($=>!$.hidden)),dt=r.computed(()=>Object.values(a.node.outputs).filter($=>!$.hidden)),_e=()=>{Kn(),i("select")},M=$=>{a.selected||_e(),i("start-drag",$)},X=()=>{b.value=!0},te=()=>{const $=l.value.displayedGraph.sidebar;$.nodeId=a.node.id,$.visible=!0},Kn=()=>{const $=l.value.displayedGraph.sidebar;$.nodeId=a.node.id},ct=async $=>{switch($){case"edit":te();break;case"delete":d.value.removeNode(a.node);break;case"rename":p.value=a.node.title,y.value=!0,await r.nextTick(),I.value?.focus();break;case"editSubgraph":c(a.node.template);break}},Lt=()=>{o.value.title=p.value,o.value.events.titleChanged.emit(o.value.title),y.value=!1},At=()=>{u.value&&l.value.hooks.renderNode.execute({node:a.node,el:u.value})},Xn=$=>{k.value=!0,S=a.node.width,f=$.clientX,$.preventDefault()},$t=$=>{o.value.state&&(o.value.state.integrated=$,i("update"))},Pe=$=>{if(!k.value)return;const z=$.clientX-f,w=S+z/d.value.scaling,N=l.value.settings.nodes.minWidth,v=l.value.settings.nodes.maxWidth;o.value.width=Math.max(N,Math.min(v,w))},Ke=()=>{k.value=!1};return r.onMounted(()=>{At(),window.addEventListener("mousemove",Pe),window.addEventListener("mouseup",Ke)}),r.onUpdated(At),r.onBeforeUnmount(()=>{window.removeEventListener("mousemove",Pe),window.removeEventListener("mouseup",Ke)}),($,z)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([P.value,"baklava-node"]),"data-node-type":o.value.type,id:o.value.id,style:r.normalizeStyle(Oe.value),ref_key:"el",ref:u,onPointerdown:_e},[r.unref(l).settings.nodes.resizable?(r.openBlock(),r.createElementBlock("div",{key:0,class:"__resize-handle",onMousedown:Xn},null,32)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"__title",onPointerdown:r.withModifiers(M,["self","stop"]),onContextmenu:r.withModifiers(X,["prevent"])},[o.value.inputs._code?(r.openBlock(),r.createBlock(r.unref(Ht),{key:0,intf:o.value.inputs._code,node:o.value,title:o.value.inputs._code.value,class:"--input","data-interface-type":"node",style:{"flex-grow":"0"}},null,8,["intf","node","title"])):r.createCommentVNode("",!0),y.value?r.withDirectives((r.openBlock(),r.createElementBlock("input",{key:2,ref_key:"renameInputEl",ref:I,"onUpdate:modelValue":z[4]||(z[4]=w=>p.value=w),class:"baklava-input",placeholder:"Title",style:{"flex-grow":"1"},type:"text",onBlur:Lt,onKeydown:r.withKeys(Lt,["enter"])},null,544)),[[r.vModelText,p.value]]):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createElementVNode("div",fo,[o.value.idx>-1?(r.openBlock(),r.createElementBlock("span",po,r.toDisplayString(o.value.idx+1)+" - ",1)):r.createCommentVNode("",!0),r.createTextVNode(" "+r.toDisplayString(o.value.title)+" "+r.toDisplayString(o.value.graph.shortId)+" "+r.toDisplayString(o.value.shortId),1)]),r.createElementVNode("div",mo,[o.value.isCodeNode?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[o.value.state.lockCode?(r.openBlock(),r.createBlock(r.unref(Wt),{key:0,class:"--clickable mx-1",onClick:z[0]||(z[0]=w=>o.value.lockCode=!1)})):r.createCommentVNode("",!0),o.value.isSelected&&!r.unref(l).displayedGraph.sidebar.visible?(r.openBlock(),r.createBlock(r.unref(Ft),{key:1,class:"--clickable mx-1",onClick:te})):r.createCommentVNode("",!0),o.value.hasConnectedOutputNodes?(r.openBlock(),r.createElementBlock(r.Fragment,{key:2},[o.value.state.integrated?(r.openBlock(),r.createBlock(r.unref(ns),{key:1,class:"--clickable mx-1",onClick:z[2]||(z[2]=w=>$t(!1))})):(r.openBlock(),r.createBlock(r.unref(us),{key:0,class:"--clickable mx-1",onClick:z[1]||(z[1]=w=>$t(!0))}))],64)):r.createCommentVNode("",!0)],64)):r.createCommentVNode("",!0),r.createVNode(r.unref(as),{class:"--clickable mx-1",onClick:X}),r.createVNode(r.unref(n),{modelValue:b.value,"onUpdate:modelValue":z[3]||(z[3]=w=>b.value=w),x:0,y:0,items:A.value,onClick:ct},null,8,["modelValue","items"])])],64)),o.value.outputs._code?(r.openBlock(),r.createBlock(r.unref(Ht),{key:3,node:o.value,intf:o.value.outputs._code,class:"--output",title:o.value.outputs._code.value,"data-interface-type":"node"},null,8,["node","intf","title"])):r.createCommentVNode("",!0)],32),r.createElementVNode("div",{class:r.normalizeClass(["__content",W.value]),onKeydown:z[5]||(z[5]=r.withKeys(r.withModifiers(()=>{},["stop"]),["delete"])),onContextmenu:z[6]||(z[6]=r.withModifiers(()=>{},["prevent"]))},[r.createElementVNode("div",_o,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(dt.value,w=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:w.id},[o.value.state?.hidden?(r.openBlock(),r.createElementBlock("div",yo,[w.port?(r.openBlock(),r.createElementBlock("div",{key:0,id:w.id,title:w.name,class:"baklava-node-interface --output --connected"},[...z[7]||(z[7]=[r.createElementVNode("div",{class:"__port"},null,-1)])],8,go)):r.createCommentVNode("",!0)])):r.renderSlot($.$slots,"nodeInterface",{key:1,type:"output",node:o.value,intf:w},()=>[r.createVNode(r.unref(s),{node:o.value,intf:w,title:w.value},null,8,["node","intf","title"])])],64))),128))]),r.createElementVNode("div",ko,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Ee.value,w=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:w.id},[o.value.state?.hidden?(r.openBlock(),r.createElementBlock("div",bo,[w.port?(r.openBlock(),r.createElementBlock("div",{key:0,id:w.id,title:w.name,class:"baklava-node-interface --input --connected"},[...z[8]||(z[8]=[r.createElementVNode("div",{class:"__port"},null,-1)])],8,wo)):r.createCommentVNode("",!0)])):r.renderSlot($.$slots,"nodeInterface",{key:1,node:o.value,intf:w,type:"input"},()=>[r.createVNode(r.unref(s),{node:o.value,intf:w,title:w.value},null,8,["node","intf","title"])])],64))),128))])],34)],46,ho))}}),vo=["id"],No={class:"align-middle"},Ht=r.defineComponent({__name:"CodeGraphNodeInterface",props:{node:{},intf:{}},setup(e){const t=e,{viewModel:n}=O.useViewModel(),{hoveredOver:s,temporaryConnection:a}=O.useTemporaryConnection(),o=r.ref(null),i=r.computed(()=>t.intf.connectionCount>0),l=r.computed(()=>({"--connected":i.value})),d=()=>{s(t.intf)},c=()=>{s(void 0)},u=()=>{o.value&&n.value.hooks.renderInterface.execute({intf:t.intf,el:o.value})};return r.onMounted(u),r.onUpdated(u),(y,p)=>(r.openBlock(),r.createElementBlock("div",{id:e.intf.id,ref_key:"el",ref:o,class:r.normalizeClass(["baklava-node-interface",l.value])},[e.intf.port?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass([{"--selected":r.unref(a)?.from===e.intf},"__port"]),onPointerover:d,onPointerout:c},null,34)):r.createCommentVNode("",!0),r.createElementVNode("span",No,[r.renderSlot(y.$slots,"default")])],10,vo))}}),Co=["title"],So={key:0,class:"__label"},jt=r.defineComponent({__name:"SidebarCheckbox",props:{disabled:{type:Boolean},inversed:{type:Boolean},modelValue:{type:Boolean},name:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(s,a)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["baklava-checkbox",{"--checked":e.inversed?!e.modelValue:e.modelValue,"--disabled":e.disabled}]),title:e.name,onClick:a[0]||(a[0]=o=>n("update:modelValue",!e.modelValue))},[a[1]||(a[1]=r.createElementVNode("div",{class:"__checkmark-container"},[r.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18"},[r.createElementVNode("path",{class:"__checkmark",d:"M 6 5 L 6 10 L 16 10",transform:"rotate(-45 10 10)"})])],-1)),e.name?(r.openBlock(),r.createElementBlock("div",So,r.toDisplayString(e.name),1)):r.createCommentVNode("",!0)],10,Co))}}),Mo={class:"__header"},Oo={class:"__node-name"},Eo={class:"__interfaces"},To={class:"__inputs"},Io={style:{display:"flex"}},xo={class:"__outputs"},Do={key:0,class:"__interface"},Yo=["placeholder"],Ro={style:{display:"flex"}},ys=r.defineComponent({__name:"CodeGraphSidebar",setup(e){const{viewModel:t}=O.useViewModel(),{graph:n}=O.useGraph(),s=r.ref(null),a=r.toRef(t.value.settings.sidebar,"width"),o=r.computed(()=>t.value.settings.sidebar.resizable);let i=0,l=0;const d=r.computed(()=>{const b=n.value.sidebar.nodeId;return n.value.nodes.find(A=>A.id===b)}),c=r.computed(()=>d.value),u=r.computed(()=>({width:`${a.value}px`})),y=r.computed(()=>c.value?Object.values(c.value.inputs).filter(b=>b.displayInSidebar&&b.component):[]),p=r.computed(()=>c.value?Object.values(c.value.outputs).filter(b=>b.displayInSidebar&&b.component):[]),I=()=>{n.value.sidebar.visible=!1},k=()=>{d.value&&(d.value.state.variableNameNumberAppendix=c.value.state.variableName.length===0,d.value.events.update.emit(null))},S=b=>{i=a.value,l=b.clientX,window.addEventListener("mousemove",f),window.addEventListener("mouseup",()=>{window.removeEventListener("mousemove",f)},{once:!0})},f=b=>{const A=s.value?.parentElement?.getBoundingClientRect().width??500,P=b.clientX-l;let W=i-P;W<300?W=300:W>.9*A&&(W=.9*A),a.value=W};return(b,A)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([{"--open":r.unref(n).sidebar.visible},"baklava-sidebar"]),style:r.normalizeStyle(u.value),ref_key:"el",ref:s},[o.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:"__resizer",onMousedown:S},null,32)):r.createCommentVNode("",!0),d.value?(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createElementVNode("div",Mo,[r.createElementVNode("button",{tabindex:"-1",class:"__close",onClick:I},"×"),r.createElementVNode("div",Oo,[r.createElementVNode("b",null,r.toDisplayString(d.value.title),1)])]),r.createElementVNode("div",Eo,[r.createElementVNode("div",To,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(y.value,P=>(r.openBlock(),r.createElementBlock("div",{key:P.id,class:"__interface"},[r.createElementVNode("div",Io,[r.createVNode(jt,{modelValue:P.hidden,"onUpdate:modelValue":[W=>P.hidden=W,A[0]||(A[0]=()=>d.value?.events.update.emit(null))],disabled:!P.optional,inversed:"",style:{"padding-right":"8px"}},null,8,["modelValue","onUpdate:modelValue","disabled"]),(r.openBlock(),r.createBlock(r.resolveDynamicComponent(P.component),{modelValue:P.value,"onUpdate:modelValue":W=>P.value=W,node:d.value,intf:P,style:{width:"100%"}},null,8,["modelValue","onUpdate:modelValue","node","intf"]))])]))),128))]),r.createElementVNode("div",xo,[c.value&&c.value.state?(r.openBlock(),r.createElementBlock("div",Do,[A[3]||(A[3]=r.createElementVNode("label",null,"Variable name",-1)),r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":A[1]||(A[1]=P=>c.value.state.variableName=P),placeholder:c.value.variableName,type:"text",class:"baklava-input",title:"Variable name",onBlur:k,onKeydown:r.withKeys(k,["enter"])},null,40,Yo),[[r.vModelText,c.value.state.variableName]])])):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p.value,P=>(r.openBlock(),r.createElementBlock("div",{key:P.id,class:"__interface"},[r.createElementVNode("div",Ro,[r.createVNode(jt,{modelValue:P.hidden,"onUpdate:modelValue":[W=>P.hidden=W,A[2]||(A[2]=()=>d.value?.events.update.emit(null))],disabled:!P.optional,inversed:"",style:{"padding-right":"8px"}},null,8,["modelValue","onUpdate:modelValue","disabled"]),(r.openBlock(),r.createBlock(r.resolveDynamicComponent(P.component),{modelValue:P.value,"onUpdate:modelValue":W=>P.value=W,node:d.value,intf:P,style:{width:"100%"}},null,8,["modelValue","onUpdate:modelValue","node","intf"]))])]))),128))])]),r.renderSlot(b.$slots,"codeEditor",{node:d.value})],64)):r.createCommentVNode("",!0)],6))}});function Bo(e,t){return Object.fromEntries(Object.entries(e).filter(t))}function Vo(e,t){return Object.fromEntries(Object.entries(e).map(([n,s])=>[n,t(s)]))}const Po={class:"baklava-node --palette",style:{"margin-top":"-20px","margin-bottom":"20px"}},Lo={key:0,style:{display:"flex","justify-content":"space-between"}},Ao=["onClick"],$o={key:0,style:{margin:"auto 0","font-size":"12px"}},gs=r.defineComponent({__name:"CodeNodePalette",setup(e){const t=O.Components.PaletteEntry,{viewModel:n}=O.useViewModel(),{x:s,y:a}=Jn.usePointer(),{transform:o}=O.useTransform(),i=O.useNodeCategories(n),l=r.inject("editorEl"),d=r.ref(""),c=r.ref(null),u=()=>d.value?i.value.filter(k=>k.name.toLowerCase().includes(d.value.toLowerCase())||Object.values(k.nodeTypes).some(S=>S.title.toLowerCase().includes(d.value.toLowerCase()))):i.value,y=k=>d.value?Bo(k,S=>{const f=S[1];return f.category.includes(d.value.toLowerCase())||f.title?.toLowerCase().includes(d.value.toLowerCase())}):k,p=r.computed(()=>{if(!c.value||!l?.value)return{};const{left:k,top:S}=l.value.getBoundingClientRect();return{top:`${a.value-S}px`,left:`${s.value-k}px`}}),I=(k,S)=>{c.value={type:k,nodeInformation:S};const f=()=>{const b=r.reactive(new S.type);n.value.displayedGraph.addNode(b);const A=l.value.getBoundingClientRect(),[P,W]=o(s.value-A.left,a.value-A.top);b.position.x=P,b.position.y=W,c.value=null,document.removeEventListener("pointerup",f)};document.addEventListener("pointerup",f)};return(k,S)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",{class:r.normalizeClass([{"--open":r.unref(n).settings.palette.enabled},"baklava-node-palette"]),onContextmenu:S[1]||(S[1]=r.withModifiers(()=>{},["stop","prevent"]))},[r.createElementVNode("div",Po,[r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":S[0]||(S[0]=f=>d.value=f),type:"text",class:"baklava-input",title:"Filter nodes",onKeyup:u},null,544),[[r.vModelText,d.value]])]),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u(),f=>(r.openBlock(),r.createElementBlock("section",{key:f.name},[f.name!=="default"?(r.openBlock(),r.createElementBlock("h3",Lo,[r.createElementVNode("div",{onClick:b=>d.value=f.name,style:{cursor:"pointer"}},r.toDisplayString(f.name),9,Ao),Object.keys(y(f.nodeTypes)).length<Object.values(f.nodeTypes).length?(r.openBlock(),r.createElementBlock("div",$o," ( "+r.toDisplayString(Object.keys(y(f.nodeTypes)).length)+" / "+r.toDisplayString(Object.values(f.nodeTypes).length)+" ) ",1)):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(y(f.nodeTypes),(b,A)=>(r.openBlock(),r.createBlock(r.unref(t),{key:A,title:b.title,type:A,onPointerdown:P=>I(A,b)},null,8,["title","type","onPointerdown"]))),128))]))),128))],34),r.createVNode(r.Transition,{name:"fade"},{default:r.withCtx(()=>[c.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:"baklava-dragged-node",style:r.normalizeStyle(p.value)},[r.createVNode(r.unref(t),{type:c.value.type,title:c.value.nodeInformation.title},null,8,["type","title"])],4)):r.createCommentVNode("",!0)]),_:1})],64))}}),Uo={},Fo={class:"prependIcon"},Wo={class:"appendIcon"};function Ho(e,t){const n=r.resolveComponent("router-link");return r.openBlock(),r.createBlock(n,{class:"navItem"},{default:r.withCtx(()=>[r.createElementVNode("span",Fo,[r.renderSlot(e.$slots,"prependIcon")]),r.renderSlot(e.$slots,"default"),r.createElementVNode("span",Wo,[r.renderSlot(e.$slots,"appendIcon")])]),_:3})}const Gt=H(Uo,[["render",Ho]]),jo={class:"navbar"},Go=["onClick"],zo=r.defineComponent({__name:"NavBar",props:{viewModel:{},editorStates:{},routes:{}},emits:["click:remove"],setup(e,{emit:t}){const n=t,s=a=>{n("click:remove",a)};return(a,o)=>(r.openBlock(),r.createElementBlock("nav",jo,[r.renderSlot(a.$slots,"prepend"),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.editorStates,i=>(r.openBlock(),r.createBlock(Gt,{key:i.graph.id,class:r.normalizeClass({active:i.graph.id===e.viewModel.displayedGraph.id}),to:{name:e.routes?.edit??"edit",params:{editorId:i.graph.id}}},{appendIcon:r.withCtx(()=>[r.createElementVNode("button",{class:"remove",onClick:r.withModifiers(l=>s(i.graph.id),["prevent"])},[r.createVNode(r.unref(fs))],8,Go)]),default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(i.graph.id.slice(0,6))+" ",1)]),_:2},1032,["class","to"]))),128)),r.renderSlot(a.$slots,"append",{},()=>[r.createVNode(Gt,{to:{name:e.routes?.new??"new"},class:"navItem"},{default:r.withCtx(()=>[r.createVNode(r.unref(is),{class:"plus"})]),_:1},8,["to"])])]))}}),qo=["title"],ht=r.defineComponent({__name:"CodeNodeInterface",props:{intf:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("div",{title:e.intf.value},r.toDisplayString(e.intf.name),9,qo))}}),Zo=r.defineComponent({props:{intf:{type:Object,required:!0},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(e,{emit:t}){return{v:r.computed({get:()=>e.modelValue,set:s=>{t("update:modelValue",s)}})}}}),Ko={style:{position:"relative"}},Xo={style:{"font-size":"12px",padding:"0 6px",position:"absolute",top:"-10px","background-color":"var(--baklava-node-color-background)"}},Jo=["placeholder","title"];function Qo(e,t,n,s,a,o){return r.openBlock(),r.createElementBlock("div",Ko,[r.createElementVNode("label",Xo,r.toDisplayString(e.intf.name),1),r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":t[0]||(t[0]=i=>e.v=i),type:"text",class:"baklava-input",placeholder:e.intf.name,title:e.intf.name},null,8,Jo),[[r.vModelText,e.v]])])}const ft=H(Zo,[["render",Qo]]),ei=r.defineComponent({components:{"i-arrow":ts},props:{intf:{type:Object,required:!0}},setup(e){const t=r.ref(null),n=r.ref(!1),s=r.computed(()=>e.intf.items.find(i=>typeof i=="string"?i===e.intf.value:i.value===e.intf.value)),a=r.computed(()=>s.value?typeof s.value=="string"?s.value:s.value.text:""),o=i=>{e.intf.value=typeof i=="string"?i:i.value};return Jn.onClickOutside(t,()=>{n.value=!1}),{el:t,open:n,selectedItem:s,selectedText:a,setSelected:o}}}),ti=["title"],ni={style:{"font-size":"12px",padding:"0 6px",position:"absolute",top:"-10px","background-color":"var(--baklava-node-color-background)"}},si={class:"__selected"},ai={class:"__text"},ri={class:"__icon"},oi={class:"__dropdown"},ii=["onClick"];function li(e,t,n,s,a,o){const i=r.resolveComponent("i-arrow");return r.openBlock(),r.createElementBlock("div",{ref:"el",class:r.normalizeClass(["baklava-select",{"--open":e.open}]),title:e.intf.name,onClick:t[0]||(t[0]=l=>e.open=!e.open)},[r.createElementVNode("label",ni,r.toDisplayString(e.intf.name),1),r.createElementVNode("div",si,[r.createElementVNode("div",ai,r.toDisplayString(e.selectedText),1),r.createElementVNode("div",ri,[r.createVNode(i)])]),r.createVNode(r.Transition,{name:"slide-fade"},{default:r.withCtx(()=>[r.withDirectives(r.createElementVNode("div",oi,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.intf.items,(l,d)=>(r.openBlock(),r.createElementBlock("div",{key:d,class:r.normalizeClass(["item",{"--active":l===e.selectedItem}]),onClick:c=>e.setSelected(l)},r.toDisplayString(typeof l=="string"?l:l.text),11,ii))),128))],512),[[r.vShow,e.open]])]),_:1})],10,ti)}const ks=H(ei,[["render",li]]),di=r.defineComponent({props:{intf:{type:Object,required:!0},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(e,{emit:t}){return{v:r.computed({get:()=>e.modelValue,set:s=>{t("update:modelValue",s)}})}}}),ci={style:{"font-size":"12px",padding:"0 6px",position:"absolute",top:"-6px","background-color":"var(--baklava-node-color-background)"}},ui=["placeholder","title"];function hi(e,t,n,s,a,o){return r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("label",ci,r.toDisplayString(e.intf.name),1),r.withDirectives(r.createElementVNode("textarea",{"onUpdate:modelValue":t[0]||(t[0]=i=>e.v=i),rows:"5",class:"baklava-input",placeholder:e.intf.name,title:e.intf.name},null,8,ui),[[r.vModelText,e.v]])])}const bs=H(di,[["render",hi]]),fi=Object.freeze(Object.defineProperty({__proto__:null,CodeEditor:io,CodeGraphEditor:lo,CodeGraphInfo:uo,CodeGraphNode:_s,CodeGraphNodeInterface:Ht,CodeGraphSidebar:ys,CodeNodeInterface:ht,CodeNodePalette:gs,CopyToClipboard:ms,NavBar:zo,NavItem:Gt,SelectInterface:ks,SidebarCheckbox:jt,TextInputInterface:ft,TextareaInputInterface:bs},Symbol.toStringTag,{value:"Module"}));Le.escape=e=>e;class zt extends Z.AbstractNode{_variableName="";codeTemplate;isCodeNode=!0;mask=null;name="";state;inputs={};outputs={};constructor(){super(),this.initializeIo(),this.twoColumn=!0,this.state=r.reactive({codeTemplate:"",hidden:!1,integrated:!1,lockCode:!1,modules:[],props:null,script:"",variableName:""}),this.codeTemplate=function(){return`${this.name}(${ws(this.codeNodeInputs).join(", ")})`}}get code(){return this.graph.code}get codeNodeInputs(){return Object.fromEntries(Object.entries(this.inputs).filter(t=>t[1].isCodeNode&&t[1].type!="node"))}get codeNodeOutputs(){return Object.fromEntries(Object.entries(this.outputs).filter(t=>t[1].isCodeNode&&t[1].type!="node"))}get graph(){return super.graph}get hasConnectedOutputNodes(){return this.getConnectedNodes("outputs").length>0}get idx(){return this.graph.nodes.filter(t=>!t.state.integrated).indexOf(this)??-1}get idxByType(){return this.graph.getNodesByType(this.type).indexOf(this)??-1}get idxByVariableNames(){return this.graph.getNodesByVariableName(this._variableName).filter(t=>!t.state.integrated).indexOf(this)??-1}get isSelected(){return this.graph.selectedNodeIds.includes(this.id)}get lockCode(){return this.state.lockCode}set lockCode(t){this.state.lockCode=t,this.events.update.emit(null)}get optionalInputs(){return Object.fromEntries(Object.entries(this.codeNodeInputs).filter(t=>t[1].optional))}get requiredInputs(){return Object.fromEntries(Object.entries(this.codeNodeInputs).filter(t=>!t[1].optional))}get script(){return this.outputs._code?.value??""}set script(t){this.outputs._code&&(this.outputs._code.value=t),this.events.update.emit(null)}get shortId(){return this.id.slice(0,6)}get subgraph(){}get variableName(){return this.state.variableName||this._variableName?this.state.variableName||this._variableName+(this.idxByVariableNames+1):""}set variableName(t){this._variableName=t}getConnectedNodeByInterface(t,n){const s=this.getConnectedNodesByInterface(t,n);return s.length>0?s[0]:null}getConnectedNodes(t){let n=[];if(t!=="inputs"){const s=this.graph.connections.filter(a=>a.from.name!=="_code").filter(a=>a.from.nodeId===this.id).map(a=>a.to.nodeId);s&&(n=n.concat(s))}if(t!=="outputs"){const s=this.graph.connections.filter(a=>a.from.name!=="_code").filter(a=>a.to.nodeId===this.id).map(a=>a.from.nodeId);s&&(n=n.concat(s))}return!n||n.length==0?[]:n.map(s=>this.graph.findNodeById(s))}getConnectedNodesByInterface(t,n){let s=[];if(n!=="outputs"&&this.inputs[t]){const a=this.graph.connections.filter(o=>o.to.id===this.inputs[t]?.id||o.from.id===this.inputs[t]?.id).map(o=>o.from.nodeId);a&&(s=s.concat(a))}if(n!=="inputs"&&this.outputs[t]){const a=this.graph.connections.filter(o=>o.from.id===this.outputs[t]?.id||o.from.id===this.outputs[t]?.id).map(o=>o.to.nodeId);a&&(s=s.concat(a))}return!s||s.length==0?[]:s.map(a=>this.graph.findNodeById(a))}remove(){this.graph?.removeNode(this)}renderCode(t){return Object.keys(t.inputs).filter(n=>Array.isArray(t.inputs[n])&&n!=="_code").forEach(n=>{const s=[...t.inputs[n]];s.reverse(),t.inputs[n]=`[${s.join(", ")}]`}),Le.render(this.state.codeTemplate,t)}updateCodeTemplate(){this.state.codeTemplate=this.codeTemplate.call(this)}updateModules(t){if(t)this.state.modules=t;else if(this.type.includes(".")){const n=this.type.split(".");this.state.modules.push(n.slice(0,n.length-1).join("."))}}updateOutputNames(){Object.values(this.codeNodeOutputs).forEach(t=>{t.name=this.state.integrated?"":this.variableName+t.suffix})}updateOutputValues(t){Object.keys(this.outputs).forEach(n=>{n!=="_code"&&(t[n]=this.state.integrated?t._code:this.outputs[n].name)})}updateProps(t){this.state.props=t}updateInputValues(t){const n=Object.keys(this.inputs);Object.keys(t).forEach(s=>{!n.includes(s)||!this.inputs[s]||(this.inputs[s].value=t[s],this.inputs[s].setHidden(!1))})}}class pt extends zt{calculate=(t,n)=>{const s={};return this.lockCode||(s._code=this.renderCode({inputs:t,...n})),this.updateOutputValues(s),s};executeFactory(t,n){Object.keys(n||{}).forEach(s=>{const a=n[s]();t==="input"?this.addInput(s,a):this.addOutput(s,a)})}load(t){super.load(t),this.afterLoaded()}}const ws=(e,t=!0)=>{const n=[],s=Object.keys(e);return s.forEach(a=>{if(e[a]?.hidden)return;const i=t&&n.length<s.indexOf(a)?`${a}=`:"";n.push(`${i}{{ inputs.${a} }}`)}),n},vs=(e,t)=>{switch(e){case"CheckBoxInterface":return new Cs(t.id,!!t.value);case"IntegerInterface":return new en(t.id,Number(t.value),t.min,t.max);case"ListInputInterface":return new Ms(t.id,String(t.value));case"NumberInterface":return new tn(t.id,Number(t.value),t.min,t.max);case"SelectInterface":return new Os(t.id,t.value,t.items);case"SliderInterface":return new Es(t.id,Number(t.value),t.min,t.max);case"TupleInputInterface":return new Ts(t.id,String(t.value));default:return new sn(t.id,String(t.value))}},qt=new G.NodeInterfaceType("boolean"),Ns=new G.NodeInterfaceType("dict"),Zt=new G.NodeInterfaceType("list"),se=new G.NodeInterfaceType("node"),Kt=new G.NodeInterfaceType("number"),Xt=new G.NodeInterfaceType("string"),Jt=new G.NodeInterfaceType("tuple"),pi=e=>{new G.BaklavaInterfaceTypes(e.editor,{viewPlugin:e}).addTypes(qt,Ns,Zt,se,Kt,Xt,Jt)};class Q extends Z.NodeInterface{component=r.markRaw(ht);isCodeNode=!0;code;componentName="";state=r.reactive({optional:!1});type=null;get optional(){return this.state.optional}get shortId(){return this.id.slice(0,6)}getValue=()=>`${this.value??"None"}`;load(t){this.id=t.id,this.templateId=t.templateId,!["_code","out"].includes(this.name)&&(this.value=t.value,this.hidden=t.hidden,t.component&&(this.componentName=t.component),t.optional&&(this.state.optional=t.optional),this.hooks.load.execute(t))}save(){const t={id:this.id,templateId:this.templateId,value:""};return["_code","out"].includes(this.name)||(t.value=this.value,t.hidden=this.hidden,this.componentName&&(t.component=this.componentName),this.state.optional&&(t.optional=this.state.optional)),this.hooks.save.execute(t)}setOptional(t){return this.state.optional=t,this.setHidden(t),this}}class Ae extends Q{component=r.markRaw(ht);constructor(t="",n){super(t,n),this.use(O.displayInSidebar,!0)}get value(){return super.value}set value(t){super.value=t,this.name!=="_code"&&this.setHidden(!1)}}class Cs extends Ae{component=r.markRaw(O.CheckboxInterfaceComponent);componentName="CheckboxInterface";constructor(t,n){super(t,n),this.use(G.setType,qt)}getValue=()=>this.value?"True":"False"}class Ss extends Q{component=r.markRaw(ht);isCodeNodeOutput=!0;suffix="";constructor(t="",n=""){super(t,""),this.suffix=n}get codeValue(){return this.node?.outputs._code?.value??""}get node(){const{graph:t}=O.useGraph();return t.value.findNodeById(this.nodeId)}}class Qt extends Ae{min;max;constructor(t,n,s,a){super(t,n),this.min=s,this.max=a,this.use(G.setType,Kt)}validate(t){return(this.min===void 0||t>=this.min)&&(this.max===void 0||t<=this.max)}}class en extends Qt{component=r.markRaw(O.IntegerInterfaceComponent);componentName="IntegerInterface";validate(t){return Number.isInteger(t)&&super.validate(t)}}class Ms extends Ae{component=r.markRaw(ft);componentName="ListInputInterface";constructor(t,n=""){super(t,n),this.use(G.setType,Zt)}getValue=()=>`[${this.value}]`}class tn extends Qt{component=r.markRaw(O.NumberInterfaceComponent);componentName="NumberInterface"}class nn extends Ae{constructor(t,n){super(t,n),this.use(G.setType,Xt)}getValue=()=>`"${this.value}"`}class Os extends nn{component=r.markRaw(ks);componentName="SelectInterface";items=[];constructor(t,n,s){super(t,n),s&&(this.items=s)}}class Es extends Qt{component=r.markRaw(O.SliderInterfaceComponent);componentName="SliderInterface";min=0;max=1;getValue=()=>`${Math.round(this.value*1e3)/1e3}`}class sn extends nn{component=r.markRaw(ft)}class mi extends nn{component=r.markRaw(bs)}class Ts extends Ae{component=r.markRaw(ft);componentName="TupleInputInterface";constructor(t,n=""){super(t,n),this.use(G.setType,Jt)}getValue=()=>`(${this.value})`}function _i(e){return class extends pt{type=e.type;inputs={};outputs={};constructor(){super(),this._title=e.title??e.type,this.executeFactory("input",e.inputs),this.executeFactory("output",e.outputs),e.calculate&&(this.calculate=(t,n)=>e.calculate.call(this,t,n)),e.onCreate?.call(this),this.name=e.name??e.type,this.updateModules(e.modules),e.codeTemplate&&(this.codeTemplate=e.codeTemplate),e.variableName!=null&&(this.variableName=e.variableName),this.addInput("_code",new Q("_code",[]).use(G.setTypeForMultipleConnections,se).use(ye.allowMultipleConnections).setHidden(!0)),this.addOutput("_code",new Q("_code",[]).use(G.setTypeForMultipleConnections,se).use(ye.allowMultipleConnections).setHidden(!0))}afterGraphLoaded(){e.afterGraphLoaded?.call(this)}afterLoaded(){e.afterLoaded?.call(this)}beforeRun(){e.beforeRun?.call(this)}onPlaced(){e.onPlaced?.call(this)}onConnected(){e.onConnected?.call(this)}onDestroy(){e.onDestroy?.call(this)}onUnconnected(){e.onUnconnected?.call(this)}update(){e.update?.call(this)}}}class Is extends pt{}function yi(e){return class extends Is{type=e.type;inputs={};outputs={};preventUpdate=!1;staticInputKeys=Object.keys(e.inputs??{});staticOutputKeys=Object.keys(e.outputs??{});constructor(){super(),this._title=e.title??e.type,this.executeFactory("input",e.inputs),this.executeFactory("output",e.outputs),e.calculate&&(this.calculate=(t,n)=>e.calculate?.call(this,t,n)),e.onCreate?.call(this),this.name=e.name??e.type,this.updateModules(e.modules),e.codeTemplate&&(this.codeTemplate=e.codeTemplate),e.variableName&&(this.variableName=e.variableName),this.addInput("_code",new Q("_code",[]).use(G.setTypeForMultipleConnections,se).use(ye.allowMultipleConnections).setHidden(!0)),this.addOutput("_code",new Q("_code",[]).use(G.setTypeForMultipleConnections,se).use(ye.allowMultipleConnections).setHidden(!0)),this.staticInputKeys.push("_code"),this.staticOutputKeys.push("_code")}afterGraphLoaded(){e.afterGraphLoaded?.call(this)}afterLoaded(){e.afterLoaded?.call(this)}beforeRun(){e.beforeRun?.call(this)}onPlaced(){this.events.update.subscribe(this,t=>{t&&(t.type==="input"&&this.staticInputKeys.includes(t.name)||t.type==="output"&&this.staticOutputKeys.includes(t.name))&&this.onUpdate()}),this.onUpdate(),e.onPlaced?.call(this)}onConnected(){e.onConnected?.call(this)}onDestroy(){e.onDestroy?.call(this)}onUnconnected(){e.onUnconnected?.call(this)}update(){e.update?.call(this)}load(t){this.preventUpdate=!0,this.hooks.beforeLoad.execute(t),this.id=t.id,this.title=t.title;for(const n of this.staticInputKeys)this.inputs[n].load(t.inputs[n]),this.inputs[n].nodeId=this.id;for(const n of this.staticOutputKeys)this.outputs[n].load(t.outputs[n]),this.outputs[n].nodeId=this.id;this.preventUpdate=!1,this.onUpdate(),this.preventUpdate=!0;for(const n of Object.keys(t.inputs))if(!(this.staticInputKeys.includes(n)||!t.inputs[n])){if(!this.inputs[n]){const s=t.inputs[n],a=s.value;let o;s.component?o=vs(s.component,{...s,id:n}):typeof a=="number"?0<a&&a<1?o=new tn(n,Number(a)):o=new en(n,Number(a)):o=new sn(n,String(a)),o.use(O.displayInSidebar,!0),this.addInput(n,o)}this.inputs[n]&&(this.inputs[n].load(t.inputs[n]),this.inputs[n].nodeId=this.id)}for(const n of Object.keys(t.outputs))if(!(this.staticOutputKeys.includes(n)||!t.outputs[n])){if(!this.outputs[n]){const s=new Ss(n);this.addOutput(n,s)}this.outputs[n]&&(this.outputs[n].load(t.outputs[n]),this.outputs[n].nodeId=this.id)}this.preventUpdate=!1,this.events.loaded.emit(this)}onUpdate(){if(!e.onUpdate||this.preventUpdate)return;this.graph&&this.graph.activeTransactions++;const t=this.getStaticValues(this.staticInputKeys,this.inputs),n=this.getStaticValues(this.staticOutputKeys,this.outputs),s=e.onUpdate.call(this,t,n);this.updateInterfaces("input",s.inputs??{},s.forceUpdateInputs??[]),this.updateInterfaces("output",s.outputs??{},s.forceUpdateOutputs??[]),this.graph&&this.graph.activeTransactions--}getStaticValues(t,n){const s={};for(const a of t)s[a]=n[a].value;return s}updateInputInterfaces(t={},n=[]){this.updateInterfaces("input",t,n)}updateInterfaces(t,n={},s=[]){const a=t==="input"?this.staticInputKeys:this.staticOutputKeys,o=t==="input"?this.inputs:this.outputs;for(const i of Object.keys(o))a.includes(i)||n[i]&&!s.includes(i)||(t==="input"?this.removeInput(i):this.removeOutput(i));for(const i of Object.keys(n)){if(o[i])continue;const l=n[i]();t==="input"?this.addInput(i,l):this.addOutput(i,l)}}updateProps(t){this.state.props=t,this.onUpdate()}}}Le.escape=e=>e;class mt{_id;_state;viewModel;constructor(){this._id=De.v4(),this._state=r.reactive({lockCode:!1,modules:{},script:"",template:""})}get engine(){return this.viewModel?.engine}get graph(){return this.viewModel?.editor.graph}get id(){return this._id}get lockCode(){return this.state.lockCode}set lockCode(t){this.state.lockCode=t}get modules(){const t=[];return this.graph?.codeNodes.filter(n=>n.state.modules?.length>0).forEach(n=>t.push(...n.state.modules)),t?(t.sort(),Array.from(new Set(t.map(n=>this.state.modules[n])))):[]}get script(){return this.state.script}set script(t){this.state.script=t}get shortId(){return this.id.slice(0,6)}get state(){return this._state}clear(){this.state.script=""}async loadTemplate(t){t.then(n=>{this._state.template=n.default??""})}registerViewModel(t){this.viewModel=t}renderCode(t){this.state.script=Le.render(this.state.template??"",t??{})}}class gi extends mt{constructor(){super(),this.loadTemplate(Promise.resolve().then(()=>Ru))}}class ki extends mt{constructor(){super(),this.loadTemplate(Promise.resolve().then(()=>Bu))}}const _t=350;class $e extends Z.Graph{code=null;editor;_state=r.reactive({codeTemplate:"{{ #nodes }}{{ script }}{{ /nodes }}",lockCode:!1});constructor(t,n){super(t,n),this.editor=t,this.template=n,t.code&&(this.code=t.code)}get codeNodes(){return an(this)}get connections(){return super.connections}set connections(t){this._connections=t}get nodeIds(){return this.nodes.map(t=>t.id)}get nodes(){return super.nodes}set nodes(t){this._nodes=t}get scriptedCodeNodes(){return this.nodes.filter(t=>!t.state?.integrated)}get selectedNodeIds(){return this.selectedNodes.map(t=>t.id)}get shortId(){return this.id.slice(0,6)}get state(){return this._state}get visibleNodes(){return this.nodes.filter(t=>!t.state?.hidden)}addNode(t,n){return t.state&&n&&(t.state.props=n),super.addNode(t)}addNodeAtCoordinates=(t,n={x:0,y:0},s)=>(this.addNode(t,s),t.position&&(t.position=n),t);addConnection(t,n){t&&t?.name!=="_code"&&(t.hidden=!1),n&&n?.name!=="_code"&&(n.hidden=!1),super.addConnection(t,n)}beforeRun(){this.nodes.forEach(t=>t.beforeRun())}clear(){this.selectedNodes=[],this._nodes=[],this._connections=[]}findNodeByType(t){return this.nodes.find(n=>n.type===t)}getNodesByType(t){return this.nodes.filter(n=>n.type===t)}getNodesByVariableName(t){return this.nodes.filter(n=>[n.state.variableName,n._variableName].includes(t))}hasConnection(t,n){return this.connections.some(s=>s.from.id===t.id&&s.to.id===n.id)}load(t){const n=super.load(t);return this.nodes.forEach(s=>s.afterGraphLoaded()),n}renderCode(t){return Le.render(this.state?.codeTemplate||"",t)}sortNodes(){if(!(this.nodes.length===0||this.connections.length===0))try{let t=this.nodeIds;const n=this.connections.filter(o=>t.includes(o.to.nodeId)&&t.includes(o.from.nodeId)).map(o=>[o.to.nodeId,o.from.nodeId]);t.reverse(),t=$a.array(t,n),t.reverse();const s=this.nodes.map(o=>o.id).filter(o=>!t.includes(o));t=[...t,...s];const a=t.map(o=>this.findNodeById(o));a&&(this.nodes=a)}catch{console.warn("Failed to sort nodes.")}}sortNodesByRank(){if(this.nodes.length===0)return;const t=new Map;this.nodes.forEach(s=>{const a=this.editor.nodeTypes.get(s.type).orderRank;t.has(a)?t.set(a,[...t.get(a),s]):t.set(a,[s])});const n=Array.from(t.keys());n.sort((s,a)=>s-a),this.nodes=n.flatMap(s=>t.get(s))}}const an=e=>{const t=[];return e.nodes.length===0||e.nodes.forEach(n=>{n&&(n.hasOwnProperty("subgraph")?t.push(...an(n.subgraph)):n.hasOwnProperty("isCodeNode")&&t.push(n))}),t},bi=(e=0,t=100)=>({x:e*(_t+70),y:t}),wi=e=>{const t={...e.position};return t.x-=_t+70,t.y+=50,t},rn="__baklava_SubgraphInputNode",on="__baklava_SubgraphOutputNode";class xs extends pt{graphInterfaceId;constructor(){super(),this.graphInterfaceId=De.v4()}onPlaced(){super.onPlaced(),this.initializeIo()}load(t){super.load(t),this.graphInterfaceId=t.graphInterfaceId}save(){return{...super.save(),graphInterfaceId:this.graphInterfaceId}}update(){}}class ln extends xs{static isGraphInputNode(t){return t.type===rn}type=rn;inputs={name:new Z.NodeInterface("Name","Input")};outputs={placeholder:new Z.NodeInterface("Value",void 0)}}class dn extends xs{static isGraphOutputNode(t){return t.type===on}type=on;inputs={name:new Z.NodeInterface("Name","Output"),placeholder:new Z.NodeInterface("Value",void 0)};outputs={output:new Z.NodeInterface("Output",void 0).setHidden(!0)};calculate=({placeholder:t})=>({output:t})}const vi=["component","connectionCount","events","hidden","hooks","id","isCodeNode","isInput","name","nodeId","port","templateId","value"];function Ds(e){return class extends zt{type=Z.getGraphNodeTypeString(e);get title(){return this._title}set title(n){this.template.name=n}inputs={};outputs={};template=e;subgraph;afterGraphLoaded(){}afterLoaded(){}beforeRun(){}onConnected(){}onUnconnected(){}update(){}calculate=async(n,s)=>{if(!this.subgraph)throw new Error(`GraphNode ${this.id}: calculate called without subgraph being initialized`);if(!s.engine||typeof s.engine!="object")throw new Error(`GraphNode ${this.id}: calculate called but no engine provided in context`);const a=s.engine.getInputValues(this.subgraph);for(const l of this.subgraph.inputs)a.set(l.nodeInterfaceId,n[l.id]);const o=await s.engine.runGraph(this.subgraph,a,s.globalValues);s.engine.pause(),ye.applyResult(o,s.engine.editor),s.engine.resume();const i={};for(const l of this.subgraph.outputs)i[l.id]=o.get(l.nodeId)?.get("output");return i._calculationResults=o,this.lockCode||(i._code=this.renderCode({inputs:n,...s.globalValues})),this.updateOutputValues(i),i};load(n){if(!this.subgraph)throw new Error("Cannot load a graph node without a graph");if(!this.template)throw new Error("Unable to load graph node without graph template");this.subgraph.load(n.graphState),super.load(n)}save(){if(!this.subgraph)throw new Error("Cannot save a graph node without a graph");return{...super.save(),graphState:this.subgraph.save()}}onPlaced(){this.template.events.updated.subscribe(this,()=>this.initialize()),this.template.events.nameChanged.subscribe(this,n=>{this._title=n}),this.initialize()}onDestroy(){this.template.events.updated.unsubscribe(this),this.template.events.nameChanged.unsubscribe(this),this.subgraph?.destroy()}initialize(){this.subgraph&&this.subgraph.destroy(),this.subgraph=this.template.createGraph(),this._title=this.template.name,this.updateInterfaces(),this.state.codeTemplate=`{{ #nodes }}{{ script }}
|
|
2
|
-
{{ /nodes }}`,this.events.update.emit(null)}renderCode(n){return this.subgraph?this.subgraph.renderCode({nodes:this.subgraph.scriptedCodeNodes}):
|
|
3
|
-
|
|
4
|
-
This is likely an internal issue. Please report it on GitHub.`);return t.get(n)}}var Bs;function _(){return Bs.apply(null,arguments)}function Ei(e){Bs=e}function ie(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function Ye(e){return e!=null&&Object.prototype.toString.call(e)==="[object Object]"}function B(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function cn(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;var t;for(t in e)if(B(e,t))return!1;return!0}function ee(e){return e===void 0}function ge(e){return typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]"}function Je(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function Vs(e,t){var n=[],s,a=e.length;for(s=0;s<a;++s)n.push(t(e[s],s));return n}function Te(e,t){for(var n in t)B(t,n)&&(e[n]=t[n]);return B(t,"toString")&&(e.toString=t.toString),B(t,"valueOf")&&(e.valueOf=t.valueOf),e}function he(e,t,n,s){return da(e,t,n,s,!0).utc()}function Ti(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function T(e){return e._pf==null&&(e._pf=Ti()),e._pf}var un;Array.prototype.some?un=Array.prototype.some:un=function(e){var t=Object(this),n=t.length>>>0,s;for(s=0;s<n;s++)if(s in t&&e.call(this,t[s],s,t))return!0;return!1};function hn(e){var t=null,n=!1,s=e._d&&!isNaN(e._d.getTime());if(s&&(t=T(e),n=un.call(t.parsedDateParts,function(a){return a!=null}),s=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n),e._strict&&(s=s&&t.charsLeftOver===0&&t.unusedTokens.length===0&&t.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(e))e._isValid=s;else return s;return e._isValid}function yt(e){var t=he(NaN);return e!=null?Te(T(t),e):T(t).userInvalidated=!0,t}var Ps=_.momentProperties=[],fn=!1;function pn(e,t){var n,s,a,o=Ps.length;if(ee(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),ee(t._i)||(e._i=t._i),ee(t._f)||(e._f=t._f),ee(t._l)||(e._l=t._l),ee(t._strict)||(e._strict=t._strict),ee(t._tzm)||(e._tzm=t._tzm),ee(t._isUTC)||(e._isUTC=t._isUTC),ee(t._offset)||(e._offset=t._offset),ee(t._pf)||(e._pf=T(t)),ee(t._locale)||(e._locale=t._locale),o>0)for(n=0;n<o;n++)s=Ps[n],a=t[s],ee(a)||(e[s]=a);return e}function Qe(e){pn(this,e),this._d=new Date(e._d!=null?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),fn===!1&&(fn=!0,_.updateOffset(this),fn=!1)}function le(e){return e instanceof Qe||e!=null&&e._isAMomentObject!=null}function Ls(e){_.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+e)}function ae(e,t){var n=!0;return Te(function(){if(_.deprecationHandler!=null&&_.deprecationHandler(null,e),n){var s=[],a,o,i,l=arguments.length;for(o=0;o<l;o++){if(a="",typeof arguments[o]=="object"){a+=`
|
|
5
|
-
[`+o+"] ";for(i in arguments[0])B(arguments[0],i)&&(a+=i+": "+arguments[0][i]+", ");a=a.slice(0,-2)}else a=arguments[o];s.push(a)}Ls(e+`
|
|
1
|
+
(function(m,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("@baklavajs/renderer-vue"),require("@baklavajs/core"),require("@vueuse/core"),require("mustache"),require("uuid"),require("@baklavajs/interface-types"),require("@baklavajs/engine"),require("toposort"),require("@baklavajs/events")):typeof define=="function"&&define.amd?define(["exports","vue","@baklavajs/renderer-vue","@baklavajs/core","@vueuse/core","mustache","uuid","@baklavajs/interface-types","@baklavajs/engine","toposort","@baklavajs/events"],r):(m=typeof globalThis<"u"?globalThis:m||self,r(m["@babsey/code-graph"]={},m.vue,m["@baklavajs/renderer-vue"],m["@baklavajs/core"],m["@vueuse/core"],m.mustache,m.uuid,m["@baklavajs/interface-types"],m["@baklavajs/engine"],m.toposort,m["@baklavajs/events"]))})(this,(function(m,r,T,re,Qn,Ve,Ie,X,Ze,Ha,es){"use strict";const j=(e,t)=>{const n=e.__vccOpts||e;for(const[s,a]of t)n[s]=a;return n},Ga={},za={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-check"};function qa(e,t){return r.openBlock(),r.createElementBlock("svg",za,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)])])}const ts=j(Ga,[["render",qa]]),Za={},Ka={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-chevron-down"};function Xa(e,t){return r.openBlock(),r.createElementBlock("svg",Ka,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none",style:{fill:"none",stroke:"none"}},null,-1),r.createElementVNode("path",{d:"M6 9l6 6l6 -6",fill:"none",style:{fill:"none"}},null,-1)])])}const ns=j(Za,[["render",Xa]]),Ja={},Qa={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-code-variable"};function er(e,t){return r.openBlock(),r.createElementBlock("svg",Qa,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M4 8m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z"},null,-1)])])}const ss=j(Ja,[["render",er]]),tr={},nr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-copy"};function sr(e,t){return r.openBlock(),r.createElementBlock("svg",nr,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z"},null,-1),r.createElementVNode("path",{d:"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1"},null,-1)])])}const as=j(tr,[["render",sr]]),ar={},rr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-dots-vertical"};function or(e,t){return r.openBlock(),r.createElementBlock("svg",rr,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),r.createElementVNode("path",{d:"M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),r.createElementVNode("path",{d:"M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1)])])}const rs=j(ar,[["render",or]]),ir={},lr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-download"};function dr(e,t){return r.openBlock(),r.createElementBlock("svg",lr,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),r.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),r.createElementVNode("path",{d:"M12 4l0 12"},null,-1)])])}const os=j(ir,[["render",dr]]),cr={},ur={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",class:"baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-left-collapse"};function hr(e,t){return r.openBlock(),r.createElementBlock("svg",ur,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M18 3a3 3 0 0 1 2.995 2.824l.005 .176v12a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-12a3 3 0 0 1 2.824 -2.995l.176 -.005h12zm0 2h-9v14h9a1 1 0 0 0 .993 -.883l.007 -.117v-12a1 1 0 0 0 -.883 -.993l-.117 -.007zm-2.293 4.293a1 1 0 0 1 .083 1.32l-.083 .094l-1.292 1.293l1.292 1.293a1 1 0 0 1 .083 1.32l-.083 .094a1 1 0 0 1 -1.32 .083l-.094 -.083l-2 -2a1 1 0 0 1 -.083 -1.32l.083 -.094l2 -2a1 1 0 0 1 1.414 0z"},null,-1)])])}const fr=j(cr,[["render",hr]]),pr={},mr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",class:"baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-left-expand"};function yr(e,t){return r.openBlock(),r.createElementBlock("svg",mr,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M18 3a3 3 0 0 1 2.995 2.824l.005 .176v12a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-12a3 3 0 0 1 2.824 -2.995l.176 -.005h12zm0 2h-9v14h9a1 1 0 0 0 .993 -.883l.007 -.117v-12a1 1 0 0 0 -.883 -.993l-.117 -.007zm-4.387 4.21l.094 .083l2 2a1 1 0 0 1 .083 1.32l-.083 .094l-2 2a1 1 0 0 1 -1.497 -1.32l.083 -.094l1.292 -1.293l-1.292 -1.293a1 1 0 0 1 -.083 -1.32l.083 -.094a1 1 0 0 1 1.32 -.083z"},null,-1)])])}const _r=j(pr,[["render",yr]]),gr={},kr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",class:"baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-right"};function br(e,t){return r.openBlock(),r.createElementBlock("svg",kr,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M6 21a3 3 0 0 1 -3 -3v-12a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3zm8 -16h-8a1 1 0 0 0 -1 1v12a1 1 0 0 0 1 1h8z"},null,-1)])])}const wr=j(gr,[["render",br]]),vr={},Nr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",class:"baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-right-collapse"};function Cr(e,t){return r.openBlock(),r.createElementBlock("svg",Nr,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M18 3a3 3 0 0 1 2.995 2.824l.005 .176v12a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-12a3 3 0 0 1 2.824 -2.995l.176 -.005h12zm-3 2h-9a1 1 0 0 0 -.993 .883l-.007 .117v12a1 1 0 0 0 .883 .993l.117 .007h9v-14zm-5.387 4.21l.094 .083l2 2a1 1 0 0 1 .083 1.32l-.083 .094l-2 2a1 1 0 0 1 -1.497 -1.32l.083 -.094l1.292 -1.293l-1.292 -1.293a1 1 0 0 1 -.083 -1.32l.083 -.094a1 1 0 0 1 1.32 -.083z"},null,-1)])])}const is=j(vr,[["render",Cr]]),Sr={},Mr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",class:"baklava-icon icon icon-tabler icons-tabler-filled icon-tabler-layout-sidebar-right-expand"};function Or(e,t){return r.openBlock(),r.createElementBlock("svg",Mr,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M18 3a3 3 0 0 1 2.995 2.824l.005 .176v12a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-12a3 3 0 0 1 2.824 -2.995l.176 -.005h12zm-3 2h-9a1 1 0 0 0 -.993 .883l-.007 .117v12a1 1 0 0 0 .883 .993l.117 .007h9v-14zm-3.293 4.293a1 1 0 0 1 .083 1.32l-.083 .094l-1.292 1.293l1.292 1.293a1 1 0 0 1 .083 1.32l-.083 .094a1 1 0 0 1 -1.32 .083l-.094 -.083l-2 -2a1 1 0 0 1 -.083 -1.32l.083 -.094l2 -2a1 1 0 0 1 1.414 0z"},null,-1)])])}const jt=j(Sr,[["render",Or]]),Er={},Tr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-lock-code"};function Ir(e,t){return r.openBlock(),r.createElementBlock("svg",Tr,[...t[0]||(t[0]=[r.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M11.5 21h-4.5a2 2 0 0 1 -2 -2v-6a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2"></path><path d="M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0"></path><path d="M8 11v-4a4 4 0 1 1 8 0v4"></path><path d="M20 21l2 -2l-2 -2"></path><path d="M17 17l-2 2l2 2"></path>',6)])])}const Ht=j(Er,[["render",Ir]]),Dr={},xr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-player-play"};function Yr(e,t){return r.openBlock(),r.createElementBlock("svg",xr,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M7 4v16l13 -8z"},null,-1)])])}const Rr=j(Dr,[["render",Yr]]),Br={},Vr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-plus"};function Pr(e,t){return r.openBlock(),r.createElementBlock("svg",Vr,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M12 5l0 14"},null,-1),r.createElementVNode("path",{d:"M5 12l14 0"},null,-1)])])}const ls=j(Br,[["render",Pr]]),Lr={},Ar={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-restore"};function $r(e,t){return r.openBlock(),r.createElementBlock("svg",Ar,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M3.06 13a9 9 0 1 0 .49 -4.087"},null,-1),r.createElementVNode("path",{d:"M3 4.001v5h5"},null,-1),r.createElementVNode("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1)])])}const ds=j(Lr,[["render",$r]]),Ur={},Fr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-schema"};function Wr(e,t){return r.openBlock(),r.createElementBlock("svg",Fr,[...t[0]||(t[0]=[r.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M5 2h5v4h-5z"></path><path d="M15 10h5v4h-5z"></path><path d="M5 18h5v4h-5z"></path><path d="M5 10h5v4h-5z"></path><path d="M10 12h5"></path><path d="M7.5 6v4"></path><path d="M7.5 14v4"></path>',8)])])}const cs=j(Ur,[["render",Wr]]),jr={},Hr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-schema-off"};function Gr(e,t){return r.openBlock(),r.createElementBlock("svg",Hr,[...t[0]||(t[0]=[r.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M6 2h4v4m-4 0h-1v-1"></path><path d="M15 11v-1h5v4h-2"></path><path d="M5 18h5v4h-5z"></path><path d="M5 10h5v4h-5z"></path><path d="M10 12h2"></path><path d="M7.5 7.5v2.5"></path><path d="M7.5 14v4"></path><path d="M3 3l18 18"></path>',9)])])}const us=j(jr,[["render",Gr]]),zr={},qr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-transition-bottom"};function Zr(e,t){return r.openBlock(),r.createElementBlock("svg",qr,[...t[0]||(t[0]=[r.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M21 18a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3"></path><path d="M3 3m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v0a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z"></path><path d="M12 9v8"></path><path d="M9 14l3 3l3 -3"></path>',5)])])}const hs=j(zr,[["render",Zr]]),Kr={},Xr={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-upload"};function Jr(e,t){return r.openBlock(),r.createElementBlock("svg",Xr,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),r.createElementVNode("path",{d:"M7 9l5 -5l5 5"},null,-1),r.createElementVNode("path",{d:"M12 4l0 12"},null,-1)])])}const fs=j(Kr,[["render",Jr]]),Qr={},eo={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"baklava-icon icon icon-tabler icons-tabler-outline icon-tabler-x"};function to(e,t){return r.openBlock(),r.createElementBlock("svg",eo,[...t[0]||(t[0]=[r.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),r.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),r.createElementVNode("path",{d:"M6 6l12 12"},null,-1)])])}const ps=j(Qr,[["render",to]]),no=Object.freeze(Object.defineProperty({__proto__:null,Check:ts,ChevronDown:ns,CodeVariable:ss,Copy:as,DotsVertical:rs,Download:os,LayoutSidebarLeftCollapse:fr,LayoutSidebarLeftExpand:_r,LayoutSidebarRight:wr,LayoutSidebarRightCollapse:is,LayoutSidebarRightExpand:jt,LockCode:Ht,PlayerPlay:Rr,Plus:ls,Restore:ds,Schema:cs,SchemaOff:us,TransitionBottom:hs,Upload:fs,X:ps},Symbol.toStringTag,{value:"Module"}));function so(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ht={exports:{}};var ao=ht.exports,ms;function ro(){return ms||(ms=1,(function(e,t){(function(s,a){e.exports=a()})(ao,function(){return(function(){var n={686:(function(o,i,l){l.d(i,{default:function(){return G}});var d=l(279),c=l.n(d),u=l(370),_=l.n(u),p=l(817),I=l.n(p);function k(w){try{return document.execCommand(w)}catch{return!1}}var S=function(N){var v=I()(N);return k("cut"),v},f=S;function b(w){var N=document.documentElement.getAttribute("dir")==="rtl",v=document.createElement("textarea");v.style.fontSize="12pt",v.style.border="0",v.style.padding="0",v.style.margin="0",v.style.position="absolute",v.style[N?"right":"left"]="-9999px";var O=window.pageYOffset||document.documentElement.scrollTop;return v.style.top="".concat(O,"px"),v.setAttribute("readonly",""),v.value=w,v}var A=function(N,v){var O=b(N);v.container.appendChild(O);var D=I()(O);return k("copy"),O.remove(),D},R=function(N){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},O="";return typeof N=="string"?O=A(N,v):N instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(N?.type)?O=A(N.value,v):(O=I()(N),k("copy")),O},W=R;function Se(w){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Se=function(v){return typeof v}:Se=function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},Se(w)}var Me=function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},v=N.action,O=v===void 0?"copy":v,D=N.container,B=N.target,ce=N.text;if(O!=="copy"&&O!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(B!==void 0)if(B&&Se(B)==="object"&&B.nodeType===1){if(O==="copy"&&B.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(O==="cut"&&(B.hasAttribute("readonly")||B.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if(ce)return W(ce,{container:D});if(B)return O==="cut"?f(B):W(B,{container:D})},ct=Me;function me(w){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?me=function(v){return typeof v}:me=function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},me(w)}function M(w,N){if(!(w instanceof N))throw new TypeError("Cannot call a class as a function")}function Z(w,N){for(var v=0;v<N.length;v++){var O=N[v];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(w,O.key,O)}}function ee(w,N,v){return N&&Z(w.prototype,N),v&&Z(w,v),w}function Xn(w,N){if(typeof N!="function"&&N!==null)throw new TypeError("Super expression must either be null or a function");w.prototype=Object.create(N&&N.prototype,{constructor:{value:w,writable:!0,configurable:!0}}),N&&ut(w,N)}function ut(w,N){return ut=Object.setPrototypeOf||function(O,D){return O.__proto__=D,O},ut(w,N)}function $t(w){var N=Ft();return function(){var O=Be(w),D;if(N){var B=Be(this).constructor;D=Reflect.construct(O,arguments,B)}else D=O.apply(this,arguments);return Ut(this,D)}}function Ut(w,N){return N&&(me(N)==="object"||typeof N=="function")?N:Jn(w)}function Jn(w){if(w===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w}function Ft(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Be(w){return Be=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},Be(w)}function qe(w,N){var v="data-clipboard-".concat(w);if(N.hasAttribute(v))return N.getAttribute(v)}var $=(function(w){Xn(v,w);var N=$t(v);function v(O,D){var B;return M(this,v),B=N.call(this),B.resolveOptions(D),B.listenClick(O),B}return ee(v,[{key:"resolveOptions",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof D.action=="function"?D.action:this.defaultAction,this.target=typeof D.target=="function"?D.target:this.defaultTarget,this.text=typeof D.text=="function"?D.text:this.defaultText,this.container=me(D.container)==="object"?D.container:document.body}},{key:"listenClick",value:function(D){var B=this;this.listener=_()(D,"click",function(ce){return B.onClick(ce)})}},{key:"onClick",value:function(D){var B=D.delegateTarget||D.currentTarget,ce=this.action(B)||"copy",Wt=ct({action:ce,container:this.container,target:this.target(B),text:this.text(B)});this.emit(Wt?"success":"error",{action:ce,text:Wt,trigger:B,clearSelection:function(){B&&B.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(D){return qe("action",D)}},{key:"defaultTarget",value:function(D){var B=qe("target",D);if(B)return document.querySelector(B)}},{key:"defaultText",value:function(D){return qe("text",D)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(D){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return W(D,B)}},{key:"cut",value:function(D){return f(D)}},{key:"isSupported",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],B=typeof D=="string"?[D]:D,ce=!!document.queryCommandSupported;return B.forEach(function(Wt){ce=ce&&!!document.queryCommandSupported(Wt)}),ce}}]),v})(c()),G=$}),828:(function(o){var i=9;if(typeof Element<"u"&&!Element.prototype.matches){var l=Element.prototype;l.matches=l.matchesSelector||l.mozMatchesSelector||l.msMatchesSelector||l.oMatchesSelector||l.webkitMatchesSelector}function d(c,u){for(;c&&c.nodeType!==i;){if(typeof c.matches=="function"&&c.matches(u))return c;c=c.parentNode}}o.exports=d}),438:(function(o,i,l){var d=l(828);function c(p,I,k,S,f){var b=_.apply(this,arguments);return p.addEventListener(k,b,f),{destroy:function(){p.removeEventListener(k,b,f)}}}function u(p,I,k,S,f){return typeof p.addEventListener=="function"?c.apply(null,arguments):typeof k=="function"?c.bind(null,document).apply(null,arguments):(typeof p=="string"&&(p=document.querySelectorAll(p)),Array.prototype.map.call(p,function(b){return c(b,I,k,S,f)}))}function _(p,I,k,S){return function(f){f.delegateTarget=d(f.target,I),f.delegateTarget&&S.call(p,f)}}o.exports=u}),879:(function(o,i){i.node=function(l){return l!==void 0&&l instanceof HTMLElement&&l.nodeType===1},i.nodeList=function(l){var d=Object.prototype.toString.call(l);return l!==void 0&&(d==="[object NodeList]"||d==="[object HTMLCollection]")&&"length"in l&&(l.length===0||i.node(l[0]))},i.string=function(l){return typeof l=="string"||l instanceof String},i.fn=function(l){var d=Object.prototype.toString.call(l);return d==="[object Function]"}}),370:(function(o,i,l){var d=l(879),c=l(438);function u(k,S,f){if(!k&&!S&&!f)throw new Error("Missing required arguments");if(!d.string(S))throw new TypeError("Second argument must be a String");if(!d.fn(f))throw new TypeError("Third argument must be a Function");if(d.node(k))return _(k,S,f);if(d.nodeList(k))return p(k,S,f);if(d.string(k))return I(k,S,f);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function _(k,S,f){return k.addEventListener(S,f),{destroy:function(){k.removeEventListener(S,f)}}}function p(k,S,f){return Array.prototype.forEach.call(k,function(b){b.addEventListener(S,f)}),{destroy:function(){Array.prototype.forEach.call(k,function(b){b.removeEventListener(S,f)})}}}function I(k,S,f){return c(document.body,k,S,f)}o.exports=u}),817:(function(o){function i(l){var d;if(l.nodeName==="SELECT")l.focus(),d=l.value;else if(l.nodeName==="INPUT"||l.nodeName==="TEXTAREA"){var c=l.hasAttribute("readonly");c||l.setAttribute("readonly",""),l.select(),l.setSelectionRange(0,l.value.length),c||l.removeAttribute("readonly"),d=l.value}else{l.hasAttribute("contenteditable")&&l.focus();var u=window.getSelection(),_=document.createRange();_.selectNodeContents(l),u.removeAllRanges(),u.addRange(_),d=u.toString()}return d}o.exports=i}),279:(function(o){function i(){}i.prototype={on:function(l,d,c){var u=this.e||(this.e={});return(u[l]||(u[l]=[])).push({fn:d,ctx:c}),this},once:function(l,d,c){var u=this;function _(){u.off(l,_),d.apply(c,arguments)}return _._=d,this.on(l,_,c)},emit:function(l){var d=[].slice.call(arguments,1),c=((this.e||(this.e={}))[l]||[]).slice(),u=0,_=c.length;for(u;u<_;u++)c[u].fn.apply(c[u].ctx,d);return this},off:function(l,d){var c=this.e||(this.e={}),u=c[l],_=[];if(u&&d)for(var p=0,I=u.length;p<I;p++)u[p].fn!==d&&u[p].fn._!==d&&_.push(u[p]);return _.length?c[l]=_:delete c[l],this}},o.exports=i,o.exports.TinyEmitter=i})},s={};function a(o){if(s[o])return s[o].exports;var i=s[o]={exports:{}};return n[o](i,i.exports,a),i.exports}return(function(){a.n=function(o){var i=o&&o.__esModule?function(){return o.default}:function(){return o};return a.d(i,{a:i}),i}})(),(function(){a.d=function(o,i){for(var l in i)a.o(i,l)&&!a.o(o,l)&&Object.defineProperty(o,l,{enumerable:!0,get:i[l]})}})(),(function(){a.o=function(o,i){return Object.prototype.hasOwnProperty.call(o,i)}})(),a(686)})().default})})(ht)),ht.exports}var oo=ro();const io=so(oo),lo=e=>({toClipboard(t,n){return new Promise((s,a)=>{const o=document.createElement("button"),i=new io(o,{text:()=>t,action:()=>"copy",container:n!==void 0?n:document.body});i.on("success",l=>{i.destroy(),s(l)}),i.on("error",l=>{i.destroy(),a(l)}),document.body.appendChild(o),o.click(),document.body.removeChild(o)})}}),co={key:0,class:"baklava-button"},ys=r.defineComponent({__name:"CopyToClipboard",props:{text:String},setup(e){const{toClipboard:t}=lo(),n=e,s=r.toRef(n,"text"),a=r.ref(!1),o=async()=>{try{await t(s.value),a.value=!0,setTimeout(()=>a.value=!1,1500),console.log("Copied to clipboard")}catch(i){console.error(i)}};return(i,l)=>(r.openBlock(),r.createElementBlock("div",null,[a.value?(r.openBlock(),r.createElementBlock("button",co,[r.createVNode(r.unref(ts))])):(r.openBlock(),r.createElementBlock("button",{key:1,onClick:o,class:"baklava-button"},[r.createVNode(r.unref(as))]))]))}}),uo={class:"code-editor"},ho={class:"code-buttons"},fo=r.defineComponent({__name:"CodeEditor",props:r.mergeModels({locked:{type:Boolean},extensions:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:r.mergeModels(["update:locked"],["update:modelValue"]),setup(e,{emit:t}){const n=r.useModel(e,"modelValue"),s=t,a=o=>s("update:locked",o);return(o,i)=>{const l=r.resolveComponent("codemirror");return r.openBlock(),r.createElementBlock("div",uo,[r.createElementVNode("div",ho,[e.locked?(r.openBlock(),r.createElementBlock("button",{key:0,class:"baklava-button",title:"The code is locked.",onClick:i[0]||(i[0]=d=>a(!1))},[r.createVNode(r.unref(Ht))])):r.createCommentVNode("",!0),r.createVNode(ys,{text:e.modelValue},null,8,["text"])]),r.createVNode(l,{modelValue:n.value,"onUpdate:modelValue":i[1]||(i[1]=d=>n.value=d),extensions:e.extensions,class:"codemirror",style:{height:"100%"},onKeydown:i[2]||(i[2]=d=>a(!0))},null,8,["modelValue","extensions"])])}}}),po=r.defineComponent({__name:"CodeGraphEditor",props:{viewModel:{}},setup(e){const t=e,n=r.toRef(t,"viewModel"),s=a=>a.events.update.emit(null);return r.onMounted(n.value.onMounted),r.onBeforeUnmount(n.value.onBeforeUnmount),r.watch(n,(a,o)=>{o&&o.onBeforeUnmount(),a&&a.onMounted()}),(a,o)=>(r.openBlock(),r.createBlock(r.unref(T.BaklavaEditor),{viewModel:n.value},{palette:r.withCtx(()=>[r.createVNode(r.unref(ws))]),node:r.withCtx(i=>[r.createVNode(r.unref(_s),r.mergeProps(i,{onUpdate:l=>s(i.node)}),null,16,["onUpdate"])]),sidebar:r.withCtx(i=>[r.createVNode(r.unref(gs),r.normalizeProps(r.guardReactiveProps(i)),{codeEditor:r.withCtx(({node:l})=>[r.renderSlot(a.$slots,"sidebarCodeEditor",{node:l})]),_:3},16)]),_:3},8,["viewModel"]))}}),mo={class:"code-graph-info"},yo=r.defineComponent({__name:"CodeGraphInfo",props:{viewModel:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("div",mo,[r.createElementVNode("div",null,"Editor graph: "+r.toDisplayString(e.viewModel.editor.graph.shortId),1),r.createElementVNode("div",null,"Displayed graph: "+r.toDisplayString(e.viewModel.displayedGraph.shortId),1),r.createElementVNode("div",null,"Graphs: "+r.toDisplayString(e.viewModel.editor.graphIds),1),r.createElementVNode("div",null,"Graph templates: "+r.toDisplayString(e.viewModel.editor.graphTemplateIds),1),r.createElementVNode("div",null,"Engine status: "+r.toDisplayString(e.viewModel.engine?.status),1)]))}}),_o=["data-node-type","id"],go={class:"__title-label",style:{"flex-grow":"1"}},ko={key:0},bo={class:"__menu",style:{display:"flex"}},wo={class:"__outputs"},vo={key:0},No=["id","title"],Co={class:"__inputs"},So={key:0},Mo=["id","title"],_s=r.defineComponent({__name:"CodeGraphNode",props:{node:{},selected:{type:Boolean,default:!1},dragging:{type:Boolean}},emits:["select","start-drag","update"],setup(e,{emit:t}){const n=T.Components.ContextMenu,s=T.Components.NodeInterface,a=e,o=r.computed(()=>a.node),i=t,{viewModel:l}=T.useViewModel(),{graph:d,switchGraph:c}=T.useGraph(),u=r.ref(null),_=r.ref(!1),p=r.ref(""),I=r.ref(null),k=r.ref(!1);let S=0,f=0;const b=r.ref(!1),A=r.computed(()=>{const $=[{value:"edit",label:"Edit"},{value:"rename",label:"Rename"},{value:"delete",label:"Delete"}];return a.node.type.startsWith(re.GRAPH_NODE_TYPE_PREFIX)&&$.push({value:"editSubgraph",label:"Edit Subgraph"}),$}),R=r.computed(()=>({"--selected":a.selected,"--dragging":a.dragging,"--two-column":!!a.node.twoColumn,"--hidden":o.value.state?.hidden})),W=r.computed(()=>({"--reverse-y":a.node.reverseY??l.value.settings.nodes.reverseY})),Se=r.computed(()=>({top:`${a.node.position?.y??0}px`,left:`${a.node.position?.x??0}px`,"--width":`${a.node.width??l.value.settings.nodes.defaultWidth}px`})),Me=r.computed(()=>Object.values(a.node.inputs).filter($=>!$.hidden)),ct=r.computed(()=>Object.values(a.node.outputs).filter($=>!$.hidden)),me=()=>{Xn(),i("select")},M=$=>{a.selected||me(),i("start-drag",$)},Z=()=>{b.value=!0},ee=()=>{const $=l.value.displayedGraph.sidebar;$.nodeId=a.node.id,$.visible=!0},Xn=()=>{const $=l.value.displayedGraph.sidebar;$.nodeId=a.node.id},ut=async $=>{switch($){case"edit":ee();break;case"delete":d.value.removeNode(a.node);break;case"rename":p.value=a.node.title,_.value=!0,await r.nextTick(),I.value?.focus();break;case"editSubgraph":c(a.node.template);break}},$t=()=>{o.value.title=p.value,o.value.events.titleChanged.emit(o.value.title),_.value=!1},Ut=()=>{u.value&&l.value.hooks.renderNode.execute({node:a.node,el:u.value})},Jn=$=>{k.value=!0,S=a.node.width,f=$.clientX,$.preventDefault()},Ft=$=>{o.value.state&&(o.value.state.integrated=$,i("update"))},Be=$=>{if(!k.value)return;const G=$.clientX-f,w=S+G/d.value.scaling,N=l.value.settings.nodes.minWidth,v=l.value.settings.nodes.maxWidth;o.value.width=Math.max(N,Math.min(v,w))},qe=()=>{k.value=!1};return r.onMounted(()=>{Ut(),window.addEventListener("mousemove",Be),window.addEventListener("mouseup",qe)}),r.onUpdated(Ut),r.onBeforeUnmount(()=>{window.removeEventListener("mousemove",Be),window.removeEventListener("mouseup",qe)}),($,G)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([R.value,"baklava-node"]),"data-node-type":o.value.type,id:o.value.id,style:r.normalizeStyle(Se.value),ref_key:"el",ref:u,onPointerdown:me},[r.unref(l).settings.nodes.resizable?(r.openBlock(),r.createElementBlock("div",{key:0,class:"__resize-handle",onMousedown:Jn},null,32)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"__title",onPointerdown:r.withModifiers(M,["self","stop"]),onContextmenu:r.withModifiers(Z,["prevent"])},[o.value.inputs._code?(r.openBlock(),r.createBlock(r.unref(Gt),{key:0,intf:o.value.inputs._code,node:o.value,title:o.value.inputs._code.value,class:"--input","data-interface-type":"node",style:{"flex-grow":"0"}},null,8,["intf","node","title"])):r.createCommentVNode("",!0),_.value?r.withDirectives((r.openBlock(),r.createElementBlock("input",{key:2,ref_key:"renameInputEl",ref:I,"onUpdate:modelValue":G[4]||(G[4]=w=>p.value=w),class:"baklava-input",placeholder:"Title",style:{"flex-grow":"1"},type:"text",onBlur:$t,onKeydown:r.withKeys($t,["enter"])},null,544)),[[r.vModelText,p.value]]):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createElementVNode("div",go,[o.value.idx>-1?(r.openBlock(),r.createElementBlock("span",ko,r.toDisplayString(o.value.idx+1)+" - ",1)):r.createCommentVNode("",!0),r.createTextVNode(" "+r.toDisplayString(o.value.title)+" "+r.toDisplayString(o.value.graph.shortId)+" "+r.toDisplayString(o.value.shortId),1)]),r.createElementVNode("div",bo,[o.value.isCodeNode?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[o.value.state.lockCode?(r.openBlock(),r.createBlock(r.unref(Ht),{key:0,class:"--clickable mx-1",onClick:G[0]||(G[0]=w=>o.value.lockCode=!1)})):r.createCommentVNode("",!0),o.value.isSelected&&!r.unref(l).displayedGraph.sidebar.visible?(r.openBlock(),r.createBlock(r.unref(jt),{key:1,class:"--clickable mx-1",onClick:ee})):r.createCommentVNode("",!0),o.value.hasConnectedOutputNodes?(r.openBlock(),r.createElementBlock(r.Fragment,{key:2},[o.value.state.integrated?(r.openBlock(),r.createBlock(r.unref(ss),{key:1,class:"--clickable mx-1",onClick:G[2]||(G[2]=w=>Ft(!1))})):(r.openBlock(),r.createBlock(r.unref(hs),{key:0,class:"--clickable mx-1",onClick:G[1]||(G[1]=w=>Ft(!0))}))],64)):r.createCommentVNode("",!0)],64)):r.createCommentVNode("",!0),r.createVNode(r.unref(rs),{class:"--clickable mx-1",onClick:Z}),r.createVNode(r.unref(n),{modelValue:b.value,"onUpdate:modelValue":G[3]||(G[3]=w=>b.value=w),x:0,y:0,items:A.value,onClick:ut},null,8,["modelValue","items"])])],64)),o.value.outputs._code?(r.openBlock(),r.createBlock(r.unref(Gt),{key:3,node:o.value,intf:o.value.outputs._code,class:"--output",title:o.value.outputs._code.value,"data-interface-type":"node"},null,8,["node","intf","title"])):r.createCommentVNode("",!0)],32),r.createElementVNode("div",{class:r.normalizeClass(["__content",W.value]),onKeydown:G[5]||(G[5]=r.withKeys(r.withModifiers(()=>{},["stop"]),["delete"])),onContextmenu:G[6]||(G[6]=r.withModifiers(()=>{},["prevent"]))},[r.createElementVNode("div",wo,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(ct.value,w=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:w.id},[o.value.state?.hidden?(r.openBlock(),r.createElementBlock("div",vo,[w.port?(r.openBlock(),r.createElementBlock("div",{key:0,id:w.id,title:w.name,class:"baklava-node-interface --output --connected"},[...G[7]||(G[7]=[r.createElementVNode("div",{class:"__port"},null,-1)])],8,No)):r.createCommentVNode("",!0)])):r.renderSlot($.$slots,"nodeInterface",{key:1,type:"output",node:o.value,intf:w},()=>[r.createVNode(r.unref(s),{node:o.value,intf:w,title:w.value},null,8,["node","intf","title"])])],64))),128))]),r.createElementVNode("div",Co,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Me.value,w=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:w.id},[o.value.state?.hidden?(r.openBlock(),r.createElementBlock("div",So,[w.port?(r.openBlock(),r.createElementBlock("div",{key:0,id:w.id,title:w.name,class:"baklava-node-interface --input --connected"},[...G[8]||(G[8]=[r.createElementVNode("div",{class:"__port"},null,-1)])],8,Mo)):r.createCommentVNode("",!0)])):r.renderSlot($.$slots,"nodeInterface",{key:1,node:o.value,intf:w,type:"input"},()=>[r.createVNode(r.unref(s),{node:o.value,intf:w,title:w.value},null,8,["node","intf","title"])])],64))),128))])],34)],46,_o))}}),Oo=["id"],Eo={class:"align-middle"},Gt=r.defineComponent({__name:"CodeGraphNodeInterface",props:{node:{},intf:{}},setup(e){const t=e,{viewModel:n}=T.useViewModel(),{hoveredOver:s,temporaryConnection:a}=T.useTemporaryConnection(),o=r.ref(null),i=r.computed(()=>t.intf.connectionCount>0),l=r.computed(()=>({"--connected":i.value})),d=()=>{s(t.intf)},c=()=>{s(void 0)},u=()=>{o.value&&n.value.hooks.renderInterface.execute({intf:t.intf,el:o.value})};return r.onMounted(u),r.onUpdated(u),(_,p)=>(r.openBlock(),r.createElementBlock("div",{id:e.intf.id,ref_key:"el",ref:o,class:r.normalizeClass(["baklava-node-interface",l.value])},[e.intf.port?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass([{"--selected":r.unref(a)?.from===e.intf},"__port"]),onPointerover:d,onPointerout:c},null,34)):r.createCommentVNode("",!0),r.createElementVNode("span",Eo,[r.renderSlot(_.$slots,"default")])],10,Oo))}}),To=["title"],Io={key:0,class:"__label"},zt=r.defineComponent({__name:"SidebarCheckbox",props:{disabled:{type:Boolean},inversed:{type:Boolean},modelValue:{type:Boolean},name:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(s,a)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["baklava-checkbox",{"--checked":e.inversed?!e.modelValue:e.modelValue,"--disabled":e.disabled}]),title:e.name,onClick:a[0]||(a[0]=o=>n("update:modelValue",!e.modelValue))},[a[1]||(a[1]=r.createElementVNode("div",{class:"__checkmark-container"},[r.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18"},[r.createElementVNode("path",{class:"__checkmark",d:"M 6 5 L 6 10 L 16 10",transform:"rotate(-45 10 10)"})])],-1)),e.name?(r.openBlock(),r.createElementBlock("div",Io,r.toDisplayString(e.name),1)):r.createCommentVNode("",!0)],10,To))}}),Do={class:"__header"},xo={class:"__node-name"},Yo={class:"__interfaces"},Ro={class:"__inputs"},Bo={style:{display:"flex"}},Vo={class:"__outputs"},Po={key:0,class:"__interface"},Lo=["placeholder"],Ao={style:{display:"flex"}},gs=r.defineComponent({__name:"CodeGraphSidebar",setup(e){const{viewModel:t}=T.useViewModel(),{graph:n}=T.useGraph(),s=r.ref(null),a=r.toRef(t.value.settings.sidebar,"width"),o=r.computed(()=>t.value.settings.sidebar.resizable);let i=0,l=0;const d=r.computed(()=>{const b=n.value.sidebar.nodeId;return n.value.nodes.find(A=>A.id===b)}),c=r.computed(()=>d.value),u=r.computed(()=>({width:`${a.value}px`})),_=r.computed(()=>c.value?Object.values(c.value.inputs).filter(b=>b.displayInSidebar&&b.component):[]),p=r.computed(()=>c.value?Object.values(c.value.outputs).filter(b=>b.displayInSidebar&&b.component):[]),I=()=>{n.value.sidebar.visible=!1},k=()=>{d.value&&(d.value.state.variableNameNumberAppendix=c.value.state.variableName.length===0,d.value.events.update.emit(null))},S=b=>{i=a.value,l=b.clientX,window.addEventListener("mousemove",f),window.addEventListener("mouseup",()=>{window.removeEventListener("mousemove",f)},{once:!0})},f=b=>{const A=s.value?.parentElement?.getBoundingClientRect().width??500,R=b.clientX-l;let W=i-R;W<300?W=300:W>.9*A&&(W=.9*A),a.value=W};return(b,A)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([{"--open":r.unref(n).sidebar.visible},"baklava-sidebar"]),style:r.normalizeStyle(u.value),ref_key:"el",ref:s},[o.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:"__resizer",onMousedown:S},null,32)):r.createCommentVNode("",!0),d.value?(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createElementVNode("div",Do,[r.createElementVNode("button",{tabindex:"-1",class:"__close",onClick:I},"×"),r.createElementVNode("div",xo,[r.createElementVNode("b",null,r.toDisplayString(d.value.title),1)])]),r.createElementVNode("div",Yo,[r.createElementVNode("div",Ro,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(_.value,R=>(r.openBlock(),r.createElementBlock("div",{key:R.id,class:"__interface"},[r.createElementVNode("div",Bo,[R.hidden!=null?(r.openBlock(),r.createBlock(zt,{key:0,modelValue:R.hidden,"onUpdate:modelValue":[W=>R.hidden=W,A[0]||(A[0]=()=>d.value?.events.update.emit(null))],disabled:!R.optional,inversed:"",style:{"padding-right":"8px"}},null,8,["modelValue","onUpdate:modelValue","disabled"])):r.createCommentVNode("",!0),(r.openBlock(),r.createBlock(r.resolveDynamicComponent(R.component),{modelValue:R.value,"onUpdate:modelValue":W=>R.value=W,node:d.value,intf:R,style:{width:"100%"}},null,8,["modelValue","onUpdate:modelValue","node","intf"]))])]))),128))]),r.createElementVNode("div",Vo,[c.value&&c.value.state?(r.openBlock(),r.createElementBlock("div",Po,[A[3]||(A[3]=r.createElementVNode("label",null,"Variable name",-1)),r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":A[1]||(A[1]=R=>c.value.state.variableName=R),placeholder:c.value.variableName,type:"text",class:"baklava-input",title:"Variable name",onBlur:k,onKeydown:r.withKeys(k,["enter"])},null,40,Lo),[[r.vModelText,c.value.state.variableName]])])):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p.value,R=>(r.openBlock(),r.createElementBlock("div",{key:R.id,class:"__interface"},[r.createElementVNode("div",Ao,[R.hidden!=null?(r.openBlock(),r.createBlock(zt,{key:0,modelValue:R.hidden,"onUpdate:modelValue":[W=>R.hidden=W,A[2]||(A[2]=()=>d.value?.events.update.emit(null))],disabled:!R.optional,inversed:"",style:{"padding-right":"8px"}},null,8,["modelValue","onUpdate:modelValue","disabled"])):r.createCommentVNode("",!0),(r.openBlock(),r.createBlock(r.resolveDynamicComponent(R.component),{modelValue:R.value,"onUpdate:modelValue":W=>R.value=W,node:d.value,intf:R,style:{width:"100%"}},null,8,["modelValue","onUpdate:modelValue","node","intf"]))])]))),128))])]),r.renderSlot(b.$slots,"codeEditor",{node:d.value})],64)):r.createCommentVNode("",!0)],6))}});function ks(e,t){return Object.fromEntries(Object.entries(e).filter(t))}function bs(e,t){return Object.fromEntries(Object.entries(e).map(([n,s])=>[n,t(s)]))}const $o={class:"baklava-node --palette",style:{"margin-top":"-20px","margin-bottom":"20px"}},Uo={key:0,style:{display:"flex","justify-content":"space-between"}},Fo=["onClick"],Wo={key:0,style:{margin:"auto 0","font-size":"12px"}},ws=r.defineComponent({__name:"CodeNodePalette",setup(e){const t=T.Components.PaletteEntry,{viewModel:n}=T.useViewModel(),{x:s,y:a}=Qn.usePointer(),{transform:o}=T.useTransform(),i=T.useNodeCategories(n),l=r.inject("editorEl"),d=r.ref(""),c=r.ref(null),u=()=>d.value?i.value.filter(k=>k.name.toLowerCase().includes(d.value.toLowerCase())||Object.values(k.nodeTypes).some(S=>S.title.toLowerCase().includes(d.value.toLowerCase()))):i.value,_=k=>d.value?ks(k,S=>{const f=S[1];return f.category.includes(d.value.toLowerCase())||f.title?.toLowerCase().includes(d.value.toLowerCase())}):k,p=r.computed(()=>{if(!c.value||!l?.value)return{};const{left:k,top:S}=l.value.getBoundingClientRect();return{top:`${a.value-S}px`,left:`${s.value-k}px`}}),I=(k,S)=>{c.value={type:k,nodeInformation:S};const f=()=>{const b=r.reactive(new S.type);n.value.displayedGraph.addNode(b);const A=l.value.getBoundingClientRect(),[R,W]=o(s.value-A.left,a.value-A.top);b.position.x=R,b.position.y=W,c.value=null,document.removeEventListener("pointerup",f)};document.addEventListener("pointerup",f)};return(k,S)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createElementVNode("div",{class:r.normalizeClass([{"--open":r.unref(n).settings.palette.enabled},"baklava-node-palette"]),onContextmenu:S[1]||(S[1]=r.withModifiers(()=>{},["stop","prevent"]))},[r.createElementVNode("div",$o,[r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":S[0]||(S[0]=f=>d.value=f),type:"text",class:"baklava-input",title:"Filter nodes",onKeyup:u},null,544),[[r.vModelText,d.value]])]),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u(),f=>(r.openBlock(),r.createElementBlock("section",{key:f.name},[f.name!=="default"?(r.openBlock(),r.createElementBlock("h3",Uo,[r.createElementVNode("div",{onClick:b=>d.value=f.name,style:{cursor:"pointer"}},r.toDisplayString(f.name),9,Fo),Object.keys(_(f.nodeTypes)).length<Object.values(f.nodeTypes).length?(r.openBlock(),r.createElementBlock("div",Wo," ( "+r.toDisplayString(Object.keys(_(f.nodeTypes)).length)+" / "+r.toDisplayString(Object.values(f.nodeTypes).length)+" ) ",1)):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(_(f.nodeTypes),(b,A)=>(r.openBlock(),r.createBlock(r.unref(t),{key:A,title:b.title,type:A,onPointerdown:R=>I(A,b)},null,8,["title","type","onPointerdown"]))),128))]))),128))],34),r.createVNode(r.Transition,{name:"fade"},{default:r.withCtx(()=>[c.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:"baklava-dragged-node",style:r.normalizeStyle(p.value)},[r.createVNode(r.unref(t),{type:c.value.type,title:c.value.nodeInformation.title},null,8,["type","title"])],4)):r.createCommentVNode("",!0)]),_:1})],64))}}),jo={},Ho={class:"prependIcon"},Go={class:"appendIcon"};function zo(e,t){const n=r.resolveComponent("router-link");return r.openBlock(),r.createBlock(n,{class:"navItem"},{default:r.withCtx(()=>[r.createElementVNode("span",Ho,[r.renderSlot(e.$slots,"prependIcon")]),r.renderSlot(e.$slots,"default"),r.createElementVNode("span",Go,[r.renderSlot(e.$slots,"appendIcon")])]),_:3})}const qt=j(jo,[["render",zo]]),qo={class:"navbar"},Zo=["onClick"],Ko=r.defineComponent({__name:"NavBar",props:{viewModel:{},editorStates:{},routes:{}},emits:["click:remove"],setup(e,{emit:t}){const n=t,s=a=>{n("click:remove",a)};return(a,o)=>(r.openBlock(),r.createElementBlock("nav",qo,[r.renderSlot(a.$slots,"prepend"),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.editorStates,i=>(r.openBlock(),r.createBlock(qt,{key:i.graph.id,class:r.normalizeClass({active:i.graph.id===e.viewModel.displayedGraph.id}),to:{name:e.routes?.edit??"edit",params:{editorId:i.graph.id}}},{appendIcon:r.withCtx(()=>[r.createElementVNode("button",{class:"remove",onClick:r.withModifiers(l=>s(i.graph.id),["prevent"])},[r.createVNode(r.unref(ps))],8,Zo)]),default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(i.graph.id.slice(0,6))+" ",1)]),_:2},1032,["class","to"]))),128)),r.renderSlot(a.$slots,"append",{},()=>[r.createVNode(qt,{to:{name:e.routes?.new??"new"},class:"navItem"},{default:r.withCtx(()=>[r.createVNode(r.unref(ls),{class:"plus"})]),_:1},8,["to"])])]))}}),Xo=["title"],ft=r.defineComponent({__name:"CodeNodeInterface",props:{intf:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("div",{title:e.intf.value},r.toDisplayString(e.intf.name),9,Xo))}}),Jo=r.defineComponent({props:{intf:{type:Object,required:!0},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(e,{emit:t}){return{v:r.computed({get:()=>e.modelValue,set:s=>{t("update:modelValue",s)}})}}}),Qo={style:{position:"relative"}},ei={style:{"font-size":"12px",padding:"0 6px",position:"absolute",top:"-10px","background-color":"var(--baklava-node-color-background)"}},ti=["placeholder","title"];function ni(e,t,n,s,a,o){return r.openBlock(),r.createElementBlock("div",Qo,[r.createElementVNode("label",ei,r.toDisplayString(e.intf.name),1),r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":t[0]||(t[0]=i=>e.v=i),type:"text",class:"baklava-input",placeholder:e.intf.name,title:e.intf.name},null,8,ti),[[r.vModelText,e.v]])])}const pt=j(Jo,[["render",ni]]),si=r.defineComponent({components:{"i-arrow":ns},props:{intf:{type:Object,required:!0}},setup(e){const t=r.ref(null),n=r.ref(!1),s=r.computed(()=>e.intf.items.find(i=>typeof i=="string"?i===e.intf.value:i.value===e.intf.value)),a=r.computed(()=>s.value?typeof s.value=="string"?s.value:s.value.text:""),o=i=>{e.intf.value=typeof i=="string"?i:i.value};return Qn.onClickOutside(t,()=>{n.value=!1}),{el:t,open:n,selectedItem:s,selectedText:a,setSelected:o}}}),ai=["title"],ri={style:{"font-size":"12px",padding:"0 6px",position:"absolute",top:"-10px","background-color":"var(--baklava-node-color-background)"}},oi={class:"__selected"},ii={class:"__text"},li={class:"__icon"},di={class:"__dropdown"},ci=["onClick"];function ui(e,t,n,s,a,o){const i=r.resolveComponent("i-arrow");return r.openBlock(),r.createElementBlock("div",{ref:"el",class:r.normalizeClass(["baklava-select",{"--open":e.open}]),title:e.intf.name,onClick:t[0]||(t[0]=l=>e.open=!e.open)},[r.createElementVNode("label",ri,r.toDisplayString(e.intf.name),1),r.createElementVNode("div",oi,[r.createElementVNode("div",ii,r.toDisplayString(e.selectedText),1),r.createElementVNode("div",li,[r.createVNode(i)])]),r.createVNode(r.Transition,{name:"slide-fade"},{default:r.withCtx(()=>[r.withDirectives(r.createElementVNode("div",di,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.intf.items,(l,d)=>(r.openBlock(),r.createElementBlock("div",{key:d,class:r.normalizeClass(["item",{"--active":l===e.selectedItem}]),onClick:c=>e.setSelected(l)},r.toDisplayString(typeof l=="string"?l:l.text),11,ci))),128))],512),[[r.vShow,e.open]])]),_:1})],10,ai)}const vs=j(si,[["render",ui]]),hi=r.defineComponent({props:{intf:{type:Object,required:!0},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(e,{emit:t}){return{v:r.computed({get:()=>e.modelValue,set:s=>{t("update:modelValue",s)}})}}}),fi={style:{"font-size":"12px",padding:"0 6px",position:"absolute",top:"-6px","background-color":"var(--baklava-node-color-background)"}},pi=["placeholder","title"];function mi(e,t,n,s,a,o){return r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("label",fi,r.toDisplayString(e.intf.name),1),r.withDirectives(r.createElementVNode("textarea",{"onUpdate:modelValue":t[0]||(t[0]=i=>e.v=i),rows:"5",class:"baklava-input",placeholder:e.intf.name,title:e.intf.name},null,8,pi),[[r.vModelText,e.v]])])}const Ns=j(hi,[["render",mi]]),yi=Object.freeze(Object.defineProperty({__proto__:null,CodeEditor:fo,CodeGraphEditor:po,CodeGraphInfo:yo,CodeGraphNode:_s,CodeGraphNodeInterface:Gt,CodeGraphSidebar:gs,CodeNodeInterface:ft,CodeNodePalette:ws,CopyToClipboard:ys,NavBar:Ko,NavItem:qt,SelectInterface:vs,SidebarCheckbox:zt,TextInputInterface:pt,TextareaInputInterface:Ns},Symbol.toStringTag,{value:"Module"})),Cs=(e,t)=>{switch(e){case"CheckBoxInterface":return new Os(t.id,!!t.value);case"IntegerInterface":return new tn(t.id,Number(t.value),t.min,t.max);case"ListInputInterface":return new Ts(t.id,String(t.value));case"NumberInterface":return new nn(t.id,Number(t.value),t.min,t.max);case"SelectInterface":return new Is(t.id,t.value,t.items);case"SliderInterface":return new Ds(t.id,Number(t.value),t.min,t.max);case"TupleInputInterface":return new xs(t.id,String(t.value));default:return new Xe(t.id,String(t.value))}},Ss=(e,t=!0)=>{const n=[],s=Object.keys(e);return s.forEach(a=>{if(e[a]?.hidden)return;const i=t&&n.length<s.indexOf(a)?`${a}=`:"";n.push(`${i}{{ inputs.${a} }}`)}),n},Zt=new X.NodeInterfaceType("boolean"),Ms=new X.NodeInterfaceType("dict"),Kt=new X.NodeInterfaceType("list"),mt=new X.NodeInterfaceType("node"),Xt=new X.NodeInterfaceType("number"),Jt=new X.NodeInterfaceType("string"),Qt=new X.NodeInterfaceType("tuple"),_i=e=>{new X.BaklavaInterfaceTypes(e.editor,{viewPlugin:e}).addTypes(Zt,Ms,Kt,mt,Xt,Jt,Qt)};class J extends re.NodeInterface{component=r.markRaw(ft);isCodeNode=!0;code;componentName="";state=r.reactive({optional:!1});type=null;get optional(){return this.state.optional}get shortId(){return this.id.slice(0,6)}getValue=()=>`${this.value??"None"}`;load(t){this.id=t.id,this.templateId=t.templateId,!["_code","out"].includes(this.name)&&(this.value=t.value,this.hidden=t.hidden,t.component&&(this.componentName=t.component),t.optional&&(this.state.optional=t.optional),this.hooks.load.execute(t))}save(){const t={id:this.id,templateId:this.templateId,value:""};return["_code","out"].includes(this.name)||(t.value=this.value,t.hidden=this.hidden,this.componentName&&(t.component=this.componentName),this.state.optional&&(t.optional=this.state.optional)),this.hooks.save.execute(t)}setOptional(t){return this.state.optional=t,this.setHidden(t),this}}const Ke=e=>{e.addInput("_code",new J("_code",[]).use(X.setTypeForMultipleConnections,mt).use(Ze.allowMultipleConnections).setHidden(!0)),e.addOutput("_code",new J("_code",[]).use(X.setTypeForMultipleConnections,mt).use(Ze.allowMultipleConnections).setHidden(!0))};class Pe extends J{component=r.markRaw(ft);constructor(t="",n){super(t,n),this.use(T.displayInSidebar,!0)}get value(){return super.value}set value(t){super.value=t,this.name!=="_code"&&this.setHidden(!1)}}class Os extends Pe{component=r.markRaw(T.CheckboxInterfaceComponent);componentName="CheckboxInterface";constructor(t,n){super(t,n),this.use(X.setType,Zt)}getValue=()=>this.value?"True":"False"}class Es extends J{component=r.markRaw(ft);isCodeNodeOutput=!0;suffix="";constructor(t="",n=""){super(t,""),this.suffix=n}get codeValue(){return this.node?.outputs._code?.value??""}get node(){const{graph:t}=T.useGraph();return t.value.findNodeById(this.nodeId)}}class en extends Pe{min;max;constructor(t,n,s,a){super(t,n),this.min=s,this.max=a,this.use(X.setType,Xt)}validate(t){return(this.min===void 0||t>=this.min)&&(this.max===void 0||t<=this.max)}}class tn extends en{component=r.markRaw(T.IntegerInterfaceComponent);componentName="IntegerInterface";validate(t){return Number.isInteger(t)&&super.validate(t)}}class Ts extends Pe{component=r.markRaw(pt);componentName="ListInputInterface";constructor(t,n=""){super(t,n),this.use(X.setType,Kt)}getValue=()=>`[${this.value}]`}class nn extends en{component=r.markRaw(T.NumberInterfaceComponent);componentName="NumberInterface"}class sn extends Pe{constructor(t,n){super(t,n),this.use(X.setType,Jt)}getValue=()=>`"${this.value}"`}class Is extends sn{component=r.markRaw(vs);componentName="SelectInterface";items=[];constructor(t,n,s){super(t,n),s&&(this.items=s)}}class Ds extends en{component=r.markRaw(T.SliderInterfaceComponent);componentName="SliderInterface";min=0;max=1;getValue=()=>`${Math.round(this.value*1e3)/1e3}`}class Xe extends sn{component=r.markRaw(pt)}class gi extends sn{component=r.markRaw(Ns)}class xs extends Pe{component=r.markRaw(pt);componentName="TupleInputInterface";constructor(t,n=""){super(t,n),this.use(X.setType,Qt)}getValue=()=>`(${this.value})`}Ve.escape=e=>e;class an extends re.AbstractNode{_variableName="";codeTemplate;isCodeNode=!0;mask=null;name="";state;inputs={};outputs={};constructor(){super(),this.initializeIo(),this.twoColumn=!0,this.state=r.reactive({codeTemplate:"",hidden:!1,integrated:!1,lockCode:!1,modules:[],props:null,script:"",variableName:""}),this.codeTemplate=function(){return`${this.name}(${Ss(this.codeNodeInputs).join(", ")})`}}get code(){return this.graph.code}get codeNodeInputs(){return Object.fromEntries(Object.entries(this.inputs).filter(t=>t[1].isCodeNode&&t[1].type!="node"))}get codeNodeOutputs(){return Object.fromEntries(Object.entries(this.outputs).filter(t=>t[1].isCodeNode&&t[1].type!="node"))}get graph(){return super.graph}get hasConnectedOutputNodes(){return this.getConnectedNodes("outputs").length>0}get idx(){return this.graph.nodes.filter(t=>!t.state.integrated).indexOf(this)??-1}get idxByType(){return this.graph.getNodesByType(this.type).indexOf(this)??-1}get idxByVariableNames(){return this.graph.getNodesByVariableName(this._variableName).filter(t=>!t.state.integrated).indexOf(this)??-1}get isSelected(){return this.graph.selectedNodeIds.includes(this.id)}get lockCode(){return this.state.lockCode}set lockCode(t){this.state.lockCode=t,this.events.update.emit(null)}get optionalInputs(){return Object.fromEntries(Object.entries(this.codeNodeInputs).filter(t=>t[1].optional))}get requiredInputs(){return Object.fromEntries(Object.entries(this.codeNodeInputs).filter(t=>!t[1].optional))}get script(){return this.outputs._code?.value??""}set script(t){this.outputs._code&&(this.outputs._code.value=t),this.events.update.emit(null)}get shortId(){return this.id.slice(0,6)}get subgraph(){}get variableName(){return this.state.variableName||this._variableName?this.state.variableName||this._variableName+(this.idxByVariableNames+1):""}set variableName(t){this._variableName=t}getConnectedNodeByInterface(t,n){const s=this.getConnectedNodesByInterface(t,n);return s.length>0?s[0]:null}getConnectedNodes(t){let n=[];if(t!=="inputs"){const s=this.graph.connections.filter(a=>a.from.name!=="_code").filter(a=>a.from.nodeId===this.id).map(a=>a.to.nodeId);s&&(n=n.concat(s))}if(t!=="outputs"){const s=this.graph.connections.filter(a=>a.from.name!=="_code").filter(a=>a.to.nodeId===this.id).map(a=>a.from.nodeId);s&&(n=n.concat(s))}return!n||n.length==0?[]:n.map(s=>this.graph.findNodeById(s))}getConnectedNodesByInterface(t,n){let s=[];if(n!=="outputs"&&this.inputs[t]){const a=this.graph.connections.filter(o=>o.to.id===this.inputs[t]?.id||o.from.id===this.inputs[t]?.id).map(o=>o.from.nodeId);a&&(s=s.concat(a))}if(n!=="inputs"&&this.outputs[t]){const a=this.graph.connections.filter(o=>o.from.id===this.outputs[t]?.id||o.from.id===this.outputs[t]?.id).map(o=>o.to.nodeId);a&&(s=s.concat(a))}return!s||s.length==0?[]:s.map(a=>this.graph.findNodeById(a))}remove(){this.graph?.removeNode(this)}renderCode(t){return Object.keys(t.inputs).filter(n=>Array.isArray(t.inputs[n])&&n!=="_code").forEach(n=>{const s=[...t.inputs[n]];s.reverse(),t.inputs[n]=`[${s.join(", ")}]`}),Ve.render(this.state.codeTemplate,t)}updateCodeTemplate(){this.state.codeTemplate=this.codeTemplate.call(this)}updateModules(t){if(t)this.state.modules=t;else if(this.type.includes(".")){const n=this.type.split(".");this.state.modules.push(n.slice(0,n.length-1).join("."))}}updateOutputNames(){Object.values(this.codeNodeOutputs).forEach(t=>{t.name=this.state.integrated?"":this.variableName+t.suffix})}updateOutputValues(t){Object.keys(this.outputs).forEach(n=>{n!=="_code"&&(t[n]=this.state.integrated?t._code:this.outputs[n].name)})}updateProps(t){this.state.props=t}updateInputValues(t){const n=Object.keys(this.inputs);Object.keys(t).forEach(s=>{!n.includes(s)||!this.inputs[s]||(this.inputs[s].value=t[s],this.inputs[s].setHidden(!1))})}}class yt extends an{calculate=(t,n)=>{const s={};return this.lockCode||(s._code=this.renderCode({inputs:t,...n})),this.updateOutputValues(s),s};executeFactory(t,n){Object.keys(n||{}).forEach(s=>{const a=n[s]();t==="input"?this.addInput(s,a):this.addOutput(s,a)})}load(t){super.load(t),this.afterLoaded()}save(){return super.save()}}function ki(e){return class extends yt{type=e.type;inputs={};outputs={};constructor(){super(),this._title=e.title??e.type,this.executeFactory("input",e.inputs),this.executeFactory("output",e.outputs),e.calculate&&(this.calculate=(t,n)=>e.calculate.call(this,t,n)),e.onCreate?.call(this),this.name=e.name??e.type,this.updateModules(e.modules),e.codeTemplate&&(this.codeTemplate=e.codeTemplate),e.variableName!=null&&(this.variableName=e.variableName),Ke(this)}afterGraphLoaded(){e.afterGraphLoaded?.call(this)}afterLoaded(){e.afterLoaded?.call(this)}beforeRun(){e.beforeRun?.call(this)}onPlaced(){e.onPlaced?.call(this)}onConnected(){e.onConnected?.call(this)}onDestroy(){e.onDestroy?.call(this)}onUnconnected(){e.onUnconnected?.call(this)}update(){e.update?.call(this)}}}class Ys extends yt{}function bi(e){return class extends Ys{type=e.type;inputs={};outputs={};preventUpdate=!1;staticInputKeys=Object.keys(e.inputs??{});staticOutputKeys=Object.keys(e.outputs??{});constructor(){super(),this._title=e.title??e.type,this.executeFactory("input",e.inputs),this.executeFactory("output",e.outputs),e.calculate&&(this.calculate=(t,n)=>e.calculate?.call(this,t,n)),e.onCreate?.call(this),this.name=e.name??e.type,this.updateModules(e.modules),e.codeTemplate&&(this.codeTemplate=e.codeTemplate),e.variableName&&(this.variableName=e.variableName),Ke(this),this.staticInputKeys.push("_code"),this.staticOutputKeys.push("_code")}afterGraphLoaded(){e.afterGraphLoaded?.call(this)}afterLoaded(){e.afterLoaded?.call(this)}beforeRun(){e.beforeRun?.call(this)}onPlaced(){this.events.update.subscribe(this,t=>{t&&(t.type==="input"&&this.staticInputKeys.includes(t.name)||t.type==="output"&&this.staticOutputKeys.includes(t.name))&&this.onUpdate()}),this.onUpdate(),e.onPlaced?.call(this)}onConnected(){e.onConnected?.call(this)}onDestroy(){e.onDestroy?.call(this)}onUnconnected(){e.onUnconnected?.call(this)}update(){e.update?.call(this)}load(t){this.preventUpdate=!0,this.hooks.beforeLoad.execute(t),this.id=t.id,this.title=t.title;for(const n of this.staticInputKeys)this.inputs[n].load(t.inputs[n]),this.inputs[n].nodeId=this.id;for(const n of this.staticOutputKeys)this.outputs[n].load(t.outputs[n]),this.outputs[n].nodeId=this.id;this.preventUpdate=!1,this.onUpdate(),this.preventUpdate=!0;for(const n of Object.keys(t.inputs))if(!(this.staticInputKeys.includes(n)||!t.inputs[n])){if(!this.inputs[n]){const s=t.inputs[n],a=s.value;let o;s.component?o=Cs(s.component,{...s,id:n}):typeof a=="number"?0<a&&a<1?o=new nn(n,Number(a)):o=new tn(n,Number(a)):o=new Xe(n,String(a)),o.use(T.displayInSidebar,!0),this.addInput(n,o)}this.inputs[n]&&(this.inputs[n].load(t.inputs[n]),this.inputs[n].nodeId=this.id)}for(const n of Object.keys(t.outputs))if(!(this.staticOutputKeys.includes(n)||!t.outputs[n])){if(!this.outputs[n]){const s=new Es(n);this.addOutput(n,s)}this.outputs[n]&&(this.outputs[n].load(t.outputs[n]),this.outputs[n].nodeId=this.id)}this.preventUpdate=!1,this.events.loaded.emit(this)}onUpdate(){if(!e.onUpdate||this.preventUpdate)return;this.graph&&this.graph.activeTransactions++;const t=this.getStaticValues(this.staticInputKeys,this.inputs),n=this.getStaticValues(this.staticOutputKeys,this.outputs),s=e.onUpdate.call(this,t,n);this.updateInterfaces("input",s.inputs??{},s.forceUpdateInputs??[]),this.updateInterfaces("output",s.outputs??{},s.forceUpdateOutputs??[]),this.graph&&this.graph.activeTransactions--}getStaticValues(t,n){const s={};for(const a of t)s[a]=n[a].value;return s}updateInputInterfaces(t={},n=[]){this.updateInterfaces("input",t,n)}updateInterfaces(t,n={},s=[]){const a=t==="input"?this.staticInputKeys:this.staticOutputKeys,o=t==="input"?this.inputs:this.outputs;for(const i of Object.keys(o))a.includes(i)||n[i]&&!s.includes(i)||(t==="input"?this.removeInput(i):this.removeOutput(i));for(const i of Object.keys(n)){if(o[i])continue;const l=n[i]();t==="input"?this.addInput(i,l):this.addOutput(i,l)}}updateProps(t){this.state.props=t,this.onUpdate()}}}Ve.escape=e=>e;class _t{_id;_state;viewModel;constructor(){this._id=Ie.v4(),this._state=r.reactive({lockCode:!1,modules:{},script:"",template:""})}get engine(){return this.viewModel?.engine}get graph(){return this.viewModel?.editor.graph}get id(){return this._id}get lockCode(){return this.state.lockCode}set lockCode(t){this.state.lockCode=t,t||this.engine?.runOnce({})}get modules(){const t=[];return this.graph?.codeNodes.filter(n=>n.state.modules?.length>0).forEach(n=>t.push(...n.state.modules)),t?(t.sort(),Array.from(new Set(t.map(n=>this.state.modules[n])))):[]}get script(){return this.state.script}get shortId(){return this.id.slice(0,6)}get state(){return this._state}clear(){this.state.script=""}async loadTemplate(t){t.then(n=>{this._state.template=n.default??""})}registerViewModel(t){this.viewModel=t}renderCode(t){this.state.script=Ve.render(this.state.template??"",t??{})}}class wi extends _t{constructor(){super(),this.loadTemplate(Promise.resolve().then(()=>Bu))}}class vi extends _t{constructor(){super(),this.loadTemplate(Promise.resolve().then(()=>Vu))}}const gt=350;class Le extends re.Graph{code=null;editor;_state=r.reactive({codeTemplate:"{{ #nodes }}{{ script }}{{ /nodes }}",lockCode:!1});constructor(t,n){super(t,n),this.editor=t,this.template=n,t.code&&(this.code=t.code)}get codeNodes(){return rn(this)}get connections(){return super.connections}set connections(t){this._connections=t}get nodeIds(){return this.nodes.map(t=>t.id)}get nodes(){return super.nodes}set nodes(t){this._nodes=t}get scriptedCodeNodes(){return this.nodes.filter(t=>!t.state?.integrated)}get selectedNodeIds(){return this.selectedNodes.map(t=>t.id)}get shortId(){return this.id.slice(0,6)}get state(){return this._state}get visibleNodes(){return this.nodes.filter(t=>!t.state?.hidden)}addNode(t,n){return t.state&&n&&(t.state.props=n),super.addNode(t)}addNodeAtCoordinates=(t,n={x:0,y:0},s)=>(this.addNode(t,s),t.position&&(t.position=n),t);addConnection(t,n){return t&&t?.name!=="_code"&&(t.hidden=!1),n&&n?.name!=="_code"&&(n.hidden=!1),super.addConnection(t,n)}beforeRun(){this.nodes.forEach(t=>t.beforeRun())}clear(){this.selectedNodes=[],this._nodes=[],this._connections=[]}findNodeByType(t){return this.nodes.find(n=>n.type===t)}getNodesByType(t){return this.nodes.filter(n=>n.type===t)}getNodesByVariableName(t){return this.nodes.filter(n=>[n.state.variableName,n._variableName].includes(t))}hasConnection(t,n){return this.connections.some(s=>s.from.id===t.id&&s.to.id===n.id)}load(t){const n=super.load(t);return this.nodes.forEach(s=>s.afterGraphLoaded()),n}renderCode(t){return Ve.render(this.state?.codeTemplate||"",t)}sortNodes(){if(!(this.nodes.length===0||this.connections.length===0))try{let t=this.nodeIds;const n=this.connections.filter(o=>t.includes(o.to.nodeId)&&t.includes(o.from.nodeId)).map(o=>[o.to.nodeId,o.from.nodeId]);t.reverse(),t=Ha.array(t,n),t.reverse();const s=this.nodes.map(o=>o.id).filter(o=>!t.includes(o));t=[...t,...s];const a=t.map(o=>this.findNodeById(o));a&&(this.nodes=a)}catch{console.warn("Failed to sort nodes.")}}sortNodesByRank(){if(this.nodes.length===0)return;const t=new Map;this.nodes.forEach(s=>{const a=this.editor.nodeTypes.get(s.type).orderRank;t.has(a)?t.set(a,[...t.get(a),s]):t.set(a,[s])});const n=Array.from(t.keys());n.sort((s,a)=>s-a),this.nodes=n.flatMap(s=>t.get(s))}}const rn=e=>{const t=[];return e.nodes.length===0||e.nodes.forEach(n=>{n&&(n.hasOwnProperty("subgraph")?t.push(...rn(n.subgraph)):n.hasOwnProperty("isCodeNode")&&t.push(n))}),t},Ni=(e=0,t=100)=>({x:e*(gt+70),y:t}),Ci=e=>{const t={...e.position};return t.x-=gt+70,t.y+=50,t},on="__baklava_SubgraphInputNode",ln="__baklava_SubgraphOutputNode";class Rs extends yt{graphInterfaceId;constructor(){super(),this.graphInterfaceId=Ie.v4(),Ke(this),this.variableName="s"}onPlaced(){super.onPlaced(),this.initializeIo()}load(t){super.load(t),this.graphInterfaceId=t.graphInterfaceId}save(){return{...super.save(),graphInterfaceId:this.graphInterfaceId}}afterGraphLoaded(){}afterLoaded(){}beforeRun(){}onConnected(){}onUnconnected(){}update(){}}class dn extends Rs{static isGraphInputNode(t){return t.type===on}type=on;inputs={name:new J("Name","Input")};outputs={placeholder:new J("Value",void 0)}}class cn extends Rs{static isGraphOutputNode(t){return t.type===ln}type=ln;inputs={name:new J("Name","Output"),placeholder:new J("Value",void 0)};outputs={output:new J("Output",void 0).setHidden(!0)};calculate=({placeholder:t})=>({output:t})}class un extends dn{_title="Subgraph Input";inputs={name:new Xe("Name","Input").setPort(!1)};outputs={placeholder:new J("Connection",void 0)}}class hn extends cn{_title="Subgraph Output";inputs={name:new Xe("Name","Output").setPort(!1),placeholder:new J("Connection",void 0)};outputs={output:new J("Output",void 0).setHidden(!0)}}const Bs="CREATE_SUBGRAPH",Vs=[re.GRAPH_INPUT_NODE_TYPE,re.GRAPH_OUTPUT_NODE_TYPE];function Ps(e,t,n){const s=()=>e.value.selectedNodes.filter(o=>!Vs.includes(o.type)).length>0,a=()=>{const{viewModel:o}=T.useViewModel(),i=e.value,l=e.value.editor;if(i.selectedNodes.length===0)return;const d=i.selectedNodes.filter(M=>!Vs.includes(M.type)),c=d.flatMap(M=>Object.values(M.inputs)),u=d.flatMap(M=>Object.values(M.outputs)),_=i.connections.filter(M=>!u.includes(M.from)&&c.includes(M.to)),p=i.connections.filter(M=>u.includes(M.from)&&!c.includes(M.to)),I=i.connections.filter(M=>u.includes(M.from)&&c.includes(M.to)),k=d.map(M=>M.save()),S=I.map(M=>({id:M.id,from:M.from.id,to:M.to.id})),f=new Map,{xLeft:b,xRight:A,yTop:R}=Si(d);for(const[M,Z]of _.entries()){const ee=new un;ee.inputs.name.value=Z.to.name,k.push({...ee.save(),position:{x:A-o.value.settings.nodes.defaultWidth-100,y:R+M*200}}),S.push({id:Ie.v4(),from:ee.outputs.placeholder.id,to:Z.to.id}),f.set(Z.to.id,ee.graphInterfaceId)}for(const[M,Z]of p.entries()){const ee=new hn;ee.inputs.name.value=Z.from.name,k.push({...ee.save(),position:{x:b+100,y:R+M*200}}),S.push({id:Ie.v4(),from:Z.from.id,to:ee.inputs.placeholder.id}),f.set(Z.from.id,ee.graphInterfaceId)}const W=r.reactive(new dt({connections:S,nodes:k,inputs:[],outputs:[]},l));l.addGraphTemplate(W);const Se=l.nodeTypes.get(re.getGraphNodeTypeString(W));if(!Se)throw new Error("Unable to create subgraph: Could not find corresponding graph node type");i.activeTransactions++;const Me=r.reactive(new Se.type);i.addNode(Me);const ct=Math.round(d.map(M=>M.position.x).reduce((M,Z)=>M+Z,0)/d.length),me=Math.round(d.map(M=>M.position.y).reduce((M,Z)=>M+Z,0)/d.length);Me.position.x=ct,Me.position.y=me,_.forEach(M=>{i.removeConnection(M),i.addConnection(M.from,Me.inputs[f.get(M.to.id)])}),p.forEach(M=>{i.removeConnection(M),i.addConnection(Me.outputs[f.get(M.from.id)],M.to)}),d.forEach(M=>i.removeNode(M)),i.activeTransactions--,t.canExecuteCommand(T.Commands.SAVE_SUBGRAPH_COMMAND)&&t.executeCommand(T.Commands.SAVE_SUBGRAPH_COMMAND),n(W),e.value.panning={...i.panning},e.value.scaling=i.scaling};t.registerCommand(Bs,{canExecute:s,execute:a})}function Si(e){const t=e.reduce((a,o)=>{const i=o.position.x;return i<a?i:a},1/0),n=e.reduce((a,o)=>{const i=o.position.y;return i<a?i:a},1/0);return{xLeft:e.reduce((a,o)=>{const i=o.position.x+o.width;return i>a?i:a},-1/0),xRight:t,yTop:n}}const Mi=["component","connectionCount","events","hidden","hooks","id","isCodeNode","isInput","name","nodeId","port","templateId","value"];function Ls(e){return class extends an{type=re.getGraphNodeTypeString(e);get title(){return this._title}set title(n){this.template.name=n}inputs={};outputs={};template=e;subgraph;calculate=async(n,s)=>{if(!this.subgraph)throw new Error(`GraphNode ${this.id}: calculate called without subgraph being initialized`);if(!s.engine||typeof s.engine!="object")throw new Error(`GraphNode ${this.id}: calculate called but no engine provided in context`);const a=s.engine.getInputValues(this.subgraph);for(const l of this.subgraph.inputs)a.set(l.nodeInterfaceId,n[l.id]);const o=await s.engine.runGraph(this.subgraph,a,s.globalValues);s.engine.pause(),Ze.applyResult(o,s.engine.editor),s.engine.resume();const i={};for(const l of this.subgraph.outputs)i[l.id]=o.get(l.nodeId)?.get("output");return i._calculationResults=o,this.lockCode||(i._code=this.renderCode({inputs:n,...s.globalValues})),this.updateOutputValues(i),i};load(n){if(!this.subgraph)throw new Error("Cannot load a graph node without a graph");if(!this.template)throw new Error("Unable to load graph node without graph template");this.subgraph.load(n.graphState),super.load(n)}save(){if(!this.subgraph)throw new Error("Cannot save a graph node without a graph");return{...super.save(),graphState:this.subgraph.save()}}onPlaced(){this.template.events.updated.subscribe(this,()=>this.initialize()),this.template.events.nameChanged.subscribe(this,n=>{this._title=n}),this.initialize()}onDestroy(){this.template.events.updated.unsubscribe(this),this.template.events.nameChanged.unsubscribe(this),this.subgraph?.destroy()}initialize(){this.subgraph&&this.subgraph.destroy(),this.subgraph=this.template.createGraph(),this._title=this.template.name;const n=this.template.nodes.find(s=>s.type==="__baklava_SubgraphOutputNode");this.variableName=n?.inputs.name?.value??"s",this.updateInterfaces(),this.state.codeTemplate=`{{ #nodes }}{{ script }}
|
|
2
|
+
{{ /nodes }}`,this.events.update.emit(null)}renderCode(n){return this.subgraph?this.subgraph.renderCode({nodes:this.subgraph.scriptedCodeNodes}):Ve.render(this.state.codeTemplate,n)}updateInterfaces(){if(!this.subgraph)throw new Error("Trying to update interfaces without graph instance");for(const n of this.subgraph.inputs)n.id in this.inputs?this.inputs[n.id].name=n.name:this.addInput(n.id,this.createProxyInterface(n,!0));for(const n of Object.keys(this.inputs))this.subgraph.inputs.some(s=>s.id===n)||this.removeInput(n);for(const n of this.subgraph.outputs)n.id in this.outputs?this.outputs[n.id].name=n.name:this.addOutput(n.id,this.createProxyInterface(n,!1));for(const n of Object.keys(this.outputs))this.subgraph.outputs.some(s=>s.id===n)||this.removeOutput(n);Ke(this),this.addOutput("_calculationResults",new re.NodeInterface("_calculationResults",void 0).setHidden(!0))}createProxyInterface(n,s){const a=new J(n.name,void 0);return new Proxy(a,{get:(o,i)=>{if(Mi.includes(i)||i in o||typeof i=="string"&&i.startsWith("__v_"))return Reflect.get(o,i);let l;s?l=this.subgraph?.nodes.find(_=>dn.isGraphInputNode(_)&&_.graphInterfaceId===n.id)?.outputs.placeholder.id:l=this.subgraph?.nodes.find(_=>cn.isGraphOutputNode(_)&&_.graphInterfaceId===n.id)?.inputs.placeholder.id;const d=this.subgraph?.connections.find(u=>l===(s?u.from:u.to)?.id),c=s?d?.to:d?.from;if(c)return Reflect.get(c,i)}})}}}var As;function y(){return As.apply(null,arguments)}function Oi(e){As=e}function oe(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function De(e){return e!=null&&Object.prototype.toString.call(e)==="[object Object]"}function V(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function fn(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;var t;for(t in e)if(V(e,t))return!1;return!0}function Q(e){return e===void 0}function ye(e){return typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]"}function Je(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function $s(e,t){var n=[],s,a=e.length;for(s=0;s<a;++s)n.push(t(e[s],s));return n}function Oe(e,t){for(var n in t)V(t,n)&&(e[n]=t[n]);return V(t,"toString")&&(e.toString=t.toString),V(t,"valueOf")&&(e.valueOf=t.valueOf),e}function ue(e,t,n,s){return fa(e,t,n,s,!0).utc()}function Ei(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function E(e){return e._pf==null&&(e._pf=Ei()),e._pf}var pn;Array.prototype.some?pn=Array.prototype.some:pn=function(e){var t=Object(this),n=t.length>>>0,s;for(s=0;s<n;s++)if(s in t&&e.call(this,t[s],s,t))return!0;return!1};function mn(e){var t=null,n=!1,s=e._d&&!isNaN(e._d.getTime());if(s&&(t=E(e),n=pn.call(t.parsedDateParts,function(a){return a!=null}),s=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n),e._strict&&(s=s&&t.charsLeftOver===0&&t.unusedTokens.length===0&&t.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(e))e._isValid=s;else return s;return e._isValid}function kt(e){var t=ue(NaN);return e!=null?Oe(E(t),e):E(t).userInvalidated=!0,t}var Us=y.momentProperties=[],yn=!1;function _n(e,t){var n,s,a,o=Us.length;if(Q(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),Q(t._i)||(e._i=t._i),Q(t._f)||(e._f=t._f),Q(t._l)||(e._l=t._l),Q(t._strict)||(e._strict=t._strict),Q(t._tzm)||(e._tzm=t._tzm),Q(t._isUTC)||(e._isUTC=t._isUTC),Q(t._offset)||(e._offset=t._offset),Q(t._pf)||(e._pf=E(t)),Q(t._locale)||(e._locale=t._locale),o>0)for(n=0;n<o;n++)s=Us[n],a=t[s],Q(a)||(e[s]=a);return e}function Qe(e){_n(this,e),this._d=new Date(e._d!=null?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),yn===!1&&(yn=!0,y.updateOffset(this),yn=!1)}function ie(e){return e instanceof Qe||e!=null&&e._isAMomentObject!=null}function Fs(e){y.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+e)}function ne(e,t){var n=!0;return Oe(function(){if(y.deprecationHandler!=null&&y.deprecationHandler(null,e),n){var s=[],a,o,i,l=arguments.length;for(o=0;o<l;o++){if(a="",typeof arguments[o]=="object"){a+=`
|
|
3
|
+
[`+o+"] ";for(i in arguments[0])V(arguments[0],i)&&(a+=i+": "+arguments[0][i]+", ");a=a.slice(0,-2)}else a=arguments[o];s.push(a)}Fs(e+`
|
|
6
4
|
Arguments: `+Array.prototype.slice.call(s).join("")+`
|
|
7
|
-
`+new Error().stack),n=!1}return t.apply(this,arguments)},t)}var As={};function $s(e,t){_.deprecationHandler!=null&&_.deprecationHandler(e,t),As[e]||(Ls(t),As[e]=!0)}_.suppressDeprecationWarnings=!1,_.deprecationHandler=null;function fe(e){return typeof Function<"u"&&e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}function Ii(e){var t,n;for(n in e)B(e,n)&&(t=e[n],fe(t)?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function mn(e,t){var n=Te({},e),s;for(s in t)B(t,s)&&(Ye(e[s])&&Ye(t[s])?(n[s]={},Te(n[s],e[s]),Te(n[s],t[s])):t[s]!=null?n[s]=t[s]:delete n[s]);for(s in e)B(e,s)&&!B(t,s)&&Ye(e[s])&&(n[s]=Te({},n[s]));return n}function _n(e){e!=null&&this.set(e)}var yn;Object.keys?yn=Object.keys:yn=function(e){var t,n=[];for(t in e)B(e,t)&&n.push(t);return n};var xi={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function Di(e,t,n){var s=this._calendar[e]||this._calendar.sameElse;return fe(s)?s.call(t,n):s}function pe(e,t,n){var s=""+Math.abs(e),a=t-s.length,o=e>=0;return(o?n?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+s}var gn=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,gt=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,kn={},Ue={};function C(e,t,n,s){var a=s;typeof s=="string"&&(a=function(){return this[s]()}),e&&(Ue[e]=a),t&&(Ue[t[0]]=function(){return pe(a.apply(this,arguments),t[1],t[2])}),n&&(Ue[n]=function(){return this.localeData().ordinal(a.apply(this,arguments),e)})}function Yi(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function Ri(e){var t=e.match(gn),n,s;for(n=0,s=t.length;n<s;n++)Ue[t[n]]?t[n]=Ue[t[n]]:t[n]=Yi(t[n]);return function(a){var o="",i;for(i=0;i<s;i++)o+=fe(t[i])?t[i].call(a,e):t[i];return o}}function kt(e,t){return e.isValid()?(t=Us(t,e.localeData()),kn[t]=kn[t]||Ri(t),kn[t](e)):e.localeData().invalidDate()}function Us(e,t){var n=5;function s(a){return t.longDateFormat(a)||a}for(gt.lastIndex=0;n>=0&>.test(e);)e=e.replace(gt,s),gt.lastIndex=0,n-=1;return e}var Bi={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function Vi(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(gn).map(function(s){return s==="MMMM"||s==="MM"||s==="DD"||s==="dddd"?s.slice(1):s}).join(""),this._longDateFormat[e])}var Pi="Invalid date";function Li(){return this._invalidDate}var Ai="%d",$i=/\d{1,2}/;function Ui(e){return this._ordinal.replace("%d",e)}var Fi={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Wi(e,t,n,s){var a=this._relativeTime[n];return fe(a)?a(e,t,n,s):a.replace(/%d/i,e)}function Hi(e,t){var n=this._relativeTime[e>0?"future":"past"];return fe(n)?n(t):n.replace(/%s/i,t)}var Fs={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function re(e){return typeof e=="string"?Fs[e]||Fs[e.toLowerCase()]:void 0}function bn(e){var t={},n,s;for(s in e)B(e,s)&&(n=re(s),n&&(t[n]=e[s]));return t}var ji={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function Gi(e){var t=[],n;for(n in e)B(e,n)&&t.push({unit:n,priority:ji[n]});return t.sort(function(s,a){return s.priority-a.priority}),t}var Ws=/\d/,ne=/\d\d/,Hs=/\d{3}/,wn=/\d{4}/,bt=/[+-]?\d{6}/,U=/\d\d?/,js=/\d\d\d\d?/,Gs=/\d\d\d\d\d\d?/,wt=/\d{1,3}/,vn=/\d{1,4}/,vt=/[+-]?\d{1,6}/,Fe=/\d+/,Nt=/[+-]?\d+/,zi=/Z|[+-]\d\d:?\d\d/gi,Ct=/Z|[+-]\d\d(?::?\d\d)?/gi,qi=/[+-]?\d+(\.\d{1,3})?/,et=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,We=/^[1-9]\d?/,Nn=/^([1-9]\d|\d)/,St;St={};function g(e,t,n){St[e]=fe(t)?t:function(s,a){return s&&n?n:t}}function Zi(e,t){return B(St,e)?St[e](t._strict,t._locale):new RegExp(Ki(e))}function Ki(e){return ke(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,n,s,a,o){return n||s||a||o}))}function ke(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function oe(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function D(e){var t=+e,n=0;return t!==0&&isFinite(t)&&(n=oe(t)),n}var Cn={};function L(e,t){var n,s=t,a;for(typeof e=="string"&&(e=[e]),ge(t)&&(s=function(o,i){i[t]=D(o)}),a=e.length,n=0;n<a;n++)Cn[e[n]]=s}function tt(e,t){L(e,function(n,s,a,o){a._w=a._w||{},t(n,a._w,a,o)})}function Xi(e,t,n){t!=null&&B(Cn,e)&&Cn[e](t,n._a,n,e)}function Mt(e){return e%4===0&&e%100!==0||e%400===0}var J=0,be=1,me=2,K=3,de=4,we=5,Re=6,Ji=7,Qi=8;C("Y",0,0,function(){var e=this.year();return e<=9999?pe(e,4):"+"+e}),C(0,["YY",2],0,function(){return this.year()%100}),C(0,["YYYY",4],0,"year"),C(0,["YYYYY",5],0,"year"),C(0,["YYYYYY",6,!0],0,"year"),g("Y",Nt),g("YY",U,ne),g("YYYY",vn,wn),g("YYYYY",vt,bt),g("YYYYYY",vt,bt),L(["YYYYY","YYYYYY"],J),L("YYYY",function(e,t){t[J]=e.length===2?_.parseTwoDigitYear(e):D(e)}),L("YY",function(e,t){t[J]=_.parseTwoDigitYear(e)}),L("Y",function(e,t){t[J]=parseInt(e,10)});function nt(e){return Mt(e)?366:365}_.parseTwoDigitYear=function(e){return D(e)+(D(e)>68?1900:2e3)};var zs=He("FullYear",!0);function el(){return Mt(this.year())}function He(e,t){return function(n){return n!=null?(qs(this,e,n),_.updateOffset(this,t),this):st(this,e)}}function st(e,t){if(!e.isValid())return NaN;var n=e._d,s=e._isUTC;switch(t){case"Milliseconds":return s?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return s?n.getUTCSeconds():n.getSeconds();case"Minutes":return s?n.getUTCMinutes():n.getMinutes();case"Hours":return s?n.getUTCHours():n.getHours();case"Date":return s?n.getUTCDate():n.getDate();case"Day":return s?n.getUTCDay():n.getDay();case"Month":return s?n.getUTCMonth():n.getMonth();case"FullYear":return s?n.getUTCFullYear():n.getFullYear();default:return NaN}}function qs(e,t,n){var s,a,o,i,l;if(!(!e.isValid()||isNaN(n))){switch(s=e._d,a=e._isUTC,t){case"Milliseconds":return void(a?s.setUTCMilliseconds(n):s.setMilliseconds(n));case"Seconds":return void(a?s.setUTCSeconds(n):s.setSeconds(n));case"Minutes":return void(a?s.setUTCMinutes(n):s.setMinutes(n));case"Hours":return void(a?s.setUTCHours(n):s.setHours(n));case"Date":return void(a?s.setUTCDate(n):s.setDate(n));case"FullYear":break;default:return}o=n,i=e.month(),l=e.date(),l=l===29&&i===1&&!Mt(o)?28:l,a?s.setUTCFullYear(o,i,l):s.setFullYear(o,i,l)}}function tl(e){return e=re(e),fe(this[e])?this[e]():this}function nl(e,t){if(typeof e=="object"){e=bn(e);var n=Gi(e),s,a=n.length;for(s=0;s<a;s++)this[n[s].unit](e[n[s].unit])}else if(e=re(e),fe(this[e]))return this[e](t);return this}function sl(e,t){return(e%t+t)%t}var q;Array.prototype.indexOf?q=Array.prototype.indexOf:q=function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1};function Sn(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=sl(t,12);return e+=(t-n)/12,n===1?Mt(e)?29:28:31-n%7%2}C("M",["MM",2],"Mo",function(){return this.month()+1}),C("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),C("MMMM",0,0,function(e){return this.localeData().months(this,e)}),g("M",U,We),g("MM",U,ne),g("MMM",function(e,t){return t.monthsShortRegex(e)}),g("MMMM",function(e,t){return t.monthsRegex(e)}),L(["M","MM"],function(e,t){t[be]=D(e)-1}),L(["MMM","MMMM"],function(e,t,n,s){var a=n._locale.monthsParse(e,s,n._strict);a!=null?t[be]=a:T(n).invalidMonth=e});var al="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Zs="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Ks=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,rl=et,ol=et;function il(e,t){return e?ie(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Ks).test(t)?"format":"standalone"][e.month()]:ie(this._months)?this._months:this._months.standalone}function ll(e,t){return e?ie(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Ks.test(t)?"format":"standalone"][e.month()]:ie(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function dl(e,t,n){var s,a,o,i=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)o=he([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(o,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(o,"").toLocaleLowerCase();return n?t==="MMM"?(a=q.call(this._shortMonthsParse,i),a!==-1?a:null):(a=q.call(this._longMonthsParse,i),a!==-1?a:null):t==="MMM"?(a=q.call(this._shortMonthsParse,i),a!==-1?a:(a=q.call(this._longMonthsParse,i),a!==-1?a:null)):(a=q.call(this._longMonthsParse,i),a!==-1?a:(a=q.call(this._shortMonthsParse,i),a!==-1?a:null))}function cl(e,t,n){var s,a,o;if(this._monthsParseExact)return dl.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(a=he([2e3,s]),n&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),!n&&!this._monthsParse[s]&&(o="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[s]=new RegExp(o.replace(".",""),"i")),n&&t==="MMMM"&&this._longMonthsParse[s].test(e))return s;if(n&&t==="MMM"&&this._shortMonthsParse[s].test(e))return s;if(!n&&this._monthsParse[s].test(e))return s}}function Xs(e,t){if(!e.isValid())return e;if(typeof t=="string"){if(/^\d+$/.test(t))t=D(t);else if(t=e.localeData().monthsParse(t),!ge(t))return e}var n=t,s=e.date();return s=s<29?s:Math.min(s,Sn(e.year(),n)),e._isUTC?e._d.setUTCMonth(n,s):e._d.setMonth(n,s),e}function Js(e){return e!=null?(Xs(this,e),_.updateOffset(this,!0),this):st(this,"Month")}function ul(){return Sn(this.year(),this.month())}function hl(e){return this._monthsParseExact?(B(this,"_monthsRegex")||Qs.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(B(this,"_monthsShortRegex")||(this._monthsShortRegex=rl),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function fl(e){return this._monthsParseExact?(B(this,"_monthsRegex")||Qs.call(this),e?this._monthsStrictRegex:this._monthsRegex):(B(this,"_monthsRegex")||(this._monthsRegex=ol),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function Qs(){function e(d,c){return c.length-d.length}var t=[],n=[],s=[],a,o,i,l;for(a=0;a<12;a++)o=he([2e3,a]),i=ke(this.monthsShort(o,"")),l=ke(this.months(o,"")),t.push(i),n.push(l),s.push(l),s.push(i);t.sort(e),n.sort(e),s.sort(e),this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")","i")}function pl(e,t,n,s,a,o,i){var l;return e<100&&e>=0?(l=new Date(e+400,t,n,s,a,o,i),isFinite(l.getFullYear())&&l.setFullYear(e)):l=new Date(e,t,n,s,a,o,i),l}function at(e){var t,n;return e<100&&e>=0?(n=Array.prototype.slice.call(arguments),n[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Ot(e,t,n){var s=7+t-n,a=(7+at(e,0,s).getUTCDay()-t)%7;return-a+s-1}function ea(e,t,n,s,a){var o=(7+n-s)%7,i=Ot(e,s,a),l=1+7*(t-1)+o+i,d,c;return l<=0?(d=e-1,c=nt(d)+l):l>nt(e)?(d=e+1,c=l-nt(e)):(d=e,c=l),{year:d,dayOfYear:c}}function rt(e,t,n){var s=Ot(e.year(),t,n),a=Math.floor((e.dayOfYear()-s-1)/7)+1,o,i;return a<1?(i=e.year()-1,o=a+ve(i,t,n)):a>ve(e.year(),t,n)?(o=a-ve(e.year(),t,n),i=e.year()+1):(i=e.year(),o=a),{week:o,year:i}}function ve(e,t,n){var s=Ot(e,t,n),a=Ot(e+1,t,n);return(nt(e)-s+a)/7}C("w",["ww",2],"wo","week"),C("W",["WW",2],"Wo","isoWeek"),g("w",U,We),g("ww",U,ne),g("W",U,We),g("WW",U,ne),tt(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=D(e)});function ml(e){return rt(e,this._week.dow,this._week.doy).week}var _l={dow:0,doy:6};function yl(){return this._week.dow}function gl(){return this._week.doy}function kl(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function bl(e){var t=rt(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}C("d",0,"do","day"),C("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),C("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),C("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),C("e",0,0,"weekday"),C("E",0,0,"isoWeekday"),g("d",U),g("e",U),g("E",U),g("dd",function(e,t){return t.weekdaysMinRegex(e)}),g("ddd",function(e,t){return t.weekdaysShortRegex(e)}),g("dddd",function(e,t){return t.weekdaysRegex(e)}),tt(["dd","ddd","dddd"],function(e,t,n,s){var a=n._locale.weekdaysParse(e,s,n._strict);a!=null?t.d=a:T(n).invalidWeekday=e}),tt(["d","e","E"],function(e,t,n,s){t[s]=D(e)});function wl(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function vl(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Mn(e,t){return e.slice(t,7).concat(e.slice(0,t))}var Nl="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),ta="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Cl="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Sl=et,Ml=et,Ol=et;function El(e,t){var n=ie(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?Mn(n,this._week.dow):e?n[e.day()]:n}function Tl(e){return e===!0?Mn(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function Il(e){return e===!0?Mn(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function xl(e,t,n){var s,a,o,i=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)o=he([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(o,"").toLocaleLowerCase();return n?t==="dddd"?(a=q.call(this._weekdaysParse,i),a!==-1?a:null):t==="ddd"?(a=q.call(this._shortWeekdaysParse,i),a!==-1?a:null):(a=q.call(this._minWeekdaysParse,i),a!==-1?a:null):t==="dddd"?(a=q.call(this._weekdaysParse,i),a!==-1||(a=q.call(this._shortWeekdaysParse,i),a!==-1)?a:(a=q.call(this._minWeekdaysParse,i),a!==-1?a:null)):t==="ddd"?(a=q.call(this._shortWeekdaysParse,i),a!==-1||(a=q.call(this._weekdaysParse,i),a!==-1)?a:(a=q.call(this._minWeekdaysParse,i),a!==-1?a:null)):(a=q.call(this._minWeekdaysParse,i),a!==-1||(a=q.call(this._weekdaysParse,i),a!==-1)?a:(a=q.call(this._shortWeekdaysParse,i),a!==-1?a:null))}function Dl(e,t,n){var s,a,o;if(this._weekdaysParseExact)return xl.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(a=he([2e3,1]).day(s),n&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(a,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(a,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(a,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(o="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[s]=new RegExp(o.replace(".",""),"i")),n&&t==="dddd"&&this._fullWeekdaysParse[s].test(e))return s;if(n&&t==="ddd"&&this._shortWeekdaysParse[s].test(e))return s;if(n&&t==="dd"&&this._minWeekdaysParse[s].test(e))return s;if(!n&&this._weekdaysParse[s].test(e))return s}}function Yl(e){if(!this.isValid())return e!=null?this:NaN;var t=st(this,"Day");return e!=null?(e=wl(e,this.localeData()),this.add(e-t,"d")):t}function Rl(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function Bl(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=vl(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function Vl(e){return this._weekdaysParseExact?(B(this,"_weekdaysRegex")||On.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(B(this,"_weekdaysRegex")||(this._weekdaysRegex=Sl),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function Pl(e){return this._weekdaysParseExact?(B(this,"_weekdaysRegex")||On.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(B(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Ml),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Ll(e){return this._weekdaysParseExact?(B(this,"_weekdaysRegex")||On.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(B(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ol),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function On(){function e(u,y){return y.length-u.length}var t=[],n=[],s=[],a=[],o,i,l,d,c;for(o=0;o<7;o++)i=he([2e3,1]).day(o),l=ke(this.weekdaysMin(i,"")),d=ke(this.weekdaysShort(i,"")),c=ke(this.weekdays(i,"")),t.push(l),n.push(d),s.push(c),a.push(l),a.push(d),a.push(c);t.sort(e),n.sort(e),s.sort(e),a.sort(e),this._weekdaysRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function En(){return this.hours()%12||12}function Al(){return this.hours()||24}C("H",["HH",2],0,"hour"),C("h",["hh",2],0,En),C("k",["kk",2],0,Al),C("hmm",0,0,function(){return""+En.apply(this)+pe(this.minutes(),2)}),C("hmmss",0,0,function(){return""+En.apply(this)+pe(this.minutes(),2)+pe(this.seconds(),2)}),C("Hmm",0,0,function(){return""+this.hours()+pe(this.minutes(),2)}),C("Hmmss",0,0,function(){return""+this.hours()+pe(this.minutes(),2)+pe(this.seconds(),2)});function na(e,t){C(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}na("a",!0),na("A",!1);function sa(e,t){return t._meridiemParse}g("a",sa),g("A",sa),g("H",U,Nn),g("h",U,We),g("k",U,We),g("HH",U,ne),g("hh",U,ne),g("kk",U,ne),g("hmm",js),g("hmmss",Gs),g("Hmm",js),g("Hmmss",Gs),L(["H","HH"],K),L(["k","kk"],function(e,t,n){var s=D(e);t[K]=s===24?0:s}),L(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),L(["h","hh"],function(e,t,n){t[K]=D(e),T(n).bigHour=!0}),L("hmm",function(e,t,n){var s=e.length-2;t[K]=D(e.substr(0,s)),t[de]=D(e.substr(s)),T(n).bigHour=!0}),L("hmmss",function(e,t,n){var s=e.length-4,a=e.length-2;t[K]=D(e.substr(0,s)),t[de]=D(e.substr(s,2)),t[we]=D(e.substr(a)),T(n).bigHour=!0}),L("Hmm",function(e,t,n){var s=e.length-2;t[K]=D(e.substr(0,s)),t[de]=D(e.substr(s))}),L("Hmmss",function(e,t,n){var s=e.length-4,a=e.length-2;t[K]=D(e.substr(0,s)),t[de]=D(e.substr(s,2)),t[we]=D(e.substr(a))});function $l(e){return(e+"").toLowerCase().charAt(0)==="p"}var Ul=/[ap]\.?m?\.?/i,Fl=He("Hours",!0);function Wl(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var aa={calendar:xi,longDateFormat:Bi,invalidDate:Pi,ordinal:Ai,dayOfMonthOrdinalParse:$i,relativeTime:Fi,months:al,monthsShort:Zs,week:_l,weekdays:Nl,weekdaysMin:Cl,weekdaysShort:ta,meridiemParse:Ul},j={},ot={},it;function Hl(e,t){var n,s=Math.min(e.length,t.length);for(n=0;n<s;n+=1)if(e[n]!==t[n])return n;return s}function ra(e){return e&&e.toLowerCase().replace("_","-")}function jl(e){for(var t=0,n,s,a,o;t<e.length;){for(o=ra(e[t]).split("-"),n=o.length,s=ra(e[t+1]),s=s?s.split("-"):null;n>0;){if(a=Et(o.slice(0,n).join("-")),a)return a;if(s&&s.length>=n&&Hl(o,s)>=n-1)break;n--}t++}return it}function Gl(e){return!!(e&&e.match("^[^/\\\\]*$"))}function Et(e){var t=null,n;if(j[e]===void 0&&typeof module<"u"&&module&&module.exports&&Gl(e))try{t=it._abbr,n=require,n("./locale/"+e),Ie(t)}catch{j[e]=null}return j[e]}function Ie(e,t){var n;return e&&(ee(t)?n=Ne(e):n=Tn(e,t),n?it=n:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),it._abbr}function Tn(e,t){if(t!==null){var n,s=aa;if(t.abbr=e,j[e]!=null)$s("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=j[e]._config;else if(t.parentLocale!=null)if(j[t.parentLocale]!=null)s=j[t.parentLocale]._config;else if(n=Et(t.parentLocale),n!=null)s=n._config;else return ot[t.parentLocale]||(ot[t.parentLocale]=[]),ot[t.parentLocale].push({name:e,config:t}),null;return j[e]=new _n(mn(s,t)),ot[e]&&ot[e].forEach(function(a){Tn(a.name,a.config)}),Ie(e),j[e]}else return delete j[e],null}function zl(e,t){if(t!=null){var n,s,a=aa;j[e]!=null&&j[e].parentLocale!=null?j[e].set(mn(j[e]._config,t)):(s=Et(e),s!=null&&(a=s._config),t=mn(a,t),s==null&&(t.abbr=e),n=new _n(t),n.parentLocale=j[e],j[e]=n),Ie(e)}else j[e]!=null&&(j[e].parentLocale!=null?(j[e]=j[e].parentLocale,e===Ie()&&Ie(e)):j[e]!=null&&delete j[e]);return j[e]}function Ne(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return it;if(!ie(e)){if(t=Et(e),t)return t;e=[e]}return jl(e)}function ql(){return yn(j)}function In(e){var t,n=e._a;return n&&T(e).overflow===-2&&(t=n[be]<0||n[be]>11?be:n[me]<1||n[me]>Sn(n[J],n[be])?me:n[K]<0||n[K]>24||n[K]===24&&(n[de]!==0||n[we]!==0||n[Re]!==0)?K:n[de]<0||n[de]>59?de:n[we]<0||n[we]>59?we:n[Re]<0||n[Re]>999?Re:-1,T(e)._overflowDayOfYear&&(t<J||t>me)&&(t=me),T(e)._overflowWeeks&&t===-1&&(t=Ji),T(e)._overflowWeekday&&t===-1&&(t=Qi),T(e).overflow=t),e}var Zl=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Kl=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Xl=/Z|[+-]\d\d(?::?\d\d)?/,Tt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],xn=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Jl=/^\/?Date\((-?\d+)/i,Ql=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,ed={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function oa(e){var t,n,s=e._i,a=Zl.exec(s)||Kl.exec(s),o,i,l,d,c=Tt.length,u=xn.length;if(a){for(T(e).iso=!0,t=0,n=c;t<n;t++)if(Tt[t][1].exec(a[1])){i=Tt[t][0],o=Tt[t][2]!==!1;break}if(i==null){e._isValid=!1;return}if(a[3]){for(t=0,n=u;t<n;t++)if(xn[t][1].exec(a[3])){l=(a[2]||" ")+xn[t][0];break}if(l==null){e._isValid=!1;return}}if(!o&&l!=null){e._isValid=!1;return}if(a[4])if(Xl.exec(a[4]))d="Z";else{e._isValid=!1;return}e._f=i+(l||"")+(d||""),Yn(e)}else e._isValid=!1}function td(e,t,n,s,a,o){var i=[nd(e),Zs.indexOf(t),parseInt(n,10),parseInt(s,10),parseInt(a,10)];return o&&i.push(parseInt(o,10)),i}function nd(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function sd(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function ad(e,t,n){if(e){var s=ta.indexOf(e),a=new Date(t[0],t[1],t[2]).getDay();if(s!==a)return T(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function rd(e,t,n){if(e)return ed[e];if(t)return 0;var s=parseInt(n,10),a=s%100,o=(s-a)/100;return o*60+a}function ia(e){var t=Ql.exec(sd(e._i)),n;if(t){if(n=td(t[4],t[3],t[2],t[5],t[6],t[7]),!ad(t[1],n,e))return;e._a=n,e._tzm=rd(t[8],t[9],t[10]),e._d=at.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),T(e).rfc2822=!0}else e._isValid=!1}function od(e){var t=Jl.exec(e._i);if(t!==null){e._d=new Date(+t[1]);return}if(oa(e),e._isValid===!1)delete e._isValid;else return;if(ia(e),e._isValid===!1)delete e._isValid;else return;e._strict?e._isValid=!1:_.createFromInputFallback(e)}_.createFromInputFallback=ae("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))});function je(e,t,n){return e??t??n}function id(e){var t=new Date(_.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Dn(e){var t,n,s=[],a,o,i;if(!e._d){for(a=id(e),e._w&&e._a[me]==null&&e._a[be]==null&&ld(e),e._dayOfYear!=null&&(i=je(e._a[J],a[J]),(e._dayOfYear>nt(i)||e._dayOfYear===0)&&(T(e)._overflowDayOfYear=!0),n=at(i,0,e._dayOfYear),e._a[be]=n.getUTCMonth(),e._a[me]=n.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=s[t]=a[t];for(;t<7;t++)e._a[t]=s[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[K]===24&&e._a[de]===0&&e._a[we]===0&&e._a[Re]===0&&(e._nextDay=!0,e._a[K]=0),e._d=(e._useUTC?at:pl).apply(null,s),o=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[K]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==o&&(T(e).weekdayMismatch=!0)}}function ld(e){var t,n,s,a,o,i,l,d,c;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(o=1,i=4,n=je(t.GG,e._a[J],rt(F(),1,4).year),s=je(t.W,1),a=je(t.E,1),(a<1||a>7)&&(d=!0)):(o=e._locale._week.dow,i=e._locale._week.doy,c=rt(F(),o,i),n=je(t.gg,e._a[J],c.year),s=je(t.w,c.week),t.d!=null?(a=t.d,(a<0||a>6)&&(d=!0)):t.e!=null?(a=t.e+o,(t.e<0||t.e>6)&&(d=!0)):a=o),s<1||s>ve(n,o,i)?T(e)._overflowWeeks=!0:d!=null?T(e)._overflowWeekday=!0:(l=ea(n,s,a,o,i),e._a[J]=l.year,e._dayOfYear=l.dayOfYear)}_.ISO_8601=function(){},_.RFC_2822=function(){};function Yn(e){if(e._f===_.ISO_8601){oa(e);return}if(e._f===_.RFC_2822){ia(e);return}e._a=[],T(e).empty=!0;var t=""+e._i,n,s,a,o,i,l=t.length,d=0,c,u;for(a=Us(e._f,e._locale).match(gn)||[],u=a.length,n=0;n<u;n++)o=a[n],s=(t.match(Zi(o,e))||[])[0],s&&(i=t.substr(0,t.indexOf(s)),i.length>0&&T(e).unusedInput.push(i),t=t.slice(t.indexOf(s)+s.length),d+=s.length),Ue[o]?(s?T(e).empty=!1:T(e).unusedTokens.push(o),Xi(o,s,e)):e._strict&&!s&&T(e).unusedTokens.push(o);T(e).charsLeftOver=l-d,t.length>0&&T(e).unusedInput.push(t),e._a[K]<=12&&T(e).bigHour===!0&&e._a[K]>0&&(T(e).bigHour=void 0),T(e).parsedDateParts=e._a.slice(0),T(e).meridiem=e._meridiem,e._a[K]=dd(e._locale,e._a[K],e._meridiem),c=T(e).era,c!==null&&(e._a[J]=e._locale.erasConvertYear(c,e._a[J])),Dn(e),In(e)}function dd(e,t,n){var s;return n==null?t:e.meridiemHour!=null?e.meridiemHour(t,n):(e.isPM!=null&&(s=e.isPM(n),s&&t<12&&(t+=12),!s&&t===12&&(t=0)),t)}function cd(e){var t,n,s,a,o,i,l=!1,d=e._f.length;if(d===0){T(e).invalidFormat=!0,e._d=new Date(NaN);return}for(a=0;a<d;a++)o=0,i=!1,t=pn({},e),e._useUTC!=null&&(t._useUTC=e._useUTC),t._f=e._f[a],Yn(t),hn(t)&&(i=!0),o+=T(t).charsLeftOver,o+=T(t).unusedTokens.length*10,T(t).score=o,l?o<s&&(s=o,n=t):(s==null||o<s||i)&&(s=o,n=t,i&&(l=!0));Te(e,n||t)}function ud(e){if(!e._d){var t=bn(e._i),n=t.day===void 0?t.date:t.day;e._a=Vs([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(s){return s&&parseInt(s,10)}),Dn(e)}}function hd(e){var t=new Qe(In(la(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function la(e){var t=e._i,n=e._f;return e._locale=e._locale||Ne(e._l),t===null||n===void 0&&t===""?yt({nullInput:!0}):(typeof t=="string"&&(e._i=t=e._locale.preparse(t)),le(t)?new Qe(In(t)):(Je(t)?e._d=t:ie(n)?cd(e):n?Yn(e):fd(e),hn(e)||(e._d=null),e))}function fd(e){var t=e._i;ee(t)?e._d=new Date(_.now()):Je(t)?e._d=new Date(t.valueOf()):typeof t=="string"?od(e):ie(t)?(e._a=Vs(t.slice(0),function(n){return parseInt(n,10)}),Dn(e)):Ye(t)?ud(e):ge(t)?e._d=new Date(t):_.createFromInputFallback(e)}function da(e,t,n,s,a){var o={};return(t===!0||t===!1)&&(s=t,t=void 0),(n===!0||n===!1)&&(s=n,n=void 0),(Ye(e)&&cn(e)||ie(e)&&e.length===0)&&(e=void 0),o._isAMomentObject=!0,o._useUTC=o._isUTC=a,o._l=n,o._i=e,o._f=t,o._strict=s,hd(o)}function F(e,t,n,s){return da(e,t,n,s,!1)}var pd=ae("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=F.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:yt()}),md=ae("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=F.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:yt()});function ca(e,t){var n,s;if(t.length===1&&ie(t[0])&&(t=t[0]),!t.length)return F();for(n=t[0],s=1;s<t.length;++s)(!t[s].isValid()||t[s][e](n))&&(n=t[s]);return n}function _d(){var e=[].slice.call(arguments,0);return ca("isBefore",e)}function yd(){var e=[].slice.call(arguments,0);return ca("isAfter",e)}var gd=function(){return Date.now?Date.now():+new Date},lt=["year","quarter","month","week","day","hour","minute","second","millisecond"];function kd(e){var t,n=!1,s,a=lt.length;for(t in e)if(B(e,t)&&!(q.call(lt,t)!==-1&&(e[t]==null||!isNaN(e[t]))))return!1;for(s=0;s<a;++s)if(e[lt[s]]){if(n)return!1;parseFloat(e[lt[s]])!==D(e[lt[s]])&&(n=!0)}return!0}function bd(){return this._isValid}function wd(){return ce(NaN)}function It(e){var t=bn(e),n=t.year||0,s=t.quarter||0,a=t.month||0,o=t.week||t.isoWeek||0,i=t.day||0,l=t.hour||0,d=t.minute||0,c=t.second||0,u=t.millisecond||0;this._isValid=kd(t),this._milliseconds=+u+c*1e3+d*6e4+l*1e3*60*60,this._days=+i+o*7,this._months=+a+s*3+n*12,this._data={},this._locale=Ne(),this._bubble()}function xt(e){return e instanceof It}function Rn(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function vd(e,t,n){var s=Math.min(e.length,t.length),a=Math.abs(e.length-t.length),o=0,i;for(i=0;i<s;i++)D(e[i])!==D(t[i])&&o++;return o+a}function ua(e,t){C(e,0,0,function(){var n=this.utcOffset(),s="+";return n<0&&(n=-n,s="-"),s+pe(~~(n/60),2)+t+pe(~~n%60,2)})}ua("Z",":"),ua("ZZ",""),g("Z",Ct),g("ZZ",Ct),L(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Bn(Ct,e)});var Nd=/([\+\-]|\d\d)/gi;function Bn(e,t){var n=(t||"").match(e),s,a,o;return n===null?null:(s=n[n.length-1]||[],a=(s+"").match(Nd)||["-",0,0],o=+(a[1]*60)+D(a[2]),o===0?0:a[0]==="+"?o:-o)}function Vn(e,t){var n,s;return t._isUTC?(n=t.clone(),s=(le(e)||Je(e)?e.valueOf():F(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+s),_.updateOffset(n,!1),n):F(e).local()}function Pn(e){return-Math.round(e._d.getTimezoneOffset())}_.updateOffset=function(){};function Cd(e,t,n){var s=this._offset||0,a;if(!this.isValid())return e!=null?this:NaN;if(e!=null){if(typeof e=="string"){if(e=Bn(Ct,e),e===null)return this}else Math.abs(e)<16&&!n&&(e=e*60);return!this._isUTC&&t&&(a=Pn(this)),this._offset=e,this._isUTC=!0,a!=null&&this.add(a,"m"),s!==e&&(!t||this._changeInProgress?ma(this,ce(e-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,_.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?s:Pn(this)}function Sd(e,t){return e!=null?(typeof e!="string"&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function Md(e){return this.utcOffset(0,e)}function Od(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Pn(this),"m")),this}function Ed(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var e=Bn(zi,this._i);e!=null?this.utcOffset(e):this.utcOffset(0,!0)}return this}function Td(e){return this.isValid()?(e=e?F(e).utcOffset():0,(this.utcOffset()-e)%60===0):!1}function Id(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function xd(){if(!ee(this._isDSTShifted))return this._isDSTShifted;var e={},t;return pn(e,this),e=la(e),e._a?(t=e._isUTC?he(e._a):F(e._a),this._isDSTShifted=this.isValid()&&vd(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Dd(){return this.isValid()?!this._isUTC:!1}function Yd(){return this.isValid()?this._isUTC:!1}function ha(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Rd=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Bd=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function ce(e,t){var n=e,s=null,a,o,i;return xt(e)?n={ms:e._milliseconds,d:e._days,M:e._months}:ge(e)||!isNaN(+e)?(n={},t?n[t]=+e:n.milliseconds=+e):(s=Rd.exec(e))?(a=s[1]==="-"?-1:1,n={y:0,d:D(s[me])*a,h:D(s[K])*a,m:D(s[de])*a,s:D(s[we])*a,ms:D(Rn(s[Re]*1e3))*a}):(s=Bd.exec(e))?(a=s[1]==="-"?-1:1,n={y:Be(s[2],a),M:Be(s[3],a),w:Be(s[4],a),d:Be(s[5],a),h:Be(s[6],a),m:Be(s[7],a),s:Be(s[8],a)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(i=Vd(F(n.from),F(n.to)),n={},n.ms=i.milliseconds,n.M=i.months),o=new It(n),xt(e)&&B(e,"_locale")&&(o._locale=e._locale),xt(e)&&B(e,"_isValid")&&(o._isValid=e._isValid),o}ce.fn=It.prototype,ce.invalid=wd;function Be(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function fa(e,t){var n={};return n.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function Vd(e,t){var n;return e.isValid()&&t.isValid()?(t=Vn(t,e),e.isBefore(t)?n=fa(e,t):(n=fa(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function pa(e,t){return function(n,s){var a,o;return s!==null&&!isNaN(+s)&&($s(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=n,n=s,s=o),a=ce(n,s),ma(this,a,e),this}}function ma(e,t,n,s){var a=t._milliseconds,o=Rn(t._days),i=Rn(t._months);e.isValid()&&(s=s??!0,i&&Xs(e,st(e,"Month")+i*n),o&&qs(e,"Date",st(e,"Date")+o*n),a&&e._d.setTime(e._d.valueOf()+a*n),s&&_.updateOffset(e,o||i))}var Pd=pa(1,"add"),Ld=pa(-1,"subtract");function _a(e){return typeof e=="string"||e instanceof String}function Ad(e){return le(e)||Je(e)||_a(e)||ge(e)||Ud(e)||$d(e)||e===null||e===void 0}function $d(e){var t=Ye(e)&&!cn(e),n=!1,s=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],a,o,i=s.length;for(a=0;a<i;a+=1)o=s[a],n=n||B(e,o);return t&&n}function Ud(e){var t=ie(e),n=!1;return t&&(n=e.filter(function(s){return!ge(s)&&_a(e)}).length===0),t&&n}function Fd(e){var t=Ye(e)&&!cn(e),n=!1,s=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],a,o;for(a=0;a<s.length;a+=1)o=s[a],n=n||B(e,o);return t&&n}function Wd(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function Hd(e,t){arguments.length===1&&(arguments[0]?Ad(arguments[0])?(e=arguments[0],t=void 0):Fd(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||F(),s=Vn(n,this).startOf("day"),a=_.calendarFormat(this,s)||"sameElse",o=t&&(fe(t[a])?t[a].call(this,n):t[a]);return this.format(o||this.localeData().calendar(a,this,F(n)))}function jd(){return new Qe(this)}function Gd(e,t){var n=le(e)?e:F(e);return this.isValid()&&n.isValid()?(t=re(t)||"millisecond",t==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf()):!1}function zd(e,t){var n=le(e)?e:F(e);return this.isValid()&&n.isValid()?(t=re(t)||"millisecond",t==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf()):!1}function qd(e,t,n,s){var a=le(e)?e:F(e),o=le(t)?t:F(t);return this.isValid()&&a.isValid()&&o.isValid()?(s=s||"()",(s[0]==="("?this.isAfter(a,n):!this.isBefore(a,n))&&(s[1]===")"?this.isBefore(o,n):!this.isAfter(o,n))):!1}function Zd(e,t){var n=le(e)?e:F(e),s;return this.isValid()&&n.isValid()?(t=re(t)||"millisecond",t==="millisecond"?this.valueOf()===n.valueOf():(s=n.valueOf(),this.clone().startOf(t).valueOf()<=s&&s<=this.clone().endOf(t).valueOf())):!1}function Kd(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function Xd(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function Jd(e,t,n){var s,a,o;if(!this.isValid())return NaN;if(s=Vn(e,this),!s.isValid())return NaN;switch(a=(s.utcOffset()-this.utcOffset())*6e4,t=re(t),t){case"year":o=Dt(this,s)/12;break;case"month":o=Dt(this,s);break;case"quarter":o=Dt(this,s)/3;break;case"second":o=(this-s)/1e3;break;case"minute":o=(this-s)/6e4;break;case"hour":o=(this-s)/36e5;break;case"day":o=(this-s-a)/864e5;break;case"week":o=(this-s-a)/6048e5;break;default:o=this-s}return n?o:oe(o)}function Dt(e,t){if(e.date()<t.date())return-Dt(t,e);var n=(t.year()-e.year())*12+(t.month()-e.month()),s=e.clone().add(n,"months"),a,o;return t-s<0?(a=e.clone().add(n-1,"months"),o=(t-s)/(s-a)):(a=e.clone().add(n+1,"months"),o=(t-s)/(a-s)),-(n+o)||0}_.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",_.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Qd(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function ec(e){if(!this.isValid())return null;var t=e!==!0,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?kt(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):fe(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",kt(n,"Z")):kt(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function tc(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",n,s,a,o;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),n="["+e+'("]',s=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",a="-MM-DD[T]HH:mm:ss.SSS",o=t+'[")]',this.format(n+s+a+o)}function nc(e){e||(e=this.isUtc()?_.defaultFormatUtc:_.defaultFormat);var t=kt(this,e);return this.localeData().postformat(t)}function sc(e,t){return this.isValid()&&(le(e)&&e.isValid()||F(e).isValid())?ce({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function ac(e){return this.from(F(),e)}function rc(e,t){return this.isValid()&&(le(e)&&e.isValid()||F(e).isValid())?ce({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function oc(e){return this.to(F(),e)}function ya(e){var t;return e===void 0?this._locale._abbr:(t=Ne(e),t!=null&&(this._locale=t),this)}var ga=ae("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===void 0?this.localeData():this.locale(e)});function ka(){return this._locale}var Yt=1e3,Ge=60*Yt,Rt=60*Ge,ba=(365*400+97)*24*Rt;function ze(e,t){return(e%t+t)%t}function wa(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-ba:new Date(e,t,n).valueOf()}function va(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-ba:Date.UTC(e,t,n)}function ic(e){var t,n;if(e=re(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?va:wa,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=ze(t+(this._isUTC?0:this.utcOffset()*Ge),Rt);break;case"minute":t=this._d.valueOf(),t-=ze(t,Ge);break;case"second":t=this._d.valueOf(),t-=ze(t,Yt);break}return this._d.setTime(t),_.updateOffset(this,!0),this}function lc(e){var t,n;if(e=re(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?va:wa,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=Rt-ze(t+(this._isUTC?0:this.utcOffset()*Ge),Rt)-1;break;case"minute":t=this._d.valueOf(),t+=Ge-ze(t,Ge)-1;break;case"second":t=this._d.valueOf(),t+=Yt-ze(t,Yt)-1;break}return this._d.setTime(t),_.updateOffset(this,!0),this}function dc(){return this._d.valueOf()-(this._offset||0)*6e4}function cc(){return Math.floor(this.valueOf()/1e3)}function uc(){return new Date(this.valueOf())}function hc(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function fc(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function pc(){return this.isValid()?this.toISOString():null}function mc(){return hn(this)}function _c(){return Te({},T(this))}function yc(){return T(this).overflow}function gc(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}C("N",0,0,"eraAbbr"),C("NN",0,0,"eraAbbr"),C("NNN",0,0,"eraAbbr"),C("NNNN",0,0,"eraName"),C("NNNNN",0,0,"eraNarrow"),C("y",["y",1],"yo","eraYear"),C("y",["yy",2],0,"eraYear"),C("y",["yyy",3],0,"eraYear"),C("y",["yyyy",4],0,"eraYear"),g("N",Ln),g("NN",Ln),g("NNN",Ln),g("NNNN",Tc),g("NNNNN",Ic),L(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,s){var a=n._locale.erasParse(e,s,n._strict);a?T(n).era=a:T(n).invalidEra=e}),g("y",Fe),g("yy",Fe),g("yyy",Fe),g("yyyy",Fe),g("yo",xc),L(["y","yy","yyy","yyyy"],J),L(["yo"],function(e,t,n,s){var a;n._locale._eraYearOrdinalRegex&&(a=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[J]=n._locale.eraYearOrdinalParse(e,a):t[J]=parseInt(e,10)});function kc(e,t){var n,s,a,o=this._eras||Ne("en")._eras;for(n=0,s=o.length;n<s;++n)switch(typeof o[n].since==="string"&&(a=_(o[n].since).startOf("day"),o[n].since=a.valueOf()),typeof o[n].until){case"undefined":o[n].until=1/0;break;case"string":a=_(o[n].until).startOf("day").valueOf(),o[n].until=a.valueOf();break}return o}function bc(e,t,n){var s,a,o=this.eras(),i,l,d;for(e=e.toUpperCase(),s=0,a=o.length;s<a;++s)if(i=o[s].name.toUpperCase(),l=o[s].abbr.toUpperCase(),d=o[s].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(l===e)return o[s];break;case"NNNN":if(i===e)return o[s];break;case"NNNNN":if(d===e)return o[s];break}else if([i,l,d].indexOf(e)>=0)return o[s]}function wc(e,t){var n=e.since<=e.until?1:-1;return t===void 0?_(e.since).year():_(e.since).year()+(t-e.offset)*n}function vc(){var e,t,n,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),s[e].since<=n&&n<=s[e].until||s[e].until<=n&&n<=s[e].since)return s[e].name;return""}function Nc(){var e,t,n,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),s[e].since<=n&&n<=s[e].until||s[e].until<=n&&n<=s[e].since)return s[e].narrow;return""}function Cc(){var e,t,n,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),s[e].since<=n&&n<=s[e].until||s[e].until<=n&&n<=s[e].since)return s[e].abbr;return""}function Sc(){var e,t,n,s,a=this.localeData().eras();for(e=0,t=a.length;e<t;++e)if(n=a[e].since<=a[e].until?1:-1,s=this.clone().startOf("day").valueOf(),a[e].since<=s&&s<=a[e].until||a[e].until<=s&&s<=a[e].since)return(this.year()-_(a[e].since).year())*n+a[e].offset;return this.year()}function Mc(e){return B(this,"_erasNameRegex")||An.call(this),e?this._erasNameRegex:this._erasRegex}function Oc(e){return B(this,"_erasAbbrRegex")||An.call(this),e?this._erasAbbrRegex:this._erasRegex}function Ec(e){return B(this,"_erasNarrowRegex")||An.call(this),e?this._erasNarrowRegex:this._erasRegex}function Ln(e,t){return t.erasAbbrRegex(e)}function Tc(e,t){return t.erasNameRegex(e)}function Ic(e,t){return t.erasNarrowRegex(e)}function xc(e,t){return t._eraYearOrdinalRegex||Fe}function An(){var e=[],t=[],n=[],s=[],a,o,i,l,d,c=this.eras();for(a=0,o=c.length;a<o;++a)i=ke(c[a].name),l=ke(c[a].abbr),d=ke(c[a].narrow),t.push(i),e.push(l),n.push(d),s.push(i),s.push(l),s.push(d);this._erasRegex=new RegExp("^("+s.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+t.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+e.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}C(0,["gg",2],0,function(){return this.weekYear()%100}),C(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Bt(e,t){C(0,[e,e.length],0,t)}Bt("gggg","weekYear"),Bt("ggggg","weekYear"),Bt("GGGG","isoWeekYear"),Bt("GGGGG","isoWeekYear"),g("G",Nt),g("g",Nt),g("GG",U,ne),g("gg",U,ne),g("GGGG",vn,wn),g("gggg",vn,wn),g("GGGGG",vt,bt),g("ggggg",vt,bt),tt(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,s){t[s.substr(0,2)]=D(e)}),tt(["gg","GG"],function(e,t,n,s){t[s]=_.parseTwoDigitYear(e)});function Dc(e){return Na.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Yc(e){return Na.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function Rc(){return ve(this.year(),1,4)}function Bc(){return ve(this.isoWeekYear(),1,4)}function Vc(){var e=this.localeData()._week;return ve(this.year(),e.dow,e.doy)}function Pc(){var e=this.localeData()._week;return ve(this.weekYear(),e.dow,e.doy)}function Na(e,t,n,s,a){var o;return e==null?rt(this,s,a).year:(o=ve(e,s,a),t>o&&(t=o),Lc.call(this,e,t,n,s,a))}function Lc(e,t,n,s,a){var o=ea(e,t,n,s,a),i=at(o.year,0,o.dayOfYear);return this.year(i.getUTCFullYear()),this.month(i.getUTCMonth()),this.date(i.getUTCDate()),this}C("Q",0,"Qo","quarter"),g("Q",Ws),L("Q",function(e,t){t[be]=(D(e)-1)*3});function Ac(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}C("D",["DD",2],"Do","date"),g("D",U,We),g("DD",U,ne),g("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),L(["D","DD"],me),L("Do",function(e,t){t[me]=D(e.match(U)[0])});var Ca=He("Date",!0);C("DDD",["DDDD",3],"DDDo","dayOfYear"),g("DDD",wt),g("DDDD",Hs),L(["DDD","DDDD"],function(e,t,n){n._dayOfYear=D(e)});function $c(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}C("m",["mm",2],0,"minute"),g("m",U,Nn),g("mm",U,ne),L(["m","mm"],de);var Uc=He("Minutes",!1);C("s",["ss",2],0,"second"),g("s",U,Nn),g("ss",U,ne),L(["s","ss"],we);var Fc=He("Seconds",!1);C("S",0,0,function(){return~~(this.millisecond()/100)}),C(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),C(0,["SSS",3],0,"millisecond"),C(0,["SSSS",4],0,function(){return this.millisecond()*10}),C(0,["SSSSS",5],0,function(){return this.millisecond()*100}),C(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),C(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),C(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),C(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),g("S",wt,Ws),g("SS",wt,ne),g("SSS",wt,Hs);var xe,Sa;for(xe="SSSS";xe.length<=9;xe+="S")g(xe,Fe);function Wc(e,t){t[Re]=D(("0."+e)*1e3)}for(xe="S";xe.length<=9;xe+="S")L(xe,Wc);Sa=He("Milliseconds",!1),C("z",0,0,"zoneAbbr"),C("zz",0,0,"zoneName");function Hc(){return this._isUTC?"UTC":""}function jc(){return this._isUTC?"Coordinated Universal Time":""}var h=Qe.prototype;h.add=Pd,h.calendar=Hd,h.clone=jd,h.diff=Jd,h.endOf=lc,h.format=nc,h.from=sc,h.fromNow=ac,h.to=rc,h.toNow=oc,h.get=tl,h.invalidAt=yc,h.isAfter=Gd,h.isBefore=zd,h.isBetween=qd,h.isSame=Zd,h.isSameOrAfter=Kd,h.isSameOrBefore=Xd,h.isValid=mc,h.lang=ga,h.locale=ya,h.localeData=ka,h.max=md,h.min=pd,h.parsingFlags=_c,h.set=nl,h.startOf=ic,h.subtract=Ld,h.toArray=hc,h.toObject=fc,h.toDate=uc,h.toISOString=ec,h.inspect=tc,typeof Symbol<"u"&&Symbol.for!=null&&(h[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),h.toJSON=pc,h.toString=Qd,h.unix=cc,h.valueOf=dc,h.creationData=gc,h.eraName=vc,h.eraNarrow=Nc,h.eraAbbr=Cc,h.eraYear=Sc,h.year=zs,h.isLeapYear=el,h.weekYear=Dc,h.isoWeekYear=Yc,h.quarter=h.quarters=Ac,h.month=Js,h.daysInMonth=ul,h.week=h.weeks=kl,h.isoWeek=h.isoWeeks=bl,h.weeksInYear=Vc,h.weeksInWeekYear=Pc,h.isoWeeksInYear=Rc,h.isoWeeksInISOWeekYear=Bc,h.date=Ca,h.day=h.days=Yl,h.weekday=Rl,h.isoWeekday=Bl,h.dayOfYear=$c,h.hour=h.hours=Fl,h.minute=h.minutes=Uc,h.second=h.seconds=Fc,h.millisecond=h.milliseconds=Sa,h.utcOffset=Cd,h.utc=Md,h.local=Od,h.parseZone=Ed,h.hasAlignedHourOffset=Td,h.isDST=Id,h.isLocal=Dd,h.isUtcOffset=Yd,h.isUtc=ha,h.isUTC=ha,h.zoneAbbr=Hc,h.zoneName=jc,h.dates=ae("dates accessor is deprecated. Use date instead.",Ca),h.months=ae("months accessor is deprecated. Use month instead",Js),h.years=ae("years accessor is deprecated. Use year instead",zs),h.zone=ae("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Sd),h.isDSTShifted=ae("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",xd);function Gc(e){return F(e*1e3)}function zc(){return F.apply(null,arguments).parseZone()}function Ma(e){return e}var V=_n.prototype;V.calendar=Di,V.longDateFormat=Vi,V.invalidDate=Li,V.ordinal=Ui,V.preparse=Ma,V.postformat=Ma,V.relativeTime=Wi,V.pastFuture=Hi,V.set=Ii,V.eras=kc,V.erasParse=bc,V.erasConvertYear=wc,V.erasAbbrRegex=Oc,V.erasNameRegex=Mc,V.erasNarrowRegex=Ec,V.months=il,V.monthsShort=ll,V.monthsParse=cl,V.monthsRegex=fl,V.monthsShortRegex=hl,V.week=ml,V.firstDayOfYear=gl,V.firstDayOfWeek=yl,V.weekdays=El,V.weekdaysMin=Il,V.weekdaysShort=Tl,V.weekdaysParse=Dl,V.weekdaysRegex=Vl,V.weekdaysShortRegex=Pl,V.weekdaysMinRegex=Ll,V.isPM=$l,V.meridiem=Wl;function Vt(e,t,n,s){var a=Ne(),o=he().set(s,t);return a[n](o,e)}function Oa(e,t,n){if(ge(e)&&(t=e,e=void 0),e=e||"",t!=null)return Vt(e,t,n,"month");var s,a=[];for(s=0;s<12;s++)a[s]=Vt(e,s,n,"month");return a}function $n(e,t,n,s){typeof e=="boolean"?(ge(t)&&(n=t,t=void 0),t=t||""):(t=e,n=t,e=!1,ge(t)&&(n=t,t=void 0),t=t||"");var a=Ne(),o=e?a._week.dow:0,i,l=[];if(n!=null)return Vt(t,(n+o)%7,s,"day");for(i=0;i<7;i++)l[i]=Vt(t,(i+o)%7,s,"day");return l}function qc(e,t){return Oa(e,t,"months")}function Zc(e,t){return Oa(e,t,"monthsShort")}function Kc(e,t,n){return $n(e,t,n,"weekdays")}function Xc(e,t,n){return $n(e,t,n,"weekdaysShort")}function Jc(e,t,n){return $n(e,t,n,"weekdaysMin")}Ie("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=D(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+n}}),_.lang=ae("moment.lang is deprecated. Use moment.locale instead.",Ie),_.langData=ae("moment.langData is deprecated. Use moment.localeData instead.",Ne);var Ce=Math.abs;function Qc(){var e=this._data;return this._milliseconds=Ce(this._milliseconds),this._days=Ce(this._days),this._months=Ce(this._months),e.milliseconds=Ce(e.milliseconds),e.seconds=Ce(e.seconds),e.minutes=Ce(e.minutes),e.hours=Ce(e.hours),e.months=Ce(e.months),e.years=Ce(e.years),this}function Ea(e,t,n,s){var a=ce(t,n);return e._milliseconds+=s*a._milliseconds,e._days+=s*a._days,e._months+=s*a._months,e._bubble()}function eu(e,t){return Ea(this,e,t,1)}function tu(e,t){return Ea(this,e,t,-1)}function Ta(e){return e<0?Math.floor(e):Math.ceil(e)}function nu(){var e=this._milliseconds,t=this._days,n=this._months,s=this._data,a,o,i,l,d;return e>=0&&t>=0&&n>=0||e<=0&&t<=0&&n<=0||(e+=Ta(Un(n)+t)*864e5,t=0,n=0),s.milliseconds=e%1e3,a=oe(e/1e3),s.seconds=a%60,o=oe(a/60),s.minutes=o%60,i=oe(o/60),s.hours=i%24,t+=oe(i/24),d=oe(Ia(t)),n+=d,t-=Ta(Un(d)),l=oe(n/12),n%=12,s.days=t,s.months=n,s.years=l,this}function Ia(e){return e*4800/146097}function Un(e){return e*146097/4800}function su(e){if(!this.isValid())return NaN;var t,n,s=this._milliseconds;if(e=re(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+s/864e5,n=this._months+Ia(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Un(this._months)),e){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return t*24+s/36e5;case"minute":return t*1440+s/6e4;case"second":return t*86400+s/1e3;case"millisecond":return Math.floor(t*864e5)+s;default:throw new Error("Unknown unit "+e)}}function Se(e){return function(){return this.as(e)}}var xa=Se("ms"),au=Se("s"),ru=Se("m"),ou=Se("h"),iu=Se("d"),lu=Se("w"),du=Se("M"),cu=Se("Q"),uu=Se("y"),hu=xa;function fu(){return ce(this)}function pu(e){return e=re(e),this.isValid()?this[e+"s"]():NaN}function Ve(e){return function(){return this.isValid()?this._data[e]:NaN}}var mu=Ve("milliseconds"),_u=Ve("seconds"),yu=Ve("minutes"),gu=Ve("hours"),ku=Ve("days"),bu=Ve("months"),wu=Ve("years");function vu(){return oe(this.days()/7)}var Me=Math.round,qe={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Nu(e,t,n,s,a){return a.relativeTime(t||1,!!n,e,s)}function Cu(e,t,n,s){var a=ce(e).abs(),o=Me(a.as("s")),i=Me(a.as("m")),l=Me(a.as("h")),d=Me(a.as("d")),c=Me(a.as("M")),u=Me(a.as("w")),y=Me(a.as("y")),p=o<=n.ss&&["s",o]||o<n.s&&["ss",o]||i<=1&&["m"]||i<n.m&&["mm",i]||l<=1&&["h"]||l<n.h&&["hh",l]||d<=1&&["d"]||d<n.d&&["dd",d];return n.w!=null&&(p=p||u<=1&&["w"]||u<n.w&&["ww",u]),p=p||c<=1&&["M"]||c<n.M&&["MM",c]||y<=1&&["y"]||["yy",y],p[2]=t,p[3]=+e>0,p[4]=s,Nu.apply(null,p)}function Su(e){return e===void 0?Me:typeof e=="function"?(Me=e,!0):!1}function Mu(e,t){return qe[e]===void 0?!1:t===void 0?qe[e]:(qe[e]=t,e==="s"&&(qe.ss=t-1),!0)}function Ou(e,t){if(!this.isValid())return this.localeData().invalidDate();var n=!1,s=qe,a,o;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(n=e),typeof t=="object"&&(s=Object.assign({},qe,t),t.s!=null&&t.ss==null&&(s.ss=t.s-1)),a=this.localeData(),o=Cu(this,!n,s,a),n&&(o=a.pastFuture(+this,o)),a.postformat(o)}var Fn=Math.abs;function Ze(e){return(e>0)-(e<0)||+e}function Pt(){if(!this.isValid())return this.localeData().invalidDate();var e=Fn(this._milliseconds)/1e3,t=Fn(this._days),n=Fn(this._months),s,a,o,i,l=this.asSeconds(),d,c,u,y;return l?(s=oe(e/60),a=oe(s/60),e%=60,s%=60,o=oe(n/12),n%=12,i=e?e.toFixed(3).replace(/\.?0+$/,""):"",d=l<0?"-":"",c=Ze(this._months)!==Ze(l)?"-":"",u=Ze(this._days)!==Ze(l)?"-":"",y=Ze(this._milliseconds)!==Ze(l)?"-":"",d+"P"+(o?c+o+"Y":"")+(n?c+n+"M":"")+(t?u+t+"D":"")+(a||s||e?"T":"")+(a?y+a+"H":"")+(s?y+s+"M":"")+(e?y+i+"S":"")):"P0D"}var Y=It.prototype;Y.isValid=bd,Y.abs=Qc,Y.add=eu,Y.subtract=tu,Y.as=su,Y.asMilliseconds=xa,Y.asSeconds=au,Y.asMinutes=ru,Y.asHours=ou,Y.asDays=iu,Y.asWeeks=lu,Y.asMonths=du,Y.asQuarters=cu,Y.asYears=uu,Y.valueOf=hu,Y._bubble=nu,Y.clone=fu,Y.get=pu,Y.milliseconds=mu,Y.seconds=_u,Y.minutes=yu,Y.hours=gu,Y.days=ku,Y.weeks=vu,Y.months=bu,Y.years=wu,Y.humanize=Ou,Y.toISOString=Pt,Y.toString=Pt,Y.toJSON=Pt,Y.locale=ya,Y.localeData=ka,Y.toIsoString=ae("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Pt),Y.lang=ga,C("X",0,0,"unix"),C("x",0,0,"valueOf"),g("x",Nt),g("X",qi),L("X",function(e,t,n){n._d=new Date(parseFloat(e)*1e3)}),L("x",function(e,t,n){n._d=new Date(D(e))});_.version="2.30.1",Ei(F),_.fn=h,_.min=_d,_.max=yd,_.now=gd,_.utc=he,_.unix=Gc,_.months=qc,_.isDate=Je,_.locale=Ie,_.invalid=yt,_.duration=ce,_.isMoment=le,_.weekdays=Kc,_.parseZone=zc,_.localeData=Ne,_.isDuration=xt,_.monthsShort=Zc,_.weekdaysMin=Jc,_.defineLocale=Tn,_.updateLocale=zl,_.locales=ql,_.weekdaysShort=Xc,_.normalizeUnits=re,_.relativeTimeRounding=Su,_.relativeTimeThreshold=Mu,_.calendarFormat=Wd,_.prototype=h,_.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const Eu="code-graph",Tu=(e,t="",n="json")=>{const s=document.createElement("a");s.setAttribute("href",`data:text/${n};charset=UTF-8,${encodeURIComponent(e)}`);const a=_().format("YYMMDD_HHMMSS");s.setAttribute("download",`${Eu}_${a}_${t}.${n}`),s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s)},Iu=(e="json")=>{const t=document.createElement("input");return t.setAttribute("type","file"),t.setAttribute("id","fileElem"),t.setAttribute("multiple","true"),t.setAttribute("accept",`${e}/*`),t.style.display="none",document.body.appendChild(t),t.click(),t},Wn="CLEAR_ALL",Hn="DOWNLOAD_EDITOR_STATE",Da="RUN_ENGINE",jn="TOGGLE_MINIMAP",Gn="TOGGLE_PALETTE",zn="UPLOAD_EDITOR_STATE",Ya=(e,t,n)=>{const s=n.zoomToFit.paddingLeft;t.registerCommand(Wn,{execute:()=>{t.executeCommand(O.Commands.CLEAR_CLIPBOARD_COMMAND),t.executeCommand(O.Commands.CLEAR_HISTORY_COMMAND),e.value.clear(),e.value.editor.code.clear()},canExecute:()=>e.value.nodes.length>0}),t.registerCommand(Hn,{execute:()=>{const a=e.value.editor.save();Tu(JSON.stringify(a,null,2),e.value.shortId)},canExecute:()=>e.value.nodes.length>0}),t.registerCommand(jn,{execute:()=>n.enableMinimap=!n.enableMinimap,canExecute:()=>e.value.nodes.length>1}),t.registerCommand(Gn,{execute:()=>{n.palette.enabled=!n.palette.enabled,n.zoomToFit.paddingLeft=n.palette.enabled?s:50},canExecute:()=>!0}),t.registerCommand(zn,{execute:()=>{const a=Iu();a.addEventListener("change",()=>{document.body.removeChild(a);const o=a.files;if(!o||o.length<=0)return!1;const i=new FileReader;i.onload=l=>{if(l.target?.result){const d=l.target.result;if(d.length===0)return;const c=JSON.parse(d);e.value.editor.load(c),e.value.code?.engine?.runOnce({})}},i.readAsText(o.item(0))})},canExecute:()=>!0})},Ra=e=>{const t={command:Wn,title:"Clear all",icon:r.computed(()=>ls)},n={command:Hn,title:"Download editor state",icon:r.computed(()=>rs)},s={command:jn,title:"Toggle minimap",icon:r.computed(()=>e.enableMinimap?cs:ds)},a={command:Gn,title:"Toggle palette",icon:r.computed(()=>e.palette.enabled?os:Ft)},o={command:zn,title:"Upload editor state",icon:r.computed(()=>hs)};e.toolbar.commands=[a,t,o,n,...O.DEFAULT_TOOLBAR_COMMANDS,s]},Ba=(e,t,n)=>{n.registerCommand(Da,{execute:()=>t.runOnce({}),canExecute:()=>e.nodes.length>0})};function Va(e){const t=Symbol("CodeEngineToken");e.engine=new Rs(e.editor),Ba(e.editor.graph,e.engine,e.commandHandler),e.loadEditor=n=>{e.engine?.pause(),e.displayedGraph.clear(),e.editor.load(n),e.commandHandler.executeCommand(O.Commands.CLEAR_CLIPBOARD_COMMAND),e.commandHandler.executeCommand(O.Commands.CLEAR_HISTORY_COMMAND),e.engine?.resume(),e.engine?.runOnce({})},e.newGraph=()=>{e.engine?.pause(),e.displayedGraph.clear(),e.commandHandler.executeCommand(O.Commands.CLEAR_CLIPBOARD_COMMAND),e.commandHandler.executeCommand(O.Commands.CLEAR_HISTORY_COMMAND),e.displayedGraph.id=De.v4(),e.engine?.resume(),e.engine?.runOnce({})},e.subscribe=()=>{e.displayedGraph.events.addConnection.subscribe(t,n=>{const s=e.displayedGraph.findNodeById(n.to.nodeId);s&&s.isCodeNode&&s.onConnected();const a=e.displayedGraph.findNodeById(n.from.nodeId);a&&a.isCodeNode&&a.onConnected()}),e.displayedGraph.events.removeConnection.subscribe(t,n=>{const s=e.displayedGraph.findNodeById(n.to.nodeId);s&&s.isCodeNode&&s.onUnconnected();const a=e.displayedGraph.findNodeById(n.from.nodeId);a&&a.isCodeNode&&a.onUnconnected()}),e.engine?.events.beforeRun.subscribe(t,()=>{e.engine?.pause(),e.displayedGraph.beforeRun(),e.displayedGraph.sortNodesByRank(),e.displayedGraph.sortNodes(),e.engine?.resume()}),e.engine?.events.afterRun.subscribe(t,n=>{e.engine?.pause(),ye.applyResult(n,e.editor),e.code.state.lockCode||e.code.renderCode({nodes:e.editor.graph.scriptedCodeNodes,modules:e.editor.code.modules}),e.engine?.resume()})},e.unsubscribe=()=>{e.displayedGraph.events.addConnection.unsubscribe(t),e.displayedGraph.events.removeConnection.unsubscribe(t),e.engine?.events.beforeRun.unsubscribe(t),e.engine?.events.afterRun.unsubscribe(t)}}class qn extends ln{_title="Subgraph Input";inputs={_code:new Q("_code","").use(G.setType,se).setHidden(!0),name:new O.TextInputInterface("Name","Input").setPort(!1)};outputs={_code:new Q("_code","").use(G.setType,se).setHidden(!0),placeholder:new Z.NodeInterface("Connection",void 0)}}class Zn extends dn{_title="Subgraph Output";inputs={_code:new Q("_code","").use(G.setType,se).setHidden(!0),name:new O.TextInputInterface("Name","Output").setPort(!1),placeholder:new Z.NodeInterface("Connection",void 0)};outputs={_code:new Q("_code","").use(G.setType,se).setHidden(!0),output:new Z.NodeInterface("Output",void 0).setHidden(!0)}}const Pa="CREATE_SUBGRAPH",La=[Z.GRAPH_INPUT_NODE_TYPE,Z.GRAPH_OUTPUT_NODE_TYPE];function Aa(e,t,n){const s=()=>e.value.selectedNodes.filter(o=>!La.includes(o.type)).length>0,a=()=>{const{viewModel:o}=O.useViewModel(),i=e.value,l=e.value.editor;if(i.selectedNodes.length===0)return;const d=i.selectedNodes.filter(M=>!La.includes(M.type)),c=d.flatMap(M=>Object.values(M.inputs)),u=d.flatMap(M=>Object.values(M.outputs)),y=i.connections.filter(M=>!u.includes(M.from)&&c.includes(M.to)),p=i.connections.filter(M=>u.includes(M.from)&&!c.includes(M.to)),I=i.connections.filter(M=>u.includes(M.from)&&c.includes(M.to)),k=d.map(M=>M.save()),S=I.map(M=>({id:M.id,from:M.from.id,to:M.to.id})),f=new Map,{xLeft:b,xRight:A,yTop:P}=xu(d);for(const[M,X]of y.entries()){const te=new qn;te.inputs.name.value=X.to.name,k.push({...te.save(),position:{x:A-o.value.settings.nodes.defaultWidth-100,y:P+M*200}}),S.push({id:De.v4(),from:te.outputs.placeholder.id,to:X.to.id}),f.set(X.to.id,te.graphInterfaceId)}for(const[M,X]of p.entries()){const te=new Zn;te.inputs.name.value=X.from.name,k.push({...te.save(),position:{x:b+100,y:P+M*200}}),S.push({id:De.v4(),from:X.from.id,to:te.inputs.placeholder.id}),f.set(X.from.id,te.graphInterfaceId)}const W=r.reactive(new Xe({connections:S,nodes:k,inputs:[],outputs:[]},l));l.addGraphTemplate(W);const Oe=l.nodeTypes.get(Z.getGraphNodeTypeString(W));if(!Oe)throw new Error("Unable to create subgraph: Could not find corresponding graph node type");i.activeTransactions++;const Ee=r.reactive(new Oe.type);i.addNode(Ee);const dt=Math.round(d.map(M=>M.position.x).reduce((M,X)=>M+X,0)/d.length),_e=Math.round(d.map(M=>M.position.y).reduce((M,X)=>M+X,0)/d.length);Ee.position.x=dt,Ee.position.y=_e,y.forEach(M=>{i.removeConnection(M),i.addConnection(M.from,Ee.inputs[f.get(M.to.id)])}),p.forEach(M=>{i.removeConnection(M),i.addConnection(Ee.outputs[f.get(M.from.id)],M.to)}),d.forEach(M=>i.removeNode(M)),i.activeTransactions--,t.canExecuteCommand(O.Commands.SAVE_SUBGRAPH_COMMAND)&&t.executeCommand(O.Commands.SAVE_SUBGRAPH_COMMAND),n(W),e.value.panning={...i.panning},e.value.scaling=i.scaling};t.registerCommand(Pa,{canExecute:s,execute:a})}function xu(e){const t=e.reduce((a,o)=>{const i=o.position.x;return i<a?i:a},1/0),n=e.reduce((a,o)=>{const i=o.position.y;return i<a?i:a},1/0);return{xLeft:e.reduce((a,o)=>{const i=o.position.x+o.width;return i>a?i:a},-1/0),xRight:t,yTop:n}}class Du extends Z.Editor{code;graph;constructor(t){super(),this.code=t,this.graph=new $e(this)}get graphIds(){const t=[];return this.graphs.forEach(n=>t.push(n.id)),t.map(n=>n.slice(0,6)).join(", ")}get graphTemplateIds(){const t=[];return this.graphTemplates.forEach(n=>t.push(n.id)),t.map(n=>n.slice(0,6)).join(", ")}addGraphTemplate(t){if(this.events.beforeAddGraphTemplate.emit(t).prevented)return;this._graphTemplates.push(t),this.graphTemplateEvents.addTarget(t.events),this.graphTemplateHooks.addTarget(t.hooks);const n=Ds(t);this.registerNodeType(n,{category:"Subgraphs",title:t.name}),this.events.addGraphTemplate.emit(t)}load(t){try{for(super._loading=!0,t=this.hooks.load.execute(t);this.graphTemplates.length>0;)this.removeGraphTemplate(this.graphTemplates[0]);t.graphTemplates.forEach(s=>{const a=new Xe(s,this);this.addGraphTemplate(a)});const n=this.graph.load(t.graph);return this.events.loaded.emit(),n.forEach(s=>console.warn(s)),n}finally{super._loading=!1}}registerNodeType(t,n){if(this.events.beforeRegisterNodeType.emit({type:t,options:n}).prevented)return;const s=new t;this.nodeTypes.set(s.type,{type:t,category:n?.category??"default",title:n?.title??s.title,orderRank:n?.orderRank}),this.events.registerNodeType.emit({type:t,options:n})}registerCategoryModule(t,n){this.code.state.modules[t]=n}}function Yu(e){const t=r.ref(e?.code??new mt),n=r.ref(e?.existingEditor??new Du(t.value)),s=Symbol("ViewModelToken"),a=r.ref(null),o=r.shallowReadonly(a),{switchGraph:i}=Ys(n,a),l=r.computed(()=>o.value&&o.value!==n.value.graph),d=r.reactive(O.DEFAULT_SETTINGS());d.nodes.defaultWidth=_t;const c=O.useCommandHandler(),u=O.useHistory(o,c),y=O.useClipboard(o,n,c),p={renderNode:new Qn.SequentialHook(null),renderInterface:new Qn.SequentialHook(null)},I=r.reactive({clipboard:y,code:t,commandHandler:c,displayedGraph:o,editor:n,history:u,hooks:p,isReady:!1,isSubgraph:l,onBeforeUnmount:()=>{},onMounted:()=>{},settings:d,switchGraph:i});return t.value.registerViewModel(I),Va(I),O.registerDeleteNodesCommand(o,c),Aa(o,c,i),O.registerSaveSubgraphCommand(o,c),O.registerSwitchToMainGraphCommand(o,c,i),O.registerSidebarCommands(o,c),O.registerZoomToFitCommands(o,c,d),Ya(o,c,d),Ra(d),r.watch(n,(k,S)=>{S&&(S.events.registerGraph.unsubscribe(s),S.graphEvents.beforeAddNode.unsubscribe(s),k.nodeHooks.beforeLoad.unsubscribe(s),k.nodeHooks.afterSave.unsubscribe(s),k.graphTemplateHooks.beforeLoad.unsubscribe(s),k.graphTemplateHooks.afterSave.unsubscribe(s),k.graph.hooks.load.unsubscribe(s),k.graph.hooks.save.unsubscribe(s)),k&&(k.nodeHooks.beforeLoad.subscribe(s,(f,b)=>(b.position=f.position??{x:0,y:0},b.state&&(b.state.integrated=f.integrated,f.props&&(b.state.props=f.props),f.variableName&&(b.state.variableName=f.variableName)),f)),k.nodeHooks.afterSave.subscribe(s,(f,b)=>(f.position=b.position,b.state&&(f.integrated=b.state.integrated,b.state.props&&(f.props=b.state.props),b.state.variableName&&(f.variableName=b.state.variableName)),f)),k.graphTemplateHooks.beforeLoad.subscribe(s,(f,b)=>(b.panning=f.panning,b.scaling=f.scaling,f)),k.graphTemplateHooks.afterSave.subscribe(s,(f,b)=>(f.panning=b.panning,f.scaling=b.scaling,f)),k.graph.hooks.load.subscribe(s,(f,b)=>(b.panning=f.panning,b.scaling=f.scaling,f)),k.graph.hooks.save.subscribe(s,(f,b)=>(f.panning=b.panning,f.scaling=b.scaling,f)),k.graphEvents.beforeAddNode.subscribe(s,f=>O.setViewNodeProperties(f,{defaultWidth:d.nodes.defaultWidth})),n.value.registerNodeType(qn,{category:"Subgraphs"}),n.value.registerNodeType(Zn,{category:"Subgraphs"}),i(k.graph))},{immediate:!0}),r.nextTick(()=>I.isReady=!0),I}const Ru=Object.freeze(Object.defineProperty({__proto__:null,default:`{{ #modules }}
|
|
5
|
+
`+new Error().stack),n=!1}return t.apply(this,arguments)},t)}var Ws={};function js(e,t){y.deprecationHandler!=null&&y.deprecationHandler(e,t),Ws[e]||(Fs(t),Ws[e]=!0)}y.suppressDeprecationWarnings=!1,y.deprecationHandler=null;function he(e){return typeof Function<"u"&&e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}function Ti(e){var t,n;for(n in e)V(e,n)&&(t=e[n],he(t)?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function gn(e,t){var n=Oe({},e),s;for(s in t)V(t,s)&&(De(e[s])&&De(t[s])?(n[s]={},Oe(n[s],e[s]),Oe(n[s],t[s])):t[s]!=null?n[s]=t[s]:delete n[s]);for(s in e)V(e,s)&&!V(t,s)&&De(e[s])&&(n[s]=Oe({},n[s]));return n}function kn(e){e!=null&&this.set(e)}var bn;Object.keys?bn=Object.keys:bn=function(e){var t,n=[];for(t in e)V(e,t)&&n.push(t);return n};var Ii={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function Di(e,t,n){var s=this._calendar[e]||this._calendar.sameElse;return he(s)?s.call(t,n):s}function fe(e,t,n){var s=""+Math.abs(e),a=t-s.length,o=e>=0;return(o?n?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+s}var wn=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,bt=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,vn={},Ae={};function C(e,t,n,s){var a=s;typeof s=="string"&&(a=function(){return this[s]()}),e&&(Ae[e]=a),t&&(Ae[t[0]]=function(){return fe(a.apply(this,arguments),t[1],t[2])}),n&&(Ae[n]=function(){return this.localeData().ordinal(a.apply(this,arguments),e)})}function xi(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function Yi(e){var t=e.match(wn),n,s;for(n=0,s=t.length;n<s;n++)Ae[t[n]]?t[n]=Ae[t[n]]:t[n]=xi(t[n]);return function(a){var o="",i;for(i=0;i<s;i++)o+=he(t[i])?t[i].call(a,e):t[i];return o}}function wt(e,t){return e.isValid()?(t=Hs(t,e.localeData()),vn[t]=vn[t]||Yi(t),vn[t](e)):e.localeData().invalidDate()}function Hs(e,t){var n=5;function s(a){return t.longDateFormat(a)||a}for(bt.lastIndex=0;n>=0&&bt.test(e);)e=e.replace(bt,s),bt.lastIndex=0,n-=1;return e}var Ri={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function Bi(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(wn).map(function(s){return s==="MMMM"||s==="MM"||s==="DD"||s==="dddd"?s.slice(1):s}).join(""),this._longDateFormat[e])}var Vi="Invalid date";function Pi(){return this._invalidDate}var Li="%d",Ai=/\d{1,2}/;function $i(e){return this._ordinal.replace("%d",e)}var Ui={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Fi(e,t,n,s){var a=this._relativeTime[n];return he(a)?a(e,t,n,s):a.replace(/%d/i,e)}function Wi(e,t){var n=this._relativeTime[e>0?"future":"past"];return he(n)?n(t):n.replace(/%s/i,t)}var Gs={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function se(e){return typeof e=="string"?Gs[e]||Gs[e.toLowerCase()]:void 0}function Nn(e){var t={},n,s;for(s in e)V(e,s)&&(n=se(s),n&&(t[n]=e[s]));return t}var ji={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function Hi(e){var t=[],n;for(n in e)V(e,n)&&t.push({unit:n,priority:ji[n]});return t.sort(function(s,a){return s.priority-a.priority}),t}var zs=/\d/,te=/\d\d/,qs=/\d{3}/,Cn=/\d{4}/,vt=/[+-]?\d{6}/,U=/\d\d?/,Zs=/\d\d\d\d?/,Ks=/\d\d\d\d\d\d?/,Nt=/\d{1,3}/,Sn=/\d{1,4}/,Ct=/[+-]?\d{1,6}/,$e=/\d+/,St=/[+-]?\d+/,Gi=/Z|[+-]\d\d:?\d\d/gi,Mt=/Z|[+-]\d\d(?::?\d\d)?/gi,zi=/[+-]?\d+(\.\d{1,3})?/,et=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Ue=/^[1-9]\d?/,Mn=/^([1-9]\d|\d)/,Ot;Ot={};function g(e,t,n){Ot[e]=he(t)?t:function(s,a){return s&&n?n:t}}function qi(e,t){return V(Ot,e)?Ot[e](t._strict,t._locale):new RegExp(Zi(e))}function Zi(e){return _e(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,n,s,a,o){return n||s||a||o}))}function _e(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function ae(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function x(e){var t=+e,n=0;return t!==0&&isFinite(t)&&(n=ae(t)),n}var On={};function L(e,t){var n,s=t,a;for(typeof e=="string"&&(e=[e]),ye(t)&&(s=function(o,i){i[t]=x(o)}),a=e.length,n=0;n<a;n++)On[e[n]]=s}function tt(e,t){L(e,function(n,s,a,o){a._w=a._w||{},t(n,a._w,a,o)})}function Ki(e,t,n){t!=null&&V(On,e)&&On[e](t,n._a,n,e)}function Et(e){return e%4===0&&e%100!==0||e%400===0}var K=0,ge=1,pe=2,q=3,le=4,ke=5,xe=6,Xi=7,Ji=8;C("Y",0,0,function(){var e=this.year();return e<=9999?fe(e,4):"+"+e}),C(0,["YY",2],0,function(){return this.year()%100}),C(0,["YYYY",4],0,"year"),C(0,["YYYYY",5],0,"year"),C(0,["YYYYYY",6,!0],0,"year"),g("Y",St),g("YY",U,te),g("YYYY",Sn,Cn),g("YYYYY",Ct,vt),g("YYYYYY",Ct,vt),L(["YYYYY","YYYYYY"],K),L("YYYY",function(e,t){t[K]=e.length===2?y.parseTwoDigitYear(e):x(e)}),L("YY",function(e,t){t[K]=y.parseTwoDigitYear(e)}),L("Y",function(e,t){t[K]=parseInt(e,10)});function nt(e){return Et(e)?366:365}y.parseTwoDigitYear=function(e){return x(e)+(x(e)>68?1900:2e3)};var Xs=Fe("FullYear",!0);function Qi(){return Et(this.year())}function Fe(e,t){return function(n){return n!=null?(Js(this,e,n),y.updateOffset(this,t),this):st(this,e)}}function st(e,t){if(!e.isValid())return NaN;var n=e._d,s=e._isUTC;switch(t){case"Milliseconds":return s?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return s?n.getUTCSeconds():n.getSeconds();case"Minutes":return s?n.getUTCMinutes():n.getMinutes();case"Hours":return s?n.getUTCHours():n.getHours();case"Date":return s?n.getUTCDate():n.getDate();case"Day":return s?n.getUTCDay():n.getDay();case"Month":return s?n.getUTCMonth():n.getMonth();case"FullYear":return s?n.getUTCFullYear():n.getFullYear();default:return NaN}}function Js(e,t,n){var s,a,o,i,l;if(!(!e.isValid()||isNaN(n))){switch(s=e._d,a=e._isUTC,t){case"Milliseconds":return void(a?s.setUTCMilliseconds(n):s.setMilliseconds(n));case"Seconds":return void(a?s.setUTCSeconds(n):s.setSeconds(n));case"Minutes":return void(a?s.setUTCMinutes(n):s.setMinutes(n));case"Hours":return void(a?s.setUTCHours(n):s.setHours(n));case"Date":return void(a?s.setUTCDate(n):s.setDate(n));case"FullYear":break;default:return}o=n,i=e.month(),l=e.date(),l=l===29&&i===1&&!Et(o)?28:l,a?s.setUTCFullYear(o,i,l):s.setFullYear(o,i,l)}}function el(e){return e=se(e),he(this[e])?this[e]():this}function tl(e,t){if(typeof e=="object"){e=Nn(e);var n=Hi(e),s,a=n.length;for(s=0;s<a;s++)this[n[s].unit](e[n[s].unit])}else if(e=se(e),he(this[e]))return this[e](t);return this}function nl(e,t){return(e%t+t)%t}var z;Array.prototype.indexOf?z=Array.prototype.indexOf:z=function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1};function En(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=nl(t,12);return e+=(t-n)/12,n===1?Et(e)?29:28:31-n%7%2}C("M",["MM",2],"Mo",function(){return this.month()+1}),C("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),C("MMMM",0,0,function(e){return this.localeData().months(this,e)}),g("M",U,Ue),g("MM",U,te),g("MMM",function(e,t){return t.monthsShortRegex(e)}),g("MMMM",function(e,t){return t.monthsRegex(e)}),L(["M","MM"],function(e,t){t[ge]=x(e)-1}),L(["MMM","MMMM"],function(e,t,n,s){var a=n._locale.monthsParse(e,s,n._strict);a!=null?t[ge]=a:E(n).invalidMonth=e});var sl="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Qs="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),ea=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,al=et,rl=et;function ol(e,t){return e?oe(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||ea).test(t)?"format":"standalone"][e.month()]:oe(this._months)?this._months:this._months.standalone}function il(e,t){return e?oe(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[ea.test(t)?"format":"standalone"][e.month()]:oe(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function ll(e,t,n){var s,a,o,i=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)o=ue([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(o,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(o,"").toLocaleLowerCase();return n?t==="MMM"?(a=z.call(this._shortMonthsParse,i),a!==-1?a:null):(a=z.call(this._longMonthsParse,i),a!==-1?a:null):t==="MMM"?(a=z.call(this._shortMonthsParse,i),a!==-1?a:(a=z.call(this._longMonthsParse,i),a!==-1?a:null)):(a=z.call(this._longMonthsParse,i),a!==-1?a:(a=z.call(this._shortMonthsParse,i),a!==-1?a:null))}function dl(e,t,n){var s,a,o;if(this._monthsParseExact)return ll.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(a=ue([2e3,s]),n&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),!n&&!this._monthsParse[s]&&(o="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[s]=new RegExp(o.replace(".",""),"i")),n&&t==="MMMM"&&this._longMonthsParse[s].test(e))return s;if(n&&t==="MMM"&&this._shortMonthsParse[s].test(e))return s;if(!n&&this._monthsParse[s].test(e))return s}}function ta(e,t){if(!e.isValid())return e;if(typeof t=="string"){if(/^\d+$/.test(t))t=x(t);else if(t=e.localeData().monthsParse(t),!ye(t))return e}var n=t,s=e.date();return s=s<29?s:Math.min(s,En(e.year(),n)),e._isUTC?e._d.setUTCMonth(n,s):e._d.setMonth(n,s),e}function na(e){return e!=null?(ta(this,e),y.updateOffset(this,!0),this):st(this,"Month")}function cl(){return En(this.year(),this.month())}function ul(e){return this._monthsParseExact?(V(this,"_monthsRegex")||sa.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(V(this,"_monthsShortRegex")||(this._monthsShortRegex=al),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function hl(e){return this._monthsParseExact?(V(this,"_monthsRegex")||sa.call(this),e?this._monthsStrictRegex:this._monthsRegex):(V(this,"_monthsRegex")||(this._monthsRegex=rl),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function sa(){function e(d,c){return c.length-d.length}var t=[],n=[],s=[],a,o,i,l;for(a=0;a<12;a++)o=ue([2e3,a]),i=_e(this.monthsShort(o,"")),l=_e(this.months(o,"")),t.push(i),n.push(l),s.push(l),s.push(i);t.sort(e),n.sort(e),s.sort(e),this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")","i")}function fl(e,t,n,s,a,o,i){var l;return e<100&&e>=0?(l=new Date(e+400,t,n,s,a,o,i),isFinite(l.getFullYear())&&l.setFullYear(e)):l=new Date(e,t,n,s,a,o,i),l}function at(e){var t,n;return e<100&&e>=0?(n=Array.prototype.slice.call(arguments),n[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Tt(e,t,n){var s=7+t-n,a=(7+at(e,0,s).getUTCDay()-t)%7;return-a+s-1}function aa(e,t,n,s,a){var o=(7+n-s)%7,i=Tt(e,s,a),l=1+7*(t-1)+o+i,d,c;return l<=0?(d=e-1,c=nt(d)+l):l>nt(e)?(d=e+1,c=l-nt(e)):(d=e,c=l),{year:d,dayOfYear:c}}function rt(e,t,n){var s=Tt(e.year(),t,n),a=Math.floor((e.dayOfYear()-s-1)/7)+1,o,i;return a<1?(i=e.year()-1,o=a+be(i,t,n)):a>be(e.year(),t,n)?(o=a-be(e.year(),t,n),i=e.year()+1):(i=e.year(),o=a),{week:o,year:i}}function be(e,t,n){var s=Tt(e,t,n),a=Tt(e+1,t,n);return(nt(e)-s+a)/7}C("w",["ww",2],"wo","week"),C("W",["WW",2],"Wo","isoWeek"),g("w",U,Ue),g("ww",U,te),g("W",U,Ue),g("WW",U,te),tt(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=x(e)});function pl(e){return rt(e,this._week.dow,this._week.doy).week}var ml={dow:0,doy:6};function yl(){return this._week.dow}function _l(){return this._week.doy}function gl(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function kl(e){var t=rt(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}C("d",0,"do","day"),C("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),C("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),C("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),C("e",0,0,"weekday"),C("E",0,0,"isoWeekday"),g("d",U),g("e",U),g("E",U),g("dd",function(e,t){return t.weekdaysMinRegex(e)}),g("ddd",function(e,t){return t.weekdaysShortRegex(e)}),g("dddd",function(e,t){return t.weekdaysRegex(e)}),tt(["dd","ddd","dddd"],function(e,t,n,s){var a=n._locale.weekdaysParse(e,s,n._strict);a!=null?t.d=a:E(n).invalidWeekday=e}),tt(["d","e","E"],function(e,t,n,s){t[s]=x(e)});function bl(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function wl(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Tn(e,t){return e.slice(t,7).concat(e.slice(0,t))}var vl="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),ra="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Nl="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Cl=et,Sl=et,Ml=et;function Ol(e,t){var n=oe(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?Tn(n,this._week.dow):e?n[e.day()]:n}function El(e){return e===!0?Tn(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function Tl(e){return e===!0?Tn(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function Il(e,t,n){var s,a,o,i=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)o=ue([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(o,"").toLocaleLowerCase();return n?t==="dddd"?(a=z.call(this._weekdaysParse,i),a!==-1?a:null):t==="ddd"?(a=z.call(this._shortWeekdaysParse,i),a!==-1?a:null):(a=z.call(this._minWeekdaysParse,i),a!==-1?a:null):t==="dddd"?(a=z.call(this._weekdaysParse,i),a!==-1||(a=z.call(this._shortWeekdaysParse,i),a!==-1)?a:(a=z.call(this._minWeekdaysParse,i),a!==-1?a:null)):t==="ddd"?(a=z.call(this._shortWeekdaysParse,i),a!==-1||(a=z.call(this._weekdaysParse,i),a!==-1)?a:(a=z.call(this._minWeekdaysParse,i),a!==-1?a:null)):(a=z.call(this._minWeekdaysParse,i),a!==-1||(a=z.call(this._weekdaysParse,i),a!==-1)?a:(a=z.call(this._shortWeekdaysParse,i),a!==-1?a:null))}function Dl(e,t,n){var s,a,o;if(this._weekdaysParseExact)return Il.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(a=ue([2e3,1]).day(s),n&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(a,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(a,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(a,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(o="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[s]=new RegExp(o.replace(".",""),"i")),n&&t==="dddd"&&this._fullWeekdaysParse[s].test(e))return s;if(n&&t==="ddd"&&this._shortWeekdaysParse[s].test(e))return s;if(n&&t==="dd"&&this._minWeekdaysParse[s].test(e))return s;if(!n&&this._weekdaysParse[s].test(e))return s}}function xl(e){if(!this.isValid())return e!=null?this:NaN;var t=st(this,"Day");return e!=null?(e=bl(e,this.localeData()),this.add(e-t,"d")):t}function Yl(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function Rl(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=wl(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function Bl(e){return this._weekdaysParseExact?(V(this,"_weekdaysRegex")||In.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(V(this,"_weekdaysRegex")||(this._weekdaysRegex=Cl),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function Vl(e){return this._weekdaysParseExact?(V(this,"_weekdaysRegex")||In.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(V(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Sl),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Pl(e){return this._weekdaysParseExact?(V(this,"_weekdaysRegex")||In.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(V(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ml),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function In(){function e(u,_){return _.length-u.length}var t=[],n=[],s=[],a=[],o,i,l,d,c;for(o=0;o<7;o++)i=ue([2e3,1]).day(o),l=_e(this.weekdaysMin(i,"")),d=_e(this.weekdaysShort(i,"")),c=_e(this.weekdays(i,"")),t.push(l),n.push(d),s.push(c),a.push(l),a.push(d),a.push(c);t.sort(e),n.sort(e),s.sort(e),a.sort(e),this._weekdaysRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function Dn(){return this.hours()%12||12}function Ll(){return this.hours()||24}C("H",["HH",2],0,"hour"),C("h",["hh",2],0,Dn),C("k",["kk",2],0,Ll),C("hmm",0,0,function(){return""+Dn.apply(this)+fe(this.minutes(),2)}),C("hmmss",0,0,function(){return""+Dn.apply(this)+fe(this.minutes(),2)+fe(this.seconds(),2)}),C("Hmm",0,0,function(){return""+this.hours()+fe(this.minutes(),2)}),C("Hmmss",0,0,function(){return""+this.hours()+fe(this.minutes(),2)+fe(this.seconds(),2)});function oa(e,t){C(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}oa("a",!0),oa("A",!1);function ia(e,t){return t._meridiemParse}g("a",ia),g("A",ia),g("H",U,Mn),g("h",U,Ue),g("k",U,Ue),g("HH",U,te),g("hh",U,te),g("kk",U,te),g("hmm",Zs),g("hmmss",Ks),g("Hmm",Zs),g("Hmmss",Ks),L(["H","HH"],q),L(["k","kk"],function(e,t,n){var s=x(e);t[q]=s===24?0:s}),L(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),L(["h","hh"],function(e,t,n){t[q]=x(e),E(n).bigHour=!0}),L("hmm",function(e,t,n){var s=e.length-2;t[q]=x(e.substr(0,s)),t[le]=x(e.substr(s)),E(n).bigHour=!0}),L("hmmss",function(e,t,n){var s=e.length-4,a=e.length-2;t[q]=x(e.substr(0,s)),t[le]=x(e.substr(s,2)),t[ke]=x(e.substr(a)),E(n).bigHour=!0}),L("Hmm",function(e,t,n){var s=e.length-2;t[q]=x(e.substr(0,s)),t[le]=x(e.substr(s))}),L("Hmmss",function(e,t,n){var s=e.length-4,a=e.length-2;t[q]=x(e.substr(0,s)),t[le]=x(e.substr(s,2)),t[ke]=x(e.substr(a))});function Al(e){return(e+"").toLowerCase().charAt(0)==="p"}var $l=/[ap]\.?m?\.?/i,Ul=Fe("Hours",!0);function Fl(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var la={calendar:Ii,longDateFormat:Ri,invalidDate:Vi,ordinal:Li,dayOfMonthOrdinalParse:Ai,relativeTime:Ui,months:sl,monthsShort:Qs,week:ml,weekdays:vl,weekdaysMin:Nl,weekdaysShort:ra,meridiemParse:$l},H={},ot={},it;function Wl(e,t){var n,s=Math.min(e.length,t.length);for(n=0;n<s;n+=1)if(e[n]!==t[n])return n;return s}function da(e){return e&&e.toLowerCase().replace("_","-")}function jl(e){for(var t=0,n,s,a,o;t<e.length;){for(o=da(e[t]).split("-"),n=o.length,s=da(e[t+1]),s=s?s.split("-"):null;n>0;){if(a=It(o.slice(0,n).join("-")),a)return a;if(s&&s.length>=n&&Wl(o,s)>=n-1)break;n--}t++}return it}function Hl(e){return!!(e&&e.match("^[^/\\\\]*$"))}function It(e){var t=null,n;if(H[e]===void 0&&typeof module<"u"&&module&&module.exports&&Hl(e))try{t=it._abbr,n=require,n("./locale/"+e),Ee(t)}catch{H[e]=null}return H[e]}function Ee(e,t){var n;return e&&(Q(t)?n=we(e):n=xn(e,t),n?it=n:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),it._abbr}function xn(e,t){if(t!==null){var n,s=la;if(t.abbr=e,H[e]!=null)js("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=H[e]._config;else if(t.parentLocale!=null)if(H[t.parentLocale]!=null)s=H[t.parentLocale]._config;else if(n=It(t.parentLocale),n!=null)s=n._config;else return ot[t.parentLocale]||(ot[t.parentLocale]=[]),ot[t.parentLocale].push({name:e,config:t}),null;return H[e]=new kn(gn(s,t)),ot[e]&&ot[e].forEach(function(a){xn(a.name,a.config)}),Ee(e),H[e]}else return delete H[e],null}function Gl(e,t){if(t!=null){var n,s,a=la;H[e]!=null&&H[e].parentLocale!=null?H[e].set(gn(H[e]._config,t)):(s=It(e),s!=null&&(a=s._config),t=gn(a,t),s==null&&(t.abbr=e),n=new kn(t),n.parentLocale=H[e],H[e]=n),Ee(e)}else H[e]!=null&&(H[e].parentLocale!=null?(H[e]=H[e].parentLocale,e===Ee()&&Ee(e)):H[e]!=null&&delete H[e]);return H[e]}function we(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return it;if(!oe(e)){if(t=It(e),t)return t;e=[e]}return jl(e)}function zl(){return bn(H)}function Yn(e){var t,n=e._a;return n&&E(e).overflow===-2&&(t=n[ge]<0||n[ge]>11?ge:n[pe]<1||n[pe]>En(n[K],n[ge])?pe:n[q]<0||n[q]>24||n[q]===24&&(n[le]!==0||n[ke]!==0||n[xe]!==0)?q:n[le]<0||n[le]>59?le:n[ke]<0||n[ke]>59?ke:n[xe]<0||n[xe]>999?xe:-1,E(e)._overflowDayOfYear&&(t<K||t>pe)&&(t=pe),E(e)._overflowWeeks&&t===-1&&(t=Xi),E(e)._overflowWeekday&&t===-1&&(t=Ji),E(e).overflow=t),e}var ql=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Zl=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Kl=/Z|[+-]\d\d(?::?\d\d)?/,Dt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Rn=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Xl=/^\/?Date\((-?\d+)/i,Jl=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Ql={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function ca(e){var t,n,s=e._i,a=ql.exec(s)||Zl.exec(s),o,i,l,d,c=Dt.length,u=Rn.length;if(a){for(E(e).iso=!0,t=0,n=c;t<n;t++)if(Dt[t][1].exec(a[1])){i=Dt[t][0],o=Dt[t][2]!==!1;break}if(i==null){e._isValid=!1;return}if(a[3]){for(t=0,n=u;t<n;t++)if(Rn[t][1].exec(a[3])){l=(a[2]||" ")+Rn[t][0];break}if(l==null){e._isValid=!1;return}}if(!o&&l!=null){e._isValid=!1;return}if(a[4])if(Kl.exec(a[4]))d="Z";else{e._isValid=!1;return}e._f=i+(l||"")+(d||""),Vn(e)}else e._isValid=!1}function ed(e,t,n,s,a,o){var i=[td(e),Qs.indexOf(t),parseInt(n,10),parseInt(s,10),parseInt(a,10)];return o&&i.push(parseInt(o,10)),i}function td(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function nd(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function sd(e,t,n){if(e){var s=ra.indexOf(e),a=new Date(t[0],t[1],t[2]).getDay();if(s!==a)return E(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function ad(e,t,n){if(e)return Ql[e];if(t)return 0;var s=parseInt(n,10),a=s%100,o=(s-a)/100;return o*60+a}function ua(e){var t=Jl.exec(nd(e._i)),n;if(t){if(n=ed(t[4],t[3],t[2],t[5],t[6],t[7]),!sd(t[1],n,e))return;e._a=n,e._tzm=ad(t[8],t[9],t[10]),e._d=at.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),E(e).rfc2822=!0}else e._isValid=!1}function rd(e){var t=Xl.exec(e._i);if(t!==null){e._d=new Date(+t[1]);return}if(ca(e),e._isValid===!1)delete e._isValid;else return;if(ua(e),e._isValid===!1)delete e._isValid;else return;e._strict?e._isValid=!1:y.createFromInputFallback(e)}y.createFromInputFallback=ne("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))});function We(e,t,n){return e??t??n}function od(e){var t=new Date(y.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Bn(e){var t,n,s=[],a,o,i;if(!e._d){for(a=od(e),e._w&&e._a[pe]==null&&e._a[ge]==null&&id(e),e._dayOfYear!=null&&(i=We(e._a[K],a[K]),(e._dayOfYear>nt(i)||e._dayOfYear===0)&&(E(e)._overflowDayOfYear=!0),n=at(i,0,e._dayOfYear),e._a[ge]=n.getUTCMonth(),e._a[pe]=n.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=s[t]=a[t];for(;t<7;t++)e._a[t]=s[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[q]===24&&e._a[le]===0&&e._a[ke]===0&&e._a[xe]===0&&(e._nextDay=!0,e._a[q]=0),e._d=(e._useUTC?at:fl).apply(null,s),o=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[q]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==o&&(E(e).weekdayMismatch=!0)}}function id(e){var t,n,s,a,o,i,l,d,c;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(o=1,i=4,n=We(t.GG,e._a[K],rt(F(),1,4).year),s=We(t.W,1),a=We(t.E,1),(a<1||a>7)&&(d=!0)):(o=e._locale._week.dow,i=e._locale._week.doy,c=rt(F(),o,i),n=We(t.gg,e._a[K],c.year),s=We(t.w,c.week),t.d!=null?(a=t.d,(a<0||a>6)&&(d=!0)):t.e!=null?(a=t.e+o,(t.e<0||t.e>6)&&(d=!0)):a=o),s<1||s>be(n,o,i)?E(e)._overflowWeeks=!0:d!=null?E(e)._overflowWeekday=!0:(l=aa(n,s,a,o,i),e._a[K]=l.year,e._dayOfYear=l.dayOfYear)}y.ISO_8601=function(){},y.RFC_2822=function(){};function Vn(e){if(e._f===y.ISO_8601){ca(e);return}if(e._f===y.RFC_2822){ua(e);return}e._a=[],E(e).empty=!0;var t=""+e._i,n,s,a,o,i,l=t.length,d=0,c,u;for(a=Hs(e._f,e._locale).match(wn)||[],u=a.length,n=0;n<u;n++)o=a[n],s=(t.match(qi(o,e))||[])[0],s&&(i=t.substr(0,t.indexOf(s)),i.length>0&&E(e).unusedInput.push(i),t=t.slice(t.indexOf(s)+s.length),d+=s.length),Ae[o]?(s?E(e).empty=!1:E(e).unusedTokens.push(o),Ki(o,s,e)):e._strict&&!s&&E(e).unusedTokens.push(o);E(e).charsLeftOver=l-d,t.length>0&&E(e).unusedInput.push(t),e._a[q]<=12&&E(e).bigHour===!0&&e._a[q]>0&&(E(e).bigHour=void 0),E(e).parsedDateParts=e._a.slice(0),E(e).meridiem=e._meridiem,e._a[q]=ld(e._locale,e._a[q],e._meridiem),c=E(e).era,c!==null&&(e._a[K]=e._locale.erasConvertYear(c,e._a[K])),Bn(e),Yn(e)}function ld(e,t,n){var s;return n==null?t:e.meridiemHour!=null?e.meridiemHour(t,n):(e.isPM!=null&&(s=e.isPM(n),s&&t<12&&(t+=12),!s&&t===12&&(t=0)),t)}function dd(e){var t,n,s,a,o,i,l=!1,d=e._f.length;if(d===0){E(e).invalidFormat=!0,e._d=new Date(NaN);return}for(a=0;a<d;a++)o=0,i=!1,t=_n({},e),e._useUTC!=null&&(t._useUTC=e._useUTC),t._f=e._f[a],Vn(t),mn(t)&&(i=!0),o+=E(t).charsLeftOver,o+=E(t).unusedTokens.length*10,E(t).score=o,l?o<s&&(s=o,n=t):(s==null||o<s||i)&&(s=o,n=t,i&&(l=!0));Oe(e,n||t)}function cd(e){if(!e._d){var t=Nn(e._i),n=t.day===void 0?t.date:t.day;e._a=$s([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(s){return s&&parseInt(s,10)}),Bn(e)}}function ud(e){var t=new Qe(Yn(ha(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function ha(e){var t=e._i,n=e._f;return e._locale=e._locale||we(e._l),t===null||n===void 0&&t===""?kt({nullInput:!0}):(typeof t=="string"&&(e._i=t=e._locale.preparse(t)),ie(t)?new Qe(Yn(t)):(Je(t)?e._d=t:oe(n)?dd(e):n?Vn(e):hd(e),mn(e)||(e._d=null),e))}function hd(e){var t=e._i;Q(t)?e._d=new Date(y.now()):Je(t)?e._d=new Date(t.valueOf()):typeof t=="string"?rd(e):oe(t)?(e._a=$s(t.slice(0),function(n){return parseInt(n,10)}),Bn(e)):De(t)?cd(e):ye(t)?e._d=new Date(t):y.createFromInputFallback(e)}function fa(e,t,n,s,a){var o={};return(t===!0||t===!1)&&(s=t,t=void 0),(n===!0||n===!1)&&(s=n,n=void 0),(De(e)&&fn(e)||oe(e)&&e.length===0)&&(e=void 0),o._isAMomentObject=!0,o._useUTC=o._isUTC=a,o._l=n,o._i=e,o._f=t,o._strict=s,ud(o)}function F(e,t,n,s){return fa(e,t,n,s,!1)}var fd=ne("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=F.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:kt()}),pd=ne("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=F.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:kt()});function pa(e,t){var n,s;if(t.length===1&&oe(t[0])&&(t=t[0]),!t.length)return F();for(n=t[0],s=1;s<t.length;++s)(!t[s].isValid()||t[s][e](n))&&(n=t[s]);return n}function md(){var e=[].slice.call(arguments,0);return pa("isBefore",e)}function yd(){var e=[].slice.call(arguments,0);return pa("isAfter",e)}var _d=function(){return Date.now?Date.now():+new Date},lt=["year","quarter","month","week","day","hour","minute","second","millisecond"];function gd(e){var t,n=!1,s,a=lt.length;for(t in e)if(V(e,t)&&!(z.call(lt,t)!==-1&&(e[t]==null||!isNaN(e[t]))))return!1;for(s=0;s<a;++s)if(e[lt[s]]){if(n)return!1;parseFloat(e[lt[s]])!==x(e[lt[s]])&&(n=!0)}return!0}function kd(){return this._isValid}function bd(){return de(NaN)}function xt(e){var t=Nn(e),n=t.year||0,s=t.quarter||0,a=t.month||0,o=t.week||t.isoWeek||0,i=t.day||0,l=t.hour||0,d=t.minute||0,c=t.second||0,u=t.millisecond||0;this._isValid=gd(t),this._milliseconds=+u+c*1e3+d*6e4+l*1e3*60*60,this._days=+i+o*7,this._months=+a+s*3+n*12,this._data={},this._locale=we(),this._bubble()}function Yt(e){return e instanceof xt}function Pn(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function wd(e,t,n){var s=Math.min(e.length,t.length),a=Math.abs(e.length-t.length),o=0,i;for(i=0;i<s;i++)x(e[i])!==x(t[i])&&o++;return o+a}function ma(e,t){C(e,0,0,function(){var n=this.utcOffset(),s="+";return n<0&&(n=-n,s="-"),s+fe(~~(n/60),2)+t+fe(~~n%60,2)})}ma("Z",":"),ma("ZZ",""),g("Z",Mt),g("ZZ",Mt),L(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Ln(Mt,e)});var vd=/([\+\-]|\d\d)/gi;function Ln(e,t){var n=(t||"").match(e),s,a,o;return n===null?null:(s=n[n.length-1]||[],a=(s+"").match(vd)||["-",0,0],o=+(a[1]*60)+x(a[2]),o===0?0:a[0]==="+"?o:-o)}function An(e,t){var n,s;return t._isUTC?(n=t.clone(),s=(ie(e)||Je(e)?e.valueOf():F(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+s),y.updateOffset(n,!1),n):F(e).local()}function $n(e){return-Math.round(e._d.getTimezoneOffset())}y.updateOffset=function(){};function Nd(e,t,n){var s=this._offset||0,a;if(!this.isValid())return e!=null?this:NaN;if(e!=null){if(typeof e=="string"){if(e=Ln(Mt,e),e===null)return this}else Math.abs(e)<16&&!n&&(e=e*60);return!this._isUTC&&t&&(a=$n(this)),this._offset=e,this._isUTC=!0,a!=null&&this.add(a,"m"),s!==e&&(!t||this._changeInProgress?ka(this,de(e-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,y.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?s:$n(this)}function Cd(e,t){return e!=null?(typeof e!="string"&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function Sd(e){return this.utcOffset(0,e)}function Md(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract($n(this),"m")),this}function Od(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var e=Ln(Gi,this._i);e!=null?this.utcOffset(e):this.utcOffset(0,!0)}return this}function Ed(e){return this.isValid()?(e=e?F(e).utcOffset():0,(this.utcOffset()-e)%60===0):!1}function Td(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Id(){if(!Q(this._isDSTShifted))return this._isDSTShifted;var e={},t;return _n(e,this),e=ha(e),e._a?(t=e._isUTC?ue(e._a):F(e._a),this._isDSTShifted=this.isValid()&&wd(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Dd(){return this.isValid()?!this._isUTC:!1}function xd(){return this.isValid()?this._isUTC:!1}function ya(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Yd=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Rd=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function de(e,t){var n=e,s=null,a,o,i;return Yt(e)?n={ms:e._milliseconds,d:e._days,M:e._months}:ye(e)||!isNaN(+e)?(n={},t?n[t]=+e:n.milliseconds=+e):(s=Yd.exec(e))?(a=s[1]==="-"?-1:1,n={y:0,d:x(s[pe])*a,h:x(s[q])*a,m:x(s[le])*a,s:x(s[ke])*a,ms:x(Pn(s[xe]*1e3))*a}):(s=Rd.exec(e))?(a=s[1]==="-"?-1:1,n={y:Ye(s[2],a),M:Ye(s[3],a),w:Ye(s[4],a),d:Ye(s[5],a),h:Ye(s[6],a),m:Ye(s[7],a),s:Ye(s[8],a)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(i=Bd(F(n.from),F(n.to)),n={},n.ms=i.milliseconds,n.M=i.months),o=new xt(n),Yt(e)&&V(e,"_locale")&&(o._locale=e._locale),Yt(e)&&V(e,"_isValid")&&(o._isValid=e._isValid),o}de.fn=xt.prototype,de.invalid=bd;function Ye(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function _a(e,t){var n={};return n.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function Bd(e,t){var n;return e.isValid()&&t.isValid()?(t=An(t,e),e.isBefore(t)?n=_a(e,t):(n=_a(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function ga(e,t){return function(n,s){var a,o;return s!==null&&!isNaN(+s)&&(js(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=n,n=s,s=o),a=de(n,s),ka(this,a,e),this}}function ka(e,t,n,s){var a=t._milliseconds,o=Pn(t._days),i=Pn(t._months);e.isValid()&&(s=s??!0,i&&ta(e,st(e,"Month")+i*n),o&&Js(e,"Date",st(e,"Date")+o*n),a&&e._d.setTime(e._d.valueOf()+a*n),s&&y.updateOffset(e,o||i))}var Vd=ga(1,"add"),Pd=ga(-1,"subtract");function ba(e){return typeof e=="string"||e instanceof String}function Ld(e){return ie(e)||Je(e)||ba(e)||ye(e)||$d(e)||Ad(e)||e===null||e===void 0}function Ad(e){var t=De(e)&&!fn(e),n=!1,s=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],a,o,i=s.length;for(a=0;a<i;a+=1)o=s[a],n=n||V(e,o);return t&&n}function $d(e){var t=oe(e),n=!1;return t&&(n=e.filter(function(s){return!ye(s)&&ba(e)}).length===0),t&&n}function Ud(e){var t=De(e)&&!fn(e),n=!1,s=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],a,o;for(a=0;a<s.length;a+=1)o=s[a],n=n||V(e,o);return t&&n}function Fd(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function Wd(e,t){arguments.length===1&&(arguments[0]?Ld(arguments[0])?(e=arguments[0],t=void 0):Ud(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||F(),s=An(n,this).startOf("day"),a=y.calendarFormat(this,s)||"sameElse",o=t&&(he(t[a])?t[a].call(this,n):t[a]);return this.format(o||this.localeData().calendar(a,this,F(n)))}function jd(){return new Qe(this)}function Hd(e,t){var n=ie(e)?e:F(e);return this.isValid()&&n.isValid()?(t=se(t)||"millisecond",t==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf()):!1}function Gd(e,t){var n=ie(e)?e:F(e);return this.isValid()&&n.isValid()?(t=se(t)||"millisecond",t==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf()):!1}function zd(e,t,n,s){var a=ie(e)?e:F(e),o=ie(t)?t:F(t);return this.isValid()&&a.isValid()&&o.isValid()?(s=s||"()",(s[0]==="("?this.isAfter(a,n):!this.isBefore(a,n))&&(s[1]===")"?this.isBefore(o,n):!this.isAfter(o,n))):!1}function qd(e,t){var n=ie(e)?e:F(e),s;return this.isValid()&&n.isValid()?(t=se(t)||"millisecond",t==="millisecond"?this.valueOf()===n.valueOf():(s=n.valueOf(),this.clone().startOf(t).valueOf()<=s&&s<=this.clone().endOf(t).valueOf())):!1}function Zd(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function Kd(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function Xd(e,t,n){var s,a,o;if(!this.isValid())return NaN;if(s=An(e,this),!s.isValid())return NaN;switch(a=(s.utcOffset()-this.utcOffset())*6e4,t=se(t),t){case"year":o=Rt(this,s)/12;break;case"month":o=Rt(this,s);break;case"quarter":o=Rt(this,s)/3;break;case"second":o=(this-s)/1e3;break;case"minute":o=(this-s)/6e4;break;case"hour":o=(this-s)/36e5;break;case"day":o=(this-s-a)/864e5;break;case"week":o=(this-s-a)/6048e5;break;default:o=this-s}return n?o:ae(o)}function Rt(e,t){if(e.date()<t.date())return-Rt(t,e);var n=(t.year()-e.year())*12+(t.month()-e.month()),s=e.clone().add(n,"months"),a,o;return t-s<0?(a=e.clone().add(n-1,"months"),o=(t-s)/(s-a)):(a=e.clone().add(n+1,"months"),o=(t-s)/(a-s)),-(n+o)||0}y.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",y.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Jd(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Qd(e){if(!this.isValid())return null;var t=e!==!0,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?wt(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):he(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",wt(n,"Z")):wt(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function ec(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",n,s,a,o;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),n="["+e+'("]',s=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",a="-MM-DD[T]HH:mm:ss.SSS",o=t+'[")]',this.format(n+s+a+o)}function tc(e){e||(e=this.isUtc()?y.defaultFormatUtc:y.defaultFormat);var t=wt(this,e);return this.localeData().postformat(t)}function nc(e,t){return this.isValid()&&(ie(e)&&e.isValid()||F(e).isValid())?de({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function sc(e){return this.from(F(),e)}function ac(e,t){return this.isValid()&&(ie(e)&&e.isValid()||F(e).isValid())?de({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function rc(e){return this.to(F(),e)}function wa(e){var t;return e===void 0?this._locale._abbr:(t=we(e),t!=null&&(this._locale=t),this)}var va=ne("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===void 0?this.localeData():this.locale(e)});function Na(){return this._locale}var Bt=1e3,je=60*Bt,Vt=60*je,Ca=(365*400+97)*24*Vt;function He(e,t){return(e%t+t)%t}function Sa(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-Ca:new Date(e,t,n).valueOf()}function Ma(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-Ca:Date.UTC(e,t,n)}function oc(e){var t,n;if(e=se(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?Ma:Sa,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=He(t+(this._isUTC?0:this.utcOffset()*je),Vt);break;case"minute":t=this._d.valueOf(),t-=He(t,je);break;case"second":t=this._d.valueOf(),t-=He(t,Bt);break}return this._d.setTime(t),y.updateOffset(this,!0),this}function ic(e){var t,n;if(e=se(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?Ma:Sa,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=Vt-He(t+(this._isUTC?0:this.utcOffset()*je),Vt)-1;break;case"minute":t=this._d.valueOf(),t+=je-He(t,je)-1;break;case"second":t=this._d.valueOf(),t+=Bt-He(t,Bt)-1;break}return this._d.setTime(t),y.updateOffset(this,!0),this}function lc(){return this._d.valueOf()-(this._offset||0)*6e4}function dc(){return Math.floor(this.valueOf()/1e3)}function cc(){return new Date(this.valueOf())}function uc(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function hc(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function fc(){return this.isValid()?this.toISOString():null}function pc(){return mn(this)}function mc(){return Oe({},E(this))}function yc(){return E(this).overflow}function _c(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}C("N",0,0,"eraAbbr"),C("NN",0,0,"eraAbbr"),C("NNN",0,0,"eraAbbr"),C("NNNN",0,0,"eraName"),C("NNNNN",0,0,"eraNarrow"),C("y",["y",1],"yo","eraYear"),C("y",["yy",2],0,"eraYear"),C("y",["yyy",3],0,"eraYear"),C("y",["yyyy",4],0,"eraYear"),g("N",Un),g("NN",Un),g("NNN",Un),g("NNNN",Ec),g("NNNNN",Tc),L(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,s){var a=n._locale.erasParse(e,s,n._strict);a?E(n).era=a:E(n).invalidEra=e}),g("y",$e),g("yy",$e),g("yyy",$e),g("yyyy",$e),g("yo",Ic),L(["y","yy","yyy","yyyy"],K),L(["yo"],function(e,t,n,s){var a;n._locale._eraYearOrdinalRegex&&(a=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[K]=n._locale.eraYearOrdinalParse(e,a):t[K]=parseInt(e,10)});function gc(e,t){var n,s,a,o=this._eras||we("en")._eras;for(n=0,s=o.length;n<s;++n)switch(typeof o[n].since==="string"&&(a=y(o[n].since).startOf("day"),o[n].since=a.valueOf()),typeof o[n].until){case"undefined":o[n].until=1/0;break;case"string":a=y(o[n].until).startOf("day").valueOf(),o[n].until=a.valueOf();break}return o}function kc(e,t,n){var s,a,o=this.eras(),i,l,d;for(e=e.toUpperCase(),s=0,a=o.length;s<a;++s)if(i=o[s].name.toUpperCase(),l=o[s].abbr.toUpperCase(),d=o[s].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(l===e)return o[s];break;case"NNNN":if(i===e)return o[s];break;case"NNNNN":if(d===e)return o[s];break}else if([i,l,d].indexOf(e)>=0)return o[s]}function bc(e,t){var n=e.since<=e.until?1:-1;return t===void 0?y(e.since).year():y(e.since).year()+(t-e.offset)*n}function wc(){var e,t,n,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),s[e].since<=n&&n<=s[e].until||s[e].until<=n&&n<=s[e].since)return s[e].name;return""}function vc(){var e,t,n,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),s[e].since<=n&&n<=s[e].until||s[e].until<=n&&n<=s[e].since)return s[e].narrow;return""}function Nc(){var e,t,n,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),s[e].since<=n&&n<=s[e].until||s[e].until<=n&&n<=s[e].since)return s[e].abbr;return""}function Cc(){var e,t,n,s,a=this.localeData().eras();for(e=0,t=a.length;e<t;++e)if(n=a[e].since<=a[e].until?1:-1,s=this.clone().startOf("day").valueOf(),a[e].since<=s&&s<=a[e].until||a[e].until<=s&&s<=a[e].since)return(this.year()-y(a[e].since).year())*n+a[e].offset;return this.year()}function Sc(e){return V(this,"_erasNameRegex")||Fn.call(this),e?this._erasNameRegex:this._erasRegex}function Mc(e){return V(this,"_erasAbbrRegex")||Fn.call(this),e?this._erasAbbrRegex:this._erasRegex}function Oc(e){return V(this,"_erasNarrowRegex")||Fn.call(this),e?this._erasNarrowRegex:this._erasRegex}function Un(e,t){return t.erasAbbrRegex(e)}function Ec(e,t){return t.erasNameRegex(e)}function Tc(e,t){return t.erasNarrowRegex(e)}function Ic(e,t){return t._eraYearOrdinalRegex||$e}function Fn(){var e=[],t=[],n=[],s=[],a,o,i,l,d,c=this.eras();for(a=0,o=c.length;a<o;++a)i=_e(c[a].name),l=_e(c[a].abbr),d=_e(c[a].narrow),t.push(i),e.push(l),n.push(d),s.push(i),s.push(l),s.push(d);this._erasRegex=new RegExp("^("+s.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+t.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+e.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}C(0,["gg",2],0,function(){return this.weekYear()%100}),C(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Pt(e,t){C(0,[e,e.length],0,t)}Pt("gggg","weekYear"),Pt("ggggg","weekYear"),Pt("GGGG","isoWeekYear"),Pt("GGGGG","isoWeekYear"),g("G",St),g("g",St),g("GG",U,te),g("gg",U,te),g("GGGG",Sn,Cn),g("gggg",Sn,Cn),g("GGGGG",Ct,vt),g("ggggg",Ct,vt),tt(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,s){t[s.substr(0,2)]=x(e)}),tt(["gg","GG"],function(e,t,n,s){t[s]=y.parseTwoDigitYear(e)});function Dc(e){return Oa.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function xc(e){return Oa.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function Yc(){return be(this.year(),1,4)}function Rc(){return be(this.isoWeekYear(),1,4)}function Bc(){var e=this.localeData()._week;return be(this.year(),e.dow,e.doy)}function Vc(){var e=this.localeData()._week;return be(this.weekYear(),e.dow,e.doy)}function Oa(e,t,n,s,a){var o;return e==null?rt(this,s,a).year:(o=be(e,s,a),t>o&&(t=o),Pc.call(this,e,t,n,s,a))}function Pc(e,t,n,s,a){var o=aa(e,t,n,s,a),i=at(o.year,0,o.dayOfYear);return this.year(i.getUTCFullYear()),this.month(i.getUTCMonth()),this.date(i.getUTCDate()),this}C("Q",0,"Qo","quarter"),g("Q",zs),L("Q",function(e,t){t[ge]=(x(e)-1)*3});function Lc(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}C("D",["DD",2],"Do","date"),g("D",U,Ue),g("DD",U,te),g("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),L(["D","DD"],pe),L("Do",function(e,t){t[pe]=x(e.match(U)[0])});var Ea=Fe("Date",!0);C("DDD",["DDDD",3],"DDDo","dayOfYear"),g("DDD",Nt),g("DDDD",qs),L(["DDD","DDDD"],function(e,t,n){n._dayOfYear=x(e)});function Ac(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}C("m",["mm",2],0,"minute"),g("m",U,Mn),g("mm",U,te),L(["m","mm"],le);var $c=Fe("Minutes",!1);C("s",["ss",2],0,"second"),g("s",U,Mn),g("ss",U,te),L(["s","ss"],ke);var Uc=Fe("Seconds",!1);C("S",0,0,function(){return~~(this.millisecond()/100)}),C(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),C(0,["SSS",3],0,"millisecond"),C(0,["SSSS",4],0,function(){return this.millisecond()*10}),C(0,["SSSSS",5],0,function(){return this.millisecond()*100}),C(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),C(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),C(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),C(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),g("S",Nt,zs),g("SS",Nt,te),g("SSS",Nt,qs);var Te,Ta;for(Te="SSSS";Te.length<=9;Te+="S")g(Te,$e);function Fc(e,t){t[xe]=x(("0."+e)*1e3)}for(Te="S";Te.length<=9;Te+="S")L(Te,Fc);Ta=Fe("Milliseconds",!1),C("z",0,0,"zoneAbbr"),C("zz",0,0,"zoneName");function Wc(){return this._isUTC?"UTC":""}function jc(){return this._isUTC?"Coordinated Universal Time":""}var h=Qe.prototype;h.add=Vd,h.calendar=Wd,h.clone=jd,h.diff=Xd,h.endOf=ic,h.format=tc,h.from=nc,h.fromNow=sc,h.to=ac,h.toNow=rc,h.get=el,h.invalidAt=yc,h.isAfter=Hd,h.isBefore=Gd,h.isBetween=zd,h.isSame=qd,h.isSameOrAfter=Zd,h.isSameOrBefore=Kd,h.isValid=pc,h.lang=va,h.locale=wa,h.localeData=Na,h.max=pd,h.min=fd,h.parsingFlags=mc,h.set=tl,h.startOf=oc,h.subtract=Pd,h.toArray=uc,h.toObject=hc,h.toDate=cc,h.toISOString=Qd,h.inspect=ec,typeof Symbol<"u"&&Symbol.for!=null&&(h[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),h.toJSON=fc,h.toString=Jd,h.unix=dc,h.valueOf=lc,h.creationData=_c,h.eraName=wc,h.eraNarrow=vc,h.eraAbbr=Nc,h.eraYear=Cc,h.year=Xs,h.isLeapYear=Qi,h.weekYear=Dc,h.isoWeekYear=xc,h.quarter=h.quarters=Lc,h.month=na,h.daysInMonth=cl,h.week=h.weeks=gl,h.isoWeek=h.isoWeeks=kl,h.weeksInYear=Bc,h.weeksInWeekYear=Vc,h.isoWeeksInYear=Yc,h.isoWeeksInISOWeekYear=Rc,h.date=Ea,h.day=h.days=xl,h.weekday=Yl,h.isoWeekday=Rl,h.dayOfYear=Ac,h.hour=h.hours=Ul,h.minute=h.minutes=$c,h.second=h.seconds=Uc,h.millisecond=h.milliseconds=Ta,h.utcOffset=Nd,h.utc=Sd,h.local=Md,h.parseZone=Od,h.hasAlignedHourOffset=Ed,h.isDST=Td,h.isLocal=Dd,h.isUtcOffset=xd,h.isUtc=ya,h.isUTC=ya,h.zoneAbbr=Wc,h.zoneName=jc,h.dates=ne("dates accessor is deprecated. Use date instead.",Ea),h.months=ne("months accessor is deprecated. Use month instead",na),h.years=ne("years accessor is deprecated. Use year instead",Xs),h.zone=ne("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Cd),h.isDSTShifted=ne("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Id);function Hc(e){return F(e*1e3)}function Gc(){return F.apply(null,arguments).parseZone()}function Ia(e){return e}var P=kn.prototype;P.calendar=Di,P.longDateFormat=Bi,P.invalidDate=Pi,P.ordinal=$i,P.preparse=Ia,P.postformat=Ia,P.relativeTime=Fi,P.pastFuture=Wi,P.set=Ti,P.eras=gc,P.erasParse=kc,P.erasConvertYear=bc,P.erasAbbrRegex=Mc,P.erasNameRegex=Sc,P.erasNarrowRegex=Oc,P.months=ol,P.monthsShort=il,P.monthsParse=dl,P.monthsRegex=hl,P.monthsShortRegex=ul,P.week=pl,P.firstDayOfYear=_l,P.firstDayOfWeek=yl,P.weekdays=Ol,P.weekdaysMin=Tl,P.weekdaysShort=El,P.weekdaysParse=Dl,P.weekdaysRegex=Bl,P.weekdaysShortRegex=Vl,P.weekdaysMinRegex=Pl,P.isPM=Al,P.meridiem=Fl;function Lt(e,t,n,s){var a=we(),o=ue().set(s,t);return a[n](o,e)}function Da(e,t,n){if(ye(e)&&(t=e,e=void 0),e=e||"",t!=null)return Lt(e,t,n,"month");var s,a=[];for(s=0;s<12;s++)a[s]=Lt(e,s,n,"month");return a}function Wn(e,t,n,s){typeof e=="boolean"?(ye(t)&&(n=t,t=void 0),t=t||""):(t=e,n=t,e=!1,ye(t)&&(n=t,t=void 0),t=t||"");var a=we(),o=e?a._week.dow:0,i,l=[];if(n!=null)return Lt(t,(n+o)%7,s,"day");for(i=0;i<7;i++)l[i]=Lt(t,(i+o)%7,s,"day");return l}function zc(e,t){return Da(e,t,"months")}function qc(e,t){return Da(e,t,"monthsShort")}function Zc(e,t,n){return Wn(e,t,n,"weekdays")}function Kc(e,t,n){return Wn(e,t,n,"weekdaysShort")}function Xc(e,t,n){return Wn(e,t,n,"weekdaysMin")}Ee("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=x(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+n}}),y.lang=ne("moment.lang is deprecated. Use moment.locale instead.",Ee),y.langData=ne("moment.langData is deprecated. Use moment.localeData instead.",we);var ve=Math.abs;function Jc(){var e=this._data;return this._milliseconds=ve(this._milliseconds),this._days=ve(this._days),this._months=ve(this._months),e.milliseconds=ve(e.milliseconds),e.seconds=ve(e.seconds),e.minutes=ve(e.minutes),e.hours=ve(e.hours),e.months=ve(e.months),e.years=ve(e.years),this}function xa(e,t,n,s){var a=de(t,n);return e._milliseconds+=s*a._milliseconds,e._days+=s*a._days,e._months+=s*a._months,e._bubble()}function Qc(e,t){return xa(this,e,t,1)}function eu(e,t){return xa(this,e,t,-1)}function Ya(e){return e<0?Math.floor(e):Math.ceil(e)}function tu(){var e=this._milliseconds,t=this._days,n=this._months,s=this._data,a,o,i,l,d;return e>=0&&t>=0&&n>=0||e<=0&&t<=0&&n<=0||(e+=Ya(jn(n)+t)*864e5,t=0,n=0),s.milliseconds=e%1e3,a=ae(e/1e3),s.seconds=a%60,o=ae(a/60),s.minutes=o%60,i=ae(o/60),s.hours=i%24,t+=ae(i/24),d=ae(Ra(t)),n+=d,t-=Ya(jn(d)),l=ae(n/12),n%=12,s.days=t,s.months=n,s.years=l,this}function Ra(e){return e*4800/146097}function jn(e){return e*146097/4800}function nu(e){if(!this.isValid())return NaN;var t,n,s=this._milliseconds;if(e=se(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+s/864e5,n=this._months+Ra(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(jn(this._months)),e){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return t*24+s/36e5;case"minute":return t*1440+s/6e4;case"second":return t*86400+s/1e3;case"millisecond":return Math.floor(t*864e5)+s;default:throw new Error("Unknown unit "+e)}}function Ne(e){return function(){return this.as(e)}}var Ba=Ne("ms"),su=Ne("s"),au=Ne("m"),ru=Ne("h"),ou=Ne("d"),iu=Ne("w"),lu=Ne("M"),du=Ne("Q"),cu=Ne("y"),uu=Ba;function hu(){return de(this)}function fu(e){return e=se(e),this.isValid()?this[e+"s"]():NaN}function Re(e){return function(){return this.isValid()?this._data[e]:NaN}}var pu=Re("milliseconds"),mu=Re("seconds"),yu=Re("minutes"),_u=Re("hours"),gu=Re("days"),ku=Re("months"),bu=Re("years");function wu(){return ae(this.days()/7)}var Ce=Math.round,Ge={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function vu(e,t,n,s,a){return a.relativeTime(t||1,!!n,e,s)}function Nu(e,t,n,s){var a=de(e).abs(),o=Ce(a.as("s")),i=Ce(a.as("m")),l=Ce(a.as("h")),d=Ce(a.as("d")),c=Ce(a.as("M")),u=Ce(a.as("w")),_=Ce(a.as("y")),p=o<=n.ss&&["s",o]||o<n.s&&["ss",o]||i<=1&&["m"]||i<n.m&&["mm",i]||l<=1&&["h"]||l<n.h&&["hh",l]||d<=1&&["d"]||d<n.d&&["dd",d];return n.w!=null&&(p=p||u<=1&&["w"]||u<n.w&&["ww",u]),p=p||c<=1&&["M"]||c<n.M&&["MM",c]||_<=1&&["y"]||["yy",_],p[2]=t,p[3]=+e>0,p[4]=s,vu.apply(null,p)}function Cu(e){return e===void 0?Ce:typeof e=="function"?(Ce=e,!0):!1}function Su(e,t){return Ge[e]===void 0?!1:t===void 0?Ge[e]:(Ge[e]=t,e==="s"&&(Ge.ss=t-1),!0)}function Mu(e,t){if(!this.isValid())return this.localeData().invalidDate();var n=!1,s=Ge,a,o;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(n=e),typeof t=="object"&&(s=Object.assign({},Ge,t),t.s!=null&&t.ss==null&&(s.ss=t.s-1)),a=this.localeData(),o=Nu(this,!n,s,a),n&&(o=a.pastFuture(+this,o)),a.postformat(o)}var Hn=Math.abs;function ze(e){return(e>0)-(e<0)||+e}function At(){if(!this.isValid())return this.localeData().invalidDate();var e=Hn(this._milliseconds)/1e3,t=Hn(this._days),n=Hn(this._months),s,a,o,i,l=this.asSeconds(),d,c,u,_;return l?(s=ae(e/60),a=ae(s/60),e%=60,s%=60,o=ae(n/12),n%=12,i=e?e.toFixed(3).replace(/\.?0+$/,""):"",d=l<0?"-":"",c=ze(this._months)!==ze(l)?"-":"",u=ze(this._days)!==ze(l)?"-":"",_=ze(this._milliseconds)!==ze(l)?"-":"",d+"P"+(o?c+o+"Y":"")+(n?c+n+"M":"")+(t?u+t+"D":"")+(a||s||e?"T":"")+(a?_+a+"H":"")+(s?_+s+"M":"")+(e?_+i+"S":"")):"P0D"}var Y=xt.prototype;Y.isValid=kd,Y.abs=Jc,Y.add=Qc,Y.subtract=eu,Y.as=nu,Y.asMilliseconds=Ba,Y.asSeconds=su,Y.asMinutes=au,Y.asHours=ru,Y.asDays=ou,Y.asWeeks=iu,Y.asMonths=lu,Y.asQuarters=du,Y.asYears=cu,Y.valueOf=uu,Y._bubble=tu,Y.clone=hu,Y.get=fu,Y.milliseconds=pu,Y.seconds=mu,Y.minutes=yu,Y.hours=_u,Y.days=gu,Y.weeks=wu,Y.months=ku,Y.years=bu,Y.humanize=Mu,Y.toISOString=At,Y.toString=At,Y.toJSON=At,Y.locale=wa,Y.localeData=Na,Y.toIsoString=ne("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",At),Y.lang=va,C("X",0,0,"unix"),C("x",0,0,"valueOf"),g("x",St),g("X",zi),L("X",function(e,t,n){n._d=new Date(parseFloat(e)*1e3)}),L("x",function(e,t,n){n._d=new Date(x(e))});y.version="2.30.1",Oi(F),y.fn=h,y.min=md,y.max=yd,y.now=_d,y.utc=ue,y.unix=Hc,y.months=zc,y.isDate=Je,y.locale=Ee,y.invalid=kt,y.duration=de,y.isMoment=ie,y.weekdays=Zc,y.parseZone=Gc,y.localeData=we,y.isDuration=Yt,y.monthsShort=qc,y.weekdaysMin=Xc,y.defineLocale=xn,y.updateLocale=Gl,y.locales=zl,y.weekdaysShort=Kc,y.normalizeUnits=se,y.relativeTimeRounding=Cu,y.relativeTimeThreshold=Su,y.calendarFormat=Fd,y.prototype=h,y.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const Ou="code-graph",Va=(e,t="",n="json")=>{const s=document.createElement("a");s.setAttribute("href",`data:text/${n};charset=UTF-8,${encodeURIComponent(e)}`);const a=y().format("YYMMDD_HHMMSS");s.setAttribute("download",`${Ou}_${a}_${t}.${n}`),s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s)},Pa=(e="json")=>{const t=document.createElement("input");return t.setAttribute("type","file"),t.setAttribute("id","fileElem"),t.setAttribute("multiple","true"),t.setAttribute("accept",`${e}/*`),t.style.display="none",document.body.appendChild(t),t.click(),t};class dt extends re.GraphTemplate{static fromGraph(t,n){return new dt(t.save(),n)}constructor(t,n){super(t,n)}get shortId(){return this.id.slice(0,6)}createGraph(t){const n=new Map,s=p=>{const I=Ie.v4();return n.set(p,I),I},a=p=>{const I=n.get(p);if(!I)throw new Error(`Unable to create graph from template: Could not map old id ${p} to new id`);return I},o=p=>bs(p,I=>({id:s(I.id),templateId:I.id,value:I.value})),i=this.nodes.map(p=>({...p,id:s(p.id),inputs:o(p.inputs),outputs:o(p.outputs)})),l=this.connections.map(p=>({id:s(p.id),from:a(p.from),to:a(p.to)})),d=this.inputs.map(p=>({id:p.id,name:p.name,nodeId:a(p.nodeId),nodeInterfaceId:a(p.nodeInterfaceId)})),c=this.outputs.map(p=>({id:p.id,name:p.name,nodeId:a(p.nodeId),nodeInterfaceId:a(p.nodeInterfaceId)})),u={id:Ie.v4(),nodes:i,connections:l,inputs:d,outputs:c};return t||(t=new Le(this.editor)),t.load(u).forEach(p=>console.warn(p)),t.template=this,t}}const Eu=e=>!(e instanceof Le);function La(e,t){return{switchGraph:s=>{let a;if(Eu(s))a=new Le(e.value),s.createGraph(a);else{if(s!==e.value.graph)throw new Error("Can only switch using 'Graph' instance when it is the root graph. Otherwise a 'GraphTemplate' must be used.");a=s}t.value&&t.value!==e.value.graph&&t.value.destroy(),a.panning=a.panning??s.panning??{x:0,y:0},a.scaling=a.scaling??s.scaling??1,a.selectedNodes=a.selectedNodes??[],a.sidebar=a.sidebar??{visible:!1,nodeId:"",optionName:""},t.value=a,a.code?.engine?.runOnce({})}}}class Tu extends Error{constructor(){super("Cycle detected")}}function Iu(e){return typeof e=="string"}function Du(e,t){const n=new Map,s=new Map,a=new Map;let o,i;if(e instanceof Le)o=e.nodes,i=e.connections;else throw new Error("Invalid argument value: expected array of connections");o.forEach(c=>{Object.values(c.inputs).forEach(u=>n.set(u.id,c.id)),Object.values(c.outputs).forEach(u=>n.set(u.id,c.id))}),o.forEach(c=>{const u=i.filter(p=>p.from&&n.get(p.from.id)===c.id),_=new Set(u.map(p=>n.get(p.to.id)).filter(Iu));s.set(c.id,_),a.set(c,u)});const l=o.slice();i.forEach(c=>{const u=l.findIndex(_=>n.get(c.to.id)===_.id);u>=0&&l.splice(u,1)});const d=[];for(;l.length>0;){const c=l.pop();d.push(c);const u=s.get(c.id);for(;u.size>0;){const _=u.values().next().value;if(u.delete(_),Array.from(s.values()).every(p=>!p.has(_))){const p=o.find(I=>I.id===_);l.push(p)}}}if(Array.from(s.values()).some(c=>c.size>0))throw new Tu;return{calculationOrder:d,connectionsFromNode:a,interfaceIdToNodeId:n}}const xu=e=>{e.allowMultipleConnections=!0};class Aa extends Ze.BaseEngine{order=new Map;constructor(t){super(t)}start(){super.start(),this.recalculateOrder=!0,this.calculateWithoutData()}async runGraph(t,n,s){this.order.has(t.id)||this.order.set(t.id,Du(t));const{calculationOrder:a,connectionsFromNode:o}=this.order.get(t.id),i=new Map;for(const l of a){const d={};Object.entries(l.inputs).forEach(([u,_])=>{if(u!=="_code")try{d[u]=this.getInterfaceValue(n,_.id)}catch{}}),l.isCodeNode&&(l.update(),l.updateCodeTemplate(),l.updateOutputNames()),this.events.beforeNodeCalculation.emit({inputValues:d,node:l});let c;if(l.calculate)c=await l.calculate(d,{globalValues:s,engine:this});else{c={};for(const[u,_]of Object.entries(l.outputs))c[u]=this.getInterfaceValue(n,_.id)}this.events.afterNodeCalculation.emit({outputValues:c,node:l}),i.set(l.id,new Map(Object.entries(c))),o.has(l)&&o.get(l).forEach(u=>{const _=Object.entries(l.outputs).find(([,I])=>I.id===u.from.id)?.[0];if(!_)throw new Error(`Could not find key for interface ${u.from.id}
|
|
6
|
+
This is likely an internal issue. Please report it on GitHub.`);const p=this.hooks.transferData.execute(c[_],u);_!=="_code"&&(u.to.allowMultipleConnections?n.has(u.to.id)?n.get(u.to.id).push(p):n.set(u.to.id,[p]):n.set(u.to.id,p))})}return i}async execute(t){this.recalculateOrder&&(this.order.clear(),this.recalculateOrder=!1);const n=this.getInputValues(this.editor.graph);return await this.runGraph(this.editor.graph,n,t)}getInputValues(t){const n=new Map;for(const s of t.nodes)Object.values(s.inputs).forEach(a=>{a.connectionCount===0&&n.set(a.id,a.getValue?a.getValue():a.value)}),s.calculate||Object.values(s.outputs).forEach(a=>{n.set(a.id,a.getValue?a.getValue():a.value)});return n}onChange(t){this.recalculateOrder=t||this.recalculateOrder,this.calculateWithoutData()}getInterfaceValue(t,n){if(!t.has(n))throw new Error(`Could not find value for interface ${n}
|
|
7
|
+
This is likely an internal issue. Please report it on GitHub.`);return t.get(n)}}const Gn="CLEAR_ALL",zn="DOWNLOAD_EDITOR_STATE",$a="RUN_ENGINE",qn="TOGGLE_MINIMAP",Zn="TOGGLE_PALETTE",Kn="UPLOAD_EDITOR_STATE",Ua=(e,t,n)=>{const s=n.zoomToFit.paddingLeft;t.registerCommand(Gn,{execute:()=>{t.executeCommand(T.Commands.CLEAR_CLIPBOARD_COMMAND),t.executeCommand(T.Commands.CLEAR_HISTORY_COMMAND),e.value.clear(),e.value.editor.code.clear()},canExecute:()=>e.value.nodes.length>0}),t.registerCommand(zn,{execute:()=>{const a=e.value.editor.save();Va(JSON.stringify(a,null,2),e.value.shortId)},canExecute:()=>e.value.nodes.length>0}),t.registerCommand(qn,{execute:()=>n.enableMinimap=!n.enableMinimap,canExecute:()=>e.value.nodes.length>1}),t.registerCommand(Zn,{execute:()=>{n.palette.enabled=!n.palette.enabled,n.zoomToFit.paddingLeft=n.palette.enabled?s:50},canExecute:()=>!0}),t.registerCommand(Kn,{execute:()=>{const a=Pa();a.addEventListener("change",()=>{document.body.removeChild(a);const o=a.files;if(!o||o.length<=0)return!1;const i=new FileReader;i.onload=l=>{if(l.target?.result){const d=l.target.result;if(d.length===0)return;const c=JSON.parse(d);e.value.editor.load(c),e.value.code?.engine?.runOnce({})}},i.readAsText(o.item(0))})},canExecute:()=>!0})},Fa=e=>{const t={command:Gn,title:"Clear all",icon:r.computed(()=>ds)},n={command:zn,title:"Download editor state",icon:r.computed(()=>os)},s={command:qn,title:"Toggle minimap",icon:r.computed(()=>e.enableMinimap?us:cs)},a={command:Zn,title:"Toggle palette",icon:r.computed(()=>e.palette.enabled?is:jt)},o={command:Kn,title:"Upload editor state",icon:r.computed(()=>fs)};e.toolbar.commands=[a,t,o,n,...T.DEFAULT_TOOLBAR_COMMANDS,s]},Wa=(e,t,n)=>{n.registerCommand($a,{execute:()=>t.runOnce({}),canExecute:()=>e.nodes.length>0})};function ja(e){const t=Symbol("CodeEngineToken");e.engine=new Aa(e.editor),Wa(e.editor.graph,e.engine,e.commandHandler),e.loadEditor=n=>{e.engine?.pause(),e.displayedGraph.clear(),e.editor.load(n),e.commandHandler.executeCommand(T.Commands.CLEAR_CLIPBOARD_COMMAND),e.commandHandler.executeCommand(T.Commands.CLEAR_HISTORY_COMMAND),e.engine?.resume(),e.engine?.runOnce({})},e.newGraph=()=>{e.engine?.pause(),e.displayedGraph.clear(),e.commandHandler.executeCommand(T.Commands.CLEAR_CLIPBOARD_COMMAND),e.commandHandler.executeCommand(T.Commands.CLEAR_HISTORY_COMMAND),e.displayedGraph.id=Ie.v4(),e.engine?.resume(),e.engine?.runOnce({})},e.subscribe=()=>{e.displayedGraph.events.addConnection.subscribe(t,n=>{const s=e.displayedGraph.findNodeById(n.to.nodeId);s&&s.isCodeNode&&s.onConnected();const a=e.displayedGraph.findNodeById(n.from.nodeId);a&&a.isCodeNode&&a.onConnected()}),e.displayedGraph.events.removeConnection.subscribe(t,n=>{const s=e.displayedGraph.findNodeById(n.to.nodeId);s&&s.isCodeNode&&s.onUnconnected();const a=e.displayedGraph.findNodeById(n.from.nodeId);a&&a.isCodeNode&&a.onUnconnected()}),e.engine?.events.beforeRun.subscribe(t,()=>{e.engine?.pause(),e.displayedGraph.beforeRun(),e.displayedGraph.sortNodesByRank(),e.displayedGraph.sortNodes(),e.engine?.resume()}),e.engine?.events.afterRun.subscribe(t,n=>{e.engine?.pause(),Ze.applyResult(n,e.editor),e.code.state.lockCode||e.code.renderCode({nodes:e.editor.graph.scriptedCodeNodes,modules:e.editor.code.modules}),e.engine?.resume()})},e.unsubscribe=()=>{e.displayedGraph.events.addConnection.unsubscribe(t),e.displayedGraph.events.removeConnection.unsubscribe(t),e.engine?.events.beforeRun.unsubscribe(t),e.engine?.events.afterRun.unsubscribe(t)}}class Yu extends re.Editor{code;graph;constructor(t){super(),this.code=t,this.graph=new Le(this)}get graphIds(){const t=[];return this.graphs.forEach(n=>t.push(n.id)),t.map(n=>n.slice(0,6)).join(", ")}get graphTemplateIds(){const t=[];return this.graphTemplates.forEach(n=>t.push(n.id)),t.map(n=>n.slice(0,6)).join(", ")}addGraphTemplate(t){if(this.events.beforeAddGraphTemplate.emit(t).prevented)return;this._graphTemplates.push(t),this.graphTemplateEvents.addTarget(t.events),this.graphTemplateHooks.addTarget(t.hooks);const n=Ls(t);this.registerNodeType(n,{category:"Subgraphs",title:t.name}),this.events.addGraphTemplate.emit(t)}load(t){try{for(super._loading=!0,t=this.hooks.load.execute(t);this.graphTemplates.length>0;)this.removeGraphTemplate(this.graphTemplates[0]);t.graphTemplates.forEach(s=>{const a=new dt(s,this);this.addGraphTemplate(a)});const n=this.graph.load(t.graph);return this.events.loaded.emit(),n.forEach(s=>console.warn(s)),n}finally{super._loading=!1}}registerNodeType(t,n){if(this.events.beforeRegisterNodeType.emit({type:t,options:n}).prevented)return;const s=new t;this.nodeTypes.set(s.type,{type:t,category:n?.category??"default",title:n?.title??s.title,orderRank:n?.orderRank}),this.events.registerNodeType.emit({type:t,options:n})}registerCategoryModule(t,n){this.code.state.modules[t]=n}}function Ru(e){const t=r.ref(e?.code??new _t),n=r.ref(e?.existingEditor??new Yu(t.value)),s=Symbol("ViewModelToken"),a=r.ref(null),o=r.shallowReadonly(a),{switchGraph:i}=La(n,a),l=r.computed(()=>o.value&&o.value!==n.value.graph),d=r.reactive(T.DEFAULT_SETTINGS());d.nodes.defaultWidth=gt;const c=T.useCommandHandler(),u=T.useHistory(o,c),_=T.useClipboard(o,n,c),p={renderNode:new es.SequentialHook(null),renderInterface:new es.SequentialHook(null)},I=r.reactive({clipboard:_,code:t,commandHandler:c,displayedGraph:o,editor:n,history:u,hooks:p,isReady:!1,isSubgraph:l,onBeforeUnmount:()=>{},onMounted:()=>{},settings:d,switchGraph:i});return t.value.registerViewModel(I),ja(I),T.registerDeleteNodesCommand(o,c),Ps(o,c,i),T.registerSaveSubgraphCommand(o,c),T.registerSwitchToMainGraphCommand(o,c,i),T.registerSidebarCommands(o,c),T.registerZoomToFitCommands(o,c,d),Ua(o,c,d),Fa(d),r.watch(n,(k,S)=>{S&&(S.events.registerGraph.unsubscribe(s),S.graphEvents.beforeAddNode.unsubscribe(s),k.nodeHooks.beforeLoad.unsubscribe(s),k.nodeHooks.afterSave.unsubscribe(s),k.graphTemplateHooks.beforeLoad.unsubscribe(s),k.graphTemplateHooks.afterSave.unsubscribe(s),k.graph.hooks.load.unsubscribe(s),k.graph.hooks.save.unsubscribe(s)),k&&(k.nodeHooks.beforeLoad.subscribe(s,(f,b)=>(b.position=f.position??{x:0,y:0},b.state&&(b.state.integrated=f.integrated,f.props&&(b.state.props=f.props),f.variableName&&(b.state.variableName=f.variableName)),f)),k.nodeHooks.afterSave.subscribe(s,(f,b)=>(f.position=b.position,b.state&&(f.integrated=b.state.integrated,b.state.props&&(f.props=b.state.props),b.state.variableName&&(f.variableName=b.state.variableName)),f)),k.graphTemplateHooks.beforeLoad.subscribe(s,(f,b)=>(b.panning=f.panning,b.scaling=f.scaling,f)),k.graphTemplateHooks.afterSave.subscribe(s,(f,b)=>(f.panning=b.panning,f.scaling=b.scaling,f)),k.graph.hooks.load.subscribe(s,(f,b)=>(b.panning=f.panning,b.scaling=f.scaling,f)),k.graph.hooks.save.subscribe(s,(f,b)=>(f.panning=b.panning,f.scaling=b.scaling,f)),k.graphEvents.beforeAddNode.subscribe(s,f=>T.setViewNodeProperties(f,{defaultWidth:d.nodes.defaultWidth})),n.value.registerNodeType(un,{category:"Subgraphs"}),n.value.registerNodeType(hn,{category:"Subgraphs"}),i(k.graph))},{immediate:!0}),r.nextTick(()=>I.isReady=!0),I}const Bu=Object.freeze(Object.defineProperty({__proto__:null,default:`{{ #modules }}
|
|
8
8
|
{{ . }}
|
|
9
9
|
{{ /modules }}
|
|
10
10
|
|
|
11
11
|
{{ #nodes }}
|
|
12
12
|
{{ #commented }}# {{ /commented }}{{ #variableName }}{{ variableName }} = {{ /variableName }}{{ script }}
|
|
13
|
-
{{ /nodes }}`},Symbol.toStringTag,{value:"Module"})),
|
|
13
|
+
{{ /nodes }}`},Symbol.toStringTag,{value:"Module"})),Vu=Object.freeze(Object.defineProperty({__proto__:null,default:`{{ #modules }}
|
|
14
14
|
{{ . }}
|
|
15
15
|
{{ /modules }}
|
|
16
16
|
|
|
17
17
|
{{ #nodes }}
|
|
18
18
|
{{ #commented }}// {{ /commented }}{{ #variableName }}var {{ variableName }} = {{ /variableName }}{{ script }};
|
|
19
|
-
{{ /nodes }}`},Symbol.toStringTag,{value:"Module"}));m.AbstractCodeNode=
|
|
19
|
+
{{ /nodes }}`},Symbol.toStringTag,{value:"Module"}));m.AbstractCodeNode=an,m.CLEAR_ALL_COMMAND=Gn,m.CREATE_SUBGRAPH_COMMAND=Bs,m.CheckboxInterface=Os,m.Code=_t,m.CodeEngine=Aa,m.CodeGraph=Le,m.CodeGraphInputNode=dn,m.CodeGraphOutputNode=cn,m.CodeGraphTemplate=dt,m.CodeNode=yt,m.CodeNodeInputInterface=Pe,m.CodeNodeInterface=J,m.CodeNodeOutputInterface=Es,m.DOWNLOAD_EDITOR_STATE_COMMAND=zn,m.DynamicCodeNode=Ys,m.GRAPH_INPUT_NODE_TYPE=on,m.GRAPH_OUTPUT_NODE_TYPE=ln,m.IntegerInterface=tn,m.JavascriptCode=vi,m.ListInputInterface=Ts,m.NODE_DEFAULT_WITH=gt,m.NumberInterface=nn,m.PythonCode=wi,m.RUN_ENGINE_COMMAND=$a,m.SelectInterface=Is,m.SliderInterface=Ds,m.SubgraphInputNode=un,m.SubgraphOutputNode=hn,m.TOGGLE_MINIMAP_COMMAND=qn,m.TOGGLE_PALETTE_COMMAND=Zn,m.TextInputInterface=Xe,m.TextareaInputInterface=gi,m.TupleInputInterface=xs,m.UPLOAD_EDITOR_STATE_COMMAND=Kn,m.addCodeInterfaces=Ke,m.addDefaultInterfaceTypes=_i,m.allowMultipleConnections=xu,m.booleanType=Zt,m.components=yi,m.createCodeGraphNodeType=Ls,m.createInterface=Cs,m.defineCodeNode=ki,m.defineDynamicCodeNode=bi,m.dictType=Ms,m.download=Va,m.filterObject=ks,m.formatInputs=Ss,m.getCodeNodes=rn,m.getPositionAtColumn=Ni,m.getPositionBeforeNode=Ci,m.icons=no,m.listType=Kt,m.mapValues=bs,m.nodeType=mt,m.numberType=Xt,m.registerCodeEngine=ja,m.registerCreateSubgraphCommand=Ps,m.registerCustomCommands=Ua,m.registerRunEngineCommands=Wa,m.stringType=Jt,m.tupleType=Qt,m.updateToolbarItems=Fa,m.upload=Pa,m.useCodeGraph=Ru,m.useSwitchCodeGraph=La,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})}));
|