diff --git a/changelog.md b/changelog.md index ab2162b..ff90df9 100644 --- a/changelog.md +++ b/changelog.md @@ -5,7 +5,7 @@ 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) -## [Unreleased] +## [0.3.4] - 2024/07/09 ### Changed @@ -96,6 +96,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Setup first version of parser. - Setup first version of renderer. +[0.3.4]: https://github.com/ditrit/githubator-plugin/blob/main/changelog.md#0.3.4 [0.3.3]: https://github.com/ditrit/githubator-plugin/blob/main/changelog.md#0.3.3 [0.3.2]: https://github.com/ditrit/githubator-plugin/blob/main/changelog.md#0.3.2 [0.3.1]: https://github.com/ditrit/githubator-plugin/blob/main/changelog.md#0.3.1 diff --git a/dist/githubator-plugin.js b/dist/githubator-plugin.js index 335827b..49df461 100644 --- a/dist/githubator-plugin.js +++ b/dist/githubator-plugin.js @@ -1,2 +1,2 @@ /*! For license information please see githubator-plugin.js.LICENSE.txt */ -(()=>{var t={916:(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:v,Output:$,Capture:K,TemplateData:U,If:b,IfAsync:_,InlineIf:w,For:x,AsyncEach:k,AsyncAll:E,Macro:O,Caller:S,Import:T,FromImport:A,FunCall:N,Filter:L,FilterAsync:M,KeywordArgs:C,Block:j,Super:P,Extends:I,Include:R,Set:D,Switch:B,Case:F,LookupVal:g,BinOp:q,In:V,Is:W,Or:Y,And:H,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),v=y.Obj,g=y.EmitterObj,b=n(2),_=b.handleError,w=b.Frame,x=n(22);function k(t,e,n){o((function(){t(e,n)}))}var E={type:"code",obj:{root:function(t,e,n,r,i){try{i(null,"")}catch(t){i(_(t,null,null))}}}},O=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 T)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=","//","**"],D=M+this.current();switch(-1!==r.indexOf(R,D)&&(this.forward(),M=D,-1!==r.indexOf(R,D+this.current())&&(M=D+this.current(),this.forward())),M){case"(":I=d;break;case")":I=m;break;case"[":I=y;break;case"]":I=v;break;case"{":I=g;break;case"}":I=b;break;case",":I=w;break;case":":I=x;break;case"~":I=k;break;case"|":I=E;break;default:I=_}return L(I,M,e,n)}if((t=this._extractUntil(i+o)).match(/^[-+]?[0-9]+$/)){if("."===this.current()){this.forward();var B=this._extract("0123456789");return L(O,t+"."+B,e,n)}return L("int",t,e,n)}if(t.match(/^(true|false)$/))return L(S,t,e,n);if("none"===t)return L(T,t,e,n);if("null"===t)return L(T,t,e,n);if(t)return L(A,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,L(c,t,e,n);if((t=this._extractString(this.tags.VARIABLE_START+"-"))||(t=this._extractString(this.tags.VARIABLE_START)))return this.in_code=!0,L(f,t,e,n);t="";var K=!1;for(this._matches(this.tags.COMMENT_START)&&(K=!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))&&!K){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(!K)throw new Error("unexpected end of comment");t+=this._extractString(this.tags.COMMENT_END);break}t+=this.current(),this.forward()}if(null===F&&K)throw new Error("expected end of comment, got end of file");return L(K?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:()=>_,ComponentAttribute:()=>a,ComponentAttributeDefinition:()=>A,ComponentDefinition:()=>x,ComponentDrawOption:()=>h,ComponentLink:()=>I,ComponentLinkDefinition:()=>D,DefaultConfiguration:()=>HN,DefaultData:()=>KN,DefaultDrawer:()=>oN,DefaultMetadata:()=>cN,DefaultParser:()=>pN,DefaultPlugin:()=>QN,DefaultRender:()=>vN,FileInformation:()=>l,FileInput:()=>q,ParseError:()=>EN,Tag:()=>tL,Variable:()=>sL});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){var n=function(t,n){if("object"!=e(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!=e(i))return i;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:()=>vt,Delaunay:()=>Du,FormatSpecifier:()=>ef,InternMap:()=>_t,InternSet:()=>wt,Node:()=>Sy,Path:()=>Za,Voronoi:()=>Mu,ZoomTransform:()=>PS,active:()=>ia,arc:()=>gE,area:()=>SE,areaRadial:()=>IE,ascending:()=>V,autoType:()=>yc,axisBottom:()=>un,axisLeft:()=>cn,axisRight:()=>sn,axisTop:()=>an,bin:()=>ee,bisect:()=>tt,bisectCenter:()=>Z,bisectLeft:()=>Q,bisectRight:()=>X,bisector:()=>Y,blob:()=>ol,blur:()=>et,blur2:()=>nt,blurImage:()=>rt,brush:()=>ja,brushSelection:()=>La,brushX:()=>Ma,brushY:()=>Ca,buffer:()=>sl,chord:()=>qa,chordDirected:()=>Wa,chordTranspose:()=>Va,cluster:()=>by,color:()=>ti,contourDensity:()=>uu,contours:()=>tu,count:()=>ut,create:()=>Wk,creator:()=>mr,cross:()=>ht,csv:()=>hl,csvFormat:()=>rc,csvFormatBody:()=>ic,csvFormatRow:()=>ac,csvFormatRows:()=>oc,csvFormatValue:()=>sc,csvParse:()=>ec,csvParseRows:()=>nc,cubehelix:()=>qs,cumsum:()=>pt,curveBasis:()=>OO,curveBasisClosed:()=>TO,curveBasisOpen:()=>NO,curveBumpX:()=>FE,curveBumpY:()=>$E,curveBundle:()=>MO,curveCardinal:()=>PO,curveCardinalClosed:()=>RO,curveCardinalOpen:()=>BO,curveCatmullRom:()=>KO,curveCatmullRomClosed:()=>zO,curveCatmullRomOpen:()=>VO,curveLinear:()=>xE,curveLinearClosed:()=>YO,curveMonotoneX:()=>eS,curveMonotoneY:()=>nS,curveNatural:()=>oS,curveStep:()=>sS,curveStepAfter:()=>cS,curveStepBefore:()=>uS,descending:()=>W,deviation:()=>mt,difference:()=>Fe,disjoint:()=>$e,dispatch:()=>mn,drag:()=>qu,dragDisable:()=>Pr,dragEnable:()=>Ir,dsv:()=>fl,dsvFormat:()=>Zu,easeBack:()=>Zc,easeBackIn:()=>Xc,easeBackInOut:()=>Zc,easeBackOut:()=>Qc,easeBounce:()=>Hc,easeBounceIn:()=>Yc,easeBounceInOut:()=>Gc,easeBounceOut:()=>Hc,easeCircle:()=>Rc,easeCircleIn:()=>Pc,easeCircleInOut:()=>Rc,easeCircleOut:()=>Ic,easeCubic:()=>ta,easeCubicIn:()=>Qo,easeCubicInOut:()=>ta,easeCubicOut:()=>Zo,easeElastic:()=>nl,easeElasticIn:()=>el,easeElasticInOut:()=>rl,easeElasticOut:()=>nl,easeExp:()=>jc,easeExpIn:()=>Mc,easeExpInOut:()=>jc,easeExpOut:()=>Cc,easeLinear:()=>gc,easePoly:()=>Ec,easePolyIn:()=>xc,easePolyInOut:()=>Ec,easePolyOut:()=>kc,easeQuad:()=>wc,easeQuadIn:()=>bc,easeQuadInOut:()=>wc,easeQuadOut:()=>_c,easeSin:()=>Nc,easeSinIn:()=>Tc,easeSinInOut:()=>Nc,easeSinOut:()=>Ac,every:()=>je,extent:()=>yt,fcumsum:()=>bt,filter:()=>Ie,flatGroup:()=>Lt,flatRollup:()=>Mt,forceCenter:()=>wl,forceCollide:()=>Pl,forceLink:()=>Dl,forceManyBody:()=>Wl,forceRadial:()=>Yl,forceSimulation:()=>Vl,forceX:()=>Hl,forceY:()=>Gl,format:()=>sf,formatDefaultLocale:()=>hf,formatLocale:()=>ff,formatPrefix:()=>uf,formatSpecifier:()=>tf,fsum:()=>gt,geoAlbers:()=>Pm,geoAlbersUsa:()=>Im,geoArea:()=>yh,geoAzimuthalEqualArea:()=>Fm,geoAzimuthalEqualAreaRaw:()=>Bm,geoAzimuthalEquidistant:()=>Km,geoAzimuthalEquidistantRaw:()=>$m,geoBounds:()=>Xh,geoCentroid:()=>cp,geoCircle:()=>_p,geoClipAntimeridian:()=>Mp,geoClipCircle:()=>Cp,geoClipExtent:()=>$p,geoClipRectangle:()=>Fp,geoConicConformal:()=>Ym,geoConicConformalRaw:()=>Wm,geoConicEqualArea:()=>jm,geoConicEqualAreaRaw:()=>Cm,geoConicEquidistant:()=>Xm,geoConicEquidistantRaw:()=>Jm,geoContains:()=>rd,geoDistance:()=>Hp,geoEqualEarth:()=>iy,geoEqualEarthRaw:()=>ry,geoEquirectangular:()=>Gm,geoEquirectangularRaw:()=>Hm,geoGnomonic:()=>ay,geoGnomonicRaw:()=>oy,geoGraticule:()=>ad,geoGraticule10:()=>sd,geoIdentity:()=>sy,geoInterpolate:()=>ud,geoLength:()=>Vp,geoMercator:()=>zm,geoMercatorRaw:()=>Um,geoNaturalEarth1:()=>cy,geoNaturalEarth1Raw:()=>uy,geoOrthographic:()=>fy,geoOrthographicRaw:()=>ly,geoPath:()=>mm,geoProjection:()=>Nm,geoProjectionMutator:()=>Lm,geoRotation:()=>vp,geoStereographic:()=>py,geoStereographicRaw:()=>hy,geoStream:()=>Wf,geoTransform:()=>ym,geoTransverseMercator:()=>my,geoTransverseMercatorRaw:()=>dy,gray:()=>Es,greatest:()=>ue,greatestIndex:()=>Oe,group:()=>Tt,groupSort:()=>Ut,groups:()=>At,hcl:()=>js,hierarchy:()=>wy,histogram:()=>ee,hsl:()=>pi,html:()=>bl,image:()=>dl,index:()=>Pt,indexes:()=>It,interpolate:()=>Fi,interpolateArray:()=>Mi,interpolateBasis:()=>bi,interpolateBasisClosed:()=>_i,interpolateBlues:()=>bk,interpolateBrBG:()=>Mx,interpolateBuGn:()=>Gx,interpolateBuPu:()=>Xx,interpolateCividis:()=>Lk,interpolateCool:()=>jk,interpolateCubehelix:()=>$v,interpolateCubehelixDefault:()=>Mk,interpolateCubehelixLong:()=>Kv,interpolateDate:()=>ji,interpolateDiscrete:()=>Tv,interpolateGnBu:()=>Zx,interpolateGreens:()=>wk,interpolateGreys:()=>kk,interpolateHcl:()=>Dv,interpolateHclLong:()=>Bv,interpolateHsl:()=>jv,interpolateHslLong:()=>Pv,interpolateHue:()=>Av,interpolateInferno:()=>qk,interpolateLab:()=>Iv,interpolateMagma:()=>zk,interpolateNumber:()=>Pi,interpolateNumberArray:()=>Ni,interpolateObject:()=>Ii,interpolateOrRd:()=>ek,interpolateOranges:()=>Nk,interpolatePRGn:()=>jx,interpolatePiYG:()=>Ix,interpolatePlasma:()=>Vk,interpolatePuBu:()=>ok,interpolatePuBuGn:()=>rk,interpolatePuOr:()=>Dx,interpolatePuRd:()=>sk,interpolatePurples:()=>Ok,interpolateRainbow:()=>Ik,interpolateRdBu:()=>Fx,interpolateRdGy:()=>Kx,interpolateRdPu:()=>ck,interpolateRdYlBu:()=>zx,interpolateRdYlGn:()=>Vx,interpolateReds:()=>Tk,interpolateRgb:()=>Oi,interpolateRgbBasis:()=>Ti,interpolateRgbBasisClosed:()=>Ai,interpolateRound:()=>Nv,interpolateSinebow:()=>Fk,interpolateSpectral:()=>Yx,interpolateString:()=>Bi,interpolateTransformCss:()=>To,interpolateTransformSvg:()=>Ao,interpolateTurbo:()=>$k,interpolateViridis:()=>Uk,interpolateWarm:()=>Ck,interpolateYlGn:()=>pk,interpolateYlGnBu:()=>fk,interpolateYlOrBr:()=>mk,interpolateYlOrRd:()=>vk,interpolateZoom:()=>Mv,interrupt:()=>wo,intersection:()=>Ke,interval:()=>MS,isoFormat:()=>AS,isoParse:()=>LS,json:()=>yl,lab:()=>Os,lch:()=>Cs,least:()=>ke,leastIndex:()=>Ee,line:()=>OE,lineRadial:()=>PE,link:()=>qE,linkHorizontal:()=>VE,linkRadial:()=>YE,linkVertical:()=>WE,local:()=>Hk,map:()=>Re,matcher:()=>wn,max:()=>ne,maxIndex:()=>re,mean:()=>de,median:()=>me,medianIndex:()=>ye,merge:()=>ve,min:()=>ie,minIndex:()=>oe,mode:()=>ge,namespace:()=>Rn,namespaces:()=>In,nice:()=>Zt,now:()=>Zi,pack:()=>Xy,packEnclose:()=>Iy,packSiblings:()=>Gy,pairs:()=>be,partition:()=>rv,path:()=>ts,pathRound:()=>es,permute:()=>Bt,pie:()=>NE,piecewise:()=>Uv,pointRadial:()=>RE,pointer:()=>Ki,pointers:()=>Jk,polygonArea:()=>qv,polygonCentroid:()=>Vv,polygonContains:()=>Jv,polygonHull:()=>Gv,polygonLength:()=>Xv,precisionFixed:()=>pf,precisionPrefix:()=>df,precisionRound:()=>mf,quadtree:()=>Sl,quantile:()=>ce,quantileIndex:()=>fe,quantileSorted:()=>le,quantize:()=>zv,quickselect:()=>ae,radialArea:()=>IE,radialLine:()=>PE,randomBates:()=>ig,randomBernoulli:()=>sg,randomBeta:()=>lg,randomBinomial:()=>fg,randomCauchy:()=>pg,randomExponential:()=>og,randomGamma:()=>cg,randomGeometric:()=>ug,randomInt:()=>tg,randomIrwinHall:()=>rg,randomLcg:()=>bg,randomLogNormal:()=>ng,randomLogistic:()=>dg,randomNormal:()=>eg,randomPareto:()=>ag,randomPoisson:()=>mg,randomUniform:()=>Zv,randomWeibull:()=>hg,range:()=>we,rank:()=>xe,reduce:()=>De,reverse:()=>Be,rgb:()=>ii,ribbon:()=>hs,ribbonArrow:()=>ps,rollup:()=>Ct,rollups:()=>jt,scaleBand:()=>Eg,scaleDiverging:()=>px,scaleDivergingLog:()=>dx,scaleDivergingPow:()=>yx,scaleDivergingSqrt:()=>vx,scaleDivergingSymlog:()=>mx,scaleIdentity:()=>Fg,scaleImplicit:()=>xg,scaleLinear:()=>Bg,scaleLog:()=>Hg,scaleOrdinal:()=>kg,scalePoint:()=>Sg,scalePow:()=>rb,scaleQuantile:()=>sb,scaleQuantize:()=>ub,scaleRadial:()=>ab,scaleSequential:()=>ax,scaleSequentialLog:()=>sx,scaleSequentialPow:()=>cx,scaleSequentialQuantile:()=>fx,scaleSequentialSqrt:()=>lx,scaleSequentialSymlog:()=>ux,scaleSqrt:()=>ib,scaleSymlog:()=>Qg,scaleThreshold:()=>cb,scaleTime:()=>nx,scaleUtc:()=>rx,scan:()=>Se,schemeAccent:()=>_x,schemeBlues:()=>gk,schemeBrBG:()=>Lx,schemeBuGn:()=>Hx,schemeBuPu:()=>Jx,schemeCategory10:()=>bx,schemeDark2:()=>wx,schemeGnBu:()=>Qx,schemeGreens:()=>_k,schemeGreys:()=>xk,schemeOrRd:()=>tk,schemeOranges:()=>Ak,schemePRGn:()=>Cx,schemePaired:()=>xx,schemePastel1:()=>kx,schemePastel2:()=>Ex,schemePiYG:()=>Px,schemePuBu:()=>ik,schemePuBuGn:()=>nk,schemePuOr:()=>Rx,schemePuRd:()=>ak,schemePurples:()=>Ek,schemeRdBu:()=>Bx,schemeRdGy:()=>$x,schemeRdPu:()=>uk,schemeRdYlBu:()=>Ux,schemeRdYlGn:()=>qx,schemeReds:()=>Sk,schemeSet1:()=>Ox,schemeSet2:()=>Sx,schemeSet3:()=>Tx,schemeSpectral:()=>Wx,schemeTableau10:()=>Ax,schemeYlGn:()=>hk,schemeYlGnBu:()=>lk,schemeYlOrBr:()=>dk,schemeYlOrRd:()=>yk,select:()=>Nr,selectAll:()=>Xk,selection:()=>Ar,selector:()=>vn,selectorAll:()=>_n,shuffle:()=>Te,shuffler:()=>Ae,some:()=>Pe,sort:()=>Ft,stack:()=>dS,stackOffsetDiverging:()=>yS,stackOffsetExpand:()=>mS,stackOffsetNone:()=>lS,stackOffsetSilhouette:()=>vS,stackOffsetWiggle:()=>gS,stackOrderAppearance:()=>bS,stackOrderAscending:()=>wS,stackOrderDescending:()=>kS,stackOrderInsideOut:()=>ES,stackOrderNone:()=>fS,stackOrderReverse:()=>OS,stratify:()=>cv,style:()=>Yn,subset:()=>Ve,sum:()=>Ne,superset:()=>ze,svg:()=>_l,symbol:()=>wO,symbolAsterisk:()=>GE,symbolCircle:()=>JE,symbolCross:()=>XE,symbolDiamond:()=>tO,symbolDiamond2:()=>eO,symbolPlus:()=>nO,symbolSquare:()=>rO,symbolSquare2:()=>iO,symbolStar:()=>uO,symbolTimes:()=>gO,symbolTriangle:()=>lO,symbolTriangle2:()=>hO,symbolWye:()=>vO,symbolX:()=>gO,symbols:()=>bO,symbolsFill:()=>bO,symbolsStroke:()=>_O,text:()=>cl,thresholdFreedmanDiaconis:()=>he,thresholdScott:()=>pe,thresholdSturges:()=>te,tickFormat:()=>Rg,tickIncrement:()=>Xt,tickStep:()=>Qt,ticks:()=>Jt,timeDay:()=>Mb,timeDays:()=>Cb,timeFormat:()=>M_,timeFormatDefaultLocale:()=>Qw,timeFormatLocale:()=>N_,timeFriday:()=>zb,timeFridays:()=>Jb,timeHour:()=>Tb,timeHours:()=>Ab,timeInterval:()=>gb,timeMillisecond:()=>bb,timeMilliseconds:()=>_b,timeMinute:()=>kb,timeMinutes:()=>Eb,timeMonday:()=>Fb,timeMondays:()=>Wb,timeMonth:()=>p_,timeMonths:()=>d_,timeParse:()=>C_,timeSaturday:()=>qb,timeSaturdays:()=>Xb,timeSecond:()=>wb,timeSeconds:()=>xb,timeSunday:()=>Bb,timeSundays:()=>Vb,timeThursday:()=>Ub,timeThursdays:()=>Gb,timeTickInterval:()=>O_,timeTicks:()=>E_,timeTuesday:()=>$b,timeTuesdays:()=>Yb,timeWednesday:()=>Kb,timeWednesdays:()=>Hb,timeWeek:()=>Bb,timeWeeks:()=>Vb,timeYear:()=>v_,timeYears:()=>g_,timeout:()=>so,timer:()=>no,timerFlush:()=>ro,transition:()=>Go,transpose:()=>Le,tree:()=>gv,treemap:()=>kv,treemapBinary:()=>Ev,treemapDice:()=>nv,treemapResquarify:()=>Sv,treemapSlice:()=>bv,treemapSliceDice:()=>Ov,treemapSquarify:()=>xv,tsv:()=>pl,tsvFormat:()=>fc,tsvFormatBody:()=>hc,tsvFormatRow:()=>dc,tsvFormatRows:()=>pc,tsvFormatValue:()=>mc,tsvParse:()=>cc,tsvParseRows:()=>lc,union:()=>We,unixDay:()=>Ib,unixDays:()=>Rb,utcDay:()=>jb,utcDays:()=>Pb,utcFormat:()=>j_,utcFriday:()=>i_,utcFridays:()=>f_,utcHour:()=>Nb,utcHours:()=>Lb,utcMillisecond:()=>bb,utcMilliseconds:()=>_b,utcMinute:()=>Ob,utcMinutes:()=>Sb,utcMonday:()=>t_,utcMondays:()=>s_,utcMonth:()=>m_,utcMonths:()=>y_,utcParse:()=>P_,utcSaturday:()=>o_,utcSaturdays:()=>h_,utcSecond:()=>wb,utcSeconds:()=>xb,utcSunday:()=>Zb,utcSundays:()=>a_,utcThursday:()=>r_,utcThursdays:()=>l_,utcTickInterval:()=>k_,utcTicks:()=>x_,utcTuesday:()=>e_,utcTuesdays:()=>u_,utcWednesday:()=>n_,utcWednesdays:()=>c_,utcWeek:()=>Zb,utcWeeks:()=>a_,utcYear:()=>b_,utcYears:()=>__,variance:()=>dt,window:()=>zn,xml:()=>gl,zip:()=>Ce,zoom:()=>VS,zoomIdentity:()=>IS,zoomTransform:()=>RS});var o=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},r=[{key:"isVariable",get:function(){return!1}},{key:"hasError",value:function(){return null===this.definition?null===this.value||("array"===this.type.toLowerCase()?!Array.isArray(this.value):e(this.value)!==this.type.toLowerCase()):null!==this.value&&void 0!==this.value&&(this.__typeOfValueValidation()||this.__ruleValueValidation()||this.__ruleMinAndMaxValidation()||this.__ruleRegexValidation())}},{key:"__typeOfValueValidation",value:function(){var t=this.type.toLowerCase();return"Link"===this.definition.type?!Array.isArray(this.value)||this.value.some((function(t){return"string"!=typeof t})):"array"===t?!Array.isArray(this.value):e(this.value)!==t}},{key:"__ruleValueValidation",value:function(){var t=this;return this.definition.rules.values&&Array.isArray(this.value)?!this.value.every((function(e){return t.definition.rules.values.includes(e)})):this.definition.rules.values&&!this.definition.rules.values.includes(this.value)}},{key:"__ruleMinAndMaxValidation",value:function(){var t="number"==typeof this.value?this.value:this.value.length;return null!==this.definition.rules.min&&tthis.definition.rules.max}},{key:"__ruleRegexValidation",value:function(){return null!==this.definition.rules.regex&&!new RegExp(this.definition.rules.regex).test(this.value)}}],r&&function(t,e){for(var r=0;r0&&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 h=f;function p(t){return p="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},p(t)}function d(t){var e=function(t,e){if("object"!=p(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=p(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==p(e)?e:e+""}function m(t,e,n){return e=v(e),function(t,e){if(e&&("object"==p(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,y()?Reflect.construct(e,n||[],v(t).constructor):e.apply(t,n))}function y(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(y=function(){return!!t})()}function v(t){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},v(t)}function g(t,e){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},g(t,e)}var b=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=m(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 h,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&&g(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 a(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]:{type:null,icon:null,model:null,displayName:null,description:null,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.url,u=e.parentTypes,c=e.childrenTypes,l=e.definedAttributes,f=e.isContainer,h=e.displayType,p=e.workflowDirection,d=e.linkModel,m=e.defaultWidth,y=e.defaultHeight,v=e.minWidth,g=e.minHeight,b=e.reservedWidth,_=e.reservedHeight,w=e.margin,x=e.gap;this.type=n||null,this.icon=r||null,this.model=i||null,this.displayName=o||null,this.description=a||null,this.url=s||null,this.parentTypes=u||[],this.childrenTypes=c||[],this.definedAttributes=l||[],this.isContainer=void 0!==f&&f,this.displayType=h||null,this.workflowDirection=p||"horizontal",this.linkModel=d||null,this.defaultWidth=m||0,this.defaultHeight=y||0,this.minWidth=v||0,this.minHeight=g||0,this.reservedWidth=b||0,this.reservedHeight=_||0,this.margin=w||10,this.gap=x||30}));const x=w;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 E(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,e,n){return(e=S(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function S(t){var e=function(t,e){if("object"!=k(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=k(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==k(e)?e:e+""}var T=function(t,e,n){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,url:null,linkType:null,linkRef:[],linkModel:null,containerRef:null,required:!1,definedAttributes:[],rules:{values:null,min:null,max:null,regex: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.url,s=e.linkType,u=e.linkRef,c=e.linkModel,l=e.containerRef,f=e.definedAttributes,h=e.required,p=e.rules;this.name=n||null,this.type=r||null,this.displayName=i||null,this.description=o||null,this.url=a||null,this.linkType=s||null,this.linkRef=u||[],this.linkModel=c||null,this.containerRef=l||null,this.definedAttributes=f||[],this.required=h||!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=L(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&&j(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(l);const I=P;var R=function(t,e,n){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 D=R;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,n){return e=K(e),function(t,e){if(e&&("object"==B(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,$()?Reflect.construct(e,n||[],K(t).constructor):e.apply(t,n))}function $(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return($=function(){return!!t})()}function K(t){return K=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},K(t)}function U(t,e){return U=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},U(t,e)}var z=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=F(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&&U(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(l);const q=z;function V(t,e){return null==t||null==e?NaN:te?1:t>=e?0:NaN}function W(t,e){return null==t||null==e?NaN:et?1:e>=t?0:NaN}function Y(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(iV(t(e),n),r=(e,n)=>t(e)-n):(e=t===V||t===W?t:H,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=st(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 nt=it(st),rt=it((function(t){const e=st(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 it(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?(ot(s,c,i,o,a),ot(s,i,c,o,a),ot(s,c,i,o,a),at(u,i,c,o,a),at(u,c,i,o,a),at(u,i,c,o,a)):s?(ot(s,i,c,o,a),ot(s,c,i,o,a),ot(s,i,c,o,a)):u&&(at(u,i,c,o,a),at(u,c,i,o,a),at(u,i,c,o,a)),e}}function ot(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 ct(t){return 0|t.length}function lt(t){return!(t>0)}function ft(t){return"object"!=typeof t||"length"in t?t:Array.from(t)}function ht(...t){const e="function"==typeof t[t.length-1]&&function(t){return e=>t(...e)}(t.pop()),n=(t=t.map(ft)).map(ct),r=t.length-1,i=new Array(r+1).fill(0),o=[];if(r<0||n.some(lt))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 pt(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 dt(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 mt(t,e){const n=dt(t,e);return n?Math.sqrt(n):n}function yt(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 gt(t,e){const n=new vt;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 bt(t,e){const n=new vt;let r=-1;return Float64Array.from(t,void 0===e?t=>n.add(+t||0):i=>n.add(+e(i,++r,t)||0))}class _t extends Map{constructor(t,e=Ot){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(xt(this,t))}has(t){return super.has(xt(this,t))}set(t,e){return super.set(kt(this,t),e)}delete(t){return super.delete(Et(this,t))}}class wt extends Set{constructor(t,e=Ot){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(xt(this,t))}add(t){return super.add(kt(this,t))}delete(t){return super.delete(Et(this,t))}}function xt({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function kt({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function Et({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function Ot(t){return null!==t&&"object"==typeof t?t.valueOf():t}function St(t){return t}function Tt(t,...e){return Dt(t,St,St,e)}function At(t,...e){return Dt(t,Array.from,St,e)}function Nt(t,e){for(let n=1,r=e.length;nt.pop().map((([e,n])=>[...t,e,n]))));return t}function Lt(t,...e){return Nt(At(t,...e),e)}function Mt(t,e,...n){return Nt(jt(t,e,...n),n)}function Ct(t,e,...n){return Dt(t,St,e,n)}function jt(t,e,...n){return Dt(t,Array.from,e,n)}function Pt(t,...e){return Dt(t,St,Rt,e)}function It(t,...e){return Dt(t,Array.from,Rt,e)}function Rt(t){if(1!==t.length)throw new Error("duplicate key");return t[0]}function Dt(t,e,n,r){return function t(i,o){if(o>=r.length)return n(i);const a=new _t,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 Bt(t,e){return Array.from(e,(e=>t[e]))}function Ft(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=Kt(r[t],r[n]);if(e)return e}}))):(n=t.map(n),r.sort(((t,e)=>Kt(n[t],n[e])))),Bt(t,r)}return t.sort($t(n))}function $t(t=V){if(t===V)return Kt;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 Kt(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(te?1:0)}function Ut(t,e,n){return(2!==e.length?Ft(Ct(t,e,n),(([t,e],[n,r])=>V(e,r)||V(t,n))):Ft(Tt(t,n),(([t,n],[r,i])=>e(n,i)||V(t,r)))).map((([t])=>t))}var zt=Array.prototype,qt=zt.slice;function Vt(t){return()=>t}zt.map;const Wt=Math.sqrt(50),Yt=Math.sqrt(10),Ht=Math.sqrt(2);function Gt(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>=Wt?10:o>=Yt?5:o>=Ht?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 te(t){return Math.max(1,Math.ceil(Math.log(ut(t))/Math.LN2)+1)}function ee(){var t=St,e=yt,n=te;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===yt){const t=Xt(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 re(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 ie(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 oe(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 ae(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?Kt:$t(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);ae(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(se(t,n,e),i(t[r],o)>0&&se(t,n,r);a0;)--s}0===i(t[n],o)?se(t,n,s):(++s,se(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function se(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function ue(t,e=V){let n,r=!1;if(1===e.length){let i;for(const o of t){const t=e(o);(r?V(t,i)>0:0===V(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 ce(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 ie(t);if(e>=1)return ne(t);var r,i=(r-1)*e,o=Math.floor(i),a=ne(ae(t,o).subarray(0,o+1));return a+(ie(t.subarray(o+1))-a)*(i-o)}}function le(t,e,n=G){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 fe(t,e,n=G){if(!isNaN(e=+e)){if(r=Float64Array.from(t,((e,r)=>G(n(t[r],r,t)))),e<=0)return oe(r);if(e>=1)return re(r);var r,i=Uint32Array.from(t,((t,e)=>e)),o=r.length-1,a=Math.floor(o*e);return ae(i,a,0,o,((t,e)=>Kt(r[t],r[e]))),(a=ue(i.subarray(0,a+1),(t=>r[t])))>=0?a:-1}}function he(t,e,n){const r=ut(t),i=ce(t,.75)-ce(t,.25);return r&&i?Math.ceil((n-e)/(2*i*Math.pow(r,-1/3))):1}function pe(t,e,n){const r=ut(t),i=mt(t);return r&&i?Math.ceil((n-e)*Math.cbrt(r)/(3.49*i)):1}function de(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 me(t,e){return ce(t,.5,e)}function ye(t,e){return fe(t,.5,e)}function ve(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function ge(t,e){const n=new _t;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 be(t,e=_e){const n=[];let r,i=!1;for(const o of t)i&&n.push(e(r,o)),r=o,i=!0;return n}function _e(t,e){return[t,e]}function we(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===V?(t,e)=>Kt(n[t],n[e]):$t(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 ke(t,e=V){let n,r=!1;if(1===e.length){let i;for(const o of t){const t=e(o);(r?V(t,i)<0:0===V(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 Ee(t,e=V){if(1===e.length)return oe(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 Oe(t,e=V){if(1===e.length)return re(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 Se(t,e){const n=Ee(t,e);return n<0?void 0:n}const Te=Ae(Math.random);function Ae(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 Ne(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 Le(t){if(!(i=t.length))return[];for(var e=-1,n=ie(t,Me),r=new Array(n);++ee(n,r,t)))}function De(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 Be(t){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");return Array.from(t).reverse()}function Fe(t,...e){t=new wt(t);for(const n of e)for(const e of n)t.delete(e);return t}function $e(t,e){const n=e[Symbol.iterator](),r=new wt;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 Ke(t,...e){t=new wt(t),e=e.map(Ue);t:for(const n of t)for(const r of e)if(!r.has(n)){t.delete(n);continue t}return t}function Ue(t){return t instanceof wt?t:new wt(t)}function ze(t,e){const n=t[Symbol.iterator](),r=new Set;for(const t of e){const e=qe(t);if(r.has(e))continue;let i,o;for(;({value:i,done:o}=n.next());){if(o)return!1;const t=qe(i);if(r.add(t),Object.is(e,t))break}}return!0}function qe(t){return null!==t&&"object"==typeof t?t.valueOf():t}function Ve(t,e){return ze(e,t)}function We(...t){const e=new wt;for(const n of t)for(const t of n)e.add(t);return e}function Ye(t){return t}var He=1,Ge=2,Je=3,Xe=4,Qe=1e-6;function Ze(t){return"translate("+t+",0)"}function tn(t){return"translate(0,"+t+")"}function en(t){return e=>+t(e)}function nn(t,e){return e=Math.max(0,t.bandwidth()-2*e)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function rn(){return!this.__axis}function on(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===He||t===Xe?-1:1,l=t===Xe||t===Ge?"x":"y",f=t===He||t===Je?Ze:tn;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):Ye:i,m=Math.max(o,0)+s,y=e.range(),v=+y[0]+u,g=+y[y.length-1]+u,b=(e.bandwidth?nn:en)(e.copy(),u),_=h.selection?h.selection():h,w=_.selectAll(".domain").data([null]),x=_.selectAll(".tick").data(p,e).order(),k=x.exit(),E=x.enter().append("g").attr("class","tick"),O=x.select("line"),S=x.select("text");w=w.merge(w.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),x=x.merge(E),O=O.merge(E.append("line").attr("stroke","currentColor").attr(l+"2",c*o)),S=S.merge(E.append("text").attr("fill","currentColor").attr(l,c*m).attr("dy",t===He?"0em":t===Je?"0.71em":"0.32em")),h!==_&&(w=w.transition(h),x=x.transition(h),O=O.transition(h),S=S.transition(h),k=k.transition(h).attr("opacity",Qe).attr("transform",(function(t){return isFinite(t=b(t))?f(t+u):this.getAttribute("transform")})),E.attr("opacity",Qe).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===Xe||t===Ge?a?"M"+c*a+","+v+"H"+u+"V"+g+"H"+c*a:"M"+u+","+v+"V"+g:a?"M"+v+","+c*a+"V"+u+"H"+g+"V"+c*a:"M"+v+","+u+"H"+g),x.attr("opacity",1).attr("transform",(function(t){return f(b(t)+u)})),O.attr(l+"2",c*o),S.attr(l,c*m).text(d),_.filter(rn).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===Ge?"start":t===Xe?"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 an(t){return on(He,t)}function sn(t){return on(Ge,t)}function un(t){return on(Je,t)}function cn(t){return on(Xe,t)}var ln={value:()=>{}};function fn(){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}An.prototype={constructor:An,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 Pn="http://www.w3.org/1999/xhtml";const In={svg:"http://www.w3.org/2000/svg",xhtml:Pn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Rn(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),In.hasOwnProperty(e)?{space:In[e],local:t}:t}function Dn(t){return function(){this.removeAttribute(t)}}function Bn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Fn(t,e){return function(){this.setAttribute(t,e)}}function $n(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Kn(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function Un(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 zn(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function qn(t){return function(){this.style.removeProperty(t)}}function Vn(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Wn(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Yn(t,e){return t.style.getPropertyValue(e)||zn(t).getComputedStyle(t,null).getPropertyValue(e)}function Hn(t){return function(){delete this[t]}}function Gn(t,e){return function(){this[t]=e}}function Jn(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function Xn(t){return t.trim().split(/^|\s+/)}function Qn(t){return t.classList||new Zn(t)}function Zn(t){this._node=t,this._names=Xn(t.getAttribute("class")||"")}function tr(t,e){for(var n=Qn(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 Or=[null];function Sr(t,e){this._groups=t,this._parents=e}function Tr(){return new Sr([[document.documentElement]],Or)}Sr.prototype=Tr.prototype={constructor:Sr,select:function(t){"function"!=typeof t&&(t=vn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i=w&&(w=_+1);!(b=v[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=jn);for(var n=this._groups,r=n.length,i=new Array(r),o=0;o1?this.each((null==e?qn:"function"==typeof e?Wn:Vn)(t,e,null==n?"":n)):Yn(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?Hn:"function"==typeof e?Jn:Gn)(t,e)):this.node()[t]},classed:function(t,e){var n=Xn(t+"");if(arguments.length<2){for(var r=Qn(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?wr:_r,r=0;r>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?ni(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?ni(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=Vr.exec(t))?new oi(e[1],e[2],e[3],1):(e=Wr.exec(t))?new oi(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Yr.exec(t))?ni(e[1],e[2],e[3],e[4]):(e=Hr.exec(t))?ni(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Gr.exec(t))?fi(e[1],e[2]/100,e[3]/100,1):(e=Jr.exec(t))?fi(e[1],e[2]/100,e[3]/100,e[4]):Xr.hasOwnProperty(t)?ei(Xr[t]):"transparent"===t?new oi(NaN,NaN,NaN,0):null}function ei(t){return new oi(t>>16&255,t>>8&255,255&t,1)}function ni(t,e,n,r){return r<=0&&(t=e=n=NaN),new oi(t,e,n,r)}function ri(t){return t instanceof Br||(t=ti(t)),t?new oi((t=t.rgb()).r,t.g,t.b,t.opacity):new oi}function ii(t,e,n,r){return 1===arguments.length?ri(t):new oi(t,e,n,null==r?1:r)}function oi(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function ai(){return`#${li(this.r)}${li(this.g)}${li(this.b)}`}function si(){const t=ui(this.opacity);return`${1===t?"rgb(":"rgba("}${ci(this.r)}, ${ci(this.g)}, ${ci(this.b)}${1===t?")":`, ${t})`}`}function ui(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function ci(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function li(t){return((t=ci(t))<16?"0":"")+t.toString(16)}function fi(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new di(t,e,n,r)}function hi(t){if(t instanceof di)return new di(t.h,t.s,t.l,t.opacity);if(t instanceof Br||(t=ti(t)),!t)return new di;if(t instanceof di)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 di(a,s,u,t.opacity)}function pi(t,e,n,r){return 1===arguments.length?hi(t):new di(t,e,n,null==r?1:r)}function di(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function mi(t){return(t=(t||0)%360)<0?t+360:t}function yi(t){return Math.max(0,Math.min(1,t||0))}function vi(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 gi(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 bi(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),vi(t,i,r),vi(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new di(mi(this.h),yi(this.s),yi(this.l),ui(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=ui(this.opacity);return`${1===t?"hsl(":"hsla("}${mi(this.h)}, ${100*yi(this.s)}%, ${100*yi(this.l)}%${1===t?")":`, ${t})`}`}}));const wi=t=>()=>t;function xi(t,e){return function(n){return t+n*e}}function ki(t,e){var n=e-t;return n?xi(t,n>180||n<-180?n-360*Math.round(n/360):n):wi(isNaN(t)?e:t)}function Ei(t,e){var n=e-t;return n?xi(t,n):wi(isNaN(t)?e:t)}const Oi=function t(e){var n=function(t){return 1==(t=+t)?Ei: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):wi(isNaN(e)?n:e)}}(e);function r(t,e){var r=n((t=ii(t)).r,(e=ii(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=Ei(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 Si(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:Pi(n,r)})),o=Di.lastIndex;return o=0&&e._call.call(void 0,t),e=e._next;--qi}function io(){Gi=(Hi=Xi.now())+Ji,qi=Vi=0;try{ro()}finally{qi=0,function(){for(var t,e,n=Ui,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:Ui=e);zi=t,ao(r)}(),Gi=0}}function oo(){var t=Xi.now(),e=t-Hi;e>Yi&&(Ji-=e,Hi=t)}function ao(t){qi||(Vi&&(Vi=clearTimeout(Vi)),t-Gi>24?(t<1/0&&(Vi=setTimeout(io,t-Xi.now()-Ji)),Wi&&(Wi=clearInterval(Wi))):(Wi||(Hi=Xi.now(),Wi=setInterval(oo,Yi)),qi=1,Qi(io)))}function so(t,e,n){var r=new eo;return e=null==e?0:+e,r.restart((n=>{r.stop(),t(n+e)}),e,n),r}eo.prototype=no.prototype={constructor:eo,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Zi():+n)+(null==e?0:+e),this._next||zi===this||(zi?zi._next=this:Ui=this,zi=this),this._call=t,this._time=n,ao()},stop:function(){this._call&&(this._call=null,this._time=1/0,ao())}};var uo=mn("start","end","cancel","interrupt"),co=[],lo=0,fo=1,ho=2,po=3,mo=5,yo=6;function vo(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!==fo)return s();for(c in i)if((h=i[c]).name===n.name){if(h.state===po)return so(o);4===h.state?(h.state=yo,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[c]):+clo)throw new Error("too late; already scheduled");return n}function bo(t,e){var n=_o(t,e);if(n.state>po)throw new Error("too late; already running");return n}function _o(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function wo(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>ho&&n.state180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:Pi(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:Pi(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:Pi(t,n)},{i:s-2,x:Pi(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)?go:bo;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=Rn(t),r="transform"===n?Ao:Co;return this.attrTween(t,"function"==typeof e?(n.local?Bo:Do)(n,r,Mo(this,"attr."+t,e)):null==e?(n.local?Po:jo)(n):(n.local?Ro:Io)(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=Rn(t);return this.tween(n,(r.local?Fo:$o)(r,e))},style:function(t,e,n){var r="transform"==(t+="")?To:Co;return null==e?this.styleTween(t,function(t,e){var n,r,i;return function(){var o=Yn(this,t),a=(this.style.removeProperty(t),Yn(this,t));return o===a?null:o===n&&a===r?i:i=e(n=o,r=a)}}(t,r)).on("end.style."+t,Wo(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,i,o;return function(){var a=Yn(this,t),s=n(this),u=s+"";return null==s&&(this.style.removeProperty(t),u=s=Yn(this,t)),a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s))}}(t,r,Mo(this,"style."+t,e))).each(function(t,e){var n,r,i,o,a="style."+e,s="end."+a;return function(){var u=bo(this,t),c=u.on,l=null==u.value[a]?o||(o=Wo(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=Yn(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}}(Mo(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=_o(this.node(),n).tween,o=0,a=i.length;ofo&&n.name===e)return new Ho([[t]],ra,e,+r);return null}const oa=t=>()=>t;function aa(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 sa(t){t.preventDefault(),t.stopImmediatePropagation()}var ua={name:"drag"},ca={name:"space"},la={name:"handle"},fa={name:"center"};const{abs:ha,max:pa,min:da}=Math;function ma(t){return[+t[0],+t[1]]}function ya(t){return[ma(t[0]),ma(t[1])]}var va={name:"x",handles:["w","e"].map(Oa),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]]}},ga={name:"y",handles:["n","s"].map(Oa),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]]}},ba={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(Oa),input:function(t){return null==t?null:ya(t)},output:function(t){return t}},_a={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"},wa={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},xa={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},ka={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},Ea={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Oa(t){return{type:t}}function Sa(t){return!t.ctrlKey&&!t.button}function Ta(){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 Aa(){return navigator.maxTouchPoints||"ontouchstart"in this}function Na(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function La(t){var e=t.__brush;return e?e.dim.output(e.selection):null}function Ma(){return Pa(va)}function Ca(){return Pa(ga)}function ja(){return Pa(ba)}function Pa(t){var e,n=Ta,r=Sa,i=Aa,o=!0,a=mn("start","brush","end"),s=6;function u(e){var n=e.property("__brush",m).selectAll(".overlay").data([Oa("overlay")]);n.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",_a.overlay).merge(n).each((function(){var t=Na(this).extent;Nr(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([Oa("selection")]).enter().append("rect").attr("class","selection").attr("cursor",_a.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 _a[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=Nr(this),e=Na(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,v,g=this,b=n.target.__data__.type,_="selection"===(o&&n.metaKey?b="overlay":b)?ua:o&&n.altKey?fa:la,w=t===ga?null:ka[b],x=t===va?null:Ea[b],k=Na(g),E=k.extent,O=k.selection,S=E[0][0],T=E[0][1],A=E[1][0],N=E[1][1],L=0,M=0,C=w&&x&&o&&n.shiftKey,j=Array.from(n.touches||[n],(t=>{const e=t.identifier;return(t=Ki(t,g)).point0=t.slice(),t.identifier=e,t}));wo(g);var P=l(g,arguments,!0).beforestart();if("overlay"===b){O&&(m=!0);const e=[j[0],j[1]||j[0]];k.selection=O=[[i=t===ga?S:da(e[0][0],e[1][0]),s=t===va?T:da(e[0][1],e[1][1])],[f=t===ga?A:pa(e[0][0],e[1][0]),p=t===va?N:pa(e[0][1],e[1][1])]],j.length>1&&F(n)}else i=O[0][0],s=O[0][1],f=O[1][0],p=O[1][1];a=i,u=s,h=f,d=p;var I=Nr(g).attr("pointer-events","none"),R=I.selectAll(".overlay").attr("cursor",_a[b]);if(n.touches)P.moved=B,P.ended=$;else{var D=Nr(n.view).on("mousemove.brush",B,!0).on("mouseup.brush",$,!0);o&&D.on("keydown.brush",(function(t){switch(t.keyCode){case 16:C=w&&x;break;case 18:_===la&&(w&&(f=h-L*w,i=a+L*w),x&&(p=d-M*x,s=u+M*x),_=fa,F(t));break;case 32:_!==la&&_!==fa||(w<0?f=h-L:w>0&&(i=a-L),x<0?p=d-M:x>0&&(s=u-M),_=ca,R.attr("cursor",_a.selection),F(t));break;default:return}sa(t)}),!0).on("keyup.brush",(function(t){switch(t.keyCode){case 16:C&&(y=v=C=!1,F(t));break;case 18:_===fa&&(w<0?f=h:w>0&&(i=a),x<0?p=d:x>0&&(s=u),_=la,F(t));break;case 32:_===ca&&(t.altKey?(w&&(f=h-L*w,i=a+L*w),x&&(p=d-M*x,s=u+M*x),_=fa):(w<0?f=h:w>0&&(i=a),x<0?p=d:x>0&&(s=u),_=la),R.attr("cursor",_a[b]),F(t));break;default:return}sa(t)}),!0),Pr(n.view)}c.call(g),P.start(n,_.name)}function B(t){for(const e of t.changedTouches||[t])for(const t of j)t.identifier===e.identifier&&(t.cur=Ki(e,g));if(C&&!y&&!v&&1===j.length){const t=j[0];ha(t.cur[0]-t[0])>ha(t.cur[1]-t[1])?v=!0:y=!0}for(const t of j)t.cur&&(t[0]=t.cur[0],t[1]=t.cur[1]);m=!0,sa(t),F(t)}function F(t){const e=j[0],n=e.point0;var r;switch(L=e[0]-n[0],M=e[1]-n[1],_){case ca:case ua:w&&(L=pa(S-i,da(A-f,L)),a=i+L,h=f+L),x&&(M=pa(T-s,da(N-p,M)),u=s+M,d=p+M);break;case la:j[1]?(w&&(a=pa(S,da(A,j[0][0])),h=pa(S,da(A,j[1][0])),w=1),x&&(u=pa(T,da(N,j[0][1])),d=pa(T,da(N,j[1][1])),x=1)):(w<0?(L=pa(S-i,da(A-i,L)),a=i+L,h=f):w>0&&(L=pa(S-f,da(A-f,L)),a=i,h=f+L),x<0?(M=pa(T-s,da(N-s,M)),u=s+M,d=p):x>0&&(M=pa(T-p,da(N-p,M)),u=s,d=p+M));break;case fa:w&&(a=pa(S,da(A,i-L*w)),h=pa(S,da(A,f+L*w))),x&&(u=pa(T,da(N,s-M*x)),d=pa(T,da(N,p+M*x)))}ht+n))}function qa(){return Ya(!1,!1)}function Va(){return Ya(!1,!0)}function Wa(){return Ya(!0,!1)}function Ya(t,e){var n=0,r=null,i=null,o=null;function a(a){var s,u=a.length,c=new Array(u),l=za(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=za(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=za(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 Qa;const n=10**e;return function(t){this._+=t[0];for(let e=1,r=t.length;eJa)if(Math.abs(l*s-u*c)>Ja&&i){let h=n-o,p=r-a,d=s*s+u*u,m=h*h+p*p,y=Math.sqrt(d),v=Math.sqrt(f),g=i*Math.tan((Ha-Math.acos((d+f-m)/(2*y*v)))/2),b=g/v,_=g/y;Math.abs(b-1)>Ja&&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)>Ja||Math.abs(this._y1-c)>Ja)&&this._append`L${u},${c}`,n&&(f<0&&(f=f%Ga+Ga),f>Xa?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>Ja&&this._append`A${n},${n},0,${+(f>=Ha)},${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 ts(){return new Za}function es(t=3){return new Za(+t)}ts.prototype=Za.prototype;var ns=Array.prototype.slice;function rs(t){return function(){return t}}function is(t){return t.source}function os(t){return t.target}function as(t){return t.radius}function ss(t){return t.startAngle}function us(t){return t.endAngle}function cs(){return 0}function ls(){return 10}function fs(t){var e=is,n=os,r=as,i=as,o=ss,a=us,s=cs,u=null;function c(){var c,l=e.apply(this,arguments),f=n.apply(this,arguments),h=s.apply(this,arguments)/2,p=ns.call(arguments),d=+r.apply(this,(p[0]=l,p)),m=o.apply(this,p)-Fa,y=a.apply(this,p)-Fa,v=+i.apply(this,(p[0]=f,p)),g=o.apply(this,p)-Fa,b=a.apply(this,p)-Fa;if(u||(u=c=ts()),h>Ua&&(Ia(y-m)>2*h+Ua?y>m?(m+=h,y-=h):(m-=h,y+=h):m=y=(m+y)/2,Ia(b-g)>2*h+Ua?b>g?(g+=h,b-=h):(g-=h,b+=h):g=b=(g+b)/2),u.moveTo(d*Ra(m),d*Da(m)),u.arc(0,0,d,m,y),m!==g||y!==b)if(t){var _=v-+t.apply(this,arguments),w=(g+b)/2;u.quadraticCurveTo(0,0,_*Ra(g),_*Da(g)),u.lineTo(v*Ra(w),v*Da(w)),u.lineTo(_*Ra(b),_*Da(b))}else u.quadraticCurveTo(0,0,v*Ra(g),v*Da(g)),u.arc(0,0,v,g,b);if(u.quadraticCurveTo(0,0,d*Ra(m),d*Da(m)),u.closePath(),c)return u=null,c+""||null}return t&&(c.headRadius=function(e){return arguments.length?(t="function"==typeof e?e:rs(+e),c):t}),c.radius=function(t){return arguments.length?(r=i="function"==typeof t?t:rs(+t),c):r},c.sourceRadius=function(t){return arguments.length?(r="function"==typeof t?t:rs(+t),c):r},c.targetRadius=function(t){return arguments.length?(i="function"==typeof t?t:rs(+t),c):i},c.startAngle=function(t){return arguments.length?(o="function"==typeof t?t:rs(+t),c):o},c.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:rs(+t),c):a},c.padAngle=function(t){return arguments.length?(s="function"==typeof t?t:rs(+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 hs(){return fs()}function ps(){return fs(ls)}const ds=Math.PI/180,ms=180/Math.PI,ys=.96422,vs=1,gs=.82521,bs=4/29,_s=6/29,ws=3*_s*_s,xs=_s*_s*_s;function ks(t){if(t instanceof Ss)return new Ss(t.l,t.a,t.b,t.opacity);if(t instanceof Ps)return Is(t);t instanceof oi||(t=ri(t));var e,n,r=Ls(t.r),i=Ls(t.g),o=Ls(t.b),a=Ts((.2225045*r+.7168786*i+.0606169*o)/vs);return r===i&&i===o?e=n=a:(e=Ts((.4360747*r+.3850649*i+.1430804*o)/ys),n=Ts((.0139322*r+.0971045*i+.7141733*o)/gs)),new Ss(116*a-16,500*(e-a),200*(a-n),t.opacity)}function Es(t,e){return new Ss(t,0,0,null==e?1:e)}function Os(t,e,n,r){return 1===arguments.length?ks(t):new Ss(t,e,n,null==r?1:r)}function Ss(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function Ts(t){return t>xs?Math.pow(t,1/3):t/ws+bs}function As(t){return t>_s?t*t*t:ws*(t-bs)}function Ns(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Ls(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ms(t){if(t instanceof Ps)return new Ps(t.h,t.c,t.l,t.opacity);if(t instanceof Ss||(t=ks(t)),0===t.a&&0===t.b)return new Ps(NaN,0()=>t;function Gs(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 Xs(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 Qs(){}var Zs=[[],[[[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 tu(){var t=1,e=1,n=te,r=s;function i(t){var e=n(t);if(Array.isArray(e))e=e.slice().sort(Ys);else{const n=yt(t,eu);for(e=Jt(...Zt(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=nu(n[0],r),Zs[c<<1].forEach(d);++o=r,Zs[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)?Hs(Ws.call(t)):Hs(t),i):n},i.smooth=function(t){return arguments.length?(r=t?s:Qs,i):r===s},i}function eu(t){return isFinite(t)?t:NaN}function nu(t,e){return null!=t&&+t>=e}function ru(t){return null==t||isNaN(t=+t)?-1/0:t}function iu(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 ou(t){return t[0]}function au(t){return t[1]}function su(){return 1}function uu(){var t=ou,e=au,n=su,r=960,i=500,o=20,a=2,s=3*o,u=r+2*s>>a,c=i+2*s>>a,l=Hs(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 v(){return u=r+2*(s=3*o)>>a,c=i+2*s>>a,h}return h.contours=function(t){var e=f(t),n=tu().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:()=>ne(e)/r}),i},h.x=function(e){return arguments.length?(t="function"==typeof e?e:Hs(+e),h):t},h.y=function(t){return arguments.length?(e="function"==typeof t?t:Hs(+t),h):e},h.weight=function(t){return arguments.length?(n="function"==typeof t?t:Hs(+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,v()},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),v()},h.thresholds=function(t){return arguments.length?(l="function"==typeof t?t:Array.isArray(t)?Hs(Ws.call(t)):Hs(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,v()},h}const cu=134217729;function lu(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,v,g,b,_,w,x,k,E;const O=t-i,S=n-i,T=e-o,A=r-o;_=O*A,h=cu*O,p=h-(h-O),d=O-p,h=cu*A,m=h-(h-A),y=A-m,w=d*y-(_-p*m-d*m-p*y),x=T*S,h=cu*T,p=h-(h-T),d=T-p,h=cu*S,m=h-(h-S),y=S-m,k=d*y-(x-p*m-d*m-p*y),v=w-k,f=w-v,hu[0]=w-(v+f)+(f-k),g=_+v,f=g-_,b=_-(g-f)+(v-f),v=b-x,f=b-v,hu[1]=b-(v+f)+(f-x),E=g+v,f=E-g,hu[2]=g-(E-f)+(v-f),hu[3]=E;let N=function(t,e){let n=e[0];for(let t=1;t<4;t++)n+=e[t];return n}(0,hu),L=22204460492503146e-32*a;if(N>=L||-N>=L)return N;if(f=t-O,s=t-(O+f)+(f-i),f=n-S,c=n-(S+f)+(f-i),f=e-T,u=e-(T+f)+(f-o),f=r-A,l=r-(A+f)+(f-o),0===s&&0===u&&0===c&&0===l)return N;if(L=11093356479670487e-47*a+33306690738754706e-32*Math.abs(N),N+=O*l+A*s-(T*c+S*u),N>=L||-N>=L)return N;_=s*A,h=cu*s,p=h-(h-s),d=s-p,h=cu*A,m=h-(h-A),y=A-m,w=d*y-(_-p*m-d*m-p*y),x=u*S,h=cu*u,p=h-(h-u),d=u-p,h=cu*S,m=h-(h-S),y=S-m,k=d*y-(x-p*m-d*m-p*y),v=w-k,f=w-v,yu[0]=w-(v+f)+(f-k),g=_+v,f=g-_,b=_-(g-f)+(v-f),v=b-x,f=b-v,yu[1]=b-(v+f)+(f-x),E=g+v,f=E-g,yu[2]=g-(E-f)+(v-f),yu[3]=E;const M=lu(4,hu,4,yu,pu);_=O*l,h=cu*O,p=h-(h-O),d=O-p,h=cu*l,m=h-(h-l),y=l-m,w=d*y-(_-p*m-d*m-p*y),x=T*c,h=cu*T,p=h-(h-T),d=T-p,h=cu*c,m=h-(h-c),y=c-m,k=d*y-(x-p*m-d*m-p*y),v=w-k,f=w-v,yu[0]=w-(v+f)+(f-k),g=_+v,f=g-_,b=_-(g-f)+(v-f),v=b-x,f=b-v,yu[1]=b-(v+f)+(f-x),E=g+v,f=E-g,yu[2]=g-(E-f)+(v-f),yu[3]=E;const C=lu(M,pu,4,yu,du);_=s*l,h=cu*s,p=h-(h-s),d=s-p,h=cu*l,m=h-(h-l),y=l-m,w=d*y-(_-p*m-d*m-p*y),x=u*c,h=cu*u,p=h-(h-u),d=u-p,h=cu*c,m=h-(h-c),y=c-m,k=d*y-(x-p*m-d*m-p*y),v=w-k,f=w-v,yu[0]=w-(v+f)+(f-k),g=_+v,f=g-_,b=_-(g-f)+(v-f),v=b-x,f=b-v,yu[1]=b-(v+f)+(f-x),E=g+v,f=E-g,yu[2]=g-(E-f)+(v-f),yu[3]=E;const j=lu(C,du,4,yu,mu);return mu[j-1]}(t,e,n,r,i,o,c)}fu(4),fu(4),fu(4),fu(4),fu(4),fu(4),fu(4),fu(4),fu(4),fu(8),fu(8),fu(8),fu(4),fu(8),fu(8),fu(8),fu(12),fu(192),fu(192),fu(4),fu(4),fu(4),fu(4),fu(4),fu(4),fu(4),fu(4),fu(8),fu(8),fu(8),fu(8),fu(8),fu(8),fu(8),fu(8),fu(8),fu(4),fu(4),fu(4),fu(8),fu(16),fu(16),fu(16),fu(32),fu(32),fu(48),fu(64),fu(1152),fu(1152),fu(4),fu(4),fu(4),fu(4),fu(4),fu(4),fu(4),fu(4),fu(4),fu(4),fu(24),fu(24),fu(24),fu(24),fu(24),fu(24),fu(24),fu(24),fu(24),fu(24),fu(1152),fu(1152),fu(1152),fu(1152),fu(1152),fu(2304),fu(2304),fu(3456),fu(5760),fu(8),fu(8),fu(8),fu(16),fu(24),fu(48),fu(48),fu(96),fu(192),fu(384),fu(384),fu(384),fu(768),fu(96),fu(96),fu(96),fu(1152);const gu=Math.pow(2,-52),bu=new Uint32Array(512);class _u{static from(t,e=Su,n=Tu){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).fill(-1),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,m=1/0;for(let e=0;e0&&(p=e,m=n)}let g=t[2*p],b=t[2*p+1],_=1/0;for(let e=0;er&&(e[n++]=i,r=this._dists[i])}return this.hull=e.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(vu(y,v,g,b,w,x)<0){const t=p,e=g,n=b;p=d,g=w,b=x,d=t,w=e,x=n}const k=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}}(y,v,g,b,w,x);this._cx=k.x,this._cy=k.y;for(let e=0;e0&&Math.abs(c-o)<=gu&&Math.abs(l-a)<=gu)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 v=this._addTriangle(y,u,n[y],-1,-1,r[y]);r[u]=this._legalize(v+2),r[y]=v,E++;let g=n[y];for(;m=n[g],vu(c,l,t[2*g],t[2*g+1],t[2*m],t[2*m+1])<0;)v=this._addTriangle(g,u,m,r[u],-1,r[g]),r[u]=this._legalize(v+2),n[g]=g,E--,g=m;if(y===f)for(;m=e[y],vu(c,l,t[2*m],t[2*m+1],t[2*y],t[2*y+1])<0;)v=this._addTriangle(m,u,y,-1,r[y],r[m]),this._legalize(v+2),r[m]=v,n[y]=y,E--,y=m;this._hullStart=e[u]=y,n[y]=e[g]=u,n[u]=g,i[this._hashKey(c,l)]=u,i[this._hashKey(t[2*y],t[2*y+1])]=y}this.hull=new Uint32Array(E);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=bu[--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(xu(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;Ou(t,n+r>>1,i),e[t[n]]>e[t[r]]&&Ou(t,n,r),e[t[i]]>e[t[r]]&&Ou(t,i,r),e[t[n]]>e[t[i]]&&Ou(t,n,i);const a=t[i],s=e[a];for(;;){do{i++}while(e[t[i]]s);if(o=o-n?(Eu(t,e,i,r),Eu(t,e,n,o-1)):(Eu(t,e,n,o-1),Eu(t,e,i,r))}}function Ou(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function Su(t){return t[0]}function Tu(t){return t[1]}const Au=1e-6;class Nu{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)>Au||Math.abs(this._y1-i)>Au)&&(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 Lu{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 Mu{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 Mu(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=ju(e-u[2*t],2)+ju(n-u[2*t+1],2);const f=r[t];let h=f;do{let r=s[h];const f=ju(e-u[2*r],2)+ju(n-u[2*r+1],2);if(f()=>t;function Fu(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 $u(t){return!t.ctrlKey&&!t.button}function Ku(){return this.parentNode}function Uu(t,e){return null==e?{x:t.x,y:t.y}:e}function zu(){return navigator.maxTouchPoints||"ontouchstart"in this}function qu(){var t,e,n,r,i=$u,o=Ku,a=Uu,s=zu,u={},c=mn("start","drag","end"),l=0,f=0;function h(t){t.on("mousedown.drag",p).filter(s).on("touchstart.drag",y).on("touchmove.drag",v,Lr).on("touchend.drag touchcancel.drag",g).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&&(Nr(a.view).on("mousemove.drag",d,Mr).on("mouseup.drag",m,Mr),Pr(a.view),Cr(a),n=!1,t=a.clientX,e=a.clientY,u("start",a))}}function d(r){if(jr(r),!n){var i=r.clientX-t,o=r.clientY-e;n=i*i+o*o>f}u.mouse("drag",r)}function m(t){Nr(t.view).on("mousemove.drag mouseup.drag",null),Ir(t.view,n),jr(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++))===Hu?c=!0:r===Gu&&(c=!0,t.charCodeAt(a)===Hu&&++a),t.slice(i+1,e-1).replace(/""/g,'"')}for(;a9999?"+"+Qu(e,6):Qu(e,4))+"-"+Qu(t.getUTCMonth()+1,2)+"-"+Qu(t.getUTCDate(),2)+(o?"T"+Qu(n,2)+":"+Qu(r,2)+":"+Qu(i,2)+"."+Qu(o,3)+"Z":i?"T"+Qu(n,2)+":"+Qu(r,2)+":"+Qu(i,2)+"Z":r||n?"T"+Qu(n,2)+":"+Qu(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=Ju(t);return function(r,i){return e(n(r),i,t)}}(t,e):Ju(t)}));return o.columns=i||[],o},parseRows:r,format:function(e,n){return null==n&&(n=Xu(e)),[n.map(a).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=Xu(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(o).join("\n")},formatRow:o,formatValue:a}}var tc=Zu(","),ec=tc.parse,nc=tc.parseRows,rc=tc.format,ic=tc.formatBody,oc=tc.formatRows,ac=tc.formatRow,sc=tc.formatValue,uc=Zu("\t"),cc=uc.parse,lc=uc.parseRows,fc=uc.format,hc=uc.formatBody,pc=uc.formatRows,dc=uc.formatRow,mc=uc.formatValue;function yc(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;vc&&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 vc=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),gc=t=>+t;function bc(t){return t*t}function _c(t){return t*(2-t)}function wc(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}var xc=function t(e){function n(t){return Math.pow(t,e)}return e=+e,n.exponent=t,n}(3),kc=function t(e){function n(t){return 1-Math.pow(1-t,e)}return e=+e,n.exponent=t,n}(3),Ec=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),Oc=Math.PI,Sc=Oc/2;function Tc(t){return 1==+t?1:1-Math.cos(t*Sc)}function Ac(t){return Math.sin(t*Sc)}function Nc(t){return(1-Math.cos(Oc*t))/2}function Lc(t){return 1.0009775171065494*(Math.pow(2,-10*t)-.0009765625)}function Mc(t){return Lc(1-+t)}function Cc(t){return 1-Lc(t)}function jc(t){return((t*=2)<=1?Lc(1-t):2-Lc(t-1))/2}function Pc(t){return 1-Math.sqrt(1-t*t)}function Ic(t){return Math.sqrt(1- --t*t)}function Rc(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var Dc=4/11,Bc=6/11,Fc=8/11,$c=3/4,Kc=9/11,Uc=10/11,zc=15/16,qc=21/22,Vc=63/64,Wc=1/Dc/Dc;function Yc(t){return 1-Hc(1-t)}function Hc(t){return(t=+t)cl(e,n).then((e=>(new DOMParser).parseFromString(e,t)))}const gl=vl("application/xml");var bl=vl("text/html"),_l=vl("image/svg+xml");function wl(t,e){var n,r=1;function i(){var i,o,a=n.length,s=0,u=0;for(i=0;i=(o=(m+v)/2))?m=o:v=o,(l=n>=(a=(y+g)/2))?y=a:g=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+v)/2))?m=o:v=o,(l=n>=(a=(y+g)/2))?y=a:g=a}while((f=l<<1|c)==(h=(u>=a)<<1|s>=o));return i[h]=p,i[f]=d,t}function kl(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function El(t){return t[0]}function Ol(t){return t[1]}function Sl(t,e,n){var r=new Tl(null==e?El:e,null==n?Ol:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function Tl(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 Al(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var Nl=Sl.prototype=Tl.prototype;function Ll(t){return function(){return t}}function Ml(t){return 1e-6*(t()-.5)}function Cl(t){return t.x+t.vx}function jl(t){return t.y+t.vy}function Pl(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,v=m*m+y*y;vt.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)=v)<<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 g=t-+this._x.call(null,m.data),b=e-+this._y.call(null,m.data),_=g*g+b*b;if(_=(s=(d+y)/2))?d=s:y=s,(l=a>=(u=(m+v)/2))?m=u:v=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)},Nl.removeAll=function(t){for(var e=0,n=t.length;e(t=(Bl*t+Fl)%$l)/$l}();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 Wl(){var t,e,n,r,i,o=Ll(-30),a=1,s=1/0,u=.81;function c(n){var i,o=t.length,a=Sl(t,Kl,Ul).visitAfter(f);for(r=n,i=0;i=s)){(t.data!==e||t.next)&&(0===f&&(d+=(f=Ml(n))*f),0===h&&(d+=(h=Ml(n))*h),d1?r[0]+r.slice(2):r,+t.slice(n+1)]}function Xl(t){return(t=Jl(Math.abs(t)))?t[1]:NaN}var Ql,Zl=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function tf(t){if(!(e=Zl.exec(t)))throw new Error("invalid format: "+t);var e;return new ef({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 ef(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 nf(t,e){var n=Jl(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")}tf.prototype=ef.prototype,ef.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 rf={"%":(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)=>nf(100*t,e),r:nf,s:function(t,e){var n=Jl(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(Ql=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")+Jl(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function of(t){return t}var af,sf,uf,cf=Array.prototype.map,lf=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ff(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?of:(e=cf.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?of:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(cf.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=tf(t)).fill,n=t.align,f=t.sign,h=t.symbol,p=t.zero,d=t.width,m=t.comma,y=t.precision,v=t.trim,g=t.type;"n"===g?(m=!0,g="g"):rf[g]||(void 0===y&&(y=12),v=!0,g="g"),(p||"0"===e&&"="===n)&&(p=!0,e="0",n="=");var b="$"===h?i:"#"===h&&/[boxX]/.test(g)?"0"+g.toLowerCase():"",_="$"===h?o:/[%p]/.test(g)?u:"",w=rf[g],x=/[defgprs%]/.test(g);function k(t){var i,o,u,h=b,k=_;if("c"===g)k=w(t)+k,t="";else{var E=(t=+t)<0||1/t<0;if(t=isNaN(t)?l:w(Math.abs(t),y),v&&(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)),E&&0==+t&&"+"!==f&&(E=!1),h=(E?"("===f?f:c:"-"===f||"("===f?"":f)+h,k=("s"===g?lf[8+Ql/3]:"")+k+(E&&"("===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 O=h.length+t.length+k.length,S=O>1)+h+t+k+S.slice(O);break;default:t=S+h+t+k}return s(t)}return y=void 0===y?6:/[gprs]/.test(g)?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=tf(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(Xl(e)/3))),i=Math.pow(10,-r),o=lf[8+r/3];return function(t){return n(i*t)+o}}}}function hf(t){return af=ff(t),sf=af.format,uf=af.formatPrefix,af}function pf(t){return Math.max(0,-Xl(Math.abs(t)))}function df(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Xl(e)/3)))-Xl(Math.abs(t)))}function mf(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Xl(e)-Xl(t))+1}hf({thousands:",",grouping:[3],currency:["$",""]});var yf=1e-6,vf=1e-12,gf=Math.PI,bf=gf/2,_f=gf/4,wf=2*gf,xf=180/gf,kf=gf/180,Ef=Math.abs,Of=Math.atan,Sf=Math.atan2,Tf=Math.cos,Af=Math.ceil,Nf=Math.exp,Lf=(Math.floor,Math.hypot),Mf=Math.log,Cf=Math.pow,jf=Math.sin,Pf=Math.sign||function(t){return t>0?1:t<0?-1:0},If=Math.sqrt,Rf=Math.tan;function Df(t){return t>1?0:t<-1?gf:Math.acos(t)}function Bf(t){return t>1?bf:t<-1?-bf:Math.asin(t)}function Ff(t){return(t=jf(t/2))*t}function $f(){}function Kf(t,e){t&&zf.hasOwnProperty(t.type)&&zf[t.type](t,e)}var Uf={Feature:function(t,e){Kf(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=Tf(e=(e*=kf)/2+_f),a=jf(e),s=Xf*a,u=Jf*o+s*Tf(i),c=s*r*jf(i);ch.add(Sf(c,u)),Gf=t,Jf=o,Xf=a}function yh(t){return lh=new vt,Wf(t,fh),2*lh}function vh(t){return[Sf(t[1],t[0]),Bf(t[2])]}function gh(t){var e=t[0],n=t[1],r=Tf(n);return[r*Tf(e),r*jf(e),jf(n)]}function bh(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function _h(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 wh(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function xh(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function kh(t){var e=If(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var Eh,Oh,Sh,Th,Ah,Nh,Lh,Mh,Ch,jh,Ph,Ih,Rh,Dh,Bh,Fh,$h={point:Kh,lineStart:zh,lineEnd:qh,polygonStart:function(){$h.point=Vh,$h.lineStart=Wh,$h.lineEnd=Yh,ah=new vt,fh.polygonStart()},polygonEnd:function(){fh.polygonEnd(),$h.point=Kh,$h.lineStart=zh,$h.lineEnd=qh,ch<0?(Qf=-(th=180),Zf=-(eh=90)):ah>yf?eh=90:ah<-yf&&(Zf=-90),uh[0]=Qf,uh[1]=th},sphere:function(){Qf=-(th=180),Zf=-(eh=90)}};function Kh(t,e){sh.push(uh=[Qf=t,th=t]),eeh&&(eh=e)}function Uh(t,e){var n=gh([t*kf,e*kf]);if(oh){var r=_h(oh,n),i=_h([r[1],-r[0],0],r);kh(i),i=vh(i);var o,a=t-nh,s=a>0?1:-1,u=i[0]*xf*s,c=Ef(a)>180;c^(s*nheh&&(eh=o):c^(s*nh<(u=(u+360)%360-180)&&ueh&&(eh=e)),c?tHh(Qf,th)&&(th=t):Hh(t,th)>Hh(Qf,th)&&(Qf=t):th>=Qf?(tth&&(th=t)):t>nh?Hh(Qf,t)>Hh(Qf,th)&&(th=t):Hh(t,th)>Hh(Qf,th)&&(Qf=t)}else sh.push(uh=[Qf=t,th=t]);eeh&&(eh=e),oh=n,nh=t}function zh(){$h.point=Uh}function qh(){uh[0]=Qf,uh[1]=th,$h.point=Kh,oh=null}function Vh(t,e){if(oh){var n=t-nh;ah.add(Ef(n)>180?n+(n>0?360:-360):n)}else rh=t,ih=e;fh.point(t,e),Uh(t,e)}function Wh(){fh.lineStart()}function Yh(){Vh(rh,ih),fh.lineEnd(),Ef(ah)>yf&&(Qf=-(th=180)),uh[0]=Qf,uh[1]=th,oh=null}function Hh(t,e){return(e-=t)<0?e+360:e}function Gh(t,e){return t[0]-e[0]}function Jh(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:eHh(r[0],r[1])&&(r[1]=i[1]),Hh(i[0],r[1])>Hh(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=Hh(r[1],i[0]))>a&&(a=s,Qf=i[0],th=r[1])}return sh=uh=null,Qf===1/0||Zf===1/0?[[NaN,NaN],[NaN,NaN]]:[[Qf,Zf],[th,eh]]}var Qh={sphere:$f,point:Zh,lineStart:ep,lineEnd:ip,polygonStart:function(){Qh.lineStart=op,Qh.lineEnd=ap},polygonEnd:function(){Qh.lineStart=ep,Qh.lineEnd=ip}};function Zh(t,e){t*=kf;var n=Tf(e*=kf);tp(n*Tf(t),n*jf(t),jf(e))}function tp(t,e,n){++Eh,Sh+=(t-Sh)/Eh,Th+=(e-Th)/Eh,Ah+=(n-Ah)/Eh}function ep(){Qh.point=np}function np(t,e){t*=kf;var n=Tf(e*=kf);Dh=n*Tf(t),Bh=n*jf(t),Fh=jf(e),Qh.point=rp,tp(Dh,Bh,Fh)}function rp(t,e){t*=kf;var n=Tf(e*=kf),r=n*Tf(t),i=n*jf(t),o=jf(e),a=Sf(If((a=Bh*o-Fh*i)*a+(a=Fh*r-Dh*o)*a+(a=Dh*i-Bh*r)*a),Dh*r+Bh*i+Fh*o);Oh+=a,Nh+=a*(Dh+(Dh=r)),Lh+=a*(Bh+(Bh=i)),Mh+=a*(Fh+(Fh=o)),tp(Dh,Bh,Fh)}function ip(){Qh.point=Zh}function op(){Qh.point=sp}function ap(){up(Ih,Rh),Qh.point=Zh}function sp(t,e){Ih=t,Rh=e,t*=kf,e*=kf,Qh.point=up;var n=Tf(e);Dh=n*Tf(t),Bh=n*jf(t),Fh=jf(e),tp(Dh,Bh,Fh)}function up(t,e){t*=kf;var n=Tf(e*=kf),r=n*Tf(t),i=n*jf(t),o=jf(e),a=Bh*o-Fh*i,s=Fh*r-Dh*o,u=Dh*i-Bh*r,c=Lf(a,s,u),l=Bf(c),f=c&&-l/c;Ch.add(f*a),jh.add(f*s),Ph.add(f*u),Oh+=l,Nh+=l*(Dh+(Dh=r)),Lh+=l*(Bh+(Bh=i)),Mh+=l*(Fh+(Fh=o)),tp(Dh,Bh,Fh)}function cp(t){Eh=Oh=Sh=Th=Ah=Nh=Lh=Mh=0,Ch=new vt,jh=new vt,Ph=new vt,Wf(t,Qh);var e=+Ch,n=+jh,r=+Ph,i=Lf(e,n,r);return igf&&(t-=Math.round(t/wf)*wf),[t,e]}function pp(t,e,n){return(t%=wf)?e||n?fp(mp(t),yp(e,n)):mp(t):e||n?yp(e,n):hp}function dp(t){return function(e,n){return Ef(e+=t)>gf&&(e-=Math.round(e/wf)*wf),[e,n]}}function mp(t){var e=dp(t);return e.invert=dp(-t),e}function yp(t,e){var n=Tf(t),r=jf(t),i=Tf(e),o=jf(e);function a(t,e){var a=Tf(e),s=Tf(t)*a,u=jf(t)*a,c=jf(e),l=c*n+s*r;return[Sf(u*i-l*o,s*n-c*r),Bf(l*i+u*o)]}return a.invert=function(t,e){var a=Tf(e),s=Tf(t)*a,u=jf(t)*a,c=jf(e),l=c*i-u*o;return[Sf(u*i+c*o,s*n+l*r),Bf(l*n-s*r)]},a}function vp(t){function e(e){return(e=t(e[0]*kf,e[1]*kf))[0]*=xf,e[1]*=xf,e}return t=pp(t[0]*kf,t[1]*kf,t.length>2?t[2]*kf:0),e.invert=function(e){return(e=t.invert(e[0]*kf,e[1]*kf))[0]*=xf,e[1]*=xf,e},e}function gp(t,e,n,r,i,o){if(n){var a=Tf(e),s=jf(e),u=r*n;null==i?(i=e+r*wf,o=e-u/2):(i=bp(a,i),o=bp(a,o),(r>0?io)&&(i+=r*wf));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 xp(t,e){return Ef(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 Op(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r=0?1:-1,S=O*E,T=S>gf,A=y*x;if(u.add(Sf(A*O*jf(S),v*k+A*Tf(S))),a+=T?E+O*wf:E,T^d>=n^_>=n){var N=_h(gh(p),gh(b));kh(N);var L=_h(o,N);kh(L);var M=(T^E>=0?-1:1)*Bf(L[2]);(r>M||r===M&&(N[0]||N[1]))&&(s+=T^E>=0?1:-1)}}return(a<-yf||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(Np))}return h}}function Np(t){return t.length>1}function Lp(t,e){return((t=t.x)[0]<0?t[1]-bf-yf:bf-t[1])-((e=e.x)[0]<0?e[1]-bf-yf:bf-e[1])}hp.invert=hp;const Mp=Ap((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?gf:-gf,u=Ef(o-n);Ef(u-gf)0?bf:-bf),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(o,r),e=0):i!==s&&u>=gf&&(Ef(n-i)yf?Of((jf(e)*(o=Tf(r))*jf(n)-jf(r)*(i=Tf(e))*jf(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*bf,r.point(-gf,i),r.point(0,i),r.point(gf,i),r.point(gf,0),r.point(gf,-i),r.point(0,-i),r.point(-gf,-i),r.point(-gf,0),r.point(-gf,i);else if(Ef(t[0]-e[0])>yf){var o=t[0]0,i=Ef(e)>yf;function o(t,n){return Tf(t)*Tf(n)>e}function a(t,n,r){var i=[1,0,0],o=_h(gh(t),gh(n)),a=bh(o,o),s=o[0],u=a-s*s;if(!u)return!r&&t;var c=e*a/u,l=-e*s/u,f=_h(i,o),h=xh(i,c);wh(h,xh(o,l));var p=f,d=bh(h,p),m=bh(p,p),y=d*d-m*(bh(h,h)-1);if(!(y<0)){var v=If(y),g=xh(p,(-d-v)/m);if(wh(g,h),g=vh(g),!r)return g;var b,_=t[0],w=n[0],x=t[1],k=n[1];w<_&&(b=_,_=w,w=b);var E=w-_,O=Ef(E-gf)0^g[1]<(Ef(g[0]-_)gf^(_<=g[0]&&g[0]<=w)){var S=xh(p,(-d+v)/m);return wh(S,h),[g,vh(S)]}}}function s(e,n){var i=r?t:gf-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return Ap(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?gf:-gf),h):0;if(!e&&(c=u=m)&&t.lineStart(),m!==u&&(!(p=a(e,d))||xp(e,p)||xp(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 v;y&n||!(v=a(d,e,!0))||(l=0,r?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1],3)))}!m||e&&xp(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){gp(o,t,n,i,e,r)}),r?[0,-t]:[-gf,t-gf])}var jp,Pp,Ip,Rp,Dp=1e9,Bp=-Dp;function Fp(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 Ef(r[0]-t)0?0:3:Ef(r[0]-n)0?2:1:Ef(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,v,g,b=a,_=wp(),w={point:x,lineStart:function(){w.point=k,c&&c.push(l=[]),v=!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=[],g=!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=g&&e,i=(u=ve(u)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&Ep(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]),v)f=o,h=a,p=s,v=!1,s&&(b.lineStart(),b.point(o,a));else if(s&&y)b.point(o,a);else{var u=[d=Math.max(Bp,Math.min(Dp,d)),m=Math.max(Bp,Math.min(Dp,m))],_=[o=Math.max(Bp,Math.min(Dp,o)),a=Math.max(Bp,Math.min(Dp,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),g=!1):(y||(b.lineStart(),b.point(u[0],u[1])),b.point(_[0],_[1]),s||b.lineEnd(),g=!1)}d=o,m=a,y=s}return w}}function $p(){var t,e,n,r=0,i=0,o=960,a=500;return n={stream:function(n){return t&&e===n?t:t=Fp(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 Kp={sphere:$f,point:$f,lineStart:function(){Kp.point=zp,Kp.lineEnd=Up},lineEnd:$f,polygonStart:$f,polygonEnd:$f};function Up(){Kp.point=Kp.lineEnd=$f}function zp(t,e){Pp=t*=kf,Ip=jf(e*=kf),Rp=Tf(e),Kp.point=qp}function qp(t,e){t*=kf;var n=jf(e*=kf),r=Tf(e),i=Ef(t-Pp),o=Tf(i),a=r*jf(i),s=Rp*n-Ip*r*o,u=Ip*n+Rp*r*o;jp.add(Sf(If(a*a+s*s),u)),Pp=t,Ip=n,Rp=r}function Vp(t){return jp=new vt,Wf(t,Kp),+jp}var Wp=[null,null],Yp={type:"LineString",coordinates:Wp};function Hp(t,e){return Wp[0]=t,Wp[1]=e,Vp(Yp)}var Gp={Feature:function(t,e){return Xp(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r0&&(i=Hp(t[o],t[o-1]))>0&&n<=i&&r<=i&&(n+r-i)*(1-Math.pow((n-r)/i,2))yf})).map(u)).concat(we(Af(o/p)*p,i,p).filter((function(t){return Ef(t%m)>yf})).map(c))}return v.lines=function(){return g().map((function(t){return{type:"LineString",coordinates:t}}))},v.outline=function(){return{type:"Polygon",coordinates:[l(r).concat(f(a).slice(1),l(n).reverse().slice(1),f(s).reverse().slice(1))]}},v.extent=function(t){return arguments.length?v.extentMajor(t).extentMinor(t):v.extentMinor()},v.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),v.precision(y)):[[r,s],[n,a]]},v.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),v.precision(y)):[[e,o],[t,i]]},v.step=function(t){return arguments.length?v.stepMajor(t).stepMinor(t):v.stepMinor()},v.stepMajor=function(t){return arguments.length?(d=+t[0],m=+t[1],v):[d,m]},v.stepMinor=function(t){return arguments.length?(h=+t[0],p=+t[1],v):[h,p]},v.precision=function(h){return arguments.length?(y=+h,u=id(o,i,90),c=od(e,t,y),l=id(s,a,90),f=od(r,n,y),v):y},v.extentMajor([[-180,-90+yf],[180,90-yf]]).extentMinor([[-180,-80-yf],[180,80+yf]])}function sd(){return ad()()}function ud(t,e){var n=t[0]*kf,r=t[1]*kf,i=e[0]*kf,o=e[1]*kf,a=Tf(r),s=jf(r),u=Tf(o),c=jf(o),l=a*Tf(n),f=a*jf(n),h=u*Tf(i),p=u*jf(i),d=2*Bf(If(Ff(o-r)+a*u*Ff(i-n))),m=jf(d),y=d?function(t){var e=jf(t*=d)/m,n=jf(d-t)/m,r=n*l+e*h,i=n*f+e*p,o=n*s+e*c;return[Sf(i,r)*xf,Sf(o,If(r*r+i*i))*xf]}:function(){return[n*xf,r*xf]};return y.distance=d,y}const cd=t=>t;var ld,fd,hd,pd,dd=new vt,md=new vt,yd={point:$f,lineStart:$f,lineEnd:$f,polygonStart:function(){yd.lineStart=vd,yd.lineEnd=_d},polygonEnd:function(){yd.lineStart=yd.lineEnd=yd.point=$f,dd.add(Ef(md)),md=new vt},result:function(){var t=dd/2;return dd=new vt,t}};function vd(){yd.point=gd}function gd(t,e){yd.point=bd,ld=hd=t,fd=pd=e}function bd(t,e){md.add(pd*t-hd*e),hd=t,pd=e}function _d(){bd(ld,fd)}const wd=yd;var xd=1/0,kd=xd,Ed=-xd,Od=Ed,Sd={point:function(t,e){tEd&&(Ed=t),eOd&&(Od=e)},lineStart:$f,lineEnd:$f,polygonStart:$f,polygonEnd:$f,result:function(){var t=[[xd,kd],[Ed,Od]];return Ed=Od=-(kd=xd=1/0),t}};const Td=Sd;var Ad,Nd,Ld,Md,Cd=0,jd=0,Pd=0,Id=0,Rd=0,Dd=0,Bd=0,Fd=0,$d=0,Kd={point:Ud,lineStart:zd,lineEnd:Wd,polygonStart:function(){Kd.lineStart=Yd,Kd.lineEnd=Hd},polygonEnd:function(){Kd.point=Ud,Kd.lineStart=zd,Kd.lineEnd=Wd},result:function(){var t=$d?[Bd/$d,Fd/$d]:Dd?[Id/Dd,Rd/Dd]:Pd?[Cd/Pd,jd/Pd]:[NaN,NaN];return Cd=jd=Pd=Id=Rd=Dd=Bd=Fd=$d=0,t}};function Ud(t,e){Cd+=t,jd+=e,++Pd}function zd(){Kd.point=qd}function qd(t,e){Kd.point=Vd,Ud(Ld=t,Md=e)}function Vd(t,e){var n=t-Ld,r=e-Md,i=If(n*n+r*r);Id+=i*(Ld+t)/2,Rd+=i*(Md+e)/2,Dd+=i,Ud(Ld=t,Md=e)}function Wd(){Kd.point=Ud}function Yd(){Kd.point=Gd}function Hd(){Jd(Ad,Nd)}function Gd(t,e){Kd.point=Jd,Ud(Ad=Ld=t,Nd=Md=e)}function Jd(t,e){var n=t-Ld,r=e-Md,i=If(n*n+r*r);Id+=i*(Ld+t)/2,Rd+=i*(Md+e)/2,Dd+=i,Bd+=(i=Md*t-Ld*e)*(Ld+t),Fd+=i*(Md+e),$d+=3*i,Ud(Ld=t,Md=e)}const Xd=Kd;function Qd(t){this._context=t}Qd.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,wf)}},result:$f};var Zd,tm,em,nm,rm,im=new vt,om={point:$f,lineStart:function(){om.point=am},lineEnd:function(){Zd&&sm(tm,em),om.point=$f},polygonStart:function(){Zd=!0},polygonEnd:function(){Zd=null},result:function(){var t=+im;return im=new vt,t}};function am(t,e){om.point=sm,tm=nm=t,em=rm=e}function sm(t,e){nm-=t,rm-=e,im.add(If(nm*nm+rm*rm)),nm=t,rm=e}const um=om;let cm,lm,fm,hm;class pm{constructor(t){this._append=null==t?dm:function(t){const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return dm;if(e!==cm){const t=10**e;cm=e,lm=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 pm(i)),a},a.projection(t).digits(i).context(e)}function ym(t){return{stream:vm(t)}}function vm(t){return function(e){var n=new gm;for(var r in t)n[r]=t[r];return n.stream=e,n}}function gm(){}function bm(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),Wf(n,t.stream(Td)),e(Td.result()),null!=r&&t.clipExtent(r),t}function _m(t,e,n){return bm(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 wm(t,e,n){return _m(t,[[0,0],e],n)}function xm(t,e,n){return bm(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 km(t,e,n){return bm(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)}gm.prototype={constructor:gm,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 Em=16,Om=Tf(30*kf);function Sm(t,e){return+e?function(t,e){function n(r,i,o,a,s,u,c,l,f,h,p,d,m,y){var v=c-r,g=l-i,b=v*v+g*g;if(b>4*e&&m--){var _=a+h,w=s+p,x=u+d,k=If(_*_+w*w+x*x),E=Bf(x/=k),O=Ef(Ef(x)-1)e||Ef((v*N+g*L)/b-.5)>.3||a*h+s*p+u*d2?t[2]%360*kf:0,N()):[y*xf,v*xf,g*xf]},T.angle=function(t){return arguments.length?(b=t%360*kf,N()):b*xf},T.reflectX=function(t){return arguments.length?(_=t?-1:1,N()):_<0},T.reflectY=function(t){return arguments.length?(w=t?-1:1,N()):w<0},T.precision=function(t){return arguments.length?(a=Sm(s,S=t*t),L()):If(S)},T.fitExtent=function(t,e){return _m(T,t,e)},T.fitSize=function(t,e){return wm(T,t,e)},T.fitWidth=function(t,e){return xm(T,t,e)},T.fitHeight=function(t,e){return km(T,t,e)},function(){return e=t.apply(this,arguments),T.invert=e.invert&&A,N()}}function Mm(t){var e=0,n=gf/3,r=Lm(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*kf,n=t[1]*kf):[e*xf,n*xf]},i}function Cm(t,e){var n=jf(t),r=(n+jf(e))/2;if(Ef(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<-bf+yf&&(e=-bf+yf):e>bf-yf&&(e=bf-yf);var n=i/Cf(Vm(e),r);return[n*jf(r*t),i-n*Tf(r*t)]}return o.invert=function(t,e){var n=i-e,o=Pf(r)*If(t*t+n*n),a=Sf(t,Ef(n))*Pf(n);return n*r<0&&(a-=gf*Pf(t)*Pf(n)),[a/r,2*Of(Cf(i/o,1/r))-bf]},o}function Ym(){return Mm(Wm).scale(109.5).parallels([30,30])}function Hm(t,e){return[t,e]}function Gm(){return Nm(Hm).scale(152.63)}function Jm(t,e){var n=Tf(t),r=t===e?jf(t):(n-Tf(e))/(e-t),i=n/r+t;if(Ef(r)2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)}function yy(t,e){return t.parent===e.parent?1:2}function vy(t,e){return t+e.x}function gy(t,e){return Math.max(t,e.y)}function by(){var t=yy,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(vy,0)/t.length}(n),e.y=function(t){return 1+t.reduce(gy,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 _y(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 wy(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=ky)):void 0===e&&(e=xy);for(var n,r,i,o,a,s=new Sy(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 Sy(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(Oy)}function xy(t){return t.children}function ky(t){return Array.isArray(t)?t[1]:null}function Ey(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function Oy(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function Sy(t){this.data=t,this.depth=this.height=0,this.parent=null}function Ty(t){return null==t?null:Ay(t)}function Ay(t){if("function"!=typeof t)throw new Error;return t}function Ny(){return 0}function Ly(t){return function(){return t}}ry.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*(Qm+Zm*i+o*(ty+ey*i))-e)/(Qm+3*Zm*i+o*(7*ty+9*ey*i)))*r)*i*i,!(Ef(n)yf&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},ly.invert=Dm(Bf),hy.invert=Dm((function(t){return 2*Of(t)})),dy.invert=function(t,e){return[-e,2*Of(Nf(t))-bf]},Sy.prototype=wy.prototype={constructor:Sy,count:function(){return this.eachAfter(_y)},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 wy(this).eachBefore(Ey)},[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=(My*t+Cy)%jy)/jy}function Iy(t){return Ry(t,Py())}function Ry(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 $y(t,e){for(var n=0;n1e-6?(T+Math.sqrt(T*T-4*S*A))/(2*S):A/T);return{x:r+x+k*N,y:i+E+O*N,r:N}}function qy(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 Vy(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 Wy(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 Yy(t){this._=t,this.next=null,this.previous=null}function Hy(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;qy(i,r,o=t[2]),r=new Yy(r),i=new Yy(i),o=new Yy(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 fv(t,e-1)&&!fv(t,e-2)&&(t=t.slice(0,-1)),"/"===t[0]?t:`/${t}`}(t(e,n,r)))),n=e.map(lv),i=new Set(e).add("");for(const t of n)i.has(t)||(i.add(t),e.push(t),n.push(lv(t)),h.push(av));p=(t,n)=>e[n],d=(t,e)=>n[e]}for(a=0,i=h.length;a=0&&(c=h[t]).data===av;--t)c.data=null}if(s.parent=iv,s.eachBefore((function(t){t.depth=t.parent.depth+1,--i})).eachBefore(Oy),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(t){return arguments.length?(e=Ty(t),r):e},r.parentId=function(t){return arguments.length?(n=Ty(t),r):n},r.path=function(e){return arguments.length?(t=Ty(e),r):t},r}function lv(t){let e=t.length;if(e<2)return"";for(;--e>1&&!fv(t,e););return t.slice(0,e)}function fv(t,e){if("/"===t[e]){let n=0;for(;e>0&&"\\"===t[--e];)++n;if(!(1&n))return!0}return!1}function hv(t,e){return t.parent===e.parent?1:2}function pv(t){var e=t.children;return e?e[0]:t.t}function dv(t){var e=t.children;return e?e[e.length-1]:t.t}function mv(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 yv(t,e,n){return t.a.parent===e.parent?t.a:n}function vv(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 gv(){var t=hv,e=1,n=1,r=null;function i(i){var u=function(t){for(var e,n,r,i,o,a=new vv(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 vv(r[i],i)),n.parent=e;return(a.parent=new vv(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=dv(s),o=pv(o),s&&o;)u=pv(u),(a=dv(a)).a=e,(i=s.z+f-o.z-c+t(s._,o._))>0&&(mv(yv(s,e,r),e,i),c+=i,l+=i),f+=s.m,c+=o.m,h+=u.m,l+=a.m;s&&!dv(a)&&(a.t=s,a.m+=f-l),o&&!pv(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 bv(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}v.push(a={value:l,dice:u1?e:1)},n}(_v);function kv(){var t=xv,e=!1,n=1,r=1,i=[0],o=Ny,a=Ny,s=Ny,u=Ny,c=Ny;function l(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(f),i=[0],e&&t.eachBefore(ev),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 g=r?(i*v+a*y)/r:a;t(e,p,y,i,o,g,u),t(p,n,v,g,o,a,u)}else{var b=r?(o*v+u*y)/r:u;t(e,p,y,i,o,a,b),t(p,n,v,i,b,a,u)}}(0,u,t.value,e,n,r,i)}function Ov(t,e,n,r,i){(1&t.depth?bv:nv)(t,e,n,r,i)}const Sv=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}(_v);function Tv(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}function Av(t,e){var n=ki(+t,+e);return function(t){var e=n(t);return e-360*Math.floor(e/360)}}function Nv(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function Lv(t){return((t=Math.exp(t))+1/t)/2}const Mv=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),v=(h*h-c*c+r*m)/(2*c*n*y),g=(h*h-c*c-r*m)/(2*h*n*y),b=Math.log(Math.sqrt(v*v+1)-v),_=Math.log(Math.sqrt(g*g+1)-g);a=(_-b)/e,o=function(t){var r,i=t*a,o=Lv(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/Lv(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 Cv(t){return function(e,n){var r=t((e=pi(e)).h,(n=pi(n)).h),i=Ei(e.s,n.s),o=Ei(e.l,n.l),a=Ei(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 jv=Cv(ki);var Pv=Cv(Ei);function Iv(t,e){var n=Ei((t=Os(t)).l,(e=Os(e)).l),r=Ei(t.a,e.a),i=Ei(t.b,e.b),o=Ei(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 Rv(t){return function(e,n){var r=t((e=js(e)).h,(n=js(n)).h),i=Ei(e.c,n.c),o=Ei(e.l,n.l),a=Ei(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 Dv=Rv(ki);var Bv=Rv(Ei);function Fv(t){return function e(n){function r(e,r){var i=t((e=qs(e)).h,(r=qs(r)).h),o=Ei(e.s,r.s),a=Ei(e.l,r.l),s=Ei(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 $v=Fv(ki);var Kv=Fv(Ei);function Uv(t,e){void 0===e&&(e=t,t=Fi);for(var n=0,r=e.length-1,i=e[0],o=new Array(r<0?0:r);n1&&Wv(t[n[i-2]],t[n[i-1]],t[r])<=0;)--i;n[i++]=r}return n.slice(0,i)}function Gv(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 Xv(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}(Qv),ng=function t(e){var n=eg.source(e);function r(){var t=n.apply(this,arguments);return function(){return Math.exp(t())}}return r.source=t,r}(Qv),rg=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}(Qv),ig=function t(e){var n=rg.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}(Qv),og=function t(e){function n(t){return function(){return-Math.log1p(-e())/t}}return n.source=t,n}(Qv),ag=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}(Qv),sg=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}(Qv),ug=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}(Qv),cg=function t(e){var n=eg.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}(Qv),lg=function t(e){var n=cg.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}(Qv),fg=function t(e){var n=ug.source(e),r=lg.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}(Qv),hg=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}(Qv),pg=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}(Qv),dg=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}(Qv),mg=function t(e){var n=cg.source(e),r=fg.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}(Qv),yg=1664525,vg=1013904223,gg=1/4294967296;function bg(t=Math.random()){let e=0|(0<=t&&t<1?t/gg:Math.abs(t));return()=>(e=yg*e+vg|0,gg*(e>>>0))}function _g(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function wg(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 xg=Symbol("implicit");function kg(){var t=new _t,e=[],n=[],r=xg;function i(i){let o=t.get(i);if(void 0===o){if(r!==xg)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 _t;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 kg(e,n).unknown(r)},_g.apply(i,arguments),i}function Eg(){var t,e,n=kg().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?Cg:Mg,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),Pi)))(n)))},f.domain=function(t){return arguments.length?(a=Array.from(t,Tg),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=Nv,l()},f.clamp=function(t){return arguments.length?(c=!!t||Ng,l()):c!==Ng},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 Ig(){return Pg()(Ng,Ng)}function Rg(t,e,n,r){var i,o=Qt(t,e,n);switch((r=tf(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=df(o,a))||(r.precision=i),uf(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=mf(o,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=pf(o))||(r.precision=i-2*("%"===r.type))}return sf(r)}function Dg(t){var e=t.domain;return t.ticks=function(t){var n=e();return Jt(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return Rg(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=Xt(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 Bg(){var t=Ig();return t.copy=function(){return jg(t,Bg())},_g.apply(t,arguments),Dg(t)}function Fg(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,Tg),n):t.slice()},n.unknown=function(t){return arguments.length?(e=t,n):e},n.copy=function(){return Fg(t).unknown(e)},t=arguments.length?Array.from(t,Tg):[0,1],Dg(n)}function $g(t,e){var n,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a-t(-e,n)}function Yg(t){const e=t(Kg,Ug),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?Vg:t===Math.E?Math.exp:e=>Math.pow(t,e)}(o),n()[0]<0?(r=Wg(r),i=Wg(i),t(zg,qg)):t(Kg,Ug),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=tf(n)).precision||(n.trim=!0),n=sf(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($g(n(),{floor:t=>i(Math.floor(r(t))),ceil:t=>i(Math.ceil(r(t)))})),e}function Hg(){const t=Yg(Pg()).domain([1,10]);return t.copy=()=>jg(t,Hg()).base(t.base()),_g.apply(t,arguments),t}function Gg(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function Jg(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function Xg(t){var e=1,n=t(Gg(e),Jg(e));return n.constant=function(n){return arguments.length?t(Gg(e=+n),Jg(e)):e},Dg(n)}function Qg(){var t=Xg(Pg());return t.copy=function(){return jg(t,Qg()).constant(t.constant())},_g.apply(t,arguments)}function Zg(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function tb(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function eb(t){return t<0?-t*t:t*t}function nb(t){var e=t(Ng,Ng),n=1;return e.exponent=function(e){return arguments.length?1==(n=+e)?t(Ng,Ng):.5===n?t(tb,eb):t(Zg(n),Zg(1/n)):n},Dg(e)}function rb(){var t=nb(Pg());return t.copy=function(){return jg(t,rb()).exponent(t.exponent())},_g.apply(t,arguments),t}function ib(){return rb.apply(null,arguments).exponent(.5)}function ob(t){return Math.sign(t)*t*t}function ab(){var t,e=Ig(),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(ob(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,Tg)).map(ob)),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 ab(e.domain(),n).round(r).clamp(e.clamp()).unknown(t)},_g.apply(i,arguments),Dg(i)}function sb(){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 ub().domain([e,n]).range(o).unknown(t)},_g.apply(Dg(a),arguments)}function cb(){var t,e=[.5],n=[0,1],r=1;function i(i){return null!=i&&i<=i?n[tt(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 cb().domain(e).range(n).unknown(t)},_g.apply(i,arguments)}const lb=1e3,fb=6e4,hb=36e5,pb=864e5,db=6048e5,mb=31536e6,yb=new Date,vb=new Date;function gb(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(sgb((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)=>(yb.setTime(+e),vb.setTime(+r),t(yb),t(vb),Math.floor(n(yb,vb))),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 bb=gb((()=>{}),((t,e)=>{t.setTime(+t+e)}),((t,e)=>e-t));bb.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?gb((e=>{e.setTime(Math.floor(e/t)*t)}),((e,n)=>{e.setTime(+e+n*t)}),((e,n)=>(n-e)/t)):bb:null);const _b=bb.range,wb=gb((t=>{t.setTime(t-t.getMilliseconds())}),((t,e)=>{t.setTime(+t+e*lb)}),((t,e)=>(e-t)/lb),(t=>t.getUTCSeconds())),xb=wb.range,kb=gb((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*lb)}),((t,e)=>{t.setTime(+t+e*fb)}),((t,e)=>(e-t)/fb),(t=>t.getMinutes())),Eb=kb.range,Ob=gb((t=>{t.setUTCSeconds(0,0)}),((t,e)=>{t.setTime(+t+e*fb)}),((t,e)=>(e-t)/fb),(t=>t.getUTCMinutes())),Sb=Ob.range,Tb=gb((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*lb-t.getMinutes()*fb)}),((t,e)=>{t.setTime(+t+e*hb)}),((t,e)=>(e-t)/hb),(t=>t.getHours())),Ab=Tb.range,Nb=gb((t=>{t.setUTCMinutes(0,0,0)}),((t,e)=>{t.setTime(+t+e*hb)}),((t,e)=>(e-t)/hb),(t=>t.getUTCHours())),Lb=Nb.range,Mb=gb((t=>t.setHours(0,0,0,0)),((t,e)=>t.setDate(t.getDate()+e)),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*fb)/pb),(t=>t.getDate()-1)),Cb=Mb.range,jb=gb((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/pb),(t=>t.getUTCDate()-1)),Pb=jb.range,Ib=gb((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/pb),(t=>Math.floor(t/pb))),Rb=Ib.range;function Db(t){return gb((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())*fb)/db))}const Bb=Db(0),Fb=Db(1),$b=Db(2),Kb=Db(3),Ub=Db(4),zb=Db(5),qb=Db(6),Vb=Bb.range,Wb=Fb.range,Yb=$b.range,Hb=Kb.range,Gb=Ub.range,Jb=zb.range,Xb=qb.range;function Qb(t){return gb((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)/db))}const Zb=Qb(0),t_=Qb(1),e_=Qb(2),n_=Qb(3),r_=Qb(4),i_=Qb(5),o_=Qb(6),a_=Zb.range,s_=t_.range,u_=e_.range,c_=n_.range,l_=r_.range,f_=i_.range,h_=o_.range,p_=gb((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())),d_=p_.range,m_=gb((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())),y_=m_.range,v_=gb((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()));v_.every=t=>isFinite(t=Math.floor(t))&&t>0?gb((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 g_=v_.range,b_=gb((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()));b_.every=t=>isFinite(t=Math.floor(t))&&t>0?gb((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 __=b_.range;function w_(t,e,n,r,i,o){const a=[[wb,1,lb],[wb,5,5e3],[wb,15,15e3],[wb,30,3e4],[o,1,fb],[o,5,3e5],[o,15,9e5],[o,30,18e5],[i,1,hb],[i,3,108e5],[i,6,216e5],[i,12,432e5],[r,1,pb],[r,2,1728e5],[n,1,db],[e,1,2592e6],[e,3,7776e6],[t,1,mb]];function s(e,n,r){const i=Math.abs(n-e)/r,o=Y((([,,t])=>t)).right(a,i);if(o===a.length)return t.every(Qt(e/mb,n/mb,r));if(0===o)return bb.every(Math.max(Qt(e,n,r),1));const[s,u]=a[i/a[o-1][2]=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:Jw,s:Xw,S:vw,u:gw,U:bw,V:ww,w:xw,W:kw,x:null,X:null,y:Ew,Y:Sw,Z:Aw,"%":Gw},_={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:Nw,e:Nw,f:Pw,g:Vw,G:Yw,H:Lw,I:Mw,j:Cw,L:jw,m:Iw,M:Rw,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:Jw,s:Xw,S:Dw,u:Bw,U:Fw,V:Kw,w:Uw,W:zw,x:null,X:null,y:qw,Y:Ww,Z:Hw,"%":Gw},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=v.exec(e.slice(n));return r?(t.m=g.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 E(t,e,n,r)},d:Z_,e:Z_,f:ow,g:G_,G:H_,H:ew,I:ew,j:tw,L:iw,m:Q_,M:nw,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:X_,Q:sw,s:uw,S:rw,u:q_,U:V_,V:W_,w:z_,W:Y_,x:function(t,e,r){return E(t,n,e,r)},X:function(t,e,n){return E(t,r,e,n)},y:G_,Y:H_,Z:J_,"%":aw};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=T_(A_(o.y,0,1))).getUTCDay(),r=i>4||0===i?t_.ceil(r):t_(r),r=jb.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=S_(A_(o.y,0,1))).getDay(),r=i>4||0===i?Fb.ceil(r):Fb(r),r=Mb.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?T_(A_(o.y,0,1)).getUTCDay():S_(A_(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,T_(o)):S_(o)}}function E(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 I_?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 L_,M_,C_,j_,P_,I_={"-":"",_:" ",0:"0"},R_=/^\s*\d+/,D_=/^%/,B_=/[\\^$*+?|[\]().{}]/g;function F_(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o[t.toLowerCase(),e])))}function z_(t,e,n){var r=R_.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function q_(t,e,n){var r=R_.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function V_(t,e,n){var r=R_.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function W_(t,e,n){var r=R_.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Y_(t,e,n){var r=R_.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function H_(t,e,n){var r=R_.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function G_(t,e,n){var r=R_.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function J_(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 X_(t,e,n){var r=R_.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function Q_(t,e,n){var r=R_.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Z_(t,e,n){var r=R_.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function tw(t,e,n){var r=R_.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function ew(t,e,n){var r=R_.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function nw(t,e,n){var r=R_.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function rw(t,e,n){var r=R_.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function iw(t,e,n){var r=R_.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function ow(t,e,n){var r=R_.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function aw(t,e,n){var r=D_.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function sw(t,e,n){var r=R_.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function uw(t,e,n){var r=R_.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function cw(t,e){return F_(t.getDate(),e,2)}function lw(t,e){return F_(t.getHours(),e,2)}function fw(t,e){return F_(t.getHours()%12||12,e,2)}function hw(t,e){return F_(1+Mb.count(v_(t),t),e,3)}function pw(t,e){return F_(t.getMilliseconds(),e,3)}function dw(t,e){return pw(t,e)+"000"}function mw(t,e){return F_(t.getMonth()+1,e,2)}function yw(t,e){return F_(t.getMinutes(),e,2)}function vw(t,e){return F_(t.getSeconds(),e,2)}function gw(t){var e=t.getDay();return 0===e?7:e}function bw(t,e){return F_(Bb.count(v_(t)-1,t),e,2)}function _w(t){var e=t.getDay();return e>=4||0===e?Ub(t):Ub.ceil(t)}function ww(t,e){return t=_w(t),F_(Ub.count(v_(t),t)+(4===v_(t).getDay()),e,2)}function xw(t){return t.getDay()}function kw(t,e){return F_(Fb.count(v_(t)-1,t),e,2)}function Ew(t,e){return F_(t.getFullYear()%100,e,2)}function Ow(t,e){return F_((t=_w(t)).getFullYear()%100,e,2)}function Sw(t,e){return F_(t.getFullYear()%1e4,e,4)}function Tw(t,e){var n=t.getDay();return F_((t=n>=4||0===n?Ub(t):Ub.ceil(t)).getFullYear()%1e4,e,4)}function Aw(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+F_(e/60|0,"0",2)+F_(e%60,"0",2)}function Nw(t,e){return F_(t.getUTCDate(),e,2)}function Lw(t,e){return F_(t.getUTCHours(),e,2)}function Mw(t,e){return F_(t.getUTCHours()%12||12,e,2)}function Cw(t,e){return F_(1+jb.count(b_(t),t),e,3)}function jw(t,e){return F_(t.getUTCMilliseconds(),e,3)}function Pw(t,e){return jw(t,e)+"000"}function Iw(t,e){return F_(t.getUTCMonth()+1,e,2)}function Rw(t,e){return F_(t.getUTCMinutes(),e,2)}function Dw(t,e){return F_(t.getUTCSeconds(),e,2)}function Bw(t){var e=t.getUTCDay();return 0===e?7:e}function Fw(t,e){return F_(Zb.count(b_(t)-1,t),e,2)}function $w(t){var e=t.getUTCDay();return e>=4||0===e?r_(t):r_.ceil(t)}function Kw(t,e){return t=$w(t),F_(r_.count(b_(t),t)+(4===b_(t).getUTCDay()),e,2)}function Uw(t){return t.getUTCDay()}function zw(t,e){return F_(t_.count(b_(t)-1,t),e,2)}function qw(t,e){return F_(t.getUTCFullYear()%100,e,2)}function Vw(t,e){return F_((t=$w(t)).getUTCFullYear()%100,e,2)}function Ww(t,e){return F_(t.getUTCFullYear()%1e4,e,4)}function Yw(t,e){var n=t.getUTCDay();return F_((t=n>=4||0===n?r_(t):r_.ceil(t)).getUTCFullYear()%1e4,e,4)}function Hw(){return"+0000"}function Gw(){return"%"}function Jw(t){return+t}function Xw(t){return Math.floor(+t/1e3)}function Qw(t){return L_=N_(t),M_=L_.format,C_=L_.parse,j_=L_.utcFormat,P_=L_.utcParse,L_}function Zw(t){return new Date(t)}function tx(t){return t instanceof Date?+t:+new Date(+t)}function ex(t,e,n,r,i,o,a,s,u,c){var l=Ig(),f=l.invert,h=l.domain,p=c(".%L"),d=c(":%S"),m=c("%I:%M"),y=c("%I %p"),v=c("%a %d"),g=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)=>ce(t,r/e)))},n.copy=function(){return fx(e).domain(t)},wg.apply(n,arguments)}function hx(){var t,e,n,r,i,o,a,s=0,u=.5,c=1,l=1,f=Ng,h=!1;function p(t){return isNaN(t=+t)?a:(t=.5+((t=+o(t))-e)*(l*tTi(t[t.length-1]);var Lx=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(gx);const Mx=Nx(Lx);var Cx=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(gx);const jx=Nx(Cx);var Px=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(gx);const Ix=Nx(Px);var Rx=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(gx);const Dx=Nx(Rx);var Bx=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(gx);const Fx=Nx(Bx);var $x=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(gx);const Kx=Nx($x);var Ux=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(gx);const zx=Nx(Ux);var qx=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(gx);const Vx=Nx(qx);var Wx=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(gx);const Yx=Nx(Wx);var Hx=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(gx);const Gx=Nx(Hx);var Jx=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(gx);const Xx=Nx(Jx);var Qx=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(gx);const Zx=Nx(Qx);var tk=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(gx);const ek=Nx(tk);var nk=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(gx);const rk=Nx(nk);var ik=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(gx);const ok=Nx(ik);var ak=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(gx);const sk=Nx(ak);var uk=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(gx);const ck=Nx(uk);var lk=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(gx);const fk=Nx(lk);var hk=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(gx);const pk=Nx(hk);var dk=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(gx);const mk=Nx(dk);var yk=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(gx);const vk=Nx(yk);var gk=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(gx);const bk=Nx(gk);var _k=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(gx);const wk=Nx(_k);var xk=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(gx);const kk=Nx(xk);var Ek=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(gx);const Ok=Nx(Ek);var Sk=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(gx);const Tk=Nx(Sk);var Ak=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(gx);const Nk=Nx(Ak);function Lk(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 Mk=Kv(qs(300,.5,0),qs(-240,.5,1));var Ck=Kv(qs(-100,.75,.35),qs(80,1.5,.8)),jk=Kv(qs(260,.75,.35),qs(80,1.5,.8)),Pk=qs();function Ik(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return Pk.h=360*t-100,Pk.s=1.5-1.5*e,Pk.l=.8-.9*e,Pk+""}var Rk=ii(),Dk=Math.PI/3,Bk=2*Math.PI/3;function Fk(t){var e;return t=(.5-t)*Math.PI,Rk.r=255*(e=Math.sin(t))*e,Rk.g=255*(e=Math.sin(t+Dk))*e,Rk.b=255*(e=Math.sin(t+Bk))*e,Rk+""}function $k(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 Kk(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}const Uk=Kk(gx("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var zk=Kk(gx("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),qk=Kk(gx("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),Vk=Kk(gx("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function Wk(t){return Nr(mr(t).call(document.documentElement))}var Yk=0;function Hk(){return new Gk}function Gk(){this._="@"+(++Yk).toString(36)}function Jk(t,e){return t.target&&(t=$i(t),void 0===e&&(e=t.currentTarget),t=t.touches||[t]),Array.from(t,(t=>Ki(t,e)))}function Xk(t){return"string"==typeof t?new Sr([document.querySelectorAll(t)],[document.documentElement]):new Sr([gn(t)],Or)}function Qk(t){return function(){return t}}Gk.prototype=Hk.prototype={constructor:Gk,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 Zk=Math.abs,tE=Math.atan2,eE=Math.cos,nE=Math.max,rE=Math.min,iE=Math.sin,oE=Math.sqrt,aE=1e-12,sE=Math.PI,uE=sE/2,cE=2*sE;function lE(t){return t>=1?uE:t<=-1?-uE:Math.asin(t)}function fE(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 Za(e)}function hE(t){return t.innerRadius}function pE(t){return t.outerRadius}function dE(t){return t.startAngle}function mE(t){return t.endAngle}function yE(t){return t&&t.padAngle}function vE(t,e,n,r,i,o,a){var s=t-n,u=e-r,c=(a?o:-o)/oE(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,v=(p+m)/2,g=d-h,b=m-p,_=g*g+b*b,w=i-o,x=h*m-d*p,k=(b<0?-1:1)*oE(nE(0,w*w*_-x*x)),E=(x*b-g*k)/_,O=(-x*g-b*k)/_,S=(x*b+g*k)/_,T=(-x*g+b*k)/_,A=E-y,N=O-v,L=S-y,M=T-v;return A*A+N*N>L*L+M*M&&(E=S,O=T),{cx:E,cy:O,x01:-l,y01:-f,x11:E*(i/w-1),y11:O*(i/w-1)}}function gE(){var t=hE,e=pE,n=Qk(0),r=null,i=dE,o=mE,a=yE,s=null,u=fE(c);function c(){var c,l,f,h=+t.apply(this,arguments),p=+e.apply(this,arguments),d=i.apply(this,arguments)-uE,m=o.apply(this,arguments)-uE,y=Zk(m-d),v=m>d;if(s||(s=c=u()),paE)if(y>cE-aE)s.moveTo(p*eE(d),p*iE(d)),s.arc(0,0,p,d,m,!v),h>aE&&(s.moveTo(h*eE(m),h*iE(m)),s.arc(0,0,h,m,d,v));else{var g,b,_=d,w=m,x=d,k=m,E=y,O=y,S=a.apply(this,arguments)/2,T=S>aE&&(r?+r.apply(this,arguments):oE(h*h+p*p)),A=rE(Zk(p-h)/2,+n.apply(this,arguments)),N=A,L=A;if(T>aE){var M=lE(T/h*iE(S)),C=lE(T/p*iE(S));(E-=2*M)>aE?(x+=M*=v?1:-1,k-=M):(E=0,x=k=(d+m)/2),(O-=2*C)>aE?(_+=C*=v?1:-1,w-=C):(O=0,_=w=(d+m)/2)}var j=p*eE(_),P=p*iE(_),I=h*eE(k),R=h*iE(k);if(A>aE){var D,B=p*eE(w),F=p*iE(w),$=h*eE(x),K=h*iE(x);if(y1?0:f<-1?sE:Math.acos(f))/2),Y=oE(D[0]*D[0]+D[1]*D[1]);N=rE(A,(h-Y)/(W-1)),L=rE(A,(p-Y)/(W+1))}else N=L=0}O>aE?L>aE?(g=vE($,K,j,P,p,L,v),b=vE(B,F,I,R,p,L,v),s.moveTo(g.cx+g.x01,g.cy+g.y01),LaE&&E>aE?N>aE?(g=vE(I,R,B,F,h,-N,v),b=vE(j,P,$,K,h,-N,v),s.lineTo(g.cx+g.x01,g.cy+g.y01),N=f;--h)s.point(v[h],g[h]);s.lineEnd(),s.areaEnd()}y&&(v[l]=+t(p,l,c),g[l]=+e(p,l,c),s.point(r?+r(p,l,c):v[l],n?+n(p,l,c):g[l]))}if(d)return s=null,d+""||null}function l(){return OE().defined(i).curve(a).context(o)}return t="function"==typeof t?t:void 0===t?kE:Qk(+t),e="function"==typeof e?e:Qk(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?EE:Qk(+n),c.x=function(e){return arguments.length?(t="function"==typeof e?e:Qk(+e),r=null,c):t},c.x0=function(e){return arguments.length?(t="function"==typeof e?e:Qk(+e),c):t},c.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:Qk(+t),c):r},c.y=function(t){return arguments.length?(e="function"==typeof t?t:Qk(+t),n=null,c):e},c.y0=function(t){return arguments.length?(e="function"==typeof t?t:Qk(+t),c):e},c.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:Qk(+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:Qk(!!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 TE(t,e){return et?1:e>=t?0:NaN}function AE(t){return t}function NE(){var t=AE,e=TE,n=null,r=Qk(0),i=Qk(cE),o=Qk(0);function a(a){var s,u,c,l,f,h=(a=_E(a)).length,p=0,d=new Array(h),m=new Array(h),y=+r.apply(this,arguments),v=Math.min(cE,Math.max(-cE,i.apply(this,arguments)-y)),g=Math.min(Math.abs(v)/h,o.apply(this,arguments)),b=g*(v<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?(v-h*b)/p:0;s0?f*c:0)+b,m[u]={data:a[u],index:s,value:f,startAngle:y,endAngle:l,padAngle:g};return m}return a.value=function(e){return arguments.length?(t="function"==typeof e?e:Qk(+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:Qk(+t),a):r},a.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:Qk(+t),a):i},a.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:Qk(+t),a):o},a}wE.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 LE=CE(xE);function ME(t){this._curve=t}function CE(t){function e(e){return new ME(t(e))}return e._curve=t,e}function jE(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(CE(t)):e()._curve},t}function PE(){return jE(OE().curve(LE))}function IE(){var t=SE().curve(LE),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 jE(n())},delete t.lineX0,t.lineEndAngle=function(){return jE(r())},delete t.lineX1,t.lineInnerRadius=function(){return jE(i())},delete t.lineY0,t.lineOuterRadius=function(){return jE(o())},delete t.lineY1,t.curve=function(t){return arguments.length?e(CE(t)):e()._curve},t}function RE(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}ME.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 DE{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 BE{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=RE(this._x0,this._y0),r=RE(this._x0,this._y0=(this._y0+e)/2),i=RE(t,this._y0),o=RE(t,e);this._context.moveTo(...n),this._context.bezierCurveTo(...r,...i,...o)}this._x0=t,this._y0=e}}function FE(t){return new DE(t,!0)}function $E(t){return new DE(t,!1)}function KE(t){return new BE(t)}function UE(t){return t.source}function zE(t){return t.target}function qE(t){let e=UE,n=zE,r=kE,i=EE,o=null,a=null,s=fE(u);function u(){let u;const c=bE.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:Qk(+t),u):r},u.y=function(t){return arguments.length?(i="function"==typeof t?t:Qk(+t),u):i},u.context=function(e){return arguments.length?(null==e?o=a=null:a=t(o=e),u):o},u}function VE(){return qE(FE)}function WE(){return qE($E)}function YE(){const t=qE(KE);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t}const HE=oE(3),GE={draw(t,e){const n=.59436*oE(e+rE(e/28,.75)),r=n/2,i=r*HE;t.moveTo(0,n),t.lineTo(0,-n),t.moveTo(-i,-r),t.lineTo(i,r),t.moveTo(-i,r),t.lineTo(i,-r)}},JE={draw(t,e){const n=oE(e/sE);t.moveTo(n,0),t.arc(0,0,n,0,cE)}},XE={draw(t,e){const n=oE(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()}},QE=oE(1/3),ZE=2*QE,tO={draw(t,e){const n=oE(e/ZE),r=n*QE;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},eO={draw(t,e){const n=.62625*oE(e);t.moveTo(0,-n),t.lineTo(n,0),t.lineTo(0,n),t.lineTo(-n,0),t.closePath()}},nO={draw(t,e){const n=.87559*oE(e-rE(e/7,2));t.moveTo(-n,0),t.lineTo(n,0),t.moveTo(0,n),t.lineTo(0,-n)}},rO={draw(t,e){const n=oE(e),r=-n/2;t.rect(r,r,n,n)}},iO={draw(t,e){const n=.4431*oE(e);t.moveTo(n,n),t.lineTo(n,-n),t.lineTo(-n,-n),t.lineTo(-n,n),t.closePath()}},oO=iE(sE/10)/iE(7*sE/10),aO=iE(cE/10)*oO,sO=-eE(cE/10)*oO,uO={draw(t,e){const n=oE(.8908130915292852*e),r=aO*n,i=sO*n;t.moveTo(0,-n),t.lineTo(r,i);for(let e=1;e<5;++e){const o=cE*e/5,a=eE(o),s=iE(o);t.lineTo(s*n,-a*n),t.lineTo(a*r-s*i,s*r+a*i)}t.closePath()}},cO=oE(3),lO={draw(t,e){const n=-oE(e/(3*cO));t.moveTo(0,2*n),t.lineTo(-cO*n,-n),t.lineTo(cO*n,-n),t.closePath()}},fO=oE(3),hO={draw(t,e){const n=.6824*oE(e),r=n/2,i=n*fO/2;t.moveTo(0,-n),t.lineTo(i,r),t.lineTo(-i,r),t.closePath()}},pO=-.5,dO=oE(3)/2,mO=1/oE(12),yO=3*(mO/2+1),vO={draw(t,e){const n=oE(e/yO),r=n/2,i=n*mO,o=r,a=n*mO+n,s=-o,u=a;t.moveTo(r,i),t.lineTo(o,a),t.lineTo(s,u),t.lineTo(pO*r-dO*i,dO*r+pO*i),t.lineTo(pO*o-dO*a,dO*o+pO*a),t.lineTo(pO*s-dO*u,dO*s+pO*u),t.lineTo(pO*r+dO*i,pO*i-dO*r),t.lineTo(pO*o+dO*a,pO*a-dO*o),t.lineTo(pO*s+dO*u,pO*u-dO*s),t.closePath()}},gO={draw(t,e){const n=.6189*oE(e-rE(e/6,1.7));t.moveTo(-n,-n),t.lineTo(n,n),t.moveTo(-n,n),t.lineTo(n,-n)}},bO=[JE,XE,tO,rO,uO,lO,vO],_O=[JE,nO,gO,hO,GE,iO,eO];function wO(t,e){let n=null,r=fE(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:Qk(t||JE),e="function"==typeof e?e:Qk(void 0===e?64:+e),i.type=function(e){return arguments.length?(t="function"==typeof e?e:Qk(e),i):t},i.size=function(t){return arguments.length?(e="function"==typeof t?t:Qk(+t),i):e},i.context=function(t){return arguments.length?(n=null==t?null:t,i):n},i}function xO(){}function kO(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 EO(t){this._context=t}function OO(t){return new EO(t)}function SO(t){this._context=t}function TO(t){return new SO(t)}function AO(t){this._context=t}function NO(t){return new AO(t)}function LO(t,e){this._basis=new EO(t),this._beta=e}EO.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:kO(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:kO(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},SO.prototype={areaStart:xO,areaEnd:xO,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:kO(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},AO.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:kO(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},LO.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 MO=function t(e){function n(t){return 1===e?new EO(t):new LO(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function CO(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 jO(t,e){this._context=t,this._k=(1-e)/6}jO.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:CO(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:CO(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 PO=function t(e){function n(t){return new jO(t,e)}return n.tension=function(e){return t(+e)},n}(0);function IO(t,e){this._context=t,this._k=(1-e)/6}IO.prototype={areaStart:xO,areaEnd:xO,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:CO(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 RO=function t(e){function n(t){return new IO(t,e)}return n.tension=function(e){return t(+e)},n}(0);function DO(t,e){this._context=t,this._k=(1-e)/6}DO.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:CO(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 BO=function t(e){function n(t){return new DO(t,e)}return n.tension=function(e){return t(+e)},n}(0);function FO(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>aE){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>aE){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 $O(t,e){this._context=t,this._alpha=e}$O.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:FO(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 KO=function t(e){function n(t){return e?new $O(t,e):new jO(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function UO(t,e){this._context=t,this._alpha=e}UO.prototype={areaStart:xO,areaEnd:xO,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:FO(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 zO=function t(e){function n(t){return e?new UO(t,e):new IO(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function qO(t,e){this._context=t,this._alpha=e}qO.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:FO(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 VO=function t(e){function n(t){return e?new qO(t,e):new DO(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function WO(t){this._context=t}function YO(t){return new WO(t)}function HO(t){return t<0?-1:1}function GO(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(HO(o)+HO(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function JO(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function XO(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 QO(t){this._context=t}function ZO(t){this._context=new tS(t)}function tS(t){this._context=t}function eS(t){return new QO(t)}function nS(t){return new ZO(t)}function rS(t){this._context=t}function iS(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 hS(t,e){return t[e]}function pS(t){const e=[];return e.key=t,e}function dS(){var t=Qk([]),e=fS,n=lS,r=hS;function i(i){var o,a,s=Array.from(t.apply(this,arguments),pS),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 vS(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 wS(t){var e=t.map(xS);return fS(t).sort((function(t,n){return e[t]-e[n]}))}function xS(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 SS="%Y-%m-%dT%H:%M:%S.%LZ",TS=Date.prototype.toISOString?function(t){return t.toISOString()}:j_(SS);const AS=TS;var NS=+new Date("2000-01-01T00:00:00.000Z")?function(t){var e=new Date(t);return isNaN(e)?null:e}:P_(SS);const LS=NS;function MS(t,e,n){var r=new eo,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?Zi():+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 CS=t=>()=>t;function jS(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 PS(t,e,n){this.k=t,this.x=e,this.y=n}PS.prototype={constructor:PS,scale:function(t){return 1===t?this:new PS(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new PS(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 IS=new PS(1,0,0);function RS(t){for(;!t.__zoom;)if(!(t=t.parentNode))return IS;return t.__zoom}function DS(t){t.stopImmediatePropagation()}function BS(t){t.preventDefault(),t.stopImmediatePropagation()}function FS(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function $S(){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 KS(){return this.__zoom||IS}function US(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function zS(){return navigator.maxTouchPoints||"ontouchstart"in this}function qS(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 VS(){var t,e,n,r=FS,i=$S,o=qS,a=US,s=zS,u=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],l=250,f=Mv,h=mn("start","zoom","end"),p=500,d=150,m=0,y=10;function v(t){t.property("__zoom",KS).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",O).on("dblclick.zoom",S).filter(s).on("touchstart.zoom",T).on("touchmove.zoom",A).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(t,e){return(e=Math.max(u[0],Math.min(u[1],e)))===t.k?t:new PS(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 PS(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 PS(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 E(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=Ki(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)],wo(this),n.start()}BS(t),n.wheel=setTimeout((function(){n.wheel=null,n.end()}),d),n.zoom("mouse",o(b(g(i,s),n.mouse[0],n.mouse[1]),n.extent,c))}}function O(t,...e){if(!n&&r.apply(this,arguments)){var i=t.currentTarget,a=x(this,e,!0).event(t),s=Nr(t.view).on("mousemove.zoom",(function(t){if(BS(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]=Ki(t,i),a.mouse[1]),a.extent,c))}),!0).on("mouseup.zoom",(function(t){s.on("mousemove.zoom mouseup.zoom",null),Ir(t.view,a.moved),BS(t),a.event(t).end()}),!0),u=Ki(t,i),l=t.clientX,f=t.clientY;Pr(t.view),DS(t),a.mouse=[u,this.__zoom.invert(u)],wo(this),a.start()}}function S(t,...e){if(r.apply(this,arguments)){var n=this.__zoom,a=Ki(t.changedTouches?t.changedTouches[0]:t,this),s=n.invert(a),u=n.k*(t.shiftKey?.5:2),f=o(b(g(n,u),a,s),i.apply(this,e),c);BS(t),l>0?Nr(this).transition().duration(l).call(w,f,a,t):Nr(this).call(v.transform,f,a,t)}}function T(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(DS(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&&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:M(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},e}function nN(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 rN(t){var e=function(t,e){if("object"!=GA(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=GA(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==GA(e)?e:e+""}var iN=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=new jA(this.pluginData,this.viewport,e),this.linkRenderer=new DA(this.pluginData,this.viewport,e),this.layout=new HA(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:"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 vA(this.pluginData,this.viewport,this.layout),this.actions.deleteAction=new rT(this.pluginData,this.viewport,this.layout),this.actions.dragScene=new bT(this.pluginData,this.viewport,this.layout),this.actions.menuAction=new IT(this.pluginData,this.viewport,this.layout),this.actions.link=new TT(this.pluginData,this.viewport,this.layout),this.actions.zoom=new OA(this.pluginData,this.viewport,this.layout),this.actions.dragComponent=new fT(this.pluginData,this.viewport,this.layout),this.actions.resizeComponent=new zT(this.pluginData,this.viewport,this.layout),this.actions.toggleSelection=new ZT(this.pluginData,this.viewport,this.layout),this.actions.deselectionAll=new sA(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=eN().mark((function e(n){var r,i,o,a,s,u,c;return eN().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){nN(o,r,i,a,s,"next",t)}function s(t){nN(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.scene=this.getScene(),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=e/ia;)s*=.9;var u=(e-i*s)/2,c=(n-o*s)/2;this.pluginData.scene.zoom=s,this.viewport.selectAll(".scene > g").attr("transform","translate(".concat(u," ").concat(c,") scale(").concat(s,")"))}}},{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(ZA({id:"scene",name:"",children:JA(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}}}],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 h(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 q({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]:"Error happened when trying to parse.",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"Error";return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,n){return e=xN(e),function(t,e){if(e&&("object"==gN(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,_N()?Reflect.construct(e,n||[],xN(t).constructor):e.apply(t,n))}(this,e,[n||"Error happened when trying to parse."])).name="ParseError",t.startLine=r||0,t.startColumn=i||0,t.endLine=o||0,t.endColumn=a||0,t.severity=s||"Error",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&&wN(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(bN(Error));const EN=kN;var ON=function(t,e,n){return Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(){var e=arguments.length>0&&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 TN(t){return TN="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},TN(t)}function AN(t,e,n){return e=LN(e),function(t,e){if(e&&("object"==TN(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,NN()?Reflect.construct(e,n||[],LN(t).constructor):e.apply(t,n))}function NN(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(NN=function(){return!!t})()}function LN(t){return LN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},LN(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}(I);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 IN(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:[]},parseErrors:[],resources:{},scene:{x:0,y:0,zoom:1,selection:[],selectionRef:null}},d=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=p.name||null,this.version=p.version||null,this.components=p.components||[],this.scene={x:(null===(n=p.scene)||void 0===n?void 0:n.x)||0,y:(null===(r=p.scene)||void 0===r?void 0:r.y)||0,zoom:(null===(i=p.scene)||void 0===i?void 0:i.zoom)||1,selection:(null===(o=p.scene)||void 0===o?void 0:o.selection)||[],selectionRef:(null===(a=p.scene)||void 0===a?void 0:a.selectionRef)||null},this.variables=p.variables||[],this.definitions={components:(null===(s=p.definitions)||void 0===s?void 0:s.components)||[],links:(null===(u=p.definitions)||void 0===u?void 0:u.links)||[]},this.parseErrors=p.parseErrors||[],this.__eventIndex=0,this.eventManager=d,this.eventLogs=[],this.configuration=e,this.resources={icons:DN({},null===(c=p.resources)||void 0===c?void 0:c.icons),markers:DN({},null===(l=p.resources)||void 0===l?void 0:l.markers),links:DN({},null===(f=p.resources)||void 0===f?void 0:f.links),models:DN({},null===(h=p.resources)||void 0===h?void 0:h.models)},this.temporaryLink=null},e=[{key:"coreVersion",get:function(){return"0.24.1"}},{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 _({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 IN(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 IN(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)?IN(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 I({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:{}};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.editor=qN({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=qN({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)}));const HN=YN;function GN(t){return GN="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},GN(t)}function JN(t){var e=function(t,e){if("object"!=GN(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=GN(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==GN(e)?e:e+""}var XN=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 KN(this.configuration,{},e.event),this.__drawer=e.pluginDrawer||new oN(this.data),this.__metadata=e.pluginMetadata||new cN(this.data),this.__parser=e.pluginParser||new pN(this.data),this.__renderer=e.pluginRenderer||new vN(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:"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 tL=ZN;function eL(t){return eL="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},eL(t)}function nL(t,e,n){return e=iL(e),function(t,e){if(e&&("object"==eL(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,rL()?Reflect.construct(e,n||[],iL(t).constructor):e.apply(t,n))}function rL(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(rL=function(){return!!t})()}function iL(t){return iL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},iL(t)}function oL(t,e){return oL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},oL(t,e)}var aL=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=nL(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&&oL(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(l);const sL=aL})();var o=e;for(var a in i)o[a]=i[a];i.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})()},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:c,Root:h,NodeList:f,Value:l,Literal:p,Symbol:d,Group:m,Array:y,Pair:v,Dict:g,Output:K,Capture:U,TemplateData:z,If:_,IfAsync:w,InlineIf:x,For:k,AsyncEach:E,AsyncAll:O,Macro:S,Caller:T,Import:A,FromImport:N,FunCall:L,Filter:M,FilterAsync:C,KeywordArgs:j,Block:P,Super:I,Extends:R,Include:D,Set:B,Switch:F,Case:$,LookupVal:b,BinOp:V,In:W,Is:Y,Or:H,And:G,Not:J,Add:X,Concat:Q,Sub:Z,Mul:tt,Div:et,FloorDiv:nt,Mod:rt,Pow:it,Neg:ot,Pos:at,Compare:st,CompareOperand:ut,CallExtension:ct,CallExtensionAsync:lt,printNodes:function t(e,n){if(n=n||0,ft(e.typename+": ",n),e instanceof f)ft("\n"),e.children.forEach((function(e){t(e,n+2)}));else if(e instanceof ct)ft(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 c?r.push([e,t]):(i=i||{})[e]=t})),i?ft(JSON.stringify(i,null,2)+"\n",null,!0):ft("\n"),r.forEach((function(e){var r=e[0],i=e[1];ft("["+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),v=y.Obj,g=y.EmitterObj,b=n(2),_=b.handleError,w=b.Frame,x=n(22);function k(t,e,n){o((function(){t(e,n)}))}var E={type:"code",obj:{root:function(t,e,n,r,i){try{i(null,"")}catch(t){i(_(t,null,null))}}}},O=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 T)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=","//","**"],D=M+this.current();switch(-1!==r.indexOf(R,D)&&(this.forward(),M=D,-1!==r.indexOf(R,D+this.current())&&(M=D+this.current(),this.forward())),M){case"(":I=d;break;case")":I=m;break;case"[":I=y;break;case"]":I=v;break;case"{":I=g;break;case"}":I=b;break;case",":I=w;break;case":":I=x;break;case"~":I=k;break;case"|":I=E;break;default:I=_}return L(I,M,e,n)}if((t=this._extractUntil(i+o)).match(/^[-+]?[0-9]+$/)){if("."===this.current()){this.forward();var B=this._extract("0123456789");return L(O,t+"."+B,e,n)}return L("int",t,e,n)}if(t.match(/^(true|false)$/))return L(S,t,e,n);if("none"===t)return L(T,t,e,n);if("null"===t)return L(T,t,e,n);if(t)return L(A,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,L(c,t,e,n);if((t=this._extractString(this.tags.VARIABLE_START+"-"))||(t=this._extractString(this.tags.VARIABLE_START)))return this.in_code=!0,L(f,t,e,n);t="";var K=!1;for(this._matches(this.tags.COMMENT_START)&&(K=!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))&&!K){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(!K)throw new Error("unexpected end of comment");t+=this._extractString(this.tags.COMMENT_END);break}t+=this.current(),this.forward()}if(null===F&&K)throw new Error("expected end of comment, got end of file");return L(K?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{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},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:()=>oi});var t=n(916);const e={generic:JSON.parse('{"workflow":{"type":"workflow","category":"workflow","model":"workflow","icon":"DefaultWorkflow","displayName":"Workflow","description":"A workflow is a configurable automated process that will run one or more jobs.

Workflows are defined by a YAML file checked in to your repository and will run when triggered by an event in your repository, or they can be triggered manually, or at a defined schedule.","url":"https://docs.github.com/en/actions/using-workflows/about-workflows","childrenTypes":["push-trigger","pullrequest-trigger","job"],"isContainer":true,"available":true,"attributes":[{"name":"name","type":"String","required":true,"description":"The name of the workflow as it will appear in the \\"Actions\\" tab of the GitHub repository.","url":"https://docs.github.com/en/actions/using-workflows/about-workflows#understanding-the-workflow-file"}],"defaultWidth":96,"defaultHeight":80,"minWidth":96,"minHeight":80,"reservedWidth":12,"reservedHeight":80,"margin":15,"gap":50},"trigger":{"type":"trigger","category":"trigger","model":"trigger","icon":"DefaultTrigger","available":false,"parentTypes":["workflow"],"attributes":[{"name":"workflow_id","displayName":"Id of workflow","type":"Reference","containerRef":"workflow","required":true}],"defaultWidth":96,"defaultHeight":80,"minWidth":96,"minHeight":80,"reservedWidth":0,"reservedHeight":0,"margin":15,"gap":50},"job":{"type":"job","category":"job","model":"job","displayName":"Job","description":"A workflow run is made up of one or more jobs, which run in parallel by default.","url":"https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow","icon":"DefaultJob","available":true,"parentTypes":["workflow"],"childrenTypes":["command-step","reusable-step"],"isContainer":true,"displayType":"workflow","workflowDirection":"horizontal","linkModel":"defaultLink","attributes":[{"name":"workflow_id","displayName":"Id of workflow","type":"Reference","containerRef":"workflow","required":true},{"name":"name","type":"String","description":"The name of the job as it will appear in the \\"Actions\\" tab of the GitHub repository.","url":"https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow#setting-a-name-for-a-job"},{"name":"runs-on","type":"String","displayName":"Type of runner","description":"The type of machine to run the job on.","url":"https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on"},{"name":"needs","displayName":"Previous job(s)","description":"Identify any jobs that must complete successfully before this job will run","url":"https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow#defining-prerequisite-jobs","type":"Link","linkType":"Reverse","linkRef":"job","linkModel":"defaultLink"}],"defaultWidth":96,"defaultHeight":80,"minWidth":140,"minHeight":200,"reservedWidth":12,"reservedHeight":80,"margin":15,"gap":50},"step":{"type":"step","category":"step","model":"step","icon":"DefaultStep","available":false,"parentTypes":["job"],"description":"Task of the job. Step can run commands, run setup tasks, or run an action in your repository, a public repository, or an action published in a Docker registry.","url":"https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idsteps","attributes":[{"name":"job_id","displayName":"Id of job","type":"Reference","containerRef":"job","required":true},{"name":"name","type":"String","description":"The name of the step as it will appear in the \\"Actions\\" tab of the GitHub repository.","url":"https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow#setting-a-name-for-a-job"},{"name":"env","type":"Object","displayName":"Environment variables","description":"Variables for steps to use in the runner environment.","url":"https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsenv"}],"defaultWidth":96,"defaultHeight":80,"minWidth":96,"minHeight":80,"reservedWidth":0,"reservedHeight":0,"margin":15,"gap":50}}'),trigger:JSON.parse('[{"type":"push-trigger","category":"trigger","icon":"PushTrigger","displayName":"Trigger - push","description":"Workflow trigger is an event that causes a workflow to run.

This event will trigger the workflow on a push event.","url":"https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push","action":"push","attributes":[{"name":"branches","type":"Array","description":"Select branch name on push event.","url":"https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#running-your-workflow-only-when-a-push-to-specific-branches-occurs"}]},{"type":"pullrequest-trigger","category":"trigger","icon":"PullRequestTrigger","displayName":"Trigger - pull request","description":"Workflow trigger is an event that causes a workflow to run.

This event will trigger the workflow on a pull request event.","action":"pull_request","attributes":[{"name":"types","type":"Array","displayName":"Activity types","description":"Run your workflow when an activity on a pull request occurs in the workflow\'s repository.","url":"https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request"}]}]'),step:JSON.parse('[{"type":"command-step","category":"step","displayName":"Command step","icon":"CommandStep","name":"command-step","attributes":[{"name":"run","type":"String","required":true}]},{"type":"reusable-step","category":"step","displayName":"Reusable step","icon":"ReusableStep","name":"reusable-step","attributes":[{"name":"uses","type":"String","required":true,"displayName":"External action","description":"Select an action to run as part of a step in your job. An action is a reusable unit of code. You can use an action defined in the same repository as the workflow, a public repository, or in a published Docker container image.","url":"https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsuses"},{"name":"with","type":"Object","displayName":"Input parameters","description":"Input parameters of the action defined by \\"uses\\" keyword.","url":"https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepswith"}]}]')};function i(t){return i="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},i(t)}function o(t,e,n){return e=s(e),function(t,e){if(e&&("object"==i(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,a()?Reflect.construct(e,n||[],s(t).constructor):e.apply(t,n))}function a(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(a=function(){return!!t})()}function s(t){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},s(t)}function u(t,e){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},u(t,e)}const c=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{available:!1,category:null};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=o(this,e,[n])).available=!!n.available,t.category=n.category||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&&u(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(t.ComponentDefinition);function l(t){return l="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},l(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 h(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{action:null};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=m(this,e,[h(h({},n),{},{category:"trigger"})])).action=n.action||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&&g(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(c);function _(t){return _="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)}function w(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 x(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=Array(e);n!!t&&"object"==typeof t&&t[z]===D,V=t=>!!t&&"object"==typeof t&&t[z]===B,W=t=>!!t&&"object"==typeof t&&t[z]===F,Y=t=>!!t&&"object"==typeof t&&t[z]===$,H=t=>!!t&&"object"==typeof t&&t[z]===K,G=t=>!!t&&"object"==typeof t&&t[z]===U;function J(t){if(t&&"object"==typeof t)switch(t[z]){case F:case U:return!0}return!1}function X(t){if(t&&"object"==typeof t)switch(t[z]){case D:case F:case K:case U:return!0}return!1}const Q=t=>(H(t)||J(t))&&!!t.anchor,Z=Symbol("break visit"),tt=Symbol("skip children"),et=Symbol("remove node");function nt(t,e){const n=at(e);V(t)?rt(null,t.contents,n,Object.freeze([t]))===et&&(t.contents=null):rt(null,t,n,Object.freeze([]))}function rt(t,e,n,r){const i=st(t,e,n,r);if(X(i)||Y(i))return ut(t,r,i),rt(t,i,n,r);if("symbol"!=typeof i)if(J(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=>ct[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&&X(t.contents)){const e={};nt(t.contents,((t,n)=>{X(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 ft(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 ht(t){const e=new Set;return nt(t,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function pt(t,e){for(let n=1;;++n){const r=`${t}${n}`;if(!e.has(r))return r}}function dt(t,e,n,r){if(r&&"object"==typeof r)if(Array.isArray(r))for(let e=0,n=r.length;emt(t,String(e),n)));if(t&&"function"==typeof t.toJSON){if(!n||!Q(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)}lt.defaultYaml={explicit:!1,version:"1.2"},lt.defaultTags={"!!":"tag:yaml.org,2002:"};class yt{constructor(t){Object.defineProperty(this,z,{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(!V(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=mt(this,"",o);if("function"==typeof r)for(const{count:t,res:e}of o.anchors.values())r(e,t);return"function"==typeof i?dt(i,{"":a},"",a):a}}class vt extends yt{constructor(t){super(D),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t){let e;return nt(t,{Node:(t,n)=>{if(n===this)return nt.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||(mt(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=gt(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(ft(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 gt(t,e,n){if(q(e)){const r=e.resolve(t),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(J(e)){let r=0;for(const i of e.items){const e=gt(t,i,n);e>r&&(r=e)}return r}if(Y(e)){const r=gt(t,e.key,n),i=gt(t,e.value,n);return Math.max(r,i)}return 1}const bt=t=>!t||"function"!=typeof t&&"object"!=typeof t;class _t extends yt{constructor(t){super(K),this.value=t}toJSON(t,e){return e?.keep?this.value:mt(this.value,t,e)}toString(){return String(this.value)}}_t.BLOCK_FOLDED="BLOCK_FOLDED",_t.BLOCK_LITERAL="BLOCK_LITERAL",_t.PLAIN="PLAIN",_t.QUOTE_DOUBLE="QUOTE_DOUBLE",_t.QUOTE_SINGLE="QUOTE_SINGLE";const wt="tag:yaml.org,2002:";function xt(t,e,n){if(V(t)&&(t=t.contents),X(t))return t;if(Y(t)){const e=n.schema[F].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 vt(u.anchor);u={anchor:null,node:null},s.set(t,u)}e?.startsWith("!!")&&(e=wt+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 _t(t);return u&&(u.node=e),e}c=t instanceof Map?a[F]:Symbol.iterator in Object(t)?a[U]:a[F]}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 _t(t);return e?l.tag=e:c.default||(l.tag=c.tag),u&&(u.node=l),l}function kt(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 xt(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 Et=t=>null==t||"object"==typeof t&&!!t[Symbol.iterator]().next().done;class Ot extends yt{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=>X(e)||Y(e)?e.clone(t):e)),this.range&&(e.range=this.range.slice()),e}addIn(t,e){if(Et(t))this.add(e);else{const[n,...r]=t,i=this.get(n,!0);if(J(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,kt(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(J(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&&H(i)?i.value:i:J(i)?i.getIn(r,e):void 0}hasAllNullValues(t){return this.items.every((e=>{if(!Y(e))return!1;const n=e.value;return null==n||t&&H(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!!J(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(J(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,kt(this.schema,r,e))}}}}Ot.maxFlowStringSingleLineLength=60;const St=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function Tt(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}const At=(t,e,n)=>t.endsWith("\n")?Tt(n,e):n.includes("\n")?"\n"+Tt(n,e):(t.endsWith(" ")?"":" ")+n,Nt="flow",Lt="block",Mt="quoted";function Ct(t,e,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:o=20,onFold:a,onOverflow:s}={}){if(!i||i<0)return t;const u=Math.max(1+o,1+i-e.length);if(t.length<=u)return t;const c=[],l={};let f,h,p=i-e.length;"number"==typeof r&&(r>i-Math.max(2,o)?c.push(0):p=i-r);let d=!1,m=-1,y=-1,v=-1;n===Lt&&(m=jt(t,m,e.length),-1!==m&&(p=m+u));for(let r;r=t[m+=1];){if(n===Mt&&"\\"===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}v=m}if("\n"===r)n===Lt&&(m=jt(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===Mt){for(;" "===h||"\t"===h;)h=r,r=t[m+=1],d=!0;const e=m>v+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 g=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}),It=t=>/^(%|---|\.\.\.)/m.test(t);function Rt(t,e){const n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=e,i=e.options.doubleQuotedMinMultiLineLength,o=e.indent||(It(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(Ft,`$&${c}`));let m,y=!1,v=-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}${g}${n=n.replace(/\n+/g,`$&${c}`)}${p}`:`${b}\n${c}${Ct(`${g}${n=n.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`)}${p}`,c,Lt,Pt(r,!0))}`}function Kt(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!==_t.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(s=_t.QUOTE_DOUBLE);const u=t=>{switch(t){case _t.BLOCK_FOLDED:case _t.BLOCK_LITERAL:return i||o?Bt(a.value,e):$t(a,e,n,r);case _t.QUOTE_DOUBLE:return Rt(a.value,e);case _t.QUOTE_SINGLE:return Dt(a.value,e);case _t.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 Bt(o,e);if(!o||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return s||l||!o.includes("\n")?Bt(o,e):$t(t,e,n,r);if(!s&&!l&&i!==_t.PLAIN&&o.includes("\n"))return $t(t,e,n,r);if(It(o)){if(""===u)return e.forceBlockIndent=!0,$t(t,e,n,r);if(s&&u===c)return Bt(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 Bt(o,e)}return s?f:Ct(f,u,Nt,Pt(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 Ut(t,e){const n=Object.assign({blockQuote:!0,commentString:St,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 zt(t,e,n,r){if(Y(t))return t.toString(e,n,r);if(q(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=X(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(H(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=(H(t)||J(t))&&t.anchor;o&&ft(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):H(o)?Kt(o,e,n,r):o.toString(e,n,r);return a?H(o)||"{"===s[0]||"["===s[0]?`${a} ${s}`:`${a}\n${e.indent}${s}`:s}function qt(t,e){"debug"!==t&&"warn"!==t||("undefined"!=typeof process&&process.emitWarning?process.emitWarning(e):console.warn(e))}function Vt(t,e,{key:n,value:r}){if(t?.doc.schema.merge&&Wt(n))if(r=q(r)?r.resolve(t.doc):r,G(r))for(const n of r.items)Yt(t,e,n);else if(Array.isArray(r))for(const n of r)Yt(t,e,n);else Yt(t,e,r);else{const i=mt(n,"",t);if(e instanceof Map)e.set(i,mt(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(X(t)&&n?.doc){const e=Ut(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)+'..."'),qt(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=mt(r,o,t);o in e?Object.defineProperty(e,o,{value:a,writable:!0,enumerable:!0,configurable:!0}):e[o]=a}}return e}const Wt=t=>"<<"===t||H(t)&&"<<"===t.value&&(!t.type||t.type===_t.PLAIN);function Yt(t,e,n){const r=t&&q(n)?n.resolve(t.doc):n;if(!W(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 Ht(t,e,n){const r=xt(t,void 0,n),i=xt(e,void 0,n);return new Gt(r,i)}class Gt{constructor(t,e=null){Object.defineProperty(this,z,{value:$}),this.key=t,this.value=e}clone(t){let{key:e,value:n}=this;return X(e)&&(e=e.clone(t)),X(n)&&(n=n.clone(t)),new Gt(e,n)}toJSON(t,e){return Vt(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=X(t)&&t.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(J(t)||!X(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||J(t)||(H(t)?t.type===_t.BLOCK_FOLDED||t.type===_t.BLOCK_LITERAL:"object"==typeof t));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(f||!o),indent:s+u});let d,m,y,v=!1,g=!1,b=zt(t,n,(()=>v=!0),(()=>g=!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 v&&r&&r(),""===b?"?":p?`? ${b}`:b}else if(o&&!f||null==e&&p)return b=`? ${b}`,h&&!v?b+=At(b,n.indent,c(h)):g&&i&&i(),b;v&&(h=null),p?(h&&(b+=At(b,n.indent,c(h))),b=`? ${b}\n${s}:`):(b=`${b}:`,h&&(b+=At(b,n.indent,c(h)))),X(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||!H(e)||(n.indentAtStart=b.length+1),g=!1,l||!(u.length>=2)||n.inFlow||p||!G(e)||e.flow||e.tag||e.anchor||(n.indent=n.indent.substring(2));let _=!1;const w=zt(e,n,(()=>_=!0),(()=>g=!0));let x=" ";if(h||d||m)x=d?"\n":"",m&&(x+=`\n${Tt(c(m),n.indent)}`),""!==w||n.inFlow?x+=`\n${n.indent}`:"\n"===x&&(x="\n\n");else if(!p&&J(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+=At(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 Zt({indent:t,options:{commentString:e}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const i=Tt(e(r),t);n.push(i.trimStart())}}function te(t,e){const n=H(e)?e.value:e;for(const r of t)if(Y(r)){if(r.key===e||r.key===n)return r;if(H(r.key)&&r.key.value===n)return r}}class ee extends Ot{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(F,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(Ht(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=Y(t)?t:t&&"object"==typeof t&&"key"in t?new Gt(t.key,t.value):new Gt(t,t?.value);const r=te(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!e)throw new Error(`Key ${n.key} already set`);H(r.value)&&bt(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=te(this.items,t);return!!e&&this.items.splice(this.items.indexOf(e),1).length>0}get(t,e){const n=te(this.items,t),r=n?.value;return(!e&&H(r)?r.value:r)??void 0}has(t){return!!te(this.items,t)}set(t,e){this.add(new Gt(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)Vt(e,r,t);return r}toString(t,e,n){if(!t)return JSON.stringify(this);for(const t of this.items)if(!Y(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})),Jt(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:n,onComment:e})}}const ne={collection:"map",default:!0,nodeClass:ee,tag:"tag:yaml.org,2002:map",resolve:(t,e)=>(W(t)||e("Expected a mapping for this tag"),t),createNode:(t,e,n)=>ee.from(t,e,n)};class re extends Ot{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(U,t),this.items=[]}add(t){this.items.push(t)}delete(t){const e=ie(t);return"number"==typeof e&&this.items.splice(e,1).length>0}get(t,e){const n=ie(t);if("number"!=typeof n)return;const r=this.items[n];return!e&&H(r)?r.value:r}has(t){const e=ie(t);return"number"==typeof e&&e=0?e:null}const oe={collection:"seq",default:!0,nodeClass:re,tag:"tag:yaml.org,2002:seq",resolve:(t,e)=>(G(t)||e("Expected a sequence for this tag"),t),createNode:(t,e,n)=>re.from(t,e,n)},ae={identify:t=>"string"==typeof t,default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:(t,e,n,r)=>Kt(t,e=Object.assign({actualString:!0},e),n,r)},se={identify:t=>null==t,createNode:()=>new _t(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new _t(null),stringify:({source:t},e)=>"string"==typeof t&&se.test.test(t)?t:e.options.nullStr},ue={identify:t=>"boolean"==typeof t,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new _t("t"===t[0]||"T"===t[0]),stringify:({source:t,value:e},n)=>t&&ue.test.test(t)&&e===("t"===t[0]||"T"===t[0])?t:e?n.options.trueStr:n.options.falseStr};function ce({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 le={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:ce},fe={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():ce(t)}},he={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 _t(parseFloat(t)),n=t.indexOf(".");return-1!==n&&"0"===t[t.length-1]&&(e.minFractionDigits=t.length-n-1),e},stringify:ce},pe=t=>"bigint"==typeof t||Number.isInteger(t),de=(t,e,n,{intAsBigInt:r})=>r?BigInt(t):parseInt(t.substring(e),n);function me(t,e,n){const{value:r}=t;return pe(r)&&r>=0?n+r.toString(e):ce(t)}const ye={identify:t=>pe(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>de(t,2,8,n),stringify:t=>me(t,8,"0o")},ve={identify:pe,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>de(t,0,10,n),stringify:ce},ge={identify:t=>pe(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>de(t,2,16,n),stringify:t=>me(t,16,"0x")},be=[ne,oe,ae,se,ue,ye,ve,ge,le,fe,he];function _e(t){return"bigint"==typeof t||Number.isInteger(t)}const we=({value:t})=>JSON.stringify(t),xe=[ne,oe].concat([{identify:t=>"string"==typeof t,default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:we},{identify:t=>null==t,createNode:()=>new _t(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:we},{identify:t=>"boolean"==typeof t,default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:t=>"true"===t,stringify:we},{identify:_e,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})=>_e(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:we}],{default:!0,tag:"",test:/^/,resolve:(t,e)=>(e(`Unresolved plain scalar ${JSON.stringify(t)}`),t)}),ke={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 Gt(new _t(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]=Y(r)?r:new Gt(r)}}else e("Expected a sequence for this tag");return t}function Oe(t,e,n){const{replacer:r}=n,i=new re(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(Ht(a,s,n))}return i}const Se={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Ee,createNode:Oe};class Te extends re{constructor(){super(),this.add=ee.prototype.add.bind(this),this.delete=ee.prototype.delete.bind(this),this.get=ee.prototype.get.bind(this),this.has=ee.prototype.has.bind(this),this.set=ee.prototype.set.bind(this),this.tag=Te.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(Y(t)?(r=mt(t.key,"",e),i=mt(t.value,r,e)):r=mt(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=Oe(t,e,n),i=new this;return i.items=r.items,i}}Te.tag="tag:yaml.org,2002:omap";const Ae={collection:"seq",identify:t=>t instanceof Map,nodeClass:Te,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){const n=Ee(t,e),r=[];for(const{key:t}of n.items)H(t)&&(r.includes(t.value)?e(`Ordered maps must not include duplicate keys: ${t.value}`):r.push(t.value));return Object.assign(new Te,n)},createNode:(t,e,n)=>Te.from(t,e,n)};function Ne({value:t,source:e},n){return e&&(t?Le:Me).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}const Le={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 _t(!0),stringify:Ne},Me={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 _t(!1),stringify:Ne},Ce={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:ce},je={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():ce(t)}},Pe={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 _t(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:ce},Ie=t=>"bigint"==typeof t||Number.isInteger(t);function Re(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 De(t,e,n){const{value:r}=t;if(Ie(r)){const t=r.toString(e);return r<0?"-"+n+t.substr(1):n+t}return ce(t)}const Be={identify:Ie,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>Re(t,2,2,n),stringify:t=>De(t,2,"0b")},Fe={identify:Ie,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>Re(t,1,8,n),stringify:t=>De(t,8,"0")},$e={identify:Ie,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>Re(t,0,10,n),stringify:ce},Ke={identify:Ie,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>Re(t,2,16,n),stringify:t=>De(t,16,"0x")};class Ue extends ee{constructor(t){super(t),this.tag=Ue.tag}add(t){let e;e=Y(t)?t:t&&"object"==typeof t&&"key"in t&&"value"in t&&null===t.value?new Gt(t.key,null):new Gt(t,null),te(this.items,e.key)||this.items.push(e)}get(t,e){const n=te(this.items,t);return!e&&Y(n)?H(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=te(this.items,t);n&&!e?this.items.splice(this.items.indexOf(n),1):!n&&e&&this.items.push(new Gt(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(Ht(t,null,n));return i}}Ue.tag="tag:yaml.org,2002:set";const ze={collection:"map",identify:t=>t instanceof Set,nodeClass:Ue,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>Ue.from(t,e,n),resolve(t,e){if(W(t)){if(t.hasAllNullValues(!0))return Object.assign(new Ue,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};function qe(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 Ve(t){let{value:e}=t,n=t=>t;if("bigint"==typeof e)n=t=>BigInt(t);else if(isNaN(e)||!isFinite(e))return ce(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 We={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})=>qe(t,n),stringify:Ve},Ye={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=>qe(t,!1),stringify:Ve},He={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(He.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=qe(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$/,"")},Ge=[ne,oe,ae,se,Le,Me,Be,Fe,$e,Ke,Ce,je,Pe,ke,Ae,Se,ze,We,Ye,He],Je=new Map([["core",be],["failsafe",[ne,oe,ae]],["json",xe],["yaml11",Ge],["yaml-1.1",Ge]]),Xe={binary:ke,bool:ue,float:he,floatExp:fe,floatNaN:le,floatTime:Ye,int:ve,intHex:ge,intOct:ye,intTime:We,map:ne,null:se,omap:Ae,pairs:Se,seq:oe,set:ze,timestamp:He},Qe={"tag:yaml.org,2002:binary":ke,"tag:yaml.org,2002:omap":Ae,"tag:yaml.org,2002:pairs":Se,"tag:yaml.org,2002:set":ze,"tag:yaml.org,2002:timestamp":He};function Ze(t,e){let n=Je.get(e);if(!n){if(!Array.isArray(t)){const t=Array.from(Je.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=Xe[t];if(e)return e;const n=Object.keys(Xe).map((t=>JSON.stringify(t))).join(", ");throw new Error(`Unknown custom tag "${t}"; use one of ${n}`)}))}const tn=(t,e)=>t.keye.key?1:0;class en{constructor({compat:t,customTags:e,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(t)?Ze(t,"compat"):t?Ze(null,t):null,this.merge=!!n,this.name="string"==typeof i&&i||"core",this.knownTags=r?Qe:{},this.tags=Ze(e,this.name),this.toStringOptions=a??null,Object.defineProperty(this,F,{value:ne}),Object.defineProperty(this,K,{value:ae}),Object.defineProperty(this,U,{value:oe}),this.sortMapEntries="function"==typeof o?o:!0===o?tn:null}clone(){const t=Object.create(en.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}class nn{constructor(t,e,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,z,{value:B});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 lt({version:o}),this.setSchema(o,n),this.contents=void 0===t?null:this.createNode(t,r,n)}clone(){const t=Object.create(nn.prototype,{[z]:{value:B}});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=X(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){rn(this.contents)&&this.contents.add(t)}addIn(t,e){rn(this.contents)&&this.contents.addIn(t,e)}createAlias(t,e){if(!t.anchor){const n=ht(this);t.anchor=!e||n.has(e)?pt(e||"a",n):e}return new vt(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=ht(t));const o=pt(e,i);return i.add(o),o},setAnchors:()=>{for(const t of n){const e=r.get(t);if("object"!=typeof e||!e.anchor||!H(e.node)&&!J(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=xt(t,c,{aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:l,onTagObj:u,replacer:r,schema:this.schema,sourceObjects:h});return a&&J(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 Gt(r,i)}delete(t){return!!rn(this.contents)&&this.contents.delete(t)}deleteIn(t){return Et(t)?null!=this.contents&&(this.contents=null,!0):!!rn(this.contents)&&this.contents.deleteIn(t)}get(t,e){return J(this.contents)?this.contents.get(t,e):void 0}getIn(t,e){return Et(t)?!e&&H(this.contents)?this.contents.value:this.contents:J(this.contents)?this.contents.getIn(t,e):void 0}has(t){return!!J(this.contents)&&this.contents.has(t)}hasIn(t){return Et(t)?void 0!==this.contents:!!J(this.contents)&&this.contents.hasIn(t)}set(t,e){null==this.contents?this.contents=kt(this.schema,[t],e):rn(this.contents)&&this.contents.set(t,e)}setIn(t,e){Et(t)?this.contents=e:null==this.contents?this.contents=kt(this.schema,Array.from(t),e):rn(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 lt({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 lt({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 en(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=mt(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?dt(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=Ut(t,e),{commentString:o}=i.options;if(t.commentBefore){1!==n.length&&n.unshift("");const e=o(t.commentBefore);n.unshift(Tt(e,""))}let a=!1,s=null;if(t.contents){if(X(t.contents)){if(t.contents.spaceBefore&&r&&n.push(""),t.contents.commentBefore){const e=o(t.contents.commentBefore);n.push(Tt(e,""))}i.forceBlockIndent=!!t.comment,s=t.contents.comment}const e=s?void 0:()=>a=!0;let u=zt(t.contents,i,(()=>s=null),e);s&&(u+=At(u,"",o(s))),"|"!==u[0]&&">"!==u[0]||"---"!==n[n.length-1]?n.push(u):n[n.length-1]=`--- ${u}`}else n.push(zt(t.contents,i));if(t.directives?.docEnd)if(t.comment){const e=o(t.comment);e.includes("\n")?(n.push("..."),n.push(Tt(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(Tt(o(e),"")))}return n.join("\n")+"\n"}(this,t)}}function rn(t){if(J(t))return!0;throw new Error("Expected a YAML collection as document contents")}class on extends Error{constructor(t,e,n,r){super(),this.name=t,this.code=n,this.message=r,this.pos=e}}class an extends on{constructor(t,e,n){super("YAMLParseError",t,e,n)}}class sn extends on{constructor(t,e,n){super("YAMLWarning",t,e,n)}}const un=(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 cn(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=!1,y=null,v=null,g=null,b=null,_=null,w=null;for(const i of t)switch(m&&("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"),m=!1),y&&(c&&"comment"!==i.type&&"newline"!==i.type&&o(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),y=null),i.type){case"space":e||"doc-start"===n&&"flow-collection"===r?.type||!i.source.includes("\t")||(y=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,(v||g)&&(d=!0),l=!0;break;case"anchor":v&&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),v=i,null===w&&(w=i.offset),c=!1,l=!1,m=!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,m=!0;break;case n:(v||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 m&&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"),y&&(c&&y.indent<=a||"block-map"===r?.type||"block-seq"===r?.type)&&o(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:_,spaceBefore:u,comment:f,hasNewline:p,hasNewlineAfterProp:d,anchor:v,tag:g,end:k,start:w??k}}function ln(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(ln(e.key)||ln(e.value))return!0}return!1;default:return!0}}function fn(t,e,n){if("flow-collection"===e?.type){const r=e.end[0];r.indent!==t||"]"!==r.source&&"}"!==r.source||!ln(e)||n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function hn(t,e,n){const{uniqueKeys:r}=t.options;if(!1===r)return!1;const i="function"==typeof r?r:(e,n)=>e===n||H(e)&&H(n)&&e.value===n.value&&!("<<"===e.value&&t.schema.merge);return e.some((t=>i(t.key,n)))}const pn="All mapping items must start at the same column";function dn(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 mn="Block collections are not allowed within flow collections",yn=t=>t&&("block-map"===t.type||"block-seq"===t.type);function vn(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??ee)(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=cn(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",pn)),!p.anchor&&!p.tag&&!f){u=p.end,p.comment&&(a.comment?a.comment+="\n"+p.comment:a.comment=p.comment);continue}(p.hasNewlineAfterProp||ln(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",pn);const m=p.end,y=l?t(n,l,p,i):e(n,m,c,null,p,i);n.schema.compat&&fn(r.indent,l,i),hn(n,a.items,y)&&i(m,"DUPLICATE_KEY","Map keys must be unique");const v=cn(f??[],{indicator:"map-value-ind",next:h,offset:y.range[2],onError:i,parentIndent:r.indent,startOnNewline:!l||"block-scalar"===l.type});if(s=v.end,v.found){d&&("block-map"!==h?.type||v.hasNewline||i(s,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&p.start0){const t=dn(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 gn(t){let e,n;try{e=new RegExp("(.*?)(?"===i.mode?_t.BLOCK_FOLDED:_t.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=_t.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}`),gn(t)}(o,c);break;case"single-quoted-scalar":s=_t.QUOTE_SINGLE,u=function(t,e){return"'"===t[t.length-1]&&1!==t.length||e(t.length,"MISSING_CHAR","Missing closing 'quote"),gn(t.slice(1,-1)).replace(/''/g,"'")}(o,c);break;case"double-quoted-scalar":s=_t.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=dn(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[K];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[K])}(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[K];if(e.compat){const a=e.compat.find((t=>t.default&&t.test?.test(n)))??e[K];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[K];let l;try{const o=c.resolve(i,(t=>r(n??e,"TAG_RESOLVE_FAILED",t)),t.options);l=H(o)?o:new _t(o)}catch(t){const o=t instanceof Error?t.message:String(t);r(n??e,"TAG_RESOLVE_FAILED",o),l=new _t(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 kn(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 En={composeNode:On,composeEmptyNode:Sn};function On(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 vt(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=dn(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=xn(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?e.directives.tagName(r.source,(t=>i(r,"TAG_RESOLVE_FAILED",t))):null,a="block-map"===n.type?"map":"block-seq"===n.type?"seq":"{"===n.start.source?"map":"seq";if(!r||!o||"!"===o||o===ee.tagName&&"map"===a||o===re.tagName&&"seq"===a||!a)return vn(t,e,n,i,o);let s=e.schema.tags.find((t=>t.tag===o&&t.collection===a));if(!s){const u=e.schema.knownTags[o];if(!u||u.collection!==a)return u?.collection?i(r,"BAD_COLLECTION_TYPE",`${u.tag} used for ${a} collection, but expects ${u.collection}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),vn(t,e,n,i,o);e.schema.tags.push(Object.assign({},u,{default:!1})),s=u}const u=vn(t,e,n,i,o,s),c=s.resolve?.(u,(t=>i(r,"TAG_RESOLVE_FAILED",t)),e.options)??u,l=X(c)?c:new _t(c);return l.range=u.range,l.tag=o,s?.format&&(l.format=s.format),l}(En,t,e,s,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=Sn(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 Sn(t,e,n,r,{spaceBefore:i,comment:o,anchor:a,tag:s,end:u},c){const l=xn(t,{type:"scalar",offset:kn(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 Tn(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 An(t){let e="",n=!1,r=!1;for(let i=0;i{const i=Tn(t);r?this.warnings.push(new sn(i,e,n)):this.errors.push(new an(i,e,n))},this.directives=new lt({version:t.version||"1.2"}),this.options=t}decorate(t,e){const{comment:n,afterEmptyLine:r}=An(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(J(i)&&!i.flow&&i.items.length>0){let t=i.items[0];Y(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:An(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=Tn(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 nn(void 0,s),c={atRoot:!0,directives:u.directives,options:u.options,schema:u.schema},l=cn(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?On(c,i,l,a):Sn(c,l.end,r,null,l,a);const f=u.contents.range[2],h=dn(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 an(Tn(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 an(Tn(t),"UNEXPECTED_TOKEN",e));break}this.doc.directives.docEnd=!0;const e=dn(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 an(Tn(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 nn(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 Ln=Symbol("break visit"),Mn=Symbol("skip children"),Cn=Symbol("remove item");function jn(t,e){"type"in t&&"document"===t.type&&(t={start:t.start,value:t.value}),Pn(Object.freeze([]),t,e)}function Pn(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},jn.parentCollection=(t,e)=>{const n=jn.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 In(t){switch(t){case void 0:case" ":case"\n":case"\r":case"\t":return!0;default:return!1}}const Rn=new Set("0123456789ABCDEFabcdef"),Dn=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Bn=new Set(",[]{}"),Fn=new Set(" ,[]{}\n\r\t"),$n=t=>!t||Fn.has(t);class Kn{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)&&In(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return("number"!=typeof t||-1!==t&&tthis.indentValue&&!In(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)&&In(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($n),"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=>In(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(In(e)||t&&Bn.has(e))break;n=r}else if(In(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&&Bn.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&&Bn.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($n))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,e=this.charAt(1);if(In(e)||t&&Bn.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(;!In(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(Dn.has(e))e=this.buffer[++t];else{if("%"!==e||!Rn.has(this.buffer[t+1])||!Rn.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 Un{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 Hn(t){if("flow-seq-start"===t.start.type)for(const e of t.items)!e.sep||e.value||zn(e.start,"explicit-key-ind")||zn(e.sep,"map-value-ind")||(e.key&&(e.value=e.key),delete e.key,Vn(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 Gn{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 Kn,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&&Hn(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===qn(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(zn(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(Vn(e.key)&&!zn(e.sep,"newline")){const t=Yn(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(zn(e.start,"newline"))Object.assign(e,{key:null,sep:[this.sourceToken]});else{const t=Yn(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]}):zn(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||zn(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=Yn(Wn(e));Hn(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=Yn(Wn(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=Yn(Wn(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 Jn(t,e={}){const{lineCounter:n,prettyErrors:r}=function(t){const e=!1!==t.prettyErrors;return{lineCounter:t.lineCounter||e&&new Un||null,prettyErrors:e}}(e),i=new Gn(n?.addNewLine),o=new Nn(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 an(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(un(t,n)),a.warnings.forEach(un(t,n))),a}class Xn extends on{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 Qn{constructor(){this.lineCounter=new Un,this.src="",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 Xn("FILE_ERROR",0,`FileError : ${t}`);return this.errors.push(e),e}syntaxError(t,e){let n=new Xn("SYNTAX_ERROR",t.range?t.range[0]:0,`SyntaxError : ${e}`);return this.errors.push(n),n}syntaxWarning(t,e){let n=new Xn("SYNTAX_WARNING",t.range?t.range[0]:0,`SyntaxWarning : ${e}`);return this.warnings.push(n),n}typeError(t,e){let n=new Xn("TYPE_ERROR",t.range?t.range[0]:0,`TypeError : ${e}`);return this.errors.push(n),n}grammarError(t){let e=new Xn("GRAMMAR_ERROR",0,`GrammarError : ${t}`);this.errors.push(e)}grammarWarning(t){let e=new Xn("GRAMMAR_WARNING",0,`GrammarWarning : ${t}`);return 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 Zn{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 tr extends Zn{constructor(t,e,n){super(t,e,n)}equals(t){if(t instanceof tr)return this.value==t.value;this.ctx.syntaxError(this.current,`Error can not compare values '${this.value}' and '${t.value}'`)}}class er extends tr{constructor(t,e){if(super(t,"string",e),!er.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not a string`);this.value=e.value}static checkCurrent(t){return H(t)&&"string"==typeof t.value}static parse(t,e){try{return new er(t,e)}catch(t){return null}}}class nr extends tr{constructor(t,e){if(super(t,"binary",e),!nr.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not a base64 string`);this.value=e.value}static checkCurrent(t){return H(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 nr(t,e)}catch(t){return null}}}class rr extends tr{constructor(t,e){if(super(t,"int",e),!rr.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not an integer`);this.value=e.value}static checkCurrent(t){return H(t)&&"number"==typeof t.value&&t.value==Math.floor(t.value)}static parse(t,e){try{return new rr(t,e)}catch(t){return null}}}class ir extends tr{constructor(t,e){if(super(t,"float",e),!ir.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not a number`);this.value=e.value}static checkCurrent(t){return H(t)&&"number"==typeof t.value}static parse(t,e){try{return new ir(t,e)}catch(t){return null}}}class or extends tr{constructor(t,e){if(super(t,"boolean",e),this.value=null,!or.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e.value}' is not a boolean`);this.value=e.value}static checkCurrent(t){return H(t)&&"boolean"==typeof t.value}static parse(t,e){try{return new or(t,e)}catch(t){return null}}}class ar extends tr{constructor(t,e){if(super(t,"null",e),this.value=null,!ar.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not the null value`)}static checkCurrent(t){return H(t)&&(null==t.value||["Null","NULL","null","~"].includes(t.value))}static parse(t,e){try{return new ar(t,e)}catch(t){return null}}}class sr extends tr{constructor(t,e,n){if(super(t,"timestamp",e),!sr.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=H(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 sr(t,e)}catch(t){return null}}equals(t){return t instanceof sr?this.value.getTime()==t.value.getTime():this.ctx.syntaxError("Error : can not compare a timestamp with something else")}}class ur extends Zn{constructor(t,e,n){super(t,e,n)}length(){return this.childs.length}isEmpty(){return 0==this.length()}}class cr extends ur{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 W(t)&&t.items.every((t=>t.key&&H(t.key)&&"string"==typeof t.key.value))}}class lr{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=xr(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 fr="undefined"!=typeof Symbol;function hr(t){var e=typeof t;return"string"===e||"number"===e||"boolean"===e||!0===fr&&"symbol"===e||null==t||!0===fr&&t instanceof Symbol||t instanceof String||t instanceof Number||t instanceof Boolean}class pr{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=>pr.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=>hr(e)&&t.rules[e]?t.rules[e]:e)),e._merge=e._merge.map((e=>pr.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 pr.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]=pr.parse(t,e._map[r]);e._map=n}if(e._mapFacultative){let n={};for(const r in e._mapFacultative)n[r]=pr.parse(t,e._mapFacultative[r]);e._mapFacultative=n}if(e._mapOf){let n={};for(const r in e._mapOf){let i=pr.parse(t,r),o=pr.parse(t,e._mapOf[r]);n[i]=o}e._mapOf=n}e._list&&(e._list=e._list.map((e=>pr.parse(t,e)))),e._listFacultative&&(e._listFacultative=e._listFacultative.map((e=>pr.parse(t,e)))),e._listOf&&(e._listOf=pr.parse(t,e._listOf))}return e}}class dr{static isPositiveInt(t){return"number"==typeof t&&t==Math.floor(t)&&t>0}static sizeChecker(t,e,n,r){if(dr.isPositiveInt(n))if(W(r)||G(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||dr.sizeChecker(t,"eq",e._nb,n)?null==e._min||dr.sizeChecker(t,"min",e._min,n)?!(null!=e._max&&!dr.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 mr{static parse(t,e,n){if(!cr.checkCurrent(n))return t.syntaxError(n,"Error : a map whose keys are strings is expected "),null;if(e._merge&&(e=pr.parse(t,e))._oneOf)return lr.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(!dr.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=xr(t,null,r[n],c);else if(o&&o[n])l=xr(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=xr(t,null,a,i.key);if(l=xr(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 er(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 cr(t,n,u)}static parse_any(t,e){if(!cr.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=gr.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 er(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 cr(t,e,n)}}class yr extends ur{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 G(t)}}class vr{static parse(t,e,n){if(!yr.checkCurrent(n))return t.syntaxError(n,"Error : a list is expected "),null;if(!dr.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=gr.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 yr(t,e,n)}}class gr{static parse(t,e,n){switch(e){case"string":return er.parse(t,n);case"binary":return nr.parse(t,n);case"timestamp":return sr.parse(t,n);case"int":return rr.parse(t,n);case"float":return ir.parse(t,n);case"boolean":return or.parse(t,n);case"null":return ar.parse(t,n);case"any":return gr.parse_any(t,n);default:return kr(t,e,n)}}static parse_any(t,e){if(H(e)){switch(typeof e.value){case"number":return rr.checkCurrent(e)?rr.parse(t,e):ir.parse(t,e);case"boolean":return or.parse(t,e);case"string":return er.parse(t,e);case"object":if(null==e.value)return ar.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 W(e)?mr.parse_any(t,e):G(e)?vr.parse_any(t,e):null}}class br{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(!hr(e))return t.grammarError("Error: _in rules expects each alternative to be a scalar"),null;if(!H(n))return t.syntaxError(n,"Syntax Error : scalar value expected by rule '_in'"),null;let i=gr.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 _r{static parse(t,e,n){if(!er.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 er(t,n):(t.syntaxError(n,`Error: value '${n.value}' does not match the regular expression '${i}'`),null)}}class wr{static scalartypes=["string","int","float","null","boolean","binary","timestamp"];static keywords=["_map","_mapOf","_mapFacultative","_list","_listOf","_listFacultative","_oneOf","_regex","_nb","_min","_max","_in"];static parse(t,e,n,r){if(null==r)return t.fileError("No source to parse"),null;if(wr.scalartypes.includes(e)||wr.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=xr(t,null,n,r),a="exit_"+e;return"node_template"==e&&console.log("Sortie de node_template"),t.listener&&t.listener[a]&&t.listener[a](o),o}}function xr(t,e,n,r){if(e)return wr.parse(t,e,n,r);if(hr(n))return gr.parse(t,n,r);if("object"==typeof n){if(n._map||n._mapOf||n._mapFacultative||n._merge)return mr.parse(t,n,r);if(n._list||n._listOf||n._listFacultative)return vr.parse(t,n,r);if(n._oneOf)return lr.parse(t,n,r);if(n._regex)return _r.parse(t,n,r);if(n._in)return br.parse(t,n,r)}return t.grammarError("Error : grammar error : no valid keyword found"),null}function kr(t,e,n){let r=t.rules[e];return void 0!==r?xr(t,e,r,n):(t.grammarError(`no rule named ${e} found.`),null)}function Er(t){t.keyword||(t.keyword="main");let e=new Qn;return 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=Jn(t,n);if(!i)return null;if(i.warnings.forEach((t=>qt(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 Un;let n=Jn(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=kr(t,e,n);return t.errors.filter((t=>t instanceof Xn)).forEach((e=>e.pretty(t))),t.warnings.filter((t=>t instanceof Xn)).forEach((e=>e.pretty(t))),t.contents=r,t}(e,t.keyword,e.src)}var Or={main:"workflow",workflow:{_mapFacultative:{name:"WorkflowName",on:{_mapFacultative:{push:"PushTrigger",pull_request:"PullRequestTrigger"}},jobs:{_mapOf:{JobId:"Job"}}}},WorkflowName:"string",PushTrigger:{_map:{branches:"PushTriggerBranches"}},PushTriggerBranches:{_listOf:"string"},PullRequestTrigger:{_map:{types:"PullRequestTriggerTypes"}},PullRequestTriggerTypes:{_listOf:"string"},Job:{_mapFacultative:{name:"JobName","runs-on":"JobRunsOn",needs:"JobNeeds",steps:{_listOf:"Step"}}},JobId:"string",JobName:"string",JobRunsOn:"string",JobNeeds:{_listOf:"string"},Step:{_oneOf:["CommandStep","ReusableStep"]},ReusableStep:{_map:{uses:"StepUses"},_mapFacultative:{name:"StepName",with:"StepWith",env:"StepEnv"}},CommandStep:{_map:{run:"StepRun"},_mapFacultative:{name:"StepName",env:"StepEnv"}},StepUses:"string",StepName:"string",StepRun:"string",StepWith:{_mapOf:{StepMapKey:"StepMapValue"}},StepEnv:{_mapOf:{StepMapKey:"StepMapValue"}},StepMapKey:"string",StepMapValue:{_oneOf:["int","float","string"]}};function Sr(t){return Sr="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},Sr(t)}function Tr(t,e){for(var n=0;n1&&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){var n=e.path;return t.path===n})).filter((function(t){var n=t.path,i=t.content;return!(!i||""===i.trim())||(e.pluginData.emitEvent({parent:r,type:"Parser",action:"read",status:"warning",files:[n],data:{code:"no_content",global:!1}}),!1)})).forEach((function(t,n){var i=e.pluginData.emitEvent({parent:r,type:"Parser",action:"read",status:"running",files:[t.path],data:{global:!1}}),o=new R(t,e.pluginData.definitions.components,"workflow_".concat(n+1));!function(t){t.rules=Or,Er(t)}({src_data:t.content,listener:o,path:t.path,prog:{errors:[],warnings:[],imports:[],alreadyImported:[],root:[]}}),o.components.forEach((function(t){return e.pluginData.components.push(t)})),e.pluginData.emitEvent({id:i,status:"success"})}))}}],r&&Tr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(t.DefaultParser);var Pr=n(326),Ir=n.n(Pr);const Rr={root:"name: {{ workflowName.value }}\n\n{% if triggers.length > 0 %}\non:\n{% for trigger in triggers %}\n{% if trigger.definition.action === 'push' %}{% set branches = getTriggerAttribute(trigger, 'branches').value %}\n push:\n branches: [{% if branches.length > 0 %}{{ branches.join(', ') }}{% endif %}]\n{% else %}{% set types = getTriggerAttribute(trigger, 'types').value %}\n pull_request:\n types: [{% if types.length > 0 %}{{ types.join(', ') }}{% endif %}]\n{% endif %}\n{% endfor %}\n{% endif %}\n\njobs:\n{% for job in jobs %}\n {{ job.id }}:\n{% for attribute in getAttributes(job) %}\n {% if attribute.type === 'Array' %}\n {{attribute.name}}: [{{ attribute.value.join(', ')}}]\n {% else %}\n {{attribute.name}}: {{attribute.value }}\n {% endif %}\n{% endfor %}\n{% if getSteps(job.id).length > 0 %}\n steps:\n{% for step in getSteps(job.id) %}\n{% for attribute in getAttributes(step) %}\n{% if attribute.type === 'Array' %}\n{% if loop.first %}{{\"- \" | indent(6, true)}}{{attribute.name}}{% else %}{{attribute.name | indent(8, true)}}{% endif %}: [{{ attribute.value.join(', ')}}]\n{% elif attribute.type === 'Object' %}\n{% if loop.first %}{{\"- \" | indent(6, true)}}{{attribute.name}}{% else %}{{attribute.name | indent(8, true)}}{% endif %}:\n{% for value in attribute.value %}\n{{value.name | indent(10,true)}}: {% if value.type == 'Number' and value.value == null %}0{% else %}{{ value.value }}{% endif %}\n\n{% endfor %}\n{% else %}\n{% if loop.first %}{{\"- \" | indent(6, true)}}{{attribute.name}}{% else %}{{attribute.name | indent(8, true)}}{% endif %}: {{ attribute.value }}\n{% endif %}\n{% endfor %}\n{% endfor %}\n\n{% endif %}\n{% endfor %}"};function Dr(t){return Dr="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},Dr(t)}function Br(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null,i=[];return e.forEach((function(e,o){var a=n.pluginData.emitEvent({parent:r,type:"Render",action:"write",status:"running",files:[o],data:{global:!1}}),s=e.find((function(t){return"workflow"===t.definition.category})),u=e.filter((function(t){return"trigger"===t.definition.category})),c=e.filter((function(t){return"step"===t.definition.category})),l="".concat(n.template.render({workflow:s,workflowName:null==s?void 0:s.attributes.find((function(t){return"name"===t.name})),triggers:u,jobs:e.filter((function(t){return"job"===t.definition.category})),getAttributes:function(t){return t.attributes.filter((function(t){var e=t.name;return"workflow_id"!==e&&"job_id"!==e}))},getTriggerAttribute:function(t,e){return t.attributes.find((function(t){return t.name===e}))},getSteps:function(t){return c.filter((function(e){return e.attributes.some((function(e){var n=e.name,r=e.value;return"job_id"===n&&r===t}))}))}}).trim(),"\n");i.push(new t.FileInput({path:o,content:l})),n.pluginData.emitEvent({id:a,status:"success"})})),i}}],i&&Br(r.prototype,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,i}(t.DefaultRender);const Vr=qr,Wr=JSON.parse('{"UU":"githubator-plugin","rE":"0.3.3"}'),Yr={name:"githubAction",languageSettings:{id:"githubAction",extensions:[".yml",".yaml"],aliases:["githubaction","Githubaction","githubAction","GithubAction"],mimetypes:["string"]},languageConfiguration:{comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],colorizedBracketPairs:[["(",")"],["{","}"],["[","]"]],autoClosingPairs:[{open:"(",close:")"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"'",close:"'",notIn:["string"]},{open:'"',close:'"',notIn:["string"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'"},{open:'"',close:'"'}],folding:{offSide:!0}},tokenProvider:{tokenPostfix:".yaml",brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.square",open:"[",close:"]"}],keywords:["true","True","TRUE","false","False","FALSE","null","Null","Null","~"],numberInteger:/(?:0|[+-]?\d+)/,numberFloat:/(?:0|[+-]?\d+)(?:\.\d+)?(?:e[-+][1-9]\d*)?/,numberOctal:/0o[0-7]+/,numberHex:/0x[0-9a-fA-F]+/,numberInfinity:/[+-]?\.(?:inf|Inf|INF)/,numberNaN:/\.(?:nan|Nan|NAN)/,numberDate:/\d{4}-\d\d-\d\d([Tt ]\d\d:\d\d:\d\d(\.\d+)?(( ?[+-]\d\d?(:\d\d)?)|Z)?)?/,escapes:/\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,tokenizer:{root:[{include:"@whitespace"},{include:"@comment"},[/%[^ ]+.*$/,"meta.directive"],[/---/,"operators.directivesEnd"],[/\.{3}/,"operators.documentEnd"],[/[-?:](?= )/,"operators"],{include:"@anchor"},{include:"@tagHandle"},{include:"@flowCollections"},{include:"@blockStyle"},[/@numberInteger(?![ \t]*\S+)/,"number"],[/@numberFloat(?![ \t]*\S+)/,"number.float"],[/@numberOctal(?![ \t]*\S+)/,"number.octal"],[/@numberHex(?![ \t]*\S+)/,"number.hex"],[/@numberInfinity(?![ \t]*\S+)/,"number.infinity"],[/@numberNaN(?![ \t]*\S+)/,"number.nan"],[/@numberDate(?![ \t]*\S+)/,"number.date"],[/(".*?"|'.*?'|[^#'"]*?)([ \t]*)(:)( |$)/,["type","white","operators","white"]],{include:"@flowScalars"},[/.+?(?=(\s+#|$))/,{cases:{"@keywords":"keyword","@default":"string"}}]],object:[{include:"@whitespace"},{include:"@comment"},[/\}/,"@brackets","@pop"],[/,/,"delimiter.comma"],[/:(?= )/,"operators"],[/(?:".*?"|'.*?'|[^,{[]+?)(?=: )/,"type"],{include:"@flowCollections"},{include:"@flowScalars"},{include:"@tagHandle"},{include:"@anchor"},{include:"@flowNumber"},[/[^},]+/,{cases:{"@keywords":"keyword","@default":"string"}}]],array:[{include:"@whitespace"},{include:"@comment"},[/\]/,"@brackets","@pop"],[/,/,"delimiter.comma"],{include:"@flowCollections"},{include:"@flowScalars"},{include:"@tagHandle"},{include:"@anchor"},{include:"@flowNumber"},[/[^\],]+/,{cases:{"@keywords":"keyword","@default":"string"}}]],multiString:[[/^( +).+$/,"string","@multiStringContinued.$1"]],multiStringContinued:[[/^( *).+$/,{cases:{"$1==$S2":"string","@default":{token:"@rematch",next:"@popall"}}}]],whitespace:[[/[ \t\r\n]+/,"white"]],comment:[[/#.*$/,"comment"]],flowCollections:[[/\[/,"@brackets","@array"],[/\{/,"@brackets","@object"]],flowScalars:[[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/'[^']*'/,"string"],[/"/,"string","@doubleQuotedString"]],doubleQuotedString:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],blockStyle:[[/[>|]\d*[+-]?$/,"operators","@multiString"]],flowNumber:[[/@numberInteger(?=[ \t]*[,\]}])/,"number"],[/@numberFloat(?=[ \t]*[,\]}])/,"number.float"],[/@numberOctal(?=[ \t]*[,\]}])/,"number.octal"],[/@numberHex(?=[ \t]*[,\]}])/,"number.hex"],[/@numberInfinity(?=[ \t]*[,\]}])/,"number.infinity"],[/@numberNaN(?=[ \t]*[,\]}])/,"number.nan"],[/@numberDate(?=[ \t]*[,\]}])/,"number.date"]],tagHandle:[[/![^ ]*/,"tag"]],anchor:[[/[&*][^ ]+/,"namespace"]]}}};function Hr(t){return Hr="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},Hr(t)}function Gr(t,e,n){return e=Xr(e),function(t,e){if(e&&("object"==Hr(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,Jr()?Reflect.construct(e,n||[],Xr(t).constructor):e.apply(t,n))}function Jr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Jr=function(){return!!t})()}function Xr(t){return Xr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Xr(t)}function Qr(t,e){return Qr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Qr(t,e)}const Zr=function(e){function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),Gr(this,n,[{editor:{syntax:Yr},tags:[new t.Tag({type:"language",value:"Github"}),new t.Tag({type:"category",value:"CI"}),new t.Tag({type:"category",value:"CD"})],restrictiveFolder:".github/workflows/",isFolderTypeDiagram:!1,defaultFileName:"new_workflow.yml",defaultFileExtension:"yml",extraResources:[{type:"markers",name:"startLinkMarker"},{type:"markers",name:"endLinkMarker"},{type:"links",name:"defaultLink"},{type:"links",name:"temporaryLink"},{type:"icons",name:"error"},{type:"icons",name:"menu"},{type:"icons",name:"resize"}],container:{margin:15,gap:50}}])}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&&Qr(t,e)}(n,e),r=n,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(t.DefaultConfiguration);function ti(t){return ti="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},ti(t)}function ei(t,e,n){return e=ri(e),function(t,e){if(e&&("object"==ti(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,ni()?Reflect.construct(e,n||[],ri(t).constructor):e.apply(t,n))}function ni(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ni=function(){return!!t})()}function ri(t){return ri=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ri(t)}function ii(t,e){return ii=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ii(t,e)}const oi=function(e){function n(){var e=arguments.length>0&&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,n);var r=new Zr,i=new t.DefaultData(r,{name:Wr.UU,version:Wr.rE},e.event);return ei(this,n,[{configuration:r,pluginData:i,pluginMetadata:new C(i),pluginParser:new jr(i),pluginRenderer:new Vr(i)}])}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&&ii(t,e)}(n,e),r=n,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(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={916:(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:v,Output:$,Capture:K,TemplateData:U,If:b,IfAsync:_,InlineIf:w,For:x,AsyncEach:k,AsyncAll:E,Macro:O,Caller:S,Import:T,FromImport:A,FunCall:N,Filter:L,FilterAsync:M,KeywordArgs:C,Block:j,Super:P,Extends:I,Include:R,Set:D,Switch:B,Case:F,LookupVal:g,BinOp:q,In:V,Is:W,Or:H,And:Y,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),v=y.Obj,g=y.EmitterObj,b=n(2),_=b.handleError,w=b.Frame,x=n(22);function k(t,e,n){o((function(){t(e,n)}))}var E={type:"code",obj:{root:function(t,e,n,r,i){try{i(null,"")}catch(t){i(_(t,null,null))}}}},O=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 T)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=","//","**"],D=M+this.current();switch(-1!==r.indexOf(R,D)&&(this.forward(),M=D,-1!==r.indexOf(R,D+this.current())&&(M=D+this.current(),this.forward())),M){case"(":I=d;break;case")":I=m;break;case"[":I=y;break;case"]":I=v;break;case"{":I=g;break;case"}":I=b;break;case",":I=w;break;case":":I=x;break;case"~":I=k;break;case"|":I=E;break;default:I=_}return L(I,M,e,n)}if((t=this._extractUntil(i+o)).match(/^[-+]?[0-9]+$/)){if("."===this.current()){this.forward();var B=this._extract("0123456789");return L(O,t+"."+B,e,n)}return L("int",t,e,n)}if(t.match(/^(true|false)$/))return L(S,t,e,n);if("none"===t)return L(T,t,e,n);if("null"===t)return L(T,t,e,n);if(t)return L(A,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,L(c,t,e,n);if((t=this._extractString(this.tags.VARIABLE_START+"-"))||(t=this._extractString(this.tags.VARIABLE_START)))return this.in_code=!0,L(f,t,e,n);t="";var K=!1;for(this._matches(this.tags.COMMENT_START)&&(K=!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))&&!K){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(!K)throw new Error("unexpected end of comment");t+=this._extractString(this.tags.COMMENT_END);break}t+=this.current(),this.forward()}if(null===F&&K)throw new Error("expected end of comment, got end of file");return L(K?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:()=>_,ComponentAttribute:()=>a,ComponentAttributeDefinition:()=>A,ComponentDefinition:()=>x,ComponentDrawOption:()=>h,ComponentLink:()=>I,ComponentLinkDefinition:()=>D,ComponentRenderer:()=>jA,DefaultConfiguration:()=>YN,DefaultData:()=>KN,DefaultDrawer:()=>oN,DefaultMetadata:()=>cN,DefaultParser:()=>pN,DefaultPlugin:()=>QN,DefaultRender:()=>vN,FileInformation:()=>l,FileInput:()=>q,LinkRenderer:()=>DA,ParseError:()=>EN,Tag:()=>tL,Variable:()=>sL});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){var n=function(t,n){if("object"!=e(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!=e(i))return i;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:()=>vt,Delaunay:()=>Du,FormatSpecifier:()=>ef,InternMap:()=>_t,InternSet:()=>wt,Node:()=>Sy,Path:()=>Za,Voronoi:()=>Mu,ZoomTransform:()=>PS,active:()=>ia,arc:()=>gE,area:()=>SE,areaRadial:()=>IE,ascending:()=>V,autoType:()=>yc,axisBottom:()=>un,axisLeft:()=>cn,axisRight:()=>sn,axisTop:()=>an,bin:()=>ee,bisect:()=>tt,bisectCenter:()=>Z,bisectLeft:()=>Q,bisectRight:()=>X,bisector:()=>H,blob:()=>ol,blur:()=>et,blur2:()=>nt,blurImage:()=>rt,brush:()=>ja,brushSelection:()=>La,brushX:()=>Ma,brushY:()=>Ca,buffer:()=>sl,chord:()=>qa,chordDirected:()=>Wa,chordTranspose:()=>Va,cluster:()=>by,color:()=>ti,contourDensity:()=>uu,contours:()=>tu,count:()=>ut,create:()=>Wk,creator:()=>mr,cross:()=>ht,csv:()=>hl,csvFormat:()=>rc,csvFormatBody:()=>ic,csvFormatRow:()=>ac,csvFormatRows:()=>oc,csvFormatValue:()=>sc,csvParse:()=>ec,csvParseRows:()=>nc,cubehelix:()=>qs,cumsum:()=>pt,curveBasis:()=>OO,curveBasisClosed:()=>TO,curveBasisOpen:()=>NO,curveBumpX:()=>FE,curveBumpY:()=>$E,curveBundle:()=>MO,curveCardinal:()=>PO,curveCardinalClosed:()=>RO,curveCardinalOpen:()=>BO,curveCatmullRom:()=>KO,curveCatmullRomClosed:()=>zO,curveCatmullRomOpen:()=>VO,curveLinear:()=>xE,curveLinearClosed:()=>HO,curveMonotoneX:()=>eS,curveMonotoneY:()=>nS,curveNatural:()=>oS,curveStep:()=>sS,curveStepAfter:()=>cS,curveStepBefore:()=>uS,descending:()=>W,deviation:()=>mt,difference:()=>Fe,disjoint:()=>$e,dispatch:()=>mn,drag:()=>qu,dragDisable:()=>Pr,dragEnable:()=>Ir,dsv:()=>fl,dsvFormat:()=>Zu,easeBack:()=>Zc,easeBackIn:()=>Xc,easeBackInOut:()=>Zc,easeBackOut:()=>Qc,easeBounce:()=>Yc,easeBounceIn:()=>Hc,easeBounceInOut:()=>Gc,easeBounceOut:()=>Yc,easeCircle:()=>Rc,easeCircleIn:()=>Pc,easeCircleInOut:()=>Rc,easeCircleOut:()=>Ic,easeCubic:()=>ta,easeCubicIn:()=>Qo,easeCubicInOut:()=>ta,easeCubicOut:()=>Zo,easeElastic:()=>nl,easeElasticIn:()=>el,easeElasticInOut:()=>rl,easeElasticOut:()=>nl,easeExp:()=>jc,easeExpIn:()=>Mc,easeExpInOut:()=>jc,easeExpOut:()=>Cc,easeLinear:()=>gc,easePoly:()=>Ec,easePolyIn:()=>xc,easePolyInOut:()=>Ec,easePolyOut:()=>kc,easeQuad:()=>wc,easeQuadIn:()=>bc,easeQuadInOut:()=>wc,easeQuadOut:()=>_c,easeSin:()=>Nc,easeSinIn:()=>Tc,easeSinInOut:()=>Nc,easeSinOut:()=>Ac,every:()=>je,extent:()=>yt,fcumsum:()=>bt,filter:()=>Ie,flatGroup:()=>Lt,flatRollup:()=>Mt,forceCenter:()=>wl,forceCollide:()=>Pl,forceLink:()=>Dl,forceManyBody:()=>Wl,forceRadial:()=>Hl,forceSimulation:()=>Vl,forceX:()=>Yl,forceY:()=>Gl,format:()=>sf,formatDefaultLocale:()=>hf,formatLocale:()=>ff,formatPrefix:()=>uf,formatSpecifier:()=>tf,fsum:()=>gt,geoAlbers:()=>Pm,geoAlbersUsa:()=>Im,geoArea:()=>yh,geoAzimuthalEqualArea:()=>Fm,geoAzimuthalEqualAreaRaw:()=>Bm,geoAzimuthalEquidistant:()=>Km,geoAzimuthalEquidistantRaw:()=>$m,geoBounds:()=>Xh,geoCentroid:()=>cp,geoCircle:()=>_p,geoClipAntimeridian:()=>Mp,geoClipCircle:()=>Cp,geoClipExtent:()=>$p,geoClipRectangle:()=>Fp,geoConicConformal:()=>Hm,geoConicConformalRaw:()=>Wm,geoConicEqualArea:()=>jm,geoConicEqualAreaRaw:()=>Cm,geoConicEquidistant:()=>Xm,geoConicEquidistantRaw:()=>Jm,geoContains:()=>rd,geoDistance:()=>Yp,geoEqualEarth:()=>iy,geoEqualEarthRaw:()=>ry,geoEquirectangular:()=>Gm,geoEquirectangularRaw:()=>Ym,geoGnomonic:()=>ay,geoGnomonicRaw:()=>oy,geoGraticule:()=>ad,geoGraticule10:()=>sd,geoIdentity:()=>sy,geoInterpolate:()=>ud,geoLength:()=>Vp,geoMercator:()=>zm,geoMercatorRaw:()=>Um,geoNaturalEarth1:()=>cy,geoNaturalEarth1Raw:()=>uy,geoOrthographic:()=>fy,geoOrthographicRaw:()=>ly,geoPath:()=>mm,geoProjection:()=>Nm,geoProjectionMutator:()=>Lm,geoRotation:()=>vp,geoStereographic:()=>py,geoStereographicRaw:()=>hy,geoStream:()=>Wf,geoTransform:()=>ym,geoTransverseMercator:()=>my,geoTransverseMercatorRaw:()=>dy,gray:()=>Es,greatest:()=>ue,greatestIndex:()=>Oe,group:()=>Tt,groupSort:()=>Ut,groups:()=>At,hcl:()=>js,hierarchy:()=>wy,histogram:()=>ee,hsl:()=>pi,html:()=>bl,image:()=>dl,index:()=>Pt,indexes:()=>It,interpolate:()=>Fi,interpolateArray:()=>Mi,interpolateBasis:()=>bi,interpolateBasisClosed:()=>_i,interpolateBlues:()=>bk,interpolateBrBG:()=>Mx,interpolateBuGn:()=>Gx,interpolateBuPu:()=>Xx,interpolateCividis:()=>Lk,interpolateCool:()=>jk,interpolateCubehelix:()=>$v,interpolateCubehelixDefault:()=>Mk,interpolateCubehelixLong:()=>Kv,interpolateDate:()=>ji,interpolateDiscrete:()=>Tv,interpolateGnBu:()=>Zx,interpolateGreens:()=>wk,interpolateGreys:()=>kk,interpolateHcl:()=>Dv,interpolateHclLong:()=>Bv,interpolateHsl:()=>jv,interpolateHslLong:()=>Pv,interpolateHue:()=>Av,interpolateInferno:()=>qk,interpolateLab:()=>Iv,interpolateMagma:()=>zk,interpolateNumber:()=>Pi,interpolateNumberArray:()=>Ni,interpolateObject:()=>Ii,interpolateOrRd:()=>ek,interpolateOranges:()=>Nk,interpolatePRGn:()=>jx,interpolatePiYG:()=>Ix,interpolatePlasma:()=>Vk,interpolatePuBu:()=>ok,interpolatePuBuGn:()=>rk,interpolatePuOr:()=>Dx,interpolatePuRd:()=>sk,interpolatePurples:()=>Ok,interpolateRainbow:()=>Ik,interpolateRdBu:()=>Fx,interpolateRdGy:()=>Kx,interpolateRdPu:()=>ck,interpolateRdYlBu:()=>zx,interpolateRdYlGn:()=>Vx,interpolateReds:()=>Tk,interpolateRgb:()=>Oi,interpolateRgbBasis:()=>Ti,interpolateRgbBasisClosed:()=>Ai,interpolateRound:()=>Nv,interpolateSinebow:()=>Fk,interpolateSpectral:()=>Hx,interpolateString:()=>Bi,interpolateTransformCss:()=>To,interpolateTransformSvg:()=>Ao,interpolateTurbo:()=>$k,interpolateViridis:()=>Uk,interpolateWarm:()=>Ck,interpolateYlGn:()=>pk,interpolateYlGnBu:()=>fk,interpolateYlOrBr:()=>mk,interpolateYlOrRd:()=>vk,interpolateZoom:()=>Mv,interrupt:()=>wo,intersection:()=>Ke,interval:()=>MS,isoFormat:()=>AS,isoParse:()=>LS,json:()=>yl,lab:()=>Os,lch:()=>Cs,least:()=>ke,leastIndex:()=>Ee,line:()=>OE,lineRadial:()=>PE,link:()=>qE,linkHorizontal:()=>VE,linkRadial:()=>HE,linkVertical:()=>WE,local:()=>Yk,map:()=>Re,matcher:()=>wn,max:()=>ne,maxIndex:()=>re,mean:()=>de,median:()=>me,medianIndex:()=>ye,merge:()=>ve,min:()=>ie,minIndex:()=>oe,mode:()=>ge,namespace:()=>Rn,namespaces:()=>In,nice:()=>Zt,now:()=>Zi,pack:()=>Xy,packEnclose:()=>Iy,packSiblings:()=>Gy,pairs:()=>be,partition:()=>rv,path:()=>ts,pathRound:()=>es,permute:()=>Bt,pie:()=>NE,piecewise:()=>Uv,pointRadial:()=>RE,pointer:()=>Ki,pointers:()=>Jk,polygonArea:()=>qv,polygonCentroid:()=>Vv,polygonContains:()=>Jv,polygonHull:()=>Gv,polygonLength:()=>Xv,precisionFixed:()=>pf,precisionPrefix:()=>df,precisionRound:()=>mf,quadtree:()=>Sl,quantile:()=>ce,quantileIndex:()=>fe,quantileSorted:()=>le,quantize:()=>zv,quickselect:()=>ae,radialArea:()=>IE,radialLine:()=>PE,randomBates:()=>ig,randomBernoulli:()=>sg,randomBeta:()=>lg,randomBinomial:()=>fg,randomCauchy:()=>pg,randomExponential:()=>og,randomGamma:()=>cg,randomGeometric:()=>ug,randomInt:()=>tg,randomIrwinHall:()=>rg,randomLcg:()=>bg,randomLogNormal:()=>ng,randomLogistic:()=>dg,randomNormal:()=>eg,randomPareto:()=>ag,randomPoisson:()=>mg,randomUniform:()=>Zv,randomWeibull:()=>hg,range:()=>we,rank:()=>xe,reduce:()=>De,reverse:()=>Be,rgb:()=>ii,ribbon:()=>hs,ribbonArrow:()=>ps,rollup:()=>Ct,rollups:()=>jt,scaleBand:()=>Eg,scaleDiverging:()=>px,scaleDivergingLog:()=>dx,scaleDivergingPow:()=>yx,scaleDivergingSqrt:()=>vx,scaleDivergingSymlog:()=>mx,scaleIdentity:()=>Fg,scaleImplicit:()=>xg,scaleLinear:()=>Bg,scaleLog:()=>Yg,scaleOrdinal:()=>kg,scalePoint:()=>Sg,scalePow:()=>rb,scaleQuantile:()=>sb,scaleQuantize:()=>ub,scaleRadial:()=>ab,scaleSequential:()=>ax,scaleSequentialLog:()=>sx,scaleSequentialPow:()=>cx,scaleSequentialQuantile:()=>fx,scaleSequentialSqrt:()=>lx,scaleSequentialSymlog:()=>ux,scaleSqrt:()=>ib,scaleSymlog:()=>Qg,scaleThreshold:()=>cb,scaleTime:()=>nx,scaleUtc:()=>rx,scan:()=>Se,schemeAccent:()=>_x,schemeBlues:()=>gk,schemeBrBG:()=>Lx,schemeBuGn:()=>Yx,schemeBuPu:()=>Jx,schemeCategory10:()=>bx,schemeDark2:()=>wx,schemeGnBu:()=>Qx,schemeGreens:()=>_k,schemeGreys:()=>xk,schemeOrRd:()=>tk,schemeOranges:()=>Ak,schemePRGn:()=>Cx,schemePaired:()=>xx,schemePastel1:()=>kx,schemePastel2:()=>Ex,schemePiYG:()=>Px,schemePuBu:()=>ik,schemePuBuGn:()=>nk,schemePuOr:()=>Rx,schemePuRd:()=>ak,schemePurples:()=>Ek,schemeRdBu:()=>Bx,schemeRdGy:()=>$x,schemeRdPu:()=>uk,schemeRdYlBu:()=>Ux,schemeRdYlGn:()=>qx,schemeReds:()=>Sk,schemeSet1:()=>Ox,schemeSet2:()=>Sx,schemeSet3:()=>Tx,schemeSpectral:()=>Wx,schemeTableau10:()=>Ax,schemeYlGn:()=>hk,schemeYlGnBu:()=>lk,schemeYlOrBr:()=>dk,schemeYlOrRd:()=>yk,select:()=>Nr,selectAll:()=>Xk,selection:()=>Ar,selector:()=>vn,selectorAll:()=>_n,shuffle:()=>Te,shuffler:()=>Ae,some:()=>Pe,sort:()=>Ft,stack:()=>dS,stackOffsetDiverging:()=>yS,stackOffsetExpand:()=>mS,stackOffsetNone:()=>lS,stackOffsetSilhouette:()=>vS,stackOffsetWiggle:()=>gS,stackOrderAppearance:()=>bS,stackOrderAscending:()=>wS,stackOrderDescending:()=>kS,stackOrderInsideOut:()=>ES,stackOrderNone:()=>fS,stackOrderReverse:()=>OS,stratify:()=>cv,style:()=>Hn,subset:()=>Ve,sum:()=>Ne,superset:()=>ze,svg:()=>_l,symbol:()=>wO,symbolAsterisk:()=>GE,symbolCircle:()=>JE,symbolCross:()=>XE,symbolDiamond:()=>tO,symbolDiamond2:()=>eO,symbolPlus:()=>nO,symbolSquare:()=>rO,symbolSquare2:()=>iO,symbolStar:()=>uO,symbolTimes:()=>gO,symbolTriangle:()=>lO,symbolTriangle2:()=>hO,symbolWye:()=>vO,symbolX:()=>gO,symbols:()=>bO,symbolsFill:()=>bO,symbolsStroke:()=>_O,text:()=>cl,thresholdFreedmanDiaconis:()=>he,thresholdScott:()=>pe,thresholdSturges:()=>te,tickFormat:()=>Rg,tickIncrement:()=>Xt,tickStep:()=>Qt,ticks:()=>Jt,timeDay:()=>Mb,timeDays:()=>Cb,timeFormat:()=>M_,timeFormatDefaultLocale:()=>Qw,timeFormatLocale:()=>N_,timeFriday:()=>zb,timeFridays:()=>Jb,timeHour:()=>Tb,timeHours:()=>Ab,timeInterval:()=>gb,timeMillisecond:()=>bb,timeMilliseconds:()=>_b,timeMinute:()=>kb,timeMinutes:()=>Eb,timeMonday:()=>Fb,timeMondays:()=>Wb,timeMonth:()=>p_,timeMonths:()=>d_,timeParse:()=>C_,timeSaturday:()=>qb,timeSaturdays:()=>Xb,timeSecond:()=>wb,timeSeconds:()=>xb,timeSunday:()=>Bb,timeSundays:()=>Vb,timeThursday:()=>Ub,timeThursdays:()=>Gb,timeTickInterval:()=>O_,timeTicks:()=>E_,timeTuesday:()=>$b,timeTuesdays:()=>Hb,timeWednesday:()=>Kb,timeWednesdays:()=>Yb,timeWeek:()=>Bb,timeWeeks:()=>Vb,timeYear:()=>v_,timeYears:()=>g_,timeout:()=>so,timer:()=>no,timerFlush:()=>ro,transition:()=>Go,transpose:()=>Le,tree:()=>gv,treemap:()=>kv,treemapBinary:()=>Ev,treemapDice:()=>nv,treemapResquarify:()=>Sv,treemapSlice:()=>bv,treemapSliceDice:()=>Ov,treemapSquarify:()=>xv,tsv:()=>pl,tsvFormat:()=>fc,tsvFormatBody:()=>hc,tsvFormatRow:()=>dc,tsvFormatRows:()=>pc,tsvFormatValue:()=>mc,tsvParse:()=>cc,tsvParseRows:()=>lc,union:()=>We,unixDay:()=>Ib,unixDays:()=>Rb,utcDay:()=>jb,utcDays:()=>Pb,utcFormat:()=>j_,utcFriday:()=>i_,utcFridays:()=>f_,utcHour:()=>Nb,utcHours:()=>Lb,utcMillisecond:()=>bb,utcMilliseconds:()=>_b,utcMinute:()=>Ob,utcMinutes:()=>Sb,utcMonday:()=>t_,utcMondays:()=>s_,utcMonth:()=>m_,utcMonths:()=>y_,utcParse:()=>P_,utcSaturday:()=>o_,utcSaturdays:()=>h_,utcSecond:()=>wb,utcSeconds:()=>xb,utcSunday:()=>Zb,utcSundays:()=>a_,utcThursday:()=>r_,utcThursdays:()=>l_,utcTickInterval:()=>k_,utcTicks:()=>x_,utcTuesday:()=>e_,utcTuesdays:()=>u_,utcWednesday:()=>n_,utcWednesdays:()=>c_,utcWeek:()=>Zb,utcWeeks:()=>a_,utcYear:()=>b_,utcYears:()=>__,variance:()=>dt,window:()=>zn,xml:()=>gl,zip:()=>Ce,zoom:()=>VS,zoomIdentity:()=>IS,zoomTransform:()=>RS});var o=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},r=[{key:"isVariable",get:function(){return!1}},{key:"hasError",value:function(){return null===this.definition?null===this.value||("array"===this.type.toLowerCase()?!Array.isArray(this.value):e(this.value)!==this.type.toLowerCase()):null!==this.value&&void 0!==this.value&&(this.__typeOfValueValidation()||this.__ruleValueValidation()||this.__ruleMinAndMaxValidation()||this.__ruleRegexValidation())}},{key:"__typeOfValueValidation",value:function(){var t=this.type.toLowerCase();return"Link"===this.definition.type?!Array.isArray(this.value)||this.value.some((function(t){return"string"!=typeof t})):"array"===t?!Array.isArray(this.value):e(this.value)!==t}},{key:"__ruleValueValidation",value:function(){var t=this;return this.definition.rules.values&&Array.isArray(this.value)?!this.value.every((function(e){return t.definition.rules.values.includes(e)})):this.definition.rules.values&&!this.definition.rules.values.includes(this.value)}},{key:"__ruleMinAndMaxValidation",value:function(){var t="number"==typeof this.value?this.value:this.value.length;return null!==this.definition.rules.min&&tthis.definition.rules.max}},{key:"__ruleRegexValidation",value:function(){return null!==this.definition.rules.regex&&!new RegExp(this.definition.rules.regex).test(this.value)}}],r&&function(t,e){for(var r=0;r0&&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 h=f;function p(t){return p="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},p(t)}function d(t){var e=function(t,e){if("object"!=p(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=p(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==p(e)?e:e+""}function m(t,e,n){return e=v(e),function(t,e){if(e&&("object"==p(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,y()?Reflect.construct(e,n||[],v(t).constructor):e.apply(t,n))}function y(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(y=function(){return!!t})()}function v(t){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},v(t)}function g(t,e){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},g(t,e)}var b=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=m(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 h,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&&g(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 a(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]:{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,v=e.defaultWidth,g=e.defaultHeight,b=e.minWidth,_=e.minHeight,w=e.reservedWidth,x=e.reservedHeight,k=e.margin,E=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=v||0,this.defaultHeight=g||0,this.minWidth=b||0,this.minHeight=_||0,this.reservedWidth=w||0,this.reservedHeight=x||0,this.margin=k||10,this.gap=E||30}));const x=w;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 E(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,e,n){return(e=S(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function S(t){var e=function(t,e){if("object"!=k(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=k(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==k(e)?e:e+""}var T=function(t,e,n){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:null,min:null,max:null,regex: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=L(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&&j(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(l);const I=P;var R=function(t,e,n){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 D=R;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,n){return e=K(e),function(t,e){if(e&&("object"==B(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,$()?Reflect.construct(e,n||[],K(t).constructor):e.apply(t,n))}function $(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return($=function(){return!!t})()}function K(t){return K=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},K(t)}function U(t,e){return U=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},U(t,e)}var z=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=F(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&&U(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(l);const q=z;function V(t,e){return null==t||null==e?NaN:te?1:t>=e?0:NaN}function W(t,e){return null==t||null==e?NaN:et?1:e>=t?0:NaN}function H(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(iV(t(e),n),r=(e,n)=>t(e)-n):(e=t===V||t===W?t:Y,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=st(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 nt=it(st),rt=it((function(t){const e=st(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 it(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?(ot(s,c,i,o,a),ot(s,i,c,o,a),ot(s,c,i,o,a),at(u,i,c,o,a),at(u,c,i,o,a),at(u,i,c,o,a)):s?(ot(s,i,c,o,a),ot(s,c,i,o,a),ot(s,i,c,o,a)):u&&(at(u,i,c,o,a),at(u,c,i,o,a),at(u,i,c,o,a)),e}}function ot(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 ct(t){return 0|t.length}function lt(t){return!(t>0)}function ft(t){return"object"!=typeof t||"length"in t?t:Array.from(t)}function ht(...t){const e="function"==typeof t[t.length-1]&&function(t){return e=>t(...e)}(t.pop()),n=(t=t.map(ft)).map(ct),r=t.length-1,i=new Array(r+1).fill(0),o=[];if(r<0||n.some(lt))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 pt(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 dt(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 mt(t,e){const n=dt(t,e);return n?Math.sqrt(n):n}function yt(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 gt(t,e){const n=new vt;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 bt(t,e){const n=new vt;let r=-1;return Float64Array.from(t,void 0===e?t=>n.add(+t||0):i=>n.add(+e(i,++r,t)||0))}class _t extends Map{constructor(t,e=Ot){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(xt(this,t))}has(t){return super.has(xt(this,t))}set(t,e){return super.set(kt(this,t),e)}delete(t){return super.delete(Et(this,t))}}class wt extends Set{constructor(t,e=Ot){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(xt(this,t))}add(t){return super.add(kt(this,t))}delete(t){return super.delete(Et(this,t))}}function xt({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function kt({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function Et({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function Ot(t){return null!==t&&"object"==typeof t?t.valueOf():t}function St(t){return t}function Tt(t,...e){return Dt(t,St,St,e)}function At(t,...e){return Dt(t,Array.from,St,e)}function Nt(t,e){for(let n=1,r=e.length;nt.pop().map((([e,n])=>[...t,e,n]))));return t}function Lt(t,...e){return Nt(At(t,...e),e)}function Mt(t,e,...n){return Nt(jt(t,e,...n),n)}function Ct(t,e,...n){return Dt(t,St,e,n)}function jt(t,e,...n){return Dt(t,Array.from,e,n)}function Pt(t,...e){return Dt(t,St,Rt,e)}function It(t,...e){return Dt(t,Array.from,Rt,e)}function Rt(t){if(1!==t.length)throw new Error("duplicate key");return t[0]}function Dt(t,e,n,r){return function t(i,o){if(o>=r.length)return n(i);const a=new _t,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 Bt(t,e){return Array.from(e,(e=>t[e]))}function Ft(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=Kt(r[t],r[n]);if(e)return e}}))):(n=t.map(n),r.sort(((t,e)=>Kt(n[t],n[e])))),Bt(t,r)}return t.sort($t(n))}function $t(t=V){if(t===V)return Kt;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 Kt(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(te?1:0)}function Ut(t,e,n){return(2!==e.length?Ft(Ct(t,e,n),(([t,e],[n,r])=>V(e,r)||V(t,n))):Ft(Tt(t,n),(([t,n],[r,i])=>e(n,i)||V(t,r)))).map((([t])=>t))}var zt=Array.prototype,qt=zt.slice;function Vt(t){return()=>t}zt.map;const Wt=Math.sqrt(50),Ht=Math.sqrt(10),Yt=Math.sqrt(2);function Gt(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>=Wt?10:o>=Ht?5:o>=Yt?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 te(t){return Math.max(1,Math.ceil(Math.log(ut(t))/Math.LN2)+1)}function ee(){var t=St,e=yt,n=te;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===yt){const t=Xt(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 re(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 ie(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 oe(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 ae(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?Kt:$t(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);ae(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(se(t,n,e),i(t[r],o)>0&&se(t,n,r);a0;)--s}0===i(t[n],o)?se(t,n,s):(++s,se(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function se(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function ue(t,e=V){let n,r=!1;if(1===e.length){let i;for(const o of t){const t=e(o);(r?V(t,i)>0:0===V(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 ce(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 ie(t);if(e>=1)return ne(t);var r,i=(r-1)*e,o=Math.floor(i),a=ne(ae(t,o).subarray(0,o+1));return a+(ie(t.subarray(o+1))-a)*(i-o)}}function le(t,e,n=G){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 fe(t,e,n=G){if(!isNaN(e=+e)){if(r=Float64Array.from(t,((e,r)=>G(n(t[r],r,t)))),e<=0)return oe(r);if(e>=1)return re(r);var r,i=Uint32Array.from(t,((t,e)=>e)),o=r.length-1,a=Math.floor(o*e);return ae(i,a,0,o,((t,e)=>Kt(r[t],r[e]))),(a=ue(i.subarray(0,a+1),(t=>r[t])))>=0?a:-1}}function he(t,e,n){const r=ut(t),i=ce(t,.75)-ce(t,.25);return r&&i?Math.ceil((n-e)/(2*i*Math.pow(r,-1/3))):1}function pe(t,e,n){const r=ut(t),i=mt(t);return r&&i?Math.ceil((n-e)*Math.cbrt(r)/(3.49*i)):1}function de(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 me(t,e){return ce(t,.5,e)}function ye(t,e){return fe(t,.5,e)}function ve(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function ge(t,e){const n=new _t;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 be(t,e=_e){const n=[];let r,i=!1;for(const o of t)i&&n.push(e(r,o)),r=o,i=!0;return n}function _e(t,e){return[t,e]}function we(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===V?(t,e)=>Kt(n[t],n[e]):$t(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 ke(t,e=V){let n,r=!1;if(1===e.length){let i;for(const o of t){const t=e(o);(r?V(t,i)<0:0===V(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 Ee(t,e=V){if(1===e.length)return oe(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 Oe(t,e=V){if(1===e.length)return re(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 Se(t,e){const n=Ee(t,e);return n<0?void 0:n}const Te=Ae(Math.random);function Ae(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 Ne(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 Le(t){if(!(i=t.length))return[];for(var e=-1,n=ie(t,Me),r=new Array(n);++ee(n,r,t)))}function De(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 Be(t){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");return Array.from(t).reverse()}function Fe(t,...e){t=new wt(t);for(const n of e)for(const e of n)t.delete(e);return t}function $e(t,e){const n=e[Symbol.iterator](),r=new wt;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 Ke(t,...e){t=new wt(t),e=e.map(Ue);t:for(const n of t)for(const r of e)if(!r.has(n)){t.delete(n);continue t}return t}function Ue(t){return t instanceof wt?t:new wt(t)}function ze(t,e){const n=t[Symbol.iterator](),r=new Set;for(const t of e){const e=qe(t);if(r.has(e))continue;let i,o;for(;({value:i,done:o}=n.next());){if(o)return!1;const t=qe(i);if(r.add(t),Object.is(e,t))break}}return!0}function qe(t){return null!==t&&"object"==typeof t?t.valueOf():t}function Ve(t,e){return ze(e,t)}function We(...t){const e=new wt;for(const n of t)for(const t of n)e.add(t);return e}function He(t){return t}var Ye=1,Ge=2,Je=3,Xe=4,Qe=1e-6;function Ze(t){return"translate("+t+",0)"}function tn(t){return"translate(0,"+t+")"}function en(t){return e=>+t(e)}function nn(t,e){return e=Math.max(0,t.bandwidth()-2*e)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function rn(){return!this.__axis}function on(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===Ye||t===Xe?-1:1,l=t===Xe||t===Ge?"x":"y",f=t===Ye||t===Je?Ze:tn;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):He:i,m=Math.max(o,0)+s,y=e.range(),v=+y[0]+u,g=+y[y.length-1]+u,b=(e.bandwidth?nn:en)(e.copy(),u),_=h.selection?h.selection():h,w=_.selectAll(".domain").data([null]),x=_.selectAll(".tick").data(p,e).order(),k=x.exit(),E=x.enter().append("g").attr("class","tick"),O=x.select("line"),S=x.select("text");w=w.merge(w.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),x=x.merge(E),O=O.merge(E.append("line").attr("stroke","currentColor").attr(l+"2",c*o)),S=S.merge(E.append("text").attr("fill","currentColor").attr(l,c*m).attr("dy",t===Ye?"0em":t===Je?"0.71em":"0.32em")),h!==_&&(w=w.transition(h),x=x.transition(h),O=O.transition(h),S=S.transition(h),k=k.transition(h).attr("opacity",Qe).attr("transform",(function(t){return isFinite(t=b(t))?f(t+u):this.getAttribute("transform")})),E.attr("opacity",Qe).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===Xe||t===Ge?a?"M"+c*a+","+v+"H"+u+"V"+g+"H"+c*a:"M"+u+","+v+"V"+g:a?"M"+v+","+c*a+"V"+u+"H"+g+"V"+c*a:"M"+v+","+u+"H"+g),x.attr("opacity",1).attr("transform",(function(t){return f(b(t)+u)})),O.attr(l+"2",c*o),S.attr(l,c*m).text(d),_.filter(rn).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===Ge?"start":t===Xe?"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 an(t){return on(Ye,t)}function sn(t){return on(Ge,t)}function un(t){return on(Je,t)}function cn(t){return on(Xe,t)}var ln={value:()=>{}};function fn(){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}An.prototype={constructor:An,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 Pn="http://www.w3.org/1999/xhtml";const In={svg:"http://www.w3.org/2000/svg",xhtml:Pn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Rn(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),In.hasOwnProperty(e)?{space:In[e],local:t}:t}function Dn(t){return function(){this.removeAttribute(t)}}function Bn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Fn(t,e){return function(){this.setAttribute(t,e)}}function $n(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Kn(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function Un(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 zn(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function qn(t){return function(){this.style.removeProperty(t)}}function Vn(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Wn(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Hn(t,e){return t.style.getPropertyValue(e)||zn(t).getComputedStyle(t,null).getPropertyValue(e)}function Yn(t){return function(){delete this[t]}}function Gn(t,e){return function(){this[t]=e}}function Jn(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function Xn(t){return t.trim().split(/^|\s+/)}function Qn(t){return t.classList||new Zn(t)}function Zn(t){this._node=t,this._names=Xn(t.getAttribute("class")||"")}function tr(t,e){for(var n=Qn(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 Or=[null];function Sr(t,e){this._groups=t,this._parents=e}function Tr(){return new Sr([[document.documentElement]],Or)}Sr.prototype=Tr.prototype={constructor:Sr,select:function(t){"function"!=typeof t&&(t=vn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i=w&&(w=_+1);!(b=v[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=jn);for(var n=this._groups,r=n.length,i=new Array(r),o=0;o1?this.each((null==e?qn:"function"==typeof e?Wn:Vn)(t,e,null==n?"":n)):Hn(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?Yn:"function"==typeof e?Jn:Gn)(t,e)):this.node()[t]},classed:function(t,e){var n=Xn(t+"");if(arguments.length<2){for(var r=Qn(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?wr:_r,r=0;r>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?ni(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?ni(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=Vr.exec(t))?new oi(e[1],e[2],e[3],1):(e=Wr.exec(t))?new oi(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Hr.exec(t))?ni(e[1],e[2],e[3],e[4]):(e=Yr.exec(t))?ni(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Gr.exec(t))?fi(e[1],e[2]/100,e[3]/100,1):(e=Jr.exec(t))?fi(e[1],e[2]/100,e[3]/100,e[4]):Xr.hasOwnProperty(t)?ei(Xr[t]):"transparent"===t?new oi(NaN,NaN,NaN,0):null}function ei(t){return new oi(t>>16&255,t>>8&255,255&t,1)}function ni(t,e,n,r){return r<=0&&(t=e=n=NaN),new oi(t,e,n,r)}function ri(t){return t instanceof Br||(t=ti(t)),t?new oi((t=t.rgb()).r,t.g,t.b,t.opacity):new oi}function ii(t,e,n,r){return 1===arguments.length?ri(t):new oi(t,e,n,null==r?1:r)}function oi(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function ai(){return`#${li(this.r)}${li(this.g)}${li(this.b)}`}function si(){const t=ui(this.opacity);return`${1===t?"rgb(":"rgba("}${ci(this.r)}, ${ci(this.g)}, ${ci(this.b)}${1===t?")":`, ${t})`}`}function ui(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function ci(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function li(t){return((t=ci(t))<16?"0":"")+t.toString(16)}function fi(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new di(t,e,n,r)}function hi(t){if(t instanceof di)return new di(t.h,t.s,t.l,t.opacity);if(t instanceof Br||(t=ti(t)),!t)return new di;if(t instanceof di)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 di(a,s,u,t.opacity)}function pi(t,e,n,r){return 1===arguments.length?hi(t):new di(t,e,n,null==r?1:r)}function di(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function mi(t){return(t=(t||0)%360)<0?t+360:t}function yi(t){return Math.max(0,Math.min(1,t||0))}function vi(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 gi(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 bi(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),vi(t,i,r),vi(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new di(mi(this.h),yi(this.s),yi(this.l),ui(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=ui(this.opacity);return`${1===t?"hsl(":"hsla("}${mi(this.h)}, ${100*yi(this.s)}%, ${100*yi(this.l)}%${1===t?")":`, ${t})`}`}}));const wi=t=>()=>t;function xi(t,e){return function(n){return t+n*e}}function ki(t,e){var n=e-t;return n?xi(t,n>180||n<-180?n-360*Math.round(n/360):n):wi(isNaN(t)?e:t)}function Ei(t,e){var n=e-t;return n?xi(t,n):wi(isNaN(t)?e:t)}const Oi=function t(e){var n=function(t){return 1==(t=+t)?Ei: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):wi(isNaN(e)?n:e)}}(e);function r(t,e){var r=n((t=ii(t)).r,(e=ii(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=Ei(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 Si(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:Pi(n,r)})),o=Di.lastIndex;return o=0&&e._call.call(void 0,t),e=e._next;--qi}function io(){Gi=(Yi=Xi.now())+Ji,qi=Vi=0;try{ro()}finally{qi=0,function(){for(var t,e,n=Ui,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:Ui=e);zi=t,ao(r)}(),Gi=0}}function oo(){var t=Xi.now(),e=t-Yi;e>Hi&&(Ji-=e,Yi=t)}function ao(t){qi||(Vi&&(Vi=clearTimeout(Vi)),t-Gi>24?(t<1/0&&(Vi=setTimeout(io,t-Xi.now()-Ji)),Wi&&(Wi=clearInterval(Wi))):(Wi||(Yi=Xi.now(),Wi=setInterval(oo,Hi)),qi=1,Qi(io)))}function so(t,e,n){var r=new eo;return e=null==e?0:+e,r.restart((n=>{r.stop(),t(n+e)}),e,n),r}eo.prototype=no.prototype={constructor:eo,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Zi():+n)+(null==e?0:+e),this._next||zi===this||(zi?zi._next=this:Ui=this,zi=this),this._call=t,this._time=n,ao()},stop:function(){this._call&&(this._call=null,this._time=1/0,ao())}};var uo=mn("start","end","cancel","interrupt"),co=[],lo=0,fo=1,ho=2,po=3,mo=5,yo=6;function vo(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!==fo)return s();for(c in i)if((h=i[c]).name===n.name){if(h.state===po)return so(o);4===h.state?(h.state=yo,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[c]):+clo)throw new Error("too late; already scheduled");return n}function bo(t,e){var n=_o(t,e);if(n.state>po)throw new Error("too late; already running");return n}function _o(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function wo(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>ho&&n.state180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:Pi(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:Pi(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:Pi(t,n)},{i:s-2,x:Pi(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)?go:bo;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=Rn(t),r="transform"===n?Ao:Co;return this.attrTween(t,"function"==typeof e?(n.local?Bo:Do)(n,r,Mo(this,"attr."+t,e)):null==e?(n.local?Po:jo)(n):(n.local?Ro:Io)(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=Rn(t);return this.tween(n,(r.local?Fo:$o)(r,e))},style:function(t,e,n){var r="transform"==(t+="")?To:Co;return null==e?this.styleTween(t,function(t,e){var n,r,i;return function(){var o=Hn(this,t),a=(this.style.removeProperty(t),Hn(this,t));return o===a?null:o===n&&a===r?i:i=e(n=o,r=a)}}(t,r)).on("end.style."+t,Wo(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,i,o;return function(){var a=Hn(this,t),s=n(this),u=s+"";return null==s&&(this.style.removeProperty(t),u=s=Hn(this,t)),a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s))}}(t,r,Mo(this,"style."+t,e))).each(function(t,e){var n,r,i,o,a="style."+e,s="end."+a;return function(){var u=bo(this,t),c=u.on,l=null==u.value[a]?o||(o=Wo(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=Hn(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}}(Mo(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=_o(this.node(),n).tween,o=0,a=i.length;ofo&&n.name===e)return new Yo([[t]],ra,e,+r);return null}const oa=t=>()=>t;function aa(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 sa(t){t.preventDefault(),t.stopImmediatePropagation()}var ua={name:"drag"},ca={name:"space"},la={name:"handle"},fa={name:"center"};const{abs:ha,max:pa,min:da}=Math;function ma(t){return[+t[0],+t[1]]}function ya(t){return[ma(t[0]),ma(t[1])]}var va={name:"x",handles:["w","e"].map(Oa),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]]}},ga={name:"y",handles:["n","s"].map(Oa),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]]}},ba={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(Oa),input:function(t){return null==t?null:ya(t)},output:function(t){return t}},_a={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"},wa={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},xa={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},ka={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},Ea={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Oa(t){return{type:t}}function Sa(t){return!t.ctrlKey&&!t.button}function Ta(){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 Aa(){return navigator.maxTouchPoints||"ontouchstart"in this}function Na(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function La(t){var e=t.__brush;return e?e.dim.output(e.selection):null}function Ma(){return Pa(va)}function Ca(){return Pa(ga)}function ja(){return Pa(ba)}function Pa(t){var e,n=Ta,r=Sa,i=Aa,o=!0,a=mn("start","brush","end"),s=6;function u(e){var n=e.property("__brush",m).selectAll(".overlay").data([Oa("overlay")]);n.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",_a.overlay).merge(n).each((function(){var t=Na(this).extent;Nr(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([Oa("selection")]).enter().append("rect").attr("class","selection").attr("cursor",_a.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 _a[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=Nr(this),e=Na(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,v,g=this,b=n.target.__data__.type,_="selection"===(o&&n.metaKey?b="overlay":b)?ua:o&&n.altKey?fa:la,w=t===ga?null:ka[b],x=t===va?null:Ea[b],k=Na(g),E=k.extent,O=k.selection,S=E[0][0],T=E[0][1],A=E[1][0],N=E[1][1],L=0,M=0,C=w&&x&&o&&n.shiftKey,j=Array.from(n.touches||[n],(t=>{const e=t.identifier;return(t=Ki(t,g)).point0=t.slice(),t.identifier=e,t}));wo(g);var P=l(g,arguments,!0).beforestart();if("overlay"===b){O&&(m=!0);const e=[j[0],j[1]||j[0]];k.selection=O=[[i=t===ga?S:da(e[0][0],e[1][0]),s=t===va?T:da(e[0][1],e[1][1])],[f=t===ga?A:pa(e[0][0],e[1][0]),p=t===va?N:pa(e[0][1],e[1][1])]],j.length>1&&F(n)}else i=O[0][0],s=O[0][1],f=O[1][0],p=O[1][1];a=i,u=s,h=f,d=p;var I=Nr(g).attr("pointer-events","none"),R=I.selectAll(".overlay").attr("cursor",_a[b]);if(n.touches)P.moved=B,P.ended=$;else{var D=Nr(n.view).on("mousemove.brush",B,!0).on("mouseup.brush",$,!0);o&&D.on("keydown.brush",(function(t){switch(t.keyCode){case 16:C=w&&x;break;case 18:_===la&&(w&&(f=h-L*w,i=a+L*w),x&&(p=d-M*x,s=u+M*x),_=fa,F(t));break;case 32:_!==la&&_!==fa||(w<0?f=h-L:w>0&&(i=a-L),x<0?p=d-M:x>0&&(s=u-M),_=ca,R.attr("cursor",_a.selection),F(t));break;default:return}sa(t)}),!0).on("keyup.brush",(function(t){switch(t.keyCode){case 16:C&&(y=v=C=!1,F(t));break;case 18:_===fa&&(w<0?f=h:w>0&&(i=a),x<0?p=d:x>0&&(s=u),_=la,F(t));break;case 32:_===ca&&(t.altKey?(w&&(f=h-L*w,i=a+L*w),x&&(p=d-M*x,s=u+M*x),_=fa):(w<0?f=h:w>0&&(i=a),x<0?p=d:x>0&&(s=u),_=la),R.attr("cursor",_a[b]),F(t));break;default:return}sa(t)}),!0),Pr(n.view)}c.call(g),P.start(n,_.name)}function B(t){for(const e of t.changedTouches||[t])for(const t of j)t.identifier===e.identifier&&(t.cur=Ki(e,g));if(C&&!y&&!v&&1===j.length){const t=j[0];ha(t.cur[0]-t[0])>ha(t.cur[1]-t[1])?v=!0:y=!0}for(const t of j)t.cur&&(t[0]=t.cur[0],t[1]=t.cur[1]);m=!0,sa(t),F(t)}function F(t){const e=j[0],n=e.point0;var r;switch(L=e[0]-n[0],M=e[1]-n[1],_){case ca:case ua:w&&(L=pa(S-i,da(A-f,L)),a=i+L,h=f+L),x&&(M=pa(T-s,da(N-p,M)),u=s+M,d=p+M);break;case la:j[1]?(w&&(a=pa(S,da(A,j[0][0])),h=pa(S,da(A,j[1][0])),w=1),x&&(u=pa(T,da(N,j[0][1])),d=pa(T,da(N,j[1][1])),x=1)):(w<0?(L=pa(S-i,da(A-i,L)),a=i+L,h=f):w>0&&(L=pa(S-f,da(A-f,L)),a=i,h=f+L),x<0?(M=pa(T-s,da(N-s,M)),u=s+M,d=p):x>0&&(M=pa(T-p,da(N-p,M)),u=s,d=p+M));break;case fa:w&&(a=pa(S,da(A,i-L*w)),h=pa(S,da(A,f+L*w))),x&&(u=pa(T,da(N,s-M*x)),d=pa(T,da(N,p+M*x)))}ht+n))}function qa(){return Ha(!1,!1)}function Va(){return Ha(!1,!0)}function Wa(){return Ha(!0,!1)}function Ha(t,e){var n=0,r=null,i=null,o=null;function a(a){var s,u=a.length,c=new Array(u),l=za(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=za(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=za(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 Qa;const n=10**e;return function(t){this._+=t[0];for(let e=1,r=t.length;eJa)if(Math.abs(l*s-u*c)>Ja&&i){let h=n-o,p=r-a,d=s*s+u*u,m=h*h+p*p,y=Math.sqrt(d),v=Math.sqrt(f),g=i*Math.tan((Ya-Math.acos((d+f-m)/(2*y*v)))/2),b=g/v,_=g/y;Math.abs(b-1)>Ja&&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)>Ja||Math.abs(this._y1-c)>Ja)&&this._append`L${u},${c}`,n&&(f<0&&(f=f%Ga+Ga),f>Xa?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>Ja&&this._append`A${n},${n},0,${+(f>=Ya)},${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 ts(){return new Za}function es(t=3){return new Za(+t)}ts.prototype=Za.prototype;var ns=Array.prototype.slice;function rs(t){return function(){return t}}function is(t){return t.source}function os(t){return t.target}function as(t){return t.radius}function ss(t){return t.startAngle}function us(t){return t.endAngle}function cs(){return 0}function ls(){return 10}function fs(t){var e=is,n=os,r=as,i=as,o=ss,a=us,s=cs,u=null;function c(){var c,l=e.apply(this,arguments),f=n.apply(this,arguments),h=s.apply(this,arguments)/2,p=ns.call(arguments),d=+r.apply(this,(p[0]=l,p)),m=o.apply(this,p)-Fa,y=a.apply(this,p)-Fa,v=+i.apply(this,(p[0]=f,p)),g=o.apply(this,p)-Fa,b=a.apply(this,p)-Fa;if(u||(u=c=ts()),h>Ua&&(Ia(y-m)>2*h+Ua?y>m?(m+=h,y-=h):(m-=h,y+=h):m=y=(m+y)/2,Ia(b-g)>2*h+Ua?b>g?(g+=h,b-=h):(g-=h,b+=h):g=b=(g+b)/2),u.moveTo(d*Ra(m),d*Da(m)),u.arc(0,0,d,m,y),m!==g||y!==b)if(t){var _=v-+t.apply(this,arguments),w=(g+b)/2;u.quadraticCurveTo(0,0,_*Ra(g),_*Da(g)),u.lineTo(v*Ra(w),v*Da(w)),u.lineTo(_*Ra(b),_*Da(b))}else u.quadraticCurveTo(0,0,v*Ra(g),v*Da(g)),u.arc(0,0,v,g,b);if(u.quadraticCurveTo(0,0,d*Ra(m),d*Da(m)),u.closePath(),c)return u=null,c+""||null}return t&&(c.headRadius=function(e){return arguments.length?(t="function"==typeof e?e:rs(+e),c):t}),c.radius=function(t){return arguments.length?(r=i="function"==typeof t?t:rs(+t),c):r},c.sourceRadius=function(t){return arguments.length?(r="function"==typeof t?t:rs(+t),c):r},c.targetRadius=function(t){return arguments.length?(i="function"==typeof t?t:rs(+t),c):i},c.startAngle=function(t){return arguments.length?(o="function"==typeof t?t:rs(+t),c):o},c.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:rs(+t),c):a},c.padAngle=function(t){return arguments.length?(s="function"==typeof t?t:rs(+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 hs(){return fs()}function ps(){return fs(ls)}const ds=Math.PI/180,ms=180/Math.PI,ys=.96422,vs=1,gs=.82521,bs=4/29,_s=6/29,ws=3*_s*_s,xs=_s*_s*_s;function ks(t){if(t instanceof Ss)return new Ss(t.l,t.a,t.b,t.opacity);if(t instanceof Ps)return Is(t);t instanceof oi||(t=ri(t));var e,n,r=Ls(t.r),i=Ls(t.g),o=Ls(t.b),a=Ts((.2225045*r+.7168786*i+.0606169*o)/vs);return r===i&&i===o?e=n=a:(e=Ts((.4360747*r+.3850649*i+.1430804*o)/ys),n=Ts((.0139322*r+.0971045*i+.7141733*o)/gs)),new Ss(116*a-16,500*(e-a),200*(a-n),t.opacity)}function Es(t,e){return new Ss(t,0,0,null==e?1:e)}function Os(t,e,n,r){return 1===arguments.length?ks(t):new Ss(t,e,n,null==r?1:r)}function Ss(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function Ts(t){return t>xs?Math.pow(t,1/3):t/ws+bs}function As(t){return t>_s?t*t*t:ws*(t-bs)}function Ns(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Ls(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ms(t){if(t instanceof Ps)return new Ps(t.h,t.c,t.l,t.opacity);if(t instanceof Ss||(t=ks(t)),0===t.a&&0===t.b)return new Ps(NaN,0()=>t;function Gs(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 Xs(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 Qs(){}var Zs=[[],[[[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 tu(){var t=1,e=1,n=te,r=s;function i(t){var e=n(t);if(Array.isArray(e))e=e.slice().sort(Hs);else{const n=yt(t,eu);for(e=Jt(...Zt(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=nu(n[0],r),Zs[c<<1].forEach(d);++o=r,Zs[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)?Ys(Ws.call(t)):Ys(t),i):n},i.smooth=function(t){return arguments.length?(r=t?s:Qs,i):r===s},i}function eu(t){return isFinite(t)?t:NaN}function nu(t,e){return null!=t&&+t>=e}function ru(t){return null==t||isNaN(t=+t)?-1/0:t}function iu(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 ou(t){return t[0]}function au(t){return t[1]}function su(){return 1}function uu(){var t=ou,e=au,n=su,r=960,i=500,o=20,a=2,s=3*o,u=r+2*s>>a,c=i+2*s>>a,l=Ys(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 v(){return u=r+2*(s=3*o)>>a,c=i+2*s>>a,h}return h.contours=function(t){var e=f(t),n=tu().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:()=>ne(e)/r}),i},h.x=function(e){return arguments.length?(t="function"==typeof e?e:Ys(+e),h):t},h.y=function(t){return arguments.length?(e="function"==typeof t?t:Ys(+t),h):e},h.weight=function(t){return arguments.length?(n="function"==typeof t?t:Ys(+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,v()},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),v()},h.thresholds=function(t){return arguments.length?(l="function"==typeof t?t:Array.isArray(t)?Ys(Ws.call(t)):Ys(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,v()},h}const cu=134217729;function lu(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,v,g,b,_,w,x,k,E;const O=t-i,S=n-i,T=e-o,A=r-o;_=O*A,h=cu*O,p=h-(h-O),d=O-p,h=cu*A,m=h-(h-A),y=A-m,w=d*y-(_-p*m-d*m-p*y),x=T*S,h=cu*T,p=h-(h-T),d=T-p,h=cu*S,m=h-(h-S),y=S-m,k=d*y-(x-p*m-d*m-p*y),v=w-k,f=w-v,hu[0]=w-(v+f)+(f-k),g=_+v,f=g-_,b=_-(g-f)+(v-f),v=b-x,f=b-v,hu[1]=b-(v+f)+(f-x),E=g+v,f=E-g,hu[2]=g-(E-f)+(v-f),hu[3]=E;let N=function(t,e){let n=e[0];for(let t=1;t<4;t++)n+=e[t];return n}(0,hu),L=22204460492503146e-32*a;if(N>=L||-N>=L)return N;if(f=t-O,s=t-(O+f)+(f-i),f=n-S,c=n-(S+f)+(f-i),f=e-T,u=e-(T+f)+(f-o),f=r-A,l=r-(A+f)+(f-o),0===s&&0===u&&0===c&&0===l)return N;if(L=11093356479670487e-47*a+33306690738754706e-32*Math.abs(N),N+=O*l+A*s-(T*c+S*u),N>=L||-N>=L)return N;_=s*A,h=cu*s,p=h-(h-s),d=s-p,h=cu*A,m=h-(h-A),y=A-m,w=d*y-(_-p*m-d*m-p*y),x=u*S,h=cu*u,p=h-(h-u),d=u-p,h=cu*S,m=h-(h-S),y=S-m,k=d*y-(x-p*m-d*m-p*y),v=w-k,f=w-v,yu[0]=w-(v+f)+(f-k),g=_+v,f=g-_,b=_-(g-f)+(v-f),v=b-x,f=b-v,yu[1]=b-(v+f)+(f-x),E=g+v,f=E-g,yu[2]=g-(E-f)+(v-f),yu[3]=E;const M=lu(4,hu,4,yu,pu);_=O*l,h=cu*O,p=h-(h-O),d=O-p,h=cu*l,m=h-(h-l),y=l-m,w=d*y-(_-p*m-d*m-p*y),x=T*c,h=cu*T,p=h-(h-T),d=T-p,h=cu*c,m=h-(h-c),y=c-m,k=d*y-(x-p*m-d*m-p*y),v=w-k,f=w-v,yu[0]=w-(v+f)+(f-k),g=_+v,f=g-_,b=_-(g-f)+(v-f),v=b-x,f=b-v,yu[1]=b-(v+f)+(f-x),E=g+v,f=E-g,yu[2]=g-(E-f)+(v-f),yu[3]=E;const C=lu(M,pu,4,yu,du);_=s*l,h=cu*s,p=h-(h-s),d=s-p,h=cu*l,m=h-(h-l),y=l-m,w=d*y-(_-p*m-d*m-p*y),x=u*c,h=cu*u,p=h-(h-u),d=u-p,h=cu*c,m=h-(h-c),y=c-m,k=d*y-(x-p*m-d*m-p*y),v=w-k,f=w-v,yu[0]=w-(v+f)+(f-k),g=_+v,f=g-_,b=_-(g-f)+(v-f),v=b-x,f=b-v,yu[1]=b-(v+f)+(f-x),E=g+v,f=E-g,yu[2]=g-(E-f)+(v-f),yu[3]=E;const j=lu(C,du,4,yu,mu);return mu[j-1]}(t,e,n,r,i,o,c)}fu(4),fu(4),fu(4),fu(4),fu(4),fu(4),fu(4),fu(4),fu(4),fu(8),fu(8),fu(8),fu(4),fu(8),fu(8),fu(8),fu(12),fu(192),fu(192),fu(4),fu(4),fu(4),fu(4),fu(4),fu(4),fu(4),fu(4),fu(8),fu(8),fu(8),fu(8),fu(8),fu(8),fu(8),fu(8),fu(8),fu(4),fu(4),fu(4),fu(8),fu(16),fu(16),fu(16),fu(32),fu(32),fu(48),fu(64),fu(1152),fu(1152),fu(4),fu(4),fu(4),fu(4),fu(4),fu(4),fu(4),fu(4),fu(4),fu(4),fu(24),fu(24),fu(24),fu(24),fu(24),fu(24),fu(24),fu(24),fu(24),fu(24),fu(1152),fu(1152),fu(1152),fu(1152),fu(1152),fu(2304),fu(2304),fu(3456),fu(5760),fu(8),fu(8),fu(8),fu(16),fu(24),fu(48),fu(48),fu(96),fu(192),fu(384),fu(384),fu(384),fu(768),fu(96),fu(96),fu(96),fu(1152);const gu=Math.pow(2,-52),bu=new Uint32Array(512);class _u{static from(t,e=Su,n=Tu){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).fill(-1),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,m=1/0;for(let e=0;e0&&(p=e,m=n)}let g=t[2*p],b=t[2*p+1],_=1/0;for(let e=0;er&&(e[n++]=i,r=this._dists[i])}return this.hull=e.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(vu(y,v,g,b,w,x)<0){const t=p,e=g,n=b;p=d,g=w,b=x,d=t,w=e,x=n}const k=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}}(y,v,g,b,w,x);this._cx=k.x,this._cy=k.y;for(let e=0;e0&&Math.abs(c-o)<=gu&&Math.abs(l-a)<=gu)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 v=this._addTriangle(y,u,n[y],-1,-1,r[y]);r[u]=this._legalize(v+2),r[y]=v,E++;let g=n[y];for(;m=n[g],vu(c,l,t[2*g],t[2*g+1],t[2*m],t[2*m+1])<0;)v=this._addTriangle(g,u,m,r[u],-1,r[g]),r[u]=this._legalize(v+2),n[g]=g,E--,g=m;if(y===f)for(;m=e[y],vu(c,l,t[2*m],t[2*m+1],t[2*y],t[2*y+1])<0;)v=this._addTriangle(m,u,y,-1,r[y],r[m]),this._legalize(v+2),r[m]=v,n[y]=y,E--,y=m;this._hullStart=e[u]=y,n[y]=e[g]=u,n[u]=g,i[this._hashKey(c,l)]=u,i[this._hashKey(t[2*y],t[2*y+1])]=y}this.hull=new Uint32Array(E);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=bu[--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(xu(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;Ou(t,n+r>>1,i),e[t[n]]>e[t[r]]&&Ou(t,n,r),e[t[i]]>e[t[r]]&&Ou(t,i,r),e[t[n]]>e[t[i]]&&Ou(t,n,i);const a=t[i],s=e[a];for(;;){do{i++}while(e[t[i]]s);if(o=o-n?(Eu(t,e,i,r),Eu(t,e,n,o-1)):(Eu(t,e,n,o-1),Eu(t,e,i,r))}}function Ou(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function Su(t){return t[0]}function Tu(t){return t[1]}const Au=1e-6;class Nu{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)>Au||Math.abs(this._y1-i)>Au)&&(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 Lu{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 Mu{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 Mu(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=ju(e-u[2*t],2)+ju(n-u[2*t+1],2);const f=r[t];let h=f;do{let r=s[h];const f=ju(e-u[2*r],2)+ju(n-u[2*r+1],2);if(f()=>t;function Fu(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 $u(t){return!t.ctrlKey&&!t.button}function Ku(){return this.parentNode}function Uu(t,e){return null==e?{x:t.x,y:t.y}:e}function zu(){return navigator.maxTouchPoints||"ontouchstart"in this}function qu(){var t,e,n,r,i=$u,o=Ku,a=Uu,s=zu,u={},c=mn("start","drag","end"),l=0,f=0;function h(t){t.on("mousedown.drag",p).filter(s).on("touchstart.drag",y).on("touchmove.drag",v,Lr).on("touchend.drag touchcancel.drag",g).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&&(Nr(a.view).on("mousemove.drag",d,Mr).on("mouseup.drag",m,Mr),Pr(a.view),Cr(a),n=!1,t=a.clientX,e=a.clientY,u("start",a))}}function d(r){if(jr(r),!n){var i=r.clientX-t,o=r.clientY-e;n=i*i+o*o>f}u.mouse("drag",r)}function m(t){Nr(t.view).on("mousemove.drag mouseup.drag",null),Ir(t.view,n),jr(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++))===Yu?c=!0:r===Gu&&(c=!0,t.charCodeAt(a)===Yu&&++a),t.slice(i+1,e-1).replace(/""/g,'"')}for(;a9999?"+"+Qu(e,6):Qu(e,4))+"-"+Qu(t.getUTCMonth()+1,2)+"-"+Qu(t.getUTCDate(),2)+(o?"T"+Qu(n,2)+":"+Qu(r,2)+":"+Qu(i,2)+"."+Qu(o,3)+"Z":i?"T"+Qu(n,2)+":"+Qu(r,2)+":"+Qu(i,2)+"Z":r||n?"T"+Qu(n,2)+":"+Qu(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=Ju(t);return function(r,i){return e(n(r),i,t)}}(t,e):Ju(t)}));return o.columns=i||[],o},parseRows:r,format:function(e,n){return null==n&&(n=Xu(e)),[n.map(a).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=Xu(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(o).join("\n")},formatRow:o,formatValue:a}}var tc=Zu(","),ec=tc.parse,nc=tc.parseRows,rc=tc.format,ic=tc.formatBody,oc=tc.formatRows,ac=tc.formatRow,sc=tc.formatValue,uc=Zu("\t"),cc=uc.parse,lc=uc.parseRows,fc=uc.format,hc=uc.formatBody,pc=uc.formatRows,dc=uc.formatRow,mc=uc.formatValue;function yc(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;vc&&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 vc=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),gc=t=>+t;function bc(t){return t*t}function _c(t){return t*(2-t)}function wc(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}var xc=function t(e){function n(t){return Math.pow(t,e)}return e=+e,n.exponent=t,n}(3),kc=function t(e){function n(t){return 1-Math.pow(1-t,e)}return e=+e,n.exponent=t,n}(3),Ec=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),Oc=Math.PI,Sc=Oc/2;function Tc(t){return 1==+t?1:1-Math.cos(t*Sc)}function Ac(t){return Math.sin(t*Sc)}function Nc(t){return(1-Math.cos(Oc*t))/2}function Lc(t){return 1.0009775171065494*(Math.pow(2,-10*t)-.0009765625)}function Mc(t){return Lc(1-+t)}function Cc(t){return 1-Lc(t)}function jc(t){return((t*=2)<=1?Lc(1-t):2-Lc(t-1))/2}function Pc(t){return 1-Math.sqrt(1-t*t)}function Ic(t){return Math.sqrt(1- --t*t)}function Rc(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var Dc=4/11,Bc=6/11,Fc=8/11,$c=3/4,Kc=9/11,Uc=10/11,zc=15/16,qc=21/22,Vc=63/64,Wc=1/Dc/Dc;function Hc(t){return 1-Yc(1-t)}function Yc(t){return(t=+t)cl(e,n).then((e=>(new DOMParser).parseFromString(e,t)))}const gl=vl("application/xml");var bl=vl("text/html"),_l=vl("image/svg+xml");function wl(t,e){var n,r=1;function i(){var i,o,a=n.length,s=0,u=0;for(i=0;i=(o=(m+v)/2))?m=o:v=o,(l=n>=(a=(y+g)/2))?y=a:g=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+v)/2))?m=o:v=o,(l=n>=(a=(y+g)/2))?y=a:g=a}while((f=l<<1|c)==(h=(u>=a)<<1|s>=o));return i[h]=p,i[f]=d,t}function kl(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function El(t){return t[0]}function Ol(t){return t[1]}function Sl(t,e,n){var r=new Tl(null==e?El:e,null==n?Ol:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function Tl(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 Al(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var Nl=Sl.prototype=Tl.prototype;function Ll(t){return function(){return t}}function Ml(t){return 1e-6*(t()-.5)}function Cl(t){return t.x+t.vx}function jl(t){return t.y+t.vy}function Pl(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,v=m*m+y*y;vt.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)=v)<<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 g=t-+this._x.call(null,m.data),b=e-+this._y.call(null,m.data),_=g*g+b*b;if(_=(s=(d+y)/2))?d=s:y=s,(l=a>=(u=(m+v)/2))?m=u:v=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)},Nl.removeAll=function(t){for(var e=0,n=t.length;e(t=(Bl*t+Fl)%$l)/$l}();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 Wl(){var t,e,n,r,i,o=Ll(-30),a=1,s=1/0,u=.81;function c(n){var i,o=t.length,a=Sl(t,Kl,Ul).visitAfter(f);for(r=n,i=0;i=s)){(t.data!==e||t.next)&&(0===f&&(d+=(f=Ml(n))*f),0===h&&(d+=(h=Ml(n))*h),d1?r[0]+r.slice(2):r,+t.slice(n+1)]}function Xl(t){return(t=Jl(Math.abs(t)))?t[1]:NaN}var Ql,Zl=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function tf(t){if(!(e=Zl.exec(t)))throw new Error("invalid format: "+t);var e;return new ef({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 ef(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 nf(t,e){var n=Jl(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")}tf.prototype=ef.prototype,ef.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 rf={"%":(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)=>nf(100*t,e),r:nf,s:function(t,e){var n=Jl(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(Ql=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")+Jl(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function of(t){return t}var af,sf,uf,cf=Array.prototype.map,lf=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ff(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?of:(e=cf.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?of:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(cf.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=tf(t)).fill,n=t.align,f=t.sign,h=t.symbol,p=t.zero,d=t.width,m=t.comma,y=t.precision,v=t.trim,g=t.type;"n"===g?(m=!0,g="g"):rf[g]||(void 0===y&&(y=12),v=!0,g="g"),(p||"0"===e&&"="===n)&&(p=!0,e="0",n="=");var b="$"===h?i:"#"===h&&/[boxX]/.test(g)?"0"+g.toLowerCase():"",_="$"===h?o:/[%p]/.test(g)?u:"",w=rf[g],x=/[defgprs%]/.test(g);function k(t){var i,o,u,h=b,k=_;if("c"===g)k=w(t)+k,t="";else{var E=(t=+t)<0||1/t<0;if(t=isNaN(t)?l:w(Math.abs(t),y),v&&(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)),E&&0==+t&&"+"!==f&&(E=!1),h=(E?"("===f?f:c:"-"===f||"("===f?"":f)+h,k=("s"===g?lf[8+Ql/3]:"")+k+(E&&"("===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 O=h.length+t.length+k.length,S=O>1)+h+t+k+S.slice(O);break;default:t=S+h+t+k}return s(t)}return y=void 0===y?6:/[gprs]/.test(g)?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=tf(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(Xl(e)/3))),i=Math.pow(10,-r),o=lf[8+r/3];return function(t){return n(i*t)+o}}}}function hf(t){return af=ff(t),sf=af.format,uf=af.formatPrefix,af}function pf(t){return Math.max(0,-Xl(Math.abs(t)))}function df(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Xl(e)/3)))-Xl(Math.abs(t)))}function mf(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Xl(e)-Xl(t))+1}hf({thousands:",",grouping:[3],currency:["$",""]});var yf=1e-6,vf=1e-12,gf=Math.PI,bf=gf/2,_f=gf/4,wf=2*gf,xf=180/gf,kf=gf/180,Ef=Math.abs,Of=Math.atan,Sf=Math.atan2,Tf=Math.cos,Af=Math.ceil,Nf=Math.exp,Lf=(Math.floor,Math.hypot),Mf=Math.log,Cf=Math.pow,jf=Math.sin,Pf=Math.sign||function(t){return t>0?1:t<0?-1:0},If=Math.sqrt,Rf=Math.tan;function Df(t){return t>1?0:t<-1?gf:Math.acos(t)}function Bf(t){return t>1?bf:t<-1?-bf:Math.asin(t)}function Ff(t){return(t=jf(t/2))*t}function $f(){}function Kf(t,e){t&&zf.hasOwnProperty(t.type)&&zf[t.type](t,e)}var Uf={Feature:function(t,e){Kf(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=Tf(e=(e*=kf)/2+_f),a=jf(e),s=Xf*a,u=Jf*o+s*Tf(i),c=s*r*jf(i);ch.add(Sf(c,u)),Gf=t,Jf=o,Xf=a}function yh(t){return lh=new vt,Wf(t,fh),2*lh}function vh(t){return[Sf(t[1],t[0]),Bf(t[2])]}function gh(t){var e=t[0],n=t[1],r=Tf(n);return[r*Tf(e),r*jf(e),jf(n)]}function bh(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function _h(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 wh(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function xh(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function kh(t){var e=If(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var Eh,Oh,Sh,Th,Ah,Nh,Lh,Mh,Ch,jh,Ph,Ih,Rh,Dh,Bh,Fh,$h={point:Kh,lineStart:zh,lineEnd:qh,polygonStart:function(){$h.point=Vh,$h.lineStart=Wh,$h.lineEnd=Hh,ah=new vt,fh.polygonStart()},polygonEnd:function(){fh.polygonEnd(),$h.point=Kh,$h.lineStart=zh,$h.lineEnd=qh,ch<0?(Qf=-(th=180),Zf=-(eh=90)):ah>yf?eh=90:ah<-yf&&(Zf=-90),uh[0]=Qf,uh[1]=th},sphere:function(){Qf=-(th=180),Zf=-(eh=90)}};function Kh(t,e){sh.push(uh=[Qf=t,th=t]),eeh&&(eh=e)}function Uh(t,e){var n=gh([t*kf,e*kf]);if(oh){var r=_h(oh,n),i=_h([r[1],-r[0],0],r);kh(i),i=vh(i);var o,a=t-nh,s=a>0?1:-1,u=i[0]*xf*s,c=Ef(a)>180;c^(s*nheh&&(eh=o):c^(s*nh<(u=(u+360)%360-180)&&ueh&&(eh=e)),c?tYh(Qf,th)&&(th=t):Yh(t,th)>Yh(Qf,th)&&(Qf=t):th>=Qf?(tth&&(th=t)):t>nh?Yh(Qf,t)>Yh(Qf,th)&&(th=t):Yh(t,th)>Yh(Qf,th)&&(Qf=t)}else sh.push(uh=[Qf=t,th=t]);eeh&&(eh=e),oh=n,nh=t}function zh(){$h.point=Uh}function qh(){uh[0]=Qf,uh[1]=th,$h.point=Kh,oh=null}function Vh(t,e){if(oh){var n=t-nh;ah.add(Ef(n)>180?n+(n>0?360:-360):n)}else rh=t,ih=e;fh.point(t,e),Uh(t,e)}function Wh(){fh.lineStart()}function Hh(){Vh(rh,ih),fh.lineEnd(),Ef(ah)>yf&&(Qf=-(th=180)),uh[0]=Qf,uh[1]=th,oh=null}function Yh(t,e){return(e-=t)<0?e+360:e}function Gh(t,e){return t[0]-e[0]}function Jh(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:eYh(r[0],r[1])&&(r[1]=i[1]),Yh(i[0],r[1])>Yh(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=Yh(r[1],i[0]))>a&&(a=s,Qf=i[0],th=r[1])}return sh=uh=null,Qf===1/0||Zf===1/0?[[NaN,NaN],[NaN,NaN]]:[[Qf,Zf],[th,eh]]}var Qh={sphere:$f,point:Zh,lineStart:ep,lineEnd:ip,polygonStart:function(){Qh.lineStart=op,Qh.lineEnd=ap},polygonEnd:function(){Qh.lineStart=ep,Qh.lineEnd=ip}};function Zh(t,e){t*=kf;var n=Tf(e*=kf);tp(n*Tf(t),n*jf(t),jf(e))}function tp(t,e,n){++Eh,Sh+=(t-Sh)/Eh,Th+=(e-Th)/Eh,Ah+=(n-Ah)/Eh}function ep(){Qh.point=np}function np(t,e){t*=kf;var n=Tf(e*=kf);Dh=n*Tf(t),Bh=n*jf(t),Fh=jf(e),Qh.point=rp,tp(Dh,Bh,Fh)}function rp(t,e){t*=kf;var n=Tf(e*=kf),r=n*Tf(t),i=n*jf(t),o=jf(e),a=Sf(If((a=Bh*o-Fh*i)*a+(a=Fh*r-Dh*o)*a+(a=Dh*i-Bh*r)*a),Dh*r+Bh*i+Fh*o);Oh+=a,Nh+=a*(Dh+(Dh=r)),Lh+=a*(Bh+(Bh=i)),Mh+=a*(Fh+(Fh=o)),tp(Dh,Bh,Fh)}function ip(){Qh.point=Zh}function op(){Qh.point=sp}function ap(){up(Ih,Rh),Qh.point=Zh}function sp(t,e){Ih=t,Rh=e,t*=kf,e*=kf,Qh.point=up;var n=Tf(e);Dh=n*Tf(t),Bh=n*jf(t),Fh=jf(e),tp(Dh,Bh,Fh)}function up(t,e){t*=kf;var n=Tf(e*=kf),r=n*Tf(t),i=n*jf(t),o=jf(e),a=Bh*o-Fh*i,s=Fh*r-Dh*o,u=Dh*i-Bh*r,c=Lf(a,s,u),l=Bf(c),f=c&&-l/c;Ch.add(f*a),jh.add(f*s),Ph.add(f*u),Oh+=l,Nh+=l*(Dh+(Dh=r)),Lh+=l*(Bh+(Bh=i)),Mh+=l*(Fh+(Fh=o)),tp(Dh,Bh,Fh)}function cp(t){Eh=Oh=Sh=Th=Ah=Nh=Lh=Mh=0,Ch=new vt,jh=new vt,Ph=new vt,Wf(t,Qh);var e=+Ch,n=+jh,r=+Ph,i=Lf(e,n,r);return igf&&(t-=Math.round(t/wf)*wf),[t,e]}function pp(t,e,n){return(t%=wf)?e||n?fp(mp(t),yp(e,n)):mp(t):e||n?yp(e,n):hp}function dp(t){return function(e,n){return Ef(e+=t)>gf&&(e-=Math.round(e/wf)*wf),[e,n]}}function mp(t){var e=dp(t);return e.invert=dp(-t),e}function yp(t,e){var n=Tf(t),r=jf(t),i=Tf(e),o=jf(e);function a(t,e){var a=Tf(e),s=Tf(t)*a,u=jf(t)*a,c=jf(e),l=c*n+s*r;return[Sf(u*i-l*o,s*n-c*r),Bf(l*i+u*o)]}return a.invert=function(t,e){var a=Tf(e),s=Tf(t)*a,u=jf(t)*a,c=jf(e),l=c*i-u*o;return[Sf(u*i+c*o,s*n+l*r),Bf(l*n-s*r)]},a}function vp(t){function e(e){return(e=t(e[0]*kf,e[1]*kf))[0]*=xf,e[1]*=xf,e}return t=pp(t[0]*kf,t[1]*kf,t.length>2?t[2]*kf:0),e.invert=function(e){return(e=t.invert(e[0]*kf,e[1]*kf))[0]*=xf,e[1]*=xf,e},e}function gp(t,e,n,r,i,o){if(n){var a=Tf(e),s=jf(e),u=r*n;null==i?(i=e+r*wf,o=e-u/2):(i=bp(a,i),o=bp(a,o),(r>0?io)&&(i+=r*wf));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 xp(t,e){return Ef(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 Op(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r=0?1:-1,S=O*E,T=S>gf,A=y*x;if(u.add(Sf(A*O*jf(S),v*k+A*Tf(S))),a+=T?E+O*wf:E,T^d>=n^_>=n){var N=_h(gh(p),gh(b));kh(N);var L=_h(o,N);kh(L);var M=(T^E>=0?-1:1)*Bf(L[2]);(r>M||r===M&&(N[0]||N[1]))&&(s+=T^E>=0?1:-1)}}return(a<-yf||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(Np))}return h}}function Np(t){return t.length>1}function Lp(t,e){return((t=t.x)[0]<0?t[1]-bf-yf:bf-t[1])-((e=e.x)[0]<0?e[1]-bf-yf:bf-e[1])}hp.invert=hp;const Mp=Ap((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?gf:-gf,u=Ef(o-n);Ef(u-gf)0?bf:-bf),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(o,r),e=0):i!==s&&u>=gf&&(Ef(n-i)yf?Of((jf(e)*(o=Tf(r))*jf(n)-jf(r)*(i=Tf(e))*jf(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*bf,r.point(-gf,i),r.point(0,i),r.point(gf,i),r.point(gf,0),r.point(gf,-i),r.point(0,-i),r.point(-gf,-i),r.point(-gf,0),r.point(-gf,i);else if(Ef(t[0]-e[0])>yf){var o=t[0]0,i=Ef(e)>yf;function o(t,n){return Tf(t)*Tf(n)>e}function a(t,n,r){var i=[1,0,0],o=_h(gh(t),gh(n)),a=bh(o,o),s=o[0],u=a-s*s;if(!u)return!r&&t;var c=e*a/u,l=-e*s/u,f=_h(i,o),h=xh(i,c);wh(h,xh(o,l));var p=f,d=bh(h,p),m=bh(p,p),y=d*d-m*(bh(h,h)-1);if(!(y<0)){var v=If(y),g=xh(p,(-d-v)/m);if(wh(g,h),g=vh(g),!r)return g;var b,_=t[0],w=n[0],x=t[1],k=n[1];w<_&&(b=_,_=w,w=b);var E=w-_,O=Ef(E-gf)0^g[1]<(Ef(g[0]-_)gf^(_<=g[0]&&g[0]<=w)){var S=xh(p,(-d+v)/m);return wh(S,h),[g,vh(S)]}}}function s(e,n){var i=r?t:gf-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return Ap(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?gf:-gf),h):0;if(!e&&(c=u=m)&&t.lineStart(),m!==u&&(!(p=a(e,d))||xp(e,p)||xp(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 v;y&n||!(v=a(d,e,!0))||(l=0,r?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1],3)))}!m||e&&xp(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){gp(o,t,n,i,e,r)}),r?[0,-t]:[-gf,t-gf])}var jp,Pp,Ip,Rp,Dp=1e9,Bp=-Dp;function Fp(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 Ef(r[0]-t)0?0:3:Ef(r[0]-n)0?2:1:Ef(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,v,g,b=a,_=wp(),w={point:x,lineStart:function(){w.point=k,c&&c.push(l=[]),v=!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=[],g=!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=g&&e,i=(u=ve(u)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&Ep(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]),v)f=o,h=a,p=s,v=!1,s&&(b.lineStart(),b.point(o,a));else if(s&&y)b.point(o,a);else{var u=[d=Math.max(Bp,Math.min(Dp,d)),m=Math.max(Bp,Math.min(Dp,m))],_=[o=Math.max(Bp,Math.min(Dp,o)),a=Math.max(Bp,Math.min(Dp,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),g=!1):(y||(b.lineStart(),b.point(u[0],u[1])),b.point(_[0],_[1]),s||b.lineEnd(),g=!1)}d=o,m=a,y=s}return w}}function $p(){var t,e,n,r=0,i=0,o=960,a=500;return n={stream:function(n){return t&&e===n?t:t=Fp(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 Kp={sphere:$f,point:$f,lineStart:function(){Kp.point=zp,Kp.lineEnd=Up},lineEnd:$f,polygonStart:$f,polygonEnd:$f};function Up(){Kp.point=Kp.lineEnd=$f}function zp(t,e){Pp=t*=kf,Ip=jf(e*=kf),Rp=Tf(e),Kp.point=qp}function qp(t,e){t*=kf;var n=jf(e*=kf),r=Tf(e),i=Ef(t-Pp),o=Tf(i),a=r*jf(i),s=Rp*n-Ip*r*o,u=Ip*n+Rp*r*o;jp.add(Sf(If(a*a+s*s),u)),Pp=t,Ip=n,Rp=r}function Vp(t){return jp=new vt,Wf(t,Kp),+jp}var Wp=[null,null],Hp={type:"LineString",coordinates:Wp};function Yp(t,e){return Wp[0]=t,Wp[1]=e,Vp(Hp)}var Gp={Feature:function(t,e){return Xp(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r0&&(i=Yp(t[o],t[o-1]))>0&&n<=i&&r<=i&&(n+r-i)*(1-Math.pow((n-r)/i,2))yf})).map(u)).concat(we(Af(o/p)*p,i,p).filter((function(t){return Ef(t%m)>yf})).map(c))}return v.lines=function(){return g().map((function(t){return{type:"LineString",coordinates:t}}))},v.outline=function(){return{type:"Polygon",coordinates:[l(r).concat(f(a).slice(1),l(n).reverse().slice(1),f(s).reverse().slice(1))]}},v.extent=function(t){return arguments.length?v.extentMajor(t).extentMinor(t):v.extentMinor()},v.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),v.precision(y)):[[r,s],[n,a]]},v.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),v.precision(y)):[[e,o],[t,i]]},v.step=function(t){return arguments.length?v.stepMajor(t).stepMinor(t):v.stepMinor()},v.stepMajor=function(t){return arguments.length?(d=+t[0],m=+t[1],v):[d,m]},v.stepMinor=function(t){return arguments.length?(h=+t[0],p=+t[1],v):[h,p]},v.precision=function(h){return arguments.length?(y=+h,u=id(o,i,90),c=od(e,t,y),l=id(s,a,90),f=od(r,n,y),v):y},v.extentMajor([[-180,-90+yf],[180,90-yf]]).extentMinor([[-180,-80-yf],[180,80+yf]])}function sd(){return ad()()}function ud(t,e){var n=t[0]*kf,r=t[1]*kf,i=e[0]*kf,o=e[1]*kf,a=Tf(r),s=jf(r),u=Tf(o),c=jf(o),l=a*Tf(n),f=a*jf(n),h=u*Tf(i),p=u*jf(i),d=2*Bf(If(Ff(o-r)+a*u*Ff(i-n))),m=jf(d),y=d?function(t){var e=jf(t*=d)/m,n=jf(d-t)/m,r=n*l+e*h,i=n*f+e*p,o=n*s+e*c;return[Sf(i,r)*xf,Sf(o,If(r*r+i*i))*xf]}:function(){return[n*xf,r*xf]};return y.distance=d,y}const cd=t=>t;var ld,fd,hd,pd,dd=new vt,md=new vt,yd={point:$f,lineStart:$f,lineEnd:$f,polygonStart:function(){yd.lineStart=vd,yd.lineEnd=_d},polygonEnd:function(){yd.lineStart=yd.lineEnd=yd.point=$f,dd.add(Ef(md)),md=new vt},result:function(){var t=dd/2;return dd=new vt,t}};function vd(){yd.point=gd}function gd(t,e){yd.point=bd,ld=hd=t,fd=pd=e}function bd(t,e){md.add(pd*t-hd*e),hd=t,pd=e}function _d(){bd(ld,fd)}const wd=yd;var xd=1/0,kd=xd,Ed=-xd,Od=Ed,Sd={point:function(t,e){tEd&&(Ed=t),eOd&&(Od=e)},lineStart:$f,lineEnd:$f,polygonStart:$f,polygonEnd:$f,result:function(){var t=[[xd,kd],[Ed,Od]];return Ed=Od=-(kd=xd=1/0),t}};const Td=Sd;var Ad,Nd,Ld,Md,Cd=0,jd=0,Pd=0,Id=0,Rd=0,Dd=0,Bd=0,Fd=0,$d=0,Kd={point:Ud,lineStart:zd,lineEnd:Wd,polygonStart:function(){Kd.lineStart=Hd,Kd.lineEnd=Yd},polygonEnd:function(){Kd.point=Ud,Kd.lineStart=zd,Kd.lineEnd=Wd},result:function(){var t=$d?[Bd/$d,Fd/$d]:Dd?[Id/Dd,Rd/Dd]:Pd?[Cd/Pd,jd/Pd]:[NaN,NaN];return Cd=jd=Pd=Id=Rd=Dd=Bd=Fd=$d=0,t}};function Ud(t,e){Cd+=t,jd+=e,++Pd}function zd(){Kd.point=qd}function qd(t,e){Kd.point=Vd,Ud(Ld=t,Md=e)}function Vd(t,e){var n=t-Ld,r=e-Md,i=If(n*n+r*r);Id+=i*(Ld+t)/2,Rd+=i*(Md+e)/2,Dd+=i,Ud(Ld=t,Md=e)}function Wd(){Kd.point=Ud}function Hd(){Kd.point=Gd}function Yd(){Jd(Ad,Nd)}function Gd(t,e){Kd.point=Jd,Ud(Ad=Ld=t,Nd=Md=e)}function Jd(t,e){var n=t-Ld,r=e-Md,i=If(n*n+r*r);Id+=i*(Ld+t)/2,Rd+=i*(Md+e)/2,Dd+=i,Bd+=(i=Md*t-Ld*e)*(Ld+t),Fd+=i*(Md+e),$d+=3*i,Ud(Ld=t,Md=e)}const Xd=Kd;function Qd(t){this._context=t}Qd.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,wf)}},result:$f};var Zd,tm,em,nm,rm,im=new vt,om={point:$f,lineStart:function(){om.point=am},lineEnd:function(){Zd&&sm(tm,em),om.point=$f},polygonStart:function(){Zd=!0},polygonEnd:function(){Zd=null},result:function(){var t=+im;return im=new vt,t}};function am(t,e){om.point=sm,tm=nm=t,em=rm=e}function sm(t,e){nm-=t,rm-=e,im.add(If(nm*nm+rm*rm)),nm=t,rm=e}const um=om;let cm,lm,fm,hm;class pm{constructor(t){this._append=null==t?dm:function(t){const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return dm;if(e!==cm){const t=10**e;cm=e,lm=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 pm(i)),a},a.projection(t).digits(i).context(e)}function ym(t){return{stream:vm(t)}}function vm(t){return function(e){var n=new gm;for(var r in t)n[r]=t[r];return n.stream=e,n}}function gm(){}function bm(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),Wf(n,t.stream(Td)),e(Td.result()),null!=r&&t.clipExtent(r),t}function _m(t,e,n){return bm(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 wm(t,e,n){return _m(t,[[0,0],e],n)}function xm(t,e,n){return bm(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 km(t,e,n){return bm(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)}gm.prototype={constructor:gm,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 Em=16,Om=Tf(30*kf);function Sm(t,e){return+e?function(t,e){function n(r,i,o,a,s,u,c,l,f,h,p,d,m,y){var v=c-r,g=l-i,b=v*v+g*g;if(b>4*e&&m--){var _=a+h,w=s+p,x=u+d,k=If(_*_+w*w+x*x),E=Bf(x/=k),O=Ef(Ef(x)-1)e||Ef((v*N+g*L)/b-.5)>.3||a*h+s*p+u*d2?t[2]%360*kf:0,N()):[y*xf,v*xf,g*xf]},T.angle=function(t){return arguments.length?(b=t%360*kf,N()):b*xf},T.reflectX=function(t){return arguments.length?(_=t?-1:1,N()):_<0},T.reflectY=function(t){return arguments.length?(w=t?-1:1,N()):w<0},T.precision=function(t){return arguments.length?(a=Sm(s,S=t*t),L()):If(S)},T.fitExtent=function(t,e){return _m(T,t,e)},T.fitSize=function(t,e){return wm(T,t,e)},T.fitWidth=function(t,e){return xm(T,t,e)},T.fitHeight=function(t,e){return km(T,t,e)},function(){return e=t.apply(this,arguments),T.invert=e.invert&&A,N()}}function Mm(t){var e=0,n=gf/3,r=Lm(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*kf,n=t[1]*kf):[e*xf,n*xf]},i}function Cm(t,e){var n=jf(t),r=(n+jf(e))/2;if(Ef(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<-bf+yf&&(e=-bf+yf):e>bf-yf&&(e=bf-yf);var n=i/Cf(Vm(e),r);return[n*jf(r*t),i-n*Tf(r*t)]}return o.invert=function(t,e){var n=i-e,o=Pf(r)*If(t*t+n*n),a=Sf(t,Ef(n))*Pf(n);return n*r<0&&(a-=gf*Pf(t)*Pf(n)),[a/r,2*Of(Cf(i/o,1/r))-bf]},o}function Hm(){return Mm(Wm).scale(109.5).parallels([30,30])}function Ym(t,e){return[t,e]}function Gm(){return Nm(Ym).scale(152.63)}function Jm(t,e){var n=Tf(t),r=t===e?jf(t):(n-Tf(e))/(e-t),i=n/r+t;if(Ef(r)2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)}function yy(t,e){return t.parent===e.parent?1:2}function vy(t,e){return t+e.x}function gy(t,e){return Math.max(t,e.y)}function by(){var t=yy,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(vy,0)/t.length}(n),e.y=function(t){return 1+t.reduce(gy,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 _y(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 wy(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=ky)):void 0===e&&(e=xy);for(var n,r,i,o,a,s=new Sy(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 Sy(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(Oy)}function xy(t){return t.children}function ky(t){return Array.isArray(t)?t[1]:null}function Ey(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function Oy(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function Sy(t){this.data=t,this.depth=this.height=0,this.parent=null}function Ty(t){return null==t?null:Ay(t)}function Ay(t){if("function"!=typeof t)throw new Error;return t}function Ny(){return 0}function Ly(t){return function(){return t}}ry.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*(Qm+Zm*i+o*(ty+ey*i))-e)/(Qm+3*Zm*i+o*(7*ty+9*ey*i)))*r)*i*i,!(Ef(n)yf&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},ly.invert=Dm(Bf),hy.invert=Dm((function(t){return 2*Of(t)})),dy.invert=function(t,e){return[-e,2*Of(Nf(t))-bf]},Sy.prototype=wy.prototype={constructor:Sy,count:function(){return this.eachAfter(_y)},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 wy(this).eachBefore(Ey)},[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=(My*t+Cy)%jy)/jy}function Iy(t){return Ry(t,Py())}function Ry(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 $y(t,e){for(var n=0;n1e-6?(T+Math.sqrt(T*T-4*S*A))/(2*S):A/T);return{x:r+x+k*N,y:i+E+O*N,r:N}}function qy(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 Vy(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 Wy(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 Hy(t){this._=t,this.next=null,this.previous=null}function Yy(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;qy(i,r,o=t[2]),r=new Hy(r),i=new Hy(i),o=new Hy(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 fv(t,e-1)&&!fv(t,e-2)&&(t=t.slice(0,-1)),"/"===t[0]?t:`/${t}`}(t(e,n,r)))),n=e.map(lv),i=new Set(e).add("");for(const t of n)i.has(t)||(i.add(t),e.push(t),n.push(lv(t)),h.push(av));p=(t,n)=>e[n],d=(t,e)=>n[e]}for(a=0,i=h.length;a=0&&(c=h[t]).data===av;--t)c.data=null}if(s.parent=iv,s.eachBefore((function(t){t.depth=t.parent.depth+1,--i})).eachBefore(Oy),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(t){return arguments.length?(e=Ty(t),r):e},r.parentId=function(t){return arguments.length?(n=Ty(t),r):n},r.path=function(e){return arguments.length?(t=Ty(e),r):t},r}function lv(t){let e=t.length;if(e<2)return"";for(;--e>1&&!fv(t,e););return t.slice(0,e)}function fv(t,e){if("/"===t[e]){let n=0;for(;e>0&&"\\"===t[--e];)++n;if(!(1&n))return!0}return!1}function hv(t,e){return t.parent===e.parent?1:2}function pv(t){var e=t.children;return e?e[0]:t.t}function dv(t){var e=t.children;return e?e[e.length-1]:t.t}function mv(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 yv(t,e,n){return t.a.parent===e.parent?t.a:n}function vv(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 gv(){var t=hv,e=1,n=1,r=null;function i(i){var u=function(t){for(var e,n,r,i,o,a=new vv(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 vv(r[i],i)),n.parent=e;return(a.parent=new vv(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=dv(s),o=pv(o),s&&o;)u=pv(u),(a=dv(a)).a=e,(i=s.z+f-o.z-c+t(s._,o._))>0&&(mv(yv(s,e,r),e,i),c+=i,l+=i),f+=s.m,c+=o.m,h+=u.m,l+=a.m;s&&!dv(a)&&(a.t=s,a.m+=f-l),o&&!pv(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 bv(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}v.push(a={value:l,dice:u1?e:1)},n}(_v);function kv(){var t=xv,e=!1,n=1,r=1,i=[0],o=Ny,a=Ny,s=Ny,u=Ny,c=Ny;function l(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(f),i=[0],e&&t.eachBefore(ev),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 g=r?(i*v+a*y)/r:a;t(e,p,y,i,o,g,u),t(p,n,v,g,o,a,u)}else{var b=r?(o*v+u*y)/r:u;t(e,p,y,i,o,a,b),t(p,n,v,i,b,a,u)}}(0,u,t.value,e,n,r,i)}function Ov(t,e,n,r,i){(1&t.depth?bv:nv)(t,e,n,r,i)}const Sv=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}(_v);function Tv(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}function Av(t,e){var n=ki(+t,+e);return function(t){var e=n(t);return e-360*Math.floor(e/360)}}function Nv(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function Lv(t){return((t=Math.exp(t))+1/t)/2}const Mv=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),v=(h*h-c*c+r*m)/(2*c*n*y),g=(h*h-c*c-r*m)/(2*h*n*y),b=Math.log(Math.sqrt(v*v+1)-v),_=Math.log(Math.sqrt(g*g+1)-g);a=(_-b)/e,o=function(t){var r,i=t*a,o=Lv(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/Lv(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 Cv(t){return function(e,n){var r=t((e=pi(e)).h,(n=pi(n)).h),i=Ei(e.s,n.s),o=Ei(e.l,n.l),a=Ei(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 jv=Cv(ki);var Pv=Cv(Ei);function Iv(t,e){var n=Ei((t=Os(t)).l,(e=Os(e)).l),r=Ei(t.a,e.a),i=Ei(t.b,e.b),o=Ei(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 Rv(t){return function(e,n){var r=t((e=js(e)).h,(n=js(n)).h),i=Ei(e.c,n.c),o=Ei(e.l,n.l),a=Ei(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 Dv=Rv(ki);var Bv=Rv(Ei);function Fv(t){return function e(n){function r(e,r){var i=t((e=qs(e)).h,(r=qs(r)).h),o=Ei(e.s,r.s),a=Ei(e.l,r.l),s=Ei(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 $v=Fv(ki);var Kv=Fv(Ei);function Uv(t,e){void 0===e&&(e=t,t=Fi);for(var n=0,r=e.length-1,i=e[0],o=new Array(r<0?0:r);n1&&Wv(t[n[i-2]],t[n[i-1]],t[r])<=0;)--i;n[i++]=r}return n.slice(0,i)}function Gv(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 Xv(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}(Qv),ng=function t(e){var n=eg.source(e);function r(){var t=n.apply(this,arguments);return function(){return Math.exp(t())}}return r.source=t,r}(Qv),rg=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}(Qv),ig=function t(e){var n=rg.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}(Qv),og=function t(e){function n(t){return function(){return-Math.log1p(-e())/t}}return n.source=t,n}(Qv),ag=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}(Qv),sg=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}(Qv),ug=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}(Qv),cg=function t(e){var n=eg.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}(Qv),lg=function t(e){var n=cg.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}(Qv),fg=function t(e){var n=ug.source(e),r=lg.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}(Qv),hg=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}(Qv),pg=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}(Qv),dg=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}(Qv),mg=function t(e){var n=cg.source(e),r=fg.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}(Qv),yg=1664525,vg=1013904223,gg=1/4294967296;function bg(t=Math.random()){let e=0|(0<=t&&t<1?t/gg:Math.abs(t));return()=>(e=yg*e+vg|0,gg*(e>>>0))}function _g(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function wg(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 xg=Symbol("implicit");function kg(){var t=new _t,e=[],n=[],r=xg;function i(i){let o=t.get(i);if(void 0===o){if(r!==xg)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 _t;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 kg(e,n).unknown(r)},_g.apply(i,arguments),i}function Eg(){var t,e,n=kg().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?Cg:Mg,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),Pi)))(n)))},f.domain=function(t){return arguments.length?(a=Array.from(t,Tg),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=Nv,l()},f.clamp=function(t){return arguments.length?(c=!!t||Ng,l()):c!==Ng},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 Ig(){return Pg()(Ng,Ng)}function Rg(t,e,n,r){var i,o=Qt(t,e,n);switch((r=tf(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=df(o,a))||(r.precision=i),uf(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=mf(o,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=pf(o))||(r.precision=i-2*("%"===r.type))}return sf(r)}function Dg(t){var e=t.domain;return t.ticks=function(t){var n=e();return Jt(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return Rg(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=Xt(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 Bg(){var t=Ig();return t.copy=function(){return jg(t,Bg())},_g.apply(t,arguments),Dg(t)}function Fg(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,Tg),n):t.slice()},n.unknown=function(t){return arguments.length?(e=t,n):e},n.copy=function(){return Fg(t).unknown(e)},t=arguments.length?Array.from(t,Tg):[0,1],Dg(n)}function $g(t,e){var n,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a-t(-e,n)}function Hg(t){const e=t(Kg,Ug),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?Vg:t===Math.E?Math.exp:e=>Math.pow(t,e)}(o),n()[0]<0?(r=Wg(r),i=Wg(i),t(zg,qg)):t(Kg,Ug),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=tf(n)).precision||(n.trim=!0),n=sf(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($g(n(),{floor:t=>i(Math.floor(r(t))),ceil:t=>i(Math.ceil(r(t)))})),e}function Yg(){const t=Hg(Pg()).domain([1,10]);return t.copy=()=>jg(t,Yg()).base(t.base()),_g.apply(t,arguments),t}function Gg(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function Jg(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function Xg(t){var e=1,n=t(Gg(e),Jg(e));return n.constant=function(n){return arguments.length?t(Gg(e=+n),Jg(e)):e},Dg(n)}function Qg(){var t=Xg(Pg());return t.copy=function(){return jg(t,Qg()).constant(t.constant())},_g.apply(t,arguments)}function Zg(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function tb(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function eb(t){return t<0?-t*t:t*t}function nb(t){var e=t(Ng,Ng),n=1;return e.exponent=function(e){return arguments.length?1==(n=+e)?t(Ng,Ng):.5===n?t(tb,eb):t(Zg(n),Zg(1/n)):n},Dg(e)}function rb(){var t=nb(Pg());return t.copy=function(){return jg(t,rb()).exponent(t.exponent())},_g.apply(t,arguments),t}function ib(){return rb.apply(null,arguments).exponent(.5)}function ob(t){return Math.sign(t)*t*t}function ab(){var t,e=Ig(),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(ob(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,Tg)).map(ob)),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 ab(e.domain(),n).round(r).clamp(e.clamp()).unknown(t)},_g.apply(i,arguments),Dg(i)}function sb(){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 ub().domain([e,n]).range(o).unknown(t)},_g.apply(Dg(a),arguments)}function cb(){var t,e=[.5],n=[0,1],r=1;function i(i){return null!=i&&i<=i?n[tt(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 cb().domain(e).range(n).unknown(t)},_g.apply(i,arguments)}const lb=1e3,fb=6e4,hb=36e5,pb=864e5,db=6048e5,mb=31536e6,yb=new Date,vb=new Date;function gb(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(sgb((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)=>(yb.setTime(+e),vb.setTime(+r),t(yb),t(vb),Math.floor(n(yb,vb))),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 bb=gb((()=>{}),((t,e)=>{t.setTime(+t+e)}),((t,e)=>e-t));bb.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?gb((e=>{e.setTime(Math.floor(e/t)*t)}),((e,n)=>{e.setTime(+e+n*t)}),((e,n)=>(n-e)/t)):bb:null);const _b=bb.range,wb=gb((t=>{t.setTime(t-t.getMilliseconds())}),((t,e)=>{t.setTime(+t+e*lb)}),((t,e)=>(e-t)/lb),(t=>t.getUTCSeconds())),xb=wb.range,kb=gb((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*lb)}),((t,e)=>{t.setTime(+t+e*fb)}),((t,e)=>(e-t)/fb),(t=>t.getMinutes())),Eb=kb.range,Ob=gb((t=>{t.setUTCSeconds(0,0)}),((t,e)=>{t.setTime(+t+e*fb)}),((t,e)=>(e-t)/fb),(t=>t.getUTCMinutes())),Sb=Ob.range,Tb=gb((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*lb-t.getMinutes()*fb)}),((t,e)=>{t.setTime(+t+e*hb)}),((t,e)=>(e-t)/hb),(t=>t.getHours())),Ab=Tb.range,Nb=gb((t=>{t.setUTCMinutes(0,0,0)}),((t,e)=>{t.setTime(+t+e*hb)}),((t,e)=>(e-t)/hb),(t=>t.getUTCHours())),Lb=Nb.range,Mb=gb((t=>t.setHours(0,0,0,0)),((t,e)=>t.setDate(t.getDate()+e)),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*fb)/pb),(t=>t.getDate()-1)),Cb=Mb.range,jb=gb((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/pb),(t=>t.getUTCDate()-1)),Pb=jb.range,Ib=gb((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/pb),(t=>Math.floor(t/pb))),Rb=Ib.range;function Db(t){return gb((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())*fb)/db))}const Bb=Db(0),Fb=Db(1),$b=Db(2),Kb=Db(3),Ub=Db(4),zb=Db(5),qb=Db(6),Vb=Bb.range,Wb=Fb.range,Hb=$b.range,Yb=Kb.range,Gb=Ub.range,Jb=zb.range,Xb=qb.range;function Qb(t){return gb((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)/db))}const Zb=Qb(0),t_=Qb(1),e_=Qb(2),n_=Qb(3),r_=Qb(4),i_=Qb(5),o_=Qb(6),a_=Zb.range,s_=t_.range,u_=e_.range,c_=n_.range,l_=r_.range,f_=i_.range,h_=o_.range,p_=gb((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())),d_=p_.range,m_=gb((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())),y_=m_.range,v_=gb((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()));v_.every=t=>isFinite(t=Math.floor(t))&&t>0?gb((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 g_=v_.range,b_=gb((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()));b_.every=t=>isFinite(t=Math.floor(t))&&t>0?gb((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 __=b_.range;function w_(t,e,n,r,i,o){const a=[[wb,1,lb],[wb,5,5e3],[wb,15,15e3],[wb,30,3e4],[o,1,fb],[o,5,3e5],[o,15,9e5],[o,30,18e5],[i,1,hb],[i,3,108e5],[i,6,216e5],[i,12,432e5],[r,1,pb],[r,2,1728e5],[n,1,db],[e,1,2592e6],[e,3,7776e6],[t,1,mb]];function s(e,n,r){const i=Math.abs(n-e)/r,o=H((([,,t])=>t)).right(a,i);if(o===a.length)return t.every(Qt(e/mb,n/mb,r));if(0===o)return bb.every(Math.max(Qt(e,n,r),1));const[s,u]=a[i/a[o-1][2]=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:Jw,s:Xw,S:vw,u:gw,U:bw,V:ww,w:xw,W:kw,x:null,X:null,y:Ew,Y:Sw,Z:Aw,"%":Gw},_={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:Nw,e:Nw,f:Pw,g:Vw,G:Hw,H:Lw,I:Mw,j:Cw,L:jw,m:Iw,M:Rw,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:Jw,s:Xw,S:Dw,u:Bw,U:Fw,V:Kw,w:Uw,W:zw,x:null,X:null,y:qw,Y:Ww,Z:Yw,"%":Gw},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=v.exec(e.slice(n));return r?(t.m=g.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 E(t,e,n,r)},d:Z_,e:Z_,f:ow,g:G_,G:Y_,H:ew,I:ew,j:tw,L:iw,m:Q_,M:nw,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:X_,Q:sw,s:uw,S:rw,u:q_,U:V_,V:W_,w:z_,W:H_,x:function(t,e,r){return E(t,n,e,r)},X:function(t,e,n){return E(t,r,e,n)},y:G_,Y:Y_,Z:J_,"%":aw};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=T_(A_(o.y,0,1))).getUTCDay(),r=i>4||0===i?t_.ceil(r):t_(r),r=jb.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=S_(A_(o.y,0,1))).getDay(),r=i>4||0===i?Fb.ceil(r):Fb(r),r=Mb.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?T_(A_(o.y,0,1)).getUTCDay():S_(A_(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,T_(o)):S_(o)}}function E(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 I_?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 L_,M_,C_,j_,P_,I_={"-":"",_:" ",0:"0"},R_=/^\s*\d+/,D_=/^%/,B_=/[\\^$*+?|[\]().{}]/g;function F_(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o[t.toLowerCase(),e])))}function z_(t,e,n){var r=R_.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function q_(t,e,n){var r=R_.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function V_(t,e,n){var r=R_.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function W_(t,e,n){var r=R_.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function H_(t,e,n){var r=R_.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function Y_(t,e,n){var r=R_.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function G_(t,e,n){var r=R_.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function J_(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 X_(t,e,n){var r=R_.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function Q_(t,e,n){var r=R_.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Z_(t,e,n){var r=R_.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function tw(t,e,n){var r=R_.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function ew(t,e,n){var r=R_.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function nw(t,e,n){var r=R_.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function rw(t,e,n){var r=R_.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function iw(t,e,n){var r=R_.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function ow(t,e,n){var r=R_.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function aw(t,e,n){var r=D_.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function sw(t,e,n){var r=R_.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function uw(t,e,n){var r=R_.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function cw(t,e){return F_(t.getDate(),e,2)}function lw(t,e){return F_(t.getHours(),e,2)}function fw(t,e){return F_(t.getHours()%12||12,e,2)}function hw(t,e){return F_(1+Mb.count(v_(t),t),e,3)}function pw(t,e){return F_(t.getMilliseconds(),e,3)}function dw(t,e){return pw(t,e)+"000"}function mw(t,e){return F_(t.getMonth()+1,e,2)}function yw(t,e){return F_(t.getMinutes(),e,2)}function vw(t,e){return F_(t.getSeconds(),e,2)}function gw(t){var e=t.getDay();return 0===e?7:e}function bw(t,e){return F_(Bb.count(v_(t)-1,t),e,2)}function _w(t){var e=t.getDay();return e>=4||0===e?Ub(t):Ub.ceil(t)}function ww(t,e){return t=_w(t),F_(Ub.count(v_(t),t)+(4===v_(t).getDay()),e,2)}function xw(t){return t.getDay()}function kw(t,e){return F_(Fb.count(v_(t)-1,t),e,2)}function Ew(t,e){return F_(t.getFullYear()%100,e,2)}function Ow(t,e){return F_((t=_w(t)).getFullYear()%100,e,2)}function Sw(t,e){return F_(t.getFullYear()%1e4,e,4)}function Tw(t,e){var n=t.getDay();return F_((t=n>=4||0===n?Ub(t):Ub.ceil(t)).getFullYear()%1e4,e,4)}function Aw(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+F_(e/60|0,"0",2)+F_(e%60,"0",2)}function Nw(t,e){return F_(t.getUTCDate(),e,2)}function Lw(t,e){return F_(t.getUTCHours(),e,2)}function Mw(t,e){return F_(t.getUTCHours()%12||12,e,2)}function Cw(t,e){return F_(1+jb.count(b_(t),t),e,3)}function jw(t,e){return F_(t.getUTCMilliseconds(),e,3)}function Pw(t,e){return jw(t,e)+"000"}function Iw(t,e){return F_(t.getUTCMonth()+1,e,2)}function Rw(t,e){return F_(t.getUTCMinutes(),e,2)}function Dw(t,e){return F_(t.getUTCSeconds(),e,2)}function Bw(t){var e=t.getUTCDay();return 0===e?7:e}function Fw(t,e){return F_(Zb.count(b_(t)-1,t),e,2)}function $w(t){var e=t.getUTCDay();return e>=4||0===e?r_(t):r_.ceil(t)}function Kw(t,e){return t=$w(t),F_(r_.count(b_(t),t)+(4===b_(t).getUTCDay()),e,2)}function Uw(t){return t.getUTCDay()}function zw(t,e){return F_(t_.count(b_(t)-1,t),e,2)}function qw(t,e){return F_(t.getUTCFullYear()%100,e,2)}function Vw(t,e){return F_((t=$w(t)).getUTCFullYear()%100,e,2)}function Ww(t,e){return F_(t.getUTCFullYear()%1e4,e,4)}function Hw(t,e){var n=t.getUTCDay();return F_((t=n>=4||0===n?r_(t):r_.ceil(t)).getUTCFullYear()%1e4,e,4)}function Yw(){return"+0000"}function Gw(){return"%"}function Jw(t){return+t}function Xw(t){return Math.floor(+t/1e3)}function Qw(t){return L_=N_(t),M_=L_.format,C_=L_.parse,j_=L_.utcFormat,P_=L_.utcParse,L_}function Zw(t){return new Date(t)}function tx(t){return t instanceof Date?+t:+new Date(+t)}function ex(t,e,n,r,i,o,a,s,u,c){var l=Ig(),f=l.invert,h=l.domain,p=c(".%L"),d=c(":%S"),m=c("%I:%M"),y=c("%I %p"),v=c("%a %d"),g=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)=>ce(t,r/e)))},n.copy=function(){return fx(e).domain(t)},wg.apply(n,arguments)}function hx(){var t,e,n,r,i,o,a,s=0,u=.5,c=1,l=1,f=Ng,h=!1;function p(t){return isNaN(t=+t)?a:(t=.5+((t=+o(t))-e)*(l*tTi(t[t.length-1]);var Lx=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(gx);const Mx=Nx(Lx);var Cx=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(gx);const jx=Nx(Cx);var Px=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(gx);const Ix=Nx(Px);var Rx=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(gx);const Dx=Nx(Rx);var Bx=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(gx);const Fx=Nx(Bx);var $x=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(gx);const Kx=Nx($x);var Ux=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(gx);const zx=Nx(Ux);var qx=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(gx);const Vx=Nx(qx);var Wx=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(gx);const Hx=Nx(Wx);var Yx=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(gx);const Gx=Nx(Yx);var Jx=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(gx);const Xx=Nx(Jx);var Qx=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(gx);const Zx=Nx(Qx);var tk=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(gx);const ek=Nx(tk);var nk=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(gx);const rk=Nx(nk);var ik=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(gx);const ok=Nx(ik);var ak=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(gx);const sk=Nx(ak);var uk=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(gx);const ck=Nx(uk);var lk=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(gx);const fk=Nx(lk);var hk=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(gx);const pk=Nx(hk);var dk=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(gx);const mk=Nx(dk);var yk=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(gx);const vk=Nx(yk);var gk=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(gx);const bk=Nx(gk);var _k=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(gx);const wk=Nx(_k);var xk=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(gx);const kk=Nx(xk);var Ek=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(gx);const Ok=Nx(Ek);var Sk=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(gx);const Tk=Nx(Sk);var Ak=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(gx);const Nk=Nx(Ak);function Lk(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 Mk=Kv(qs(300,.5,0),qs(-240,.5,1));var Ck=Kv(qs(-100,.75,.35),qs(80,1.5,.8)),jk=Kv(qs(260,.75,.35),qs(80,1.5,.8)),Pk=qs();function Ik(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return Pk.h=360*t-100,Pk.s=1.5-1.5*e,Pk.l=.8-.9*e,Pk+""}var Rk=ii(),Dk=Math.PI/3,Bk=2*Math.PI/3;function Fk(t){var e;return t=(.5-t)*Math.PI,Rk.r=255*(e=Math.sin(t))*e,Rk.g=255*(e=Math.sin(t+Dk))*e,Rk.b=255*(e=Math.sin(t+Bk))*e,Rk+""}function $k(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 Kk(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}const Uk=Kk(gx("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var zk=Kk(gx("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),qk=Kk(gx("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),Vk=Kk(gx("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function Wk(t){return Nr(mr(t).call(document.documentElement))}var Hk=0;function Yk(){return new Gk}function Gk(){this._="@"+(++Hk).toString(36)}function Jk(t,e){return t.target&&(t=$i(t),void 0===e&&(e=t.currentTarget),t=t.touches||[t]),Array.from(t,(t=>Ki(t,e)))}function Xk(t){return"string"==typeof t?new Sr([document.querySelectorAll(t)],[document.documentElement]):new Sr([gn(t)],Or)}function Qk(t){return function(){return t}}Gk.prototype=Yk.prototype={constructor:Gk,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 Zk=Math.abs,tE=Math.atan2,eE=Math.cos,nE=Math.max,rE=Math.min,iE=Math.sin,oE=Math.sqrt,aE=1e-12,sE=Math.PI,uE=sE/2,cE=2*sE;function lE(t){return t>=1?uE:t<=-1?-uE:Math.asin(t)}function fE(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 Za(e)}function hE(t){return t.innerRadius}function pE(t){return t.outerRadius}function dE(t){return t.startAngle}function mE(t){return t.endAngle}function yE(t){return t&&t.padAngle}function vE(t,e,n,r,i,o,a){var s=t-n,u=e-r,c=(a?o:-o)/oE(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,v=(p+m)/2,g=d-h,b=m-p,_=g*g+b*b,w=i-o,x=h*m-d*p,k=(b<0?-1:1)*oE(nE(0,w*w*_-x*x)),E=(x*b-g*k)/_,O=(-x*g-b*k)/_,S=(x*b+g*k)/_,T=(-x*g+b*k)/_,A=E-y,N=O-v,L=S-y,M=T-v;return A*A+N*N>L*L+M*M&&(E=S,O=T),{cx:E,cy:O,x01:-l,y01:-f,x11:E*(i/w-1),y11:O*(i/w-1)}}function gE(){var t=hE,e=pE,n=Qk(0),r=null,i=dE,o=mE,a=yE,s=null,u=fE(c);function c(){var c,l,f,h=+t.apply(this,arguments),p=+e.apply(this,arguments),d=i.apply(this,arguments)-uE,m=o.apply(this,arguments)-uE,y=Zk(m-d),v=m>d;if(s||(s=c=u()),paE)if(y>cE-aE)s.moveTo(p*eE(d),p*iE(d)),s.arc(0,0,p,d,m,!v),h>aE&&(s.moveTo(h*eE(m),h*iE(m)),s.arc(0,0,h,m,d,v));else{var g,b,_=d,w=m,x=d,k=m,E=y,O=y,S=a.apply(this,arguments)/2,T=S>aE&&(r?+r.apply(this,arguments):oE(h*h+p*p)),A=rE(Zk(p-h)/2,+n.apply(this,arguments)),N=A,L=A;if(T>aE){var M=lE(T/h*iE(S)),C=lE(T/p*iE(S));(E-=2*M)>aE?(x+=M*=v?1:-1,k-=M):(E=0,x=k=(d+m)/2),(O-=2*C)>aE?(_+=C*=v?1:-1,w-=C):(O=0,_=w=(d+m)/2)}var j=p*eE(_),P=p*iE(_),I=h*eE(k),R=h*iE(k);if(A>aE){var D,B=p*eE(w),F=p*iE(w),$=h*eE(x),K=h*iE(x);if(y1?0:f<-1?sE:Math.acos(f))/2),H=oE(D[0]*D[0]+D[1]*D[1]);N=rE(A,(h-H)/(W-1)),L=rE(A,(p-H)/(W+1))}else N=L=0}O>aE?L>aE?(g=vE($,K,j,P,p,L,v),b=vE(B,F,I,R,p,L,v),s.moveTo(g.cx+g.x01,g.cy+g.y01),LaE&&E>aE?N>aE?(g=vE(I,R,B,F,h,-N,v),b=vE(j,P,$,K,h,-N,v),s.lineTo(g.cx+g.x01,g.cy+g.y01),N=f;--h)s.point(v[h],g[h]);s.lineEnd(),s.areaEnd()}y&&(v[l]=+t(p,l,c),g[l]=+e(p,l,c),s.point(r?+r(p,l,c):v[l],n?+n(p,l,c):g[l]))}if(d)return s=null,d+""||null}function l(){return OE().defined(i).curve(a).context(o)}return t="function"==typeof t?t:void 0===t?kE:Qk(+t),e="function"==typeof e?e:Qk(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?EE:Qk(+n),c.x=function(e){return arguments.length?(t="function"==typeof e?e:Qk(+e),r=null,c):t},c.x0=function(e){return arguments.length?(t="function"==typeof e?e:Qk(+e),c):t},c.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:Qk(+t),c):r},c.y=function(t){return arguments.length?(e="function"==typeof t?t:Qk(+t),n=null,c):e},c.y0=function(t){return arguments.length?(e="function"==typeof t?t:Qk(+t),c):e},c.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:Qk(+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:Qk(!!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 TE(t,e){return et?1:e>=t?0:NaN}function AE(t){return t}function NE(){var t=AE,e=TE,n=null,r=Qk(0),i=Qk(cE),o=Qk(0);function a(a){var s,u,c,l,f,h=(a=_E(a)).length,p=0,d=new Array(h),m=new Array(h),y=+r.apply(this,arguments),v=Math.min(cE,Math.max(-cE,i.apply(this,arguments)-y)),g=Math.min(Math.abs(v)/h,o.apply(this,arguments)),b=g*(v<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?(v-h*b)/p:0;s0?f*c:0)+b,m[u]={data:a[u],index:s,value:f,startAngle:y,endAngle:l,padAngle:g};return m}return a.value=function(e){return arguments.length?(t="function"==typeof e?e:Qk(+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:Qk(+t),a):r},a.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:Qk(+t),a):i},a.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:Qk(+t),a):o},a}wE.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 LE=CE(xE);function ME(t){this._curve=t}function CE(t){function e(e){return new ME(t(e))}return e._curve=t,e}function jE(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(CE(t)):e()._curve},t}function PE(){return jE(OE().curve(LE))}function IE(){var t=SE().curve(LE),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 jE(n())},delete t.lineX0,t.lineEndAngle=function(){return jE(r())},delete t.lineX1,t.lineInnerRadius=function(){return jE(i())},delete t.lineY0,t.lineOuterRadius=function(){return jE(o())},delete t.lineY1,t.curve=function(t){return arguments.length?e(CE(t)):e()._curve},t}function RE(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}ME.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 DE{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 BE{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=RE(this._x0,this._y0),r=RE(this._x0,this._y0=(this._y0+e)/2),i=RE(t,this._y0),o=RE(t,e);this._context.moveTo(...n),this._context.bezierCurveTo(...r,...i,...o)}this._x0=t,this._y0=e}}function FE(t){return new DE(t,!0)}function $E(t){return new DE(t,!1)}function KE(t){return new BE(t)}function UE(t){return t.source}function zE(t){return t.target}function qE(t){let e=UE,n=zE,r=kE,i=EE,o=null,a=null,s=fE(u);function u(){let u;const c=bE.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:Qk(+t),u):r},u.y=function(t){return arguments.length?(i="function"==typeof t?t:Qk(+t),u):i},u.context=function(e){return arguments.length?(null==e?o=a=null:a=t(o=e),u):o},u}function VE(){return qE(FE)}function WE(){return qE($E)}function HE(){const t=qE(KE);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t}const YE=oE(3),GE={draw(t,e){const n=.59436*oE(e+rE(e/28,.75)),r=n/2,i=r*YE;t.moveTo(0,n),t.lineTo(0,-n),t.moveTo(-i,-r),t.lineTo(i,r),t.moveTo(-i,r),t.lineTo(i,-r)}},JE={draw(t,e){const n=oE(e/sE);t.moveTo(n,0),t.arc(0,0,n,0,cE)}},XE={draw(t,e){const n=oE(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()}},QE=oE(1/3),ZE=2*QE,tO={draw(t,e){const n=oE(e/ZE),r=n*QE;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},eO={draw(t,e){const n=.62625*oE(e);t.moveTo(0,-n),t.lineTo(n,0),t.lineTo(0,n),t.lineTo(-n,0),t.closePath()}},nO={draw(t,e){const n=.87559*oE(e-rE(e/7,2));t.moveTo(-n,0),t.lineTo(n,0),t.moveTo(0,n),t.lineTo(0,-n)}},rO={draw(t,e){const n=oE(e),r=-n/2;t.rect(r,r,n,n)}},iO={draw(t,e){const n=.4431*oE(e);t.moveTo(n,n),t.lineTo(n,-n),t.lineTo(-n,-n),t.lineTo(-n,n),t.closePath()}},oO=iE(sE/10)/iE(7*sE/10),aO=iE(cE/10)*oO,sO=-eE(cE/10)*oO,uO={draw(t,e){const n=oE(.8908130915292852*e),r=aO*n,i=sO*n;t.moveTo(0,-n),t.lineTo(r,i);for(let e=1;e<5;++e){const o=cE*e/5,a=eE(o),s=iE(o);t.lineTo(s*n,-a*n),t.lineTo(a*r-s*i,s*r+a*i)}t.closePath()}},cO=oE(3),lO={draw(t,e){const n=-oE(e/(3*cO));t.moveTo(0,2*n),t.lineTo(-cO*n,-n),t.lineTo(cO*n,-n),t.closePath()}},fO=oE(3),hO={draw(t,e){const n=.6824*oE(e),r=n/2,i=n*fO/2;t.moveTo(0,-n),t.lineTo(i,r),t.lineTo(-i,r),t.closePath()}},pO=-.5,dO=oE(3)/2,mO=1/oE(12),yO=3*(mO/2+1),vO={draw(t,e){const n=oE(e/yO),r=n/2,i=n*mO,o=r,a=n*mO+n,s=-o,u=a;t.moveTo(r,i),t.lineTo(o,a),t.lineTo(s,u),t.lineTo(pO*r-dO*i,dO*r+pO*i),t.lineTo(pO*o-dO*a,dO*o+pO*a),t.lineTo(pO*s-dO*u,dO*s+pO*u),t.lineTo(pO*r+dO*i,pO*i-dO*r),t.lineTo(pO*o+dO*a,pO*a-dO*o),t.lineTo(pO*s+dO*u,pO*u-dO*s),t.closePath()}},gO={draw(t,e){const n=.6189*oE(e-rE(e/6,1.7));t.moveTo(-n,-n),t.lineTo(n,n),t.moveTo(-n,n),t.lineTo(n,-n)}},bO=[JE,XE,tO,rO,uO,lO,vO],_O=[JE,nO,gO,hO,GE,iO,eO];function wO(t,e){let n=null,r=fE(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:Qk(t||JE),e="function"==typeof e?e:Qk(void 0===e?64:+e),i.type=function(e){return arguments.length?(t="function"==typeof e?e:Qk(e),i):t},i.size=function(t){return arguments.length?(e="function"==typeof t?t:Qk(+t),i):e},i.context=function(t){return arguments.length?(n=null==t?null:t,i):n},i}function xO(){}function kO(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 EO(t){this._context=t}function OO(t){return new EO(t)}function SO(t){this._context=t}function TO(t){return new SO(t)}function AO(t){this._context=t}function NO(t){return new AO(t)}function LO(t,e){this._basis=new EO(t),this._beta=e}EO.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:kO(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:kO(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},SO.prototype={areaStart:xO,areaEnd:xO,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:kO(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},AO.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:kO(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},LO.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 MO=function t(e){function n(t){return 1===e?new EO(t):new LO(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function CO(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 jO(t,e){this._context=t,this._k=(1-e)/6}jO.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:CO(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:CO(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 PO=function t(e){function n(t){return new jO(t,e)}return n.tension=function(e){return t(+e)},n}(0);function IO(t,e){this._context=t,this._k=(1-e)/6}IO.prototype={areaStart:xO,areaEnd:xO,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:CO(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 RO=function t(e){function n(t){return new IO(t,e)}return n.tension=function(e){return t(+e)},n}(0);function DO(t,e){this._context=t,this._k=(1-e)/6}DO.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:CO(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 BO=function t(e){function n(t){return new DO(t,e)}return n.tension=function(e){return t(+e)},n}(0);function FO(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>aE){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>aE){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 $O(t,e){this._context=t,this._alpha=e}$O.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:FO(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 KO=function t(e){function n(t){return e?new $O(t,e):new jO(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function UO(t,e){this._context=t,this._alpha=e}UO.prototype={areaStart:xO,areaEnd:xO,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:FO(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 zO=function t(e){function n(t){return e?new UO(t,e):new IO(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function qO(t,e){this._context=t,this._alpha=e}qO.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:FO(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 VO=function t(e){function n(t){return e?new qO(t,e):new DO(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function WO(t){this._context=t}function HO(t){return new WO(t)}function YO(t){return t<0?-1:1}function GO(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(YO(o)+YO(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function JO(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function XO(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 QO(t){this._context=t}function ZO(t){this._context=new tS(t)}function tS(t){this._context=t}function eS(t){return new QO(t)}function nS(t){return new ZO(t)}function rS(t){this._context=t}function iS(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 hS(t,e){return t[e]}function pS(t){const e=[];return e.key=t,e}function dS(){var t=Qk([]),e=fS,n=lS,r=hS;function i(i){var o,a,s=Array.from(t.apply(this,arguments),pS),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 vS(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 wS(t){var e=t.map(xS);return fS(t).sort((function(t,n){return e[t]-e[n]}))}function xS(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 SS="%Y-%m-%dT%H:%M:%S.%LZ",TS=Date.prototype.toISOString?function(t){return t.toISOString()}:j_(SS);const AS=TS;var NS=+new Date("2000-01-01T00:00:00.000Z")?function(t){var e=new Date(t);return isNaN(e)?null:e}:P_(SS);const LS=NS;function MS(t,e,n){var r=new eo,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?Zi():+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 CS=t=>()=>t;function jS(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 PS(t,e,n){this.k=t,this.x=e,this.y=n}PS.prototype={constructor:PS,scale:function(t){return 1===t?this:new PS(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new PS(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 IS=new PS(1,0,0);function RS(t){for(;!t.__zoom;)if(!(t=t.parentNode))return IS;return t.__zoom}function DS(t){t.stopImmediatePropagation()}function BS(t){t.preventDefault(),t.stopImmediatePropagation()}function FS(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function $S(){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 KS(){return this.__zoom||IS}function US(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function zS(){return navigator.maxTouchPoints||"ontouchstart"in this}function qS(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 VS(){var t,e,n,r=FS,i=$S,o=qS,a=US,s=zS,u=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],l=250,f=Mv,h=mn("start","zoom","end"),p=500,d=150,m=0,y=10;function v(t){t.property("__zoom",KS).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",O).on("dblclick.zoom",S).filter(s).on("touchstart.zoom",T).on("touchmove.zoom",A).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(t,e){return(e=Math.max(u[0],Math.min(u[1],e)))===t.k?t:new PS(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 PS(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 PS(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 E(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=Ki(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)],wo(this),n.start()}BS(t),n.wheel=setTimeout((function(){n.wheel=null,n.end()}),d),n.zoom("mouse",o(b(g(i,s),n.mouse[0],n.mouse[1]),n.extent,c))}}function O(t,...e){if(!n&&r.apply(this,arguments)){var i=t.currentTarget,a=x(this,e,!0).event(t),s=Nr(t.view).on("mousemove.zoom",(function(t){if(BS(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]=Ki(t,i),a.mouse[1]),a.extent,c))}),!0).on("mouseup.zoom",(function(t){s.on("mousemove.zoom mouseup.zoom",null),Ir(t.view,a.moved),BS(t),a.event(t).end()}),!0),u=Ki(t,i),l=t.clientX,f=t.clientY;Pr(t.view),DS(t),a.mouse=[u,this.__zoom.invert(u)],wo(this),a.start()}}function S(t,...e){if(r.apply(this,arguments)){var n=this.__zoom,a=Ki(t.changedTouches?t.changedTouches[0]:t,this),s=n.invert(a),u=n.k*(t.shiftKey?.5:2),f=o(b(g(n,u),a,s),i.apply(this,e),c);BS(t),l>0?Nr(this).transition().duration(l).call(w,f,a,t):Nr(this).call(v.transform,f,a,t)}}function T(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(DS(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&&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:M(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},e}function nN(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 rN(t){var e=function(t,e){if("object"!=GA(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=GA(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==GA(e)?e:e+""}var iN=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 YA(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 jA(this.pluginData,this.viewport,t)}},{key:"initLinkRenderer",value:function(t){return new DA(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 vA(this.pluginData,this.viewport,this.layout),this.actions.deleteAction=new rT(this.pluginData,this.viewport,this.layout),this.actions.dragScene=new bT(this.pluginData,this.viewport,this.layout),this.actions.menuAction=new IT(this.pluginData,this.viewport,this.layout),this.actions.link=new TT(this.pluginData,this.viewport,this.layout),this.actions.zoom=new OA(this.pluginData,this.viewport,this.layout),this.actions.dragComponent=new fT(this.pluginData,this.viewport,this.layout),this.actions.resizeComponent=new zT(this.pluginData,this.viewport,this.layout),this.actions.toggleSelection=new ZT(this.pluginData,this.viewport,this.layout),this.actions.deselectionAll=new sA(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=eN().mark((function e(n){var r,i,o,a,s,u,c;return eN().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){nN(o,r,i,a,s,"next",t)}function s(t){nN(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(ZA({id:"scene",name:"",children:JA(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(){return this.viewport.selectAll(".scene > g").attr("transform",""),document.querySelector("#view-port .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 h(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 q({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]:"Error happened when trying to parse.",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"Error";return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,n){return e=xN(e),function(t,e){if(e&&("object"==gN(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,_N()?Reflect.construct(e,n||[],xN(t).constructor):e.apply(t,n))}(this,e,[n||"Error happened when trying to parse."])).name="ParseError",t.startLine=r||0,t.startColumn=i||0,t.endLine=o||0,t.endColumn=a||0,t.severity=s||"Error",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&&wN(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(bN(Error));const EN=kN;var ON=function(t,e,n){return Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(){var e=arguments.length>0&&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 TN(t){return TN="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},TN(t)}function AN(t,e,n){return e=LN(e),function(t,e){if(e&&("object"==TN(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,NN()?Reflect.construct(e,n||[],LN(t).constructor):e.apply(t,n))}function NN(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(NN=function(){return!!t})()}function LN(t){return LN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},LN(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}(I);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 IN(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:[]},parseErrors:[],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.parseErrors=d.parseErrors||[],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.25.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 _({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 IN(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 IN(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)?IN(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 I({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:{}};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.editor=qN({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=qN({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)}));const YN=HN;function GN(t){return GN="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},GN(t)}function JN(t){var e=function(t,e){if("object"!=GN(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=GN(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==GN(e)?e:e+""}var XN=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 YN,this.data=e.pluginData||new KN(this.configuration,{},e.event),this.__drawer=e.pluginDrawer||new oN(this.data),this.__metadata=e.pluginMetadata||new cN(this.data),this.__parser=e.pluginParser||new pN(this.data),this.__renderer=e.pluginRenderer||new vN(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();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 tL=ZN;function eL(t){return eL="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},eL(t)}function nL(t,e,n){return e=iL(e),function(t,e){if(e&&("object"==eL(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,rL()?Reflect.construct(e,n||[],iL(t).constructor):e.apply(t,n))}function rL(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(rL=function(){return!!t})()}function iL(t){return iL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},iL(t)}function oL(t,e){return oL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},oL(t,e)}var aL=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=nL(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&&oL(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(l);const sL=aL})();var o=e;for(var a in i)o[a]=i[a];i.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})()},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:c,Root:h,NodeList:f,Value:l,Literal:p,Symbol:d,Group:m,Array:y,Pair:v,Dict:g,Output:K,Capture:U,TemplateData:z,If:_,IfAsync:w,InlineIf:x,For:k,AsyncEach:E,AsyncAll:O,Macro:S,Caller:T,Import:A,FromImport:N,FunCall:L,Filter:M,FilterAsync:C,KeywordArgs:j,Block:P,Super:I,Extends:R,Include:D,Set:B,Switch:F,Case:$,LookupVal:b,BinOp:V,In:W,Is:H,Or:Y,And:G,Not:J,Add:X,Concat:Q,Sub:Z,Mul:tt,Div:et,FloorDiv:nt,Mod:rt,Pow:it,Neg:ot,Pos:at,Compare:st,CompareOperand:ut,CallExtension:ct,CallExtensionAsync:lt,printNodes:function t(e,n){if(n=n||0,ft(e.typename+": ",n),e instanceof f)ft("\n"),e.children.forEach((function(e){t(e,n+2)}));else if(e instanceof ct)ft(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 c?r.push([e,t]):(i=i||{})[e]=t})),i?ft(JSON.stringify(i,null,2)+"\n",null,!0):ft("\n"),r.forEach((function(e){var r=e[0],i=e[1];ft("["+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),v=y.Obj,g=y.EmitterObj,b=n(2),_=b.handleError,w=b.Frame,x=n(22);function k(t,e,n){o((function(){t(e,n)}))}var E={type:"code",obj:{root:function(t,e,n,r,i){try{i(null,"")}catch(t){i(_(t,null,null))}}}},O=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 T)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=","//","**"],D=M+this.current();switch(-1!==r.indexOf(R,D)&&(this.forward(),M=D,-1!==r.indexOf(R,D+this.current())&&(M=D+this.current(),this.forward())),M){case"(":I=d;break;case")":I=m;break;case"[":I=y;break;case"]":I=v;break;case"{":I=g;break;case"}":I=b;break;case",":I=w;break;case":":I=x;break;case"~":I=k;break;case"|":I=E;break;default:I=_}return L(I,M,e,n)}if((t=this._extractUntil(i+o)).match(/^[-+]?[0-9]+$/)){if("."===this.current()){this.forward();var B=this._extract("0123456789");return L(O,t+"."+B,e,n)}return L("int",t,e,n)}if(t.match(/^(true|false)$/))return L(S,t,e,n);if("none"===t)return L(T,t,e,n);if("null"===t)return L(T,t,e,n);if(t)return L(A,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,L(c,t,e,n);if((t=this._extractString(this.tags.VARIABLE_START+"-"))||(t=this._extractString(this.tags.VARIABLE_START)))return this.in_code=!0,L(f,t,e,n);t="";var K=!1;for(this._matches(this.tags.COMMENT_START)&&(K=!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))&&!K){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(!K)throw new Error("unexpected end of comment");t+=this._extractString(this.tags.COMMENT_END);break}t+=this.current(),this.forward()}if(null===F&&K)throw new Error("expected end of comment, got end of file");return L(K?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{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},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:()=>oi});var t=n(916);const e={generic:JSON.parse('{"workflow":{"type":"workflow","category":"workflow","model":"workflow","icon":"DefaultWorkflow","displayName":"Workflow","description":"A workflow is a configurable automated process that will run one or more jobs.

Workflows are defined by a YAML file checked in to your repository and will run when triggered by an event in your repository, or they can be triggered manually, or at a defined schedule.","url":"https://docs.github.com/en/actions/using-workflows/about-workflows","childrenTypes":["push-trigger","pullrequest-trigger","job"],"categories":["GithubAction"],"isContainer":true,"available":true,"attributes":[{"name":"name","type":"String","required":true,"description":"The name of the workflow as it will appear in the \\"Actions\\" tab of the GitHub repository.","url":"https://docs.github.com/en/actions/using-workflows/about-workflows#understanding-the-workflow-file"}],"defaultWidth":96,"defaultHeight":80,"minWidth":96,"minHeight":80,"reservedWidth":12,"reservedHeight":80,"margin":15,"gap":50},"trigger":{"type":"trigger","category":"trigger","model":"trigger","icon":"DefaultTrigger","available":false,"parentTypes":["workflow"],"categories":["GithubAction"],"attributes":[{"name":"workflow_id","displayName":"Id of workflow","type":"Reference","containerRef":"workflow","required":true}],"defaultWidth":96,"defaultHeight":80,"minWidth":96,"minHeight":80,"reservedWidth":0,"reservedHeight":0,"margin":15,"gap":50},"job":{"type":"job","category":"job","model":"job","displayName":"Job","description":"A workflow run is made up of one or more jobs, which run in parallel by default.","url":"https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow","icon":"DefaultJob","available":true,"parentTypes":["workflow"],"childrenTypes":["command-step","reusable-step"],"categories":["GithubAction"],"isContainer":true,"displayType":"workflow","workflowDirection":"horizontal","linkModel":"defaultLink","attributes":[{"name":"workflow_id","displayName":"Id of workflow","type":"Reference","containerRef":"workflow","required":true},{"name":"name","type":"String","description":"The name of the job as it will appear in the \\"Actions\\" tab of the GitHub repository.","url":"https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow#setting-a-name-for-a-job"},{"name":"runs-on","type":"String","displayName":"Type of runner","description":"The type of machine to run the job on.","url":"https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on"},{"name":"needs","displayName":"Previous job(s)","description":"Identify any jobs that must complete successfully before this job will run","url":"https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow#defining-prerequisite-jobs","type":"Link","linkType":"Reverse","linkRef":"job","linkModel":"defaultLink"}],"defaultWidth":96,"defaultHeight":80,"minWidth":140,"minHeight":200,"reservedWidth":12,"reservedHeight":80,"margin":15,"gap":50},"step":{"type":"step","category":"step","model":"step","icon":"DefaultStep","available":false,"parentTypes":["job"],"categories":["GithubAction"],"description":"Task of the job. Step can run commands, run setup tasks, or run an action in your repository, a public repository, or an action published in a Docker registry.","url":"https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idsteps","attributes":[{"name":"job_id","displayName":"Id of job","type":"Reference","containerRef":"job","required":true},{"name":"name","type":"String","description":"The name of the step as it will appear in the \\"Actions\\" tab of the GitHub repository.","url":"https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow#setting-a-name-for-a-job"},{"name":"env","type":"Object","displayName":"Environment variables","description":"Variables for steps to use in the runner environment.","url":"https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsenv"}],"defaultWidth":96,"defaultHeight":80,"minWidth":96,"minHeight":80,"reservedWidth":0,"reservedHeight":0,"margin":15,"gap":50}}'),trigger:JSON.parse('[{"type":"push-trigger","category":"trigger","icon":"PushTrigger","displayName":"Trigger - push","description":"Workflow trigger is an event that causes a workflow to run.

This event will trigger the workflow on a push event.","url":"https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push","action":"push","attributes":[{"name":"branches","type":"Array","description":"Select branch name on push event.","url":"https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#running-your-workflow-only-when-a-push-to-specific-branches-occurs"}]},{"type":"pullrequest-trigger","category":"trigger","icon":"PullRequestTrigger","displayName":"Trigger - pull request","description":"Workflow trigger is an event that causes a workflow to run.

This event will trigger the workflow on a pull request event.","action":"pull_request","attributes":[{"name":"types","type":"Array","displayName":"Activity types","description":"Run your workflow when an activity on a pull request occurs in the workflow\'s repository.","url":"https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request"}]}]'),step:JSON.parse('[{"type":"command-step","category":"step","displayName":"Command step","icon":"CommandStep","name":"command-step","attributes":[{"name":"run","type":"String","required":true}]},{"type":"reusable-step","category":"step","displayName":"Reusable step","icon":"ReusableStep","name":"reusable-step","attributes":[{"name":"uses","type":"String","required":true,"displayName":"External action","description":"Select an action to run as part of a step in your job. An action is a reusable unit of code. You can use an action defined in the same repository as the workflow, a public repository, or in a published Docker container image.","url":"https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsuses"},{"name":"with","type":"Object","displayName":"Input parameters","description":"Input parameters of the action defined by \\"uses\\" keyword.","url":"https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepswith"}]}]')};function i(t){return i="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},i(t)}function o(t,e,n){return e=s(e),function(t,e){if(e&&("object"==i(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,a()?Reflect.construct(e,n||[],s(t).constructor):e.apply(t,n))}function a(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(a=function(){return!!t})()}function s(t){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},s(t)}function u(t,e){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},u(t,e)}const c=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{available:!1,category:null};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=o(this,e,[n])).available=!!n.available,t.category=n.category||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&&u(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(t.ComponentDefinition);function l(t){return l="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},l(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 h(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{action:null};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=m(this,e,[h(h({},n),{},{category:"trigger"})])).action=n.action||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&&g(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(c);function _(t){return _="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)}function w(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 x(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=Array(e);n!!t&&"object"==typeof t&&t[z]===D,V=t=>!!t&&"object"==typeof t&&t[z]===B,W=t=>!!t&&"object"==typeof t&&t[z]===F,H=t=>!!t&&"object"==typeof t&&t[z]===$,Y=t=>!!t&&"object"==typeof t&&t[z]===K,G=t=>!!t&&"object"==typeof t&&t[z]===U;function J(t){if(t&&"object"==typeof t)switch(t[z]){case F:case U:return!0}return!1}function X(t){if(t&&"object"==typeof t)switch(t[z]){case D:case F:case K:case U:return!0}return!1}const Q=t=>(Y(t)||J(t))&&!!t.anchor,Z=Symbol("break visit"),tt=Symbol("skip children"),et=Symbol("remove node");function nt(t,e){const n=at(e);V(t)?rt(null,t.contents,n,Object.freeze([t]))===et&&(t.contents=null):rt(null,t,n,Object.freeze([]))}function rt(t,e,n,r){const i=st(t,e,n,r);if(X(i)||H(i))return ut(t,r,i),rt(t,i,n,r);if("symbol"!=typeof i)if(J(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=>ct[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&&X(t.contents)){const e={};nt(t.contents,((t,n)=>{X(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 ft(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 ht(t){const e=new Set;return nt(t,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function pt(t,e){for(let n=1;;++n){const r=`${t}${n}`;if(!e.has(r))return r}}function dt(t,e,n,r){if(r&&"object"==typeof r)if(Array.isArray(r))for(let e=0,n=r.length;emt(t,String(e),n)));if(t&&"function"==typeof t.toJSON){if(!n||!Q(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)}lt.defaultYaml={explicit:!1,version:"1.2"},lt.defaultTags={"!!":"tag:yaml.org,2002:"};class yt{constructor(t){Object.defineProperty(this,z,{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(!V(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=mt(this,"",o);if("function"==typeof r)for(const{count:t,res:e}of o.anchors.values())r(e,t);return"function"==typeof i?dt(i,{"":a},"",a):a}}class vt extends yt{constructor(t){super(D),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t){let e;return nt(t,{Node:(t,n)=>{if(n===this)return nt.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||(mt(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=gt(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(ft(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 gt(t,e,n){if(q(e)){const r=e.resolve(t),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(J(e)){let r=0;for(const i of e.items){const e=gt(t,i,n);e>r&&(r=e)}return r}if(H(e)){const r=gt(t,e.key,n),i=gt(t,e.value,n);return Math.max(r,i)}return 1}const bt=t=>!t||"function"!=typeof t&&"object"!=typeof t;class _t extends yt{constructor(t){super(K),this.value=t}toJSON(t,e){return e?.keep?this.value:mt(this.value,t,e)}toString(){return String(this.value)}}_t.BLOCK_FOLDED="BLOCK_FOLDED",_t.BLOCK_LITERAL="BLOCK_LITERAL",_t.PLAIN="PLAIN",_t.QUOTE_DOUBLE="QUOTE_DOUBLE",_t.QUOTE_SINGLE="QUOTE_SINGLE";const wt="tag:yaml.org,2002:";function xt(t,e,n){if(V(t)&&(t=t.contents),X(t))return t;if(H(t)){const e=n.schema[F].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 vt(u.anchor);u={anchor:null,node:null},s.set(t,u)}e?.startsWith("!!")&&(e=wt+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 _t(t);return u&&(u.node=e),e}c=t instanceof Map?a[F]:Symbol.iterator in Object(t)?a[U]:a[F]}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 _t(t);return e?l.tag=e:c.default||(l.tag=c.tag),u&&(u.node=l),l}function kt(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 xt(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 Et=t=>null==t||"object"==typeof t&&!!t[Symbol.iterator]().next().done;class Ot extends yt{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=>X(e)||H(e)?e.clone(t):e)),this.range&&(e.range=this.range.slice()),e}addIn(t,e){if(Et(t))this.add(e);else{const[n,...r]=t,i=this.get(n,!0);if(J(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,kt(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(J(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&&Y(i)?i.value:i:J(i)?i.getIn(r,e):void 0}hasAllNullValues(t){return this.items.every((e=>{if(!H(e))return!1;const n=e.value;return null==n||t&&Y(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!!J(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(J(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,kt(this.schema,r,e))}}}}Ot.maxFlowStringSingleLineLength=60;const St=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function Tt(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}const At=(t,e,n)=>t.endsWith("\n")?Tt(n,e):n.includes("\n")?"\n"+Tt(n,e):(t.endsWith(" ")?"":" ")+n,Nt="flow",Lt="block",Mt="quoted";function Ct(t,e,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:o=20,onFold:a,onOverflow:s}={}){if(!i||i<0)return t;const u=Math.max(1+o,1+i-e.length);if(t.length<=u)return t;const c=[],l={};let f,h,p=i-e.length;"number"==typeof r&&(r>i-Math.max(2,o)?c.push(0):p=i-r);let d=!1,m=-1,y=-1,v=-1;n===Lt&&(m=jt(t,m,e.length),-1!==m&&(p=m+u));for(let r;r=t[m+=1];){if(n===Mt&&"\\"===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}v=m}if("\n"===r)n===Lt&&(m=jt(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===Mt){for(;" "===h||"\t"===h;)h=r,r=t[m+=1],d=!0;const e=m>v+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 g=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}),It=t=>/^(%|---|\.\.\.)/m.test(t);function Rt(t,e){const n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=e,i=e.options.doubleQuotedMinMultiLineLength,o=e.indent||(It(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(Ft,`$&${c}`));let m,y=!1,v=-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}${g}${n=n.replace(/\n+/g,`$&${c}`)}${p}`:`${b}\n${c}${Ct(`${g}${n=n.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`)}${p}`,c,Lt,Pt(r,!0))}`}function Kt(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!==_t.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(s=_t.QUOTE_DOUBLE);const u=t=>{switch(t){case _t.BLOCK_FOLDED:case _t.BLOCK_LITERAL:return i||o?Bt(a.value,e):$t(a,e,n,r);case _t.QUOTE_DOUBLE:return Rt(a.value,e);case _t.QUOTE_SINGLE:return Dt(a.value,e);case _t.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 Bt(o,e);if(!o||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return s||l||!o.includes("\n")?Bt(o,e):$t(t,e,n,r);if(!s&&!l&&i!==_t.PLAIN&&o.includes("\n"))return $t(t,e,n,r);if(It(o)){if(""===u)return e.forceBlockIndent=!0,$t(t,e,n,r);if(s&&u===c)return Bt(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 Bt(o,e)}return s?f:Ct(f,u,Nt,Pt(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 Ut(t,e){const n=Object.assign({blockQuote:!0,commentString:St,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 zt(t,e,n,r){if(H(t))return t.toString(e,n,r);if(q(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=X(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(Y(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=(Y(t)||J(t))&&t.anchor;o&&ft(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):Y(o)?Kt(o,e,n,r):o.toString(e,n,r);return a?Y(o)||"{"===s[0]||"["===s[0]?`${a} ${s}`:`${a}\n${e.indent}${s}`:s}function qt(t,e){"debug"!==t&&"warn"!==t||("undefined"!=typeof process&&process.emitWarning?process.emitWarning(e):console.warn(e))}function Vt(t,e,{key:n,value:r}){if(t?.doc.schema.merge&&Wt(n))if(r=q(r)?r.resolve(t.doc):r,G(r))for(const n of r.items)Ht(t,e,n);else if(Array.isArray(r))for(const n of r)Ht(t,e,n);else Ht(t,e,r);else{const i=mt(n,"",t);if(e instanceof Map)e.set(i,mt(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(X(t)&&n?.doc){const e=Ut(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)+'..."'),qt(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=mt(r,o,t);o in e?Object.defineProperty(e,o,{value:a,writable:!0,enumerable:!0,configurable:!0}):e[o]=a}}return e}const Wt=t=>"<<"===t||Y(t)&&"<<"===t.value&&(!t.type||t.type===_t.PLAIN);function Ht(t,e,n){const r=t&&q(n)?n.resolve(t.doc):n;if(!W(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 Yt(t,e,n){const r=xt(t,void 0,n),i=xt(e,void 0,n);return new Gt(r,i)}class Gt{constructor(t,e=null){Object.defineProperty(this,z,{value:$}),this.key=t,this.value=e}clone(t){let{key:e,value:n}=this;return X(e)&&(e=e.clone(t)),X(n)&&(n=n.clone(t)),new Gt(e,n)}toJSON(t,e){return Vt(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=X(t)&&t.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(J(t)||!X(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||J(t)||(Y(t)?t.type===_t.BLOCK_FOLDED||t.type===_t.BLOCK_LITERAL:"object"==typeof t));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(f||!o),indent:s+u});let d,m,y,v=!1,g=!1,b=zt(t,n,(()=>v=!0),(()=>g=!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 v&&r&&r(),""===b?"?":p?`? ${b}`:b}else if(o&&!f||null==e&&p)return b=`? ${b}`,h&&!v?b+=At(b,n.indent,c(h)):g&&i&&i(),b;v&&(h=null),p?(h&&(b+=At(b,n.indent,c(h))),b=`? ${b}\n${s}:`):(b=`${b}:`,h&&(b+=At(b,n.indent,c(h)))),X(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||!Y(e)||(n.indentAtStart=b.length+1),g=!1,l||!(u.length>=2)||n.inFlow||p||!G(e)||e.flow||e.tag||e.anchor||(n.indent=n.indent.substring(2));let _=!1;const w=zt(e,n,(()=>_=!0),(()=>g=!0));let x=" ";if(h||d||m)x=d?"\n":"",m&&(x+=`\n${Tt(c(m),n.indent)}`),""!==w||n.inFlow?x+=`\n${n.indent}`:"\n"===x&&(x="\n\n");else if(!p&&J(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+=At(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 Zt({indent:t,options:{commentString:e}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const i=Tt(e(r),t);n.push(i.trimStart())}}function te(t,e){const n=Y(e)?e.value:e;for(const r of t)if(H(r)){if(r.key===e||r.key===n)return r;if(Y(r.key)&&r.key.value===n)return r}}class ee extends Ot{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(F,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(Yt(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=H(t)?t:t&&"object"==typeof t&&"key"in t?new Gt(t.key,t.value):new Gt(t,t?.value);const r=te(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!e)throw new Error(`Key ${n.key} already set`);Y(r.value)&&bt(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=te(this.items,t);return!!e&&this.items.splice(this.items.indexOf(e),1).length>0}get(t,e){const n=te(this.items,t),r=n?.value;return(!e&&Y(r)?r.value:r)??void 0}has(t){return!!te(this.items,t)}set(t,e){this.add(new Gt(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)Vt(e,r,t);return r}toString(t,e,n){if(!t)return JSON.stringify(this);for(const t of this.items)if(!H(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})),Jt(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:n,onComment:e})}}const ne={collection:"map",default:!0,nodeClass:ee,tag:"tag:yaml.org,2002:map",resolve:(t,e)=>(W(t)||e("Expected a mapping for this tag"),t),createNode:(t,e,n)=>ee.from(t,e,n)};class re extends Ot{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(U,t),this.items=[]}add(t){this.items.push(t)}delete(t){const e=ie(t);return"number"==typeof e&&this.items.splice(e,1).length>0}get(t,e){const n=ie(t);if("number"!=typeof n)return;const r=this.items[n];return!e&&Y(r)?r.value:r}has(t){const e=ie(t);return"number"==typeof e&&e=0?e:null}const oe={collection:"seq",default:!0,nodeClass:re,tag:"tag:yaml.org,2002:seq",resolve:(t,e)=>(G(t)||e("Expected a sequence for this tag"),t),createNode:(t,e,n)=>re.from(t,e,n)},ae={identify:t=>"string"==typeof t,default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:(t,e,n,r)=>Kt(t,e=Object.assign({actualString:!0},e),n,r)},se={identify:t=>null==t,createNode:()=>new _t(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new _t(null),stringify:({source:t},e)=>"string"==typeof t&&se.test.test(t)?t:e.options.nullStr},ue={identify:t=>"boolean"==typeof t,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new _t("t"===t[0]||"T"===t[0]),stringify:({source:t,value:e},n)=>t&&ue.test.test(t)&&e===("t"===t[0]||"T"===t[0])?t:e?n.options.trueStr:n.options.falseStr};function ce({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 le={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:ce},fe={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():ce(t)}},he={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 _t(parseFloat(t)),n=t.indexOf(".");return-1!==n&&"0"===t[t.length-1]&&(e.minFractionDigits=t.length-n-1),e},stringify:ce},pe=t=>"bigint"==typeof t||Number.isInteger(t),de=(t,e,n,{intAsBigInt:r})=>r?BigInt(t):parseInt(t.substring(e),n);function me(t,e,n){const{value:r}=t;return pe(r)&&r>=0?n+r.toString(e):ce(t)}const ye={identify:t=>pe(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>de(t,2,8,n),stringify:t=>me(t,8,"0o")},ve={identify:pe,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>de(t,0,10,n),stringify:ce},ge={identify:t=>pe(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>de(t,2,16,n),stringify:t=>me(t,16,"0x")},be=[ne,oe,ae,se,ue,ye,ve,ge,le,fe,he];function _e(t){return"bigint"==typeof t||Number.isInteger(t)}const we=({value:t})=>JSON.stringify(t),xe=[ne,oe].concat([{identify:t=>"string"==typeof t,default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:we},{identify:t=>null==t,createNode:()=>new _t(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:we},{identify:t=>"boolean"==typeof t,default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:t=>"true"===t,stringify:we},{identify:_e,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})=>_e(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:we}],{default:!0,tag:"",test:/^/,resolve:(t,e)=>(e(`Unresolved plain scalar ${JSON.stringify(t)}`),t)}),ke={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 Gt(new _t(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]=H(r)?r:new Gt(r)}}else e("Expected a sequence for this tag");return t}function Oe(t,e,n){const{replacer:r}=n,i=new re(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(Yt(a,s,n))}return i}const Se={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Ee,createNode:Oe};class Te extends re{constructor(){super(),this.add=ee.prototype.add.bind(this),this.delete=ee.prototype.delete.bind(this),this.get=ee.prototype.get.bind(this),this.has=ee.prototype.has.bind(this),this.set=ee.prototype.set.bind(this),this.tag=Te.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(H(t)?(r=mt(t.key,"",e),i=mt(t.value,r,e)):r=mt(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=Oe(t,e,n),i=new this;return i.items=r.items,i}}Te.tag="tag:yaml.org,2002:omap";const Ae={collection:"seq",identify:t=>t instanceof Map,nodeClass:Te,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){const n=Ee(t,e),r=[];for(const{key:t}of n.items)Y(t)&&(r.includes(t.value)?e(`Ordered maps must not include duplicate keys: ${t.value}`):r.push(t.value));return Object.assign(new Te,n)},createNode:(t,e,n)=>Te.from(t,e,n)};function Ne({value:t,source:e},n){return e&&(t?Le:Me).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}const Le={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 _t(!0),stringify:Ne},Me={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 _t(!1),stringify:Ne},Ce={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:ce},je={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():ce(t)}},Pe={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 _t(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:ce},Ie=t=>"bigint"==typeof t||Number.isInteger(t);function Re(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 De(t,e,n){const{value:r}=t;if(Ie(r)){const t=r.toString(e);return r<0?"-"+n+t.substr(1):n+t}return ce(t)}const Be={identify:Ie,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>Re(t,2,2,n),stringify:t=>De(t,2,"0b")},Fe={identify:Ie,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>Re(t,1,8,n),stringify:t=>De(t,8,"0")},$e={identify:Ie,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>Re(t,0,10,n),stringify:ce},Ke={identify:Ie,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>Re(t,2,16,n),stringify:t=>De(t,16,"0x")};class Ue extends ee{constructor(t){super(t),this.tag=Ue.tag}add(t){let e;e=H(t)?t:t&&"object"==typeof t&&"key"in t&&"value"in t&&null===t.value?new Gt(t.key,null):new Gt(t,null),te(this.items,e.key)||this.items.push(e)}get(t,e){const n=te(this.items,t);return!e&&H(n)?Y(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=te(this.items,t);n&&!e?this.items.splice(this.items.indexOf(n),1):!n&&e&&this.items.push(new Gt(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(Yt(t,null,n));return i}}Ue.tag="tag:yaml.org,2002:set";const ze={collection:"map",identify:t=>t instanceof Set,nodeClass:Ue,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>Ue.from(t,e,n),resolve(t,e){if(W(t)){if(t.hasAllNullValues(!0))return Object.assign(new Ue,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};function qe(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 Ve(t){let{value:e}=t,n=t=>t;if("bigint"==typeof e)n=t=>BigInt(t);else if(isNaN(e)||!isFinite(e))return ce(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 We={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})=>qe(t,n),stringify:Ve},He={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=>qe(t,!1),stringify:Ve},Ye={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(Ye.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=qe(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$/,"")},Ge=[ne,oe,ae,se,Le,Me,Be,Fe,$e,Ke,Ce,je,Pe,ke,Ae,Se,ze,We,He,Ye],Je=new Map([["core",be],["failsafe",[ne,oe,ae]],["json",xe],["yaml11",Ge],["yaml-1.1",Ge]]),Xe={binary:ke,bool:ue,float:he,floatExp:fe,floatNaN:le,floatTime:He,int:ve,intHex:ge,intOct:ye,intTime:We,map:ne,null:se,omap:Ae,pairs:Se,seq:oe,set:ze,timestamp:Ye},Qe={"tag:yaml.org,2002:binary":ke,"tag:yaml.org,2002:omap":Ae,"tag:yaml.org,2002:pairs":Se,"tag:yaml.org,2002:set":ze,"tag:yaml.org,2002:timestamp":Ye};function Ze(t,e){let n=Je.get(e);if(!n){if(!Array.isArray(t)){const t=Array.from(Je.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=Xe[t];if(e)return e;const n=Object.keys(Xe).map((t=>JSON.stringify(t))).join(", ");throw new Error(`Unknown custom tag "${t}"; use one of ${n}`)}))}const tn=(t,e)=>t.keye.key?1:0;class en{constructor({compat:t,customTags:e,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(t)?Ze(t,"compat"):t?Ze(null,t):null,this.merge=!!n,this.name="string"==typeof i&&i||"core",this.knownTags=r?Qe:{},this.tags=Ze(e,this.name),this.toStringOptions=a??null,Object.defineProperty(this,F,{value:ne}),Object.defineProperty(this,K,{value:ae}),Object.defineProperty(this,U,{value:oe}),this.sortMapEntries="function"==typeof o?o:!0===o?tn:null}clone(){const t=Object.create(en.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}class nn{constructor(t,e,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,z,{value:B});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 lt({version:o}),this.setSchema(o,n),this.contents=void 0===t?null:this.createNode(t,r,n)}clone(){const t=Object.create(nn.prototype,{[z]:{value:B}});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=X(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){rn(this.contents)&&this.contents.add(t)}addIn(t,e){rn(this.contents)&&this.contents.addIn(t,e)}createAlias(t,e){if(!t.anchor){const n=ht(this);t.anchor=!e||n.has(e)?pt(e||"a",n):e}return new vt(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=ht(t));const o=pt(e,i);return i.add(o),o},setAnchors:()=>{for(const t of n){const e=r.get(t);if("object"!=typeof e||!e.anchor||!Y(e.node)&&!J(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=xt(t,c,{aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:l,onTagObj:u,replacer:r,schema:this.schema,sourceObjects:h});return a&&J(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 Gt(r,i)}delete(t){return!!rn(this.contents)&&this.contents.delete(t)}deleteIn(t){return Et(t)?null!=this.contents&&(this.contents=null,!0):!!rn(this.contents)&&this.contents.deleteIn(t)}get(t,e){return J(this.contents)?this.contents.get(t,e):void 0}getIn(t,e){return Et(t)?!e&&Y(this.contents)?this.contents.value:this.contents:J(this.contents)?this.contents.getIn(t,e):void 0}has(t){return!!J(this.contents)&&this.contents.has(t)}hasIn(t){return Et(t)?void 0!==this.contents:!!J(this.contents)&&this.contents.hasIn(t)}set(t,e){null==this.contents?this.contents=kt(this.schema,[t],e):rn(this.contents)&&this.contents.set(t,e)}setIn(t,e){Et(t)?this.contents=e:null==this.contents?this.contents=kt(this.schema,Array.from(t),e):rn(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 lt({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 lt({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 en(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=mt(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?dt(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=Ut(t,e),{commentString:o}=i.options;if(t.commentBefore){1!==n.length&&n.unshift("");const e=o(t.commentBefore);n.unshift(Tt(e,""))}let a=!1,s=null;if(t.contents){if(X(t.contents)){if(t.contents.spaceBefore&&r&&n.push(""),t.contents.commentBefore){const e=o(t.contents.commentBefore);n.push(Tt(e,""))}i.forceBlockIndent=!!t.comment,s=t.contents.comment}const e=s?void 0:()=>a=!0;let u=zt(t.contents,i,(()=>s=null),e);s&&(u+=At(u,"",o(s))),"|"!==u[0]&&">"!==u[0]||"---"!==n[n.length-1]?n.push(u):n[n.length-1]=`--- ${u}`}else n.push(zt(t.contents,i));if(t.directives?.docEnd)if(t.comment){const e=o(t.comment);e.includes("\n")?(n.push("..."),n.push(Tt(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(Tt(o(e),"")))}return n.join("\n")+"\n"}(this,t)}}function rn(t){if(J(t))return!0;throw new Error("Expected a YAML collection as document contents")}class on extends Error{constructor(t,e,n,r){super(),this.name=t,this.code=n,this.message=r,this.pos=e}}class an extends on{constructor(t,e,n){super("YAMLParseError",t,e,n)}}class sn extends on{constructor(t,e,n){super("YAMLWarning",t,e,n)}}const un=(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 cn(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=!1,y=null,v=null,g=null,b=null,_=null,w=null;for(const i of t)switch(m&&("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"),m=!1),y&&(c&&"comment"!==i.type&&"newline"!==i.type&&o(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),y=null),i.type){case"space":e||"doc-start"===n&&"flow-collection"===r?.type||!i.source.includes("\t")||(y=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,(v||g)&&(d=!0),l=!0;break;case"anchor":v&&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),v=i,null===w&&(w=i.offset),c=!1,l=!1,m=!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,m=!0;break;case n:(v||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 m&&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"),y&&(c&&y.indent<=a||"block-map"===r?.type||"block-seq"===r?.type)&&o(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:_,spaceBefore:u,comment:f,hasNewline:p,hasNewlineAfterProp:d,anchor:v,tag:g,end:k,start:w??k}}function ln(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(ln(e.key)||ln(e.value))return!0}return!1;default:return!0}}function fn(t,e,n){if("flow-collection"===e?.type){const r=e.end[0];r.indent!==t||"]"!==r.source&&"}"!==r.source||!ln(e)||n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function hn(t,e,n){const{uniqueKeys:r}=t.options;if(!1===r)return!1;const i="function"==typeof r?r:(e,n)=>e===n||Y(e)&&Y(n)&&e.value===n.value&&!("<<"===e.value&&t.schema.merge);return e.some((t=>i(t.key,n)))}const pn="All mapping items must start at the same column";function dn(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 mn="Block collections are not allowed within flow collections",yn=t=>t&&("block-map"===t.type||"block-seq"===t.type);function vn(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??ee)(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=cn(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",pn)),!p.anchor&&!p.tag&&!f){u=p.end,p.comment&&(a.comment?a.comment+="\n"+p.comment:a.comment=p.comment);continue}(p.hasNewlineAfterProp||ln(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",pn);const m=p.end,y=l?t(n,l,p,i):e(n,m,c,null,p,i);n.schema.compat&&fn(r.indent,l,i),hn(n,a.items,y)&&i(m,"DUPLICATE_KEY","Map keys must be unique");const v=cn(f??[],{indicator:"map-value-ind",next:h,offset:y.range[2],onError:i,parentIndent:r.indent,startOnNewline:!l||"block-scalar"===l.type});if(s=v.end,v.found){d&&("block-map"!==h?.type||v.hasNewline||i(s,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&p.start0){const t=dn(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 gn(t){let e,n;try{e=new RegExp("(.*?)(?"===i.mode?_t.BLOCK_FOLDED:_t.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=_t.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}`),gn(t)}(o,c);break;case"single-quoted-scalar":s=_t.QUOTE_SINGLE,u=function(t,e){return"'"===t[t.length-1]&&1!==t.length||e(t.length,"MISSING_CHAR","Missing closing 'quote"),gn(t.slice(1,-1)).replace(/''/g,"'")}(o,c);break;case"double-quoted-scalar":s=_t.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=dn(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[K];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[K])}(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[K];if(e.compat){const a=e.compat.find((t=>t.default&&t.test?.test(n)))??e[K];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[K];let l;try{const o=c.resolve(i,(t=>r(n??e,"TAG_RESOLVE_FAILED",t)),t.options);l=Y(o)?o:new _t(o)}catch(t){const o=t instanceof Error?t.message:String(t);r(n??e,"TAG_RESOLVE_FAILED",o),l=new _t(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 kn(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 En={composeNode:On,composeEmptyNode:Sn};function On(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 vt(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=dn(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=xn(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?e.directives.tagName(r.source,(t=>i(r,"TAG_RESOLVE_FAILED",t))):null,a="block-map"===n.type?"map":"block-seq"===n.type?"seq":"{"===n.start.source?"map":"seq";if(!r||!o||"!"===o||o===ee.tagName&&"map"===a||o===re.tagName&&"seq"===a||!a)return vn(t,e,n,i,o);let s=e.schema.tags.find((t=>t.tag===o&&t.collection===a));if(!s){const u=e.schema.knownTags[o];if(!u||u.collection!==a)return u?.collection?i(r,"BAD_COLLECTION_TYPE",`${u.tag} used for ${a} collection, but expects ${u.collection}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),vn(t,e,n,i,o);e.schema.tags.push(Object.assign({},u,{default:!1})),s=u}const u=vn(t,e,n,i,o,s),c=s.resolve?.(u,(t=>i(r,"TAG_RESOLVE_FAILED",t)),e.options)??u,l=X(c)?c:new _t(c);return l.range=u.range,l.tag=o,s?.format&&(l.format=s.format),l}(En,t,e,s,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=Sn(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 Sn(t,e,n,r,{spaceBefore:i,comment:o,anchor:a,tag:s,end:u},c){const l=xn(t,{type:"scalar",offset:kn(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 Tn(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 An(t){let e="",n=!1,r=!1;for(let i=0;i{const i=Tn(t);r?this.warnings.push(new sn(i,e,n)):this.errors.push(new an(i,e,n))},this.directives=new lt({version:t.version||"1.2"}),this.options=t}decorate(t,e){const{comment:n,afterEmptyLine:r}=An(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(J(i)&&!i.flow&&i.items.length>0){let t=i.items[0];H(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:An(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=Tn(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 nn(void 0,s),c={atRoot:!0,directives:u.directives,options:u.options,schema:u.schema},l=cn(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?On(c,i,l,a):Sn(c,l.end,r,null,l,a);const f=u.contents.range[2],h=dn(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 an(Tn(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 an(Tn(t),"UNEXPECTED_TOKEN",e));break}this.doc.directives.docEnd=!0;const e=dn(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 an(Tn(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 nn(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 Ln=Symbol("break visit"),Mn=Symbol("skip children"),Cn=Symbol("remove item");function jn(t,e){"type"in t&&"document"===t.type&&(t={start:t.start,value:t.value}),Pn(Object.freeze([]),t,e)}function Pn(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},jn.parentCollection=(t,e)=>{const n=jn.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 In(t){switch(t){case void 0:case" ":case"\n":case"\r":case"\t":return!0;default:return!1}}const Rn=new Set("0123456789ABCDEFabcdef"),Dn=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Bn=new Set(",[]{}"),Fn=new Set(" ,[]{}\n\r\t"),$n=t=>!t||Fn.has(t);class Kn{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)&&In(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return("number"!=typeof t||-1!==t&&tthis.indentValue&&!In(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)&&In(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($n),"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=>In(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(In(e)||t&&Bn.has(e))break;n=r}else if(In(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&&Bn.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&&Bn.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($n))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,e=this.charAt(1);if(In(e)||t&&Bn.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(;!In(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(Dn.has(e))e=this.buffer[++t];else{if("%"!==e||!Rn.has(this.buffer[t+1])||!Rn.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 Un{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 Yn(t){if("flow-seq-start"===t.start.type)for(const e of t.items)!e.sep||e.value||zn(e.start,"explicit-key-ind")||zn(e.sep,"map-value-ind")||(e.key&&(e.value=e.key),delete e.key,Vn(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 Gn{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 Kn,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&&Yn(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===qn(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(zn(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(Vn(e.key)&&!zn(e.sep,"newline")){const t=Hn(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(zn(e.start,"newline"))Object.assign(e,{key:null,sep:[this.sourceToken]});else{const t=Hn(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]}):zn(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||zn(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=Hn(Wn(e));Yn(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=Hn(Wn(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=Hn(Wn(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 Jn(t,e={}){const{lineCounter:n,prettyErrors:r}=function(t){const e=!1!==t.prettyErrors;return{lineCounter:t.lineCounter||e&&new Un||null,prettyErrors:e}}(e),i=new Gn(n?.addNewLine),o=new Nn(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 an(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(un(t,n)),a.warnings.forEach(un(t,n))),a}class Xn extends on{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 Qn{constructor(){this.lineCounter=new Un,this.src="",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 Xn("FILE_ERROR",0,`FileError : ${t}`);return this.errors.push(e),e}syntaxError(t,e){let n=new Xn("SYNTAX_ERROR",t.range?t.range[0]:0,`SyntaxError : ${e}`);return this.errors.push(n),n}syntaxWarning(t,e){let n=new Xn("SYNTAX_WARNING",t.range?t.range[0]:0,`SyntaxWarning : ${e}`);return this.warnings.push(n),n}typeError(t,e){let n=new Xn("TYPE_ERROR",t.range?t.range[0]:0,`TypeError : ${e}`);return this.errors.push(n),n}grammarError(t){let e=new Xn("GRAMMAR_ERROR",0,`GrammarError : ${t}`);this.errors.push(e)}grammarWarning(t){let e=new Xn("GRAMMAR_WARNING",0,`GrammarWarning : ${t}`);return 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 Zn{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 tr extends Zn{constructor(t,e,n){super(t,e,n)}equals(t){if(t instanceof tr)return this.value==t.value;this.ctx.syntaxError(this.current,`Error can not compare values '${this.value}' and '${t.value}'`)}}class er extends tr{constructor(t,e){if(super(t,"string",e),!er.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not a string`);this.value=e.value}static checkCurrent(t){return Y(t)&&"string"==typeof t.value}static parse(t,e){try{return new er(t,e)}catch(t){return null}}}class nr extends tr{constructor(t,e){if(super(t,"binary",e),!nr.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not a base64 string`);this.value=e.value}static checkCurrent(t){return Y(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 nr(t,e)}catch(t){return null}}}class rr extends tr{constructor(t,e){if(super(t,"int",e),!rr.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not an integer`);this.value=e.value}static checkCurrent(t){return Y(t)&&"number"==typeof t.value&&t.value==Math.floor(t.value)}static parse(t,e){try{return new rr(t,e)}catch(t){return null}}}class ir extends tr{constructor(t,e){if(super(t,"float",e),!ir.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not a number`);this.value=e.value}static checkCurrent(t){return Y(t)&&"number"==typeof t.value}static parse(t,e){try{return new ir(t,e)}catch(t){return null}}}class or extends tr{constructor(t,e){if(super(t,"boolean",e),this.value=null,!or.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e.value}' is not a boolean`);this.value=e.value}static checkCurrent(t){return Y(t)&&"boolean"==typeof t.value}static parse(t,e){try{return new or(t,e)}catch(t){return null}}}class ar extends tr{constructor(t,e){if(super(t,"null",e),this.value=null,!ar.checkCurrent(e))throw t.syntaxError(e,`Error: value '${e?e.value:""}' is not the null value`)}static checkCurrent(t){return Y(t)&&(null==t.value||["Null","NULL","null","~"].includes(t.value))}static parse(t,e){try{return new ar(t,e)}catch(t){return null}}}class sr extends tr{constructor(t,e,n){if(super(t,"timestamp",e),!sr.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=Y(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 sr(t,e)}catch(t){return null}}equals(t){return t instanceof sr?this.value.getTime()==t.value.getTime():this.ctx.syntaxError("Error : can not compare a timestamp with something else")}}class ur extends Zn{constructor(t,e,n){super(t,e,n)}length(){return this.childs.length}isEmpty(){return 0==this.length()}}class cr extends ur{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 W(t)&&t.items.every((t=>t.key&&Y(t.key)&&"string"==typeof t.key.value))}}class lr{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=xr(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 fr="undefined"!=typeof Symbol;function hr(t){var e=typeof t;return"string"===e||"number"===e||"boolean"===e||!0===fr&&"symbol"===e||null==t||!0===fr&&t instanceof Symbol||t instanceof String||t instanceof Number||t instanceof Boolean}class pr{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=>pr.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=>hr(e)&&t.rules[e]?t.rules[e]:e)),e._merge=e._merge.map((e=>pr.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 pr.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]=pr.parse(t,e._map[r]);e._map=n}if(e._mapFacultative){let n={};for(const r in e._mapFacultative)n[r]=pr.parse(t,e._mapFacultative[r]);e._mapFacultative=n}if(e._mapOf){let n={};for(const r in e._mapOf){let i=pr.parse(t,r),o=pr.parse(t,e._mapOf[r]);n[i]=o}e._mapOf=n}e._list&&(e._list=e._list.map((e=>pr.parse(t,e)))),e._listFacultative&&(e._listFacultative=e._listFacultative.map((e=>pr.parse(t,e)))),e._listOf&&(e._listOf=pr.parse(t,e._listOf))}return e}}class dr{static isPositiveInt(t){return"number"==typeof t&&t==Math.floor(t)&&t>0}static sizeChecker(t,e,n,r){if(dr.isPositiveInt(n))if(W(r)||G(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||dr.sizeChecker(t,"eq",e._nb,n)?null==e._min||dr.sizeChecker(t,"min",e._min,n)?!(null!=e._max&&!dr.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 mr{static parse(t,e,n){if(!cr.checkCurrent(n))return t.syntaxError(n,"Error : a map whose keys are strings is expected "),null;if(e._merge&&(e=pr.parse(t,e))._oneOf)return lr.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(!dr.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=xr(t,null,r[n],c);else if(o&&o[n])l=xr(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=xr(t,null,a,i.key);if(l=xr(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 er(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 cr(t,n,u)}static parse_any(t,e){if(!cr.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=gr.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 er(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 cr(t,e,n)}}class yr extends ur{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 G(t)}}class vr{static parse(t,e,n){if(!yr.checkCurrent(n))return t.syntaxError(n,"Error : a list is expected "),null;if(!dr.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=gr.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 yr(t,e,n)}}class gr{static parse(t,e,n){switch(e){case"string":return er.parse(t,n);case"binary":return nr.parse(t,n);case"timestamp":return sr.parse(t,n);case"int":return rr.parse(t,n);case"float":return ir.parse(t,n);case"boolean":return or.parse(t,n);case"null":return ar.parse(t,n);case"any":return gr.parse_any(t,n);default:return kr(t,e,n)}}static parse_any(t,e){if(Y(e)){switch(typeof e.value){case"number":return rr.checkCurrent(e)?rr.parse(t,e):ir.parse(t,e);case"boolean":return or.parse(t,e);case"string":return er.parse(t,e);case"object":if(null==e.value)return ar.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 W(e)?mr.parse_any(t,e):G(e)?vr.parse_any(t,e):null}}class br{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(!hr(e))return t.grammarError("Error: _in rules expects each alternative to be a scalar"),null;if(!Y(n))return t.syntaxError(n,"Syntax Error : scalar value expected by rule '_in'"),null;let i=gr.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 _r{static parse(t,e,n){if(!er.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 er(t,n):(t.syntaxError(n,`Error: value '${n.value}' does not match the regular expression '${i}'`),null)}}class wr{static scalartypes=["string","int","float","null","boolean","binary","timestamp"];static keywords=["_map","_mapOf","_mapFacultative","_list","_listOf","_listFacultative","_oneOf","_regex","_nb","_min","_max","_in"];static parse(t,e,n,r){if(null==r)return t.fileError("No source to parse"),null;if(wr.scalartypes.includes(e)||wr.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=xr(t,null,n,r),a="exit_"+e;return"node_template"==e&&console.log("Sortie de node_template"),t.listener&&t.listener[a]&&t.listener[a](o),o}}function xr(t,e,n,r){if(e)return wr.parse(t,e,n,r);if(hr(n))return gr.parse(t,n,r);if("object"==typeof n){if(n._map||n._mapOf||n._mapFacultative||n._merge)return mr.parse(t,n,r);if(n._list||n._listOf||n._listFacultative)return vr.parse(t,n,r);if(n._oneOf)return lr.parse(t,n,r);if(n._regex)return _r.parse(t,n,r);if(n._in)return br.parse(t,n,r)}return t.grammarError("Error : grammar error : no valid keyword found"),null}function kr(t,e,n){let r=t.rules[e];return void 0!==r?xr(t,e,r,n):(t.grammarError(`no rule named ${e} found.`),null)}function Er(t){t.keyword||(t.keyword="main");let e=new Qn;return 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=Jn(t,n);if(!i)return null;if(i.warnings.forEach((t=>qt(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 Un;let n=Jn(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=kr(t,e,n);return t.errors.filter((t=>t instanceof Xn)).forEach((e=>e.pretty(t))),t.warnings.filter((t=>t instanceof Xn)).forEach((e=>e.pretty(t))),t.contents=r,t}(e,t.keyword,e.src)}var Or={main:"workflow",workflow:{_mapFacultative:{name:"WorkflowName",on:{_mapFacultative:{push:"PushTrigger",pull_request:"PullRequestTrigger"}},jobs:{_mapOf:{JobId:"Job"}}}},WorkflowName:"string",PushTrigger:{_map:{branches:"PushTriggerBranches"}},PushTriggerBranches:{_listOf:"string"},PullRequestTrigger:{_map:{types:"PullRequestTriggerTypes"}},PullRequestTriggerTypes:{_listOf:"string"},Job:{_mapFacultative:{name:"JobName","runs-on":"JobRunsOn",needs:"JobNeeds",steps:{_listOf:"Step"}}},JobId:"string",JobName:"string",JobRunsOn:"string",JobNeeds:{_listOf:"string"},Step:{_oneOf:["CommandStep","ReusableStep"]},ReusableStep:{_map:{uses:"StepUses"},_mapFacultative:{name:"StepName",with:"StepWith",env:"StepEnv"}},CommandStep:{_map:{run:"StepRun"},_mapFacultative:{name:"StepName",env:"StepEnv"}},StepUses:"string",StepName:"string",StepRun:"string",StepWith:{_mapOf:{StepMapKey:"StepMapValue"}},StepEnv:{_mapOf:{StepMapKey:"StepMapValue"}},StepMapKey:"string",StepMapValue:{_oneOf:["int","float","string"]}};function Sr(t){return Sr="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},Sr(t)}function Tr(t,e){for(var n=0;n1&&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){var n=e.path;return t.path===n})).filter((function(t){var n=t.path,i=t.content;return!(!i||""===i.trim())||(e.pluginData.emitEvent({parent:r,type:"Parser",action:"read",status:"warning",files:[n],data:{code:"no_content",global:!1}}),!1)})).forEach((function(t,n){var i=e.pluginData.emitEvent({parent:r,type:"Parser",action:"read",status:"running",files:[t.path],data:{global:!1}}),o=new R(t,e.pluginData.definitions.components,"workflow_".concat(n+1));!function(t){t.rules=Or,Er(t)}({src_data:t.content,listener:o,path:t.path,prog:{errors:[],warnings:[],imports:[],alreadyImported:[],root:[]}}),o.components.forEach((function(t){return e.pluginData.components.push(t)})),e.pluginData.emitEvent({id:i,status:"success"})}))}}],r&&Tr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(t.DefaultParser);var Pr=n(326),Ir=n.n(Pr);const Rr={root:"name: {{ workflowName.value }}\n\n{% if triggers.length > 0 %}\non:\n{% for trigger in triggers %}\n{% if trigger.definition.action === 'push' %}{% set branches = getTriggerAttribute(trigger, 'branches').value %}\n push:\n branches: [{% if branches.length > 0 %}{{ branches.join(', ') }}{% endif %}]\n{% else %}{% set types = getTriggerAttribute(trigger, 'types').value %}\n pull_request:\n types: [{% if types.length > 0 %}{{ types.join(', ') }}{% endif %}]\n{% endif %}\n{% endfor %}\n{% endif %}\n\njobs:\n{% for job in jobs %}\n {{ job.id }}:\n{% for attribute in getAttributes(job) %}\n {% if attribute.type === 'Array' %}\n {{attribute.name}}: [{{ attribute.value.join(', ')}}]\n {% else %}\n {{attribute.name}}: {{attribute.value }}\n {% endif %}\n{% endfor %}\n{% if getSteps(job.id).length > 0 %}\n steps:\n{% for step in getSteps(job.id) %}\n{% for attribute in getAttributes(step) %}\n{% if attribute.type === 'Array' %}\n{% if loop.first %}{{\"- \" | indent(6, true)}}{{attribute.name}}{% else %}{{attribute.name | indent(8, true)}}{% endif %}: [{{ attribute.value.join(', ')}}]\n{% elif attribute.type === 'Object' %}\n{% if loop.first %}{{\"- \" | indent(6, true)}}{{attribute.name}}{% else %}{{attribute.name | indent(8, true)}}{% endif %}:\n{% for value in attribute.value %}\n{{value.name | indent(10,true)}}: {% if value.type == 'Number' and value.value == null %}0{% else %}{{ value.value }}{% endif %}\n\n{% endfor %}\n{% else %}\n{% if loop.first %}{{\"- \" | indent(6, true)}}{{attribute.name}}{% else %}{{attribute.name | indent(8, true)}}{% endif %}: {{ attribute.value }}\n{% endif %}\n{% endfor %}\n{% endfor %}\n\n{% endif %}\n{% endfor %}"};function Dr(t){return Dr="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},Dr(t)}function Br(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null,i=[];return e.forEach((function(e,o){var a=n.pluginData.emitEvent({parent:r,type:"Render",action:"write",status:"running",files:[o],data:{global:!1}}),s=e.find((function(t){return"workflow"===t.definition.category})),u=e.filter((function(t){return"trigger"===t.definition.category})),c=e.filter((function(t){return"step"===t.definition.category})),l="".concat(n.template.render({workflow:s,workflowName:null==s?void 0:s.attributes.find((function(t){return"name"===t.name})),triggers:u,jobs:e.filter((function(t){return"job"===t.definition.category})),getAttributes:function(t){return t.attributes.filter((function(t){var e=t.name;return"workflow_id"!==e&&"job_id"!==e}))},getTriggerAttribute:function(t,e){return t.attributes.find((function(t){return t.name===e}))},getSteps:function(t){return c.filter((function(e){return e.attributes.some((function(e){var n=e.name,r=e.value;return"job_id"===n&&r===t}))}))}}).trim(),"\n");i.push(new t.FileInput({path:o,content:l})),n.pluginData.emitEvent({id:a,status:"success"})})),i}}],i&&Br(r.prototype,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,i}(t.DefaultRender);const Vr=qr,Wr=JSON.parse('{"UU":"githubator-plugin","rE":"0.3.4"}'),Hr={name:"githubAction",languageSettings:{id:"githubAction",extensions:[".yml",".yaml"],aliases:["githubaction","Githubaction","githubAction","GithubAction"],mimetypes:["string"]},languageConfiguration:{comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],colorizedBracketPairs:[["(",")"],["{","}"],["[","]"]],autoClosingPairs:[{open:"(",close:")"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"'",close:"'",notIn:["string"]},{open:'"',close:'"',notIn:["string"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'"},{open:'"',close:'"'}],folding:{offSide:!0}},tokenProvider:{tokenPostfix:".yaml",brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.square",open:"[",close:"]"}],keywords:["true","True","TRUE","false","False","FALSE","null","Null","Null","~"],numberInteger:/(?:0|[+-]?\d+)/,numberFloat:/(?:0|[+-]?\d+)(?:\.\d+)?(?:e[-+][1-9]\d*)?/,numberOctal:/0o[0-7]+/,numberHex:/0x[0-9a-fA-F]+/,numberInfinity:/[+-]?\.(?:inf|Inf|INF)/,numberNaN:/\.(?:nan|Nan|NAN)/,numberDate:/\d{4}-\d\d-\d\d([Tt ]\d\d:\d\d:\d\d(\.\d+)?(( ?[+-]\d\d?(:\d\d)?)|Z)?)?/,escapes:/\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,tokenizer:{root:[{include:"@whitespace"},{include:"@comment"},[/%[^ ]+.*$/,"meta.directive"],[/---/,"operators.directivesEnd"],[/\.{3}/,"operators.documentEnd"],[/[-?:](?= )/,"operators"],{include:"@anchor"},{include:"@tagHandle"},{include:"@flowCollections"},{include:"@blockStyle"},[/@numberInteger(?![ \t]*\S+)/,"number"],[/@numberFloat(?![ \t]*\S+)/,"number.float"],[/@numberOctal(?![ \t]*\S+)/,"number.octal"],[/@numberHex(?![ \t]*\S+)/,"number.hex"],[/@numberInfinity(?![ \t]*\S+)/,"number.infinity"],[/@numberNaN(?![ \t]*\S+)/,"number.nan"],[/@numberDate(?![ \t]*\S+)/,"number.date"],[/(".*?"|'.*?'|[^#'"]*?)([ \t]*)(:)( |$)/,["type","white","operators","white"]],{include:"@flowScalars"},[/.+?(?=(\s+#|$))/,{cases:{"@keywords":"keyword","@default":"string"}}]],object:[{include:"@whitespace"},{include:"@comment"},[/\}/,"@brackets","@pop"],[/,/,"delimiter.comma"],[/:(?= )/,"operators"],[/(?:".*?"|'.*?'|[^,{[]+?)(?=: )/,"type"],{include:"@flowCollections"},{include:"@flowScalars"},{include:"@tagHandle"},{include:"@anchor"},{include:"@flowNumber"},[/[^},]+/,{cases:{"@keywords":"keyword","@default":"string"}}]],array:[{include:"@whitespace"},{include:"@comment"},[/\]/,"@brackets","@pop"],[/,/,"delimiter.comma"],{include:"@flowCollections"},{include:"@flowScalars"},{include:"@tagHandle"},{include:"@anchor"},{include:"@flowNumber"},[/[^\],]+/,{cases:{"@keywords":"keyword","@default":"string"}}]],multiString:[[/^( +).+$/,"string","@multiStringContinued.$1"]],multiStringContinued:[[/^( *).+$/,{cases:{"$1==$S2":"string","@default":{token:"@rematch",next:"@popall"}}}]],whitespace:[[/[ \t\r\n]+/,"white"]],comment:[[/#.*$/,"comment"]],flowCollections:[[/\[/,"@brackets","@array"],[/\{/,"@brackets","@object"]],flowScalars:[[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/'[^']*'/,"string"],[/"/,"string","@doubleQuotedString"]],doubleQuotedString:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],blockStyle:[[/[>|]\d*[+-]?$/,"operators","@multiString"]],flowNumber:[[/@numberInteger(?=[ \t]*[,\]}])/,"number"],[/@numberFloat(?=[ \t]*[,\]}])/,"number.float"],[/@numberOctal(?=[ \t]*[,\]}])/,"number.octal"],[/@numberHex(?=[ \t]*[,\]}])/,"number.hex"],[/@numberInfinity(?=[ \t]*[,\]}])/,"number.infinity"],[/@numberNaN(?=[ \t]*[,\]}])/,"number.nan"],[/@numberDate(?=[ \t]*[,\]}])/,"number.date"]],tagHandle:[[/![^ ]*/,"tag"]],anchor:[[/[&*][^ ]+/,"namespace"]]}}};function Yr(t){return Yr="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},Yr(t)}function Gr(t,e,n){return e=Xr(e),function(t,e){if(e&&("object"==Yr(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,Jr()?Reflect.construct(e,n||[],Xr(t).constructor):e.apply(t,n))}function Jr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Jr=function(){return!!t})()}function Xr(t){return Xr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Xr(t)}function Qr(t,e){return Qr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Qr(t,e)}const Zr=function(e){function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),Gr(this,n,[{editor:{syntax:Hr},tags:[new t.Tag({type:"language",value:"Github"}),new t.Tag({type:"category",value:"CI"}),new t.Tag({type:"category",value:"CD"})],restrictiveFolder:".github/workflows/",isFolderTypeDiagram:!1,defaultFileName:"new_workflow.yml",defaultFileExtension:"yml",extraResources:[{type:"markers",name:"startLinkMarker"},{type:"markers",name:"endLinkMarker"},{type:"links",name:"defaultLink"},{type:"links",name:"temporaryLink"},{type:"icons",name:"error"},{type:"icons",name:"menu"},{type:"icons",name:"resize"}],container:{margin:15,gap:50}}])}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&&Qr(t,e)}(n,e),r=n,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(t.DefaultConfiguration);function ti(t){return ti="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},ti(t)}function ei(t,e,n){return e=ri(e),function(t,e){if(e&&("object"==ti(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,ni()?Reflect.construct(e,n||[],ri(t).constructor):e.apply(t,n))}function ni(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ni=function(){return!!t})()}function ri(t){return ri=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ri(t)}function ii(t,e){return ii=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ii(t,e)}const oi=function(e){function n(){var e=arguments.length>0&&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,n);var r=new Zr,i=new t.DefaultData(r,{name:Wr.UU,version:Wr.rE},e.event);return ei(this,n,[{configuration:r,pluginData:i,pluginMetadata:new C(i),pluginParser:new jr(i),pluginRenderer:new Vr(i)}])}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&&ii(t,e)}(n,e),r=n,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(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 diff --git a/package-lock.json b/package-lock.json index 8a2eb0b..d3ea681 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "githubator-plugin", - "version": "0.3.3", + "version": "0.3.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "githubator-plugin", - "version": "0.3.3", + "version": "0.3.4", "license": "Mozilla Public License 2.0", "dependencies": { "leto-modelizer-plugin-core": "github:ditrit/leto-modelizer-plugin-core#0.25.0", diff --git a/package.json b/package.json index a397523..07bb43a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "githubator-plugin", - "version": "0.3.3", + "version": "0.3.4", "description": "Github action plugin for Leto modelizer.", "main": "dist/githubator-plugin.js", "exports": "./dist/githubator-plugin.js",