From 1799ef88d4dcaa5684f68719be01bdc0eb5d3077 Mon Sep 17 00:00:00 2001 From: AlexisNeveu Date: Tue, 1 Oct 2024 11:18:56 +0200 Subject: [PATCH 1/3] Add Network Policy component --- src/assets/metadata/apiVersions/others.json | 150 ++++++++++++++++++++ 1 file changed, 150 insertions(+) diff --git a/src/assets/metadata/apiVersions/others.json b/src/assets/metadata/apiVersions/others.json index 0c4b830..bcb36ff 100644 --- a/src/assets/metadata/apiVersions/others.json +++ b/src/assets/metadata/apiVersions/others.json @@ -462,5 +462,155 @@ "type": "UnknownResource", "model": "DefaultModel", "icon": "question-mark" + }, + { + "type": "NetworkPolicy", + "model": "DefaultModel", + "icon": "resources/unlabeled/netpol", + "url": "https://kubernetes.io/docs/concepts/services-networking/network-policies/", + "description": "NetworkPolicy describes what network traffic is allowed for a set of Pods", + "attributes": [ + { + "name": "metadata", + "type": "Object", + "attributes": [ + { + "name": "name", + "type": "String", + "required": true + }, + { + "name": "namespace", + "type": "String" + } + ] + }, + { + "name": "spec", + "type": "Object", + "displayName": "Specification", + "expanded": true, + "attributes": [ + { + "name": "podSelector", + "type": "Object", + "required": true, + "attributes": [ + { + "name": "matchLabels", + "type": "Object" + } + ] + }, + { + "name": "policyTypes", + "type": "Array", + "attributes": [ + { + "name": null, + "type": "String", + "required": true + } + ] + }, + { + "name": "ingress", + "type": "Array", + "attributes": [ + { + "name": "from", + "type": "Array", + "attributes": [ + { + "name": "null", + "type": "Array", + "attributes": [ + { + "name": "podSelector", + "type": "Object", + "attributes": [ + { + "name": "matchLabels", + "type": "Object" + } + ] + } + ] + }, + { + "name": "port", + "type": "Object", + "attributes": [ + { + "name": "null", + "type": "Array", + "attributes": [ + { + "name": "protocol", + "type": "String" + } + ] + }, + { + "name": "port", + "type": "Number" + } + ] + } + ] + } + ] + }, + { + "name": "egress", + "type": "Array", + "attributes": [ + { + "name": "to", + "type": "Object", + "attributes": [ + { + "name": "null", + "type": "Array", + "attributes": [ + { + "name": "podSelector", + "type": "Object", + "attributes": [ + { + "name": "matchLabels", + "type": "Object" + } + ] + } + ] + }, + { + "name": "port", + "type": "Object", + "attributes": [ + { + "name": "null", + "type": "Array", + "attributes": [ + { + "name": "protocol", + "type": "String" + } + ] + }, + { + "name": "port", + "type": "Number" + } + ] + } + ] + } + ] + } + ] + } + ] } ] From 116c48914ca2375cee723ef1e279aa309ba1ecfb Mon Sep 17 00:00:00 2001 From: AlexisNeveu Date: Tue, 1 Oct 2024 11:19:24 +0200 Subject: [PATCH 2/3] Build plugin --- dist/kubernator-plugin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/kubernator-plugin.js b/dist/kubernator-plugin.js index 491f95c..430ef98 100644 --- a/dist/kubernator-plugin.js +++ b/dist/kubernator-plugin.js @@ -1,2 +1,2 @@ /*! For license information please see kubernator-plugin.js.LICENSE.txt */ -(()=>{var t={149:(t,e)=>{(()=>{var t={326:function(t){var e;"undefined"!=typeof self&&self,e=function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=11)}([function(t,e,n){"use strict";var r=Array.prototype,i=Object.prototype,o={"&":"&",'"':""","'":"'","<":"<",">":">","\\":"\"},a=/[&"'<>\\]/g;function s(t,e){return i.hasOwnProperty.call(t,e)}function u(t){return o[t]}function c(t,e,n){var r,i,o;if(t instanceof Error&&(t=(i=t).name+": "+i.message),Object.setPrototypeOf?(r=new Error(t),Object.setPrototypeOf(r,c.prototype)):(r=this,Object.defineProperty(r,"message",{enumerable:!1,writable:!0,value:t})),Object.defineProperty(r,"name",{value:"Template render error"}),Error.captureStackTrace&&Error.captureStackTrace(r,this.constructor),i){var a=Object.getOwnPropertyDescriptor(i,"stack");(o=a&&(a.get||function(){return a.value}))||(o=function(){return i.stack})}else{var s=new Error(t).stack;o=function(){return s}}return Object.defineProperty(r,"stack",{get:function(){return o.call(r)}}),Object.defineProperty(r,"cause",{value:i}),r.lineno=e,r.colno=n,r.firstUpdate=!0,r.Update=function(t){var e="("+(t||"unknown path")+")";return this.firstUpdate&&(this.lineno&&this.colno?e+=" [Line "+this.lineno+", Column "+this.colno+"]":this.lineno&&(e+=" [Line "+this.lineno+"]")),e+="\n ",this.firstUpdate&&(e+=" "),this.message=e+(this.message||""),this.firstUpdate=!1,this},r}function l(t){return"[object Function]"===i.toString.call(t)}function f(t){return"[object Array]"===i.toString.call(t)}function h(t){return"[object String]"===i.toString.call(t)}function p(t){return"[object Object]"===i.toString.call(t)}function d(t){var e,n=(e=t)?"string"==typeof e?e.split("."):[e]:[];return function(t){for(var e=t,r=0;rt.length)a=i.slice(0,t.length),i.slice(a.length,c).forEach((function(t,n){n2?i-2:0),a=2;a0||!n)&&process.stdout.write(" ".repeat(e));var o=i===r.length-1?"":"\n";process.stdout.write(""+t+o)}))}t.exports={Node:u,Root:f,NodeList:l,Value:c,Literal:h,Symbol:p,Group:d,Array:m,Pair:y,Dict:g,Output:$,Capture:q,TemplateData:U,If:b,IfAsync:_,InlineIf:w,For:x,AsyncEach:k,AsyncAll:O,Macro:S,Caller:E,Import:A,FromImport:T,FunCall:N,Filter:M,FilterAsync:C,KeywordArgs:j,Block:P,Super:L,Extends:I,Include:D,Set:R,Switch:B,Case:F,LookupVal:v,BinOp:z,In:V,Is:Y,Or:H,And:W,Not:G,Add:J,Concat:X,Sub:Q,Mul:Z,Div:tt,FloorDiv:et,Mod:nt,Pow:rt,Neg:it,Pos:ot,Compare:at,CompareOperand:st,CallExtension:ut,CallExtensionAsync:ct,printNodes:function t(e,n){if(n=n||0,lt(e.typename+": ",n),e instanceof l)lt("\n"),e.children.forEach((function(e){t(e,n+2)}));else if(e instanceof ut)lt(e.extName+"."+e.prop+"\n"),e.args&&t(e.args,n+2),e.contentArgs&&e.contentArgs.forEach((function(e){t(e,n+2)}));else{var r=[],i=null;e.iterFields((function(t,e){t instanceof u?r.push([e,t]):(i=i||{})[e]=t})),i?lt(JSON.stringify(i,null,2)+"\n",null,!0):lt("\n"),r.forEach((function(e){var r=e[0],i=e[1];lt("["+r+"] =>",n+2),t(i,n+4)}))}}}},function(t,e){},function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}var i=n(8),o=n(17),a=n(3),s=n(0).TemplateError,u=n(2).Frame,c=n(1).Obj,l={"==":"==","===":"===","!=":"!=","!==":"!==","<":"<",">":">","<=":"<=",">=":">="},f=function(t){var e,n;function i(){return t.apply(this,arguments)||this}n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n);var o=i.prototype;return o.init=function(t,e){this.templateName=t,this.codebuf=[],this.lastId=0,this.buffer=null,this.bufferStack=[],this._scopeClosers="",this.inBlock=!1,this.throwOnUndefined=e},o.fail=function(t,e,n){throw void 0!==e&&(e+=1),void 0!==n&&(n+=1),new s(t,e,n)},o._pushBuffer=function(){var t=this._tmpid();return this.bufferStack.push(this.buffer),this.buffer=t,this._emit("var "+this.buffer+' = "";'),t},o._popBuffer=function(){this.buffer=this.bufferStack.pop()},o._emit=function(t){this.codebuf.push(t)},o._emitLine=function(t){this._emit(t+"\n")},o._emitLines=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r0&&i._emit(","),i.compile(t,e)})),r&&this._emit(r)},o._compileExpression=function(t,e){this.assertType(t,a.Literal,a.Symbol,a.Group,a.Array,a.Dict,a.FunCall,a.Caller,a.Filter,a.LookupVal,a.Compare,a.InlineIf,a.In,a.Is,a.And,a.Or,a.Not,a.Add,a.Concat,a.Sub,a.Mul,a.Div,a.FloorDiv,a.Mod,a.Pow,a.Neg,a.Pos,a.Compare,a.NodeList),this.compile(t,e)},o.assertType=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r0&&r._emit(","),t){r._emitLine("function(cb) {"),r._emitLine("if(!cb) { cb = function(err) { if(err) { throw err; }}}");var i=r._pushBuffer();r._withScopedSyntax((function(){r.compile(t,e),r._emitLine("cb(null, "+i+");")})),r._popBuffer(),r._emitLine("return "+i+";"),r._emitLine("}")}else r._emit("null")})),n){var u=this._tmpid();this._emitLine(", "+this._makeCallback(u)),this._emitLine(this.buffer+" += runtime.suppressValue("+u+", "+s+" && env.opts.autoescape);"),this._addScopeLevel()}else this._emit(")"),this._emit(", "+s+" && env.opts.autoescape);\n")},o.compileCallExtensionAsync=function(t,e){this.compileCallExtension(t,e,!0)},o.compileNodeList=function(t,e){this._compileChildren(t,e)},o.compileLiteral=function(t){if("string"==typeof t.value){var e=t.value.replace(/\\/g,"\\\\");e=(e=(e=(e=(e=e.replace(/"/g,'\\"')).replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/\t/g,"\\t")).replace(/\u2028/g,"\\u2028"),this._emit('"'+e+'"')}else null===t.value?this._emit("null"):this._emit(t.value.toString())},o.compileSymbol=function(t,e){var n=t.value,r=e.lookup(n);r?this._emit(r):this._emit('runtime.contextOrFrameLookup(context, frame, "'+n+'")')},o.compileGroup=function(t,e){this._compileAggregate(t,e,"(",")")},o.compileArray=function(t,e){this._compileAggregate(t,e,"[","]")},o.compileDict=function(t,e){this._compileAggregate(t,e,"{","}")},o.compilePair=function(t,e){var n=t.key,r=t.value;n instanceof a.Symbol?n=new a.Literal(n.lineno,n.colno,n.value):n instanceof a.Literal&&"string"==typeof n.value||this.fail("compilePair: Dict keys must be strings or names",n.lineno,n.colno),this.compile(n,e),this._emit(": "),this._compileExpression(r,e)},o.compileInlineIf=function(t,e){this._emit("("),this.compile(t.cond,e),this._emit("?"),this.compile(t.body,e),this._emit(":"),null!==t.else_?this.compile(t.else_,e):this._emit('""'),this._emit(")")},o.compileIn=function(t,e){this._emit("runtime.inOperator("),this.compile(t.left,e),this._emit(","),this.compile(t.right,e),this._emit(")")},o.compileIs=function(t,e){var n=t.right.name?t.right.name.value:t.right.value;this._emit('env.getTest("'+n+'").call(context, '),this.compile(t.left,e),t.right.args&&(this._emit(","),this.compile(t.right.args,e)),this._emit(") === true")},o._binOpEmitter=function(t,e,n){this.compile(t.left,e),this._emit(n),this.compile(t.right,e)},o.compileOr=function(t,e){return this._binOpEmitter(t,e," || ")},o.compileAnd=function(t,e){return this._binOpEmitter(t,e," && ")},o.compileAdd=function(t,e){return this._binOpEmitter(t,e," + ")},o.compileConcat=function(t,e){return this._binOpEmitter(t,e,' + "" + ')},o.compileSub=function(t,e){return this._binOpEmitter(t,e," - ")},o.compileMul=function(t,e){return this._binOpEmitter(t,e," * ")},o.compileDiv=function(t,e){return this._binOpEmitter(t,e," / ")},o.compileMod=function(t,e){return this._binOpEmitter(t,e," % ")},o.compileNot=function(t,e){this._emit("!"),this.compile(t.target,e)},o.compileFloorDiv=function(t,e){this._emit("Math.floor("),this.compile(t.left,e),this._emit(" / "),this.compile(t.right,e),this._emit(")")},o.compilePow=function(t,e){this._emit("Math.pow("),this.compile(t.left,e),this._emit(", "),this.compile(t.right,e),this._emit(")")},o.compileNeg=function(t,e){this._emit("-"),this.compile(t.target,e)},o.compilePos=function(t,e){this._emit("+"),this.compile(t.target,e)},o.compileCompare=function(t,e){var n=this;this.compile(t.expr,e),t.ops.forEach((function(t){n._emit(" "+l[t.type]+" "),n.compile(t.expr,e)}))},o.compileLookupVal=function(t,e){this._emit("runtime.memberLookup(("),this._compileExpression(t.target,e),this._emit("),"),this._compileExpression(t.val,e),this._emit(")")},o._getNodeName=function(t){switch(t.typename){case"Symbol":return t.value;case"FunCall":return"the return value of ("+this._getNodeName(t.name)+")";case"LookupVal":return this._getNodeName(t.target)+'["'+this._getNodeName(t.val)+'"]';case"Literal":return t.value.toString();default:return"--expression--"}},o.compileFunCall=function(t,e){this._emit("(lineno = "+t.lineno+", colno = "+t.colno+", "),this._emit("runtime.callWrap("),this._compileExpression(t.name,e),this._emit(', "'+this._getNodeName(t.name).replace(/"/g,'\\"')+'", context, '),this._compileAggregate(t.args,e,"[","])"),this._emit(")")},o.compileFilter=function(t,e){var n=t.name;this.assertType(n,a.Symbol),this._emit('env.getFilter("'+n.value+'").call(context, '),this._compileAggregate(t.args,e),this._emit(")")},o.compileFilterAsync=function(t,e){var n=t.name,r=t.symbol.value;this.assertType(n,a.Symbol),e.set(r,r),this._emit('env.getFilter("'+n.value+'").call(context, '),this._compileAggregate(t.args,e),this._emitLine(", "+this._makeCallback(r)),this._addScopeLevel()},o.compileKeywordArgs=function(t,e){this._emit("runtime.makeKeywordArgs("),this.compileDict(t,e),this._emit(")")},o.compileSet=function(t,e){var n=this,r=[];t.targets.forEach((function(t){var i=t.value,o=e.lookup(i);null==o&&(o=n._tmpid(),n._emitLine("var "+o+";")),r.push(o)})),t.value?(this._emit(r.join(" = ")+" = "),this._compileExpression(t.value,e),this._emitLine(";")):(this._emit(r.join(" = ")+" = "),this.compile(t.body,e),this._emitLine(";")),t.targets.forEach((function(t,e){var i=r[e],o=t.value;n._emitLine('frame.set("'+o+'", '+i+", true);"),n._emitLine("if(frame.topLevel) {"),n._emitLine('context.setVariable("'+o+'", '+i+");"),n._emitLine("}"),"_"!==o.charAt(0)&&(n._emitLine("if(frame.topLevel) {"),n._emitLine('context.addExport("'+o+'", '+i+");"),n._emitLine("}"))}))},o.compileSwitch=function(t,e){var n=this;this._emit("switch ("),this.compile(t.expr,e),this._emit(") {"),t.cases.forEach((function(t,r){n._emit("case "),n.compile(t.cond,e),n._emit(": "),n.compile(t.body,e),t.body.children.length&&n._emitLine("break;")})),t.default&&(this._emit("default:"),this.compile(t.default,e)),this._emit("}")},o.compileIf=function(t,e,n){var r=this;this._emit("if("),this._compileExpression(t.cond,e),this._emitLine(") {"),this._withScopedSyntax((function(){r.compile(t.body,e),n&&r._emit("cb()")})),t.else_?(this._emitLine("}\nelse {"),this._withScopedSyntax((function(){r.compile(t.else_,e),n&&r._emit("cb()")}))):n&&(this._emitLine("}\nelse {"),this._emit("cb()")),this._emitLine("}")},o.compileIfAsync=function(t,e){this._emit("(function(cb) {"),this.compileIf(t,e,!0),this._emit("})("+this._makeCallback()),this._addScopeLevel()},o._emitLoopBindings=function(t,e,n,r){var i=this;[{name:"index",val:n+" + 1"},{name:"index0",val:n},{name:"revindex",val:r+" - "+n},{name:"revindex0",val:r+" - "+n+" - 1"},{name:"first",val:n+" === 0"},{name:"last",val:n+" === "+r+" - 1"},{name:"length",val:r}].forEach((function(t){i._emitLine('frame.set("loop.'+t.name+'", '+t.val+");")}))},o.compileFor=function(t,e){var n=this,r=this._tmpid(),i=this._tmpid(),o=this._tmpid();if(e=e.push(),this._emitLine("frame = frame.push();"),this._emit("var "+o+" = "),this._compileExpression(t.arr,e),this._emitLine(";"),this._emit("if("+o+") {"),this._emitLine(o+" = runtime.fromIterator("+o+");"),t.name instanceof a.Array){this._emitLine("var "+r+";"),this._emitLine("if(runtime.isArray("+o+")) {"),this._emitLine("var "+i+" = "+o+".length;"),this._emitLine("for("+r+"=0; "+r+" < "+o+".length; "+r+"++) {"),t.name.children.forEach((function(i,a){var s=n._tmpid();n._emitLine("var "+s+" = "+o+"["+r+"]["+a+"];"),n._emitLine('frame.set("'+i+'", '+o+"["+r+"]["+a+"]);"),e.set(t.name.children[a].value,s)})),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}"),this._emitLine("} else {");var s=t.name.children,u=s[0],c=s[1],l=this._tmpid(),f=this._tmpid();e.set(u.value,l),e.set(c.value,f),this._emitLine(r+" = -1;"),this._emitLine("var "+i+" = runtime.keys("+o+").length;"),this._emitLine("for(var "+l+" in "+o+") {"),this._emitLine(r+"++;"),this._emitLine("var "+f+" = "+o+"["+l+"];"),this._emitLine('frame.set("'+u.value+'", '+l+");"),this._emitLine('frame.set("'+c.value+'", '+f+");"),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}"),this._emitLine("}")}else{var h=this._tmpid();e.set(t.name.value,h),this._emitLine("var "+i+" = "+o+".length;"),this._emitLine("for(var "+r+"=0; "+r+" < "+o+".length; "+r+"++) {"),this._emitLine("var "+h+" = "+o+"["+r+"];"),this._emitLine('frame.set("'+t.name.value+'", '+h+");"),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}")}this._emitLine("}"),t.else_&&(this._emitLine("if (!"+i+") {"),this.compile(t.else_,e),this._emitLine("}")),this._emitLine("frame = frame.pop();")},o._compileAsyncLoop=function(t,e,n){var r=this,i=this._tmpid(),o=this._tmpid(),s=this._tmpid(),u=n?"asyncAll":"asyncEach";if(e=e.push(),this._emitLine("frame = frame.push();"),this._emit("var "+s+" = runtime.fromIterator("),this._compileExpression(t.arr,e),this._emitLine(");"),t.name instanceof a.Array){var c=t.name.children.length;this._emit("runtime."+u+"("+s+", "+c+", function("),t.name.children.forEach((function(t){r._emit(t.value+",")})),this._emit(i+","+o+",next) {"),t.name.children.forEach((function(t){var n=t.value;e.set(n,n),r._emitLine('frame.set("'+n+'", '+n+");")}))}else{var l=t.name.value;this._emitLine("runtime."+u+"("+s+", 1, function("+l+", "+i+", "+o+",next) {"),this._emitLine('frame.set("'+l+'", '+l+");"),e.set(l,l)}this._emitLoopBindings(t,s,i,o),this._withScopedSyntax((function(){var o;n&&(o=r._pushBuffer()),r.compile(t.body,e),r._emitLine("next("+i+(o?","+o:"")+");"),n&&r._popBuffer()}));var f=this._tmpid();this._emitLine("}, "+this._makeCallback(f)),this._addScopeLevel(),n&&this._emitLine(this.buffer+" += "+f+";"),t.else_&&(this._emitLine("if (!"+s+".length) {"),this.compile(t.else_,e),this._emitLine("}")),this._emitLine("frame = frame.pop();")},o.compileAsyncEach=function(t,e){this._compileAsyncLoop(t,e)},o.compileAsyncAll=function(t,e){this._compileAsyncLoop(t,e,!0)},o._compileMacro=function(t,e){var n=this,r=[],i=null,o="macro_"+this._tmpid(),s=void 0!==e;t.args.children.forEach((function(e,o){o===t.args.children.length-1&&e instanceof a.Dict?i=e:(n.assertType(e,a.Symbol),r.push(e))}));var c,l=[].concat(r.map((function(t){return"l_"+t.value})),["kwargs"]),f=r.map((function(t){return'"'+t.value+'"'})),h=(i&&i.children||[]).map((function(t){return'"'+t.key.value+'"'}));c=s?e.push(!0):new u,this._emitLines("var "+o+" = runtime.makeMacro(","["+f.join(", ")+"], ","["+h.join(", ")+"], ","function ("+l.join(", ")+") {","var callerFrame = frame;","frame = "+(s?"frame.push(true);":"new runtime.Frame();"),"kwargs = kwargs || {};",'if (Object.prototype.hasOwnProperty.call(kwargs, "caller")) {','frame.set("caller", kwargs.caller); }'),r.forEach((function(t){n._emitLine('frame.set("'+t.value+'", l_'+t.value+");"),c.set(t.value,"l_"+t.value)})),i&&i.children.forEach((function(t){var e=t.key.value;n._emit('frame.set("'+e+'", '),n._emit('Object.prototype.hasOwnProperty.call(kwargs, "'+e+'")'),n._emit(' ? kwargs["'+e+'"] : '),n._compileExpression(t.value,c),n._emit(");")}));var p=this._pushBuffer();return this._withScopedSyntax((function(){n.compile(t.body,c)})),this._emitLine("frame = "+(s?"frame.pop();":"callerFrame;")),this._emitLine("return new runtime.SafeString("+p+");"),this._emitLine("});"),this._popBuffer(),o},o.compileMacro=function(t,e){var n=this._compileMacro(t),r=t.name.value;e.set(r,n),e.parent?this._emitLine('frame.set("'+r+'", '+n+");"):("_"!==t.name.value.charAt(0)&&this._emitLine('context.addExport("'+r+'");'),this._emitLine('context.setVariable("'+r+'", '+n+");"))},o.compileCaller=function(t,e){this._emit("(function (){");var n=this._compileMacro(t,e);this._emit("return "+n+";})()")},o._compileGetTemplate=function(t,e,n,r){var i=this._tmpid(),o=this._templateName(),a=this._makeCallback(i),s=n?"true":"false",u=r?"true":"false";return this._emit("env.getTemplate("),this._compileExpression(t.template,e),this._emitLine(", "+s+", "+o+", "+u+", "+a),i},o.compileImport=function(t,e){var n=t.target.value,r=this._compileGetTemplate(t,e,!1,!1);this._addScopeLevel(),this._emitLine(r+".getExported("+(t.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(r)),this._addScopeLevel(),e.set(n,r),e.parent?this._emitLine('frame.set("'+n+'", '+r+");"):this._emitLine('context.setVariable("'+n+'", '+r+");")},o.compileFromImport=function(t,e){var n=this,r=this._compileGetTemplate(t,e,!1,!1);this._addScopeLevel(),this._emitLine(r+".getExported("+(t.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(r)),this._addScopeLevel(),t.names.children.forEach((function(t){var i,o,s=n._tmpid();t instanceof a.Pair?(i=t.key.value,o=t.value.value):o=i=t.value,n._emitLine("if(Object.prototype.hasOwnProperty.call("+r+', "'+i+'")) {'),n._emitLine("var "+s+" = "+r+"."+i+";"),n._emitLine("} else {"),n._emitLine("cb(new Error(\"cannot import '"+i+"'\")); return;"),n._emitLine("}"),e.set(o,s),e.parent?n._emitLine('frame.set("'+o+'", '+s+");"):n._emitLine('context.setVariable("'+o+'", '+s+");")}))},o.compileBlock=function(t){var e=this._tmpid();this.inBlock||this._emit('(parentTemplate ? function(e, c, f, r, cb) { cb(""); } : '),this._emit('context.getBlock("'+t.name.value+'")'),this.inBlock||this._emit(")"),this._emitLine("(env, context, frame, runtime, "+this._makeCallback(e)),this._emitLine(this.buffer+" += "+e+";"),this._addScopeLevel()},o.compileSuper=function(t,e){var n=t.blockName.value,r=t.symbol.value,i=this._makeCallback(r);this._emitLine('context.getSuper(env, "'+n+'", b_'+n+", frame, runtime, "+i),this._emitLine(r+" = runtime.markSafe("+r+");"),this._addScopeLevel(),e.set(r,r)},o.compileExtends=function(t,e){var n=this._tmpid(),r=this._compileGetTemplate(t,e,!0,!1);this._emitLine("parentTemplate = "+r),this._emitLine("for(var "+n+" in parentTemplate.blocks) {"),this._emitLine("context.addBlock("+n+", parentTemplate.blocks["+n+"]);"),this._emitLine("}"),this._addScopeLevel()},o.compileInclude=function(t,e){this._emitLine("var tasks = [];"),this._emitLine("tasks.push("),this._emitLine("function(callback) {");var n=this._compileGetTemplate(t,e,!1,t.ignoreMissing);this._emitLine("callback(null,"+n+");});"),this._emitLine("});");var r=this._tmpid();this._emitLine("tasks.push("),this._emitLine("function(template, callback){"),this._emitLine("template.render(context.getVariables(), frame, "+this._makeCallback(r)),this._emitLine("callback(null,"+r+");});"),this._emitLine("});"),this._emitLine("tasks.push("),this._emitLine("function(result, callback){"),this._emitLine(this.buffer+" += result;"),this._emitLine("callback(null);"),this._emitLine("});"),this._emitLine("env.waterfall(tasks, function(){"),this._addScopeLevel()},o.compileTemplateData=function(t,e){this.compileLiteral(t,e)},o.compileCapture=function(t,e){var n=this,r=this.buffer;this.buffer="output",this._emitLine("(function() {"),this._emitLine('var output = "";'),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("return output;"),this._emitLine("})()"),this.buffer=r},o.compileOutput=function(t,e){var n=this;t.children.forEach((function(r){r instanceof a.TemplateData?r.value&&(n._emit(n.buffer+" += "),n.compileLiteral(r,e),n._emitLine(";")):(n._emit(n.buffer+" += runtime.suppressValue("),n.throwOnUndefined&&n._emit("runtime.ensureDefined("),n.compile(r,e),n.throwOnUndefined&&n._emit(","+t.lineno+","+t.colno+")"),n._emit(", env.opts.autoescape);\n"))}))},o.compileRoot=function(t,e){var n=this;e&&this.fail("compileRoot: root node can't have frame"),e=new u,this._emitFuncBegin(t,"root"),this._emitLine("var parentTemplate = null;"),this._compileChildren(t,e),this._emitLine("if(parentTemplate) {"),this._emitLine("parentTemplate.rootRenderFunc(env, context, frame, runtime, cb);"),this._emitLine("} else {"),this._emitLine("cb(null, "+this.buffer+");"),this._emitLine("}"),this._emitFuncEnd(!0),this.inBlock=!0;var r=[],i=t.findAll(a.Block);i.forEach((function(t,e){var i=t.name.value;if(-1!==r.indexOf(i))throw new Error('Block "'+i+'" defined more than once.');r.push(i),n._emitFuncBegin(t,"b_"+i);var o=new u;n._emitLine("var frame = frame.push(true);"),n.compile(t.body,o),n._emitFuncEnd()})),this._emitLine("return {"),i.forEach((function(t,e){var r="b_"+t.name.value;n._emitLine(r+": "+r+",")})),this._emitLine("root: root\n};")},o.compile=function(t,e){var n=this["compile"+t.typename];n?n.call(this,t,e):this.fail("compile: Cannot compile node: "+t.typename,t.lineno,t.colno)},o.getCode=function(){return this.codebuf.join("")},i}(c);t.exports={compile:function(t,e,n,r,a){void 0===a&&(a={});var s=new f(r,a.throwOnUndefined),u=(n||[]).map((function(t){return t.preprocess})).filter((function(t){return!!t})).reduce((function(t,e){return e(t)}),t);return s.compile(o.transform(i.parse(u,n,a),e,r)),s.getCode()},Compiler:f}},function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}var i=n(4),o=n(1).EmitterObj;t.exports=function(t){var e,n;function o(){return t.apply(this,arguments)||this}n=t,(e=o).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n);var a=o.prototype;return a.resolve=function(t,e){return i.resolve(i.dirname(t),e)},a.isRelative=function(t){return 0===t.indexOf("./")||0===t.indexOf("../")},o}(o)},function(t,e,n){"use strict";function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,i(t,e)}function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}var o=n(12),a=n(15),s=n(0),u=n(5),c=n(18),l=n(10),f=l.FileSystemLoader,h=l.WebLoader,p=l.PrecompiledLoader,d=n(20),m=n(21),y=n(1),g=y.Obj,v=y.EmitterObj,b=n(2),_=b.handleError,w=b.Frame,x=n(22);function k(t,e,n){o((function(){t(e,n)}))}var O={type:"code",obj:{root:function(t,e,n,r,i){try{i(null,"")}catch(t){i(_(t,null,null))}}}},S=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.init=function(t,e){var n=this;e=this.opts=e||{},this.opts.dev=!!e.dev,this.opts.autoescape=null==e.autoescape||e.autoescape,this.opts.throwOnUndefined=!!e.throwOnUndefined,this.opts.trimBlocks=!!e.trimBlocks,this.opts.lstripBlocks=!!e.lstripBlocks,this.loaders=[],t?this.loaders=s.isArray(t)?t:[t]:f?this.loaders=[new f("views")]:h&&(this.loaders=[new h("/views")]),"undefined"!=typeof window&&window.nunjucksPrecompiled&&this.loaders.unshift(new p(window.nunjucksPrecompiled)),this._initLoaders(),this.globals=m(),this.filters={},this.tests={},this.asyncFilters=[],this.extensions={},this.extensionsList=[],s._entries(c).forEach((function(t){var e=t[0],r=t[1];return n.addFilter(e,r)})),s._entries(d).forEach((function(t){var e=t[0],r=t[1];return n.addTest(e,r)}))},n._initLoaders=function(){var t=this;this.loaders.forEach((function(e){e.cache={},"function"==typeof e.on&&(e.on("update",(function(n,r){e.cache[n]=null,t.emit("update",n,r,e)})),e.on("load",(function(n,r){t.emit("load",n,r,e)})))}))},n.invalidateCache=function(){this.loaders.forEach((function(t){t.cache={}}))},n.addExtension=function(t,e){return e.__name=t,this.extensions[t]=e,this.extensionsList.push(e),this},n.removeExtension=function(t){var e=this.getExtension(t);e&&(this.extensionsList=s.without(this.extensionsList,e),delete this.extensions[t])},n.getExtension=function(t){return this.extensions[t]},n.hasExtension=function(t){return!!this.extensions[t]},n.addGlobal=function(t,e){return this.globals[t]=e,this},n.getGlobal=function(t){if(void 0===this.globals[t])throw new Error("global not found: "+t);return this.globals[t]},n.addFilter=function(t,e,n){var r=e;return n&&this.asyncFilters.push(t),this.filters[t]=r,this},n.getFilter=function(t){if(!this.filters[t])throw new Error("filter not found: "+t);return this.filters[t]},n.addTest=function(t,e){return this.tests[t]=e,this},n.getTest=function(t){if(!this.tests[t])throw new Error("test not found: "+t);return this.tests[t]},n.resolveTemplate=function(t,e,n){return t.isRelative&&e&&t.isRelative(n)&&t.resolve?t.resolve(e,n):n},n.getTemplate=function(t,e,n,r,i){var o,a=this,u=this,c=null;if(t&&t.raw&&(t=t.raw),s.isFunction(n)&&(i=n,n=null,e=e||!1),s.isFunction(e)&&(i=e,e=!1),t instanceof A)c=t;else{if("string"!=typeof t)throw new Error("template names must be a string: "+t);for(var l=0;l0&&!this.skip(i.TOKEN_COMMA)&&this.fail("parseFrom: expected comma",t.lineno,t.colno);var s=this.parsePrimary();if("_"===s.value.charAt(0)&&this.fail("parseFrom: names starting with an underscore cannot be imported",s.lineno,s.colno),this.skipSymbol("as")){var u=this.parsePrimary();r.addChild(new o.Pair(s.lineno,s.colno,s,u))}else r.addChild(s);n=this.parseWithContext()}return new o.FromImport(t.lineno,t.colno,e,r,n)},u.parseBlock=function(){var t=this.peekToken();this.skipSymbol("block")||this.fail("parseBlock: expected block",t.lineno,t.colno);var e=new o.Block(t.lineno,t.colno);e.name=this.parsePrimary(),e.name instanceof o.Symbol||this.fail("parseBlock: variable name expected",t.lineno,t.colno),this.advanceAfterBlockEnd(t.value),e.body=this.parseUntilBlocks("endblock"),this.skipSymbol("endblock"),this.skipSymbol(e.name.value);var n=this.peekToken();return n||this.fail("parseBlock: expected endblock, got end of file"),this.advanceAfterBlockEnd(n.value),e},u.parseExtends=function(){var t="extends",e=this.peekToken();this.skipSymbol(t)||this.fail("parseTemplateRef: expected "+t);var n=new o.Extends(e.lineno,e.colno);return n.template=this.parseExpression(),this.advanceAfterBlockEnd(e.value),n},u.parseInclude=function(){var t="include",e=this.peekToken();this.skipSymbol(t)||this.fail("parseInclude: expected "+t);var n=new o.Include(e.lineno,e.colno);return n.template=this.parseExpression(),this.skipSymbol("ignore")&&this.skipSymbol("missing")&&(n.ignoreMissing=!0),this.advanceAfterBlockEnd(e.value),n},u.parseIf=function(){var t,e=this.peekToken();this.skipSymbol("if")||this.skipSymbol("elif")||this.skipSymbol("elseif")?t=new o.If(e.lineno,e.colno):this.skipSymbol("ifAsync")?t=new o.IfAsync(e.lineno,e.colno):this.fail("parseIf: expected if, elif, or elseif",e.lineno,e.colno),t.cond=this.parseExpression(),this.advanceAfterBlockEnd(e.value),t.body=this.parseUntilBlocks("elif","elseif","else","endif");var n=this.peekToken();switch(n&&n.value){case"elseif":case"elif":t.else_=this.parseIf();break;case"else":this.advanceAfterBlockEnd(),t.else_=this.parseUntilBlocks("endif"),this.advanceAfterBlockEnd();break;case"endif":t.else_=null,this.advanceAfterBlockEnd();break;default:this.fail("parseIf: expected elif, else, or endif, got end of file")}return t},u.parseSet=function(){var t=this.peekToken();this.skipSymbol("set")||this.fail("parseSet: expected set",t.lineno,t.colno);for(var e,n=new o.Set(t.lineno,t.colno,[]);(e=this.parsePrimary())&&(n.targets.push(e),this.skip(i.TOKEN_COMMA)););return this.skipValue(i.TOKEN_OPERATOR,"=")?(n.value=this.parseExpression(),this.advanceAfterBlockEnd(t.value)):this.skip(i.TOKEN_BLOCK_END)?(n.body=new o.Capture(t.lineno,t.colno,this.parseUntilBlocks("endset")),n.value=null,this.advanceAfterBlockEnd()):this.fail("parseSet: expected = or block end in set tag",t.lineno,t.colno),n},u.parseSwitch=function(){var t="switch",e="endswitch",n="case",r="default",i=this.peekToken();this.skipSymbol(t)||this.skipSymbol(n)||this.skipSymbol(r)||this.fail('parseSwitch: expected "switch," "case" or "default"',i.lineno,i.colno);var a=this.parseExpression();this.advanceAfterBlockEnd(t),this.parseUntilBlocks(n,r,e);var s,u=this.peekToken(),c=[];do{this.skipSymbol(n);var l=this.parseExpression();this.advanceAfterBlockEnd(t);var f=this.parseUntilBlocks(n,r,e);c.push(new o.Case(u.line,u.col,l,f)),u=this.peekToken()}while(u&&u.value===n);switch(u.value){case r:this.advanceAfterBlockEnd(),s=this.parseUntilBlocks(e),this.advanceAfterBlockEnd();break;case e:this.advanceAfterBlockEnd();break;default:this.fail('parseSwitch: expected "case," "default" or "endswitch," got EOF.')}return new o.Switch(i.lineno,i.colno,a,c,s)},u.parseStatement=function(){var t=this.peekToken();if(t.type!==i.TOKEN_SYMBOL&&this.fail("tag name expected",t.lineno,t.colno),this.breakOnBlocks&&-1!==s.indexOf(this.breakOnBlocks,t.value))return null;switch(t.value){case"raw":return this.parseRaw();case"verbatim":return this.parseRaw("verbatim");case"if":case"ifAsync":return this.parseIf();case"for":case"asyncEach":case"asyncAll":return this.parseFor();case"block":return this.parseBlock();case"extends":return this.parseExtends();case"include":return this.parseInclude();case"set":return this.parseSet();case"macro":return this.parseMacro();case"call":return this.parseCall();case"import":return this.parseImport();case"from":return this.parseFrom();case"filter":return this.parseFilterStatement();case"switch":return this.parseSwitch();default:if(this.extensions.length)for(var e=0;e0;){var u=a[0],c=a[1],l=a[2];l===t?r+=1:l===e&&(r-=1),0===r?(i+=c,this.tokens.backN(u.length-c.length)):i+=u}return new o.Output(s.lineno,s.colno,[new o.TemplateData(s.lineno,s.colno,i)])},u.parsePostfix=function(t){for(var e,n=this.peekToken();n;){if(n.type===i.TOKEN_LEFT_PAREN)t=new o.FunCall(n.lineno,n.colno,t,this.parseSignature());else if(n.type===i.TOKEN_LEFT_BRACKET)(e=this.parseAggregate()).children.length>1&&this.fail("invalid index"),t=new o.LookupVal(n.lineno,n.colno,t,e.children[0]);else{if(n.type!==i.TOKEN_OPERATOR||"."!==n.value)break;this.nextToken();var r=this.nextToken();r.type!==i.TOKEN_SYMBOL&&this.fail("expected name as lookup value, got "+r.value,r.lineno,r.colno),e=new o.Literal(r.lineno,r.colno,r.value),t=new o.LookupVal(n.lineno,n.colno,t,e)}n=this.peekToken()}return t},u.parseExpression=function(){return this.parseInlineIf()},u.parseInlineIf=function(){var t=this.parseOr();if(this.skipSymbol("if")){var e=this.parseOr(),n=t;(t=new o.InlineIf(t.lineno,t.colno)).body=n,t.cond=e,this.skipSymbol("else")?t.else_=this.parseOr():t.else_=null}return t},u.parseOr=function(){for(var t=this.parseAnd();this.skipSymbol("or");){var e=this.parseAnd();t=new o.Or(t.lineno,t.colno,t,e)}return t},u.parseAnd=function(){for(var t=this.parseNot();this.skipSymbol("and");){var e=this.parseNot();t=new o.And(t.lineno,t.colno,t,e)}return t},u.parseNot=function(){var t=this.peekToken();return this.skipSymbol("not")?new o.Not(t.lineno,t.colno,this.parseNot()):this.parseIn()},u.parseIn=function(){for(var t=this.parseIs();;){var e=this.nextToken();if(!e)break;var n=e.type===i.TOKEN_SYMBOL&&"not"===e.value;if(n||this.pushToken(e),!this.skipSymbol("in")){n&&this.pushToken(e);break}var r=this.parseIs();t=new o.In(t.lineno,t.colno,t,r),n&&(t=new o.Not(t.lineno,t.colno,t))}return t},u.parseIs=function(){var t=this.parseCompare();if(this.skipSymbol("is")){var e=this.skipSymbol("not"),n=this.parseCompare();t=new o.Is(t.lineno,t.colno,t,n),e&&(t=new o.Not(t.lineno,t.colno,t))}return t},u.parseCompare=function(){for(var t=["==","===","!=","!==","<",">","<=",">="],e=this.parseConcat(),n=[];;){var r=this.nextToken();if(!r)break;if(-1===t.indexOf(r.value)){this.pushToken(r);break}n.push(new o.CompareOperand(r.lineno,r.colno,this.parseConcat(),r.value))}return n.length?new o.Compare(n[0].lineno,n[0].colno,e,n):e},u.parseConcat=function(){for(var t=this.parseAdd();this.skipValue(i.TOKEN_TILDE,"~");){var e=this.parseAdd();t=new o.Concat(t.lineno,t.colno,t,e)}return t},u.parseAdd=function(){for(var t=this.parseSub();this.skipValue(i.TOKEN_OPERATOR,"+");){var e=this.parseSub();t=new o.Add(t.lineno,t.colno,t,e)}return t},u.parseSub=function(){for(var t=this.parseMul();this.skipValue(i.TOKEN_OPERATOR,"-");){var e=this.parseMul();t=new o.Sub(t.lineno,t.colno,t,e)}return t},u.parseMul=function(){for(var t=this.parseDiv();this.skipValue(i.TOKEN_OPERATOR,"*");){var e=this.parseDiv();t=new o.Mul(t.lineno,t.colno,t,e)}return t},u.parseDiv=function(){for(var t=this.parseFloorDiv();this.skipValue(i.TOKEN_OPERATOR,"/");){var e=this.parseFloorDiv();t=new o.Div(t.lineno,t.colno,t,e)}return t},u.parseFloorDiv=function(){for(var t=this.parseMod();this.skipValue(i.TOKEN_OPERATOR,"//");){var e=this.parseMod();t=new o.FloorDiv(t.lineno,t.colno,t,e)}return t},u.parseMod=function(){for(var t=this.parsePow();this.skipValue(i.TOKEN_OPERATOR,"%");){var e=this.parsePow();t=new o.Mod(t.lineno,t.colno,t,e)}return t},u.parsePow=function(){for(var t=this.parseUnary();this.skipValue(i.TOKEN_OPERATOR,"**");){var e=this.parseUnary();t=new o.Pow(t.lineno,t.colno,t,e)}return t},u.parseUnary=function(t){var e,n=this.peekToken();return e=this.skipValue(i.TOKEN_OPERATOR,"-")?new o.Neg(n.lineno,n.colno,this.parseUnary(!0)):this.skipValue(i.TOKEN_OPERATOR,"+")?new o.Pos(n.lineno,n.colno,this.parseUnary(!0)):this.parsePrimary(),t||(e=this.parseFilter(e)),e},u.parsePrimary=function(t){var e,n=this.nextToken(),r=null;if(n?n.type===i.TOKEN_STRING?e=n.value:n.type===i.TOKEN_INT?e=parseInt(n.value,10):n.type===i.TOKEN_FLOAT?e=parseFloat(n.value):n.type===i.TOKEN_BOOLEAN?"true"===n.value?e=!0:"false"===n.value?e=!1:this.fail("invalid boolean: "+n.value,n.lineno,n.colno):n.type===i.TOKEN_NONE?e=null:n.type===i.TOKEN_REGEX&&(e=new RegExp(n.value.body,n.value.flags)):this.fail("expected expression, got end of file"),void 0!==e?r=new o.Literal(n.lineno,n.colno,e):n.type===i.TOKEN_SYMBOL?r=new o.Symbol(n.lineno,n.colno,n.value):(this.pushToken(n),r=this.parseAggregate()),t||(r=this.parsePostfix(r)),r)return r;throw this.error("unexpected token: "+n.value,n.lineno,n.colno)},u.parseFilterName=function(){for(var t=this.expect(i.TOKEN_SYMBOL),e=t.value;this.skipValue(i.TOKEN_OPERATOR,".");)e+="."+this.expect(i.TOKEN_SYMBOL).value;return new o.Symbol(t.lineno,t.colno,e)},u.parseFilterArgs=function(t){return this.peekToken().type===i.TOKEN_LEFT_PAREN?this.parsePostfix(t).args.children:[]},u.parseFilter=function(t){for(;this.skip(i.TOKEN_PIPE);){var e=this.parseFilterName();t=new o.Filter(e.lineno,e.colno,e,new o.NodeList(e.lineno,e.colno,[t].concat(this.parseFilterArgs(t))))}return t},u.parseFilterStatement=function(){var t=this.peekToken();this.skipSymbol("filter")||this.fail("parseFilterStatement: expected filter");var e=this.parseFilterName(),n=this.parseFilterArgs(e);this.advanceAfterBlockEnd(t.value);var r=new o.Capture(e.lineno,e.colno,this.parseUntilBlocks("endfilter"));this.advanceAfterBlockEnd();var i=new o.Filter(e.lineno,e.colno,e,new o.NodeList(e.lineno,e.colno,[r].concat(n)));return new o.Output(e.lineno,e.colno,[i])},u.parseAggregate=function(){var t,e=this.nextToken();switch(e.type){case i.TOKEN_LEFT_PAREN:t=new o.Group(e.lineno,e.colno);break;case i.TOKEN_LEFT_BRACKET:t=new o.Array(e.lineno,e.colno);break;case i.TOKEN_LEFT_CURLY:t=new o.Dict(e.lineno,e.colno);break;default:return null}for(;;){var n=this.peekToken().type;if(n===i.TOKEN_RIGHT_PAREN||n===i.TOKEN_RIGHT_BRACKET||n===i.TOKEN_RIGHT_CURLY){this.nextToken();break}if(t.children.length>0&&(this.skip(i.TOKEN_COMMA)||this.fail("parseAggregate: expected comma after expression",e.lineno,e.colno)),t instanceof o.Dict){var r=this.parsePrimary();this.skip(i.TOKEN_COLON)||this.fail("parseAggregate: expected colon after dict key",e.lineno,e.colno);var a=this.parseExpression();t.addChild(new o.Pair(r.lineno,r.colno,r,a))}else{var s=this.parseExpression();t.addChild(s)}}return t},u.parseSignature=function(t,e){var n=this.peekToken();if(!e&&n.type!==i.TOKEN_LEFT_PAREN){if(t)return null;this.fail("expected arguments",n.lineno,n.colno)}n.type===i.TOKEN_LEFT_PAREN&&(n=this.nextToken());for(var r=new o.NodeList(n.lineno,n.colno),a=new o.KeywordArgs(n.lineno,n.colno),s=!1;;){if(n=this.peekToken(),!e&&n.type===i.TOKEN_RIGHT_PAREN){this.nextToken();break}if(e&&n.type===i.TOKEN_BLOCK_END)break;if(s&&!this.skip(i.TOKEN_COMMA))this.fail("parseSignature: expected comma after expression",n.lineno,n.colno);else{var u=this.parseExpression();this.skipValue(i.TOKEN_OPERATOR,"=")?a.addChild(new o.Pair(u.lineno,u.colno,u,this.parseExpression())):r.addChild(u)}s=!0}return a.children.length&&r.addChild(a),r},u.parseUntilBlocks=function(){for(var t=this.breakOnBlocks,e=arguments.length,n=new Array(e),r=0;r=","//","**"],R=C+this.current();switch(-1!==r.indexOf(D,R)&&(this.forward(),C=R,-1!==r.indexOf(D,R+this.current())&&(C=R+this.current(),this.forward())),C){case"(":I=d;break;case")":I=m;break;case"[":I=y;break;case"]":I=g;break;case"{":I=v;break;case"}":I=b;break;case",":I=w;break;case":":I=x;break;case"~":I=k;break;case"|":I=O;break;default:I=_}return M(I,C,e,n)}if((t=this._extractUntil(i+o)).match(/^[-+]?[0-9]+$/)){if("."===this.current()){this.forward();var B=this._extract("0123456789");return M(S,t+"."+B,e,n)}return M("int",t,e,n)}if(t.match(/^(true|false)$/))return M(E,t,e,n);if("none"===t)return M(A,t,e,n);if("null"===t)return M(A,t,e,n);if(t)return M(T,t,e,n);throw new Error("Unexpected value while parsing: "+t)}var F,$=this.tags.BLOCK_START.charAt(0)+this.tags.VARIABLE_START.charAt(0)+this.tags.COMMENT_START.charAt(0)+this.tags.COMMENT_END.charAt(0);if(this.isFinished())return null;if((t=this._extractString(this.tags.BLOCK_START+"-"))||(t=this._extractString(this.tags.BLOCK_START)))return this.in_code=!0,M(c,t,e,n);if((t=this._extractString(this.tags.VARIABLE_START+"-"))||(t=this._extractString(this.tags.VARIABLE_START)))return this.in_code=!0,M(f,t,e,n);t="";var q=!1;for(this._matches(this.tags.COMMENT_START)&&(q=!0,t=this._extractString(this.tags.COMMENT_START));null!==(F=this._extractUntil($));){if(t+=F,(this._matches(this.tags.BLOCK_START)||this._matches(this.tags.VARIABLE_START)||this._matches(this.tags.COMMENT_START))&&!q){if(this.lstripBlocks&&this._matches(this.tags.BLOCK_START)&&this.colno>0&&this.colno<=t.length){var U=t.slice(-this.colno);if(/^\s+$/.test(U)&&!(t=t.slice(0,-this.colno)).length)return this.nextToken()}break}if(this._matches(this.tags.COMMENT_END)){if(!q)throw new Error("unexpected end of comment");t+=this._extractString(this.tags.COMMENT_END);break}t+=this.current(),this.forward()}if(null===F&&q)throw new Error("expected end of comment, got end of file");return M(q?p:u,t,e,n)},e._parseString=function(t){this.forward();for(var e="";!this.isFinished()&&this.current()!==t;){var n=this.current();if("\\"===n){switch(this.forward(),this.current()){case"n":e+="\n";break;case"t":e+="\t";break;case"r":e+="\r";break;default:e+=this.current()}this.forward()}else e+=n,this.forward()}return this.forward(),e},e._matches=function(t){return this.index+t.length>this.len?null:this.str.slice(this.index,this.index+t.length)===t},e._extractString=function(t){return this._matches(t)?(this.forwardN(t.length),t):null},e._extractUntil=function(t){return this._extractMatching(!0,t||"")},e._extract=function(t){return this._extractMatching(!1,t)},e._extractMatching=function(t,e){if(this.isFinished())return null;var n=e.indexOf(this.current());if(t&&-1===n||!t&&-1!==n){var r=this.current();this.forward();for(var i=e.indexOf(this.current());(t&&-1===i||!t&&-1!==i)&&!this.isFinished();)r+=this.current(),this.forward(),i=e.indexOf(this.current());return r}return""},e._extractRegex=function(t){var e=this.currentStr().match(t);return e?(this.forwardN(e[0].length),e):null},e.isFinished=function(){return this.index>=this.len},e.forwardN=function(t){for(var e=0;e1024){for(var e=0,n=i.length-o;e0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}return t}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=h.bind(r);return i.listener=n,r.wrapFn=i,i}function d(t,e,n){var r=t._events;if(void 0===r)return[];var i=r[e];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(t){for(var e=new Array(t.length),n=0;n0&&(a=e[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=i[t];if(void 0===u)return!1;if("function"==typeof u)o(u,this,e);else{var c=u.length,l=y(u,c);for(n=0;n=0;o--)if(n[o]===e||n[o].listener===e){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(t,e){for(;e+1=0;r--)this.removeListener(t,e[r]);return this},s.prototype.listeners=function(t){return d(this,t,!0)},s.prototype.rawListeners=function(t){return d(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},s.prototype.listenerCount=m,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(t,e,n){"use strict";var r=n(3),i=n(0),o=0;function a(){return"hole_"+o++}function s(t,e){for(var n=null,r=0;r=e)return t;var n=e-t.length,a=r.repeat(" ",n/2-n%2),s=r.repeat(" ",n/2);return i.copySafeness(t,a+t+s)},e.default=function(t,e,n){return n?t||e:void 0!==t?t:e},e.dictsort=function(t,e,n){if(!r.isObject(t))throw new r.TemplateError("dictsort filter: val must be an object");var i,o=[];for(var a in t)o.push([a,t[a]]);if(void 0===n||"key"===n)i=0;else{if("value"!==n)throw new r.TemplateError("dictsort filter: You can only sort by either key or value");i=1}return o.sort((function(t,n){var o=t[i],a=n[i];return e||(r.isString(o)&&(o=o.toUpperCase()),r.isString(a)&&(a=a.toUpperCase())),o>a?1:o===a?0:-1})),o},e.dump=function(t,e){return JSON.stringify(t,null,e)},e.escape=function(t){return t instanceof i.SafeString?t:(t=null==t?"":t,i.markSafe(r.escape(t.toString())))},e.safe=function(t){return t instanceof i.SafeString?t:(t=null==t?"":t,i.markSafe(t.toString()))},e.first=function(t){return t[0]},e.forceescape=function(t){return t=null==t?"":t,i.markSafe(r.escape(t.toString()))},e.groupby=function(t,e){return r.groupBy(t,e,this.env.opts.throwOnUndefined)},e.indent=function(t,e,n){if(""===(t=o(t,"")))return"";e=e||4;var a=t.split("\n"),s=r.repeat(" ",e),u=a.map((function(t,e){return 0!==e||n?""+s+t:t})).join("\n");return i.copySafeness(t,u)},e.join=function(t,e,n){return e=e||"",n&&(t=r.map(t,(function(t){return t[n]}))),t.join(e)},e.last=function(t){return t[t.length-1]},e.length=function(t){var e=o(t,"");return void 0!==e?"function"==typeof Map&&e instanceof Map||"function"==typeof Set&&e instanceof Set?e.size:!r.isObject(e)||e instanceof i.SafeString?e.length:r.keys(e).length:0},e.list=u,e.lower=function(t){return(t=o(t,"")).toLowerCase()},e.nl2br=function(t){return null==t?"":i.copySafeness(t,t.replace(/\r\n|\n/g,"
\n"))},e.random=function(t){return t[Math.floor(Math.random()*t.length)]},e.reject=c(!1),e.rejectattr=function(t,e){return t.filter((function(t){return!t[e]}))},e.select=c(!0),e.selectattr=function(t,e){return t.filter((function(t){return!!t[e]}))},e.replace=function(t,e,n,r){var o=t;if(e instanceof RegExp)return t.replace(e,n);void 0===r&&(r=-1);var a="";if("number"==typeof e)e=""+e;else if("string"!=typeof e)return t;if("number"==typeof t&&(t=""+t),"string"!=typeof t&&!(t instanceof i.SafeString))return t;if(""===e)return a=n+t.split("").join(n)+n,i.copySafeness(t,a);var s=t.indexOf(e);if(0===r||-1===s)return t;for(var u=0,c=0;s>-1&&(-1===r||c=i&&l.push(n),o.push(l)}return o},e.sum=function(t,e,n){return void 0===n&&(n=0),e&&(t=r.map(t,(function(t){return t[e]}))),n+t.reduce((function(t,e){return t+e}),0)},e.sort=i.makeMacro(["value","reverse","case_sensitive","attribute"],[],(function(t,e,n,i){var o=this,a=r.map(t,(function(t){return t})),s=r.getAttrGetter(i);return a.sort((function(t,a){var u=i?s(t):t,c=i?s(a):a;if(o.env.opts.throwOnUndefined&&i&&(void 0===u||void 0===c))throw new TypeError('sort: attribute "'+i+'" resolved to undefined');return!n&&r.isString(u)&&r.isString(c)&&(u=u.toLowerCase(),c=c.toLowerCase()),uc?e?-1:1:0})),a})),e.string=function(t){return i.copySafeness(t,t)},e.striptags=function(t,e){var n,r=l((t=o(t,"")).replace(/<\/?([a-z][a-z0-9]*)\b[^>]*>|/gi,""));return n=e?r.replace(/^ +| +$/gm,"").replace(/ +/g," ").replace(/(\r\n)/g,"\n").replace(/\n\n\n+/g,"\n\n"):r.replace(/\s+/gi," "),i.copySafeness(t,n)},e.title=function(t){var e=(t=o(t,"")).split(" ").map((function(t){return s(t)}));return i.copySafeness(t,e.join(" "))},e.trim=l,e.truncate=function(t,e,n,r){var a=t;if(e=e||255,(t=o(t,"")).length<=e)return t;if(n)t=t.substring(0,e);else{var s=t.lastIndexOf(" ",e);-1===s&&(s=e),t=t.substring(0,s)}return t+=null!=r?r:"...",i.copySafeness(a,t)},e.upper=function(t){return(t=o(t,"")).toUpperCase()},e.urlencode=function(t){var e=encodeURIComponent;return r.isString(t)?e(t):(r.isArray(t)?t:r._entries(t)).map((function(t){var n=t[0],r=t[1];return e(n)+"="+e(r)})).join("&")};var f=/^(?:\(|<|<)?(.*?)(?:\.|,|\)|\n|>)?$/,h=/^[\w.!#$%&'*+\-\/=?\^`{|}~]+@[a-z\d\-]+(\.[a-z\d\-]+)+$/i,p=/^https?:\/\/.*$/,d=/^www\./,m=/\.(?:org|net|com)(?:\:|\/|$)/;e.urlize=function(t,e,n){a(e)&&(e=1/0);var r=!0===n?' rel="nofollow"':"";return t.split(/(\s+)/).filter((function(t){return t&&t.length})).map((function(t){var n=t.match(f),i=n?n[1]:t,o=i.substr(0,e);return p.test(i)?'"+o+"":d.test(i)?'"+o+"":h.test(i)?''+i+"":m.test(i)?'"+o+"":t})).join("")},e.wordcount=function(t){var e=(t=o(t,""))?t.match(/\w+/g):null;return e?e.length:null},e.float=function(t,e){var n=parseFloat(t);return a(n)?e:n};var y=i.makeMacro(["value","default","base"],[],(function(t,e,n){void 0===n&&(n=10);var r=parseInt(t,n);return a(r)?e:r}));e.int=y,e.d=e.default,e.e=e.escape},function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}var i=function(t){var e,n;function i(e){var n;return(n=t.call(this)||this).precompiled=e||{},n}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n),i.prototype.getSource=function(t){return this.precompiled[t]?{src:{type:"code",obj:this.precompiled[t]},path:t}:null},i}(n(6));t.exports={PrecompiledLoader:i}},function(t,e,n){"use strict";var r=n(2).SafeString;e.callable=function(t){return"function"==typeof t},e.defined=function(t){return void 0!==t},e.divisibleby=function(t,e){return t%e==0},e.escaped=function(t){return t instanceof r},e.equalto=function(t,e){return t===e},e.eq=e.equalto,e.sameas=e.equalto,e.even=function(t){return t%2==0},e.falsy=function(t){return!t},e.ge=function(t,e){return t>=e},e.greaterthan=function(t,e){return t>e},e.gt=e.greaterthan,e.le=function(t,e){return t<=e},e.lessthan=function(t,e){return t0)for(var i=t;ie;o+=n)r.push(o);return r},cycler:function(){return t=Array.prototype.slice.call(arguments),e=-1,{current:null,reset:function(){e=-1,this.current=null},next:function(){return++e>=t.length&&(e=0),this.current=t[e],this.current}};var t,e},joiner:function(t){return function(t){t=t||",";var e=!0;return function(){var n=e?"":t;return e=!1,n}}(t)}}}},function(t,e,n){var r=n(4);t.exports=function(t,e){function n(t,e){if(this.name=t,this.path=t,this.defaultEngine=e.defaultEngine,this.ext=r.extname(t),!this.ext&&!this.defaultEngine)throw new Error("No default engine was specified and no extension was provided.");this.ext||(this.name+=this.ext=("."!==this.defaultEngine[0]?".":"")+this.defaultEngine)}return n.prototype.render=function(e,n){t.render(this.name,e,n)},e.set("view",n),e.set("nunjucksEnv",t),t}},function(t,e,n){"use strict";var r=n(4),i=n(4),o=n(0)._prettifyError,a=n(5),s=n(7).Environment,u=n(24);function c(t,e){return!!Array.isArray(e)&&e.some((function(e){return t.match(e)}))}function l(t,e){(e=e||{}).isString=!0;var n=e.env||new s([]),r=e.wrapper||u;if(!e.name)throw new Error('the "name" option is required when compiling a string');return r([f(t,e.name,n)],e)}function f(t,e,n){var r,i=(n=n||new s([])).asyncFilters,u=n.extensionsList;e=e.replace(/\\/g,"/");try{r=a.compile(t,i,u,e,n.opts)}catch(t){throw o(e,!1,t)}return{name:e,template:r}}t.exports={precompile:function(t,e){var n=(e=e||{}).env||new s([]),o=e.wrapper||u;if(e.isString)return l(t,e);var a=r.existsSync(t)&&r.statSync(t),h=[],p=[];if(a.isFile())h.push(f(r.readFileSync(t,"utf-8"),e.name||t,n));else if(a.isDirectory()){!function n(o){r.readdirSync(o).forEach((function(a){var s=i.join(o,a),u=s.substr(i.join(t,"/").length),l=r.statSync(s);l&&l.isDirectory()?c(u+="/",e.exclude)||n(s):c(u,e.include)&&p.push(s)}))}(t);for(var d=0;dt.length||i>0&&a>=r||i<0&&a<=r);a+=i)o.push(n.memberLookup(t,a));return o}function p(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var d={pop:function(t){if(void 0===t)return this.pop();if(t>=this.length||t<0)throw new Error("KeyError");return this.splice(t,1)},append:function(t){return this.push(t)},remove:function(t){for(var e=0;e{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};(()=>{"use strict";r.r(i),r.d(i,{Component:()=>S,ComponentAttribute:()=>f,ComponentAttributeDefinition:()=>P,ComponentDefinition:()=>A,ComponentDrawOption:()=>g,ComponentLink:()=>$,ComponentLinkDefinition:()=>U,ComponentRenderer:()=>FT,DefaultConfiguration:()=>HN,DefaultData:()=>$N,DefaultDrawer:()=>fN,DefaultMetadata:()=>mN,DefaultParser:()=>bN,DefaultPlugin:()=>XN,DefaultRender:()=>kN,FileInformation:()=>m,FileInput:()=>G,LinkRenderer:()=>KT,ParserLog:()=>s,Tag:()=>ZN,Variable:()=>aM});var t={};function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function n(t,e,n){return(e=o(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o(t){var n=function(t){if("object"!=e(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=e(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==e(n)?n:n+""}r.r(t),r.d(t,{Adder:()=>xt,Delaunay:()=>Uu,FormatSpecifier:()=>sf,InternMap:()=>St,InternSet:()=>Et,Node:()=>Cy,Path:()=>is,Voronoi:()=>Du,ZoomTransform:()=>$E,active:()=>ca,arc:()=>OO,area:()=>jO,areaRadial:()=>qO,ascending:()=>J,autoType:()=>wc,axisBottom:()=>pn,axisLeft:()=>dn,axisRight:()=>hn,axisTop:()=>fn,bin:()=>ae,bisect:()=>ot,bisectCenter:()=>it,bisectLeft:()=>rt,bisectRight:()=>nt,bisector:()=>Q,blob:()=>ll,blur:()=>at,blur2:()=>st,blurImage:()=>ut,brush:()=>Ba,brushSelection:()=>Ia,brushX:()=>Da,brushY:()=>Ra,buffer:()=>hl,chord:()=>Ga,chordDirected:()=>Xa,chordTranspose:()=>Ja,cluster:()=>Oy,color:()=>oi,contourDensity:()=>pu,contours:()=>ou,count:()=>pt,create:()=>Qk,creator:()=>_r,cross:()=>gt,csv:()=>gl,csvFormat:()=>uc,csvFormatBody:()=>cc,csvFormatRow:()=>fc,csvFormatRows:()=>lc,csvFormatValue:()=>hc,csvParse:()=>ac,csvParseRows:()=>sc,cubehelix:()=>Gs,cumsum:()=>vt,curveBasis:()=>CS,curveBasisClosed:()=>PS,curveBasisOpen:()=>IS,curveBumpX:()=>VO,curveBumpY:()=>YO,curveBundle:()=>RS,curveCardinal:()=>$S,curveCardinalClosed:()=>US,curveCardinalOpen:()=>zS,curveCatmullRom:()=>HS,curveCatmullRomClosed:()=>GS,curveCatmullRomOpen:()=>XS,curveLinear:()=>TO,curveLinearClosed:()=>ZS,curveMonotoneX:()=>sE,curveMonotoneY:()=>uE,curveNatural:()=>fE,curveStep:()=>pE,curveStepAfter:()=>mE,curveStepBefore:()=>dE,descending:()=>X,deviation:()=>_t,difference:()=>ze,disjoint:()=>Ve,dispatch:()=>_n,drag:()=>Gu,dragDisable:()=>Fr,dragEnable:()=>$r,dsv:()=>yl,dsvFormat:()=>ic,easeBack:()=>il,easeBackIn:()=>nl,easeBackInOut:()=>il,easeBackOut:()=>rl,easeBounce:()=>Zc,easeBounceIn:()=>Qc,easeBounceInOut:()=>tl,easeBounceOut:()=>Zc,easeCircle:()=>qc,easeCircleIn:()=>Fc,easeCircleInOut:()=>qc,easeCircleOut:()=>$c,easeCubic:()=>oa,easeCubicIn:()=>ra,easeCubicInOut:()=>oa,easeCubicOut:()=>ia,easeElastic:()=>sl,easeElasticIn:()=>al,easeElasticInOut:()=>ul,easeElasticOut:()=>sl,easeExp:()=>Bc,easeExpIn:()=>Dc,easeExpInOut:()=>Bc,easeExpOut:()=>Rc,easeLinear:()=>kc,easePoly:()=>Nc,easePolyIn:()=>Ac,easePolyInOut:()=>Nc,easePolyOut:()=>Tc,easeQuad:()=>Ec,easeQuadIn:()=>Oc,easeQuadInOut:()=>Ec,easeQuadOut:()=>Sc,easeSin:()=>Lc,easeSinIn:()=>jc,easeSinInOut:()=>Lc,easeSinOut:()=>Pc,every:()=>Be,extent:()=>wt,fcumsum:()=>Ot,filter:()=>$e,flatGroup:()=>It,flatRollup:()=>Dt,forceCenter:()=>El,forceCollide:()=>Fl,forceLink:()=>Ul,forceManyBody:()=>Xl,forceRadial:()=>Ql,forceSimulation:()=>Jl,forceX:()=>Zl,forceY:()=>tf,format:()=>hf,formatDefaultLocale:()=>gf,formatLocale:()=>yf,formatPrefix:()=>pf,formatSpecifier:()=>af,fsum:()=>kt,geoAlbers:()=>Fm,geoAlbersUsa:()=>$m,geoArea:()=>wh,geoAzimuthalEqualArea:()=>zm,geoAzimuthalEqualAreaRaw:()=>Km,geoAzimuthalEquidistant:()=>Ym,geoAzimuthalEquidistantRaw:()=>Vm,geoBounds:()=>np,geoCentroid:()=>dp,geoCircle:()=>Sp,geoClipAntimeridian:()=>Dp,geoClipCircle:()=>Rp,geoClipExtent:()=>Vp,geoClipRectangle:()=>zp,geoConicConformal:()=>Qm,geoConicConformalRaw:()=>Xm,geoConicEqualArea:()=>Bm,geoConicEqualAreaRaw:()=>Rm,geoConicEquidistant:()=>ny,geoConicEquidistantRaw:()=>ey,geoContains:()=>ud,geoDistance:()=>Zp,geoEqualEarth:()=>cy,geoEqualEarthRaw:()=>uy,geoEquirectangular:()=>ty,geoEquirectangularRaw:()=>Zm,geoGnomonic:()=>fy,geoGnomonicRaw:()=>ly,geoGraticule:()=>fd,geoGraticule10:()=>hd,geoIdentity:()=>hy,geoInterpolate:()=>pd,geoLength:()=>Jp,geoMercator:()=>Wm,geoMercatorRaw:()=>Hm,geoNaturalEarth1:()=>dy,geoNaturalEarth1Raw:()=>py,geoOrthographic:()=>yy,geoOrthographicRaw:()=>my,geoPath:()=>_m,geoProjection:()=>Lm,geoProjectionMutator:()=>Im,geoRotation:()=>xp,geoStereographic:()=>vy,geoStereographicRaw:()=>gy,geoStream:()=>Xf,geoTransform:()=>wm,geoTransverseMercator:()=>_y,geoTransverseMercatorRaw:()=>by,gray:()=>Ns,greatest:()=>pe,greatestIndex:()=>Me,group:()=>jt,groupSort:()=>Ht,groups:()=>Pt,hcl:()=>Bs,hierarchy:()=>Ey,histogram:()=>ae,hsl:()=>vi,html:()=>Ol,image:()=>bl,index:()=>Ft,indexes:()=>$t,interpolate:()=>zi,interpolateArray:()=>Di,interpolateBasis:()=>Oi,interpolateBasisClosed:()=>Si,interpolateBlues:()=>Sk,interpolateBrBG:()=>Rx,interpolateBuGn:()=>ek,interpolateBuPu:()=>rk,interpolateCividis:()=>Dk,interpolateCool:()=>Fk,interpolateCubehelix:()=>Vg,interpolateCubehelixDefault:()=>Rk,interpolateCubehelixLong:()=>Yg,interpolateDate:()=>Bi,interpolateDiscrete:()=>jg,interpolateGnBu:()=>ok,interpolateGreens:()=>Ak,interpolateGreys:()=>Nk,interpolateHcl:()=>Ug,interpolateHclLong:()=>Kg,interpolateHsl:()=>Bg,interpolateHslLong:()=>Fg,interpolateHue:()=>Pg,interpolateInferno:()=>Jk,interpolateLab:()=>$g,interpolateMagma:()=>Gk,interpolateNumber:()=>Fi,interpolateNumberArray:()=>Li,interpolateObject:()=>$i,interpolateOrRd:()=>sk,interpolateOranges:()=>Ik,interpolatePRGn:()=>Fx,interpolatePiYG:()=>qx,interpolatePlasma:()=>Xk,interpolatePuBu:()=>fk,interpolatePuBuGn:()=>ck,interpolatePuOr:()=>Kx,interpolatePuRd:()=>pk,interpolatePurples:()=>Ck,interpolateRainbow:()=>qk,interpolateRdBu:()=>Vx,interpolateRdGy:()=>Hx,interpolateRdPu:()=>mk,interpolateRdYlBu:()=>Gx,interpolateRdYlGn:()=>Xx,interpolateReds:()=>Pk,interpolateRgb:()=>Mi,interpolateRgbBasis:()=>ji,interpolateRgbBasisClosed:()=>Pi,interpolateRound:()=>Lg,interpolateSinebow:()=>Vk,interpolateSpectral:()=>Zx,interpolateString:()=>Ki,interpolateTransformCss:()=>jo,interpolateTransformSvg:()=>Po,interpolateTurbo:()=>Yk,interpolateViridis:()=>Wk,interpolateWarm:()=>Bk,interpolateYlGn:()=>bk,interpolateYlGnBu:()=>gk,interpolateYlOrBr:()=>wk,interpolateYlOrRd:()=>kk,interpolateZoom:()=>Dg,interrupt:()=>Eo,intersection:()=>Ye,interval:()=>RE,isoFormat:()=>LE,isoParse:()=>DE,json:()=>wl,lab:()=>Ms,lch:()=>Rs,least:()=>Te,leastIndex:()=>Ne,line:()=>CO,lineRadial:()=>$O,link:()=>JO,linkHorizontal:()=>XO,linkRadial:()=>ZO,linkVertical:()=>QO,local:()=>tO,map:()=>qe,matcher:()=>En,max:()=>se,maxIndex:()=>ue,mean:()=>be,median:()=>_e,medianIndex:()=>we,merge:()=>xe,min:()=>ce,minIndex:()=>le,mode:()=>ke,namespace:()=>qn,namespaces:()=>$n,nice:()=>ie,now:()=>io,pack:()=>ng,packEnclose:()=>$y,packSiblings:()=>tg,pairs:()=>Oe,partition:()=>ug,path:()=>os,pathRound:()=>as,permute:()=>Kt,pie:()=>IO,piecewise:()=>Hg,pointRadial:()=>UO,pointer:()=>Yi,pointers:()=>nO,polygonArea:()=>Gg,polygonCentroid:()=>Jg,polygonContains:()=>ev,polygonHull:()=>tv,polygonLength:()=>nv,precisionFixed:()=>vf,precisionPrefix:()=>bf,precisionRound:()=>_f,quadtree:()=>Cl,quantile:()=>de,quantileIndex:()=>ye,quantileSorted:()=>me,quantize:()=>Wg,quickselect:()=>fe,radialArea:()=>qO,radialLine:()=>$O,randomBates:()=>cv,randomBernoulli:()=>hv,randomBeta:()=>mv,randomBinomial:()=>yv,randomCauchy:()=>vv,randomExponential:()=>lv,randomGamma:()=>dv,randomGeometric:()=>pv,randomInt:()=>ov,randomIrwinHall:()=>uv,randomLcg:()=>Ov,randomLogNormal:()=>sv,randomLogistic:()=>bv,randomNormal:()=>av,randomPareto:()=>fv,randomPoisson:()=>_v,randomUniform:()=>iv,randomWeibull:()=>gv,range:()=>Ee,rank:()=>Ae,reduce:()=>Ue,reverse:()=>Ke,rgb:()=>ci,ribbon:()=>gs,ribbonArrow:()=>vs,rollup:()=>Rt,rollups:()=>Bt,scaleBand:()=>Nv,scaleDiverging:()=>vx,scaleDivergingLog:()=>bx,scaleDivergingPow:()=>wx,scaleDivergingSqrt:()=>xx,scaleDivergingSymlog:()=>_x,scaleIdentity:()=>zv,scaleImplicit:()=>Av,scaleLinear:()=>Kv,scaleLog:()=>Zv,scaleOrdinal:()=>Tv,scalePoint:()=>Cv,scalePow:()=>ub,scaleQuantile:()=>hb,scaleQuantize:()=>pb,scaleRadial:()=>fb,scaleSequential:()=>fx,scaleSequentialLog:()=>hx,scaleSequentialPow:()=>dx,scaleSequentialQuantile:()=>yx,scaleSequentialSqrt:()=>mx,scaleSequentialSymlog:()=>px,scaleSqrt:()=>cb,scaleSymlog:()=>rb,scaleThreshold:()=>db,scaleTime:()=>sx,scaleUtc:()=>ux,scan:()=>Ce,schemeAccent:()=>Sx,schemeBlues:()=>Ok,schemeBrBG:()=>Dx,schemeBuGn:()=>tk,schemeBuPu:()=>nk,schemeCategory10:()=>Ox,schemeDark2:()=>Ex,schemeGnBu:()=>ik,schemeGreens:()=>Ek,schemeGreys:()=>Tk,schemeObservable10:()=>Ax,schemeOrRd:()=>ak,schemeOranges:()=>Lk,schemePRGn:()=>Bx,schemePaired:()=>Tx,schemePastel1:()=>Nx,schemePastel2:()=>Mx,schemePiYG:()=>$x,schemePuBu:()=>lk,schemePuBuGn:()=>uk,schemePuOr:()=>Ux,schemePuRd:()=>hk,schemePurples:()=>Mk,schemeRdBu:()=>zx,schemeRdGy:()=>Yx,schemeRdPu:()=>dk,schemeRdYlBu:()=>Wx,schemeRdYlGn:()=>Jx,schemeReds:()=>jk,schemeSet1:()=>Cx,schemeSet2:()=>jx,schemeSet3:()=>Px,schemeSpectral:()=>Qx,schemeTableau10:()=>Lx,schemeYlGn:()=>vk,schemeYlGnBu:()=>yk,schemeYlOrBr:()=>_k,schemeYlOrRd:()=>xk,select:()=>Lr,selectAll:()=>rO,selection:()=>Pr,selector:()=>xn,selectorAll:()=>Sn,shuffle:()=>je,shuffler:()=>Pe,some:()=>Fe,sort:()=>zt,stack:()=>_E,stackOffsetDiverging:()=>xE,stackOffsetExpand:()=>wE,stackOffsetNone:()=>yE,stackOffsetSilhouette:()=>kE,stackOffsetWiggle:()=>OE,stackOrderAppearance:()=>SE,stackOrderAscending:()=>AE,stackOrderDescending:()=>NE,stackOrderInsideOut:()=>ME,stackOrderNone:()=>gE,stackOrderReverse:()=>CE,stratify:()=>dg,style:()=>Qn,subset:()=>Je,sum:()=>Le,superset:()=>We,svg:()=>Sl,symbol:()=>AS,symbolAsterisk:()=>eS,symbolCircle:()=>nS,symbolCross:()=>rS,symbolDiamond:()=>aS,symbolDiamond2:()=>sS,symbolPlus:()=>uS,symbolSquare:()=>cS,symbolSquare2:()=>lS,symbolStar:()=>dS,symbolTimes:()=>OS,symbolTriangle:()=>yS,symbolTriangle2:()=>vS,symbolWye:()=>kS,symbolX:()=>OS,symbols:()=>SS,symbolsFill:()=>SS,symbolsStroke:()=>ES,text:()=>dl,thresholdFreedmanDiaconis:()=>ge,thresholdScott:()=>ve,thresholdSturges:()=>oe,tickFormat:()=>qv,tickIncrement:()=>ne,tickStep:()=>re,ticks:()=>ee,timeDay:()=>Db,timeDays:()=>Rb,timeFormat:()=>D_,timeFormatDefaultLocale:()=>rx,timeFormatLocale:()=>L_,timeFriday:()=>Wb,timeFridays:()=>e_,timeHour:()=>jb,timeHours:()=>Pb,timeInterval:()=>kb,timeMillisecond:()=>Ob,timeMilliseconds:()=>Sb,timeMinute:()=>Tb,timeMinutes:()=>Nb,timeMonday:()=>zb,timeMondays:()=>Xb,timeMonth:()=>v_,timeMonths:()=>b_,timeParse:()=>R_,timeSaturday:()=>Gb,timeSaturdays:()=>n_,timeSecond:()=>Eb,timeSeconds:()=>Ab,timeSunday:()=>Kb,timeSundays:()=>Jb,timeThursday:()=>Hb,timeThursdays:()=>t_,timeTickInterval:()=>M_,timeTicks:()=>N_,timeTuesday:()=>Vb,timeTuesdays:()=>Qb,timeWednesday:()=>Yb,timeWednesdays:()=>Zb,timeWeek:()=>Kb,timeWeeks:()=>Jb,timeYear:()=>x_,timeYears:()=>k_,timeout:()=>ho,timer:()=>so,timerFlush:()=>uo,transition:()=>ta,transpose:()=>Ie,tree:()=>kg,treemap:()=>Tg,treemapBinary:()=>Ng,treemapDice:()=>sg,treemapResquarify:()=>Cg,treemapSlice:()=>Og,treemapSliceDice:()=>Mg,treemapSquarify:()=>Ag,tsv:()=>vl,tsvFormat:()=>yc,tsvFormatBody:()=>gc,tsvFormatRow:()=>bc,tsvFormatRows:()=>vc,tsvFormatValue:()=>_c,tsvParse:()=>dc,tsvParseRows:()=>mc,union:()=>Xe,unixDay:()=>$b,unixDays:()=>qb,utcDay:()=>Bb,utcDays:()=>Fb,utcFormat:()=>B_,utcFriday:()=>c_,utcFridays:()=>y_,utcHour:()=>Lb,utcHours:()=>Ib,utcMillisecond:()=>Ob,utcMilliseconds:()=>Sb,utcMinute:()=>Mb,utcMinutes:()=>Cb,utcMonday:()=>o_,utcMondays:()=>h_,utcMonth:()=>__,utcMonths:()=>w_,utcParse:()=>F_,utcSaturday:()=>l_,utcSaturdays:()=>g_,utcSecond:()=>Eb,utcSeconds:()=>Ab,utcSunday:()=>i_,utcSundays:()=>f_,utcThursday:()=>u_,utcThursdays:()=>m_,utcTickInterval:()=>T_,utcTicks:()=>A_,utcTuesday:()=>a_,utcTuesdays:()=>p_,utcWednesday:()=>s_,utcWednesdays:()=>d_,utcWeek:()=>i_,utcWeeks:()=>f_,utcYear:()=>O_,utcYears:()=>S_,variance:()=>bt,window:()=>Wn,xml:()=>kl,zip:()=>Re,zoom:()=>XE,zoomIdentity:()=>qE,zoomTransform:()=>UE});var a=function(t){return Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{path:null,severity:null,startLineNumber:null,startColumn:null,endLineNumber:null,endColumn:null,message:null,initialErrorMessage:null,componentId:null,attribute:null,extraData:""};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.path,r=e.severity,i=e.startLineNumber,o=e.startColumn,a=e.endLineNumber,s=e.endColumn,u=e.message,c=e.initialErrorMessage,l=e.componentId,f=e.attribute,h=e.extraData;this.path=null!=n?n:null,this.severity=null!=r?r:t.SEVERITY_HINT,this.startLineNumber=null!=i?i:null,this.startColumn=null!=o?o:null,this.endLineNumber=null!=a?a:null,this.endColumn=null!=s?s:null,this.message=null!=u?u:null,this.initialErrorMessage=null!=c?c:null,this.componentId=null!=l?l:null,this.attribute=null!=f?f:null,this.extraData=null!=h?h:""}));n(a,"SEVERITY_HINT",1),n(a,"SEVERITY_INFO",2),n(a,"SEVERITY_WARNING",4),n(a,"SEVERITY_ERROR",8);const s=a;function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}function c(t){var e=function(t){if("object"!=u(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=u(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==u(e)?e:e+""}var l=function(){return t=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{name:null,value:null,type:null,definition:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.name,r=e.value,i=e.type,o=e.definition;this.name=n||null,this.value=null!=r?r:null,this.type=i||null,this.definition=o||null},e=[{key:"isVariable",get:function(){return!1}},{key:"getErrors",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return this.validateDefinitionType(e,r),this.validateType(e,r),this.validateRuleMinMax(e,r),this.validateRuleValues(e,r),this.validateRuleRegex(e,r),this.validateRequiredAttributes(e,r),n&&"Object"===(null===(t=this.definition)||void 0===t?void 0:t.type)&&Array.isArray(this.value)&&this.value.forEach((function(t){return t.getErrors(e,!0,r)})),e}},{key:"validateDefinitionType",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return null===this.definition?t:"Link"===this.definition.type&&"Array"!==this.type?(t.push(new s({componentId:e,severity:s.SEVERITY_ERROR,message:"parser.error.invalidLinkType",attribute:this.name})),t):"Reference"===this.definition.type&&"String"!==this.type?(t.push(new s({componentId:e,severity:s.SEVERITY_ERROR,message:"parser.error.invalidReferenceType",attribute:this.name})),t):("Reference"!==this.definition.type&&"Link"!==this.definition.type&&this.definition.type!==this.type&&t.push(new s({componentId:e,severity:s.SEVERITY_ERROR,message:"parser.error.not".concat(this.definition.type),attribute:this.name})),t)}},{key:"validateType",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return null===this.value?t:"Boolean"===this.type?("boolean"!=typeof this.value&&t.push(new s({componentId:e,severity:s.SEVERITY_ERROR,message:"parser.error.notBoolean",attribute:this.name})),t):"String"===this.type?("string"!=typeof this.value&&t.push(new s({componentId:e,severity:s.SEVERITY_ERROR,message:"parser.error.notString",attribute:this.name})),t):"Number"===this.type?("number"!=typeof this.value&&t.push(new s({componentId:e,severity:s.SEVERITY_ERROR,message:"parser.error.notNumber",attribute:this.name})),t):(Array.isArray(this.value)||t.push(new s({componentId:e,severity:s.SEVERITY_ERROR,message:"parser.error.not".concat(this.type),attribute:this.name})),t)}},{key:"validateRuleMinMax",value:function(){var t,e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("Boolean"===this.type||"Object"===this.type||null===(t=this.definition)||void 0===t||!t.rules)return n;var i="number"==typeof this.value?this.value:(null===(e=this.value)||void 0===e?void 0:e.length)||0;return null!==this.definition.rules.min&&ithis.definition.rules.max&&n.push(new s({componentId:r,severity:s.SEVERITY_ERROR,message:"parser.error.max".concat(this.definition.type),attribute:this.name,extraData:this.definition.rules.max})),n}},{key:"validateRuleValues",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!this.definition||0===this.definition.rules.values.length)return e;var r=Array.isArray(this.value);return(r&&this.value.some((function(e){return!t.definition.rules.values.includes(e)}))||!r&&!this.definition.rules.values.includes(this.value))&&e.push(new s({componentId:n,severity:s.SEVERITY_ERROR,message:"parser.error.invalidValue",attribute:this.name,extraData:this.definition.rules.values.join(", ")})),e}},{key:"validateRuleRegex",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return null!==(t=this.definition)&&void 0!==t&&t.rules.regex&&null!==this.value?(new RegExp(this.definition.rules.regex).test(this.value)||e.push(new s({componentId:n,severity:s.SEVERITY_ERROR,message:this.definition.rules.regexMessage||"parser.error.regex",attribute:this.name})),e):e}},{key:"validateRequiredAttributes",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.definition&&"Object"===this.definition.type?(this.definition.definedAttributes.forEach((function(r){var i=t.value.find((function(t){return t.name===r.name}));!r.required||i&&null!==i.value||e.push(new s({componentId:n,severity:s.SEVERITY_ERROR,message:"parser.error.required",attribute:r.name}))})),e):e}}],e&&function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{path:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.path;this.path=null!=n?n:null},(e=[{key:"fileName",get:function(){return this.path?this.path.replace(/^.*[\\/]/,""):null}}])&&function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{x:null,y:null,width:null,height:null,hide:!1};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.x,r=e.y,i=e.width,o=e.height,a=e.hide;this.x=n||null,this.y=r||null,this.width=i||null,this.height=o||null,this.hide=a||!1}));const g=y;function v(t){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},v(t)}function b(t){var e=function(t){if("object"!=v(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=v(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==v(e)?e:e+""}function _(t,e,n){return e=x(e),function(t,e){if(e&&("object"==v(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,w()?Reflect.construct(e,n||[],x(t).constructor):e.apply(t,n))}function w(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(w=function(){return!!t})()}function x(t){return x=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},x(t)}function k(t,e){return k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},k(t,e)}var O=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:null,externalId:null,name:null,definition:null,drawOption:null,attributes:[]};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t=_(this,e,[n]);var r=n.id,i=n.externalId,o=n.name,a=n.definition,s=n.drawOption,u=n.attributes;return t.__class="Component",t.id=r||null,t.externalId=i||t.id,t.name=o||null,t.definition=a||null,t.drawOption=s||new g,t.attributes=u||[],t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&k(t,e)}(e,t),n=e,r=[{key:"setExternalId",value:function(t){this.externalId=t}},{key:"getConfigurationKey",value:function(){return this.id}},{key:"setReferenceAttribute",value:function(t){var e=this.definition.definedAttributes.find((function(e){return e.containerRef===t.definition.type}));if(e){var n=this.attributes.filter((function(t){var n=t.definition;return(null==n?void 0:n.name)===e.name}));n.length>0?n.forEach((function(e){e.value=t.id})):this.attributes.push(this.createAttribute({name:e.name,value:t.id,type:"String",definition:e}))}}},{key:"__createNestedAttributes",value:function(t){var e=this,n=this.attributes;return t.slice().reverse().forEach((function(t){var r=n.find((function(e){return e.definition.name===t.name}));r||(r=e.createAttribute({name:t.name,definition:t,type:"Object",value:[]}),n.push(r)),n=r.value})),n}},{key:"createAttribute",value:function(t){return new f(t)}},{key:"removeAllReferenceAttributes",value:function(t){this.attributes=t?this.attributes.filter((function(e){return!("Reference"===e.definition.type&&e.definition.containerRef===t.definition.type&&e.value===t.id)})):this.attributes.filter((function(t){return"Reference"!==t.definition.type}))}},{key:"setLinkAttribute",value:function(t){var e=[],n=this.__getLinkAttribute(e,this.definition.definedAttributes,t),r=this.__createNestedAttributes(e),i=r.find((function(t){return t.definition.name===n.name}));i||(i=this.createAttribute({name:n.name,definition:n,type:"Array",value:[]}),r.push(i)),i.value.includes(t.target)||i.value.push(t.target)}},{key:"__getLinkAttribute",value:function(t,e,n){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:null;this.__removeLinkAttribute(this.attributes,t,e)}},{key:"__removeLinkAttribute",value:function(t,e,n){var r=this;t.forEach((function(t){var i;if("Object"===t.type&&r.__removeLinkAttribute(t.value,e,n),"Link"===(null===(i=t.definition)||void 0===i?void 0:i.type)&&(!n||t.name===n)){var o=t.value.findIndex((function(t){return t===e}));o>=0&&t.value.splice(o,1)}}))}},{key:"getAttributeByName",value:function(t){return this.__getAttributeByName(this.attributes,t)}},{key:"__getAttributeByName",value:function(t,e){for(var n=0;n3?i-3:0),a=3;a2?n-2:0),i=2;i0&&void 0!==arguments[0]?arguments[0]:[];return this.validateDefinition(e),this.validateRequiredAttributes(e),this.attributes.forEach((function(n){return n.getErrors(e,!0,t.id)})),e}},{key:"validateRequiredAttributes",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.definition?(this.definition.definedAttributes.forEach((function(n){var r=t.attributes.find((function(t){return t.name===n.name}));!n.required||r&&null!==r.value||e.push(new s({componentId:t.id,severity:s.SEVERITY_ERROR,message:"parser.error.required",attribute:n.name}))})),e):e}},{key:"validateDefinition",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return null===this.definition&&t.push(new s({componentId:this.id,severity:s.SEVERITY_WARNING,message:"parser.warning.noComponentDefinition"})),t}},{key:"getDefinedAttributesByType",value:function(t){var e=[];return this.__setDefinedAttributesByType(e,this.definition.definedAttributes,t),e}},{key:"__setDefinedAttributesByType",value:function(t,e,n){var r=this;e.forEach((function(e){"Object"===e.type&&r.__setDefinedAttributesByType(t,e.definedAttributes,n),e.type===n&&t.push(e)}))}},{key:"canContain",value:function(t){return this.definition.isContainer&&this.definition.childrenTypes.includes(t)}}],r&&function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{type:null,icon:null,model:null,displayName:null,description:null,categories:[],tags:[],url:null,parentTypes:[],childrenTypes:[],definedAttributes:[],isContainer:!1,displayType:null,workflowDirection:null,linkModel:null,defaultWidth:0,defaultHeight:0,minWidth:0,minHeight:0,reservedWidth:0,reservedHeight:0,margin:10,gap:30};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.type,r=e.icon,i=e.model,o=e.displayName,a=e.description,s=e.categories,u=e.tags,c=e.url,l=e.parentTypes,f=e.childrenTypes,h=e.definedAttributes,p=e.isContainer,d=e.displayType,m=e.workflowDirection,y=e.linkModel,g=e.defaultWidth,v=e.defaultHeight,b=e.minWidth,_=e.minHeight,w=e.reservedWidth,x=e.reservedHeight,k=e.margin,O=e.gap;this.type=n||null,this.icon=r||null,this.model=i||null,this.displayName=o||null,this.description=a||null,this.categories=s||[],this.tags=u||[],this.url=c||null,this.parentTypes=l||[],this.childrenTypes=f||[],this.definedAttributes=h||[],this.isContainer=void 0!==p&&p,this.displayType=d||null,this.workflowDirection=m||"horizontal",this.linkModel=y||null,this.defaultWidth=g||0,this.defaultHeight=v||0,this.minWidth=b||0,this.minHeight=_||0,this.reservedWidth=w||0,this.reservedHeight=x||0,this.margin=k||10,this.gap=O||30}));const A=E;function T(t){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},T(t)}function N(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function M(t,e,n){return(e=C(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function C(t){var e=function(t){if("object"!=T(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=T(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==T(e)?e:e+""}var j=function(t){return Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{name:null,type:null,displayName:null,description:null,tags:[],url:null,linkType:null,linkRef:[],linkModel:null,containerRef:null,required:!1,definedAttributes:[],rules:{values:[],min:null,max:null,regex:null,regexMessage:null}};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.name,r=e.type,i=e.displayName,o=e.description,a=e.tags,s=e.url,u=e.linkType,c=e.linkRef,l=e.linkModel,f=e.containerRef,h=e.definedAttributes,p=e.required,d=e.rules;this.name=n||null,this.type=r||null,this.displayName=i||null,this.description=o||null,this.tags=a||[],this.url=s||null,this.linkType=u||null,this.linkRef=c||[],this.linkModel=l||null,this.containerRef=f||null,this.definedAttributes=h||[],this.required=p||!1,this.rules=function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{source:null,target:null,name:null,definition:null,isReverse:!1};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t=I(this,e);var r=n.source,i=n.target,o=n.name,a=n.definition,s=n.isReverse;return t.__class="Link",t.source=r||null,t.target=i||null,t.name=o||null,t.definition=a||null,t.isReverse=!!s,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&B(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(m);const $=F;var q=function(t){return Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{attributeRef:null,sourceRef:null,targetRef:null,type:null,model:null,isTemporary:!1};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.attributeRef,r=e.sourceRef,i=e.targetRef,o=e.type,a=e.model,s=e.isTemporary;this.attributeRef=n||null,this.sourceRef=r||null,this.targetRef=i||null,this.type=o||null,this.model=a||null,this.isTemporary=!!s}));const U=q;function K(t){return K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},K(t)}function z(t,e,n){return e=Y(e),function(t,e){if(e&&("object"==K(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,V()?Reflect.construct(e,n||[],Y(t).constructor):e.apply(t,n))}function V(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(V=function(){return!!t})()}function Y(t){return Y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Y(t)}function H(t,e){return H=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},H(t,e)}var W=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{path:null,name:null,content:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t=z(this,e,[n]);var r=n.content;return t.content=r||null,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&H(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(m);const G=W;function J(t,e){return null==t||null==e?NaN:te?1:t>=e?0:NaN}function X(t,e){return null==t||null==e?NaN:et?1:e>=t?0:NaN}function Q(t){let e,n,r;function i(t,r,i=0,o=t.length){if(i>>1;n(t[e],r)<0?i=e+1:o=e}while(iJ(t(e),n),r=(e,n)=>t(e)-n):(e=t===J||t===X?t:Z,n=t,r=t),{left:i,center:function(t,e,n=0,o=t.length){const a=i(t,e,n,o-1);return a>n&&r(t[a-1],e)>-r(t[a],e)?a-1:a},right:function(t,r,i=0,o=t.length){if(i>>1;n(t[e],r)<=0?i=e+1:o=e}while(i=0))throw new RangeError("invalid r");let n=t.length;if(!((n=Math.floor(n))>=0))throw new RangeError("invalid length");if(!n||!e)return t;const r=ht(e),i=t.slice();return r(t,i,0,n,1),r(i,t,0,n,1),r(t,i,0,n,1),t}const st=ct(ht),ut=ct((function(t){const e=ht(t);return(t,n,r,i,o)=>{e(t,n,0+(r<<=2),0+(i<<=2),o<<=2),e(t,n,r+1,i+1,o),e(t,n,r+2,i+2,o),e(t,n,r+3,i+3,o)}}));function ct(t){return function(e,n,r=n){if(!((n=+n)>=0))throw new RangeError("invalid rx");if(!((r=+r)>=0))throw new RangeError("invalid ry");let{data:i,width:o,height:a}=e;if(!((o=Math.floor(o))>=0))throw new RangeError("invalid width");if(!((a=Math.floor(void 0!==a?a:i.length/o))>=0))throw new RangeError("invalid height");if(!o||!a||!n&&!r)return e;const s=n&&t(n),u=r&&t(r),c=i.slice();return s&&u?(lt(s,c,i,o,a),lt(s,i,c,o,a),lt(s,c,i,o,a),ft(u,i,c,o,a),ft(u,c,i,o,a),ft(u,i,c,o,a)):s?(lt(s,i,c,o,a),lt(s,c,i,o,a),lt(s,i,c,o,a)):u&&(ft(u,i,c,o,a),ft(u,c,i,o,a),ft(u,i,c,o,a)),e}}function lt(t,e,n,r,i){for(let o=0,a=r*i;o{if(!((o-=a)>=i))return;let s=t*r[i];const u=a*t;for(let t=i,e=i+u;t{if(!((a-=s)>=o))return;let u=e*i[o];const c=s*e,l=c+s;for(let t=o,e=o+c;t=e&&++n;else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(i=+i)>=i&&++n}return n}function dt(t){return 0|t.length}function mt(t){return!(t>0)}function yt(t){return"object"!=typeof t||"length"in t?t:Array.from(t)}function gt(...t){const e="function"==typeof t[t.length-1]&&function(t){return e=>t(...e)}(t.pop()),n=(t=t.map(yt)).map(dt),r=t.length-1,i=new Array(r+1).fill(0),o=[];if(r<0||n.some(mt))return o;for(;;){o.push(i.map(((e,n)=>t[n][e])));let a=r;for(;++i[a]===n[a];){if(0===a)return e?o.map(e):o;i[a--]=0}}}function vt(t,e){var n=0,r=0;return Float64Array.from(t,void 0===e?t=>n+=+t||0:i=>n+=+e(i,r++,t)||0)}function bt(t,e){let n,r=0,i=0,o=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(n=e-i,i+=n/++r,o+=n*(e-i));else{let a=-1;for(let s of t)null!=(s=e(s,++a,t))&&(s=+s)>=s&&(n=s-i,i+=n/++r,o+=n*(s-i))}if(r>1)return o/(r-1)}function _t(t,e){const n=bt(t,e);return n?Math.sqrt(n):n}function wt(t,e){let n,r;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=r=e):(n>e&&(n=e),r=o&&(n=r=o):(n>o&&(n=o),r0){for(o=t[--i];i>0&&(e=o,n=t[--i],o=e+n,r=n-(o-e),!r););i>0&&(r<0&&t[i-1]<0||r>0&&t[i-1]>0)&&(n=2*r,e=o+n,n==e-o&&(o=e))}return o}}function kt(t,e){const n=new xt;if(void 0===e)for(let e of t)(e=+e)&&n.add(e);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&n.add(i)}return+n}function Ot(t,e){const n=new xt;let r=-1;return Float64Array.from(t,void 0===e?t=>n.add(+t||0):i=>n.add(+e(i,++r,t)||0))}class St extends Map{constructor(t,e=Mt){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(At(this,t))}has(t){return super.has(At(this,t))}set(t,e){return super.set(Tt(this,t),e)}delete(t){return super.delete(Nt(this,t))}}class Et extends Set{constructor(t,e=Mt){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const e of t)this.add(e)}has(t){return super.has(At(this,t))}add(t){return super.add(Tt(this,t))}delete(t){return super.delete(Nt(this,t))}}function At({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Tt({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function Nt({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function Mt(t){return null!==t&&"object"==typeof t?t.valueOf():t}function Ct(t){return t}function jt(t,...e){return Ut(t,Ct,Ct,e)}function Pt(t,...e){return Ut(t,Array.from,Ct,e)}function Lt(t,e){for(let n=1,r=e.length;nt.pop().map((([e,n])=>[...t,e,n]))));return t}function It(t,...e){return Lt(Pt(t,...e),e)}function Dt(t,e,...n){return Lt(Bt(t,e,...n),n)}function Rt(t,e,...n){return Ut(t,Ct,e,n)}function Bt(t,e,...n){return Ut(t,Array.from,e,n)}function Ft(t,...e){return Ut(t,Ct,qt,e)}function $t(t,...e){return Ut(t,Array.from,qt,e)}function qt(t){if(1!==t.length)throw new Error("duplicate key");return t[0]}function Ut(t,e,n,r){return function t(i,o){if(o>=r.length)return n(i);const a=new St,s=r[o++];let u=-1;for(const t of i){const e=s(t,++u,i),n=a.get(e);n?n.push(t):a.set(e,[t])}for(const[e,n]of a)a.set(e,t(n,o));return e(a)}(t,0)}function Kt(t,e){return Array.from(e,(e=>t[e]))}function zt(t,...e){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");t=Array.from(t);let[n]=e;if(n&&2!==n.length||e.length>1){const r=Uint32Array.from(t,((t,e)=>e));return e.length>1?(e=e.map((e=>t.map(e))),r.sort(((t,n)=>{for(const r of e){const e=Yt(r[t],r[n]);if(e)return e}}))):(n=t.map(n),r.sort(((t,e)=>Yt(n[t],n[e])))),Kt(t,r)}return t.sort(Vt(n))}function Vt(t=J){if(t===J)return Yt;if("function"!=typeof t)throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||0===r?r:(0===t(n,n))-(0===t(e,e))}}function Yt(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(te?1:0)}function Ht(t,e,n){return(2!==e.length?zt(Rt(t,e,n),(([t,e],[n,r])=>J(e,r)||J(t,n))):zt(jt(t,n),(([t,n],[r,i])=>e(n,i)||J(t,r)))).map((([t])=>t))}var Wt=Array.prototype,Gt=Wt.slice;function Jt(t){return()=>t}Wt.map;const Xt=Math.sqrt(50),Qt=Math.sqrt(10),Zt=Math.sqrt(2);function te(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=Xt?10:o>=Qt?5:o>=Zt?2:1;let s,u,c;return i<0?(c=Math.pow(10,-i)/a,s=Math.round(t*c),u=Math.round(e*c),s/ce&&--u,c=-c):(c=Math.pow(10,i)*a,s=Math.round(t/c),u=Math.round(e/c),s*ce&&--u),u0))return[];if((t=+t)==(e=+e))return[t];const r=e=i))return[];const s=o-i+1,u=new Array(s);if(r)if(a<0)for(let t=0;t0?(t=Math.floor(t/i)*i,e=Math.ceil(e/i)*i):i<0&&(t=Math.ceil(t*i)/i,e=Math.floor(e*i)/i),r=i}}function oe(t){return Math.max(1,Math.ceil(Math.log(pt(t))/Math.LN2)+1)}function ae(){var t=Ct,e=wt,n=oe;function r(r){Array.isArray(r)||(r=Array.from(r));var i,o,a,s=r.length,u=new Array(s);for(i=0;i=f)if(t>=f&&e===wt){const t=ne(l,f,n);isFinite(t)&&(t>0?f=(Math.floor(f/t)+1)*t:t<0&&(f=(Math.ceil(f*-t)+1)/-t))}else h.pop()}for(var p=h.length,d=0,m=p;h[d]<=l;)++d;for(;h[m-1]>f;)--m;(d||m0?h[i-1]:l,y.x1=i0)for(i=0;i=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n=i)&&(n=i)}return n}function ue(t,e){let n,r=-1,i=-1;if(void 0===e)for(const e of t)++i,null!=e&&(n=e)&&(n=e,r=i);else for(let o of t)null!=(o=e(o,++i,t))&&(n=o)&&(n=o,r=i);return r}function ce(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function le(t,e){let n,r=-1,i=-1;if(void 0===e)for(const e of t)++i,null!=e&&(n>e||void 0===n&&e>=e)&&(n=e,r=i);else for(let o of t)null!=(o=e(o,++i,t))&&(n>o||void 0===n&&o>=o)&&(n=o,r=i);return r}function fe(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=void 0===i?Yt:Vt(i);r>n;){if(r-n>600){const o=r-n+1,a=e-n+1,s=Math.log(o),u=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*u*(o-u)/o)*(a-o/2<0?-1:1);fe(t,e,Math.max(n,Math.floor(e-a*u/o+c)),Math.min(r,Math.floor(e+(o-a)*u/o+c)),i)}const o=t[e];let a=n,s=r;for(he(t,n,e),i(t[r],o)>0&&he(t,n,r);a0;)--s}0===i(t[n],o)?he(t,n,s):(++s,he(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function he(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function pe(t,e=J){let n,r=!1;if(1===e.length){let i;for(const o of t){const t=e(o);(r?J(t,i)>0:0===J(t,t))&&(n=o,i=t,r=!0)}}else for(const i of t)(r?e(i,n)>0:0===e(i,i))&&(n=i,r=!0);return n}function de(t,e,n){if(t=Float64Array.from(function*(t,e){if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let r of t)null!=(r=e(r,++n,t))&&(r=+r)>=r&&(yield r)}}(t,n)),(r=t.length)&&!isNaN(e=+e)){if(e<=0||r<2)return ce(t);if(e>=1)return se(t);var r,i=(r-1)*e,o=Math.floor(i),a=se(fe(t,o).subarray(0,o+1));return a+(ce(t.subarray(o+1))-a)*(i-o)}}function me(t,e,n=tt){if((r=t.length)&&!isNaN(e=+e)){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t);return a+(+n(t[o+1],o+1,t)-a)*(i-o)}}function ye(t,e,n=tt){if(!isNaN(e=+e)){if(r=Float64Array.from(t,((e,r)=>tt(n(t[r],r,t)))),e<=0)return le(r);if(e>=1)return ue(r);var r,i=Uint32Array.from(t,((t,e)=>e)),o=r.length-1,a=Math.floor(o*e);return fe(i,a,0,o,((t,e)=>Yt(r[t],r[e]))),(a=pe(i.subarray(0,a+1),(t=>r[t])))>=0?a:-1}}function ge(t,e,n){const r=pt(t),i=de(t,.75)-de(t,.25);return r&&i?Math.ceil((n-e)/(2*i*Math.pow(r,-1/3))):1}function ve(t,e,n){const r=pt(t),i=_t(t);return r&&i?Math.ceil((n-e)*Math.cbrt(r)/(3.49*i)):1}function be(t,e){let n=0,r=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(++n,r+=e);else{let i=-1;for(let o of t)null!=(o=e(o,++i,t))&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function _e(t,e){return de(t,.5,e)}function we(t,e){return ye(t,.5,e)}function xe(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function ke(t,e){const n=new St;if(void 0===e)for(let e of t)null!=e&&e>=e&&n.set(e,(n.get(e)||0)+1);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&i>=i&&n.set(i,(n.get(i)||0)+1)}let r,i=0;for(const[t,e]of n)e>i&&(i=e,r=t);return r}function Oe(t,e=Se){const n=[];let r,i=!1;for(const o of t)i&&n.push(e(r,o)),r=o,i=!0;return n}function Se(t,e){return[t,e]}function Ee(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(i);++re(n[t],n[r]);let o,a;return t=Uint32Array.from(n,((t,e)=>e)),t.sort(e===J?(t,e)=>Yt(n[t],n[e]):Vt(i)),t.forEach(((t,e)=>{const n=i(t,void 0===o?t:o);n>=0?((void 0===o||n>0)&&(o=t,a=e),r[t]=a):r[t]=NaN})),r}function Te(t,e=J){let n,r=!1;if(1===e.length){let i;for(const o of t){const t=e(o);(r?J(t,i)<0:0===J(t,t))&&(n=o,i=t,r=!0)}}else for(const i of t)(r?e(i,n)<0:0===e(i,i))&&(n=i,r=!0);return n}function Ne(t,e=J){if(1===e.length)return le(t,e);let n,r=-1,i=-1;for(const o of t)++i,(r<0?0===e(o,o):e(o,n)<0)&&(n=o,r=i);return r}function Me(t,e=J){if(1===e.length)return ue(t,e);let n,r=-1,i=-1;for(const o of t)++i,(r<0?0===e(o,o):e(o,n)>0)&&(n=o,r=i);return r}function Ce(t,e){const n=Ne(t,e);return n<0?void 0:n}const je=Pe(Math.random);function Pe(t){return function(e,n=0,r=e.length){let i=r-(n=+n);for(;i;){const r=t()*i--|0,o=e[i+n];e[i+n]=e[r+n],e[r+n]=o}return e}}function Le(t,e){let n=0;if(void 0===e)for(let e of t)(e=+e)&&(n+=e);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}function Ie(t){if(!(i=t.length))return[];for(var e=-1,n=ce(t,De),r=new Array(n);++ee(n,r,t)))}function Ue(t,e,n){if("function"!=typeof e)throw new TypeError("reducer is not a function");const r=t[Symbol.iterator]();let i,o,a=-1;if(arguments.length<3){if(({done:i,value:n}=r.next()),i)return;++a}for(;({done:i,value:o}=r.next()),!i;)n=e(n,o,++a,t);return n}function Ke(t){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");return Array.from(t).reverse()}function ze(t,...e){t=new Et(t);for(const n of e)for(const e of n)t.delete(e);return t}function Ve(t,e){const n=e[Symbol.iterator](),r=new Et;for(const e of t){if(r.has(e))return!1;let t,i;for(;({value:t,done:i}=n.next())&&!i;){if(Object.is(e,t))return!1;r.add(t)}}return!0}function Ye(t,...e){t=new Et(t),e=e.map(He);t:for(const n of t)for(const r of e)if(!r.has(n)){t.delete(n);continue t}return t}function He(t){return t instanceof Et?t:new Et(t)}function We(t,e){const n=t[Symbol.iterator](),r=new Set;for(const t of e){const e=Ge(t);if(r.has(e))continue;let i,o;for(;({value:i,done:o}=n.next());){if(o)return!1;const t=Ge(i);if(r.add(t),Object.is(e,t))break}}return!0}function Ge(t){return null!==t&&"object"==typeof t?t.valueOf():t}function Je(t,e){return We(e,t)}function Xe(...t){const e=new Et;for(const n of t)for(const t of n)e.add(t);return e}function Qe(t){return t}var Ze=1,tn=2,en=3,nn=4,rn=1e-6;function on(t){return"translate("+t+",0)"}function an(t){return"translate(0,"+t+")"}function sn(t){return e=>+t(e)}function un(t,e){return e=Math.max(0,t.bandwidth()-2*e)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function cn(){return!this.__axis}function ln(t,e){var n=[],r=null,i=null,o=6,a=6,s=3,u="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,c=t===Ze||t===nn?-1:1,l=t===nn||t===tn?"x":"y",f=t===Ze||t===en?on:an;function h(h){var p=null==r?e.ticks?e.ticks.apply(e,n):e.domain():r,d=null==i?e.tickFormat?e.tickFormat.apply(e,n):Qe:i,m=Math.max(o,0)+s,y=e.range(),g=+y[0]+u,v=+y[y.length-1]+u,b=(e.bandwidth?un:sn)(e.copy(),u),_=h.selection?h.selection():h,w=_.selectAll(".domain").data([null]),x=_.selectAll(".tick").data(p,e).order(),k=x.exit(),O=x.enter().append("g").attr("class","tick"),S=x.select("line"),E=x.select("text");w=w.merge(w.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),x=x.merge(O),S=S.merge(O.append("line").attr("stroke","currentColor").attr(l+"2",c*o)),E=E.merge(O.append("text").attr("fill","currentColor").attr(l,c*m).attr("dy",t===Ze?"0em":t===en?"0.71em":"0.32em")),h!==_&&(w=w.transition(h),x=x.transition(h),S=S.transition(h),E=E.transition(h),k=k.transition(h).attr("opacity",rn).attr("transform",(function(t){return isFinite(t=b(t))?f(t+u):this.getAttribute("transform")})),O.attr("opacity",rn).attr("transform",(function(t){var e=this.parentNode.__axis;return f((e&&isFinite(e=e(t))?e:b(t))+u)}))),k.remove(),w.attr("d",t===nn||t===tn?a?"M"+c*a+","+g+"H"+u+"V"+v+"H"+c*a:"M"+u+","+g+"V"+v:a?"M"+g+","+c*a+"V"+u+"H"+v+"V"+c*a:"M"+g+","+u+"H"+v),x.attr("opacity",1).attr("transform",(function(t){return f(b(t)+u)})),S.attr(l+"2",c*o),E.attr(l,c*m).text(d),_.filter(cn).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===tn?"start":t===nn?"end":"middle"),_.each((function(){this.__axis=b}))}return h.scale=function(t){return arguments.length?(e=t,h):e},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(t){return arguments.length?(n=null==t?[]:Array.from(t),h):n.slice()},h.tickValues=function(t){return arguments.length?(r=null==t?null:Array.from(t),h):r&&r.slice()},h.tickFormat=function(t){return arguments.length?(i=t,h):i},h.tickSize=function(t){return arguments.length?(o=a=+t,h):o},h.tickSizeInner=function(t){return arguments.length?(o=+t,h):o},h.tickSizeOuter=function(t){return arguments.length?(a=+t,h):a},h.tickPadding=function(t){return arguments.length?(s=+t,h):s},h.offset=function(t){return arguments.length?(u=+t,h):u},h}function fn(t){return ln(Ze,t)}function hn(t){return ln(tn,t)}function pn(t){return ln(en,t)}function dn(t){return ln(nn,t)}var mn={value:()=>{}};function yn(){for(var t,e=0,n=arguments.length,r={};e=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),a=-1,s=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a0)for(var n,r,i=new Array(n),o=0;oe?1:t>=e?0:NaN}Pn.prototype={constructor:Pn,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var Fn="http://www.w3.org/1999/xhtml";const $n={svg:"http://www.w3.org/2000/svg",xhtml:Fn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function qn(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),$n.hasOwnProperty(e)?{space:$n[e],local:t}:t}function Un(t){return function(){this.removeAttribute(t)}}function Kn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function zn(t,e){return function(){this.setAttribute(t,e)}}function Vn(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Yn(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function Hn(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function Wn(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Gn(t){return function(){this.style.removeProperty(t)}}function Jn(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Xn(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Qn(t,e){return t.style.getPropertyValue(e)||Wn(t).getComputedStyle(t,null).getPropertyValue(e)}function Zn(t){return function(){delete this[t]}}function tr(t,e){return function(){this[t]=e}}function er(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function nr(t){return t.trim().split(/^|\s+/)}function rr(t){return t.classList||new ir(t)}function ir(t){this._node=t,this._names=nr(t.getAttribute("class")||"")}function or(t,e){for(var n=rr(t),r=-1,i=e.length;++r=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var Mr=[null];function Cr(t,e){this._groups=t,this._parents=e}function jr(){return new Cr([[document.documentElement]],Mr)}Cr.prototype=jr.prototype={constructor:Cr,select:function(t){"function"!=typeof t&&(t=xn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i=w&&(w=_+1);!(b=g[w])&&++w=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=Bn);for(var n=this._groups,r=n.length,i=new Array(r),o=0;o1?this.each((null==e?Gn:"function"==typeof e?Xn:Jn)(t,e,null==n?"":n)):Qn(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?Zn:"function"==typeof e?er:tr)(t,e)):this.node()[t]},classed:function(t,e){var n=nr(t+"");if(arguments.length<2){for(var r=rr(this.node()),i=-1,o=n.length;++i=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}(t+""),a=o.length;if(!(arguments.length<2)){for(s=e?Er:Sr,r=0;r>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?si(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?si(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Jr.exec(t))?new li(e[1],e[2],e[3],1):(e=Xr.exec(t))?new li(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Qr.exec(t))?si(e[1],e[2],e[3],e[4]):(e=Zr.exec(t))?si(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=ti.exec(t))?yi(e[1],e[2]/100,e[3]/100,1):(e=ei.exec(t))?yi(e[1],e[2]/100,e[3]/100,e[4]):ni.hasOwnProperty(t)?ai(ni[t]):"transparent"===t?new li(NaN,NaN,NaN,0):null}function ai(t){return new li(t>>16&255,t>>8&255,255&t,1)}function si(t,e,n,r){return r<=0&&(t=e=n=NaN),new li(t,e,n,r)}function ui(t){return t instanceof Kr||(t=oi(t)),t?new li((t=t.rgb()).r,t.g,t.b,t.opacity):new li}function ci(t,e,n,r){return 1===arguments.length?ui(t):new li(t,e,n,null==r?1:r)}function li(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function fi(){return`#${mi(this.r)}${mi(this.g)}${mi(this.b)}`}function hi(){const t=pi(this.opacity);return`${1===t?"rgb(":"rgba("}${di(this.r)}, ${di(this.g)}, ${di(this.b)}${1===t?")":`, ${t})`}`}function pi(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function di(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function mi(t){return((t=di(t))<16?"0":"")+t.toString(16)}function yi(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new bi(t,e,n,r)}function gi(t){if(t instanceof bi)return new bi(t.h,t.s,t.l,t.opacity);if(t instanceof Kr||(t=oi(t)),!t)return new bi;if(t instanceof bi)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n0&&u<1?0:a,new bi(a,s,u,t.opacity)}function vi(t,e,n,r){return 1===arguments.length?gi(t):new bi(t,e,n,null==r?1:r)}function bi(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function _i(t){return(t=(t||0)%360)<0?t+360:t}function wi(t){return Math.max(0,Math.min(1,t||0))}function xi(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function ki(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}function Oi(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=r=240?t-240:t+120,i,r),xi(t,i,r),xi(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new bi(_i(this.h),wi(this.s),wi(this.l),pi(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=pi(this.opacity);return`${1===t?"hsl(":"hsla("}${_i(this.h)}, ${100*wi(this.s)}%, ${100*wi(this.l)}%${1===t?")":`, ${t})`}`}}));const Ei=t=>()=>t;function Ai(t,e){return function(n){return t+n*e}}function Ti(t,e){var n=e-t;return n?Ai(t,n>180||n<-180?n-360*Math.round(n/360):n):Ei(isNaN(t)?e:t)}function Ni(t,e){var n=e-t;return n?Ai(t,n):Ei(isNaN(t)?e:t)}const Mi=function t(e){var n=function(t){return 1==(t=+t)?Ni:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):Ei(isNaN(e)?n:e)}}(e);function r(t,e){var r=n((t=ci(t)).r,(e=ci(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=Ni(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function Ci(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;no&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:Fi(n,r)})),o=Ui.lastIndex;return o=0&&e._call.call(void 0,t),e=e._next;--Gi}function co(){to=(Zi=no.now())+eo,Gi=Ji=0;try{uo()}finally{Gi=0,function(){for(var t,e,n=Hi,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Hi=e);Wi=t,fo(r)}(),to=0}}function lo(){var t=no.now(),e=t-Zi;e>Qi&&(eo-=e,Zi=t)}function fo(t){Gi||(Ji&&(Ji=clearTimeout(Ji)),t-to>24?(t<1/0&&(Ji=setTimeout(co,t-no.now()-eo)),Xi&&(Xi=clearInterval(Xi))):(Xi||(Zi=no.now(),Xi=setInterval(lo,Qi)),Gi=1,ro(co)))}function ho(t,e,n){var r=new ao;return e=null==e?0:+e,r.restart((n=>{r.stop(),t(n+e)}),e,n),r}ao.prototype=so.prototype={constructor:ao,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?io():+n)+(null==e?0:+e),this._next||Wi===this||(Wi?Wi._next=this:Hi=this,Wi=this),this._call=t,this._time=n,fo()},stop:function(){this._call&&(this._call=null,this._time=1/0,fo())}};var po=_n("start","end","cancel","interrupt"),mo=[],yo=0,go=1,vo=2,bo=3,_o=5,wo=6;function xo(t,e,n,r,i,o){var a=t.__transition;if(a){if(n in a)return}else t.__transition={};!function(t,e,n){var r,i=t.__transition;function o(u){var c,l,f,h;if(n.state!==go)return s();for(c in i)if((h=i[c]).name===n.name){if(h.state===bo)return ho(o);4===h.state?(h.state=wo,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[c]):+cyo)throw new Error("too late; already scheduled");return n}function Oo(t,e){var n=So(t,e);if(n.state>bo)throw new Error("too late; already running");return n}function So(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Eo(t,e){var n,r,i,o=t.__transition,a=!0;if(o){for(i in e=null==e?null:e+"",o)(n=o[i]).name===e?(r=n.state>vo&&n.state<_o,n.state=wo,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete o[i]):a=!1;a&&delete t.__transition}}var Ao,To=180/Math.PI,No={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Mo(t,e,n,r,i,o){var a,s,u;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(u=t*n+e*r)&&(n-=t*u,r-=e*u),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,u/=s),t*r180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:Fi(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(o.rotate,a.rotate,s,u),function(t,e,n,o){t!==e?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:Fi(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(o.skewX,a.skewX,s,u),function(t,e,n,r,o,a){if(t!==n||e!==r){var s=o.push(i(o)+"scale(",null,",",null,")");a.push({i:s-4,x:Fi(t,n)},{i:s-2,x:Fi(e,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,s,u),o=a=null,function(t){for(var e,n=-1,r=u.length;++n=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?ko:Oo;return function(){var a=o(this,t),s=a.on;s!==r&&(i=(r=s).copy()).on(e,n),a.on=i}}(n,t,e))},attr:function(t,e){var n=qn(t),r="transform"===n?Po:Ro;return this.attrTween(t,"function"==typeof e?(n.local?Ko:Uo)(n,r,Do(this,"attr."+t,e)):null==e?(n.local?Fo:Bo)(n):(n.local?qo:$o)(n,r,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var r=qn(t);return this.tween(n,(r.local?zo:Vo)(r,e))},style:function(t,e,n){var r="transform"==(t+="")?jo:Ro;return null==e?this.styleTween(t,function(t,e){var n,r,i;return function(){var o=Qn(this,t),a=(this.style.removeProperty(t),Qn(this,t));return o===a?null:o===n&&a===r?i:i=e(n=o,r=a)}}(t,r)).on("end.style."+t,Xo(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,i,o;return function(){var a=Qn(this,t),s=n(this),u=s+"";return null==s&&(this.style.removeProperty(t),u=s=Qn(this,t)),a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s))}}(t,r,Do(this,"style."+t,e))).each(function(t,e){var n,r,i,o,a="style."+e,s="end."+a;return function(){var u=Oo(this,t),c=u.on,l=null==u.value[a]?o||(o=Xo(e)):void 0;c===n&&i===l||(r=(n=c).copy()).on(s,i=l),u.on=r}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,i,o=n+"";return function(){var a=Qn(this,t);return a===o?null:a===r?i:i=e(r=a,n)}}(t,r,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;return this.tween(r,function(t,e,n){var r,i;function o(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&function(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}(t,o,n)),r}return o._value=e,o}(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(Do(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&function(t){return function(e){this.textContent=t.call(this,e)}}(r)),e}return r._value=t,r}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r,i=So(this.node(),n).tween,o=0,a=i.length;ogo&&n.name===e)return new Zo([[t]],ua,e,+r);return null}const la=t=>()=>t;function fa(t,{sourceEvent:e,target:n,selection:r,mode:i,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:o}})}function ha(t){t.preventDefault(),t.stopImmediatePropagation()}var pa={name:"drag"},da={name:"space"},ma={name:"handle"},ya={name:"center"};const{abs:ga,max:va,min:ba}=Math;function _a(t){return[+t[0],+t[1]]}function wa(t){return[_a(t[0]),_a(t[1])]}var xa={name:"x",handles:["w","e"].map(Ma),input:function(t,e){return null==t?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},ka={name:"y",handles:["n","s"].map(Ma),input:function(t,e){return null==t?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},Oa={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(Ma),input:function(t){return null==t?null:wa(t)},output:function(t){return t}},Sa={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Ea={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Aa={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},Ta={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},Na={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Ma(t){return{type:t}}function Ca(t){return!t.ctrlKey&&!t.button}function ja(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function Pa(){return navigator.maxTouchPoints||"ontouchstart"in this}function La(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function Ia(t){var e=t.__brush;return e?e.dim.output(e.selection):null}function Da(){return Fa(xa)}function Ra(){return Fa(ka)}function Ba(){return Fa(Oa)}function Fa(t){var e,n=ja,r=Ca,i=Pa,o=!0,a=_n("start","brush","end"),s=6;function u(e){var n=e.property("__brush",m).selectAll(".overlay").data([Ma("overlay")]);n.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Sa.overlay).merge(n).each((function(){var t=La(this).extent;Lr(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])})),e.selectAll(".selection").data([Ma("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Sa.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var r=e.selectAll(".handle").data(t.handles,(function(t){return t.type}));r.exit().remove(),r.enter().append("rect").attr("class",(function(t){return"handle handle--"+t.type})).attr("cursor",(function(t){return Sa[t.type]})),e.each(c).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(i).on("touchstart.brush",h).on("touchmove.brush",p).on("touchend.brush touchcancel.brush",d).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function c(){var t=Lr(this),e=La(this).selection;e?(t.selectAll(".selection").style("display",null).attr("x",e[0][0]).attr("y",e[0][1]).attr("width",e[1][0]-e[0][0]).attr("height",e[1][1]-e[0][1]),t.selectAll(".handle").style("display",null).attr("x",(function(t){return"e"===t.type[t.type.length-1]?e[1][0]-s/2:e[0][0]-s/2})).attr("y",(function(t){return"s"===t.type[0]?e[1][1]-s/2:e[0][1]-s/2})).attr("width",(function(t){return"n"===t.type||"s"===t.type?e[1][0]-e[0][0]+s:s})).attr("height",(function(t){return"e"===t.type||"w"===t.type?e[1][1]-e[0][1]+s:s}))):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function l(t,e,n){var r=t.__brush.emitter;return!r||n&&r.clean?new f(t,e,n):r}function f(t,e,n){this.that=t,this.args=e,this.state=t.__brush,this.active=0,this.clean=n}function h(n){if((!e||n.touches)&&r.apply(this,arguments)){var i,a,s,u,f,h,p,d,m,y,g,v=this,b=n.target.__data__.type,_="selection"===(o&&n.metaKey?b="overlay":b)?pa:o&&n.altKey?ya:ma,w=t===ka?null:Ta[b],x=t===xa?null:Na[b],k=La(v),O=k.extent,S=k.selection,E=O[0][0],A=O[0][1],T=O[1][0],N=O[1][1],M=0,C=0,j=w&&x&&o&&n.shiftKey,P=Array.from(n.touches||[n],(t=>{const e=t.identifier;return(t=Yi(t,v)).point0=t.slice(),t.identifier=e,t}));Eo(v);var L=l(v,arguments,!0).beforestart();if("overlay"===b){S&&(m=!0);const e=[P[0],P[1]||P[0]];k.selection=S=[[i=t===ka?E:ba(e[0][0],e[1][0]),s=t===xa?A:ba(e[0][1],e[1][1])],[f=t===ka?T:va(e[0][0],e[1][0]),p=t===xa?N:va(e[0][1],e[1][1])]],P.length>1&&F(n)}else i=S[0][0],s=S[0][1],f=S[1][0],p=S[1][1];a=i,u=s,h=f,d=p;var I=Lr(v).attr("pointer-events","none"),D=I.selectAll(".overlay").attr("cursor",Sa[b]);if(n.touches)L.moved=B,L.ended=$;else{var R=Lr(n.view).on("mousemove.brush",B,!0).on("mouseup.brush",$,!0);o&&R.on("keydown.brush",(function(t){switch(t.keyCode){case 16:j=w&&x;break;case 18:_===ma&&(w&&(f=h-M*w,i=a+M*w),x&&(p=d-C*x,s=u+C*x),_=ya,F(t));break;case 32:_!==ma&&_!==ya||(w<0?f=h-M:w>0&&(i=a-M),x<0?p=d-C:x>0&&(s=u-C),_=da,D.attr("cursor",Sa.selection),F(t));break;default:return}ha(t)}),!0).on("keyup.brush",(function(t){switch(t.keyCode){case 16:j&&(y=g=j=!1,F(t));break;case 18:_===ya&&(w<0?f=h:w>0&&(i=a),x<0?p=d:x>0&&(s=u),_=ma,F(t));break;case 32:_===da&&(t.altKey?(w&&(f=h-M*w,i=a+M*w),x&&(p=d-C*x,s=u+C*x),_=ya):(w<0?f=h:w>0&&(i=a),x<0?p=d:x>0&&(s=u),_=ma),D.attr("cursor",Sa[b]),F(t));break;default:return}ha(t)}),!0),Fr(n.view)}c.call(v),L.start(n,_.name)}function B(t){for(const e of t.changedTouches||[t])for(const t of P)t.identifier===e.identifier&&(t.cur=Yi(e,v));if(j&&!y&&!g&&1===P.length){const t=P[0];ga(t.cur[0]-t[0])>ga(t.cur[1]-t[1])?g=!0:y=!0}for(const t of P)t.cur&&(t[0]=t.cur[0],t[1]=t.cur[1]);m=!0,ha(t),F(t)}function F(t){const e=P[0],n=e.point0;var r;switch(M=e[0]-n[0],C=e[1]-n[1],_){case da:case pa:w&&(M=va(E-i,ba(T-f,M)),a=i+M,h=f+M),x&&(C=va(A-s,ba(N-p,C)),u=s+C,d=p+C);break;case ma:P[1]?(w&&(a=va(E,ba(T,P[0][0])),h=va(E,ba(T,P[1][0])),w=1),x&&(u=va(A,ba(N,P[0][1])),d=va(A,ba(N,P[1][1])),x=1)):(w<0?(M=va(E-i,ba(T-i,M)),a=i+M,h=f):w>0&&(M=va(E-f,ba(T-f,M)),a=i,h=f+M),x<0?(C=va(A-s,ba(N-s,C)),u=s+C,d=p):x>0&&(C=va(A-p,ba(N-p,C)),u=s,d=p+C));break;case ya:w&&(a=va(E,ba(T,i-M*w)),h=va(E,ba(T,f+M*w))),x&&(u=va(A,ba(N,s-C*x)),d=va(A,ba(N,p+C*x)))}ht+n))}function Ga(){return Qa(!1,!1)}function Ja(){return Qa(!1,!0)}function Xa(){return Qa(!0,!1)}function Qa(t,e){var n=0,r=null,i=null,o=null;function a(a){var s,u=a.length,c=new Array(u),l=Wa(0,u),f=new Array(u*u),h=new Array(u),p=0;a=Float64Array.from({length:u*u},e?(t,e)=>a[e%u][e/u|0]:(t,e)=>a[e/u|0][e%u]);for(let e=0;er(c[t],c[e])));for(const n of l){const r=e;if(t){const t=Wa(1+~u,u).filter((t=>t<0?a[~t*u+n]:a[n*u+t]));i&&t.sort(((t,e)=>i(t<0?-a[~t*u+n]:a[n*u+t],e<0?-a[~e*u+n]:a[n*u+e])));for(const r of t)r<0?(f[~r*u+n]||(f[~r*u+n]={source:null,target:null})).target={index:n,startAngle:e,endAngle:e+=a[~r*u+n]*p,value:a[~r*u+n]}:(f[n*u+r]||(f[n*u+r]={source:null,target:null})).source={index:n,startAngle:e,endAngle:e+=a[n*u+r]*p,value:a[n*u+r]};h[n]={index:n,startAngle:r,endAngle:e,value:c[n]}}else{const t=Wa(0,u).filter((t=>a[n*u+t]||a[t*u+n]));i&&t.sort(((t,e)=>i(a[n*u+t],a[n*u+e])));for(const r of t){let t;if(n=0))throw new Error(`invalid digits: ${t}`);if(e>15)return rs;const n=10**e;return function(t){this._+=t[0];for(let e=1,r=t.length;ees)if(Math.abs(l*s-u*c)>es&&i){let h=n-o,p=r-a,d=s*s+u*u,m=h*h+p*p,y=Math.sqrt(d),g=Math.sqrt(f),v=i*Math.tan((Za-Math.acos((d+f-m)/(2*y*g)))/2),b=v/g,_=v/y;Math.abs(b-1)>es&&this._append`L${t+b*c},${e+b*l}`,this._append`A${i},${i},0,0,${+(l*h>c*p)},${this._x1=t+_*s},${this._y1=e+_*u}`}else this._append`L${this._x1=t},${this._y1=e}`}arc(t,e,n,r,i,o){if(t=+t,e=+e,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let a=n*Math.cos(r),s=n*Math.sin(r),u=t+a,c=e+s,l=1^o,f=o?r-i:i-r;null===this._x1?this._append`M${u},${c}`:(Math.abs(this._x1-u)>es||Math.abs(this._y1-c)>es)&&this._append`L${u},${c}`,n&&(f<0&&(f=f%ts+ts),f>ns?this._append`A${n},${n},0,1,${l},${t-a},${e-s}A${n},${n},0,1,${l},${this._x1=u},${this._y1=c}`:f>es&&this._append`A${n},${n},0,${+(f>=Za)},${l},${this._x1=t+n*Math.cos(i)},${this._y1=e+n*Math.sin(i)}`)}rect(t,e,n,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function os(){return new is}function as(t=3){return new is(+t)}os.prototype=is.prototype;var ss=Array.prototype.slice;function us(t){return function(){return t}}function cs(t){return t.source}function ls(t){return t.target}function fs(t){return t.radius}function hs(t){return t.startAngle}function ps(t){return t.endAngle}function ds(){return 0}function ms(){return 10}function ys(t){var e=cs,n=ls,r=fs,i=fs,o=hs,a=ps,s=ds,u=null;function c(){var c,l=e.apply(this,arguments),f=n.apply(this,arguments),h=s.apply(this,arguments)/2,p=ss.call(arguments),d=+r.apply(this,(p[0]=l,p)),m=o.apply(this,p)-za,y=a.apply(this,p)-za,g=+i.apply(this,(p[0]=f,p)),v=o.apply(this,p)-za,b=a.apply(this,p)-za;if(u||(u=c=os()),h>Ha&&($a(y-m)>2*h+Ha?y>m?(m+=h,y-=h):(m-=h,y+=h):m=y=(m+y)/2,$a(b-v)>2*h+Ha?b>v?(v+=h,b-=h):(v-=h,b+=h):v=b=(v+b)/2),u.moveTo(d*qa(m),d*Ua(m)),u.arc(0,0,d,m,y),m!==v||y!==b)if(t){var _=g-+t.apply(this,arguments),w=(v+b)/2;u.quadraticCurveTo(0,0,_*qa(v),_*Ua(v)),u.lineTo(g*qa(w),g*Ua(w)),u.lineTo(_*qa(b),_*Ua(b))}else u.quadraticCurveTo(0,0,g*qa(v),g*Ua(v)),u.arc(0,0,g,v,b);if(u.quadraticCurveTo(0,0,d*qa(m),d*Ua(m)),u.closePath(),c)return u=null,c+""||null}return t&&(c.headRadius=function(e){return arguments.length?(t="function"==typeof e?e:us(+e),c):t}),c.radius=function(t){return arguments.length?(r=i="function"==typeof t?t:us(+t),c):r},c.sourceRadius=function(t){return arguments.length?(r="function"==typeof t?t:us(+t),c):r},c.targetRadius=function(t){return arguments.length?(i="function"==typeof t?t:us(+t),c):i},c.startAngle=function(t){return arguments.length?(o="function"==typeof t?t:us(+t),c):o},c.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:us(+t),c):a},c.padAngle=function(t){return arguments.length?(s="function"==typeof t?t:us(+t),c):s},c.source=function(t){return arguments.length?(e=t,c):e},c.target=function(t){return arguments.length?(n=t,c):n},c.context=function(t){return arguments.length?(u=null==t?null:t,c):u},c}function gs(){return ys()}function vs(){return ys(ms)}const bs=Math.PI/180,_s=180/Math.PI,ws=.96422,xs=1,ks=.82521,Os=4/29,Ss=6/29,Es=3*Ss*Ss,As=Ss*Ss*Ss;function Ts(t){if(t instanceof Cs)return new Cs(t.l,t.a,t.b,t.opacity);if(t instanceof Fs)return $s(t);t instanceof li||(t=ui(t));var e,n,r=Is(t.r),i=Is(t.g),o=Is(t.b),a=js((.2225045*r+.7168786*i+.0606169*o)/xs);return r===i&&i===o?e=n=a:(e=js((.4360747*r+.3850649*i+.1430804*o)/ws),n=js((.0139322*r+.0971045*i+.7141733*o)/ks)),new Cs(116*a-16,500*(e-a),200*(a-n),t.opacity)}function Ns(t,e){return new Cs(t,0,0,null==e?1:e)}function Ms(t,e,n,r){return 1===arguments.length?Ts(t):new Cs(t,e,n,null==r?1:r)}function Cs(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function js(t){return t>As?Math.pow(t,1/3):t/Es+Os}function Ps(t){return t>Ss?t*t*t:Es*(t-Os)}function Ls(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Is(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ds(t){if(t instanceof Fs)return new Fs(t.h,t.c,t.l,t.opacity);if(t instanceof Cs||(t=Ts(t)),0===t.a&&0===t.b)return new Fs(NaN,0()=>t;function tu(t,e){for(var n,r=-1,i=e.length;++rr!=p>r&&n<(h-c)*(r-l)/(p-l)+c&&(i=-i)}return i}function nu(t,e,n){var r,i,o,a;return function(t,e,n){return(e[0]-t[0])*(n[1]-t[1])==(n[0]-t[0])*(e[1]-t[1])}(t,e,n)&&(i=t[r=+(t[0]===e[0])],o=n[r],a=e[r],i<=o&&o<=a||a<=o&&o<=i)}function ru(){}var iu=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function ou(){var t=1,e=1,n=oe,r=s;function i(t){var e=n(t);if(Array.isArray(e))e=e.slice().sort(Qs);else{const n=wt(t,au);for(e=ee(...ie(n[0],n[1],e),e);e[e.length-1]>=n[1];)e.pop();for(;e[1]o(t,e)))}function o(n,i){const o=null==i?NaN:+i;if(isNaN(o))throw new Error(`invalid value: ${i}`);var s=[],u=[];return function(n,r,i){var o,s,u,c,l,f,h=new Array,p=new Array;for(o=s=-1,c=su(n[0],r),iu[c<<1].forEach(d);++o=r,iu[l<<2].forEach(d);++o0?s.push([t]):u.push(t)})),u.forEach((function(t){for(var e,n=0,r=s.length;n0&&o0&&a=0&&o>=0))throw new Error("invalid size");return t=r,e=o,i},i.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:Array.isArray(t)?Zs(Xs.call(t)):Zs(t),i):n},i.smooth=function(t){return arguments.length?(r=t?s:ru,i):r===s},i}function au(t){return isFinite(t)?t:NaN}function su(t,e){return null!=t&&+t>=e}function uu(t){return null==t||isNaN(t=+t)?-1/0:t}function cu(t,e,n,r){const i=r-e,o=n-e,a=isFinite(i)||isFinite(o)?i/o:Math.sign(i)/Math.sign(o);return isNaN(a)?t:t+a-.5}function lu(t){return t[0]}function fu(t){return t[1]}function hu(){return 1}function pu(){var t=lu,e=fu,n=hu,r=960,i=500,o=20,a=2,s=3*o,u=r+2*s>>a,c=i+2*s>>a,l=Zs(20);function f(r){var i=new Float32Array(u*c),l=Math.pow(2,-a),f=-1;for(const o of r){var h=(t(o,++f,r)+s)*l,p=(e(o,f,r)+s)*l,d=+n(o,f,r);if(d&&h>=0&&h=0&&pt*r)))(e).map(((t,e)=>(t.value=+n[e],p(t))))}function p(t){return t.coordinates.forEach(d),t}function d(t){t.forEach(m)}function m(t){t.forEach(y)}function y(t){t[0]=t[0]*Math.pow(2,a)-s,t[1]=t[1]*Math.pow(2,a)-s}function g(){return u=r+2*(s=3*o)>>a,c=i+2*s>>a,h}return h.contours=function(t){var e=f(t),n=ou().size([u,c]),r=Math.pow(2,2*a),i=t=>{t=+t;var i=p(n.contour(e,t*r));return i.value=t,i};return Object.defineProperty(i,"max",{get:()=>se(e)/r}),i},h.x=function(e){return arguments.length?(t="function"==typeof e?e:Zs(+e),h):t},h.y=function(t){return arguments.length?(e="function"==typeof t?t:Zs(+t),h):e},h.weight=function(t){return arguments.length?(n="function"==typeof t?t:Zs(+t),h):n},h.size=function(t){if(!arguments.length)return[r,i];var e=+t[0],n=+t[1];if(!(e>=0&&n>=0))throw new Error("invalid size");return r=e,i=n,g()},h.cellSize=function(t){if(!arguments.length)return 1<=1))throw new Error("invalid cell size");return a=Math.floor(Math.log(t)/Math.LN2),g()},h.thresholds=function(t){return arguments.length?(l="function"==typeof t?t:Array.isArray(t)?Zs(Xs.call(t)):Zs(t),h):l},h.bandwidth=function(t){if(!arguments.length)return Math.sqrt(o*(o+1));if(!((t=+t)>=0))throw new Error("invalid bandwidth");return o=(Math.sqrt(4*t*t+1)-1)/2,g()},h}const du=134217729;function mu(t,e,n,r,i){let o,a,s,u,c=e[0],l=r[0],f=0,h=0;l>c==l>-c?(o=c,c=e[++f]):(o=l,l=r[++h]);let p=0;if(fc==l>-c?(a=c+o,s=o-(a-c),c=e[++f]):(a=l+o,s=o-(a-l),l=r[++h]),o=a,0!==s&&(i[p++]=s);fc==l>-c?(a=o+c,u=a-o,s=o-(a-u)+(c-u),c=e[++f]):(a=o+l,u=a-o,s=o-(a-u)+(l-u),l=r[++h]),o=a,0!==s&&(i[p++]=s);for(;f=33306690738754716e-32*c?u:-function(t,e,n,r,i,o,a){let s,u,c,l,f,h,p,d,m,y,g,v,b,_,w,x,k,O;const S=t-i,E=n-i,A=e-o,T=r-o;_=S*T,h=du*S,p=h-(h-S),d=S-p,h=du*T,m=h-(h-T),y=T-m,w=d*y-(_-p*m-d*m-p*y),x=A*E,h=du*A,p=h-(h-A),d=A-p,h=du*E,m=h-(h-E),y=E-m,k=d*y-(x-p*m-d*m-p*y),g=w-k,f=w-g,gu[0]=w-(g+f)+(f-k),v=_+g,f=v-_,b=_-(v-f)+(g-f),g=b-x,f=b-g,gu[1]=b-(g+f)+(f-x),O=v+g,f=O-v,gu[2]=v-(O-f)+(g-f),gu[3]=O;let N=function(t,e){let n=e[0];for(let t=1;t<4;t++)n+=e[t];return n}(0,gu),M=22204460492503146e-32*a;if(N>=M||-N>=M)return N;if(f=t-S,s=t-(S+f)+(f-i),f=n-E,c=n-(E+f)+(f-i),f=e-A,u=e-(A+f)+(f-o),f=r-T,l=r-(T+f)+(f-o),0===s&&0===u&&0===c&&0===l)return N;if(M=11093356479670487e-47*a+33306690738754706e-32*Math.abs(N),N+=S*l+T*s-(A*c+E*u),N>=M||-N>=M)return N;_=s*T,h=du*s,p=h-(h-s),d=s-p,h=du*T,m=h-(h-T),y=T-m,w=d*y-(_-p*m-d*m-p*y),x=u*E,h=du*u,p=h-(h-u),d=u-p,h=du*E,m=h-(h-E),y=E-m,k=d*y-(x-p*m-d*m-p*y),g=w-k,f=w-g,wu[0]=w-(g+f)+(f-k),v=_+g,f=v-_,b=_-(v-f)+(g-f),g=b-x,f=b-g,wu[1]=b-(g+f)+(f-x),O=v+g,f=O-v,wu[2]=v-(O-f)+(g-f),wu[3]=O;const C=mu(4,gu,4,wu,vu);_=S*l,h=du*S,p=h-(h-S),d=S-p,h=du*l,m=h-(h-l),y=l-m,w=d*y-(_-p*m-d*m-p*y),x=A*c,h=du*A,p=h-(h-A),d=A-p,h=du*c,m=h-(h-c),y=c-m,k=d*y-(x-p*m-d*m-p*y),g=w-k,f=w-g,wu[0]=w-(g+f)+(f-k),v=_+g,f=v-_,b=_-(v-f)+(g-f),g=b-x,f=b-g,wu[1]=b-(g+f)+(f-x),O=v+g,f=O-v,wu[2]=v-(O-f)+(g-f),wu[3]=O;const j=mu(C,vu,4,wu,bu);_=s*l,h=du*s,p=h-(h-s),d=s-p,h=du*l,m=h-(h-l),y=l-m,w=d*y-(_-p*m-d*m-p*y),x=u*c,h=du*u,p=h-(h-u),d=u-p,h=du*c,m=h-(h-c),y=c-m,k=d*y-(x-p*m-d*m-p*y),g=w-k,f=w-g,wu[0]=w-(g+f)+(f-k),v=_+g,f=v-_,b=_-(v-f)+(g-f),g=b-x,f=b-g,wu[1]=b-(g+f)+(f-x),O=v+g,f=O-v,wu[2]=v-(O-f)+(g-f),wu[3]=O;const P=mu(j,bu,4,wu,_u);return _u[P-1]}(t,e,n,r,i,o,c)}yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(8),yu(8),yu(8),yu(4),yu(8),yu(8),yu(8),yu(12),yu(192),yu(192),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(8),yu(8),yu(8),yu(8),yu(8),yu(8),yu(8),yu(8),yu(8),yu(4),yu(4),yu(4),yu(8),yu(16),yu(16),yu(16),yu(32),yu(32),yu(48),yu(64),yu(1152),yu(1152),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(24),yu(24),yu(24),yu(24),yu(24),yu(24),yu(24),yu(24),yu(24),yu(24),yu(1152),yu(1152),yu(1152),yu(1152),yu(1152),yu(2304),yu(2304),yu(3456),yu(5760),yu(8),yu(8),yu(8),yu(16),yu(24),yu(48),yu(48),yu(96),yu(192),yu(384),yu(384),yu(384),yu(768),yu(96),yu(96),yu(96),yu(1152);const ku=Math.pow(2,-52),Ou=new Uint32Array(512);class Su{static from(t,e=Cu,n=ju){const r=t.length,i=new Float64Array(2*r);for(let o=0;o>1;if(e>0&&"number"!=typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;const n=Math.max(2*e-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update()}update(){const{coords:t,_hullPrev:e,_hullNext:n,_hullTri:r,_hullHash:i}=this,o=t.length>>1;let a=1/0,s=1/0,u=-1/0,c=-1/0;for(let e=0;eu&&(u=n),r>c&&(c=r),this._ids[e]=e}const l=(a+u)/2,f=(s+c)/2;let h,p,d;for(let e=0,n=1/0;e0&&(p=e,n=r)}let g=t[2*p],v=t[2*p+1],b=1/0;for(let e=0;er&&(e[n++]=i,r=o)}return this.hull=e.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(xu(m,y,g,v,_,w)<0){const t=p,e=g,n=v;p=d,g=_,v=w,d=t,_=e,w=n}const x=function(t,e,n,r,i,o){const a=n-t,s=r-e,u=i-t,c=o-e,l=a*a+s*s,f=u*u+c*c,h=.5/(a*c-s*u);return{x:t+(c*l-s*f)*h,y:e+(a*f-u*l)*h}}(m,y,g,v,_,w);this._cx=x.x,this._cy=x.y;for(let e=0;e0&&Math.abs(c-o)<=ku&&Math.abs(l-a)<=ku)continue;if(o=c,a=l,u===h||u===p||u===d)continue;let f=0;for(let t=0,e=this._hashKey(c,l);t=0;)if(y=m,y===f){y=-1;break}if(-1===y)continue;let g=this._addTriangle(y,u,n[y],-1,-1,r[y]);r[u]=this._legalize(g+2),r[y]=g,k++;let v=n[y];for(;m=n[v],xu(c,l,t[2*v],t[2*v+1],t[2*m],t[2*m+1])<0;)g=this._addTriangle(v,u,m,r[u],-1,r[v]),r[u]=this._legalize(g+2),n[v]=v,k--,v=m;if(y===f)for(;m=e[y],xu(c,l,t[2*m],t[2*m+1],t[2*y],t[2*y+1])<0;)g=this._addTriangle(m,u,y,-1,r[y],r[m]),this._legalize(g+2),r[m]=g,n[y]=y,k--,y=m;this._hullStart=e[u]=y,n[y]=e[v]=u,n[u]=v,i[this._hashKey(c,l)]=u,i[this._hashKey(t[2*y],t[2*y+1])]=y}this.hull=new Uint32Array(k);for(let t=0,e=this._hullStart;t0?3-n:1+n)/4}(t-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:e,_halfedges:n,coords:r}=this;let i=0,o=0;for(;;){const a=n[t],s=t-t%3;if(o=s+(t+2)%3,-1===a){if(0===i)break;t=Ou[--i];continue}const u=a-a%3,c=s+(t+1)%3,l=u+(a+2)%3,f=e[o],h=e[t],p=e[c],d=e[l];if(Au(r[2*f],r[2*f+1],r[2*h],r[2*h+1],r[2*p],r[2*p+1],r[2*d],r[2*d+1])){e[t]=d,e[a]=f;const r=n[l];if(-1===r){let e=this._hullStart;do{if(this._hullTri[e]===l){this._hullTri[e]=t;break}e=this._hullPrev[e]}while(e!==this._hullStart)}this._link(t,r),this._link(a,n[o]),this._link(o,l);const s=u+(a+1)%3;i=n&&e[t[a]]>o;)t[a+1]=t[a--];t[a+1]=r}else{let i=n+1,o=r;Mu(t,n+r>>1,i),e[t[n]]>e[t[r]]&&Mu(t,n,r),e[t[i]]>e[t[r]]&&Mu(t,i,r),e[t[n]]>e[t[i]]&&Mu(t,n,i);const a=t[i],s=e[a];for(;;){do{i++}while(e[t[i]]s);if(o=o-n?(Nu(t,e,i,r),Nu(t,e,n,o-1)):(Nu(t,e,n,o-1),Nu(t,e,i,r))}}function Mu(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function Cu(t){return t[0]}function ju(t){return t[1]}const Pu=1e-6;class Lu{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,e){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,e){this._+=`L${this._x1=+t},${this._y1=+e}`}arc(t,e,n){const r=(t=+t)+(n=+n),i=e=+e;if(n<0)throw new Error("negative radius");null===this._x1?this._+=`M${r},${i}`:(Math.abs(this._x1-r)>Pu||Math.abs(this._y1-i)>Pu)&&(this._+="L"+r+","+i),n&&(this._+=`A${n},${n},0,1,1,${t-n},${e}A${n},${n},0,1,1,${this._x1=r},${this._y1=i}`)}rect(t,e,n,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${+n}v${+r}h${-n}Z`}value(){return this._||null}}class Iu{constructor(){this._=[]}moveTo(t,e){this._.push([t,e])}closePath(){this._.push(this._[0].slice())}lineTo(t,e){this._.push([t,e])}value(){return this._.length?this._:null}}class Du{constructor(t,[e,n,r,i]=[0,0,960,500]){if(!((r=+r)>=(e=+e)&&(i=+i)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(2*t.points.length),this.vectors=new Float64Array(2*t.points.length),this.xmax=r,this.xmin=e,this.ymax=i,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:e,triangles:n},vectors:r}=this;let i,o;const a=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let r,s,u=0,c=0,l=n.length;u1;)i-=2;for(let t=2;t0){if(e>=this.ymax)return null;(i=(this.ymax-e)/r)0){if(t>=this.xmax)return null;(i=(this.xmax-t)/n)this.xmax?2:0)|(ethis.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let e=0;e2&&function(t){const{triangles:e,coords:n}=t;for(let t=0;t1e-10)return!1}return!0}(t)){this.collinear=Int32Array.from({length:e.length/2},((t,e)=>e)).sort(((t,n)=>e[2*t]-e[2*n]||e[2*t+1]-e[2*n+1]));const t=this.collinear[0],n=this.collinear[this.collinear.length-1],r=[e[2*t],e[2*t+1],e[2*n],e[2*n+1]],i=1e-8*Math.hypot(r[3]-r[1],r[2]-r[0]);for(let t=0,n=e.length/2;t0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],o[r[0]]=1,2===r.length&&(o[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(t){return new Du(this,t)}*neighbors(t){const{inedges:e,hull:n,_hullIndex:r,halfedges:i,triangles:o,collinear:a}=this;if(a){const e=a.indexOf(t);return e>0&&(yield a[e-1]),void(e=0&&i!==n&&i!==r;)n=i;return i}_step(t,e,n){const{inedges:r,hull:i,_hullIndex:o,halfedges:a,triangles:s,points:u}=this;if(-1===r[t]||!u.length)return(t+1)%(u.length>>1);let c=t,l=Bu(e-u[2*t],2)+Bu(n-u[2*t+1],2);const f=r[t];let h=f;do{let r=s[h];const f=Bu(e-u[2*r],2)+Bu(n-u[2*r+1],2);if(f()=>t;function zu(t,{sourceEvent:e,subject:n,target:r,identifier:i,active:o,x:a,y:s,dx:u,dy:c,dispatch:l}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:l}})}function Vu(t){return!t.ctrlKey&&!t.button}function Yu(){return this.parentNode}function Hu(t,e){return null==e?{x:t.x,y:t.y}:e}function Wu(){return navigator.maxTouchPoints||"ontouchstart"in this}function Gu(){var t,e,n,r,i=Vu,o=Yu,a=Hu,s=Wu,u={},c=_n("start","drag","end"),l=0,f=0;function h(t){t.on("mousedown.drag",p).filter(s).on("touchstart.drag",y).on("touchmove.drag",g,Ir).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(a,s){if(!r&&i.call(this,a,s)){var u=b(this,o.call(this,a,s),a,s,"mouse");u&&(Lr(a.view).on("mousemove.drag",d,Dr).on("mouseup.drag",m,Dr),Fr(a.view),Rr(a),n=!1,t=a.clientX,e=a.clientY,u("start",a))}}function d(r){if(Br(r),!n){var i=r.clientX-t,o=r.clientY-e;n=i*i+o*o>f}u.mouse("drag",r)}function m(t){Lr(t.view).on("mousemove.drag mouseup.drag",null),$r(t.view,n),Br(t),u.mouse("end",t)}function y(t,e){if(i.call(this,t,e)){var n,r,a=t.changedTouches,s=o.call(this,t,e),u=a.length;for(n=0;n=o?u=!0:(r=t.charCodeAt(a++))===Zu?c=!0:r===tc&&(c=!0,t.charCodeAt(a)===Zu&&++a),t.slice(i+1,e-1).replace(/""/g,'"')}for(;a9999?"+"+rc(e,6):rc(e,4))+"-"+rc(t.getUTCMonth()+1,2)+"-"+rc(t.getUTCDate(),2)+(o?"T"+rc(n,2)+":"+rc(r,2)+":"+rc(i,2)+"."+rc(o,3)+"Z":i?"T"+rc(n,2)+":"+rc(r,2)+":"+rc(i,2)+"Z":r||n?"T"+rc(n,2)+":"+rc(r,2)+"Z":"")}(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,i,o=r(t,(function(t,r){if(n)return n(t,r-1);i=t,n=e?function(t,e){var n=ec(t);return function(r,i){return e(n(r),i,t)}}(t,e):ec(t)}));return o.columns=i||[],o},parseRows:r,format:function(e,n){return null==n&&(n=nc(e)),[n.map(a).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=nc(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(o).join("\n")},formatRow:o,formatValue:a}}var oc=ic(","),ac=oc.parse,sc=oc.parseRows,uc=oc.format,cc=oc.formatBody,lc=oc.formatRows,fc=oc.formatRow,hc=oc.formatValue,pc=ic("\t"),dc=pc.parse,mc=pc.parseRows,yc=pc.format,gc=pc.formatBody,vc=pc.formatRows,bc=pc.formatRow,_c=pc.formatValue;function wc(t){for(var e in t){var n,r,i=t[e].trim();if(i)if("true"===i)i=!0;else if("false"===i)i=!1;else if("NaN"===i)i=NaN;else if(isNaN(n=+i)){if(!(r=i.match(/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/)))continue;xc&&r[4]&&!r[7]&&(i=i.replace(/-/g,"/").replace(/T/," ")),i=new Date(i)}else i=n;else i=null;t[e]=i}return t}const xc=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),kc=t=>+t;function Oc(t){return t*t}function Sc(t){return t*(2-t)}function Ec(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}var Ac=function t(e){function n(t){return Math.pow(t,e)}return e=+e,n.exponent=t,n}(3),Tc=function t(e){function n(t){return 1-Math.pow(1-t,e)}return e=+e,n.exponent=t,n}(3),Nc=function t(e){function n(t){return((t*=2)<=1?Math.pow(t,e):2-Math.pow(2-t,e))/2}return e=+e,n.exponent=t,n}(3),Mc=Math.PI,Cc=Mc/2;function jc(t){return 1==+t?1:1-Math.cos(t*Cc)}function Pc(t){return Math.sin(t*Cc)}function Lc(t){return(1-Math.cos(Mc*t))/2}function Ic(t){return 1.0009775171065494*(Math.pow(2,-10*t)-.0009765625)}function Dc(t){return Ic(1-+t)}function Rc(t){return 1-Ic(t)}function Bc(t){return((t*=2)<=1?Ic(1-t):2-Ic(t-1))/2}function Fc(t){return 1-Math.sqrt(1-t*t)}function $c(t){return Math.sqrt(1- --t*t)}function qc(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var Uc=4/11,Kc=6/11,zc=8/11,Vc=3/4,Yc=9/11,Hc=10/11,Wc=15/16,Gc=21/22,Jc=63/64,Xc=1/Uc/Uc;function Qc(t){return 1-Zc(1-t)}function Zc(t){return(t=+t)dl(e,n).then((e=>(new DOMParser).parseFromString(e,t)))}const kl=xl("application/xml");var Ol=xl("text/html"),Sl=xl("image/svg+xml");function El(t,e){var n,r=1;function i(){var i,o,a=n.length,s=0,u=0;for(i=0;i=(o=(m+g)/2))?m=o:g=o,(l=n>=(a=(y+v)/2))?y=a:v=a,i=p,!(p=p[f=l<<1|c]))return i[f]=d,t;if(s=+t._x.call(null,p.data),u=+t._y.call(null,p.data),e===s&&n===u)return d.next=p,i?i[f]=d:t._root=d,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(c=e>=(o=(m+g)/2))?m=o:g=o,(l=n>=(a=(y+v)/2))?y=a:v=a}while((f=l<<1|c)==(h=(u>=a)<<1|s>=o));return i[h]=p,i[f]=d,t}function Tl(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function Nl(t){return t[0]}function Ml(t){return t[1]}function Cl(t,e,n){var r=new jl(null==e?Nl:e,null==n?Ml:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function jl(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function Pl(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var Ll=Cl.prototype=jl.prototype;function Il(t){return function(){return t}}function Dl(t){return 1e-6*(t()-.5)}function Rl(t){return t.x+t.vx}function Bl(t){return t.y+t.vy}function Fl(t){var e,n,r,i=1,o=1;function a(){for(var t,a,u,c,l,f,h,p=e.length,d=0;dc+d||ol+d||au.index){var m=c-s.x-s.vx,y=l-s.y-s.vy,g=m*m+y*y;gt.r&&(t.r=t[e].r)}function u(){if(e){var r,i,o=e.length;for(n=new Array(o),r=0;r[s(t,e,r),t])));for(a=0,i=new Array(c);al&&(l=r),if&&(f=i));if(u>l||c>f)return this;for(this.cover(u,c).cover(l,f),n=0;nt||t>=i||r>e||e>=o;)switch(s=(eh||(o=u.y0)>p||(a=u.x1)=g)<<1|t>=y)&&(u=d[d.length-1],d[d.length-1]=d[d.length-1-c],d[d.length-1-c]=u)}else{var v=t-+this._x.call(null,m.data),b=e-+this._y.call(null,m.data),_=v*v+b*b;if(_=(s=(d+y)/2))?d=s:y=s,(l=a>=(u=(m+g)/2))?m=u:g=u,e=p,!(p=p[f=l<<1|c]))return this;if(!p.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(n=e,h=f)}for(;p.data!==t;)if(r=p,!(p=p.next))return this;return(i=p.next)&&delete p.next,r?(i?r.next=i:delete r.next,this):e?(i?e[f]=i:delete e[f],(p=e[0]||e[1]||e[2]||e[3])&&p===(e[3]||e[2]||e[1]||e[0])&&!p.length&&(n?n[h]=p:this._root=p),this):(this._root=i,this)},Ll.removeAll=function(t){for(var e=0,n=t.length;e(t=(Kl*t+zl)%Vl)/Vl}();function f(){h(),c.call("tick",e),n1?(null==n?s.delete(t):s.set(t,d(n)),e):s.get(t)},find:function(e,n,r){var i,o,a,s,u,c=0,l=t.length;for(null==r?r=1/0:r*=r,c=0;c1?(c.on(t,n),e):c.on(t)}}}function Xl(){var t,e,n,r,i,o=Il(-30),a=1,s=1/0,u=.81;function c(n){var i,o=t.length,a=Cl(t,Yl,Hl).visitAfter(f);for(r=n,i=0;i=s)){(t.data!==e||t.next)&&(0===f&&(d+=(f=Dl(n))*f),0===h&&(d+=(h=Dl(n))*h),d1?r[0]+r.slice(2):r,+t.slice(n+1)]}function nf(t){return(t=ef(Math.abs(t)))?t[1]:NaN}var rf,of=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function af(t){if(!(e=of.exec(t)))throw new Error("invalid format: "+t);var e;return new sf({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function sf(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function uf(t,e){var n=ef(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}af.prototype=sf.prototype,sf.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const cf={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>uf(100*t,e),r:uf,s:function(t,e){var n=ef(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(rf=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+ef(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function lf(t){return t}var ff,hf,pf,df=Array.prototype.map,mf=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function yf(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?lf:(e=df.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,s=e[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),o.push(t.substring(i-=s,i+s)),!((u+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?lf:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(df.call(t.numerals,String)),u=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"−":t.minus+"",l=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=af(t)).fill,n=t.align,f=t.sign,h=t.symbol,p=t.zero,d=t.width,m=t.comma,y=t.precision,g=t.trim,v=t.type;"n"===v?(m=!0,v="g"):cf[v]||(void 0===y&&(y=12),g=!0,v="g"),(p||"0"===e&&"="===n)&&(p=!0,e="0",n="=");var b="$"===h?i:"#"===h&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",_="$"===h?o:/[%p]/.test(v)?u:"",w=cf[v],x=/[defgprs%]/.test(v);function k(t){var i,o,u,h=b,k=_;if("c"===v)k=w(t)+k,t="";else{var O=(t=+t)<0||1/t<0;if(t=isNaN(t)?l:w(Math.abs(t),y),g&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),O&&0==+t&&"+"!==f&&(O=!1),h=(O?"("===f?f:c:"-"===f||"("===f?"":f)+h,k=("s"===v?mf[8+rf/3]:"")+k+(O&&"("===f?")":""),x)for(i=-1,o=t.length;++i(u=t.charCodeAt(i))||u>57){k=(46===u?a+t.slice(i+1):t.slice(i))+k,t=t.slice(0,i);break}}m&&!p&&(t=r(t,1/0));var S=h.length+t.length+k.length,E=S>1)+h+t+k+E.slice(S);break;default:t=E+h+t+k}return s(t)}return y=void 0===y?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),k.toString=function(){return t+""},k}return{format:f,formatPrefix:function(t,e){var n=f(((t=af(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(nf(e)/3))),i=Math.pow(10,-r),o=mf[8+r/3];return function(t){return n(i*t)+o}}}}function gf(t){return ff=yf(t),hf=ff.format,pf=ff.formatPrefix,ff}function vf(t){return Math.max(0,-nf(Math.abs(t)))}function bf(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(nf(e)/3)))-nf(Math.abs(t)))}function _f(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,nf(e)-nf(t))+1}gf({thousands:",",grouping:[3],currency:["$",""]});var wf=1e-6,xf=1e-12,kf=Math.PI,Of=kf/2,Sf=kf/4,Ef=2*kf,Af=180/kf,Tf=kf/180,Nf=Math.abs,Mf=Math.atan,Cf=Math.atan2,jf=Math.cos,Pf=Math.ceil,Lf=Math.exp,If=(Math.floor,Math.hypot),Df=Math.log,Rf=Math.pow,Bf=Math.sin,Ff=Math.sign||function(t){return t>0?1:t<0?-1:0},$f=Math.sqrt,qf=Math.tan;function Uf(t){return t>1?0:t<-1?kf:Math.acos(t)}function Kf(t){return t>1?Of:t<-1?-Of:Math.asin(t)}function zf(t){return(t=Bf(t/2))*t}function Vf(){}function Yf(t,e){t&&Wf.hasOwnProperty(t.type)&&Wf[t.type](t,e)}var Hf={Feature:function(t,e){Yf(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r=0?1:-1,i=r*n,o=jf(e=(e*=Tf)/2+Sf),a=Bf(e),s=nh*a,u=eh*o+s*jf(i),c=s*r*Bf(i);dh.add(Cf(c,u)),th=t,eh=o,nh=a}function wh(t){return mh=new xt,Xf(t,yh),2*mh}function xh(t){return[Cf(t[1],t[0]),Kf(t[2])]}function kh(t){var e=t[0],n=t[1],r=jf(n);return[r*jf(e),r*Bf(e),Bf(n)]}function Oh(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Sh(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Eh(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Ah(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Th(t){var e=$f(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var Nh,Mh,Ch,jh,Ph,Lh,Ih,Dh,Rh,Bh,Fh,$h,qh,Uh,Kh,zh,Vh={point:Yh,lineStart:Wh,lineEnd:Gh,polygonStart:function(){Vh.point=Jh,Vh.lineStart=Xh,Vh.lineEnd=Qh,fh=new xt,yh.polygonStart()},polygonEnd:function(){yh.polygonEnd(),Vh.point=Yh,Vh.lineStart=Wh,Vh.lineEnd=Gh,dh<0?(rh=-(oh=180),ih=-(ah=90)):fh>wf?ah=90:fh<-wf&&(ih=-90),ph[0]=rh,ph[1]=oh},sphere:function(){rh=-(oh=180),ih=-(ah=90)}};function Yh(t,e){hh.push(ph=[rh=t,oh=t]),eah&&(ah=e)}function Hh(t,e){var n=kh([t*Tf,e*Tf]);if(lh){var r=Sh(lh,n),i=Sh([r[1],-r[0],0],r);Th(i),i=xh(i);var o,a=t-sh,s=a>0?1:-1,u=i[0]*Af*s,c=Nf(a)>180;c^(s*shah&&(ah=o):c^(s*sh<(u=(u+360)%360-180)&&uah&&(ah=e)),c?tZh(rh,oh)&&(oh=t):Zh(t,oh)>Zh(rh,oh)&&(rh=t):oh>=rh?(toh&&(oh=t)):t>sh?Zh(rh,t)>Zh(rh,oh)&&(oh=t):Zh(t,oh)>Zh(rh,oh)&&(rh=t)}else hh.push(ph=[rh=t,oh=t]);eah&&(ah=e),lh=n,sh=t}function Wh(){Vh.point=Hh}function Gh(){ph[0]=rh,ph[1]=oh,Vh.point=Yh,lh=null}function Jh(t,e){if(lh){var n=t-sh;fh.add(Nf(n)>180?n+(n>0?360:-360):n)}else uh=t,ch=e;yh.point(t,e),Hh(t,e)}function Xh(){yh.lineStart()}function Qh(){Jh(uh,ch),yh.lineEnd(),Nf(fh)>wf&&(rh=-(oh=180)),ph[0]=rh,ph[1]=oh,lh=null}function Zh(t,e){return(e-=t)<0?e+360:e}function tp(t,e){return t[0]-e[0]}function ep(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:eZh(r[0],r[1])&&(r[1]=i[1]),Zh(i[0],r[1])>Zh(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,e=0,r=o[n=o.length-1];e<=n;r=i,++e)i=o[e],(s=Zh(r[1],i[0]))>a&&(a=s,rh=i[0],oh=r[1])}return hh=ph=null,rh===1/0||ih===1/0?[[NaN,NaN],[NaN,NaN]]:[[rh,ih],[oh,ah]]}var rp={sphere:Vf,point:ip,lineStart:ap,lineEnd:cp,polygonStart:function(){rp.lineStart=lp,rp.lineEnd=fp},polygonEnd:function(){rp.lineStart=ap,rp.lineEnd=cp}};function ip(t,e){t*=Tf;var n=jf(e*=Tf);op(n*jf(t),n*Bf(t),Bf(e))}function op(t,e,n){++Nh,Ch+=(t-Ch)/Nh,jh+=(e-jh)/Nh,Ph+=(n-Ph)/Nh}function ap(){rp.point=sp}function sp(t,e){t*=Tf;var n=jf(e*=Tf);Uh=n*jf(t),Kh=n*Bf(t),zh=Bf(e),rp.point=up,op(Uh,Kh,zh)}function up(t,e){t*=Tf;var n=jf(e*=Tf),r=n*jf(t),i=n*Bf(t),o=Bf(e),a=Cf($f((a=Kh*o-zh*i)*a+(a=zh*r-Uh*o)*a+(a=Uh*i-Kh*r)*a),Uh*r+Kh*i+zh*o);Mh+=a,Lh+=a*(Uh+(Uh=r)),Ih+=a*(Kh+(Kh=i)),Dh+=a*(zh+(zh=o)),op(Uh,Kh,zh)}function cp(){rp.point=ip}function lp(){rp.point=hp}function fp(){pp($h,qh),rp.point=ip}function hp(t,e){$h=t,qh=e,t*=Tf,e*=Tf,rp.point=pp;var n=jf(e);Uh=n*jf(t),Kh=n*Bf(t),zh=Bf(e),op(Uh,Kh,zh)}function pp(t,e){t*=Tf;var n=jf(e*=Tf),r=n*jf(t),i=n*Bf(t),o=Bf(e),a=Kh*o-zh*i,s=zh*r-Uh*o,u=Uh*i-Kh*r,c=If(a,s,u),l=Kf(c),f=c&&-l/c;Rh.add(f*a),Bh.add(f*s),Fh.add(f*u),Mh+=l,Lh+=l*(Uh+(Uh=r)),Ih+=l*(Kh+(Kh=i)),Dh+=l*(zh+(zh=o)),op(Uh,Kh,zh)}function dp(t){Nh=Mh=Ch=jh=Ph=Lh=Ih=Dh=0,Rh=new xt,Bh=new xt,Fh=new xt,Xf(t,rp);var e=+Rh,n=+Bh,r=+Fh,i=If(e,n,r);return ikf&&(t-=Math.round(t/Ef)*Ef),[t,e]}function vp(t,e,n){return(t%=Ef)?e||n?yp(_p(t),wp(e,n)):_p(t):e||n?wp(e,n):gp}function bp(t){return function(e,n){return Nf(e+=t)>kf&&(e-=Math.round(e/Ef)*Ef),[e,n]}}function _p(t){var e=bp(t);return e.invert=bp(-t),e}function wp(t,e){var n=jf(t),r=Bf(t),i=jf(e),o=Bf(e);function a(t,e){var a=jf(e),s=jf(t)*a,u=Bf(t)*a,c=Bf(e),l=c*n+s*r;return[Cf(u*i-l*o,s*n-c*r),Kf(l*i+u*o)]}return a.invert=function(t,e){var a=jf(e),s=jf(t)*a,u=Bf(t)*a,c=Bf(e),l=c*i-u*o;return[Cf(u*i+c*o,s*n+l*r),Kf(l*n-s*r)]},a}function xp(t){function e(e){return(e=t(e[0]*Tf,e[1]*Tf))[0]*=Af,e[1]*=Af,e}return t=vp(t[0]*Tf,t[1]*Tf,t.length>2?t[2]*Tf:0),e.invert=function(e){return(e=t.invert(e[0]*Tf,e[1]*Tf))[0]*=Af,e[1]*=Af,e},e}function kp(t,e,n,r,i,o){if(n){var a=jf(e),s=Bf(e),u=r*n;null==i?(i=e+r*Ef,o=e-u/2):(i=Op(a,i),o=Op(a,o),(r>0?io)&&(i+=r*Ef));for(var c,l=i;r>0?l>o:l1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Ap(t,e){return Nf(t[0]-e[0])=0;--o)i.point((l=c[o])[0],l[1]);else r(h.x,h.p.x,-1,i);h=h.p}c=(h=h.o).z,p=!p}while(!h.v);i.lineEnd()}}}function Mp(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r=0?1:-1,E=S*O,A=E>kf,T=y*x;if(u.add(Cf(T*S*Bf(E),g*k+T*jf(E))),a+=A?O+S*Ef:O,A^d>=n^_>=n){var N=Sh(kh(p),kh(b));Th(N);var M=Sh(o,N);Th(M);var C=(A^O>=0?-1:1)*Kf(M[2]);(r>C||r===C&&(N[0]||N[1]))&&(s+=A^O>=0?1:-1)}}return(a<-wf||a0){for(f||(i.polygonStart(),f=!0),i.lineStart(),t=0;t1&&2&u&&h.push(h.pop().concat(h.shift())),a.push(h.filter(Lp))}return h}}function Lp(t){return t.length>1}function Ip(t,e){return((t=t.x)[0]<0?t[1]-Of-wf:Of-t[1])-((e=e.x)[0]<0?e[1]-Of-wf:Of-e[1])}gp.invert=gp;const Dp=Pp((function(){return!0}),(function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,a){var s=o>0?kf:-kf,u=Nf(o-n);Nf(u-kf)0?Of:-Of),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(o,r),e=0):i!==s&&u>=kf&&(Nf(n-i)wf?Mf((Bf(e)*(o=jf(r))*Bf(n)-Bf(r)*(i=jf(e))*Bf(t))/(i*o*a)):(e+r)/2}(n,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=o,r=a),i=s},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;if(null==t)i=n*Of,r.point(-kf,i),r.point(0,i),r.point(kf,i),r.point(kf,0),r.point(kf,-i),r.point(0,-i),r.point(-kf,-i),r.point(-kf,0),r.point(-kf,i);else if(Nf(t[0]-e[0])>wf){var o=t[0]0,i=Nf(e)>wf;function o(t,n){return jf(t)*jf(n)>e}function a(t,n,r){var i=[1,0,0],o=Sh(kh(t),kh(n)),a=Oh(o,o),s=o[0],u=a-s*s;if(!u)return!r&&t;var c=e*a/u,l=-e*s/u,f=Sh(i,o),h=Ah(i,c);Eh(h,Ah(o,l));var p=f,d=Oh(h,p),m=Oh(p,p),y=d*d-m*(Oh(h,h)-1);if(!(y<0)){var g=$f(y),v=Ah(p,(-d-g)/m);if(Eh(v,h),v=xh(v),!r)return v;var b,_=t[0],w=n[0],x=t[1],k=n[1];w<_&&(b=_,_=w,w=b);var O=w-_,S=Nf(O-kf)0^v[1]<(Nf(v[0]-_)kf^(_<=v[0]&&v[0]<=w)){var E=Ah(p,(-d+g)/m);return Eh(E,h),[v,xh(E)]}}}function s(e,n){var i=r?t:kf-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return Pp(o,(function(t){var e,n,u,c,l;return{lineStart:function(){c=u=!1,l=1},point:function(f,h){var p,d=[f,h],m=o(f,h),y=r?m?0:s(f,h):m?s(f+(f<0?kf:-kf),h):0;if(!e&&(c=u=m)&&t.lineStart(),m!==u&&(!(p=a(e,d))||Ap(e,p)||Ap(d,p))&&(d[2]=1),m!==u)l=0,m?(t.lineStart(),p=a(d,e),t.point(p[0],p[1])):(p=a(e,d),t.point(p[0],p[1],2),t.lineEnd()),e=p;else if(i&&e&&r^m){var g;y&n||!(g=a(d,e,!0))||(l=0,r?(t.lineStart(),t.point(g[0][0],g[0][1]),t.point(g[1][0],g[1][1]),t.lineEnd()):(t.point(g[1][0],g[1][1]),t.lineEnd(),t.lineStart(),t.point(g[0][0],g[0][1],3)))}!m||e&&Ap(e,d)||t.point(d[0],d[1]),e=d,u=m,n=y},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return l|(c&&u)<<1}}}),(function(e,r,i,o){kp(o,t,n,i,e,r)}),r?[0,-t]:[-kf,t-kf])}var Bp,Fp,$p,qp,Up=1e9,Kp=-Up;function zp(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,s,c){var l=0,f=0;if(null==i||(l=a(i,s))!==(f=a(o,s))||u(i,o)<0^s>0)do{c.point(0===l||3===l?t:n,l>1?r:e)}while((l=(l+s+4)%4)!==f);else c.point(o[0],o[1])}function a(r,i){return Nf(r[0]-t)0?0:3:Nf(r[0]-n)0?2:1:Nf(r[1]-e)0?1:0:i>0?3:2}function s(t,e){return u(t.x,e.x)}function u(t,e){var n=a(t,1),r=a(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){var u,c,l,f,h,p,d,m,y,g,v,b=a,_=Ep(),w={point:x,lineStart:function(){w.point=k,c&&c.push(l=[]),g=!0,y=!1,d=m=NaN},lineEnd:function(){u&&(k(f,h),p&&y&&_.rejoin(),u.push(_.result())),w.point=x,y&&b.lineEnd()},polygonStart:function(){b=_,u=[],c=[],v=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=c.length;nr&&(h-o)*(r-a)>(p-a)*(t-o)&&++e:p<=r&&(h-o)*(r-a)<(p-a)*(t-o)&&--e;return e}(),n=v&&e,i=(u=xe(u)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&Np(u,s,e,o,a),a.polygonEnd()),b=a,u=c=l=null}};function x(t,e){i(t,e)&&b.point(t,e)}function k(o,a){var s=i(o,a);if(c&&l.push([o,a]),g)f=o,h=a,p=s,g=!1,s&&(b.lineStart(),b.point(o,a));else if(s&&y)b.point(o,a);else{var u=[d=Math.max(Kp,Math.min(Up,d)),m=Math.max(Kp,Math.min(Up,m))],_=[o=Math.max(Kp,Math.min(Up,o)),a=Math.max(Kp,Math.min(Up,a))];!function(t,e,n,r,i,o){var a,s=t[0],u=t[1],c=0,l=1,f=e[0]-s,h=e[1]-u;if(a=n-s,f||!(a>0)){if(a/=f,f<0){if(a0){if(a>l)return;a>c&&(c=a)}if(a=i-s,f||!(a<0)){if(a/=f,f<0){if(a>l)return;a>c&&(c=a)}else if(f>0){if(a0)){if(a/=h,h<0){if(a0){if(a>l)return;a>c&&(c=a)}if(a=o-u,h||!(a<0)){if(a/=h,h<0){if(a>l)return;a>c&&(c=a)}else if(h>0){if(a0&&(t[0]=s+c*f,t[1]=u+c*h),l<1&&(e[0]=s+l*f,e[1]=u+l*h),!0}}}}}(u,_,t,e,n,r)?s&&(b.lineStart(),b.point(o,a),v=!1):(y||(b.lineStart(),b.point(u[0],u[1])),b.point(_[0],_[1]),s||b.lineEnd(),v=!1)}d=o,m=a,y=s}return w}}function Vp(){var t,e,n,r=0,i=0,o=960,a=500;return n={stream:function(n){return t&&e===n?t:t=zp(r,i,o,a)(e=n)},extent:function(s){return arguments.length?(r=+s[0][0],i=+s[0][1],o=+s[1][0],a=+s[1][1],t=e=null,n):[[r,i],[o,a]]}}}var Yp={sphere:Vf,point:Vf,lineStart:function(){Yp.point=Wp,Yp.lineEnd=Hp},lineEnd:Vf,polygonStart:Vf,polygonEnd:Vf};function Hp(){Yp.point=Yp.lineEnd=Vf}function Wp(t,e){Fp=t*=Tf,$p=Bf(e*=Tf),qp=jf(e),Yp.point=Gp}function Gp(t,e){t*=Tf;var n=Bf(e*=Tf),r=jf(e),i=Nf(t-Fp),o=jf(i),a=r*Bf(i),s=qp*n-$p*r*o,u=$p*n+qp*r*o;Bp.add(Cf($f(a*a+s*s),u)),Fp=t,$p=n,qp=r}function Jp(t){return Bp=new xt,Xf(t,Yp),+Bp}var Xp=[null,null],Qp={type:"LineString",coordinates:Xp};function Zp(t,e){return Xp[0]=t,Xp[1]=e,Jp(Qp)}var td={Feature:function(t,e){return nd(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r0&&(i=Zp(t[o],t[o-1]))>0&&n<=i&&r<=i&&(n+r-i)*(1-Math.pow((n-r)/i,2))wf})).map(u)).concat(Ee(Pf(o/p)*p,i,p).filter((function(t){return Nf(t%m)>wf})).map(c))}return g.lines=function(){return v().map((function(t){return{type:"LineString",coordinates:t}}))},g.outline=function(){return{type:"Polygon",coordinates:[l(r).concat(f(a).slice(1),l(n).reverse().slice(1),f(s).reverse().slice(1))]}},g.extent=function(t){return arguments.length?g.extentMajor(t).extentMinor(t):g.extentMinor()},g.extentMajor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],a=+t[1][1],r>n&&(t=r,r=n,n=t),s>a&&(t=s,s=a,a=t),g.precision(y)):[[r,s],[n,a]]},g.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],o=+n[0][1],i=+n[1][1],e>t&&(n=e,e=t,t=n),o>i&&(n=o,o=i,i=n),g.precision(y)):[[e,o],[t,i]]},g.step=function(t){return arguments.length?g.stepMajor(t).stepMinor(t):g.stepMinor()},g.stepMajor=function(t){return arguments.length?(d=+t[0],m=+t[1],g):[d,m]},g.stepMinor=function(t){return arguments.length?(h=+t[0],p=+t[1],g):[h,p]},g.precision=function(h){return arguments.length?(y=+h,u=cd(o,i,90),c=ld(e,t,y),l=cd(s,a,90),f=ld(r,n,y),g):y},g.extentMajor([[-180,-90+wf],[180,90-wf]]).extentMinor([[-180,-80-wf],[180,80+wf]])}function hd(){return fd()()}function pd(t,e){var n=t[0]*Tf,r=t[1]*Tf,i=e[0]*Tf,o=e[1]*Tf,a=jf(r),s=Bf(r),u=jf(o),c=Bf(o),l=a*jf(n),f=a*Bf(n),h=u*jf(i),p=u*Bf(i),d=2*Kf($f(zf(o-r)+a*u*zf(i-n))),m=Bf(d),y=d?function(t){var e=Bf(t*=d)/m,n=Bf(d-t)/m,r=n*l+e*h,i=n*f+e*p,o=n*s+e*c;return[Cf(i,r)*Af,Cf(o,$f(r*r+i*i))*Af]}:function(){return[n*Af,r*Af]};return y.distance=d,y}const dd=t=>t;var md,yd,gd,vd,bd=new xt,_d=new xt,wd={point:Vf,lineStart:Vf,lineEnd:Vf,polygonStart:function(){wd.lineStart=xd,wd.lineEnd=Sd},polygonEnd:function(){wd.lineStart=wd.lineEnd=wd.point=Vf,bd.add(Nf(_d)),_d=new xt},result:function(){var t=bd/2;return bd=new xt,t}};function xd(){wd.point=kd}function kd(t,e){wd.point=Od,md=gd=t,yd=vd=e}function Od(t,e){_d.add(vd*t-gd*e),gd=t,vd=e}function Sd(){Od(md,yd)}const Ed=wd;var Ad=1/0,Td=Ad,Nd=-Ad,Md=Nd,Cd={point:function(t,e){tNd&&(Nd=t),eMd&&(Md=e)},lineStart:Vf,lineEnd:Vf,polygonStart:Vf,polygonEnd:Vf,result:function(){var t=[[Ad,Td],[Nd,Md]];return Nd=Md=-(Td=Ad=1/0),t}};const jd=Cd;var Pd,Ld,Id,Dd,Rd=0,Bd=0,Fd=0,$d=0,qd=0,Ud=0,Kd=0,zd=0,Vd=0,Yd={point:Hd,lineStart:Wd,lineEnd:Xd,polygonStart:function(){Yd.lineStart=Qd,Yd.lineEnd=Zd},polygonEnd:function(){Yd.point=Hd,Yd.lineStart=Wd,Yd.lineEnd=Xd},result:function(){var t=Vd?[Kd/Vd,zd/Vd]:Ud?[$d/Ud,qd/Ud]:Fd?[Rd/Fd,Bd/Fd]:[NaN,NaN];return Rd=Bd=Fd=$d=qd=Ud=Kd=zd=Vd=0,t}};function Hd(t,e){Rd+=t,Bd+=e,++Fd}function Wd(){Yd.point=Gd}function Gd(t,e){Yd.point=Jd,Hd(Id=t,Dd=e)}function Jd(t,e){var n=t-Id,r=e-Dd,i=$f(n*n+r*r);$d+=i*(Id+t)/2,qd+=i*(Dd+e)/2,Ud+=i,Hd(Id=t,Dd=e)}function Xd(){Yd.point=Hd}function Qd(){Yd.point=tm}function Zd(){em(Pd,Ld)}function tm(t,e){Yd.point=em,Hd(Pd=Id=t,Ld=Dd=e)}function em(t,e){var n=t-Id,r=e-Dd,i=$f(n*n+r*r);$d+=i*(Id+t)/2,qd+=i*(Dd+e)/2,Ud+=i,Kd+=(i=Dd*t-Id*e)*(Id+t),zd+=i*(Dd+e),Vd+=3*i,Hd(Id=t,Dd=e)}const nm=Yd;function rm(t){this._context=t}rm.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,Ef)}},result:Vf};var im,om,am,sm,um,cm=new xt,lm={point:Vf,lineStart:function(){lm.point=fm},lineEnd:function(){im&&hm(om,am),lm.point=Vf},polygonStart:function(){im=!0},polygonEnd:function(){im=null},result:function(){var t=+cm;return cm=new xt,t}};function fm(t,e){lm.point=hm,om=sm=t,am=um=e}function hm(t,e){sm-=t,um-=e,cm.add($f(sm*sm+um*um)),sm=t,um=e}const pm=lm;let dm,mm,ym,gm;class vm{constructor(t){this._append=null==t?bm:function(t){const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return bm;if(e!==dm){const t=10**e;dm=e,mm=function(e){let n=1;this._+=e[0];for(const r=e.length;n=0))throw new RangeError(`invalid digits: ${t}`);i=e}return null===e&&(r=new vm(i)),a},a.projection(t).digits(i).context(e)}function wm(t){return{stream:xm(t)}}function xm(t){return function(e){var n=new km;for(var r in t)n[r]=t[r];return n.stream=e,n}}function km(){}function Om(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),Xf(n,t.stream(jd)),e(jd.result()),null!=r&&t.clipExtent(r),t}function Sm(t,e,n){return Om(t,(function(n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),a=+e[0][0]+(r-o*(n[1][0]+n[0][0]))/2,s=+e[0][1]+(i-o*(n[1][1]+n[0][1]))/2;t.scale(150*o).translate([a,s])}),n)}function Em(t,e,n){return Sm(t,[[0,0],e],n)}function Am(t,e,n){return Om(t,(function(n){var r=+e,i=r/(n[1][0]-n[0][0]),o=(r-i*(n[1][0]+n[0][0]))/2,a=-i*n[0][1];t.scale(150*i).translate([o,a])}),n)}function Tm(t,e,n){return Om(t,(function(n){var r=+e,i=r/(n[1][1]-n[0][1]),o=-i*n[0][0],a=(r-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([o,a])}),n)}km.prototype={constructor:km,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Nm=16,Mm=jf(30*Tf);function Cm(t,e){return+e?function(t,e){function n(r,i,o,a,s,u,c,l,f,h,p,d,m,y){var g=c-r,v=l-i,b=g*g+v*v;if(b>4*e&&m--){var _=a+h,w=s+p,x=u+d,k=$f(_*_+w*w+x*x),O=Kf(x/=k),S=Nf(Nf(x)-1)e||Nf((g*N+v*M)/b-.5)>.3||a*h+s*p+u*d2?t[2]%360*Tf:0,N()):[y*Af,g*Af,v*Af]},A.angle=function(t){return arguments.length?(b=t%360*Tf,N()):b*Af},A.reflectX=function(t){return arguments.length?(_=t?-1:1,N()):_<0},A.reflectY=function(t){return arguments.length?(w=t?-1:1,N()):w<0},A.precision=function(t){return arguments.length?(a=Cm(s,E=t*t),M()):$f(E)},A.fitExtent=function(t,e){return Sm(A,t,e)},A.fitSize=function(t,e){return Em(A,t,e)},A.fitWidth=function(t,e){return Am(A,t,e)},A.fitHeight=function(t,e){return Tm(A,t,e)},function(){return e=t.apply(this,arguments),A.invert=e.invert&&T,N()}}function Dm(t){var e=0,n=kf/3,r=Im(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*Tf,n=t[1]*Tf):[e*Af,n*Af]},i}function Rm(t,e){var n=Bf(t),r=(n+Bf(e))/2;if(Nf(r)=.12&&i<.234&&r>=-.425&&r<-.214?s:i>=.166&&i<.234&&r>=-.214&&r<-.115?u:a).invert(t)},l.stream=function(n){return t&&e===n?t:(r=[a.stream(e=n),s.stream(n),u.stream(n)],i=r.length,t={point:function(t,e){for(var n=-1;++n0?e<-Of+wf&&(e=-Of+wf):e>Of-wf&&(e=Of-wf);var n=i/Rf(Jm(e),r);return[n*Bf(r*t),i-n*jf(r*t)]}return o.invert=function(t,e){var n=i-e,o=Ff(r)*$f(t*t+n*n),a=Cf(t,Nf(n))*Ff(n);return n*r<0&&(a-=kf*Ff(t)*Ff(n)),[a/r,2*Mf(Rf(i/o,1/r))-Of]},o}function Qm(){return Dm(Xm).scale(109.5).parallels([30,30])}function Zm(t,e){return[t,e]}function ty(){return Lm(Zm).scale(152.63)}function ey(t,e){var n=jf(t),r=t===e?Bf(t):(n-jf(e))/(e-t),i=n/r+t;if(Nf(r)2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)}function wy(t,e){return t.parent===e.parent?1:2}function xy(t,e){return t+e.x}function ky(t,e){return Math.max(t,e.y)}function Oy(){var t=wy,e=1,n=1,r=!1;function i(i){var o,a=0;i.eachAfter((function(e){var n=e.children;n?(e.x=function(t){return t.reduce(xy,0)/t.length}(n),e.y=function(t){return 1+t.reduce(ky,0)}(n)):(e.x=o?a+=t(e,o):0,e.y=0,o=e)}));var s=function(t){for(var e;e=t.children;)t=e[0];return t}(i),u=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(i),c=s.x-t(s,u)/2,l=u.x+t(u,s)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*e,t.y=(i.y-t.y)*n}:function(t){t.x=(t.x-c)/(l-c)*e,t.y=(1-(i.y?t.y/i.y:1))*n})}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i}function Sy(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function Ey(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=Ty)):void 0===e&&(e=Ay);for(var n,r,i,o,a,s=new Cy(t),u=[s];n=u.pop();)if((i=e(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)u.push(r=i[o]=new Cy(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(My)}function Ay(t){return t.children}function Ty(t){return Array.isArray(t)?t[1]:null}function Ny(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function My(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function Cy(t){this.data=t,this.depth=this.height=0,this.parent=null}function jy(t){return null==t?null:Py(t)}function Py(t){if("function"!=typeof t)throw new Error;return t}function Ly(){return 0}function Iy(t){return function(){return t}}uy.invert=function(t,e){for(var n,r=e,i=r*r,o=i*i*i,a=0;a<12&&(o=(i=(r-=n=(r*(ry+iy*i+o*(oy+ay*i))-e)/(ry+3*iy*i+o*(7*oy+9*ay*i)))*r)*i*i,!(Nf(n)wf&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},my.invert=Um(Kf),gy.invert=Um((function(t){return 2*Mf(t)})),by.invert=function(t,e){return[-e,2*Mf(Lf(t))-Of]},Cy.prototype=Ey.prototype={constructor:Cy,count:function(){return this.eachAfter(Sy)},each:function(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this},eachAfter:function(t,e){for(var n,r,i,o=this,a=[o],s=[],u=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r=0;--r)o.push(n[r]);return this},find:function(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;for(t=n.pop(),e=r.pop();t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return Ey(this).eachBefore(Ny)},[Symbol.iterator]:function*(){var t,e,n,r,i=this,o=[i];do{for(t=o.reverse(),o=[];i=t.pop();)if(yield i,e=i.children)for(n=0,r=e.length;n(t=(Dy*t+Ry)%By)/By}function $y(t){return qy(t,Fy())}function qy(t,e){for(var n,r,i=0,o=(t=function(t,e){let n,r,i=t.length;for(;i;)r=e()*i--|0,n=t[i],t[i]=t[r],t[r]=n;return t}(Array.from(t),e)).length,a=[];i0&&n*n>r*r+i*i}function Vy(t,e){for(var n=0;n1e-6?(A+Math.sqrt(A*A-4*E*T))/(2*E):T/A);return{x:r+x+k*N,y:i+O+S*N,r:N}}function Gy(t,e,n){var r,i,o,a,s=t.x-e.x,u=t.y-e.y,c=s*s+u*u;c?(i=e.r+n.r,i*=i,a=t.r+n.r,i>(a*=a)?(r=(c+a-i)/(2*c),o=Math.sqrt(Math.max(0,a/c-r*r)),n.x=t.x-r*s-o*u,n.y=t.y-r*u+o*s):(r=(c+i-a)/(2*c),o=Math.sqrt(Math.max(0,i/c-r*r)),n.x=e.x+r*s-o*u,n.y=e.y+r*u+o*s)):(n.x=e.x+n.r,n.y=e.y)}function Jy(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function Xy(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,o=(e.y*n.r+n.y*e.r)/r;return i*i+o*o}function Qy(t){this._=t,this.next=null,this.previous=null}function Zy(t,e){if(!(a=(n=t,t="object"==typeof n&&"length"in n?n:Array.from(n)).length))return 0;var n,r,i,o,a,s,u,c,l,f,h,p;if((r=t[0]).x=0,r.y=0,!(a>1))return r.r;if(i=t[1],r.x=-i.r,i.x=r.r,i.y=0,!(a>2))return r.r+i.r;Gy(i,r,o=t[2]),r=new Qy(r),i=new Qy(i),o=new Qy(o),r.next=o.previous=i,i.next=r.previous=o,o.next=i.previous=r;t:for(c=3;cfunction(t){let e=(t=`${t}`).length;return yg(t,e-1)&&!yg(t,e-2)&&(t=t.slice(0,-1)),"/"===t[0]?t:`/${t}`}(t(e,n,r)))),n=e.map(mg),i=new Set(e).add("");for(const t of n)i.has(t)||(i.add(t),e.push(t),n.push(mg(t)),h.push(fg));p=(t,n)=>e[n],d=(t,e)=>n[e]}for(a=0,i=h.length;a=0&&(c=h[t]).data===fg;--t)c.data=null}if(s.parent=cg,s.eachBefore((function(t){t.depth=t.parent.depth+1,--i})).eachBefore(My),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(t){return arguments.length?(e=jy(t),r):e},r.parentId=function(t){return arguments.length?(n=jy(t),r):n},r.path=function(e){return arguments.length?(t=jy(e),r):t},r}function mg(t){let e=t.length;if(e<2)return"";for(;--e>1&&!yg(t,e););return t.slice(0,e)}function yg(t,e){if("/"===t[e]){let n=0;for(;e>0&&"\\"===t[--e];)++n;if(!(1&n))return!0}return!1}function gg(t,e){return t.parent===e.parent?1:2}function vg(t){var e=t.children;return e?e[0]:t.t}function bg(t){var e=t.children;return e?e[e.length-1]:t.t}function _g(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function wg(t,e,n){return t.a.parent===e.parent?t.a:n}function xg(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function kg(){var t=gg,e=1,n=1,r=null;function i(i){var u=function(t){for(var e,n,r,i,o,a=new xg(t,0),s=[a];e=s.pop();)if(r=e._.children)for(e.children=new Array(o=r.length),i=o-1;i>=0;--i)s.push(n=e.children[i]=new xg(r[i],i)),n.parent=e;return(a.parent=new xg(null,0)).children=[a],a}(i);if(u.eachAfter(o),u.parent.m=-u.z,u.eachBefore(a),r)i.eachBefore(s);else{var c=i,l=i,f=i;i.eachBefore((function(t){t.xl.x&&(l=t),t.depth>f.depth&&(f=t)}));var h=c===l?1:t(c,l)/2,p=h-c.x,d=e/(l.x+h+p),m=n/(f.depth||1);i.eachBefore((function(t){t.x=(t.x+p)*d,t.y=t.depth*m}))}return i}function o(e){var n=e.children,r=e.parent.children,i=e.i?r[e.i-1]:null;if(n){!function(t){for(var e,n=0,r=0,i=t.children,o=i.length;--o>=0;)(e=i[o]).z+=n,e.m+=n,n+=e.s+(r+=e.c)}(e);var o=(n[0].z+n[n.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-o):e.z=o}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,n,r){if(n){for(var i,o=e,a=e,s=n,u=o.parent.children[0],c=o.m,l=a.m,f=s.m,h=u.m;s=bg(s),o=vg(o),s&&o;)u=vg(u),(a=bg(a)).a=e,(i=s.z+f-o.z-c+t(s._,o._))>0&&(_g(wg(s,e,r),e,i),c+=i,l+=i),f+=s.m,c+=o.m,h+=u.m,l+=a.m;s&&!bg(a)&&(a.t=s,a.m+=f-l),o&&!vg(u)&&(u.t=o,u.m+=c-h,r=e)}return r}(e,i,e.parent.A||r[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*n}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i}function Og(t,e,n,r,i){for(var o,a=t.children,s=-1,u=a.length,c=t.value&&(i-n)/t.value;++sh&&(h=s),y=l*l*m,(p=Math.max(h/y,y/f))>d){l-=s;break}d=p}g.push(a={value:l,dice:u1?e:1)},n}(Sg);function Tg(){var t=Ag,e=!1,n=1,r=1,i=[0],o=Ly,a=Ly,s=Ly,u=Ly,c=Ly;function l(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(f),i=[0],e&&t.eachBefore(ag),t}function f(e){var n=i[e.depth],r=e.x0+n,l=e.y0+n,f=e.x1-n,h=e.y1-n;f=n-1){var l=s[e];return l.x0=i,l.y0=o,l.x1=a,void(l.y1=u)}for(var f=c[e],h=r/2+f,p=e+1,d=n-1;p>>1;c[m]u-o){var v=r?(i*g+a*y)/r:a;t(e,p,y,i,o,v,u),t(p,n,g,v,o,a,u)}else{var b=r?(o*g+u*y)/r:u;t(e,p,y,i,o,a,b),t(p,n,g,i,b,a,u)}}(0,u,t.value,e,n,r,i)}function Mg(t,e,n,r,i){(1&t.depth?Og:sg)(t,e,n,r,i)}const Cg=function t(e){function n(t,n,r,i,o){if((a=t._squarify)&&a.ratio===e)for(var a,s,u,c,l,f=-1,h=a.length,p=t.value;++f1?e:1)},n}(Sg);function jg(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}function Pg(t,e){var n=Ti(+t,+e);return function(t){var e=n(t);return e-360*Math.floor(e/360)}}function Lg(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function Ig(t){return((t=Math.exp(t))+1/t)/2}const Dg=function t(e,n,r){function i(t,i){var o,a,s=t[0],u=t[1],c=t[2],l=i[0],f=i[1],h=i[2],p=l-s,d=f-u,m=p*p+d*d;if(m<1e-12)a=Math.log(h/c)/e,o=function(t){return[s+t*p,u+t*d,c*Math.exp(e*t*a)]};else{var y=Math.sqrt(m),g=(h*h-c*c+r*m)/(2*c*n*y),v=(h*h-c*c-r*m)/(2*h*n*y),b=Math.log(Math.sqrt(g*g+1)-g),_=Math.log(Math.sqrt(v*v+1)-v);a=(_-b)/e,o=function(t){var r,i=t*a,o=Ig(b),l=c/(n*y)*(o*(r=e*i+b,((r=Math.exp(2*r))-1)/(r+1))-function(t){return((t=Math.exp(t))-1/t)/2}(b));return[s+l*p,u+l*d,c*o/Ig(e*i+b)]}}return o.duration=1e3*a*e/Math.SQRT2,o}return i.rho=function(e){var n=Math.max(.001,+e),r=n*n;return t(n,r,r*r)},i}(Math.SQRT2,2,4);function Rg(t){return function(e,n){var r=t((e=vi(e)).h,(n=vi(n)).h),i=Ni(e.s,n.s),o=Ni(e.l,n.l),a=Ni(e.opacity,n.opacity);return function(t){return e.h=r(t),e.s=i(t),e.l=o(t),e.opacity=a(t),e+""}}}const Bg=Rg(Ti);var Fg=Rg(Ni);function $g(t,e){var n=Ni((t=Ms(t)).l,(e=Ms(e)).l),r=Ni(t.a,e.a),i=Ni(t.b,e.b),o=Ni(t.opacity,e.opacity);return function(e){return t.l=n(e),t.a=r(e),t.b=i(e),t.opacity=o(e),t+""}}function qg(t){return function(e,n){var r=t((e=Bs(e)).h,(n=Bs(n)).h),i=Ni(e.c,n.c),o=Ni(e.l,n.l),a=Ni(e.opacity,n.opacity);return function(t){return e.h=r(t),e.c=i(t),e.l=o(t),e.opacity=a(t),e+""}}}const Ug=qg(Ti);var Kg=qg(Ni);function zg(t){return function e(n){function r(e,r){var i=t((e=Gs(e)).h,(r=Gs(r)).h),o=Ni(e.s,r.s),a=Ni(e.l,r.l),s=Ni(e.opacity,r.opacity);return function(t){return e.h=i(t),e.s=o(t),e.l=a(Math.pow(t,n)),e.opacity=s(t),e+""}}return n=+n,r.gamma=e,r}(1)}const Vg=zg(Ti);var Yg=zg(Ni);function Hg(t,e){void 0===e&&(e=t,t=zi);for(var n=0,r=e.length-1,i=e[0],o=new Array(r<0?0:r);n1&&Xg(t[n[i-2]],t[n[i-1]],t[r])<=0;)--i;n[i++]=r}return n.slice(0,i)}function tv(t){if((n=t.length)<3)return null;var e,n,r=new Array(n),i=new Array(n);for(e=0;e=0;--e)c.push(t[r[o[e]][2]]);for(e=+s;es!=c>s&&a<(u-n)*(s-r)/(c-r)+n&&(l=!l),u=n,c=r;return l}function nv(t){for(var e,n,r=-1,i=t.length,o=t[i-1],a=o[0],s=o[1],u=0;++r1);return t+n*o*Math.sqrt(-2*Math.log(i)/i)}}return n.source=t,n}(rv),sv=function t(e){var n=av.source(e);function r(){var t=n.apply(this,arguments);return function(){return Math.exp(t())}}return r.source=t,r}(rv),uv=function t(e){function n(t){return(t=+t)<=0?()=>0:function(){for(var n=0,r=t;r>1;--r)n+=e();return n+r*e()}}return n.source=t,n}(rv),cv=function t(e){var n=uv.source(e);function r(t){if(0==(t=+t))return e;var r=n(t);return function(){return r()/t}}return r.source=t,r}(rv),lv=function t(e){function n(t){return function(){return-Math.log1p(-e())/t}}return n.source=t,n}(rv),fv=function t(e){function n(t){if((t=+t)<0)throw new RangeError("invalid alpha");return t=1/-t,function(){return Math.pow(1-e(),t)}}return n.source=t,n}(rv),hv=function t(e){function n(t){if((t=+t)<0||t>1)throw new RangeError("invalid p");return function(){return Math.floor(e()+t)}}return n.source=t,n}(rv),pv=function t(e){function n(t){if((t=+t)<0||t>1)throw new RangeError("invalid p");return 0===t?()=>1/0:1===t?()=>1:(t=Math.log1p(-t),function(){return 1+Math.floor(Math.log1p(-e())/t)})}return n.source=t,n}(rv),dv=function t(e){var n=av.source(e)();function r(t,r){if((t=+t)<0)throw new RangeError("invalid k");if(0===t)return()=>0;if(r=null==r?1:+r,1===t)return()=>-Math.log1p(-e())*r;var i=(t<1?t+1:t)-1/3,o=1/(3*Math.sqrt(i)),a=t<1?()=>Math.pow(e(),1/t):()=>1;return function(){do{do{var t=n(),s=1+o*t}while(s<=0);s*=s*s;var u=1-e()}while(u>=1-.0331*t*t*t*t&&Math.log(u)>=.5*t*t+i*(1-s+Math.log(s)));return i*s*a()*r}}return r.source=t,r}(rv),mv=function t(e){var n=dv.source(e);function r(t,e){var r=n(t),i=n(e);return function(){var t=r();return 0===t?0:t/(t+i())}}return r.source=t,r}(rv),yv=function t(e){var n=pv.source(e),r=mv.source(e);function i(t,e){return t=+t,(e=+e)>=1?()=>t:e<=0?()=>0:function(){for(var i=0,o=t,a=e;o*a>16&&o*(1-a)>16;){var s=Math.floor((o+1)*a),u=r(s,o-s+1)();u<=a?(i+=s,o-=s,a=(a-u)/(1-u)):(o=s-1,a/=u)}for(var c=a<.5,l=n(c?a:1-a),f=l(),h=0;f<=o;++h)f+=l();return i+(c?h:o-h)}}return i.source=t,i}(rv),gv=function t(e){function n(t,n,r){var i;return 0==(t=+t)?i=t=>-Math.log(t):(t=1/t,i=e=>Math.pow(e,t)),n=null==n?0:+n,r=null==r?1:+r,function(){return n+r*i(-Math.log1p(-e()))}}return n.source=t,n}(rv),vv=function t(e){function n(t,n){return t=null==t?0:+t,n=null==n?1:+n,function(){return t+n*Math.tan(Math.PI*e())}}return n.source=t,n}(rv),bv=function t(e){function n(t,n){return t=null==t?0:+t,n=null==n?1:+n,function(){var r=e();return t+n*Math.log(r/(1-r))}}return n.source=t,n}(rv),_v=function t(e){var n=dv.source(e),r=yv.source(e);function i(t){return function(){for(var i=0,o=t;o>16;){var a=Math.floor(.875*o),s=n(a)();if(s>o)return i+r(a-1,o/s)();i+=a,o-=s}for(var u=-Math.log1p(-e()),c=0;u<=o;++c)u-=Math.log1p(-e());return i+c}}return i.source=t,i}(rv),wv=1664525,xv=1013904223,kv=1/4294967296;function Ov(t=Math.random()){let e=0|(0<=t&&t<1?t/kv:Math.abs(t));return()=>(e=wv*e+xv|0,kv*(e>>>0))}function Sv(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function Ev(t,e){switch(arguments.length){case 0:break;case 1:"function"==typeof t?this.interpolator(t):this.range(t);break;default:this.domain(t),"function"==typeof e?this.interpolator(e):this.range(e)}return this}const Av=Symbol("implicit");function Tv(){var t=new St,e=[],n=[],r=Av;function i(i){let o=t.get(i);if(void 0===o){if(r!==Av)return r;t.set(i,o=e.push(i)-1)}return n[o%n.length]}return i.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new St;for(const r of n)t.has(r)||t.set(r,e.push(r)-1);return i},i.range=function(t){return arguments.length?(n=Array.from(t),i):n.slice()},i.unknown=function(t){return arguments.length?(r=t,i):r},i.copy=function(){return Tv(e,n).unknown(r)},Sv.apply(i,arguments),i}function Nv(){var t,e,n=Tv().unknown(void 0),r=n.domain,i=n.range,o=0,a=1,s=!1,u=0,c=0,l=.5;function f(){var n=r().length,f=ae&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}(a[0],a[t-1])),r=t>2?Rv:Dv,i=o=null,f}function f(e){return null==e||isNaN(e=+e)?n:(i||(i=r(a.map(t),s,u)))(t(c(e)))}return f.invert=function(n){return c(e((o||(o=r(s,a.map(t),Fi)))(n)))},f.domain=function(t){return arguments.length?(a=Array.from(t,jv),l()):a.slice()},f.range=function(t){return arguments.length?(s=Array.from(t),l()):s.slice()},f.rangeRound=function(t){return s=Array.from(t),u=Lg,l()},f.clamp=function(t){return arguments.length?(c=!!t||Lv,l()):c!==Lv},f.interpolate=function(t){return arguments.length?(u=t,l()):u},f.unknown=function(t){return arguments.length?(n=t,f):n},function(n,r){return t=n,e=r,l()}}function $v(){return Fv()(Lv,Lv)}function qv(t,e,n,r){var i,o=re(t,e,n);switch((r=af(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=bf(o,a))||(r.precision=i),pf(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=_f(o,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=vf(o))||(r.precision=i-2*("%"===r.type))}return hf(r)}function Uv(t){var e=t.domain;return t.ticks=function(t){var n=e();return ee(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return qv(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,i,o=e(),a=0,s=o.length-1,u=o[a],c=o[s],l=10;for(c0;){if((i=ne(u,c,n))===r)return o[a]=u,o[s]=c,e(o);if(i>0)u=Math.floor(u/i)*i,c=Math.ceil(c/i)*i;else{if(!(i<0))break;u=Math.ceil(u*i)/i,c=Math.floor(c*i)/i}r=i}return t},t}function Kv(){var t=$v();return t.copy=function(){return Bv(t,Kv())},Sv.apply(t,arguments),Uv(t)}function zv(t){var e;function n(t){return null==t||isNaN(t=+t)?e:t}return n.invert=n,n.domain=n.range=function(e){return arguments.length?(t=Array.from(e,jv),n):t.slice()},n.unknown=function(t){return arguments.length?(e=t,n):e},n.copy=function(){return zv(t).unknown(e)},t=arguments.length?Array.from(t,jv):[0,1],Uv(n)}function Vv(t,e){var n,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a-t(-e,n)}function Qv(t){const e=t(Yv,Hv),n=e.domain;let r,i,o=10;function a(){return r=function(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}(o),i=function(t){return 10===t?Jv:t===Math.E?Math.exp:e=>Math.pow(t,e)}(o),n()[0]<0?(r=Xv(r),i=Xv(i),t(Wv,Gv)):t(Yv,Hv),e}return e.base=function(t){return arguments.length?(o=+t,a()):o},e.domain=function(t){return arguments.length?(n(t),a()):n()},e.ticks=t=>{const e=n();let a=e[0],s=e[e.length-1];const u=s0){for(;f<=h;++f)for(c=1;cs)break;d.push(l)}}else for(;f<=h;++f)for(c=o-1;c>=1;--c)if(l=f>0?c/i(-f):c*i(f),!(ls)break;d.push(l)}2*d.length{if(null==t&&(t=10),null==n&&(n=10===o?"s":","),"function"!=typeof n&&(o%1||null!=(n=af(n)).precision||(n.trim=!0),n=hf(n)),t===1/0)return n;const a=Math.max(1,o*t/e.ticks().length);return t=>{let e=t/i(Math.round(r(t)));return e*on(Vv(n(),{floor:t=>i(Math.floor(r(t))),ceil:t=>i(Math.ceil(r(t)))})),e}function Zv(){const t=Qv(Fv()).domain([1,10]);return t.copy=()=>Bv(t,Zv()).base(t.base()),Sv.apply(t,arguments),t}function tb(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function eb(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function nb(t){var e=1,n=t(tb(e),eb(e));return n.constant=function(n){return arguments.length?t(tb(e=+n),eb(e)):e},Uv(n)}function rb(){var t=nb(Fv());return t.copy=function(){return Bv(t,rb()).constant(t.constant())},Sv.apply(t,arguments)}function ib(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function ob(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function ab(t){return t<0?-t*t:t*t}function sb(t){var e=t(Lv,Lv),n=1;return e.exponent=function(e){return arguments.length?1==(n=+e)?t(Lv,Lv):.5===n?t(ob,ab):t(ib(n),ib(1/n)):n},Uv(e)}function ub(){var t=sb(Fv());return t.copy=function(){return Bv(t,ub()).exponent(t.exponent())},Sv.apply(t,arguments),t}function cb(){return ub.apply(null,arguments).exponent(.5)}function lb(t){return Math.sign(t)*t*t}function fb(){var t,e=$v(),n=[0,1],r=!1;function i(n){var i=function(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}(e(n));return isNaN(i)?t:r?Math.round(i):i}return i.invert=function(t){return e.invert(lb(t))},i.domain=function(t){return arguments.length?(e.domain(t),i):e.domain()},i.range=function(t){return arguments.length?(e.range((n=Array.from(t,jv)).map(lb)),i):n.slice()},i.rangeRound=function(t){return i.range(t).round(!0)},i.round=function(t){return arguments.length?(r=!!t,i):r},i.clamp=function(t){return arguments.length?(e.clamp(t),i):e.clamp()},i.unknown=function(e){return arguments.length?(t=e,i):t},i.copy=function(){return fb(e.domain(),n).round(r).clamp(e.clamp()).unknown(t)},Sv.apply(i,arguments),Uv(i)}function hb(){var t,e=[],n=[],r=[];function i(){var t=0,i=Math.max(1,n.length);for(r=new Array(i-1);++t0?r[i-1]:e[0],i=r?[i[r-1],n]:[i[a-1],i[a]]},a.unknown=function(e){return arguments.length?(t=e,a):a},a.thresholds=function(){return i.slice()},a.copy=function(){return pb().domain([e,n]).range(o).unknown(t)},Sv.apply(Uv(a),arguments)}function db(){var t,e=[.5],n=[0,1],r=1;function i(i){return null!=i&&i<=i?n[ot(e,i,0,r)]:t}return i.domain=function(t){return arguments.length?(e=Array.from(t),r=Math.min(e.length,n.length-1),i):e.slice()},i.range=function(t){return arguments.length?(n=Array.from(t),r=Math.min(e.length,n.length-1),i):n.slice()},i.invertExtent=function(t){var r=n.indexOf(t);return[e[r-1],e[r]]},i.unknown=function(e){return arguments.length?(t=e,i):t},i.copy=function(){return db().domain(e).range(n).unknown(t)},Sv.apply(i,arguments)}const mb=1e3,yb=6e4,gb=36e5,vb=864e5,bb=6048e5,_b=31536e6,wb=new Date,xb=new Date;function kb(t,e,n,r){function i(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return i.floor=e=>(t(e=new Date(+e)),e),i.ceil=n=>(t(n=new Date(n-1)),e(n,1),t(n),n),i.round=t=>{const e=i(t),n=i.ceil(t);return t-e(e(t=new Date(+t),null==n?1:Math.floor(n)),t),i.range=(n,r,o)=>{const a=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n0))return a;let s;do{a.push(s=new Date(+n)),e(n,o),t(n)}while(skb((e=>{if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)}),((t,r)=>{if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););})),n&&(i.count=(e,r)=>(wb.setTime(+e),xb.setTime(+r),t(wb),t(xb),Math.floor(n(wb,xb))),i.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?e=>r(e)%t==0:e=>i.count(0,e)%t==0):i:null)),i}const Ob=kb((()=>{}),((t,e)=>{t.setTime(+t+e)}),((t,e)=>e-t));Ob.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?kb((e=>{e.setTime(Math.floor(e/t)*t)}),((e,n)=>{e.setTime(+e+n*t)}),((e,n)=>(n-e)/t)):Ob:null);const Sb=Ob.range,Eb=kb((t=>{t.setTime(t-t.getMilliseconds())}),((t,e)=>{t.setTime(+t+e*mb)}),((t,e)=>(e-t)/mb),(t=>t.getUTCSeconds())),Ab=Eb.range,Tb=kb((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mb)}),((t,e)=>{t.setTime(+t+e*yb)}),((t,e)=>(e-t)/yb),(t=>t.getMinutes())),Nb=Tb.range,Mb=kb((t=>{t.setUTCSeconds(0,0)}),((t,e)=>{t.setTime(+t+e*yb)}),((t,e)=>(e-t)/yb),(t=>t.getUTCMinutes())),Cb=Mb.range,jb=kb((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mb-t.getMinutes()*yb)}),((t,e)=>{t.setTime(+t+e*gb)}),((t,e)=>(e-t)/gb),(t=>t.getHours())),Pb=jb.range,Lb=kb((t=>{t.setUTCMinutes(0,0,0)}),((t,e)=>{t.setTime(+t+e*gb)}),((t,e)=>(e-t)/gb),(t=>t.getUTCHours())),Ib=Lb.range,Db=kb((t=>t.setHours(0,0,0,0)),((t,e)=>t.setDate(t.getDate()+e)),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*yb)/vb),(t=>t.getDate()-1)),Rb=Db.range,Bb=kb((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/vb),(t=>t.getUTCDate()-1)),Fb=Bb.range,$b=kb((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/vb),(t=>Math.floor(t/vb))),qb=$b.range;function Ub(t){return kb((e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),((t,e)=>{t.setDate(t.getDate()+7*e)}),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*yb)/bb))}const Kb=Ub(0),zb=Ub(1),Vb=Ub(2),Yb=Ub(3),Hb=Ub(4),Wb=Ub(5),Gb=Ub(6),Jb=Kb.range,Xb=zb.range,Qb=Vb.range,Zb=Yb.range,t_=Hb.range,e_=Wb.range,n_=Gb.range;function r_(t){return kb((e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+7*e)}),((t,e)=>(e-t)/bb))}const i_=r_(0),o_=r_(1),a_=r_(2),s_=r_(3),u_=r_(4),c_=r_(5),l_=r_(6),f_=i_.range,h_=o_.range,p_=a_.range,d_=s_.range,m_=u_.range,y_=c_.range,g_=l_.range,v_=kb((t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,e)=>{t.setMonth(t.getMonth()+e)}),((t,e)=>e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())),(t=>t.getMonth())),b_=v_.range,__=kb((t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)}),((t,e)=>e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())),(t=>t.getUTCMonth())),w_=__.range,x_=kb((t=>{t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,e)=>{t.setFullYear(t.getFullYear()+e)}),((t,e)=>e.getFullYear()-t.getFullYear()),(t=>t.getFullYear()));x_.every=t=>isFinite(t=Math.floor(t))&&t>0?kb((e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,n)=>{e.setFullYear(e.getFullYear()+n*t)})):null;const k_=x_.range,O_=kb((t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)}),((t,e)=>e.getUTCFullYear()-t.getUTCFullYear()),(t=>t.getUTCFullYear()));O_.every=t=>isFinite(t=Math.floor(t))&&t>0?kb((e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null;const S_=O_.range;function E_(t,e,n,r,i,o){const a=[[Eb,1,mb],[Eb,5,5e3],[Eb,15,15e3],[Eb,30,3e4],[o,1,yb],[o,5,3e5],[o,15,9e5],[o,30,18e5],[i,1,gb],[i,3,108e5],[i,6,216e5],[i,12,432e5],[r,1,vb],[r,2,1728e5],[n,1,bb],[e,1,2592e6],[e,3,7776e6],[t,1,_b]];function s(e,n,r){const i=Math.abs(n-e)/r,o=Q((([,,t])=>t)).right(a,i);if(o===a.length)return t.every(re(e/_b,n/_b,r));if(0===o)return Ob.every(Math.max(re(e,n,r),1));const[s,u]=a[i/a[o-1][2]=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:ex,s:nx,S:xw,u:kw,U:Ow,V:Ew,w:Aw,W:Tw,x:null,X:null,y:Nw,Y:Cw,Z:Pw,"%":tx},_={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return u[t.getUTCMonth()]},B:function(t){return s[t.getUTCMonth()]},c:null,d:Lw,e:Lw,f:Fw,g:Jw,G:Qw,H:Iw,I:Dw,j:Rw,L:Bw,m:$w,M:qw,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:ex,s:nx,S:Uw,u:Kw,U:zw,V:Yw,w:Hw,W:Ww,x:null,X:null,y:Gw,Y:Xw,Z:Zw,"%":tx},w={a:function(t,e,n){var r=p.exec(e.slice(n));return r?(t.w=d.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(t,e,n){var r=f.exec(e.slice(n));return r?(t.w=h.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(t,e,n){var r=g.exec(e.slice(n));return r?(t.m=v.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(t,e,n){var r=m.exec(e.slice(n));return r?(t.m=y.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(t,n,r){return O(t,e,n,r)},d:iw,e:iw,f:lw,g:tw,G:Z_,H:aw,I:aw,j:ow,L:cw,m:rw,M:sw,p:function(t,e,n){var r=c.exec(e.slice(n));return r?(t.p=l.get(r[0].toLowerCase()),n+r[0].length):-1},q:nw,Q:hw,s:pw,S:uw,u:G_,U:J_,V:X_,w:W_,W:Q_,x:function(t,e,r){return O(t,n,e,r)},X:function(t,e,n){return O(t,r,e,n)},y:tw,Y:Z_,Z:ew,"%":fw};function x(t,e){return function(n){var r,i,o,a=[],s=-1,u=0,c=t.length;for(n instanceof Date||(n=new Date(+n));++s53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=j_(P_(o.y,0,1))).getUTCDay(),r=i>4||0===i?o_.ceil(r):o_(r),r=Bb.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=C_(P_(o.y,0,1))).getDay(),r=i>4||0===i?zb.ceil(r):zb(r),r=Db.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?j_(P_(o.y,0,1)).getUTCDay():C_(P_(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,j_(o)):C_(o)}}function O(t,e,n,r){for(var i,o,a=0,s=e.length,u=n.length;a=u)return-1;if(37===(i=e.charCodeAt(a++))){if(i=e.charAt(a++),!(o=w[i in $_?e.charAt(a++):i])||(r=o(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=x(n,b),b.X=x(r,b),b.c=x(e,b),_.x=x(n,_),_.X=x(r,_),_.c=x(e,_),{format:function(t){var e=x(t+="",b);return e.toString=function(){return t},e},parse:function(t){var e=k(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=x(t+="",_);return e.toString=function(){return t},e},utcParse:function(t){var e=k(t+="",!0);return e.toString=function(){return t},e}}}var I_,D_,R_,B_,F_,$_={"-":"",_:" ",0:"0"},q_=/^\s*\d+/,U_=/^%/,K_=/[\\^$*+?|[\]().{}]/g;function z_(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o[t.toLowerCase(),e])))}function W_(t,e,n){var r=q_.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function G_(t,e,n){var r=q_.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function J_(t,e,n){var r=q_.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function X_(t,e,n){var r=q_.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Q_(t,e,n){var r=q_.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function Z_(t,e,n){var r=q_.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function tw(t,e,n){var r=q_.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function ew(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function nw(t,e,n){var r=q_.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function rw(t,e,n){var r=q_.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function iw(t,e,n){var r=q_.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function ow(t,e,n){var r=q_.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function aw(t,e,n){var r=q_.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function sw(t,e,n){var r=q_.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function uw(t,e,n){var r=q_.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function cw(t,e,n){var r=q_.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function lw(t,e,n){var r=q_.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function fw(t,e,n){var r=U_.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function hw(t,e,n){var r=q_.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function pw(t,e,n){var r=q_.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function dw(t,e){return z_(t.getDate(),e,2)}function mw(t,e){return z_(t.getHours(),e,2)}function yw(t,e){return z_(t.getHours()%12||12,e,2)}function gw(t,e){return z_(1+Db.count(x_(t),t),e,3)}function vw(t,e){return z_(t.getMilliseconds(),e,3)}function bw(t,e){return vw(t,e)+"000"}function _w(t,e){return z_(t.getMonth()+1,e,2)}function ww(t,e){return z_(t.getMinutes(),e,2)}function xw(t,e){return z_(t.getSeconds(),e,2)}function kw(t){var e=t.getDay();return 0===e?7:e}function Ow(t,e){return z_(Kb.count(x_(t)-1,t),e,2)}function Sw(t){var e=t.getDay();return e>=4||0===e?Hb(t):Hb.ceil(t)}function Ew(t,e){return t=Sw(t),z_(Hb.count(x_(t),t)+(4===x_(t).getDay()),e,2)}function Aw(t){return t.getDay()}function Tw(t,e){return z_(zb.count(x_(t)-1,t),e,2)}function Nw(t,e){return z_(t.getFullYear()%100,e,2)}function Mw(t,e){return z_((t=Sw(t)).getFullYear()%100,e,2)}function Cw(t,e){return z_(t.getFullYear()%1e4,e,4)}function jw(t,e){var n=t.getDay();return z_((t=n>=4||0===n?Hb(t):Hb.ceil(t)).getFullYear()%1e4,e,4)}function Pw(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+z_(e/60|0,"0",2)+z_(e%60,"0",2)}function Lw(t,e){return z_(t.getUTCDate(),e,2)}function Iw(t,e){return z_(t.getUTCHours(),e,2)}function Dw(t,e){return z_(t.getUTCHours()%12||12,e,2)}function Rw(t,e){return z_(1+Bb.count(O_(t),t),e,3)}function Bw(t,e){return z_(t.getUTCMilliseconds(),e,3)}function Fw(t,e){return Bw(t,e)+"000"}function $w(t,e){return z_(t.getUTCMonth()+1,e,2)}function qw(t,e){return z_(t.getUTCMinutes(),e,2)}function Uw(t,e){return z_(t.getUTCSeconds(),e,2)}function Kw(t){var e=t.getUTCDay();return 0===e?7:e}function zw(t,e){return z_(i_.count(O_(t)-1,t),e,2)}function Vw(t){var e=t.getUTCDay();return e>=4||0===e?u_(t):u_.ceil(t)}function Yw(t,e){return t=Vw(t),z_(u_.count(O_(t),t)+(4===O_(t).getUTCDay()),e,2)}function Hw(t){return t.getUTCDay()}function Ww(t,e){return z_(o_.count(O_(t)-1,t),e,2)}function Gw(t,e){return z_(t.getUTCFullYear()%100,e,2)}function Jw(t,e){return z_((t=Vw(t)).getUTCFullYear()%100,e,2)}function Xw(t,e){return z_(t.getUTCFullYear()%1e4,e,4)}function Qw(t,e){var n=t.getUTCDay();return z_((t=n>=4||0===n?u_(t):u_.ceil(t)).getUTCFullYear()%1e4,e,4)}function Zw(){return"+0000"}function tx(){return"%"}function ex(t){return+t}function nx(t){return Math.floor(+t/1e3)}function rx(t){return I_=L_(t),D_=I_.format,R_=I_.parse,B_=I_.utcFormat,F_=I_.utcParse,I_}function ix(t){return new Date(t)}function ox(t){return t instanceof Date?+t:+new Date(+t)}function ax(t,e,n,r,i,o,a,s,u,c){var l=$v(),f=l.invert,h=l.domain,p=c(".%L"),d=c(":%S"),m=c("%I:%M"),y=c("%I %p"),g=c("%a %d"),v=c("%b %d"),b=c("%B"),_=c("%Y");function w(t){return(u(t)e(r/(t.length-1))))},n.quantiles=function(e){return Array.from({length:e+1},((n,r)=>de(t,r/e)))},n.copy=function(){return yx(e).domain(t)},Ev.apply(n,arguments)}function gx(){var t,e,n,r,i,o,a,s=0,u=.5,c=1,l=1,f=Lv,h=!1;function p(t){return isNaN(t=+t)?a:(t=.5+((t=+o(t))-e)*(l*tji(t[t.length-1]);var Dx=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(kx);const Rx=Ix(Dx);var Bx=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(kx);const Fx=Ix(Bx);var $x=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(kx);const qx=Ix($x);var Ux=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(kx);const Kx=Ix(Ux);var zx=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(kx);const Vx=Ix(zx);var Yx=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(kx);const Hx=Ix(Yx);var Wx=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(kx);const Gx=Ix(Wx);var Jx=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(kx);const Xx=Ix(Jx);var Qx=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(kx);const Zx=Ix(Qx);var tk=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(kx);const ek=Ix(tk);var nk=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(kx);const rk=Ix(nk);var ik=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(kx);const ok=Ix(ik);var ak=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(kx);const sk=Ix(ak);var uk=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(kx);const ck=Ix(uk);var lk=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(kx);const fk=Ix(lk);var hk=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(kx);const pk=Ix(hk);var dk=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(kx);const mk=Ix(dk);var yk=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(kx);const gk=Ix(yk);var vk=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(kx);const bk=Ix(vk);var _k=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(kx);const wk=Ix(_k);var xk=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(kx);const kk=Ix(xk);var Ok=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(kx);const Sk=Ix(Ok);var Ek=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(kx);const Ak=Ix(Ek);var Tk=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(kx);const Nk=Ix(Tk);var Mk=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(kx);const Ck=Ix(Mk);var jk=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(kx);const Pk=Ix(jk);var Lk=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(kx);const Ik=Ix(Lk);function Dk(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"}const Rk=Yg(Gs(300,.5,0),Gs(-240,.5,1));var Bk=Yg(Gs(-100,.75,.35),Gs(80,1.5,.8)),Fk=Yg(Gs(260,.75,.35),Gs(80,1.5,.8)),$k=Gs();function qk(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return $k.h=360*t-100,$k.s=1.5-1.5*e,$k.l=.8-.9*e,$k+""}var Uk=ci(),Kk=Math.PI/3,zk=2*Math.PI/3;function Vk(t){var e;return t=(.5-t)*Math.PI,Uk.r=255*(e=Math.sin(t))*e,Uk.g=255*(e=Math.sin(t+Kk))*e,Uk.b=255*(e=Math.sin(t+zk))*e,Uk+""}function Yk(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"}function Hk(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}const Wk=Hk(kx("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var Gk=Hk(kx("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Jk=Hk(kx("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),Xk=Hk(kx("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function Qk(t){return Lr(_r(t).call(document.documentElement))}var Zk=0;function tO(){return new eO}function eO(){this._="@"+(++Zk).toString(36)}function nO(t,e){return t.target&&(t=Vi(t),void 0===e&&(e=t.currentTarget),t=t.touches||[t]),Array.from(t,(t=>Yi(t,e)))}function rO(t){return"string"==typeof t?new Cr([document.querySelectorAll(t)],[document.documentElement]):new Cr([kn(t)],Mr)}function iO(t){return function(){return t}}eO.prototype=tO.prototype={constructor:eO,get:function(t){for(var e=this._;!(e in t);)if(!(t=t.parentNode))return;return t[e]},set:function(t,e){return t[this._]=e},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};const oO=Math.abs,aO=Math.atan2,sO=Math.cos,uO=Math.max,cO=Math.min,lO=Math.sin,fO=Math.sqrt,hO=1e-12,pO=Math.PI,dO=pO/2,mO=2*pO;function yO(t){return t>=1?dO:t<=-1?-dO:Math.asin(t)}function gO(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{const t=Math.floor(n);if(!(t>=0))throw new RangeError(`invalid digits: ${n}`);e=t}return t},()=>new is(e)}function vO(t){return t.innerRadius}function bO(t){return t.outerRadius}function _O(t){return t.startAngle}function wO(t){return t.endAngle}function xO(t){return t&&t.padAngle}function kO(t,e,n,r,i,o,a){var s=t-n,u=e-r,c=(a?o:-o)/fO(s*s+u*u),l=c*u,f=-c*s,h=t+l,p=e+f,d=n+l,m=r+f,y=(h+d)/2,g=(p+m)/2,v=d-h,b=m-p,_=v*v+b*b,w=i-o,x=h*m-d*p,k=(b<0?-1:1)*fO(uO(0,w*w*_-x*x)),O=(x*b-v*k)/_,S=(-x*v-b*k)/_,E=(x*b+v*k)/_,A=(-x*v+b*k)/_,T=O-y,N=S-g,M=E-y,C=A-g;return T*T+N*N>M*M+C*C&&(O=E,S=A),{cx:O,cy:S,x01:-l,y01:-f,x11:O*(i/w-1),y11:S*(i/w-1)}}function OO(){var t=vO,e=bO,n=iO(0),r=null,i=_O,o=wO,a=xO,s=null,u=gO(c);function c(){var c,l,f,h=+t.apply(this,arguments),p=+e.apply(this,arguments),d=i.apply(this,arguments)-dO,m=o.apply(this,arguments)-dO,y=oO(m-d),g=m>d;if(s||(s=c=u()),phO)if(y>mO-hO)s.moveTo(p*sO(d),p*lO(d)),s.arc(0,0,p,d,m,!g),h>hO&&(s.moveTo(h*sO(m),h*lO(m)),s.arc(0,0,h,m,d,g));else{var v,b,_=d,w=m,x=d,k=m,O=y,S=y,E=a.apply(this,arguments)/2,A=E>hO&&(r?+r.apply(this,arguments):fO(h*h+p*p)),T=cO(oO(p-h)/2,+n.apply(this,arguments)),N=T,M=T;if(A>hO){var C=yO(A/h*lO(E)),j=yO(A/p*lO(E));(O-=2*C)>hO?(x+=C*=g?1:-1,k-=C):(O=0,x=k=(d+m)/2),(S-=2*j)>hO?(_+=j*=g?1:-1,w-=j):(S=0,_=w=(d+m)/2)}var P=p*sO(_),L=p*lO(_),I=h*sO(k),D=h*lO(k);if(T>hO){var R,B=p*sO(w),F=p*lO(w),$=h*sO(x),q=h*lO(x);if(y1?0:f<-1?pO:Math.acos(f))/2),H=fO(R[0]*R[0]+R[1]*R[1]);N=cO(T,(h-H)/(Y-1)),M=cO(T,(p-H)/(Y+1))}else N=M=0}S>hO?M>hO?(v=kO($,q,P,L,p,M,g),b=kO(B,F,I,D,p,M,g),s.moveTo(v.cx+v.x01,v.cy+v.y01),MhO&&O>hO?N>hO?(v=kO(I,D,B,F,h,-N,g),b=kO(P,L,$,q,h,-N,g),s.lineTo(v.cx+v.x01,v.cy+v.y01),N=f;--h)s.point(g[h],v[h]);s.lineEnd(),s.areaEnd()}y&&(g[l]=+t(p,l,c),v[l]=+e(p,l,c),s.point(r?+r(p,l,c):g[l],n?+n(p,l,c):v[l]))}if(d)return s=null,d+""||null}function l(){return CO().defined(i).curve(a).context(o)}return t="function"==typeof t?t:void 0===t?NO:iO(+t),e="function"==typeof e?e:iO(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?MO:iO(+n),c.x=function(e){return arguments.length?(t="function"==typeof e?e:iO(+e),r=null,c):t},c.x0=function(e){return arguments.length?(t="function"==typeof e?e:iO(+e),c):t},c.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:iO(+t),c):r},c.y=function(t){return arguments.length?(e="function"==typeof t?t:iO(+t),n=null,c):e},c.y0=function(t){return arguments.length?(e="function"==typeof t?t:iO(+t),c):e},c.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:iO(+t),c):n},c.lineX0=c.lineY0=function(){return l().x(t).y(e)},c.lineY1=function(){return l().x(t).y(n)},c.lineX1=function(){return l().x(r).y(e)},c.defined=function(t){return arguments.length?(i="function"==typeof t?t:iO(!!t),c):i},c.curve=function(t){return arguments.length?(a=t,null!=o&&(s=a(o)),c):a},c.context=function(t){return arguments.length?(null==t?o=s=null:s=a(o=t),c):o},c}function PO(t,e){return et?1:e>=t?0:NaN}function LO(t){return t}function IO(){var t=LO,e=PO,n=null,r=iO(0),i=iO(mO),o=iO(0);function a(a){var s,u,c,l,f,h=(a=EO(a)).length,p=0,d=new Array(h),m=new Array(h),y=+r.apply(this,arguments),g=Math.min(mO,Math.max(-mO,i.apply(this,arguments)-y)),v=Math.min(Math.abs(g)/h,o.apply(this,arguments)),b=v*(g<0?-1:1);for(s=0;s0&&(p+=f);for(null!=e?d.sort((function(t,n){return e(m[t],m[n])})):null!=n&&d.sort((function(t,e){return n(a[t],a[e])})),s=0,c=p?(g-h*b)/p:0;s0?f*c:0)+b,m[u]={data:a[u],index:s,value:f,startAngle:y,endAngle:l,padAngle:v};return m}return a.value=function(e){return arguments.length?(t="function"==typeof e?e:iO(+e),a):t},a.sortValues=function(t){return arguments.length?(e=t,n=null,a):e},a.sort=function(t){return arguments.length?(n=t,e=null,a):n},a.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:iO(+t),a):r},a.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:iO(+t),a):i},a.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:iO(+t),a):o},a}AO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var DO=BO(TO);function RO(t){this._curve=t}function BO(t){function e(e){return new RO(t(e))}return e._curve=t,e}function FO(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(BO(t)):e()._curve},t}function $O(){return FO(CO().curve(DO))}function qO(){var t=jO().curve(DO),e=t.curve,n=t.lineX0,r=t.lineX1,i=t.lineY0,o=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return FO(n())},delete t.lineX0,t.lineEndAngle=function(){return FO(r())},delete t.lineX1,t.lineInnerRadius=function(){return FO(i())},delete t.lineY0,t.lineOuterRadius=function(){return FO(o())},delete t.lineY1,t.curve=function(t){return arguments.length?e(BO(t)):e()._curve},t}function UO(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}RO.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};class KO{constructor(t,e){this._context=t,this._x=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,e,t,e):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+e)/2,t,this._y0,t,e)}this._x0=t,this._y0=e}}class zO{constructor(t){this._context=t}lineStart(){this._point=0}lineEnd(){}point(t,e){if(t=+t,e=+e,0===this._point)this._point=1;else{const n=UO(this._x0,this._y0),r=UO(this._x0,this._y0=(this._y0+e)/2),i=UO(t,this._y0),o=UO(t,e);this._context.moveTo(...n),this._context.bezierCurveTo(...r,...i,...o)}this._x0=t,this._y0=e}}function VO(t){return new KO(t,!0)}function YO(t){return new KO(t,!1)}function HO(t){return new zO(t)}function WO(t){return t.source}function GO(t){return t.target}function JO(t){let e=WO,n=GO,r=NO,i=MO,o=null,a=null,s=gO(u);function u(){let u;const c=SO.call(arguments),l=e.apply(this,c),f=n.apply(this,c);if(null==o&&(a=t(u=s())),a.lineStart(),c[0]=l,a.point(+r.apply(this,c),+i.apply(this,c)),c[0]=f,a.point(+r.apply(this,c),+i.apply(this,c)),a.lineEnd(),u)return a=null,u+""||null}return u.source=function(t){return arguments.length?(e=t,u):e},u.target=function(t){return arguments.length?(n=t,u):n},u.x=function(t){return arguments.length?(r="function"==typeof t?t:iO(+t),u):r},u.y=function(t){return arguments.length?(i="function"==typeof t?t:iO(+t),u):i},u.context=function(e){return arguments.length?(null==e?o=a=null:a=t(o=e),u):o},u}function XO(){return JO(VO)}function QO(){return JO(YO)}function ZO(){const t=JO(HO);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t}const tS=fO(3),eS={draw(t,e){const n=.59436*fO(e+cO(e/28,.75)),r=n/2,i=r*tS;t.moveTo(0,n),t.lineTo(0,-n),t.moveTo(-i,-r),t.lineTo(i,r),t.moveTo(-i,r),t.lineTo(i,-r)}},nS={draw(t,e){const n=fO(e/pO);t.moveTo(n,0),t.arc(0,0,n,0,mO)}},rS={draw(t,e){const n=fO(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},iS=fO(1/3),oS=2*iS,aS={draw(t,e){const n=fO(e/oS),r=n*iS;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},sS={draw(t,e){const n=.62625*fO(e);t.moveTo(0,-n),t.lineTo(n,0),t.lineTo(0,n),t.lineTo(-n,0),t.closePath()}},uS={draw(t,e){const n=.87559*fO(e-cO(e/7,2));t.moveTo(-n,0),t.lineTo(n,0),t.moveTo(0,n),t.lineTo(0,-n)}},cS={draw(t,e){const n=fO(e),r=-n/2;t.rect(r,r,n,n)}},lS={draw(t,e){const n=.4431*fO(e);t.moveTo(n,n),t.lineTo(n,-n),t.lineTo(-n,-n),t.lineTo(-n,n),t.closePath()}},fS=lO(pO/10)/lO(7*pO/10),hS=lO(mO/10)*fS,pS=-sO(mO/10)*fS,dS={draw(t,e){const n=fO(.8908130915292852*e),r=hS*n,i=pS*n;t.moveTo(0,-n),t.lineTo(r,i);for(let e=1;e<5;++e){const o=mO*e/5,a=sO(o),s=lO(o);t.lineTo(s*n,-a*n),t.lineTo(a*r-s*i,s*r+a*i)}t.closePath()}},mS=fO(3),yS={draw(t,e){const n=-fO(e/(3*mS));t.moveTo(0,2*n),t.lineTo(-mS*n,-n),t.lineTo(mS*n,-n),t.closePath()}},gS=fO(3),vS={draw(t,e){const n=.6824*fO(e),r=n/2,i=n*gS/2;t.moveTo(0,-n),t.lineTo(i,r),t.lineTo(-i,r),t.closePath()}},bS=-.5,_S=fO(3)/2,wS=1/fO(12),xS=3*(wS/2+1),kS={draw(t,e){const n=fO(e/xS),r=n/2,i=n*wS,o=r,a=n*wS+n,s=-o,u=a;t.moveTo(r,i),t.lineTo(o,a),t.lineTo(s,u),t.lineTo(bS*r-_S*i,_S*r+bS*i),t.lineTo(bS*o-_S*a,_S*o+bS*a),t.lineTo(bS*s-_S*u,_S*s+bS*u),t.lineTo(bS*r+_S*i,bS*i-_S*r),t.lineTo(bS*o+_S*a,bS*a-_S*o),t.lineTo(bS*s+_S*u,bS*u-_S*s),t.closePath()}},OS={draw(t,e){const n=.6189*fO(e-cO(e/6,1.7));t.moveTo(-n,-n),t.lineTo(n,n),t.moveTo(-n,n),t.lineTo(n,-n)}},SS=[nS,rS,aS,cS,dS,yS,kS],ES=[nS,uS,OS,vS,eS,lS,sS];function AS(t,e){let n=null,r=gO(i);function i(){let i;if(n||(n=i=r()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),i)return n=null,i+""||null}return t="function"==typeof t?t:iO(t||nS),e="function"==typeof e?e:iO(void 0===e?64:+e),i.type=function(e){return arguments.length?(t="function"==typeof e?e:iO(e),i):t},i.size=function(t){return arguments.length?(e="function"==typeof t?t:iO(+t),i):e},i.context=function(t){return arguments.length?(n=null==t?null:t,i):n},i}function TS(){}function NS(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function MS(t){this._context=t}function CS(t){return new MS(t)}function jS(t){this._context=t}function PS(t){return new jS(t)}function LS(t){this._context=t}function IS(t){return new LS(t)}function DS(t,e){this._basis=new MS(t),this._beta=e}MS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:NS(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:NS(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},jS.prototype={areaStart:TS,areaEnd:TS,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:NS(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},LS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:NS(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},DS.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r,i=t[0],o=e[0],a=t[n]-i,s=e[n]-o,u=-1;++u<=n;)r=u/n,this._basis.point(this._beta*t[u]+(1-this._beta)*(i+r*a),this._beta*e[u]+(1-this._beta)*(o+r*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const RS=function t(e){function n(t){return 1===e?new MS(t):new DS(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function BS(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function FS(t,e){this._context=t,this._k=(1-e)/6}FS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:BS(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:BS(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const $S=function t(e){function n(t){return new FS(t,e)}return n.tension=function(e){return t(+e)},n}(0);function qS(t,e){this._context=t,this._k=(1-e)/6}qS.prototype={areaStart:TS,areaEnd:TS,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:BS(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const US=function t(e){function n(t){return new qS(t,e)}return n.tension=function(e){return t(+e)},n}(0);function KS(t,e){this._context=t,this._k=(1-e)/6}KS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:BS(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const zS=function t(e){function n(t){return new KS(t,e)}return n.tension=function(e){return t(+e)},n}(0);function VS(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>hO){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,u=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/u,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/u}if(t._l23_a>hO){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,l=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*c+t._x1*t._l23_2a-e*t._l12_2a)/l,a=(a*c+t._y1*t._l23_2a-n*t._l12_2a)/l}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function YS(t,e){this._context=t,this._alpha=e}YS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:VS(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const HS=function t(e){function n(t){return e?new YS(t,e):new FS(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function WS(t,e){this._context=t,this._alpha=e}WS.prototype={areaStart:TS,areaEnd:TS,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:VS(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const GS=function t(e){function n(t){return e?new WS(t,e):new qS(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function JS(t,e){this._context=t,this._alpha=e}JS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:VS(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const XS=function t(e){function n(t){return e?new JS(t,e):new KS(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function QS(t){this._context=t}function ZS(t){return new QS(t)}function tE(t){return t<0?-1:1}function eE(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(tE(o)+tE(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function nE(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function rE(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,s=(o-r)/3;t._context.bezierCurveTo(r+s,i+s*e,o-s,a-s*n,o,a)}function iE(t){this._context=t}function oE(t){this._context=new aE(t)}function aE(t){this._context=t}function sE(t){return new iE(t)}function uE(t){return new oE(t)}function cE(t){this._context=t}function lE(t){var e,n,r=t.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=t[0]+2*t[1],e=1;e=0;--e)i[e]=(a[e]-i[e+1])/o[e];for(o[r-1]=(t[r]+i[r-1])/2,e=0;e1)for(var n,r,i,o=1,a=t[e[0]],s=a.length;o=0;)n[e]=e;return n}function vE(t,e){return t[e]}function bE(t){const e=[];return e.key=t,e}function _E(){var t=iO([]),e=gE,n=yE,r=vE;function i(i){var o,a,s=Array.from(t.apply(this,arguments),bE),u=s.length,c=-1;for(const t of i)for(o=0,++c;o0){for(var n,r,i,o=0,a=t[0].length;o0)for(var n,r,i,o,a,s,u=0,c=t[e[0]].length;u0?(r[0]=o,r[1]=o+=i):i<0?(r[1]=a,r[0]=a+=i):(r[0]=0,r[1]=i)}function kE(t,e){if((n=t.length)>0){for(var n,r=0,i=t[e[0]],o=i.length;r0&&(r=(n=t[e[0]]).length)>0){for(var n,r,i,o=0,a=1;ao&&(o=e,r=n);return r}function AE(t){var e=t.map(TE);return gE(t).sort((function(t,n){return e[t]-e[n]}))}function TE(t){for(var e,n=0,r=-1,i=t.length;++r=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var jE="%Y-%m-%dT%H:%M:%S.%LZ",PE=Date.prototype.toISOString?function(t){return t.toISOString()}:B_(jE);const LE=PE;var IE=+new Date("2000-01-01T00:00:00.000Z")?function(t){var e=new Date(t);return isNaN(e)?null:e}:F_(jE);const DE=IE;function RE(t,e,n){var r=new ao,i=e;return null==e?(r.restart(t,e,n),r):(r._restart=r.restart,r.restart=function(t,e,n){e=+e,n=null==n?io():+n,r._restart((function o(a){a+=i,r._restart(o,i+=e,n),t(a)}),e,n)},r.restart(t,e,n),r)}const BE=t=>()=>t;function FE(t,{sourceEvent:e,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function $E(t,e,n){this.k=t,this.x=e,this.y=n}$E.prototype={constructor:$E,scale:function(t){return 1===t?this:new $E(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new $E(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var qE=new $E(1,0,0);function UE(t){for(;!t.__zoom;)if(!(t=t.parentNode))return qE;return t.__zoom}function KE(t){t.stopImmediatePropagation()}function zE(t){t.preventDefault(),t.stopImmediatePropagation()}function VE(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function YE(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function HE(){return this.__zoom||qE}function WE(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function GE(){return navigator.maxTouchPoints||"ontouchstart"in this}function JE(t,e,n){var r=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],o=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}function XE(){var t,e,n,r=VE,i=YE,o=JE,a=WE,s=GE,u=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],l=250,f=Dg,h=_n("start","zoom","end"),p=500,d=150,m=0,y=10;function g(t){t.property("__zoom",HE).on("wheel.zoom",O,{passive:!1}).on("mousedown.zoom",S).on("dblclick.zoom",E).filter(s).on("touchstart.zoom",A).on("touchmove.zoom",T).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(t,e){return(e=Math.max(u[0],Math.min(u[1],e)))===t.k?t:new $E(e,t.x,t.y)}function b(t,e,n){var r=e[0]-n[0]*t.k,i=e[1]-n[1]*t.k;return r===t.x&&i===t.y?t:new $E(t.k,r,i)}function _(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function w(t,e,n,r){t.on("start.zoom",(function(){x(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){x(this,arguments).event(r).end()})).tween("zoom",(function(){var t=this,o=arguments,a=x(t,o).event(r),s=i.apply(t,o),u=null==n?_(s):"function"==typeof n?n.apply(t,o):n,c=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),l=t.__zoom,h="function"==typeof e?e.apply(t,o):e,p=f(l.invert(u).concat(c/l.k),h.invert(u).concat(c/h.k));return function(t){if(1===t)t=h;else{var e=p(t),n=c/e[2];t=new $E(n,u[0]-e[0]*n,u[1]-e[1]*n)}a.zoom(null,t)}}))}function x(t,e,n){return!n&&t.__zooming||new k(t,e)}function k(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=i.apply(t,e),this.taps=0}function O(t,...e){if(r.apply(this,arguments)){var n=x(this,e).event(t),i=this.__zoom,s=Math.max(u[0],Math.min(u[1],i.k*Math.pow(2,a.apply(this,arguments)))),l=Yi(t);if(n.wheel)n.mouse[0][0]===l[0]&&n.mouse[0][1]===l[1]||(n.mouse[1]=i.invert(n.mouse[0]=l)),clearTimeout(n.wheel);else{if(i.k===s)return;n.mouse=[l,i.invert(l)],Eo(this),n.start()}zE(t),n.wheel=setTimeout((function(){n.wheel=null,n.end()}),d),n.zoom("mouse",o(b(v(i,s),n.mouse[0],n.mouse[1]),n.extent,c))}}function S(t,...e){if(!n&&r.apply(this,arguments)){var i=t.currentTarget,a=x(this,e,!0).event(t),s=Lr(t.view).on("mousemove.zoom",(function(t){if(zE(t),!a.moved){var e=t.clientX-l,n=t.clientY-f;a.moved=e*e+n*n>m}a.event(t).zoom("mouse",o(b(a.that.__zoom,a.mouse[0]=Yi(t,i),a.mouse[1]),a.extent,c))}),!0).on("mouseup.zoom",(function(t){s.on("mousemove.zoom mouseup.zoom",null),$r(t.view,a.moved),zE(t),a.event(t).end()}),!0),u=Yi(t,i),l=t.clientX,f=t.clientY;Fr(t.view),KE(t),a.mouse=[u,this.__zoom.invert(u)],Eo(this),a.start()}}function E(t,...e){if(r.apply(this,arguments)){var n=this.__zoom,a=Yi(t.changedTouches?t.changedTouches[0]:t,this),s=n.invert(a),u=n.k*(t.shiftKey?.5:2),f=o(b(v(n,u),a,s),i.apply(this,e),c);zE(t),l>0?Lr(this).transition().duration(l).call(w,f,a,t):Lr(this).call(g.transform,f,a,t)}}function A(n,...i){if(r.apply(this,arguments)){var o,a,s,u,c=n.touches,l=c.length,f=x(this,i,n.changedTouches.length===l).event(n);for(KE(n),a=0;a g").attr("transform","".concat(i," ").concat(o))}},{key:"getSourcesId",value:function(t){return this.pluginData.scene.selection.includes(t.subject.datum().data.id)?this.pluginData.scene.selection:[t.subject.datum().data.id]}},{key:"getSourcePosition",value:function(t){var e=this.viewport.select(".".concat(t," .model"));return{x:parseFloat(e.attr("x")),y:parseFloat(e.attr("y"))}}},{key:"getTargetsByDepth",value:function(t){var e=this,n=t.subject.datum().data.id,r=t.sourceEvent,i=r.clientX,o=r.clientY,a=[];return this.viewport.selectAll("g.component.container:not(.".concat(n,")")).each((function(t){var n=e.viewport.select(".".concat(t.data.id," .background")).node().getBoundingClientRect(),r=n.x,s=n.y,u=n.width,c=n.height;if(i>=r&&i<=r+u&&o>=s&&o<=s+c){for(var l=parseInt(e.viewport.select(".".concat(t.data.id)).attr("depth"),10)-1;a.length<=l;)a.push([]);a[l].push(t.data.id)}})),a}},{key:"getTargetsId",value:function(t){return this.getTargetsByDepth(t).flat().reverse()}},{key:"getTargetId",value:function(t){return this.getTargetsId(t)[0]}},{key:"getTransform",value:function(t,e){var n=this.viewport.select(t).node().getBoundingClientRect(),r=n.x,i=n.y,o=this.viewport.select(e).node().getBoundingClientRect();return{dx:r-o.x,dy:i-o.y}}}],e&&function(t,e){for(var n=0;nf?p:f),r.attr("height",d>h?d:h);var m=this.viewport.select(".".concat(e.data.id," .components-background")),y=m.node().getBoundingClientRect();return f=Math.max((a-y.x)/n,e.data.definition.minWidth-e.data.definition.reservedWidth),h=Math.max((s-y.y)/n,e.data.definition.minHeight-e.data.definition.reservedHeight),p=(c-y.x)/n,d=(l-y.y)/n,m.attr("width",p>f?p:f),m.attr("height",d>h?d:h),!1}},{key:"finalize",value:function(t){var e=t.subject.datum().data.id,n=this.viewport.select(".".concat(e," .model")),r=this.pluginData.getComponentById(e);return r.drawOption.width=parseFloat(n.attr("width")),r.drawOption.height=parseFloat(n.attr("height")),this.pluginData.emitEvent({components:[e],type:"Drawer",action:"resize",status:"success"}),!0}},{key:"getMaxPosition",value:function(t){var e=this,n=this.pluginData.getComponentById(t),r=0,i=0;return this.pluginData.getChildren(t).forEach((function(t){var o=e.viewport.select(".".concat(t.id," .model")).node().getBoundingClientRect(),a=o.x,s=o.y,u=o.width,c=o.height;r=Math.max(r,a+u+n.definition.margin),i=Math.max(i,s+c+n.definition.margin)})),{x:r,y:i}}}],r&&function(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=Array(e);nt.length)&&(e=t.length);for(var n=0,r=Array(e);n0,hasWarning:r>0,numberOfErrors:n,numberOfWarnings:r,hasX:!!t.drawOption.x,hasY:!!t.drawOption.y,isSelected:this.pluginData.scene.selection.includes(t.id),getIcon:function(t){return e.pluginData.resources.icons[t]},canHaveLink:this.pluginData.canHaveLink(t.definition.type),getAttribute:function(e){return t.attributes.find((function(t){return t.name===e}))}})}}],e&&function(t,e){for(var n=0;n0&&this.pluginData.emitEvent({components:o,type:"Drawer",action:"move",status:"success"}),a.length>0&&this.pluginData.emitEvent({components:a,type:"Drawer",action:"resize",status:"success"}),!0}},{key:"getNodes",value:function(){var t=this,e={id:"root",parent:null,children:[],depth:0,type:"default",isContainer:!0,margin:this.pluginData.configuration.rootContainer.margin,gap:this.pluginData.configuration.rootContainer.gap},n=new Map(this.pluginData.components.map((function(e){return[e.id,t.createNode(e)]})));return n.set("root",e),n.forEach((function(t){if(t.parent){var e=n.get(t.parent);t.parent=e,e.children.push(t)}})),n}},{key:"createNode",value:function(t){return{id:t.id,parent:t.getContainerId()||"root",type:t.definition.displayType||"default",direction:t.definition.workflowDirection,children:[],depth:this.pluginData.getComponentDepth(t.id)+1,isContainer:t.definition.isContainer,width:t.definition.defaultWidth,height:t.definition.defaultHeight,minWidth:t.definition.minWidth,minHeight:t.definition.minHeight,reservedWidth:t.definition.reservedWidth,reservedHeight:t.definition.reservedHeight,margin:t.definition.margin,gap:t.definition.gap,x:t.drawOption.x,y:t.drawOption.y}}},{key:"generateLayout",value:function(t,e,n){var r=this;e.children.forEach((function(e){r.generateLayout(t,e,n)})),e.isContainer&&"default"===e.type?this.generateDefaultLayout(e,n):e.isContainer&&this.generateWorkflowLayout(t,e)}},{key:"generateDefaultLayout",value:function(t,e){this.text=0;var n=[],r=[],i=t.margin,o=t.gap,a=t.minWidth,s=t.minHeight,u=t.reservedWidth,c=t.reservedHeight,l=0,f=0;t.children.forEach((function(t){t.x&&t.y&&e?(n.push(t),l=Math.max(t.x+t.width,l),f=Math.max(t.y+t.height,f)):r.push(t)}));for(var h,p=0,d=0,m=this.getPoints(p,i,o);r.length>0;)h||(h=r[0]),0===m.length&&(d=0,p+=1,m=this.getPoints(p,i,o)),m.length>0&&this.canBePlaced(n,h,m[d])&&(h.x=m[d].x,h.y=m[d].y,l=Math.max(h.x+h.width,l),f=Math.max(h.y+h.height,f),n.push(h),r.shift(),h=null),(d+=1)>=m.length&&(d=0,p+=1,m=this.getPoints(p,i,o));t.width=Math.max(l+i+u,a),t.height=Math.max(f+i+c,s)}},{key:"canBePlaced",value:function(t,e,n){return t.every((function(t){var r=t.x,i=t.y,o=t.width,a=t.height,s=n.x+e.widthr+o,c=n.y+e.heighti+a;return s||u||c||l}))}},{key:"getPoints",value:function(t,e,n){if(0===t)return[{x:e,y:e}];for(var r=e+n*t,i=e+n*t,o=[],a=e,s=e;s<=r&&(s!==r||i!==a);)o.push({x:s,y:i}),s+=n,o.push({x:r,y:a}),a+=n;return o.push({x:r,y:i}),o}},{key:"generateWorkflowLayout",value:function(t,e){"vertical"===e.direction?this.generateVerticalWorkflowLayout(t,e):this.generateHorizontalWorkflowLayout(t,e)}},{key:"generateHorizontalWorkflowLayout",value:function(t,e){var n=e.margin,r=e.gap,i=e.minWidth,o=e.minHeight,a=e.reservedWidth,s=e.reservedHeight,u=n,c=0;e.children.forEach((function(t){t.x=u,t.y=n,u=t.x+t.width+r,t.height>c&&(c=t.height)})),e.width=Math.max(u-r+n+a,i),e.height=Math.max(c+2*n+s,o)}},{key:"generateVerticalWorkflowLayout",value:function(t,e){var n=e.margin,r=e.gap,i=e.minWidth,o=e.minHeight,a=e.reservedWidth,s=e.reservedHeight,u=n,c=0;e.children.forEach((function(t){t.x=n,t.y=u,u=t.y+t.height+r,t.width>c&&(c=t.width)})),e.width=Math.max(c+2*n+a,i),e.height=Math.max(u-r+n+s,o)}},{key:"resize",value:function(t){var e=this.pluginData.getComponentById(t);if(!e.definition.isContainer)return!1;var n=0,r=0;this.pluginData.getChildren(t).forEach((function(t){var e=t.drawOption.x+t.drawOption.width,i=t.drawOption.y+t.drawOption.height;e>n&&(n=e),i>r&&(r=i)}));var i=e.definition,o=i.minWidth,a=i.minHeight,s=i.reservedWidth,u=i.reservedHeight,c=i.margin,l=Math.max(n+2*c+s,o),f=Math.max(r+2*c+u,a);return l===e.drawOption.width&&f===e.drawOption.height||(e.drawOption.width=l,e.drawOption.height=f,this.pluginData.emitEvent({components:[t],type:"Drawer",action:"resize",status:"success"})),!0}}],r&&function(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=Array(e);n=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),N(n),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;N(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:C(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},e}function uN(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function cN(t){var e=function(t){if("object"!=eN(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=eN(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==eN(e)?e:e+""}var lN=function(){return e=function e(n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.pluginData=n,this.componentRenderer=null,this.linkRenderer=null,this.layout=null,this.viewport=null,this.scene=null,this.d3=t,this.actions={deleteAction:null,dragComponent:null,dragScene:null,linkAction:null,menuAction:null,resizeComponent:null,toggleSelection:null,selectionAll:null,deselectionAll:null,zoom:null},this.states={linking:!1,menuOpening:!1,moving:!1,resizing:!1,selection:!1},this.readOnly=!1},n=[{key:"init",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.d3.select("#".concat(t)).selectAll(null).remove(),this.d3.select("#".concat(t)).html(""),this.viewport=this.d3.select("#".concat(t)),this.componentRenderer=this.initComponentRenderer(e),this.linkRenderer=this.initLinkRenderer(e),this.layout=new tN(this.pluginData,this.viewport),this.readOnly=e,this.clearActions(),this.readOnly&&(this.pluginData.scene.x=0,this.pluginData.scene.y=0,this.pluginData.scene.zoom=1),this.initActions(),this.initScene()}},{key:"initComponentRenderer",value:function(t){return new FT(this.pluginData,this.viewport,t)}},{key:"initLinkRenderer",value:function(t){return new KT(this.pluginData,this.viewport,t)}},{key:"clearActions",value:function(){this.actions.deleteAction=null,this.actions.dragComponent=null,this.actions.dragScene=null,this.actions.menuAction=null,this.actions.resizeComponent=null,this.actions.toggleSelection=null,this.actions.selectionAll=null,this.actions.deselectionAll=null,this.actions.zoom=null,this.viewport.on("wheel",null),this.d3.select("body").on("keydown",null).on("keyup",null),this.viewport.on(".drag",null)}},{key:"initActions",value:function(){var t=this;this.actions.selectionAll=new kT(this.pluginData,this.viewport,this.layout),this.actions.deleteAction=new cA(this.pluginData,this.viewport,this.layout),this.actions.dragScene=new SA(this.pluginData,this.viewport,this.layout),this.actions.menuAction=new qA(this.pluginData,this.viewport,this.layout),this.actions.link=new PA(this.pluginData,this.viewport,this.layout),this.actions.zoom=new CT(this.pluginData,this.viewport,this.layout),this.actions.dragComponent=new gA(this.pluginData,this.viewport,this.layout),this.actions.resizeComponent=new GA(this.pluginData,this.viewport,this.layout),this.actions.toggleSelection=new oT(this.pluginData,this.viewport,this.layout),this.actions.deselectionAll=new pT(this.pluginData,this.viewport,this.layout),this.viewport.on("wheel",(function(e){t.actions.zoom.execute(e)&&t.draw()})),this.readOnly||this.d3.select("body").on("keydown",(function(e){var n=!1;t.pluginData.configuration.keysBinding.selection.includes(e.key)&&(t.states.selection=!0),t.pluginData.configuration.keysBinding.deleteObject.includes(e.key)&&(n=t.actions.deleteAction.execute(e)),t.pluginData.configuration.keysBinding.selectAll.includes(e.key)&&(n=t.actions.selectionAll.execute(e)),t.pluginData.configuration.keysBinding.deselectAll.includes(e.key)&&(n=t.actions.deselectionAll.execute(e)),n&&t.draw()})).on("keyup",(function(e){var n=!1;t.pluginData.configuration.keysBinding.selection.includes(e.key)&&(t.states.selection=!1),t.pluginData.configuration.keysBinding.deleteObject.includes(e.key)&&(n=t.actions.deleteAction.finalize(e)),t.pluginData.configuration.keysBinding.selectAll.includes(e.key)&&(n=t.actions.selectionAll.finalize(e)),t.pluginData.configuration.keysBinding.deselectAll.includes(e.key)&&(n=t.actions.deselectionAll.finalize(e)),n&&t.draw()}));var e=this.d3.drag().subject((function(e){var n=e.sourceEvent.target.closest(".component");if(t.states.resizing=!!e.sourceEvent.target.closest(".resize-button"),t.states.menuOpening=!!e.sourceEvent.target.closest(".menu-button"),!n)return t.scene;var r=t.viewport.select(Array.from(n.classList).map((function(t){return".".concat(t)})).join(""));return t.states.linking=!!e.sourceEvent.target.closest(".anchor")&&t.pluginData.canHaveLink(r.datum().data.definition.type),r})).on("drag",(function(e){t.states.moving=!0;var n="scene"===e.subject.datum().data.id,r=!1;t.readOnly?t.actions.dragScene.execute(e):(n?r=t.actions.dragScene.execute(e):t.states.linking?(r=t.actions.link.execute(e),t.linkRenderer.render()):t.states.resizing?(r=t.actions.resizeComponent.execute(e),t.linkRenderer.render()):(r=t.actions.dragComponent.execute(e),t.linkRenderer.render()),r&&t.draw())})).on("end",function(){var e,n=(e=sN().mark((function e(n){var r,i,o,a,s,u,c;return sN().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.states.moving,i=t.states.selection,o=t.states.menuOpening,a=t.states.resizing,s=t.states.linking,u="scene"===n.subject.datum().data.id,c=!1,!t.readOnly){e.next=10;break}return u&&r&&t.actions.dragScene.finalize(n),e.abrupt("return");case 10:s?c=t.actions.link.finalize(n):r&&u?c=t.actions.dragScene.finalize(n):a?c=t.actions.resizeComponent.finalize(n):r&&!u?c=t.actions.dragComponent.finalize(n):!r&&o?c=t.actions.menuAction.finalize(n):r||u||!i||(c=t.actions.toggleSelection.finalize(n)),c&&t.draw(),t.states.moving=!1;case 13:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(t){uN(o,r,i,a,s,"next",t)}function s(t){uN(o,r,i,a,s,"throw",t)}a(void 0)}))});return function(t){return n.apply(this,arguments)}}());this.viewport.call(e)}},{key:"getScene",value:function(){return this.viewport.selectAll(".scene").data(this.getSceneData()).join("svg").attr("class","scene").attr("width","100%").attr("height","100%")}},{key:"initScene",value:function(){var t=this;this.viewport.append("style").text(this.pluginData.resources.style),this.scene=this.getScene(),this.scene.attr("version","1.1"),this.scene.attr("xmlns","http://www.w3.org/2000/svg"),this.scene.append("defs").html(Object.keys(this.pluginData.resources.markers).map((function(e){return t.pluginData.resources.markers[e]})).join(""));var e=this.pluginData.scene,n=e.x,r=e.y,i=e.zoom,o="translate(".concat(n," ").concat(r,") scale(").concat(i,")");this.scene.append("g").attr("class","components").attr("transform",o),this.scene.append("g").attr("class","links").attr("transform",o)}},{key:"draw",value:function(){if(this.scene=this.getScene(),this.componentRenderer.render("scene"),this.linkRenderer.render("scene"),this.readOnly){for(var t=this.viewport.node().getBoundingClientRect(),e=t.width,n=t.height,r=this.viewport.select(".scene .components").node().getBBox(),i=r.width,o=r.height,a=r.x,s=r.y,u=e/iu;)c*=.9;this.scene.attr("viewBox","".concat(a-15," ").concat(s-15," ").concat(i+a+15," ").concat(o+s+15)),this.pluginData.scene.zoom=c}}},{key:"arrangeComponentsPosition",value:function(t,e){this.layout.generateComponentsLayout(t,e)}},{key:"resize",value:function(t){this.layout.resize(t)}},{key:"getSceneData",value:function(){var t=this;return[this.d3.hierarchy(oN({id:"scene",name:"",children:nN(this.pluginData.components.filter((function(t){return null===t.getContainerId()})))},this.pluginData.scene),(function(e){return"scene"===e.id?e.children:t.pluginData.getChildren(e.id)}))]}},{key:"dropComponent",value:function(t,e){var n=e.target.closest(".component");if(t.drawOption.width=t.definition.width,t.drawOption.height=t.definition.height,!n){var r=this.viewport.select(".scene").node().getBoundingClientRect(),i=r.x,o=r.y;return t.drawOption.x=(e.clientX-i-this.pluginData.scene.x)/this.pluginData.scene.zoom-t.definition.defaultWidth/2,void(t.drawOption.y=(e.clientY-o-this.pluginData.scene.y)/this.pluginData.scene.zoom-t.definition.defaultHeight/2)}if(n.canContain(t.definition.type)){var a=this.viewport.select(".".concat(t.id,".container")).node().getBoundingClientRect(),s=a.x,u=a.y;t.drawOption.x=(e.clientX-s-this.pluginData.scene.x)/this.pluginData.scene.zoom-t.definition.defaultWidth/2,t.drawOption.y=(e.clientY-u-this.pluginData.scene.y)/this.pluginData.scene.zoom-t.definition.defaultHeight/2}}},{key:"exportSvg",value:function(t){return this.viewport.selectAll(".scene > g").attr("transform",""),document.querySelector("#".concat(t," .scene")).outerHTML}}],n&&function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:[]).map((function(t){return t.path}))}},{key:"parseConfiguration",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=this.pluginData.emitEvent({parent:r,type:"Parser",action:"read",status:"running",files:[e.path],data:{global:!1}});if(null!=e.content){var o=JSON.parse(e.content);o[t.path]?o[t.path][this.pluginData.name]?(Object.keys(o[t.path][this.pluginData.name]).forEach((function(e){var r=n.pluginData.getComponentByConfigurationKey(e);r&&o[t.path][n.pluginData.name][e]&&(r.drawOption=new g(o[t.path][n.pluginData.name][e]))})),this.pluginData.emitEvent({id:i,status:"success"})):this.pluginData.emitEvent({id:i,status:"warning",data:{code:"no_plugin_content",global:!1}}):this.pluginData.emitEvent({id:i,status:"warning",data:{code:"no_diagram_content",global:!1}})}else this.pluginData.emitEvent({id:i,status:"warning",data:{code:"no_content",global:!1}})}},{key:"isParsable",value:function(t){return null!=t}}],e&&function(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null,e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((function(t,e){return t[e.path]="",t}),{});return this.renderFiles(t).forEach((function(t){e[t.path]=t.content})),Object.keys(e).map((function(t){return new G({path:t,content:e[t]})}))}},{key:"renderFiles",value:function(){return[]}},{key:"renderConfiguration",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=this.pluginData.emitEvent({parent:r,type:"Render",action:"write",status:"running",files:[e.path],data:{global:!1}}),o=JSON.parse(e.content)||{};o[t.path]||(o[t.path]={}),o[t.path][this.pluginData.name]={},this.pluginData.components.filter((function(t){return t.drawOption})).forEach((function(e){var r=e.getConfigurationKey();o[t.path][n.pluginData.name][r]=e.drawOption})),e.content=JSON.stringify(o,(function(t,e){return null===e?void 0:e}),2),this.pluginData.emitEvent({id:i,status:"success"})}}],e&&function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{id:null,parentId:null,files:null,components:null,links:null,type:null,action:null,status:null,data:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.id,r=e.parentId,i=e.files,o=e.components,a=e.links,s=e.type,u=e.action,c=e.status,l=e.data;this.id=n||null,this.parentId=r||null,this.startDate=null,this.endDate=null,this.files=i||null,this.components=o||null,this.links=a||null,this.type=s||null,this.action=u||null,this.status=c||null,this.data=l||null}));const SN=ON;function EN(t){return EN="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},EN(t)}function AN(t,e,n){return e=NN(e),function(t,e){if(e&&("object"==EN(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,TN()?Reflect.construct(e,n||[],NN(t).constructor):e.apply(t,n))}function TN(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(TN=function(){return!!t})()}function NN(t){return NN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},NN(t)}function MN(t,e){return MN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},MN(t,e)}var CN=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{anchorName:null};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=AN(this,e,[n])).anchorName=n.anchorName||null,t.endX=null,t.endY=null,t.isTemporary=!0,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&MN(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}($);const jN=CN;function PN(t){return PN="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},PN(t)}function LN(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n1&&void 0!==arguments[1]?arguments[1]:{name:null,version:null,components:[],variables:[],definitions:{components:[],links:[]},parseLogs:[],resources:{},scene:{x:0,y:0,zoom:1,selection:[],selectionRef:null}},m=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.name=d.name||null,this.version=d.version||null,this.components=d.components||[],this.scene={x:(null===(n=d.scene)||void 0===n?void 0:n.x)||0,y:(null===(r=d.scene)||void 0===r?void 0:r.y)||0,zoom:(null===(i=d.scene)||void 0===i?void 0:i.zoom)||1,selection:(null===(o=d.scene)||void 0===o?void 0:o.selection)||[],selectionRef:(null===(a=d.scene)||void 0===a?void 0:a.selectionRef)||null},this.variables=d.variables||[],this.definitions={components:(null===(s=d.definitions)||void 0===s?void 0:s.components)||[],links:(null===(u=d.definitions)||void 0===u?void 0:u.links)||[]},this.parseLogs=d.parseLogs||[],this.__eventIndex=0,this.eventManager=m,this.eventLogs=[],this.configuration=e,this.resources={icons:DN({},null===(c=d.resources)||void 0===c?void 0:c.icons),markers:DN({},null===(l=d.resources)||void 0===l?void 0:l.markers),links:DN({},null===(f=d.resources)||void 0===f?void 0:f.links),models:DN({},null===(h=d.resources)||void 0===h?void 0:h.models),style:(null===(p=d.resources)||void 0===p?void 0:p.style)||""},this.temporaryLink=null},e=[{key:"coreVersion",get:function(){return"0.28.0"}},{key:"getComponentById",value:function(t){return this.components.find((function(e){return e.id===t}))||null}},{key:"getComponentDepth",value:function(t){var e=this.getComponentById(t).getContainerId();return e?this.getComponentDepth(e)+1:0}},{key:"getComponentByConfigurationKey",value:function(t){return this.getComponentById(t)}},{key:"renameComponentExternalId",value:function(t,e){this.getComponentById(t).setExternalId(e)}},{key:"getComponentsByType",value:function(t){return this.components.filter((function(e){var n=e.definition;return n&&n.type===t}))}},{key:"addComponent",value:function(t,e){var n=this.generateComponentId();return this.components.push(new S({id:n,name:n,definition:t,path:e})),n}},{key:"generateComponentId",value:function(){var t=this.components.map((function(t){return t.id})).filter((function(t){return new RegExp("".concat("id_","\\d+")).test(t)})).map((function(t){return parseInt(t.substring(3),10)})),e=0===t.length?1:Math.max.apply(Math,function(t){return function(t){if(Array.isArray(t))return LN(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return LN(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?LN(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t))+1;return"".concat("id_").concat(e)}},{key:"removeComponentById",value:function(t){var e=this;this.getChildren(t).forEach((function(t){return e.removeComponentById(t.id)})),this.components=this.components.filter((function(e){return e.id!==t})),this.components.forEach((function(e){e.removeLinkAttribute(t)}))}},{key:"removeLink",value:function(t){var e=t.source,n=t.target,r=t.definition.attributeRef;this.getComponentById(e).removeLinkAttribute(n,r)}},{key:"getLinks",value:function(){var t=this,e=[];return this.definitions.links.forEach((function(n){t.getComponentsByType(n.sourceRef).forEach((function(r){var i=r.getAttributeByName(n.attributeRef);i&&t.getLinkedComponentsIds(i).forEach((function(t){return e.push(new $({definition:n,source:r.id,target:t,isReverse:"Reverse"===i.definition.linkType}))}))}))})),this.temporaryLink&&e.push(this.temporaryLink),e.concat(this.getWorkflowLinks())}},{key:"getAttributeValue",value:function(t){return t.isVariable?this.getVariableValue(t.value):t.value}},{key:"getLinkedComponentsIds",value:function(t){var e=this.getAttributeValue(t);return null===e?[]:Array.isArray(e)?e:[e]}},{key:"getVariableValue",value:function(t){var e;return(null===(e=this.variables.find((function(e){return e.name===t})))||void 0===e?void 0:e.value)||null}},{key:"setVariableValue",value:function(t,e){var n=this.variables.find((function(e){return e.name===t}));n&&(n.value=e)}},{key:"getComponentIdFromValue",value:function(t){return t}},{key:"canHaveLink",value:function(t){return this.definitions.links.some((function(e){return e.sourceRef===t}))}},{key:"canBeLinked",value:function(t,e){return this.definitions.links.some((function(n){var r=n.sourceRef,i=n.targetRef;return r===t&&i===e}))}},{key:"createTemporaryLink",value:function(t,e){this.temporaryLink=new jN({anchorName:e,source:t,definition:this.definitions.links.find((function(t){return t.isTemporary}))})}},{key:"getWorkflowLinks",value:function(){var t=this;return this.components.filter((function(t){var e;return null===(e=t.definition.displayType)||void 0===e?void 0:e.match("workflow")})).reduce((function(e,n){var r=t.getChildren(n.id);if(r.length>1)for(var i=0;in,this.components.splice(i,0,r),this.components.splice(n+(it}))}},{key:"emitEvent",value:function(){var t,e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.id;return r?(e=this.getEventLogById(r),Object.keys(n).forEach((function(t){e[t]=n[t]}))):(this.__eventIndex+=1,r=this.__eventIndex,(e=new SN(DN(DN({},n),{},{id:r}))).startDate=Date.now(),this.eventLogs.push(e)),["success","warning","error"].includes(e.status)&&(e.endDate=Date.now()),null!==(t=this.eventManager)&&void 0!==t&&t.next&&this.eventManager.next({plugin:this.name,event:DN({},e)}),r}}],e&&function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{editor:{syntax:null},restrictiveFolder:null,defaultFileName:null,defaultFileExtension:null,tags:[],isFolderTypeDiagram:!0,extraResources:[],rootContainer:{margin:30,gap:50},container:{margin:30,gap:50},keysBinding:{},i18n:{}};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.editor=KN({syntax:null},a.editor),this.restrictiveFolder=a.restrictiveFolder||null,this.defaultFileName=a.defaultFileName||null,this.defaultFileExtension=a.defaultFileExtension||null,this.tags=a.tags||[],this.isFolderTypeDiagram=null===(e=a.isFolderTypeDiagram)||void 0===e||e,this.extraResources=a.extraResources||[],this.rootContainer={margin:(null===(n=a.rootContainer)||void 0===n?void 0:n.margin)||30,gap:(null===(r=a.rootContainer)||void 0===r?void 0:r.gap)||50},this.container={margin:(null===(i=a.container)||void 0===i?void 0:i.margin)||30,gap:(null===(o=a.container)||void 0===o?void 0:o.gap)||50},this.keysBinding=KN({moveSceneUp:["ArrowUp"],moveSceneDown:["ArrowDown"],moveSceneLeft:["ArrowLeft"],moveSceneRight:["ArrowRight"],moveComponentUp:[],moveComponentDown:[],moveComponentLeft:[],moveComponentRight:[],zoomIn:["+"],zoomOut:["-"],deleteObject:["Delete"],editComponent:[",","?"],selection:["Shift"],selectAll:["A"],deselectAll:["D"]},a.keysBinding),this.i18n=a.i18n||{}}));const HN=YN;function WN(t){return WN="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},WN(t)}function GN(t){var e=function(t){if("object"!=WN(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=WN(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==WN(e)?e:e+""}var JN=function(){return t=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{event:null,configuration:null,pluginData:null,pluginDrawer:null,pluginMetadata:null,pluginParser:null,pluginRenderer:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.configuration=e.configuration||new HN,this.data=e.pluginData||new $N(this.configuration,{},e.event),this.__drawer=e.pluginDrawer||new fN(this.data),this.__metadata=e.pluginMetadata||new mN(this.data),this.__parser=e.pluginParser||new bN(this.data),this.__renderer=e.pluginRenderer||new kN(this.data)},e=[{key:"init",value:function(){var t=this.data.emitEvent({type:"Plugin",action:"init",status:"running"});this.__metadata.parse(t),this.data.initLinkDefinitions(t),this.data.emitEvent({id:t,status:"success"})}},{key:"initResources",value:function(t){this.data.resources=t}},{key:"initDrawer",value:function(t,e){this.__drawer.init(t,e)}},{key:"draw",value:function(){this.__drawer.draw()}},{key:"parse",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=this.data.emitEvent({type:"Parser",action:"read",status:"running",files:n.map((function(t){return t.path})).concat(null==e?void 0:e.path),data:{global:!0}});this.__parser.parse(t,n,r),this.__parser.parseConfiguration(t,e,r),this.data.emitEvent({id:r,status:"success"})}},{key:"isParsable",value:function(t){return this.__parser.isParsable(t)}},{key:"getModels",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.__parser.getModels(e.filter((function(e){return t.isParsable(e)})))}},{key:"render",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=this.data.emitEvent({type:"Render",action:"write",status:"running",files:n.map((function(t){return t.path})).concat(e.path),data:{global:!0}});this.__renderer.renderConfiguration(t,e,r);var i=this.__renderer.render(n,r).concat(e);return this.data.emitEvent({id:r,status:"success"}),i}},{key:"arrangeComponentsPosition",value:function(t,e){this.__drawer.arrangeComponentsPosition(t,e)}},{key:"resize",value:function(t){this.__drawer.resize(t)}},{key:"exportSvg",value:function(t){this.__drawer.init(t,!0),this.draw();var e=this.__drawer.exportSvg(t);return this.__drawer.init(t,!1),this.draw(),e}},{key:"getComponentPosition",value:function(t,e){var n=e.x,r=e.y,i=this.__drawer.actions.zoom,o=i.scale,a=i.translate,s=document.querySelector("#".concat(t)).getBoundingClientRect(),u=s.left,c=s.top;return{x:(n-u-a.x)/o,y:(r-c-a.y)/o}}},{key:"addComponent",value:function(t,e,n,r){var i=this.data.addComponent(e,n),o=this.data.getComponentById(i);if(t){var a=this.data.getComponentById(t);o.setReferenceAttribute(a)}return r&&this.__drawer.dropComponent(o,r),i}}],e&&function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{type:null,value:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.type,r=e.value;this.type=n||null,this.value=r||null}));const ZN=QN;function tM(t){return tM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tM(t)}function eM(t,e,n){return e=rM(e),function(t,e){if(e&&("object"==tM(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,nM()?Reflect.construct(e,n||[],rM(t).constructor):e.apply(t,n))}function nM(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(nM=function(){return!!t})()}function rM(t){return rM=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},rM(t)}function iM(t,e){return iM=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},iM(t,e)}var oM=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{name:null,type:null,value:null,category:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t=eM(this,e,[n]);var r=n.name,i=n.type,o=n.value,a=n.category;return t.__class="Variable",t.name=r||null,t.type=i||null,t.value=o||null,t.category=a||null,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&iM(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(m);const aM=oM})();var o=e;for(var a in i)o[a]=i[a];i.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r](o,o.exports,n),o.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{default:()=>Za});var t=n(149);function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function o(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{apiVersion:null,childrenIndex:[],ignoredAttributes:[]};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=E(this,e,[k(k({},n),{},{defaultWidth:n.isContainer?186:96,defaultHeight:n.isContainer?160:80,minWidth:n.isContainer?186:96,minHeight:n.isContainer?140:80,reservedWidth:n.isContainer?12:0,reservedHeight:n.isContainer?80:0,margin:15,gap:50,categories:["Kubernetes"]})])).apiVersion=n.apiVersion||null,t.childrenIndex=n.childrenIndex||[],t.ignoredAttributes=n.ignoredAttributes||[],t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&N(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(t.ComponentDefinition);function C(t){return C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},C(t)}function j(t,e,n){return e=L(e),function(t,e){if(e&&("object"==C(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,P()?Reflect.construct(e,n||[],L(t).constructor):e.apply(t,n))}function P(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(P=function(){return!!t})()}function L(t){return L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},L(t)}function I(t,e){return I=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},I(t,e)}const D=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{ignoredAttributes:[]};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=j(this,e,[n])).ignoredAttributes=n.ignoredAttributes||[],t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&I(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(t.ComponentAttributeDefinition),R={commonAttributes:JSON.parse('[{"name":"metadata","type":"Object","expanded":true,"ignoredAttributes":["creationTimestamp","deletionGracePeriodSeconds","deletionTimestamp","generation","name","resourceVersion","selfLink","uid"],"attributes":[{"name":"namespace","type":"String","description":"Namespace defines the space within which each name must be unique.
An empty namespace is equivalent to the \\"default\\" namespace, but \\"default\\" is the canonical representation.
Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.

Must be a DNS_LABEL. Cannot be updated.","url":"http://kubernetes.io/docs/user-guide/namespaces"},{"name":"labels","type":"Object","attributes":[{"name":"app.kubernetes.io/name","type":"String","description":"The name of the application."},{"name":"app.kubernetes.io/instance","type":"String","description":"A unique name identifying the instance of an application."},{"name":"app.kubernetes.io/version","type":"String","description":"The current version of the application (e.g., a SemVer 1.0, revision hash, etc.)."},{"name":"app.kubernetes.io/component","type":"String","description":"The component within the architecture."},{"name":"app.kubernetes.io/part-of","type":"String","description":"The name of a higher level application this one is part of."},{"name":"app.kubernetes.io/managed-by","type":"String","description":"The tool being used to manage the operation of an application."}]},{"name":"annotations","type":"Object"}]}]'),apiVersions:{"apps/v1":JSON.parse('[{"type":"Deployment","model":"DefaultContainer","icon":"resources/unlabeled/deploy","description":"A Deployment provides declarative updates for Pods and ReplicaSets.

You describe a desired state in a Deployment, and the Deployment Controller changes the actual state to the desired state at a controlled rate.
You can define Deployments to create new ReplicaSets, or to remove existing Deployments and adopt all their resources with new Deployments.","url":"https://kubernetes.io/docs/concepts/workloads/controllers/deployment/","isContainer":true,"childrenIndex":[{"attributeName":"template","componentType":"Pod"}],"attributes":[{"name":"spec","type":"Object","displayName":"Specification","expanded":true,"ignoredAttributes":["selector"],"attributes":[{"name":"replicas","type":"Number","description":"Number of desired pods.
This is a pointer to distinguish between explicit zero and not specified.
Defaults to 1."},{"name":"strategy","type":"Object","description":"The deployment strategy to use to replace existing pods with new ones.","attributes":[{"name":"type","type":"String","description":"Type of deployment.
Can be \\"Recreate\\" or \\"RollingUpdate\\".
Default is RollingUpdate.","rules":{"values":["RollingUpdate","Recreate"]}},{"name":"rollingUpdate","type":"Object","description":"Rolling update config params.
Present only if DeploymentStrategyType = RollingUpdate.","expanded":true,"attributes":[{"name":"maxSurge","type":"String","description":"The maximum number of pods that can be scheduled above the desired number of pods.
Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
This can not be 0 if MaxUnavailable is 0.
Absolute number is calculated from percentage by rounding up.
Defaults to 25%.
Example: when this is set to 30%, the new ReplicaSet can be scaled up immediately when the rolling update starts, such that the total number of old and new pods do not exceed 130% of desired pods.
Once old pods have been killed, new ReplicaSet can be scaled up further, ensuring that total number of pods running at any time during the update is at most 130% of desired pods."},{"name":"maxUnavailable","type":"String","description":"The maximum number of pods that can be unavailable during the update.
Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
Absolute number is calculated from percentage by rounding down.
This can not be 0 if MaxSurge is 0.
Defaults to 25%.
Example: when this is set to 30%, the old ReplicaSet can be scaled down to 70% of desired pods immediately when the rolling update starts.
Once new pods are ready, old ReplicaSet can be scaled down further, followed by scaling up the new ReplicaSet, ensuring that the total number of pods available at all times during the update is at least 70% of desired pods."}]}]},{"name":"revisionHistoryLimit","type":"Number","description":"The number of old ReplicaSets to retain to allow rollback.
This is a pointer to distinguish between explicit zero and not specified.
Defaults to 10."}]}]},{"type":"StatefulSet","model":"DefaultContainer","icon":"resources/unlabeled/sts","description":"StatefulSet is the workload API object used to manage stateful applications.

Manages the deployment and scaling of a set of Pods, and provides guarantees about the ordering and uniqueness of these Pods.

Like a Deployment, a StatefulSet manages Pods that are based on an identical container spec.
Unlike a Deployment, a StatefulSet maintains a sticky identity for each of their Pods.
These pods are created from the same spec, but are not interchangeable: each has a persistent identifier that it maintains across any rescheduling.

If you want to use storage volumes to provide persistence for your workload, you can use a StatefulSet as part of the solution.
Although individual Pods in a StatefulSet are susceptible to failure, the persistent Pod identifiers make it easier to match existing volumes to the new Pods that replace any that have failed.","url":"https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/","isContainer":true,"childrenIndex":[{"attributeName":"template","componentType":"Pod"}],"attributes":[{"name":"spec","type":"Object","displayName":"Specification","expanded":true,"ignoredAttributes":["selector"],"attributes":[]}]}]'),"batch/v1":JSON.parse('[{"type":"CronJob","model":"DefaultContainer","icon":"resources/unlabeled/cronjob","description":"A CronJob creates Jobs on a repeating schedule.

CronJob is meant for performing regular scheduled actions such as backups, report generation, and so on.
One CronJob object is like one line of a crontab (cron table) file on a Unix system.
It runs a job periodically on a given schedule, written in Cron format.

CronJobs have limitations and idiosyncrasies.
For example, in certain circumstances, a single CronJob can create multiple concurrent Jobs.
See the limitations below.

When the control plane creates new Jobs and (indirectly) Pods for a CronJob, the .metadata.name of the CronJob is part of the basis for naming those Pods.
The name of a CronJob must be a valid DNS subdomain value, but this can produce unexpected results for the Pod hostnames.
For best compatibility, the name should follow the more restrictive rules for a DNS label.
Even when the name is a DNS subdomain, the name must be no longer than 52 characters.
This is because the CronJob controller will automatically append 11 characters to the name you provide and there is a constraint that the length of a Job name is no more than 63 characters.","url":"https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/","isContainer":true,"childrenIndex":[{"attributeName":"jobTemplate","componentType":"Job"}],"attributes":[{"name":"spec","type":"Object","displayName":"Specification","expanded":true,"attributes":[]}]},{"type":"Job","model":"DefaultContainer","icon":"resources/unlabeled/job","isContainer":true,"parentTypes":["CronJob"],"childrenIndex":[{"attributeName":"template","componentType":"Pod"}],"attributes":[{"name":"parent","type":"Reference","containerRef":"CronJob"},{"name":"spec","type":"Object","displayName":"Specification","expanded":true,"ignoredAttributes":["selector"],"attributes":[]}]}]'),v1:JSON.parse('[{"type":"Pod","model":"DefaultContainer","icon":"resources/unlabeled/pod","parentTypes":["Deployment","StatefulSet","Job"],"isContainer":true,"childrenPerLine":3,"childrenIndex":[{"attributeName":"containers","componentType":"Container"},{"attributeName":"initContainers","componentType":"Container"}],"attributes":[{"name":"parentDeployment","type":"Reference","containerRef":"Deployment"},{"name":"parentStatefulSet","type":"Reference","containerRef":"StatefulSet"},{"name":"parentJob","type":"Reference","containerRef":"Job"},{"name":"spec","type":"Object","displayName":"Specification","expanded":true,"attributes":[{"name":"volumes","type":"Array","attributes":[{"name":null,"type":"Object","attributes":[{"name":"name","type":"String","required":true},{"name":"configMap","type":"Object","attributes":[{"name":"name","type":"Link","linkRef":"ConfigMap","linkModel":"defaultLink","required":true},{"name":"defaultMode","type":"Number"},{"name":"items","type":"Array","attributes":[{"name":null,"type":"Object","attributes":[{"name":"key","type":"String","required":true},{"name":"path","type":"String","required":true},{"name":"mode","type":"Number"}]}]},{"name":"optional","type":"Boolean"}]},{"name":"secret","type":"Object","attributes":[{"name":"secretName","type":"Link","linkRef":"Secret","linkModel":"defaultLink","required":true},{"name":"defaultMode","type":"Number"},{"name":"items","type":"Array","attributes":[{"name":null,"type":"Object","attributes":[{"name":"key","type":"String","required":true},{"name":"path","type":"String","required":true},{"name":"mode","type":"Number"}]}]},{"name":"optional","type":"Boolean"}]},{"name":"persistentVolumeClaim","type":"Object","attributes":[{"name":"claimName","type":"Link","linkRef":"PersistentVolumeClaim","linkModel":"defaultLink","required":true},{"name":"readOnly","type":"Boolean"}]}]}]},{"name":"topologySpreadConstraints","type":"Array","description":"TopologySpreadConstraints describes how a group of pods ought to spread across topology domains.
Scheduler will schedule pods in a way which abides by the constraints.
All topologySpreadConstraints are ANDed.","attributes":[{"name":null,"type":"Object","attributes":[{"name":"maxSkew","type":"Number","required":true},{"name":"minDomains","type":"Number"},{"name":"topologyKey","type":"String","required":true},{"name":"whenUnsatisfiable","type":"String","required":true,"rules":{"values":["DoNotSchedule","ScheduleAnyway"]}},{"name":"labelSelector","type":"Object","attributes":[{"name":"matchLabels","type":"Object","expanded":true},{"name":"matchExpressions","type":"Array","attributes":[{"name":null,"type":"Object","attributes":[{"name":"key","type":"String","required":true},{"name":"operator","type":"String","required":true},{"name":"values","type":"Array"}]}]}]}]}]}]}]},{"type":"Service","model":"DefaultModel","icon":"resources/unlabeled/svc","attributes":[{"name":"spec","type":"Object","displayName":"Specification","expanded":true,"attributes":[{"name":"type","type":"String","description":"type determines how the Service is exposed.
Defaults to ClusterIP.
Valid options are ExternalName, ClusterIP, NodePort, and LoadBalancer.
\\"ClusterIP\\" allocates a cluster-internal IP address for load-balancing to endpoints.
Endpoints are determined by the selector or if that is not specified, by manual construction of an Endpoints object or EndpointSlice objects.
If clusterIP is \\"None\\", no virtual IP is allocated and the endpoints are published as a set of endpoints rather than a virtual IP.
\\"NodePort\\" builds on ClusterIP and allocates a port on every node which routes to the same endpoints as the clusterIP.
\\"LoadBalancer\\" builds on NodePort and creates an external load-balancer (if supported in the current cloud) which routes to the same endpoints as the clusterIP.
\\"ExternalName\\" aliases this service to the specified externalName.
Several other fields do not apply to ExternalName services.","url":"https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types","rules":{"values":["ClusterIP","NodePort","LoadBalancer","ExternalName"]}},{"name":"selector","type":"Link","linkRef":"Pod","linkModel":"defaultLink"},{"name":"ports","type":"Array","attributes":[{"name":null,"type":"Object","attributes":[{"name":"name","type":"String"},{"name":"protocol","type":"String","rules":{"values":["TCP","UDP","SCTP"]}},{"name":"port","type":"Number","required":true},{"name":"targetPort","type":"String"}]}]}]}]},{"type":"ConfigMap","model":"DefaultModel","icon":"resources/unlabeled/cm","attributes":[{"name":"data","type":"Object","expanded":true},{"name":"binaryData","type":"Object"},{"name":"immutable","type":"Boolean"}]},{"type":"Secret","model":"DefaultModel","icon":"resources/unlabeled/secret","attributes":[{"name":"type","type":"String","rules":{"values":["Opaque","kubernetes.io/service-account-token","kubernetes.io/dockercfg","kubernetes.io/dockerconfigjson","kubernetes.io/basic-auth","kubernetes.io/ssh-auth","kubernetes.io/tls","bootstrap.kubernetes.io/token"]}},{"name":"stringData","type":"Object","expanded":true},{"name":"data","type":"Object"},{"name":"immutable","type":"Boolean"}]},{"type":"PersistentVolumeClaim","model":"DefaultModel","icon":"resources/unlabeled/pvc","attributes":[{"name":"spec","type":"Object","displayName":"Specification","expanded":true,"attributes":[{"name":"storageClassName","type":"String"},{"name":"accessModes","type":"Array"},{"name":"volumeMode","type":"String","rules":{"values":["Filesystem","Block"]}},{"name":"resources","type":"Object","attributes":[{"name":"requests","type":"Object","expanded":true,"attributes":[{"name":"storage","type":"String"}]},{"name":"limits","type":"Object","expanded":true,"attributes":[{"name":"storage","type":"String"}]}]},{"name":"volumeName","type":"String"},{"name":"selector","type":"Object","attributes":[{"name":"matchLabels","type":"Object","expanded":true}]}]}]}]'),"networking.k8s.io/v1":JSON.parse('[{"type":"Ingress","model":"DefaultModel","icon":"resources/unlabeled/ing","attributes":[{"name":"spec","type":"Object","displayName":"Specification","expanded":true,"attributes":[{"name":"ingressClassName","type":"String","description":"ingressClassName is the name of an IngressClass cluster resource.
Ingress controller implementations use this field to know whether they should be serving this Ingress resource, by a transitive connection (controller -> IngressClass -> Ingress resource).
Although the `kubernetes.io/ingress.class` annotation (simple constant name) was never formally defined, it was widely supported by Ingress controllers to create a direct binding between Ingress controller and Ingress resources.
Newly created Ingress resources should prefer using the field.
However, even though the annotation is officially deprecated, for backwards compatibility reasons, ingress controllers should still honor that annotation if present."},{"name":"defaultBackend","type":"Object","description":"DefaultBackend is the backend that should handle requests that don\'t match any rule.
If Rules are not specified, DefaultBackend must be specified.
If DefaultBackend is not set, the handling of requests that do not match any of the rules will be up to the Ingress controller.","expanded":true,"attributes":[{"name":"service","type":"Object","expanded":true,"attributes":[{"name":"name","type":"Link","linkRef":"Service","linkModel":"defaultLink","required":true},{"name":"port","type":"Object","expanded":true,"attributes":[{"name":"name","type":"String","description":"Name is the name of the port on the Service.
This is a mutually exclusive setting with \\"Number\\"."},{"name":"number","type":"Number","description":"Number is the numerical port number (e.g. 80) on the Service.
This is a mutually exclusive setting with \\"Name\\"."}]}]}]},{"name":"rules","type":"Array","description":"A list of host rules used to configure the Ingress.
If unspecified, or no rule matches, all traffic is sent to the default backend.","attributes":[{"name":null,"type":"Object","attributes":[{"name":"host","type":"String"},{"name":"http","type":"Object","expanded":true,"attributes":[{"name":"paths","type":"Array","required":true,"attributes":[{"name":null,"type":"Object","attributes":[{"name":"pathType","type":"String","required":true,"rules":{"values":["Exact","Prefix","ImplementationSpecific"]}},{"name":"path","type":"String"},{"name":"backend","type":"Object","required":true,"expanded":true,"attributes":[{"name":"service","type":"Object","expanded":true,"attributes":[{"name":"name","type":"Link","description":"Name is the referenced service.
The service must exist in the same namespace as the Ingress object.","linkRef":"Service","linkModel":"defaultLink","required":true},{"name":"port","type":"Object","expanded":true,"attributes":[{"name":"name","type":"String","description":"Name is the name of the port on the Service.
This is a mutually exclusive setting with \\"Number\\"."},{"name":"number","type":"Number","description":"Number is the numerical port number (e.g. 80) on the Service.
This is a mutually exclusive setting with \\"Name\\"."}]}]}]}]}]}]}]}]},{"name":"tls","type":"Array","description":"TLS configuration.
Currently the Ingress only supports a single TLS port, 443.
If multiple members of this list specify different hosts, they will be multiplexed on the same port according to the hostname specified through the SNI TLS extension, if the ingress controller fulfilling the ingress supports SNI.","attributes":[{"name":null,"type":"Object","attributes":[{"name":"hosts","type":"Array"},{"name":"secretName","type":"String"}]}]}]}]}]'),"autoscaling/v2":JSON.parse('[{"type":"HorizontalPodAutoscaler","model":"DefaultModel","icon":"resources/unlabeled/hpa","attributes":[{"name":"spec","type":"Object","displayName":"Specification","expanded":true,"attributes":[]}]}]'),others:JSON.parse('[{"type":"Container","model":"DefaultContainer","icon":"resources/unlabeled/container","parentTypes":["Pod"],"attributes":[{"name":"parent","type":"Reference","containerRef":"Pod","required":true},{"name":"isInitContainer","type":"Boolean"},{"name":"image","type":"String"},{"name":"imagePullPolicy","type":"String","rules":{"values":["Always","IfNotPresent","Never"]}},{"name":"workingDir","type":"String"},{"name":"command","type":"Array","description":"Entrypoint array.
Not executed within a shell.
The container image\'s ENTRYPOINT is used if this is not provided.
Variable references $(VAR_NAME) are expanded using the container\'s environment.
If a variable cannot be resolved, the reference in the input string will be unchanged.
Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \\"$$(VAR_NAME)\\" will produce the string literal \\"$(VAR_NAME)\\".
Escaped references will never be expanded, regardless of whether the variable exists or not.
Cannot be updated.","url":"https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell"},{"name":"args","type":"Array","description":"Arguments to the entrypoint.
The container image\'s CMD is used if this is not provided.
Variable references $(VAR_NAME) are expanded using the container\'s environment.
If a variable cannot be resolved, the reference in the input string will be unchanged.
Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \\"$$(VAR_NAME)\\" will produce the string literal \\"$(VAR_NAME)\\".
Escaped references will never be expanded, regardless of whether the variable exists or not.
Cannot be updated.","url":"https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell"},{"name":"volumeMounts","type":"Array","attributes":[{"name":null,"type":"Object","attributes":[{"name":"name","type":"String","required":true},{"name":"mountPath","type":"String","required":true},{"name":"subPath","type":"String"},{"name":"subPathExpr","type":"String"},{"name":"mountPropagation","type":"String","rules":{"values":["None","HostToContainer","Bidirectional"]}},{"name":"readOnly","type":"Boolean"}]}]},{"name":"env","type":"Array","attributes":[{"name":null,"type":"Object","attributes":[{"name":"name","type":"String","required":true},{"name":"value","type":"String"}]}]},{"name":"envFrom","type":"Array","attributes":[{"name":null,"type":"Object","attributes":[{"name":"configMapRef","type":"Object","attributes":[{"name":"name","type":"String"},{"name":"optional","type":"Boolean"}]},{"name":"secretRef","type":"Object","attributes":[{"name":"name","type":"String"},{"name":"optional","type":"Boolean"}]},{"name":"prefix","type":"String"}]}]},{"name":"ports","type":"Array","attributes":[{"name":null,"type":"Object","attributes":[{"name":"name","type":"String"},{"name":"containerPort","type":"String","required":true},{"name":"protocol","type":"String","rules":{"values":["TCP","IDP","SCTP"]}}]}]},{"name":"resources","type":"Object","attributes":[{"name":"requests","type":"Object","expanded":true,"attributes":[{"name":"memory","type":"String"},{"name":"cpu","type":"String"},{"name":"ephemeral-storage","type":"String"}]},{"name":"limits","type":"Object","expanded":true,"attributes":[{"name":"memory","type":"String"},{"name":"cpu","type":"String"},{"name":"ephemeral-storage","type":"String"}]}]},{"name":"readinessProbe","type":"Object","attributes":[{"name":"initialDelaySeconds","type":"Number"},{"name":"periodSeconds","type":"Number"},{"name":"timeoutSeconds","type":"Number"},{"name":"successThreshold","type":"Number"},{"name":"failureThreshold","type":"Number"},{"name":"terminationGracePeriodSeconds","type":"Number"},{"name":"httpGet","type":"Object","attributes":[{"name":"host","type":"String"},{"name":"port","type":"String","required":false},{"name":"scheme","type":"String","rules":{"values":["HTTP","HTTPS"]}},{"name":"path","type":"String"},{"name":"httpHeaders","type":"Array","attributes":[{"name":null,"type":"Object","attributes":[{"name":"name","type":"String","required":true},{"name":"value","type":"String","required":true}]}]}]},{"name":"exec","type":"Object","attributes":[{"name":"command","type":"Array"}]},{"name":"tcpSocket","type":"Object","attributes":[{"name":"host","type":"String"},{"name":"port","type":"String","required":false}]},{"name":"grpc","type":"Object","attributes":[{"name":"port","type":"String","required":false},{"name":"service","type":"String"}]}]},{"name":"livenessProbe","type":"Object","attributes":[{"name":"initialDelaySeconds","type":"Number"},{"name":"periodSeconds","type":"Number"},{"name":"timeoutSeconds","type":"Number"},{"name":"successThreshold","type":"Number"},{"name":"failureThreshold","type":"Number"},{"name":"terminationGracePeriodSeconds","type":"Number"},{"name":"httpGet","type":"Object","attributes":[{"name":"host","type":"String"},{"name":"port","type":"String","required":false},{"name":"scheme","type":"String","rules":{"values":["HTTP","HTTPS"]}},{"name":"path","type":"String"},{"name":"httpHeaders","type":"Array","attributes":[{"name":null,"type":"Object","attributes":[{"name":"name","type":"String","required":true},{"name":"value","type":"String","required":true}]}]}]},{"name":"exec","type":"Object","attributes":[{"name":"command","type":"Array"}]},{"name":"tcpSocket","type":"Object","attributes":[{"name":"host","type":"String"},{"name":"port","type":"String","required":false}]},{"name":"grpc","type":"Object","attributes":[{"name":"port","type":"String","required":false},{"name":"service","type":"String"}]}]}]},{"type":"UnknownResource","model":"DefaultModel","icon":"question-mark"}]')}};function B(t){return B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},B(t)}function F(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function $(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=Array(e);n!!t&&"object"==typeof t&&t[rt]===X,ot=t=>!!t&&"object"==typeof t&&t[rt]===Q,at=t=>!!t&&"object"==typeof t&&t[rt]===Z,st=t=>!!t&&"object"==typeof t&&t[rt]===tt,ut=t=>!!t&&"object"==typeof t&&t[rt]===et,ct=t=>!!t&&"object"==typeof t&&t[rt]===nt;function lt(t){if(t&&"object"==typeof t)switch(t[rt]){case Z:case nt:return!0}return!1}function ft(t){if(t&&"object"==typeof t)switch(t[rt]){case X:case Z:case et:case nt:return!0}return!1}const ht=t=>(ut(t)||lt(t))&&!!t.anchor,pt=Symbol("break visit"),dt=Symbol("skip children"),mt=Symbol("remove node");function yt(t,e){const n=_t(e);ot(t)?gt(null,t.contents,n,Object.freeze([t]))===mt&&(t.contents=null):gt(null,t,n,Object.freeze([]))}function gt(t,e,n,r){const i=wt(t,e,n,r);if(ft(i)||st(i))return xt(t,r,i),gt(t,i,n,r);if("symbol"!=typeof i)if(lt(e)){r=Object.freeze(r.concat(e));for(let t=0;t"!==t[t.length-1]&&e("Verbatim tags must end with a >"),n)}const[,n,r]=t.match(/^(.*!)([^!]*)$/s);r||e(`The ${t} tag has no suffix`);const i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(t){return e(String(t)),null}return"!"===n?t:(e(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[e,n]of Object.entries(this.tags))if(t.startsWith(n))return e+t.substring(n.length).replace(/[!,[\]{}]/g,(t=>kt[t]));return"!"===t[0]?t:`!<${t}>`}toString(t){const e=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags);let r;if(t&&n.length>0&&ft(t.contents)){const e={};yt(t.contents,((t,n)=>{ft(n)&&n.tag&&(e[n.tag]=!0)})),r=Object.keys(e)}else r=[];for(const[i,o]of n)"!!"===i&&"tag:yaml.org,2002:"===o||t&&!r.some((t=>t.startsWith(o)))||e.push(`%TAG ${i} ${o}`);return e.join("\n")}}function St(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){const e=JSON.stringify(t);throw new Error(`Anchor must not contain whitespace or control characters: ${e}`)}return!0}function Et(t){const e=new Set;return yt(t,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function At(t,e){for(let n=1;;++n){const r=`${t}${n}`;if(!e.has(r))return r}}function Tt(t,e,n,r){if(r&&"object"==typeof r)if(Array.isArray(r))for(let e=0,n=r.length;eNt(t,String(e),n)));if(t&&"function"==typeof t.toJSON){if(!n||!ht(t))return t.toJSON(e,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(t,r),n.onCreate=t=>{r.res=t,delete n.onCreate};const i=t.toJSON(e,n);return n.onCreate&&n.onCreate(i),i}return"bigint"!=typeof t||n?.keep?t:Number(t)}Ot.defaultYaml={explicit:!1,version:"1.2"},Ot.defaultTags={"!!":"tag:yaml.org,2002:"};class Mt{constructor(t){Object.defineProperty(this,rt,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:e,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!ot(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:!0===e,mapKeyWarned:!1,maxAliasCount:"number"==typeof n?n:100},a=Nt(this,"",o);if("function"==typeof r)for(const{count:t,res:e}of o.anchors.values())r(e,t);return"function"==typeof i?Tt(i,{"":a},"",a):a}}class Ct extends Mt{constructor(t){super(X),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t){let e;return yt(t,{Node:(t,n)=>{if(n===this)return yt.BREAK;n.anchor===this.source&&(e=n)}}),e}toJSON(t,e){if(!e)return{source:this.source};const{anchors:n,doc:r,maxAliasCount:i}=e,o=this.resolve(r);if(!o){const t=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(t)}let a=n.get(o);if(a||(Nt(o,null,e),a=n.get(o)),!a||void 0===a.res)throw new ReferenceError("This should not happen: Alias anchor was not resolved?");if(i>=0&&(a.count+=1,0===a.aliasCount&&(a.aliasCount=jt(r,o,n)),a.count*a.aliasCount>i))throw new ReferenceError("Excessive alias count indicates a resource exhaustion attack");return a.res}toString(t,e,n){const r=`*${this.source}`;if(t){if(St(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const t=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(t)}if(t.implicitKey)return`${r} `}return r}}function jt(t,e,n){if(it(e)){const r=e.resolve(t),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(lt(e)){let r=0;for(const i of e.items){const e=jt(t,i,n);e>r&&(r=e)}return r}if(st(e)){const r=jt(t,e.key,n),i=jt(t,e.value,n);return Math.max(r,i)}return 1}const Pt=t=>!t||"function"!=typeof t&&"object"!=typeof t;class Lt extends Mt{constructor(t){super(et),this.value=t}toJSON(t,e){return e?.keep?this.value:Nt(this.value,t,e)}toString(){return String(this.value)}}Lt.BLOCK_FOLDED="BLOCK_FOLDED",Lt.BLOCK_LITERAL="BLOCK_LITERAL",Lt.PLAIN="PLAIN",Lt.QUOTE_DOUBLE="QUOTE_DOUBLE",Lt.QUOTE_SINGLE="QUOTE_SINGLE";const It="tag:yaml.org,2002:";function Dt(t,e,n){if(ot(t)&&(t=t.contents),ft(t))return t;if(st(t)){const e=n.schema[Z].createNode?.(n.schema,null,n);return e.items.push(t),e}(t instanceof String||t instanceof Number||t instanceof Boolean||"undefined"!=typeof BigInt&&t instanceof BigInt)&&(t=t.valueOf());const{aliasDuplicateObjects:r,onAnchor:i,onTagObj:o,schema:a,sourceObjects:s}=n;let u;if(r&&t&&"object"==typeof t){if(u=s.get(t),u)return u.anchor||(u.anchor=i(t)),new Ct(u.anchor);u={anchor:null,node:null},s.set(t,u)}e?.startsWith("!!")&&(e=It+e.slice(2));let c=function(t,e,n){if(e){const t=n.filter((t=>t.tag===e)),r=t.find((t=>!t.format))??t[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return n.find((e=>e.identify?.(t)&&!e.format))}(t,e,a.tags);if(!c){if(t&&"function"==typeof t.toJSON&&(t=t.toJSON()),!t||"object"!=typeof t){const e=new Lt(t);return u&&(u.node=e),e}c=t instanceof Map?a[Z]:Symbol.iterator in Object(t)?a[nt]:a[Z]}o&&(o(c),delete n.onTagObj);const l=c?.createNode?c.createNode(n.schema,t,n):"function"==typeof c?.nodeClass?.from?c.nodeClass.from(n.schema,t,n):new Lt(t);return e?l.tag=e:c.default||(l.tag=c.tag),u&&(u.node=l),l}function Rt(t,e,n){let r=n;for(let t=e.length-1;t>=0;--t){const n=e[t];if("number"==typeof n&&Number.isInteger(n)&&n>=0){const t=[];t[n]=r,r=t}else r=new Map([[n,r]])}return Dt(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}const Bt=t=>null==t||"object"==typeof t&&!!t[Symbol.iterator]().next().done;class Ft extends Mt{constructor(t,e){super(t),Object.defineProperty(this,"schema",{value:e,configurable:!0,enumerable:!1,writable:!0})}clone(t){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(e.schema=t),e.items=e.items.map((e=>ft(e)||st(e)?e.clone(t):e)),this.range&&(e.range=this.range.slice()),e}addIn(t,e){if(Bt(t))this.add(e);else{const[n,...r]=t,i=this.get(n,!0);if(lt(i))i.addIn(r,e);else{if(void 0!==i||!this.schema)throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`);this.set(n,Rt(this.schema,r,e))}}}deleteIn(t){const[e,...n]=t;if(0===n.length)return this.delete(e);const r=this.get(e,!0);if(lt(r))return r.deleteIn(n);throw new Error(`Expected YAML collection at ${e}. Remaining path: ${n}`)}getIn(t,e){const[n,...r]=t,i=this.get(n,!0);return 0===r.length?!e&&ut(i)?i.value:i:lt(i)?i.getIn(r,e):void 0}hasAllNullValues(t){return this.items.every((e=>{if(!st(e))return!1;const n=e.value;return null==n||t&&ut(n)&&null==n.value&&!n.commentBefore&&!n.comment&&!n.tag}))}hasIn(t){const[e,...n]=t;if(0===n.length)return this.has(e);const r=this.get(e,!0);return!!lt(r)&&r.hasIn(n)}setIn(t,e){const[n,...r]=t;if(0===r.length)this.set(n,e);else{const t=this.get(n,!0);if(lt(t))t.setIn(r,e);else{if(void 0!==t||!this.schema)throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`);this.set(n,Rt(this.schema,r,e))}}}}const $t=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function qt(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}const Ut=(t,e,n)=>t.endsWith("\n")?qt(n,e):n.includes("\n")?"\n"+qt(n,e):(t.endsWith(" ")?"":" ")+n,Kt="flow",zt="block",Vt="quoted";function Yt(t,e,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:o=20,onFold:a,onOverflow:s}={}){if(!i||i<0)return t;ii-Math.max(2,o)?c.push(0):p=i-r);let d=!1,m=-1,y=-1,g=-1;n===zt&&(m=Ht(t,m,e.length),-1!==m&&(p=m+u));for(let r;r=t[m+=1];){if(n===Vt&&"\\"===r){switch(y=m,t[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}g=m}if("\n"===r)n===zt&&(m=Ht(t,m,e.length)),p=m+e.length+u,f=void 0;else{if(" "===r&&h&&" "!==h&&"\n"!==h&&"\t"!==h){const e=t[m+1];e&&" "!==e&&"\n"!==e&&"\t"!==e&&(f=m)}if(m>=p)if(f)c.push(f),p=f+u,f=void 0;else if(n===Vt){for(;" "===h||"\t"===h;)h=r,r=t[m+=1],d=!0;const e=m>g+1?m-2:y-1;if(l[e])return t;c.push(e),l[e]=!0,p=e+u,f=void 0}else d=!0}h=r}if(d&&s&&s(),0===c.length)return t;a&&a();let v=t.slice(0,c[0]);for(let r=0;r({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Gt=t=>/^(%|---|\.\.\.)/m.test(t);function Jt(t,e){const n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=e,i=e.options.doubleQuotedMinMultiLineLength,o=e.indent||(Gt(t)?" ":"");let a="",s=0;for(let t=0,e=n[t];e;e=n[++t])if(" "===e&&"\\"===n[t+1]&&"n"===n[t+2]&&(a+=n.slice(s,t)+"\\ ",t+=1,s=t,e="\\"),"\\"===e)switch(n[t+1]){case"u":{a+=n.slice(s,t);const e=n.substr(t+2,4);switch(e){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:"00"===e.substr(0,2)?a+="\\x"+e.substr(2):a+=n.substr(t,6)}t+=5,s=t+1}break;case"n":if(r||'"'===n[t+2]||n.lengthr)return!0;if(n=e+1,i-n<=r)return!1}return!0}(n,u,c.length));if(!n)return l?"|\n":">\n";let f,h;for(h=n.length;h>0;--h){const t=n[h-1];if("\n"!==t&&"\t"!==t&&" "!==t)break}let p=n.substring(h);const d=p.indexOf("\n");-1===d?f="-":n===p||d!==p.length-1?(f="+",o&&o()):f="",p&&(n=n.slice(0,-p.length),"\n"===p[p.length-1]&&(p=p.slice(0,-1)),p=p.replace(Zt,`$&${c}`));let m,y=!1,g=-1;for(m=0;m")+(y?c?"2":"1":"")+f;return t&&(b+=" "+s(t.replace(/ ?[\r\n]+/g," ")),i&&i()),l?`${b}\n${c}${v}${n=n.replace(/\n+/g,`$&${c}`)}${p}`:`${b}\n${c}${Yt(`${v}${n=n.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`)}${p}`,c,zt,Wt(r,!0))}`}function ee(t,e,n,r){const{implicitKey:i,inFlow:o}=e,a="string"==typeof t.value?t:Object.assign({},t,{value:String(t.value)});let{type:s}=t;s!==Lt.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(s=Lt.QUOTE_DOUBLE);const u=t=>{switch(t){case Lt.BLOCK_FOLDED:case Lt.BLOCK_LITERAL:return i||o?Qt(a.value,e):te(a,e,n,r);case Lt.QUOTE_DOUBLE:return Jt(a.value,e);case Lt.QUOTE_SINGLE:return Xt(a.value,e);case Lt.PLAIN:return function(t,e,n,r){const{type:i,value:o}=t,{actualString:a,implicitKey:s,indent:u,indentStep:c,inFlow:l}=e;if(s&&o.includes("\n")||l&&/[[\]{},]/.test(o))return Qt(o,e);if(!o||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return s||l||!o.includes("\n")?Qt(o,e):te(t,e,n,r);if(!s&&!l&&i!==Lt.PLAIN&&o.includes("\n"))return te(t,e,n,r);if(Gt(o)){if(""===u)return e.forceBlockIndent=!0,te(t,e,n,r);if(s&&u===c)return Qt(o,e)}const f=o.replace(/\n+/g,`$&\n${u}`);if(a){const t=t=>t.default&&"tag:yaml.org,2002:str"!==t.tag&&t.test?.test(f),{compat:n,tags:r}=e.doc.schema;if(r.some(t)||n?.some(t))return Qt(o,e)}return s?f:Yt(f,u,Kt,Wt(e,!1))}(a,e,n,r);default:return null}};let c=u(s);if(null===c){const{defaultKeyType:t,defaultStringType:n}=e.options,r=i&&t||n;if(c=u(r),null===c)throw new Error(`Unsupported default string type ${r}`)}return c}function ne(t,e){const n=Object.assign({blockQuote:!0,commentString:$t,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e);let r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:"number"==typeof n.indent?" ".repeat(n.indent):" ",inFlow:r,options:n}}function re(t,e,n,r){if(st(t))return t.toString(e,n,r);if(it(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i;const o=ft(t)?t:e.doc.createNode(t,{onTagObj:t=>i=t});i||(i=function(t,e){if(e.tag){const n=t.filter((t=>t.tag===e.tag));if(n.length>0)return n.find((t=>t.format===e.format))??n[0]}let n,r;if(ut(e)){r=e.value;const i=t.filter((t=>t.identify?.(r)));n=i.find((t=>t.format===e.format))??i.find((t=>!t.format))}else r=e,n=t.find((t=>t.nodeClass&&r instanceof t.nodeClass));if(!n)throw new Error(`Tag not resolved for ${r?.constructor?.name??typeof r} value`);return n}(e.doc.schema.tags,o));const a=function(t,e,{anchors:n,doc:r}){if(!r.directives)return"";const i=[],o=(ut(t)||lt(t))&&t.anchor;o&&St(o)&&(n.add(o),i.push(`&${o}`));const a=t.tag?t.tag:e.default?null:e.tag;return a&&i.push(r.directives.tagString(a)),i.join(" ")}(o,i,e);a.length>0&&(e.indentAtStart=(e.indentAtStart??0)+a.length+1);const s="function"==typeof i.stringify?i.stringify(o,e,n,r):ut(o)?ee(o,e,n,r):o.toString(e,n,r);return a?ut(o)||"{"===s[0]||"["===s[0]?`${a} ${s}`:`${a}\n${e.indent}${s}`:s}function ie(t,e){"debug"!==t&&"warn"!==t||("undefined"!=typeof process&&process.emitWarning?process.emitWarning(e):console.warn(e))}function oe(t,e,{key:n,value:r}){if(t?.doc.schema.merge&&ae(n))if(r=it(r)?r.resolve(t.doc):r,ct(r))for(const n of r.items)se(t,e,n);else if(Array.isArray(r))for(const n of r)se(t,e,n);else se(t,e,r);else{const i=Nt(n,"",t);if(e instanceof Map)e.set(i,Nt(r,i,t));else if(e instanceof Set)e.add(i);else{const o=function(t,e,n){if(null===e)return"";if("object"!=typeof e)return String(e);if(ft(t)&&n?.doc){const e=ne(n.doc,{});e.anchors=new Set;for(const t of n.anchors.keys())e.anchors.add(t.anchor);e.inFlow=!0,e.inStringifyKey=!0;const r=t.toString(e);if(!n.mapKeyWarned){let t=JSON.stringify(r);t.length>40&&(t=t.substring(0,36)+'..."'),ie(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${t}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(e)}(n,i,t),a=Nt(r,o,t);o in e?Object.defineProperty(e,o,{value:a,writable:!0,enumerable:!0,configurable:!0}):e[o]=a}}return e}const ae=t=>"<<"===t||ut(t)&&"<<"===t.value&&(!t.type||t.type===Lt.PLAIN);function se(t,e,n){const r=t&&it(n)?n.resolve(t.doc):n;if(!at(r))throw new Error("Merge sources must be maps or map aliases");const i=r.toJSON(null,t,Map);for(const[t,n]of i)e instanceof Map?e.has(t)||e.set(t,n):e instanceof Set?e.add(t):Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0});return e}function ue(t,e,n){const r=Dt(t,void 0,n),i=Dt(e,void 0,n);return new ce(r,i)}class ce{constructor(t,e=null){Object.defineProperty(this,rt,{value:tt}),this.key=t,this.value=e}clone(t){let{key:e,value:n}=this;return ft(e)&&(e=e.clone(t)),ft(n)&&(n=n.clone(t)),new ce(e,n)}toJSON(t,e){return oe(e,e?.mapAsMap?new Map:{},this)}toString(t,e,n){return t?.doc?function({key:t,value:e},n,r,i){const{allNullValues:o,doc:a,indent:s,indentStep:u,options:{commentString:c,indentSeq:l,simpleKeys:f}}=n;let h=ft(t)&&t.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(lt(t)||!ft(t)&&"object"==typeof t)throw new Error("With simple keys, collection cannot be used as a key value")}let p=!f&&(!t||h&&null==e&&!n.inFlow||lt(t)||(ut(t)?t.type===Lt.BLOCK_FOLDED||t.type===Lt.BLOCK_LITERAL:"object"==typeof t));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(f||!o),indent:s+u});let d,m,y,g=!1,v=!1,b=re(t,n,(()=>g=!0),(()=>v=!0));if(!p&&!n.inFlow&&b.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(n.inFlow){if(o||null==e)return g&&r&&r(),""===b?"?":p?`? ${b}`:b}else if(o&&!f||null==e&&p)return b=`? ${b}`,h&&!g?b+=Ut(b,n.indent,c(h)):v&&i&&i(),b;g&&(h=null),p?(h&&(b+=Ut(b,n.indent,c(h))),b=`? ${b}\n${s}:`):(b=`${b}:`,h&&(b+=Ut(b,n.indent,c(h)))),ft(e)?(d=!!e.spaceBefore,m=e.commentBefore,y=e.comment):(d=!1,m=null,y=null,e&&"object"==typeof e&&(e=a.createNode(e))),n.implicitKey=!1,p||h||!ut(e)||(n.indentAtStart=b.length+1),v=!1,l||!(u.length>=2)||n.inFlow||p||!ct(e)||e.flow||e.tag||e.anchor||(n.indent=n.indent.substring(2));let _=!1;const w=re(e,n,(()=>_=!0),(()=>v=!0));let x=" ";if(h||d||m)x=d?"\n":"",m&&(x+=`\n${qt(c(m),n.indent)}`),""!==w||n.inFlow?x+=`\n${n.indent}`:"\n"===x&&(x="\n\n");else if(!p&<(e)){const t=w[0],r=w.indexOf("\n"),i=-1!==r,o=n.inFlow??e.flow??0===e.items.length;if(i||!o){let e=!1;if(i&&("&"===t||"!"===t)){let n=w.indexOf(" ");"&"===t&&-1!==n&&na=null),(()=>f=!0));a&&(s+=Ut(s,o,c(a))),f&&a&&(f=!1),h.push(r+s)}let p;if(0===h.length)p=i.start+i.end;else{p=h[0];for(let t=1;to=null));nl||a.includes("\n"))&&(c=!0),f.push(a),l=f.length}const{start:h,end:p}=n;if(0===f.length)return h+p;if(!c){const t=f.reduce(((t,e)=>t+e.length+2),2);c=e.options.lineWidth>0&&t>e.options.lineWidth}if(c){let t=h;for(const e of f)t+=e?`\n${o}${i}${e}`:"\n";return`${t}\n${i}${p}`}return`${h}${a}${f.join(" ")}${a}${p}`}function pe({indent:t,options:{commentString:e}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const i=qt(e(r),t);n.push(i.trimStart())}}function de(t,e){const n=ut(e)?e.value:e;for(const r of t)if(st(r)){if(r.key===e||r.key===n)return r;if(ut(r.key)&&r.key.value===n)return r}}class me extends Ft{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Z,t),this.items=[]}static from(t,e,n){const{keepUndefined:r,replacer:i}=n,o=new this(t),a=(t,a)=>{if("function"==typeof i)a=i.call(e,t,a);else if(Array.isArray(i)&&!i.includes(t))return;(void 0!==a||r)&&o.items.push(ue(t,a,n))};if(e instanceof Map)for(const[t,n]of e)a(t,n);else if(e&&"object"==typeof e)for(const t of Object.keys(e))a(t,e[t]);return"function"==typeof t.sortMapEntries&&o.items.sort(t.sortMapEntries),o}add(t,e){let n;n=st(t)?t:t&&"object"==typeof t&&"key"in t?new ce(t.key,t.value):new ce(t,t?.value);const r=de(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!e)throw new Error(`Key ${n.key} already set`);ut(r.value)&&Pt(n.value)?r.value.value=n.value:r.value=n.value}else if(i){const t=this.items.findIndex((t=>i(n,t)<0));-1===t?this.items.push(n):this.items.splice(t,0,n)}else this.items.push(n)}delete(t){const e=de(this.items,t);return!!e&&this.items.splice(this.items.indexOf(e),1).length>0}get(t,e){const n=de(this.items,t),r=n?.value;return(!e&&ut(r)?r.value:r)??void 0}has(t){return!!de(this.items,t)}set(t,e){this.add(new ce(t,e),!0)}toJSON(t,e,n){const r=n?new n:e?.mapAsMap?new Map:{};e?.onCreate&&e.onCreate(r);for(const t of this.items)oe(e,r,t);return r}toString(t,e,n){if(!t)return JSON.stringify(this);for(const t of this.items)if(!st(t))throw new Error(`Map items must all be pairs; found ${JSON.stringify(t)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),le(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:n,onComment:e})}}const ye={collection:"map",default:!0,nodeClass:me,tag:"tag:yaml.org,2002:map",resolve:(t,e)=>(at(t)||e("Expected a mapping for this tag"),t),createNode:(t,e,n)=>me.from(t,e,n)};class ge extends Ft{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(nt,t),this.items=[]}add(t){this.items.push(t)}delete(t){const e=ve(t);return"number"==typeof e&&this.items.splice(e,1).length>0}get(t,e){const n=ve(t);if("number"!=typeof n)return;const r=this.items[n];return!e&&ut(r)?r.value:r}has(t){const e=ve(t);return"number"==typeof e&&e=0?e:null}const be={collection:"seq",default:!0,nodeClass:ge,tag:"tag:yaml.org,2002:seq",resolve:(t,e)=>(ct(t)||e("Expected a sequence for this tag"),t),createNode:(t,e,n)=>ge.from(t,e,n)},_e={identify:t=>"string"==typeof t,default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:(t,e,n,r)=>ee(t,e=Object.assign({actualString:!0},e),n,r)},we={identify:t=>null==t,createNode:()=>new Lt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Lt(null),stringify:({source:t},e)=>"string"==typeof t&&we.test.test(t)?t:e.options.nullStr},xe={identify:t=>"boolean"==typeof t,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new Lt("t"===t[0]||"T"===t[0]),stringify:({source:t,value:e},n)=>t&&xe.test.test(t)&&e===("t"===t[0]||"T"===t[0])?t:e?n.options.trueStr:n.options.falseStr};function ke({format:t,minFractionDigits:e,tag:n,value:r}){if("bigint"==typeof r)return String(r);const i="number"==typeof r?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let o=JSON.stringify(r);if(!t&&e&&(!n||"tag:yaml.org,2002:float"===n)&&/^\d/.test(o)){let t=o.indexOf(".");t<0&&(t=o.length,o+=".");let n=e-(o.length-t-1);for(;n-- >0;)o+="0"}return o}const Oe={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>"nan"===t.slice(-3).toLowerCase()?NaN:"-"===t[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ke},Se={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){const e=Number(t.value);return isFinite(e)?e.toExponential():ke(t)}},Ee={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){const e=new Lt(parseFloat(t)),n=t.indexOf(".");return-1!==n&&"0"===t[t.length-1]&&(e.minFractionDigits=t.length-n-1),e},stringify:ke},Ae=t=>"bigint"==typeof t||Number.isInteger(t),Te=(t,e,n,{intAsBigInt:r})=>r?BigInt(t):parseInt(t.substring(e),n);function Ne(t,e,n){const{value:r}=t;return Ae(r)&&r>=0?n+r.toString(e):ke(t)}const Me={identify:t=>Ae(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>Te(t,2,8,n),stringify:t=>Ne(t,8,"0o")},Ce={identify:Ae,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>Te(t,0,10,n),stringify:ke},je={identify:t=>Ae(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>Te(t,2,16,n),stringify:t=>Ne(t,16,"0x")},Pe=[ye,be,_e,we,xe,Me,Ce,je,Oe,Se,Ee];function Le(t){return"bigint"==typeof t||Number.isInteger(t)}const Ie=({value:t})=>JSON.stringify(t),De=[{identify:t=>"string"==typeof t,default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Ie},{identify:t=>null==t,createNode:()=>new Lt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Ie},{identify:t=>"boolean"==typeof t,default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:t=>"true"===t,stringify:Ie},{identify:Le,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:n})=>n?BigInt(t):parseInt(t,10),stringify:({value:t})=>Le(t)?t.toString():JSON.stringify(t)},{identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Ie}],Re={default:!0,tag:"",test:/^/,resolve:(t,e)=>(e(`Unresolved plain scalar ${JSON.stringify(t)}`),t)},Be=[ye,be].concat(De,Re),Fe={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if("function"==typeof Buffer)return Buffer.from(t,"base64");if("function"==typeof atob){const e=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(e.length);for(let t=0;t1&&e("Each pair must have its own sequence indicator");const t=r.items[0]||new ce(new Lt(null));if(r.commentBefore&&(t.key.commentBefore=t.key.commentBefore?`${r.commentBefore}\n${t.key.commentBefore}`:r.commentBefore),r.comment){const e=t.value??t.key;e.comment=e.comment?`${r.comment}\n${e.comment}`:r.comment}r=t}t.items[n]=st(r)?r:new ce(r)}}else e("Expected a sequence for this tag");return t}function qe(t,e,n){const{replacer:r}=n,i=new ge(t);i.tag="tag:yaml.org,2002:pairs";let o=0;if(e&&Symbol.iterator in Object(e))for(let t of e){let a,s;if("function"==typeof r&&(t=r.call(e,String(o++),t)),Array.isArray(t)){if(2!==t.length)throw new TypeError(`Expected [key, value] tuple: ${t}`);a=t[0],s=t[1]}else if(t&&t instanceof Object){const e=Object.keys(t);if(1!==e.length)throw new TypeError(`Expected tuple with one key, not ${e.length} keys`);a=e[0],s=t[a]}else a=t;i.items.push(ue(a,s,n))}return i}const Ue={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:$e,createNode:qe};class Ke extends ge{constructor(){super(),this.add=me.prototype.add.bind(this),this.delete=me.prototype.delete.bind(this),this.get=me.prototype.get.bind(this),this.has=me.prototype.has.bind(this),this.set=me.prototype.set.bind(this),this.tag=Ke.tag}toJSON(t,e){if(!e)return super.toJSON(t);const n=new Map;e?.onCreate&&e.onCreate(n);for(const t of this.items){let r,i;if(st(t)?(r=Nt(t.key,"",e),i=Nt(t.value,r,e)):r=Nt(t,"",e),n.has(r))throw new Error("Ordered maps must not include duplicate keys");n.set(r,i)}return n}static from(t,e,n){const r=qe(t,e,n),i=new this;return i.items=r.items,i}}Ke.tag="tag:yaml.org,2002:omap";const ze={collection:"seq",identify:t=>t instanceof Map,nodeClass:Ke,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){const n=$e(t,e),r=[];for(const{key:t}of n.items)ut(t)&&(r.includes(t.value)?e(`Ordered maps must not include duplicate keys: ${t.value}`):r.push(t.value));return Object.assign(new Ke,n)},createNode:(t,e,n)=>Ke.from(t,e,n)};function Ve({value:t,source:e},n){return e&&(t?Ye:He).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}const Ye={identify:t=>!0===t,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Lt(!0),stringify:Ve},He={identify:t=>!1===t,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Lt(!1),stringify:Ve},We={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>"nan"===t.slice(-3).toLowerCase()?NaN:"-"===t[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ke},Ge={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){const e=Number(t.value);return isFinite(e)?e.toExponential():ke(t)}},Je={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){const e=new Lt(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(-1!==n){const r=t.substring(n+1).replace(/_/g,"");"0"===r[r.length-1]&&(e.minFractionDigits=r.length)}return e},stringify:ke},Xe=t=>"bigint"==typeof t||Number.isInteger(t);function Qe(t,e,n,{intAsBigInt:r}){const i=t[0];if("-"!==i&&"+"!==i||(e+=1),t=t.substring(e).replace(/_/g,""),r){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`}const e=BigInt(t);return"-"===i?BigInt(-1)*e:e}const o=parseInt(t,n);return"-"===i?-1*o:o}function Ze(t,e,n){const{value:r}=t;if(Xe(r)){const t=r.toString(e);return r<0?"-"+n+t.substr(1):n+t}return ke(t)}const tn={identify:Xe,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>Qe(t,2,2,n),stringify:t=>Ze(t,2,"0b")},en={identify:Xe,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>Qe(t,1,8,n),stringify:t=>Ze(t,8,"0")},nn={identify:Xe,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>Qe(t,0,10,n),stringify:ke},rn={identify:Xe,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>Qe(t,2,16,n),stringify:t=>Ze(t,16,"0x")};class on extends me{constructor(t){super(t),this.tag=on.tag}add(t){let e;e=st(t)?t:t&&"object"==typeof t&&"key"in t&&"value"in t&&null===t.value?new ce(t.key,null):new ce(t,null),de(this.items,e.key)||this.items.push(e)}get(t,e){const n=de(this.items,t);return!e&&st(n)?ut(n.key)?n.key.value:n.key:n}set(t,e){if("boolean"!=typeof e)throw new Error("Expected boolean value for set(key, value) in a YAML set, not "+typeof e);const n=de(this.items,t);n&&!e?this.items.splice(this.items.indexOf(n),1):!n&&e&&this.items.push(new ce(t))}toJSON(t,e){return super.toJSON(t,e,Set)}toString(t,e,n){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),e,n);throw new Error("Set items must all have null values")}static from(t,e,n){const{replacer:r}=n,i=new this(t);if(e&&Symbol.iterator in Object(e))for(let t of e)"function"==typeof r&&(t=r.call(e,t,t)),i.items.push(ue(t,null,n));return i}}on.tag="tag:yaml.org,2002:set";const an={collection:"map",identify:t=>t instanceof Set,nodeClass:on,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>on.from(t,e,n),resolve(t,e){if(at(t)){if(t.hasAllNullValues(!0))return Object.assign(new on,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};function sn(t,e){const n=t[0],r="-"===n||"+"===n?t.substring(1):t,i=t=>e?BigInt(t):Number(t),o=r.replace(/_/g,"").split(":").reduce(((t,e)=>t*i(60)+i(e)),i(0));return"-"===n?i(-1)*o:o}function un(t){let{value:e}=t,n=t=>t;if("bigint"==typeof e)n=t=>BigInt(t);else if(isNaN(e)||!isFinite(e))return ke(t);let r="";e<0&&(r="-",e*=n(-1));const i=n(60),o=[e%i];return e<60?o.unshift(0):(e=(e-o[0])/i,o.unshift(e%i),e>=60&&(e=(e-o[0])/i,o.unshift(e))),r+o.map((t=>String(t).padStart(2,"0"))).join(":").replace(/000000\d*$/,"")}const cn={identify:t=>"bigint"==typeof t||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:n})=>sn(t,n),stringify:un},ln={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>sn(t,!1),stringify:un},fn={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){const e=t.match(fn.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,i,o,a,s]=e.map(Number),u=e[7]?Number((e[7]+"00").substr(1,3)):0;let c=Date.UTC(n,r-1,i,o||0,a||0,s||0,u);const l=e[8];if(l&&"Z"!==l){let t=sn(l,!1);Math.abs(t)<30&&(t*=60),c-=6e4*t}return new Date(c)},stringify:({value:t})=>t.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")},hn=[ye,be,_e,we,Ye,He,tn,en,nn,rn,We,Ge,Je,Fe,ze,Ue,an,cn,ln,fn],pn=new Map([["core",Pe],["failsafe",[ye,be,_e]],["json",Be],["yaml11",hn],["yaml-1.1",hn]]),dn={binary:Fe,bool:xe,float:Ee,floatExp:Se,floatNaN:Oe,floatTime:ln,int:Ce,intHex:je,intOct:Me,intTime:cn,map:ye,null:we,omap:ze,pairs:Ue,seq:be,set:an,timestamp:fn},mn={"tag:yaml.org,2002:binary":Fe,"tag:yaml.org,2002:omap":ze,"tag:yaml.org,2002:pairs":Ue,"tag:yaml.org,2002:set":an,"tag:yaml.org,2002:timestamp":fn};function yn(t,e){let n=pn.get(e);if(!n){if(!Array.isArray(t)){const t=Array.from(pn.keys()).filter((t=>"yaml11"!==t)).map((t=>JSON.stringify(t))).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${t} or define customTags array`)}n=[]}if(Array.isArray(t))for(const e of t)n=n.concat(e);else"function"==typeof t&&(n=t(n.slice()));return n.map((t=>{if("string"!=typeof t)return t;const e=dn[t];if(e)return e;const n=Object.keys(dn).map((t=>JSON.stringify(t))).join(", ");throw new Error(`Unknown custom tag "${t}"; use one of ${n}`)}))}const gn=(t,e)=>t.keye.key?1:0;class vn{constructor({compat:t,customTags:e,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(t)?yn(t,"compat"):t?yn(null,t):null,this.merge=!!n,this.name="string"==typeof i&&i||"core",this.knownTags=r?mn:{},this.tags=yn(e,this.name),this.toStringOptions=a??null,Object.defineProperty(this,Z,{value:ye}),Object.defineProperty(this,et,{value:_e}),Object.defineProperty(this,nt,{value:be}),this.sortMapEntries="function"==typeof o?o:!0===o?gn:null}clone(){const t=Object.create(vn.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}class bn{constructor(t,e,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,rt,{value:Q});let r=null;"function"==typeof e||Array.isArray(e)?r=e:void 0===n&&e&&(n=e,e=void 0);const i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,uniqueKeys:!0,version:"1.2"},n);this.options=i;let{version:o}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Ot({version:o}),this.setSchema(o,n),this.contents=void 0===t?null:this.createNode(t,r,n)}clone(){const t=Object.create(bn.prototype,{[rt]:{value:Q}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=ft(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){_n(this.contents)&&this.contents.add(t)}addIn(t,e){_n(this.contents)&&this.contents.addIn(t,e)}createAlias(t,e){if(!t.anchor){const n=Et(this);t.anchor=!e||n.has(e)?At(e||"a",n):e}return new Ct(t.anchor)}createNode(t,e,n){let r;if("function"==typeof e)t=e.call({"":t},"",t),r=e;else if(Array.isArray(e)){const t=t=>"number"==typeof t||t instanceof String||t instanceof Number,n=e.filter(t).map(String);n.length>0&&(e=e.concat(n)),r=e}else void 0===n&&e&&(n=e,e=void 0);const{aliasDuplicateObjects:i,anchorPrefix:o,flow:a,keepUndefined:s,onTagObj:u,tag:c}=n??{},{onAnchor:l,setAnchors:f,sourceObjects:h}=function(t,e){const n=[],r=new Map;let i=null;return{onAnchor:r=>{n.push(r),i||(i=Et(t));const o=At(e,i);return i.add(o),o},setAnchors:()=>{for(const t of n){const e=r.get(t);if("object"!=typeof e||!e.anchor||!ut(e.node)&&!lt(e.node)){const e=new Error("Failed to resolve repeated object (this should not happen)");throw e.source=t,e}e.node.anchor=e.anchor}},sourceObjects:r}}(this,o||"a"),p=Dt(t,c,{aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:l,onTagObj:u,replacer:r,schema:this.schema,sourceObjects:h});return a&<(p)&&(p.flow=!0),f(),p}createPair(t,e,n={}){const r=this.createNode(t,null,n),i=this.createNode(e,null,n);return new ce(r,i)}delete(t){return!!_n(this.contents)&&this.contents.delete(t)}deleteIn(t){return Bt(t)?null!=this.contents&&(this.contents=null,!0):!!_n(this.contents)&&this.contents.deleteIn(t)}get(t,e){return lt(this.contents)?this.contents.get(t,e):void 0}getIn(t,e){return Bt(t)?!e&&ut(this.contents)?this.contents.value:this.contents:lt(this.contents)?this.contents.getIn(t,e):void 0}has(t){return!!lt(this.contents)&&this.contents.has(t)}hasIn(t){return Bt(t)?void 0!==this.contents:!!lt(this.contents)&&this.contents.hasIn(t)}set(t,e){null==this.contents?this.contents=Rt(this.schema,[t],e):_n(this.contents)&&this.contents.set(t,e)}setIn(t,e){Bt(t)?this.contents=e:null==this.contents?this.contents=Rt(this.schema,Array.from(t),e):_n(this.contents)&&this.contents.setIn(t,e)}setSchema(t,e={}){let n;switch("number"==typeof t&&(t=String(t)),t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Ot({version:"1.1"}),n={merge:!0,resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new Ot({version:t}),n={merge:!1,resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{const e=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${e}`)}}if(e.schema instanceof Object)this.schema=e.schema;else{if(!n)throw new Error("With a null YAML version, the { schema: Schema } option is required");this.schema=new vn(Object.assign(n,e))}}toJS({json:t,jsonArg:e,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:o}={}){const a={anchors:new Map,doc:this,keep:!t,mapAsMap:!0===n,mapKeyWarned:!1,maxAliasCount:"number"==typeof r?r:100},s=Nt(this.contents,e??"",a);if("function"==typeof i)for(const{count:t,res:e}of a.anchors.values())i(e,t);return"function"==typeof o?Tt(o,{"":s},"",s):s}toJSON(t,e){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:e})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const e=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${e}`)}return function(t,e){const n=[];let r=!0===e.directives;if(!1!==e.directives&&t.directives){const e=t.directives.toString(t);e?(n.push(e),r=!0):t.directives.docStart&&(r=!0)}r&&n.push("---");const i=ne(t,e),{commentString:o}=i.options;if(t.commentBefore){1!==n.length&&n.unshift("");const e=o(t.commentBefore);n.unshift(qt(e,""))}let a=!1,s=null;if(t.contents){if(ft(t.contents)){if(t.contents.spaceBefore&&r&&n.push(""),t.contents.commentBefore){const e=o(t.contents.commentBefore);n.push(qt(e,""))}i.forceBlockIndent=!!t.comment,s=t.contents.comment}const e=s?void 0:()=>a=!0;let u=re(t.contents,i,(()=>s=null),e);s&&(u+=Ut(u,"",o(s))),"|"!==u[0]&&">"!==u[0]||"---"!==n[n.length-1]?n.push(u):n[n.length-1]=`--- ${u}`}else n.push(re(t.contents,i));if(t.directives?.docEnd)if(t.comment){const e=o(t.comment);e.includes("\n")?(n.push("..."),n.push(qt(e,""))):n.push(`... ${e}`)}else n.push("...");else{let e=t.comment;e&&a&&(e=e.replace(/^\n+/,"")),e&&(a&&!s||""===n[n.length-1]||n.push(""),n.push(qt(o(e),"")))}return n.join("\n")+"\n"}(this,t)}}function _n(t){if(lt(t))return!0;throw new Error("Expected a YAML collection as document contents")}class wn extends Error{constructor(t,e,n,r){super(),this.name=t,this.code=n,this.message=r,this.pos=e}}class xn extends wn{constructor(t,e,n){super("YAMLParseError",t,e,n)}}class kn extends wn{constructor(t,e,n){super("YAMLWarning",t,e,n)}}const On=(t,e)=>n=>{if(-1===n.pos[0])return;n.linePos=n.pos.map((t=>e.linePos(t)));const{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let o=i-1,a=t.substring(e.lineStarts[r-1],e.lineStarts[r]).replace(/[\n\r]+$/,"");if(o>=60&&a.length>80){const t=Math.min(o-39,a.length-79);a="…"+a.substring(t),o-=t-1}if(a.length>80&&(a=a.substring(0,79)+"…"),r>1&&/^ *$/.test(a.substring(0,o))){let n=t.substring(e.lineStarts[r-2],e.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+"…\n"),a=n+a}if(/[^ ]/.test(a)){let t=1;const e=n.linePos[1];e&&e.line===r&&e.col>i&&(t=Math.max(1,Math.min(e.col-i,80-o)));const s=" ".repeat(o)+"^".repeat(t);n.message+=`:\n\n${a}\n${s}\n`}};function Sn(t,{flow:e,indicator:n,next:r,offset:i,onError:o,parentIndent:a,startOnNewline:s}){let u=!1,c=s,l=s,f="",h="",p=!1,d=!1,m=null,y=null,g=null,v=null,b=null,_=null,w=null;for(const i of t)switch(d&&("space"!==i.type&&"newline"!==i.type&&"comma"!==i.type&&o(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),d=!1),m&&(c&&"comment"!==i.type&&"newline"!==i.type&&o(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),m=null),i.type){case"space":e||"doc-start"===n&&"flow-collection"===r?.type||!i.source.includes("\t")||(m=i),l=!0;break;case"comment":{l||o(i,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const t=i.source.substring(1)||" ";f?f+=h+t:f=t,h="",c=!1;break}case"newline":c?f?f+=i.source:u=!0:h+=i.source,c=!0,p=!0,(y||g)&&(v=i),l=!0;break;case"anchor":y&&o(i,"MULTIPLE_ANCHORS","A node can have at most one anchor"),i.source.endsWith(":")&&o(i.offset+i.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),y=i,null===w&&(w=i.offset),c=!1,l=!1,d=!0;break;case"tag":g&&o(i,"MULTIPLE_TAGS","A node can have at most one tag"),g=i,null===w&&(w=i.offset),c=!1,l=!1,d=!0;break;case n:(y||g)&&o(i,"BAD_PROP_ORDER",`Anchors and tags must be after the ${i.source} indicator`),_&&o(i,"UNEXPECTED_TOKEN",`Unexpected ${i.source} in ${e??"collection"}`),_=i,c="seq-item-ind"===n||"explicit-key-ind"===n,l=!1;break;case"comma":if(e){b&&o(i,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),b=i,c=!1,l=!1;break}default:o(i,"UNEXPECTED_TOKEN",`Unexpected ${i.type} token`),c=!1,l=!1}const x=t[t.length-1],k=x?x.offset+x.source.length:i;return d&&r&&"space"!==r.type&&"newline"!==r.type&&"comma"!==r.type&&("scalar"!==r.type||""!==r.source)&&o(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m&&(c&&m.indent<=a||"block-map"===r?.type||"block-seq"===r?.type)&&o(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:_,spaceBefore:u,comment:f,hasNewline:p,anchor:y,tag:g,newlineAfterProp:v,end:k,start:w??k}}function En(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes("\n"))return!0;if(t.end)for(const e of t.end)if("newline"===e.type)return!0;return!1;case"flow-collection":for(const e of t.items){for(const t of e.start)if("newline"===t.type)return!0;if(e.sep)for(const t of e.sep)if("newline"===t.type)return!0;if(En(e.key)||En(e.value))return!0}return!1;default:return!0}}function An(t,e,n){if("flow-collection"===e?.type){const r=e.end[0];r.indent!==t||"]"!==r.source&&"}"!==r.source||!En(e)||n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Tn(t,e,n){const{uniqueKeys:r}=t.options;if(!1===r)return!1;const i="function"==typeof r?r:(e,n)=>e===n||ut(e)&&ut(n)&&e.value===n.value&&!("<<"===e.value&&t.schema.merge);return e.some((t=>i(t.key,n)))}const Nn="All mapping items must start at the same column";function Mn(t,e,n,r){let i="";if(t){let o=!1,a="";for(const s of t){const{source:t,type:u}=s;switch(u){case"space":o=!0;break;case"comment":{n&&!o&&r(s,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const e=t.substring(1)||" ";i?i+=a+e:i=e,a="";break}case"newline":i&&(a+=t),o=!0;break;default:r(s,"UNEXPECTED_TOKEN",`Unexpected ${u} at node end`)}e+=t.length}}return{comment:i,offset:e}}const Cn="Block collections are not allowed within flow collections",jn=t=>t&&("block-map"===t.type||"block-seq"===t.type);function Pn(t,e,n,r,i,o){const a="block-map"===n.type?function({composeNode:t,composeEmptyNode:e},n,r,i,o){const a=new(o?.nodeClass??me)(n.schema);n.atRoot&&(n.atRoot=!1);let s=r.offset,u=null;for(const o of r.items){const{start:c,key:l,sep:f,value:h}=o,p=Sn(c,{indicator:"explicit-key-ind",next:l??f?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),d=!p.found;if(d){if(l&&("block-seq"===l.type?i(s,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in l&&l.indent!==r.indent&&i(s,"BAD_INDENT",Nn)),!p.anchor&&!p.tag&&!f){u=p.end,p.comment&&(a.comment?a.comment+="\n"+p.comment:a.comment=p.comment);continue}(p.newlineAfterProp||En(l))&&i(l??c[c.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else p.found?.indent!==r.indent&&i(s,"BAD_INDENT",Nn);const m=p.end,y=l?t(n,l,p,i):e(n,m,c,null,p,i);n.schema.compat&&An(r.indent,l,i),Tn(n,a.items,y)&&i(m,"DUPLICATE_KEY","Map keys must be unique");const g=Sn(f??[],{indicator:"map-value-ind",next:h,offset:y.range[2],onError:i,parentIndent:r.indent,startOnNewline:!l||"block-scalar"===l.type});if(s=g.end,g.found){d&&("block-map"!==h?.type||g.hasNewline||i(s,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&p.start0){const t=Mn(p,d,n.options.strict,i);t.comment&&(u.comment?u.comment+="\n"+t.comment:u.comment=t.comment),u.range=[r.offset,d,t.offset]}else u.range=[r.offset,d,d];return u}(t,e,n,r,o),s=a.constructor;return"!"===i||i===s.tagName?(a.tag=s.tagName,a):(i&&(a.tag=i),a)}function Ln(t){let e,n;try{e=new RegExp("(.*?)(?"===i.mode?Lt.BLOCK_FOLDED:Lt.BLOCK_LITERAL,a=e.source?function(t){const e=t.split(/\n( *)/),n=e[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let t=1;t=0;--t){const e=a[t][1];if(""!==e&&"\r"!==e)break;s=t}if(0===s){const t="+"===i.chomp&&a.length>0?"\n".repeat(Math.max(1,a.length-1)):"";let n=r+i.length;return e.source&&(n+=e.source.length),{value:t,type:o,comment:i.comment,range:[r,n,n]}}let u=e.indent+i.indent,c=e.offset+i.length,l=0;for(let e=0;eu&&(u=r.length),c+=r.length+o.length+1}for(let t=a.length-1;t>=s;--t)a[t][0].length>u&&(s=t+1);let f="",h="",p=!1;for(let t=0;tu||"\t"===r[0]?(" "===h?h="\n":p||"\n"!==h||(h="\n\n"),f+=h+e.slice(u)+r,h="\n",p=!0):""===r?"\n"===h?f+="\n":h="\n":(f+=h+r,h=" ",p=!1)}switch(i.chomp){case"-":break;case"+":for(let t=s;tn(r+t,e,i);switch(i){case"scalar":s=Lt.PLAIN,u=function(t,e){let n="";switch(t[0]){case"\t":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":n=`block scalar indicator ${t[0]}`;break;case"@":case"`":n=`reserved character ${t[0]}`}return n&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),Ln(t)}(o,c);break;case"single-quoted-scalar":s=Lt.QUOTE_SINGLE,u=function(t,e){return"'"===t[t.length-1]&&1!==t.length||e(t.length,"MISSING_CHAR","Missing closing 'quote"),Ln(t.slice(1,-1)).replace(/''/g,"'")}(o,c);break;case"double-quoted-scalar":s=Lt.QUOTE_DOUBLE,u=function(t,e){let n="";for(let r=1;re?t.slice(e,r+1):i)}else n+=i}return'"'===t[t.length-1]&&1!==t.length||e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}(o,c);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+o.length,r+o.length]}}const l=r+o.length,f=Mn(a,l,e,n);return{value:u,type:s,comment:f.comment,range:[r,l,f.offset]}}(e,t.options.strict,r),u=n?t.directives.tagName(n.source,(t=>r(n,"TAG_RESOLVE_FAILED",t))):null,c=n&&u?function(t,e,n,r,i){if("!"===n)return t[et];const o=[];for(const e of t.tags)if(!e.collection&&e.tag===n){if(!e.default||!e.test)return e;o.push(e)}for(const t of o)if(t.test?.test(e))return t;const a=t.knownTags[n];return a&&!a.collection?(t.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,"tag:yaml.org,2002:str"!==n),t[et])}(t.schema,i,u,n,r):"scalar"===e.type?function({directives:t,schema:e},n,r,i){const o=e.tags.find((t=>t.default&&t.test?.test(n)))||e[et];if(e.compat){const a=e.compat.find((t=>t.default&&t.test?.test(n)))??e[et];o.tag!==a.tag&&i(r,"TAG_RESOLVE_FAILED",`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(a.tag)}`,!0)}return o}(t,i,e,r):t.schema[et];let l;try{const o=c.resolve(i,(t=>r(n??e,"TAG_RESOLVE_FAILED",t)),t.options);l=ut(o)?o:new Lt(o)}catch(t){const o=t instanceof Error?t.message:String(t);r(n??e,"TAG_RESOLVE_FAILED",o),l=new Lt(i)}return l.range=s,l.source=i,o&&(l.type=o),u&&(l.tag=u),c.format&&(l.format=c.format),a&&(l.comment=a),l}function Fn(t,e,n){if(e){null===n&&(n=e.length);for(let r=n-1;r>=0;--r){let n=e[r];switch(n.type){case"space":case"comment":case"newline":t-=n.source.length;continue}for(n=e[++r];"space"===n?.type;)t+=n.source.length,n=e[++r];break}}return t}const $n={composeNode:qn,composeEmptyNode:Un};function qn(t,e,n,r){const{spaceBefore:i,comment:o,anchor:a,tag:s}=n;let u,c=!0;switch(e.type){case"alias":u=function({options:t},{offset:e,source:n,end:r},i){const o=new Ct(n.substring(1));""===o.source&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&i(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const a=e+n.length,s=Mn(r,a,t.strict,i);return o.range=[e,a,s.offset],s.comment&&(o.comment=s.comment),o}(t,e,r),(a||s)&&r(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":u=Bn(t,e,s,r),a&&(u.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":u=function(t,e,n,r,i){const o=r.tag,a=o?e.directives.tagName(o.source,(t=>i(o,"TAG_RESOLVE_FAILED",t))):null;if("block-seq"===n.type){const{anchor:t,newlineAfterProp:e}=r,n=t&&o?t.offset>o.offset?t:o:t??o;n&&(!e||e.offsett.tag===a&&t.collection===s));if(!u){const r=e.schema.knownTags[a];if(!r||r.collection!==s)return r?.collection?i(o,"BAD_COLLECTION_TYPE",`${r.tag} used for ${s} collection, but expects ${r.collection}`,!0):i(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),Pn(t,e,n,i,a);e.schema.tags.push(Object.assign({},r,{default:!1})),u=r}const c=Pn(t,e,n,i,a,u),l=u.resolve?.(c,(t=>i(o,"TAG_RESOLVE_FAILED",t)),e.options)??c,f=ft(l)?l:new Lt(l);return f.range=c.range,f.tag=a,u?.format&&(f.format=u.format),f}($n,t,e,n,r),a&&(u.anchor=a.source.substring(1));break;default:r(e,"UNEXPECTED_TOKEN","error"===e.type?e.message:`Unsupported token (type: ${e.type})`),u=Un(t,e.offset,void 0,null,n,r),c=!1}return a&&""===u.anchor&&r(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&(u.spaceBefore=!0),o&&("scalar"===e.type&&""===e.source?u.comment=o:u.commentBefore=o),t.options.keepSourceTokens&&c&&(u.srcToken=e),u}function Un(t,e,n,r,{spaceBefore:i,comment:o,anchor:a,tag:s,end:u},c){const l=Bn(t,{type:"scalar",offset:Fn(e,n,r),indent:-1,source:""},s,c);return a&&(l.anchor=a.source.substring(1),""===l.anchor&&c(a,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(l.spaceBefore=!0),o&&(l.comment=o,l.range[2]=u),l}function Kn(t){if("number"==typeof t)return[t,t+1];if(Array.isArray(t))return 2===t.length?t:[t[0],t[1]];const{offset:e,source:n}=t;return[e,e+("string"==typeof n?n.length:1)]}function zn(t){let e="",n=!1,r=!1;for(let i=0;i{const i=Kn(t);r?this.warnings.push(new kn(i,e,n)):this.errors.push(new xn(i,e,n))},this.directives=new Ot({version:t.version||"1.2"}),this.options=t}decorate(t,e){const{comment:n,afterEmptyLine:r}=zn(this.prelude);if(n){const i=t.contents;if(e)t.comment=t.comment?`${t.comment}\n${n}`:n;else if(r||t.directives.docStart||!i)t.commentBefore=n;else if(lt(i)&&!i.flow&&i.items.length>0){let t=i.items[0];st(t)&&(t=t.key);const e=t.commentBefore;t.commentBefore=e?`${n}\n${e}`:n}else{const t=i.commentBefore;i.commentBefore=t?`${n}\n${t}`:n}}e?(Array.prototype.push.apply(t.errors,this.errors),Array.prototype.push.apply(t.warnings,this.warnings)):(t.errors=this.errors,t.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:zn(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,e=!1,n=-1){for(const e of t)yield*this.next(e);yield*this.end(e,n)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,((e,n,r)=>{const i=Kn(t);i[0]+=e,this.onError(i,"BAD_DIRECTIVE",n,r)})),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const e=function(t,e,{offset:n,start:r,value:i,end:o},a){const s=Object.assign({_directives:e},t),u=new bn(void 0,s),c={atRoot:!0,directives:u.directives,options:u.options,schema:u.schema},l=Sn(r,{indicator:"doc-start",next:i??o?.[0],offset:n,onError:a,parentIndent:0,startOnNewline:!0});l.found&&(u.directives.docStart=!0,!i||"block-map"!==i.type&&"block-seq"!==i.type||l.hasNewline||a(l.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),u.contents=i?qn(c,i,l,a):Un(c,l.end,r,null,l,a);const f=u.contents.range[2],h=Mn(o,f,!1,a);return h.comment&&(u.comment=h.comment),u.range=[n,f,h.offset],u}(this.options,this.directives,t,this.onError);this.atDirectives&&!e.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(e,!1),this.doc&&(yield this.doc),this.doc=e,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const e=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,n=new xn(Kn(t),"UNEXPECTED_TOKEN",e);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){const e="Unexpected doc-end without preceding document";this.errors.push(new xn(Kn(t),"UNEXPECTED_TOKEN",e));break}this.doc.directives.docEnd=!0;const e=Mn(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),e.comment){const t=this.doc.comment;this.doc.comment=t?`${t}\n${e.comment}`:e.comment}this.doc.range[2]=e.offset;break}default:this.errors.push(new xn(Kn(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,e=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const t=Object.assign({_directives:this.directives},this.options),n=new bn(void 0,t);this.atDirectives&&this.onError(e,"MISSING_CHAR","Missing directives-end indicator line"),n.range=[0,e,e],this.decorate(n,!1),yield n}}}const Yn=Symbol("break visit"),Hn=Symbol("skip children"),Wn=Symbol("remove item");function Gn(t,e){"type"in t&&"document"===t.type&&(t={start:t.start,value:t.value}),Jn(Object.freeze([]),t,e)}function Jn(t,e,n){let r=n(e,t);if("symbol"==typeof r)return r;for(const i of["key","value"]){const o=e[i];if(o&&"items"in o){for(let e=0;e{let n=t;for(const[t,r]of e){const e=n?.[t];if(!e||!("items"in e))return;n=e.items[r]}return n},Gn.parentCollection=(t,e)=>{const n=Gn.itemAtPath(t,e.slice(0,-1)),r=e[e.length-1][0],i=n?.[r];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function Xn(t){switch(t){case void 0:case" ":case"\n":case"\r":case"\t":return!0;default:return!1}}const Qn=new Set("0123456789ABCDEFabcdef"),Zn=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),tr=new Set(",[]{}"),er=new Set(" ,[]{}\n\r\t"),nr=t=>!t||er.has(t);class rr{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,e=!1){if(t){if("string"!=typeof t)throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!e;let n=this.next??"stream";for(;n&&(e||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let t=this.pos,e=this.buffer[t];for(;" "===e||"\t"===e;)e=this.buffer[++t];return!e||"#"===e||"\n"===e||"\r"===e&&"\n"===this.buffer[t+1]}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let e=this.buffer[t];if(this.indentNext>0){let n=0;for(;" "===e;)e=this.buffer[++n+t];if("\r"===e){const e=this.buffer[n+t+1];if("\n"===e||!e&&!this.atEnd)return t+n+1}return"\n"===e||n>=this.indentNext||!e&&!this.atEnd?t+n:-1}if("-"===e||"."===e){const e=this.buffer.substr(t,3);if(("---"===e||"..."===e)&&Xn(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return("number"!=typeof t||-1!==t&&tthis.indentValue&&!Xn(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,e]=this.peek(2);if(!e&&!this.atEnd)return this.setNext("block-start");if(("-"===t||"?"===t||":"===t)&&Xn(e)){const t=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=t,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(null===t)return this.setNext("doc");let e=yield*this.pushIndicators();switch(t[e]){case"#":yield*this.pushCount(t.length-e);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(nr),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return e+=(yield*this.parseBlockScalarHeader()),e+=(yield*this.pushSpaces(!0)),yield*this.pushCount(t.length-e),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,e,n=-1;do{t=yield*this.pushNewline(),t>0?(e=yield*this.pushSpaces(!1),this.indentValue=n=e):e=0,e+=(yield*this.pushSpaces(!0))}while(t+e>0);const r=this.getLine();if(null===r)return this.setNext("flow");if((-1!==n&&n"0"&&e<="9")this.blockScalarIndent=Number(e)-1;else if("-"!==e)break}return yield*this.pushUntil((t=>Xn(t)||"#"===t))}*parseBlockScalar(){let t,e=this.pos-1,n=0;t:for(let r=this.pos;t=this.buffer[r];++r)switch(t){case" ":n+=1;break;case"\n":e=r,n=0;break;case"\r":{const t=this.buffer[r+1];if(!t&&!this.atEnd)return this.setNext("block-scalar");if("\n"===t)break}default:break t}if(!t&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){-1===this.blockScalarIndent?this.indentNext=n:this.indentNext=this.blockScalarIndent+(0===this.indentNext?1:this.indentNext);do{const t=this.continueScalar(e+1);if(-1===t)break;e=this.buffer.indexOf("\n",t)}while(-1!==e);if(-1===e){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let r=e+1;for(t=this.buffer[r];" "===t;)t=this.buffer[++r];if("\t"===t){for(;"\t"===t||" "===t||"\r"===t||"\n"===t;)t=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)for(;;){let t=e-1,r=this.buffer[t];"\r"===r&&(r=this.buffer[--t]);const i=t;for(;" "===r;)r=this.buffer[--t];if(!("\n"===r&&t>=this.pos&&t+1+n>i))break;e=t}return yield"",yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let e,n=this.pos-1,r=this.pos-1;for(;e=this.buffer[++r];)if(":"===e){const e=this.buffer[r+1];if(Xn(e)||t&&tr.has(e))break;n=r}else if(Xn(e)){let i=this.buffer[r+1];if("\r"===e&&("\n"===i?(r+=1,e="\n",i=this.buffer[r+1]):n=r),"#"===i||t&&tr.has(i))break;if("\n"===e){const t=this.continueScalar(r+1);if(-1===t)break;r=Math.max(r,t-2)}}else{if(t&&tr.has(e))break;n=r}return e||this.atEnd?(yield"",yield*this.pushToIndex(n+1,!0),t?"flow":"doc"):this.setNext("plain-scalar")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,e){const n=this.buffer.slice(this.pos,t);return n?(yield n,this.pos+=n.length,n.length):(e&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(nr))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,e=this.charAt(1);if(Xn(e)||t&&tr.has(e))return t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if("<"===this.charAt(1)){let t=this.pos+2,e=this.buffer[t];for(;!Xn(e)&&">"!==e;)e=this.buffer[++t];return yield*this.pushToIndex(">"===e?t+1:t,!1)}{let t=this.pos+1,e=this.buffer[t];for(;e;)if(Zn.has(e))e=this.buffer[++t];else{if("%"!==e||!Qn.has(this.buffer[t+1])||!Qn.has(this.buffer[t+2]))break;e=this.buffer[t+=3]}return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return"\n"===t?yield*this.pushCount(1):"\r"===t&&"\n"===this.charAt(1)?yield*this.pushCount(2):0}*pushSpaces(t){let e,n=this.pos-1;do{e=this.buffer[++n]}while(" "===e||t&&"\t"===e);const r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(t){let e=this.pos,n=this.buffer[e];for(;!t(n);)n=this.buffer[++e];return yield*this.pushToIndex(e,!1)}}class ir{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let e=0,n=this.lineStarts.length;for(;e>1;this.lineStarts[r]=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break t}for(;"space"===t[++e]?.type;);return t.splice(e,t.length)}function lr(t){if("flow-seq-start"===t.start.type)for(const e of t.items)!e.sep||e.value||or(e.start,"explicit-key-ind")||or(e.sep,"map-value-ind")||(e.key&&(e.value=e.key),delete e.key,sr(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}class fr{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new rr,this.onNewLine=t}*parse(t,e=!1){this.onNewLine&&0===this.offset&&this.onNewLine(0);for(const n of this.lexer.lex(t,e))yield*this.next(n);e||(yield*this.end())}*next(t){if(this.source=t,this.atScalar)return this.atScalar=!1,yield*this.step(),void(this.offset+=t.length);const e=function(t){switch(t){case"\ufeff":return"byte-order-mark";case"":return"doc-mode";case"":return"flow-error-end";case"":return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case"\n":case"\r\n":return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}(t);if(e)if("scalar"===e)this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=e,yield*this.step(),e){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&" "===t[0]&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{const e=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:e,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if("doc-end"!==this.type||t&&"doc-end"===t.type){if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}else{for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source})}}peek(t){return this.stack[this.stack.length-t]}*pop(t){const e=t??this.stack.pop();if(e)if(0===this.stack.length)yield e;else{const t=this.peek(1);switch("block-scalar"===e.type?e.indent="indent"in t?t.indent:0:"flow-collection"===e.type&&"document"===t.type&&(e.indent=0),"flow-collection"===e.type&&lr(e),t.type){case"document":t.value=e;break;case"block-scalar":t.props.push(e);break;case"block-map":{const n=t.items[t.items.length-1];if(n.value)return t.items.push({start:[],key:e,sep:[]}),void(this.onKeyLine=!0);if(!n.sep)return Object.assign(n,{key:e,sep:[]}),void(this.onKeyLine=!n.explicitKey);n.value=e;break}case"block-seq":{const n=t.items[t.items.length-1];n.value?t.items.push({start:[],value:e}):n.value=e;break}case"flow-collection":{const n=t.items[t.items.length-1];return void(!n||n.value?t.items.push({start:[],key:e,sep:[]}):n.sep?n.value=e:Object.assign(n,{key:e,sep:[]}))}default:yield*this.pop(),yield*this.pop(e)}if(!("document"!==t.type&&"block-map"!==t.type&&"block-seq"!==t.type||"block-map"!==e.type&&"block-seq"!==e.type)){const n=e.items[e.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&-1===ar(n.start)&&(0===e.indent||n.start.every((t=>"comment"!==t.type||t.indent=t.indent){const n=!this.onKeyLine&&this.indent===t.indent,r=n&&(e.sep||e.explicitKey)&&"seq-item-ind"!==this.type;let i=[];if(r&&e.sep&&!e.value){const n=[];for(let r=0;rt.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=e.sep.splice(n[1]))}switch(this.type){case"anchor":case"tag":return void(r||e.value?(i.push(this.sourceToken),t.items.push({start:i}),this.onKeyLine=!0):e.sep?e.sep.push(this.sourceToken):e.start.push(this.sourceToken));case"explicit-key-ind":return e.sep||e.explicitKey?r||e.value?(i.push(this.sourceToken),t.items.push({start:i,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}):(e.start.push(this.sourceToken),e.explicitKey=!0),void(this.onKeyLine=!0);case"map-value-ind":if(e.explicitKey)if(e.sep)if(e.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(or(e.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(sr(e.key)&&!or(e.sep,"newline")){const t=cr(e.start),n=e.key,r=e.sep;r.push(this.sourceToken),delete e.key,delete e.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:n,sep:r}]})}else i.length>0?e.sep=e.sep.concat(i,this.sourceToken):e.sep.push(this.sourceToken);else if(or(e.start,"newline"))Object.assign(e,{key:null,sep:[this.sourceToken]});else{const t=cr(e.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]})}else e.sep?e.value||r?t.items.push({start:i,key:null,sep:[this.sourceToken]}):or(e.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):e.sep.push(this.sourceToken):Object.assign(e,{key:null,sep:[this.sourceToken]});return void(this.onKeyLine=!0);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const n=this.flowScalar(this.type);return void(r||e.value?(t.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):e.sep?this.stack.push(n):(Object.assign(e,{key:n,sep:[]}),this.onKeyLine=!0))}default:{const e=this.startBlockValue(t);if(e)return n&&"block-seq"!==e.type&&t.items.push({start:i}),void this.stack.push(e)}}}yield*this.pop(),yield*this.step()}*blockSequence(t){const e=t.items[t.items.length-1];switch(this.type){case"newline":if(e.value){const n="end"in e.value?e.value.end:void 0,r=Array.isArray(n)?n[n.length-1]:void 0;"comment"===r?.type?n?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else e.start.push(this.sourceToken);return;case"space":case"comment":if(e.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(e.start,t.indent)){const n=t.items[t.items.length-2],r=n?.value?.end;if(Array.isArray(r))return Array.prototype.push.apply(r,e.start),r.push(this.sourceToken),void t.items.pop()}e.start.push(this.sourceToken)}return;case"anchor":case"tag":if(e.value||this.indent<=t.indent)break;return void e.start.push(this.sourceToken);case"seq-item-ind":if(this.indent!==t.indent)break;return void(e.value||or(e.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):e.start.push(this.sourceToken))}if(this.indent>t.indent){const e=this.startBlockValue(t);if(e)return void this.stack.push(e)}yield*this.pop(),yield*this.step()}*flowCollection(t){const e=t.items[t.items.length-1];if("flow-error-end"===this.type){let t;do{yield*this.pop(),t=this.peek(1)}while(t&&"flow-collection"===t.type)}else if(0===t.end.length){switch(this.type){case"comma":case"explicit-key-ind":return void(!e||e.sep?t.items.push({start:[this.sourceToken]}):e.start.push(this.sourceToken));case"map-value-ind":return void(!e||e.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):e.sep?e.sep.push(this.sourceToken):Object.assign(e,{key:null,sep:[this.sourceToken]}));case"space":case"comment":case"newline":case"anchor":case"tag":return void(!e||e.value?t.items.push({start:[this.sourceToken]}):e.sep?e.sep.push(this.sourceToken):e.start.push(this.sourceToken));case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const n=this.flowScalar(this.type);return void(!e||e.value?t.items.push({start:[],key:n,sep:[]}):e.sep?this.stack.push(n):Object.assign(e,{key:n,sep:[]}))}case"flow-map-end":case"flow-seq-end":return void t.end.push(this.sourceToken)}const n=this.startBlockValue(t);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{const e=this.peek(2);if("block-map"===e.type&&("map-value-ind"===this.type&&e.indent===t.indent||"newline"===this.type&&!e.items[e.items.length-1].sep))yield*this.pop(),yield*this.step();else if("map-value-ind"===this.type&&"flow-collection"!==e.type){const n=cr(ur(e));lr(t);const r=t.end.splice(1,t.end.length);r.push(this.sourceToken);const i={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:n,key:t,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let t=this.source.indexOf("\n")+1;for(;0!==t;)this.onNewLine(this.offset+t),t=this.source.indexOf("\n",t)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const e=cr(ur(t));return e.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const e=cr(ur(t));return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,e){return"comment"===this.type&&!(this.indent<=e)&&t.every((t=>"newline"===t.type||"space"===t.type))}*documentEnd(t){"doc-mode"!==this.type&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop())}}}function hr(t,e={}){const{lineCounter:n,prettyErrors:r}=function(t){const e=!1!==t.prettyErrors;return{lineCounter:t.lineCounter||e&&new ir||null,prettyErrors:e}}(e),i=new fr(n?.addNewLine),o=new Vn(e);let a=null;for(const e of o.compose(i.parse(t),!0,t.length))if(a){if("silent"!==a.options.logLevel){a.errors.push(new xn(e.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}else a=e;return r&&n&&(a.errors.forEach(On(t,n)),a.warnings.forEach(On(t,n))),a}class pr extends wn{constructor(t,e,n){super(t,e,"IMPOSSIBLE",n),this.name=t}pretty(t){this.linePos=t.lineCounter.linePos(this.pos);const{line:e,col:n}=this.linePos;this.message+=` at line ${e}, column ${n} ${t.file?" @"+t.file:""}`}}class dr{constructor(){this.lineCounter=new ir,this.src="",this.file="",this.txt="",this.errors=[],this.warnings=[],this.yaml_ok=!1,this.contents=null,this.listener=null,this.prog={}}errors(t){this.errors=this.errors.concat(t)}warnings(t){this.warnings=this.warnings.concat(t)}fileError(t){let e=new pr("FILE_ERROR",0,`FileError : ${t}`);return e.pretty(this),this.errors.push(e),e}syntaxError(t,e){let n=new pr("SYNTAX_ERROR",t.range?t.range[0]:0,`SyntaxError : ${e}`);return n.pretty(this),this.errors.push(n),n}syntaxWarning(t,e){let n=new pr("SYNTAX_WARNING",t.range?t.range[0]:0,`SyntaxWarning : ${e}`);return n.pretty(this),this.warnings.push(n),n}typeError(t,e){let n=new pr("TYPE_ERROR",t.range?t.range[0]:0,`TypeError : ${e}`);return n.pretty(this),this.errors.push(n),n}grammarError(t){let e=new pr("GRAMMAR_ERROR",0,`GrammarError : ${t}`);e.pretty(this),this.errors.push(e)}grammarWarning(t){let e=new pr("GRAMMAR_WARNING",0,`GrammarWarning : ${t}`);return e.pretty(this),this.warnings.push(e),e}fails(){return this.errors.length>0}success(){return 0===this.errors.length&&0===this.warnings.length}result(){return this.contents}}class mr{constructor(t,e,n){this.ctx=t,this.type=e,this.current=n,this.start=n.range[0],this.end=n.range[1],this.childs=[]}getChild(t){return this.childs[t]}getChildCount(){return this.childs.length}getValue(){return this.value}toString(){return this.value}}class yr extends mr{constructor(t,e,n){super(t,e,n)}equals(t){if(t instanceof yr)return this.value==t.value;this.ctx.syntaxError(this.current,`Error can not compare values '${this.value}' and '${t.value}'`)}}class gr extends yr{constructor(t,e){if(super(t,"string",e),!gr.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not a string`);this.value=e.value}static checkCurrent(t){return ut(t)&&"string"==typeof t.value}static parse(t,e){try{return new gr(t,e)}catch(t){return null}}}class vr extends yr{constructor(t,e){if(super(t,"binary",e),!vr.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not a base64 string`);this.value=e.value}static checkCurrent(t){return ut(t)&&"string"==typeof t.value&&/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/.test(t.value)}static parse(t,e){try{return new vr(t,e)}catch(t){return null}}}class br extends yr{constructor(t,e){if(super(t,"int",e),!br.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not an integer`);this.value=e.value}static checkCurrent(t){return ut(t)&&"number"==typeof t.value&&t.value==Math.floor(t.value)}static parse(t,e){try{return new br(t,e)}catch(t){return null}}}class _r extends yr{constructor(t,e){if(super(t,"float",e),!_r.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not a number`);this.value=e.value}static checkCurrent(t){return ut(t)&&"number"==typeof t.value}static parse(t,e){try{return new _r(t,e)}catch(t){return null}}}class wr extends yr{constructor(t,e){if(super(t,"boolean",e),this.value=null,!wr.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e.value}' is not a boolean`);this.value=e.value}static checkCurrent(t){return ut(t)&&"boolean"==typeof t.value}static parse(t,e){try{return new wr(t,e)}catch(t){return null}}}class xr extends yr{constructor(t,e){if(super(t,"null",e),this.value=null,!xr.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not the null value`)}static checkCurrent(t){return ut(t)&&(null==t.value||["Null","NULL","null","~"].includes(t.value))}static parse(t,e){try{return new xr(t,e)}catch(t){return null}}}class kr extends yr{constructor(t,e,n){if(super(t,"timestamp",e),!kr.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not a timestamp in ISO9601 format`);this.value=new Date(e.value)}static checkCurrent(t){let e=ut(t)&&"string"==typeof t.value&&/\d{4}-\d{2}-\d{2}|\d{4}-\d{2}?-\d{2}?([Tt]|[ \t]+)\d{2}?:\d{2}:\d{2}(\.\d*)?(([ \t]*)Z|[-+]\d\d?(:\d{2})?)?/.test(t.value);if(1==e)try{new Date(t.value)}catch(t){e=!1}return e}static parse(t,e){try{return new kr(t,e)}catch(t){return null}}equals(t){return t instanceof kr?this.value.getTime()==t.value.getTime():this.ctx.syntaxError("Error : can not compare a timestamp with something else")}}class Or extends mr{constructor(t,e,n){super(t,e,n)}length(){return this.childs.length}isEmpty(){return 0==this.length()}}class Sr extends Or{constructor(t,e,n){if(super(t,"map",e),"object"!=typeof n||n instanceof Array)throw t.syntaxError(e,"Erorr : MapNode must be initialized with a parsed map. This should not happen.");this.value=n;for(const t in n)this.childs.push(n[t])}static checkCurrent(t){return at(t)&&t.items.every((t=>t.key&&ut(t.key)&&"string"==typeof t.key.value))}}class Er{static parse(t,e,n){"object"!=typeof e&&t.grammarError("Error: oneof rule can not be parsed'");let r=e._oneOf;if(r instanceof Array){let e=[].concat(t.errors),i=[].concat(t.warnings),o=t.errors.length;for(let a of r){let r=Br(t,null,a,n);if(o==t.errors.length)return t.errors=e,t.warnings=i,r;o=t.errors.length}return t.syntaxError(n,"Syntax Error : no valid alternative found during parsing"),null}t.grammarError("Error: _oneof rules expects a sequence of alternatives")}}var Ar="undefined"!=typeof Symbol;function Tr(t){var e=typeof t;return"string"===e||"number"===e||"boolean"===e||!0===Ar&&"symbol"===e||null==t||!0===Ar&&t instanceof Symbol||t instanceof String||t instanceof Number||t instanceof Boolean}class Nr{static parse(t,e){if("object"==typeof e){if(e._oneOf){let n;!e._oneOf instanceof Array&&t.grammarError("Error : _oneof value have to be a list"),e._oneOf=e._oneOf.map((e=>Nr.parse(t,e)));do{if(n=e._oneOf.findIndex((t=>t._oneOf)),n>=0){let t=e._oneOf[n]._oneOf;(e={_oneOf:[].concat(e._oneOf)})._oneOf.splice(n,1),e._oneOf=e._oneOf.concat(t)}}while(n>=0);return e}if(e._merge){if(!(e._merge instanceof Array))return t.grammarError("Error : _merge value have to be a map"),null;const{_merge:n,...r}=e;let i;e={_merge:e._merge},Object.keys(r).length&&e._merge.push(r),e._merge=e._merge.map((e=>Tr(e)&&t.rules[e]?t.rules[e]:e)),e._merge=e._merge.map((e=>Nr.parse(t,e)));do{if(i=e._merge.findIndex((t=>t._merge)),i>=0){let t=e.one._merge;(e={_merge:[].concat(e._merge)})._merge.splice(i,1),e._merge=e._merge.concat(t)}}while(i>=0);let o={_oneOf:[]};do{if(i=(e={_merge:[].concat(e._merge)})._merge.findIndex((t=>t._oneOf)),i>=0){let t=e._merge[i]._oneOf;(e={_merge:[].concat(e._merge)})._merge.splice(i,1),t.forEach((t=>{let n={_merge:[t].concat(e._merge)};o._oneOf.push(n)}))}}while(i>=0);if(o._oneOf.length>=1)return Nr.parse(t,o);e._merge.some((t=>t._merge||t._oneOf))&&t.grammarError("Error : merge has not been processed successfully. This error should not occur.");let a={},s={},u=null,c=-1,l=-1,f=-1;e._merge.forEach((e=>{if(e._map){a={...a};for(let n in e._map)a.key&&t.grammarError("Error : can not merge two maps with some identical keys"),a[n]=e._map[n]}if(e._mapFacultative){s={...s};for(let n in e._mapFacultative)s.key&&t.grammarError("Error : can not merge two maps with some identical keys"),s[n]=e._mapFacultative[n]}if(e._mapOf){if(null!=u)return t.grammarError("Error : only one '_mapOf' is allowed in a '_merge' clause"),null;u=e._mapOf}e._nb&&(c<0||c==e._nb?c=e._nb:t.grammarError("Contradictory sizing in merge clause")),e._min&&(l=Math.max(e._min,l)),e._max&&(nax=c>0?Math.min(e._max,f):e._max)}));let h={};return c>=0&&(h._nb=c),l>=0&&(h._min=l),f>=0&&(h._max=f),Object.keys(a).length>0&&(h._map=a),Object.keys(s).length>0&&(h._mapFacultative=s),null!=u&&(h._mapOf=u),h}if(e._map){let n={};for(const r in e._map)n[r]=Nr.parse(t,e._map[r]);e._map=n}if(e._mapFacultative){let n={};for(const r in e._mapFacultative)n[r]=Nr.parse(t,e._mapFacultative[r]);e._mapFacultative=n}if(e._mapOf){let n={};for(const r in e._mapOf){let i=Nr.parse(t,r),o=Nr.parse(t,e._mapOf[r]);n[i]=o}e._mapOf=n}e._list&&(e._list=e._list.map((e=>Nr.parse(t,e)))),e._listFacultative&&(e._listFacultative=e._listFacultative.map((e=>Nr.parse(t,e)))),e._listOf&&(e._listOf=Nr.parse(t,e._listOf))}return e}}class Mr{static isPositiveInt(t){return"number"==typeof t&&t==Math.floor(t)&&t>0}static sizeChecker(t,e,n,r){if(Mr.isPositiveInt(n))if(at(r)||ct(r))switch(e){case"eq":return r.items.length==n;case"min":return r.items.length>=n;case"max":return r.items.length<=n}else t.syntaxError(r,"Error : a map is expected");else t.grammarError(`Error: the map checker '${e}' does not have a positive integer as value`);return!1}static sizeCheckers(t,e,n){return null==e._nb||Mr.sizeChecker(t,"eq",e._nb,n)?null==e._min||Mr.sizeChecker(t,"min",e._min,n)?!(null!=e._max&&!Mr.sizeChecker(t,"max",e._max,n)&&(t.syntaxError(n,`Error : map expected with more than ${e._max} elements but ${n.items.length} are provided`),1)):(t.syntaxError(n,`Error : map expected with more than ${e._min} elements but ${n.items.length} are provided`),!1):(t.syntaxError(n,`Error : map expected with ${e._nb} elements but ${n.items.length} are provided`),!1)}}class Cr{static parse(t,e,n){if(!Sr.checkCurrent(n))return t.syntaxError(n,"Error : a map whose keys are strings is expected "),null;if(e._merge&&(e=Nr.parse(t,e))._oneOf)return Er.parse(t,e,n);let r=e._map,i=e._mapOf,o=e._mapFacultative;if(null!=i&&"object"!=typeof i||null!=o&&"object"!=typeof o)return t.grammarError("Error : error in map value definition"),null;if(!Mr.sizeCheckers(t,e,n))return null;if(null!=r)for(let e in r){if("string"!=typeof e)return t.grammarError("Error : error in map definition"),null;if(!n.has(e))return t.syntaxError(n,`Error : key '${e}' not found in current value`),null}let a,s=null;if(i){let t=Object.entries(i);1==t.length&&([[a,s]]=t)}let u={};for(let i of n.items){let n=i.key.value,c=i.value,l=null;if(r&&r[n])l=Br(t,null,r[n],c);else if(o&&o[n])l=Br(t,null,o[n],c);else{if(!a||!s)return t.syntaxError(c,`Error : '${n}' is not a valid key (in rule : ${JSON.stringify(e)})`),null;{let e=Br(t,null,a,i.key);if(l=Br(t,null,s,c),e.value!=n)return t.syntaxError(n,`Error : '${n}' does not match expected '${a}' type`),null}}if(null==l)return t.syntaxError(c,`Error : bad value '${c}'found for '${n}' (mapparser.parse)`),null;let f=new gr(t,i.key);if(l.key=f,null!=u[n])return t.syntaxError(c,`Error : more than one value provided in the map for the key '${n}'`),null;u[n]=l}return new Sr(t,n,u)}static parse_any(t,e){if(!Sr.checkCurrent(e))return t.syntaxError(e,"Error : a map whose keys are strings is expected "),null;let n={};return e.items.forEach((e=>{let r=e.key.value,i=e.value,o=Lr.parse_any(t,i);if(null==o)return t.syntaxError(i,`Error : bad value '${i}' found for '${r}' (mapparser.parse_any)`),null;let a=new gr(t,e.key);o.key=a,null!=n[r]&&t.syntaxError(i,`Error : more than one value provided in the map for the key '${r}'`),n[r]=o})),new Sr(t,e,n)}}class jr extends Or{constructor(t,e,n){if(super(t,"list",e),!n instanceof Array)throw t.syntaxError(e,"Erorr : ListNode must be initialized with an array. This should not happen.");this.value=n,this.childs=this.value}static checkCurrent(t){return ct(t)}}class Pr{static parse(t,e,n){if(!jr.checkCurrent(n))return t.syntaxError(n,"Error : a list is expected "),null;if(!Mr.sizeCheckers(t,e,n))return null;let r=e._list,i=e._listOf,o=e._listFacultative;if(null!=r&&!(r instanceof Array)||null!=o&&!(o instanceof Array))return t.grammarError("Error : error in list value definition"),null;let a=0,s=n.items.length,u=[];r&&r.forEach((e=>{if(!(a{if(a{let r=Lr.parse_any(t,e);if(null==r)return t.SyntaxError(value,`Error : bad value '${value}' found for '${key}' (listparser.parse_any)`),null;n.push(r)})),new jr(t,e,n)}}class Lr{static parse(t,e,n){switch(e){case"string":return gr.parse(t,n);case"binary":return vr.parse(t,n);case"timestamp":return kr.parse(t,n);case"int":return br.parse(t,n);case"float":return _r.parse(t,n);case"boolean":return wr.parse(t,n);case"null":return xr.parse(t,n);case"any":return Lr.parse_any(t,n);default:return Fr(t,e,n)}}static parse_any(t,e){if(ut(e)){switch(typeof e.value){case"number":return br.checkCurrent(e)?br.parse(t,e):_r.parse(t,e);case"boolean":return wr.parse(t,e);case"string":return gr.parse(t,e);case"object":if(null==e.value)return xr.parse(t,e);t.syntaxError(e,`Error: value '${e.value}' is not a scalar value`);default:t.syntaxError(e,`Error: value '${e.value}' is not a scalar value`)}return null}return at(e)?Cr.parse_any(t,e):ct(e)?Pr.parse_any(t,e):null}}class Ir{static parse(t,e,n){"object"==typeof e&&e._in||t.grammarError("Error: can not parse _in rule'");let r=e._in;if(!(r instanceof Array))return t.grammarError("Error: _in rules expects a sequence of alternatives"),null;for(let e of r)if(!Tr(e))return t.grammarError("Error: _in rules expects each alternative to be a scalar"),null;if(!ut(n))return t.syntaxError(n,"Syntax Error : scalar value expected by rule '_in'"),null;let i=Lr.parse_any(t,n);if(i){let e=[].concat(t.errors),n=[].concat(t.warnings),o=t.errors.length,a=i.value;for(let s of r)if(s){let r=s==a?i:null;if(null!=r)return t.errors=e,t.warnings=n,r;o=t.errors.length}}return t.syntaxError(n,"Syntax Error : no valid alternative for '_in' rule found during parsing"),null}}class Dr{static parse(t,e,n){if(!gr.checkCurrent(n))return t.syntaxError(n,`Error: regular expressions match only strings, '${n?n.value:""}' is not a string`),null;let r=e._regex;if(null==r)return t.grammarError("Error : regep rule must have a value for key '_regex'"),null;let i=null;try{i=new RegExp(r)}catch(t){}return null==i?(t.grammarError(`Error: value '${i}' is not a valid regular expression`),null):i.test(n.value)?new gr(t,n):(t.syntaxError(n,`Error: value '${n.value}' does not match the regular expression '${i}'`),null)}}class Rr{static scalartypes=["string","int","float","null","boolean","binary","timestamp"];static keywords=["_map","_mapOf","_mapFacultative","_list","_listOf","_listFacultative","_oneOf","_regex","_nb","_min","_max","_in"];static throwOnError=!1;static parse(t,e,n,r){if(null==r)return t.fileError("No source to parse"),null;if(Rr.scalartypes.includes(e)||Rr.keywords.includes(e))return t.syntaxError(r,`'${e}' is not allowed as rule_name in Lidy Grammar (reserved keyword)`),null;let i="enter_"+e;r.ctx=t,t.listener&&t.listener[i]&&t.listener[i](r);let o=Br(t,null,n,r);if(this.throwOnError&&null===o)throw 0!==t.errors.length?t.errors[t.errors.length-1]:new Error("Unknown error encountered while parsing.");let a="exit_"+e;return t.listener&&t.listener[a]&&t.listener[a](o),o}}function Br(t,e,n,r){if(e)return Rr.parse(t,e,n,r);if(Tr(n))return Lr.parse(t,n,r);if("object"==typeof n){if(n._map||n._mapOf||n._mapFacultative||n._merge)return Cr.parse(t,n,r);if(n._list||n._listOf||n._listFacultative)return Pr.parse(t,n,r);if(n._oneOf)return Er.parse(t,n,r);if(n._regex)return Dr.parse(t,n,r);if(n._in)return Ir.parse(t,n,r)}return t.grammarError("Error : grammar error : no valid keyword found"),null}function Fr(t,e,n){let r=t.rules[e];return void 0!==r?Br(t,e,r,n):(t.grammarError(`no rule named ${e} found.`),null)}function $r(t){t.keyword||(t.keyword="main");let e=new dr;return e.file=t.abs_path,e.prog=t.prog,t.rules?e.rules=t.rules:function(t,e,n){try{t.rules=function(t,e,n){let r;const i=hr(t,n);if(!i)return null;if(i.warnings.forEach((t=>ie(i.options.logLevel,t))),i.errors.length>0){if("silent"!==i.options.logLevel)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}(e)}catch(e){throw t.errors.push(e),t.grammarError("ERROR : can not parse dsl ")}if("object"==(t.rules,!1))throw t.grammarError("ERROR : can not parse dsl ");if(!t.rules[n])throw Error("ERROR : no rule labeled '"+n+"' in the grammar")}(e,t.dsl_data,t.keyword),e.listener=t.listener,function(t,e){t.lineCounter=new ir;let n=hr(e,{lineCounter:t.lineCounter});n||t.fileError("can not parse the provided source code."),t.src=n.contents,t.txt=e,t.errors=n.errors,t.warnings=n.warnings,t.yaml_ok=0==t.errors.length&&0==t.warnings.length}(e,t.src_data),function(t,e,n){let r=Fr(t,e,n);return t.errors.filter((t=>t instanceof pr)).forEach((e=>e.pretty(t))),t.warnings.filter((t=>t instanceof pr)).forEach((e=>e.pretty(t))),t.contents=r,t}(e,t.keyword,e.src)}var qr={main:"root",root:{_oneOf:["pod","service","ingress","configMap","secret","persistentVolumeClaim","deployment","statefulSet","job","cronJob","standaloneContainer","standaloneConfigMapMount","standaloneSecretMount","standalonePersistentVolumeClaimMount","catchAll"]},uint16:"int",metadata:{_mapFacultative:{name:"string",namespace:"string",labels:{_mapOf:{string:"string"}},annotations:{_mapOf:{string:"string"}},finalizers:{_mapOf:{string:"string"}},ownerReferences:{_listOf:{_mapFacultative:{apiVersion:"string",blockOwnerDeletion:"boolean",controller:"boolean",kind:"string",name:"string",uid:"string"}}},managedFields:{_listOf:{_mapFacultative:{apiVersion:"string",fieldsType:"string",fieldsV1:{_mapOf:{string:"string"}},manager:"string",operation:"string",subresource:"string",time:"string"}}},generateName:"string",uid:"string",resourceVersion:"string",generation:"int",selfLink:"string",creationTimestamp:"string",deletionGracePeriodSeconds:"int",deletionTimestamp:"string"}},labelSelector:{_mapFacultative:{matchLabels:{_mapOf:{string:"string"}},matchExpressions:{_map:{key:"string",operator:{_in:["In","NotIn","Exists","DoesNotExist"]}},_mapFacultative:{values:{_listOf:"string"}}}}},pod:{_map:{apiVersion:"string",kind:{_in:["Pod"]}},_mapFacultative:{metadata:"metadata",spec:"podSpec"}},podSpec:{_mapFacultative:{containers:{_listOf:"container"},volumes:{_listOf:{_oneOf:["configMapVolume","secretVolume","persistentVolumeClaimVolume","any"]}}},_mapOf:{any:"any"}},container:{_mapFacultative:{name:"string",image:"string",ports:{_listOf:{_mapFacultative:{name:"string",protocol:"string",hostIP:"string",hostPort:"uint16",containerPort:"uint16"}}},volumeMounts:{_listOf:"volumeMount"}},_mapOf:{any:"any"}},volumeMount:{_map:{name:"string",mountPath:"string"},_mapFacultative:{subPath:"string",subPathExpr:"string",mountPropagation:{_in:["None","HostToContainer","Bidirectional"]},readOnly:"boolean"}},service:{_map:{apiVersion:"string",kind:{_in:["Service"]}},_mapFacultative:{metadata:"metadata",spec:{_mapFacultative:{type:{_in:["ClusterIP","NodePort","LoadBalancer","ExternalName"]},selector:{_mapOf:{string:"string"}},ports:{_listOf:{_mapFacultative:{name:"string",protocol:{_in:["TCP","UDP","SCTP"]},targetPort:{_oneOf:["string","int"]}},_map:{port:"uint16"}}},clusterIP:"string",externalName:"string",sessionAffinity:"string",sessionAffinityConfig:{_mapFacultative:{clientIP:{_mapFacultative:{timeoutSeconds:"int"}}}},clusterIPs:{_listOf:"string"},allocateLoadBalancerNodePorts:"boolean",externalIPs:{_listOf:"string"},externalTrafficPolicy:"string",healthCheckNodePort:"uint16",internalTrafficPolicy:"string",ipFamilies:{_listOf:"string"},ipFamilyPolicy:"string",loadBalancerClass:"string",loadBalancerSourceRanges:{_listOf:"string"},publishNotReadyAddresses:"boolean",loadBalancerIP:"string"}}}},ingress:{_map:{apiVersion:"string",kind:{_in:["Ingress"]}},_mapFacultative:{metadata:"metadata",spec:{_mapFacultative:{ingressClassName:"string",defaultBackend:"ingressBackend",rules:{_listOf:{_mapFacultative:{host:"string",http:{_map:{paths:{_listOf:{_mapFacultative:{path:"string"},_map:{pathType:{_in:["Exact","Prefix","ImplementationSpecific"]},backend:"ingressBackend"}}}}}}}},tls:{_listOf:{_mapFacultative:{hosts:{_listOf:"string"},secretName:"string"}}}}},status:"any"}},ingressBackend:{_mapFacultative:{service:{_map:{name:"string"},_mapFacultative:{port:{_mapFacultative:{name:"string",number:"uint16"}}}},resource:{_mapFacultative:{apiGroup:"string"},_map:{kind:"string",name:"string"}}}},configMap:{_map:{apiVersion:"string",kind:{_in:["ConfigMap"]}},_mapFacultative:{metadata:"metadata",data:{_mapOf:{string:"string"}},binaryData:{_mapOf:{string:"string"}},immutable:"boolean"}},configMapVolume:{_map:{name:"string"},_mapFacultative:{configMap:{_mapFacultative:{name:"string",defaultMode:"number",items:{_listOf:{_map:{key:"string",path:"string"},_mapFacultative:{mode:"number"}}},optional:"boolean"}}}},secret:{_map:{apiVersion:"string",kind:{_in:["Secret"]}},_mapFacultative:{metadata:"metadata",type:{_in:["Opaque","kubernetes.io/service-account-token","kubernetes.io/dockercfg","kubernetes.io/dockerconfigjson","kubernetes.io/basic-auth","kubernetes.io/ssh-auth","kubernetes.io/tls","bootstrap.kubernetes.io/token"]},stringData:{_mapOf:{string:"string"}},data:{_mapOf:{string:"string"}},immutable:"boolean"}},secretVolume:{_map:{name:"string"},_mapFacultative:{secret:{_mapFacultative:{secretName:"string",defaultMode:"number",items:{_listOf:{_map:{key:"string",path:"string"},_mapFacultative:{mode:"number"}}},optional:"boolean"}}}},persistentVolumeClaim:{_map:{apiVersion:"string",kind:{_in:["PersistentVolumeClaim"]}},_mapFacultative:{metadata:"metadata",spec:{_mapFacultative:{storageClassName:"string",accessModes:{_listOf:{_in:["ReadWriteOnce","ReadWriteMany","ReadWriteOncePod","ReadOnlyMany"]}},volumeMode:{_in:["Filesystem","Block"]},resources:{_mapFacultative:{limits:{_mapOf:{string:"string"}},requests:{_mapOf:{string:"string"}}}},volumeName:"string",selector:"labelSelector"}}}},persistentVolumeClaimVolume:{_map:{name:"string"},_mapFacultative:{persistentVolumeClaim:{_map:{claimName:"string"},_mapFacultative:{readOnly:"boolean"}}}},deployment:{_map:{apiVersion:"string",kind:{_in:["Deployment"]}},_mapFacultative:{metadata:"metadata",spec:"deploymentSpec"}},deploymentSpec:{_mapFacultative:{replicas:"int",strategy:{_mapFacultative:{type:{_in:["RollingUpdate","Recreate"]},rollingUpdate:{_mapFacultative:{maxSurge:{_oneOf:["string","int"]},maxUnavailable:{_oneOf:["string","int"]}}}}},revisionHistoryLimit:"int",minReadySeconds:"int",progressDeadlineSeconds:"int",paused:"boolean",selector:"labelSelector",template:{_mapFacultative:{metadata:"metadata",spec:"podSpec"}}}},statefulSet:{_map:{apiVersion:"string",kind:{_in:["StatefulSet"]}},_mapFacultative:{metadata:"metadata",spec:"statefulSetSpec"}},statefulSetSpec:{_mapFacultative:{selector:"labelSelector",template:{_mapFacultative:{metadata:"metadata",spec:"podSpec"}}},_mapOf:{any:"any"}},job:{_map:{apiVersion:"string",kind:{_in:["Job"]}},_mapFacultative:{metadata:"metadata",spec:"jobSpec"}},jobSpec:{_mapFacultative:{selector:"labelSelector",template:{_mapFacultative:{metadata:"metadata",spec:"podSpec"}}},_mapOf:{any:"any"}},cronJob:{_map:{apiVersion:"string",kind:{_in:["CronJob"]}},_mapFacultative:{metadata:"metadata",spec:"cronJobSpec"}},cronJobSpec:{_mapFacultative:{jobTemplate:{_mapFacultative:{metadata:"metadata",spec:"jobSpec"}}},_mapOf:{any:"any"}},standaloneContainer:{_map:{apiVersion:"string",kind:{_in:["Container"]}},_mapFacultative:{name:"string",image:"string",ports:{_listOf:{_mapFacultative:{name:"string",protocol:"string",hostIP:"string",hostPort:"uint16",containerPort:"uint16"}}},volumeMounts:{_listOf:"volumeMount"}},_mapOf:{any:"any"}},catchAll:{_mapOf:{any:"any"}}};function Ur(t){return Ur="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ur(t)}function Kr(t,e){for(var n=0;n=0)return!1;var e=/\.ya?ml$/.test(t.path);return t.content&&0!==t.content.trim().length?e&&["apiVersion","kind"].every((function(e){return t.content.includes(e)})):e}},{key:"getModels",value:function(){var t=this;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).filter((function(e){return t.isParsable(e)})).reduce((function(t,e){var n=e.path.split("/").slice(0,-1).join("/");return t.includes(n)||t.push(n),t}),[])}},{key:"parse",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.pluginData.components=[],this.pluginData.parseErrors=[],n.filter((function(e){return e.path.split("/").slice(0,-1).join("/")===t.path})).filter((function(t){var n=t.content,i=t.path;return!(!n||""===n.trim())||(e.pluginData.emitEvent({parent:r,type:"Parser",action:"read",status:"warning",files:[i],data:{code:"no_content",global:!1}}),!1)})).forEach((function(t){var n=e.pluginData.emitEvent({parent:r,type:"Parser",action:"read",status:"running",files:[t.path],data:{global:!1}}),i=new Yr(e.pluginData,t);!function(t){t.rules=qr,$r(t)}({src_data:t.content,listener:i,path:t.path,prog:{errors:[],warnings:[],imports:[],alreadyImported:[],root:[]}}),e.pluginData.emitEvent({id:n,status:"success"})})),this.__convertSelectorAttributesToLinks()}},{key:"__convertSelectorAttributesToLinks",value:function(){var t=this;this.pluginData.components.forEach((function(e){var n,r=e.getAttributeByName("selector");"Link"===(null==r||null===(n=r.definition)||void 0===n?void 0:n.type)&&(r.value=t.pluginData.getComponentsByType(r.definition.linkRef).filter((function(e){var n,i=null===(n=e.attributes.find((function(t){return"metadata"===t.name})))||void 0===n||null===(n=n.value)||void 0===n?void 0:n.find((function(t){return"labels"===t.name}));if(!i)return!1;var o=t.__convertObjectAttributeToJsObject(r),a=t.__convertObjectAttributeToJsObject(i),s=Object.keys(o);return s.length&&s.every((function(t){return o[t]===a[t]}))})).map((function(t){return t.id})))}))}},{key:"__convertObjectAttributeToJsObject",value:function(t){return t.value.reduce((function(t,e){var n=e.name,r=e.value;return t[n]=r,t}),{})}}],r&&Wr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(t.DefaultParser);function ei(t){return null==t}var ni={isNothing:ei,isObject:function(t){return"object"==typeof t&&null!==t},toArray:function(t){return Array.isArray(t)?t:ei(t)?[]:[t]},repeat:function(t,e){var n,r="";for(n=0;ns&&(e=r-s+(o=" ... ").length),n-r>s&&(n=r+s-(a=" ...").length),{str:o+t.slice(e,n).replace(/\t/g,"→")+a,pos:r-e+o.length}}function si(t,e){return ni.repeat(" ",e-t.length)+t}var ui=function(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),"number"!=typeof e.indent&&(e.indent=1),"number"!=typeof e.linesBefore&&(e.linesBefore=3),"number"!=typeof e.linesAfter&&(e.linesAfter=2);for(var n,r=/\r?\n|\r|\0/g,i=[0],o=[],a=-1;n=r.exec(t.buffer);)o.push(n.index),i.push(n.index+n[0].length),t.position<=n.index&&a<0&&(a=i.length-2);a<0&&(a=i.length-1);var s,u,c="",l=Math.min(t.line+e.linesAfter,o.length).toString().length,f=e.maxLength-(e.indent+l+3);for(s=1;s<=e.linesBefore&&!(a-s<0);s++)u=ai(t.buffer,i[a-s],o[a-s],t.position-(i[a]-i[a-s]),f),c=ni.repeat(" ",e.indent)+si((t.line-s+1).toString(),l)+" | "+u.str+"\n"+c;for(u=ai(t.buffer,i[a],o[a],t.position,f),c+=ni.repeat(" ",e.indent)+si((t.line+1).toString(),l)+" | "+u.str+"\n",c+=ni.repeat("-",e.indent+l+3+u.pos)+"^\n",s=1;s<=e.linesAfter&&!(a+s>=o.length);s++)u=ai(t.buffer,i[a+s],o[a+s],t.position-(i[a]-i[a+s]),f),c+=ni.repeat(" ",e.indent)+si((t.line+s+1).toString(),l)+" | "+u.str+"\n";return c.replace(/\n$/,"")},ci=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],li=["scalar","sequence","mapping"],fi=function(t,e){if(e=e||{},Object.keys(e).forEach((function(e){if(-1===ci.indexOf(e))throw new oi('Unknown option "'+e+'" is met in definition of "'+t+'" YAML type.')})),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=function(t){var e={};return null!==t&&Object.keys(t).forEach((function(n){t[n].forEach((function(t){e[String(t)]=n}))})),e}(e.styleAliases||null),-1===li.indexOf(this.kind))throw new oi('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')};function hi(t,e){var n=[];return t[e].forEach((function(t){var e=n.length;n.forEach((function(n,r){n.tag===t.tag&&n.kind===t.kind&&n.multi===t.multi&&(e=r)})),n[e]=t})),n}function pi(t){return this.extend(t)}pi.prototype.extend=function(t){var e=[],n=[];if(t instanceof fi)n.push(t);else if(Array.isArray(t))n=n.concat(t);else{if(!t||!Array.isArray(t.implicit)&&!Array.isArray(t.explicit))throw new oi("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.implicit&&(e=e.concat(t.implicit)),t.explicit&&(n=n.concat(t.explicit))}e.forEach((function(t){if(!(t instanceof fi))throw new oi("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(t.loadKind&&"scalar"!==t.loadKind)throw new oi("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(t.multi)throw new oi("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),n.forEach((function(t){if(!(t instanceof fi))throw new oi("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var r=Object.create(pi.prototype);return r.implicit=(this.implicit||[]).concat(e),r.explicit=(this.explicit||[]).concat(n),r.compiledImplicit=hi(r,"implicit"),r.compiledExplicit=hi(r,"explicit"),r.compiledTypeMap=function(){var t,e,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function r(t){t.multi?(n.multi[t.kind].push(t),n.multi.fallback.push(t)):n[t.kind][t.tag]=n.fallback[t.tag]=t}for(t=0,e=arguments.length;t=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Oi=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),Si=/^[-+]?[0-9]+e/,Ei=new fi("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(t){return null!==t&&!(!Oi.test(t)||"_"===t[t.length-1])},construct:function(t){var e,n;return n="-"===(e=t.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),".inf"===e?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===e?NaN:n*parseFloat(e,10)},predicate:function(t){return"[object Number]"===Object.prototype.toString.call(t)&&(t%1!=0||ni.isNegativeZero(t))},represent:function(t,e){var n;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(ni.isNegativeZero(t))return"-0.0";return n=t.toString(10),Si.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"}),Ai=vi.extend({implicit:[bi,_i,ki,Ei]}),Ti=Ai,Ni=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Mi=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"),Ci=new fi("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(t){return null!==t&&(null!==Ni.exec(t)||null!==Mi.exec(t))},construct:function(t){var e,n,r,i,o,a,s,u,c=0,l=null;if(null===(e=Ni.exec(t))&&(e=Mi.exec(t)),null===e)throw new Error("Date resolve error");if(n=+e[1],r=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(n,r,i));if(o=+e[4],a=+e[5],s=+e[6],e[7]){for(c=e[7].slice(0,3);c.length<3;)c+="0";c=+c}return e[9]&&(l=6e4*(60*+e[10]+ +(e[11]||0)),"-"===e[9]&&(l=-l)),u=new Date(Date.UTC(n,r,i,o,a,s,c)),l&&u.setTime(u.getTime()-l),u},instanceOf:Date,represent:function(t){return t.toISOString()}}),ji=new fi("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(t){return"<<"===t||null===t}}),Pi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r",Li=new fi("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e,n,r=0,i=t.length,o=Pi;for(n=0;n64)){if(e<0)return!1;r+=6}return r%8==0},construct:function(t){var e,n,r=t.replace(/[\r\n=]/g,""),i=r.length,o=Pi,a=0,s=[];for(e=0;e>16&255),s.push(a>>8&255),s.push(255&a)),a=a<<6|o.indexOf(r.charAt(e));return 0==(n=i%4*6)?(s.push(a>>16&255),s.push(a>>8&255),s.push(255&a)):18===n?(s.push(a>>10&255),s.push(a>>2&255)):12===n&&s.push(a>>4&255),new Uint8Array(s)},predicate:function(t){return"[object Uint8Array]"===Object.prototype.toString.call(t)},represent:function(t){var e,n,r="",i=0,o=t.length,a=Pi;for(e=0;e>18&63],r+=a[i>>12&63],r+=a[i>>6&63],r+=a[63&i]),i=(i<<8)+t[e];return 0==(n=o%3)?(r+=a[i>>18&63],r+=a[i>>12&63],r+=a[i>>6&63],r+=a[63&i]):2===n?(r+=a[i>>10&63],r+=a[i>>4&63],r+=a[i<<2&63],r+=a[64]):1===n&&(r+=a[i>>2&63],r+=a[i<<4&63],r+=a[64],r+=a[64]),r}}),Ii=Object.prototype.hasOwnProperty,Di=Object.prototype.toString,Ri=new fi("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(t){if(null===t)return!0;var e,n,r,i,o,a=[],s=t;for(e=0,n=s.length;e>10),56320+(t-65536&1023))}for(var lo=new Array(256),fo=new Array(256),ho=0;ho<256;ho++)lo[ho]=uo(ho)?1:0,fo[ho]=uo(ho);function po(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||Ui,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function mo(t,e){var n={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return n.snippet=ui(n),new oi(e,n)}function yo(t,e){throw mo(t,e)}function go(t,e){t.onWarning&&t.onWarning.call(null,mo(t,e))}var vo={YAML:function(t,e,n){var r,i,o;null!==t.version&&yo(t,"duplication of %YAML directive"),1!==n.length&&yo(t,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&yo(t,"ill-formed argument of the YAML directive"),i=parseInt(r[1],10),o=parseInt(r[2],10),1!==i&&yo(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=o<2,1!==o&&2!==o&&go(t,"unsupported YAML version of the document")},TAG:function(t,e,n){var r,i;2!==n.length&&yo(t,"TAG directive accepts exactly two arguments"),r=n[0],i=n[1],to.test(r)||yo(t,"ill-formed tag handle (first argument) of the TAG directive"),Ki.call(t.tagMap,r)&&yo(t,'there is a previously declared suffix for "'+r+'" tag handle'),eo.test(i)||yo(t,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch(e){yo(t,"tag prefix is malformed: "+i)}t.tagMap[r]=i}};function bo(t,e,n,r){var i,o,a,s;if(e1&&(t.result+=ni.repeat("\n",e-1))}function Eo(t,e){var n,r,i=t.tag,o=t.anchor,a=[],s=!1;if(-1!==t.firstTabInLine)return!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=a),r=t.input.charCodeAt(t.position);0!==r&&(-1!==t.firstTabInLine&&(t.position=t.firstTabInLine,yo(t,"tab characters must not be used in indentation")),45===r)&&oo(t.input.charCodeAt(t.position+1));)if(s=!0,t.position++,ko(t,!0,-1)&&t.lineIndent<=e)a.push(null),r=t.input.charCodeAt(t.position);else if(n=t.line,No(t,e,Yi,!1,!0),a.push(t.result),ko(t,!0,-1),r=t.input.charCodeAt(t.position),(t.line===n||t.lineIndent>e)&&0!==r)yo(t,"bad indentation of a sequence entry");else if(t.lineIndente?d=1:t.lineIndent===e?d=0:t.lineIndente?d=1:t.lineIndent===e?d=0:t.lineIndente)&&(g&&(a=t.line,s=t.lineStart,u=t.position),No(t,e,Hi,!0,i)&&(g?m=t.result:y=t.result),g||(wo(t,h,p,d,m,y,a,s,u),d=m=y=null),ko(t,!0,-1),c=t.input.charCodeAt(t.position)),(t.line===o||t.lineIndent>e)&&0!==c)yo(t,"bad indentation of a mapping entry");else if(t.lineIndent=0))break;0===i?yo(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?yo(t,"repeat of an indentation width identifier"):(l=e+i-1,c=!0)}if(io(o)){do{o=t.input.charCodeAt(++t.position)}while(io(o));if(35===o)do{o=t.input.charCodeAt(++t.position)}while(!ro(o)&&0!==o)}for(;0!==o;){for(xo(t),t.lineIndent=0,o=t.input.charCodeAt(t.position);(!c||t.lineIndentl&&(l=t.lineIndent),ro(o))f++;else{if(t.lineIndent0){for(i=a,o=0;i>0;i--)(a=so(s=t.input.charCodeAt(++t.position)))>=0?o=(o<<4)+a:yo(t,"expected hexadecimal character");t.result+=co(o),t.position++}else yo(t,"unknown escape sequence");n=r=t.position}else ro(s)?(bo(t,n,r,!0),So(t,ko(t,!1,e)),n=r=t.position):t.position===t.lineStart&&Oo(t)?yo(t,"unexpected end of the document within a double quoted scalar"):(t.position++,r=t.position)}yo(t,"unexpected end of the stream within a double quoted scalar")}(t,h)?y=!0:function(t){var e,n,r;if(42!==(r=t.input.charCodeAt(t.position)))return!1;for(r=t.input.charCodeAt(++t.position),e=t.position;0!==r&&!oo(r)&&!ao(r);)r=t.input.charCodeAt(++t.position);return t.position===e&&yo(t,"name of an alias node must contain at least one character"),n=t.input.slice(e,t.position),Ki.call(t.anchorMap,n)||yo(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],ko(t,!0,-1),!0}(t)?(y=!0,null===t.tag&&null===t.anchor||yo(t,"alias node should not have any properties")):function(t,e,n){var r,i,o,a,s,u,c,l,f=t.kind,h=t.result;if(oo(l=t.input.charCodeAt(t.position))||ao(l)||35===l||38===l||42===l||33===l||124===l||62===l||39===l||34===l||37===l||64===l||96===l)return!1;if((63===l||45===l)&&(oo(r=t.input.charCodeAt(t.position+1))||n&&ao(r)))return!1;for(t.kind="scalar",t.result="",i=o=t.position,a=!1;0!==l;){if(58===l){if(oo(r=t.input.charCodeAt(t.position+1))||n&&ao(r))break}else if(35===l){if(oo(t.input.charCodeAt(t.position-1)))break}else{if(t.position===t.lineStart&&Oo(t)||n&&ao(l))break;if(ro(l)){if(s=t.line,u=t.lineStart,c=t.lineIndent,ko(t,!1,-1),t.lineIndent>=e){a=!0,l=t.input.charCodeAt(t.position);continue}t.position=o,t.line=s,t.lineStart=u,t.lineIndent=c;break}}a&&(bo(t,i,o,!1),So(t,t.line-s),i=o=t.position,a=!1),io(l)||(o=t.position+1),l=t.input.charCodeAt(++t.position)}return bo(t,i,o,!1),!!t.result||(t.kind=f,t.result=h,!1)}(t,h,zi===n)&&(y=!0,null===t.tag&&(t.tag="?")),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):0===d&&(y=s&&Eo(t,p))),null===t.tag)null!==t.anchor&&(t.anchorMap[t.anchor]=t.result);else if("?"===t.tag){for(null!==t.result&&"scalar"!==t.kind&&yo(t,'unacceptable node kind for ! tag; it should be "scalar", not "'+t.kind+'"'),u=0,c=t.implicitTypes.length;u"),null!==t.result&&f.kind!==t.kind&&yo(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+f.kind+'", not "'+t.kind+'"'),f.resolve(t.result,t.tag)?(t.result=f.construct(t.result,t.tag),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):yo(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return null!==t.listener&&t.listener("close",t),null!==t.tag||null!==t.anchor||y}function Mo(t){var e,n,r,i,o=t.position,a=!1;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);0!==(i=t.input.charCodeAt(t.position))&&(ko(t,!0,-1),i=t.input.charCodeAt(t.position),!(t.lineIndent>0||37!==i));){for(a=!0,i=t.input.charCodeAt(++t.position),e=t.position;0!==i&&!oo(i);)i=t.input.charCodeAt(++t.position);for(r=[],(n=t.input.slice(e,t.position)).length<1&&yo(t,"directive name must not be less than one character in length");0!==i;){for(;io(i);)i=t.input.charCodeAt(++t.position);if(35===i){do{i=t.input.charCodeAt(++t.position)}while(0!==i&&!ro(i));break}if(ro(i))break;for(e=t.position;0!==i&&!oo(i);)i=t.input.charCodeAt(++t.position);r.push(t.input.slice(e,t.position))}0!==i&&xo(t),Ki.call(vo,n)?vo[n](t,n,r):go(t,'unknown document directive "'+n+'"')}ko(t,!0,-1),0===t.lineIndent&&45===t.input.charCodeAt(t.position)&&45===t.input.charCodeAt(t.position+1)&&45===t.input.charCodeAt(t.position+2)?(t.position+=3,ko(t,!0,-1)):a&&yo(t,"directives end mark is expected"),No(t,t.lineIndent-1,Hi,!1,!0),ko(t,!0,-1),t.checkLineBreaks&&Qi.test(t.input.slice(o,t.position))&&go(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&Oo(t)?46===t.input.charCodeAt(t.position)&&(t.position+=3,ko(t,!0,-1)):t.position=55296&&r<=56319&&e+1=56320&&n<=57343?1024*(r-55296)+n-56320+65536:r}function ba(t){return/^\n* /.test(t)}var _a=1,wa=2,xa=3,ka=4,Oa=5;function Sa(t,e,n,r,i){t.dump=function(){if(0===e.length)return t.quotingType===la?'""':"''";if(!t.noCompatMode&&(-1!==sa.indexOf(e)||ua.test(e)))return t.quotingType===la?'"'+e+'"':"'"+e+"'";var o=t.indent*Math.max(1,n),a=-1===t.lineWidth?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-o),s=r||t.flowLevel>-1&&n>=t.flowLevel;switch(function(t,e,n,r,i,o,a,s){var u,c,l=0,f=null,h=!1,p=!1,d=-1!==r,m=-1,y=ma(c=va(t,0))&&c!==Io&&!da(c)&&c!==Wo&&c!==Qo&&c!==Go&&c!==Ho&&c!==ta&&c!==ea&&c!==ra&&c!==oa&&c!==Uo&&c!==zo&&c!==Yo&&c!==$o&&c!==ia&&c!==Jo&&c!==Xo&&c!==Vo&&c!==qo&&c!==Ko&&c!==Zo&&c!==na&&function(t){return!da(t)&&t!==Go}(va(t,t.length-1));if(e||a)for(u=0;u=65536?u+=2:u++){if(!ma(l=va(t,u)))return Oa;y=y&&ga(l,f,s),f=l}else{for(u=0;u=65536?u+=2:u++){if((l=va(t,u))===Ro)h=!0,d&&(p=p||u-m-1>r&&" "!==t[m+1],m=u);else if(!ma(l))return Oa;y=y&&ga(l,f,s),f=l}p=p||d&&u-m-1>r&&" "!==t[m+1]}return h||p?n>9&&ba(t)?Oa:a?o===la?Oa:wa:p?ka:xa:!y||a||i(t)?o===la?Oa:wa:_a}(e,s,t.indent,a,(function(e){return function(t,e){var n,r;for(n=0,r=t.implicitTypes.length;n"+Ea(e,t.indent)+Aa(ha(function(t,e){for(var n,r,i,o=/(\n+)([^\n]*)/g,a=(i=-1!==(i=t.indexOf("\n"))?i:t.length,o.lastIndex=i,Ta(t.slice(0,i),e)),s="\n"===t[0]||" "===t[0];r=o.exec(t);){var u=r[1],c=r[2];n=" "===c[0],a+=u+(s||n||""===c?"":"\n")+Ta(c,e),s=n}return a}(e,a),o));case Oa:return'"'+function(t){for(var e,n="",r=0,i=0;i=65536?i+=2:i++)r=va(t,i),!(e=aa[r])&&ma(r)?(n+=t[i],r>=65536&&(n+=t[i+1])):n+=e||ca(r);return n}(e)+'"';default:throw new oi("impossible error: invalid scalar style")}}()}function Ea(t,e){var n=ba(t)?String(e):"",r="\n"===t[t.length-1];return n+(!r||"\n"!==t[t.length-2]&&"\n"!==t?r?"":"-":"+")+"\n"}function Aa(t){return"\n"===t[t.length-1]?t.slice(0,-1):t}function Ta(t,e){if(""===t||" "===t[0])return t;for(var n,r,i=/ [^ ]/g,o=0,a=0,s=0,u="";n=i.exec(t);)(s=n.index)-o>e&&(r=a>o?a:s,u+="\n"+t.slice(o,r),o=r+1),a=s;return u+="\n",t.length-o>e&&a>o?u+=t.slice(o,a)+"\n"+t.slice(a+1):u+=t.slice(o),u.slice(1)}function Na(t,e,n,r){var i,o,a,s="",u=t.tag;for(i=0,o=n.length;i tag resolver accepts not "'+u+'" style');r=s.represent[u](e,u)}t.dump=r}return!0}return!1}function Ca(t,e,n,r,i,o,a){t.tag=null,t.dump=n,Ma(t,n,!1)||Ma(t,n,!0);var s,u=Po.call(t.dump),c=r;r&&(r=t.flowLevel<0||t.flowLevel>e);var l,f,h="[object Object]"===u||"[object Array]"===u;if(h&&(f=-1!==(l=t.duplicates.indexOf(n))),(null!==t.tag&&"?"!==t.tag||f||2!==t.indent&&e>0)&&(i=!1),f&&t.usedDuplicates[l])t.dump="*ref_"+l;else{if(h&&f&&!t.usedDuplicates[l]&&(t.usedDuplicates[l]=!0),"[object Object]"===u)r&&0!==Object.keys(t.dump).length?(function(t,e,n,r){var i,o,a,s,u,c,l="",f=t.tag,h=Object.keys(n);if(!0===t.sortKeys)h.sort();else if("function"==typeof t.sortKeys)h.sort(t.sortKeys);else if(t.sortKeys)throw new oi("sortKeys must be a boolean or a function");for(i=0,o=h.length;i1024)&&(t.dump&&Ro===t.dump.charCodeAt(0)?c+="?":c+="? "),c+=t.dump,u&&(c+=pa(t,e)),Ca(t,e+1,s,!0,u)&&(t.dump&&Ro===t.dump.charCodeAt(0)?c+=":":c+=": ",l+=c+=t.dump));t.tag=f,t.dump=l||"{}"}(t,e,t.dump,i),f&&(t.dump="&ref_"+l+t.dump)):(function(t,e,n){var r,i,o,a,s,u="",c=t.tag,l=Object.keys(n);for(r=0,i=l.length;r1024&&(s+="? "),s+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),Ca(t,e,a,!1,!1)&&(u+=s+=t.dump));t.tag=c,t.dump="{"+u+"}"}(t,e,t.dump),f&&(t.dump="&ref_"+l+" "+t.dump));else if("[object Array]"===u)r&&0!==t.dump.length?(t.noArrayIndent&&!a&&e>0?Na(t,e-1,t.dump,i):Na(t,e,t.dump,i),f&&(t.dump="&ref_"+l+t.dump)):(function(t,e,n){var r,i,o,a="",s=t.tag;for(r=0,i=n.length;r",t.dump=s+" "+t.dump)}return!0}function ja(t,e){var n,r,i=[],o=[];for(Pa(t,i,o),n=0,r=o.length;n0&&void 0!==arguments[0]?arguments[0]:null;return this.pluginData.components.filter((function(t){return!t.getContainerId()})).map((function(r){var i=e.pluginData.emitEvent({parent:n,type:"Render",action:"write",status:"running",files:[r.path],data:{global:!1}}),o=new t.FileInput({path:r.path,content:Ia.dump(e.__formatComponent(r,!1),{lineWidth:-1,noRefs:!0})});return e.pluginData.emitEvent({id:i,status:"success"}),o}))}},{key:"__formatComponent",value:function(t,e){var n=this.__formatAttributes(t.attributes);if("others"===t.definition.apiVersion?n=this.__insertFront(n,"name",t.id):(n=this.__insertFront(n,"metadata",this.__insertFront(n.metadata||{},"name",t.id)),Object.keys(n.metadata.labels||{}).length||(n.metadata.labels={"app.kubernetes.io/name":t.id})),e||(n=this.__insertFront(n,"kind",t.definition.type),n=this.__insertFront(n,"apiVersion",t.definition.apiVersion)),this.__insertChildComponentsAttributes(n,t),["Deployment","StatefulSet","Job"].includes(t.definition.type)){var r,i,o,a=null===(r=n.spec)||void 0===r?void 0:r.template;a&&((i=n).spec||(i.spec={}),(o=n.spec).selector||(o.selector={}),n.spec.selector.matchLabels=a.metadata.labels,delete n.spec.template,n.spec.template=a)}return n}},{key:"__formatAttributes",value:function(t){var e=this;return t.reduce((function(t,n,r){var i,o;if("Object"===n.type)t[n.name||r]=e.__formatAttributes(n.value);else if("Link"===(null===(i=n.definition)||void 0===i?void 0:i.type))t[n.name]="selector"===n.name?e.__formatSelectorLinkAttribute(n):n.value[0];else if("Array"===n.type){var a;t[n.name]="Object"===(null===(a=n.value[0])||void 0===a?void 0:a.type)?Object.values(e.__formatAttributes(n.value)):n.value}else"Reference"===(null===(o=n.definition)||void 0===o?void 0:o.type)||"isInitContainer"===n.name||(t[n.name]=n.value);return t}),{})}},{key:"__formatSelectorLinkAttribute",value:function(t){var e,n;if(null===(e=t.value)||void 0===e||!e.length)return{};var r=t.value[0],i=this.pluginData.getComponentById(r);if(!i)throw new Error("Target component not found '".concat(r,"'."));var o=null===(n=i.attributes.find((function(t){return"metadata"===t.name})))||void 0===n||null===(n=n.value)||void 0===n||null===(n=n.find((function(t){return"labels"===t.name})))||void 0===n?void 0:n.value;return null!=o&&o.length?this.__formatAttributes(o):{"app.kubernetes.io/name":i.id}}},{key:"__insertChildComponentsAttributes",value:function(t,e){var n=this;if(e.definition.definedAttributes.find((function(t){return"spec"===t.name}))){var r=this.pluginData.getChildren(e.id);e.definition.childrenIndex.forEach((function(i){var o=i.attributeName,a=i.componentType,s=r.filter((function(t){return t.definition.type===a}));if(s.length)if(t.spec||(t.spec={}),"Pod"===e.definition.type){var u="initContainers"===o,c=s.filter((function(t){return t.getAttributeByName("isInitContainer").value===u}));c.length&&(t.spec[o]=c.map((function(t){return n.__formatComponent(t,!0)})))}else t.spec[o]=n.__formatComponent(s[0],!0)}))}}},{key:"__insertFront",value:function(t,e,n){return delete t[e],function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{event:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=new h,r=new _(n,{name:Ha.UU,version:Ha.rE},t.event);return Ga(this,e,[{configuration:n,pluginData:r,pluginMetadata:new J(r),pluginParser:new ti(r),pluginRenderer:new Ya(r)}])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Qa(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(t.DefaultPlugin)})();var i=exports;for(var o in r)i[o]=r[o];r.__esModule&&Object.defineProperty(i,"__esModule",{value:!0})})(); \ No newline at end of file +(()=>{var t={149:(t,e)=>{(()=>{var t={326:function(t){var e;"undefined"!=typeof self&&self,e=function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=11)}([function(t,e,n){"use strict";var r=Array.prototype,i=Object.prototype,o={"&":"&",'"':""","'":"'","<":"<",">":">","\\":"\"},a=/[&"'<>\\]/g;function s(t,e){return i.hasOwnProperty.call(t,e)}function u(t){return o[t]}function c(t,e,n){var r,i,o;if(t instanceof Error&&(t=(i=t).name+": "+i.message),Object.setPrototypeOf?(r=new Error(t),Object.setPrototypeOf(r,c.prototype)):(r=this,Object.defineProperty(r,"message",{enumerable:!1,writable:!0,value:t})),Object.defineProperty(r,"name",{value:"Template render error"}),Error.captureStackTrace&&Error.captureStackTrace(r,this.constructor),i){var a=Object.getOwnPropertyDescriptor(i,"stack");(o=a&&(a.get||function(){return a.value}))||(o=function(){return i.stack})}else{var s=new Error(t).stack;o=function(){return s}}return Object.defineProperty(r,"stack",{get:function(){return o.call(r)}}),Object.defineProperty(r,"cause",{value:i}),r.lineno=e,r.colno=n,r.firstUpdate=!0,r.Update=function(t){var e="("+(t||"unknown path")+")";return this.firstUpdate&&(this.lineno&&this.colno?e+=" [Line "+this.lineno+", Column "+this.colno+"]":this.lineno&&(e+=" [Line "+this.lineno+"]")),e+="\n ",this.firstUpdate&&(e+=" "),this.message=e+(this.message||""),this.firstUpdate=!1,this},r}function l(t){return"[object Function]"===i.toString.call(t)}function f(t){return"[object Array]"===i.toString.call(t)}function h(t){return"[object String]"===i.toString.call(t)}function p(t){return"[object Object]"===i.toString.call(t)}function d(t){var e,n=(e=t)?"string"==typeof e?e.split("."):[e]:[];return function(t){for(var e=t,r=0;rt.length)a=i.slice(0,t.length),i.slice(a.length,c).forEach((function(t,n){n2?i-2:0),a=2;a0||!n)&&process.stdout.write(" ".repeat(e));var o=i===r.length-1?"":"\n";process.stdout.write(""+t+o)}))}t.exports={Node:u,Root:f,NodeList:l,Value:c,Literal:h,Symbol:p,Group:d,Array:m,Pair:y,Dict:g,Output:$,Capture:q,TemplateData:U,If:b,IfAsync:_,InlineIf:w,For:x,AsyncEach:k,AsyncAll:O,Macro:S,Caller:E,Import:A,FromImport:T,FunCall:N,Filter:M,FilterAsync:C,KeywordArgs:j,Block:P,Super:L,Extends:I,Include:D,Set:R,Switch:B,Case:F,LookupVal:v,BinOp:z,In:V,Is:Y,Or:H,And:W,Not:G,Add:J,Concat:X,Sub:Q,Mul:Z,Div:tt,FloorDiv:et,Mod:nt,Pow:rt,Neg:it,Pos:ot,Compare:at,CompareOperand:st,CallExtension:ut,CallExtensionAsync:ct,printNodes:function t(e,n){if(n=n||0,lt(e.typename+": ",n),e instanceof l)lt("\n"),e.children.forEach((function(e){t(e,n+2)}));else if(e instanceof ut)lt(e.extName+"."+e.prop+"\n"),e.args&&t(e.args,n+2),e.contentArgs&&e.contentArgs.forEach((function(e){t(e,n+2)}));else{var r=[],i=null;e.iterFields((function(t,e){t instanceof u?r.push([e,t]):(i=i||{})[e]=t})),i?lt(JSON.stringify(i,null,2)+"\n",null,!0):lt("\n"),r.forEach((function(e){var r=e[0],i=e[1];lt("["+r+"] =>",n+2),t(i,n+4)}))}}}},function(t,e){},function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}var i=n(8),o=n(17),a=n(3),s=n(0).TemplateError,u=n(2).Frame,c=n(1).Obj,l={"==":"==","===":"===","!=":"!=","!==":"!==","<":"<",">":">","<=":"<=",">=":">="},f=function(t){var e,n;function i(){return t.apply(this,arguments)||this}n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n);var o=i.prototype;return o.init=function(t,e){this.templateName=t,this.codebuf=[],this.lastId=0,this.buffer=null,this.bufferStack=[],this._scopeClosers="",this.inBlock=!1,this.throwOnUndefined=e},o.fail=function(t,e,n){throw void 0!==e&&(e+=1),void 0!==n&&(n+=1),new s(t,e,n)},o._pushBuffer=function(){var t=this._tmpid();return this.bufferStack.push(this.buffer),this.buffer=t,this._emit("var "+this.buffer+' = "";'),t},o._popBuffer=function(){this.buffer=this.bufferStack.pop()},o._emit=function(t){this.codebuf.push(t)},o._emitLine=function(t){this._emit(t+"\n")},o._emitLines=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r0&&i._emit(","),i.compile(t,e)})),r&&this._emit(r)},o._compileExpression=function(t,e){this.assertType(t,a.Literal,a.Symbol,a.Group,a.Array,a.Dict,a.FunCall,a.Caller,a.Filter,a.LookupVal,a.Compare,a.InlineIf,a.In,a.Is,a.And,a.Or,a.Not,a.Add,a.Concat,a.Sub,a.Mul,a.Div,a.FloorDiv,a.Mod,a.Pow,a.Neg,a.Pos,a.Compare,a.NodeList),this.compile(t,e)},o.assertType=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r0&&r._emit(","),t){r._emitLine("function(cb) {"),r._emitLine("if(!cb) { cb = function(err) { if(err) { throw err; }}}");var i=r._pushBuffer();r._withScopedSyntax((function(){r.compile(t,e),r._emitLine("cb(null, "+i+");")})),r._popBuffer(),r._emitLine("return "+i+";"),r._emitLine("}")}else r._emit("null")})),n){var u=this._tmpid();this._emitLine(", "+this._makeCallback(u)),this._emitLine(this.buffer+" += runtime.suppressValue("+u+", "+s+" && env.opts.autoescape);"),this._addScopeLevel()}else this._emit(")"),this._emit(", "+s+" && env.opts.autoescape);\n")},o.compileCallExtensionAsync=function(t,e){this.compileCallExtension(t,e,!0)},o.compileNodeList=function(t,e){this._compileChildren(t,e)},o.compileLiteral=function(t){if("string"==typeof t.value){var e=t.value.replace(/\\/g,"\\\\");e=(e=(e=(e=(e=e.replace(/"/g,'\\"')).replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/\t/g,"\\t")).replace(/\u2028/g,"\\u2028"),this._emit('"'+e+'"')}else null===t.value?this._emit("null"):this._emit(t.value.toString())},o.compileSymbol=function(t,e){var n=t.value,r=e.lookup(n);r?this._emit(r):this._emit('runtime.contextOrFrameLookup(context, frame, "'+n+'")')},o.compileGroup=function(t,e){this._compileAggregate(t,e,"(",")")},o.compileArray=function(t,e){this._compileAggregate(t,e,"[","]")},o.compileDict=function(t,e){this._compileAggregate(t,e,"{","}")},o.compilePair=function(t,e){var n=t.key,r=t.value;n instanceof a.Symbol?n=new a.Literal(n.lineno,n.colno,n.value):n instanceof a.Literal&&"string"==typeof n.value||this.fail("compilePair: Dict keys must be strings or names",n.lineno,n.colno),this.compile(n,e),this._emit(": "),this._compileExpression(r,e)},o.compileInlineIf=function(t,e){this._emit("("),this.compile(t.cond,e),this._emit("?"),this.compile(t.body,e),this._emit(":"),null!==t.else_?this.compile(t.else_,e):this._emit('""'),this._emit(")")},o.compileIn=function(t,e){this._emit("runtime.inOperator("),this.compile(t.left,e),this._emit(","),this.compile(t.right,e),this._emit(")")},o.compileIs=function(t,e){var n=t.right.name?t.right.name.value:t.right.value;this._emit('env.getTest("'+n+'").call(context, '),this.compile(t.left,e),t.right.args&&(this._emit(","),this.compile(t.right.args,e)),this._emit(") === true")},o._binOpEmitter=function(t,e,n){this.compile(t.left,e),this._emit(n),this.compile(t.right,e)},o.compileOr=function(t,e){return this._binOpEmitter(t,e," || ")},o.compileAnd=function(t,e){return this._binOpEmitter(t,e," && ")},o.compileAdd=function(t,e){return this._binOpEmitter(t,e," + ")},o.compileConcat=function(t,e){return this._binOpEmitter(t,e,' + "" + ')},o.compileSub=function(t,e){return this._binOpEmitter(t,e," - ")},o.compileMul=function(t,e){return this._binOpEmitter(t,e," * ")},o.compileDiv=function(t,e){return this._binOpEmitter(t,e," / ")},o.compileMod=function(t,e){return this._binOpEmitter(t,e," % ")},o.compileNot=function(t,e){this._emit("!"),this.compile(t.target,e)},o.compileFloorDiv=function(t,e){this._emit("Math.floor("),this.compile(t.left,e),this._emit(" / "),this.compile(t.right,e),this._emit(")")},o.compilePow=function(t,e){this._emit("Math.pow("),this.compile(t.left,e),this._emit(", "),this.compile(t.right,e),this._emit(")")},o.compileNeg=function(t,e){this._emit("-"),this.compile(t.target,e)},o.compilePos=function(t,e){this._emit("+"),this.compile(t.target,e)},o.compileCompare=function(t,e){var n=this;this.compile(t.expr,e),t.ops.forEach((function(t){n._emit(" "+l[t.type]+" "),n.compile(t.expr,e)}))},o.compileLookupVal=function(t,e){this._emit("runtime.memberLookup(("),this._compileExpression(t.target,e),this._emit("),"),this._compileExpression(t.val,e),this._emit(")")},o._getNodeName=function(t){switch(t.typename){case"Symbol":return t.value;case"FunCall":return"the return value of ("+this._getNodeName(t.name)+")";case"LookupVal":return this._getNodeName(t.target)+'["'+this._getNodeName(t.val)+'"]';case"Literal":return t.value.toString();default:return"--expression--"}},o.compileFunCall=function(t,e){this._emit("(lineno = "+t.lineno+", colno = "+t.colno+", "),this._emit("runtime.callWrap("),this._compileExpression(t.name,e),this._emit(', "'+this._getNodeName(t.name).replace(/"/g,'\\"')+'", context, '),this._compileAggregate(t.args,e,"[","])"),this._emit(")")},o.compileFilter=function(t,e){var n=t.name;this.assertType(n,a.Symbol),this._emit('env.getFilter("'+n.value+'").call(context, '),this._compileAggregate(t.args,e),this._emit(")")},o.compileFilterAsync=function(t,e){var n=t.name,r=t.symbol.value;this.assertType(n,a.Symbol),e.set(r,r),this._emit('env.getFilter("'+n.value+'").call(context, '),this._compileAggregate(t.args,e),this._emitLine(", "+this._makeCallback(r)),this._addScopeLevel()},o.compileKeywordArgs=function(t,e){this._emit("runtime.makeKeywordArgs("),this.compileDict(t,e),this._emit(")")},o.compileSet=function(t,e){var n=this,r=[];t.targets.forEach((function(t){var i=t.value,o=e.lookup(i);null==o&&(o=n._tmpid(),n._emitLine("var "+o+";")),r.push(o)})),t.value?(this._emit(r.join(" = ")+" = "),this._compileExpression(t.value,e),this._emitLine(";")):(this._emit(r.join(" = ")+" = "),this.compile(t.body,e),this._emitLine(";")),t.targets.forEach((function(t,e){var i=r[e],o=t.value;n._emitLine('frame.set("'+o+'", '+i+", true);"),n._emitLine("if(frame.topLevel) {"),n._emitLine('context.setVariable("'+o+'", '+i+");"),n._emitLine("}"),"_"!==o.charAt(0)&&(n._emitLine("if(frame.topLevel) {"),n._emitLine('context.addExport("'+o+'", '+i+");"),n._emitLine("}"))}))},o.compileSwitch=function(t,e){var n=this;this._emit("switch ("),this.compile(t.expr,e),this._emit(") {"),t.cases.forEach((function(t,r){n._emit("case "),n.compile(t.cond,e),n._emit(": "),n.compile(t.body,e),t.body.children.length&&n._emitLine("break;")})),t.default&&(this._emit("default:"),this.compile(t.default,e)),this._emit("}")},o.compileIf=function(t,e,n){var r=this;this._emit("if("),this._compileExpression(t.cond,e),this._emitLine(") {"),this._withScopedSyntax((function(){r.compile(t.body,e),n&&r._emit("cb()")})),t.else_?(this._emitLine("}\nelse {"),this._withScopedSyntax((function(){r.compile(t.else_,e),n&&r._emit("cb()")}))):n&&(this._emitLine("}\nelse {"),this._emit("cb()")),this._emitLine("}")},o.compileIfAsync=function(t,e){this._emit("(function(cb) {"),this.compileIf(t,e,!0),this._emit("})("+this._makeCallback()),this._addScopeLevel()},o._emitLoopBindings=function(t,e,n,r){var i=this;[{name:"index",val:n+" + 1"},{name:"index0",val:n},{name:"revindex",val:r+" - "+n},{name:"revindex0",val:r+" - "+n+" - 1"},{name:"first",val:n+" === 0"},{name:"last",val:n+" === "+r+" - 1"},{name:"length",val:r}].forEach((function(t){i._emitLine('frame.set("loop.'+t.name+'", '+t.val+");")}))},o.compileFor=function(t,e){var n=this,r=this._tmpid(),i=this._tmpid(),o=this._tmpid();if(e=e.push(),this._emitLine("frame = frame.push();"),this._emit("var "+o+" = "),this._compileExpression(t.arr,e),this._emitLine(";"),this._emit("if("+o+") {"),this._emitLine(o+" = runtime.fromIterator("+o+");"),t.name instanceof a.Array){this._emitLine("var "+r+";"),this._emitLine("if(runtime.isArray("+o+")) {"),this._emitLine("var "+i+" = "+o+".length;"),this._emitLine("for("+r+"=0; "+r+" < "+o+".length; "+r+"++) {"),t.name.children.forEach((function(i,a){var s=n._tmpid();n._emitLine("var "+s+" = "+o+"["+r+"]["+a+"];"),n._emitLine('frame.set("'+i+'", '+o+"["+r+"]["+a+"]);"),e.set(t.name.children[a].value,s)})),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}"),this._emitLine("} else {");var s=t.name.children,u=s[0],c=s[1],l=this._tmpid(),f=this._tmpid();e.set(u.value,l),e.set(c.value,f),this._emitLine(r+" = -1;"),this._emitLine("var "+i+" = runtime.keys("+o+").length;"),this._emitLine("for(var "+l+" in "+o+") {"),this._emitLine(r+"++;"),this._emitLine("var "+f+" = "+o+"["+l+"];"),this._emitLine('frame.set("'+u.value+'", '+l+");"),this._emitLine('frame.set("'+c.value+'", '+f+");"),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}"),this._emitLine("}")}else{var h=this._tmpid();e.set(t.name.value,h),this._emitLine("var "+i+" = "+o+".length;"),this._emitLine("for(var "+r+"=0; "+r+" < "+o+".length; "+r+"++) {"),this._emitLine("var "+h+" = "+o+"["+r+"];"),this._emitLine('frame.set("'+t.name.value+'", '+h+");"),this._emitLoopBindings(t,o,r,i),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("}")}this._emitLine("}"),t.else_&&(this._emitLine("if (!"+i+") {"),this.compile(t.else_,e),this._emitLine("}")),this._emitLine("frame = frame.pop();")},o._compileAsyncLoop=function(t,e,n){var r=this,i=this._tmpid(),o=this._tmpid(),s=this._tmpid(),u=n?"asyncAll":"asyncEach";if(e=e.push(),this._emitLine("frame = frame.push();"),this._emit("var "+s+" = runtime.fromIterator("),this._compileExpression(t.arr,e),this._emitLine(");"),t.name instanceof a.Array){var c=t.name.children.length;this._emit("runtime."+u+"("+s+", "+c+", function("),t.name.children.forEach((function(t){r._emit(t.value+",")})),this._emit(i+","+o+",next) {"),t.name.children.forEach((function(t){var n=t.value;e.set(n,n),r._emitLine('frame.set("'+n+'", '+n+");")}))}else{var l=t.name.value;this._emitLine("runtime."+u+"("+s+", 1, function("+l+", "+i+", "+o+",next) {"),this._emitLine('frame.set("'+l+'", '+l+");"),e.set(l,l)}this._emitLoopBindings(t,s,i,o),this._withScopedSyntax((function(){var o;n&&(o=r._pushBuffer()),r.compile(t.body,e),r._emitLine("next("+i+(o?","+o:"")+");"),n&&r._popBuffer()}));var f=this._tmpid();this._emitLine("}, "+this._makeCallback(f)),this._addScopeLevel(),n&&this._emitLine(this.buffer+" += "+f+";"),t.else_&&(this._emitLine("if (!"+s+".length) {"),this.compile(t.else_,e),this._emitLine("}")),this._emitLine("frame = frame.pop();")},o.compileAsyncEach=function(t,e){this._compileAsyncLoop(t,e)},o.compileAsyncAll=function(t,e){this._compileAsyncLoop(t,e,!0)},o._compileMacro=function(t,e){var n=this,r=[],i=null,o="macro_"+this._tmpid(),s=void 0!==e;t.args.children.forEach((function(e,o){o===t.args.children.length-1&&e instanceof a.Dict?i=e:(n.assertType(e,a.Symbol),r.push(e))}));var c,l=[].concat(r.map((function(t){return"l_"+t.value})),["kwargs"]),f=r.map((function(t){return'"'+t.value+'"'})),h=(i&&i.children||[]).map((function(t){return'"'+t.key.value+'"'}));c=s?e.push(!0):new u,this._emitLines("var "+o+" = runtime.makeMacro(","["+f.join(", ")+"], ","["+h.join(", ")+"], ","function ("+l.join(", ")+") {","var callerFrame = frame;","frame = "+(s?"frame.push(true);":"new runtime.Frame();"),"kwargs = kwargs || {};",'if (Object.prototype.hasOwnProperty.call(kwargs, "caller")) {','frame.set("caller", kwargs.caller); }'),r.forEach((function(t){n._emitLine('frame.set("'+t.value+'", l_'+t.value+");"),c.set(t.value,"l_"+t.value)})),i&&i.children.forEach((function(t){var e=t.key.value;n._emit('frame.set("'+e+'", '),n._emit('Object.prototype.hasOwnProperty.call(kwargs, "'+e+'")'),n._emit(' ? kwargs["'+e+'"] : '),n._compileExpression(t.value,c),n._emit(");")}));var p=this._pushBuffer();return this._withScopedSyntax((function(){n.compile(t.body,c)})),this._emitLine("frame = "+(s?"frame.pop();":"callerFrame;")),this._emitLine("return new runtime.SafeString("+p+");"),this._emitLine("});"),this._popBuffer(),o},o.compileMacro=function(t,e){var n=this._compileMacro(t),r=t.name.value;e.set(r,n),e.parent?this._emitLine('frame.set("'+r+'", '+n+");"):("_"!==t.name.value.charAt(0)&&this._emitLine('context.addExport("'+r+'");'),this._emitLine('context.setVariable("'+r+'", '+n+");"))},o.compileCaller=function(t,e){this._emit("(function (){");var n=this._compileMacro(t,e);this._emit("return "+n+";})()")},o._compileGetTemplate=function(t,e,n,r){var i=this._tmpid(),o=this._templateName(),a=this._makeCallback(i),s=n?"true":"false",u=r?"true":"false";return this._emit("env.getTemplate("),this._compileExpression(t.template,e),this._emitLine(", "+s+", "+o+", "+u+", "+a),i},o.compileImport=function(t,e){var n=t.target.value,r=this._compileGetTemplate(t,e,!1,!1);this._addScopeLevel(),this._emitLine(r+".getExported("+(t.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(r)),this._addScopeLevel(),e.set(n,r),e.parent?this._emitLine('frame.set("'+n+'", '+r+");"):this._emitLine('context.setVariable("'+n+'", '+r+");")},o.compileFromImport=function(t,e){var n=this,r=this._compileGetTemplate(t,e,!1,!1);this._addScopeLevel(),this._emitLine(r+".getExported("+(t.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(r)),this._addScopeLevel(),t.names.children.forEach((function(t){var i,o,s=n._tmpid();t instanceof a.Pair?(i=t.key.value,o=t.value.value):o=i=t.value,n._emitLine("if(Object.prototype.hasOwnProperty.call("+r+', "'+i+'")) {'),n._emitLine("var "+s+" = "+r+"."+i+";"),n._emitLine("} else {"),n._emitLine("cb(new Error(\"cannot import '"+i+"'\")); return;"),n._emitLine("}"),e.set(o,s),e.parent?n._emitLine('frame.set("'+o+'", '+s+");"):n._emitLine('context.setVariable("'+o+'", '+s+");")}))},o.compileBlock=function(t){var e=this._tmpid();this.inBlock||this._emit('(parentTemplate ? function(e, c, f, r, cb) { cb(""); } : '),this._emit('context.getBlock("'+t.name.value+'")'),this.inBlock||this._emit(")"),this._emitLine("(env, context, frame, runtime, "+this._makeCallback(e)),this._emitLine(this.buffer+" += "+e+";"),this._addScopeLevel()},o.compileSuper=function(t,e){var n=t.blockName.value,r=t.symbol.value,i=this._makeCallback(r);this._emitLine('context.getSuper(env, "'+n+'", b_'+n+", frame, runtime, "+i),this._emitLine(r+" = runtime.markSafe("+r+");"),this._addScopeLevel(),e.set(r,r)},o.compileExtends=function(t,e){var n=this._tmpid(),r=this._compileGetTemplate(t,e,!0,!1);this._emitLine("parentTemplate = "+r),this._emitLine("for(var "+n+" in parentTemplate.blocks) {"),this._emitLine("context.addBlock("+n+", parentTemplate.blocks["+n+"]);"),this._emitLine("}"),this._addScopeLevel()},o.compileInclude=function(t,e){this._emitLine("var tasks = [];"),this._emitLine("tasks.push("),this._emitLine("function(callback) {");var n=this._compileGetTemplate(t,e,!1,t.ignoreMissing);this._emitLine("callback(null,"+n+");});"),this._emitLine("});");var r=this._tmpid();this._emitLine("tasks.push("),this._emitLine("function(template, callback){"),this._emitLine("template.render(context.getVariables(), frame, "+this._makeCallback(r)),this._emitLine("callback(null,"+r+");});"),this._emitLine("});"),this._emitLine("tasks.push("),this._emitLine("function(result, callback){"),this._emitLine(this.buffer+" += result;"),this._emitLine("callback(null);"),this._emitLine("});"),this._emitLine("env.waterfall(tasks, function(){"),this._addScopeLevel()},o.compileTemplateData=function(t,e){this.compileLiteral(t,e)},o.compileCapture=function(t,e){var n=this,r=this.buffer;this.buffer="output",this._emitLine("(function() {"),this._emitLine('var output = "";'),this._withScopedSyntax((function(){n.compile(t.body,e)})),this._emitLine("return output;"),this._emitLine("})()"),this.buffer=r},o.compileOutput=function(t,e){var n=this;t.children.forEach((function(r){r instanceof a.TemplateData?r.value&&(n._emit(n.buffer+" += "),n.compileLiteral(r,e),n._emitLine(";")):(n._emit(n.buffer+" += runtime.suppressValue("),n.throwOnUndefined&&n._emit("runtime.ensureDefined("),n.compile(r,e),n.throwOnUndefined&&n._emit(","+t.lineno+","+t.colno+")"),n._emit(", env.opts.autoescape);\n"))}))},o.compileRoot=function(t,e){var n=this;e&&this.fail("compileRoot: root node can't have frame"),e=new u,this._emitFuncBegin(t,"root"),this._emitLine("var parentTemplate = null;"),this._compileChildren(t,e),this._emitLine("if(parentTemplate) {"),this._emitLine("parentTemplate.rootRenderFunc(env, context, frame, runtime, cb);"),this._emitLine("} else {"),this._emitLine("cb(null, "+this.buffer+");"),this._emitLine("}"),this._emitFuncEnd(!0),this.inBlock=!0;var r=[],i=t.findAll(a.Block);i.forEach((function(t,e){var i=t.name.value;if(-1!==r.indexOf(i))throw new Error('Block "'+i+'" defined more than once.');r.push(i),n._emitFuncBegin(t,"b_"+i);var o=new u;n._emitLine("var frame = frame.push(true);"),n.compile(t.body,o),n._emitFuncEnd()})),this._emitLine("return {"),i.forEach((function(t,e){var r="b_"+t.name.value;n._emitLine(r+": "+r+",")})),this._emitLine("root: root\n};")},o.compile=function(t,e){var n=this["compile"+t.typename];n?n.call(this,t,e):this.fail("compile: Cannot compile node: "+t.typename,t.lineno,t.colno)},o.getCode=function(){return this.codebuf.join("")},i}(c);t.exports={compile:function(t,e,n,r,a){void 0===a&&(a={});var s=new f(r,a.throwOnUndefined),u=(n||[]).map((function(t){return t.preprocess})).filter((function(t){return!!t})).reduce((function(t,e){return e(t)}),t);return s.compile(o.transform(i.parse(u,n,a),e,r)),s.getCode()},Compiler:f}},function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}var i=n(4),o=n(1).EmitterObj;t.exports=function(t){var e,n;function o(){return t.apply(this,arguments)||this}n=t,(e=o).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n);var a=o.prototype;return a.resolve=function(t,e){return i.resolve(i.dirname(t),e)},a.isRelative=function(t){return 0===t.indexOf("./")||0===t.indexOf("../")},o}(o)},function(t,e,n){"use strict";function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,i(t,e)}function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}var o=n(12),a=n(15),s=n(0),u=n(5),c=n(18),l=n(10),f=l.FileSystemLoader,h=l.WebLoader,p=l.PrecompiledLoader,d=n(20),m=n(21),y=n(1),g=y.Obj,v=y.EmitterObj,b=n(2),_=b.handleError,w=b.Frame,x=n(22);function k(t,e,n){o((function(){t(e,n)}))}var O={type:"code",obj:{root:function(t,e,n,r,i){try{i(null,"")}catch(t){i(_(t,null,null))}}}},S=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.init=function(t,e){var n=this;e=this.opts=e||{},this.opts.dev=!!e.dev,this.opts.autoescape=null==e.autoescape||e.autoescape,this.opts.throwOnUndefined=!!e.throwOnUndefined,this.opts.trimBlocks=!!e.trimBlocks,this.opts.lstripBlocks=!!e.lstripBlocks,this.loaders=[],t?this.loaders=s.isArray(t)?t:[t]:f?this.loaders=[new f("views")]:h&&(this.loaders=[new h("/views")]),"undefined"!=typeof window&&window.nunjucksPrecompiled&&this.loaders.unshift(new p(window.nunjucksPrecompiled)),this._initLoaders(),this.globals=m(),this.filters={},this.tests={},this.asyncFilters=[],this.extensions={},this.extensionsList=[],s._entries(c).forEach((function(t){var e=t[0],r=t[1];return n.addFilter(e,r)})),s._entries(d).forEach((function(t){var e=t[0],r=t[1];return n.addTest(e,r)}))},n._initLoaders=function(){var t=this;this.loaders.forEach((function(e){e.cache={},"function"==typeof e.on&&(e.on("update",(function(n,r){e.cache[n]=null,t.emit("update",n,r,e)})),e.on("load",(function(n,r){t.emit("load",n,r,e)})))}))},n.invalidateCache=function(){this.loaders.forEach((function(t){t.cache={}}))},n.addExtension=function(t,e){return e.__name=t,this.extensions[t]=e,this.extensionsList.push(e),this},n.removeExtension=function(t){var e=this.getExtension(t);e&&(this.extensionsList=s.without(this.extensionsList,e),delete this.extensions[t])},n.getExtension=function(t){return this.extensions[t]},n.hasExtension=function(t){return!!this.extensions[t]},n.addGlobal=function(t,e){return this.globals[t]=e,this},n.getGlobal=function(t){if(void 0===this.globals[t])throw new Error("global not found: "+t);return this.globals[t]},n.addFilter=function(t,e,n){var r=e;return n&&this.asyncFilters.push(t),this.filters[t]=r,this},n.getFilter=function(t){if(!this.filters[t])throw new Error("filter not found: "+t);return this.filters[t]},n.addTest=function(t,e){return this.tests[t]=e,this},n.getTest=function(t){if(!this.tests[t])throw new Error("test not found: "+t);return this.tests[t]},n.resolveTemplate=function(t,e,n){return t.isRelative&&e&&t.isRelative(n)&&t.resolve?t.resolve(e,n):n},n.getTemplate=function(t,e,n,r,i){var o,a=this,u=this,c=null;if(t&&t.raw&&(t=t.raw),s.isFunction(n)&&(i=n,n=null,e=e||!1),s.isFunction(e)&&(i=e,e=!1),t instanceof A)c=t;else{if("string"!=typeof t)throw new Error("template names must be a string: "+t);for(var l=0;l0&&!this.skip(i.TOKEN_COMMA)&&this.fail("parseFrom: expected comma",t.lineno,t.colno);var s=this.parsePrimary();if("_"===s.value.charAt(0)&&this.fail("parseFrom: names starting with an underscore cannot be imported",s.lineno,s.colno),this.skipSymbol("as")){var u=this.parsePrimary();r.addChild(new o.Pair(s.lineno,s.colno,s,u))}else r.addChild(s);n=this.parseWithContext()}return new o.FromImport(t.lineno,t.colno,e,r,n)},u.parseBlock=function(){var t=this.peekToken();this.skipSymbol("block")||this.fail("parseBlock: expected block",t.lineno,t.colno);var e=new o.Block(t.lineno,t.colno);e.name=this.parsePrimary(),e.name instanceof o.Symbol||this.fail("parseBlock: variable name expected",t.lineno,t.colno),this.advanceAfterBlockEnd(t.value),e.body=this.parseUntilBlocks("endblock"),this.skipSymbol("endblock"),this.skipSymbol(e.name.value);var n=this.peekToken();return n||this.fail("parseBlock: expected endblock, got end of file"),this.advanceAfterBlockEnd(n.value),e},u.parseExtends=function(){var t="extends",e=this.peekToken();this.skipSymbol(t)||this.fail("parseTemplateRef: expected "+t);var n=new o.Extends(e.lineno,e.colno);return n.template=this.parseExpression(),this.advanceAfterBlockEnd(e.value),n},u.parseInclude=function(){var t="include",e=this.peekToken();this.skipSymbol(t)||this.fail("parseInclude: expected "+t);var n=new o.Include(e.lineno,e.colno);return n.template=this.parseExpression(),this.skipSymbol("ignore")&&this.skipSymbol("missing")&&(n.ignoreMissing=!0),this.advanceAfterBlockEnd(e.value),n},u.parseIf=function(){var t,e=this.peekToken();this.skipSymbol("if")||this.skipSymbol("elif")||this.skipSymbol("elseif")?t=new o.If(e.lineno,e.colno):this.skipSymbol("ifAsync")?t=new o.IfAsync(e.lineno,e.colno):this.fail("parseIf: expected if, elif, or elseif",e.lineno,e.colno),t.cond=this.parseExpression(),this.advanceAfterBlockEnd(e.value),t.body=this.parseUntilBlocks("elif","elseif","else","endif");var n=this.peekToken();switch(n&&n.value){case"elseif":case"elif":t.else_=this.parseIf();break;case"else":this.advanceAfterBlockEnd(),t.else_=this.parseUntilBlocks("endif"),this.advanceAfterBlockEnd();break;case"endif":t.else_=null,this.advanceAfterBlockEnd();break;default:this.fail("parseIf: expected elif, else, or endif, got end of file")}return t},u.parseSet=function(){var t=this.peekToken();this.skipSymbol("set")||this.fail("parseSet: expected set",t.lineno,t.colno);for(var e,n=new o.Set(t.lineno,t.colno,[]);(e=this.parsePrimary())&&(n.targets.push(e),this.skip(i.TOKEN_COMMA)););return this.skipValue(i.TOKEN_OPERATOR,"=")?(n.value=this.parseExpression(),this.advanceAfterBlockEnd(t.value)):this.skip(i.TOKEN_BLOCK_END)?(n.body=new o.Capture(t.lineno,t.colno,this.parseUntilBlocks("endset")),n.value=null,this.advanceAfterBlockEnd()):this.fail("parseSet: expected = or block end in set tag",t.lineno,t.colno),n},u.parseSwitch=function(){var t="switch",e="endswitch",n="case",r="default",i=this.peekToken();this.skipSymbol(t)||this.skipSymbol(n)||this.skipSymbol(r)||this.fail('parseSwitch: expected "switch," "case" or "default"',i.lineno,i.colno);var a=this.parseExpression();this.advanceAfterBlockEnd(t),this.parseUntilBlocks(n,r,e);var s,u=this.peekToken(),c=[];do{this.skipSymbol(n);var l=this.parseExpression();this.advanceAfterBlockEnd(t);var f=this.parseUntilBlocks(n,r,e);c.push(new o.Case(u.line,u.col,l,f)),u=this.peekToken()}while(u&&u.value===n);switch(u.value){case r:this.advanceAfterBlockEnd(),s=this.parseUntilBlocks(e),this.advanceAfterBlockEnd();break;case e:this.advanceAfterBlockEnd();break;default:this.fail('parseSwitch: expected "case," "default" or "endswitch," got EOF.')}return new o.Switch(i.lineno,i.colno,a,c,s)},u.parseStatement=function(){var t=this.peekToken();if(t.type!==i.TOKEN_SYMBOL&&this.fail("tag name expected",t.lineno,t.colno),this.breakOnBlocks&&-1!==s.indexOf(this.breakOnBlocks,t.value))return null;switch(t.value){case"raw":return this.parseRaw();case"verbatim":return this.parseRaw("verbatim");case"if":case"ifAsync":return this.parseIf();case"for":case"asyncEach":case"asyncAll":return this.parseFor();case"block":return this.parseBlock();case"extends":return this.parseExtends();case"include":return this.parseInclude();case"set":return this.parseSet();case"macro":return this.parseMacro();case"call":return this.parseCall();case"import":return this.parseImport();case"from":return this.parseFrom();case"filter":return this.parseFilterStatement();case"switch":return this.parseSwitch();default:if(this.extensions.length)for(var e=0;e0;){var u=a[0],c=a[1],l=a[2];l===t?r+=1:l===e&&(r-=1),0===r?(i+=c,this.tokens.backN(u.length-c.length)):i+=u}return new o.Output(s.lineno,s.colno,[new o.TemplateData(s.lineno,s.colno,i)])},u.parsePostfix=function(t){for(var e,n=this.peekToken();n;){if(n.type===i.TOKEN_LEFT_PAREN)t=new o.FunCall(n.lineno,n.colno,t,this.parseSignature());else if(n.type===i.TOKEN_LEFT_BRACKET)(e=this.parseAggregate()).children.length>1&&this.fail("invalid index"),t=new o.LookupVal(n.lineno,n.colno,t,e.children[0]);else{if(n.type!==i.TOKEN_OPERATOR||"."!==n.value)break;this.nextToken();var r=this.nextToken();r.type!==i.TOKEN_SYMBOL&&this.fail("expected name as lookup value, got "+r.value,r.lineno,r.colno),e=new o.Literal(r.lineno,r.colno,r.value),t=new o.LookupVal(n.lineno,n.colno,t,e)}n=this.peekToken()}return t},u.parseExpression=function(){return this.parseInlineIf()},u.parseInlineIf=function(){var t=this.parseOr();if(this.skipSymbol("if")){var e=this.parseOr(),n=t;(t=new o.InlineIf(t.lineno,t.colno)).body=n,t.cond=e,this.skipSymbol("else")?t.else_=this.parseOr():t.else_=null}return t},u.parseOr=function(){for(var t=this.parseAnd();this.skipSymbol("or");){var e=this.parseAnd();t=new o.Or(t.lineno,t.colno,t,e)}return t},u.parseAnd=function(){for(var t=this.parseNot();this.skipSymbol("and");){var e=this.parseNot();t=new o.And(t.lineno,t.colno,t,e)}return t},u.parseNot=function(){var t=this.peekToken();return this.skipSymbol("not")?new o.Not(t.lineno,t.colno,this.parseNot()):this.parseIn()},u.parseIn=function(){for(var t=this.parseIs();;){var e=this.nextToken();if(!e)break;var n=e.type===i.TOKEN_SYMBOL&&"not"===e.value;if(n||this.pushToken(e),!this.skipSymbol("in")){n&&this.pushToken(e);break}var r=this.parseIs();t=new o.In(t.lineno,t.colno,t,r),n&&(t=new o.Not(t.lineno,t.colno,t))}return t},u.parseIs=function(){var t=this.parseCompare();if(this.skipSymbol("is")){var e=this.skipSymbol("not"),n=this.parseCompare();t=new o.Is(t.lineno,t.colno,t,n),e&&(t=new o.Not(t.lineno,t.colno,t))}return t},u.parseCompare=function(){for(var t=["==","===","!=","!==","<",">","<=",">="],e=this.parseConcat(),n=[];;){var r=this.nextToken();if(!r)break;if(-1===t.indexOf(r.value)){this.pushToken(r);break}n.push(new o.CompareOperand(r.lineno,r.colno,this.parseConcat(),r.value))}return n.length?new o.Compare(n[0].lineno,n[0].colno,e,n):e},u.parseConcat=function(){for(var t=this.parseAdd();this.skipValue(i.TOKEN_TILDE,"~");){var e=this.parseAdd();t=new o.Concat(t.lineno,t.colno,t,e)}return t},u.parseAdd=function(){for(var t=this.parseSub();this.skipValue(i.TOKEN_OPERATOR,"+");){var e=this.parseSub();t=new o.Add(t.lineno,t.colno,t,e)}return t},u.parseSub=function(){for(var t=this.parseMul();this.skipValue(i.TOKEN_OPERATOR,"-");){var e=this.parseMul();t=new o.Sub(t.lineno,t.colno,t,e)}return t},u.parseMul=function(){for(var t=this.parseDiv();this.skipValue(i.TOKEN_OPERATOR,"*");){var e=this.parseDiv();t=new o.Mul(t.lineno,t.colno,t,e)}return t},u.parseDiv=function(){for(var t=this.parseFloorDiv();this.skipValue(i.TOKEN_OPERATOR,"/");){var e=this.parseFloorDiv();t=new o.Div(t.lineno,t.colno,t,e)}return t},u.parseFloorDiv=function(){for(var t=this.parseMod();this.skipValue(i.TOKEN_OPERATOR,"//");){var e=this.parseMod();t=new o.FloorDiv(t.lineno,t.colno,t,e)}return t},u.parseMod=function(){for(var t=this.parsePow();this.skipValue(i.TOKEN_OPERATOR,"%");){var e=this.parsePow();t=new o.Mod(t.lineno,t.colno,t,e)}return t},u.parsePow=function(){for(var t=this.parseUnary();this.skipValue(i.TOKEN_OPERATOR,"**");){var e=this.parseUnary();t=new o.Pow(t.lineno,t.colno,t,e)}return t},u.parseUnary=function(t){var e,n=this.peekToken();return e=this.skipValue(i.TOKEN_OPERATOR,"-")?new o.Neg(n.lineno,n.colno,this.parseUnary(!0)):this.skipValue(i.TOKEN_OPERATOR,"+")?new o.Pos(n.lineno,n.colno,this.parseUnary(!0)):this.parsePrimary(),t||(e=this.parseFilter(e)),e},u.parsePrimary=function(t){var e,n=this.nextToken(),r=null;if(n?n.type===i.TOKEN_STRING?e=n.value:n.type===i.TOKEN_INT?e=parseInt(n.value,10):n.type===i.TOKEN_FLOAT?e=parseFloat(n.value):n.type===i.TOKEN_BOOLEAN?"true"===n.value?e=!0:"false"===n.value?e=!1:this.fail("invalid boolean: "+n.value,n.lineno,n.colno):n.type===i.TOKEN_NONE?e=null:n.type===i.TOKEN_REGEX&&(e=new RegExp(n.value.body,n.value.flags)):this.fail("expected expression, got end of file"),void 0!==e?r=new o.Literal(n.lineno,n.colno,e):n.type===i.TOKEN_SYMBOL?r=new o.Symbol(n.lineno,n.colno,n.value):(this.pushToken(n),r=this.parseAggregate()),t||(r=this.parsePostfix(r)),r)return r;throw this.error("unexpected token: "+n.value,n.lineno,n.colno)},u.parseFilterName=function(){for(var t=this.expect(i.TOKEN_SYMBOL),e=t.value;this.skipValue(i.TOKEN_OPERATOR,".");)e+="."+this.expect(i.TOKEN_SYMBOL).value;return new o.Symbol(t.lineno,t.colno,e)},u.parseFilterArgs=function(t){return this.peekToken().type===i.TOKEN_LEFT_PAREN?this.parsePostfix(t).args.children:[]},u.parseFilter=function(t){for(;this.skip(i.TOKEN_PIPE);){var e=this.parseFilterName();t=new o.Filter(e.lineno,e.colno,e,new o.NodeList(e.lineno,e.colno,[t].concat(this.parseFilterArgs(t))))}return t},u.parseFilterStatement=function(){var t=this.peekToken();this.skipSymbol("filter")||this.fail("parseFilterStatement: expected filter");var e=this.parseFilterName(),n=this.parseFilterArgs(e);this.advanceAfterBlockEnd(t.value);var r=new o.Capture(e.lineno,e.colno,this.parseUntilBlocks("endfilter"));this.advanceAfterBlockEnd();var i=new o.Filter(e.lineno,e.colno,e,new o.NodeList(e.lineno,e.colno,[r].concat(n)));return new o.Output(e.lineno,e.colno,[i])},u.parseAggregate=function(){var t,e=this.nextToken();switch(e.type){case i.TOKEN_LEFT_PAREN:t=new o.Group(e.lineno,e.colno);break;case i.TOKEN_LEFT_BRACKET:t=new o.Array(e.lineno,e.colno);break;case i.TOKEN_LEFT_CURLY:t=new o.Dict(e.lineno,e.colno);break;default:return null}for(;;){var n=this.peekToken().type;if(n===i.TOKEN_RIGHT_PAREN||n===i.TOKEN_RIGHT_BRACKET||n===i.TOKEN_RIGHT_CURLY){this.nextToken();break}if(t.children.length>0&&(this.skip(i.TOKEN_COMMA)||this.fail("parseAggregate: expected comma after expression",e.lineno,e.colno)),t instanceof o.Dict){var r=this.parsePrimary();this.skip(i.TOKEN_COLON)||this.fail("parseAggregate: expected colon after dict key",e.lineno,e.colno);var a=this.parseExpression();t.addChild(new o.Pair(r.lineno,r.colno,r,a))}else{var s=this.parseExpression();t.addChild(s)}}return t},u.parseSignature=function(t,e){var n=this.peekToken();if(!e&&n.type!==i.TOKEN_LEFT_PAREN){if(t)return null;this.fail("expected arguments",n.lineno,n.colno)}n.type===i.TOKEN_LEFT_PAREN&&(n=this.nextToken());for(var r=new o.NodeList(n.lineno,n.colno),a=new o.KeywordArgs(n.lineno,n.colno),s=!1;;){if(n=this.peekToken(),!e&&n.type===i.TOKEN_RIGHT_PAREN){this.nextToken();break}if(e&&n.type===i.TOKEN_BLOCK_END)break;if(s&&!this.skip(i.TOKEN_COMMA))this.fail("parseSignature: expected comma after expression",n.lineno,n.colno);else{var u=this.parseExpression();this.skipValue(i.TOKEN_OPERATOR,"=")?a.addChild(new o.Pair(u.lineno,u.colno,u,this.parseExpression())):r.addChild(u)}s=!0}return a.children.length&&r.addChild(a),r},u.parseUntilBlocks=function(){for(var t=this.breakOnBlocks,e=arguments.length,n=new Array(e),r=0;r=","//","**"],R=C+this.current();switch(-1!==r.indexOf(D,R)&&(this.forward(),C=R,-1!==r.indexOf(D,R+this.current())&&(C=R+this.current(),this.forward())),C){case"(":I=d;break;case")":I=m;break;case"[":I=y;break;case"]":I=g;break;case"{":I=v;break;case"}":I=b;break;case",":I=w;break;case":":I=x;break;case"~":I=k;break;case"|":I=O;break;default:I=_}return M(I,C,e,n)}if((t=this._extractUntil(i+o)).match(/^[-+]?[0-9]+$/)){if("."===this.current()){this.forward();var B=this._extract("0123456789");return M(S,t+"."+B,e,n)}return M("int",t,e,n)}if(t.match(/^(true|false)$/))return M(E,t,e,n);if("none"===t)return M(A,t,e,n);if("null"===t)return M(A,t,e,n);if(t)return M(T,t,e,n);throw new Error("Unexpected value while parsing: "+t)}var F,$=this.tags.BLOCK_START.charAt(0)+this.tags.VARIABLE_START.charAt(0)+this.tags.COMMENT_START.charAt(0)+this.tags.COMMENT_END.charAt(0);if(this.isFinished())return null;if((t=this._extractString(this.tags.BLOCK_START+"-"))||(t=this._extractString(this.tags.BLOCK_START)))return this.in_code=!0,M(c,t,e,n);if((t=this._extractString(this.tags.VARIABLE_START+"-"))||(t=this._extractString(this.tags.VARIABLE_START)))return this.in_code=!0,M(f,t,e,n);t="";var q=!1;for(this._matches(this.tags.COMMENT_START)&&(q=!0,t=this._extractString(this.tags.COMMENT_START));null!==(F=this._extractUntil($));){if(t+=F,(this._matches(this.tags.BLOCK_START)||this._matches(this.tags.VARIABLE_START)||this._matches(this.tags.COMMENT_START))&&!q){if(this.lstripBlocks&&this._matches(this.tags.BLOCK_START)&&this.colno>0&&this.colno<=t.length){var U=t.slice(-this.colno);if(/^\s+$/.test(U)&&!(t=t.slice(0,-this.colno)).length)return this.nextToken()}break}if(this._matches(this.tags.COMMENT_END)){if(!q)throw new Error("unexpected end of comment");t+=this._extractString(this.tags.COMMENT_END);break}t+=this.current(),this.forward()}if(null===F&&q)throw new Error("expected end of comment, got end of file");return M(q?p:u,t,e,n)},e._parseString=function(t){this.forward();for(var e="";!this.isFinished()&&this.current()!==t;){var n=this.current();if("\\"===n){switch(this.forward(),this.current()){case"n":e+="\n";break;case"t":e+="\t";break;case"r":e+="\r";break;default:e+=this.current()}this.forward()}else e+=n,this.forward()}return this.forward(),e},e._matches=function(t){return this.index+t.length>this.len?null:this.str.slice(this.index,this.index+t.length)===t},e._extractString=function(t){return this._matches(t)?(this.forwardN(t.length),t):null},e._extractUntil=function(t){return this._extractMatching(!0,t||"")},e._extract=function(t){return this._extractMatching(!1,t)},e._extractMatching=function(t,e){if(this.isFinished())return null;var n=e.indexOf(this.current());if(t&&-1===n||!t&&-1!==n){var r=this.current();this.forward();for(var i=e.indexOf(this.current());(t&&-1===i||!t&&-1!==i)&&!this.isFinished();)r+=this.current(),this.forward(),i=e.indexOf(this.current());return r}return""},e._extractRegex=function(t){var e=this.currentStr().match(t);return e?(this.forwardN(e[0].length),e):null},e.isFinished=function(){return this.index>=this.len},e.forwardN=function(t){for(var e=0;e1024){for(var e=0,n=i.length-o;e0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}return t}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=h.bind(r);return i.listener=n,r.wrapFn=i,i}function d(t,e,n){var r=t._events;if(void 0===r)return[];var i=r[e];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(t){for(var e=new Array(t.length),n=0;n0&&(a=e[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=i[t];if(void 0===u)return!1;if("function"==typeof u)o(u,this,e);else{var c=u.length,l=y(u,c);for(n=0;n=0;o--)if(n[o]===e||n[o].listener===e){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(t,e){for(;e+1=0;r--)this.removeListener(t,e[r]);return this},s.prototype.listeners=function(t){return d(this,t,!0)},s.prototype.rawListeners=function(t){return d(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},s.prototype.listenerCount=m,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(t,e,n){"use strict";var r=n(3),i=n(0),o=0;function a(){return"hole_"+o++}function s(t,e){for(var n=null,r=0;r=e)return t;var n=e-t.length,a=r.repeat(" ",n/2-n%2),s=r.repeat(" ",n/2);return i.copySafeness(t,a+t+s)},e.default=function(t,e,n){return n?t||e:void 0!==t?t:e},e.dictsort=function(t,e,n){if(!r.isObject(t))throw new r.TemplateError("dictsort filter: val must be an object");var i,o=[];for(var a in t)o.push([a,t[a]]);if(void 0===n||"key"===n)i=0;else{if("value"!==n)throw new r.TemplateError("dictsort filter: You can only sort by either key or value");i=1}return o.sort((function(t,n){var o=t[i],a=n[i];return e||(r.isString(o)&&(o=o.toUpperCase()),r.isString(a)&&(a=a.toUpperCase())),o>a?1:o===a?0:-1})),o},e.dump=function(t,e){return JSON.stringify(t,null,e)},e.escape=function(t){return t instanceof i.SafeString?t:(t=null==t?"":t,i.markSafe(r.escape(t.toString())))},e.safe=function(t){return t instanceof i.SafeString?t:(t=null==t?"":t,i.markSafe(t.toString()))},e.first=function(t){return t[0]},e.forceescape=function(t){return t=null==t?"":t,i.markSafe(r.escape(t.toString()))},e.groupby=function(t,e){return r.groupBy(t,e,this.env.opts.throwOnUndefined)},e.indent=function(t,e,n){if(""===(t=o(t,"")))return"";e=e||4;var a=t.split("\n"),s=r.repeat(" ",e),u=a.map((function(t,e){return 0!==e||n?""+s+t:t})).join("\n");return i.copySafeness(t,u)},e.join=function(t,e,n){return e=e||"",n&&(t=r.map(t,(function(t){return t[n]}))),t.join(e)},e.last=function(t){return t[t.length-1]},e.length=function(t){var e=o(t,"");return void 0!==e?"function"==typeof Map&&e instanceof Map||"function"==typeof Set&&e instanceof Set?e.size:!r.isObject(e)||e instanceof i.SafeString?e.length:r.keys(e).length:0},e.list=u,e.lower=function(t){return(t=o(t,"")).toLowerCase()},e.nl2br=function(t){return null==t?"":i.copySafeness(t,t.replace(/\r\n|\n/g,"
\n"))},e.random=function(t){return t[Math.floor(Math.random()*t.length)]},e.reject=c(!1),e.rejectattr=function(t,e){return t.filter((function(t){return!t[e]}))},e.select=c(!0),e.selectattr=function(t,e){return t.filter((function(t){return!!t[e]}))},e.replace=function(t,e,n,r){var o=t;if(e instanceof RegExp)return t.replace(e,n);void 0===r&&(r=-1);var a="";if("number"==typeof e)e=""+e;else if("string"!=typeof e)return t;if("number"==typeof t&&(t=""+t),"string"!=typeof t&&!(t instanceof i.SafeString))return t;if(""===e)return a=n+t.split("").join(n)+n,i.copySafeness(t,a);var s=t.indexOf(e);if(0===r||-1===s)return t;for(var u=0,c=0;s>-1&&(-1===r||c=i&&l.push(n),o.push(l)}return o},e.sum=function(t,e,n){return void 0===n&&(n=0),e&&(t=r.map(t,(function(t){return t[e]}))),n+t.reduce((function(t,e){return t+e}),0)},e.sort=i.makeMacro(["value","reverse","case_sensitive","attribute"],[],(function(t,e,n,i){var o=this,a=r.map(t,(function(t){return t})),s=r.getAttrGetter(i);return a.sort((function(t,a){var u=i?s(t):t,c=i?s(a):a;if(o.env.opts.throwOnUndefined&&i&&(void 0===u||void 0===c))throw new TypeError('sort: attribute "'+i+'" resolved to undefined');return!n&&r.isString(u)&&r.isString(c)&&(u=u.toLowerCase(),c=c.toLowerCase()),uc?e?-1:1:0})),a})),e.string=function(t){return i.copySafeness(t,t)},e.striptags=function(t,e){var n,r=l((t=o(t,"")).replace(/<\/?([a-z][a-z0-9]*)\b[^>]*>|/gi,""));return n=e?r.replace(/^ +| +$/gm,"").replace(/ +/g," ").replace(/(\r\n)/g,"\n").replace(/\n\n\n+/g,"\n\n"):r.replace(/\s+/gi," "),i.copySafeness(t,n)},e.title=function(t){var e=(t=o(t,"")).split(" ").map((function(t){return s(t)}));return i.copySafeness(t,e.join(" "))},e.trim=l,e.truncate=function(t,e,n,r){var a=t;if(e=e||255,(t=o(t,"")).length<=e)return t;if(n)t=t.substring(0,e);else{var s=t.lastIndexOf(" ",e);-1===s&&(s=e),t=t.substring(0,s)}return t+=null!=r?r:"...",i.copySafeness(a,t)},e.upper=function(t){return(t=o(t,"")).toUpperCase()},e.urlencode=function(t){var e=encodeURIComponent;return r.isString(t)?e(t):(r.isArray(t)?t:r._entries(t)).map((function(t){var n=t[0],r=t[1];return e(n)+"="+e(r)})).join("&")};var f=/^(?:\(|<|<)?(.*?)(?:\.|,|\)|\n|>)?$/,h=/^[\w.!#$%&'*+\-\/=?\^`{|}~]+@[a-z\d\-]+(\.[a-z\d\-]+)+$/i,p=/^https?:\/\/.*$/,d=/^www\./,m=/\.(?:org|net|com)(?:\:|\/|$)/;e.urlize=function(t,e,n){a(e)&&(e=1/0);var r=!0===n?' rel="nofollow"':"";return t.split(/(\s+)/).filter((function(t){return t&&t.length})).map((function(t){var n=t.match(f),i=n?n[1]:t,o=i.substr(0,e);return p.test(i)?'"+o+"":d.test(i)?'"+o+"":h.test(i)?''+i+"":m.test(i)?'"+o+"":t})).join("")},e.wordcount=function(t){var e=(t=o(t,""))?t.match(/\w+/g):null;return e?e.length:null},e.float=function(t,e){var n=parseFloat(t);return a(n)?e:n};var y=i.makeMacro(["value","default","base"],[],(function(t,e,n){void 0===n&&(n=10);var r=parseInt(t,n);return a(r)?e:r}));e.int=y,e.d=e.default,e.e=e.escape},function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}var i=function(t){var e,n;function i(e){var n;return(n=t.call(this)||this).precompiled=e||{},n}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n),i.prototype.getSource=function(t){return this.precompiled[t]?{src:{type:"code",obj:this.precompiled[t]},path:t}:null},i}(n(6));t.exports={PrecompiledLoader:i}},function(t,e,n){"use strict";var r=n(2).SafeString;e.callable=function(t){return"function"==typeof t},e.defined=function(t){return void 0!==t},e.divisibleby=function(t,e){return t%e==0},e.escaped=function(t){return t instanceof r},e.equalto=function(t,e){return t===e},e.eq=e.equalto,e.sameas=e.equalto,e.even=function(t){return t%2==0},e.falsy=function(t){return!t},e.ge=function(t,e){return t>=e},e.greaterthan=function(t,e){return t>e},e.gt=e.greaterthan,e.le=function(t,e){return t<=e},e.lessthan=function(t,e){return t0)for(var i=t;ie;o+=n)r.push(o);return r},cycler:function(){return t=Array.prototype.slice.call(arguments),e=-1,{current:null,reset:function(){e=-1,this.current=null},next:function(){return++e>=t.length&&(e=0),this.current=t[e],this.current}};var t,e},joiner:function(t){return function(t){t=t||",";var e=!0;return function(){var n=e?"":t;return e=!1,n}}(t)}}}},function(t,e,n){var r=n(4);t.exports=function(t,e){function n(t,e){if(this.name=t,this.path=t,this.defaultEngine=e.defaultEngine,this.ext=r.extname(t),!this.ext&&!this.defaultEngine)throw new Error("No default engine was specified and no extension was provided.");this.ext||(this.name+=this.ext=("."!==this.defaultEngine[0]?".":"")+this.defaultEngine)}return n.prototype.render=function(e,n){t.render(this.name,e,n)},e.set("view",n),e.set("nunjucksEnv",t),t}},function(t,e,n){"use strict";var r=n(4),i=n(4),o=n(0)._prettifyError,a=n(5),s=n(7).Environment,u=n(24);function c(t,e){return!!Array.isArray(e)&&e.some((function(e){return t.match(e)}))}function l(t,e){(e=e||{}).isString=!0;var n=e.env||new s([]),r=e.wrapper||u;if(!e.name)throw new Error('the "name" option is required when compiling a string');return r([f(t,e.name,n)],e)}function f(t,e,n){var r,i=(n=n||new s([])).asyncFilters,u=n.extensionsList;e=e.replace(/\\/g,"/");try{r=a.compile(t,i,u,e,n.opts)}catch(t){throw o(e,!1,t)}return{name:e,template:r}}t.exports={precompile:function(t,e){var n=(e=e||{}).env||new s([]),o=e.wrapper||u;if(e.isString)return l(t,e);var a=r.existsSync(t)&&r.statSync(t),h=[],p=[];if(a.isFile())h.push(f(r.readFileSync(t,"utf-8"),e.name||t,n));else if(a.isDirectory()){!function n(o){r.readdirSync(o).forEach((function(a){var s=i.join(o,a),u=s.substr(i.join(t,"/").length),l=r.statSync(s);l&&l.isDirectory()?c(u+="/",e.exclude)||n(s):c(u,e.include)&&p.push(s)}))}(t);for(var d=0;dt.length||i>0&&a>=r||i<0&&a<=r);a+=i)o.push(n.memberLookup(t,a));return o}function p(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var d={pop:function(t){if(void 0===t)return this.pop();if(t>=this.length||t<0)throw new Error("KeyError");return this.splice(t,1)},append:function(t){return this.push(t)},remove:function(t){for(var e=0;e{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};(()=>{"use strict";r.r(i),r.d(i,{Component:()=>S,ComponentAttribute:()=>f,ComponentAttributeDefinition:()=>P,ComponentDefinition:()=>A,ComponentDrawOption:()=>g,ComponentLink:()=>$,ComponentLinkDefinition:()=>U,ComponentRenderer:()=>FT,DefaultConfiguration:()=>HN,DefaultData:()=>$N,DefaultDrawer:()=>fN,DefaultMetadata:()=>mN,DefaultParser:()=>bN,DefaultPlugin:()=>XN,DefaultRender:()=>kN,FileInformation:()=>m,FileInput:()=>G,LinkRenderer:()=>KT,ParserLog:()=>s,Tag:()=>ZN,Variable:()=>aM});var t={};function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function n(t,e,n){return(e=o(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o(t){var n=function(t){if("object"!=e(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=e(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==e(n)?n:n+""}r.r(t),r.d(t,{Adder:()=>xt,Delaunay:()=>Uu,FormatSpecifier:()=>sf,InternMap:()=>St,InternSet:()=>Et,Node:()=>Cy,Path:()=>is,Voronoi:()=>Du,ZoomTransform:()=>$E,active:()=>ca,arc:()=>OO,area:()=>jO,areaRadial:()=>qO,ascending:()=>J,autoType:()=>wc,axisBottom:()=>pn,axisLeft:()=>dn,axisRight:()=>hn,axisTop:()=>fn,bin:()=>ae,bisect:()=>ot,bisectCenter:()=>it,bisectLeft:()=>rt,bisectRight:()=>nt,bisector:()=>Q,blob:()=>ll,blur:()=>at,blur2:()=>st,blurImage:()=>ut,brush:()=>Ba,brushSelection:()=>Ia,brushX:()=>Da,brushY:()=>Ra,buffer:()=>hl,chord:()=>Ga,chordDirected:()=>Xa,chordTranspose:()=>Ja,cluster:()=>Oy,color:()=>oi,contourDensity:()=>pu,contours:()=>ou,count:()=>pt,create:()=>Qk,creator:()=>_r,cross:()=>gt,csv:()=>gl,csvFormat:()=>uc,csvFormatBody:()=>cc,csvFormatRow:()=>fc,csvFormatRows:()=>lc,csvFormatValue:()=>hc,csvParse:()=>ac,csvParseRows:()=>sc,cubehelix:()=>Gs,cumsum:()=>vt,curveBasis:()=>CS,curveBasisClosed:()=>PS,curveBasisOpen:()=>IS,curveBumpX:()=>VO,curveBumpY:()=>YO,curveBundle:()=>RS,curveCardinal:()=>$S,curveCardinalClosed:()=>US,curveCardinalOpen:()=>zS,curveCatmullRom:()=>HS,curveCatmullRomClosed:()=>GS,curveCatmullRomOpen:()=>XS,curveLinear:()=>TO,curveLinearClosed:()=>ZS,curveMonotoneX:()=>sE,curveMonotoneY:()=>uE,curveNatural:()=>fE,curveStep:()=>pE,curveStepAfter:()=>mE,curveStepBefore:()=>dE,descending:()=>X,deviation:()=>_t,difference:()=>ze,disjoint:()=>Ve,dispatch:()=>_n,drag:()=>Gu,dragDisable:()=>Fr,dragEnable:()=>$r,dsv:()=>yl,dsvFormat:()=>ic,easeBack:()=>il,easeBackIn:()=>nl,easeBackInOut:()=>il,easeBackOut:()=>rl,easeBounce:()=>Zc,easeBounceIn:()=>Qc,easeBounceInOut:()=>tl,easeBounceOut:()=>Zc,easeCircle:()=>qc,easeCircleIn:()=>Fc,easeCircleInOut:()=>qc,easeCircleOut:()=>$c,easeCubic:()=>oa,easeCubicIn:()=>ra,easeCubicInOut:()=>oa,easeCubicOut:()=>ia,easeElastic:()=>sl,easeElasticIn:()=>al,easeElasticInOut:()=>ul,easeElasticOut:()=>sl,easeExp:()=>Bc,easeExpIn:()=>Dc,easeExpInOut:()=>Bc,easeExpOut:()=>Rc,easeLinear:()=>kc,easePoly:()=>Nc,easePolyIn:()=>Ac,easePolyInOut:()=>Nc,easePolyOut:()=>Tc,easeQuad:()=>Ec,easeQuadIn:()=>Oc,easeQuadInOut:()=>Ec,easeQuadOut:()=>Sc,easeSin:()=>Lc,easeSinIn:()=>jc,easeSinInOut:()=>Lc,easeSinOut:()=>Pc,every:()=>Be,extent:()=>wt,fcumsum:()=>Ot,filter:()=>$e,flatGroup:()=>It,flatRollup:()=>Dt,forceCenter:()=>El,forceCollide:()=>Fl,forceLink:()=>Ul,forceManyBody:()=>Xl,forceRadial:()=>Ql,forceSimulation:()=>Jl,forceX:()=>Zl,forceY:()=>tf,format:()=>hf,formatDefaultLocale:()=>gf,formatLocale:()=>yf,formatPrefix:()=>pf,formatSpecifier:()=>af,fsum:()=>kt,geoAlbers:()=>Fm,geoAlbersUsa:()=>$m,geoArea:()=>wh,geoAzimuthalEqualArea:()=>zm,geoAzimuthalEqualAreaRaw:()=>Km,geoAzimuthalEquidistant:()=>Ym,geoAzimuthalEquidistantRaw:()=>Vm,geoBounds:()=>np,geoCentroid:()=>dp,geoCircle:()=>Sp,geoClipAntimeridian:()=>Dp,geoClipCircle:()=>Rp,geoClipExtent:()=>Vp,geoClipRectangle:()=>zp,geoConicConformal:()=>Qm,geoConicConformalRaw:()=>Xm,geoConicEqualArea:()=>Bm,geoConicEqualAreaRaw:()=>Rm,geoConicEquidistant:()=>ny,geoConicEquidistantRaw:()=>ey,geoContains:()=>ud,geoDistance:()=>Zp,geoEqualEarth:()=>cy,geoEqualEarthRaw:()=>uy,geoEquirectangular:()=>ty,geoEquirectangularRaw:()=>Zm,geoGnomonic:()=>fy,geoGnomonicRaw:()=>ly,geoGraticule:()=>fd,geoGraticule10:()=>hd,geoIdentity:()=>hy,geoInterpolate:()=>pd,geoLength:()=>Jp,geoMercator:()=>Wm,geoMercatorRaw:()=>Hm,geoNaturalEarth1:()=>dy,geoNaturalEarth1Raw:()=>py,geoOrthographic:()=>yy,geoOrthographicRaw:()=>my,geoPath:()=>_m,geoProjection:()=>Lm,geoProjectionMutator:()=>Im,geoRotation:()=>xp,geoStereographic:()=>vy,geoStereographicRaw:()=>gy,geoStream:()=>Xf,geoTransform:()=>wm,geoTransverseMercator:()=>_y,geoTransverseMercatorRaw:()=>by,gray:()=>Ns,greatest:()=>pe,greatestIndex:()=>Me,group:()=>jt,groupSort:()=>Ht,groups:()=>Pt,hcl:()=>Bs,hierarchy:()=>Ey,histogram:()=>ae,hsl:()=>vi,html:()=>Ol,image:()=>bl,index:()=>Ft,indexes:()=>$t,interpolate:()=>zi,interpolateArray:()=>Di,interpolateBasis:()=>Oi,interpolateBasisClosed:()=>Si,interpolateBlues:()=>Sk,interpolateBrBG:()=>Rx,interpolateBuGn:()=>ek,interpolateBuPu:()=>rk,interpolateCividis:()=>Dk,interpolateCool:()=>Fk,interpolateCubehelix:()=>Vg,interpolateCubehelixDefault:()=>Rk,interpolateCubehelixLong:()=>Yg,interpolateDate:()=>Bi,interpolateDiscrete:()=>jg,interpolateGnBu:()=>ok,interpolateGreens:()=>Ak,interpolateGreys:()=>Nk,interpolateHcl:()=>Ug,interpolateHclLong:()=>Kg,interpolateHsl:()=>Bg,interpolateHslLong:()=>Fg,interpolateHue:()=>Pg,interpolateInferno:()=>Jk,interpolateLab:()=>$g,interpolateMagma:()=>Gk,interpolateNumber:()=>Fi,interpolateNumberArray:()=>Li,interpolateObject:()=>$i,interpolateOrRd:()=>sk,interpolateOranges:()=>Ik,interpolatePRGn:()=>Fx,interpolatePiYG:()=>qx,interpolatePlasma:()=>Xk,interpolatePuBu:()=>fk,interpolatePuBuGn:()=>ck,interpolatePuOr:()=>Kx,interpolatePuRd:()=>pk,interpolatePurples:()=>Ck,interpolateRainbow:()=>qk,interpolateRdBu:()=>Vx,interpolateRdGy:()=>Hx,interpolateRdPu:()=>mk,interpolateRdYlBu:()=>Gx,interpolateRdYlGn:()=>Xx,interpolateReds:()=>Pk,interpolateRgb:()=>Mi,interpolateRgbBasis:()=>ji,interpolateRgbBasisClosed:()=>Pi,interpolateRound:()=>Lg,interpolateSinebow:()=>Vk,interpolateSpectral:()=>Zx,interpolateString:()=>Ki,interpolateTransformCss:()=>jo,interpolateTransformSvg:()=>Po,interpolateTurbo:()=>Yk,interpolateViridis:()=>Wk,interpolateWarm:()=>Bk,interpolateYlGn:()=>bk,interpolateYlGnBu:()=>gk,interpolateYlOrBr:()=>wk,interpolateYlOrRd:()=>kk,interpolateZoom:()=>Dg,interrupt:()=>Eo,intersection:()=>Ye,interval:()=>RE,isoFormat:()=>LE,isoParse:()=>DE,json:()=>wl,lab:()=>Ms,lch:()=>Rs,least:()=>Te,leastIndex:()=>Ne,line:()=>CO,lineRadial:()=>$O,link:()=>JO,linkHorizontal:()=>XO,linkRadial:()=>ZO,linkVertical:()=>QO,local:()=>tO,map:()=>qe,matcher:()=>En,max:()=>se,maxIndex:()=>ue,mean:()=>be,median:()=>_e,medianIndex:()=>we,merge:()=>xe,min:()=>ce,minIndex:()=>le,mode:()=>ke,namespace:()=>qn,namespaces:()=>$n,nice:()=>ie,now:()=>io,pack:()=>ng,packEnclose:()=>$y,packSiblings:()=>tg,pairs:()=>Oe,partition:()=>ug,path:()=>os,pathRound:()=>as,permute:()=>Kt,pie:()=>IO,piecewise:()=>Hg,pointRadial:()=>UO,pointer:()=>Yi,pointers:()=>nO,polygonArea:()=>Gg,polygonCentroid:()=>Jg,polygonContains:()=>ev,polygonHull:()=>tv,polygonLength:()=>nv,precisionFixed:()=>vf,precisionPrefix:()=>bf,precisionRound:()=>_f,quadtree:()=>Cl,quantile:()=>de,quantileIndex:()=>ye,quantileSorted:()=>me,quantize:()=>Wg,quickselect:()=>fe,radialArea:()=>qO,radialLine:()=>$O,randomBates:()=>cv,randomBernoulli:()=>hv,randomBeta:()=>mv,randomBinomial:()=>yv,randomCauchy:()=>vv,randomExponential:()=>lv,randomGamma:()=>dv,randomGeometric:()=>pv,randomInt:()=>ov,randomIrwinHall:()=>uv,randomLcg:()=>Ov,randomLogNormal:()=>sv,randomLogistic:()=>bv,randomNormal:()=>av,randomPareto:()=>fv,randomPoisson:()=>_v,randomUniform:()=>iv,randomWeibull:()=>gv,range:()=>Ee,rank:()=>Ae,reduce:()=>Ue,reverse:()=>Ke,rgb:()=>ci,ribbon:()=>gs,ribbonArrow:()=>vs,rollup:()=>Rt,rollups:()=>Bt,scaleBand:()=>Nv,scaleDiverging:()=>vx,scaleDivergingLog:()=>bx,scaleDivergingPow:()=>wx,scaleDivergingSqrt:()=>xx,scaleDivergingSymlog:()=>_x,scaleIdentity:()=>zv,scaleImplicit:()=>Av,scaleLinear:()=>Kv,scaleLog:()=>Zv,scaleOrdinal:()=>Tv,scalePoint:()=>Cv,scalePow:()=>ub,scaleQuantile:()=>hb,scaleQuantize:()=>pb,scaleRadial:()=>fb,scaleSequential:()=>fx,scaleSequentialLog:()=>hx,scaleSequentialPow:()=>dx,scaleSequentialQuantile:()=>yx,scaleSequentialSqrt:()=>mx,scaleSequentialSymlog:()=>px,scaleSqrt:()=>cb,scaleSymlog:()=>rb,scaleThreshold:()=>db,scaleTime:()=>sx,scaleUtc:()=>ux,scan:()=>Ce,schemeAccent:()=>Sx,schemeBlues:()=>Ok,schemeBrBG:()=>Dx,schemeBuGn:()=>tk,schemeBuPu:()=>nk,schemeCategory10:()=>Ox,schemeDark2:()=>Ex,schemeGnBu:()=>ik,schemeGreens:()=>Ek,schemeGreys:()=>Tk,schemeObservable10:()=>Ax,schemeOrRd:()=>ak,schemeOranges:()=>Lk,schemePRGn:()=>Bx,schemePaired:()=>Tx,schemePastel1:()=>Nx,schemePastel2:()=>Mx,schemePiYG:()=>$x,schemePuBu:()=>lk,schemePuBuGn:()=>uk,schemePuOr:()=>Ux,schemePuRd:()=>hk,schemePurples:()=>Mk,schemeRdBu:()=>zx,schemeRdGy:()=>Yx,schemeRdPu:()=>dk,schemeRdYlBu:()=>Wx,schemeRdYlGn:()=>Jx,schemeReds:()=>jk,schemeSet1:()=>Cx,schemeSet2:()=>jx,schemeSet3:()=>Px,schemeSpectral:()=>Qx,schemeTableau10:()=>Lx,schemeYlGn:()=>vk,schemeYlGnBu:()=>yk,schemeYlOrBr:()=>_k,schemeYlOrRd:()=>xk,select:()=>Lr,selectAll:()=>rO,selection:()=>Pr,selector:()=>xn,selectorAll:()=>Sn,shuffle:()=>je,shuffler:()=>Pe,some:()=>Fe,sort:()=>zt,stack:()=>_E,stackOffsetDiverging:()=>xE,stackOffsetExpand:()=>wE,stackOffsetNone:()=>yE,stackOffsetSilhouette:()=>kE,stackOffsetWiggle:()=>OE,stackOrderAppearance:()=>SE,stackOrderAscending:()=>AE,stackOrderDescending:()=>NE,stackOrderInsideOut:()=>ME,stackOrderNone:()=>gE,stackOrderReverse:()=>CE,stratify:()=>dg,style:()=>Qn,subset:()=>Je,sum:()=>Le,superset:()=>We,svg:()=>Sl,symbol:()=>AS,symbolAsterisk:()=>eS,symbolCircle:()=>nS,symbolCross:()=>rS,symbolDiamond:()=>aS,symbolDiamond2:()=>sS,symbolPlus:()=>uS,symbolSquare:()=>cS,symbolSquare2:()=>lS,symbolStar:()=>dS,symbolTimes:()=>OS,symbolTriangle:()=>yS,symbolTriangle2:()=>vS,symbolWye:()=>kS,symbolX:()=>OS,symbols:()=>SS,symbolsFill:()=>SS,symbolsStroke:()=>ES,text:()=>dl,thresholdFreedmanDiaconis:()=>ge,thresholdScott:()=>ve,thresholdSturges:()=>oe,tickFormat:()=>qv,tickIncrement:()=>ne,tickStep:()=>re,ticks:()=>ee,timeDay:()=>Db,timeDays:()=>Rb,timeFormat:()=>D_,timeFormatDefaultLocale:()=>rx,timeFormatLocale:()=>L_,timeFriday:()=>Wb,timeFridays:()=>e_,timeHour:()=>jb,timeHours:()=>Pb,timeInterval:()=>kb,timeMillisecond:()=>Ob,timeMilliseconds:()=>Sb,timeMinute:()=>Tb,timeMinutes:()=>Nb,timeMonday:()=>zb,timeMondays:()=>Xb,timeMonth:()=>v_,timeMonths:()=>b_,timeParse:()=>R_,timeSaturday:()=>Gb,timeSaturdays:()=>n_,timeSecond:()=>Eb,timeSeconds:()=>Ab,timeSunday:()=>Kb,timeSundays:()=>Jb,timeThursday:()=>Hb,timeThursdays:()=>t_,timeTickInterval:()=>M_,timeTicks:()=>N_,timeTuesday:()=>Vb,timeTuesdays:()=>Qb,timeWednesday:()=>Yb,timeWednesdays:()=>Zb,timeWeek:()=>Kb,timeWeeks:()=>Jb,timeYear:()=>x_,timeYears:()=>k_,timeout:()=>ho,timer:()=>so,timerFlush:()=>uo,transition:()=>ta,transpose:()=>Ie,tree:()=>kg,treemap:()=>Tg,treemapBinary:()=>Ng,treemapDice:()=>sg,treemapResquarify:()=>Cg,treemapSlice:()=>Og,treemapSliceDice:()=>Mg,treemapSquarify:()=>Ag,tsv:()=>vl,tsvFormat:()=>yc,tsvFormatBody:()=>gc,tsvFormatRow:()=>bc,tsvFormatRows:()=>vc,tsvFormatValue:()=>_c,tsvParse:()=>dc,tsvParseRows:()=>mc,union:()=>Xe,unixDay:()=>$b,unixDays:()=>qb,utcDay:()=>Bb,utcDays:()=>Fb,utcFormat:()=>B_,utcFriday:()=>c_,utcFridays:()=>y_,utcHour:()=>Lb,utcHours:()=>Ib,utcMillisecond:()=>Ob,utcMilliseconds:()=>Sb,utcMinute:()=>Mb,utcMinutes:()=>Cb,utcMonday:()=>o_,utcMondays:()=>h_,utcMonth:()=>__,utcMonths:()=>w_,utcParse:()=>F_,utcSaturday:()=>l_,utcSaturdays:()=>g_,utcSecond:()=>Eb,utcSeconds:()=>Ab,utcSunday:()=>i_,utcSundays:()=>f_,utcThursday:()=>u_,utcThursdays:()=>m_,utcTickInterval:()=>T_,utcTicks:()=>A_,utcTuesday:()=>a_,utcTuesdays:()=>p_,utcWednesday:()=>s_,utcWednesdays:()=>d_,utcWeek:()=>i_,utcWeeks:()=>f_,utcYear:()=>O_,utcYears:()=>S_,variance:()=>bt,window:()=>Wn,xml:()=>kl,zip:()=>Re,zoom:()=>XE,zoomIdentity:()=>qE,zoomTransform:()=>UE});var a=function(t){return Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{path:null,severity:null,startLineNumber:null,startColumn:null,endLineNumber:null,endColumn:null,message:null,initialErrorMessage:null,componentId:null,attribute:null,extraData:""};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.path,r=e.severity,i=e.startLineNumber,o=e.startColumn,a=e.endLineNumber,s=e.endColumn,u=e.message,c=e.initialErrorMessage,l=e.componentId,f=e.attribute,h=e.extraData;this.path=null!=n?n:null,this.severity=null!=r?r:t.SEVERITY_HINT,this.startLineNumber=null!=i?i:null,this.startColumn=null!=o?o:null,this.endLineNumber=null!=a?a:null,this.endColumn=null!=s?s:null,this.message=null!=u?u:null,this.initialErrorMessage=null!=c?c:null,this.componentId=null!=l?l:null,this.attribute=null!=f?f:null,this.extraData=null!=h?h:""}));n(a,"SEVERITY_HINT",1),n(a,"SEVERITY_INFO",2),n(a,"SEVERITY_WARNING",4),n(a,"SEVERITY_ERROR",8);const s=a;function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}function c(t){var e=function(t){if("object"!=u(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=u(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==u(e)?e:e+""}var l=function(){return t=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{name:null,value:null,type:null,definition:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.name,r=e.value,i=e.type,o=e.definition;this.name=n||null,this.value=null!=r?r:null,this.type=i||null,this.definition=o||null},e=[{key:"isVariable",get:function(){return!1}},{key:"getErrors",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return this.validateDefinitionType(e,r),this.validateType(e,r),this.validateRuleMinMax(e,r),this.validateRuleValues(e,r),this.validateRuleRegex(e,r),this.validateRequiredAttributes(e,r),n&&"Object"===(null===(t=this.definition)||void 0===t?void 0:t.type)&&Array.isArray(this.value)&&this.value.forEach((function(t){return t.getErrors(e,!0,r)})),e}},{key:"validateDefinitionType",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return null===this.definition?t:"Link"===this.definition.type&&"Array"!==this.type?(t.push(new s({componentId:e,severity:s.SEVERITY_ERROR,message:"parser.error.invalidLinkType",attribute:this.name})),t):"Reference"===this.definition.type&&"String"!==this.type?(t.push(new s({componentId:e,severity:s.SEVERITY_ERROR,message:"parser.error.invalidReferenceType",attribute:this.name})),t):("Reference"!==this.definition.type&&"Link"!==this.definition.type&&this.definition.type!==this.type&&t.push(new s({componentId:e,severity:s.SEVERITY_ERROR,message:"parser.error.not".concat(this.definition.type),attribute:this.name})),t)}},{key:"validateType",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return null===this.value?t:"Boolean"===this.type?("boolean"!=typeof this.value&&t.push(new s({componentId:e,severity:s.SEVERITY_ERROR,message:"parser.error.notBoolean",attribute:this.name})),t):"String"===this.type?("string"!=typeof this.value&&t.push(new s({componentId:e,severity:s.SEVERITY_ERROR,message:"parser.error.notString",attribute:this.name})),t):"Number"===this.type?("number"!=typeof this.value&&t.push(new s({componentId:e,severity:s.SEVERITY_ERROR,message:"parser.error.notNumber",attribute:this.name})),t):(Array.isArray(this.value)||t.push(new s({componentId:e,severity:s.SEVERITY_ERROR,message:"parser.error.not".concat(this.type),attribute:this.name})),t)}},{key:"validateRuleMinMax",value:function(){var t,e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("Boolean"===this.type||"Object"===this.type||null===(t=this.definition)||void 0===t||!t.rules)return n;var i="number"==typeof this.value?this.value:(null===(e=this.value)||void 0===e?void 0:e.length)||0;return null!==this.definition.rules.min&&ithis.definition.rules.max&&n.push(new s({componentId:r,severity:s.SEVERITY_ERROR,message:"parser.error.max".concat(this.definition.type),attribute:this.name,extraData:this.definition.rules.max})),n}},{key:"validateRuleValues",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!this.definition||0===this.definition.rules.values.length)return e;var r=Array.isArray(this.value);return(r&&this.value.some((function(e){return!t.definition.rules.values.includes(e)}))||!r&&!this.definition.rules.values.includes(this.value))&&e.push(new s({componentId:n,severity:s.SEVERITY_ERROR,message:"parser.error.invalidValue",attribute:this.name,extraData:this.definition.rules.values.join(", ")})),e}},{key:"validateRuleRegex",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return null!==(t=this.definition)&&void 0!==t&&t.rules.regex&&null!==this.value?(new RegExp(this.definition.rules.regex).test(this.value)||e.push(new s({componentId:n,severity:s.SEVERITY_ERROR,message:this.definition.rules.regexMessage||"parser.error.regex",attribute:this.name})),e):e}},{key:"validateRequiredAttributes",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.definition&&"Object"===this.definition.type?(this.definition.definedAttributes.forEach((function(r){var i=t.value.find((function(t){return t.name===r.name}));!r.required||i&&null!==i.value||e.push(new s({componentId:n,severity:s.SEVERITY_ERROR,message:"parser.error.required",attribute:r.name}))})),e):e}}],e&&function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{path:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.path;this.path=null!=n?n:null},(e=[{key:"fileName",get:function(){return this.path?this.path.replace(/^.*[\\/]/,""):null}}])&&function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{x:null,y:null,width:null,height:null,hide:!1};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.x,r=e.y,i=e.width,o=e.height,a=e.hide;this.x=n||null,this.y=r||null,this.width=i||null,this.height=o||null,this.hide=a||!1}));const g=y;function v(t){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},v(t)}function b(t){var e=function(t){if("object"!=v(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=v(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==v(e)?e:e+""}function _(t,e,n){return e=x(e),function(t,e){if(e&&("object"==v(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,w()?Reflect.construct(e,n||[],x(t).constructor):e.apply(t,n))}function w(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(w=function(){return!!t})()}function x(t){return x=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},x(t)}function k(t,e){return k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},k(t,e)}var O=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:null,externalId:null,name:null,definition:null,drawOption:null,attributes:[]};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t=_(this,e,[n]);var r=n.id,i=n.externalId,o=n.name,a=n.definition,s=n.drawOption,u=n.attributes;return t.__class="Component",t.id=r||null,t.externalId=i||t.id,t.name=o||null,t.definition=a||null,t.drawOption=s||new g,t.attributes=u||[],t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&k(t,e)}(e,t),n=e,r=[{key:"setExternalId",value:function(t){this.externalId=t}},{key:"getConfigurationKey",value:function(){return this.id}},{key:"setReferenceAttribute",value:function(t){var e=this.definition.definedAttributes.find((function(e){return e.containerRef===t.definition.type}));if(e){var n=this.attributes.filter((function(t){var n=t.definition;return(null==n?void 0:n.name)===e.name}));n.length>0?n.forEach((function(e){e.value=t.id})):this.attributes.push(this.createAttribute({name:e.name,value:t.id,type:"String",definition:e}))}}},{key:"__createNestedAttributes",value:function(t){var e=this,n=this.attributes;return t.slice().reverse().forEach((function(t){var r=n.find((function(e){return e.definition.name===t.name}));r||(r=e.createAttribute({name:t.name,definition:t,type:"Object",value:[]}),n.push(r)),n=r.value})),n}},{key:"createAttribute",value:function(t){return new f(t)}},{key:"removeAllReferenceAttributes",value:function(t){this.attributes=t?this.attributes.filter((function(e){return!("Reference"===e.definition.type&&e.definition.containerRef===t.definition.type&&e.value===t.id)})):this.attributes.filter((function(t){return"Reference"!==t.definition.type}))}},{key:"setLinkAttribute",value:function(t){var e=[],n=this.__getLinkAttribute(e,this.definition.definedAttributes,t),r=this.__createNestedAttributes(e),i=r.find((function(t){return t.definition.name===n.name}));i||(i=this.createAttribute({name:n.name,definition:n,type:"Array",value:[]}),r.push(i)),i.value.includes(t.target)||i.value.push(t.target)}},{key:"__getLinkAttribute",value:function(t,e,n){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:null;this.__removeLinkAttribute(this.attributes,t,e)}},{key:"__removeLinkAttribute",value:function(t,e,n){var r=this;t.forEach((function(t){var i;if("Object"===t.type&&r.__removeLinkAttribute(t.value,e,n),"Link"===(null===(i=t.definition)||void 0===i?void 0:i.type)&&(!n||t.name===n)){var o=t.value.findIndex((function(t){return t===e}));o>=0&&t.value.splice(o,1)}}))}},{key:"getAttributeByName",value:function(t){return this.__getAttributeByName(this.attributes,t)}},{key:"__getAttributeByName",value:function(t,e){for(var n=0;n3?i-3:0),a=3;a2?n-2:0),i=2;i0&&void 0!==arguments[0]?arguments[0]:[];return this.validateDefinition(e),this.validateRequiredAttributes(e),this.attributes.forEach((function(n){return n.getErrors(e,!0,t.id)})),e}},{key:"validateRequiredAttributes",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.definition?(this.definition.definedAttributes.forEach((function(n){var r=t.attributes.find((function(t){return t.name===n.name}));!n.required||r&&null!==r.value||e.push(new s({componentId:t.id,severity:s.SEVERITY_ERROR,message:"parser.error.required",attribute:n.name}))})),e):e}},{key:"validateDefinition",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return null===this.definition&&t.push(new s({componentId:this.id,severity:s.SEVERITY_WARNING,message:"parser.warning.noComponentDefinition"})),t}},{key:"getDefinedAttributesByType",value:function(t){var e=[];return this.__setDefinedAttributesByType(e,this.definition.definedAttributes,t),e}},{key:"__setDefinedAttributesByType",value:function(t,e,n){var r=this;e.forEach((function(e){"Object"===e.type&&r.__setDefinedAttributesByType(t,e.definedAttributes,n),e.type===n&&t.push(e)}))}},{key:"canContain",value:function(t){return this.definition.isContainer&&this.definition.childrenTypes.includes(t)}}],r&&function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{type:null,icon:null,model:null,displayName:null,description:null,categories:[],tags:[],url:null,parentTypes:[],childrenTypes:[],definedAttributes:[],isContainer:!1,displayType:null,workflowDirection:null,linkModel:null,defaultWidth:0,defaultHeight:0,minWidth:0,minHeight:0,reservedWidth:0,reservedHeight:0,margin:10,gap:30};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.type,r=e.icon,i=e.model,o=e.displayName,a=e.description,s=e.categories,u=e.tags,c=e.url,l=e.parentTypes,f=e.childrenTypes,h=e.definedAttributes,p=e.isContainer,d=e.displayType,m=e.workflowDirection,y=e.linkModel,g=e.defaultWidth,v=e.defaultHeight,b=e.minWidth,_=e.minHeight,w=e.reservedWidth,x=e.reservedHeight,k=e.margin,O=e.gap;this.type=n||null,this.icon=r||null,this.model=i||null,this.displayName=o||null,this.description=a||null,this.categories=s||[],this.tags=u||[],this.url=c||null,this.parentTypes=l||[],this.childrenTypes=f||[],this.definedAttributes=h||[],this.isContainer=void 0!==p&&p,this.displayType=d||null,this.workflowDirection=m||"horizontal",this.linkModel=y||null,this.defaultWidth=g||0,this.defaultHeight=v||0,this.minWidth=b||0,this.minHeight=_||0,this.reservedWidth=w||0,this.reservedHeight=x||0,this.margin=k||10,this.gap=O||30}));const A=E;function T(t){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},T(t)}function N(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function M(t,e,n){return(e=C(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function C(t){var e=function(t){if("object"!=T(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=T(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==T(e)?e:e+""}var j=function(t){return Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{name:null,type:null,displayName:null,description:null,tags:[],url:null,linkType:null,linkRef:[],linkModel:null,containerRef:null,required:!1,definedAttributes:[],rules:{values:[],min:null,max:null,regex:null,regexMessage:null}};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.name,r=e.type,i=e.displayName,o=e.description,a=e.tags,s=e.url,u=e.linkType,c=e.linkRef,l=e.linkModel,f=e.containerRef,h=e.definedAttributes,p=e.required,d=e.rules;this.name=n||null,this.type=r||null,this.displayName=i||null,this.description=o||null,this.tags=a||[],this.url=s||null,this.linkType=u||null,this.linkRef=c||[],this.linkModel=l||null,this.containerRef=f||null,this.definedAttributes=h||[],this.required=p||!1,this.rules=function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{source:null,target:null,name:null,definition:null,isReverse:!1};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t=I(this,e);var r=n.source,i=n.target,o=n.name,a=n.definition,s=n.isReverse;return t.__class="Link",t.source=r||null,t.target=i||null,t.name=o||null,t.definition=a||null,t.isReverse=!!s,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&B(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(m);const $=F;var q=function(t){return Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{attributeRef:null,sourceRef:null,targetRef:null,type:null,model:null,isTemporary:!1};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.attributeRef,r=e.sourceRef,i=e.targetRef,o=e.type,a=e.model,s=e.isTemporary;this.attributeRef=n||null,this.sourceRef=r||null,this.targetRef=i||null,this.type=o||null,this.model=a||null,this.isTemporary=!!s}));const U=q;function K(t){return K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},K(t)}function z(t,e,n){return e=Y(e),function(t,e){if(e&&("object"==K(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,V()?Reflect.construct(e,n||[],Y(t).constructor):e.apply(t,n))}function V(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(V=function(){return!!t})()}function Y(t){return Y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Y(t)}function H(t,e){return H=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},H(t,e)}var W=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{path:null,name:null,content:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t=z(this,e,[n]);var r=n.content;return t.content=r||null,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&H(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(m);const G=W;function J(t,e){return null==t||null==e?NaN:te?1:t>=e?0:NaN}function X(t,e){return null==t||null==e?NaN:et?1:e>=t?0:NaN}function Q(t){let e,n,r;function i(t,r,i=0,o=t.length){if(i>>1;n(t[e],r)<0?i=e+1:o=e}while(iJ(t(e),n),r=(e,n)=>t(e)-n):(e=t===J||t===X?t:Z,n=t,r=t),{left:i,center:function(t,e,n=0,o=t.length){const a=i(t,e,n,o-1);return a>n&&r(t[a-1],e)>-r(t[a],e)?a-1:a},right:function(t,r,i=0,o=t.length){if(i>>1;n(t[e],r)<=0?i=e+1:o=e}while(i=0))throw new RangeError("invalid r");let n=t.length;if(!((n=Math.floor(n))>=0))throw new RangeError("invalid length");if(!n||!e)return t;const r=ht(e),i=t.slice();return r(t,i,0,n,1),r(i,t,0,n,1),r(t,i,0,n,1),t}const st=ct(ht),ut=ct((function(t){const e=ht(t);return(t,n,r,i,o)=>{e(t,n,0+(r<<=2),0+(i<<=2),o<<=2),e(t,n,r+1,i+1,o),e(t,n,r+2,i+2,o),e(t,n,r+3,i+3,o)}}));function ct(t){return function(e,n,r=n){if(!((n=+n)>=0))throw new RangeError("invalid rx");if(!((r=+r)>=0))throw new RangeError("invalid ry");let{data:i,width:o,height:a}=e;if(!((o=Math.floor(o))>=0))throw new RangeError("invalid width");if(!((a=Math.floor(void 0!==a?a:i.length/o))>=0))throw new RangeError("invalid height");if(!o||!a||!n&&!r)return e;const s=n&&t(n),u=r&&t(r),c=i.slice();return s&&u?(lt(s,c,i,o,a),lt(s,i,c,o,a),lt(s,c,i,o,a),ft(u,i,c,o,a),ft(u,c,i,o,a),ft(u,i,c,o,a)):s?(lt(s,i,c,o,a),lt(s,c,i,o,a),lt(s,i,c,o,a)):u&&(ft(u,i,c,o,a),ft(u,c,i,o,a),ft(u,i,c,o,a)),e}}function lt(t,e,n,r,i){for(let o=0,a=r*i;o{if(!((o-=a)>=i))return;let s=t*r[i];const u=a*t;for(let t=i,e=i+u;t{if(!((a-=s)>=o))return;let u=e*i[o];const c=s*e,l=c+s;for(let t=o,e=o+c;t=e&&++n;else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(i=+i)>=i&&++n}return n}function dt(t){return 0|t.length}function mt(t){return!(t>0)}function yt(t){return"object"!=typeof t||"length"in t?t:Array.from(t)}function gt(...t){const e="function"==typeof t[t.length-1]&&function(t){return e=>t(...e)}(t.pop()),n=(t=t.map(yt)).map(dt),r=t.length-1,i=new Array(r+1).fill(0),o=[];if(r<0||n.some(mt))return o;for(;;){o.push(i.map(((e,n)=>t[n][e])));let a=r;for(;++i[a]===n[a];){if(0===a)return e?o.map(e):o;i[a--]=0}}}function vt(t,e){var n=0,r=0;return Float64Array.from(t,void 0===e?t=>n+=+t||0:i=>n+=+e(i,r++,t)||0)}function bt(t,e){let n,r=0,i=0,o=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(n=e-i,i+=n/++r,o+=n*(e-i));else{let a=-1;for(let s of t)null!=(s=e(s,++a,t))&&(s=+s)>=s&&(n=s-i,i+=n/++r,o+=n*(s-i))}if(r>1)return o/(r-1)}function _t(t,e){const n=bt(t,e);return n?Math.sqrt(n):n}function wt(t,e){let n,r;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=r=e):(n>e&&(n=e),r=o&&(n=r=o):(n>o&&(n=o),r0){for(o=t[--i];i>0&&(e=o,n=t[--i],o=e+n,r=n-(o-e),!r););i>0&&(r<0&&t[i-1]<0||r>0&&t[i-1]>0)&&(n=2*r,e=o+n,n==e-o&&(o=e))}return o}}function kt(t,e){const n=new xt;if(void 0===e)for(let e of t)(e=+e)&&n.add(e);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&n.add(i)}return+n}function Ot(t,e){const n=new xt;let r=-1;return Float64Array.from(t,void 0===e?t=>n.add(+t||0):i=>n.add(+e(i,++r,t)||0))}class St extends Map{constructor(t,e=Mt){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(At(this,t))}has(t){return super.has(At(this,t))}set(t,e){return super.set(Tt(this,t),e)}delete(t){return super.delete(Nt(this,t))}}class Et extends Set{constructor(t,e=Mt){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const e of t)this.add(e)}has(t){return super.has(At(this,t))}add(t){return super.add(Tt(this,t))}delete(t){return super.delete(Nt(this,t))}}function At({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Tt({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function Nt({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function Mt(t){return null!==t&&"object"==typeof t?t.valueOf():t}function Ct(t){return t}function jt(t,...e){return Ut(t,Ct,Ct,e)}function Pt(t,...e){return Ut(t,Array.from,Ct,e)}function Lt(t,e){for(let n=1,r=e.length;nt.pop().map((([e,n])=>[...t,e,n]))));return t}function It(t,...e){return Lt(Pt(t,...e),e)}function Dt(t,e,...n){return Lt(Bt(t,e,...n),n)}function Rt(t,e,...n){return Ut(t,Ct,e,n)}function Bt(t,e,...n){return Ut(t,Array.from,e,n)}function Ft(t,...e){return Ut(t,Ct,qt,e)}function $t(t,...e){return Ut(t,Array.from,qt,e)}function qt(t){if(1!==t.length)throw new Error("duplicate key");return t[0]}function Ut(t,e,n,r){return function t(i,o){if(o>=r.length)return n(i);const a=new St,s=r[o++];let u=-1;for(const t of i){const e=s(t,++u,i),n=a.get(e);n?n.push(t):a.set(e,[t])}for(const[e,n]of a)a.set(e,t(n,o));return e(a)}(t,0)}function Kt(t,e){return Array.from(e,(e=>t[e]))}function zt(t,...e){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");t=Array.from(t);let[n]=e;if(n&&2!==n.length||e.length>1){const r=Uint32Array.from(t,((t,e)=>e));return e.length>1?(e=e.map((e=>t.map(e))),r.sort(((t,n)=>{for(const r of e){const e=Yt(r[t],r[n]);if(e)return e}}))):(n=t.map(n),r.sort(((t,e)=>Yt(n[t],n[e])))),Kt(t,r)}return t.sort(Vt(n))}function Vt(t=J){if(t===J)return Yt;if("function"!=typeof t)throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||0===r?r:(0===t(n,n))-(0===t(e,e))}}function Yt(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(te?1:0)}function Ht(t,e,n){return(2!==e.length?zt(Rt(t,e,n),(([t,e],[n,r])=>J(e,r)||J(t,n))):zt(jt(t,n),(([t,n],[r,i])=>e(n,i)||J(t,r)))).map((([t])=>t))}var Wt=Array.prototype,Gt=Wt.slice;function Jt(t){return()=>t}Wt.map;const Xt=Math.sqrt(50),Qt=Math.sqrt(10),Zt=Math.sqrt(2);function te(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=Xt?10:o>=Qt?5:o>=Zt?2:1;let s,u,c;return i<0?(c=Math.pow(10,-i)/a,s=Math.round(t*c),u=Math.round(e*c),s/ce&&--u,c=-c):(c=Math.pow(10,i)*a,s=Math.round(t/c),u=Math.round(e/c),s*ce&&--u),u0))return[];if((t=+t)==(e=+e))return[t];const r=e=i))return[];const s=o-i+1,u=new Array(s);if(r)if(a<0)for(let t=0;t0?(t=Math.floor(t/i)*i,e=Math.ceil(e/i)*i):i<0&&(t=Math.ceil(t*i)/i,e=Math.floor(e*i)/i),r=i}}function oe(t){return Math.max(1,Math.ceil(Math.log(pt(t))/Math.LN2)+1)}function ae(){var t=Ct,e=wt,n=oe;function r(r){Array.isArray(r)||(r=Array.from(r));var i,o,a,s=r.length,u=new Array(s);for(i=0;i=f)if(t>=f&&e===wt){const t=ne(l,f,n);isFinite(t)&&(t>0?f=(Math.floor(f/t)+1)*t:t<0&&(f=(Math.ceil(f*-t)+1)/-t))}else h.pop()}for(var p=h.length,d=0,m=p;h[d]<=l;)++d;for(;h[m-1]>f;)--m;(d||m0?h[i-1]:l,y.x1=i0)for(i=0;i=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n=i)&&(n=i)}return n}function ue(t,e){let n,r=-1,i=-1;if(void 0===e)for(const e of t)++i,null!=e&&(n=e)&&(n=e,r=i);else for(let o of t)null!=(o=e(o,++i,t))&&(n=o)&&(n=o,r=i);return r}function ce(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function le(t,e){let n,r=-1,i=-1;if(void 0===e)for(const e of t)++i,null!=e&&(n>e||void 0===n&&e>=e)&&(n=e,r=i);else for(let o of t)null!=(o=e(o,++i,t))&&(n>o||void 0===n&&o>=o)&&(n=o,r=i);return r}function fe(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=void 0===i?Yt:Vt(i);r>n;){if(r-n>600){const o=r-n+1,a=e-n+1,s=Math.log(o),u=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*u*(o-u)/o)*(a-o/2<0?-1:1);fe(t,e,Math.max(n,Math.floor(e-a*u/o+c)),Math.min(r,Math.floor(e+(o-a)*u/o+c)),i)}const o=t[e];let a=n,s=r;for(he(t,n,e),i(t[r],o)>0&&he(t,n,r);a0;)--s}0===i(t[n],o)?he(t,n,s):(++s,he(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function he(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function pe(t,e=J){let n,r=!1;if(1===e.length){let i;for(const o of t){const t=e(o);(r?J(t,i)>0:0===J(t,t))&&(n=o,i=t,r=!0)}}else for(const i of t)(r?e(i,n)>0:0===e(i,i))&&(n=i,r=!0);return n}function de(t,e,n){if(t=Float64Array.from(function*(t,e){if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let r of t)null!=(r=e(r,++n,t))&&(r=+r)>=r&&(yield r)}}(t,n)),(r=t.length)&&!isNaN(e=+e)){if(e<=0||r<2)return ce(t);if(e>=1)return se(t);var r,i=(r-1)*e,o=Math.floor(i),a=se(fe(t,o).subarray(0,o+1));return a+(ce(t.subarray(o+1))-a)*(i-o)}}function me(t,e,n=tt){if((r=t.length)&&!isNaN(e=+e)){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t);return a+(+n(t[o+1],o+1,t)-a)*(i-o)}}function ye(t,e,n=tt){if(!isNaN(e=+e)){if(r=Float64Array.from(t,((e,r)=>tt(n(t[r],r,t)))),e<=0)return le(r);if(e>=1)return ue(r);var r,i=Uint32Array.from(t,((t,e)=>e)),o=r.length-1,a=Math.floor(o*e);return fe(i,a,0,o,((t,e)=>Yt(r[t],r[e]))),(a=pe(i.subarray(0,a+1),(t=>r[t])))>=0?a:-1}}function ge(t,e,n){const r=pt(t),i=de(t,.75)-de(t,.25);return r&&i?Math.ceil((n-e)/(2*i*Math.pow(r,-1/3))):1}function ve(t,e,n){const r=pt(t),i=_t(t);return r&&i?Math.ceil((n-e)*Math.cbrt(r)/(3.49*i)):1}function be(t,e){let n=0,r=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(++n,r+=e);else{let i=-1;for(let o of t)null!=(o=e(o,++i,t))&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function _e(t,e){return de(t,.5,e)}function we(t,e){return ye(t,.5,e)}function xe(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function ke(t,e){const n=new St;if(void 0===e)for(let e of t)null!=e&&e>=e&&n.set(e,(n.get(e)||0)+1);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&i>=i&&n.set(i,(n.get(i)||0)+1)}let r,i=0;for(const[t,e]of n)e>i&&(i=e,r=t);return r}function Oe(t,e=Se){const n=[];let r,i=!1;for(const o of t)i&&n.push(e(r,o)),r=o,i=!0;return n}function Se(t,e){return[t,e]}function Ee(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(i);++re(n[t],n[r]);let o,a;return t=Uint32Array.from(n,((t,e)=>e)),t.sort(e===J?(t,e)=>Yt(n[t],n[e]):Vt(i)),t.forEach(((t,e)=>{const n=i(t,void 0===o?t:o);n>=0?((void 0===o||n>0)&&(o=t,a=e),r[t]=a):r[t]=NaN})),r}function Te(t,e=J){let n,r=!1;if(1===e.length){let i;for(const o of t){const t=e(o);(r?J(t,i)<0:0===J(t,t))&&(n=o,i=t,r=!0)}}else for(const i of t)(r?e(i,n)<0:0===e(i,i))&&(n=i,r=!0);return n}function Ne(t,e=J){if(1===e.length)return le(t,e);let n,r=-1,i=-1;for(const o of t)++i,(r<0?0===e(o,o):e(o,n)<0)&&(n=o,r=i);return r}function Me(t,e=J){if(1===e.length)return ue(t,e);let n,r=-1,i=-1;for(const o of t)++i,(r<0?0===e(o,o):e(o,n)>0)&&(n=o,r=i);return r}function Ce(t,e){const n=Ne(t,e);return n<0?void 0:n}const je=Pe(Math.random);function Pe(t){return function(e,n=0,r=e.length){let i=r-(n=+n);for(;i;){const r=t()*i--|0,o=e[i+n];e[i+n]=e[r+n],e[r+n]=o}return e}}function Le(t,e){let n=0;if(void 0===e)for(let e of t)(e=+e)&&(n+=e);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}function Ie(t){if(!(i=t.length))return[];for(var e=-1,n=ce(t,De),r=new Array(n);++ee(n,r,t)))}function Ue(t,e,n){if("function"!=typeof e)throw new TypeError("reducer is not a function");const r=t[Symbol.iterator]();let i,o,a=-1;if(arguments.length<3){if(({done:i,value:n}=r.next()),i)return;++a}for(;({done:i,value:o}=r.next()),!i;)n=e(n,o,++a,t);return n}function Ke(t){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");return Array.from(t).reverse()}function ze(t,...e){t=new Et(t);for(const n of e)for(const e of n)t.delete(e);return t}function Ve(t,e){const n=e[Symbol.iterator](),r=new Et;for(const e of t){if(r.has(e))return!1;let t,i;for(;({value:t,done:i}=n.next())&&!i;){if(Object.is(e,t))return!1;r.add(t)}}return!0}function Ye(t,...e){t=new Et(t),e=e.map(He);t:for(const n of t)for(const r of e)if(!r.has(n)){t.delete(n);continue t}return t}function He(t){return t instanceof Et?t:new Et(t)}function We(t,e){const n=t[Symbol.iterator](),r=new Set;for(const t of e){const e=Ge(t);if(r.has(e))continue;let i,o;for(;({value:i,done:o}=n.next());){if(o)return!1;const t=Ge(i);if(r.add(t),Object.is(e,t))break}}return!0}function Ge(t){return null!==t&&"object"==typeof t?t.valueOf():t}function Je(t,e){return We(e,t)}function Xe(...t){const e=new Et;for(const n of t)for(const t of n)e.add(t);return e}function Qe(t){return t}var Ze=1,tn=2,en=3,nn=4,rn=1e-6;function on(t){return"translate("+t+",0)"}function an(t){return"translate(0,"+t+")"}function sn(t){return e=>+t(e)}function un(t,e){return e=Math.max(0,t.bandwidth()-2*e)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function cn(){return!this.__axis}function ln(t,e){var n=[],r=null,i=null,o=6,a=6,s=3,u="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,c=t===Ze||t===nn?-1:1,l=t===nn||t===tn?"x":"y",f=t===Ze||t===en?on:an;function h(h){var p=null==r?e.ticks?e.ticks.apply(e,n):e.domain():r,d=null==i?e.tickFormat?e.tickFormat.apply(e,n):Qe:i,m=Math.max(o,0)+s,y=e.range(),g=+y[0]+u,v=+y[y.length-1]+u,b=(e.bandwidth?un:sn)(e.copy(),u),_=h.selection?h.selection():h,w=_.selectAll(".domain").data([null]),x=_.selectAll(".tick").data(p,e).order(),k=x.exit(),O=x.enter().append("g").attr("class","tick"),S=x.select("line"),E=x.select("text");w=w.merge(w.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),x=x.merge(O),S=S.merge(O.append("line").attr("stroke","currentColor").attr(l+"2",c*o)),E=E.merge(O.append("text").attr("fill","currentColor").attr(l,c*m).attr("dy",t===Ze?"0em":t===en?"0.71em":"0.32em")),h!==_&&(w=w.transition(h),x=x.transition(h),S=S.transition(h),E=E.transition(h),k=k.transition(h).attr("opacity",rn).attr("transform",(function(t){return isFinite(t=b(t))?f(t+u):this.getAttribute("transform")})),O.attr("opacity",rn).attr("transform",(function(t){var e=this.parentNode.__axis;return f((e&&isFinite(e=e(t))?e:b(t))+u)}))),k.remove(),w.attr("d",t===nn||t===tn?a?"M"+c*a+","+g+"H"+u+"V"+v+"H"+c*a:"M"+u+","+g+"V"+v:a?"M"+g+","+c*a+"V"+u+"H"+v+"V"+c*a:"M"+g+","+u+"H"+v),x.attr("opacity",1).attr("transform",(function(t){return f(b(t)+u)})),S.attr(l+"2",c*o),E.attr(l,c*m).text(d),_.filter(cn).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===tn?"start":t===nn?"end":"middle"),_.each((function(){this.__axis=b}))}return h.scale=function(t){return arguments.length?(e=t,h):e},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(t){return arguments.length?(n=null==t?[]:Array.from(t),h):n.slice()},h.tickValues=function(t){return arguments.length?(r=null==t?null:Array.from(t),h):r&&r.slice()},h.tickFormat=function(t){return arguments.length?(i=t,h):i},h.tickSize=function(t){return arguments.length?(o=a=+t,h):o},h.tickSizeInner=function(t){return arguments.length?(o=+t,h):o},h.tickSizeOuter=function(t){return arguments.length?(a=+t,h):a},h.tickPadding=function(t){return arguments.length?(s=+t,h):s},h.offset=function(t){return arguments.length?(u=+t,h):u},h}function fn(t){return ln(Ze,t)}function hn(t){return ln(tn,t)}function pn(t){return ln(en,t)}function dn(t){return ln(nn,t)}var mn={value:()=>{}};function yn(){for(var t,e=0,n=arguments.length,r={};e=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),a=-1,s=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a0)for(var n,r,i=new Array(n),o=0;oe?1:t>=e?0:NaN}Pn.prototype={constructor:Pn,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var Fn="http://www.w3.org/1999/xhtml";const $n={svg:"http://www.w3.org/2000/svg",xhtml:Fn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function qn(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),$n.hasOwnProperty(e)?{space:$n[e],local:t}:t}function Un(t){return function(){this.removeAttribute(t)}}function Kn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function zn(t,e){return function(){this.setAttribute(t,e)}}function Vn(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Yn(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function Hn(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function Wn(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Gn(t){return function(){this.style.removeProperty(t)}}function Jn(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Xn(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Qn(t,e){return t.style.getPropertyValue(e)||Wn(t).getComputedStyle(t,null).getPropertyValue(e)}function Zn(t){return function(){delete this[t]}}function tr(t,e){return function(){this[t]=e}}function er(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function nr(t){return t.trim().split(/^|\s+/)}function rr(t){return t.classList||new ir(t)}function ir(t){this._node=t,this._names=nr(t.getAttribute("class")||"")}function or(t,e){for(var n=rr(t),r=-1,i=e.length;++r=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var Mr=[null];function Cr(t,e){this._groups=t,this._parents=e}function jr(){return new Cr([[document.documentElement]],Mr)}Cr.prototype=jr.prototype={constructor:Cr,select:function(t){"function"!=typeof t&&(t=xn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i=w&&(w=_+1);!(b=g[w])&&++w=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=Bn);for(var n=this._groups,r=n.length,i=new Array(r),o=0;o1?this.each((null==e?Gn:"function"==typeof e?Xn:Jn)(t,e,null==n?"":n)):Qn(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?Zn:"function"==typeof e?er:tr)(t,e)):this.node()[t]},classed:function(t,e){var n=nr(t+"");if(arguments.length<2){for(var r=rr(this.node()),i=-1,o=n.length;++i=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}(t+""),a=o.length;if(!(arguments.length<2)){for(s=e?Er:Sr,r=0;r>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?si(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?si(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Jr.exec(t))?new li(e[1],e[2],e[3],1):(e=Xr.exec(t))?new li(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Qr.exec(t))?si(e[1],e[2],e[3],e[4]):(e=Zr.exec(t))?si(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=ti.exec(t))?yi(e[1],e[2]/100,e[3]/100,1):(e=ei.exec(t))?yi(e[1],e[2]/100,e[3]/100,e[4]):ni.hasOwnProperty(t)?ai(ni[t]):"transparent"===t?new li(NaN,NaN,NaN,0):null}function ai(t){return new li(t>>16&255,t>>8&255,255&t,1)}function si(t,e,n,r){return r<=0&&(t=e=n=NaN),new li(t,e,n,r)}function ui(t){return t instanceof Kr||(t=oi(t)),t?new li((t=t.rgb()).r,t.g,t.b,t.opacity):new li}function ci(t,e,n,r){return 1===arguments.length?ui(t):new li(t,e,n,null==r?1:r)}function li(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function fi(){return`#${mi(this.r)}${mi(this.g)}${mi(this.b)}`}function hi(){const t=pi(this.opacity);return`${1===t?"rgb(":"rgba("}${di(this.r)}, ${di(this.g)}, ${di(this.b)}${1===t?")":`, ${t})`}`}function pi(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function di(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function mi(t){return((t=di(t))<16?"0":"")+t.toString(16)}function yi(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new bi(t,e,n,r)}function gi(t){if(t instanceof bi)return new bi(t.h,t.s,t.l,t.opacity);if(t instanceof Kr||(t=oi(t)),!t)return new bi;if(t instanceof bi)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n0&&u<1?0:a,new bi(a,s,u,t.opacity)}function vi(t,e,n,r){return 1===arguments.length?gi(t):new bi(t,e,n,null==r?1:r)}function bi(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function _i(t){return(t=(t||0)%360)<0?t+360:t}function wi(t){return Math.max(0,Math.min(1,t||0))}function xi(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function ki(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}function Oi(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=r=240?t-240:t+120,i,r),xi(t,i,r),xi(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new bi(_i(this.h),wi(this.s),wi(this.l),pi(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=pi(this.opacity);return`${1===t?"hsl(":"hsla("}${_i(this.h)}, ${100*wi(this.s)}%, ${100*wi(this.l)}%${1===t?")":`, ${t})`}`}}));const Ei=t=>()=>t;function Ai(t,e){return function(n){return t+n*e}}function Ti(t,e){var n=e-t;return n?Ai(t,n>180||n<-180?n-360*Math.round(n/360):n):Ei(isNaN(t)?e:t)}function Ni(t,e){var n=e-t;return n?Ai(t,n):Ei(isNaN(t)?e:t)}const Mi=function t(e){var n=function(t){return 1==(t=+t)?Ni:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):Ei(isNaN(e)?n:e)}}(e);function r(t,e){var r=n((t=ci(t)).r,(e=ci(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=Ni(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function Ci(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;no&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:Fi(n,r)})),o=Ui.lastIndex;return o=0&&e._call.call(void 0,t),e=e._next;--Gi}function co(){to=(Zi=no.now())+eo,Gi=Ji=0;try{uo()}finally{Gi=0,function(){for(var t,e,n=Hi,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Hi=e);Wi=t,fo(r)}(),to=0}}function lo(){var t=no.now(),e=t-Zi;e>Qi&&(eo-=e,Zi=t)}function fo(t){Gi||(Ji&&(Ji=clearTimeout(Ji)),t-to>24?(t<1/0&&(Ji=setTimeout(co,t-no.now()-eo)),Xi&&(Xi=clearInterval(Xi))):(Xi||(Zi=no.now(),Xi=setInterval(lo,Qi)),Gi=1,ro(co)))}function ho(t,e,n){var r=new ao;return e=null==e?0:+e,r.restart((n=>{r.stop(),t(n+e)}),e,n),r}ao.prototype=so.prototype={constructor:ao,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?io():+n)+(null==e?0:+e),this._next||Wi===this||(Wi?Wi._next=this:Hi=this,Wi=this),this._call=t,this._time=n,fo()},stop:function(){this._call&&(this._call=null,this._time=1/0,fo())}};var po=_n("start","end","cancel","interrupt"),mo=[],yo=0,go=1,vo=2,bo=3,_o=5,wo=6;function xo(t,e,n,r,i,o){var a=t.__transition;if(a){if(n in a)return}else t.__transition={};!function(t,e,n){var r,i=t.__transition;function o(u){var c,l,f,h;if(n.state!==go)return s();for(c in i)if((h=i[c]).name===n.name){if(h.state===bo)return ho(o);4===h.state?(h.state=wo,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[c]):+cyo)throw new Error("too late; already scheduled");return n}function Oo(t,e){var n=So(t,e);if(n.state>bo)throw new Error("too late; already running");return n}function So(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Eo(t,e){var n,r,i,o=t.__transition,a=!0;if(o){for(i in e=null==e?null:e+"",o)(n=o[i]).name===e?(r=n.state>vo&&n.state<_o,n.state=wo,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete o[i]):a=!1;a&&delete t.__transition}}var Ao,To=180/Math.PI,No={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Mo(t,e,n,r,i,o){var a,s,u;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(u=t*n+e*r)&&(n-=t*u,r-=e*u),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,u/=s),t*r180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:Fi(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(o.rotate,a.rotate,s,u),function(t,e,n,o){t!==e?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:Fi(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(o.skewX,a.skewX,s,u),function(t,e,n,r,o,a){if(t!==n||e!==r){var s=o.push(i(o)+"scale(",null,",",null,")");a.push({i:s-4,x:Fi(t,n)},{i:s-2,x:Fi(e,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,s,u),o=a=null,function(t){for(var e,n=-1,r=u.length;++n=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?ko:Oo;return function(){var a=o(this,t),s=a.on;s!==r&&(i=(r=s).copy()).on(e,n),a.on=i}}(n,t,e))},attr:function(t,e){var n=qn(t),r="transform"===n?Po:Ro;return this.attrTween(t,"function"==typeof e?(n.local?Ko:Uo)(n,r,Do(this,"attr."+t,e)):null==e?(n.local?Fo:Bo)(n):(n.local?qo:$o)(n,r,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var r=qn(t);return this.tween(n,(r.local?zo:Vo)(r,e))},style:function(t,e,n){var r="transform"==(t+="")?jo:Ro;return null==e?this.styleTween(t,function(t,e){var n,r,i;return function(){var o=Qn(this,t),a=(this.style.removeProperty(t),Qn(this,t));return o===a?null:o===n&&a===r?i:i=e(n=o,r=a)}}(t,r)).on("end.style."+t,Xo(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,i,o;return function(){var a=Qn(this,t),s=n(this),u=s+"";return null==s&&(this.style.removeProperty(t),u=s=Qn(this,t)),a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s))}}(t,r,Do(this,"style."+t,e))).each(function(t,e){var n,r,i,o,a="style."+e,s="end."+a;return function(){var u=Oo(this,t),c=u.on,l=null==u.value[a]?o||(o=Xo(e)):void 0;c===n&&i===l||(r=(n=c).copy()).on(s,i=l),u.on=r}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,i,o=n+"";return function(){var a=Qn(this,t);return a===o?null:a===r?i:i=e(r=a,n)}}(t,r,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;return this.tween(r,function(t,e,n){var r,i;function o(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&function(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}(t,o,n)),r}return o._value=e,o}(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(Do(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&function(t){return function(e){this.textContent=t.call(this,e)}}(r)),e}return r._value=t,r}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r,i=So(this.node(),n).tween,o=0,a=i.length;ogo&&n.name===e)return new Zo([[t]],ua,e,+r);return null}const la=t=>()=>t;function fa(t,{sourceEvent:e,target:n,selection:r,mode:i,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:o}})}function ha(t){t.preventDefault(),t.stopImmediatePropagation()}var pa={name:"drag"},da={name:"space"},ma={name:"handle"},ya={name:"center"};const{abs:ga,max:va,min:ba}=Math;function _a(t){return[+t[0],+t[1]]}function wa(t){return[_a(t[0]),_a(t[1])]}var xa={name:"x",handles:["w","e"].map(Ma),input:function(t,e){return null==t?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},ka={name:"y",handles:["n","s"].map(Ma),input:function(t,e){return null==t?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},Oa={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(Ma),input:function(t){return null==t?null:wa(t)},output:function(t){return t}},Sa={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Ea={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Aa={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},Ta={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},Na={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Ma(t){return{type:t}}function Ca(t){return!t.ctrlKey&&!t.button}function ja(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function Pa(){return navigator.maxTouchPoints||"ontouchstart"in this}function La(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function Ia(t){var e=t.__brush;return e?e.dim.output(e.selection):null}function Da(){return Fa(xa)}function Ra(){return Fa(ka)}function Ba(){return Fa(Oa)}function Fa(t){var e,n=ja,r=Ca,i=Pa,o=!0,a=_n("start","brush","end"),s=6;function u(e){var n=e.property("__brush",m).selectAll(".overlay").data([Ma("overlay")]);n.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Sa.overlay).merge(n).each((function(){var t=La(this).extent;Lr(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])})),e.selectAll(".selection").data([Ma("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Sa.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var r=e.selectAll(".handle").data(t.handles,(function(t){return t.type}));r.exit().remove(),r.enter().append("rect").attr("class",(function(t){return"handle handle--"+t.type})).attr("cursor",(function(t){return Sa[t.type]})),e.each(c).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(i).on("touchstart.brush",h).on("touchmove.brush",p).on("touchend.brush touchcancel.brush",d).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function c(){var t=Lr(this),e=La(this).selection;e?(t.selectAll(".selection").style("display",null).attr("x",e[0][0]).attr("y",e[0][1]).attr("width",e[1][0]-e[0][0]).attr("height",e[1][1]-e[0][1]),t.selectAll(".handle").style("display",null).attr("x",(function(t){return"e"===t.type[t.type.length-1]?e[1][0]-s/2:e[0][0]-s/2})).attr("y",(function(t){return"s"===t.type[0]?e[1][1]-s/2:e[0][1]-s/2})).attr("width",(function(t){return"n"===t.type||"s"===t.type?e[1][0]-e[0][0]+s:s})).attr("height",(function(t){return"e"===t.type||"w"===t.type?e[1][1]-e[0][1]+s:s}))):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function l(t,e,n){var r=t.__brush.emitter;return!r||n&&r.clean?new f(t,e,n):r}function f(t,e,n){this.that=t,this.args=e,this.state=t.__brush,this.active=0,this.clean=n}function h(n){if((!e||n.touches)&&r.apply(this,arguments)){var i,a,s,u,f,h,p,d,m,y,g,v=this,b=n.target.__data__.type,_="selection"===(o&&n.metaKey?b="overlay":b)?pa:o&&n.altKey?ya:ma,w=t===ka?null:Ta[b],x=t===xa?null:Na[b],k=La(v),O=k.extent,S=k.selection,E=O[0][0],A=O[0][1],T=O[1][0],N=O[1][1],M=0,C=0,j=w&&x&&o&&n.shiftKey,P=Array.from(n.touches||[n],(t=>{const e=t.identifier;return(t=Yi(t,v)).point0=t.slice(),t.identifier=e,t}));Eo(v);var L=l(v,arguments,!0).beforestart();if("overlay"===b){S&&(m=!0);const e=[P[0],P[1]||P[0]];k.selection=S=[[i=t===ka?E:ba(e[0][0],e[1][0]),s=t===xa?A:ba(e[0][1],e[1][1])],[f=t===ka?T:va(e[0][0],e[1][0]),p=t===xa?N:va(e[0][1],e[1][1])]],P.length>1&&F(n)}else i=S[0][0],s=S[0][1],f=S[1][0],p=S[1][1];a=i,u=s,h=f,d=p;var I=Lr(v).attr("pointer-events","none"),D=I.selectAll(".overlay").attr("cursor",Sa[b]);if(n.touches)L.moved=B,L.ended=$;else{var R=Lr(n.view).on("mousemove.brush",B,!0).on("mouseup.brush",$,!0);o&&R.on("keydown.brush",(function(t){switch(t.keyCode){case 16:j=w&&x;break;case 18:_===ma&&(w&&(f=h-M*w,i=a+M*w),x&&(p=d-C*x,s=u+C*x),_=ya,F(t));break;case 32:_!==ma&&_!==ya||(w<0?f=h-M:w>0&&(i=a-M),x<0?p=d-C:x>0&&(s=u-C),_=da,D.attr("cursor",Sa.selection),F(t));break;default:return}ha(t)}),!0).on("keyup.brush",(function(t){switch(t.keyCode){case 16:j&&(y=g=j=!1,F(t));break;case 18:_===ya&&(w<0?f=h:w>0&&(i=a),x<0?p=d:x>0&&(s=u),_=ma,F(t));break;case 32:_===da&&(t.altKey?(w&&(f=h-M*w,i=a+M*w),x&&(p=d-C*x,s=u+C*x),_=ya):(w<0?f=h:w>0&&(i=a),x<0?p=d:x>0&&(s=u),_=ma),D.attr("cursor",Sa[b]),F(t));break;default:return}ha(t)}),!0),Fr(n.view)}c.call(v),L.start(n,_.name)}function B(t){for(const e of t.changedTouches||[t])for(const t of P)t.identifier===e.identifier&&(t.cur=Yi(e,v));if(j&&!y&&!g&&1===P.length){const t=P[0];ga(t.cur[0]-t[0])>ga(t.cur[1]-t[1])?g=!0:y=!0}for(const t of P)t.cur&&(t[0]=t.cur[0],t[1]=t.cur[1]);m=!0,ha(t),F(t)}function F(t){const e=P[0],n=e.point0;var r;switch(M=e[0]-n[0],C=e[1]-n[1],_){case da:case pa:w&&(M=va(E-i,ba(T-f,M)),a=i+M,h=f+M),x&&(C=va(A-s,ba(N-p,C)),u=s+C,d=p+C);break;case ma:P[1]?(w&&(a=va(E,ba(T,P[0][0])),h=va(E,ba(T,P[1][0])),w=1),x&&(u=va(A,ba(N,P[0][1])),d=va(A,ba(N,P[1][1])),x=1)):(w<0?(M=va(E-i,ba(T-i,M)),a=i+M,h=f):w>0&&(M=va(E-f,ba(T-f,M)),a=i,h=f+M),x<0?(C=va(A-s,ba(N-s,C)),u=s+C,d=p):x>0&&(C=va(A-p,ba(N-p,C)),u=s,d=p+C));break;case ya:w&&(a=va(E,ba(T,i-M*w)),h=va(E,ba(T,f+M*w))),x&&(u=va(A,ba(N,s-C*x)),d=va(A,ba(N,p+C*x)))}ht+n))}function Ga(){return Qa(!1,!1)}function Ja(){return Qa(!1,!0)}function Xa(){return Qa(!0,!1)}function Qa(t,e){var n=0,r=null,i=null,o=null;function a(a){var s,u=a.length,c=new Array(u),l=Wa(0,u),f=new Array(u*u),h=new Array(u),p=0;a=Float64Array.from({length:u*u},e?(t,e)=>a[e%u][e/u|0]:(t,e)=>a[e/u|0][e%u]);for(let e=0;er(c[t],c[e])));for(const n of l){const r=e;if(t){const t=Wa(1+~u,u).filter((t=>t<0?a[~t*u+n]:a[n*u+t]));i&&t.sort(((t,e)=>i(t<0?-a[~t*u+n]:a[n*u+t],e<0?-a[~e*u+n]:a[n*u+e])));for(const r of t)r<0?(f[~r*u+n]||(f[~r*u+n]={source:null,target:null})).target={index:n,startAngle:e,endAngle:e+=a[~r*u+n]*p,value:a[~r*u+n]}:(f[n*u+r]||(f[n*u+r]={source:null,target:null})).source={index:n,startAngle:e,endAngle:e+=a[n*u+r]*p,value:a[n*u+r]};h[n]={index:n,startAngle:r,endAngle:e,value:c[n]}}else{const t=Wa(0,u).filter((t=>a[n*u+t]||a[t*u+n]));i&&t.sort(((t,e)=>i(a[n*u+t],a[n*u+e])));for(const r of t){let t;if(n=0))throw new Error(`invalid digits: ${t}`);if(e>15)return rs;const n=10**e;return function(t){this._+=t[0];for(let e=1,r=t.length;ees)if(Math.abs(l*s-u*c)>es&&i){let h=n-o,p=r-a,d=s*s+u*u,m=h*h+p*p,y=Math.sqrt(d),g=Math.sqrt(f),v=i*Math.tan((Za-Math.acos((d+f-m)/(2*y*g)))/2),b=v/g,_=v/y;Math.abs(b-1)>es&&this._append`L${t+b*c},${e+b*l}`,this._append`A${i},${i},0,0,${+(l*h>c*p)},${this._x1=t+_*s},${this._y1=e+_*u}`}else this._append`L${this._x1=t},${this._y1=e}`}arc(t,e,n,r,i,o){if(t=+t,e=+e,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let a=n*Math.cos(r),s=n*Math.sin(r),u=t+a,c=e+s,l=1^o,f=o?r-i:i-r;null===this._x1?this._append`M${u},${c}`:(Math.abs(this._x1-u)>es||Math.abs(this._y1-c)>es)&&this._append`L${u},${c}`,n&&(f<0&&(f=f%ts+ts),f>ns?this._append`A${n},${n},0,1,${l},${t-a},${e-s}A${n},${n},0,1,${l},${this._x1=u},${this._y1=c}`:f>es&&this._append`A${n},${n},0,${+(f>=Za)},${l},${this._x1=t+n*Math.cos(i)},${this._y1=e+n*Math.sin(i)}`)}rect(t,e,n,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function os(){return new is}function as(t=3){return new is(+t)}os.prototype=is.prototype;var ss=Array.prototype.slice;function us(t){return function(){return t}}function cs(t){return t.source}function ls(t){return t.target}function fs(t){return t.radius}function hs(t){return t.startAngle}function ps(t){return t.endAngle}function ds(){return 0}function ms(){return 10}function ys(t){var e=cs,n=ls,r=fs,i=fs,o=hs,a=ps,s=ds,u=null;function c(){var c,l=e.apply(this,arguments),f=n.apply(this,arguments),h=s.apply(this,arguments)/2,p=ss.call(arguments),d=+r.apply(this,(p[0]=l,p)),m=o.apply(this,p)-za,y=a.apply(this,p)-za,g=+i.apply(this,(p[0]=f,p)),v=o.apply(this,p)-za,b=a.apply(this,p)-za;if(u||(u=c=os()),h>Ha&&($a(y-m)>2*h+Ha?y>m?(m+=h,y-=h):(m-=h,y+=h):m=y=(m+y)/2,$a(b-v)>2*h+Ha?b>v?(v+=h,b-=h):(v-=h,b+=h):v=b=(v+b)/2),u.moveTo(d*qa(m),d*Ua(m)),u.arc(0,0,d,m,y),m!==v||y!==b)if(t){var _=g-+t.apply(this,arguments),w=(v+b)/2;u.quadraticCurveTo(0,0,_*qa(v),_*Ua(v)),u.lineTo(g*qa(w),g*Ua(w)),u.lineTo(_*qa(b),_*Ua(b))}else u.quadraticCurveTo(0,0,g*qa(v),g*Ua(v)),u.arc(0,0,g,v,b);if(u.quadraticCurveTo(0,0,d*qa(m),d*Ua(m)),u.closePath(),c)return u=null,c+""||null}return t&&(c.headRadius=function(e){return arguments.length?(t="function"==typeof e?e:us(+e),c):t}),c.radius=function(t){return arguments.length?(r=i="function"==typeof t?t:us(+t),c):r},c.sourceRadius=function(t){return arguments.length?(r="function"==typeof t?t:us(+t),c):r},c.targetRadius=function(t){return arguments.length?(i="function"==typeof t?t:us(+t),c):i},c.startAngle=function(t){return arguments.length?(o="function"==typeof t?t:us(+t),c):o},c.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:us(+t),c):a},c.padAngle=function(t){return arguments.length?(s="function"==typeof t?t:us(+t),c):s},c.source=function(t){return arguments.length?(e=t,c):e},c.target=function(t){return arguments.length?(n=t,c):n},c.context=function(t){return arguments.length?(u=null==t?null:t,c):u},c}function gs(){return ys()}function vs(){return ys(ms)}const bs=Math.PI/180,_s=180/Math.PI,ws=.96422,xs=1,ks=.82521,Os=4/29,Ss=6/29,Es=3*Ss*Ss,As=Ss*Ss*Ss;function Ts(t){if(t instanceof Cs)return new Cs(t.l,t.a,t.b,t.opacity);if(t instanceof Fs)return $s(t);t instanceof li||(t=ui(t));var e,n,r=Is(t.r),i=Is(t.g),o=Is(t.b),a=js((.2225045*r+.7168786*i+.0606169*o)/xs);return r===i&&i===o?e=n=a:(e=js((.4360747*r+.3850649*i+.1430804*o)/ws),n=js((.0139322*r+.0971045*i+.7141733*o)/ks)),new Cs(116*a-16,500*(e-a),200*(a-n),t.opacity)}function Ns(t,e){return new Cs(t,0,0,null==e?1:e)}function Ms(t,e,n,r){return 1===arguments.length?Ts(t):new Cs(t,e,n,null==r?1:r)}function Cs(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function js(t){return t>As?Math.pow(t,1/3):t/Es+Os}function Ps(t){return t>Ss?t*t*t:Es*(t-Os)}function Ls(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Is(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ds(t){if(t instanceof Fs)return new Fs(t.h,t.c,t.l,t.opacity);if(t instanceof Cs||(t=Ts(t)),0===t.a&&0===t.b)return new Fs(NaN,0()=>t;function tu(t,e){for(var n,r=-1,i=e.length;++rr!=p>r&&n<(h-c)*(r-l)/(p-l)+c&&(i=-i)}return i}function nu(t,e,n){var r,i,o,a;return function(t,e,n){return(e[0]-t[0])*(n[1]-t[1])==(n[0]-t[0])*(e[1]-t[1])}(t,e,n)&&(i=t[r=+(t[0]===e[0])],o=n[r],a=e[r],i<=o&&o<=a||a<=o&&o<=i)}function ru(){}var iu=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function ou(){var t=1,e=1,n=oe,r=s;function i(t){var e=n(t);if(Array.isArray(e))e=e.slice().sort(Qs);else{const n=wt(t,au);for(e=ee(...ie(n[0],n[1],e),e);e[e.length-1]>=n[1];)e.pop();for(;e[1]o(t,e)))}function o(n,i){const o=null==i?NaN:+i;if(isNaN(o))throw new Error(`invalid value: ${i}`);var s=[],u=[];return function(n,r,i){var o,s,u,c,l,f,h=new Array,p=new Array;for(o=s=-1,c=su(n[0],r),iu[c<<1].forEach(d);++o=r,iu[l<<2].forEach(d);++o0?s.push([t]):u.push(t)})),u.forEach((function(t){for(var e,n=0,r=s.length;n0&&o0&&a=0&&o>=0))throw new Error("invalid size");return t=r,e=o,i},i.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:Array.isArray(t)?Zs(Xs.call(t)):Zs(t),i):n},i.smooth=function(t){return arguments.length?(r=t?s:ru,i):r===s},i}function au(t){return isFinite(t)?t:NaN}function su(t,e){return null!=t&&+t>=e}function uu(t){return null==t||isNaN(t=+t)?-1/0:t}function cu(t,e,n,r){const i=r-e,o=n-e,a=isFinite(i)||isFinite(o)?i/o:Math.sign(i)/Math.sign(o);return isNaN(a)?t:t+a-.5}function lu(t){return t[0]}function fu(t){return t[1]}function hu(){return 1}function pu(){var t=lu,e=fu,n=hu,r=960,i=500,o=20,a=2,s=3*o,u=r+2*s>>a,c=i+2*s>>a,l=Zs(20);function f(r){var i=new Float32Array(u*c),l=Math.pow(2,-a),f=-1;for(const o of r){var h=(t(o,++f,r)+s)*l,p=(e(o,f,r)+s)*l,d=+n(o,f,r);if(d&&h>=0&&h=0&&pt*r)))(e).map(((t,e)=>(t.value=+n[e],p(t))))}function p(t){return t.coordinates.forEach(d),t}function d(t){t.forEach(m)}function m(t){t.forEach(y)}function y(t){t[0]=t[0]*Math.pow(2,a)-s,t[1]=t[1]*Math.pow(2,a)-s}function g(){return u=r+2*(s=3*o)>>a,c=i+2*s>>a,h}return h.contours=function(t){var e=f(t),n=ou().size([u,c]),r=Math.pow(2,2*a),i=t=>{t=+t;var i=p(n.contour(e,t*r));return i.value=t,i};return Object.defineProperty(i,"max",{get:()=>se(e)/r}),i},h.x=function(e){return arguments.length?(t="function"==typeof e?e:Zs(+e),h):t},h.y=function(t){return arguments.length?(e="function"==typeof t?t:Zs(+t),h):e},h.weight=function(t){return arguments.length?(n="function"==typeof t?t:Zs(+t),h):n},h.size=function(t){if(!arguments.length)return[r,i];var e=+t[0],n=+t[1];if(!(e>=0&&n>=0))throw new Error("invalid size");return r=e,i=n,g()},h.cellSize=function(t){if(!arguments.length)return 1<=1))throw new Error("invalid cell size");return a=Math.floor(Math.log(t)/Math.LN2),g()},h.thresholds=function(t){return arguments.length?(l="function"==typeof t?t:Array.isArray(t)?Zs(Xs.call(t)):Zs(t),h):l},h.bandwidth=function(t){if(!arguments.length)return Math.sqrt(o*(o+1));if(!((t=+t)>=0))throw new Error("invalid bandwidth");return o=(Math.sqrt(4*t*t+1)-1)/2,g()},h}const du=134217729;function mu(t,e,n,r,i){let o,a,s,u,c=e[0],l=r[0],f=0,h=0;l>c==l>-c?(o=c,c=e[++f]):(o=l,l=r[++h]);let p=0;if(fc==l>-c?(a=c+o,s=o-(a-c),c=e[++f]):(a=l+o,s=o-(a-l),l=r[++h]),o=a,0!==s&&(i[p++]=s);fc==l>-c?(a=o+c,u=a-o,s=o-(a-u)+(c-u),c=e[++f]):(a=o+l,u=a-o,s=o-(a-u)+(l-u),l=r[++h]),o=a,0!==s&&(i[p++]=s);for(;f=33306690738754716e-32*c?u:-function(t,e,n,r,i,o,a){let s,u,c,l,f,h,p,d,m,y,g,v,b,_,w,x,k,O;const S=t-i,E=n-i,A=e-o,T=r-o;_=S*T,h=du*S,p=h-(h-S),d=S-p,h=du*T,m=h-(h-T),y=T-m,w=d*y-(_-p*m-d*m-p*y),x=A*E,h=du*A,p=h-(h-A),d=A-p,h=du*E,m=h-(h-E),y=E-m,k=d*y-(x-p*m-d*m-p*y),g=w-k,f=w-g,gu[0]=w-(g+f)+(f-k),v=_+g,f=v-_,b=_-(v-f)+(g-f),g=b-x,f=b-g,gu[1]=b-(g+f)+(f-x),O=v+g,f=O-v,gu[2]=v-(O-f)+(g-f),gu[3]=O;let N=function(t,e){let n=e[0];for(let t=1;t<4;t++)n+=e[t];return n}(0,gu),M=22204460492503146e-32*a;if(N>=M||-N>=M)return N;if(f=t-S,s=t-(S+f)+(f-i),f=n-E,c=n-(E+f)+(f-i),f=e-A,u=e-(A+f)+(f-o),f=r-T,l=r-(T+f)+(f-o),0===s&&0===u&&0===c&&0===l)return N;if(M=11093356479670487e-47*a+33306690738754706e-32*Math.abs(N),N+=S*l+T*s-(A*c+E*u),N>=M||-N>=M)return N;_=s*T,h=du*s,p=h-(h-s),d=s-p,h=du*T,m=h-(h-T),y=T-m,w=d*y-(_-p*m-d*m-p*y),x=u*E,h=du*u,p=h-(h-u),d=u-p,h=du*E,m=h-(h-E),y=E-m,k=d*y-(x-p*m-d*m-p*y),g=w-k,f=w-g,wu[0]=w-(g+f)+(f-k),v=_+g,f=v-_,b=_-(v-f)+(g-f),g=b-x,f=b-g,wu[1]=b-(g+f)+(f-x),O=v+g,f=O-v,wu[2]=v-(O-f)+(g-f),wu[3]=O;const C=mu(4,gu,4,wu,vu);_=S*l,h=du*S,p=h-(h-S),d=S-p,h=du*l,m=h-(h-l),y=l-m,w=d*y-(_-p*m-d*m-p*y),x=A*c,h=du*A,p=h-(h-A),d=A-p,h=du*c,m=h-(h-c),y=c-m,k=d*y-(x-p*m-d*m-p*y),g=w-k,f=w-g,wu[0]=w-(g+f)+(f-k),v=_+g,f=v-_,b=_-(v-f)+(g-f),g=b-x,f=b-g,wu[1]=b-(g+f)+(f-x),O=v+g,f=O-v,wu[2]=v-(O-f)+(g-f),wu[3]=O;const j=mu(C,vu,4,wu,bu);_=s*l,h=du*s,p=h-(h-s),d=s-p,h=du*l,m=h-(h-l),y=l-m,w=d*y-(_-p*m-d*m-p*y),x=u*c,h=du*u,p=h-(h-u),d=u-p,h=du*c,m=h-(h-c),y=c-m,k=d*y-(x-p*m-d*m-p*y),g=w-k,f=w-g,wu[0]=w-(g+f)+(f-k),v=_+g,f=v-_,b=_-(v-f)+(g-f),g=b-x,f=b-g,wu[1]=b-(g+f)+(f-x),O=v+g,f=O-v,wu[2]=v-(O-f)+(g-f),wu[3]=O;const P=mu(j,bu,4,wu,_u);return _u[P-1]}(t,e,n,r,i,o,c)}yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(8),yu(8),yu(8),yu(4),yu(8),yu(8),yu(8),yu(12),yu(192),yu(192),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(8),yu(8),yu(8),yu(8),yu(8),yu(8),yu(8),yu(8),yu(8),yu(4),yu(4),yu(4),yu(8),yu(16),yu(16),yu(16),yu(32),yu(32),yu(48),yu(64),yu(1152),yu(1152),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(4),yu(24),yu(24),yu(24),yu(24),yu(24),yu(24),yu(24),yu(24),yu(24),yu(24),yu(1152),yu(1152),yu(1152),yu(1152),yu(1152),yu(2304),yu(2304),yu(3456),yu(5760),yu(8),yu(8),yu(8),yu(16),yu(24),yu(48),yu(48),yu(96),yu(192),yu(384),yu(384),yu(384),yu(768),yu(96),yu(96),yu(96),yu(1152);const ku=Math.pow(2,-52),Ou=new Uint32Array(512);class Su{static from(t,e=Cu,n=ju){const r=t.length,i=new Float64Array(2*r);for(let o=0;o>1;if(e>0&&"number"!=typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;const n=Math.max(2*e-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update()}update(){const{coords:t,_hullPrev:e,_hullNext:n,_hullTri:r,_hullHash:i}=this,o=t.length>>1;let a=1/0,s=1/0,u=-1/0,c=-1/0;for(let e=0;eu&&(u=n),r>c&&(c=r),this._ids[e]=e}const l=(a+u)/2,f=(s+c)/2;let h,p,d;for(let e=0,n=1/0;e0&&(p=e,n=r)}let g=t[2*p],v=t[2*p+1],b=1/0;for(let e=0;er&&(e[n++]=i,r=o)}return this.hull=e.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(xu(m,y,g,v,_,w)<0){const t=p,e=g,n=v;p=d,g=_,v=w,d=t,_=e,w=n}const x=function(t,e,n,r,i,o){const a=n-t,s=r-e,u=i-t,c=o-e,l=a*a+s*s,f=u*u+c*c,h=.5/(a*c-s*u);return{x:t+(c*l-s*f)*h,y:e+(a*f-u*l)*h}}(m,y,g,v,_,w);this._cx=x.x,this._cy=x.y;for(let e=0;e0&&Math.abs(c-o)<=ku&&Math.abs(l-a)<=ku)continue;if(o=c,a=l,u===h||u===p||u===d)continue;let f=0;for(let t=0,e=this._hashKey(c,l);t=0;)if(y=m,y===f){y=-1;break}if(-1===y)continue;let g=this._addTriangle(y,u,n[y],-1,-1,r[y]);r[u]=this._legalize(g+2),r[y]=g,k++;let v=n[y];for(;m=n[v],xu(c,l,t[2*v],t[2*v+1],t[2*m],t[2*m+1])<0;)g=this._addTriangle(v,u,m,r[u],-1,r[v]),r[u]=this._legalize(g+2),n[v]=v,k--,v=m;if(y===f)for(;m=e[y],xu(c,l,t[2*m],t[2*m+1],t[2*y],t[2*y+1])<0;)g=this._addTriangle(m,u,y,-1,r[y],r[m]),this._legalize(g+2),r[m]=g,n[y]=y,k--,y=m;this._hullStart=e[u]=y,n[y]=e[v]=u,n[u]=v,i[this._hashKey(c,l)]=u,i[this._hashKey(t[2*y],t[2*y+1])]=y}this.hull=new Uint32Array(k);for(let t=0,e=this._hullStart;t0?3-n:1+n)/4}(t-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:e,_halfedges:n,coords:r}=this;let i=0,o=0;for(;;){const a=n[t],s=t-t%3;if(o=s+(t+2)%3,-1===a){if(0===i)break;t=Ou[--i];continue}const u=a-a%3,c=s+(t+1)%3,l=u+(a+2)%3,f=e[o],h=e[t],p=e[c],d=e[l];if(Au(r[2*f],r[2*f+1],r[2*h],r[2*h+1],r[2*p],r[2*p+1],r[2*d],r[2*d+1])){e[t]=d,e[a]=f;const r=n[l];if(-1===r){let e=this._hullStart;do{if(this._hullTri[e]===l){this._hullTri[e]=t;break}e=this._hullPrev[e]}while(e!==this._hullStart)}this._link(t,r),this._link(a,n[o]),this._link(o,l);const s=u+(a+1)%3;i=n&&e[t[a]]>o;)t[a+1]=t[a--];t[a+1]=r}else{let i=n+1,o=r;Mu(t,n+r>>1,i),e[t[n]]>e[t[r]]&&Mu(t,n,r),e[t[i]]>e[t[r]]&&Mu(t,i,r),e[t[n]]>e[t[i]]&&Mu(t,n,i);const a=t[i],s=e[a];for(;;){do{i++}while(e[t[i]]s);if(o=o-n?(Nu(t,e,i,r),Nu(t,e,n,o-1)):(Nu(t,e,n,o-1),Nu(t,e,i,r))}}function Mu(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function Cu(t){return t[0]}function ju(t){return t[1]}const Pu=1e-6;class Lu{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,e){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,e){this._+=`L${this._x1=+t},${this._y1=+e}`}arc(t,e,n){const r=(t=+t)+(n=+n),i=e=+e;if(n<0)throw new Error("negative radius");null===this._x1?this._+=`M${r},${i}`:(Math.abs(this._x1-r)>Pu||Math.abs(this._y1-i)>Pu)&&(this._+="L"+r+","+i),n&&(this._+=`A${n},${n},0,1,1,${t-n},${e}A${n},${n},0,1,1,${this._x1=r},${this._y1=i}`)}rect(t,e,n,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${+n}v${+r}h${-n}Z`}value(){return this._||null}}class Iu{constructor(){this._=[]}moveTo(t,e){this._.push([t,e])}closePath(){this._.push(this._[0].slice())}lineTo(t,e){this._.push([t,e])}value(){return this._.length?this._:null}}class Du{constructor(t,[e,n,r,i]=[0,0,960,500]){if(!((r=+r)>=(e=+e)&&(i=+i)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(2*t.points.length),this.vectors=new Float64Array(2*t.points.length),this.xmax=r,this.xmin=e,this.ymax=i,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:e,triangles:n},vectors:r}=this;let i,o;const a=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let r,s,u=0,c=0,l=n.length;u1;)i-=2;for(let t=2;t0){if(e>=this.ymax)return null;(i=(this.ymax-e)/r)0){if(t>=this.xmax)return null;(i=(this.xmax-t)/n)this.xmax?2:0)|(ethis.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let e=0;e2&&function(t){const{triangles:e,coords:n}=t;for(let t=0;t1e-10)return!1}return!0}(t)){this.collinear=Int32Array.from({length:e.length/2},((t,e)=>e)).sort(((t,n)=>e[2*t]-e[2*n]||e[2*t+1]-e[2*n+1]));const t=this.collinear[0],n=this.collinear[this.collinear.length-1],r=[e[2*t],e[2*t+1],e[2*n],e[2*n+1]],i=1e-8*Math.hypot(r[3]-r[1],r[2]-r[0]);for(let t=0,n=e.length/2;t0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],o[r[0]]=1,2===r.length&&(o[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(t){return new Du(this,t)}*neighbors(t){const{inedges:e,hull:n,_hullIndex:r,halfedges:i,triangles:o,collinear:a}=this;if(a){const e=a.indexOf(t);return e>0&&(yield a[e-1]),void(e=0&&i!==n&&i!==r;)n=i;return i}_step(t,e,n){const{inedges:r,hull:i,_hullIndex:o,halfedges:a,triangles:s,points:u}=this;if(-1===r[t]||!u.length)return(t+1)%(u.length>>1);let c=t,l=Bu(e-u[2*t],2)+Bu(n-u[2*t+1],2);const f=r[t];let h=f;do{let r=s[h];const f=Bu(e-u[2*r],2)+Bu(n-u[2*r+1],2);if(f()=>t;function zu(t,{sourceEvent:e,subject:n,target:r,identifier:i,active:o,x:a,y:s,dx:u,dy:c,dispatch:l}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:l}})}function Vu(t){return!t.ctrlKey&&!t.button}function Yu(){return this.parentNode}function Hu(t,e){return null==e?{x:t.x,y:t.y}:e}function Wu(){return navigator.maxTouchPoints||"ontouchstart"in this}function Gu(){var t,e,n,r,i=Vu,o=Yu,a=Hu,s=Wu,u={},c=_n("start","drag","end"),l=0,f=0;function h(t){t.on("mousedown.drag",p).filter(s).on("touchstart.drag",y).on("touchmove.drag",g,Ir).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(a,s){if(!r&&i.call(this,a,s)){var u=b(this,o.call(this,a,s),a,s,"mouse");u&&(Lr(a.view).on("mousemove.drag",d,Dr).on("mouseup.drag",m,Dr),Fr(a.view),Rr(a),n=!1,t=a.clientX,e=a.clientY,u("start",a))}}function d(r){if(Br(r),!n){var i=r.clientX-t,o=r.clientY-e;n=i*i+o*o>f}u.mouse("drag",r)}function m(t){Lr(t.view).on("mousemove.drag mouseup.drag",null),$r(t.view,n),Br(t),u.mouse("end",t)}function y(t,e){if(i.call(this,t,e)){var n,r,a=t.changedTouches,s=o.call(this,t,e),u=a.length;for(n=0;n=o?u=!0:(r=t.charCodeAt(a++))===Zu?c=!0:r===tc&&(c=!0,t.charCodeAt(a)===Zu&&++a),t.slice(i+1,e-1).replace(/""/g,'"')}for(;a9999?"+"+rc(e,6):rc(e,4))+"-"+rc(t.getUTCMonth()+1,2)+"-"+rc(t.getUTCDate(),2)+(o?"T"+rc(n,2)+":"+rc(r,2)+":"+rc(i,2)+"."+rc(o,3)+"Z":i?"T"+rc(n,2)+":"+rc(r,2)+":"+rc(i,2)+"Z":r||n?"T"+rc(n,2)+":"+rc(r,2)+"Z":"")}(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,i,o=r(t,(function(t,r){if(n)return n(t,r-1);i=t,n=e?function(t,e){var n=ec(t);return function(r,i){return e(n(r),i,t)}}(t,e):ec(t)}));return o.columns=i||[],o},parseRows:r,format:function(e,n){return null==n&&(n=nc(e)),[n.map(a).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=nc(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(o).join("\n")},formatRow:o,formatValue:a}}var oc=ic(","),ac=oc.parse,sc=oc.parseRows,uc=oc.format,cc=oc.formatBody,lc=oc.formatRows,fc=oc.formatRow,hc=oc.formatValue,pc=ic("\t"),dc=pc.parse,mc=pc.parseRows,yc=pc.format,gc=pc.formatBody,vc=pc.formatRows,bc=pc.formatRow,_c=pc.formatValue;function wc(t){for(var e in t){var n,r,i=t[e].trim();if(i)if("true"===i)i=!0;else if("false"===i)i=!1;else if("NaN"===i)i=NaN;else if(isNaN(n=+i)){if(!(r=i.match(/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/)))continue;xc&&r[4]&&!r[7]&&(i=i.replace(/-/g,"/").replace(/T/," ")),i=new Date(i)}else i=n;else i=null;t[e]=i}return t}const xc=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),kc=t=>+t;function Oc(t){return t*t}function Sc(t){return t*(2-t)}function Ec(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}var Ac=function t(e){function n(t){return Math.pow(t,e)}return e=+e,n.exponent=t,n}(3),Tc=function t(e){function n(t){return 1-Math.pow(1-t,e)}return e=+e,n.exponent=t,n}(3),Nc=function t(e){function n(t){return((t*=2)<=1?Math.pow(t,e):2-Math.pow(2-t,e))/2}return e=+e,n.exponent=t,n}(3),Mc=Math.PI,Cc=Mc/2;function jc(t){return 1==+t?1:1-Math.cos(t*Cc)}function Pc(t){return Math.sin(t*Cc)}function Lc(t){return(1-Math.cos(Mc*t))/2}function Ic(t){return 1.0009775171065494*(Math.pow(2,-10*t)-.0009765625)}function Dc(t){return Ic(1-+t)}function Rc(t){return 1-Ic(t)}function Bc(t){return((t*=2)<=1?Ic(1-t):2-Ic(t-1))/2}function Fc(t){return 1-Math.sqrt(1-t*t)}function $c(t){return Math.sqrt(1- --t*t)}function qc(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var Uc=4/11,Kc=6/11,zc=8/11,Vc=3/4,Yc=9/11,Hc=10/11,Wc=15/16,Gc=21/22,Jc=63/64,Xc=1/Uc/Uc;function Qc(t){return 1-Zc(1-t)}function Zc(t){return(t=+t)dl(e,n).then((e=>(new DOMParser).parseFromString(e,t)))}const kl=xl("application/xml");var Ol=xl("text/html"),Sl=xl("image/svg+xml");function El(t,e){var n,r=1;function i(){var i,o,a=n.length,s=0,u=0;for(i=0;i=(o=(m+g)/2))?m=o:g=o,(l=n>=(a=(y+v)/2))?y=a:v=a,i=p,!(p=p[f=l<<1|c]))return i[f]=d,t;if(s=+t._x.call(null,p.data),u=+t._y.call(null,p.data),e===s&&n===u)return d.next=p,i?i[f]=d:t._root=d,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(c=e>=(o=(m+g)/2))?m=o:g=o,(l=n>=(a=(y+v)/2))?y=a:v=a}while((f=l<<1|c)==(h=(u>=a)<<1|s>=o));return i[h]=p,i[f]=d,t}function Tl(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function Nl(t){return t[0]}function Ml(t){return t[1]}function Cl(t,e,n){var r=new jl(null==e?Nl:e,null==n?Ml:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function jl(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function Pl(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var Ll=Cl.prototype=jl.prototype;function Il(t){return function(){return t}}function Dl(t){return 1e-6*(t()-.5)}function Rl(t){return t.x+t.vx}function Bl(t){return t.y+t.vy}function Fl(t){var e,n,r,i=1,o=1;function a(){for(var t,a,u,c,l,f,h,p=e.length,d=0;dc+d||ol+d||au.index){var m=c-s.x-s.vx,y=l-s.y-s.vy,g=m*m+y*y;gt.r&&(t.r=t[e].r)}function u(){if(e){var r,i,o=e.length;for(n=new Array(o),r=0;r[s(t,e,r),t])));for(a=0,i=new Array(c);al&&(l=r),if&&(f=i));if(u>l||c>f)return this;for(this.cover(u,c).cover(l,f),n=0;nt||t>=i||r>e||e>=o;)switch(s=(eh||(o=u.y0)>p||(a=u.x1)=g)<<1|t>=y)&&(u=d[d.length-1],d[d.length-1]=d[d.length-1-c],d[d.length-1-c]=u)}else{var v=t-+this._x.call(null,m.data),b=e-+this._y.call(null,m.data),_=v*v+b*b;if(_=(s=(d+y)/2))?d=s:y=s,(l=a>=(u=(m+g)/2))?m=u:g=u,e=p,!(p=p[f=l<<1|c]))return this;if(!p.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(n=e,h=f)}for(;p.data!==t;)if(r=p,!(p=p.next))return this;return(i=p.next)&&delete p.next,r?(i?r.next=i:delete r.next,this):e?(i?e[f]=i:delete e[f],(p=e[0]||e[1]||e[2]||e[3])&&p===(e[3]||e[2]||e[1]||e[0])&&!p.length&&(n?n[h]=p:this._root=p),this):(this._root=i,this)},Ll.removeAll=function(t){for(var e=0,n=t.length;e(t=(Kl*t+zl)%Vl)/Vl}();function f(){h(),c.call("tick",e),n1?(null==n?s.delete(t):s.set(t,d(n)),e):s.get(t)},find:function(e,n,r){var i,o,a,s,u,c=0,l=t.length;for(null==r?r=1/0:r*=r,c=0;c1?(c.on(t,n),e):c.on(t)}}}function Xl(){var t,e,n,r,i,o=Il(-30),a=1,s=1/0,u=.81;function c(n){var i,o=t.length,a=Cl(t,Yl,Hl).visitAfter(f);for(r=n,i=0;i=s)){(t.data!==e||t.next)&&(0===f&&(d+=(f=Dl(n))*f),0===h&&(d+=(h=Dl(n))*h),d1?r[0]+r.slice(2):r,+t.slice(n+1)]}function nf(t){return(t=ef(Math.abs(t)))?t[1]:NaN}var rf,of=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function af(t){if(!(e=of.exec(t)))throw new Error("invalid format: "+t);var e;return new sf({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function sf(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function uf(t,e){var n=ef(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}af.prototype=sf.prototype,sf.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const cf={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>uf(100*t,e),r:uf,s:function(t,e){var n=ef(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(rf=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+ef(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function lf(t){return t}var ff,hf,pf,df=Array.prototype.map,mf=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function yf(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?lf:(e=df.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,s=e[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),o.push(t.substring(i-=s,i+s)),!((u+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?lf:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(df.call(t.numerals,String)),u=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"−":t.minus+"",l=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=af(t)).fill,n=t.align,f=t.sign,h=t.symbol,p=t.zero,d=t.width,m=t.comma,y=t.precision,g=t.trim,v=t.type;"n"===v?(m=!0,v="g"):cf[v]||(void 0===y&&(y=12),g=!0,v="g"),(p||"0"===e&&"="===n)&&(p=!0,e="0",n="=");var b="$"===h?i:"#"===h&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",_="$"===h?o:/[%p]/.test(v)?u:"",w=cf[v],x=/[defgprs%]/.test(v);function k(t){var i,o,u,h=b,k=_;if("c"===v)k=w(t)+k,t="";else{var O=(t=+t)<0||1/t<0;if(t=isNaN(t)?l:w(Math.abs(t),y),g&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),O&&0==+t&&"+"!==f&&(O=!1),h=(O?"("===f?f:c:"-"===f||"("===f?"":f)+h,k=("s"===v?mf[8+rf/3]:"")+k+(O&&"("===f?")":""),x)for(i=-1,o=t.length;++i(u=t.charCodeAt(i))||u>57){k=(46===u?a+t.slice(i+1):t.slice(i))+k,t=t.slice(0,i);break}}m&&!p&&(t=r(t,1/0));var S=h.length+t.length+k.length,E=S>1)+h+t+k+E.slice(S);break;default:t=E+h+t+k}return s(t)}return y=void 0===y?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),k.toString=function(){return t+""},k}return{format:f,formatPrefix:function(t,e){var n=f(((t=af(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(nf(e)/3))),i=Math.pow(10,-r),o=mf[8+r/3];return function(t){return n(i*t)+o}}}}function gf(t){return ff=yf(t),hf=ff.format,pf=ff.formatPrefix,ff}function vf(t){return Math.max(0,-nf(Math.abs(t)))}function bf(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(nf(e)/3)))-nf(Math.abs(t)))}function _f(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,nf(e)-nf(t))+1}gf({thousands:",",grouping:[3],currency:["$",""]});var wf=1e-6,xf=1e-12,kf=Math.PI,Of=kf/2,Sf=kf/4,Ef=2*kf,Af=180/kf,Tf=kf/180,Nf=Math.abs,Mf=Math.atan,Cf=Math.atan2,jf=Math.cos,Pf=Math.ceil,Lf=Math.exp,If=(Math.floor,Math.hypot),Df=Math.log,Rf=Math.pow,Bf=Math.sin,Ff=Math.sign||function(t){return t>0?1:t<0?-1:0},$f=Math.sqrt,qf=Math.tan;function Uf(t){return t>1?0:t<-1?kf:Math.acos(t)}function Kf(t){return t>1?Of:t<-1?-Of:Math.asin(t)}function zf(t){return(t=Bf(t/2))*t}function Vf(){}function Yf(t,e){t&&Wf.hasOwnProperty(t.type)&&Wf[t.type](t,e)}var Hf={Feature:function(t,e){Yf(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r=0?1:-1,i=r*n,o=jf(e=(e*=Tf)/2+Sf),a=Bf(e),s=nh*a,u=eh*o+s*jf(i),c=s*r*Bf(i);dh.add(Cf(c,u)),th=t,eh=o,nh=a}function wh(t){return mh=new xt,Xf(t,yh),2*mh}function xh(t){return[Cf(t[1],t[0]),Kf(t[2])]}function kh(t){var e=t[0],n=t[1],r=jf(n);return[r*jf(e),r*Bf(e),Bf(n)]}function Oh(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Sh(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Eh(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Ah(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Th(t){var e=$f(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var Nh,Mh,Ch,jh,Ph,Lh,Ih,Dh,Rh,Bh,Fh,$h,qh,Uh,Kh,zh,Vh={point:Yh,lineStart:Wh,lineEnd:Gh,polygonStart:function(){Vh.point=Jh,Vh.lineStart=Xh,Vh.lineEnd=Qh,fh=new xt,yh.polygonStart()},polygonEnd:function(){yh.polygonEnd(),Vh.point=Yh,Vh.lineStart=Wh,Vh.lineEnd=Gh,dh<0?(rh=-(oh=180),ih=-(ah=90)):fh>wf?ah=90:fh<-wf&&(ih=-90),ph[0]=rh,ph[1]=oh},sphere:function(){rh=-(oh=180),ih=-(ah=90)}};function Yh(t,e){hh.push(ph=[rh=t,oh=t]),eah&&(ah=e)}function Hh(t,e){var n=kh([t*Tf,e*Tf]);if(lh){var r=Sh(lh,n),i=Sh([r[1],-r[0],0],r);Th(i),i=xh(i);var o,a=t-sh,s=a>0?1:-1,u=i[0]*Af*s,c=Nf(a)>180;c^(s*shah&&(ah=o):c^(s*sh<(u=(u+360)%360-180)&&uah&&(ah=e)),c?tZh(rh,oh)&&(oh=t):Zh(t,oh)>Zh(rh,oh)&&(rh=t):oh>=rh?(toh&&(oh=t)):t>sh?Zh(rh,t)>Zh(rh,oh)&&(oh=t):Zh(t,oh)>Zh(rh,oh)&&(rh=t)}else hh.push(ph=[rh=t,oh=t]);eah&&(ah=e),lh=n,sh=t}function Wh(){Vh.point=Hh}function Gh(){ph[0]=rh,ph[1]=oh,Vh.point=Yh,lh=null}function Jh(t,e){if(lh){var n=t-sh;fh.add(Nf(n)>180?n+(n>0?360:-360):n)}else uh=t,ch=e;yh.point(t,e),Hh(t,e)}function Xh(){yh.lineStart()}function Qh(){Jh(uh,ch),yh.lineEnd(),Nf(fh)>wf&&(rh=-(oh=180)),ph[0]=rh,ph[1]=oh,lh=null}function Zh(t,e){return(e-=t)<0?e+360:e}function tp(t,e){return t[0]-e[0]}function ep(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:eZh(r[0],r[1])&&(r[1]=i[1]),Zh(i[0],r[1])>Zh(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,e=0,r=o[n=o.length-1];e<=n;r=i,++e)i=o[e],(s=Zh(r[1],i[0]))>a&&(a=s,rh=i[0],oh=r[1])}return hh=ph=null,rh===1/0||ih===1/0?[[NaN,NaN],[NaN,NaN]]:[[rh,ih],[oh,ah]]}var rp={sphere:Vf,point:ip,lineStart:ap,lineEnd:cp,polygonStart:function(){rp.lineStart=lp,rp.lineEnd=fp},polygonEnd:function(){rp.lineStart=ap,rp.lineEnd=cp}};function ip(t,e){t*=Tf;var n=jf(e*=Tf);op(n*jf(t),n*Bf(t),Bf(e))}function op(t,e,n){++Nh,Ch+=(t-Ch)/Nh,jh+=(e-jh)/Nh,Ph+=(n-Ph)/Nh}function ap(){rp.point=sp}function sp(t,e){t*=Tf;var n=jf(e*=Tf);Uh=n*jf(t),Kh=n*Bf(t),zh=Bf(e),rp.point=up,op(Uh,Kh,zh)}function up(t,e){t*=Tf;var n=jf(e*=Tf),r=n*jf(t),i=n*Bf(t),o=Bf(e),a=Cf($f((a=Kh*o-zh*i)*a+(a=zh*r-Uh*o)*a+(a=Uh*i-Kh*r)*a),Uh*r+Kh*i+zh*o);Mh+=a,Lh+=a*(Uh+(Uh=r)),Ih+=a*(Kh+(Kh=i)),Dh+=a*(zh+(zh=o)),op(Uh,Kh,zh)}function cp(){rp.point=ip}function lp(){rp.point=hp}function fp(){pp($h,qh),rp.point=ip}function hp(t,e){$h=t,qh=e,t*=Tf,e*=Tf,rp.point=pp;var n=jf(e);Uh=n*jf(t),Kh=n*Bf(t),zh=Bf(e),op(Uh,Kh,zh)}function pp(t,e){t*=Tf;var n=jf(e*=Tf),r=n*jf(t),i=n*Bf(t),o=Bf(e),a=Kh*o-zh*i,s=zh*r-Uh*o,u=Uh*i-Kh*r,c=If(a,s,u),l=Kf(c),f=c&&-l/c;Rh.add(f*a),Bh.add(f*s),Fh.add(f*u),Mh+=l,Lh+=l*(Uh+(Uh=r)),Ih+=l*(Kh+(Kh=i)),Dh+=l*(zh+(zh=o)),op(Uh,Kh,zh)}function dp(t){Nh=Mh=Ch=jh=Ph=Lh=Ih=Dh=0,Rh=new xt,Bh=new xt,Fh=new xt,Xf(t,rp);var e=+Rh,n=+Bh,r=+Fh,i=If(e,n,r);return ikf&&(t-=Math.round(t/Ef)*Ef),[t,e]}function vp(t,e,n){return(t%=Ef)?e||n?yp(_p(t),wp(e,n)):_p(t):e||n?wp(e,n):gp}function bp(t){return function(e,n){return Nf(e+=t)>kf&&(e-=Math.round(e/Ef)*Ef),[e,n]}}function _p(t){var e=bp(t);return e.invert=bp(-t),e}function wp(t,e){var n=jf(t),r=Bf(t),i=jf(e),o=Bf(e);function a(t,e){var a=jf(e),s=jf(t)*a,u=Bf(t)*a,c=Bf(e),l=c*n+s*r;return[Cf(u*i-l*o,s*n-c*r),Kf(l*i+u*o)]}return a.invert=function(t,e){var a=jf(e),s=jf(t)*a,u=Bf(t)*a,c=Bf(e),l=c*i-u*o;return[Cf(u*i+c*o,s*n+l*r),Kf(l*n-s*r)]},a}function xp(t){function e(e){return(e=t(e[0]*Tf,e[1]*Tf))[0]*=Af,e[1]*=Af,e}return t=vp(t[0]*Tf,t[1]*Tf,t.length>2?t[2]*Tf:0),e.invert=function(e){return(e=t.invert(e[0]*Tf,e[1]*Tf))[0]*=Af,e[1]*=Af,e},e}function kp(t,e,n,r,i,o){if(n){var a=jf(e),s=Bf(e),u=r*n;null==i?(i=e+r*Ef,o=e-u/2):(i=Op(a,i),o=Op(a,o),(r>0?io)&&(i+=r*Ef));for(var c,l=i;r>0?l>o:l1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Ap(t,e){return Nf(t[0]-e[0])=0;--o)i.point((l=c[o])[0],l[1]);else r(h.x,h.p.x,-1,i);h=h.p}c=(h=h.o).z,p=!p}while(!h.v);i.lineEnd()}}}function Mp(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r=0?1:-1,E=S*O,A=E>kf,T=y*x;if(u.add(Cf(T*S*Bf(E),g*k+T*jf(E))),a+=A?O+S*Ef:O,A^d>=n^_>=n){var N=Sh(kh(p),kh(b));Th(N);var M=Sh(o,N);Th(M);var C=(A^O>=0?-1:1)*Kf(M[2]);(r>C||r===C&&(N[0]||N[1]))&&(s+=A^O>=0?1:-1)}}return(a<-wf||a0){for(f||(i.polygonStart(),f=!0),i.lineStart(),t=0;t1&&2&u&&h.push(h.pop().concat(h.shift())),a.push(h.filter(Lp))}return h}}function Lp(t){return t.length>1}function Ip(t,e){return((t=t.x)[0]<0?t[1]-Of-wf:Of-t[1])-((e=e.x)[0]<0?e[1]-Of-wf:Of-e[1])}gp.invert=gp;const Dp=Pp((function(){return!0}),(function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,a){var s=o>0?kf:-kf,u=Nf(o-n);Nf(u-kf)0?Of:-Of),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(o,r),e=0):i!==s&&u>=kf&&(Nf(n-i)wf?Mf((Bf(e)*(o=jf(r))*Bf(n)-Bf(r)*(i=jf(e))*Bf(t))/(i*o*a)):(e+r)/2}(n,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=o,r=a),i=s},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;if(null==t)i=n*Of,r.point(-kf,i),r.point(0,i),r.point(kf,i),r.point(kf,0),r.point(kf,-i),r.point(0,-i),r.point(-kf,-i),r.point(-kf,0),r.point(-kf,i);else if(Nf(t[0]-e[0])>wf){var o=t[0]0,i=Nf(e)>wf;function o(t,n){return jf(t)*jf(n)>e}function a(t,n,r){var i=[1,0,0],o=Sh(kh(t),kh(n)),a=Oh(o,o),s=o[0],u=a-s*s;if(!u)return!r&&t;var c=e*a/u,l=-e*s/u,f=Sh(i,o),h=Ah(i,c);Eh(h,Ah(o,l));var p=f,d=Oh(h,p),m=Oh(p,p),y=d*d-m*(Oh(h,h)-1);if(!(y<0)){var g=$f(y),v=Ah(p,(-d-g)/m);if(Eh(v,h),v=xh(v),!r)return v;var b,_=t[0],w=n[0],x=t[1],k=n[1];w<_&&(b=_,_=w,w=b);var O=w-_,S=Nf(O-kf)0^v[1]<(Nf(v[0]-_)kf^(_<=v[0]&&v[0]<=w)){var E=Ah(p,(-d+g)/m);return Eh(E,h),[v,xh(E)]}}}function s(e,n){var i=r?t:kf-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return Pp(o,(function(t){var e,n,u,c,l;return{lineStart:function(){c=u=!1,l=1},point:function(f,h){var p,d=[f,h],m=o(f,h),y=r?m?0:s(f,h):m?s(f+(f<0?kf:-kf),h):0;if(!e&&(c=u=m)&&t.lineStart(),m!==u&&(!(p=a(e,d))||Ap(e,p)||Ap(d,p))&&(d[2]=1),m!==u)l=0,m?(t.lineStart(),p=a(d,e),t.point(p[0],p[1])):(p=a(e,d),t.point(p[0],p[1],2),t.lineEnd()),e=p;else if(i&&e&&r^m){var g;y&n||!(g=a(d,e,!0))||(l=0,r?(t.lineStart(),t.point(g[0][0],g[0][1]),t.point(g[1][0],g[1][1]),t.lineEnd()):(t.point(g[1][0],g[1][1]),t.lineEnd(),t.lineStart(),t.point(g[0][0],g[0][1],3)))}!m||e&&Ap(e,d)||t.point(d[0],d[1]),e=d,u=m,n=y},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return l|(c&&u)<<1}}}),(function(e,r,i,o){kp(o,t,n,i,e,r)}),r?[0,-t]:[-kf,t-kf])}var Bp,Fp,$p,qp,Up=1e9,Kp=-Up;function zp(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,s,c){var l=0,f=0;if(null==i||(l=a(i,s))!==(f=a(o,s))||u(i,o)<0^s>0)do{c.point(0===l||3===l?t:n,l>1?r:e)}while((l=(l+s+4)%4)!==f);else c.point(o[0],o[1])}function a(r,i){return Nf(r[0]-t)0?0:3:Nf(r[0]-n)0?2:1:Nf(r[1]-e)0?1:0:i>0?3:2}function s(t,e){return u(t.x,e.x)}function u(t,e){var n=a(t,1),r=a(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){var u,c,l,f,h,p,d,m,y,g,v,b=a,_=Ep(),w={point:x,lineStart:function(){w.point=k,c&&c.push(l=[]),g=!0,y=!1,d=m=NaN},lineEnd:function(){u&&(k(f,h),p&&y&&_.rejoin(),u.push(_.result())),w.point=x,y&&b.lineEnd()},polygonStart:function(){b=_,u=[],c=[],v=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=c.length;nr&&(h-o)*(r-a)>(p-a)*(t-o)&&++e:p<=r&&(h-o)*(r-a)<(p-a)*(t-o)&&--e;return e}(),n=v&&e,i=(u=xe(u)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&Np(u,s,e,o,a),a.polygonEnd()),b=a,u=c=l=null}};function x(t,e){i(t,e)&&b.point(t,e)}function k(o,a){var s=i(o,a);if(c&&l.push([o,a]),g)f=o,h=a,p=s,g=!1,s&&(b.lineStart(),b.point(o,a));else if(s&&y)b.point(o,a);else{var u=[d=Math.max(Kp,Math.min(Up,d)),m=Math.max(Kp,Math.min(Up,m))],_=[o=Math.max(Kp,Math.min(Up,o)),a=Math.max(Kp,Math.min(Up,a))];!function(t,e,n,r,i,o){var a,s=t[0],u=t[1],c=0,l=1,f=e[0]-s,h=e[1]-u;if(a=n-s,f||!(a>0)){if(a/=f,f<0){if(a0){if(a>l)return;a>c&&(c=a)}if(a=i-s,f||!(a<0)){if(a/=f,f<0){if(a>l)return;a>c&&(c=a)}else if(f>0){if(a0)){if(a/=h,h<0){if(a0){if(a>l)return;a>c&&(c=a)}if(a=o-u,h||!(a<0)){if(a/=h,h<0){if(a>l)return;a>c&&(c=a)}else if(h>0){if(a0&&(t[0]=s+c*f,t[1]=u+c*h),l<1&&(e[0]=s+l*f,e[1]=u+l*h),!0}}}}}(u,_,t,e,n,r)?s&&(b.lineStart(),b.point(o,a),v=!1):(y||(b.lineStart(),b.point(u[0],u[1])),b.point(_[0],_[1]),s||b.lineEnd(),v=!1)}d=o,m=a,y=s}return w}}function Vp(){var t,e,n,r=0,i=0,o=960,a=500;return n={stream:function(n){return t&&e===n?t:t=zp(r,i,o,a)(e=n)},extent:function(s){return arguments.length?(r=+s[0][0],i=+s[0][1],o=+s[1][0],a=+s[1][1],t=e=null,n):[[r,i],[o,a]]}}}var Yp={sphere:Vf,point:Vf,lineStart:function(){Yp.point=Wp,Yp.lineEnd=Hp},lineEnd:Vf,polygonStart:Vf,polygonEnd:Vf};function Hp(){Yp.point=Yp.lineEnd=Vf}function Wp(t,e){Fp=t*=Tf,$p=Bf(e*=Tf),qp=jf(e),Yp.point=Gp}function Gp(t,e){t*=Tf;var n=Bf(e*=Tf),r=jf(e),i=Nf(t-Fp),o=jf(i),a=r*Bf(i),s=qp*n-$p*r*o,u=$p*n+qp*r*o;Bp.add(Cf($f(a*a+s*s),u)),Fp=t,$p=n,qp=r}function Jp(t){return Bp=new xt,Xf(t,Yp),+Bp}var Xp=[null,null],Qp={type:"LineString",coordinates:Xp};function Zp(t,e){return Xp[0]=t,Xp[1]=e,Jp(Qp)}var td={Feature:function(t,e){return nd(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r0&&(i=Zp(t[o],t[o-1]))>0&&n<=i&&r<=i&&(n+r-i)*(1-Math.pow((n-r)/i,2))wf})).map(u)).concat(Ee(Pf(o/p)*p,i,p).filter((function(t){return Nf(t%m)>wf})).map(c))}return g.lines=function(){return v().map((function(t){return{type:"LineString",coordinates:t}}))},g.outline=function(){return{type:"Polygon",coordinates:[l(r).concat(f(a).slice(1),l(n).reverse().slice(1),f(s).reverse().slice(1))]}},g.extent=function(t){return arguments.length?g.extentMajor(t).extentMinor(t):g.extentMinor()},g.extentMajor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],a=+t[1][1],r>n&&(t=r,r=n,n=t),s>a&&(t=s,s=a,a=t),g.precision(y)):[[r,s],[n,a]]},g.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],o=+n[0][1],i=+n[1][1],e>t&&(n=e,e=t,t=n),o>i&&(n=o,o=i,i=n),g.precision(y)):[[e,o],[t,i]]},g.step=function(t){return arguments.length?g.stepMajor(t).stepMinor(t):g.stepMinor()},g.stepMajor=function(t){return arguments.length?(d=+t[0],m=+t[1],g):[d,m]},g.stepMinor=function(t){return arguments.length?(h=+t[0],p=+t[1],g):[h,p]},g.precision=function(h){return arguments.length?(y=+h,u=cd(o,i,90),c=ld(e,t,y),l=cd(s,a,90),f=ld(r,n,y),g):y},g.extentMajor([[-180,-90+wf],[180,90-wf]]).extentMinor([[-180,-80-wf],[180,80+wf]])}function hd(){return fd()()}function pd(t,e){var n=t[0]*Tf,r=t[1]*Tf,i=e[0]*Tf,o=e[1]*Tf,a=jf(r),s=Bf(r),u=jf(o),c=Bf(o),l=a*jf(n),f=a*Bf(n),h=u*jf(i),p=u*Bf(i),d=2*Kf($f(zf(o-r)+a*u*zf(i-n))),m=Bf(d),y=d?function(t){var e=Bf(t*=d)/m,n=Bf(d-t)/m,r=n*l+e*h,i=n*f+e*p,o=n*s+e*c;return[Cf(i,r)*Af,Cf(o,$f(r*r+i*i))*Af]}:function(){return[n*Af,r*Af]};return y.distance=d,y}const dd=t=>t;var md,yd,gd,vd,bd=new xt,_d=new xt,wd={point:Vf,lineStart:Vf,lineEnd:Vf,polygonStart:function(){wd.lineStart=xd,wd.lineEnd=Sd},polygonEnd:function(){wd.lineStart=wd.lineEnd=wd.point=Vf,bd.add(Nf(_d)),_d=new xt},result:function(){var t=bd/2;return bd=new xt,t}};function xd(){wd.point=kd}function kd(t,e){wd.point=Od,md=gd=t,yd=vd=e}function Od(t,e){_d.add(vd*t-gd*e),gd=t,vd=e}function Sd(){Od(md,yd)}const Ed=wd;var Ad=1/0,Td=Ad,Nd=-Ad,Md=Nd,Cd={point:function(t,e){tNd&&(Nd=t),eMd&&(Md=e)},lineStart:Vf,lineEnd:Vf,polygonStart:Vf,polygonEnd:Vf,result:function(){var t=[[Ad,Td],[Nd,Md]];return Nd=Md=-(Td=Ad=1/0),t}};const jd=Cd;var Pd,Ld,Id,Dd,Rd=0,Bd=0,Fd=0,$d=0,qd=0,Ud=0,Kd=0,zd=0,Vd=0,Yd={point:Hd,lineStart:Wd,lineEnd:Xd,polygonStart:function(){Yd.lineStart=Qd,Yd.lineEnd=Zd},polygonEnd:function(){Yd.point=Hd,Yd.lineStart=Wd,Yd.lineEnd=Xd},result:function(){var t=Vd?[Kd/Vd,zd/Vd]:Ud?[$d/Ud,qd/Ud]:Fd?[Rd/Fd,Bd/Fd]:[NaN,NaN];return Rd=Bd=Fd=$d=qd=Ud=Kd=zd=Vd=0,t}};function Hd(t,e){Rd+=t,Bd+=e,++Fd}function Wd(){Yd.point=Gd}function Gd(t,e){Yd.point=Jd,Hd(Id=t,Dd=e)}function Jd(t,e){var n=t-Id,r=e-Dd,i=$f(n*n+r*r);$d+=i*(Id+t)/2,qd+=i*(Dd+e)/2,Ud+=i,Hd(Id=t,Dd=e)}function Xd(){Yd.point=Hd}function Qd(){Yd.point=tm}function Zd(){em(Pd,Ld)}function tm(t,e){Yd.point=em,Hd(Pd=Id=t,Ld=Dd=e)}function em(t,e){var n=t-Id,r=e-Dd,i=$f(n*n+r*r);$d+=i*(Id+t)/2,qd+=i*(Dd+e)/2,Ud+=i,Kd+=(i=Dd*t-Id*e)*(Id+t),zd+=i*(Dd+e),Vd+=3*i,Hd(Id=t,Dd=e)}const nm=Yd;function rm(t){this._context=t}rm.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,Ef)}},result:Vf};var im,om,am,sm,um,cm=new xt,lm={point:Vf,lineStart:function(){lm.point=fm},lineEnd:function(){im&&hm(om,am),lm.point=Vf},polygonStart:function(){im=!0},polygonEnd:function(){im=null},result:function(){var t=+cm;return cm=new xt,t}};function fm(t,e){lm.point=hm,om=sm=t,am=um=e}function hm(t,e){sm-=t,um-=e,cm.add($f(sm*sm+um*um)),sm=t,um=e}const pm=lm;let dm,mm,ym,gm;class vm{constructor(t){this._append=null==t?bm:function(t){const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return bm;if(e!==dm){const t=10**e;dm=e,mm=function(e){let n=1;this._+=e[0];for(const r=e.length;n=0))throw new RangeError(`invalid digits: ${t}`);i=e}return null===e&&(r=new vm(i)),a},a.projection(t).digits(i).context(e)}function wm(t){return{stream:xm(t)}}function xm(t){return function(e){var n=new km;for(var r in t)n[r]=t[r];return n.stream=e,n}}function km(){}function Om(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),Xf(n,t.stream(jd)),e(jd.result()),null!=r&&t.clipExtent(r),t}function Sm(t,e,n){return Om(t,(function(n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),a=+e[0][0]+(r-o*(n[1][0]+n[0][0]))/2,s=+e[0][1]+(i-o*(n[1][1]+n[0][1]))/2;t.scale(150*o).translate([a,s])}),n)}function Em(t,e,n){return Sm(t,[[0,0],e],n)}function Am(t,e,n){return Om(t,(function(n){var r=+e,i=r/(n[1][0]-n[0][0]),o=(r-i*(n[1][0]+n[0][0]))/2,a=-i*n[0][1];t.scale(150*i).translate([o,a])}),n)}function Tm(t,e,n){return Om(t,(function(n){var r=+e,i=r/(n[1][1]-n[0][1]),o=-i*n[0][0],a=(r-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([o,a])}),n)}km.prototype={constructor:km,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Nm=16,Mm=jf(30*Tf);function Cm(t,e){return+e?function(t,e){function n(r,i,o,a,s,u,c,l,f,h,p,d,m,y){var g=c-r,v=l-i,b=g*g+v*v;if(b>4*e&&m--){var _=a+h,w=s+p,x=u+d,k=$f(_*_+w*w+x*x),O=Kf(x/=k),S=Nf(Nf(x)-1)e||Nf((g*N+v*M)/b-.5)>.3||a*h+s*p+u*d2?t[2]%360*Tf:0,N()):[y*Af,g*Af,v*Af]},A.angle=function(t){return arguments.length?(b=t%360*Tf,N()):b*Af},A.reflectX=function(t){return arguments.length?(_=t?-1:1,N()):_<0},A.reflectY=function(t){return arguments.length?(w=t?-1:1,N()):w<0},A.precision=function(t){return arguments.length?(a=Cm(s,E=t*t),M()):$f(E)},A.fitExtent=function(t,e){return Sm(A,t,e)},A.fitSize=function(t,e){return Em(A,t,e)},A.fitWidth=function(t,e){return Am(A,t,e)},A.fitHeight=function(t,e){return Tm(A,t,e)},function(){return e=t.apply(this,arguments),A.invert=e.invert&&T,N()}}function Dm(t){var e=0,n=kf/3,r=Im(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*Tf,n=t[1]*Tf):[e*Af,n*Af]},i}function Rm(t,e){var n=Bf(t),r=(n+Bf(e))/2;if(Nf(r)=.12&&i<.234&&r>=-.425&&r<-.214?s:i>=.166&&i<.234&&r>=-.214&&r<-.115?u:a).invert(t)},l.stream=function(n){return t&&e===n?t:(r=[a.stream(e=n),s.stream(n),u.stream(n)],i=r.length,t={point:function(t,e){for(var n=-1;++n0?e<-Of+wf&&(e=-Of+wf):e>Of-wf&&(e=Of-wf);var n=i/Rf(Jm(e),r);return[n*Bf(r*t),i-n*jf(r*t)]}return o.invert=function(t,e){var n=i-e,o=Ff(r)*$f(t*t+n*n),a=Cf(t,Nf(n))*Ff(n);return n*r<0&&(a-=kf*Ff(t)*Ff(n)),[a/r,2*Mf(Rf(i/o,1/r))-Of]},o}function Qm(){return Dm(Xm).scale(109.5).parallels([30,30])}function Zm(t,e){return[t,e]}function ty(){return Lm(Zm).scale(152.63)}function ey(t,e){var n=jf(t),r=t===e?Bf(t):(n-jf(e))/(e-t),i=n/r+t;if(Nf(r)2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)}function wy(t,e){return t.parent===e.parent?1:2}function xy(t,e){return t+e.x}function ky(t,e){return Math.max(t,e.y)}function Oy(){var t=wy,e=1,n=1,r=!1;function i(i){var o,a=0;i.eachAfter((function(e){var n=e.children;n?(e.x=function(t){return t.reduce(xy,0)/t.length}(n),e.y=function(t){return 1+t.reduce(ky,0)}(n)):(e.x=o?a+=t(e,o):0,e.y=0,o=e)}));var s=function(t){for(var e;e=t.children;)t=e[0];return t}(i),u=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(i),c=s.x-t(s,u)/2,l=u.x+t(u,s)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*e,t.y=(i.y-t.y)*n}:function(t){t.x=(t.x-c)/(l-c)*e,t.y=(1-(i.y?t.y/i.y:1))*n})}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i}function Sy(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function Ey(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=Ty)):void 0===e&&(e=Ay);for(var n,r,i,o,a,s=new Cy(t),u=[s];n=u.pop();)if((i=e(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)u.push(r=i[o]=new Cy(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(My)}function Ay(t){return t.children}function Ty(t){return Array.isArray(t)?t[1]:null}function Ny(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function My(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function Cy(t){this.data=t,this.depth=this.height=0,this.parent=null}function jy(t){return null==t?null:Py(t)}function Py(t){if("function"!=typeof t)throw new Error;return t}function Ly(){return 0}function Iy(t){return function(){return t}}uy.invert=function(t,e){for(var n,r=e,i=r*r,o=i*i*i,a=0;a<12&&(o=(i=(r-=n=(r*(ry+iy*i+o*(oy+ay*i))-e)/(ry+3*iy*i+o*(7*oy+9*ay*i)))*r)*i*i,!(Nf(n)wf&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},my.invert=Um(Kf),gy.invert=Um((function(t){return 2*Mf(t)})),by.invert=function(t,e){return[-e,2*Mf(Lf(t))-Of]},Cy.prototype=Ey.prototype={constructor:Cy,count:function(){return this.eachAfter(Sy)},each:function(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this},eachAfter:function(t,e){for(var n,r,i,o=this,a=[o],s=[],u=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r=0;--r)o.push(n[r]);return this},find:function(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;for(t=n.pop(),e=r.pop();t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return Ey(this).eachBefore(Ny)},[Symbol.iterator]:function*(){var t,e,n,r,i=this,o=[i];do{for(t=o.reverse(),o=[];i=t.pop();)if(yield i,e=i.children)for(n=0,r=e.length;n(t=(Dy*t+Ry)%By)/By}function $y(t){return qy(t,Fy())}function qy(t,e){for(var n,r,i=0,o=(t=function(t,e){let n,r,i=t.length;for(;i;)r=e()*i--|0,n=t[i],t[i]=t[r],t[r]=n;return t}(Array.from(t),e)).length,a=[];i0&&n*n>r*r+i*i}function Vy(t,e){for(var n=0;n1e-6?(A+Math.sqrt(A*A-4*E*T))/(2*E):T/A);return{x:r+x+k*N,y:i+O+S*N,r:N}}function Gy(t,e,n){var r,i,o,a,s=t.x-e.x,u=t.y-e.y,c=s*s+u*u;c?(i=e.r+n.r,i*=i,a=t.r+n.r,i>(a*=a)?(r=(c+a-i)/(2*c),o=Math.sqrt(Math.max(0,a/c-r*r)),n.x=t.x-r*s-o*u,n.y=t.y-r*u+o*s):(r=(c+i-a)/(2*c),o=Math.sqrt(Math.max(0,i/c-r*r)),n.x=e.x+r*s-o*u,n.y=e.y+r*u+o*s)):(n.x=e.x+n.r,n.y=e.y)}function Jy(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function Xy(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,o=(e.y*n.r+n.y*e.r)/r;return i*i+o*o}function Qy(t){this._=t,this.next=null,this.previous=null}function Zy(t,e){if(!(a=(n=t,t="object"==typeof n&&"length"in n?n:Array.from(n)).length))return 0;var n,r,i,o,a,s,u,c,l,f,h,p;if((r=t[0]).x=0,r.y=0,!(a>1))return r.r;if(i=t[1],r.x=-i.r,i.x=r.r,i.y=0,!(a>2))return r.r+i.r;Gy(i,r,o=t[2]),r=new Qy(r),i=new Qy(i),o=new Qy(o),r.next=o.previous=i,i.next=r.previous=o,o.next=i.previous=r;t:for(c=3;cfunction(t){let e=(t=`${t}`).length;return yg(t,e-1)&&!yg(t,e-2)&&(t=t.slice(0,-1)),"/"===t[0]?t:`/${t}`}(t(e,n,r)))),n=e.map(mg),i=new Set(e).add("");for(const t of n)i.has(t)||(i.add(t),e.push(t),n.push(mg(t)),h.push(fg));p=(t,n)=>e[n],d=(t,e)=>n[e]}for(a=0,i=h.length;a=0&&(c=h[t]).data===fg;--t)c.data=null}if(s.parent=cg,s.eachBefore((function(t){t.depth=t.parent.depth+1,--i})).eachBefore(My),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(t){return arguments.length?(e=jy(t),r):e},r.parentId=function(t){return arguments.length?(n=jy(t),r):n},r.path=function(e){return arguments.length?(t=jy(e),r):t},r}function mg(t){let e=t.length;if(e<2)return"";for(;--e>1&&!yg(t,e););return t.slice(0,e)}function yg(t,e){if("/"===t[e]){let n=0;for(;e>0&&"\\"===t[--e];)++n;if(!(1&n))return!0}return!1}function gg(t,e){return t.parent===e.parent?1:2}function vg(t){var e=t.children;return e?e[0]:t.t}function bg(t){var e=t.children;return e?e[e.length-1]:t.t}function _g(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function wg(t,e,n){return t.a.parent===e.parent?t.a:n}function xg(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function kg(){var t=gg,e=1,n=1,r=null;function i(i){var u=function(t){for(var e,n,r,i,o,a=new xg(t,0),s=[a];e=s.pop();)if(r=e._.children)for(e.children=new Array(o=r.length),i=o-1;i>=0;--i)s.push(n=e.children[i]=new xg(r[i],i)),n.parent=e;return(a.parent=new xg(null,0)).children=[a],a}(i);if(u.eachAfter(o),u.parent.m=-u.z,u.eachBefore(a),r)i.eachBefore(s);else{var c=i,l=i,f=i;i.eachBefore((function(t){t.xl.x&&(l=t),t.depth>f.depth&&(f=t)}));var h=c===l?1:t(c,l)/2,p=h-c.x,d=e/(l.x+h+p),m=n/(f.depth||1);i.eachBefore((function(t){t.x=(t.x+p)*d,t.y=t.depth*m}))}return i}function o(e){var n=e.children,r=e.parent.children,i=e.i?r[e.i-1]:null;if(n){!function(t){for(var e,n=0,r=0,i=t.children,o=i.length;--o>=0;)(e=i[o]).z+=n,e.m+=n,n+=e.s+(r+=e.c)}(e);var o=(n[0].z+n[n.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-o):e.z=o}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,n,r){if(n){for(var i,o=e,a=e,s=n,u=o.parent.children[0],c=o.m,l=a.m,f=s.m,h=u.m;s=bg(s),o=vg(o),s&&o;)u=vg(u),(a=bg(a)).a=e,(i=s.z+f-o.z-c+t(s._,o._))>0&&(_g(wg(s,e,r),e,i),c+=i,l+=i),f+=s.m,c+=o.m,h+=u.m,l+=a.m;s&&!bg(a)&&(a.t=s,a.m+=f-l),o&&!vg(u)&&(u.t=o,u.m+=c-h,r=e)}return r}(e,i,e.parent.A||r[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*n}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i}function Og(t,e,n,r,i){for(var o,a=t.children,s=-1,u=a.length,c=t.value&&(i-n)/t.value;++sh&&(h=s),y=l*l*m,(p=Math.max(h/y,y/f))>d){l-=s;break}d=p}g.push(a={value:l,dice:u1?e:1)},n}(Sg);function Tg(){var t=Ag,e=!1,n=1,r=1,i=[0],o=Ly,a=Ly,s=Ly,u=Ly,c=Ly;function l(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(f),i=[0],e&&t.eachBefore(ag),t}function f(e){var n=i[e.depth],r=e.x0+n,l=e.y0+n,f=e.x1-n,h=e.y1-n;f=n-1){var l=s[e];return l.x0=i,l.y0=o,l.x1=a,void(l.y1=u)}for(var f=c[e],h=r/2+f,p=e+1,d=n-1;p>>1;c[m]u-o){var v=r?(i*g+a*y)/r:a;t(e,p,y,i,o,v,u),t(p,n,g,v,o,a,u)}else{var b=r?(o*g+u*y)/r:u;t(e,p,y,i,o,a,b),t(p,n,g,i,b,a,u)}}(0,u,t.value,e,n,r,i)}function Mg(t,e,n,r,i){(1&t.depth?Og:sg)(t,e,n,r,i)}const Cg=function t(e){function n(t,n,r,i,o){if((a=t._squarify)&&a.ratio===e)for(var a,s,u,c,l,f=-1,h=a.length,p=t.value;++f1?e:1)},n}(Sg);function jg(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}function Pg(t,e){var n=Ti(+t,+e);return function(t){var e=n(t);return e-360*Math.floor(e/360)}}function Lg(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function Ig(t){return((t=Math.exp(t))+1/t)/2}const Dg=function t(e,n,r){function i(t,i){var o,a,s=t[0],u=t[1],c=t[2],l=i[0],f=i[1],h=i[2],p=l-s,d=f-u,m=p*p+d*d;if(m<1e-12)a=Math.log(h/c)/e,o=function(t){return[s+t*p,u+t*d,c*Math.exp(e*t*a)]};else{var y=Math.sqrt(m),g=(h*h-c*c+r*m)/(2*c*n*y),v=(h*h-c*c-r*m)/(2*h*n*y),b=Math.log(Math.sqrt(g*g+1)-g),_=Math.log(Math.sqrt(v*v+1)-v);a=(_-b)/e,o=function(t){var r,i=t*a,o=Ig(b),l=c/(n*y)*(o*(r=e*i+b,((r=Math.exp(2*r))-1)/(r+1))-function(t){return((t=Math.exp(t))-1/t)/2}(b));return[s+l*p,u+l*d,c*o/Ig(e*i+b)]}}return o.duration=1e3*a*e/Math.SQRT2,o}return i.rho=function(e){var n=Math.max(.001,+e),r=n*n;return t(n,r,r*r)},i}(Math.SQRT2,2,4);function Rg(t){return function(e,n){var r=t((e=vi(e)).h,(n=vi(n)).h),i=Ni(e.s,n.s),o=Ni(e.l,n.l),a=Ni(e.opacity,n.opacity);return function(t){return e.h=r(t),e.s=i(t),e.l=o(t),e.opacity=a(t),e+""}}}const Bg=Rg(Ti);var Fg=Rg(Ni);function $g(t,e){var n=Ni((t=Ms(t)).l,(e=Ms(e)).l),r=Ni(t.a,e.a),i=Ni(t.b,e.b),o=Ni(t.opacity,e.opacity);return function(e){return t.l=n(e),t.a=r(e),t.b=i(e),t.opacity=o(e),t+""}}function qg(t){return function(e,n){var r=t((e=Bs(e)).h,(n=Bs(n)).h),i=Ni(e.c,n.c),o=Ni(e.l,n.l),a=Ni(e.opacity,n.opacity);return function(t){return e.h=r(t),e.c=i(t),e.l=o(t),e.opacity=a(t),e+""}}}const Ug=qg(Ti);var Kg=qg(Ni);function zg(t){return function e(n){function r(e,r){var i=t((e=Gs(e)).h,(r=Gs(r)).h),o=Ni(e.s,r.s),a=Ni(e.l,r.l),s=Ni(e.opacity,r.opacity);return function(t){return e.h=i(t),e.s=o(t),e.l=a(Math.pow(t,n)),e.opacity=s(t),e+""}}return n=+n,r.gamma=e,r}(1)}const Vg=zg(Ti);var Yg=zg(Ni);function Hg(t,e){void 0===e&&(e=t,t=zi);for(var n=0,r=e.length-1,i=e[0],o=new Array(r<0?0:r);n1&&Xg(t[n[i-2]],t[n[i-1]],t[r])<=0;)--i;n[i++]=r}return n.slice(0,i)}function tv(t){if((n=t.length)<3)return null;var e,n,r=new Array(n),i=new Array(n);for(e=0;e=0;--e)c.push(t[r[o[e]][2]]);for(e=+s;es!=c>s&&a<(u-n)*(s-r)/(c-r)+n&&(l=!l),u=n,c=r;return l}function nv(t){for(var e,n,r=-1,i=t.length,o=t[i-1],a=o[0],s=o[1],u=0;++r1);return t+n*o*Math.sqrt(-2*Math.log(i)/i)}}return n.source=t,n}(rv),sv=function t(e){var n=av.source(e);function r(){var t=n.apply(this,arguments);return function(){return Math.exp(t())}}return r.source=t,r}(rv),uv=function t(e){function n(t){return(t=+t)<=0?()=>0:function(){for(var n=0,r=t;r>1;--r)n+=e();return n+r*e()}}return n.source=t,n}(rv),cv=function t(e){var n=uv.source(e);function r(t){if(0==(t=+t))return e;var r=n(t);return function(){return r()/t}}return r.source=t,r}(rv),lv=function t(e){function n(t){return function(){return-Math.log1p(-e())/t}}return n.source=t,n}(rv),fv=function t(e){function n(t){if((t=+t)<0)throw new RangeError("invalid alpha");return t=1/-t,function(){return Math.pow(1-e(),t)}}return n.source=t,n}(rv),hv=function t(e){function n(t){if((t=+t)<0||t>1)throw new RangeError("invalid p");return function(){return Math.floor(e()+t)}}return n.source=t,n}(rv),pv=function t(e){function n(t){if((t=+t)<0||t>1)throw new RangeError("invalid p");return 0===t?()=>1/0:1===t?()=>1:(t=Math.log1p(-t),function(){return 1+Math.floor(Math.log1p(-e())/t)})}return n.source=t,n}(rv),dv=function t(e){var n=av.source(e)();function r(t,r){if((t=+t)<0)throw new RangeError("invalid k");if(0===t)return()=>0;if(r=null==r?1:+r,1===t)return()=>-Math.log1p(-e())*r;var i=(t<1?t+1:t)-1/3,o=1/(3*Math.sqrt(i)),a=t<1?()=>Math.pow(e(),1/t):()=>1;return function(){do{do{var t=n(),s=1+o*t}while(s<=0);s*=s*s;var u=1-e()}while(u>=1-.0331*t*t*t*t&&Math.log(u)>=.5*t*t+i*(1-s+Math.log(s)));return i*s*a()*r}}return r.source=t,r}(rv),mv=function t(e){var n=dv.source(e);function r(t,e){var r=n(t),i=n(e);return function(){var t=r();return 0===t?0:t/(t+i())}}return r.source=t,r}(rv),yv=function t(e){var n=pv.source(e),r=mv.source(e);function i(t,e){return t=+t,(e=+e)>=1?()=>t:e<=0?()=>0:function(){for(var i=0,o=t,a=e;o*a>16&&o*(1-a)>16;){var s=Math.floor((o+1)*a),u=r(s,o-s+1)();u<=a?(i+=s,o-=s,a=(a-u)/(1-u)):(o=s-1,a/=u)}for(var c=a<.5,l=n(c?a:1-a),f=l(),h=0;f<=o;++h)f+=l();return i+(c?h:o-h)}}return i.source=t,i}(rv),gv=function t(e){function n(t,n,r){var i;return 0==(t=+t)?i=t=>-Math.log(t):(t=1/t,i=e=>Math.pow(e,t)),n=null==n?0:+n,r=null==r?1:+r,function(){return n+r*i(-Math.log1p(-e()))}}return n.source=t,n}(rv),vv=function t(e){function n(t,n){return t=null==t?0:+t,n=null==n?1:+n,function(){return t+n*Math.tan(Math.PI*e())}}return n.source=t,n}(rv),bv=function t(e){function n(t,n){return t=null==t?0:+t,n=null==n?1:+n,function(){var r=e();return t+n*Math.log(r/(1-r))}}return n.source=t,n}(rv),_v=function t(e){var n=dv.source(e),r=yv.source(e);function i(t){return function(){for(var i=0,o=t;o>16;){var a=Math.floor(.875*o),s=n(a)();if(s>o)return i+r(a-1,o/s)();i+=a,o-=s}for(var u=-Math.log1p(-e()),c=0;u<=o;++c)u-=Math.log1p(-e());return i+c}}return i.source=t,i}(rv),wv=1664525,xv=1013904223,kv=1/4294967296;function Ov(t=Math.random()){let e=0|(0<=t&&t<1?t/kv:Math.abs(t));return()=>(e=wv*e+xv|0,kv*(e>>>0))}function Sv(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function Ev(t,e){switch(arguments.length){case 0:break;case 1:"function"==typeof t?this.interpolator(t):this.range(t);break;default:this.domain(t),"function"==typeof e?this.interpolator(e):this.range(e)}return this}const Av=Symbol("implicit");function Tv(){var t=new St,e=[],n=[],r=Av;function i(i){let o=t.get(i);if(void 0===o){if(r!==Av)return r;t.set(i,o=e.push(i)-1)}return n[o%n.length]}return i.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new St;for(const r of n)t.has(r)||t.set(r,e.push(r)-1);return i},i.range=function(t){return arguments.length?(n=Array.from(t),i):n.slice()},i.unknown=function(t){return arguments.length?(r=t,i):r},i.copy=function(){return Tv(e,n).unknown(r)},Sv.apply(i,arguments),i}function Nv(){var t,e,n=Tv().unknown(void 0),r=n.domain,i=n.range,o=0,a=1,s=!1,u=0,c=0,l=.5;function f(){var n=r().length,f=ae&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}(a[0],a[t-1])),r=t>2?Rv:Dv,i=o=null,f}function f(e){return null==e||isNaN(e=+e)?n:(i||(i=r(a.map(t),s,u)))(t(c(e)))}return f.invert=function(n){return c(e((o||(o=r(s,a.map(t),Fi)))(n)))},f.domain=function(t){return arguments.length?(a=Array.from(t,jv),l()):a.slice()},f.range=function(t){return arguments.length?(s=Array.from(t),l()):s.slice()},f.rangeRound=function(t){return s=Array.from(t),u=Lg,l()},f.clamp=function(t){return arguments.length?(c=!!t||Lv,l()):c!==Lv},f.interpolate=function(t){return arguments.length?(u=t,l()):u},f.unknown=function(t){return arguments.length?(n=t,f):n},function(n,r){return t=n,e=r,l()}}function $v(){return Fv()(Lv,Lv)}function qv(t,e,n,r){var i,o=re(t,e,n);switch((r=af(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=bf(o,a))||(r.precision=i),pf(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=_f(o,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=vf(o))||(r.precision=i-2*("%"===r.type))}return hf(r)}function Uv(t){var e=t.domain;return t.ticks=function(t){var n=e();return ee(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return qv(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,i,o=e(),a=0,s=o.length-1,u=o[a],c=o[s],l=10;for(c0;){if((i=ne(u,c,n))===r)return o[a]=u,o[s]=c,e(o);if(i>0)u=Math.floor(u/i)*i,c=Math.ceil(c/i)*i;else{if(!(i<0))break;u=Math.ceil(u*i)/i,c=Math.floor(c*i)/i}r=i}return t},t}function Kv(){var t=$v();return t.copy=function(){return Bv(t,Kv())},Sv.apply(t,arguments),Uv(t)}function zv(t){var e;function n(t){return null==t||isNaN(t=+t)?e:t}return n.invert=n,n.domain=n.range=function(e){return arguments.length?(t=Array.from(e,jv),n):t.slice()},n.unknown=function(t){return arguments.length?(e=t,n):e},n.copy=function(){return zv(t).unknown(e)},t=arguments.length?Array.from(t,jv):[0,1],Uv(n)}function Vv(t,e){var n,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a-t(-e,n)}function Qv(t){const e=t(Yv,Hv),n=e.domain;let r,i,o=10;function a(){return r=function(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}(o),i=function(t){return 10===t?Jv:t===Math.E?Math.exp:e=>Math.pow(t,e)}(o),n()[0]<0?(r=Xv(r),i=Xv(i),t(Wv,Gv)):t(Yv,Hv),e}return e.base=function(t){return arguments.length?(o=+t,a()):o},e.domain=function(t){return arguments.length?(n(t),a()):n()},e.ticks=t=>{const e=n();let a=e[0],s=e[e.length-1];const u=s0){for(;f<=h;++f)for(c=1;cs)break;d.push(l)}}else for(;f<=h;++f)for(c=o-1;c>=1;--c)if(l=f>0?c/i(-f):c*i(f),!(ls)break;d.push(l)}2*d.length{if(null==t&&(t=10),null==n&&(n=10===o?"s":","),"function"!=typeof n&&(o%1||null!=(n=af(n)).precision||(n.trim=!0),n=hf(n)),t===1/0)return n;const a=Math.max(1,o*t/e.ticks().length);return t=>{let e=t/i(Math.round(r(t)));return e*on(Vv(n(),{floor:t=>i(Math.floor(r(t))),ceil:t=>i(Math.ceil(r(t)))})),e}function Zv(){const t=Qv(Fv()).domain([1,10]);return t.copy=()=>Bv(t,Zv()).base(t.base()),Sv.apply(t,arguments),t}function tb(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function eb(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function nb(t){var e=1,n=t(tb(e),eb(e));return n.constant=function(n){return arguments.length?t(tb(e=+n),eb(e)):e},Uv(n)}function rb(){var t=nb(Fv());return t.copy=function(){return Bv(t,rb()).constant(t.constant())},Sv.apply(t,arguments)}function ib(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function ob(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function ab(t){return t<0?-t*t:t*t}function sb(t){var e=t(Lv,Lv),n=1;return e.exponent=function(e){return arguments.length?1==(n=+e)?t(Lv,Lv):.5===n?t(ob,ab):t(ib(n),ib(1/n)):n},Uv(e)}function ub(){var t=sb(Fv());return t.copy=function(){return Bv(t,ub()).exponent(t.exponent())},Sv.apply(t,arguments),t}function cb(){return ub.apply(null,arguments).exponent(.5)}function lb(t){return Math.sign(t)*t*t}function fb(){var t,e=$v(),n=[0,1],r=!1;function i(n){var i=function(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}(e(n));return isNaN(i)?t:r?Math.round(i):i}return i.invert=function(t){return e.invert(lb(t))},i.domain=function(t){return arguments.length?(e.domain(t),i):e.domain()},i.range=function(t){return arguments.length?(e.range((n=Array.from(t,jv)).map(lb)),i):n.slice()},i.rangeRound=function(t){return i.range(t).round(!0)},i.round=function(t){return arguments.length?(r=!!t,i):r},i.clamp=function(t){return arguments.length?(e.clamp(t),i):e.clamp()},i.unknown=function(e){return arguments.length?(t=e,i):t},i.copy=function(){return fb(e.domain(),n).round(r).clamp(e.clamp()).unknown(t)},Sv.apply(i,arguments),Uv(i)}function hb(){var t,e=[],n=[],r=[];function i(){var t=0,i=Math.max(1,n.length);for(r=new Array(i-1);++t0?r[i-1]:e[0],i=r?[i[r-1],n]:[i[a-1],i[a]]},a.unknown=function(e){return arguments.length?(t=e,a):a},a.thresholds=function(){return i.slice()},a.copy=function(){return pb().domain([e,n]).range(o).unknown(t)},Sv.apply(Uv(a),arguments)}function db(){var t,e=[.5],n=[0,1],r=1;function i(i){return null!=i&&i<=i?n[ot(e,i,0,r)]:t}return i.domain=function(t){return arguments.length?(e=Array.from(t),r=Math.min(e.length,n.length-1),i):e.slice()},i.range=function(t){return arguments.length?(n=Array.from(t),r=Math.min(e.length,n.length-1),i):n.slice()},i.invertExtent=function(t){var r=n.indexOf(t);return[e[r-1],e[r]]},i.unknown=function(e){return arguments.length?(t=e,i):t},i.copy=function(){return db().domain(e).range(n).unknown(t)},Sv.apply(i,arguments)}const mb=1e3,yb=6e4,gb=36e5,vb=864e5,bb=6048e5,_b=31536e6,wb=new Date,xb=new Date;function kb(t,e,n,r){function i(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return i.floor=e=>(t(e=new Date(+e)),e),i.ceil=n=>(t(n=new Date(n-1)),e(n,1),t(n),n),i.round=t=>{const e=i(t),n=i.ceil(t);return t-e(e(t=new Date(+t),null==n?1:Math.floor(n)),t),i.range=(n,r,o)=>{const a=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n0))return a;let s;do{a.push(s=new Date(+n)),e(n,o),t(n)}while(skb((e=>{if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)}),((t,r)=>{if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););})),n&&(i.count=(e,r)=>(wb.setTime(+e),xb.setTime(+r),t(wb),t(xb),Math.floor(n(wb,xb))),i.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?e=>r(e)%t==0:e=>i.count(0,e)%t==0):i:null)),i}const Ob=kb((()=>{}),((t,e)=>{t.setTime(+t+e)}),((t,e)=>e-t));Ob.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?kb((e=>{e.setTime(Math.floor(e/t)*t)}),((e,n)=>{e.setTime(+e+n*t)}),((e,n)=>(n-e)/t)):Ob:null);const Sb=Ob.range,Eb=kb((t=>{t.setTime(t-t.getMilliseconds())}),((t,e)=>{t.setTime(+t+e*mb)}),((t,e)=>(e-t)/mb),(t=>t.getUTCSeconds())),Ab=Eb.range,Tb=kb((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mb)}),((t,e)=>{t.setTime(+t+e*yb)}),((t,e)=>(e-t)/yb),(t=>t.getMinutes())),Nb=Tb.range,Mb=kb((t=>{t.setUTCSeconds(0,0)}),((t,e)=>{t.setTime(+t+e*yb)}),((t,e)=>(e-t)/yb),(t=>t.getUTCMinutes())),Cb=Mb.range,jb=kb((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mb-t.getMinutes()*yb)}),((t,e)=>{t.setTime(+t+e*gb)}),((t,e)=>(e-t)/gb),(t=>t.getHours())),Pb=jb.range,Lb=kb((t=>{t.setUTCMinutes(0,0,0)}),((t,e)=>{t.setTime(+t+e*gb)}),((t,e)=>(e-t)/gb),(t=>t.getUTCHours())),Ib=Lb.range,Db=kb((t=>t.setHours(0,0,0,0)),((t,e)=>t.setDate(t.getDate()+e)),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*yb)/vb),(t=>t.getDate()-1)),Rb=Db.range,Bb=kb((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/vb),(t=>t.getUTCDate()-1)),Fb=Bb.range,$b=kb((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/vb),(t=>Math.floor(t/vb))),qb=$b.range;function Ub(t){return kb((e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),((t,e)=>{t.setDate(t.getDate()+7*e)}),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*yb)/bb))}const Kb=Ub(0),zb=Ub(1),Vb=Ub(2),Yb=Ub(3),Hb=Ub(4),Wb=Ub(5),Gb=Ub(6),Jb=Kb.range,Xb=zb.range,Qb=Vb.range,Zb=Yb.range,t_=Hb.range,e_=Wb.range,n_=Gb.range;function r_(t){return kb((e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+7*e)}),((t,e)=>(e-t)/bb))}const i_=r_(0),o_=r_(1),a_=r_(2),s_=r_(3),u_=r_(4),c_=r_(5),l_=r_(6),f_=i_.range,h_=o_.range,p_=a_.range,d_=s_.range,m_=u_.range,y_=c_.range,g_=l_.range,v_=kb((t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,e)=>{t.setMonth(t.getMonth()+e)}),((t,e)=>e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())),(t=>t.getMonth())),b_=v_.range,__=kb((t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)}),((t,e)=>e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())),(t=>t.getUTCMonth())),w_=__.range,x_=kb((t=>{t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,e)=>{t.setFullYear(t.getFullYear()+e)}),((t,e)=>e.getFullYear()-t.getFullYear()),(t=>t.getFullYear()));x_.every=t=>isFinite(t=Math.floor(t))&&t>0?kb((e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,n)=>{e.setFullYear(e.getFullYear()+n*t)})):null;const k_=x_.range,O_=kb((t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)}),((t,e)=>e.getUTCFullYear()-t.getUTCFullYear()),(t=>t.getUTCFullYear()));O_.every=t=>isFinite(t=Math.floor(t))&&t>0?kb((e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null;const S_=O_.range;function E_(t,e,n,r,i,o){const a=[[Eb,1,mb],[Eb,5,5e3],[Eb,15,15e3],[Eb,30,3e4],[o,1,yb],[o,5,3e5],[o,15,9e5],[o,30,18e5],[i,1,gb],[i,3,108e5],[i,6,216e5],[i,12,432e5],[r,1,vb],[r,2,1728e5],[n,1,bb],[e,1,2592e6],[e,3,7776e6],[t,1,_b]];function s(e,n,r){const i=Math.abs(n-e)/r,o=Q((([,,t])=>t)).right(a,i);if(o===a.length)return t.every(re(e/_b,n/_b,r));if(0===o)return Ob.every(Math.max(re(e,n,r),1));const[s,u]=a[i/a[o-1][2]=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:ex,s:nx,S:xw,u:kw,U:Ow,V:Ew,w:Aw,W:Tw,x:null,X:null,y:Nw,Y:Cw,Z:Pw,"%":tx},_={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return u[t.getUTCMonth()]},B:function(t){return s[t.getUTCMonth()]},c:null,d:Lw,e:Lw,f:Fw,g:Jw,G:Qw,H:Iw,I:Dw,j:Rw,L:Bw,m:$w,M:qw,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:ex,s:nx,S:Uw,u:Kw,U:zw,V:Yw,w:Hw,W:Ww,x:null,X:null,y:Gw,Y:Xw,Z:Zw,"%":tx},w={a:function(t,e,n){var r=p.exec(e.slice(n));return r?(t.w=d.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(t,e,n){var r=f.exec(e.slice(n));return r?(t.w=h.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(t,e,n){var r=g.exec(e.slice(n));return r?(t.m=v.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(t,e,n){var r=m.exec(e.slice(n));return r?(t.m=y.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(t,n,r){return O(t,e,n,r)},d:iw,e:iw,f:lw,g:tw,G:Z_,H:aw,I:aw,j:ow,L:cw,m:rw,M:sw,p:function(t,e,n){var r=c.exec(e.slice(n));return r?(t.p=l.get(r[0].toLowerCase()),n+r[0].length):-1},q:nw,Q:hw,s:pw,S:uw,u:G_,U:J_,V:X_,w:W_,W:Q_,x:function(t,e,r){return O(t,n,e,r)},X:function(t,e,n){return O(t,r,e,n)},y:tw,Y:Z_,Z:ew,"%":fw};function x(t,e){return function(n){var r,i,o,a=[],s=-1,u=0,c=t.length;for(n instanceof Date||(n=new Date(+n));++s53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=j_(P_(o.y,0,1))).getUTCDay(),r=i>4||0===i?o_.ceil(r):o_(r),r=Bb.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=C_(P_(o.y,0,1))).getDay(),r=i>4||0===i?zb.ceil(r):zb(r),r=Db.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?j_(P_(o.y,0,1)).getUTCDay():C_(P_(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,j_(o)):C_(o)}}function O(t,e,n,r){for(var i,o,a=0,s=e.length,u=n.length;a=u)return-1;if(37===(i=e.charCodeAt(a++))){if(i=e.charAt(a++),!(o=w[i in $_?e.charAt(a++):i])||(r=o(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=x(n,b),b.X=x(r,b),b.c=x(e,b),_.x=x(n,_),_.X=x(r,_),_.c=x(e,_),{format:function(t){var e=x(t+="",b);return e.toString=function(){return t},e},parse:function(t){var e=k(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=x(t+="",_);return e.toString=function(){return t},e},utcParse:function(t){var e=k(t+="",!0);return e.toString=function(){return t},e}}}var I_,D_,R_,B_,F_,$_={"-":"",_:" ",0:"0"},q_=/^\s*\d+/,U_=/^%/,K_=/[\\^$*+?|[\]().{}]/g;function z_(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o[t.toLowerCase(),e])))}function W_(t,e,n){var r=q_.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function G_(t,e,n){var r=q_.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function J_(t,e,n){var r=q_.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function X_(t,e,n){var r=q_.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Q_(t,e,n){var r=q_.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function Z_(t,e,n){var r=q_.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function tw(t,e,n){var r=q_.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function ew(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function nw(t,e,n){var r=q_.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function rw(t,e,n){var r=q_.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function iw(t,e,n){var r=q_.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function ow(t,e,n){var r=q_.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function aw(t,e,n){var r=q_.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function sw(t,e,n){var r=q_.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function uw(t,e,n){var r=q_.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function cw(t,e,n){var r=q_.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function lw(t,e,n){var r=q_.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function fw(t,e,n){var r=U_.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function hw(t,e,n){var r=q_.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function pw(t,e,n){var r=q_.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function dw(t,e){return z_(t.getDate(),e,2)}function mw(t,e){return z_(t.getHours(),e,2)}function yw(t,e){return z_(t.getHours()%12||12,e,2)}function gw(t,e){return z_(1+Db.count(x_(t),t),e,3)}function vw(t,e){return z_(t.getMilliseconds(),e,3)}function bw(t,e){return vw(t,e)+"000"}function _w(t,e){return z_(t.getMonth()+1,e,2)}function ww(t,e){return z_(t.getMinutes(),e,2)}function xw(t,e){return z_(t.getSeconds(),e,2)}function kw(t){var e=t.getDay();return 0===e?7:e}function Ow(t,e){return z_(Kb.count(x_(t)-1,t),e,2)}function Sw(t){var e=t.getDay();return e>=4||0===e?Hb(t):Hb.ceil(t)}function Ew(t,e){return t=Sw(t),z_(Hb.count(x_(t),t)+(4===x_(t).getDay()),e,2)}function Aw(t){return t.getDay()}function Tw(t,e){return z_(zb.count(x_(t)-1,t),e,2)}function Nw(t,e){return z_(t.getFullYear()%100,e,2)}function Mw(t,e){return z_((t=Sw(t)).getFullYear()%100,e,2)}function Cw(t,e){return z_(t.getFullYear()%1e4,e,4)}function jw(t,e){var n=t.getDay();return z_((t=n>=4||0===n?Hb(t):Hb.ceil(t)).getFullYear()%1e4,e,4)}function Pw(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+z_(e/60|0,"0",2)+z_(e%60,"0",2)}function Lw(t,e){return z_(t.getUTCDate(),e,2)}function Iw(t,e){return z_(t.getUTCHours(),e,2)}function Dw(t,e){return z_(t.getUTCHours()%12||12,e,2)}function Rw(t,e){return z_(1+Bb.count(O_(t),t),e,3)}function Bw(t,e){return z_(t.getUTCMilliseconds(),e,3)}function Fw(t,e){return Bw(t,e)+"000"}function $w(t,e){return z_(t.getUTCMonth()+1,e,2)}function qw(t,e){return z_(t.getUTCMinutes(),e,2)}function Uw(t,e){return z_(t.getUTCSeconds(),e,2)}function Kw(t){var e=t.getUTCDay();return 0===e?7:e}function zw(t,e){return z_(i_.count(O_(t)-1,t),e,2)}function Vw(t){var e=t.getUTCDay();return e>=4||0===e?u_(t):u_.ceil(t)}function Yw(t,e){return t=Vw(t),z_(u_.count(O_(t),t)+(4===O_(t).getUTCDay()),e,2)}function Hw(t){return t.getUTCDay()}function Ww(t,e){return z_(o_.count(O_(t)-1,t),e,2)}function Gw(t,e){return z_(t.getUTCFullYear()%100,e,2)}function Jw(t,e){return z_((t=Vw(t)).getUTCFullYear()%100,e,2)}function Xw(t,e){return z_(t.getUTCFullYear()%1e4,e,4)}function Qw(t,e){var n=t.getUTCDay();return z_((t=n>=4||0===n?u_(t):u_.ceil(t)).getUTCFullYear()%1e4,e,4)}function Zw(){return"+0000"}function tx(){return"%"}function ex(t){return+t}function nx(t){return Math.floor(+t/1e3)}function rx(t){return I_=L_(t),D_=I_.format,R_=I_.parse,B_=I_.utcFormat,F_=I_.utcParse,I_}function ix(t){return new Date(t)}function ox(t){return t instanceof Date?+t:+new Date(+t)}function ax(t,e,n,r,i,o,a,s,u,c){var l=$v(),f=l.invert,h=l.domain,p=c(".%L"),d=c(":%S"),m=c("%I:%M"),y=c("%I %p"),g=c("%a %d"),v=c("%b %d"),b=c("%B"),_=c("%Y");function w(t){return(u(t)e(r/(t.length-1))))},n.quantiles=function(e){return Array.from({length:e+1},((n,r)=>de(t,r/e)))},n.copy=function(){return yx(e).domain(t)},Ev.apply(n,arguments)}function gx(){var t,e,n,r,i,o,a,s=0,u=.5,c=1,l=1,f=Lv,h=!1;function p(t){return isNaN(t=+t)?a:(t=.5+((t=+o(t))-e)*(l*tji(t[t.length-1]);var Dx=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(kx);const Rx=Ix(Dx);var Bx=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(kx);const Fx=Ix(Bx);var $x=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(kx);const qx=Ix($x);var Ux=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(kx);const Kx=Ix(Ux);var zx=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(kx);const Vx=Ix(zx);var Yx=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(kx);const Hx=Ix(Yx);var Wx=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(kx);const Gx=Ix(Wx);var Jx=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(kx);const Xx=Ix(Jx);var Qx=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(kx);const Zx=Ix(Qx);var tk=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(kx);const ek=Ix(tk);var nk=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(kx);const rk=Ix(nk);var ik=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(kx);const ok=Ix(ik);var ak=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(kx);const sk=Ix(ak);var uk=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(kx);const ck=Ix(uk);var lk=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(kx);const fk=Ix(lk);var hk=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(kx);const pk=Ix(hk);var dk=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(kx);const mk=Ix(dk);var yk=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(kx);const gk=Ix(yk);var vk=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(kx);const bk=Ix(vk);var _k=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(kx);const wk=Ix(_k);var xk=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(kx);const kk=Ix(xk);var Ok=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(kx);const Sk=Ix(Ok);var Ek=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(kx);const Ak=Ix(Ek);var Tk=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(kx);const Nk=Ix(Tk);var Mk=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(kx);const Ck=Ix(Mk);var jk=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(kx);const Pk=Ix(jk);var Lk=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(kx);const Ik=Ix(Lk);function Dk(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"}const Rk=Yg(Gs(300,.5,0),Gs(-240,.5,1));var Bk=Yg(Gs(-100,.75,.35),Gs(80,1.5,.8)),Fk=Yg(Gs(260,.75,.35),Gs(80,1.5,.8)),$k=Gs();function qk(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return $k.h=360*t-100,$k.s=1.5-1.5*e,$k.l=.8-.9*e,$k+""}var Uk=ci(),Kk=Math.PI/3,zk=2*Math.PI/3;function Vk(t){var e;return t=(.5-t)*Math.PI,Uk.r=255*(e=Math.sin(t))*e,Uk.g=255*(e=Math.sin(t+Kk))*e,Uk.b=255*(e=Math.sin(t+zk))*e,Uk+""}function Yk(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"}function Hk(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}const Wk=Hk(kx("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var Gk=Hk(kx("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Jk=Hk(kx("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),Xk=Hk(kx("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function Qk(t){return Lr(_r(t).call(document.documentElement))}var Zk=0;function tO(){return new eO}function eO(){this._="@"+(++Zk).toString(36)}function nO(t,e){return t.target&&(t=Vi(t),void 0===e&&(e=t.currentTarget),t=t.touches||[t]),Array.from(t,(t=>Yi(t,e)))}function rO(t){return"string"==typeof t?new Cr([document.querySelectorAll(t)],[document.documentElement]):new Cr([kn(t)],Mr)}function iO(t){return function(){return t}}eO.prototype=tO.prototype={constructor:eO,get:function(t){for(var e=this._;!(e in t);)if(!(t=t.parentNode))return;return t[e]},set:function(t,e){return t[this._]=e},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};const oO=Math.abs,aO=Math.atan2,sO=Math.cos,uO=Math.max,cO=Math.min,lO=Math.sin,fO=Math.sqrt,hO=1e-12,pO=Math.PI,dO=pO/2,mO=2*pO;function yO(t){return t>=1?dO:t<=-1?-dO:Math.asin(t)}function gO(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{const t=Math.floor(n);if(!(t>=0))throw new RangeError(`invalid digits: ${n}`);e=t}return t},()=>new is(e)}function vO(t){return t.innerRadius}function bO(t){return t.outerRadius}function _O(t){return t.startAngle}function wO(t){return t.endAngle}function xO(t){return t&&t.padAngle}function kO(t,e,n,r,i,o,a){var s=t-n,u=e-r,c=(a?o:-o)/fO(s*s+u*u),l=c*u,f=-c*s,h=t+l,p=e+f,d=n+l,m=r+f,y=(h+d)/2,g=(p+m)/2,v=d-h,b=m-p,_=v*v+b*b,w=i-o,x=h*m-d*p,k=(b<0?-1:1)*fO(uO(0,w*w*_-x*x)),O=(x*b-v*k)/_,S=(-x*v-b*k)/_,E=(x*b+v*k)/_,A=(-x*v+b*k)/_,T=O-y,N=S-g,M=E-y,C=A-g;return T*T+N*N>M*M+C*C&&(O=E,S=A),{cx:O,cy:S,x01:-l,y01:-f,x11:O*(i/w-1),y11:S*(i/w-1)}}function OO(){var t=vO,e=bO,n=iO(0),r=null,i=_O,o=wO,a=xO,s=null,u=gO(c);function c(){var c,l,f,h=+t.apply(this,arguments),p=+e.apply(this,arguments),d=i.apply(this,arguments)-dO,m=o.apply(this,arguments)-dO,y=oO(m-d),g=m>d;if(s||(s=c=u()),phO)if(y>mO-hO)s.moveTo(p*sO(d),p*lO(d)),s.arc(0,0,p,d,m,!g),h>hO&&(s.moveTo(h*sO(m),h*lO(m)),s.arc(0,0,h,m,d,g));else{var v,b,_=d,w=m,x=d,k=m,O=y,S=y,E=a.apply(this,arguments)/2,A=E>hO&&(r?+r.apply(this,arguments):fO(h*h+p*p)),T=cO(oO(p-h)/2,+n.apply(this,arguments)),N=T,M=T;if(A>hO){var C=yO(A/h*lO(E)),j=yO(A/p*lO(E));(O-=2*C)>hO?(x+=C*=g?1:-1,k-=C):(O=0,x=k=(d+m)/2),(S-=2*j)>hO?(_+=j*=g?1:-1,w-=j):(S=0,_=w=(d+m)/2)}var P=p*sO(_),L=p*lO(_),I=h*sO(k),D=h*lO(k);if(T>hO){var R,B=p*sO(w),F=p*lO(w),$=h*sO(x),q=h*lO(x);if(y1?0:f<-1?pO:Math.acos(f))/2),H=fO(R[0]*R[0]+R[1]*R[1]);N=cO(T,(h-H)/(Y-1)),M=cO(T,(p-H)/(Y+1))}else N=M=0}S>hO?M>hO?(v=kO($,q,P,L,p,M,g),b=kO(B,F,I,D,p,M,g),s.moveTo(v.cx+v.x01,v.cy+v.y01),MhO&&O>hO?N>hO?(v=kO(I,D,B,F,h,-N,g),b=kO(P,L,$,q,h,-N,g),s.lineTo(v.cx+v.x01,v.cy+v.y01),N=f;--h)s.point(g[h],v[h]);s.lineEnd(),s.areaEnd()}y&&(g[l]=+t(p,l,c),v[l]=+e(p,l,c),s.point(r?+r(p,l,c):g[l],n?+n(p,l,c):v[l]))}if(d)return s=null,d+""||null}function l(){return CO().defined(i).curve(a).context(o)}return t="function"==typeof t?t:void 0===t?NO:iO(+t),e="function"==typeof e?e:iO(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?MO:iO(+n),c.x=function(e){return arguments.length?(t="function"==typeof e?e:iO(+e),r=null,c):t},c.x0=function(e){return arguments.length?(t="function"==typeof e?e:iO(+e),c):t},c.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:iO(+t),c):r},c.y=function(t){return arguments.length?(e="function"==typeof t?t:iO(+t),n=null,c):e},c.y0=function(t){return arguments.length?(e="function"==typeof t?t:iO(+t),c):e},c.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:iO(+t),c):n},c.lineX0=c.lineY0=function(){return l().x(t).y(e)},c.lineY1=function(){return l().x(t).y(n)},c.lineX1=function(){return l().x(r).y(e)},c.defined=function(t){return arguments.length?(i="function"==typeof t?t:iO(!!t),c):i},c.curve=function(t){return arguments.length?(a=t,null!=o&&(s=a(o)),c):a},c.context=function(t){return arguments.length?(null==t?o=s=null:s=a(o=t),c):o},c}function PO(t,e){return et?1:e>=t?0:NaN}function LO(t){return t}function IO(){var t=LO,e=PO,n=null,r=iO(0),i=iO(mO),o=iO(0);function a(a){var s,u,c,l,f,h=(a=EO(a)).length,p=0,d=new Array(h),m=new Array(h),y=+r.apply(this,arguments),g=Math.min(mO,Math.max(-mO,i.apply(this,arguments)-y)),v=Math.min(Math.abs(g)/h,o.apply(this,arguments)),b=v*(g<0?-1:1);for(s=0;s0&&(p+=f);for(null!=e?d.sort((function(t,n){return e(m[t],m[n])})):null!=n&&d.sort((function(t,e){return n(a[t],a[e])})),s=0,c=p?(g-h*b)/p:0;s0?f*c:0)+b,m[u]={data:a[u],index:s,value:f,startAngle:y,endAngle:l,padAngle:v};return m}return a.value=function(e){return arguments.length?(t="function"==typeof e?e:iO(+e),a):t},a.sortValues=function(t){return arguments.length?(e=t,n=null,a):e},a.sort=function(t){return arguments.length?(n=t,e=null,a):n},a.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:iO(+t),a):r},a.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:iO(+t),a):i},a.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:iO(+t),a):o},a}AO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var DO=BO(TO);function RO(t){this._curve=t}function BO(t){function e(e){return new RO(t(e))}return e._curve=t,e}function FO(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(BO(t)):e()._curve},t}function $O(){return FO(CO().curve(DO))}function qO(){var t=jO().curve(DO),e=t.curve,n=t.lineX0,r=t.lineX1,i=t.lineY0,o=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return FO(n())},delete t.lineX0,t.lineEndAngle=function(){return FO(r())},delete t.lineX1,t.lineInnerRadius=function(){return FO(i())},delete t.lineY0,t.lineOuterRadius=function(){return FO(o())},delete t.lineY1,t.curve=function(t){return arguments.length?e(BO(t)):e()._curve},t}function UO(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}RO.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};class KO{constructor(t,e){this._context=t,this._x=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,e,t,e):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+e)/2,t,this._y0,t,e)}this._x0=t,this._y0=e}}class zO{constructor(t){this._context=t}lineStart(){this._point=0}lineEnd(){}point(t,e){if(t=+t,e=+e,0===this._point)this._point=1;else{const n=UO(this._x0,this._y0),r=UO(this._x0,this._y0=(this._y0+e)/2),i=UO(t,this._y0),o=UO(t,e);this._context.moveTo(...n),this._context.bezierCurveTo(...r,...i,...o)}this._x0=t,this._y0=e}}function VO(t){return new KO(t,!0)}function YO(t){return new KO(t,!1)}function HO(t){return new zO(t)}function WO(t){return t.source}function GO(t){return t.target}function JO(t){let e=WO,n=GO,r=NO,i=MO,o=null,a=null,s=gO(u);function u(){let u;const c=SO.call(arguments),l=e.apply(this,c),f=n.apply(this,c);if(null==o&&(a=t(u=s())),a.lineStart(),c[0]=l,a.point(+r.apply(this,c),+i.apply(this,c)),c[0]=f,a.point(+r.apply(this,c),+i.apply(this,c)),a.lineEnd(),u)return a=null,u+""||null}return u.source=function(t){return arguments.length?(e=t,u):e},u.target=function(t){return arguments.length?(n=t,u):n},u.x=function(t){return arguments.length?(r="function"==typeof t?t:iO(+t),u):r},u.y=function(t){return arguments.length?(i="function"==typeof t?t:iO(+t),u):i},u.context=function(e){return arguments.length?(null==e?o=a=null:a=t(o=e),u):o},u}function XO(){return JO(VO)}function QO(){return JO(YO)}function ZO(){const t=JO(HO);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t}const tS=fO(3),eS={draw(t,e){const n=.59436*fO(e+cO(e/28,.75)),r=n/2,i=r*tS;t.moveTo(0,n),t.lineTo(0,-n),t.moveTo(-i,-r),t.lineTo(i,r),t.moveTo(-i,r),t.lineTo(i,-r)}},nS={draw(t,e){const n=fO(e/pO);t.moveTo(n,0),t.arc(0,0,n,0,mO)}},rS={draw(t,e){const n=fO(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},iS=fO(1/3),oS=2*iS,aS={draw(t,e){const n=fO(e/oS),r=n*iS;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},sS={draw(t,e){const n=.62625*fO(e);t.moveTo(0,-n),t.lineTo(n,0),t.lineTo(0,n),t.lineTo(-n,0),t.closePath()}},uS={draw(t,e){const n=.87559*fO(e-cO(e/7,2));t.moveTo(-n,0),t.lineTo(n,0),t.moveTo(0,n),t.lineTo(0,-n)}},cS={draw(t,e){const n=fO(e),r=-n/2;t.rect(r,r,n,n)}},lS={draw(t,e){const n=.4431*fO(e);t.moveTo(n,n),t.lineTo(n,-n),t.lineTo(-n,-n),t.lineTo(-n,n),t.closePath()}},fS=lO(pO/10)/lO(7*pO/10),hS=lO(mO/10)*fS,pS=-sO(mO/10)*fS,dS={draw(t,e){const n=fO(.8908130915292852*e),r=hS*n,i=pS*n;t.moveTo(0,-n),t.lineTo(r,i);for(let e=1;e<5;++e){const o=mO*e/5,a=sO(o),s=lO(o);t.lineTo(s*n,-a*n),t.lineTo(a*r-s*i,s*r+a*i)}t.closePath()}},mS=fO(3),yS={draw(t,e){const n=-fO(e/(3*mS));t.moveTo(0,2*n),t.lineTo(-mS*n,-n),t.lineTo(mS*n,-n),t.closePath()}},gS=fO(3),vS={draw(t,e){const n=.6824*fO(e),r=n/2,i=n*gS/2;t.moveTo(0,-n),t.lineTo(i,r),t.lineTo(-i,r),t.closePath()}},bS=-.5,_S=fO(3)/2,wS=1/fO(12),xS=3*(wS/2+1),kS={draw(t,e){const n=fO(e/xS),r=n/2,i=n*wS,o=r,a=n*wS+n,s=-o,u=a;t.moveTo(r,i),t.lineTo(o,a),t.lineTo(s,u),t.lineTo(bS*r-_S*i,_S*r+bS*i),t.lineTo(bS*o-_S*a,_S*o+bS*a),t.lineTo(bS*s-_S*u,_S*s+bS*u),t.lineTo(bS*r+_S*i,bS*i-_S*r),t.lineTo(bS*o+_S*a,bS*a-_S*o),t.lineTo(bS*s+_S*u,bS*u-_S*s),t.closePath()}},OS={draw(t,e){const n=.6189*fO(e-cO(e/6,1.7));t.moveTo(-n,-n),t.lineTo(n,n),t.moveTo(-n,n),t.lineTo(n,-n)}},SS=[nS,rS,aS,cS,dS,yS,kS],ES=[nS,uS,OS,vS,eS,lS,sS];function AS(t,e){let n=null,r=gO(i);function i(){let i;if(n||(n=i=r()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),i)return n=null,i+""||null}return t="function"==typeof t?t:iO(t||nS),e="function"==typeof e?e:iO(void 0===e?64:+e),i.type=function(e){return arguments.length?(t="function"==typeof e?e:iO(e),i):t},i.size=function(t){return arguments.length?(e="function"==typeof t?t:iO(+t),i):e},i.context=function(t){return arguments.length?(n=null==t?null:t,i):n},i}function TS(){}function NS(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function MS(t){this._context=t}function CS(t){return new MS(t)}function jS(t){this._context=t}function PS(t){return new jS(t)}function LS(t){this._context=t}function IS(t){return new LS(t)}function DS(t,e){this._basis=new MS(t),this._beta=e}MS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:NS(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:NS(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},jS.prototype={areaStart:TS,areaEnd:TS,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:NS(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},LS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:NS(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},DS.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r,i=t[0],o=e[0],a=t[n]-i,s=e[n]-o,u=-1;++u<=n;)r=u/n,this._basis.point(this._beta*t[u]+(1-this._beta)*(i+r*a),this._beta*e[u]+(1-this._beta)*(o+r*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const RS=function t(e){function n(t){return 1===e?new MS(t):new DS(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function BS(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function FS(t,e){this._context=t,this._k=(1-e)/6}FS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:BS(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:BS(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const $S=function t(e){function n(t){return new FS(t,e)}return n.tension=function(e){return t(+e)},n}(0);function qS(t,e){this._context=t,this._k=(1-e)/6}qS.prototype={areaStart:TS,areaEnd:TS,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:BS(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const US=function t(e){function n(t){return new qS(t,e)}return n.tension=function(e){return t(+e)},n}(0);function KS(t,e){this._context=t,this._k=(1-e)/6}KS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:BS(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const zS=function t(e){function n(t){return new KS(t,e)}return n.tension=function(e){return t(+e)},n}(0);function VS(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>hO){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,u=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/u,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/u}if(t._l23_a>hO){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,l=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*c+t._x1*t._l23_2a-e*t._l12_2a)/l,a=(a*c+t._y1*t._l23_2a-n*t._l12_2a)/l}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function YS(t,e){this._context=t,this._alpha=e}YS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:VS(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const HS=function t(e){function n(t){return e?new YS(t,e):new FS(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function WS(t,e){this._context=t,this._alpha=e}WS.prototype={areaStart:TS,areaEnd:TS,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:VS(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const GS=function t(e){function n(t){return e?new WS(t,e):new qS(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function JS(t,e){this._context=t,this._alpha=e}JS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:VS(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const XS=function t(e){function n(t){return e?new JS(t,e):new KS(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function QS(t){this._context=t}function ZS(t){return new QS(t)}function tE(t){return t<0?-1:1}function eE(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(tE(o)+tE(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function nE(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function rE(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,s=(o-r)/3;t._context.bezierCurveTo(r+s,i+s*e,o-s,a-s*n,o,a)}function iE(t){this._context=t}function oE(t){this._context=new aE(t)}function aE(t){this._context=t}function sE(t){return new iE(t)}function uE(t){return new oE(t)}function cE(t){this._context=t}function lE(t){var e,n,r=t.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=t[0]+2*t[1],e=1;e=0;--e)i[e]=(a[e]-i[e+1])/o[e];for(o[r-1]=(t[r]+i[r-1])/2,e=0;e1)for(var n,r,i,o=1,a=t[e[0]],s=a.length;o=0;)n[e]=e;return n}function vE(t,e){return t[e]}function bE(t){const e=[];return e.key=t,e}function _E(){var t=iO([]),e=gE,n=yE,r=vE;function i(i){var o,a,s=Array.from(t.apply(this,arguments),bE),u=s.length,c=-1;for(const t of i)for(o=0,++c;o0){for(var n,r,i,o=0,a=t[0].length;o0)for(var n,r,i,o,a,s,u=0,c=t[e[0]].length;u0?(r[0]=o,r[1]=o+=i):i<0?(r[1]=a,r[0]=a+=i):(r[0]=0,r[1]=i)}function kE(t,e){if((n=t.length)>0){for(var n,r=0,i=t[e[0]],o=i.length;r0&&(r=(n=t[e[0]]).length)>0){for(var n,r,i,o=0,a=1;ao&&(o=e,r=n);return r}function AE(t){var e=t.map(TE);return gE(t).sort((function(t,n){return e[t]-e[n]}))}function TE(t){for(var e,n=0,r=-1,i=t.length;++r=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var jE="%Y-%m-%dT%H:%M:%S.%LZ",PE=Date.prototype.toISOString?function(t){return t.toISOString()}:B_(jE);const LE=PE;var IE=+new Date("2000-01-01T00:00:00.000Z")?function(t){var e=new Date(t);return isNaN(e)?null:e}:F_(jE);const DE=IE;function RE(t,e,n){var r=new ao,i=e;return null==e?(r.restart(t,e,n),r):(r._restart=r.restart,r.restart=function(t,e,n){e=+e,n=null==n?io():+n,r._restart((function o(a){a+=i,r._restart(o,i+=e,n),t(a)}),e,n)},r.restart(t,e,n),r)}const BE=t=>()=>t;function FE(t,{sourceEvent:e,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function $E(t,e,n){this.k=t,this.x=e,this.y=n}$E.prototype={constructor:$E,scale:function(t){return 1===t?this:new $E(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new $E(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var qE=new $E(1,0,0);function UE(t){for(;!t.__zoom;)if(!(t=t.parentNode))return qE;return t.__zoom}function KE(t){t.stopImmediatePropagation()}function zE(t){t.preventDefault(),t.stopImmediatePropagation()}function VE(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function YE(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function HE(){return this.__zoom||qE}function WE(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function GE(){return navigator.maxTouchPoints||"ontouchstart"in this}function JE(t,e,n){var r=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],o=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}function XE(){var t,e,n,r=VE,i=YE,o=JE,a=WE,s=GE,u=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],l=250,f=Dg,h=_n("start","zoom","end"),p=500,d=150,m=0,y=10;function g(t){t.property("__zoom",HE).on("wheel.zoom",O,{passive:!1}).on("mousedown.zoom",S).on("dblclick.zoom",E).filter(s).on("touchstart.zoom",A).on("touchmove.zoom",T).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(t,e){return(e=Math.max(u[0],Math.min(u[1],e)))===t.k?t:new $E(e,t.x,t.y)}function b(t,e,n){var r=e[0]-n[0]*t.k,i=e[1]-n[1]*t.k;return r===t.x&&i===t.y?t:new $E(t.k,r,i)}function _(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function w(t,e,n,r){t.on("start.zoom",(function(){x(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){x(this,arguments).event(r).end()})).tween("zoom",(function(){var t=this,o=arguments,a=x(t,o).event(r),s=i.apply(t,o),u=null==n?_(s):"function"==typeof n?n.apply(t,o):n,c=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),l=t.__zoom,h="function"==typeof e?e.apply(t,o):e,p=f(l.invert(u).concat(c/l.k),h.invert(u).concat(c/h.k));return function(t){if(1===t)t=h;else{var e=p(t),n=c/e[2];t=new $E(n,u[0]-e[0]*n,u[1]-e[1]*n)}a.zoom(null,t)}}))}function x(t,e,n){return!n&&t.__zooming||new k(t,e)}function k(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=i.apply(t,e),this.taps=0}function O(t,...e){if(r.apply(this,arguments)){var n=x(this,e).event(t),i=this.__zoom,s=Math.max(u[0],Math.min(u[1],i.k*Math.pow(2,a.apply(this,arguments)))),l=Yi(t);if(n.wheel)n.mouse[0][0]===l[0]&&n.mouse[0][1]===l[1]||(n.mouse[1]=i.invert(n.mouse[0]=l)),clearTimeout(n.wheel);else{if(i.k===s)return;n.mouse=[l,i.invert(l)],Eo(this),n.start()}zE(t),n.wheel=setTimeout((function(){n.wheel=null,n.end()}),d),n.zoom("mouse",o(b(v(i,s),n.mouse[0],n.mouse[1]),n.extent,c))}}function S(t,...e){if(!n&&r.apply(this,arguments)){var i=t.currentTarget,a=x(this,e,!0).event(t),s=Lr(t.view).on("mousemove.zoom",(function(t){if(zE(t),!a.moved){var e=t.clientX-l,n=t.clientY-f;a.moved=e*e+n*n>m}a.event(t).zoom("mouse",o(b(a.that.__zoom,a.mouse[0]=Yi(t,i),a.mouse[1]),a.extent,c))}),!0).on("mouseup.zoom",(function(t){s.on("mousemove.zoom mouseup.zoom",null),$r(t.view,a.moved),zE(t),a.event(t).end()}),!0),u=Yi(t,i),l=t.clientX,f=t.clientY;Fr(t.view),KE(t),a.mouse=[u,this.__zoom.invert(u)],Eo(this),a.start()}}function E(t,...e){if(r.apply(this,arguments)){var n=this.__zoom,a=Yi(t.changedTouches?t.changedTouches[0]:t,this),s=n.invert(a),u=n.k*(t.shiftKey?.5:2),f=o(b(v(n,u),a,s),i.apply(this,e),c);zE(t),l>0?Lr(this).transition().duration(l).call(w,f,a,t):Lr(this).call(g.transform,f,a,t)}}function A(n,...i){if(r.apply(this,arguments)){var o,a,s,u,c=n.touches,l=c.length,f=x(this,i,n.changedTouches.length===l).event(n);for(KE(n),a=0;a g").attr("transform","".concat(i," ").concat(o))}},{key:"getSourcesId",value:function(t){return this.pluginData.scene.selection.includes(t.subject.datum().data.id)?this.pluginData.scene.selection:[t.subject.datum().data.id]}},{key:"getSourcePosition",value:function(t){var e=this.viewport.select(".".concat(t," .model"));return{x:parseFloat(e.attr("x")),y:parseFloat(e.attr("y"))}}},{key:"getTargetsByDepth",value:function(t){var e=this,n=t.subject.datum().data.id,r=t.sourceEvent,i=r.clientX,o=r.clientY,a=[];return this.viewport.selectAll("g.component.container:not(.".concat(n,")")).each((function(t){var n=e.viewport.select(".".concat(t.data.id," .background")).node().getBoundingClientRect(),r=n.x,s=n.y,u=n.width,c=n.height;if(i>=r&&i<=r+u&&o>=s&&o<=s+c){for(var l=parseInt(e.viewport.select(".".concat(t.data.id)).attr("depth"),10)-1;a.length<=l;)a.push([]);a[l].push(t.data.id)}})),a}},{key:"getTargetsId",value:function(t){return this.getTargetsByDepth(t).flat().reverse()}},{key:"getTargetId",value:function(t){return this.getTargetsId(t)[0]}},{key:"getTransform",value:function(t,e){var n=this.viewport.select(t).node().getBoundingClientRect(),r=n.x,i=n.y,o=this.viewport.select(e).node().getBoundingClientRect();return{dx:r-o.x,dy:i-o.y}}}],e&&function(t,e){for(var n=0;nf?p:f),r.attr("height",d>h?d:h);var m=this.viewport.select(".".concat(e.data.id," .components-background")),y=m.node().getBoundingClientRect();return f=Math.max((a-y.x)/n,e.data.definition.minWidth-e.data.definition.reservedWidth),h=Math.max((s-y.y)/n,e.data.definition.minHeight-e.data.definition.reservedHeight),p=(c-y.x)/n,d=(l-y.y)/n,m.attr("width",p>f?p:f),m.attr("height",d>h?d:h),!1}},{key:"finalize",value:function(t){var e=t.subject.datum().data.id,n=this.viewport.select(".".concat(e," .model")),r=this.pluginData.getComponentById(e);return r.drawOption.width=parseFloat(n.attr("width")),r.drawOption.height=parseFloat(n.attr("height")),this.pluginData.emitEvent({components:[e],type:"Drawer",action:"resize",status:"success"}),!0}},{key:"getMaxPosition",value:function(t){var e=this,n=this.pluginData.getComponentById(t),r=0,i=0;return this.pluginData.getChildren(t).forEach((function(t){var o=e.viewport.select(".".concat(t.id," .model")).node().getBoundingClientRect(),a=o.x,s=o.y,u=o.width,c=o.height;r=Math.max(r,a+u+n.definition.margin),i=Math.max(i,s+c+n.definition.margin)})),{x:r,y:i}}}],r&&function(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=Array(e);nt.length)&&(e=t.length);for(var n=0,r=Array(e);n0,hasWarning:r>0,numberOfErrors:n,numberOfWarnings:r,hasX:!!t.drawOption.x,hasY:!!t.drawOption.y,isSelected:this.pluginData.scene.selection.includes(t.id),getIcon:function(t){return e.pluginData.resources.icons[t]},canHaveLink:this.pluginData.canHaveLink(t.definition.type),getAttribute:function(e){return t.attributes.find((function(t){return t.name===e}))}})}}],e&&function(t,e){for(var n=0;n0&&this.pluginData.emitEvent({components:o,type:"Drawer",action:"move",status:"success"}),a.length>0&&this.pluginData.emitEvent({components:a,type:"Drawer",action:"resize",status:"success"}),!0}},{key:"getNodes",value:function(){var t=this,e={id:"root",parent:null,children:[],depth:0,type:"default",isContainer:!0,margin:this.pluginData.configuration.rootContainer.margin,gap:this.pluginData.configuration.rootContainer.gap},n=new Map(this.pluginData.components.map((function(e){return[e.id,t.createNode(e)]})));return n.set("root",e),n.forEach((function(t){if(t.parent){var e=n.get(t.parent);t.parent=e,e.children.push(t)}})),n}},{key:"createNode",value:function(t){return{id:t.id,parent:t.getContainerId()||"root",type:t.definition.displayType||"default",direction:t.definition.workflowDirection,children:[],depth:this.pluginData.getComponentDepth(t.id)+1,isContainer:t.definition.isContainer,width:t.definition.defaultWidth,height:t.definition.defaultHeight,minWidth:t.definition.minWidth,minHeight:t.definition.minHeight,reservedWidth:t.definition.reservedWidth,reservedHeight:t.definition.reservedHeight,margin:t.definition.margin,gap:t.definition.gap,x:t.drawOption.x,y:t.drawOption.y}}},{key:"generateLayout",value:function(t,e,n){var r=this;e.children.forEach((function(e){r.generateLayout(t,e,n)})),e.isContainer&&"default"===e.type?this.generateDefaultLayout(e,n):e.isContainer&&this.generateWorkflowLayout(t,e)}},{key:"generateDefaultLayout",value:function(t,e){this.text=0;var n=[],r=[],i=t.margin,o=t.gap,a=t.minWidth,s=t.minHeight,u=t.reservedWidth,c=t.reservedHeight,l=0,f=0;t.children.forEach((function(t){t.x&&t.y&&e?(n.push(t),l=Math.max(t.x+t.width,l),f=Math.max(t.y+t.height,f)):r.push(t)}));for(var h,p=0,d=0,m=this.getPoints(p,i,o);r.length>0;)h||(h=r[0]),0===m.length&&(d=0,p+=1,m=this.getPoints(p,i,o)),m.length>0&&this.canBePlaced(n,h,m[d])&&(h.x=m[d].x,h.y=m[d].y,l=Math.max(h.x+h.width,l),f=Math.max(h.y+h.height,f),n.push(h),r.shift(),h=null),(d+=1)>=m.length&&(d=0,p+=1,m=this.getPoints(p,i,o));t.width=Math.max(l+i+u,a),t.height=Math.max(f+i+c,s)}},{key:"canBePlaced",value:function(t,e,n){return t.every((function(t){var r=t.x,i=t.y,o=t.width,a=t.height,s=n.x+e.widthr+o,c=n.y+e.heighti+a;return s||u||c||l}))}},{key:"getPoints",value:function(t,e,n){if(0===t)return[{x:e,y:e}];for(var r=e+n*t,i=e+n*t,o=[],a=e,s=e;s<=r&&(s!==r||i!==a);)o.push({x:s,y:i}),s+=n,o.push({x:r,y:a}),a+=n;return o.push({x:r,y:i}),o}},{key:"generateWorkflowLayout",value:function(t,e){"vertical"===e.direction?this.generateVerticalWorkflowLayout(t,e):this.generateHorizontalWorkflowLayout(t,e)}},{key:"generateHorizontalWorkflowLayout",value:function(t,e){var n=e.margin,r=e.gap,i=e.minWidth,o=e.minHeight,a=e.reservedWidth,s=e.reservedHeight,u=n,c=0;e.children.forEach((function(t){t.x=u,t.y=n,u=t.x+t.width+r,t.height>c&&(c=t.height)})),e.width=Math.max(u-r+n+a,i),e.height=Math.max(c+2*n+s,o)}},{key:"generateVerticalWorkflowLayout",value:function(t,e){var n=e.margin,r=e.gap,i=e.minWidth,o=e.minHeight,a=e.reservedWidth,s=e.reservedHeight,u=n,c=0;e.children.forEach((function(t){t.x=n,t.y=u,u=t.y+t.height+r,t.width>c&&(c=t.width)})),e.width=Math.max(c+2*n+a,i),e.height=Math.max(u-r+n+s,o)}},{key:"resize",value:function(t){var e=this.pluginData.getComponentById(t);if(!e.definition.isContainer)return!1;var n=0,r=0;this.pluginData.getChildren(t).forEach((function(t){var e=t.drawOption.x+t.drawOption.width,i=t.drawOption.y+t.drawOption.height;e>n&&(n=e),i>r&&(r=i)}));var i=e.definition,o=i.minWidth,a=i.minHeight,s=i.reservedWidth,u=i.reservedHeight,c=i.margin,l=Math.max(n+2*c+s,o),f=Math.max(r+2*c+u,a);return l===e.drawOption.width&&f===e.drawOption.height||(e.drawOption.width=l,e.drawOption.height=f,this.pluginData.emitEvent({components:[t],type:"Drawer",action:"resize",status:"success"})),!0}}],r&&function(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=Array(e);n=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),N(n),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;N(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:C(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},e}function uN(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function cN(t){var e=function(t){if("object"!=eN(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=eN(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==eN(e)?e:e+""}var lN=function(){return e=function e(n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.pluginData=n,this.componentRenderer=null,this.linkRenderer=null,this.layout=null,this.viewport=null,this.scene=null,this.d3=t,this.actions={deleteAction:null,dragComponent:null,dragScene:null,linkAction:null,menuAction:null,resizeComponent:null,toggleSelection:null,selectionAll:null,deselectionAll:null,zoom:null},this.states={linking:!1,menuOpening:!1,moving:!1,resizing:!1,selection:!1},this.readOnly=!1},n=[{key:"init",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.d3.select("#".concat(t)).selectAll(null).remove(),this.d3.select("#".concat(t)).html(""),this.viewport=this.d3.select("#".concat(t)),this.componentRenderer=this.initComponentRenderer(e),this.linkRenderer=this.initLinkRenderer(e),this.layout=new tN(this.pluginData,this.viewport),this.readOnly=e,this.clearActions(),this.readOnly&&(this.pluginData.scene.x=0,this.pluginData.scene.y=0,this.pluginData.scene.zoom=1),this.initActions(),this.initScene()}},{key:"initComponentRenderer",value:function(t){return new FT(this.pluginData,this.viewport,t)}},{key:"initLinkRenderer",value:function(t){return new KT(this.pluginData,this.viewport,t)}},{key:"clearActions",value:function(){this.actions.deleteAction=null,this.actions.dragComponent=null,this.actions.dragScene=null,this.actions.menuAction=null,this.actions.resizeComponent=null,this.actions.toggleSelection=null,this.actions.selectionAll=null,this.actions.deselectionAll=null,this.actions.zoom=null,this.viewport.on("wheel",null),this.d3.select("body").on("keydown",null).on("keyup",null),this.viewport.on(".drag",null)}},{key:"initActions",value:function(){var t=this;this.actions.selectionAll=new kT(this.pluginData,this.viewport,this.layout),this.actions.deleteAction=new cA(this.pluginData,this.viewport,this.layout),this.actions.dragScene=new SA(this.pluginData,this.viewport,this.layout),this.actions.menuAction=new qA(this.pluginData,this.viewport,this.layout),this.actions.link=new PA(this.pluginData,this.viewport,this.layout),this.actions.zoom=new CT(this.pluginData,this.viewport,this.layout),this.actions.dragComponent=new gA(this.pluginData,this.viewport,this.layout),this.actions.resizeComponent=new GA(this.pluginData,this.viewport,this.layout),this.actions.toggleSelection=new oT(this.pluginData,this.viewport,this.layout),this.actions.deselectionAll=new pT(this.pluginData,this.viewport,this.layout),this.viewport.on("wheel",(function(e){t.actions.zoom.execute(e)&&t.draw()})),this.readOnly||this.d3.select("body").on("keydown",(function(e){var n=!1;t.pluginData.configuration.keysBinding.selection.includes(e.key)&&(t.states.selection=!0),t.pluginData.configuration.keysBinding.deleteObject.includes(e.key)&&(n=t.actions.deleteAction.execute(e)),t.pluginData.configuration.keysBinding.selectAll.includes(e.key)&&(n=t.actions.selectionAll.execute(e)),t.pluginData.configuration.keysBinding.deselectAll.includes(e.key)&&(n=t.actions.deselectionAll.execute(e)),n&&t.draw()})).on("keyup",(function(e){var n=!1;t.pluginData.configuration.keysBinding.selection.includes(e.key)&&(t.states.selection=!1),t.pluginData.configuration.keysBinding.deleteObject.includes(e.key)&&(n=t.actions.deleteAction.finalize(e)),t.pluginData.configuration.keysBinding.selectAll.includes(e.key)&&(n=t.actions.selectionAll.finalize(e)),t.pluginData.configuration.keysBinding.deselectAll.includes(e.key)&&(n=t.actions.deselectionAll.finalize(e)),n&&t.draw()}));var e=this.d3.drag().subject((function(e){var n=e.sourceEvent.target.closest(".component");if(t.states.resizing=!!e.sourceEvent.target.closest(".resize-button"),t.states.menuOpening=!!e.sourceEvent.target.closest(".menu-button"),!n)return t.scene;var r=t.viewport.select(Array.from(n.classList).map((function(t){return".".concat(t)})).join(""));return t.states.linking=!!e.sourceEvent.target.closest(".anchor")&&t.pluginData.canHaveLink(r.datum().data.definition.type),r})).on("drag",(function(e){t.states.moving=!0;var n="scene"===e.subject.datum().data.id,r=!1;t.readOnly?t.actions.dragScene.execute(e):(n?r=t.actions.dragScene.execute(e):t.states.linking?(r=t.actions.link.execute(e),t.linkRenderer.render()):t.states.resizing?(r=t.actions.resizeComponent.execute(e),t.linkRenderer.render()):(r=t.actions.dragComponent.execute(e),t.linkRenderer.render()),r&&t.draw())})).on("end",function(){var e,n=(e=sN().mark((function e(n){var r,i,o,a,s,u,c;return sN().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.states.moving,i=t.states.selection,o=t.states.menuOpening,a=t.states.resizing,s=t.states.linking,u="scene"===n.subject.datum().data.id,c=!1,!t.readOnly){e.next=10;break}return u&&r&&t.actions.dragScene.finalize(n),e.abrupt("return");case 10:s?c=t.actions.link.finalize(n):r&&u?c=t.actions.dragScene.finalize(n):a?c=t.actions.resizeComponent.finalize(n):r&&!u?c=t.actions.dragComponent.finalize(n):!r&&o?c=t.actions.menuAction.finalize(n):r||u||!i||(c=t.actions.toggleSelection.finalize(n)),c&&t.draw(),t.states.moving=!1;case 13:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(t){uN(o,r,i,a,s,"next",t)}function s(t){uN(o,r,i,a,s,"throw",t)}a(void 0)}))});return function(t){return n.apply(this,arguments)}}());this.viewport.call(e)}},{key:"getScene",value:function(){return this.viewport.selectAll(".scene").data(this.getSceneData()).join("svg").attr("class","scene").attr("width","100%").attr("height","100%")}},{key:"initScene",value:function(){var t=this;this.viewport.append("style").text(this.pluginData.resources.style),this.scene=this.getScene(),this.scene.attr("version","1.1"),this.scene.attr("xmlns","http://www.w3.org/2000/svg"),this.scene.append("defs").html(Object.keys(this.pluginData.resources.markers).map((function(e){return t.pluginData.resources.markers[e]})).join(""));var e=this.pluginData.scene,n=e.x,r=e.y,i=e.zoom,o="translate(".concat(n," ").concat(r,") scale(").concat(i,")");this.scene.append("g").attr("class","components").attr("transform",o),this.scene.append("g").attr("class","links").attr("transform",o)}},{key:"draw",value:function(){if(this.scene=this.getScene(),this.componentRenderer.render("scene"),this.linkRenderer.render("scene"),this.readOnly){for(var t=this.viewport.node().getBoundingClientRect(),e=t.width,n=t.height,r=this.viewport.select(".scene .components").node().getBBox(),i=r.width,o=r.height,a=r.x,s=r.y,u=e/iu;)c*=.9;this.scene.attr("viewBox","".concat(a-15," ").concat(s-15," ").concat(i+a+15," ").concat(o+s+15)),this.pluginData.scene.zoom=c}}},{key:"arrangeComponentsPosition",value:function(t,e){this.layout.generateComponentsLayout(t,e)}},{key:"resize",value:function(t){this.layout.resize(t)}},{key:"getSceneData",value:function(){var t=this;return[this.d3.hierarchy(oN({id:"scene",name:"",children:nN(this.pluginData.components.filter((function(t){return null===t.getContainerId()})))},this.pluginData.scene),(function(e){return"scene"===e.id?e.children:t.pluginData.getChildren(e.id)}))]}},{key:"dropComponent",value:function(t,e){var n=e.target.closest(".component");if(t.drawOption.width=t.definition.width,t.drawOption.height=t.definition.height,!n){var r=this.viewport.select(".scene").node().getBoundingClientRect(),i=r.x,o=r.y;return t.drawOption.x=(e.clientX-i-this.pluginData.scene.x)/this.pluginData.scene.zoom-t.definition.defaultWidth/2,void(t.drawOption.y=(e.clientY-o-this.pluginData.scene.y)/this.pluginData.scene.zoom-t.definition.defaultHeight/2)}if(n.canContain(t.definition.type)){var a=this.viewport.select(".".concat(t.id,".container")).node().getBoundingClientRect(),s=a.x,u=a.y;t.drawOption.x=(e.clientX-s-this.pluginData.scene.x)/this.pluginData.scene.zoom-t.definition.defaultWidth/2,t.drawOption.y=(e.clientY-u-this.pluginData.scene.y)/this.pluginData.scene.zoom-t.definition.defaultHeight/2}}},{key:"exportSvg",value:function(t){return this.viewport.selectAll(".scene > g").attr("transform",""),document.querySelector("#".concat(t," .scene")).outerHTML}}],n&&function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:[]).map((function(t){return t.path}))}},{key:"parseConfiguration",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=this.pluginData.emitEvent({parent:r,type:"Parser",action:"read",status:"running",files:[e.path],data:{global:!1}});if(null!=e.content){var o=JSON.parse(e.content);o[t.path]?o[t.path][this.pluginData.name]?(Object.keys(o[t.path][this.pluginData.name]).forEach((function(e){var r=n.pluginData.getComponentByConfigurationKey(e);r&&o[t.path][n.pluginData.name][e]&&(r.drawOption=new g(o[t.path][n.pluginData.name][e]))})),this.pluginData.emitEvent({id:i,status:"success"})):this.pluginData.emitEvent({id:i,status:"warning",data:{code:"no_plugin_content",global:!1}}):this.pluginData.emitEvent({id:i,status:"warning",data:{code:"no_diagram_content",global:!1}})}else this.pluginData.emitEvent({id:i,status:"warning",data:{code:"no_content",global:!1}})}},{key:"isParsable",value:function(t){return null!=t}}],e&&function(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null,e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((function(t,e){return t[e.path]="",t}),{});return this.renderFiles(t).forEach((function(t){e[t.path]=t.content})),Object.keys(e).map((function(t){return new G({path:t,content:e[t]})}))}},{key:"renderFiles",value:function(){return[]}},{key:"renderConfiguration",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=this.pluginData.emitEvent({parent:r,type:"Render",action:"write",status:"running",files:[e.path],data:{global:!1}}),o=JSON.parse(e.content)||{};o[t.path]||(o[t.path]={}),o[t.path][this.pluginData.name]={},this.pluginData.components.filter((function(t){return t.drawOption})).forEach((function(e){var r=e.getConfigurationKey();o[t.path][n.pluginData.name][r]=e.drawOption})),e.content=JSON.stringify(o,(function(t,e){return null===e?void 0:e}),2),this.pluginData.emitEvent({id:i,status:"success"})}}],e&&function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{id:null,parentId:null,files:null,components:null,links:null,type:null,action:null,status:null,data:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.id,r=e.parentId,i=e.files,o=e.components,a=e.links,s=e.type,u=e.action,c=e.status,l=e.data;this.id=n||null,this.parentId=r||null,this.startDate=null,this.endDate=null,this.files=i||null,this.components=o||null,this.links=a||null,this.type=s||null,this.action=u||null,this.status=c||null,this.data=l||null}));const SN=ON;function EN(t){return EN="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},EN(t)}function AN(t,e,n){return e=NN(e),function(t,e){if(e&&("object"==EN(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,TN()?Reflect.construct(e,n||[],NN(t).constructor):e.apply(t,n))}function TN(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(TN=function(){return!!t})()}function NN(t){return NN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},NN(t)}function MN(t,e){return MN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},MN(t,e)}var CN=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{anchorName:null};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=AN(this,e,[n])).anchorName=n.anchorName||null,t.endX=null,t.endY=null,t.isTemporary=!0,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&MN(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}($);const jN=CN;function PN(t){return PN="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},PN(t)}function LN(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n1&&void 0!==arguments[1]?arguments[1]:{name:null,version:null,components:[],variables:[],definitions:{components:[],links:[]},parseLogs:[],resources:{},scene:{x:0,y:0,zoom:1,selection:[],selectionRef:null}},m=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.name=d.name||null,this.version=d.version||null,this.components=d.components||[],this.scene={x:(null===(n=d.scene)||void 0===n?void 0:n.x)||0,y:(null===(r=d.scene)||void 0===r?void 0:r.y)||0,zoom:(null===(i=d.scene)||void 0===i?void 0:i.zoom)||1,selection:(null===(o=d.scene)||void 0===o?void 0:o.selection)||[],selectionRef:(null===(a=d.scene)||void 0===a?void 0:a.selectionRef)||null},this.variables=d.variables||[],this.definitions={components:(null===(s=d.definitions)||void 0===s?void 0:s.components)||[],links:(null===(u=d.definitions)||void 0===u?void 0:u.links)||[]},this.parseLogs=d.parseLogs||[],this.__eventIndex=0,this.eventManager=m,this.eventLogs=[],this.configuration=e,this.resources={icons:DN({},null===(c=d.resources)||void 0===c?void 0:c.icons),markers:DN({},null===(l=d.resources)||void 0===l?void 0:l.markers),links:DN({},null===(f=d.resources)||void 0===f?void 0:f.links),models:DN({},null===(h=d.resources)||void 0===h?void 0:h.models),style:(null===(p=d.resources)||void 0===p?void 0:p.style)||""},this.temporaryLink=null},e=[{key:"coreVersion",get:function(){return"0.28.0"}},{key:"getComponentById",value:function(t){return this.components.find((function(e){return e.id===t}))||null}},{key:"getComponentDepth",value:function(t){var e=this.getComponentById(t).getContainerId();return e?this.getComponentDepth(e)+1:0}},{key:"getComponentByConfigurationKey",value:function(t){return this.getComponentById(t)}},{key:"renameComponentExternalId",value:function(t,e){this.getComponentById(t).setExternalId(e)}},{key:"getComponentsByType",value:function(t){return this.components.filter((function(e){var n=e.definition;return n&&n.type===t}))}},{key:"addComponent",value:function(t,e){var n=this.generateComponentId();return this.components.push(new S({id:n,name:n,definition:t,path:e})),n}},{key:"generateComponentId",value:function(){var t=this.components.map((function(t){return t.id})).filter((function(t){return new RegExp("".concat("id_","\\d+")).test(t)})).map((function(t){return parseInt(t.substring(3),10)})),e=0===t.length?1:Math.max.apply(Math,function(t){return function(t){if(Array.isArray(t))return LN(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return LN(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?LN(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t))+1;return"".concat("id_").concat(e)}},{key:"removeComponentById",value:function(t){var e=this;this.getChildren(t).forEach((function(t){return e.removeComponentById(t.id)})),this.components=this.components.filter((function(e){return e.id!==t})),this.components.forEach((function(e){e.removeLinkAttribute(t)}))}},{key:"removeLink",value:function(t){var e=t.source,n=t.target,r=t.definition.attributeRef;this.getComponentById(e).removeLinkAttribute(n,r)}},{key:"getLinks",value:function(){var t=this,e=[];return this.definitions.links.forEach((function(n){t.getComponentsByType(n.sourceRef).forEach((function(r){var i=r.getAttributeByName(n.attributeRef);i&&t.getLinkedComponentsIds(i).forEach((function(t){return e.push(new $({definition:n,source:r.id,target:t,isReverse:"Reverse"===i.definition.linkType}))}))}))})),this.temporaryLink&&e.push(this.temporaryLink),e.concat(this.getWorkflowLinks())}},{key:"getAttributeValue",value:function(t){return t.isVariable?this.getVariableValue(t.value):t.value}},{key:"getLinkedComponentsIds",value:function(t){var e=this.getAttributeValue(t);return null===e?[]:Array.isArray(e)?e:[e]}},{key:"getVariableValue",value:function(t){var e;return(null===(e=this.variables.find((function(e){return e.name===t})))||void 0===e?void 0:e.value)||null}},{key:"setVariableValue",value:function(t,e){var n=this.variables.find((function(e){return e.name===t}));n&&(n.value=e)}},{key:"getComponentIdFromValue",value:function(t){return t}},{key:"canHaveLink",value:function(t){return this.definitions.links.some((function(e){return e.sourceRef===t}))}},{key:"canBeLinked",value:function(t,e){return this.definitions.links.some((function(n){var r=n.sourceRef,i=n.targetRef;return r===t&&i===e}))}},{key:"createTemporaryLink",value:function(t,e){this.temporaryLink=new jN({anchorName:e,source:t,definition:this.definitions.links.find((function(t){return t.isTemporary}))})}},{key:"getWorkflowLinks",value:function(){var t=this;return this.components.filter((function(t){var e;return null===(e=t.definition.displayType)||void 0===e?void 0:e.match("workflow")})).reduce((function(e,n){var r=t.getChildren(n.id);if(r.length>1)for(var i=0;in,this.components.splice(i,0,r),this.components.splice(n+(it}))}},{key:"emitEvent",value:function(){var t,e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.id;return r?(e=this.getEventLogById(r),Object.keys(n).forEach((function(t){e[t]=n[t]}))):(this.__eventIndex+=1,r=this.__eventIndex,(e=new SN(DN(DN({},n),{},{id:r}))).startDate=Date.now(),this.eventLogs.push(e)),["success","warning","error"].includes(e.status)&&(e.endDate=Date.now()),null!==(t=this.eventManager)&&void 0!==t&&t.next&&this.eventManager.next({plugin:this.name,event:DN({},e)}),r}}],e&&function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{editor:{syntax:null},restrictiveFolder:null,defaultFileName:null,defaultFileExtension:null,tags:[],isFolderTypeDiagram:!0,extraResources:[],rootContainer:{margin:30,gap:50},container:{margin:30,gap:50},keysBinding:{},i18n:{}};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.editor=KN({syntax:null},a.editor),this.restrictiveFolder=a.restrictiveFolder||null,this.defaultFileName=a.defaultFileName||null,this.defaultFileExtension=a.defaultFileExtension||null,this.tags=a.tags||[],this.isFolderTypeDiagram=null===(e=a.isFolderTypeDiagram)||void 0===e||e,this.extraResources=a.extraResources||[],this.rootContainer={margin:(null===(n=a.rootContainer)||void 0===n?void 0:n.margin)||30,gap:(null===(r=a.rootContainer)||void 0===r?void 0:r.gap)||50},this.container={margin:(null===(i=a.container)||void 0===i?void 0:i.margin)||30,gap:(null===(o=a.container)||void 0===o?void 0:o.gap)||50},this.keysBinding=KN({moveSceneUp:["ArrowUp"],moveSceneDown:["ArrowDown"],moveSceneLeft:["ArrowLeft"],moveSceneRight:["ArrowRight"],moveComponentUp:[],moveComponentDown:[],moveComponentLeft:[],moveComponentRight:[],zoomIn:["+"],zoomOut:["-"],deleteObject:["Delete"],editComponent:[",","?"],selection:["Shift"],selectAll:["A"],deselectAll:["D"]},a.keysBinding),this.i18n=a.i18n||{}}));const HN=YN;function WN(t){return WN="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},WN(t)}function GN(t){var e=function(t){if("object"!=WN(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=WN(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==WN(e)?e:e+""}var JN=function(){return t=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{event:null,configuration:null,pluginData:null,pluginDrawer:null,pluginMetadata:null,pluginParser:null,pluginRenderer:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.configuration=e.configuration||new HN,this.data=e.pluginData||new $N(this.configuration,{},e.event),this.__drawer=e.pluginDrawer||new fN(this.data),this.__metadata=e.pluginMetadata||new mN(this.data),this.__parser=e.pluginParser||new bN(this.data),this.__renderer=e.pluginRenderer||new kN(this.data)},e=[{key:"init",value:function(){var t=this.data.emitEvent({type:"Plugin",action:"init",status:"running"});this.__metadata.parse(t),this.data.initLinkDefinitions(t),this.data.emitEvent({id:t,status:"success"})}},{key:"initResources",value:function(t){this.data.resources=t}},{key:"initDrawer",value:function(t,e){this.__drawer.init(t,e)}},{key:"draw",value:function(){this.__drawer.draw()}},{key:"parse",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=this.data.emitEvent({type:"Parser",action:"read",status:"running",files:n.map((function(t){return t.path})).concat(null==e?void 0:e.path),data:{global:!0}});this.__parser.parse(t,n,r),this.__parser.parseConfiguration(t,e,r),this.data.emitEvent({id:r,status:"success"})}},{key:"isParsable",value:function(t){return this.__parser.isParsable(t)}},{key:"getModels",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.__parser.getModels(e.filter((function(e){return t.isParsable(e)})))}},{key:"render",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=this.data.emitEvent({type:"Render",action:"write",status:"running",files:n.map((function(t){return t.path})).concat(e.path),data:{global:!0}});this.__renderer.renderConfiguration(t,e,r);var i=this.__renderer.render(n,r).concat(e);return this.data.emitEvent({id:r,status:"success"}),i}},{key:"arrangeComponentsPosition",value:function(t,e){this.__drawer.arrangeComponentsPosition(t,e)}},{key:"resize",value:function(t){this.__drawer.resize(t)}},{key:"exportSvg",value:function(t){this.__drawer.init(t,!0),this.draw();var e=this.__drawer.exportSvg(t);return this.__drawer.init(t,!1),this.draw(),e}},{key:"getComponentPosition",value:function(t,e){var n=e.x,r=e.y,i=this.__drawer.actions.zoom,o=i.scale,a=i.translate,s=document.querySelector("#".concat(t)).getBoundingClientRect(),u=s.left,c=s.top;return{x:(n-u-a.x)/o,y:(r-c-a.y)/o}}},{key:"addComponent",value:function(t,e,n,r){var i=this.data.addComponent(e,n),o=this.data.getComponentById(i);if(t){var a=this.data.getComponentById(t);o.setReferenceAttribute(a)}return r&&this.__drawer.dropComponent(o,r),i}}],e&&function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{type:null,value:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.type,r=e.value;this.type=n||null,this.value=r||null}));const ZN=QN;function tM(t){return tM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tM(t)}function eM(t,e,n){return e=rM(e),function(t,e){if(e&&("object"==tM(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,nM()?Reflect.construct(e,n||[],rM(t).constructor):e.apply(t,n))}function nM(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(nM=function(){return!!t})()}function rM(t){return rM=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},rM(t)}function iM(t,e){return iM=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},iM(t,e)}var oM=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{name:null,type:null,value:null,category:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t=eM(this,e,[n]);var r=n.name,i=n.type,o=n.value,a=n.category;return t.__class="Variable",t.name=r||null,t.type=i||null,t.value=o||null,t.category=a||null,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&iM(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(m);const aM=oM})();var o=e;for(var a in i)o[a]=i[a];i.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r](o,o.exports,n),o.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{default:()=>Za});var t=n(149);function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function o(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{apiVersion:null,childrenIndex:[],ignoredAttributes:[]};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=E(this,e,[k(k({},n),{},{defaultWidth:n.isContainer?186:96,defaultHeight:n.isContainer?160:80,minWidth:n.isContainer?186:96,minHeight:n.isContainer?140:80,reservedWidth:n.isContainer?12:0,reservedHeight:n.isContainer?80:0,margin:15,gap:50,categories:["Kubernetes"]})])).apiVersion=n.apiVersion||null,t.childrenIndex=n.childrenIndex||[],t.ignoredAttributes=n.ignoredAttributes||[],t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&N(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(t.ComponentDefinition);function C(t){return C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},C(t)}function j(t,e,n){return e=L(e),function(t,e){if(e&&("object"==C(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,P()?Reflect.construct(e,n||[],L(t).constructor):e.apply(t,n))}function P(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(P=function(){return!!t})()}function L(t){return L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},L(t)}function I(t,e){return I=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},I(t,e)}const D=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{ignoredAttributes:[]};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=j(this,e,[n])).ignoredAttributes=n.ignoredAttributes||[],t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&I(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(t.ComponentAttributeDefinition),R={commonAttributes:JSON.parse('[{"name":"metadata","type":"Object","expanded":true,"ignoredAttributes":["creationTimestamp","deletionGracePeriodSeconds","deletionTimestamp","generation","name","resourceVersion","selfLink","uid"],"attributes":[{"name":"namespace","type":"String","description":"Namespace defines the space within which each name must be unique.
An empty namespace is equivalent to the \\"default\\" namespace, but \\"default\\" is the canonical representation.
Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.

Must be a DNS_LABEL. Cannot be updated.","url":"http://kubernetes.io/docs/user-guide/namespaces"},{"name":"labels","type":"Object","attributes":[{"name":"app.kubernetes.io/name","type":"String","description":"The name of the application."},{"name":"app.kubernetes.io/instance","type":"String","description":"A unique name identifying the instance of an application."},{"name":"app.kubernetes.io/version","type":"String","description":"The current version of the application (e.g., a SemVer 1.0, revision hash, etc.)."},{"name":"app.kubernetes.io/component","type":"String","description":"The component within the architecture."},{"name":"app.kubernetes.io/part-of","type":"String","description":"The name of a higher level application this one is part of."},{"name":"app.kubernetes.io/managed-by","type":"String","description":"The tool being used to manage the operation of an application."}]},{"name":"annotations","type":"Object"}]}]'),apiVersions:{"apps/v1":JSON.parse('[{"type":"Deployment","model":"DefaultContainer","icon":"resources/unlabeled/deploy","description":"A Deployment provides declarative updates for Pods and ReplicaSets.

You describe a desired state in a Deployment, and the Deployment Controller changes the actual state to the desired state at a controlled rate.
You can define Deployments to create new ReplicaSets, or to remove existing Deployments and adopt all their resources with new Deployments.","url":"https://kubernetes.io/docs/concepts/workloads/controllers/deployment/","isContainer":true,"childrenIndex":[{"attributeName":"template","componentType":"Pod"}],"attributes":[{"name":"spec","type":"Object","displayName":"Specification","expanded":true,"ignoredAttributes":["selector"],"attributes":[{"name":"replicas","type":"Number","description":"Number of desired pods.
This is a pointer to distinguish between explicit zero and not specified.
Defaults to 1."},{"name":"strategy","type":"Object","description":"The deployment strategy to use to replace existing pods with new ones.","attributes":[{"name":"type","type":"String","description":"Type of deployment.
Can be \\"Recreate\\" or \\"RollingUpdate\\".
Default is RollingUpdate.","rules":{"values":["RollingUpdate","Recreate"]}},{"name":"rollingUpdate","type":"Object","description":"Rolling update config params.
Present only if DeploymentStrategyType = RollingUpdate.","expanded":true,"attributes":[{"name":"maxSurge","type":"String","description":"The maximum number of pods that can be scheduled above the desired number of pods.
Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
This can not be 0 if MaxUnavailable is 0.
Absolute number is calculated from percentage by rounding up.
Defaults to 25%.
Example: when this is set to 30%, the new ReplicaSet can be scaled up immediately when the rolling update starts, such that the total number of old and new pods do not exceed 130% of desired pods.
Once old pods have been killed, new ReplicaSet can be scaled up further, ensuring that total number of pods running at any time during the update is at most 130% of desired pods."},{"name":"maxUnavailable","type":"String","description":"The maximum number of pods that can be unavailable during the update.
Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
Absolute number is calculated from percentage by rounding down.
This can not be 0 if MaxSurge is 0.
Defaults to 25%.
Example: when this is set to 30%, the old ReplicaSet can be scaled down to 70% of desired pods immediately when the rolling update starts.
Once new pods are ready, old ReplicaSet can be scaled down further, followed by scaling up the new ReplicaSet, ensuring that the total number of pods available at all times during the update is at least 70% of desired pods."}]}]},{"name":"revisionHistoryLimit","type":"Number","description":"The number of old ReplicaSets to retain to allow rollback.
This is a pointer to distinguish between explicit zero and not specified.
Defaults to 10."}]}]},{"type":"StatefulSet","model":"DefaultContainer","icon":"resources/unlabeled/sts","description":"StatefulSet is the workload API object used to manage stateful applications.

Manages the deployment and scaling of a set of Pods, and provides guarantees about the ordering and uniqueness of these Pods.

Like a Deployment, a StatefulSet manages Pods that are based on an identical container spec.
Unlike a Deployment, a StatefulSet maintains a sticky identity for each of their Pods.
These pods are created from the same spec, but are not interchangeable: each has a persistent identifier that it maintains across any rescheduling.

If you want to use storage volumes to provide persistence for your workload, you can use a StatefulSet as part of the solution.
Although individual Pods in a StatefulSet are susceptible to failure, the persistent Pod identifiers make it easier to match existing volumes to the new Pods that replace any that have failed.","url":"https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/","isContainer":true,"childrenIndex":[{"attributeName":"template","componentType":"Pod"}],"attributes":[{"name":"spec","type":"Object","displayName":"Specification","expanded":true,"ignoredAttributes":["selector"],"attributes":[]}]}]'),"batch/v1":JSON.parse('[{"type":"CronJob","model":"DefaultContainer","icon":"resources/unlabeled/cronjob","description":"A CronJob creates Jobs on a repeating schedule.

CronJob is meant for performing regular scheduled actions such as backups, report generation, and so on.
One CronJob object is like one line of a crontab (cron table) file on a Unix system.
It runs a job periodically on a given schedule, written in Cron format.

CronJobs have limitations and idiosyncrasies.
For example, in certain circumstances, a single CronJob can create multiple concurrent Jobs.
See the limitations below.

When the control plane creates new Jobs and (indirectly) Pods for a CronJob, the .metadata.name of the CronJob is part of the basis for naming those Pods.
The name of a CronJob must be a valid DNS subdomain value, but this can produce unexpected results for the Pod hostnames.
For best compatibility, the name should follow the more restrictive rules for a DNS label.
Even when the name is a DNS subdomain, the name must be no longer than 52 characters.
This is because the CronJob controller will automatically append 11 characters to the name you provide and there is a constraint that the length of a Job name is no more than 63 characters.","url":"https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/","isContainer":true,"childrenIndex":[{"attributeName":"jobTemplate","componentType":"Job"}],"attributes":[{"name":"spec","type":"Object","displayName":"Specification","expanded":true,"attributes":[]}]},{"type":"Job","model":"DefaultContainer","icon":"resources/unlabeled/job","isContainer":true,"parentTypes":["CronJob"],"childrenIndex":[{"attributeName":"template","componentType":"Pod"}],"attributes":[{"name":"parent","type":"Reference","containerRef":"CronJob"},{"name":"spec","type":"Object","displayName":"Specification","expanded":true,"ignoredAttributes":["selector"],"attributes":[]}]}]'),v1:JSON.parse('[{"type":"Pod","model":"DefaultContainer","icon":"resources/unlabeled/pod","parentTypes":["Deployment","StatefulSet","Job"],"isContainer":true,"childrenPerLine":3,"childrenIndex":[{"attributeName":"containers","componentType":"Container"},{"attributeName":"initContainers","componentType":"Container"}],"attributes":[{"name":"parentDeployment","type":"Reference","containerRef":"Deployment"},{"name":"parentStatefulSet","type":"Reference","containerRef":"StatefulSet"},{"name":"parentJob","type":"Reference","containerRef":"Job"},{"name":"spec","type":"Object","displayName":"Specification","expanded":true,"attributes":[{"name":"volumes","type":"Array","attributes":[{"name":null,"type":"Object","attributes":[{"name":"name","type":"String","required":true},{"name":"configMap","type":"Object","attributes":[{"name":"name","type":"Link","linkRef":"ConfigMap","linkModel":"defaultLink","required":true},{"name":"defaultMode","type":"Number"},{"name":"items","type":"Array","attributes":[{"name":null,"type":"Object","attributes":[{"name":"key","type":"String","required":true},{"name":"path","type":"String","required":true},{"name":"mode","type":"Number"}]}]},{"name":"optional","type":"Boolean"}]},{"name":"secret","type":"Object","attributes":[{"name":"secretName","type":"Link","linkRef":"Secret","linkModel":"defaultLink","required":true},{"name":"defaultMode","type":"Number"},{"name":"items","type":"Array","attributes":[{"name":null,"type":"Object","attributes":[{"name":"key","type":"String","required":true},{"name":"path","type":"String","required":true},{"name":"mode","type":"Number"}]}]},{"name":"optional","type":"Boolean"}]},{"name":"persistentVolumeClaim","type":"Object","attributes":[{"name":"claimName","type":"Link","linkRef":"PersistentVolumeClaim","linkModel":"defaultLink","required":true},{"name":"readOnly","type":"Boolean"}]}]}]},{"name":"topologySpreadConstraints","type":"Array","description":"TopologySpreadConstraints describes how a group of pods ought to spread across topology domains.
Scheduler will schedule pods in a way which abides by the constraints.
All topologySpreadConstraints are ANDed.","attributes":[{"name":null,"type":"Object","attributes":[{"name":"maxSkew","type":"Number","required":true},{"name":"minDomains","type":"Number"},{"name":"topologyKey","type":"String","required":true},{"name":"whenUnsatisfiable","type":"String","required":true,"rules":{"values":["DoNotSchedule","ScheduleAnyway"]}},{"name":"labelSelector","type":"Object","attributes":[{"name":"matchLabels","type":"Object","expanded":true},{"name":"matchExpressions","type":"Array","attributes":[{"name":null,"type":"Object","attributes":[{"name":"key","type":"String","required":true},{"name":"operator","type":"String","required":true},{"name":"values","type":"Array"}]}]}]}]}]}]}]},{"type":"Service","model":"DefaultModel","icon":"resources/unlabeled/svc","attributes":[{"name":"spec","type":"Object","displayName":"Specification","expanded":true,"attributes":[{"name":"type","type":"String","description":"type determines how the Service is exposed.
Defaults to ClusterIP.
Valid options are ExternalName, ClusterIP, NodePort, and LoadBalancer.
\\"ClusterIP\\" allocates a cluster-internal IP address for load-balancing to endpoints.
Endpoints are determined by the selector or if that is not specified, by manual construction of an Endpoints object or EndpointSlice objects.
If clusterIP is \\"None\\", no virtual IP is allocated and the endpoints are published as a set of endpoints rather than a virtual IP.
\\"NodePort\\" builds on ClusterIP and allocates a port on every node which routes to the same endpoints as the clusterIP.
\\"LoadBalancer\\" builds on NodePort and creates an external load-balancer (if supported in the current cloud) which routes to the same endpoints as the clusterIP.
\\"ExternalName\\" aliases this service to the specified externalName.
Several other fields do not apply to ExternalName services.","url":"https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types","rules":{"values":["ClusterIP","NodePort","LoadBalancer","ExternalName"]}},{"name":"selector","type":"Link","linkRef":"Pod","linkModel":"defaultLink"},{"name":"ports","type":"Array","attributes":[{"name":null,"type":"Object","attributes":[{"name":"name","type":"String"},{"name":"protocol","type":"String","rules":{"values":["TCP","UDP","SCTP"]}},{"name":"port","type":"Number","required":true},{"name":"targetPort","type":"String"}]}]}]}]},{"type":"ConfigMap","model":"DefaultModel","icon":"resources/unlabeled/cm","attributes":[{"name":"data","type":"Object","expanded":true},{"name":"binaryData","type":"Object"},{"name":"immutable","type":"Boolean"}]},{"type":"Secret","model":"DefaultModel","icon":"resources/unlabeled/secret","attributes":[{"name":"type","type":"String","rules":{"values":["Opaque","kubernetes.io/service-account-token","kubernetes.io/dockercfg","kubernetes.io/dockerconfigjson","kubernetes.io/basic-auth","kubernetes.io/ssh-auth","kubernetes.io/tls","bootstrap.kubernetes.io/token"]}},{"name":"stringData","type":"Object","expanded":true},{"name":"data","type":"Object"},{"name":"immutable","type":"Boolean"}]},{"type":"PersistentVolumeClaim","model":"DefaultModel","icon":"resources/unlabeled/pvc","attributes":[{"name":"spec","type":"Object","displayName":"Specification","expanded":true,"attributes":[{"name":"storageClassName","type":"String"},{"name":"accessModes","type":"Array"},{"name":"volumeMode","type":"String","rules":{"values":["Filesystem","Block"]}},{"name":"resources","type":"Object","attributes":[{"name":"requests","type":"Object","expanded":true,"attributes":[{"name":"storage","type":"String"}]},{"name":"limits","type":"Object","expanded":true,"attributes":[{"name":"storage","type":"String"}]}]},{"name":"volumeName","type":"String"},{"name":"selector","type":"Object","attributes":[{"name":"matchLabels","type":"Object","expanded":true}]}]}]}]'),"networking.k8s.io/v1":JSON.parse('[{"type":"Ingress","model":"DefaultModel","icon":"resources/unlabeled/ing","attributes":[{"name":"spec","type":"Object","displayName":"Specification","expanded":true,"attributes":[{"name":"ingressClassName","type":"String","description":"ingressClassName is the name of an IngressClass cluster resource.
Ingress controller implementations use this field to know whether they should be serving this Ingress resource, by a transitive connection (controller -> IngressClass -> Ingress resource).
Although the `kubernetes.io/ingress.class` annotation (simple constant name) was never formally defined, it was widely supported by Ingress controllers to create a direct binding between Ingress controller and Ingress resources.
Newly created Ingress resources should prefer using the field.
However, even though the annotation is officially deprecated, for backwards compatibility reasons, ingress controllers should still honor that annotation if present."},{"name":"defaultBackend","type":"Object","description":"DefaultBackend is the backend that should handle requests that don\'t match any rule.
If Rules are not specified, DefaultBackend must be specified.
If DefaultBackend is not set, the handling of requests that do not match any of the rules will be up to the Ingress controller.","expanded":true,"attributes":[{"name":"service","type":"Object","expanded":true,"attributes":[{"name":"name","type":"Link","linkRef":"Service","linkModel":"defaultLink","required":true},{"name":"port","type":"Object","expanded":true,"attributes":[{"name":"name","type":"String","description":"Name is the name of the port on the Service.
This is a mutually exclusive setting with \\"Number\\"."},{"name":"number","type":"Number","description":"Number is the numerical port number (e.g. 80) on the Service.
This is a mutually exclusive setting with \\"Name\\"."}]}]}]},{"name":"rules","type":"Array","description":"A list of host rules used to configure the Ingress.
If unspecified, or no rule matches, all traffic is sent to the default backend.","attributes":[{"name":null,"type":"Object","attributes":[{"name":"host","type":"String"},{"name":"http","type":"Object","expanded":true,"attributes":[{"name":"paths","type":"Array","required":true,"attributes":[{"name":null,"type":"Object","attributes":[{"name":"pathType","type":"String","required":true,"rules":{"values":["Exact","Prefix","ImplementationSpecific"]}},{"name":"path","type":"String"},{"name":"backend","type":"Object","required":true,"expanded":true,"attributes":[{"name":"service","type":"Object","expanded":true,"attributes":[{"name":"name","type":"Link","description":"Name is the referenced service.
The service must exist in the same namespace as the Ingress object.","linkRef":"Service","linkModel":"defaultLink","required":true},{"name":"port","type":"Object","expanded":true,"attributes":[{"name":"name","type":"String","description":"Name is the name of the port on the Service.
This is a mutually exclusive setting with \\"Number\\"."},{"name":"number","type":"Number","description":"Number is the numerical port number (e.g. 80) on the Service.
This is a mutually exclusive setting with \\"Name\\"."}]}]}]}]}]}]}]}]},{"name":"tls","type":"Array","description":"TLS configuration.
Currently the Ingress only supports a single TLS port, 443.
If multiple members of this list specify different hosts, they will be multiplexed on the same port according to the hostname specified through the SNI TLS extension, if the ingress controller fulfilling the ingress supports SNI.","attributes":[{"name":null,"type":"Object","attributes":[{"name":"hosts","type":"Array"},{"name":"secretName","type":"String"}]}]}]}]}]'),"autoscaling/v2":JSON.parse('[{"type":"HorizontalPodAutoscaler","model":"DefaultModel","icon":"resources/unlabeled/hpa","attributes":[{"name":"spec","type":"Object","displayName":"Specification","expanded":true,"attributes":[]}]}]'),others:JSON.parse('[{"type":"Container","model":"DefaultContainer","icon":"resources/unlabeled/container","parentTypes":["Pod"],"attributes":[{"name":"parent","type":"Reference","containerRef":"Pod","required":true},{"name":"isInitContainer","type":"Boolean"},{"name":"image","type":"String"},{"name":"imagePullPolicy","type":"String","rules":{"values":["Always","IfNotPresent","Never"]}},{"name":"workingDir","type":"String"},{"name":"command","type":"Array","description":"Entrypoint array.
Not executed within a shell.
The container image\'s ENTRYPOINT is used if this is not provided.
Variable references $(VAR_NAME) are expanded using the container\'s environment.
If a variable cannot be resolved, the reference in the input string will be unchanged.
Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \\"$$(VAR_NAME)\\" will produce the string literal \\"$(VAR_NAME)\\".
Escaped references will never be expanded, regardless of whether the variable exists or not.
Cannot be updated.","url":"https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell"},{"name":"args","type":"Array","description":"Arguments to the entrypoint.
The container image\'s CMD is used if this is not provided.
Variable references $(VAR_NAME) are expanded using the container\'s environment.
If a variable cannot be resolved, the reference in the input string will be unchanged.
Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \\"$$(VAR_NAME)\\" will produce the string literal \\"$(VAR_NAME)\\".
Escaped references will never be expanded, regardless of whether the variable exists or not.
Cannot be updated.","url":"https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell"},{"name":"volumeMounts","type":"Array","attributes":[{"name":null,"type":"Object","attributes":[{"name":"name","type":"String","required":true},{"name":"mountPath","type":"String","required":true},{"name":"subPath","type":"String"},{"name":"subPathExpr","type":"String"},{"name":"mountPropagation","type":"String","rules":{"values":["None","HostToContainer","Bidirectional"]}},{"name":"readOnly","type":"Boolean"}]}]},{"name":"env","type":"Array","attributes":[{"name":null,"type":"Object","attributes":[{"name":"name","type":"String","required":true},{"name":"value","type":"String"}]}]},{"name":"envFrom","type":"Array","attributes":[{"name":null,"type":"Object","attributes":[{"name":"configMapRef","type":"Object","attributes":[{"name":"name","type":"String"},{"name":"optional","type":"Boolean"}]},{"name":"secretRef","type":"Object","attributes":[{"name":"name","type":"String"},{"name":"optional","type":"Boolean"}]},{"name":"prefix","type":"String"}]}]},{"name":"ports","type":"Array","attributes":[{"name":null,"type":"Object","attributes":[{"name":"name","type":"String"},{"name":"containerPort","type":"String","required":true},{"name":"protocol","type":"String","rules":{"values":["TCP","IDP","SCTP"]}}]}]},{"name":"resources","type":"Object","attributes":[{"name":"requests","type":"Object","expanded":true,"attributes":[{"name":"memory","type":"String"},{"name":"cpu","type":"String"},{"name":"ephemeral-storage","type":"String"}]},{"name":"limits","type":"Object","expanded":true,"attributes":[{"name":"memory","type":"String"},{"name":"cpu","type":"String"},{"name":"ephemeral-storage","type":"String"}]}]},{"name":"readinessProbe","type":"Object","attributes":[{"name":"initialDelaySeconds","type":"Number"},{"name":"periodSeconds","type":"Number"},{"name":"timeoutSeconds","type":"Number"},{"name":"successThreshold","type":"Number"},{"name":"failureThreshold","type":"Number"},{"name":"terminationGracePeriodSeconds","type":"Number"},{"name":"httpGet","type":"Object","attributes":[{"name":"host","type":"String"},{"name":"port","type":"String","required":false},{"name":"scheme","type":"String","rules":{"values":["HTTP","HTTPS"]}},{"name":"path","type":"String"},{"name":"httpHeaders","type":"Array","attributes":[{"name":null,"type":"Object","attributes":[{"name":"name","type":"String","required":true},{"name":"value","type":"String","required":true}]}]}]},{"name":"exec","type":"Object","attributes":[{"name":"command","type":"Array"}]},{"name":"tcpSocket","type":"Object","attributes":[{"name":"host","type":"String"},{"name":"port","type":"String","required":false}]},{"name":"grpc","type":"Object","attributes":[{"name":"port","type":"String","required":false},{"name":"service","type":"String"}]}]},{"name":"livenessProbe","type":"Object","attributes":[{"name":"initialDelaySeconds","type":"Number"},{"name":"periodSeconds","type":"Number"},{"name":"timeoutSeconds","type":"Number"},{"name":"successThreshold","type":"Number"},{"name":"failureThreshold","type":"Number"},{"name":"terminationGracePeriodSeconds","type":"Number"},{"name":"httpGet","type":"Object","attributes":[{"name":"host","type":"String"},{"name":"port","type":"String","required":false},{"name":"scheme","type":"String","rules":{"values":["HTTP","HTTPS"]}},{"name":"path","type":"String"},{"name":"httpHeaders","type":"Array","attributes":[{"name":null,"type":"Object","attributes":[{"name":"name","type":"String","required":true},{"name":"value","type":"String","required":true}]}]}]},{"name":"exec","type":"Object","attributes":[{"name":"command","type":"Array"}]},{"name":"tcpSocket","type":"Object","attributes":[{"name":"host","type":"String"},{"name":"port","type":"String","required":false}]},{"name":"grpc","type":"Object","attributes":[{"name":"port","type":"String","required":false},{"name":"service","type":"String"}]}]}]},{"type":"UnknownResource","model":"DefaultModel","icon":"question-mark"},{"type":"NetworkPolicy","model":"DefaultModel","icon":"resources/unlabeled/netpol","url":"https://kubernetes.io/docs/concepts/services-networking/network-policies/","description":"NetworkPolicy describes what network traffic is allowed for a set of Pods","attributes":[{"name":"metadata","type":"Object","attributes":[{"name":"name","type":"String","required":true},{"name":"namespace","type":"String"}]},{"name":"spec","type":"Object","displayName":"Specification","expanded":true,"attributes":[{"name":"podSelector","type":"Object","required":true,"attributes":[{"name":"matchLabels","type":"Object"}]},{"name":"policyTypes","type":"Array","attributes":[{"name":null,"type":"String","required":true}]},{"name":"ingress","type":"Array","attributes":[{"name":"from","type":"Array","attributes":[{"name":"null","type":"Array","attributes":[{"name":"podSelector","type":"Object","attributes":[{"name":"matchLabels","type":"Object"}]}]},{"name":"port","type":"Object","attributes":[{"name":"null","type":"Array","attributes":[{"name":"protocol","type":"String"}]},{"name":"port","type":"Number"}]}]}]},{"name":"egress","type":"Array","attributes":[{"name":"to","type":"Object","attributes":[{"name":"null","type":"Array","attributes":[{"name":"podSelector","type":"Object","attributes":[{"name":"matchLabels","type":"Object"}]}]},{"name":"port","type":"Object","attributes":[{"name":"null","type":"Array","attributes":[{"name":"protocol","type":"String"}]},{"name":"port","type":"Number"}]}]}]}]}]}]')}};function B(t){return B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},B(t)}function F(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function $(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=Array(e);n!!t&&"object"==typeof t&&t[rt]===X,ot=t=>!!t&&"object"==typeof t&&t[rt]===Q,at=t=>!!t&&"object"==typeof t&&t[rt]===Z,st=t=>!!t&&"object"==typeof t&&t[rt]===tt,ut=t=>!!t&&"object"==typeof t&&t[rt]===et,ct=t=>!!t&&"object"==typeof t&&t[rt]===nt;function lt(t){if(t&&"object"==typeof t)switch(t[rt]){case Z:case nt:return!0}return!1}function ft(t){if(t&&"object"==typeof t)switch(t[rt]){case X:case Z:case et:case nt:return!0}return!1}const ht=t=>(ut(t)||lt(t))&&!!t.anchor,pt=Symbol("break visit"),dt=Symbol("skip children"),mt=Symbol("remove node");function yt(t,e){const n=_t(e);ot(t)?gt(null,t.contents,n,Object.freeze([t]))===mt&&(t.contents=null):gt(null,t,n,Object.freeze([]))}function gt(t,e,n,r){const i=wt(t,e,n,r);if(ft(i)||st(i))return xt(t,r,i),gt(t,i,n,r);if("symbol"!=typeof i)if(lt(e)){r=Object.freeze(r.concat(e));for(let t=0;t"!==t[t.length-1]&&e("Verbatim tags must end with a >"),n)}const[,n,r]=t.match(/^(.*!)([^!]*)$/s);r||e(`The ${t} tag has no suffix`);const i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(t){return e(String(t)),null}return"!"===n?t:(e(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[e,n]of Object.entries(this.tags))if(t.startsWith(n))return e+t.substring(n.length).replace(/[!,[\]{}]/g,(t=>kt[t]));return"!"===t[0]?t:`!<${t}>`}toString(t){const e=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags);let r;if(t&&n.length>0&&ft(t.contents)){const e={};yt(t.contents,((t,n)=>{ft(n)&&n.tag&&(e[n.tag]=!0)})),r=Object.keys(e)}else r=[];for(const[i,o]of n)"!!"===i&&"tag:yaml.org,2002:"===o||t&&!r.some((t=>t.startsWith(o)))||e.push(`%TAG ${i} ${o}`);return e.join("\n")}}function St(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){const e=JSON.stringify(t);throw new Error(`Anchor must not contain whitespace or control characters: ${e}`)}return!0}function Et(t){const e=new Set;return yt(t,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function At(t,e){for(let n=1;;++n){const r=`${t}${n}`;if(!e.has(r))return r}}function Tt(t,e,n,r){if(r&&"object"==typeof r)if(Array.isArray(r))for(let e=0,n=r.length;eNt(t,String(e),n)));if(t&&"function"==typeof t.toJSON){if(!n||!ht(t))return t.toJSON(e,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(t,r),n.onCreate=t=>{r.res=t,delete n.onCreate};const i=t.toJSON(e,n);return n.onCreate&&n.onCreate(i),i}return"bigint"!=typeof t||n?.keep?t:Number(t)}Ot.defaultYaml={explicit:!1,version:"1.2"},Ot.defaultTags={"!!":"tag:yaml.org,2002:"};class Mt{constructor(t){Object.defineProperty(this,rt,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:e,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!ot(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:!0===e,mapKeyWarned:!1,maxAliasCount:"number"==typeof n?n:100},a=Nt(this,"",o);if("function"==typeof r)for(const{count:t,res:e}of o.anchors.values())r(e,t);return"function"==typeof i?Tt(i,{"":a},"",a):a}}class Ct extends Mt{constructor(t){super(X),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t){let e;return yt(t,{Node:(t,n)=>{if(n===this)return yt.BREAK;n.anchor===this.source&&(e=n)}}),e}toJSON(t,e){if(!e)return{source:this.source};const{anchors:n,doc:r,maxAliasCount:i}=e,o=this.resolve(r);if(!o){const t=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(t)}let a=n.get(o);if(a||(Nt(o,null,e),a=n.get(o)),!a||void 0===a.res)throw new ReferenceError("This should not happen: Alias anchor was not resolved?");if(i>=0&&(a.count+=1,0===a.aliasCount&&(a.aliasCount=jt(r,o,n)),a.count*a.aliasCount>i))throw new ReferenceError("Excessive alias count indicates a resource exhaustion attack");return a.res}toString(t,e,n){const r=`*${this.source}`;if(t){if(St(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const t=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(t)}if(t.implicitKey)return`${r} `}return r}}function jt(t,e,n){if(it(e)){const r=e.resolve(t),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(lt(e)){let r=0;for(const i of e.items){const e=jt(t,i,n);e>r&&(r=e)}return r}if(st(e)){const r=jt(t,e.key,n),i=jt(t,e.value,n);return Math.max(r,i)}return 1}const Pt=t=>!t||"function"!=typeof t&&"object"!=typeof t;class Lt extends Mt{constructor(t){super(et),this.value=t}toJSON(t,e){return e?.keep?this.value:Nt(this.value,t,e)}toString(){return String(this.value)}}Lt.BLOCK_FOLDED="BLOCK_FOLDED",Lt.BLOCK_LITERAL="BLOCK_LITERAL",Lt.PLAIN="PLAIN",Lt.QUOTE_DOUBLE="QUOTE_DOUBLE",Lt.QUOTE_SINGLE="QUOTE_SINGLE";const It="tag:yaml.org,2002:";function Dt(t,e,n){if(ot(t)&&(t=t.contents),ft(t))return t;if(st(t)){const e=n.schema[Z].createNode?.(n.schema,null,n);return e.items.push(t),e}(t instanceof String||t instanceof Number||t instanceof Boolean||"undefined"!=typeof BigInt&&t instanceof BigInt)&&(t=t.valueOf());const{aliasDuplicateObjects:r,onAnchor:i,onTagObj:o,schema:a,sourceObjects:s}=n;let u;if(r&&t&&"object"==typeof t){if(u=s.get(t),u)return u.anchor||(u.anchor=i(t)),new Ct(u.anchor);u={anchor:null,node:null},s.set(t,u)}e?.startsWith("!!")&&(e=It+e.slice(2));let c=function(t,e,n){if(e){const t=n.filter((t=>t.tag===e)),r=t.find((t=>!t.format))??t[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return n.find((e=>e.identify?.(t)&&!e.format))}(t,e,a.tags);if(!c){if(t&&"function"==typeof t.toJSON&&(t=t.toJSON()),!t||"object"!=typeof t){const e=new Lt(t);return u&&(u.node=e),e}c=t instanceof Map?a[Z]:Symbol.iterator in Object(t)?a[nt]:a[Z]}o&&(o(c),delete n.onTagObj);const l=c?.createNode?c.createNode(n.schema,t,n):"function"==typeof c?.nodeClass?.from?c.nodeClass.from(n.schema,t,n):new Lt(t);return e?l.tag=e:c.default||(l.tag=c.tag),u&&(u.node=l),l}function Rt(t,e,n){let r=n;for(let t=e.length-1;t>=0;--t){const n=e[t];if("number"==typeof n&&Number.isInteger(n)&&n>=0){const t=[];t[n]=r,r=t}else r=new Map([[n,r]])}return Dt(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}const Bt=t=>null==t||"object"==typeof t&&!!t[Symbol.iterator]().next().done;class Ft extends Mt{constructor(t,e){super(t),Object.defineProperty(this,"schema",{value:e,configurable:!0,enumerable:!1,writable:!0})}clone(t){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(e.schema=t),e.items=e.items.map((e=>ft(e)||st(e)?e.clone(t):e)),this.range&&(e.range=this.range.slice()),e}addIn(t,e){if(Bt(t))this.add(e);else{const[n,...r]=t,i=this.get(n,!0);if(lt(i))i.addIn(r,e);else{if(void 0!==i||!this.schema)throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`);this.set(n,Rt(this.schema,r,e))}}}deleteIn(t){const[e,...n]=t;if(0===n.length)return this.delete(e);const r=this.get(e,!0);if(lt(r))return r.deleteIn(n);throw new Error(`Expected YAML collection at ${e}. Remaining path: ${n}`)}getIn(t,e){const[n,...r]=t,i=this.get(n,!0);return 0===r.length?!e&&ut(i)?i.value:i:lt(i)?i.getIn(r,e):void 0}hasAllNullValues(t){return this.items.every((e=>{if(!st(e))return!1;const n=e.value;return null==n||t&&ut(n)&&null==n.value&&!n.commentBefore&&!n.comment&&!n.tag}))}hasIn(t){const[e,...n]=t;if(0===n.length)return this.has(e);const r=this.get(e,!0);return!!lt(r)&&r.hasIn(n)}setIn(t,e){const[n,...r]=t;if(0===r.length)this.set(n,e);else{const t=this.get(n,!0);if(lt(t))t.setIn(r,e);else{if(void 0!==t||!this.schema)throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`);this.set(n,Rt(this.schema,r,e))}}}}const $t=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function qt(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}const Ut=(t,e,n)=>t.endsWith("\n")?qt(n,e):n.includes("\n")?"\n"+qt(n,e):(t.endsWith(" ")?"":" ")+n,Kt="flow",zt="block",Vt="quoted";function Yt(t,e,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:o=20,onFold:a,onOverflow:s}={}){if(!i||i<0)return t;ii-Math.max(2,o)?c.push(0):p=i-r);let d=!1,m=-1,y=-1,g=-1;n===zt&&(m=Ht(t,m,e.length),-1!==m&&(p=m+u));for(let r;r=t[m+=1];){if(n===Vt&&"\\"===r){switch(y=m,t[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}g=m}if("\n"===r)n===zt&&(m=Ht(t,m,e.length)),p=m+e.length+u,f=void 0;else{if(" "===r&&h&&" "!==h&&"\n"!==h&&"\t"!==h){const e=t[m+1];e&&" "!==e&&"\n"!==e&&"\t"!==e&&(f=m)}if(m>=p)if(f)c.push(f),p=f+u,f=void 0;else if(n===Vt){for(;" "===h||"\t"===h;)h=r,r=t[m+=1],d=!0;const e=m>g+1?m-2:y-1;if(l[e])return t;c.push(e),l[e]=!0,p=e+u,f=void 0}else d=!0}h=r}if(d&&s&&s(),0===c.length)return t;a&&a();let v=t.slice(0,c[0]);for(let r=0;r({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Gt=t=>/^(%|---|\.\.\.)/m.test(t);function Jt(t,e){const n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=e,i=e.options.doubleQuotedMinMultiLineLength,o=e.indent||(Gt(t)?" ":"");let a="",s=0;for(let t=0,e=n[t];e;e=n[++t])if(" "===e&&"\\"===n[t+1]&&"n"===n[t+2]&&(a+=n.slice(s,t)+"\\ ",t+=1,s=t,e="\\"),"\\"===e)switch(n[t+1]){case"u":{a+=n.slice(s,t);const e=n.substr(t+2,4);switch(e){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:"00"===e.substr(0,2)?a+="\\x"+e.substr(2):a+=n.substr(t,6)}t+=5,s=t+1}break;case"n":if(r||'"'===n[t+2]||n.lengthr)return!0;if(n=e+1,i-n<=r)return!1}return!0}(n,u,c.length));if(!n)return l?"|\n":">\n";let f,h;for(h=n.length;h>0;--h){const t=n[h-1];if("\n"!==t&&"\t"!==t&&" "!==t)break}let p=n.substring(h);const d=p.indexOf("\n");-1===d?f="-":n===p||d!==p.length-1?(f="+",o&&o()):f="",p&&(n=n.slice(0,-p.length),"\n"===p[p.length-1]&&(p=p.slice(0,-1)),p=p.replace(Zt,`$&${c}`));let m,y=!1,g=-1;for(m=0;m")+(y?c?"2":"1":"")+f;return t&&(b+=" "+s(t.replace(/ ?[\r\n]+/g," ")),i&&i()),l?`${b}\n${c}${v}${n=n.replace(/\n+/g,`$&${c}`)}${p}`:`${b}\n${c}${Yt(`${v}${n=n.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`)}${p}`,c,zt,Wt(r,!0))}`}function ee(t,e,n,r){const{implicitKey:i,inFlow:o}=e,a="string"==typeof t.value?t:Object.assign({},t,{value:String(t.value)});let{type:s}=t;s!==Lt.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(s=Lt.QUOTE_DOUBLE);const u=t=>{switch(t){case Lt.BLOCK_FOLDED:case Lt.BLOCK_LITERAL:return i||o?Qt(a.value,e):te(a,e,n,r);case Lt.QUOTE_DOUBLE:return Jt(a.value,e);case Lt.QUOTE_SINGLE:return Xt(a.value,e);case Lt.PLAIN:return function(t,e,n,r){const{type:i,value:o}=t,{actualString:a,implicitKey:s,indent:u,indentStep:c,inFlow:l}=e;if(s&&o.includes("\n")||l&&/[[\]{},]/.test(o))return Qt(o,e);if(!o||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return s||l||!o.includes("\n")?Qt(o,e):te(t,e,n,r);if(!s&&!l&&i!==Lt.PLAIN&&o.includes("\n"))return te(t,e,n,r);if(Gt(o)){if(""===u)return e.forceBlockIndent=!0,te(t,e,n,r);if(s&&u===c)return Qt(o,e)}const f=o.replace(/\n+/g,`$&\n${u}`);if(a){const t=t=>t.default&&"tag:yaml.org,2002:str"!==t.tag&&t.test?.test(f),{compat:n,tags:r}=e.doc.schema;if(r.some(t)||n?.some(t))return Qt(o,e)}return s?f:Yt(f,u,Kt,Wt(e,!1))}(a,e,n,r);default:return null}};let c=u(s);if(null===c){const{defaultKeyType:t,defaultStringType:n}=e.options,r=i&&t||n;if(c=u(r),null===c)throw new Error(`Unsupported default string type ${r}`)}return c}function ne(t,e){const n=Object.assign({blockQuote:!0,commentString:$t,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e);let r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:"number"==typeof n.indent?" ".repeat(n.indent):" ",inFlow:r,options:n}}function re(t,e,n,r){if(st(t))return t.toString(e,n,r);if(it(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i;const o=ft(t)?t:e.doc.createNode(t,{onTagObj:t=>i=t});i||(i=function(t,e){if(e.tag){const n=t.filter((t=>t.tag===e.tag));if(n.length>0)return n.find((t=>t.format===e.format))??n[0]}let n,r;if(ut(e)){r=e.value;const i=t.filter((t=>t.identify?.(r)));n=i.find((t=>t.format===e.format))??i.find((t=>!t.format))}else r=e,n=t.find((t=>t.nodeClass&&r instanceof t.nodeClass));if(!n)throw new Error(`Tag not resolved for ${r?.constructor?.name??typeof r} value`);return n}(e.doc.schema.tags,o));const a=function(t,e,{anchors:n,doc:r}){if(!r.directives)return"";const i=[],o=(ut(t)||lt(t))&&t.anchor;o&&St(o)&&(n.add(o),i.push(`&${o}`));const a=t.tag?t.tag:e.default?null:e.tag;return a&&i.push(r.directives.tagString(a)),i.join(" ")}(o,i,e);a.length>0&&(e.indentAtStart=(e.indentAtStart??0)+a.length+1);const s="function"==typeof i.stringify?i.stringify(o,e,n,r):ut(o)?ee(o,e,n,r):o.toString(e,n,r);return a?ut(o)||"{"===s[0]||"["===s[0]?`${a} ${s}`:`${a}\n${e.indent}${s}`:s}function ie(t,e){"debug"!==t&&"warn"!==t||("undefined"!=typeof process&&process.emitWarning?process.emitWarning(e):console.warn(e))}function oe(t,e,{key:n,value:r}){if(t?.doc.schema.merge&&ae(n))if(r=it(r)?r.resolve(t.doc):r,ct(r))for(const n of r.items)se(t,e,n);else if(Array.isArray(r))for(const n of r)se(t,e,n);else se(t,e,r);else{const i=Nt(n,"",t);if(e instanceof Map)e.set(i,Nt(r,i,t));else if(e instanceof Set)e.add(i);else{const o=function(t,e,n){if(null===e)return"";if("object"!=typeof e)return String(e);if(ft(t)&&n?.doc){const e=ne(n.doc,{});e.anchors=new Set;for(const t of n.anchors.keys())e.anchors.add(t.anchor);e.inFlow=!0,e.inStringifyKey=!0;const r=t.toString(e);if(!n.mapKeyWarned){let t=JSON.stringify(r);t.length>40&&(t=t.substring(0,36)+'..."'),ie(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${t}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(e)}(n,i,t),a=Nt(r,o,t);o in e?Object.defineProperty(e,o,{value:a,writable:!0,enumerable:!0,configurable:!0}):e[o]=a}}return e}const ae=t=>"<<"===t||ut(t)&&"<<"===t.value&&(!t.type||t.type===Lt.PLAIN);function se(t,e,n){const r=t&&it(n)?n.resolve(t.doc):n;if(!at(r))throw new Error("Merge sources must be maps or map aliases");const i=r.toJSON(null,t,Map);for(const[t,n]of i)e instanceof Map?e.has(t)||e.set(t,n):e instanceof Set?e.add(t):Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0});return e}function ue(t,e,n){const r=Dt(t,void 0,n),i=Dt(e,void 0,n);return new ce(r,i)}class ce{constructor(t,e=null){Object.defineProperty(this,rt,{value:tt}),this.key=t,this.value=e}clone(t){let{key:e,value:n}=this;return ft(e)&&(e=e.clone(t)),ft(n)&&(n=n.clone(t)),new ce(e,n)}toJSON(t,e){return oe(e,e?.mapAsMap?new Map:{},this)}toString(t,e,n){return t?.doc?function({key:t,value:e},n,r,i){const{allNullValues:o,doc:a,indent:s,indentStep:u,options:{commentString:c,indentSeq:l,simpleKeys:f}}=n;let h=ft(t)&&t.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(lt(t)||!ft(t)&&"object"==typeof t)throw new Error("With simple keys, collection cannot be used as a key value")}let p=!f&&(!t||h&&null==e&&!n.inFlow||lt(t)||(ut(t)?t.type===Lt.BLOCK_FOLDED||t.type===Lt.BLOCK_LITERAL:"object"==typeof t));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(f||!o),indent:s+u});let d,m,y,g=!1,v=!1,b=re(t,n,(()=>g=!0),(()=>v=!0));if(!p&&!n.inFlow&&b.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(n.inFlow){if(o||null==e)return g&&r&&r(),""===b?"?":p?`? ${b}`:b}else if(o&&!f||null==e&&p)return b=`? ${b}`,h&&!g?b+=Ut(b,n.indent,c(h)):v&&i&&i(),b;g&&(h=null),p?(h&&(b+=Ut(b,n.indent,c(h))),b=`? ${b}\n${s}:`):(b=`${b}:`,h&&(b+=Ut(b,n.indent,c(h)))),ft(e)?(d=!!e.spaceBefore,m=e.commentBefore,y=e.comment):(d=!1,m=null,y=null,e&&"object"==typeof e&&(e=a.createNode(e))),n.implicitKey=!1,p||h||!ut(e)||(n.indentAtStart=b.length+1),v=!1,l||!(u.length>=2)||n.inFlow||p||!ct(e)||e.flow||e.tag||e.anchor||(n.indent=n.indent.substring(2));let _=!1;const w=re(e,n,(()=>_=!0),(()=>v=!0));let x=" ";if(h||d||m)x=d?"\n":"",m&&(x+=`\n${qt(c(m),n.indent)}`),""!==w||n.inFlow?x+=`\n${n.indent}`:"\n"===x&&(x="\n\n");else if(!p&<(e)){const t=w[0],r=w.indexOf("\n"),i=-1!==r,o=n.inFlow??e.flow??0===e.items.length;if(i||!o){let e=!1;if(i&&("&"===t||"!"===t)){let n=w.indexOf(" ");"&"===t&&-1!==n&&na=null),(()=>f=!0));a&&(s+=Ut(s,o,c(a))),f&&a&&(f=!1),h.push(r+s)}let p;if(0===h.length)p=i.start+i.end;else{p=h[0];for(let t=1;to=null));nl||a.includes("\n"))&&(c=!0),f.push(a),l=f.length}const{start:h,end:p}=n;if(0===f.length)return h+p;if(!c){const t=f.reduce(((t,e)=>t+e.length+2),2);c=e.options.lineWidth>0&&t>e.options.lineWidth}if(c){let t=h;for(const e of f)t+=e?`\n${o}${i}${e}`:"\n";return`${t}\n${i}${p}`}return`${h}${a}${f.join(" ")}${a}${p}`}function pe({indent:t,options:{commentString:e}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const i=qt(e(r),t);n.push(i.trimStart())}}function de(t,e){const n=ut(e)?e.value:e;for(const r of t)if(st(r)){if(r.key===e||r.key===n)return r;if(ut(r.key)&&r.key.value===n)return r}}class me extends Ft{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Z,t),this.items=[]}static from(t,e,n){const{keepUndefined:r,replacer:i}=n,o=new this(t),a=(t,a)=>{if("function"==typeof i)a=i.call(e,t,a);else if(Array.isArray(i)&&!i.includes(t))return;(void 0!==a||r)&&o.items.push(ue(t,a,n))};if(e instanceof Map)for(const[t,n]of e)a(t,n);else if(e&&"object"==typeof e)for(const t of Object.keys(e))a(t,e[t]);return"function"==typeof t.sortMapEntries&&o.items.sort(t.sortMapEntries),o}add(t,e){let n;n=st(t)?t:t&&"object"==typeof t&&"key"in t?new ce(t.key,t.value):new ce(t,t?.value);const r=de(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!e)throw new Error(`Key ${n.key} already set`);ut(r.value)&&Pt(n.value)?r.value.value=n.value:r.value=n.value}else if(i){const t=this.items.findIndex((t=>i(n,t)<0));-1===t?this.items.push(n):this.items.splice(t,0,n)}else this.items.push(n)}delete(t){const e=de(this.items,t);return!!e&&this.items.splice(this.items.indexOf(e),1).length>0}get(t,e){const n=de(this.items,t),r=n?.value;return(!e&&ut(r)?r.value:r)??void 0}has(t){return!!de(this.items,t)}set(t,e){this.add(new ce(t,e),!0)}toJSON(t,e,n){const r=n?new n:e?.mapAsMap?new Map:{};e?.onCreate&&e.onCreate(r);for(const t of this.items)oe(e,r,t);return r}toString(t,e,n){if(!t)return JSON.stringify(this);for(const t of this.items)if(!st(t))throw new Error(`Map items must all be pairs; found ${JSON.stringify(t)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),le(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:n,onComment:e})}}const ye={collection:"map",default:!0,nodeClass:me,tag:"tag:yaml.org,2002:map",resolve:(t,e)=>(at(t)||e("Expected a mapping for this tag"),t),createNode:(t,e,n)=>me.from(t,e,n)};class ge extends Ft{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(nt,t),this.items=[]}add(t){this.items.push(t)}delete(t){const e=ve(t);return"number"==typeof e&&this.items.splice(e,1).length>0}get(t,e){const n=ve(t);if("number"!=typeof n)return;const r=this.items[n];return!e&&ut(r)?r.value:r}has(t){const e=ve(t);return"number"==typeof e&&e=0?e:null}const be={collection:"seq",default:!0,nodeClass:ge,tag:"tag:yaml.org,2002:seq",resolve:(t,e)=>(ct(t)||e("Expected a sequence for this tag"),t),createNode:(t,e,n)=>ge.from(t,e,n)},_e={identify:t=>"string"==typeof t,default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:(t,e,n,r)=>ee(t,e=Object.assign({actualString:!0},e),n,r)},we={identify:t=>null==t,createNode:()=>new Lt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Lt(null),stringify:({source:t},e)=>"string"==typeof t&&we.test.test(t)?t:e.options.nullStr},xe={identify:t=>"boolean"==typeof t,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new Lt("t"===t[0]||"T"===t[0]),stringify:({source:t,value:e},n)=>t&&xe.test.test(t)&&e===("t"===t[0]||"T"===t[0])?t:e?n.options.trueStr:n.options.falseStr};function ke({format:t,minFractionDigits:e,tag:n,value:r}){if("bigint"==typeof r)return String(r);const i="number"==typeof r?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let o=JSON.stringify(r);if(!t&&e&&(!n||"tag:yaml.org,2002:float"===n)&&/^\d/.test(o)){let t=o.indexOf(".");t<0&&(t=o.length,o+=".");let n=e-(o.length-t-1);for(;n-- >0;)o+="0"}return o}const Oe={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>"nan"===t.slice(-3).toLowerCase()?NaN:"-"===t[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ke},Se={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){const e=Number(t.value);return isFinite(e)?e.toExponential():ke(t)}},Ee={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){const e=new Lt(parseFloat(t)),n=t.indexOf(".");return-1!==n&&"0"===t[t.length-1]&&(e.minFractionDigits=t.length-n-1),e},stringify:ke},Ae=t=>"bigint"==typeof t||Number.isInteger(t),Te=(t,e,n,{intAsBigInt:r})=>r?BigInt(t):parseInt(t.substring(e),n);function Ne(t,e,n){const{value:r}=t;return Ae(r)&&r>=0?n+r.toString(e):ke(t)}const Me={identify:t=>Ae(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>Te(t,2,8,n),stringify:t=>Ne(t,8,"0o")},Ce={identify:Ae,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>Te(t,0,10,n),stringify:ke},je={identify:t=>Ae(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>Te(t,2,16,n),stringify:t=>Ne(t,16,"0x")},Pe=[ye,be,_e,we,xe,Me,Ce,je,Oe,Se,Ee];function Le(t){return"bigint"==typeof t||Number.isInteger(t)}const Ie=({value:t})=>JSON.stringify(t),De=[{identify:t=>"string"==typeof t,default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Ie},{identify:t=>null==t,createNode:()=>new Lt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Ie},{identify:t=>"boolean"==typeof t,default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:t=>"true"===t,stringify:Ie},{identify:Le,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:n})=>n?BigInt(t):parseInt(t,10),stringify:({value:t})=>Le(t)?t.toString():JSON.stringify(t)},{identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Ie}],Re={default:!0,tag:"",test:/^/,resolve:(t,e)=>(e(`Unresolved plain scalar ${JSON.stringify(t)}`),t)},Be=[ye,be].concat(De,Re),Fe={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if("function"==typeof Buffer)return Buffer.from(t,"base64");if("function"==typeof atob){const e=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(e.length);for(let t=0;t1&&e("Each pair must have its own sequence indicator");const t=r.items[0]||new ce(new Lt(null));if(r.commentBefore&&(t.key.commentBefore=t.key.commentBefore?`${r.commentBefore}\n${t.key.commentBefore}`:r.commentBefore),r.comment){const e=t.value??t.key;e.comment=e.comment?`${r.comment}\n${e.comment}`:r.comment}r=t}t.items[n]=st(r)?r:new ce(r)}}else e("Expected a sequence for this tag");return t}function qe(t,e,n){const{replacer:r}=n,i=new ge(t);i.tag="tag:yaml.org,2002:pairs";let o=0;if(e&&Symbol.iterator in Object(e))for(let t of e){let a,s;if("function"==typeof r&&(t=r.call(e,String(o++),t)),Array.isArray(t)){if(2!==t.length)throw new TypeError(`Expected [key, value] tuple: ${t}`);a=t[0],s=t[1]}else if(t&&t instanceof Object){const e=Object.keys(t);if(1!==e.length)throw new TypeError(`Expected tuple with one key, not ${e.length} keys`);a=e[0],s=t[a]}else a=t;i.items.push(ue(a,s,n))}return i}const Ue={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:$e,createNode:qe};class Ke extends ge{constructor(){super(),this.add=me.prototype.add.bind(this),this.delete=me.prototype.delete.bind(this),this.get=me.prototype.get.bind(this),this.has=me.prototype.has.bind(this),this.set=me.prototype.set.bind(this),this.tag=Ke.tag}toJSON(t,e){if(!e)return super.toJSON(t);const n=new Map;e?.onCreate&&e.onCreate(n);for(const t of this.items){let r,i;if(st(t)?(r=Nt(t.key,"",e),i=Nt(t.value,r,e)):r=Nt(t,"",e),n.has(r))throw new Error("Ordered maps must not include duplicate keys");n.set(r,i)}return n}static from(t,e,n){const r=qe(t,e,n),i=new this;return i.items=r.items,i}}Ke.tag="tag:yaml.org,2002:omap";const ze={collection:"seq",identify:t=>t instanceof Map,nodeClass:Ke,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){const n=$e(t,e),r=[];for(const{key:t}of n.items)ut(t)&&(r.includes(t.value)?e(`Ordered maps must not include duplicate keys: ${t.value}`):r.push(t.value));return Object.assign(new Ke,n)},createNode:(t,e,n)=>Ke.from(t,e,n)};function Ve({value:t,source:e},n){return e&&(t?Ye:He).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}const Ye={identify:t=>!0===t,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Lt(!0),stringify:Ve},He={identify:t=>!1===t,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Lt(!1),stringify:Ve},We={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>"nan"===t.slice(-3).toLowerCase()?NaN:"-"===t[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ke},Ge={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){const e=Number(t.value);return isFinite(e)?e.toExponential():ke(t)}},Je={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){const e=new Lt(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(-1!==n){const r=t.substring(n+1).replace(/_/g,"");"0"===r[r.length-1]&&(e.minFractionDigits=r.length)}return e},stringify:ke},Xe=t=>"bigint"==typeof t||Number.isInteger(t);function Qe(t,e,n,{intAsBigInt:r}){const i=t[0];if("-"!==i&&"+"!==i||(e+=1),t=t.substring(e).replace(/_/g,""),r){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`}const e=BigInt(t);return"-"===i?BigInt(-1)*e:e}const o=parseInt(t,n);return"-"===i?-1*o:o}function Ze(t,e,n){const{value:r}=t;if(Xe(r)){const t=r.toString(e);return r<0?"-"+n+t.substr(1):n+t}return ke(t)}const tn={identify:Xe,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>Qe(t,2,2,n),stringify:t=>Ze(t,2,"0b")},en={identify:Xe,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>Qe(t,1,8,n),stringify:t=>Ze(t,8,"0")},nn={identify:Xe,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>Qe(t,0,10,n),stringify:ke},rn={identify:Xe,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>Qe(t,2,16,n),stringify:t=>Ze(t,16,"0x")};class on extends me{constructor(t){super(t),this.tag=on.tag}add(t){let e;e=st(t)?t:t&&"object"==typeof t&&"key"in t&&"value"in t&&null===t.value?new ce(t.key,null):new ce(t,null),de(this.items,e.key)||this.items.push(e)}get(t,e){const n=de(this.items,t);return!e&&st(n)?ut(n.key)?n.key.value:n.key:n}set(t,e){if("boolean"!=typeof e)throw new Error("Expected boolean value for set(key, value) in a YAML set, not "+typeof e);const n=de(this.items,t);n&&!e?this.items.splice(this.items.indexOf(n),1):!n&&e&&this.items.push(new ce(t))}toJSON(t,e){return super.toJSON(t,e,Set)}toString(t,e,n){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),e,n);throw new Error("Set items must all have null values")}static from(t,e,n){const{replacer:r}=n,i=new this(t);if(e&&Symbol.iterator in Object(e))for(let t of e)"function"==typeof r&&(t=r.call(e,t,t)),i.items.push(ue(t,null,n));return i}}on.tag="tag:yaml.org,2002:set";const an={collection:"map",identify:t=>t instanceof Set,nodeClass:on,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>on.from(t,e,n),resolve(t,e){if(at(t)){if(t.hasAllNullValues(!0))return Object.assign(new on,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};function sn(t,e){const n=t[0],r="-"===n||"+"===n?t.substring(1):t,i=t=>e?BigInt(t):Number(t),o=r.replace(/_/g,"").split(":").reduce(((t,e)=>t*i(60)+i(e)),i(0));return"-"===n?i(-1)*o:o}function un(t){let{value:e}=t,n=t=>t;if("bigint"==typeof e)n=t=>BigInt(t);else if(isNaN(e)||!isFinite(e))return ke(t);let r="";e<0&&(r="-",e*=n(-1));const i=n(60),o=[e%i];return e<60?o.unshift(0):(e=(e-o[0])/i,o.unshift(e%i),e>=60&&(e=(e-o[0])/i,o.unshift(e))),r+o.map((t=>String(t).padStart(2,"0"))).join(":").replace(/000000\d*$/,"")}const cn={identify:t=>"bigint"==typeof t||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:n})=>sn(t,n),stringify:un},ln={identify:t=>"number"==typeof t,default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>sn(t,!1),stringify:un},fn={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){const e=t.match(fn.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,i,o,a,s]=e.map(Number),u=e[7]?Number((e[7]+"00").substr(1,3)):0;let c=Date.UTC(n,r-1,i,o||0,a||0,s||0,u);const l=e[8];if(l&&"Z"!==l){let t=sn(l,!1);Math.abs(t)<30&&(t*=60),c-=6e4*t}return new Date(c)},stringify:({value:t})=>t.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")},hn=[ye,be,_e,we,Ye,He,tn,en,nn,rn,We,Ge,Je,Fe,ze,Ue,an,cn,ln,fn],pn=new Map([["core",Pe],["failsafe",[ye,be,_e]],["json",Be],["yaml11",hn],["yaml-1.1",hn]]),dn={binary:Fe,bool:xe,float:Ee,floatExp:Se,floatNaN:Oe,floatTime:ln,int:Ce,intHex:je,intOct:Me,intTime:cn,map:ye,null:we,omap:ze,pairs:Ue,seq:be,set:an,timestamp:fn},mn={"tag:yaml.org,2002:binary":Fe,"tag:yaml.org,2002:omap":ze,"tag:yaml.org,2002:pairs":Ue,"tag:yaml.org,2002:set":an,"tag:yaml.org,2002:timestamp":fn};function yn(t,e){let n=pn.get(e);if(!n){if(!Array.isArray(t)){const t=Array.from(pn.keys()).filter((t=>"yaml11"!==t)).map((t=>JSON.stringify(t))).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${t} or define customTags array`)}n=[]}if(Array.isArray(t))for(const e of t)n=n.concat(e);else"function"==typeof t&&(n=t(n.slice()));return n.map((t=>{if("string"!=typeof t)return t;const e=dn[t];if(e)return e;const n=Object.keys(dn).map((t=>JSON.stringify(t))).join(", ");throw new Error(`Unknown custom tag "${t}"; use one of ${n}`)}))}const gn=(t,e)=>t.keye.key?1:0;class vn{constructor({compat:t,customTags:e,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(t)?yn(t,"compat"):t?yn(null,t):null,this.merge=!!n,this.name="string"==typeof i&&i||"core",this.knownTags=r?mn:{},this.tags=yn(e,this.name),this.toStringOptions=a??null,Object.defineProperty(this,Z,{value:ye}),Object.defineProperty(this,et,{value:_e}),Object.defineProperty(this,nt,{value:be}),this.sortMapEntries="function"==typeof o?o:!0===o?gn:null}clone(){const t=Object.create(vn.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}class bn{constructor(t,e,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,rt,{value:Q});let r=null;"function"==typeof e||Array.isArray(e)?r=e:void 0===n&&e&&(n=e,e=void 0);const i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,uniqueKeys:!0,version:"1.2"},n);this.options=i;let{version:o}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Ot({version:o}),this.setSchema(o,n),this.contents=void 0===t?null:this.createNode(t,r,n)}clone(){const t=Object.create(bn.prototype,{[rt]:{value:Q}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=ft(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){_n(this.contents)&&this.contents.add(t)}addIn(t,e){_n(this.contents)&&this.contents.addIn(t,e)}createAlias(t,e){if(!t.anchor){const n=Et(this);t.anchor=!e||n.has(e)?At(e||"a",n):e}return new Ct(t.anchor)}createNode(t,e,n){let r;if("function"==typeof e)t=e.call({"":t},"",t),r=e;else if(Array.isArray(e)){const t=t=>"number"==typeof t||t instanceof String||t instanceof Number,n=e.filter(t).map(String);n.length>0&&(e=e.concat(n)),r=e}else void 0===n&&e&&(n=e,e=void 0);const{aliasDuplicateObjects:i,anchorPrefix:o,flow:a,keepUndefined:s,onTagObj:u,tag:c}=n??{},{onAnchor:l,setAnchors:f,sourceObjects:h}=function(t,e){const n=[],r=new Map;let i=null;return{onAnchor:r=>{n.push(r),i||(i=Et(t));const o=At(e,i);return i.add(o),o},setAnchors:()=>{for(const t of n){const e=r.get(t);if("object"!=typeof e||!e.anchor||!ut(e.node)&&!lt(e.node)){const e=new Error("Failed to resolve repeated object (this should not happen)");throw e.source=t,e}e.node.anchor=e.anchor}},sourceObjects:r}}(this,o||"a"),p=Dt(t,c,{aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:l,onTagObj:u,replacer:r,schema:this.schema,sourceObjects:h});return a&<(p)&&(p.flow=!0),f(),p}createPair(t,e,n={}){const r=this.createNode(t,null,n),i=this.createNode(e,null,n);return new ce(r,i)}delete(t){return!!_n(this.contents)&&this.contents.delete(t)}deleteIn(t){return Bt(t)?null!=this.contents&&(this.contents=null,!0):!!_n(this.contents)&&this.contents.deleteIn(t)}get(t,e){return lt(this.contents)?this.contents.get(t,e):void 0}getIn(t,e){return Bt(t)?!e&&ut(this.contents)?this.contents.value:this.contents:lt(this.contents)?this.contents.getIn(t,e):void 0}has(t){return!!lt(this.contents)&&this.contents.has(t)}hasIn(t){return Bt(t)?void 0!==this.contents:!!lt(this.contents)&&this.contents.hasIn(t)}set(t,e){null==this.contents?this.contents=Rt(this.schema,[t],e):_n(this.contents)&&this.contents.set(t,e)}setIn(t,e){Bt(t)?this.contents=e:null==this.contents?this.contents=Rt(this.schema,Array.from(t),e):_n(this.contents)&&this.contents.setIn(t,e)}setSchema(t,e={}){let n;switch("number"==typeof t&&(t=String(t)),t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Ot({version:"1.1"}),n={merge:!0,resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new Ot({version:t}),n={merge:!1,resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{const e=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${e}`)}}if(e.schema instanceof Object)this.schema=e.schema;else{if(!n)throw new Error("With a null YAML version, the { schema: Schema } option is required");this.schema=new vn(Object.assign(n,e))}}toJS({json:t,jsonArg:e,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:o}={}){const a={anchors:new Map,doc:this,keep:!t,mapAsMap:!0===n,mapKeyWarned:!1,maxAliasCount:"number"==typeof r?r:100},s=Nt(this.contents,e??"",a);if("function"==typeof i)for(const{count:t,res:e}of a.anchors.values())i(e,t);return"function"==typeof o?Tt(o,{"":s},"",s):s}toJSON(t,e){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:e})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const e=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${e}`)}return function(t,e){const n=[];let r=!0===e.directives;if(!1!==e.directives&&t.directives){const e=t.directives.toString(t);e?(n.push(e),r=!0):t.directives.docStart&&(r=!0)}r&&n.push("---");const i=ne(t,e),{commentString:o}=i.options;if(t.commentBefore){1!==n.length&&n.unshift("");const e=o(t.commentBefore);n.unshift(qt(e,""))}let a=!1,s=null;if(t.contents){if(ft(t.contents)){if(t.contents.spaceBefore&&r&&n.push(""),t.contents.commentBefore){const e=o(t.contents.commentBefore);n.push(qt(e,""))}i.forceBlockIndent=!!t.comment,s=t.contents.comment}const e=s?void 0:()=>a=!0;let u=re(t.contents,i,(()=>s=null),e);s&&(u+=Ut(u,"",o(s))),"|"!==u[0]&&">"!==u[0]||"---"!==n[n.length-1]?n.push(u):n[n.length-1]=`--- ${u}`}else n.push(re(t.contents,i));if(t.directives?.docEnd)if(t.comment){const e=o(t.comment);e.includes("\n")?(n.push("..."),n.push(qt(e,""))):n.push(`... ${e}`)}else n.push("...");else{let e=t.comment;e&&a&&(e=e.replace(/^\n+/,"")),e&&(a&&!s||""===n[n.length-1]||n.push(""),n.push(qt(o(e),"")))}return n.join("\n")+"\n"}(this,t)}}function _n(t){if(lt(t))return!0;throw new Error("Expected a YAML collection as document contents")}class wn extends Error{constructor(t,e,n,r){super(),this.name=t,this.code=n,this.message=r,this.pos=e}}class xn extends wn{constructor(t,e,n){super("YAMLParseError",t,e,n)}}class kn extends wn{constructor(t,e,n){super("YAMLWarning",t,e,n)}}const On=(t,e)=>n=>{if(-1===n.pos[0])return;n.linePos=n.pos.map((t=>e.linePos(t)));const{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let o=i-1,a=t.substring(e.lineStarts[r-1],e.lineStarts[r]).replace(/[\n\r]+$/,"");if(o>=60&&a.length>80){const t=Math.min(o-39,a.length-79);a="…"+a.substring(t),o-=t-1}if(a.length>80&&(a=a.substring(0,79)+"…"),r>1&&/^ *$/.test(a.substring(0,o))){let n=t.substring(e.lineStarts[r-2],e.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+"…\n"),a=n+a}if(/[^ ]/.test(a)){let t=1;const e=n.linePos[1];e&&e.line===r&&e.col>i&&(t=Math.max(1,Math.min(e.col-i,80-o)));const s=" ".repeat(o)+"^".repeat(t);n.message+=`:\n\n${a}\n${s}\n`}};function Sn(t,{flow:e,indicator:n,next:r,offset:i,onError:o,parentIndent:a,startOnNewline:s}){let u=!1,c=s,l=s,f="",h="",p=!1,d=!1,m=null,y=null,g=null,v=null,b=null,_=null,w=null;for(const i of t)switch(d&&("space"!==i.type&&"newline"!==i.type&&"comma"!==i.type&&o(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),d=!1),m&&(c&&"comment"!==i.type&&"newline"!==i.type&&o(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),m=null),i.type){case"space":e||"doc-start"===n&&"flow-collection"===r?.type||!i.source.includes("\t")||(m=i),l=!0;break;case"comment":{l||o(i,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const t=i.source.substring(1)||" ";f?f+=h+t:f=t,h="",c=!1;break}case"newline":c?f?f+=i.source:u=!0:h+=i.source,c=!0,p=!0,(y||g)&&(v=i),l=!0;break;case"anchor":y&&o(i,"MULTIPLE_ANCHORS","A node can have at most one anchor"),i.source.endsWith(":")&&o(i.offset+i.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),y=i,null===w&&(w=i.offset),c=!1,l=!1,d=!0;break;case"tag":g&&o(i,"MULTIPLE_TAGS","A node can have at most one tag"),g=i,null===w&&(w=i.offset),c=!1,l=!1,d=!0;break;case n:(y||g)&&o(i,"BAD_PROP_ORDER",`Anchors and tags must be after the ${i.source} indicator`),_&&o(i,"UNEXPECTED_TOKEN",`Unexpected ${i.source} in ${e??"collection"}`),_=i,c="seq-item-ind"===n||"explicit-key-ind"===n,l=!1;break;case"comma":if(e){b&&o(i,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),b=i,c=!1,l=!1;break}default:o(i,"UNEXPECTED_TOKEN",`Unexpected ${i.type} token`),c=!1,l=!1}const x=t[t.length-1],k=x?x.offset+x.source.length:i;return d&&r&&"space"!==r.type&&"newline"!==r.type&&"comma"!==r.type&&("scalar"!==r.type||""!==r.source)&&o(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m&&(c&&m.indent<=a||"block-map"===r?.type||"block-seq"===r?.type)&&o(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:_,spaceBefore:u,comment:f,hasNewline:p,anchor:y,tag:g,newlineAfterProp:v,end:k,start:w??k}}function En(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes("\n"))return!0;if(t.end)for(const e of t.end)if("newline"===e.type)return!0;return!1;case"flow-collection":for(const e of t.items){for(const t of e.start)if("newline"===t.type)return!0;if(e.sep)for(const t of e.sep)if("newline"===t.type)return!0;if(En(e.key)||En(e.value))return!0}return!1;default:return!0}}function An(t,e,n){if("flow-collection"===e?.type){const r=e.end[0];r.indent!==t||"]"!==r.source&&"}"!==r.source||!En(e)||n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Tn(t,e,n){const{uniqueKeys:r}=t.options;if(!1===r)return!1;const i="function"==typeof r?r:(e,n)=>e===n||ut(e)&&ut(n)&&e.value===n.value&&!("<<"===e.value&&t.schema.merge);return e.some((t=>i(t.key,n)))}const Nn="All mapping items must start at the same column";function Mn(t,e,n,r){let i="";if(t){let o=!1,a="";for(const s of t){const{source:t,type:u}=s;switch(u){case"space":o=!0;break;case"comment":{n&&!o&&r(s,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const e=t.substring(1)||" ";i?i+=a+e:i=e,a="";break}case"newline":i&&(a+=t),o=!0;break;default:r(s,"UNEXPECTED_TOKEN",`Unexpected ${u} at node end`)}e+=t.length}}return{comment:i,offset:e}}const Cn="Block collections are not allowed within flow collections",jn=t=>t&&("block-map"===t.type||"block-seq"===t.type);function Pn(t,e,n,r,i,o){const a="block-map"===n.type?function({composeNode:t,composeEmptyNode:e},n,r,i,o){const a=new(o?.nodeClass??me)(n.schema);n.atRoot&&(n.atRoot=!1);let s=r.offset,u=null;for(const o of r.items){const{start:c,key:l,sep:f,value:h}=o,p=Sn(c,{indicator:"explicit-key-ind",next:l??f?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),d=!p.found;if(d){if(l&&("block-seq"===l.type?i(s,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in l&&l.indent!==r.indent&&i(s,"BAD_INDENT",Nn)),!p.anchor&&!p.tag&&!f){u=p.end,p.comment&&(a.comment?a.comment+="\n"+p.comment:a.comment=p.comment);continue}(p.newlineAfterProp||En(l))&&i(l??c[c.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else p.found?.indent!==r.indent&&i(s,"BAD_INDENT",Nn);const m=p.end,y=l?t(n,l,p,i):e(n,m,c,null,p,i);n.schema.compat&&An(r.indent,l,i),Tn(n,a.items,y)&&i(m,"DUPLICATE_KEY","Map keys must be unique");const g=Sn(f??[],{indicator:"map-value-ind",next:h,offset:y.range[2],onError:i,parentIndent:r.indent,startOnNewline:!l||"block-scalar"===l.type});if(s=g.end,g.found){d&&("block-map"!==h?.type||g.hasNewline||i(s,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&p.start0){const t=Mn(p,d,n.options.strict,i);t.comment&&(u.comment?u.comment+="\n"+t.comment:u.comment=t.comment),u.range=[r.offset,d,t.offset]}else u.range=[r.offset,d,d];return u}(t,e,n,r,o),s=a.constructor;return"!"===i||i===s.tagName?(a.tag=s.tagName,a):(i&&(a.tag=i),a)}function Ln(t){let e,n;try{e=new RegExp("(.*?)(?"===i.mode?Lt.BLOCK_FOLDED:Lt.BLOCK_LITERAL,a=e.source?function(t){const e=t.split(/\n( *)/),n=e[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let t=1;t=0;--t){const e=a[t][1];if(""!==e&&"\r"!==e)break;s=t}if(0===s){const t="+"===i.chomp&&a.length>0?"\n".repeat(Math.max(1,a.length-1)):"";let n=r+i.length;return e.source&&(n+=e.source.length),{value:t,type:o,comment:i.comment,range:[r,n,n]}}let u=e.indent+i.indent,c=e.offset+i.length,l=0;for(let e=0;eu&&(u=r.length),c+=r.length+o.length+1}for(let t=a.length-1;t>=s;--t)a[t][0].length>u&&(s=t+1);let f="",h="",p=!1;for(let t=0;tu||"\t"===r[0]?(" "===h?h="\n":p||"\n"!==h||(h="\n\n"),f+=h+e.slice(u)+r,h="\n",p=!0):""===r?"\n"===h?f+="\n":h="\n":(f+=h+r,h=" ",p=!1)}switch(i.chomp){case"-":break;case"+":for(let t=s;tn(r+t,e,i);switch(i){case"scalar":s=Lt.PLAIN,u=function(t,e){let n="";switch(t[0]){case"\t":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":n=`block scalar indicator ${t[0]}`;break;case"@":case"`":n=`reserved character ${t[0]}`}return n&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),Ln(t)}(o,c);break;case"single-quoted-scalar":s=Lt.QUOTE_SINGLE,u=function(t,e){return"'"===t[t.length-1]&&1!==t.length||e(t.length,"MISSING_CHAR","Missing closing 'quote"),Ln(t.slice(1,-1)).replace(/''/g,"'")}(o,c);break;case"double-quoted-scalar":s=Lt.QUOTE_DOUBLE,u=function(t,e){let n="";for(let r=1;re?t.slice(e,r+1):i)}else n+=i}return'"'===t[t.length-1]&&1!==t.length||e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}(o,c);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+o.length,r+o.length]}}const l=r+o.length,f=Mn(a,l,e,n);return{value:u,type:s,comment:f.comment,range:[r,l,f.offset]}}(e,t.options.strict,r),u=n?t.directives.tagName(n.source,(t=>r(n,"TAG_RESOLVE_FAILED",t))):null,c=n&&u?function(t,e,n,r,i){if("!"===n)return t[et];const o=[];for(const e of t.tags)if(!e.collection&&e.tag===n){if(!e.default||!e.test)return e;o.push(e)}for(const t of o)if(t.test?.test(e))return t;const a=t.knownTags[n];return a&&!a.collection?(t.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,"tag:yaml.org,2002:str"!==n),t[et])}(t.schema,i,u,n,r):"scalar"===e.type?function({directives:t,schema:e},n,r,i){const o=e.tags.find((t=>t.default&&t.test?.test(n)))||e[et];if(e.compat){const a=e.compat.find((t=>t.default&&t.test?.test(n)))??e[et];o.tag!==a.tag&&i(r,"TAG_RESOLVE_FAILED",`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(a.tag)}`,!0)}return o}(t,i,e,r):t.schema[et];let l;try{const o=c.resolve(i,(t=>r(n??e,"TAG_RESOLVE_FAILED",t)),t.options);l=ut(o)?o:new Lt(o)}catch(t){const o=t instanceof Error?t.message:String(t);r(n??e,"TAG_RESOLVE_FAILED",o),l=new Lt(i)}return l.range=s,l.source=i,o&&(l.type=o),u&&(l.tag=u),c.format&&(l.format=c.format),a&&(l.comment=a),l}function Fn(t,e,n){if(e){null===n&&(n=e.length);for(let r=n-1;r>=0;--r){let n=e[r];switch(n.type){case"space":case"comment":case"newline":t-=n.source.length;continue}for(n=e[++r];"space"===n?.type;)t+=n.source.length,n=e[++r];break}}return t}const $n={composeNode:qn,composeEmptyNode:Un};function qn(t,e,n,r){const{spaceBefore:i,comment:o,anchor:a,tag:s}=n;let u,c=!0;switch(e.type){case"alias":u=function({options:t},{offset:e,source:n,end:r},i){const o=new Ct(n.substring(1));""===o.source&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&i(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const a=e+n.length,s=Mn(r,a,t.strict,i);return o.range=[e,a,s.offset],s.comment&&(o.comment=s.comment),o}(t,e,r),(a||s)&&r(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":u=Bn(t,e,s,r),a&&(u.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":u=function(t,e,n,r,i){const o=r.tag,a=o?e.directives.tagName(o.source,(t=>i(o,"TAG_RESOLVE_FAILED",t))):null;if("block-seq"===n.type){const{anchor:t,newlineAfterProp:e}=r,n=t&&o?t.offset>o.offset?t:o:t??o;n&&(!e||e.offsett.tag===a&&t.collection===s));if(!u){const r=e.schema.knownTags[a];if(!r||r.collection!==s)return r?.collection?i(o,"BAD_COLLECTION_TYPE",`${r.tag} used for ${s} collection, but expects ${r.collection}`,!0):i(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),Pn(t,e,n,i,a);e.schema.tags.push(Object.assign({},r,{default:!1})),u=r}const c=Pn(t,e,n,i,a,u),l=u.resolve?.(c,(t=>i(o,"TAG_RESOLVE_FAILED",t)),e.options)??c,f=ft(l)?l:new Lt(l);return f.range=c.range,f.tag=a,u?.format&&(f.format=u.format),f}($n,t,e,n,r),a&&(u.anchor=a.source.substring(1));break;default:r(e,"UNEXPECTED_TOKEN","error"===e.type?e.message:`Unsupported token (type: ${e.type})`),u=Un(t,e.offset,void 0,null,n,r),c=!1}return a&&""===u.anchor&&r(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&(u.spaceBefore=!0),o&&("scalar"===e.type&&""===e.source?u.comment=o:u.commentBefore=o),t.options.keepSourceTokens&&c&&(u.srcToken=e),u}function Un(t,e,n,r,{spaceBefore:i,comment:o,anchor:a,tag:s,end:u},c){const l=Bn(t,{type:"scalar",offset:Fn(e,n,r),indent:-1,source:""},s,c);return a&&(l.anchor=a.source.substring(1),""===l.anchor&&c(a,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(l.spaceBefore=!0),o&&(l.comment=o,l.range[2]=u),l}function Kn(t){if("number"==typeof t)return[t,t+1];if(Array.isArray(t))return 2===t.length?t:[t[0],t[1]];const{offset:e,source:n}=t;return[e,e+("string"==typeof n?n.length:1)]}function zn(t){let e="",n=!1,r=!1;for(let i=0;i{const i=Kn(t);r?this.warnings.push(new kn(i,e,n)):this.errors.push(new xn(i,e,n))},this.directives=new Ot({version:t.version||"1.2"}),this.options=t}decorate(t,e){const{comment:n,afterEmptyLine:r}=zn(this.prelude);if(n){const i=t.contents;if(e)t.comment=t.comment?`${t.comment}\n${n}`:n;else if(r||t.directives.docStart||!i)t.commentBefore=n;else if(lt(i)&&!i.flow&&i.items.length>0){let t=i.items[0];st(t)&&(t=t.key);const e=t.commentBefore;t.commentBefore=e?`${n}\n${e}`:n}else{const t=i.commentBefore;i.commentBefore=t?`${n}\n${t}`:n}}e?(Array.prototype.push.apply(t.errors,this.errors),Array.prototype.push.apply(t.warnings,this.warnings)):(t.errors=this.errors,t.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:zn(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,e=!1,n=-1){for(const e of t)yield*this.next(e);yield*this.end(e,n)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,((e,n,r)=>{const i=Kn(t);i[0]+=e,this.onError(i,"BAD_DIRECTIVE",n,r)})),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const e=function(t,e,{offset:n,start:r,value:i,end:o},a){const s=Object.assign({_directives:e},t),u=new bn(void 0,s),c={atRoot:!0,directives:u.directives,options:u.options,schema:u.schema},l=Sn(r,{indicator:"doc-start",next:i??o?.[0],offset:n,onError:a,parentIndent:0,startOnNewline:!0});l.found&&(u.directives.docStart=!0,!i||"block-map"!==i.type&&"block-seq"!==i.type||l.hasNewline||a(l.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),u.contents=i?qn(c,i,l,a):Un(c,l.end,r,null,l,a);const f=u.contents.range[2],h=Mn(o,f,!1,a);return h.comment&&(u.comment=h.comment),u.range=[n,f,h.offset],u}(this.options,this.directives,t,this.onError);this.atDirectives&&!e.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(e,!1),this.doc&&(yield this.doc),this.doc=e,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const e=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,n=new xn(Kn(t),"UNEXPECTED_TOKEN",e);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){const e="Unexpected doc-end without preceding document";this.errors.push(new xn(Kn(t),"UNEXPECTED_TOKEN",e));break}this.doc.directives.docEnd=!0;const e=Mn(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),e.comment){const t=this.doc.comment;this.doc.comment=t?`${t}\n${e.comment}`:e.comment}this.doc.range[2]=e.offset;break}default:this.errors.push(new xn(Kn(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,e=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const t=Object.assign({_directives:this.directives},this.options),n=new bn(void 0,t);this.atDirectives&&this.onError(e,"MISSING_CHAR","Missing directives-end indicator line"),n.range=[0,e,e],this.decorate(n,!1),yield n}}}const Yn=Symbol("break visit"),Hn=Symbol("skip children"),Wn=Symbol("remove item");function Gn(t,e){"type"in t&&"document"===t.type&&(t={start:t.start,value:t.value}),Jn(Object.freeze([]),t,e)}function Jn(t,e,n){let r=n(e,t);if("symbol"==typeof r)return r;for(const i of["key","value"]){const o=e[i];if(o&&"items"in o){for(let e=0;e{let n=t;for(const[t,r]of e){const e=n?.[t];if(!e||!("items"in e))return;n=e.items[r]}return n},Gn.parentCollection=(t,e)=>{const n=Gn.itemAtPath(t,e.slice(0,-1)),r=e[e.length-1][0],i=n?.[r];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function Xn(t){switch(t){case void 0:case" ":case"\n":case"\r":case"\t":return!0;default:return!1}}const Qn=new Set("0123456789ABCDEFabcdef"),Zn=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),tr=new Set(",[]{}"),er=new Set(" ,[]{}\n\r\t"),nr=t=>!t||er.has(t);class rr{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,e=!1){if(t){if("string"!=typeof t)throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!e;let n=this.next??"stream";for(;n&&(e||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let t=this.pos,e=this.buffer[t];for(;" "===e||"\t"===e;)e=this.buffer[++t];return!e||"#"===e||"\n"===e||"\r"===e&&"\n"===this.buffer[t+1]}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let e=this.buffer[t];if(this.indentNext>0){let n=0;for(;" "===e;)e=this.buffer[++n+t];if("\r"===e){const e=this.buffer[n+t+1];if("\n"===e||!e&&!this.atEnd)return t+n+1}return"\n"===e||n>=this.indentNext||!e&&!this.atEnd?t+n:-1}if("-"===e||"."===e){const e=this.buffer.substr(t,3);if(("---"===e||"..."===e)&&Xn(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return("number"!=typeof t||-1!==t&&tthis.indentValue&&!Xn(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,e]=this.peek(2);if(!e&&!this.atEnd)return this.setNext("block-start");if(("-"===t||"?"===t||":"===t)&&Xn(e)){const t=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=t,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(null===t)return this.setNext("doc");let e=yield*this.pushIndicators();switch(t[e]){case"#":yield*this.pushCount(t.length-e);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(nr),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return e+=(yield*this.parseBlockScalarHeader()),e+=(yield*this.pushSpaces(!0)),yield*this.pushCount(t.length-e),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,e,n=-1;do{t=yield*this.pushNewline(),t>0?(e=yield*this.pushSpaces(!1),this.indentValue=n=e):e=0,e+=(yield*this.pushSpaces(!0))}while(t+e>0);const r=this.getLine();if(null===r)return this.setNext("flow");if((-1!==n&&n"0"&&e<="9")this.blockScalarIndent=Number(e)-1;else if("-"!==e)break}return yield*this.pushUntil((t=>Xn(t)||"#"===t))}*parseBlockScalar(){let t,e=this.pos-1,n=0;t:for(let r=this.pos;t=this.buffer[r];++r)switch(t){case" ":n+=1;break;case"\n":e=r,n=0;break;case"\r":{const t=this.buffer[r+1];if(!t&&!this.atEnd)return this.setNext("block-scalar");if("\n"===t)break}default:break t}if(!t&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){-1===this.blockScalarIndent?this.indentNext=n:this.indentNext=this.blockScalarIndent+(0===this.indentNext?1:this.indentNext);do{const t=this.continueScalar(e+1);if(-1===t)break;e=this.buffer.indexOf("\n",t)}while(-1!==e);if(-1===e){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let r=e+1;for(t=this.buffer[r];" "===t;)t=this.buffer[++r];if("\t"===t){for(;"\t"===t||" "===t||"\r"===t||"\n"===t;)t=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)for(;;){let t=e-1,r=this.buffer[t];"\r"===r&&(r=this.buffer[--t]);const i=t;for(;" "===r;)r=this.buffer[--t];if(!("\n"===r&&t>=this.pos&&t+1+n>i))break;e=t}return yield"",yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let e,n=this.pos-1,r=this.pos-1;for(;e=this.buffer[++r];)if(":"===e){const e=this.buffer[r+1];if(Xn(e)||t&&tr.has(e))break;n=r}else if(Xn(e)){let i=this.buffer[r+1];if("\r"===e&&("\n"===i?(r+=1,e="\n",i=this.buffer[r+1]):n=r),"#"===i||t&&tr.has(i))break;if("\n"===e){const t=this.continueScalar(r+1);if(-1===t)break;r=Math.max(r,t-2)}}else{if(t&&tr.has(e))break;n=r}return e||this.atEnd?(yield"",yield*this.pushToIndex(n+1,!0),t?"flow":"doc"):this.setNext("plain-scalar")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,e){const n=this.buffer.slice(this.pos,t);return n?(yield n,this.pos+=n.length,n.length):(e&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(nr))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,e=this.charAt(1);if(Xn(e)||t&&tr.has(e))return t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if("<"===this.charAt(1)){let t=this.pos+2,e=this.buffer[t];for(;!Xn(e)&&">"!==e;)e=this.buffer[++t];return yield*this.pushToIndex(">"===e?t+1:t,!1)}{let t=this.pos+1,e=this.buffer[t];for(;e;)if(Zn.has(e))e=this.buffer[++t];else{if("%"!==e||!Qn.has(this.buffer[t+1])||!Qn.has(this.buffer[t+2]))break;e=this.buffer[t+=3]}return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return"\n"===t?yield*this.pushCount(1):"\r"===t&&"\n"===this.charAt(1)?yield*this.pushCount(2):0}*pushSpaces(t){let e,n=this.pos-1;do{e=this.buffer[++n]}while(" "===e||t&&"\t"===e);const r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(t){let e=this.pos,n=this.buffer[e];for(;!t(n);)n=this.buffer[++e];return yield*this.pushToIndex(e,!1)}}class ir{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let e=0,n=this.lineStarts.length;for(;e>1;this.lineStarts[r]=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break t}for(;"space"===t[++e]?.type;);return t.splice(e,t.length)}function lr(t){if("flow-seq-start"===t.start.type)for(const e of t.items)!e.sep||e.value||or(e.start,"explicit-key-ind")||or(e.sep,"map-value-ind")||(e.key&&(e.value=e.key),delete e.key,sr(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}class fr{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new rr,this.onNewLine=t}*parse(t,e=!1){this.onNewLine&&0===this.offset&&this.onNewLine(0);for(const n of this.lexer.lex(t,e))yield*this.next(n);e||(yield*this.end())}*next(t){if(this.source=t,this.atScalar)return this.atScalar=!1,yield*this.step(),void(this.offset+=t.length);const e=function(t){switch(t){case"\ufeff":return"byte-order-mark";case"":return"doc-mode";case"":return"flow-error-end";case"":return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case"\n":case"\r\n":return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}(t);if(e)if("scalar"===e)this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=e,yield*this.step(),e){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&" "===t[0]&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{const e=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:e,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if("doc-end"!==this.type||t&&"doc-end"===t.type){if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}else{for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source})}}peek(t){return this.stack[this.stack.length-t]}*pop(t){const e=t??this.stack.pop();if(e)if(0===this.stack.length)yield e;else{const t=this.peek(1);switch("block-scalar"===e.type?e.indent="indent"in t?t.indent:0:"flow-collection"===e.type&&"document"===t.type&&(e.indent=0),"flow-collection"===e.type&&lr(e),t.type){case"document":t.value=e;break;case"block-scalar":t.props.push(e);break;case"block-map":{const n=t.items[t.items.length-1];if(n.value)return t.items.push({start:[],key:e,sep:[]}),void(this.onKeyLine=!0);if(!n.sep)return Object.assign(n,{key:e,sep:[]}),void(this.onKeyLine=!n.explicitKey);n.value=e;break}case"block-seq":{const n=t.items[t.items.length-1];n.value?t.items.push({start:[],value:e}):n.value=e;break}case"flow-collection":{const n=t.items[t.items.length-1];return void(!n||n.value?t.items.push({start:[],key:e,sep:[]}):n.sep?n.value=e:Object.assign(n,{key:e,sep:[]}))}default:yield*this.pop(),yield*this.pop(e)}if(!("document"!==t.type&&"block-map"!==t.type&&"block-seq"!==t.type||"block-map"!==e.type&&"block-seq"!==e.type)){const n=e.items[e.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&-1===ar(n.start)&&(0===e.indent||n.start.every((t=>"comment"!==t.type||t.indent=t.indent){const n=!this.onKeyLine&&this.indent===t.indent,r=n&&(e.sep||e.explicitKey)&&"seq-item-ind"!==this.type;let i=[];if(r&&e.sep&&!e.value){const n=[];for(let r=0;rt.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=e.sep.splice(n[1]))}switch(this.type){case"anchor":case"tag":return void(r||e.value?(i.push(this.sourceToken),t.items.push({start:i}),this.onKeyLine=!0):e.sep?e.sep.push(this.sourceToken):e.start.push(this.sourceToken));case"explicit-key-ind":return e.sep||e.explicitKey?r||e.value?(i.push(this.sourceToken),t.items.push({start:i,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}):(e.start.push(this.sourceToken),e.explicitKey=!0),void(this.onKeyLine=!0);case"map-value-ind":if(e.explicitKey)if(e.sep)if(e.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(or(e.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(sr(e.key)&&!or(e.sep,"newline")){const t=cr(e.start),n=e.key,r=e.sep;r.push(this.sourceToken),delete e.key,delete e.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:n,sep:r}]})}else i.length>0?e.sep=e.sep.concat(i,this.sourceToken):e.sep.push(this.sourceToken);else if(or(e.start,"newline"))Object.assign(e,{key:null,sep:[this.sourceToken]});else{const t=cr(e.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]})}else e.sep?e.value||r?t.items.push({start:i,key:null,sep:[this.sourceToken]}):or(e.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):e.sep.push(this.sourceToken):Object.assign(e,{key:null,sep:[this.sourceToken]});return void(this.onKeyLine=!0);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const n=this.flowScalar(this.type);return void(r||e.value?(t.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):e.sep?this.stack.push(n):(Object.assign(e,{key:n,sep:[]}),this.onKeyLine=!0))}default:{const e=this.startBlockValue(t);if(e)return n&&"block-seq"!==e.type&&t.items.push({start:i}),void this.stack.push(e)}}}yield*this.pop(),yield*this.step()}*blockSequence(t){const e=t.items[t.items.length-1];switch(this.type){case"newline":if(e.value){const n="end"in e.value?e.value.end:void 0,r=Array.isArray(n)?n[n.length-1]:void 0;"comment"===r?.type?n?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else e.start.push(this.sourceToken);return;case"space":case"comment":if(e.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(e.start,t.indent)){const n=t.items[t.items.length-2],r=n?.value?.end;if(Array.isArray(r))return Array.prototype.push.apply(r,e.start),r.push(this.sourceToken),void t.items.pop()}e.start.push(this.sourceToken)}return;case"anchor":case"tag":if(e.value||this.indent<=t.indent)break;return void e.start.push(this.sourceToken);case"seq-item-ind":if(this.indent!==t.indent)break;return void(e.value||or(e.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):e.start.push(this.sourceToken))}if(this.indent>t.indent){const e=this.startBlockValue(t);if(e)return void this.stack.push(e)}yield*this.pop(),yield*this.step()}*flowCollection(t){const e=t.items[t.items.length-1];if("flow-error-end"===this.type){let t;do{yield*this.pop(),t=this.peek(1)}while(t&&"flow-collection"===t.type)}else if(0===t.end.length){switch(this.type){case"comma":case"explicit-key-ind":return void(!e||e.sep?t.items.push({start:[this.sourceToken]}):e.start.push(this.sourceToken));case"map-value-ind":return void(!e||e.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):e.sep?e.sep.push(this.sourceToken):Object.assign(e,{key:null,sep:[this.sourceToken]}));case"space":case"comment":case"newline":case"anchor":case"tag":return void(!e||e.value?t.items.push({start:[this.sourceToken]}):e.sep?e.sep.push(this.sourceToken):e.start.push(this.sourceToken));case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const n=this.flowScalar(this.type);return void(!e||e.value?t.items.push({start:[],key:n,sep:[]}):e.sep?this.stack.push(n):Object.assign(e,{key:n,sep:[]}))}case"flow-map-end":case"flow-seq-end":return void t.end.push(this.sourceToken)}const n=this.startBlockValue(t);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{const e=this.peek(2);if("block-map"===e.type&&("map-value-ind"===this.type&&e.indent===t.indent||"newline"===this.type&&!e.items[e.items.length-1].sep))yield*this.pop(),yield*this.step();else if("map-value-ind"===this.type&&"flow-collection"!==e.type){const n=cr(ur(e));lr(t);const r=t.end.splice(1,t.end.length);r.push(this.sourceToken);const i={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:n,key:t,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let t=this.source.indexOf("\n")+1;for(;0!==t;)this.onNewLine(this.offset+t),t=this.source.indexOf("\n",t)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const e=cr(ur(t));return e.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const e=cr(ur(t));return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,e){return"comment"===this.type&&!(this.indent<=e)&&t.every((t=>"newline"===t.type||"space"===t.type))}*documentEnd(t){"doc-mode"!==this.type&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop())}}}function hr(t,e={}){const{lineCounter:n,prettyErrors:r}=function(t){const e=!1!==t.prettyErrors;return{lineCounter:t.lineCounter||e&&new ir||null,prettyErrors:e}}(e),i=new fr(n?.addNewLine),o=new Vn(e);let a=null;for(const e of o.compose(i.parse(t),!0,t.length))if(a){if("silent"!==a.options.logLevel){a.errors.push(new xn(e.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}else a=e;return r&&n&&(a.errors.forEach(On(t,n)),a.warnings.forEach(On(t,n))),a}class pr extends wn{constructor(t,e,n){super(t,e,"IMPOSSIBLE",n),this.name=t}pretty(t){this.linePos=t.lineCounter.linePos(this.pos);const{line:e,col:n}=this.linePos;this.message+=` at line ${e}, column ${n} ${t.file?" @"+t.file:""}`}}class dr{constructor(){this.lineCounter=new ir,this.src="",this.file="",this.txt="",this.errors=[],this.warnings=[],this.yaml_ok=!1,this.contents=null,this.listener=null,this.prog={}}errors(t){this.errors=this.errors.concat(t)}warnings(t){this.warnings=this.warnings.concat(t)}fileError(t){let e=new pr("FILE_ERROR",0,`FileError : ${t}`);return e.pretty(this),this.errors.push(e),e}syntaxError(t,e){let n=new pr("SYNTAX_ERROR",t.range?t.range[0]:0,`SyntaxError : ${e}`);return n.pretty(this),this.errors.push(n),n}syntaxWarning(t,e){let n=new pr("SYNTAX_WARNING",t.range?t.range[0]:0,`SyntaxWarning : ${e}`);return n.pretty(this),this.warnings.push(n),n}typeError(t,e){let n=new pr("TYPE_ERROR",t.range?t.range[0]:0,`TypeError : ${e}`);return n.pretty(this),this.errors.push(n),n}grammarError(t){let e=new pr("GRAMMAR_ERROR",0,`GrammarError : ${t}`);e.pretty(this),this.errors.push(e)}grammarWarning(t){let e=new pr("GRAMMAR_WARNING",0,`GrammarWarning : ${t}`);return e.pretty(this),this.warnings.push(e),e}fails(){return this.errors.length>0}success(){return 0===this.errors.length&&0===this.warnings.length}result(){return this.contents}}class mr{constructor(t,e,n){this.ctx=t,this.type=e,this.current=n,this.start=n.range[0],this.end=n.range[1],this.childs=[]}getChild(t){return this.childs[t]}getChildCount(){return this.childs.length}getValue(){return this.value}toString(){return this.value}}class yr extends mr{constructor(t,e,n){super(t,e,n)}equals(t){if(t instanceof yr)return this.value==t.value;this.ctx.syntaxError(this.current,`Error can not compare values '${this.value}' and '${t.value}'`)}}class gr extends yr{constructor(t,e){if(super(t,"string",e),!gr.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not a string`);this.value=e.value}static checkCurrent(t){return ut(t)&&"string"==typeof t.value}static parse(t,e){try{return new gr(t,e)}catch(t){return null}}}class vr extends yr{constructor(t,e){if(super(t,"binary",e),!vr.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not a base64 string`);this.value=e.value}static checkCurrent(t){return ut(t)&&"string"==typeof t.value&&/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/.test(t.value)}static parse(t,e){try{return new vr(t,e)}catch(t){return null}}}class br extends yr{constructor(t,e){if(super(t,"int",e),!br.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not an integer`);this.value=e.value}static checkCurrent(t){return ut(t)&&"number"==typeof t.value&&t.value==Math.floor(t.value)}static parse(t,e){try{return new br(t,e)}catch(t){return null}}}class _r extends yr{constructor(t,e){if(super(t,"float",e),!_r.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not a number`);this.value=e.value}static checkCurrent(t){return ut(t)&&"number"==typeof t.value}static parse(t,e){try{return new _r(t,e)}catch(t){return null}}}class wr extends yr{constructor(t,e){if(super(t,"boolean",e),this.value=null,!wr.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e.value}' is not a boolean`);this.value=e.value}static checkCurrent(t){return ut(t)&&"boolean"==typeof t.value}static parse(t,e){try{return new wr(t,e)}catch(t){return null}}}class xr extends yr{constructor(t,e){if(super(t,"null",e),this.value=null,!xr.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not the null value`)}static checkCurrent(t){return ut(t)&&(null==t.value||["Null","NULL","null","~"].includes(t.value))}static parse(t,e){try{return new xr(t,e)}catch(t){return null}}}class kr extends yr{constructor(t,e,n){if(super(t,"timestamp",e),!kr.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not a timestamp in ISO9601 format`);this.value=new Date(e.value)}static checkCurrent(t){let e=ut(t)&&"string"==typeof t.value&&/\d{4}-\d{2}-\d{2}|\d{4}-\d{2}?-\d{2}?([Tt]|[ \t]+)\d{2}?:\d{2}:\d{2}(\.\d*)?(([ \t]*)Z|[-+]\d\d?(:\d{2})?)?/.test(t.value);if(1==e)try{new Date(t.value)}catch(t){e=!1}return e}static parse(t,e){try{return new kr(t,e)}catch(t){return null}}equals(t){return t instanceof kr?this.value.getTime()==t.value.getTime():this.ctx.syntaxError("Error : can not compare a timestamp with something else")}}class Or extends mr{constructor(t,e,n){super(t,e,n)}length(){return this.childs.length}isEmpty(){return 0==this.length()}}class Sr extends Or{constructor(t,e,n){if(super(t,"map",e),"object"!=typeof n||n instanceof Array)throw t.syntaxError(e,"Erorr : MapNode must be initialized with a parsed map. This should not happen.");this.value=n;for(const t in n)this.childs.push(n[t])}static checkCurrent(t){return at(t)&&t.items.every((t=>t.key&&ut(t.key)&&"string"==typeof t.key.value))}}class Er{static parse(t,e,n){"object"!=typeof e&&t.grammarError("Error: oneof rule can not be parsed'");let r=e._oneOf;if(r instanceof Array){let e=[].concat(t.errors),i=[].concat(t.warnings),o=t.errors.length;for(let a of r){let r=Br(t,null,a,n);if(o==t.errors.length)return t.errors=e,t.warnings=i,r;o=t.errors.length}return t.syntaxError(n,"Syntax Error : no valid alternative found during parsing"),null}t.grammarError("Error: _oneof rules expects a sequence of alternatives")}}var Ar="undefined"!=typeof Symbol;function Tr(t){var e=typeof t;return"string"===e||"number"===e||"boolean"===e||!0===Ar&&"symbol"===e||null==t||!0===Ar&&t instanceof Symbol||t instanceof String||t instanceof Number||t instanceof Boolean}class Nr{static parse(t,e){if("object"==typeof e){if(e._oneOf){let n;!e._oneOf instanceof Array&&t.grammarError("Error : _oneof value have to be a list"),e._oneOf=e._oneOf.map((e=>Nr.parse(t,e)));do{if(n=e._oneOf.findIndex((t=>t._oneOf)),n>=0){let t=e._oneOf[n]._oneOf;(e={_oneOf:[].concat(e._oneOf)})._oneOf.splice(n,1),e._oneOf=e._oneOf.concat(t)}}while(n>=0);return e}if(e._merge){if(!(e._merge instanceof Array))return t.grammarError("Error : _merge value have to be a map"),null;const{_merge:n,...r}=e;let i;e={_merge:e._merge},Object.keys(r).length&&e._merge.push(r),e._merge=e._merge.map((e=>Tr(e)&&t.rules[e]?t.rules[e]:e)),e._merge=e._merge.map((e=>Nr.parse(t,e)));do{if(i=e._merge.findIndex((t=>t._merge)),i>=0){let t=e.one._merge;(e={_merge:[].concat(e._merge)})._merge.splice(i,1),e._merge=e._merge.concat(t)}}while(i>=0);let o={_oneOf:[]};do{if(i=(e={_merge:[].concat(e._merge)})._merge.findIndex((t=>t._oneOf)),i>=0){let t=e._merge[i]._oneOf;(e={_merge:[].concat(e._merge)})._merge.splice(i,1),t.forEach((t=>{let n={_merge:[t].concat(e._merge)};o._oneOf.push(n)}))}}while(i>=0);if(o._oneOf.length>=1)return Nr.parse(t,o);e._merge.some((t=>t._merge||t._oneOf))&&t.grammarError("Error : merge has not been processed successfully. This error should not occur.");let a={},s={},u=null,c=-1,l=-1,f=-1;e._merge.forEach((e=>{if(e._map){a={...a};for(let n in e._map)a.key&&t.grammarError("Error : can not merge two maps with some identical keys"),a[n]=e._map[n]}if(e._mapFacultative){s={...s};for(let n in e._mapFacultative)s.key&&t.grammarError("Error : can not merge two maps with some identical keys"),s[n]=e._mapFacultative[n]}if(e._mapOf){if(null!=u)return t.grammarError("Error : only one '_mapOf' is allowed in a '_merge' clause"),null;u=e._mapOf}e._nb&&(c<0||c==e._nb?c=e._nb:t.grammarError("Contradictory sizing in merge clause")),e._min&&(l=Math.max(e._min,l)),e._max&&(nax=c>0?Math.min(e._max,f):e._max)}));let h={};return c>=0&&(h._nb=c),l>=0&&(h._min=l),f>=0&&(h._max=f),Object.keys(a).length>0&&(h._map=a),Object.keys(s).length>0&&(h._mapFacultative=s),null!=u&&(h._mapOf=u),h}if(e._map){let n={};for(const r in e._map)n[r]=Nr.parse(t,e._map[r]);e._map=n}if(e._mapFacultative){let n={};for(const r in e._mapFacultative)n[r]=Nr.parse(t,e._mapFacultative[r]);e._mapFacultative=n}if(e._mapOf){let n={};for(const r in e._mapOf){let i=Nr.parse(t,r),o=Nr.parse(t,e._mapOf[r]);n[i]=o}e._mapOf=n}e._list&&(e._list=e._list.map((e=>Nr.parse(t,e)))),e._listFacultative&&(e._listFacultative=e._listFacultative.map((e=>Nr.parse(t,e)))),e._listOf&&(e._listOf=Nr.parse(t,e._listOf))}return e}}class Mr{static isPositiveInt(t){return"number"==typeof t&&t==Math.floor(t)&&t>0}static sizeChecker(t,e,n,r){if(Mr.isPositiveInt(n))if(at(r)||ct(r))switch(e){case"eq":return r.items.length==n;case"min":return r.items.length>=n;case"max":return r.items.length<=n}else t.syntaxError(r,"Error : a map is expected");else t.grammarError(`Error: the map checker '${e}' does not have a positive integer as value`);return!1}static sizeCheckers(t,e,n){return null==e._nb||Mr.sizeChecker(t,"eq",e._nb,n)?null==e._min||Mr.sizeChecker(t,"min",e._min,n)?!(null!=e._max&&!Mr.sizeChecker(t,"max",e._max,n)&&(t.syntaxError(n,`Error : map expected with more than ${e._max} elements but ${n.items.length} are provided`),1)):(t.syntaxError(n,`Error : map expected with more than ${e._min} elements but ${n.items.length} are provided`),!1):(t.syntaxError(n,`Error : map expected with ${e._nb} elements but ${n.items.length} are provided`),!1)}}class Cr{static parse(t,e,n){if(!Sr.checkCurrent(n))return t.syntaxError(n,"Error : a map whose keys are strings is expected "),null;if(e._merge&&(e=Nr.parse(t,e))._oneOf)return Er.parse(t,e,n);let r=e._map,i=e._mapOf,o=e._mapFacultative;if(null!=i&&"object"!=typeof i||null!=o&&"object"!=typeof o)return t.grammarError("Error : error in map value definition"),null;if(!Mr.sizeCheckers(t,e,n))return null;if(null!=r)for(let e in r){if("string"!=typeof e)return t.grammarError("Error : error in map definition"),null;if(!n.has(e))return t.syntaxError(n,`Error : key '${e}' not found in current value`),null}let a,s=null;if(i){let t=Object.entries(i);1==t.length&&([[a,s]]=t)}let u={};for(let i of n.items){let n=i.key.value,c=i.value,l=null;if(r&&r[n])l=Br(t,null,r[n],c);else if(o&&o[n])l=Br(t,null,o[n],c);else{if(!a||!s)return t.syntaxError(c,`Error : '${n}' is not a valid key (in rule : ${JSON.stringify(e)})`),null;{let e=Br(t,null,a,i.key);if(l=Br(t,null,s,c),e.value!=n)return t.syntaxError(n,`Error : '${n}' does not match expected '${a}' type`),null}}if(null==l)return t.syntaxError(c,`Error : bad value '${c}'found for '${n}' (mapparser.parse)`),null;let f=new gr(t,i.key);if(l.key=f,null!=u[n])return t.syntaxError(c,`Error : more than one value provided in the map for the key '${n}'`),null;u[n]=l}return new Sr(t,n,u)}static parse_any(t,e){if(!Sr.checkCurrent(e))return t.syntaxError(e,"Error : a map whose keys are strings is expected "),null;let n={};return e.items.forEach((e=>{let r=e.key.value,i=e.value,o=Lr.parse_any(t,i);if(null==o)return t.syntaxError(i,`Error : bad value '${i}' found for '${r}' (mapparser.parse_any)`),null;let a=new gr(t,e.key);o.key=a,null!=n[r]&&t.syntaxError(i,`Error : more than one value provided in the map for the key '${r}'`),n[r]=o})),new Sr(t,e,n)}}class jr extends Or{constructor(t,e,n){if(super(t,"list",e),!n instanceof Array)throw t.syntaxError(e,"Erorr : ListNode must be initialized with an array. This should not happen.");this.value=n,this.childs=this.value}static checkCurrent(t){return ct(t)}}class Pr{static parse(t,e,n){if(!jr.checkCurrent(n))return t.syntaxError(n,"Error : a list is expected "),null;if(!Mr.sizeCheckers(t,e,n))return null;let r=e._list,i=e._listOf,o=e._listFacultative;if(null!=r&&!(r instanceof Array)||null!=o&&!(o instanceof Array))return t.grammarError("Error : error in list value definition"),null;let a=0,s=n.items.length,u=[];r&&r.forEach((e=>{if(!(a{if(a{let r=Lr.parse_any(t,e);if(null==r)return t.SyntaxError(value,`Error : bad value '${value}' found for '${key}' (listparser.parse_any)`),null;n.push(r)})),new jr(t,e,n)}}class Lr{static parse(t,e,n){switch(e){case"string":return gr.parse(t,n);case"binary":return vr.parse(t,n);case"timestamp":return kr.parse(t,n);case"int":return br.parse(t,n);case"float":return _r.parse(t,n);case"boolean":return wr.parse(t,n);case"null":return xr.parse(t,n);case"any":return Lr.parse_any(t,n);default:return Fr(t,e,n)}}static parse_any(t,e){if(ut(e)){switch(typeof e.value){case"number":return br.checkCurrent(e)?br.parse(t,e):_r.parse(t,e);case"boolean":return wr.parse(t,e);case"string":return gr.parse(t,e);case"object":if(null==e.value)return xr.parse(t,e);t.syntaxError(e,`Error: value '${e.value}' is not a scalar value`);default:t.syntaxError(e,`Error: value '${e.value}' is not a scalar value`)}return null}return at(e)?Cr.parse_any(t,e):ct(e)?Pr.parse_any(t,e):null}}class Ir{static parse(t,e,n){"object"==typeof e&&e._in||t.grammarError("Error: can not parse _in rule'");let r=e._in;if(!(r instanceof Array))return t.grammarError("Error: _in rules expects a sequence of alternatives"),null;for(let e of r)if(!Tr(e))return t.grammarError("Error: _in rules expects each alternative to be a scalar"),null;if(!ut(n))return t.syntaxError(n,"Syntax Error : scalar value expected by rule '_in'"),null;let i=Lr.parse_any(t,n);if(i){let e=[].concat(t.errors),n=[].concat(t.warnings),o=t.errors.length,a=i.value;for(let s of r)if(s){let r=s==a?i:null;if(null!=r)return t.errors=e,t.warnings=n,r;o=t.errors.length}}return t.syntaxError(n,"Syntax Error : no valid alternative for '_in' rule found during parsing"),null}}class Dr{static parse(t,e,n){if(!gr.checkCurrent(n))return t.syntaxError(n,`Error: regular expressions match only strings, '${n?n.value:""}' is not a string`),null;let r=e._regex;if(null==r)return t.grammarError("Error : regep rule must have a value for key '_regex'"),null;let i=null;try{i=new RegExp(r)}catch(t){}return null==i?(t.grammarError(`Error: value '${i}' is not a valid regular expression`),null):i.test(n.value)?new gr(t,n):(t.syntaxError(n,`Error: value '${n.value}' does not match the regular expression '${i}'`),null)}}class Rr{static scalartypes=["string","int","float","null","boolean","binary","timestamp"];static keywords=["_map","_mapOf","_mapFacultative","_list","_listOf","_listFacultative","_oneOf","_regex","_nb","_min","_max","_in"];static throwOnError=!1;static parse(t,e,n,r){if(null==r)return t.fileError("No source to parse"),null;if(Rr.scalartypes.includes(e)||Rr.keywords.includes(e))return t.syntaxError(r,`'${e}' is not allowed as rule_name in Lidy Grammar (reserved keyword)`),null;let i="enter_"+e;r.ctx=t,t.listener&&t.listener[i]&&t.listener[i](r);let o=Br(t,null,n,r);if(this.throwOnError&&null===o)throw 0!==t.errors.length?t.errors[t.errors.length-1]:new Error("Unknown error encountered while parsing.");let a="exit_"+e;return t.listener&&t.listener[a]&&t.listener[a](o),o}}function Br(t,e,n,r){if(e)return Rr.parse(t,e,n,r);if(Tr(n))return Lr.parse(t,n,r);if("object"==typeof n){if(n._map||n._mapOf||n._mapFacultative||n._merge)return Cr.parse(t,n,r);if(n._list||n._listOf||n._listFacultative)return Pr.parse(t,n,r);if(n._oneOf)return Er.parse(t,n,r);if(n._regex)return Dr.parse(t,n,r);if(n._in)return Ir.parse(t,n,r)}return t.grammarError("Error : grammar error : no valid keyword found"),null}function Fr(t,e,n){let r=t.rules[e];return void 0!==r?Br(t,e,r,n):(t.grammarError(`no rule named ${e} found.`),null)}function $r(t){t.keyword||(t.keyword="main");let e=new dr;return e.file=t.abs_path,e.prog=t.prog,t.rules?e.rules=t.rules:function(t,e,n){try{t.rules=function(t,e,n){let r;const i=hr(t,n);if(!i)return null;if(i.warnings.forEach((t=>ie(i.options.logLevel,t))),i.errors.length>0){if("silent"!==i.options.logLevel)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}(e)}catch(e){throw t.errors.push(e),t.grammarError("ERROR : can not parse dsl ")}if("object"==(t.rules,!1))throw t.grammarError("ERROR : can not parse dsl ");if(!t.rules[n])throw Error("ERROR : no rule labeled '"+n+"' in the grammar")}(e,t.dsl_data,t.keyword),e.listener=t.listener,function(t,e){t.lineCounter=new ir;let n=hr(e,{lineCounter:t.lineCounter});n||t.fileError("can not parse the provided source code."),t.src=n.contents,t.txt=e,t.errors=n.errors,t.warnings=n.warnings,t.yaml_ok=0==t.errors.length&&0==t.warnings.length}(e,t.src_data),function(t,e,n){let r=Fr(t,e,n);return t.errors.filter((t=>t instanceof pr)).forEach((e=>e.pretty(t))),t.warnings.filter((t=>t instanceof pr)).forEach((e=>e.pretty(t))),t.contents=r,t}(e,t.keyword,e.src)}var qr={main:"root",root:{_oneOf:["pod","service","ingress","configMap","secret","persistentVolumeClaim","deployment","statefulSet","job","cronJob","standaloneContainer","standaloneConfigMapMount","standaloneSecretMount","standalonePersistentVolumeClaimMount","catchAll"]},uint16:"int",metadata:{_mapFacultative:{name:"string",namespace:"string",labels:{_mapOf:{string:"string"}},annotations:{_mapOf:{string:"string"}},finalizers:{_mapOf:{string:"string"}},ownerReferences:{_listOf:{_mapFacultative:{apiVersion:"string",blockOwnerDeletion:"boolean",controller:"boolean",kind:"string",name:"string",uid:"string"}}},managedFields:{_listOf:{_mapFacultative:{apiVersion:"string",fieldsType:"string",fieldsV1:{_mapOf:{string:"string"}},manager:"string",operation:"string",subresource:"string",time:"string"}}},generateName:"string",uid:"string",resourceVersion:"string",generation:"int",selfLink:"string",creationTimestamp:"string",deletionGracePeriodSeconds:"int",deletionTimestamp:"string"}},labelSelector:{_mapFacultative:{matchLabels:{_mapOf:{string:"string"}},matchExpressions:{_map:{key:"string",operator:{_in:["In","NotIn","Exists","DoesNotExist"]}},_mapFacultative:{values:{_listOf:"string"}}}}},pod:{_map:{apiVersion:"string",kind:{_in:["Pod"]}},_mapFacultative:{metadata:"metadata",spec:"podSpec"}},podSpec:{_mapFacultative:{containers:{_listOf:"container"},volumes:{_listOf:{_oneOf:["configMapVolume","secretVolume","persistentVolumeClaimVolume","any"]}}},_mapOf:{any:"any"}},container:{_mapFacultative:{name:"string",image:"string",ports:{_listOf:{_mapFacultative:{name:"string",protocol:"string",hostIP:"string",hostPort:"uint16",containerPort:"uint16"}}},volumeMounts:{_listOf:"volumeMount"}},_mapOf:{any:"any"}},volumeMount:{_map:{name:"string",mountPath:"string"},_mapFacultative:{subPath:"string",subPathExpr:"string",mountPropagation:{_in:["None","HostToContainer","Bidirectional"]},readOnly:"boolean"}},service:{_map:{apiVersion:"string",kind:{_in:["Service"]}},_mapFacultative:{metadata:"metadata",spec:{_mapFacultative:{type:{_in:["ClusterIP","NodePort","LoadBalancer","ExternalName"]},selector:{_mapOf:{string:"string"}},ports:{_listOf:{_mapFacultative:{name:"string",protocol:{_in:["TCP","UDP","SCTP"]},targetPort:{_oneOf:["string","int"]}},_map:{port:"uint16"}}},clusterIP:"string",externalName:"string",sessionAffinity:"string",sessionAffinityConfig:{_mapFacultative:{clientIP:{_mapFacultative:{timeoutSeconds:"int"}}}},clusterIPs:{_listOf:"string"},allocateLoadBalancerNodePorts:"boolean",externalIPs:{_listOf:"string"},externalTrafficPolicy:"string",healthCheckNodePort:"uint16",internalTrafficPolicy:"string",ipFamilies:{_listOf:"string"},ipFamilyPolicy:"string",loadBalancerClass:"string",loadBalancerSourceRanges:{_listOf:"string"},publishNotReadyAddresses:"boolean",loadBalancerIP:"string"}}}},ingress:{_map:{apiVersion:"string",kind:{_in:["Ingress"]}},_mapFacultative:{metadata:"metadata",spec:{_mapFacultative:{ingressClassName:"string",defaultBackend:"ingressBackend",rules:{_listOf:{_mapFacultative:{host:"string",http:{_map:{paths:{_listOf:{_mapFacultative:{path:"string"},_map:{pathType:{_in:["Exact","Prefix","ImplementationSpecific"]},backend:"ingressBackend"}}}}}}}},tls:{_listOf:{_mapFacultative:{hosts:{_listOf:"string"},secretName:"string"}}}}},status:"any"}},ingressBackend:{_mapFacultative:{service:{_map:{name:"string"},_mapFacultative:{port:{_mapFacultative:{name:"string",number:"uint16"}}}},resource:{_mapFacultative:{apiGroup:"string"},_map:{kind:"string",name:"string"}}}},configMap:{_map:{apiVersion:"string",kind:{_in:["ConfigMap"]}},_mapFacultative:{metadata:"metadata",data:{_mapOf:{string:"string"}},binaryData:{_mapOf:{string:"string"}},immutable:"boolean"}},configMapVolume:{_map:{name:"string"},_mapFacultative:{configMap:{_mapFacultative:{name:"string",defaultMode:"number",items:{_listOf:{_map:{key:"string",path:"string"},_mapFacultative:{mode:"number"}}},optional:"boolean"}}}},secret:{_map:{apiVersion:"string",kind:{_in:["Secret"]}},_mapFacultative:{metadata:"metadata",type:{_in:["Opaque","kubernetes.io/service-account-token","kubernetes.io/dockercfg","kubernetes.io/dockerconfigjson","kubernetes.io/basic-auth","kubernetes.io/ssh-auth","kubernetes.io/tls","bootstrap.kubernetes.io/token"]},stringData:{_mapOf:{string:"string"}},data:{_mapOf:{string:"string"}},immutable:"boolean"}},secretVolume:{_map:{name:"string"},_mapFacultative:{secret:{_mapFacultative:{secretName:"string",defaultMode:"number",items:{_listOf:{_map:{key:"string",path:"string"},_mapFacultative:{mode:"number"}}},optional:"boolean"}}}},persistentVolumeClaim:{_map:{apiVersion:"string",kind:{_in:["PersistentVolumeClaim"]}},_mapFacultative:{metadata:"metadata",spec:{_mapFacultative:{storageClassName:"string",accessModes:{_listOf:{_in:["ReadWriteOnce","ReadWriteMany","ReadWriteOncePod","ReadOnlyMany"]}},volumeMode:{_in:["Filesystem","Block"]},resources:{_mapFacultative:{limits:{_mapOf:{string:"string"}},requests:{_mapOf:{string:"string"}}}},volumeName:"string",selector:"labelSelector"}}}},persistentVolumeClaimVolume:{_map:{name:"string"},_mapFacultative:{persistentVolumeClaim:{_map:{claimName:"string"},_mapFacultative:{readOnly:"boolean"}}}},deployment:{_map:{apiVersion:"string",kind:{_in:["Deployment"]}},_mapFacultative:{metadata:"metadata",spec:"deploymentSpec"}},deploymentSpec:{_mapFacultative:{replicas:"int",strategy:{_mapFacultative:{type:{_in:["RollingUpdate","Recreate"]},rollingUpdate:{_mapFacultative:{maxSurge:{_oneOf:["string","int"]},maxUnavailable:{_oneOf:["string","int"]}}}}},revisionHistoryLimit:"int",minReadySeconds:"int",progressDeadlineSeconds:"int",paused:"boolean",selector:"labelSelector",template:{_mapFacultative:{metadata:"metadata",spec:"podSpec"}}}},statefulSet:{_map:{apiVersion:"string",kind:{_in:["StatefulSet"]}},_mapFacultative:{metadata:"metadata",spec:"statefulSetSpec"}},statefulSetSpec:{_mapFacultative:{selector:"labelSelector",template:{_mapFacultative:{metadata:"metadata",spec:"podSpec"}}},_mapOf:{any:"any"}},job:{_map:{apiVersion:"string",kind:{_in:["Job"]}},_mapFacultative:{metadata:"metadata",spec:"jobSpec"}},jobSpec:{_mapFacultative:{selector:"labelSelector",template:{_mapFacultative:{metadata:"metadata",spec:"podSpec"}}},_mapOf:{any:"any"}},cronJob:{_map:{apiVersion:"string",kind:{_in:["CronJob"]}},_mapFacultative:{metadata:"metadata",spec:"cronJobSpec"}},cronJobSpec:{_mapFacultative:{jobTemplate:{_mapFacultative:{metadata:"metadata",spec:"jobSpec"}}},_mapOf:{any:"any"}},standaloneContainer:{_map:{apiVersion:"string",kind:{_in:["Container"]}},_mapFacultative:{name:"string",image:"string",ports:{_listOf:{_mapFacultative:{name:"string",protocol:"string",hostIP:"string",hostPort:"uint16",containerPort:"uint16"}}},volumeMounts:{_listOf:"volumeMount"}},_mapOf:{any:"any"}},catchAll:{_mapOf:{any:"any"}}};function Ur(t){return Ur="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ur(t)}function Kr(t,e){for(var n=0;n=0)return!1;var e=/\.ya?ml$/.test(t.path);return t.content&&0!==t.content.trim().length?e&&["apiVersion","kind"].every((function(e){return t.content.includes(e)})):e}},{key:"getModels",value:function(){var t=this;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).filter((function(e){return t.isParsable(e)})).reduce((function(t,e){var n=e.path.split("/").slice(0,-1).join("/");return t.includes(n)||t.push(n),t}),[])}},{key:"parse",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.pluginData.components=[],this.pluginData.parseErrors=[],n.filter((function(e){return e.path.split("/").slice(0,-1).join("/")===t.path})).filter((function(t){var n=t.content,i=t.path;return!(!n||""===n.trim())||(e.pluginData.emitEvent({parent:r,type:"Parser",action:"read",status:"warning",files:[i],data:{code:"no_content",global:!1}}),!1)})).forEach((function(t){var n=e.pluginData.emitEvent({parent:r,type:"Parser",action:"read",status:"running",files:[t.path],data:{global:!1}}),i=new Yr(e.pluginData,t);!function(t){t.rules=qr,$r(t)}({src_data:t.content,listener:i,path:t.path,prog:{errors:[],warnings:[],imports:[],alreadyImported:[],root:[]}}),e.pluginData.emitEvent({id:n,status:"success"})})),this.__convertSelectorAttributesToLinks()}},{key:"__convertSelectorAttributesToLinks",value:function(){var t=this;this.pluginData.components.forEach((function(e){var n,r=e.getAttributeByName("selector");"Link"===(null==r||null===(n=r.definition)||void 0===n?void 0:n.type)&&(r.value=t.pluginData.getComponentsByType(r.definition.linkRef).filter((function(e){var n,i=null===(n=e.attributes.find((function(t){return"metadata"===t.name})))||void 0===n||null===(n=n.value)||void 0===n?void 0:n.find((function(t){return"labels"===t.name}));if(!i)return!1;var o=t.__convertObjectAttributeToJsObject(r),a=t.__convertObjectAttributeToJsObject(i),s=Object.keys(o);return s.length&&s.every((function(t){return o[t]===a[t]}))})).map((function(t){return t.id})))}))}},{key:"__convertObjectAttributeToJsObject",value:function(t){return t.value.reduce((function(t,e){var n=e.name,r=e.value;return t[n]=r,t}),{})}}],r&&Wr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(t.DefaultParser);function ei(t){return null==t}var ni={isNothing:ei,isObject:function(t){return"object"==typeof t&&null!==t},toArray:function(t){return Array.isArray(t)?t:ei(t)?[]:[t]},repeat:function(t,e){var n,r="";for(n=0;ns&&(e=r-s+(o=" ... ").length),n-r>s&&(n=r+s-(a=" ...").length),{str:o+t.slice(e,n).replace(/\t/g,"→")+a,pos:r-e+o.length}}function si(t,e){return ni.repeat(" ",e-t.length)+t}var ui=function(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),"number"!=typeof e.indent&&(e.indent=1),"number"!=typeof e.linesBefore&&(e.linesBefore=3),"number"!=typeof e.linesAfter&&(e.linesAfter=2);for(var n,r=/\r?\n|\r|\0/g,i=[0],o=[],a=-1;n=r.exec(t.buffer);)o.push(n.index),i.push(n.index+n[0].length),t.position<=n.index&&a<0&&(a=i.length-2);a<0&&(a=i.length-1);var s,u,c="",l=Math.min(t.line+e.linesAfter,o.length).toString().length,f=e.maxLength-(e.indent+l+3);for(s=1;s<=e.linesBefore&&!(a-s<0);s++)u=ai(t.buffer,i[a-s],o[a-s],t.position-(i[a]-i[a-s]),f),c=ni.repeat(" ",e.indent)+si((t.line-s+1).toString(),l)+" | "+u.str+"\n"+c;for(u=ai(t.buffer,i[a],o[a],t.position,f),c+=ni.repeat(" ",e.indent)+si((t.line+1).toString(),l)+" | "+u.str+"\n",c+=ni.repeat("-",e.indent+l+3+u.pos)+"^\n",s=1;s<=e.linesAfter&&!(a+s>=o.length);s++)u=ai(t.buffer,i[a+s],o[a+s],t.position-(i[a]-i[a+s]),f),c+=ni.repeat(" ",e.indent)+si((t.line+s+1).toString(),l)+" | "+u.str+"\n";return c.replace(/\n$/,"")},ci=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],li=["scalar","sequence","mapping"],fi=function(t,e){if(e=e||{},Object.keys(e).forEach((function(e){if(-1===ci.indexOf(e))throw new oi('Unknown option "'+e+'" is met in definition of "'+t+'" YAML type.')})),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=function(t){var e={};return null!==t&&Object.keys(t).forEach((function(n){t[n].forEach((function(t){e[String(t)]=n}))})),e}(e.styleAliases||null),-1===li.indexOf(this.kind))throw new oi('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')};function hi(t,e){var n=[];return t[e].forEach((function(t){var e=n.length;n.forEach((function(n,r){n.tag===t.tag&&n.kind===t.kind&&n.multi===t.multi&&(e=r)})),n[e]=t})),n}function pi(t){return this.extend(t)}pi.prototype.extend=function(t){var e=[],n=[];if(t instanceof fi)n.push(t);else if(Array.isArray(t))n=n.concat(t);else{if(!t||!Array.isArray(t.implicit)&&!Array.isArray(t.explicit))throw new oi("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.implicit&&(e=e.concat(t.implicit)),t.explicit&&(n=n.concat(t.explicit))}e.forEach((function(t){if(!(t instanceof fi))throw new oi("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(t.loadKind&&"scalar"!==t.loadKind)throw new oi("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(t.multi)throw new oi("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),n.forEach((function(t){if(!(t instanceof fi))throw new oi("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var r=Object.create(pi.prototype);return r.implicit=(this.implicit||[]).concat(e),r.explicit=(this.explicit||[]).concat(n),r.compiledImplicit=hi(r,"implicit"),r.compiledExplicit=hi(r,"explicit"),r.compiledTypeMap=function(){var t,e,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function r(t){t.multi?(n.multi[t.kind].push(t),n.multi.fallback.push(t)):n[t.kind][t.tag]=n.fallback[t.tag]=t}for(t=0,e=arguments.length;t=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Oi=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),Si=/^[-+]?[0-9]+e/,Ei=new fi("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(t){return null!==t&&!(!Oi.test(t)||"_"===t[t.length-1])},construct:function(t){var e,n;return n="-"===(e=t.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),".inf"===e?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===e?NaN:n*parseFloat(e,10)},predicate:function(t){return"[object Number]"===Object.prototype.toString.call(t)&&(t%1!=0||ni.isNegativeZero(t))},represent:function(t,e){var n;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(ni.isNegativeZero(t))return"-0.0";return n=t.toString(10),Si.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"}),Ai=vi.extend({implicit:[bi,_i,ki,Ei]}),Ti=Ai,Ni=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Mi=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"),Ci=new fi("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(t){return null!==t&&(null!==Ni.exec(t)||null!==Mi.exec(t))},construct:function(t){var e,n,r,i,o,a,s,u,c=0,l=null;if(null===(e=Ni.exec(t))&&(e=Mi.exec(t)),null===e)throw new Error("Date resolve error");if(n=+e[1],r=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(n,r,i));if(o=+e[4],a=+e[5],s=+e[6],e[7]){for(c=e[7].slice(0,3);c.length<3;)c+="0";c=+c}return e[9]&&(l=6e4*(60*+e[10]+ +(e[11]||0)),"-"===e[9]&&(l=-l)),u=new Date(Date.UTC(n,r,i,o,a,s,c)),l&&u.setTime(u.getTime()-l),u},instanceOf:Date,represent:function(t){return t.toISOString()}}),ji=new fi("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(t){return"<<"===t||null===t}}),Pi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r",Li=new fi("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e,n,r=0,i=t.length,o=Pi;for(n=0;n64)){if(e<0)return!1;r+=6}return r%8==0},construct:function(t){var e,n,r=t.replace(/[\r\n=]/g,""),i=r.length,o=Pi,a=0,s=[];for(e=0;e>16&255),s.push(a>>8&255),s.push(255&a)),a=a<<6|o.indexOf(r.charAt(e));return 0==(n=i%4*6)?(s.push(a>>16&255),s.push(a>>8&255),s.push(255&a)):18===n?(s.push(a>>10&255),s.push(a>>2&255)):12===n&&s.push(a>>4&255),new Uint8Array(s)},predicate:function(t){return"[object Uint8Array]"===Object.prototype.toString.call(t)},represent:function(t){var e,n,r="",i=0,o=t.length,a=Pi;for(e=0;e>18&63],r+=a[i>>12&63],r+=a[i>>6&63],r+=a[63&i]),i=(i<<8)+t[e];return 0==(n=o%3)?(r+=a[i>>18&63],r+=a[i>>12&63],r+=a[i>>6&63],r+=a[63&i]):2===n?(r+=a[i>>10&63],r+=a[i>>4&63],r+=a[i<<2&63],r+=a[64]):1===n&&(r+=a[i>>2&63],r+=a[i<<4&63],r+=a[64],r+=a[64]),r}}),Ii=Object.prototype.hasOwnProperty,Di=Object.prototype.toString,Ri=new fi("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(t){if(null===t)return!0;var e,n,r,i,o,a=[],s=t;for(e=0,n=s.length;e>10),56320+(t-65536&1023))}for(var lo=new Array(256),fo=new Array(256),ho=0;ho<256;ho++)lo[ho]=uo(ho)?1:0,fo[ho]=uo(ho);function po(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||Ui,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function mo(t,e){var n={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return n.snippet=ui(n),new oi(e,n)}function yo(t,e){throw mo(t,e)}function go(t,e){t.onWarning&&t.onWarning.call(null,mo(t,e))}var vo={YAML:function(t,e,n){var r,i,o;null!==t.version&&yo(t,"duplication of %YAML directive"),1!==n.length&&yo(t,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&yo(t,"ill-formed argument of the YAML directive"),i=parseInt(r[1],10),o=parseInt(r[2],10),1!==i&&yo(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=o<2,1!==o&&2!==o&&go(t,"unsupported YAML version of the document")},TAG:function(t,e,n){var r,i;2!==n.length&&yo(t,"TAG directive accepts exactly two arguments"),r=n[0],i=n[1],to.test(r)||yo(t,"ill-formed tag handle (first argument) of the TAG directive"),Ki.call(t.tagMap,r)&&yo(t,'there is a previously declared suffix for "'+r+'" tag handle'),eo.test(i)||yo(t,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch(e){yo(t,"tag prefix is malformed: "+i)}t.tagMap[r]=i}};function bo(t,e,n,r){var i,o,a,s;if(e1&&(t.result+=ni.repeat("\n",e-1))}function Eo(t,e){var n,r,i=t.tag,o=t.anchor,a=[],s=!1;if(-1!==t.firstTabInLine)return!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=a),r=t.input.charCodeAt(t.position);0!==r&&(-1!==t.firstTabInLine&&(t.position=t.firstTabInLine,yo(t,"tab characters must not be used in indentation")),45===r)&&oo(t.input.charCodeAt(t.position+1));)if(s=!0,t.position++,ko(t,!0,-1)&&t.lineIndent<=e)a.push(null),r=t.input.charCodeAt(t.position);else if(n=t.line,No(t,e,Yi,!1,!0),a.push(t.result),ko(t,!0,-1),r=t.input.charCodeAt(t.position),(t.line===n||t.lineIndent>e)&&0!==r)yo(t,"bad indentation of a sequence entry");else if(t.lineIndente?d=1:t.lineIndent===e?d=0:t.lineIndente?d=1:t.lineIndent===e?d=0:t.lineIndente)&&(g&&(a=t.line,s=t.lineStart,u=t.position),No(t,e,Hi,!0,i)&&(g?m=t.result:y=t.result),g||(wo(t,h,p,d,m,y,a,s,u),d=m=y=null),ko(t,!0,-1),c=t.input.charCodeAt(t.position)),(t.line===o||t.lineIndent>e)&&0!==c)yo(t,"bad indentation of a mapping entry");else if(t.lineIndent=0))break;0===i?yo(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?yo(t,"repeat of an indentation width identifier"):(l=e+i-1,c=!0)}if(io(o)){do{o=t.input.charCodeAt(++t.position)}while(io(o));if(35===o)do{o=t.input.charCodeAt(++t.position)}while(!ro(o)&&0!==o)}for(;0!==o;){for(xo(t),t.lineIndent=0,o=t.input.charCodeAt(t.position);(!c||t.lineIndentl&&(l=t.lineIndent),ro(o))f++;else{if(t.lineIndent0){for(i=a,o=0;i>0;i--)(a=so(s=t.input.charCodeAt(++t.position)))>=0?o=(o<<4)+a:yo(t,"expected hexadecimal character");t.result+=co(o),t.position++}else yo(t,"unknown escape sequence");n=r=t.position}else ro(s)?(bo(t,n,r,!0),So(t,ko(t,!1,e)),n=r=t.position):t.position===t.lineStart&&Oo(t)?yo(t,"unexpected end of the document within a double quoted scalar"):(t.position++,r=t.position)}yo(t,"unexpected end of the stream within a double quoted scalar")}(t,h)?y=!0:function(t){var e,n,r;if(42!==(r=t.input.charCodeAt(t.position)))return!1;for(r=t.input.charCodeAt(++t.position),e=t.position;0!==r&&!oo(r)&&!ao(r);)r=t.input.charCodeAt(++t.position);return t.position===e&&yo(t,"name of an alias node must contain at least one character"),n=t.input.slice(e,t.position),Ki.call(t.anchorMap,n)||yo(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],ko(t,!0,-1),!0}(t)?(y=!0,null===t.tag&&null===t.anchor||yo(t,"alias node should not have any properties")):function(t,e,n){var r,i,o,a,s,u,c,l,f=t.kind,h=t.result;if(oo(l=t.input.charCodeAt(t.position))||ao(l)||35===l||38===l||42===l||33===l||124===l||62===l||39===l||34===l||37===l||64===l||96===l)return!1;if((63===l||45===l)&&(oo(r=t.input.charCodeAt(t.position+1))||n&&ao(r)))return!1;for(t.kind="scalar",t.result="",i=o=t.position,a=!1;0!==l;){if(58===l){if(oo(r=t.input.charCodeAt(t.position+1))||n&&ao(r))break}else if(35===l){if(oo(t.input.charCodeAt(t.position-1)))break}else{if(t.position===t.lineStart&&Oo(t)||n&&ao(l))break;if(ro(l)){if(s=t.line,u=t.lineStart,c=t.lineIndent,ko(t,!1,-1),t.lineIndent>=e){a=!0,l=t.input.charCodeAt(t.position);continue}t.position=o,t.line=s,t.lineStart=u,t.lineIndent=c;break}}a&&(bo(t,i,o,!1),So(t,t.line-s),i=o=t.position,a=!1),io(l)||(o=t.position+1),l=t.input.charCodeAt(++t.position)}return bo(t,i,o,!1),!!t.result||(t.kind=f,t.result=h,!1)}(t,h,zi===n)&&(y=!0,null===t.tag&&(t.tag="?")),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):0===d&&(y=s&&Eo(t,p))),null===t.tag)null!==t.anchor&&(t.anchorMap[t.anchor]=t.result);else if("?"===t.tag){for(null!==t.result&&"scalar"!==t.kind&&yo(t,'unacceptable node kind for ! tag; it should be "scalar", not "'+t.kind+'"'),u=0,c=t.implicitTypes.length;u"),null!==t.result&&f.kind!==t.kind&&yo(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+f.kind+'", not "'+t.kind+'"'),f.resolve(t.result,t.tag)?(t.result=f.construct(t.result,t.tag),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):yo(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return null!==t.listener&&t.listener("close",t),null!==t.tag||null!==t.anchor||y}function Mo(t){var e,n,r,i,o=t.position,a=!1;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);0!==(i=t.input.charCodeAt(t.position))&&(ko(t,!0,-1),i=t.input.charCodeAt(t.position),!(t.lineIndent>0||37!==i));){for(a=!0,i=t.input.charCodeAt(++t.position),e=t.position;0!==i&&!oo(i);)i=t.input.charCodeAt(++t.position);for(r=[],(n=t.input.slice(e,t.position)).length<1&&yo(t,"directive name must not be less than one character in length");0!==i;){for(;io(i);)i=t.input.charCodeAt(++t.position);if(35===i){do{i=t.input.charCodeAt(++t.position)}while(0!==i&&!ro(i));break}if(ro(i))break;for(e=t.position;0!==i&&!oo(i);)i=t.input.charCodeAt(++t.position);r.push(t.input.slice(e,t.position))}0!==i&&xo(t),Ki.call(vo,n)?vo[n](t,n,r):go(t,'unknown document directive "'+n+'"')}ko(t,!0,-1),0===t.lineIndent&&45===t.input.charCodeAt(t.position)&&45===t.input.charCodeAt(t.position+1)&&45===t.input.charCodeAt(t.position+2)?(t.position+=3,ko(t,!0,-1)):a&&yo(t,"directives end mark is expected"),No(t,t.lineIndent-1,Hi,!1,!0),ko(t,!0,-1),t.checkLineBreaks&&Qi.test(t.input.slice(o,t.position))&&go(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&Oo(t)?46===t.input.charCodeAt(t.position)&&(t.position+=3,ko(t,!0,-1)):t.position=55296&&r<=56319&&e+1=56320&&n<=57343?1024*(r-55296)+n-56320+65536:r}function ba(t){return/^\n* /.test(t)}var _a=1,wa=2,xa=3,ka=4,Oa=5;function Sa(t,e,n,r,i){t.dump=function(){if(0===e.length)return t.quotingType===la?'""':"''";if(!t.noCompatMode&&(-1!==sa.indexOf(e)||ua.test(e)))return t.quotingType===la?'"'+e+'"':"'"+e+"'";var o=t.indent*Math.max(1,n),a=-1===t.lineWidth?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-o),s=r||t.flowLevel>-1&&n>=t.flowLevel;switch(function(t,e,n,r,i,o,a,s){var u,c,l=0,f=null,h=!1,p=!1,d=-1!==r,m=-1,y=ma(c=va(t,0))&&c!==Io&&!da(c)&&c!==Wo&&c!==Qo&&c!==Go&&c!==Ho&&c!==ta&&c!==ea&&c!==ra&&c!==oa&&c!==Uo&&c!==zo&&c!==Yo&&c!==$o&&c!==ia&&c!==Jo&&c!==Xo&&c!==Vo&&c!==qo&&c!==Ko&&c!==Zo&&c!==na&&function(t){return!da(t)&&t!==Go}(va(t,t.length-1));if(e||a)for(u=0;u=65536?u+=2:u++){if(!ma(l=va(t,u)))return Oa;y=y&&ga(l,f,s),f=l}else{for(u=0;u=65536?u+=2:u++){if((l=va(t,u))===Ro)h=!0,d&&(p=p||u-m-1>r&&" "!==t[m+1],m=u);else if(!ma(l))return Oa;y=y&&ga(l,f,s),f=l}p=p||d&&u-m-1>r&&" "!==t[m+1]}return h||p?n>9&&ba(t)?Oa:a?o===la?Oa:wa:p?ka:xa:!y||a||i(t)?o===la?Oa:wa:_a}(e,s,t.indent,a,(function(e){return function(t,e){var n,r;for(n=0,r=t.implicitTypes.length;n"+Ea(e,t.indent)+Aa(ha(function(t,e){for(var n,r,i,o=/(\n+)([^\n]*)/g,a=(i=-1!==(i=t.indexOf("\n"))?i:t.length,o.lastIndex=i,Ta(t.slice(0,i),e)),s="\n"===t[0]||" "===t[0];r=o.exec(t);){var u=r[1],c=r[2];n=" "===c[0],a+=u+(s||n||""===c?"":"\n")+Ta(c,e),s=n}return a}(e,a),o));case Oa:return'"'+function(t){for(var e,n="",r=0,i=0;i=65536?i+=2:i++)r=va(t,i),!(e=aa[r])&&ma(r)?(n+=t[i],r>=65536&&(n+=t[i+1])):n+=e||ca(r);return n}(e)+'"';default:throw new oi("impossible error: invalid scalar style")}}()}function Ea(t,e){var n=ba(t)?String(e):"",r="\n"===t[t.length-1];return n+(!r||"\n"!==t[t.length-2]&&"\n"!==t?r?"":"-":"+")+"\n"}function Aa(t){return"\n"===t[t.length-1]?t.slice(0,-1):t}function Ta(t,e){if(""===t||" "===t[0])return t;for(var n,r,i=/ [^ ]/g,o=0,a=0,s=0,u="";n=i.exec(t);)(s=n.index)-o>e&&(r=a>o?a:s,u+="\n"+t.slice(o,r),o=r+1),a=s;return u+="\n",t.length-o>e&&a>o?u+=t.slice(o,a)+"\n"+t.slice(a+1):u+=t.slice(o),u.slice(1)}function Na(t,e,n,r){var i,o,a,s="",u=t.tag;for(i=0,o=n.length;i tag resolver accepts not "'+u+'" style');r=s.represent[u](e,u)}t.dump=r}return!0}return!1}function Ca(t,e,n,r,i,o,a){t.tag=null,t.dump=n,Ma(t,n,!1)||Ma(t,n,!0);var s,u=Po.call(t.dump),c=r;r&&(r=t.flowLevel<0||t.flowLevel>e);var l,f,h="[object Object]"===u||"[object Array]"===u;if(h&&(f=-1!==(l=t.duplicates.indexOf(n))),(null!==t.tag&&"?"!==t.tag||f||2!==t.indent&&e>0)&&(i=!1),f&&t.usedDuplicates[l])t.dump="*ref_"+l;else{if(h&&f&&!t.usedDuplicates[l]&&(t.usedDuplicates[l]=!0),"[object Object]"===u)r&&0!==Object.keys(t.dump).length?(function(t,e,n,r){var i,o,a,s,u,c,l="",f=t.tag,h=Object.keys(n);if(!0===t.sortKeys)h.sort();else if("function"==typeof t.sortKeys)h.sort(t.sortKeys);else if(t.sortKeys)throw new oi("sortKeys must be a boolean or a function");for(i=0,o=h.length;i1024)&&(t.dump&&Ro===t.dump.charCodeAt(0)?c+="?":c+="? "),c+=t.dump,u&&(c+=pa(t,e)),Ca(t,e+1,s,!0,u)&&(t.dump&&Ro===t.dump.charCodeAt(0)?c+=":":c+=": ",l+=c+=t.dump));t.tag=f,t.dump=l||"{}"}(t,e,t.dump,i),f&&(t.dump="&ref_"+l+t.dump)):(function(t,e,n){var r,i,o,a,s,u="",c=t.tag,l=Object.keys(n);for(r=0,i=l.length;r1024&&(s+="? "),s+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),Ca(t,e,a,!1,!1)&&(u+=s+=t.dump));t.tag=c,t.dump="{"+u+"}"}(t,e,t.dump),f&&(t.dump="&ref_"+l+" "+t.dump));else if("[object Array]"===u)r&&0!==t.dump.length?(t.noArrayIndent&&!a&&e>0?Na(t,e-1,t.dump,i):Na(t,e,t.dump,i),f&&(t.dump="&ref_"+l+t.dump)):(function(t,e,n){var r,i,o,a="",s=t.tag;for(r=0,i=n.length;r",t.dump=s+" "+t.dump)}return!0}function ja(t,e){var n,r,i=[],o=[];for(Pa(t,i,o),n=0,r=o.length;n0&&void 0!==arguments[0]?arguments[0]:null;return this.pluginData.components.filter((function(t){return!t.getContainerId()})).map((function(r){var i=e.pluginData.emitEvent({parent:n,type:"Render",action:"write",status:"running",files:[r.path],data:{global:!1}}),o=new t.FileInput({path:r.path,content:Ia.dump(e.__formatComponent(r,!1),{lineWidth:-1,noRefs:!0})});return e.pluginData.emitEvent({id:i,status:"success"}),o}))}},{key:"__formatComponent",value:function(t,e){var n=this.__formatAttributes(t.attributes);if("others"===t.definition.apiVersion?n=this.__insertFront(n,"name",t.id):(n=this.__insertFront(n,"metadata",this.__insertFront(n.metadata||{},"name",t.id)),Object.keys(n.metadata.labels||{}).length||(n.metadata.labels={"app.kubernetes.io/name":t.id})),e||(n=this.__insertFront(n,"kind",t.definition.type),n=this.__insertFront(n,"apiVersion",t.definition.apiVersion)),this.__insertChildComponentsAttributes(n,t),["Deployment","StatefulSet","Job"].includes(t.definition.type)){var r,i,o,a=null===(r=n.spec)||void 0===r?void 0:r.template;a&&((i=n).spec||(i.spec={}),(o=n.spec).selector||(o.selector={}),n.spec.selector.matchLabels=a.metadata.labels,delete n.spec.template,n.spec.template=a)}return n}},{key:"__formatAttributes",value:function(t){var e=this;return t.reduce((function(t,n,r){var i,o;if("Object"===n.type)t[n.name||r]=e.__formatAttributes(n.value);else if("Link"===(null===(i=n.definition)||void 0===i?void 0:i.type))t[n.name]="selector"===n.name?e.__formatSelectorLinkAttribute(n):n.value[0];else if("Array"===n.type){var a;t[n.name]="Object"===(null===(a=n.value[0])||void 0===a?void 0:a.type)?Object.values(e.__formatAttributes(n.value)):n.value}else"Reference"===(null===(o=n.definition)||void 0===o?void 0:o.type)||"isInitContainer"===n.name||(t[n.name]=n.value);return t}),{})}},{key:"__formatSelectorLinkAttribute",value:function(t){var e,n;if(null===(e=t.value)||void 0===e||!e.length)return{};var r=t.value[0],i=this.pluginData.getComponentById(r);if(!i)throw new Error("Target component not found '".concat(r,"'."));var o=null===(n=i.attributes.find((function(t){return"metadata"===t.name})))||void 0===n||null===(n=n.value)||void 0===n||null===(n=n.find((function(t){return"labels"===t.name})))||void 0===n?void 0:n.value;return null!=o&&o.length?this.__formatAttributes(o):{"app.kubernetes.io/name":i.id}}},{key:"__insertChildComponentsAttributes",value:function(t,e){var n=this;if(e.definition.definedAttributes.find((function(t){return"spec"===t.name}))){var r=this.pluginData.getChildren(e.id);e.definition.childrenIndex.forEach((function(i){var o=i.attributeName,a=i.componentType,s=r.filter((function(t){return t.definition.type===a}));if(s.length)if(t.spec||(t.spec={}),"Pod"===e.definition.type){var u="initContainers"===o,c=s.filter((function(t){return t.getAttributeByName("isInitContainer").value===u}));c.length&&(t.spec[o]=c.map((function(t){return n.__formatComponent(t,!0)})))}else t.spec[o]=n.__formatComponent(s[0],!0)}))}}},{key:"__insertFront",value:function(t,e,n){return delete t[e],function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{event:null};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=new h,r=new _(n,{name:Ha.UU,version:Ha.rE},t.event);return Ga(this,e,[{configuration:n,pluginData:r,pluginMetadata:new J(r),pluginParser:new ti(r),pluginRenderer:new Ya(r)}])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Qa(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(t.DefaultPlugin)})();var i=exports;for(var o in r)i[o]=r[o];r.__esModule&&Object.defineProperty(i,"__esModule",{value:!0})})(); \ No newline at end of file From 3d8e354e2642b7a210a04d2474aa20b85fa9ba44 Mon Sep 17 00:00:00 2001 From: AlexisNeveu Date: Tue, 1 Oct 2024 11:19:51 +0200 Subject: [PATCH 3/3] Update Changelog --- changelog.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/changelog.md b/changelog.md index d0669bc..59f91ef 100644 --- a/changelog.md +++ b/changelog.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) +### Added + +- Network Policy Component. + ## [0.3.2] - 2024/08/20 ### Fixed