@antv/layout 0.1.21 → 0.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/layout.min.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see layout.min.js.LICENSE.txt */
|
|
2
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.layout=e():t.layout=e()}(self,(function(){return(()=>{var t={7294:()=>{},9586:()=>{},2697:()=>{},1894:()=>{},1186:()=>{},5275:()=>{},2862:()=>{},9633:()=>{},7222:()=>{},5965:()=>{},2391:()=>{},3945:()=>{},9216:(t,e,n)=>{"use strict";n(9504),n(3982),n(721),n(5778),n(3898),n(7536),n(5834),n(6945),n(547),n(5967),n(3515),n(3042),n(4962),n(405)},122:(t,e,n)=>{t.exports=n(405)},8311:(t,e,n)=>{var r=n(1946);t.exports={Graph:r.Graph,json:n(1603),alg:n(638),version:r.version}},5267:(t,e,n)=>{var r=n(6879);t.exports=function(t){var e,n={},i=[];function o(i){r.has(n,i)||(n[i]=!0,e.push(i),r.each(t.successors(i),o),r.each(t.predecessors(i),o))}return r.each(t.nodes(),(function(t){e=[],o(t),e.length&&i.push(e)})),i}},4370:(t,e,n)=>{var r=n(6879);function i(t,e,n,o,a,u){r.has(o,e)||(o[e]=!0,n||u.push(e),r.each(a(e),(function(e){i(t,e,n,o,a,u)})),n&&u.push(e))}t.exports=function(t,e,n){r.isArray(e)||(e=[e]);var o=(t.isDirected()?t.successors:t.neighbors).bind(t),a=[],u={};return r.each(e,(function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);i(t,e,"post"===n,u,o,a)})),a}},5566:(t,e,n)=>{var r=n(7435),i=n(6879);t.exports=function(t,e,n){return i.transform(t.nodes(),(function(i,o){i[o]=r(t,o,e,n)}),{})}},7435:(t,e,n)=>{var r=n(6879),i=n(758);t.exports=function(t,e,n,r){return function(t,e,n,r){var o,a,u={},s=new i,c=function(t){var e=t.v!==o?t.v:t.w,r=u[e],i=n(t),c=a.distance+i;if(i<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+t+" Weight: "+i);c<r.distance&&(r.distance=c,r.predecessor=o,s.decrease(e,c))};for(t.nodes().forEach((function(t){var n=t===e?0:Number.POSITIVE_INFINITY;u[t]={distance:n},s.add(t,n)}));s.size()>0&&(o=s.removeMin(),(a=u[o]).distance!==Number.POSITIVE_INFINITY);)r(o).forEach(c);return u}(t,String(e),n||o,r||function(e){return t.outEdges(e)})};var o=r.constant(1)},5488:(t,e,n)=>{var r=n(6879),i=n(4155);t.exports=function(t){return r.filter(i(t),(function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])}))}},7003:(t,e,n)=>{var r=n(6879);t.exports=function(t,e,n){return function(t,e,n){var r={},i=t.nodes();return i.forEach((function(t){r[t]={},r[t][t]={distance:0},i.forEach((function(e){t!==e&&(r[t][e]={distance:Number.POSITIVE_INFINITY})})),n(t).forEach((function(n){var i=n.v===t?n.w:n.v,o=e(n);r[t][i]={distance:o,predecessor:t}}))})),i.forEach((function(t){var e=r[t];i.forEach((function(n){var o=r[n];i.forEach((function(n){var r=o[t],i=e[n],a=o[n],u=r.distance+i.distance;u<a.distance&&(a.distance=u,a.predecessor=i.predecessor)}))}))})),r}(t,e||i,n||function(e){return t.outEdges(e)})};var i=r.constant(1)},638:(t,e,n)=>{t.exports={components:n(5267),dijkstra:n(7435),dijkstraAll:n(5566),findCycles:n(5488),floydWarshall:n(7003),isAcyclic:n(6515),postorder:n(4654),preorder:n(2746),prim:n(6828),tarjan:n(4155),topsort:n(4417)}},6515:(t,e,n)=>{var r=n(4417);t.exports=function(t){try{r(t)}catch(t){if(t instanceof r.CycleException)return!1;throw t}return!0}},4654:(t,e,n)=>{var r=n(4370);t.exports=function(t,e){return r(t,e,"post")}},2746:(t,e,n)=>{var r=n(4370);t.exports=function(t,e){return r(t,e,"pre")}},6828:(t,e,n)=>{var r=n(6879),i=n(5256),o=n(758);t.exports=function(t,e){var n,a=new i,u={},s=new o;function c(t){var r=t.v===n?t.w:t.v,i=s.priority(r);if(void 0!==i){var o=e(t);o<i&&(u[r]=n,s.decrease(r,o))}}if(0===t.nodeCount())return a;r.each(t.nodes(),(function(t){s.add(t,Number.POSITIVE_INFINITY),a.setNode(t)})),s.decrease(t.nodes()[0],0);for(var f=!1;s.size()>0;){if(n=s.removeMin(),r.has(u,n))a.setEdge(n,u[n]);else{if(f)throw new Error("Input graph is not connected: "+t);f=!0}t.nodeEdges(n).forEach(c)}return a}},4155:(t,e,n)=>{var r=n(6879);t.exports=function(t){var e=0,n=[],i={},o=[];function a(u){var s=i[u]={onStack:!0,lowlink:e,index:e++};if(n.push(u),t.successors(u).forEach((function(t){r.has(i,t)?i[t].onStack&&(s.lowlink=Math.min(s.lowlink,i[t].index)):(a(t),s.lowlink=Math.min(s.lowlink,i[t].lowlink))})),s.lowlink===s.index){var c,f=[];do{c=n.pop(),i[c].onStack=!1,f.push(c)}while(u!==c);o.push(f)}}return t.nodes().forEach((function(t){r.has(i,t)||a(t)})),o}},4417:(t,e,n)=>{var r=n(6879);function i(t){var e={},n={},i=[];if(r.each(t.sinks(),(function a(u){if(r.has(n,u))throw new o;r.has(e,u)||(n[u]=!0,e[u]=!0,r.each(t.predecessors(u),a),delete n[u],i.push(u))})),r.size(e)!==t.nodeCount())throw new o;return i}function o(){}t.exports=i,i.CycleException=o},758:(t,e,n)=>{var r=n(6879);function i(){this._arr=[],this._keyIndices={}}t.exports=i,i.prototype.size=function(){return this._arr.length},i.prototype.keys=function(){return this._arr.map((function(t){return t.key}))},i.prototype.has=function(t){return r.has(this._keyIndices,t)},i.prototype.priority=function(t){var e=this._keyIndices[t];if(void 0!==e)return this._arr[e].priority},i.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},i.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!r.has(n,t)){var i=this._arr,o=i.length;return n[t]=o,i.push({key:t,priority:e}),this._decrease(o),!0}return!1},i.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},i.prototype.decrease=function(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)},i.prototype._heapify=function(t){var e=this._arr,n=2*t,r=n+1,i=t;n<e.length&&(i=e[n].priority<e[i].priority?n:i,r<e.length&&(i=e[r].priority<e[i].priority?r:i),i!==t&&(this._swap(t,i),this._heapify(i)))},i.prototype._decrease=function(t){for(var e,n=this._arr,r=n[t].priority;0!==t&&!(n[e=t>>1].priority<r);)this._swap(t,e),t=e},i.prototype._swap=function(t,e){var n=this._arr,r=this._keyIndices,i=n[t],o=n[e];n[t]=o,n[e]=i,r[o.key]=t,r[i.key]=e}},5256:(t,e,n)=>{"use strict";var r=n(6879);t.exports=o;var i="\0";function o(t){this._isDirected=!r.has(t,"directed")||t.directed,this._isMultigraph=!!r.has(t,"multigraph")&&t.multigraph,this._isCompound=!!r.has(t,"compound")&&t.compound,this._label=void 0,this._defaultNodeLabelFn=r.constant(void 0),this._defaultEdgeLabelFn=r.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\0"]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function a(t,e){t[e]?t[e]++:t[e]=1}function u(t,e){--t[e]||delete t[e]}function s(t,e,n,i){var o=""+e,a=""+n;if(!t&&o>a){var u=o;o=a,a=u}return o+""+a+""+(r.isUndefined(i)?"\0":i)}function c(t,e,n,r){var i=""+e,o=""+n;if(!t&&i>o){var a=i;i=o,o=a}var u={v:i,w:o};return r&&(u.name=r),u}function f(t,e){return s(t,e.v,e.w,e.name)}o.prototype._nodeCount=0,o.prototype._edgeCount=0,o.prototype.isDirected=function(){return this._isDirected},o.prototype.isMultigraph=function(){return this._isMultigraph},o.prototype.isCompound=function(){return this._isCompound},o.prototype.setGraph=function(t){return this._label=t,this},o.prototype.graph=function(){return this._label},o.prototype.setDefaultNodeLabel=function(t){return r.isFunction(t)||(t=r.constant(t)),this._defaultNodeLabelFn=t,this},o.prototype.nodeCount=function(){return this._nodeCount},o.prototype.nodes=function(){return r.keys(this._nodes)},o.prototype.sources=function(){return r.filter(this.nodes(),r.bind((function(t){return r.isEmpty(this._in[t])}),this))},o.prototype.sinks=function(){return r.filter(this.nodes(),r.bind((function(t){return r.isEmpty(this._out[t])}),this))},o.prototype.setNodes=function(t,e){var n=arguments;return r.each(t,r.bind((function(t){n.length>1?this.setNode(t,e):this.setNode(t)}),this)),this},o.prototype.setNode=function(t,e){return r.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=i,this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},o.prototype.node=function(t){return this._nodes[t]},o.prototype.hasNode=function(t){return r.has(this._nodes,t)},o.prototype.removeNode=function(t){var e=this;if(r.has(this._nodes,t)){var n=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],r.each(this.children(t),r.bind((function(t){this.setParent(t)}),this)),delete this._children[t]),r.each(r.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],r.each(r.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},o.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(e))e=i;else{for(var n=e+="";!r.isUndefined(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},o.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},o.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if(e!==i)return e}},o.prototype.children=function(t){if(r.isUndefined(t)&&(t=i),this._isCompound){var e=this._children[t];if(e)return r.keys(e)}else{if(t===i)return this.nodes();if(this.hasNode(t))return[]}},o.prototype.predecessors=function(t){var e=this._preds[t];if(e)return r.keys(e)},o.prototype.successors=function(t){var e=this._sucs[t];if(e)return r.keys(e)},o.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return r.union(e,this.successors(t))},o.prototype.isLeaf=function(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length},o.prototype.filterNodes=function(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph()),r.each(this._nodes,r.bind((function(n,r){t(r)&&e.setNode(r,n)}),this)),r.each(this._edgeObjs,r.bind((function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,this.edge(t))}),this));var n=this,i={};function o(t){var r=n.parent(t);return void 0===r||e.hasNode(r)?(i[t]=r,r):r in i?i[r]:o(r)}return this._isCompound&&r.each(e.nodes(),(function(t){e.setParent(t,o(t))})),e},o.prototype.setDefaultEdgeLabel=function(t){return r.isFunction(t)||(t=r.constant(t)),this._defaultEdgeLabelFn=t,this},o.prototype.edgeCount=function(){return this._edgeCount},o.prototype.edges=function(){return r.values(this._edgeObjs)},o.prototype.setPath=function(t,e){var n=this,i=arguments;return r.reduce(t,(function(t,r){return i.length>1?n.setEdge(t,r,e):n.setEdge(t,r),r})),this},o.prototype.setEdge=function(){var t,e,n,i,o=!1,u=arguments[0];"object"==typeof u&&null!==u&&"v"in u?(t=u.v,e=u.w,n=u.name,2===arguments.length&&(i=arguments[1],o=!0)):(t=u,e=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),t=""+t,e=""+e,r.isUndefined(n)||(n=""+n);var f=s(this._isDirected,t,e,n);if(r.has(this._edgeLabels,f))return o&&(this._edgeLabels[f]=i),this;if(!r.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[f]=o?i:this._defaultEdgeLabelFn(t,e,n);var l=c(this._isDirected,t,e,n);return t=l.v,e=l.w,Object.freeze(l),this._edgeObjs[f]=l,a(this._preds[e],t),a(this._sucs[t],e),this._in[e][f]=l,this._out[t][f]=l,this._edgeCount++,this},o.prototype.edge=function(t,e,n){var r=1===arguments.length?f(this._isDirected,arguments[0]):s(this._isDirected,t,e,n);return this._edgeLabels[r]},o.prototype.hasEdge=function(t,e,n){var i=1===arguments.length?f(this._isDirected,arguments[0]):s(this._isDirected,t,e,n);return r.has(this._edgeLabels,i)},o.prototype.removeEdge=function(t,e,n){var r=1===arguments.length?f(this._isDirected,arguments[0]):s(this._isDirected,t,e,n),i=this._edgeObjs[r];return i&&(t=i.v,e=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],u(this._preds[e],t),u(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this},o.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var i=r.values(n);return e?r.filter(i,(function(t){return t.v===e})):i}},o.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var i=r.values(n);return e?r.filter(i,(function(t){return t.w===e})):i}},o.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))}},1946:(t,e,n)=>{t.exports={Graph:n(5256),version:n(7942)}},1603:(t,e,n)=>{var r=n(6879),i=n(5256);function o(t){return r.map(t.nodes(),(function(e){var n=t.node(e),i=t.parent(e),o={v:e};return r.isUndefined(n)||(o.value=n),r.isUndefined(i)||(o.parent=i),o}))}function a(t){return r.map(t.edges(),(function(e){var n=t.edge(e),i={v:e.v,w:e.w};return r.isUndefined(e.name)||(i.name=e.name),r.isUndefined(n)||(i.value=n),i}))}t.exports={write:function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:o(t),edges:a(t)};return r.isUndefined(t.graph())||(e.value=r.clone(t.graph())),e},read:function(t){var e=new i(t.options).setGraph(t.value);return r.each(t.nodes,(function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)})),r.each(t.edges,(function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)})),e}}},6879:(t,e,n)=>{var r;try{r=n(9392)}catch(t){}r||(r=window._),t.exports=r},7942:t=>{t.exports="2.1.4"},8344:(t,e)=>{"use strict";var n,r,i,o,a,u,s,c,f,l,h,d,p,v,g,y,m,b,_,x,w,E,S,A,T;(e.UX||(e.UX={})).TextureCompressionBC="texture-compression-bc",(T=e.OB||(e.OB={})).ClampToEdge="clamp-to-edge",T.Repeat="repeat",T.MirrorRepeat="mirror-repeat",(A=e.$l||(e.$l={})).UniformBuffer="uniform-buffer",A.StorageBuffer="storage-buffer",A.ReadonlyStorageBuffer="readonly-storage-buffer",A.Sampler="sampler",A.ComparisonSampler="comparison-sampler",A.SampledTexture="sampled-texture",A.ReadonlyStorageTexture="readonly-storage-texture",A.WriteonlyStorageTexture="writeonly-storage-texture",(S=e.zi||(e.zi={})).Zero="zero",S.One="one",S.SrcColor="src-color",S.OneMinusSrcColor="one-minus-src-color",S.SrcAlpha="src-alpha",S.OneMinusSrcAlpha="one-minus-src-alpha",S.DstColor="dst-color",S.OneMinusDstColor="one-minus-dst-color",S.DstAlpha="dst-alpha",S.OneMinusDstAlpha="one-minus-dst-alpha",S.SrcAlphaSaturated="src-alpha-saturated",S.BlendColor="blend-color",S.OneMinusBlendColor="one-minus-blend-color",(E=e.db||(e.db={})).Add="add",E.Subtract="subtract",E.ReverseSubtract="reverse-subtract",E.Min="min",E.Max="max",(w=e.wb||(e.wb={})).Never="never",w.Less="less",w.Equal="equal",w.LessEqual="less-equal",w.Greater="greater",w.NotEqual="not-equal",w.GreaterEqual="greater-equal",w.Always="always",(x=e.Wf||(e.Wf={})).None="none",x.Front="front",x.Back="back",(_=e.X9||(e.X9={})).Nearest="nearest",_.Linear="linear",(b=e.zX||(e.zX={})).CCW="ccw",b.CW="cw",(m=e.iD||(e.iD={})).Uint16="uint16",m.Uint32="uint32",(y=e.V||(e.V={})).Vertex="vertex",y.Instance="instance",(e.Ws||(e.Ws={})).Load="load",(g=e.YV||(e.YV={})).PointList="point-list",g.LineList="line-list",g.LineStrip="line-strip",g.TriangleList="triangle-list",g.TriangleStrip="triangle-strip",(v=e.xS||(e.xS={})).Keep="keep",v.Zero="zero",v.Replace="replace",v.Invert="invert",v.IncrementClamp="increment-clamp",v.DecrementClamp="decrement-clamp",v.IncrementWrap="increment-wrap",v.DecrementWrap="decrement-wrap",(p=e.EG||(e.EG={})).Store="store",p.Clear="clear",(d=e.kd||(e.kd={})).E1d="1d",d.E2d="2d",d.E3d="3d",(h=e.EV||(e.EV={})).R8Unorm="r8unorm",h.R8Snorm="r8snorm",h.R8Uint="r8uint",h.R8Sint="r8sint",h.R16Uint="r16uint",h.R16Sint="r16sint",h.R16Float="r16float",h.RG8Unorm="rg8unorm",h.RG8Snorm="rg8snorm",h.RG8Uint="rg8uint",h.RG8Sint="rg8sint",h.R32Uint="r32uint",h.R32Sint="r32sint",h.R32Float="r32float",h.RG16Uint="rg16uint",h.RG16Sint="rg16sint",h.RG16Float="rg16float",h.RGBA8Unorm="rgba8unorm",h.RGBA8UnormSRGB="rgba8unorm-srgb",h.RGBA8Snorm="rgba8snorm",h.RGBA8Uint="rgba8uint",h.RGBA8Sint="rgba8sint",h.BGRA8Unorm="bgra8unorm",h.BGRA8UnormSRGB="bgra8unorm-srgb",h.RGB10A2Unorm="rgb10a2unorm",h.RG11B10Float="rg11b10float",h.RG32Uint="rg32uint",h.RG32Sint="rg32sint",h.RG32Float="rg32float",h.RGBA16Uint="rgba16uint",h.RGBA16Sint="rgba16sint",h.RGBA16Float="rgba16float",h.RGBA32Uint="rgba32uint",h.RGBA32Sint="rgba32sint",h.RGBA32Float="rgba32float",h.Depth32Float="depth32float",h.Depth24Plus="depth24plus",h.Depth24PlusStencil8="depth24plus-stencil8",(l=e.Ek||(e.Ek={})).Float="float",l.Sint="sint",l.Uint="uint",(f=e.p_||(e.p_={})).E1d="1d",f.E2d="2d",f.E2dArray="2d-array",f.Cube="cube",f.CubeArray="cube-array",f.E3d="3d",(c=e.gB||(e.gB={})).Uchar2="uchar2",c.Uchar4="uchar4",c.Char2="char2",c.Char4="char4",c.Uchar2Norm="uchar2norm",c.Uchar4Norm="uchar4norm",c.Char2Norm="char2norm",c.Char4Norm="char4norm",c.Ushort2="ushort2",c.Ushort4="ushort4",c.Short2="short2",c.Short4="short4",c.Ushort2Norm="ushort2norm",c.Ushort4Norm="ushort4norm",c.Short2Norm="short2norm",c.Short4Norm="short4norm",c.Half2="half2",c.Half4="half4",c.Float="float",c.Float2="float2",c.Float3="float3",c.Float4="float4",c.Uint="uint",c.Uint2="uint2",c.Uint3="uint3",c.Uint4="uint4",c.Int="int",c.Int2="int2",c.Int3="int3",c.Int4="int4",(s=e.H7||(e.H7={})).All="all",s.StencilOnly="stencil-only",s.DepthOnly="depth-only",(u=e.mj||(e.mj={})).Error="error",u.Warning="warning",u.Info="info",(e.xL||(e.xL={})).Occlusion="occlusion",(a=e.FB||(e.FB={}))[a.MapRead=1]="MapRead",a[a.MapWrite=2]="MapWrite",a[a.CopySrc=4]="CopySrc",a[a.CopyDst=8]="CopyDst",a[a.Index=16]="Index",a[a.Vertex=32]="Vertex",a[a.Uniform=64]="Uniform",a[a.Storage=128]="Storage",a[a.Indirect=256]="Indirect",a[a.QueryResolve=512]="QueryResolve",(o=e.Yw||(e.Yw={}))[o.Red=1]="Red",o[o.Green=2]="Green",o[o.Blue=4]="Blue",o[o.Alpha=8]="Alpha",o[o.All=15]="All",(i=e.$X||(e.$X={}))[i.Vertex=1]="Vertex",i[i.Fragment=2]="Fragment",i[i.Compute=4]="Compute",(r=e.v2||(e.v2={}))[r.CopySrc=1]="CopySrc",r[r.CopyDst=2]="CopyDst",r[r.Sampled=4]="Sampled",r[r.Storage=8]="Storage",r[r.OutputAttachment=16]="OutputAttachment",(n=e.gc||(e.gc={}))[n.Read=1]="Read",n[n.Write=2]="Write"},9504:(t,e,n)=>{n(2825),n(6051),n(2640),n(9518),n(8201),n(470),n(5723),n(7525),n(9788),n(1498),n(7577),n(6129),n(2802),n(7940),n(5261),n(9340),n(1584),n(7298),n(1765),n(5747),n(7451),n(2784),n(2809),n(7454),n(3053),n(8032),n(7551),n(2929),n(215),n(6183),n(8190),n(476),n(948),n(942),n(2870),n(2212),n(4230),n(9754),n(2811),n(3998),n(1769),n(8789),n(2848),n(1762),n(1323),n(6063),n(3282),n(6816),n(1854),n(3303),n(4421),n(2203),n(1028),n(6818),n(5557),n(7938),n(8316),n(7937),n(637),n(8219),n(9029),n(3157),n(9791),n(2296),n(4555),n(6505),n(4722),n(9713),n(7392),n(4687),n(3684),n(3339),n(4148),n(7754),n(4094),n(8781),n(5013),n(3735),n(8723),n(2247),n(9689),n(9003),n(9026),n(4088),n(535),n(5788),n(7878),n(5119),n(3135),n(5015),n(8059),n(646),n(5377),n(9879),n(5305),n(6341),n(5915),n(4488),n(9281),n(163),n(6668),n(7139),n(6408),n(8686),n(5480),n(9121),n(914),n(7742),n(7843),n(6441),n(429),n(2214),n(498),n(6349),n(3742),n(9604),n(2592),n(9290),n(9363),n(3871),n(8632),n(1838),n(3421),n(6144),n(8275),n(2552),n(3077),n(1031),n(8916),n(8978),n(8531),n(7323),n(3704),n(3153),n(8812),n(2636),n(1602),n(377),t.exports=n(2845)},721:(t,e,n)=>{n(7744),t.exports=n(2845).Array.flatMap},3982:(t,e,n)=>{n(5448),t.exports=n(2845).Array.includes},3515:(t,e,n)=>{n(8938),t.exports=n(2845).Object.entries},547:(t,e,n)=>{n(7819),t.exports=n(2845).Object.getOwnPropertyDescriptors},5967:(t,e,n)=>{n(6572),t.exports=n(2845).Object.values},3042:(t,e,n)=>{"use strict";n(7843),n(8228),t.exports=n(2845).Promise.finally},3898:(t,e,n)=>{n(3336),t.exports=n(2845).String.padEnd},5778:(t,e,n)=>{n(3718),t.exports=n(2845).String.padStart},5834:(t,e,n)=>{n(6642),t.exports=n(2845).String.trimRight},7536:(t,e,n)=>{n(7831),t.exports=n(2845).String.trimLeft},6945:(t,e,n)=>{n(9956),t.exports=n(7686).f("asyncIterator")},2680:(t,e,n)=>{n(8358),t.exports=n(3142).global},3749:t=>{t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},8891:(t,e,n)=>{var r=n(2799);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},3142:t=>{var e=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=e)},5526:(t,e,n)=>{var r=n(3749);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},7498:(t,e,n)=>{t.exports=!n(9880)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},2004:(t,e,n)=>{var r=n(2799),i=n(5505).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},2069:(t,e,n)=>{var r=n(5505),i=n(3142),o=n(5526),a=n(5954),u=n(9761),s=function(t,e,n){var c,f,l,h=t&s.F,d=t&s.G,p=t&s.S,v=t&s.P,g=t&s.B,y=t&s.W,m=d?i:i[e]||(i[e]={}),b=m.prototype,_=d?r:p?r[e]:(r[e]||{}).prototype;for(c in d&&(n=e),n)(f=!h&&_&&void 0!==_[c])&&u(m,c)||(l=f?_[c]:n[c],m[c]=d&&"function"!=typeof _[c]?n[c]:g&&f?o(l,r):y&&_[c]==l?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(l):v&&"function"==typeof l?o(Function.call,l):l,v&&((m.virtual||(m.virtual={}))[c]=l,t&s.R&&b&&!b[c]&&a(b,c,l)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},9880:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},5505:t=>{var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},9761:t=>{var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},5954:(t,e,n)=>{var r=n(5584),i=n(5734);t.exports=n(7498)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},4053:(t,e,n)=>{t.exports=!n(7498)&&!n(9880)((function(){return 7!=Object.defineProperty(n(2004)("div"),"a",{get:function(){return 7}}).a}))},2799:t=>{t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},5584:(t,e,n)=>{var r=n(8891),i=n(4053),o=n(923),a=Object.defineProperty;e.f=n(7498)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},5734:t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},923:(t,e,n)=>{var r=n(2799);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},8358:(t,e,n)=>{var r=n(2069);r(r.G,{global:n(5505)})},1464:t=>{t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},8347:(t,e,n)=>{var r=n(1669);t.exports=function(t,e){if("number"!=typeof t&&"Number"!=r(t))throw TypeError(e);return+t}},4691:(t,e,n)=>{var r=n(341)("unscopables"),i=Array.prototype;null==i[r]&&n(913)(i,r,{}),t.exports=function(t){i[r][t]=!0}},178:(t,e,n)=>{"use strict";var r=n(8016)(!0);t.exports=function(t,e,n){return e+(n?r(t,e).length:1)}},6903:t=>{t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},486:(t,e,n)=>{var r=n(1255);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},1064:(t,e,n)=>{"use strict";var r=n(7583),i=n(9260),o=n(8087);t.exports=[].copyWithin||function(t,e){var n=r(this),a=o(n.length),u=i(t,a),s=i(e,a),c=arguments.length>2?arguments[2]:void 0,f=Math.min((void 0===c?a:i(c,a))-s,a-u),l=1;for(s<u&&u<s+f&&(l=-1,s+=f-1,u+=f-1);f-- >0;)s in n?n[u]=n[s]:delete n[u],u+=l,s+=l;return n}},8676:(t,e,n)=>{"use strict";var r=n(7583),i=n(9260),o=n(8087);t.exports=function(t){for(var e=r(this),n=o(e.length),a=arguments.length,u=i(a>1?arguments[1]:void 0,n),s=a>2?arguments[2]:void 0,c=void 0===s?n:i(s,n);c>u;)e[u++]=t;return e}},4538:(t,e,n)=>{var r=n(8182),i=n(8087),o=n(9260);t.exports=function(t){return function(e,n,a){var u,s=r(e),c=i(s.length),f=o(a,c);if(t&&n!=n){for(;c>f;)if((u=s[f++])!=u)return!0}else for(;c>f;f++)if((t||f in s)&&s[f]===n)return t||f||0;return!t&&-1}}},7622:(t,e,n)=>{var r=n(994),i=n(8579),o=n(7583),a=n(8087),u=n(6699);t.exports=function(t,e){var n=1==t,s=2==t,c=3==t,f=4==t,l=6==t,h=5==t||l,d=e||u;return function(e,u,p){for(var v,g,y=o(e),m=i(y),b=r(u,p,3),_=a(m.length),x=0,w=n?d(e,_):s?d(e,0):void 0;_>x;x++)if((h||x in m)&&(g=b(v=m[x],x,y),t))if(n)w[x]=g;else if(g)switch(t){case 3:return!0;case 5:return v;case 6:return x;case 2:w.push(v)}else if(f)return!1;return l?-1:c||f?f:w}}},5336:(t,e,n)=>{var r=n(1464),i=n(7583),o=n(8579),a=n(8087);t.exports=function(t,e,n,u,s){r(e);var c=i(t),f=o(c),l=a(c.length),h=s?l-1:0,d=s?-1:1;if(n<2)for(;;){if(h in f){u=f[h],h+=d;break}if(h+=d,s?h<0:l<=h)throw TypeError("Reduce of empty array with no initial value")}for(;s?h>=0:l>h;h+=d)h in f&&(u=e(u,f[h],h,c));return u}},7600:(t,e,n)=>{var r=n(1255),i=n(7183),o=n(341)("species");t.exports=function(t){var e;return i(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!i(e.prototype)||(e=void 0),r(e)&&null===(e=e[o])&&(e=void 0)),void 0===e?Array:e}},6699:(t,e,n)=>{var r=n(7600);t.exports=function(t,e){return new(r(t))(e)}},8366:(t,e,n)=>{"use strict";var r=n(1464),i=n(1255),o=n(8262),a=[].slice,u={},s=function(t,e,n){if(!(e in u)){for(var r=[],i=0;i<e;i++)r[i]="a["+i+"]";u[e]=Function("F,a","return new F("+r.join(",")+")")}return u[e](t,n)};t.exports=Function.bind||function(t){var e=r(this),n=a.call(arguments,1),u=function(){var r=n.concat(a.call(arguments));return this instanceof u?s(e,r.length,r):o(e,r,t)};return i(e.prototype)&&(u.prototype=e.prototype),u}},4939:(t,e,n)=>{var r=n(1669),i=n(341)("toStringTag"),o="Arguments"==r(function(){return arguments}());t.exports=function(t){var e,n,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),i))?n:o?r(e):"Object"==(a=r(e))&&"function"==typeof e.callee?"Arguments":a}},1669:t=>{var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},3050:(t,e,n)=>{"use strict";var r=n(3886).f,i=n(9055),o=n(8565),a=n(994),u=n(6903),s=n(9822),c=n(966),f=n(8782),l=n(4412),h=n(1216),d=n(4278).fastKey,p=n(4664),v=h?"_s":"size",g=function(t,e){var n,r=d(e);if("F"!==r)return t._i[r];for(n=t._f;n;n=n.n)if(n.k==e)return n};t.exports={getConstructor:function(t,e,n,c){var f=t((function(t,r){u(t,f,e,"_i"),t._t=e,t._i=i(null),t._f=void 0,t._l=void 0,t[v]=0,null!=r&&s(r,n,t[c],t)}));return o(f.prototype,{clear:function(){for(var t=p(this,e),n=t._i,r=t._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];t._f=t._l=void 0,t[v]=0},delete:function(t){var n=p(this,e),r=g(n,t);if(r){var i=r.n,o=r.p;delete n._i[r.i],r.r=!0,o&&(o.n=i),i&&(i.p=o),n._f==r&&(n._f=i),n._l==r&&(n._l=o),n[v]--}return!!r},forEach:function(t){p(this,e);for(var n,r=a(t,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(t){return!!g(p(this,e),t)}}),h&&r(f.prototype,"size",{get:function(){return p(this,e)[v]}}),f},def:function(t,e,n){var r,i,o=g(t,e);return o?o.v=n:(t._l=o={i:i=d(e,!0),k:e,v:n,p:r=t._l,n:void 0,r:!1},t._f||(t._f=o),r&&(r.n=o),t[v]++,"F"!==i&&(t._i[i]=o)),t},getEntry:g,setStrong:function(t,e,n){c(t,e,(function(t,n){this._t=p(t,e),this._k=n,this._l=void 0}),(function(){for(var t=this,e=t._k,n=t._l;n&&n.r;)n=n.p;return t._t&&(t._l=n=n?n.n:t._t._f)?f(0,"keys"==e?n.k:"values"==e?n.v:[n.k,n.v]):(t._t=void 0,f(1))}),n?"entries":"values",!n,!0),l(e)}}},1990:(t,e,n)=>{"use strict";var r=n(8565),i=n(4278).getWeak,o=n(486),a=n(1255),u=n(6903),s=n(9822),c=n(7622),f=n(7384),l=n(4664),h=c(5),d=c(6),p=0,v=function(t){return t._l||(t._l=new g)},g=function(){this.a=[]},y=function(t,e){return h(t.a,(function(t){return t[0]===e}))};g.prototype={get:function(t){var e=y(this,t);if(e)return e[1]},has:function(t){return!!y(this,t)},set:function(t,e){var n=y(this,t);n?n[1]=e:this.a.push([t,e])},delete:function(t){var e=d(this.a,(function(e){return e[0]===t}));return~e&&this.a.splice(e,1),!!~e}},t.exports={getConstructor:function(t,e,n,o){var c=t((function(t,r){u(t,c,e,"_i"),t._t=e,t._i=p++,t._l=void 0,null!=r&&s(r,n,t[o],t)}));return r(c.prototype,{delete:function(t){if(!a(t))return!1;var n=i(t);return!0===n?v(l(this,e)).delete(t):n&&f(n,this._i)&&delete n[this._i]},has:function(t){if(!a(t))return!1;var n=i(t);return!0===n?v(l(this,e)).has(t):n&&f(n,this._i)}}),c},def:function(t,e,n){var r=i(o(e),!0);return!0===r?v(t).set(e,n):r[t._i]=n,t},ufstore:v}},859:(t,e,n)=>{"use strict";var r=n(7571),i=n(7044),o=n(6476),a=n(8565),u=n(4278),s=n(9822),c=n(6903),f=n(1255),l=n(5338),h=n(2803),d=n(5837),p=n(116);t.exports=function(t,e,n,v,g,y){var m=r[t],b=m,_=g?"set":"add",x=b&&b.prototype,w={},E=function(t){var e=x[t];o(x,t,"delete"==t||"has"==t?function(t){return!(y&&!f(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return y&&!f(t)?void 0:e.call(this,0===t?0:t)}:"add"==t?function(t){return e.call(this,0===t?0:t),this}:function(t,n){return e.call(this,0===t?0:t,n),this})};if("function"==typeof b&&(y||x.forEach&&!l((function(){(new b).entries().next()})))){var S=new b,A=S[_](y?{}:-0,1)!=S,T=l((function(){S.has(1)})),I=h((function(t){new b(t)})),C=!y&&l((function(){for(var t=new b,e=5;e--;)t[_](e,e);return!t.has(-0)}));I||((b=e((function(e,n){c(e,b,t);var r=p(new m,e,b);return null!=n&&s(n,g,r[_],r),r}))).prototype=x,x.constructor=b),(T||C)&&(E("delete"),E("has"),g&&E("get")),(C||A)&&E(_),y&&x.clear&&delete x.clear}else b=v.getConstructor(e,t,g,_),a(b.prototype,n),u.NEED=!0;return d(b,t),w[t]=b,i(i.G+i.W+i.F*(b!=m),w),y||v.setStrong(b,t,g),b}},2845:t=>{var e=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=e)},1395:(t,e,n)=>{"use strict";var r=n(3886),i=n(8328);t.exports=function(t,e,n){e in t?r.f(t,e,i(0,n)):t[e]=n}},994:(t,e,n)=>{var r=n(1464);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},4506:(t,e,n)=>{"use strict";var r=n(5338),i=Date.prototype.getTime,o=Date.prototype.toISOString,a=function(t){return t>9?t:"0"+t};t.exports=r((function(){return"0385-07-25T07:06:39.999Z"!=o.call(new Date(-50000000000001))}))||!r((function(){o.call(new Date(NaN))}))?function(){if(!isFinite(i.call(this)))throw RangeError("Invalid time value");var t=this,e=t.getUTCFullYear(),n=t.getUTCMilliseconds(),r=e<0?"-":e>9999?"+":"";return r+("00000"+Math.abs(e)).slice(r?-6:-4)+"-"+a(t.getUTCMonth()+1)+"-"+a(t.getUTCDate())+"T"+a(t.getUTCHours())+":"+a(t.getUTCMinutes())+":"+a(t.getUTCSeconds())+"."+(n>99?n:"0"+a(n))+"Z"}:o},9514:(t,e,n)=>{"use strict";var r=n(486),i=n(4467),o="number";t.exports=function(t){if("string"!==t&&t!==o&&"default"!==t)throw TypeError("Incorrect hint");return i(r(this),t!=o)}},5091:t=>{t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},1216:(t,e,n)=>{t.exports=!n(5338)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},3438:(t,e,n)=>{var r=n(1255),i=n(7571).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},9824:t=>{t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},6397:(t,e,n)=>{var r=n(9804),i=n(3844),o=n(4179);t.exports=function(t){var e=r(t),n=i.f;if(n)for(var a,u=n(t),s=o.f,c=0;u.length>c;)s.call(t,a=u[c++])&&e.push(a);return e}},7044:(t,e,n)=>{var r=n(7571),i=n(2845),o=n(913),a=n(6476),u=n(994),s=function(t,e,n){var c,f,l,h,d=t&s.F,p=t&s.G,v=t&s.S,g=t&s.P,y=t&s.B,m=p?r:v?r[e]||(r[e]={}):(r[e]||{}).prototype,b=p?i:i[e]||(i[e]={}),_=b.prototype||(b.prototype={});for(c in p&&(n=e),n)l=((f=!d&&m&&void 0!==m[c])?m:n)[c],h=y&&f?u(l,r):g&&"function"==typeof l?u(Function.call,l):l,m&&a(m,c,l,t&s.U),b[c]!=l&&o(b,c,h),g&&_[c]!=l&&(_[c]=l)};r.core=i,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},2910:(t,e,n)=>{var r=n(341)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,!"/./"[t](e)}catch(t){}}return!0}},5338:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},6719:(t,e,n)=>{"use strict";n(7139);var r=n(6476),i=n(913),o=n(5338),a=n(5091),u=n(341),s=n(9020),c=u("species"),f=!o((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),l=function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();t.exports=function(t,e,n){var h=u(t),d=!o((function(){var e={};return e[h]=function(){return 7},7!=""[t](e)})),p=d?!o((function(){var e=!1,n=/a/;return n.exec=function(){return e=!0,null},"split"===t&&(n.constructor={},n.constructor[c]=function(){return n}),n[h](""),!e})):void 0;if(!d||!p||"replace"===t&&!f||"split"===t&&!l){var v=/./[h],g=n(a,h,""[t],(function(t,e,n,r,i){return e.exec===s?d&&!i?{done:!0,value:v.call(e,n,r)}:{done:!0,value:t.call(n,e,r)}:{done:!1}})),y=g[0],m=g[1];r(String.prototype,t,y),i(RegExp.prototype,h,2==e?function(t,e){return m.call(t,this,e)}:function(t){return m.call(t,this)})}}},3649:(t,e,n)=>{"use strict";var r=n(486);t.exports=function(){var t=r(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},6806:(t,e,n)=>{"use strict";var r=n(7183),i=n(1255),o=n(8087),a=n(994),u=n(341)("isConcatSpreadable");t.exports=function t(e,n,s,c,f,l,h,d){for(var p,v,g=f,y=0,m=!!h&&a(h,d,3);y<c;){if(y in s){if(p=m?m(s[y],y,n):s[y],v=!1,i(p)&&(v=void 0!==(v=p[u])?!!v:r(p)),v&&l>0)g=t(e,n,p,o(p.length),g,l-1)-1;else{if(g>=9007199254740991)throw TypeError();e[g]=p}g++}y++}return g}},9822:(t,e,n)=>{var r=n(994),i=n(4902),o=n(9981),a=n(486),u=n(8087),s=n(9685),c={},f={},l=t.exports=function(t,e,n,l,h){var d,p,v,g,y=h?function(){return t}:s(t),m=r(n,l,e?2:1),b=0;if("function"!=typeof y)throw TypeError(t+" is not iterable!");if(o(y)){for(d=u(t.length);d>b;b++)if((g=e?m(a(p=t[b])[0],p[1]):m(t[b]))===c||g===f)return g}else for(v=y.call(t);!(p=v.next()).done;)if((g=i(v,m,p.value,e))===c||g===f)return g};l.BREAK=c,l.RETURN=f},8454:(t,e,n)=>{t.exports=n(5570)("native-function-to-string",Function.toString)},7571:t=>{var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},7384:t=>{var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},913:(t,e,n)=>{var r=n(3886),i=n(8328);t.exports=n(1216)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},7680:(t,e,n)=>{var r=n(7571).document;t.exports=r&&r.documentElement},6252:(t,e,n)=>{t.exports=!n(1216)&&!n(5338)((function(){return 7!=Object.defineProperty(n(3438)("div"),"a",{get:function(){return 7}}).a}))},116:(t,e,n)=>{var r=n(1255),i=n(473).set;t.exports=function(t,e,n){var o,a=e.constructor;return a!==n&&"function"==typeof a&&(o=a.prototype)!==n.prototype&&r(o)&&i&&i(t,o),t}},8262:t=>{t.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},8579:(t,e,n)=>{var r=n(1669);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},9981:(t,e,n)=>{var r=n(9740),i=n(341)("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||o[i]===t)}},7183:(t,e,n)=>{var r=n(1669);t.exports=Array.isArray||function(t){return"Array"==r(t)}},1272:(t,e,n)=>{var r=n(1255),i=Math.floor;t.exports=function(t){return!r(t)&&isFinite(t)&&i(t)===t}},1255:t=>{t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},8990:(t,e,n)=>{var r=n(1255),i=n(1669),o=n(341)("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[o])?!!e:"RegExp"==i(t))}},4902:(t,e,n)=>{var r=n(486);t.exports=function(t,e,n,i){try{return i?e(r(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&r(o.call(t)),e}}},4529:(t,e,n)=>{"use strict";var r=n(9055),i=n(8328),o=n(5837),a={};n(913)(a,n(341)("iterator"),(function(){return this})),t.exports=function(t,e,n){t.prototype=r(a,{next:i(1,n)}),o(t,e+" Iterator")}},966:(t,e,n)=>{"use strict";var r=n(2725),i=n(7044),o=n(6476),a=n(913),u=n(9740),s=n(4529),c=n(5837),f=n(9881),l=n(341)("iterator"),h=!([].keys&&"next"in[].keys()),d="keys",p="values",v=function(){return this};t.exports=function(t,e,n,g,y,m,b){s(n,e,g);var _,x,w,E=function(t){if(!h&&t in I)return I[t];switch(t){case d:case p:return function(){return new n(this,t)}}return function(){return new n(this,t)}},S=e+" Iterator",A=y==p,T=!1,I=t.prototype,C=I[l]||I["@@iterator"]||y&&I[y],D=C||E(y),N=y?A?E("entries"):D:void 0,k="Array"==e&&I.entries||C;if(k&&(w=f(k.call(new t)))!==Object.prototype&&w.next&&(c(w,S,!0),r||"function"==typeof w[l]||a(w,l,v)),A&&C&&C.name!==p&&(T=!0,D=function(){return C.call(this)}),r&&!b||!h&&!T&&I[l]||a(I,l,D),u[e]=D,u[S]=v,y)if(_={values:A?D:E(p),keys:m?D:E(d),entries:N},b)for(x in _)x in I||o(I,x,_[x]);else i(i.P+i.F*(h||T),e,_);return _}},2803:(t,e,n)=>{var r=n(341)("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!i)return!1;var n=!1;try{var o=[7],a=o[r]();a.next=function(){return{done:n=!0}},o[r]=function(){return a},t(o)}catch(t){}return n}},8782:t=>{t.exports=function(t,e){return{value:e,done:!!t}}},9740:t=>{t.exports={}},2725:t=>{t.exports=!1},959:t=>{var e=Math.expm1;t.exports=!e||e(10)>22025.465794806718||e(10)<22025.465794806718||-2e-17!=e(-2e-17)?function(t){return 0==(t=+t)?t:t>-1e-6&&t<1e-6?t+t*t/2:Math.exp(t)-1}:e},7682:(t,e,n)=>{var r=n(2987),i=Math.pow,o=i(2,-52),a=i(2,-23),u=i(2,127)*(2-a),s=i(2,-126);t.exports=Math.fround||function(t){var e,n,i=Math.abs(t),c=r(t);return i<s?c*(i/s/a+1/o-1/o)*s*a:(n=(e=(1+a/o)*i)-(e-i))>u||n!=n?c*(1/0):c*n}},1618:t=>{t.exports=Math.log1p||function(t){return(t=+t)>-1e-8&&t<1e-8?t-t*t/2:Math.log(1+t)}},2987:t=>{t.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},4278:(t,e,n)=>{var r=n(4316)("meta"),i=n(1255),o=n(7384),a=n(3886).f,u=0,s=Object.isExtensible||function(){return!0},c=!n(5338)((function(){return s(Object.preventExtensions({}))})),f=function(t){a(t,r,{value:{i:"O"+ ++u,w:{}}})},l=t.exports={KEY:r,NEED:!1,fastKey:function(t,e){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,r)){if(!s(t))return"F";if(!e)return"E";f(t)}return t[r].i},getWeak:function(t,e){if(!o(t,r)){if(!s(t))return!0;if(!e)return!1;f(t)}return t[r].w},onFreeze:function(t){return c&&l.NEED&&s(t)&&!o(t,r)&&f(t),t}}},7485:(t,e,n)=>{var r=n(7571),i=n(7225).set,o=r.MutationObserver||r.WebKitMutationObserver,a=r.process,u=r.Promise,s="process"==n(1669)(a);t.exports=function(){var t,e,n,c=function(){var r,i;for(s&&(r=a.domain)&&r.exit();t;){i=t.fn,t=t.next;try{i()}catch(r){throw t?n():e=void 0,r}}e=void 0,r&&r.enter()};if(s)n=function(){a.nextTick(c)};else if(!o||r.navigator&&r.navigator.standalone)if(u&&u.resolve){var f=u.resolve(void 0);n=function(){f.then(c)}}else n=function(){i.call(r,c)};else{var l=!0,h=document.createTextNode("");new o(c).observe(h,{characterData:!0}),n=function(){h.data=l=!l}}return function(r){var i={fn:r,next:void 0};e&&(e.next=i),t||(t=i,n()),e=i}}},449:(t,e,n)=>{"use strict";var r=n(1464);function i(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=r(e),this.reject=r(n)}t.exports.f=function(t){return new i(t)}},4643:(t,e,n)=>{"use strict";var r=n(1216),i=n(9804),o=n(3844),a=n(4179),u=n(7583),s=n(8579),c=Object.assign;t.exports=!c||n(5338)((function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach((function(t){e[t]=t})),7!=c({},t)[n]||Object.keys(c({},e)).join("")!=r}))?function(t,e){for(var n=u(t),c=arguments.length,f=1,l=o.f,h=a.f;c>f;)for(var d,p=s(arguments[f++]),v=l?i(p).concat(l(p)):i(p),g=v.length,y=0;g>y;)d=v[y++],r&&!h.call(p,d)||(n[d]=p[d]);return n}:c},9055:(t,e,n)=>{var r=n(486),i=n(6283),o=n(9824),a=n(3574)("IE_PROTO"),u=function(){},s=function(){var t,e=n(3438)("iframe"),r=o.length;for(e.style.display="none",n(7680).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),s=t.F;r--;)delete s.prototype[o[r]];return s()};t.exports=Object.create||function(t,e){var n;return null!==t?(u.prototype=r(t),n=new u,u.prototype=null,n[a]=t):n=s(),void 0===e?n:i(n,e)}},3886:(t,e,n)=>{var r=n(486),i=n(6252),o=n(4467),a=Object.defineProperty;e.f=n(1216)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},6283:(t,e,n)=>{var r=n(3886),i=n(486),o=n(9804);t.exports=n(1216)?Object.defineProperties:function(t,e){i(t);for(var n,a=o(e),u=a.length,s=0;u>s;)r.f(t,n=a[s++],e[n]);return t}},5385:(t,e,n)=>{var r=n(4179),i=n(8328),o=n(8182),a=n(4467),u=n(7384),s=n(6252),c=Object.getOwnPropertyDescriptor;e.f=n(1216)?c:function(t,e){if(t=o(t),e=a(e,!0),s)try{return c(t,e)}catch(t){}if(u(t,e))return i(!r.f.call(t,e),t[e])}},3473:(t,e,n)=>{var r=n(8182),i=n(6907).f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return a&&"[object Window]"==o.call(t)?function(t){try{return i(t)}catch(t){return a.slice()}}(t):i(r(t))}},6907:(t,e,n)=>{var r=n(946),i=n(9824).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},3844:(t,e)=>{e.f=Object.getOwnPropertySymbols},9881:(t,e,n)=>{var r=n(7384),i=n(7583),o=n(3574)("IE_PROTO"),a=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),r(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},946:(t,e,n)=>{var r=n(7384),i=n(8182),o=n(4538)(!1),a=n(3574)("IE_PROTO");t.exports=function(t,e){var n,u=i(t),s=0,c=[];for(n in u)n!=a&&r(u,n)&&c.push(n);for(;e.length>s;)r(u,n=e[s++])&&(~o(c,n)||c.push(n));return c}},9804:(t,e,n)=>{var r=n(946),i=n(9824);t.exports=Object.keys||function(t){return r(t,i)}},4179:(t,e)=>{e.f={}.propertyIsEnumerable},381:(t,e,n)=>{var r=n(7044),i=n(2845),o=n(5338);t.exports=function(t,e){var n=(i.Object||{})[t]||Object[t],a={};a[t]=e(n),r(r.S+r.F*o((function(){n(1)})),"Object",a)}},6460:(t,e,n)=>{var r=n(1216),i=n(9804),o=n(8182),a=n(4179).f;t.exports=function(t){return function(e){for(var n,u=o(e),s=i(u),c=s.length,f=0,l=[];c>f;)n=s[f++],r&&!a.call(u,n)||l.push(t?[n,u[n]]:u[n]);return l}}},8125:(t,e,n)=>{var r=n(6907),i=n(3844),o=n(486),a=n(7571).Reflect;t.exports=a&&a.ownKeys||function(t){var e=r.f(o(t)),n=i.f;return n?e.concat(n(t)):e}},1885:(t,e,n)=>{var r=n(7571).parseFloat,i=n(4961).trim;t.exports=1/r(n(1644)+"-0")!=-1/0?function(t){var e=i(String(t),3),n=r(e);return 0===n&&"-"==e.charAt(0)?-0:n}:r},343:(t,e,n)=>{var r=n(7571).parseInt,i=n(4961).trim,o=n(1644),a=/^[-+]?0[xX]/;t.exports=8!==r(o+"08")||22!==r(o+"0x16")?function(t,e){var n=i(String(t),3);return r(n,e>>>0||(a.test(n)?16:10))}:r},9696:t=>{t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},909:(t,e,n)=>{var r=n(486),i=n(1255),o=n(449);t.exports=function(t,e){if(r(t),i(e)&&e.constructor===t)return e;var n=o.f(t);return(0,n.resolve)(e),n.promise}},8328:t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},8565:(t,e,n)=>{var r=n(6476);t.exports=function(t,e,n){for(var i in e)r(t,i,e[i],n);return t}},6476:(t,e,n)=>{var r=n(7571),i=n(913),o=n(7384),a=n(4316)("src"),u=n(8454),s="toString",c=(""+u).split(s);n(2845).inspectSource=function(t){return u.call(t)},(t.exports=function(t,e,n,u){var s="function"==typeof n;s&&(o(n,"name")||i(n,"name",e)),t[e]!==n&&(s&&(o(n,a)||i(n,a,t[e]?""+t[e]:c.join(String(e)))),t===r?t[e]=n:u?t[e]?t[e]=n:i(t,e,n):(delete t[e],i(t,e,n)))})(Function.prototype,s,(function(){return"function"==typeof this&&this[a]||u.call(this)}))},2968:(t,e,n)=>{"use strict";var r=n(4939),i=RegExp.prototype.exec;t.exports=function(t,e){var n=t.exec;if("function"==typeof n){var o=n.call(t,e);if("object"!=typeof o)throw new TypeError("RegExp exec method returned something other than an Object or null");return o}if("RegExp"!==r(t))throw new TypeError("RegExp#exec called on incompatible receiver");return i.call(t,e)}},9020:(t,e,n)=>{"use strict";var r,i,o=n(3649),a=RegExp.prototype.exec,u=String.prototype.replace,s=a,c=(r=/a/,i=/b*/g,a.call(r,"a"),a.call(i,"a"),0!==r.lastIndex||0!==i.lastIndex),f=void 0!==/()??/.exec("")[1];(c||f)&&(s=function(t){var e,n,r,i,s=this;return f&&(n=new RegExp("^"+s.source+"$(?!\\s)",o.call(s))),c&&(e=s.lastIndex),r=a.call(s,t),c&&r&&(s.lastIndex=s.global?r.index+r[0].length:e),f&&r&&r.length>1&&u.call(r[0],n,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(r[i]=void 0)})),r}),t.exports=s},6962:t=>{t.exports=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}},473:(t,e,n)=>{var r=n(1255),i=n(486),o=function(t,e){if(i(t),!r(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,r){try{(r=n(994)(Function.call,n(5385).f(Object.prototype,"__proto__").set,2))(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,n){return o(t,n),e?t.__proto__=n:r(t,n),t}}({},!1):void 0),check:o}},4412:(t,e,n)=>{"use strict";var r=n(7571),i=n(3886),o=n(1216),a=n(341)("species");t.exports=function(t){var e=r[t];o&&e&&!e[a]&&i.f(e,a,{configurable:!0,get:function(){return this}})}},5837:(t,e,n)=>{var r=n(3886).f,i=n(7384),o=n(341)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},3574:(t,e,n)=>{var r=n(5570)("keys"),i=n(4316);t.exports=function(t){return r[t]||(r[t]=i(t))}},5570:(t,e,n)=>{var r=n(2845),i=n(7571),o="__core-js_shared__",a=i[o]||(i[o]={});(t.exports=function(t,e){return a[t]||(a[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n(2725)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},8713:(t,e,n)=>{var r=n(486),i=n(1464),o=n(341)("species");t.exports=function(t,e){var n,a=r(t).constructor;return void 0===a||null==(n=r(a)[o])?e:i(n)}},5296:(t,e,n)=>{"use strict";var r=n(5338);t.exports=function(t,e){return!!t&&r((function(){e?t.call(null,(function(){}),1):t.call(null)}))}},8016:(t,e,n)=>{var r=n(5845),i=n(5091);t.exports=function(t){return function(e,n){var o,a,u=String(i(e)),s=r(n),c=u.length;return s<0||s>=c?t?"":void 0:(o=u.charCodeAt(s))<55296||o>56319||s+1===c||(a=u.charCodeAt(s+1))<56320||a>57343?t?u.charAt(s):o:t?u.slice(s,s+2):a-56320+(o-55296<<10)+65536}}},5692:(t,e,n)=>{var r=n(8990),i=n(5091);t.exports=function(t,e,n){if(r(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(t))}},5264:(t,e,n)=>{var r=n(7044),i=n(5338),o=n(5091),a=/"/g,u=function(t,e,n,r){var i=String(o(t)),u="<"+e;return""!==n&&(u+=" "+n+'="'+String(r).replace(a,""")+'"'),u+">"+i+"</"+e+">"};t.exports=function(t,e){var n={};n[t]=e(u),r(r.P+r.F*i((function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3})),"String",n)}},8261:(t,e,n)=>{var r=n(8087),i=n(5458),o=n(5091);t.exports=function(t,e,n,a){var u=String(o(t)),s=u.length,c=void 0===n?" ":String(n),f=r(e);if(f<=s||""==c)return u;var l=f-s,h=i.call(c,Math.ceil(l/c.length));return h.length>l&&(h=h.slice(0,l)),a?h+u:u+h}},5458:(t,e,n)=>{"use strict";var r=n(5845),i=n(5091);t.exports=function(t){var e=String(i(this)),n="",o=r(t);if(o<0||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(e+=e))1&o&&(n+=e);return n}},4961:(t,e,n)=>{var r=n(7044),i=n(5091),o=n(5338),a=n(1644),u="["+a+"]",s=RegExp("^"+u+u+"*"),c=RegExp(u+u+"*$"),f=function(t,e,n){var i={},u=o((function(){return!!a[t]()||"
"!="
"[t]()})),s=i[t]=u?e(l):a[t];n&&(i[n]=s),r(r.P+r.F*u,"String",i)},l=f.trim=function(t,e){return t=String(i(t)),1&e&&(t=t.replace(s,"")),2&e&&(t=t.replace(c,"")),t};t.exports=f},1644:t=>{t.exports="\t\n\v\f\r \u2028\u2029\ufeff"},7225:(t,e,n)=>{var r,i,o,a=n(994),u=n(8262),s=n(7680),c=n(3438),f=n(7571),l=f.process,h=f.setImmediate,d=f.clearImmediate,p=f.MessageChannel,v=f.Dispatch,g=0,y={},m=function(){var t=+this;if(y.hasOwnProperty(t)){var e=y[t];delete y[t],e()}},b=function(t){m.call(t.data)};h&&d||(h=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return y[++g]=function(){u("function"==typeof t?t:Function(t),e)},r(g),g},d=function(t){delete y[t]},"process"==n(1669)(l)?r=function(t){l.nextTick(a(m,t,1))}:v&&v.now?r=function(t){v.now(a(m,t,1))}:p?(o=(i=new p).port2,i.port1.onmessage=b,r=a(o.postMessage,o,1)):f.addEventListener&&"function"==typeof postMessage&&!f.importScripts?(r=function(t){f.postMessage(t+"","*")},f.addEventListener("message",b,!1)):r="onreadystatechange"in c("script")?function(t){s.appendChild(c("script")).onreadystatechange=function(){s.removeChild(this),m.call(t)}}:function(t){setTimeout(a(m,t,1),0)}),t.exports={set:h,clear:d}},9260:(t,e,n)=>{var r=n(5845),i=Math.max,o=Math.min;t.exports=function(t,e){return(t=r(t))<0?i(t+e,0):o(t,e)}},5e3:(t,e,n)=>{var r=n(5845),i=n(8087);t.exports=function(t){if(void 0===t)return 0;var e=r(t),n=i(e);if(e!==n)throw RangeError("Wrong length!");return n}},5845:t=>{var e=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:e)(t)}},8182:(t,e,n)=>{var r=n(8579),i=n(5091);t.exports=function(t){return r(i(t))}},8087:(t,e,n)=>{var r=n(5845),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},7583:(t,e,n)=>{var r=n(5091);t.exports=function(t){return Object(r(t))}},4467:(t,e,n)=>{var r=n(1255);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},1063:(t,e,n)=>{"use strict";if(n(1216)){var r=n(2725),i=n(7571),o=n(5338),a=n(7044),u=n(604),s=n(1541),c=n(994),f=n(6903),l=n(8328),h=n(913),d=n(8565),p=n(5845),v=n(8087),g=n(5e3),y=n(9260),m=n(4467),b=n(7384),_=n(4939),x=n(1255),w=n(7583),E=n(9981),S=n(9055),A=n(9881),T=n(6907).f,I=n(9685),C=n(4316),D=n(341),N=n(7622),k=n(4538),R=n(8713),O=n(163),M=n(9740),P=n(2803),G=n(4412),L=n(8676),U=n(1064),F=n(3886),B=n(5385),z=F.f,j=B.f,W=i.RangeError,V=i.TypeError,X=i.Uint8Array,H="ArrayBuffer",q="SharedArrayBuffer",Y="BYTES_PER_ELEMENT",K=Array.prototype,Z=s.ArrayBuffer,$=s.DataView,J=N(0),Q=N(2),tt=N(3),et=N(4),nt=N(5),rt=N(6),it=k(!0),ot=k(!1),at=O.values,ut=O.keys,st=O.entries,ct=K.lastIndexOf,ft=K.reduce,lt=K.reduceRight,ht=K.join,dt=K.sort,pt=K.slice,vt=K.toString,gt=K.toLocaleString,yt=D("iterator"),mt=D("toStringTag"),bt=C("typed_constructor"),_t=C("def_constructor"),xt=u.CONSTR,wt=u.TYPED,Et=u.VIEW,St="Wrong length!",At=N(1,(function(t,e){return Nt(R(t,t[_t]),e)})),Tt=o((function(){return 1===new X(new Uint16Array([1]).buffer)[0]})),It=!!X&&!!X.prototype.set&&o((function(){new X(1).set({})})),Ct=function(t,e){var n=p(t);if(n<0||n%e)throw W("Wrong offset!");return n},Dt=function(t){if(x(t)&&wt in t)return t;throw V(t+" is not a typed array!")},Nt=function(t,e){if(!x(t)||!(bt in t))throw V("It is not a typed array constructor!");return new t(e)},kt=function(t,e){return Rt(R(t,t[_t]),e)},Rt=function(t,e){for(var n=0,r=e.length,i=Nt(t,r);r>n;)i[n]=e[n++];return i},Ot=function(t,e,n){z(t,e,{get:function(){return this._d[n]}})},Mt=function(t){var e,n,r,i,o,a,u=w(t),s=arguments.length,f=s>1?arguments[1]:void 0,l=void 0!==f,h=I(u);if(null!=h&&!E(h)){for(a=h.call(u),r=[],e=0;!(o=a.next()).done;e++)r.push(o.value);u=r}for(l&&s>2&&(f=c(f,arguments[2],2)),e=0,n=v(u.length),i=Nt(this,n);n>e;e++)i[e]=l?f(u[e],e):u[e];return i},Pt=function(){for(var t=0,e=arguments.length,n=Nt(this,e);e>t;)n[t]=arguments[t++];return n},Gt=!!X&&o((function(){gt.call(new X(1))})),Lt=function(){return gt.apply(Gt?pt.call(Dt(this)):Dt(this),arguments)},Ut={copyWithin:function(t,e){return U.call(Dt(this),t,e,arguments.length>2?arguments[2]:void 0)},every:function(t){return et(Dt(this),t,arguments.length>1?arguments[1]:void 0)},fill:function(t){return L.apply(Dt(this),arguments)},filter:function(t){return kt(this,Q(Dt(this),t,arguments.length>1?arguments[1]:void 0))},find:function(t){return nt(Dt(this),t,arguments.length>1?arguments[1]:void 0)},findIndex:function(t){return rt(Dt(this),t,arguments.length>1?arguments[1]:void 0)},forEach:function(t){J(Dt(this),t,arguments.length>1?arguments[1]:void 0)},indexOf:function(t){return ot(Dt(this),t,arguments.length>1?arguments[1]:void 0)},includes:function(t){return it(Dt(this),t,arguments.length>1?arguments[1]:void 0)},join:function(t){return ht.apply(Dt(this),arguments)},lastIndexOf:function(t){return ct.apply(Dt(this),arguments)},map:function(t){return At(Dt(this),t,arguments.length>1?arguments[1]:void 0)},reduce:function(t){return ft.apply(Dt(this),arguments)},reduceRight:function(t){return lt.apply(Dt(this),arguments)},reverse:function(){for(var t,e=this,n=Dt(e).length,r=Math.floor(n/2),i=0;i<r;)t=e[i],e[i++]=e[--n],e[n]=t;return e},some:function(t){return tt(Dt(this),t,arguments.length>1?arguments[1]:void 0)},sort:function(t){return dt.call(Dt(this),t)},subarray:function(t,e){var n=Dt(this),r=n.length,i=y(t,r);return new(R(n,n[_t]))(n.buffer,n.byteOffset+i*n.BYTES_PER_ELEMENT,v((void 0===e?r:y(e,r))-i))}},Ft=function(t,e){return kt(this,pt.call(Dt(this),t,e))},Bt=function(t){Dt(this);var e=Ct(arguments[1],1),n=this.length,r=w(t),i=v(r.length),o=0;if(i+e>n)throw W(St);for(;o<i;)this[e+o]=r[o++]},zt={entries:function(){return st.call(Dt(this))},keys:function(){return ut.call(Dt(this))},values:function(){return at.call(Dt(this))}},jt=function(t,e){return x(t)&&t[wt]&&"symbol"!=typeof e&&e in t&&String(+e)==String(e)},Wt=function(t,e){return jt(t,e=m(e,!0))?l(2,t[e]):j(t,e)},Vt=function(t,e,n){return!(jt(t,e=m(e,!0))&&x(n)&&b(n,"value"))||b(n,"get")||b(n,"set")||n.configurable||b(n,"writable")&&!n.writable||b(n,"enumerable")&&!n.enumerable?z(t,e,n):(t[e]=n.value,t)};xt||(B.f=Wt,F.f=Vt),a(a.S+a.F*!xt,"Object",{getOwnPropertyDescriptor:Wt,defineProperty:Vt}),o((function(){vt.call({})}))&&(vt=gt=function(){return ht.call(this)});var Xt=d({},Ut);d(Xt,zt),h(Xt,yt,zt.values),d(Xt,{slice:Ft,set:Bt,constructor:function(){},toString:vt,toLocaleString:Lt}),Ot(Xt,"buffer","b"),Ot(Xt,"byteOffset","o"),Ot(Xt,"byteLength","l"),Ot(Xt,"length","e"),z(Xt,mt,{get:function(){return this[wt]}}),t.exports=function(t,e,n,s){var c=t+((s=!!s)?"Clamped":"")+"Array",l="get"+t,d="set"+t,p=i[c],y=p||{},m=p&&A(p),b=!p||!u.ABV,w={},E=p&&p.prototype,I=function(t,n){z(t,n,{get:function(){return function(t,n){var r=t._d;return r.v[l](n*e+r.o,Tt)}(this,n)},set:function(t){return function(t,n,r){var i=t._d;s&&(r=(r=Math.round(r))<0?0:r>255?255:255&r),i.v[d](n*e+i.o,r,Tt)}(this,n,t)},enumerable:!0})};b?(p=n((function(t,n,r,i){f(t,p,c,"_d");var o,a,u,s,l=0,d=0;if(x(n)){if(!(n instanceof Z||(s=_(n))==H||s==q))return wt in n?Rt(p,n):Mt.call(p,n);o=n,d=Ct(r,e);var y=n.byteLength;if(void 0===i){if(y%e)throw W(St);if((a=y-d)<0)throw W(St)}else if((a=v(i)*e)+d>y)throw W(St);u=a/e}else u=g(n),o=new Z(a=u*e);for(h(t,"_d",{b:o,o:d,l:a,e:u,v:new $(o)});l<u;)I(t,l++)})),E=p.prototype=S(Xt),h(E,"constructor",p)):o((function(){p(1)}))&&o((function(){new p(-1)}))&&P((function(t){new p,new p(null),new p(1.5),new p(t)}),!0)||(p=n((function(t,n,r,i){var o;return f(t,p,c),x(n)?n instanceof Z||(o=_(n))==H||o==q?void 0!==i?new y(n,Ct(r,e),i):void 0!==r?new y(n,Ct(r,e)):new y(n):wt in n?Rt(p,n):Mt.call(p,n):new y(g(n))})),J(m!==Function.prototype?T(y).concat(T(m)):T(y),(function(t){t in p||h(p,t,y[t])})),p.prototype=E,r||(E.constructor=p));var C=E[yt],D=!!C&&("values"==C.name||null==C.name),N=zt.values;h(p,bt,!0),h(E,wt,c),h(E,Et,!0),h(E,_t,p),(s?new p(1)[mt]==c:mt in E)||z(E,mt,{get:function(){return c}}),w[c]=p,a(a.G+a.W+a.F*(p!=y),w),a(a.S,c,{BYTES_PER_ELEMENT:e}),a(a.S+a.F*o((function(){y.of.call(p,1)})),c,{from:Mt,of:Pt}),Y in E||h(E,Y,e),a(a.P,c,Ut),G(c),a(a.P+a.F*It,c,{set:Bt}),a(a.P+a.F*!D,c,zt),r||E.toString==vt||(E.toString=vt),a(a.P+a.F*o((function(){new p(1).slice()})),c,{slice:Ft}),a(a.P+a.F*(o((function(){return[1,2].toLocaleString()!=new p([1,2]).toLocaleString()}))||!o((function(){E.toLocaleString.call([1,2])}))),c,{toLocaleString:Lt}),M[c]=D?C:N,r||D||h(E,yt,N)}}else t.exports=function(){}},1541:(t,e,n)=>{"use strict";var r=n(7571),i=n(1216),o=n(2725),a=n(604),u=n(913),s=n(8565),c=n(5338),f=n(6903),l=n(5845),h=n(8087),d=n(5e3),p=n(6907).f,v=n(3886).f,g=n(8676),y=n(5837),m="ArrayBuffer",b="DataView",_="Wrong index!",x=r.ArrayBuffer,w=r.DataView,E=r.Math,S=r.RangeError,A=r.Infinity,T=x,I=E.abs,C=E.pow,D=E.floor,N=E.log,k=E.LN2,R="buffer",O="byteLength",M="byteOffset",P=i?"_b":R,G=i?"_l":O,L=i?"_o":M;function U(t,e,n){var r,i,o,a=new Array(n),u=8*n-e-1,s=(1<<u)-1,c=s>>1,f=23===e?C(2,-24)-C(2,-77):0,l=0,h=t<0||0===t&&1/t<0?1:0;for((t=I(t))!=t||t===A?(i=t!=t?1:0,r=s):(r=D(N(t)/k),t*(o=C(2,-r))<1&&(r--,o*=2),(t+=r+c>=1?f/o:f*C(2,1-c))*o>=2&&(r++,o/=2),r+c>=s?(i=0,r=s):r+c>=1?(i=(t*o-1)*C(2,e),r+=c):(i=t*C(2,c-1)*C(2,e),r=0));e>=8;a[l++]=255&i,i/=256,e-=8);for(r=r<<e|i,u+=e;u>0;a[l++]=255&r,r/=256,u-=8);return a[--l]|=128*h,a}function F(t,e,n){var r,i=8*n-e-1,o=(1<<i)-1,a=o>>1,u=i-7,s=n-1,c=t[s--],f=127&c;for(c>>=7;u>0;f=256*f+t[s],s--,u-=8);for(r=f&(1<<-u)-1,f>>=-u,u+=e;u>0;r=256*r+t[s],s--,u-=8);if(0===f)f=1-a;else{if(f===o)return r?NaN:c?-A:A;r+=C(2,e),f-=a}return(c?-1:1)*r*C(2,f-e)}function B(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]}function z(t){return[255&t]}function j(t){return[255&t,t>>8&255]}function W(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function V(t){return U(t,52,8)}function X(t){return U(t,23,4)}function H(t,e,n){v(t.prototype,e,{get:function(){return this[n]}})}function q(t,e,n,r){var i=d(+n);if(i+e>t[G])throw S(_);var o=t[P]._b,a=i+t[L],u=o.slice(a,a+e);return r?u:u.reverse()}function Y(t,e,n,r,i,o){var a=d(+n);if(a+e>t[G])throw S(_);for(var u=t[P]._b,s=a+t[L],c=r(+i),f=0;f<e;f++)u[s+f]=c[o?f:e-f-1]}if(a.ABV){if(!c((function(){x(1)}))||!c((function(){new x(-1)}))||c((function(){return new x,new x(1.5),new x(NaN),x.name!=m}))){for(var K,Z=(x=function(t){return f(this,x),new T(d(t))}).prototype=T.prototype,$=p(T),J=0;$.length>J;)(K=$[J++])in x||u(x,K,T[K]);o||(Z.constructor=x)}var Q=new w(new x(2)),tt=w.prototype.setInt8;Q.setInt8(0,2147483648),Q.setInt8(1,2147483649),!Q.getInt8(0)&&Q.getInt8(1)||s(w.prototype,{setInt8:function(t,e){tt.call(this,t,e<<24>>24)},setUint8:function(t,e){tt.call(this,t,e<<24>>24)}},!0)}else x=function(t){f(this,x,m);var e=d(t);this._b=g.call(new Array(e),0),this[G]=e},w=function(t,e,n){f(this,w,b),f(t,x,b);var r=t[G],i=l(e);if(i<0||i>r)throw S("Wrong offset!");if(i+(n=void 0===n?r-i:h(n))>r)throw S("Wrong length!");this[P]=t,this[L]=i,this[G]=n},i&&(H(x,O,"_l"),H(w,R,"_b"),H(w,O,"_l"),H(w,M,"_o")),s(w.prototype,{getInt8:function(t){return q(this,1,t)[0]<<24>>24},getUint8:function(t){return q(this,1,t)[0]},getInt16:function(t){var e=q(this,2,t,arguments[1]);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=q(this,2,t,arguments[1]);return e[1]<<8|e[0]},getInt32:function(t){return B(q(this,4,t,arguments[1]))},getUint32:function(t){return B(q(this,4,t,arguments[1]))>>>0},getFloat32:function(t){return F(q(this,4,t,arguments[1]),23,4)},getFloat64:function(t){return F(q(this,8,t,arguments[1]),52,8)},setInt8:function(t,e){Y(this,1,t,z,e)},setUint8:function(t,e){Y(this,1,t,z,e)},setInt16:function(t,e){Y(this,2,t,j,e,arguments[2])},setUint16:function(t,e){Y(this,2,t,j,e,arguments[2])},setInt32:function(t,e){Y(this,4,t,W,e,arguments[2])},setUint32:function(t,e){Y(this,4,t,W,e,arguments[2])},setFloat32:function(t,e){Y(this,4,t,X,e,arguments[2])},setFloat64:function(t,e){Y(this,8,t,V,e,arguments[2])}});y(x,m),y(w,b),u(w.prototype,a.VIEW,!0),e.ArrayBuffer=x,e.DataView=w},604:(t,e,n)=>{for(var r,i=n(7571),o=n(913),a=n(4316),u=a("typed_array"),s=a("view"),c=!(!i.ArrayBuffer||!i.DataView),f=c,l=0,h="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");l<9;)(r=i[h[l++]])?(o(r.prototype,u,!0),o(r.prototype,s,!0)):f=!1;t.exports={ABV:c,CONSTR:f,TYPED:u,VIEW:s}},4316:t=>{var e=0,n=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++e+n).toString(36))}},2541:(t,e,n)=>{var r=n(7571).navigator;t.exports=r&&r.userAgent||""},4664:(t,e,n)=>{var r=n(1255);t.exports=function(t,e){if(!r(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t}},6262:(t,e,n)=>{var r=n(7571),i=n(2845),o=n(2725),a=n(7686),u=n(3886).f;t.exports=function(t){var e=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||u(e,t,{value:a.f(t)})}},7686:(t,e,n)=>{e.f=n(341)},341:(t,e,n)=>{var r=n(5570)("wks"),i=n(4316),o=n(7571).Symbol,a="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=a&&o[t]||(a?o:i)("Symbol."+t))}).store=r},9685:(t,e,n)=>{var r=n(4939),i=n(341)("iterator"),o=n(9740);t.exports=n(2845).getIteratorMethod=function(t){if(null!=t)return t[i]||t["@@iterator"]||o[r(t)]}},5305:(t,e,n)=>{var r=n(7044);r(r.P,"Array",{copyWithin:n(1064)}),n(4691)("copyWithin")},5015:(t,e,n)=>{"use strict";var r=n(7044),i=n(7622)(4);r(r.P+r.F*!n(5296)([].every,!0),"Array",{every:function(t){return i(this,t,arguments[1])}})},6341:(t,e,n)=>{var r=n(7044);r(r.P,"Array",{fill:n(8676)}),n(4691)("fill")},5119:(t,e,n)=>{"use strict";var r=n(7044),i=n(7622)(2);r(r.P+r.F*!n(5296)([].filter,!0),"Array",{filter:function(t){return i(this,t,arguments[1])}})},4488:(t,e,n)=>{"use strict";var r=n(7044),i=n(7622)(6),o="findIndex",a=!0;o in[]&&Array(1)[o]((function(){a=!1})),r(r.P+r.F*a,"Array",{findIndex:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),n(4691)(o)},5915:(t,e,n)=>{"use strict";var r=n(7044),i=n(7622)(5),o="find",a=!0;o in[]&&Array(1).find((function(){a=!1})),r(r.P+r.F*a,"Array",{find:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),n(4691)(o)},5788:(t,e,n)=>{"use strict";var r=n(7044),i=n(7622)(0),o=n(5296)([].forEach,!0);r(r.P+r.F*!o,"Array",{forEach:function(t){return i(this,t,arguments[1])}})},9689:(t,e,n)=>{"use strict";var r=n(994),i=n(7044),o=n(7583),a=n(4902),u=n(9981),s=n(8087),c=n(1395),f=n(9685);i(i.S+i.F*!n(2803)((function(t){Array.from(t)})),"Array",{from:function(t){var e,n,i,l,h=o(t),d="function"==typeof this?this:Array,p=arguments.length,v=p>1?arguments[1]:void 0,g=void 0!==v,y=0,m=f(h);if(g&&(v=r(v,p>2?arguments[2]:void 0,2)),null==m||d==Array&&u(m))for(n=new d(e=s(h.length));e>y;y++)c(n,y,g?v(h[y],y):h[y]);else for(l=m.call(h),n=new d;!(i=l.next()).done;y++)c(n,y,g?a(l,v,[i.value,y],!0):i.value);return n.length=y,n}})},5377:(t,e,n)=>{"use strict";var r=n(7044),i=n(4538)(!1),o=[].indexOf,a=!!o&&1/[1].indexOf(1,-0)<0;r(r.P+r.F*(a||!n(5296)(o)),"Array",{indexOf:function(t){return a?o.apply(this,arguments)||0:i(this,t,arguments[1])}})},2247:(t,e,n)=>{var r=n(7044);r(r.S,"Array",{isArray:n(7183)})},163:(t,e,n)=>{"use strict";var r=n(4691),i=n(8782),o=n(9740),a=n(8182);t.exports=n(966)(Array,"Array",(function(t,e){this._t=a(t),this._i=0,this._k=e}),(function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):i(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])}),"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},9026:(t,e,n)=>{"use strict";var r=n(7044),i=n(8182),o=[].join;r(r.P+r.F*(n(8579)!=Object||!n(5296)(o)),"Array",{join:function(t){return o.call(i(this),void 0===t?",":t)}})},9879:(t,e,n)=>{"use strict";var r=n(7044),i=n(8182),o=n(5845),a=n(8087),u=[].lastIndexOf,s=!!u&&1/[1].lastIndexOf(1,-0)<0;r(r.P+r.F*(s||!n(5296)(u)),"Array",{lastIndexOf:function(t){if(s)return u.apply(this,arguments)||0;var e=i(this),n=a(e.length),r=n-1;for(arguments.length>1&&(r=Math.min(r,o(arguments[1]))),r<0&&(r=n+r);r>=0;r--)if(r in e&&e[r]===t)return r||0;return-1}})},7878:(t,e,n)=>{"use strict";var r=n(7044),i=n(7622)(1);r(r.P+r.F*!n(5296)([].map,!0),"Array",{map:function(t){return i(this,t,arguments[1])}})},9003:(t,e,n)=>{"use strict";var r=n(7044),i=n(1395);r(r.S+r.F*n(5338)((function(){function t(){}return!(Array.of.call(t)instanceof t)})),"Array",{of:function(){for(var t=0,e=arguments.length,n=new("function"==typeof this?this:Array)(e);e>t;)i(n,t,arguments[t++]);return n.length=e,n}})},646:(t,e,n)=>{"use strict";var r=n(7044),i=n(5336);r(r.P+r.F*!n(5296)([].reduceRight,!0),"Array",{reduceRight:function(t){return i(this,t,arguments.length,arguments[1],!0)}})},8059:(t,e,n)=>{"use strict";var r=n(7044),i=n(5336);r(r.P+r.F*!n(5296)([].reduce,!0),"Array",{reduce:function(t){return i(this,t,arguments.length,arguments[1],!1)}})},4088:(t,e,n)=>{"use strict";var r=n(7044),i=n(7680),o=n(1669),a=n(9260),u=n(8087),s=[].slice;r(r.P+r.F*n(5338)((function(){i&&s.call(i)})),"Array",{slice:function(t,e){var n=u(this.length),r=o(this);if(e=void 0===e?n:e,"Array"==r)return s.call(this,t,e);for(var i=a(t,n),c=a(e,n),f=u(c-i),l=new Array(f),h=0;h<f;h++)l[h]="String"==r?this.charAt(i+h):this[i+h];return l}})},3135:(t,e,n)=>{"use strict";var r=n(7044),i=n(7622)(3);r(r.P+r.F*!n(5296)([].some,!0),"Array",{some:function(t){return i(this,t,arguments[1])}})},535:(t,e,n)=>{"use strict";var r=n(7044),i=n(1464),o=n(7583),a=n(5338),u=[].sort,s=[1,2,3];r(r.P+r.F*(a((function(){s.sort(void 0)}))||!a((function(){s.sort(null)}))||!n(5296)(u)),"Array",{sort:function(t){return void 0===t?u.call(o(this)):u.call(o(this),i(t))}})},9281:(t,e,n)=>{n(4412)("Array")},4094:(t,e,n)=>{var r=n(7044);r(r.S,"Date",{now:function(){return(new Date).getTime()}})},5013:(t,e,n)=>{var r=n(7044),i=n(4506);r(r.P+r.F*(Date.prototype.toISOString!==i),"Date",{toISOString:i})},8781:(t,e,n)=>{"use strict";var r=n(7044),i=n(7583),o=n(4467);r(r.P+r.F*n(5338)((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})})),"Date",{toJSON:function(t){var e=i(this),n=o(e);return"number"!=typeof n||isFinite(n)?e.toISOString():null}})},8723:(t,e,n)=>{var r=n(341)("toPrimitive"),i=Date.prototype;r in i||n(913)(i,r,n(9514))},3735:(t,e,n)=>{var r=Date.prototype,i="Invalid Date",o=r.toString,a=r.getTime;new Date(NaN)+""!=i&&n(6476)(r,"toString",(function(){var t=a.call(this);return t==t?o.call(this):i}))},1765:(t,e,n)=>{var r=n(7044);r(r.P,"Function",{bind:n(8366)})},7451:(t,e,n)=>{"use strict";var r=n(1255),i=n(9881),o=n(341)("hasInstance"),a=Function.prototype;o in a||n(3886).f(a,o,{value:function(t){if("function"!=typeof this||!r(t))return!1;if(!r(this.prototype))return t instanceof this;for(;t=i(t);)if(this.prototype===t)return!0;return!1}})},5747:(t,e,n)=>{var r=n(3886).f,i=Function.prototype,o=/^\s*function ([^ (]*)/,a="name";a in i||n(1216)&&r(i,a,{configurable:!0,get:function(){try{return(""+this).match(o)[1]}catch(t){return""}}})},6441:(t,e,n)=>{"use strict";var r=n(3050),i=n(4664),o="Map";t.exports=n(859)(o,(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{get:function(t){var e=r.getEntry(i(this,o),t);return e&&e.v},set:function(t,e){return r.def(i(this,o),0===t?0:t,e)}},r,!0)},2212:(t,e,n)=>{var r=n(7044),i=n(1618),o=Math.sqrt,a=Math.acosh;r(r.S+r.F*!(a&&710==Math.floor(a(Number.MAX_VALUE))&&a(1/0)==1/0),"Math",{acosh:function(t){return(t=+t)<1?NaN:t>94906265.62425156?Math.log(t)+Math.LN2:i(t-1+o(t-1)*o(t+1))}})},4230:(t,e,n)=>{var r=n(7044),i=Math.asinh;r(r.S+r.F*!(i&&1/i(0)>0),"Math",{asinh:function t(e){return isFinite(e=+e)&&0!=e?e<0?-t(-e):Math.log(e+Math.sqrt(e*e+1)):e}})},9754:(t,e,n)=>{var r=n(7044),i=Math.atanh;r(r.S+r.F*!(i&&1/i(-0)<0),"Math",{atanh:function(t){return 0==(t=+t)?t:Math.log((1+t)/(1-t))/2}})},2811:(t,e,n)=>{var r=n(7044),i=n(2987);r(r.S,"Math",{cbrt:function(t){return i(t=+t)*Math.pow(Math.abs(t),1/3)}})},3998:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{clz32:function(t){return(t>>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},1769:(t,e,n)=>{var r=n(7044),i=Math.exp;r(r.S,"Math",{cosh:function(t){return(i(t=+t)+i(-t))/2}})},8789:(t,e,n)=>{var r=n(7044),i=n(959);r(r.S+r.F*(i!=Math.expm1),"Math",{expm1:i})},2848:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{fround:n(7682)})},1762:(t,e,n)=>{var r=n(7044),i=Math.abs;r(r.S,"Math",{hypot:function(t,e){for(var n,r,o=0,a=0,u=arguments.length,s=0;a<u;)s<(n=i(arguments[a++]))?(o=o*(r=s/n)*r+1,s=n):o+=n>0?(r=n/s)*r:n;return s===1/0?1/0:s*Math.sqrt(o)}})},1323:(t,e,n)=>{var r=n(7044),i=Math.imul;r(r.S+r.F*n(5338)((function(){return-5!=i(4294967295,5)||2!=i.length})),"Math",{imul:function(t,e){var n=65535,r=+t,i=+e,o=n&r,a=n&i;return 0|o*a+((n&r>>>16)*a+o*(n&i>>>16)<<16>>>0)}})},6063:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{log10:function(t){return Math.log(t)*Math.LOG10E}})},3282:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{log1p:n(1618)})},6816:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{log2:function(t){return Math.log(t)/Math.LN2}})},1854:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{sign:n(2987)})},3303:(t,e,n)=>{var r=n(7044),i=n(959),o=Math.exp;r(r.S+r.F*n(5338)((function(){return-2e-17!=!Math.sinh(-2e-17)})),"Math",{sinh:function(t){return Math.abs(t=+t)<1?(i(t)-i(-t))/2:(o(t-1)-o(-t-1))*(Math.E/2)}})},4421:(t,e,n)=>{var r=n(7044),i=n(959),o=Math.exp;r(r.S,"Math",{tanh:function(t){var e=i(t=+t),n=i(-t);return e==1/0?1:n==1/0?-1:(e-n)/(o(t)+o(-t))}})},2203:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{trunc:function(t){return(t>0?Math.floor:Math.ceil)(t)}})},7454:(t,e,n)=>{"use strict";var r=n(7571),i=n(7384),o=n(1669),a=n(116),u=n(4467),s=n(5338),c=n(6907).f,f=n(5385).f,l=n(3886).f,h=n(4961).trim,d="Number",p=r.Number,v=p,g=p.prototype,y=o(n(9055)(g))==d,m="trim"in String.prototype,b=function(t){var e=u(t,!1);if("string"==typeof e&&e.length>2){var n,r,i,o=(e=m?e.trim():h(e,3)).charCodeAt(0);if(43===o||45===o){if(88===(n=e.charCodeAt(2))||120===n)return NaN}else if(48===o){switch(e.charCodeAt(1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+e}for(var a,s=e.slice(2),c=0,f=s.length;c<f;c++)if((a=s.charCodeAt(c))<48||a>i)return NaN;return parseInt(s,r)}}return+e};if(!p(" 0o1")||!p("0b1")||p("+0x1")){p=function(t){var e=arguments.length<1?0:t,n=this;return n instanceof p&&(y?s((function(){g.valueOf.call(n)})):o(n)!=d)?a(new v(b(e)),n,p):b(e)};for(var _,x=n(1216)?c(v):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),w=0;x.length>w;w++)i(v,_=x[w])&&!i(p,_)&&l(p,_,f(v,_));p.prototype=g,g.constructor=p,n(6476)(r,d,p)}},7551:(t,e,n)=>{var r=n(7044);r(r.S,"Number",{EPSILON:Math.pow(2,-52)})},2929:(t,e,n)=>{var r=n(7044),i=n(7571).isFinite;r(r.S,"Number",{isFinite:function(t){return"number"==typeof t&&i(t)}})},215:(t,e,n)=>{var r=n(7044);r(r.S,"Number",{isInteger:n(1272)})},6183:(t,e,n)=>{var r=n(7044);r(r.S,"Number",{isNaN:function(t){return t!=t}})},8190:(t,e,n)=>{var r=n(7044),i=n(1272),o=Math.abs;r(r.S,"Number",{isSafeInteger:function(t){return i(t)&&o(t)<=9007199254740991}})},476:(t,e,n)=>{var r=n(7044);r(r.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},948:(t,e,n)=>{var r=n(7044);r(r.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},942:(t,e,n)=>{var r=n(7044),i=n(1885);r(r.S+r.F*(Number.parseFloat!=i),"Number",{parseFloat:i})},2870:(t,e,n)=>{var r=n(7044),i=n(343);r(r.S+r.F*(Number.parseInt!=i),"Number",{parseInt:i})},3053:(t,e,n)=>{"use strict";var r=n(7044),i=n(5845),o=n(8347),a=n(5458),u=1..toFixed,s=Math.floor,c=[0,0,0,0,0,0],f="Number.toFixed: incorrect invocation!",l="0",h=function(t,e){for(var n=-1,r=e;++n<6;)r+=t*c[n],c[n]=r%1e7,r=s(r/1e7)},d=function(t){for(var e=6,n=0;--e>=0;)n+=c[e],c[e]=s(n/t),n=n%t*1e7},p=function(){for(var t=6,e="";--t>=0;)if(""!==e||0===t||0!==c[t]){var n=String(c[t]);e=""===e?n:e+a.call(l,7-n.length)+n}return e},v=function(t,e,n){return 0===e?n:e%2==1?v(t,e-1,n*t):v(t*t,e/2,n)};r(r.P+r.F*(!!u&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!n(5338)((function(){u.call({})}))),"Number",{toFixed:function(t){var e,n,r,u,s=o(this,f),c=i(t),g="",y=l;if(c<0||c>20)throw RangeError(f);if(s!=s)return"NaN";if(s<=-1e21||s>=1e21)return String(s);if(s<0&&(g="-",s=-s),s>1e-21)if(e=function(t){for(var e=0,n=t;n>=4096;)e+=12,n/=4096;for(;n>=2;)e+=1,n/=2;return e}(s*v(2,69,1))-69,n=e<0?s*v(2,-e,1):s/v(2,e,1),n*=4503599627370496,(e=52-e)>0){for(h(0,n),r=c;r>=7;)h(1e7,0),r-=7;for(h(v(10,r,1),0),r=e-1;r>=23;)d(1<<23),r-=23;d(1<<r),h(1,1),d(2),y=p()}else h(0,n),h(1<<-e,0),y=p()+a.call(l,c);return c>0?g+((u=y.length)<=c?"0."+a.call(l,c-u)+y:y.slice(0,u-c)+"."+y.slice(u-c)):g+y}})},8032:(t,e,n)=>{"use strict";var r=n(7044),i=n(5338),o=n(8347),a=1..toPrecision;r(r.P+r.F*(i((function(){return"1"!==a.call(1,void 0)}))||!i((function(){a.call({})}))),"Number",{toPrecision:function(t){var e=o(this,"Number#toPrecision: incorrect invocation!");return void 0===t?a.call(e):a.call(e,t)}})},5261:(t,e,n)=>{var r=n(7044);r(r.S+r.F,"Object",{assign:n(4643)})},6051:(t,e,n)=>{var r=n(7044);r(r.S,"Object",{create:n(9055)})},9518:(t,e,n)=>{var r=n(7044);r(r.S+r.F*!n(1216),"Object",{defineProperties:n(6283)})},2640:(t,e,n)=>{var r=n(7044);r(r.S+r.F*!n(1216),"Object",{defineProperty:n(3886).f})},9788:(t,e,n)=>{var r=n(1255),i=n(4278).onFreeze;n(381)("freeze",(function(t){return function(e){return t&&r(e)?t(i(e)):e}}))},8201:(t,e,n)=>{var r=n(8182),i=n(5385).f;n(381)("getOwnPropertyDescriptor",(function(){return function(t,e){return i(r(t),e)}}))},7525:(t,e,n)=>{n(381)("getOwnPropertyNames",(function(){return n(3473).f}))},470:(t,e,n)=>{var r=n(7583),i=n(9881);n(381)("getPrototypeOf",(function(){return function(t){return i(r(t))}}))},7940:(t,e,n)=>{var r=n(1255);n(381)("isExtensible",(function(t){return function(e){return!!r(e)&&(!t||t(e))}}))},6129:(t,e,n)=>{var r=n(1255);n(381)("isFrozen",(function(t){return function(e){return!r(e)||!!t&&t(e)}}))},2802:(t,e,n)=>{var r=n(1255);n(381)("isSealed",(function(t){return function(e){return!r(e)||!!t&&t(e)}}))},9340:(t,e,n)=>{var r=n(7044);r(r.S,"Object",{is:n(6962)})},5723:(t,e,n)=>{var r=n(7583),i=n(9804);n(381)("keys",(function(){return function(t){return i(r(t))}}))},7577:(t,e,n)=>{var r=n(1255),i=n(4278).onFreeze;n(381)("preventExtensions",(function(t){return function(e){return t&&r(e)?t(i(e)):e}}))},1498:(t,e,n)=>{var r=n(1255),i=n(4278).onFreeze;n(381)("seal",(function(t){return function(e){return t&&r(e)?t(i(e)):e}}))},1584:(t,e,n)=>{var r=n(7044);r(r.S,"Object",{setPrototypeOf:n(473).set})},7298:(t,e,n)=>{"use strict";var r=n(4939),i={};i[n(341)("toStringTag")]="z",i+""!="[object z]"&&n(6476)(Object.prototype,"toString",(function(){return"[object "+r(this)+"]"}),!0)},2809:(t,e,n)=>{var r=n(7044),i=n(1885);r(r.G+r.F*(parseFloat!=i),{parseFloat:i})},2784:(t,e,n)=>{var r=n(7044),i=n(343);r(r.G+r.F*(parseInt!=i),{parseInt:i})},7843:(t,e,n)=>{"use strict";var r,i,o,a,u=n(2725),s=n(7571),c=n(994),f=n(4939),l=n(7044),h=n(1255),d=n(1464),p=n(6903),v=n(9822),g=n(8713),y=n(7225).set,m=n(7485)(),b=n(449),_=n(9696),x=n(2541),w=n(909),E="Promise",S=s.TypeError,A=s.process,T=A&&A.versions,I=T&&T.v8||"",C=s.Promise,D="process"==f(A),N=function(){},k=i=b.f,R=!!function(){try{var t=C.resolve(1),e=(t.constructor={})[n(341)("species")]=function(t){t(N,N)};return(D||"function"==typeof PromiseRejectionEvent)&&t.then(N)instanceof e&&0!==I.indexOf("6.6")&&-1===x.indexOf("Chrome/66")}catch(t){}}(),O=function(t){var e;return!(!h(t)||"function"!=typeof(e=t.then))&&e},M=function(t,e){if(!t._n){t._n=!0;var n=t._c;m((function(){for(var r=t._v,i=1==t._s,o=0,a=function(e){var n,o,a,u=i?e.ok:e.fail,s=e.resolve,c=e.reject,f=e.domain;try{u?(i||(2==t._h&&L(t),t._h=1),!0===u?n=r:(f&&f.enter(),n=u(r),f&&(f.exit(),a=!0)),n===e.promise?c(S("Promise-chain cycle")):(o=O(n))?o.call(n,s,c):s(n)):c(r)}catch(t){f&&!a&&f.exit(),c(t)}};n.length>o;)a(n[o++]);t._c=[],t._n=!1,e&&!t._h&&P(t)}))}},P=function(t){y.call(s,(function(){var e,n,r,i=t._v,o=G(t);if(o&&(e=_((function(){D?A.emit("unhandledRejection",i,t):(n=s.onunhandledrejection)?n({promise:t,reason:i}):(r=s.console)&&r.error&&r.error("Unhandled promise rejection",i)})),t._h=D||G(t)?2:1),t._a=void 0,o&&e.e)throw e.v}))},G=function(t){return 1!==t._h&&0===(t._a||t._c).length},L=function(t){y.call(s,(function(){var e;D?A.emit("rejectionHandled",t):(e=s.onrejectionhandled)&&e({promise:t,reason:t._v})}))},U=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),M(e,!0))},F=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw S("Promise can't be resolved itself");(e=O(t))?m((function(){var r={_w:n,_d:!1};try{e.call(t,c(F,r,1),c(U,r,1))}catch(t){U.call(r,t)}})):(n._v=t,n._s=1,M(n,!1))}catch(t){U.call({_w:n,_d:!1},t)}}};R||(C=function(t){p(this,C,E,"_h"),d(t),r.call(this);try{t(c(F,this,1),c(U,this,1))}catch(t){U.call(this,t)}},(r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(8565)(C.prototype,{then:function(t,e){var n=k(g(this,C));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=D?A.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&M(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new r;this.promise=t,this.resolve=c(F,t,1),this.reject=c(U,t,1)},b.f=k=function(t){return t===C||t===a?new o(t):i(t)}),l(l.G+l.W+l.F*!R,{Promise:C}),n(5837)(C,E),n(4412)(E),a=n(2845).Promise,l(l.S+l.F*!R,E,{reject:function(t){var e=k(this);return(0,e.reject)(t),e.promise}}),l(l.S+l.F*(u||!R),E,{resolve:function(t){return w(u&&this===a?C:this,t)}}),l(l.S+l.F*!(R&&n(2803)((function(t){C.all(t).catch(N)}))),E,{all:function(t){var e=this,n=k(e),r=n.resolve,i=n.reject,o=_((function(){var n=[],o=0,a=1;v(t,!1,(function(t){var u=o++,s=!1;n.push(void 0),a++,e.resolve(t).then((function(t){s||(s=!0,n[u]=t,--a||r(n))}),i)})),--a||r(n)}));return o.e&&i(o.v),n.promise},race:function(t){var e=this,n=k(e),r=n.reject,i=_((function(){v(t,!1,(function(t){e.resolve(t).then(n.resolve,r)}))}));return i.e&&r(i.v),n.promise}})},8275:(t,e,n)=>{var r=n(7044),i=n(1464),o=n(486),a=(n(7571).Reflect||{}).apply,u=Function.apply;r(r.S+r.F*!n(5338)((function(){a((function(){}))})),"Reflect",{apply:function(t,e,n){var r=i(t),s=o(n);return a?a(r,e,s):u.call(r,e,s)}})},2552:(t,e,n)=>{var r=n(7044),i=n(9055),o=n(1464),a=n(486),u=n(1255),s=n(5338),c=n(8366),f=(n(7571).Reflect||{}).construct,l=s((function(){function t(){}return!(f((function(){}),[],t)instanceof t)})),h=!s((function(){f((function(){}))}));r(r.S+r.F*(l||h),"Reflect",{construct:function(t,e){o(t),a(e);var n=arguments.length<3?t:o(arguments[2]);if(h&&!l)return f(t,e,n);if(t==n){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var r=[null];return r.push.apply(r,e),new(c.apply(t,r))}var s=n.prototype,d=i(u(s)?s:Object.prototype),p=Function.apply.call(t,d,e);return u(p)?p:d}})},3077:(t,e,n)=>{var r=n(3886),i=n(7044),o=n(486),a=n(4467);i(i.S+i.F*n(5338)((function(){Reflect.defineProperty(r.f({},1,{value:1}),1,{value:2})})),"Reflect",{defineProperty:function(t,e,n){o(t),e=a(e,!0),o(n);try{return r.f(t,e,n),!0}catch(t){return!1}}})},1031:(t,e,n)=>{var r=n(7044),i=n(5385).f,o=n(486);r(r.S,"Reflect",{deleteProperty:function(t,e){var n=i(o(t),e);return!(n&&!n.configurable)&&delete t[e]}})},8916:(t,e,n)=>{"use strict";var r=n(7044),i=n(486),o=function(t){this._t=i(t),this._i=0;var e,n=this._k=[];for(e in t)n.push(e)};n(4529)(o,"Object",(function(){var t,e=this,n=e._k;do{if(e._i>=n.length)return{value:void 0,done:!0}}while(!((t=n[e._i++])in e._t));return{value:t,done:!1}})),r(r.S,"Reflect",{enumerate:function(t){return new o(t)}})},8531:(t,e,n)=>{var r=n(5385),i=n(7044),o=n(486);i(i.S,"Reflect",{getOwnPropertyDescriptor:function(t,e){return r.f(o(t),e)}})},7323:(t,e,n)=>{var r=n(7044),i=n(9881),o=n(486);r(r.S,"Reflect",{getPrototypeOf:function(t){return i(o(t))}})},8978:(t,e,n)=>{var r=n(5385),i=n(9881),o=n(7384),a=n(7044),u=n(1255),s=n(486);a(a.S,"Reflect",{get:function t(e,n){var a,c,f=arguments.length<3?e:arguments[2];return s(e)===f?e[n]:(a=r.f(e,n))?o(a,"value")?a.value:void 0!==a.get?a.get.call(f):void 0:u(c=i(e))?t(c,n,f):void 0}})},3704:(t,e,n)=>{var r=n(7044);r(r.S,"Reflect",{has:function(t,e){return e in t}})},3153:(t,e,n)=>{var r=n(7044),i=n(486),o=Object.isExtensible;r(r.S,"Reflect",{isExtensible:function(t){return i(t),!o||o(t)}})},8812:(t,e,n)=>{var r=n(7044);r(r.S,"Reflect",{ownKeys:n(8125)})},2636:(t,e,n)=>{var r=n(7044),i=n(486),o=Object.preventExtensions;r(r.S,"Reflect",{preventExtensions:function(t){i(t);try{return o&&o(t),!0}catch(t){return!1}}})},377:(t,e,n)=>{var r=n(7044),i=n(473);i&&r(r.S,"Reflect",{setPrototypeOf:function(t,e){i.check(t,e);try{return i.set(t,e),!0}catch(t){return!1}}})},1602:(t,e,n)=>{var r=n(3886),i=n(5385),o=n(9881),a=n(7384),u=n(7044),s=n(8328),c=n(486),f=n(1255);u(u.S,"Reflect",{set:function t(e,n,u){var l,h,d=arguments.length<4?e:arguments[3],p=i.f(c(e),n);if(!p){if(f(h=o(e)))return t(h,n,u,d);p=s(0)}if(a(p,"value")){if(!1===p.writable||!f(d))return!1;if(l=i.f(d,n)){if(l.get||l.set||!1===l.writable)return!1;l.value=u,r.f(d,n,l)}else r.f(d,n,s(0,u));return!0}return void 0!==p.set&&(p.set.call(d,u),!0)}})},6668:(t,e,n)=>{var r=n(7571),i=n(116),o=n(3886).f,a=n(6907).f,u=n(8990),s=n(3649),c=r.RegExp,f=c,l=c.prototype,h=/a/g,d=/a/g,p=new c(h)!==h;if(n(1216)&&(!p||n(5338)((function(){return d[n(341)("match")]=!1,c(h)!=h||c(d)==d||"/a/i"!=c(h,"i")})))){c=function(t,e){var n=this instanceof c,r=u(t),o=void 0===e;return!n&&r&&t.constructor===c&&o?t:i(p?new f(r&&!o?t.source:t,e):f((r=t instanceof c)?t.source:t,r&&o?s.call(t):e),n?this:l,c)};for(var v=function(t){t in c||o(c,t,{configurable:!0,get:function(){return f[t]},set:function(e){f[t]=e}})},g=a(f),y=0;g.length>y;)v(g[y++]);l.constructor=c,c.prototype=l,n(6476)(r,"RegExp",c)}n(4412)("RegExp")},7139:(t,e,n)=>{"use strict";var r=n(9020);n(7044)({target:"RegExp",proto:!0,forced:r!==/./.exec},{exec:r})},8686:(t,e,n)=>{n(1216)&&"g"!=/./g.flags&&n(3886).f(RegExp.prototype,"flags",{configurable:!0,get:n(3649)})},5480:(t,e,n)=>{"use strict";var r=n(486),i=n(8087),o=n(178),a=n(2968);n(6719)("match",1,(function(t,e,n,u){return[function(n){var r=t(this),i=null==n?void 0:n[e];return void 0!==i?i.call(n,r):new RegExp(n)[e](String(r))},function(t){var e=u(n,t,this);if(e.done)return e.value;var s=r(t),c=String(this);if(!s.global)return a(s,c);var f=s.unicode;s.lastIndex=0;for(var l,h=[],d=0;null!==(l=a(s,c));){var p=String(l[0]);h[d]=p,""===p&&(s.lastIndex=o(c,i(s.lastIndex),f)),d++}return 0===d?null:h}]}))},9121:(t,e,n)=>{"use strict";var r=n(486),i=n(7583),o=n(8087),a=n(5845),u=n(178),s=n(2968),c=Math.max,f=Math.min,l=Math.floor,h=/\$([$&`']|\d\d?|<[^>]*>)/g,d=/\$([$&`']|\d\d?)/g;n(6719)("replace",2,(function(t,e,n,p){return[function(r,i){var o=t(this),a=null==r?void 0:r[e];return void 0!==a?a.call(r,o,i):n.call(String(o),r,i)},function(t,e){var i=p(n,t,this,e);if(i.done)return i.value;var l=r(t),h=String(this),d="function"==typeof e;d||(e=String(e));var g=l.global;if(g){var y=l.unicode;l.lastIndex=0}for(var m=[];;){var b=s(l,h);if(null===b)break;if(m.push(b),!g)break;""===String(b[0])&&(l.lastIndex=u(h,o(l.lastIndex),y))}for(var _,x="",w=0,E=0;E<m.length;E++){b=m[E];for(var S=String(b[0]),A=c(f(a(b.index),h.length),0),T=[],I=1;I<b.length;I++)T.push(void 0===(_=b[I])?_:String(_));var C=b.groups;if(d){var D=[S].concat(T,A,h);void 0!==C&&D.push(C);var N=String(e.apply(void 0,D))}else N=v(S,h,A,T,C,e);A>=w&&(x+=h.slice(w,A)+N,w=A+S.length)}return x+h.slice(w)}];function v(t,e,r,o,a,u){var s=r+t.length,c=o.length,f=d;return void 0!==a&&(a=i(a),f=h),n.call(u,f,(function(n,i){var u;switch(i.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,r);case"'":return e.slice(s);case"<":u=a[i.slice(1,-1)];break;default:var f=+i;if(0===f)return n;if(f>c){var h=l(f/10);return 0===h?n:h<=c?void 0===o[h-1]?i.charAt(1):o[h-1]+i.charAt(1):n}u=o[f-1]}return void 0===u?"":u}))}}))},914:(t,e,n)=>{"use strict";var r=n(486),i=n(6962),o=n(2968);n(6719)("search",1,(function(t,e,n,a){return[function(n){var r=t(this),i=null==n?void 0:n[e];return void 0!==i?i.call(n,r):new RegExp(n)[e](String(r))},function(t){var e=a(n,t,this);if(e.done)return e.value;var u=r(t),s=String(this),c=u.lastIndex;i(c,0)||(u.lastIndex=0);var f=o(u,s);return i(u.lastIndex,c)||(u.lastIndex=c),null===f?-1:f.index}]}))},7742:(t,e,n)=>{"use strict";var r=n(8990),i=n(486),o=n(8713),a=n(178),u=n(8087),s=n(2968),c=n(9020),f=n(5338),l=Math.min,h=[].push,d=4294967295,p=!f((function(){RegExp(d,"y")}));n(6719)("split",2,(function(t,e,n,f){var v;return v="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,e){var i=String(this);if(void 0===t&&0===e)return[];if(!r(t))return n.call(i,t,e);for(var o,a,u,s=[],f=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),l=0,p=void 0===e?d:e>>>0,v=new RegExp(t.source,f+"g");(o=c.call(v,i))&&!((a=v.lastIndex)>l&&(s.push(i.slice(l,o.index)),o.length>1&&o.index<i.length&&h.apply(s,o.slice(1)),u=o[0].length,l=a,s.length>=p));)v.lastIndex===o.index&&v.lastIndex++;return l===i.length?!u&&v.test("")||s.push(""):s.push(i.slice(l)),s.length>p?s.slice(0,p):s}:"0".split(void 0,0).length?function(t,e){return void 0===t&&0===e?[]:n.call(this,t,e)}:n,[function(n,r){var i=t(this),o=null==n?void 0:n[e];return void 0!==o?o.call(n,i,r):v.call(String(i),n,r)},function(t,e){var r=f(v,t,this,e,v!==n);if(r.done)return r.value;var c=i(t),h=String(this),g=o(c,RegExp),y=c.unicode,m=(c.ignoreCase?"i":"")+(c.multiline?"m":"")+(c.unicode?"u":"")+(p?"y":"g"),b=new g(p?c:"^(?:"+c.source+")",m),_=void 0===e?d:e>>>0;if(0===_)return[];if(0===h.length)return null===s(b,h)?[h]:[];for(var x=0,w=0,E=[];w<h.length;){b.lastIndex=p?w:0;var S,A=s(b,p?h:h.slice(w));if(null===A||(S=l(u(b.lastIndex+(p?0:w)),h.length))===x)w=a(h,w,y);else{if(E.push(h.slice(x,w)),E.length===_)return E;for(var T=1;T<=A.length-1;T++)if(E.push(A[T]),E.length===_)return E;w=x=S}}return E.push(h.slice(x)),E}]}))},6408:(t,e,n)=>{"use strict";n(8686);var r=n(486),i=n(3649),o=n(1216),a="toString",u=/./.toString,s=function(t){n(6476)(RegExp.prototype,a,t,!0)};n(5338)((function(){return"/a/b"!=u.call({source:"a",flags:"b"})}))?s((function(){var t=r(this);return"/".concat(t.source,"/","flags"in t?t.flags:!o&&t instanceof RegExp?i.call(t):void 0)})):u.name!=a&&s((function(){return u.call(this)}))},429:(t,e,n)=>{"use strict";var r=n(3050),i=n(4664);t.exports=n(859)("Set",(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(t){return r.def(i(this,"Set"),t=0===t?0:t,t)}},r)},3157:(t,e,n)=>{"use strict";n(5264)("anchor",(function(t){return function(e){return t(this,"a","name",e)}}))},9791:(t,e,n)=>{"use strict";n(5264)("big",(function(t){return function(){return t(this,"big","","")}}))},2296:(t,e,n)=>{"use strict";n(5264)("blink",(function(t){return function(){return t(this,"blink","","")}}))},4555:(t,e,n)=>{"use strict";n(5264)("bold",(function(t){return function(){return t(this,"b","","")}}))},8316:(t,e,n)=>{"use strict";var r=n(7044),i=n(8016)(!1);r(r.P,"String",{codePointAt:function(t){return i(this,t)}})},7937:(t,e,n)=>{"use strict";var r=n(7044),i=n(8087),o=n(5692),a="endsWith",u="".endsWith;r(r.P+r.F*n(2910)(a),"String",{endsWith:function(t){var e=o(this,t,a),n=arguments.length>1?arguments[1]:void 0,r=i(e.length),s=void 0===n?r:Math.min(i(n),r),c=String(t);return u?u.call(e,c,s):e.slice(s-c.length,s)===c}})},6505:(t,e,n)=>{"use strict";n(5264)("fixed",(function(t){return function(){return t(this,"tt","","")}}))},4722:(t,e,n)=>{"use strict";n(5264)("fontcolor",(function(t){return function(e){return t(this,"font","color",e)}}))},9713:(t,e,n)=>{"use strict";n(5264)("fontsize",(function(t){return function(e){return t(this,"font","size",e)}}))},1028:(t,e,n)=>{var r=n(7044),i=n(9260),o=String.fromCharCode,a=String.fromCodePoint;r(r.S+r.F*(!!a&&1!=a.length),"String",{fromCodePoint:function(t){for(var e,n=[],r=arguments.length,a=0;r>a;){if(e=+arguments[a++],i(e,1114111)!==e)throw RangeError(e+" is not a valid code point");n.push(e<65536?o(e):o(55296+((e-=65536)>>10),e%1024+56320))}return n.join("")}})},637:(t,e,n)=>{"use strict";var r=n(7044),i=n(5692),o="includes";r(r.P+r.F*n(2910)(o),"String",{includes:function(t){return!!~i(this,t,o).indexOf(t,arguments.length>1?arguments[1]:void 0)}})},7392:(t,e,n)=>{"use strict";n(5264)("italics",(function(t){return function(){return t(this,"i","","")}}))},7938:(t,e,n)=>{"use strict";var r=n(8016)(!0);n(966)(String,"String",(function(t){this._t=String(t),this._i=0}),(function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})}))},4687:(t,e,n)=>{"use strict";n(5264)("link",(function(t){return function(e){return t(this,"a","href",e)}}))},6818:(t,e,n)=>{var r=n(7044),i=n(8182),o=n(8087);r(r.S,"String",{raw:function(t){for(var e=i(t.raw),n=o(e.length),r=arguments.length,a=[],u=0;n>u;)a.push(String(e[u++])),u<r&&a.push(String(arguments[u]));return a.join("")}})},8219:(t,e,n)=>{var r=n(7044);r(r.P,"String",{repeat:n(5458)})},3684:(t,e,n)=>{"use strict";n(5264)("small",(function(t){return function(){return t(this,"small","","")}}))},9029:(t,e,n)=>{"use strict";var r=n(7044),i=n(8087),o=n(5692),a="startsWith",u="".startsWith;r(r.P+r.F*n(2910)(a),"String",{startsWith:function(t){var e=o(this,t,a),n=i(Math.min(arguments.length>1?arguments[1]:void 0,e.length)),r=String(t);return u?u.call(e,r,n):e.slice(n,n+r.length)===r}})},3339:(t,e,n)=>{"use strict";n(5264)("strike",(function(t){return function(){return t(this,"strike","","")}}))},4148:(t,e,n)=>{"use strict";n(5264)("sub",(function(t){return function(){return t(this,"sub","","")}}))},7754:(t,e,n)=>{"use strict";n(5264)("sup",(function(t){return function(){return t(this,"sup","","")}}))},5557:(t,e,n)=>{"use strict";n(4961)("trim",(function(t){return function(){return t(this,3)}}))},2825:(t,e,n)=>{"use strict";var r=n(7571),i=n(7384),o=n(1216),a=n(7044),u=n(6476),s=n(4278).KEY,c=n(5338),f=n(5570),l=n(5837),h=n(4316),d=n(341),p=n(7686),v=n(6262),g=n(6397),y=n(7183),m=n(486),b=n(1255),_=n(7583),x=n(8182),w=n(4467),E=n(8328),S=n(9055),A=n(3473),T=n(5385),I=n(3844),C=n(3886),D=n(9804),N=T.f,k=C.f,R=A.f,O=r.Symbol,M=r.JSON,P=M&&M.stringify,G=d("_hidden"),L=d("toPrimitive"),U={}.propertyIsEnumerable,F=f("symbol-registry"),B=f("symbols"),z=f("op-symbols"),j=Object.prototype,W="function"==typeof O&&!!I.f,V=r.QObject,X=!V||!V.prototype||!V.prototype.findChild,H=o&&c((function(){return 7!=S(k({},"a",{get:function(){return k(this,"a",{value:7}).a}})).a}))?function(t,e,n){var r=N(j,e);r&&delete j[e],k(t,e,n),r&&t!==j&&k(j,e,r)}:k,q=function(t){var e=B[t]=S(O.prototype);return e._k=t,e},Y=W&&"symbol"==typeof O.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof O},K=function(t,e,n){return t===j&&K(z,e,n),m(t),e=w(e,!0),m(n),i(B,e)?(n.enumerable?(i(t,G)&&t[G][e]&&(t[G][e]=!1),n=S(n,{enumerable:E(0,!1)})):(i(t,G)||k(t,G,E(1,{})),t[G][e]=!0),H(t,e,n)):k(t,e,n)},Z=function(t,e){m(t);for(var n,r=g(e=x(e)),i=0,o=r.length;o>i;)K(t,n=r[i++],e[n]);return t},$=function(t){var e=U.call(this,t=w(t,!0));return!(this===j&&i(B,t)&&!i(z,t))&&(!(e||!i(this,t)||!i(B,t)||i(this,G)&&this[G][t])||e)},J=function(t,e){if(t=x(t),e=w(e,!0),t!==j||!i(B,e)||i(z,e)){var n=N(t,e);return!n||!i(B,e)||i(t,G)&&t[G][e]||(n.enumerable=!0),n}},Q=function(t){for(var e,n=R(x(t)),r=[],o=0;n.length>o;)i(B,e=n[o++])||e==G||e==s||r.push(e);return r},tt=function(t){for(var e,n=t===j,r=R(n?z:x(t)),o=[],a=0;r.length>a;)!i(B,e=r[a++])||n&&!i(j,e)||o.push(B[e]);return o};W||(O=function(){if(this instanceof O)throw TypeError("Symbol is not a constructor!");var t=h(arguments.length>0?arguments[0]:void 0),e=function(n){this===j&&e.call(z,n),i(this,G)&&i(this[G],t)&&(this[G][t]=!1),H(this,t,E(1,n))};return o&&X&&H(j,t,{configurable:!0,set:e}),q(t)},u(O.prototype,"toString",(function(){return this._k})),T.f=J,C.f=K,n(6907).f=A.f=Q,n(4179).f=$,I.f=tt,o&&!n(2725)&&u(j,"propertyIsEnumerable",$,!0),p.f=function(t){return q(d(t))}),a(a.G+a.W+a.F*!W,{Symbol:O});for(var et="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),nt=0;et.length>nt;)d(et[nt++]);for(var rt=D(d.store),it=0;rt.length>it;)v(rt[it++]);a(a.S+a.F*!W,"Symbol",{for:function(t){return i(F,t+="")?F[t]:F[t]=O(t)},keyFor:function(t){if(!Y(t))throw TypeError(t+" is not a symbol!");for(var e in F)if(F[e]===t)return e},useSetter:function(){X=!0},useSimple:function(){X=!1}}),a(a.S+a.F*!W,"Object",{create:function(t,e){return void 0===e?S(t):Z(S(t),e)},defineProperty:K,defineProperties:Z,getOwnPropertyDescriptor:J,getOwnPropertyNames:Q,getOwnPropertySymbols:tt});var ot=c((function(){I.f(1)}));a(a.S+a.F*ot,"Object",{getOwnPropertySymbols:function(t){return I.f(_(t))}}),M&&a(a.S+a.F*(!W||c((function(){var t=O();return"[null]"!=P([t])||"{}"!=P({a:t})||"{}"!=P(Object(t))}))),"JSON",{stringify:function(t){for(var e,n,r=[t],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=e=r[1],(b(e)||void 0!==t)&&!Y(t))return y(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!Y(e))return e}),r[1]=e,P.apply(M,r)}}),O.prototype[L]||n(913)(O.prototype,L,O.prototype.valueOf),l(O,"Symbol"),l(Math,"Math",!0),l(r.JSON,"JSON",!0)},6349:(t,e,n)=>{"use strict";var r=n(7044),i=n(604),o=n(1541),a=n(486),u=n(9260),s=n(8087),c=n(1255),f=n(7571).ArrayBuffer,l=n(8713),h=o.ArrayBuffer,d=o.DataView,p=i.ABV&&f.isView,v=h.prototype.slice,g=i.VIEW,y="ArrayBuffer";r(r.G+r.W+r.F*(f!==h),{ArrayBuffer:h}),r(r.S+r.F*!i.CONSTR,y,{isView:function(t){return p&&p(t)||c(t)&&g in t}}),r(r.P+r.U+r.F*n(5338)((function(){return!new h(2).slice(1,void 0).byteLength})),y,{slice:function(t,e){if(void 0!==v&&void 0===e)return v.call(a(this),t);for(var n=a(this).byteLength,r=u(t,n),i=u(void 0===e?n:e,n),o=new(l(this,h))(s(i-r)),c=new d(this),f=new d(o),p=0;r<i;)f.setUint8(p++,c.getUint8(r++));return o}}),n(4412)(y)},3742:(t,e,n)=>{var r=n(7044);r(r.G+r.W+r.F*!n(604).ABV,{DataView:n(1541).DataView})},3421:(t,e,n)=>{n(1063)("Float32",4,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},6144:(t,e,n)=>{n(1063)("Float64",8,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},9363:(t,e,n)=>{n(1063)("Int16",2,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},8632:(t,e,n)=>{n(1063)("Int32",4,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},9604:(t,e,n)=>{n(1063)("Int8",1,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},3871:(t,e,n)=>{n(1063)("Uint16",2,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},1838:(t,e,n)=>{n(1063)("Uint32",4,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},2592:(t,e,n)=>{n(1063)("Uint8",1,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},9290:(t,e,n)=>{n(1063)("Uint8",1,(function(t){return function(e,n,r){return t(this,e,n,r)}}),!0)},2214:(t,e,n)=>{"use strict";var r,i=n(7571),o=n(7622)(0),a=n(6476),u=n(4278),s=n(4643),c=n(1990),f=n(1255),l=n(4664),h=n(4664),d=!i.ActiveXObject&&"ActiveXObject"in i,p="WeakMap",v=u.getWeak,g=Object.isExtensible,y=c.ufstore,m=function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},b={get:function(t){if(f(t)){var e=v(t);return!0===e?y(l(this,p)).get(t):e?e[this._i]:void 0}},set:function(t,e){return c.def(l(this,p),t,e)}},_=t.exports=n(859)(p,m,b,c,!0,!0);h&&d&&(s((r=c.getConstructor(m,p)).prototype,b),u.NEED=!0,o(["delete","has","get","set"],(function(t){var e=_.prototype,n=e[t];a(e,t,(function(e,i){if(f(e)&&!g(e)){this._f||(this._f=new r);var o=this._f[t](e,i);return"set"==t?this:o}return n.call(this,e,i)}))})))},498:(t,e,n)=>{"use strict";var r=n(1990),i=n(4664),o="WeakSet";n(859)(o,(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(t){return r.def(i(this,o),t,!0)}},r,!1,!0)},7744:(t,e,n)=>{"use strict";var r=n(7044),i=n(6806),o=n(7583),a=n(8087),u=n(1464),s=n(6699);r(r.P,"Array",{flatMap:function(t){var e,n,r=o(this);return u(t),e=a(r.length),n=s(r,0),i(n,r,r,e,0,1,t,arguments[1]),n}}),n(4691)("flatMap")},5448:(t,e,n)=>{"use strict";var r=n(7044),i=n(4538)(!0);r(r.P,"Array",{includes:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),n(4691)("includes")},8938:(t,e,n)=>{var r=n(7044),i=n(6460)(!0);r(r.S,"Object",{entries:function(t){return i(t)}})},7819:(t,e,n)=>{var r=n(7044),i=n(8125),o=n(8182),a=n(5385),u=n(1395);r(r.S,"Object",{getOwnPropertyDescriptors:function(t){for(var e,n,r=o(t),s=a.f,c=i(r),f={},l=0;c.length>l;)void 0!==(n=s(r,e=c[l++]))&&u(f,e,n);return f}})},6572:(t,e,n)=>{var r=n(7044),i=n(6460)(!1);r(r.S,"Object",{values:function(t){return i(t)}})},8228:(t,e,n)=>{"use strict";var r=n(7044),i=n(2845),o=n(7571),a=n(8713),u=n(909);r(r.P+r.R,"Promise",{finally:function(t){var e=a(this,i.Promise||o.Promise),n="function"==typeof t;return this.then(n?function(n){return u(e,t()).then((function(){return n}))}:t,n?function(n){return u(e,t()).then((function(){throw n}))}:t)}})},3336:(t,e,n)=>{"use strict";var r=n(7044),i=n(8261),o=n(2541),a=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(o);r(r.P+r.F*a,"String",{padEnd:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0,!1)}})},3718:(t,e,n)=>{"use strict";var r=n(7044),i=n(8261),o=n(2541),a=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(o);r(r.P+r.F*a,"String",{padStart:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0,!0)}})},7831:(t,e,n)=>{"use strict";n(4961)("trimLeft",(function(t){return function(){return t(this,1)}}),"trimStart")},6642:(t,e,n)=>{"use strict";n(4961)("trimRight",(function(t){return function(){return t(this,2)}}),"trimEnd")},9956:(t,e,n)=>{n(6262)("asyncIterator")},4367:(t,e,n)=>{for(var r=n(163),i=n(9804),o=n(6476),a=n(7571),u=n(913),s=n(9740),c=n(341),f=c("iterator"),l=c("toStringTag"),h=s.Array,d={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},p=i(d),v=0;v<p.length;v++){var g,y=p[v],m=d[y],b=a[y],_=b&&b.prototype;if(_&&(_[f]||u(_,f,h),_[l]||u(_,l,y),s[y]=h,m))for(g in r)_[g]||o(_,g,r[g],!0)}},4433:(t,e,n)=>{var r=n(7044),i=n(7225);r(r.G+r.B,{setImmediate:i.set,clearImmediate:i.clear})},110:(t,e,n)=>{var r=n(7571),i=n(7044),o=n(2541),a=[].slice,u=/MSIE .\./.test(o),s=function(t){return function(e,n){var r=arguments.length>2,i=!!r&&a.call(arguments,2);return t(r?function(){("function"==typeof e?e:Function(e)).apply(this,i)}:e,n)}};i(i.G+i.B+i.F*u,{setTimeout:s(r.setTimeout),setInterval:s(r.setInterval)})},4962:(t,e,n)=>{n(110),n(4433),n(4367),t.exports=n(2845)},5229:t=>{t.exports=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}},8356:t=>{t.exports=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}},5375:t=>{t.exports=function(t){var e=new Float32Array(2);return e[0]=t[0],e[1]=t[1],e}},3422:t=>{t.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t}},5128:t=>{t.exports=function(){var t=new Float32Array(2);return t[0]=0,t[1]=0,t}},134:t=>{t.exports=function(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t}},7223:(t,e,n)=>{t.exports=n(2274)},2274:t=>{t.exports=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)}},6770:(t,e,n)=>{t.exports=n(236)},236:t=>{t.exports=function(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}},6064:t=>{t.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]}},2157:t=>{t.exports=1e-6},6922:(t,e,n)=>{t.exports=function(t,e){var n=t[0],i=t[1],o=e[0],a=e[1];return Math.abs(n-o)<=r*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-a)<=r*Math.max(1,Math.abs(i),Math.abs(a))};var r=n(2157)},6066:t=>{t.exports=function(t,e){return t[0]===e[0]&&t[1]===e[1]}},4860:t=>{t.exports=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}},7395:(t,e,n)=>{t.exports=function(t,e,n,i,o,a){var u,s;for(e||(e=2),n||(n=0),s=i?Math.min(i*e+n,t.length):t.length,u=n;u<s;u+=e)r[0]=t[u],r[1]=t[u+1],o(r,r,a),t[u]=r[0],t[u+1]=r[1];return t};var r=n(5128)()},4697:t=>{t.exports=function(t,e){var n=new Float32Array(2);return n[0]=t,n[1]=e,n}},7801:(t,e,n)=>{t.exports={EPSILON:n(2157),create:n(5128),clone:n(5375),fromValues:n(4697),copy:n(3422),set:n(6765),equals:n(6922),exactEquals:n(6066),add:n(5229),subtract:n(4186),sub:n(5302),multiply:n(3848),mul:n(1665),divide:n(236),div:n(6770),inverse:n(1873),min:n(6780),max:n(9564),rotate:n(8615),floor:n(4860),ceil:n(8356),round:n(7313),scale:n(6526),scaleAndAdd:n(7781),distance:n(2274),dist:n(7223),squaredDistance:n(6534),sqrDist:n(4969),length:n(360),len:n(2256),squaredLength:n(5476),sqrLen:n(508),negate:n(388),normalize:n(5927),dot:n(6064),cross:n(134),lerp:n(1099),random:n(679),transformMat2:n(367),transformMat2d:n(655),transformMat3:n(2730),transformMat4:n(4020),forEach:n(7395),limit:n(8709)}},1873:t=>{t.exports=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}},2256:(t,e,n)=>{t.exports=n(360)},360:t=>{t.exports=function(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)}},1099:t=>{t.exports=function(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t}},8709:t=>{t.exports=function(t,e,n){var r=e[0]*e[0]+e[1]*e[1];if(r>n*n){var i=Math.sqrt(r);t[0]=e[0]/i*n,t[1]=e[1]/i*n}else t[0]=e[0],t[1]=e[1];return t}},9564:t=>{t.exports=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}},6780:t=>{t.exports=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t}},1665:(t,e,n)=>{t.exports=n(3848)},3848:t=>{t.exports=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}},388:t=>{t.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t}},5927:t=>{t.exports=function(t,e){var n=e[0],r=e[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i),t}},679:t=>{t.exports=function(t,e){e=e||1;var n=2*Math.random()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t}},8615:t=>{t.exports=function(t,e,n){var r=Math.cos(n),i=Math.sin(n),o=e[0],a=e[1];return t[0]=o*r-a*i,t[1]=o*i+a*r,t}},7313:t=>{t.exports=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}},6526:t=>{t.exports=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}},7781:t=>{t.exports=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t}},6765:t=>{t.exports=function(t,e,n){return t[0]=e,t[1]=n,t}},4969:(t,e,n)=>{t.exports=n(6534)},508:(t,e,n)=>{t.exports=n(5476)},6534:t=>{t.exports=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}},5476:t=>{t.exports=function(t){var e=t[0],n=t[1];return e*e+n*n}},5302:(t,e,n)=>{t.exports=n(4186)},4186:t=>{t.exports=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}},367:t=>{t.exports=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t}},655:t=>{t.exports=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t}},2730:t=>{t.exports=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t}},4020:t=>{t.exports=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t}},3039:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=Symbol.for("INJECTION");function r(t,e,r,i){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:function(){return i&&!Reflect.hasMetadata(n,this,e)&&Reflect.defineMetadata(n,r(),this,e),Reflect.hasMetadata(n,this,e)?Reflect.getMetadata(n,this,e):r()},set:function(t){Reflect.defineMetadata(n,t,this,e)}})}e.makePropertyInjectDecorator=function(t,e){return function(n){return function(i,o){r(i,o,(function(){return t.get(n)}),e)}}},e.makePropertyInjectNamedDecorator=function(t,e){return function(n,i){return function(o,a){r(o,a,(function(){return t.getNamed(n,i)}),e)}}},e.makePropertyInjectTaggedDecorator=function(t,e){return function(n,i,o){return function(a,u){r(a,u,(function(){return t.getTagged(n,i,o)}),e)}}},e.makePropertyMultiInjectDecorator=function(t,e){return function(n){return function(i,o){r(i,o,(function(){return t.getAll(n)}),e)}}}},1922:(t,e,n)=>{"use strict";var r=n(3039);e.Z=function(t,e){return void 0===e&&(e=!0),{lazyInject:r.makePropertyInjectDecorator(t,e),lazyInjectNamed:r.makePropertyInjectNamedDecorator(t,e),lazyInjectTagged:r.makePropertyInjectTaggedDecorator(t,e),lazyMultiInject:r.makePropertyMultiInjectDecorator(t,e)}}},626:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tagProperty=e.tagParameter=e.decorate=void 0;var r=n(6078),i=n(295);function o(t,e,n,i,o){var a={},u="number"==typeof o,s=void 0!==o&&u?o.toString():n;if(u&&void 0!==n)throw new Error(r.INVALID_DECORATOR_OPERATION);Reflect.hasOwnMetadata(t,e)&&(a=Reflect.getMetadata(t,e));var c=a[s];if(Array.isArray(c))for(var f=0,l=c;f<l.length;f++){var h=l[f];if(h.key===i.key)throw new Error(r.DUPLICATED_METADATA+" "+h.key.toString())}else c=[];c.push(i),a[s]=c,Reflect.defineMetadata(t,a,e)}function a(t,e){Reflect.decorate(t,e)}function u(t,e){return function(n,r){e(n,r,t)}}e.tagParameter=function(t,e,n,r){o(i.TAGGED,t,e,r,n)},e.tagProperty=function(t,e,n){o(i.TAGGED_PROP,t.constructor,e,n)},e.decorate=function(t,e,n){"number"==typeof n?a([u(n,t)],e):"string"==typeof n?Reflect.decorate([t],e,n):a([t],e)}},6213:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.inject=e.LazyServiceIdentifer=void 0;var r=n(6078),i=n(295),o=n(5092),a=n(626),u=function(){function t(t){this._cb=t}return t.prototype.unwrap=function(){return this._cb()},t}();e.LazyServiceIdentifer=u,e.inject=function(t){return function(e,n,u){if(void 0===t)throw new Error(r.UNDEFINED_INJECT_ANNOTATION(e.name));var s=new o.Metadata(i.INJECT_TAG,t);"number"==typeof u?a.tagParameter(e,n,u,s):a.tagProperty(e,n,s)}}},1773:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.injectable=void 0;var r=n(6078),i=n(295);e.injectable=function(){return function(t){if(Reflect.hasOwnMetadata(i.PARAM_TYPES,t))throw new Error(r.DUPLICATED_INJECTABLE_DECORATOR);var e=Reflect.getMetadata(i.DESIGN_PARAM_TYPES,t)||[];return Reflect.defineMetadata(i.PARAM_TYPES,e,t),t}}},1528:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.multiInject=void 0;var r=n(295),i=n(5092),o=n(626);e.multiInject=function(t){return function(e,n,a){var u=new i.Metadata(r.MULTI_INJECT_TAG,t);"number"==typeof a?o.tagParameter(e,n,a,u):o.tagProperty(e,n,u)}}},9817:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.named=void 0;var r=n(295),i=n(5092),o=n(626);e.named=function(t){return function(e,n,a){var u=new i.Metadata(r.NAMED_TAG,t);"number"==typeof a?o.tagParameter(e,n,a,u):o.tagProperty(e,n,u)}}},1316:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.optional=void 0;var r=n(295),i=n(5092),o=n(626);e.optional=function(){return function(t,e,n){var a=new i.Metadata(r.OPTIONAL_TAG,!0);"number"==typeof n?o.tagParameter(t,e,n,a):o.tagProperty(t,e,a)}}},1971:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.postConstruct=void 0;var r=n(6078),i=n(295),o=n(5092);e.postConstruct=function(){return function(t,e,n){var a=new o.Metadata(i.POST_CONSTRUCT,e);if(Reflect.hasOwnMetadata(i.POST_CONSTRUCT,t.constructor))throw new Error(r.MULTIPLE_POST_CONSTRUCT_METHODS);Reflect.defineMetadata(i.POST_CONSTRUCT,a,t.constructor)}}},9189:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tagged=void 0;var r=n(5092),i=n(626);e.tagged=function(t,e){return function(n,o,a){var u=new r.Metadata(t,e);"number"==typeof a?i.tagParameter(n,o,a,u):i.tagProperty(n,o,u)}}},8245:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.targetName=void 0;var r=n(295),i=n(5092),o=n(626);e.targetName=function(t){return function(e,n,a){var u=new i.Metadata(r.NAME_TAG,t);o.tagParameter(e,n,a,u)}}},9235:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.unmanaged=void 0;var r=n(295),i=n(5092),o=n(626);e.unmanaged=function(){return function(t,e,n){var a=new i.Metadata(r.UNMANAGED_TAG,!0);o.tagParameter(t,e,n,a)}}},683:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Binding=void 0;var r=n(7690),i=n(23),o=function(){function t(t,e){this.id=i.id(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=r.BindingTypeEnum.Invalid,this.constraint=function(t){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.dynamicValue=null}return t.prototype.clone=function(){var e=new t(this.serviceIdentifier,this.scope);return e.activated=e.scope===r.BindingScopeEnum.Singleton&&this.activated,e.implementationType=this.implementationType,e.dynamicValue=this.dynamicValue,e.scope=this.scope,e.type=this.type,e.factory=this.factory,e.provider=this.provider,e.constraint=this.constraint,e.onActivation=this.onActivation,e.cache=this.cache,e},t}();e.Binding=o},3497:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingCount=void 0,e.BindingCount={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1}},6078:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.STACK_OVERFLOW=e.CIRCULAR_DEPENDENCY_IN_FACTORY=e.POST_CONSTRUCT_ERROR=e.MULTIPLE_POST_CONSTRUCT_METHODS=e.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK=e.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE=e.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE=e.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT=e.ARGUMENTS_LENGTH_MISMATCH=e.INVALID_DECORATOR_OPERATION=e.INVALID_TO_SELF_VALUE=e.INVALID_FUNCTION_BINDING=e.INVALID_MIDDLEWARE_RETURN=e.NO_MORE_SNAPSHOTS_AVAILABLE=e.INVALID_BINDING_TYPE=e.NOT_IMPLEMENTED=e.CIRCULAR_DEPENDENCY=e.UNDEFINED_INJECT_ANNOTATION=e.MISSING_INJECT_ANNOTATION=e.MISSING_INJECTABLE_ANNOTATION=e.NOT_REGISTERED=e.CANNOT_UNBIND=e.AMBIGUOUS_MATCH=e.KEY_NOT_FOUND=e.NULL_ARGUMENT=e.DUPLICATED_METADATA=e.DUPLICATED_INJECTABLE_DECORATOR=void 0,e.DUPLICATED_INJECTABLE_DECORATOR="Cannot apply @injectable decorator multiple times.",e.DUPLICATED_METADATA="Metadata key was used more than once in a parameter:",e.NULL_ARGUMENT="NULL argument",e.KEY_NOT_FOUND="Key Not Found",e.AMBIGUOUS_MATCH="Ambiguous match found for serviceIdentifier:",e.CANNOT_UNBIND="Could not unbind serviceIdentifier:",e.NOT_REGISTERED="No matching bindings found for serviceIdentifier:",e.MISSING_INJECTABLE_ANNOTATION="Missing required @injectable annotation in:",e.MISSING_INJECT_ANNOTATION="Missing required @inject or @multiInject annotation in:",e.UNDEFINED_INJECT_ANNOTATION=function(t){return"@inject called with undefined this could mean that the class "+t+" has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation."},e.CIRCULAR_DEPENDENCY="Circular dependency found:",e.NOT_IMPLEMENTED="Sorry, this feature is not fully implemented yet.",e.INVALID_BINDING_TYPE="Invalid binding type:",e.NO_MORE_SNAPSHOTS_AVAILABLE="No snapshot available to restore.",e.INVALID_MIDDLEWARE_RETURN="Invalid return type in middleware. Middleware must return!",e.INVALID_FUNCTION_BINDING="Value provided to function binding must be a function!",e.INVALID_TO_SELF_VALUE="The toSelf function can only be applied when a constructor is used as service identifier",e.INVALID_DECORATOR_OPERATION="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.",e.ARGUMENTS_LENGTH_MISMATCH=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"The number of constructor arguments in the derived class "+t[0]+" must be >= than the number of constructor arguments of its base class."},e.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT="Invalid Container constructor argument. Container options must be an object.",e.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE="Invalid Container option. Default scope must be a string ('singleton' or 'transient').",e.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE="Invalid Container option. Auto bind injectable must be a boolean",e.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK="Invalid Container option. Skip base check must be a boolean",e.MULTIPLE_POST_CONSTRUCT_METHODS="Cannot apply @postConstruct decorator multiple times in the same class",e.POST_CONSTRUCT_ERROR=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"@postConstruct error in class "+t[0]+": "+t[1]},e.CIRCULAR_DEPENDENCY_IN_FACTORY=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"It looks like there is a circular dependency in one of the '"+t[0]+"' bindings. Please investigate bindings withservice identifier '"+t[1]+"'."},e.STACK_OVERFLOW="Maximum call stack size exceeded"},7690:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TargetTypeEnum=e.BindingTypeEnum=e.BindingScopeEnum=void 0,e.BindingScopeEnum={Request:"Request",Singleton:"Singleton",Transient:"Transient"},e.BindingTypeEnum={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"},e.TargetTypeEnum={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"}},295:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NON_CUSTOM_TAG_KEYS=e.POST_CONSTRUCT=e.DESIGN_PARAM_TYPES=e.PARAM_TYPES=e.TAGGED_PROP=e.TAGGED=e.MULTI_INJECT_TAG=e.INJECT_TAG=e.OPTIONAL_TAG=e.UNMANAGED_TAG=e.NAME_TAG=e.NAMED_TAG=void 0,e.NAMED_TAG="named",e.NAME_TAG="name",e.UNMANAGED_TAG="unmanaged",e.OPTIONAL_TAG="optional",e.INJECT_TAG="inject",e.MULTI_INJECT_TAG="multi_inject",e.TAGGED="inversify:tagged",e.TAGGED_PROP="inversify:tagged_props",e.PARAM_TYPES="inversify:paramtypes",e.DESIGN_PARAM_TYPES="design:paramtypes",e.POST_CONSTRUCT="post_construct",e.NON_CUSTOM_TAG_KEYS=[e.INJECT_TAG,e.MULTI_INJECT_TAG,e.NAME_TAG,e.UNMANAGED_TAG,e.NAMED_TAG,e.OPTIONAL_TAG]},596:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{s(r.next(t))}catch(t){o(t)}}function u(t){try{s(r.throw(t))}catch(t){o(t)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}s((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},o=this&&this.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.Container=void 0;var a=n(683),u=n(6078),s=n(7690),c=n(295),f=n(3870),l=n(4142),h=n(9386),d=n(3313),p=n(23),v=n(9552),g=n(1878),y=n(2543),m=function(){function t(t){this._appliedMiddleware=[];var e=t||{};if("object"!=typeof e)throw new Error(""+u.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT);if(void 0===e.defaultScope)e.defaultScope=s.BindingScopeEnum.Transient;else if(e.defaultScope!==s.BindingScopeEnum.Singleton&&e.defaultScope!==s.BindingScopeEnum.Transient&&e.defaultScope!==s.BindingScopeEnum.Request)throw new Error(""+u.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE);if(void 0===e.autoBindInjectable)e.autoBindInjectable=!1;else if("boolean"!=typeof e.autoBindInjectable)throw new Error(""+u.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE);if(void 0===e.skipBaseClassChecks)e.skipBaseClassChecks=!1;else if("boolean"!=typeof e.skipBaseClassChecks)throw new Error(""+u.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK);this.options={autoBindInjectable:e.autoBindInjectable,defaultScope:e.defaultScope,skipBaseClassChecks:e.skipBaseClassChecks},this.id=p.id(),this._bindingDictionary=new y.Lookup,this._snapshots=[],this._middleware=null,this.parent=null,this._metadataReader=new f.MetadataReader}return t.merge=function(e,n){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];var a=new t,u=o([e,n],r).map((function(t){return l.getBindingDictionary(t)})),s=l.getBindingDictionary(a);function c(t,e){t.traverse((function(t,n){n.forEach((function(t){e.add(t.serviceIdentifier,t.clone())}))}))}return u.forEach((function(t){c(t,s)})),a},t.prototype.load=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=this._getContainerModuleHelpersFactory(),r=0,i=t;r<i.length;r++){var o=i[r],a=n(o.id);o.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction)}},t.prototype.loadAsync=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return r(this,void 0,void 0,(function(){var e,n,r,o,a;return i(this,(function(i){switch(i.label){case 0:e=this._getContainerModuleHelpersFactory(),n=0,r=t,i.label=1;case 1:return n<r.length?(o=r[n],a=e(o.id),[4,o.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction)]):[3,4];case 2:i.sent(),i.label=3;case 3:return n++,[3,1];case 4:return[2]}}))}))},t.prototype.unload=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=function(t){return function(e){return e.moduleId===t}};e.forEach((function(e){var n=r(e.id);t._bindingDictionary.removeByCondition(n)}))},t.prototype.bind=function(t){var e=this.options.defaultScope||s.BindingScopeEnum.Transient,n=new a.Binding(t,e);return this._bindingDictionary.add(t,n),new d.BindingToSyntax(n)},t.prototype.rebind=function(t){return this.unbind(t),this.bind(t)},t.prototype.unbind=function(t){try{this._bindingDictionary.remove(t)}catch(e){throw new Error(u.CANNOT_UNBIND+" "+v.getServiceIdentifierAsString(t))}},t.prototype.unbindAll=function(){this._bindingDictionary=new y.Lookup},t.prototype.isBound=function(t){var e=this._bindingDictionary.hasKey(t);return!e&&this.parent&&(e=this.parent.isBound(t)),e},t.prototype.isBoundNamed=function(t,e){return this.isBoundTagged(t,c.NAMED_TAG,e)},t.prototype.isBoundTagged=function(t,e,n){var r=!1;if(this._bindingDictionary.hasKey(t)){var i=this._bindingDictionary.get(t),o=l.createMockRequest(this,t,e,n);r=i.some((function(t){return t.constraint(o)}))}return!r&&this.parent&&(r=this.parent.isBoundTagged(t,e,n)),r},t.prototype.snapshot=function(){this._snapshots.push(g.ContainerSnapshot.of(this._bindingDictionary.clone(),this._middleware))},t.prototype.restore=function(){var t=this._snapshots.pop();if(void 0===t)throw new Error(u.NO_MORE_SNAPSHOTS_AVAILABLE);this._bindingDictionary=t.bindings,this._middleware=t.middleware},t.prototype.createChild=function(e){var n=new t(e||this.options);return n.parent=this,n},t.prototype.applyMiddleware=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._appliedMiddleware=this._appliedMiddleware.concat(t);var n=this._middleware?this._middleware:this._planAndResolve();this._middleware=t.reduce((function(t,e){return e(t)}),n)},t.prototype.applyCustomMetadataReader=function(t){this._metadataReader=t},t.prototype.get=function(t){return this._get(!1,!1,s.TargetTypeEnum.Variable,t)},t.prototype.getTagged=function(t,e,n){return this._get(!1,!1,s.TargetTypeEnum.Variable,t,e,n)},t.prototype.getNamed=function(t,e){return this.getTagged(t,c.NAMED_TAG,e)},t.prototype.getAll=function(t){return this._get(!0,!0,s.TargetTypeEnum.Variable,t)},t.prototype.getAllTagged=function(t,e,n){return this._get(!1,!0,s.TargetTypeEnum.Variable,t,e,n)},t.prototype.getAllNamed=function(t,e){return this.getAllTagged(t,c.NAMED_TAG,e)},t.prototype.resolve=function(t){var e=this.createChild();return e.bind(t).toSelf(),this._appliedMiddleware.forEach((function(t){e.applyMiddleware(t)})),e.get(t)},t.prototype._getContainerModuleHelpersFactory=function(){var t=this,e=function(t,e){t._binding.moduleId=e},n=function(n){return function(r){var i=t.rebind.bind(t)(r);return e(i,n),i}};return function(r){return{bindFunction:(i=r,function(n){var r=t.bind.bind(t)(n);return e(r,i),r}),isboundFunction:function(e){return t.isBound.bind(t)(e)},rebindFunction:n(r),unbindFunction:function(e){t.unbind.bind(t)(e)}};var i}},t.prototype._get=function(t,e,n,r,i,o){var a=null,s={avoidConstraints:t,contextInterceptor:function(t){return t},isMultiInject:e,key:i,serviceIdentifier:r,targetType:n,value:o};if(this._middleware){if(null==(a=this._middleware(s)))throw new Error(u.INVALID_MIDDLEWARE_RETURN)}else a=this._planAndResolve()(s);return a},t.prototype._planAndResolve=function(){var t=this;return function(e){var n=l.plan(t._metadataReader,t,e.isMultiInject,e.targetType,e.serviceIdentifier,e.key,e.value,e.avoidConstraints);return n=e.contextInterceptor(n),h.resolve(n)}},t}();e.Container=m},2913:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AsyncContainerModule=e.ContainerModule=void 0;var r=n(23);e.ContainerModule=function(t){this.id=r.id(),this.registry=t};e.AsyncContainerModule=function(t){this.id=r.id(),this.registry=t}},1878:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContainerSnapshot=void 0;var n=function(){function t(){}return t.of=function(e,n){var r=new t;return r.bindings=e,r.middleware=n,r},t}();e.ContainerSnapshot=n},2543:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Lookup=void 0;var r=n(6078),i=function(){function t(){this._map=new Map}return t.prototype.getMap=function(){return this._map},t.prototype.add=function(t,e){if(null==t)throw new Error(r.NULL_ARGUMENT);if(null==e)throw new Error(r.NULL_ARGUMENT);var n=this._map.get(t);void 0!==n?(n.push(e),this._map.set(t,n)):this._map.set(t,[e])},t.prototype.get=function(t){if(null==t)throw new Error(r.NULL_ARGUMENT);var e=this._map.get(t);if(void 0!==e)return e;throw new Error(r.KEY_NOT_FOUND)},t.prototype.remove=function(t){if(null==t)throw new Error(r.NULL_ARGUMENT);if(!this._map.delete(t))throw new Error(r.KEY_NOT_FOUND)},t.prototype.removeByCondition=function(t){var e=this;this._map.forEach((function(n,r){var i=n.filter((function(e){return!t(e)}));i.length>0?e._map.set(r,i):e._map.delete(r)}))},t.prototype.hasKey=function(t){if(null==t)throw new Error(r.NULL_ARGUMENT);return this._map.has(t)},t.prototype.clone=function(){var e=new t;return this._map.forEach((function(t,n){t.forEach((function(t){return e.add(n,t.clone())}))})),e},t.prototype.traverse=function(t){this._map.forEach((function(e,n){t(n,e)}))},t}();e.Lookup=i},9311:(t,e,n)=>{"use strict";e.f3=e.t6=e.b2=e.W2=void 0,n(295);var r=n(596);Object.defineProperty(e,"W2",{enumerable:!0,get:function(){return r.Container}});n(7690),n(2913);var i=n(1773);Object.defineProperty(e,"b2",{enumerable:!0,get:function(){return i.injectable}});n(9189);var o=n(9817);Object.defineProperty(e,"t6",{enumerable:!0,get:function(){return o.named}});var a=n(6213);Object.defineProperty(e,"f3",{enumerable:!0,get:function(){return a.inject}});n(1316),n(9235),n(1528),n(8245),n(1971),n(3870),n(23),n(626),n(3140),n(9552),n(4384)},1519:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Context=void 0;var r=n(23),i=function(){function t(t){this.id=r.id(),this.container=t}return t.prototype.addPlan=function(t){this.plan=t},t.prototype.setCurrentRequest=function(t){this.currentRequest=t},t}();e.Context=i},5092:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;var r=n(295),i=function(){function t(t,e){this.key=t,this.value=e}return t.prototype.toString=function(){return this.key===r.NAMED_TAG?"named: "+this.value.toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+this.value+" }"},t}();e.Metadata=i},3870:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MetadataReader=void 0;var r=n(295),i=function(){function t(){}return t.prototype.getConstructorMetadata=function(t){return{compilerGeneratedMetadata:Reflect.getMetadata(r.PARAM_TYPES,t),userGeneratedMetadata:Reflect.getMetadata(r.TAGGED,t)||{}}},t.prototype.getPropertiesMetadata=function(t){return Reflect.getMetadata(r.TAGGED_PROP,t)||[]},t}();e.MetadataReader=i},6335:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Plan=void 0;e.Plan=function(t,e){this.parentContext=t,this.rootRequest=e}},4142:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getBindingDictionary=e.createMockRequest=e.plan=void 0;var r=n(3497),i=n(6078),o=n(7690),a=n(295),u=n(2542),s=n(9552),c=n(1519),f=n(5092),l=n(6335),h=n(6664),d=n(4810),p=n(9660);function v(t){return t._bindingDictionary}function g(t,e,n,o,a){var u,c=m(n.container,a.serviceIdentifier);return c.length===r.BindingCount.NoBindingsAvailable&&n.container.options.autoBindInjectable&&"function"==typeof a.serviceIdentifier&&t.getConstructorMetadata(a.serviceIdentifier).compilerGeneratedMetadata&&(n.container.bind(a.serviceIdentifier).toSelf(),c=m(n.container,a.serviceIdentifier)),u=e?c:c.filter((function(t){var e=new d.Request(t.serviceIdentifier,n,o,t,a);return t.constraint(e)})),function(t,e,n,o){switch(e.length){case r.BindingCount.NoBindingsAvailable:if(n.isOptional())return e;var a=s.getServiceIdentifierAsString(t),u=i.NOT_REGISTERED;throw u+=s.listMetadataForTarget(a,n),u+=s.listRegisteredBindingsForServiceIdentifier(o,a,m),new Error(u);case r.BindingCount.OnlyOneBindingAvailable:if(!n.isArray())return e;case r.BindingCount.MultipleBindingsAvailable:default:if(n.isArray())return e;throw a=s.getServiceIdentifierAsString(t),u=i.AMBIGUOUS_MATCH+" "+a,u+=s.listRegisteredBindingsForServiceIdentifier(o,a,m),new Error(u)}}(a.serviceIdentifier,u,a,n.container),u}function y(t,e,n,r,a,u){var s,c;if(null===a){s=g(t,e,r,null,u),c=new d.Request(n,r,null,s,u);var f=new l.Plan(r,c);r.addPlan(f)}else s=g(t,e,r,a,u),c=a.addChildRequest(u.serviceIdentifier,s,u);s.forEach((function(e){var n=null;if(u.isArray())n=c.addChildRequest(e.serviceIdentifier,e,u);else{if(e.cache)return;n=c}if(e.type===o.BindingTypeEnum.Instance&&null!==e.implementationType){var a=h.getDependencies(t,e.implementationType);if(!r.container.options.skipBaseClassChecks){var s=h.getBaseClassDependencyCount(t,e.implementationType);if(a.length<s){var f=i.ARGUMENTS_LENGTH_MISMATCH(h.getFunctionName(e.implementationType));throw new Error(f)}}a.forEach((function(e){y(t,!1,e.serviceIdentifier,r,n,e)}))}}))}function m(t,e){var n=[],r=v(t);return r.hasKey(e)?n=r.get(e):null!==t.parent&&(n=m(t.parent,e)),n}e.getBindingDictionary=v,e.plan=function(t,e,n,r,i,o,l,h){void 0===h&&(h=!1);var d=new c.Context(e),v=function(t,e,n,r,i,o){var u=t?a.MULTI_INJECT_TAG:a.INJECT_TAG,s=new f.Metadata(u,n),c=new p.Target(e,"",n,s);if(void 0!==i){var l=new f.Metadata(i,o);c.metadata.push(l)}return c}(n,r,i,0,o,l);try{return y(t,h,i,d,null,v),d}catch(t){throw u.isStackOverflowExeption(t)&&d.plan&&s.circularDependencyToException(d.plan.rootRequest),t}},e.createMockRequest=function(t,e,n,r){var i=new p.Target(o.TargetTypeEnum.Variable,"",e,new f.Metadata(n,r)),a=new c.Context(t);return new d.Request(e,a,null,[],i)}},8634:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QueryableString=void 0;var n=function(){function t(t){this.str=t}return t.prototype.startsWith=function(t){return 0===this.str.indexOf(t)},t.prototype.endsWith=function(t){var e,n=t.split("").reverse().join("");return e=this.str.split("").reverse().join(""),this.startsWith.call({str:e},n)},t.prototype.contains=function(t){return-1!==this.str.indexOf(t)},t.prototype.equals=function(t){return this.str===t},t.prototype.value=function(){return this.str},t}();e.QueryableString=n},6664:function(t,e,n){"use strict";var r=this&&this.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.getFunctionName=e.getBaseClassDependencyCount=e.getDependencies=void 0;var i=n(6213),o=n(6078),a=n(7690),u=n(295),s=n(9552);Object.defineProperty(e,"getFunctionName",{enumerable:!0,get:function(){return s.getFunctionName}});var c=n(9660);function f(t,e,n,i){var a=t.getConstructorMetadata(n),u=a.compilerGeneratedMetadata;if(void 0===u){var s=o.MISSING_INJECTABLE_ANNOTATION+" "+e+".";throw new Error(s)}var c=a.userGeneratedMetadata,f=Object.keys(c),d=0===n.length&&f.length>0,p=f.length>n.length,v=function(t,e,n,r,i){for(var o=[],a=0;a<i;a++){var u=l(a,t,e,n,r);null!==u&&o.push(u)}return o}(i,e,u,c,d||p?f.length:n.length),g=h(t,n);return r(r([],v),g)}function l(t,e,n,r,u){var s=u[t.toString()]||[],f=d(s),l=!0!==f.unmanaged,h=r[t];if((h=f.inject||f.multiInject||h)instanceof i.LazyServiceIdentifer&&(h=h.unwrap()),l){if(!e&&(h===Object||h===Function||void 0===h)){var p=o.MISSING_INJECT_ANNOTATION+" argument "+t+" in class "+n+".";throw new Error(p)}var v=new c.Target(a.TargetTypeEnum.ConstructorArgument,f.targetName,h);return v.metadata=s,v}return null}function h(t,e){for(var n=t.getPropertiesMetadata(e),i=[],o=0,u=Object.keys(n);o<u.length;o++){var s=u[o],f=n[s],l=d(n[s]),p=l.targetName||s,v=l.inject||l.multiInject,g=new c.Target(a.TargetTypeEnum.ClassProperty,p,v);g.metadata=f,i.push(g)}var y=Object.getPrototypeOf(e.prototype).constructor;if(y!==Object){var m=h(t,y);i=r(r([],i),m)}return i}function d(t){var e={};return t.forEach((function(t){e[t.key.toString()]=t.value})),{inject:e[u.INJECT_TAG],multiInject:e[u.MULTI_INJECT_TAG],targetName:e[u.NAME_TAG],unmanaged:e[u.UNMANAGED_TAG]}}e.getDependencies=function(t,e){return f(t,s.getFunctionName(e),e,!1)},e.getBaseClassDependencyCount=function t(e,n){var r=Object.getPrototypeOf(n.prototype).constructor;if(r!==Object){var i=f(e,s.getFunctionName(r),r,!0),o=i.map((function(t){return t.metadata.filter((function(t){return t.key===u.UNMANAGED_TAG}))})),a=[].concat.apply([],o).length,c=i.length-a;return c>0?c:t(e,r)}return 0}},4810:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Request=void 0;var r=n(23),i=function(){function t(t,e,n,i,o){this.id=r.id(),this.serviceIdentifier=t,this.parentContext=e,this.parentRequest=n,this.target=o,this.childRequests=[],this.bindings=Array.isArray(i)?i:[i],this.requestScope=null===n?new Map:null}return t.prototype.addChildRequest=function(e,n,r){var i=new t(e,this.parentContext,this,n,r);return this.childRequests.push(i),i},t}();e.Request=i},9660:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Target=void 0;var r=n(295),i=n(23),o=n(5092),a=n(8634),u=function(){function t(t,e,n,u){this.id=i.id(),this.type=t,this.serviceIdentifier=n,this.name=new a.QueryableString(e||""),this.metadata=new Array;var s=null;"string"==typeof u?s=new o.Metadata(r.NAMED_TAG,u):u instanceof o.Metadata&&(s=u),null!==s&&this.metadata.push(s)}return t.prototype.hasTag=function(t){for(var e=0,n=this.metadata;e<n.length;e++)if(n[e].key===t)return!0;return!1},t.prototype.isArray=function(){return this.hasTag(r.MULTI_INJECT_TAG)},t.prototype.matchesArray=function(t){return this.matchesTag(r.MULTI_INJECT_TAG)(t)},t.prototype.isNamed=function(){return this.hasTag(r.NAMED_TAG)},t.prototype.isTagged=function(){return this.metadata.some((function(t){return r.NON_CUSTOM_TAG_KEYS.every((function(e){return t.key!==e}))}))},t.prototype.isOptional=function(){return this.matchesTag(r.OPTIONAL_TAG)(!0)},t.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter((function(t){return t.key===r.NAMED_TAG}))[0]:null},t.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter((function(t){return r.NON_CUSTOM_TAG_KEYS.every((function(e){return t.key!==e}))})):null},t.prototype.matchesNamedTag=function(t){return this.matchesTag(r.NAMED_TAG)(t)},t.prototype.matchesTag=function(t){var e=this;return function(n){for(var r=0,i=e.metadata;r<i.length;r++){var o=i[r];if(o.key===t&&o.value===n)return!0}return!1}},t}();e.Target=u},8544:function(t,e,n){"use strict";var r=this&&this.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.resolveInstance=void 0;var i=n(6078),o=n(7690),a=n(295);e.resolveInstance=function(t,e,n){var u,s,c=null;e.length>0?(s=e.filter((function(t){return null!==t.target&&t.target.type===o.TargetTypeEnum.ConstructorArgument})).map(n),c=function(t,e,n){var r=e.filter((function(t){return null!==t.target&&t.target.type===o.TargetTypeEnum.ClassProperty})),i=r.map(n);return r.forEach((function(e,n){var r;r=e.target.name.value();var o=i[n];t[r]=o})),t}(c=new((u=t).bind.apply(u,r([void 0],s))),e,n)):c=new t;return function(t,e){if(Reflect.hasMetadata(a.POST_CONSTRUCT,t)){var n=Reflect.getMetadata(a.POST_CONSTRUCT,t);try{e[n.value]()}catch(e){throw new Error(i.POST_CONSTRUCT_ERROR(t.name,e.message))}}}(t,c),c}},9386:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.resolve=void 0;var r=n(6078),i=n(7690),o=n(2542),a=n(9552),u=n(8544),s=function(t,e,n){try{return n()}catch(n){throw o.isStackOverflowExeption(n)?new Error(r.CIRCULAR_DEPENDENCY_IN_FACTORY(t,e.toString())):n}},c=function(t){return function(e){e.parentContext.setCurrentRequest(e);var n=e.bindings,o=e.childRequests,f=e.target&&e.target.isArray(),l=!(e.parentRequest&&e.parentRequest.target&&e.target&&e.parentRequest.target.matchesArray(e.target.serviceIdentifier));if(f&&l)return o.map((function(e){return c(t)(e)}));var h=null;if(!e.target.isOptional()||0!==n.length){var d=n[0],p=d.scope===i.BindingScopeEnum.Singleton,v=d.scope===i.BindingScopeEnum.Request;if(p&&d.activated)return d.cache;if(v&&null!==t&&t.has(d.id))return t.get(d.id);if(d.type===i.BindingTypeEnum.ConstantValue)h=d.cache,d.activated=!0;else if(d.type===i.BindingTypeEnum.Function)h=d.cache,d.activated=!0;else if(d.type===i.BindingTypeEnum.Constructor)h=d.implementationType;else if(d.type===i.BindingTypeEnum.DynamicValue&&null!==d.dynamicValue)h=s("toDynamicValue",d.serviceIdentifier,(function(){return d.dynamicValue(e.parentContext)}));else if(d.type===i.BindingTypeEnum.Factory&&null!==d.factory)h=s("toFactory",d.serviceIdentifier,(function(){return d.factory(e.parentContext)}));else if(d.type===i.BindingTypeEnum.Provider&&null!==d.provider)h=s("toProvider",d.serviceIdentifier,(function(){return d.provider(e.parentContext)}));else{if(d.type!==i.BindingTypeEnum.Instance||null===d.implementationType){var g=a.getServiceIdentifierAsString(e.serviceIdentifier);throw new Error(r.INVALID_BINDING_TYPE+" "+g)}h=u.resolveInstance(d.implementationType,o,c(t))}return"function"==typeof d.onActivation&&(h=d.onActivation(e.parentContext,h)),p&&(d.cache=h,d.activated=!0),v&&null!==t&&!t.has(d.id)&&t.set(d.id,h),h}}};e.resolve=function(t){return c(t.plan.rootRequest.requestScope)(t.plan.rootRequest)}},1640:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInSyntax=void 0;var r=n(7690),i=n(6890),o=function(){function t(t){this._binding=t}return t.prototype.inRequestScope=function(){return this._binding.scope=r.BindingScopeEnum.Request,new i.BindingWhenOnSyntax(this._binding)},t.prototype.inSingletonScope=function(){return this._binding.scope=r.BindingScopeEnum.Singleton,new i.BindingWhenOnSyntax(this._binding)},t.prototype.inTransientScope=function(){return this._binding.scope=r.BindingScopeEnum.Transient,new i.BindingWhenOnSyntax(this._binding)},t}();e.BindingInSyntax=o},2386:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInWhenOnSyntax=void 0;var r=n(1640),i=n(8926),o=n(2700),a=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new o.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new i.BindingOnSyntax(this._binding),this._bindingInSyntax=new r.BindingInSyntax(t)}return t.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},t.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},t.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t}();e.BindingInWhenOnSyntax=a},8926:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingOnSyntax=void 0;var r=n(2700),i=function(){function t(t){this._binding=t}return t.prototype.onActivation=function(t){return this._binding.onActivation=t,new r.BindingWhenSyntax(this._binding)},t}();e.BindingOnSyntax=i},3313:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingToSyntax=void 0;var r=n(6078),i=n(7690),o=n(2386),a=n(6890),u=function(){function t(t){this._binding=t}return t.prototype.to=function(t){return this._binding.type=i.BindingTypeEnum.Instance,this._binding.implementationType=t,new o.BindingInWhenOnSyntax(this._binding)},t.prototype.toSelf=function(){if("function"!=typeof this._binding.serviceIdentifier)throw new Error(""+r.INVALID_TO_SELF_VALUE);var t=this._binding.serviceIdentifier;return this.to(t)},t.prototype.toConstantValue=function(t){return this._binding.type=i.BindingTypeEnum.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toDynamicValue=function(t){return this._binding.type=i.BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new o.BindingInWhenOnSyntax(this._binding)},t.prototype.toConstructor=function(t){return this._binding.type=i.BindingTypeEnum.Constructor,this._binding.implementationType=t,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toFactory=function(t){return this._binding.type=i.BindingTypeEnum.Factory,this._binding.factory=t,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toFunction=function(t){if("function"!=typeof t)throw new Error(r.INVALID_FUNCTION_BINDING);var e=this.toConstantValue(t);return this._binding.type=i.BindingTypeEnum.Function,this._binding.scope=i.BindingScopeEnum.Singleton,e},t.prototype.toAutoFactory=function(t){return this._binding.type=i.BindingTypeEnum.Factory,this._binding.factory=function(e){return function(){return e.container.get(t)}},this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toProvider=function(t){return this._binding.type=i.BindingTypeEnum.Provider,this._binding.provider=t,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toService=function(t){this.toDynamicValue((function(e){return e.container.get(t)}))},t}();e.BindingToSyntax=u},6890:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenOnSyntax=void 0;var r=n(8926),i=n(2700),o=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new i.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new r.BindingOnSyntax(this._binding)}return t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t}();e.BindingWhenOnSyntax=o},2700:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenSyntax=void 0;var r=n(8926),i=n(3140),o=function(){function t(t){this._binding=t}return t.prototype.when=function(t){return this._binding.constraint=t,new r.BindingOnSyntax(this._binding)},t.prototype.whenTargetNamed=function(t){return this._binding.constraint=i.namedConstraint(t),new r.BindingOnSyntax(this._binding)},t.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(t){return null!==t.target&&!t.target.isNamed()&&!t.target.isTagged()},new r.BindingOnSyntax(this._binding)},t.prototype.whenTargetTagged=function(t,e){return this._binding.constraint=i.taggedConstraint(t)(e),new r.BindingOnSyntax(this._binding)},t.prototype.whenInjectedInto=function(t){return this._binding.constraint=function(e){return i.typeConstraint(t)(e.parentRequest)},new r.BindingOnSyntax(this._binding)},t.prototype.whenParentNamed=function(t){return this._binding.constraint=function(e){return i.namedConstraint(t)(e.parentRequest)},new r.BindingOnSyntax(this._binding)},t.prototype.whenParentTagged=function(t,e){return this._binding.constraint=function(n){return i.taggedConstraint(t)(e)(n.parentRequest)},new r.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorIs=function(t){return this._binding.constraint=function(e){return i.traverseAncerstors(e,i.typeConstraint(t))},new r.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorIs=function(t){return this._binding.constraint=function(e){return!i.traverseAncerstors(e,i.typeConstraint(t))},new r.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorNamed=function(t){return this._binding.constraint=function(e){return i.traverseAncerstors(e,i.namedConstraint(t))},new r.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorNamed=function(t){return this._binding.constraint=function(e){return!i.traverseAncerstors(e,i.namedConstraint(t))},new r.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._binding.constraint=function(n){return i.traverseAncerstors(n,i.taggedConstraint(t)(e))},new r.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorTagged=function(t,e){return this._binding.constraint=function(n){return!i.traverseAncerstors(n,i.taggedConstraint(t)(e))},new r.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorMatches=function(t){return this._binding.constraint=function(e){return i.traverseAncerstors(e,t)},new r.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorMatches=function(t){return this._binding.constraint=function(e){return!i.traverseAncerstors(e,t)},new r.BindingOnSyntax(this._binding)},t}();e.BindingWhenSyntax=o},3140:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.typeConstraint=e.namedConstraint=e.taggedConstraint=e.traverseAncerstors=void 0;var r=n(295),i=n(5092),o=function(t,e){var n=t.parentRequest;return null!==n&&(!!e(n)||o(n,e))};e.traverseAncerstors=o;var a=function(t){return function(e){var n=function(n){return null!==n&&null!==n.target&&n.target.matchesTag(t)(e)};return n.metaData=new i.Metadata(t,e),n}};e.taggedConstraint=a;var u=a(r.NAMED_TAG);e.namedConstraint=u,e.typeConstraint=function(t){return function(e){var n=null;if(null!==e){if(n=e.bindings[0],"string"==typeof t)return n.serviceIdentifier===t;var r=e.bindings[0].implementationType;return t===r}return!1}}},4384:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.multiBindToService=void 0,e.multiBindToService=function(t){return function(e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return n.forEach((function(n){return t.bind(n).toService(e)}))}}}},2542:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isStackOverflowExeption=void 0;var r=n(6078);e.isStackOverflowExeption=function(t){return t instanceof RangeError||t.message===r.STACK_OVERFLOW}},23:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.id=void 0;var n=0;e.id=function(){return n++}},9552:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.circularDependencyToException=e.listMetadataForTarget=e.listRegisteredBindingsForServiceIdentifier=e.getServiceIdentifierAsString=e.getFunctionName=void 0;var r=n(6078);function i(t){return"function"==typeof t?t.name:"symbol"==typeof t?t.toString():t}function o(t,e){return null!==t.parentRequest&&(t.parentRequest.serviceIdentifier===e||o(t.parentRequest,e))}function a(t){if(t.name)return t.name;var e=t.toString(),n=e.match(/^function\s*([^\s(]+)/);return n?n[1]:"Anonymous function: "+e}e.getServiceIdentifierAsString=i,e.listRegisteredBindingsForServiceIdentifier=function(t,e,n){var r="",i=n(t,e);return 0!==i.length&&(r="\nRegistered bindings:",i.forEach((function(t){var e="Object";null!==t.implementationType&&(e=a(t.implementationType)),r=r+"\n "+e,t.constraint.metaData&&(r=r+" - "+t.constraint.metaData)}))),r},e.circularDependencyToException=function t(e){e.childRequests.forEach((function(e){if(o(e,e.serviceIdentifier)){var n=function(t){return function t(e,n){void 0===n&&(n=[]);var r=i(e.serviceIdentifier);return n.push(r),null!==e.parentRequest?t(e.parentRequest,n):n}(t).reverse().join(" --\x3e ")}(e);throw new Error(r.CIRCULAR_DEPENDENCY+" "+n)}t(e)}))},e.listMetadataForTarget=function(t,e){if(e.isTagged()||e.isNamed()){var n="",r=e.getNamedTag(),i=e.getCustomTags();return null!==r&&(n+=r.toString()+"\n"),null!==i&&i.forEach((function(t){n+=t.toString()+"\n"}))," "+t+"\n "+t+" - "+n}return" "+t},e.getFunctionName=a},9392:function(t,e,n){var r;t=n.nmd(t),function(){var i,o="Expected a function",a="__lodash_hash_undefined__",u="__lodash_placeholder__",s=32,c=128,f=1/0,l=9007199254740991,h=NaN,d=4294967295,p=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",s],["partialRight",64],["rearg",256]],v="[object Arguments]",g="[object Array]",y="[object Boolean]",m="[object Date]",b="[object Error]",_="[object Function]",x="[object GeneratorFunction]",w="[object Map]",E="[object Number]",S="[object Object]",A="[object Promise]",T="[object RegExp]",I="[object Set]",C="[object String]",D="[object Symbol]",N="[object WeakMap]",k="[object ArrayBuffer]",R="[object DataView]",O="[object Float32Array]",M="[object Float64Array]",P="[object Int8Array]",G="[object Int16Array]",L="[object Int32Array]",U="[object Uint8Array]",F="[object Uint8ClampedArray]",B="[object Uint16Array]",z="[object Uint32Array]",j=/\b__p \+= '';/g,W=/\b(__p \+=) '' \+/g,V=/(__e\(.*?\)|\b__t\)) \+\n'';/g,X=/&(?:amp|lt|gt|quot|#39);/g,H=/[&<>"']/g,q=RegExp(X.source),Y=RegExp(H.source),K=/<%-([\s\S]+?)%>/g,Z=/<%([\s\S]+?)%>/g,$=/<%=([\s\S]+?)%>/g,J=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,et=/[\\^$.*+?()[\]{}|]/g,nt=RegExp(et.source),rt=/^\s+/,it=/\s/,ot=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,at=/\{\n\/\* \[wrapped with (.+)\] \*/,ut=/,? & /,st=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ct=/[()=,{}\[\]\/\s]/,ft=/\\(\\)?/g,lt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ht=/\w*$/,dt=/^[-+]0x[0-9a-f]+$/i,pt=/^0b[01]+$/i,vt=/^\[object .+?Constructor\]$/,gt=/^0o[0-7]+$/i,yt=/^(?:0|[1-9]\d*)$/,mt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bt=/($^)/,_t=/['\n\r\u2028\u2029\\]/g,xt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",wt="a-z\\xdf-\\xf6\\xf8-\\xff",Et="A-Z\\xc0-\\xd6\\xd8-\\xde",St="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",At="["+St+"]",Tt="["+xt+"]",It="\\d+",Ct="["+wt+"]",Dt="[^\\ud800-\\udfff"+St+It+"\\u2700-\\u27bf"+wt+Et+"]",Nt="\\ud83c[\\udffb-\\udfff]",kt="[^\\ud800-\\udfff]",Rt="(?:\\ud83c[\\udde6-\\uddff]){2}",Ot="[\\ud800-\\udbff][\\udc00-\\udfff]",Mt="["+Et+"]",Pt="(?:"+Ct+"|"+Dt+")",Gt="(?:"+Mt+"|"+Dt+")",Lt="(?:['’](?:d|ll|m|re|s|t|ve))?",Ut="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ft="(?:"+Tt+"|"+Nt+")?",Bt="[\\ufe0e\\ufe0f]?",zt=Bt+Ft+"(?:\\u200d(?:"+[kt,Rt,Ot].join("|")+")"+Bt+Ft+")*",jt="(?:"+["[\\u2700-\\u27bf]",Rt,Ot].join("|")+")"+zt,Wt="(?:"+[kt+Tt+"?",Tt,Rt,Ot,"[\\ud800-\\udfff]"].join("|")+")",Vt=RegExp("['’]","g"),Xt=RegExp(Tt,"g"),Ht=RegExp(Nt+"(?="+Nt+")|"+Wt+zt,"g"),qt=RegExp([Mt+"?"+Ct+"+"+Lt+"(?="+[At,Mt,"$"].join("|")+")",Gt+"+"+Ut+"(?="+[At,Mt+Pt,"$"].join("|")+")",Mt+"?"+Pt+"+"+Lt,Mt+"+"+Ut,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",It,jt].join("|"),"g"),Yt=RegExp("[\\u200d\\ud800-\\udfff"+xt+"\\ufe0e\\ufe0f]"),Kt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Zt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],$t=-1,Jt={};Jt[O]=Jt[M]=Jt[P]=Jt[G]=Jt[L]=Jt[U]=Jt[F]=Jt[B]=Jt[z]=!0,Jt[v]=Jt[g]=Jt[k]=Jt[y]=Jt[R]=Jt[m]=Jt[b]=Jt[_]=Jt[w]=Jt[E]=Jt[S]=Jt[T]=Jt[I]=Jt[C]=Jt[N]=!1;var Qt={};Qt[v]=Qt[g]=Qt[k]=Qt[R]=Qt[y]=Qt[m]=Qt[O]=Qt[M]=Qt[P]=Qt[G]=Qt[L]=Qt[w]=Qt[E]=Qt[S]=Qt[T]=Qt[I]=Qt[C]=Qt[D]=Qt[U]=Qt[F]=Qt[B]=Qt[z]=!0,Qt[b]=Qt[_]=Qt[N]=!1;var te={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ee=parseFloat,ne=parseInt,re="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,ie="object"==typeof self&&self&&self.Object===Object&&self,oe=re||ie||Function("return this")(),ae=e&&!e.nodeType&&e,ue=ae&&t&&!t.nodeType&&t,se=ue&&ue.exports===ae,ce=se&&re.process,fe=function(){try{return ue&&ue.require&&ue.require("util").types||ce&&ce.binding&&ce.binding("util")}catch(t){}}(),le=fe&&fe.isArrayBuffer,he=fe&&fe.isDate,de=fe&&fe.isMap,pe=fe&&fe.isRegExp,ve=fe&&fe.isSet,ge=fe&&fe.isTypedArray;function ye(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function me(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i<o;){var a=t[i];e(r,a,n(a),t)}return r}function be(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function _e(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function xe(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function we(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o}function Ee(t,e){return!(null==t||!t.length)&&Oe(t,e,0)>-1}function Se(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function Ae(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function Te(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function Ie(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}function Ce(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function De(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var Ne=Le("length");function ke(t,e,n){var r;return n(t,(function(t,n,i){if(e(t,n,i))return r=n,!1})),r}function Re(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function Oe(t,e,n){return e==e?function(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):Re(t,Pe,n)}function Me(t,e,n,r){for(var i=n-1,o=t.length;++i<o;)if(r(t[i],e))return i;return-1}function Pe(t){return t!=t}function Ge(t,e){var n=null==t?0:t.length;return n?Be(t,e)/n:h}function Le(t){return function(e){return null==e?i:e[t]}}function Ue(t){return function(e){return null==t?i:t[e]}}function Fe(t,e,n,r,i){return i(t,(function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)})),n}function Be(t,e){for(var n,r=-1,o=t.length;++r<o;){var a=e(t[r]);a!==i&&(n=n===i?a:n+a)}return n}function ze(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function je(t){return t?t.slice(0,un(t)+1).replace(rt,""):t}function We(t){return function(e){return t(e)}}function Ve(t,e){return Ae(e,(function(e){return t[e]}))}function Xe(t,e){return t.has(e)}function He(t,e){for(var n=-1,r=t.length;++n<r&&Oe(e,t[n],0)>-1;);return n}function qe(t,e){for(var n=t.length;n--&&Oe(e,t[n],0)>-1;);return n}function Ye(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}var Ke=Ue({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),Ze=Ue({"&":"&","<":"<",">":">",'"':""","'":"'"});function $e(t){return"\\"+te[t]}function Je(t){return Yt.test(t)}function Qe(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function tn(t,e){return function(n){return t(e(n))}}function en(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n];a!==e&&a!==u||(t[n]=u,o[i++]=n)}return o}function nn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function rn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}function on(t){return Je(t)?function(t){for(var e=Ht.lastIndex=0;Ht.test(t);)++e;return e}(t):Ne(t)}function an(t){return Je(t)?function(t){return t.match(Ht)||[]}(t):function(t){return t.split("")}(t)}function un(t){for(var e=t.length;e--&&it.test(t.charAt(e)););return e}var sn=Ue({"&":"&","<":"<",">":">",""":'"',"'":"'"}),cn=function t(e){var n,r=(e=null==e?oe:cn.defaults(oe.Object(),e,cn.pick(oe,Zt))).Array,it=e.Date,xt=e.Error,wt=e.Function,Et=e.Math,St=e.Object,At=e.RegExp,Tt=e.String,It=e.TypeError,Ct=r.prototype,Dt=wt.prototype,Nt=St.prototype,kt=e["__core-js_shared__"],Rt=Dt.toString,Ot=Nt.hasOwnProperty,Mt=0,Pt=(n=/[^.]+$/.exec(kt&&kt.keys&&kt.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Gt=Nt.toString,Lt=Rt.call(St),Ut=oe._,Ft=At("^"+Rt.call(Ot).replace(et,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Bt=se?e.Buffer:i,zt=e.Symbol,jt=e.Uint8Array,Wt=Bt?Bt.allocUnsafe:i,Ht=tn(St.getPrototypeOf,St),Yt=St.create,te=Nt.propertyIsEnumerable,re=Ct.splice,ie=zt?zt.isConcatSpreadable:i,ae=zt?zt.iterator:i,ue=zt?zt.toStringTag:i,ce=function(){try{var t=co(St,"defineProperty");return t({},"",{}),t}catch(t){}}(),fe=e.clearTimeout!==oe.clearTimeout&&e.clearTimeout,Ne=it&&it.now!==oe.Date.now&&it.now,Ue=e.setTimeout!==oe.setTimeout&&e.setTimeout,fn=Et.ceil,ln=Et.floor,hn=St.getOwnPropertySymbols,dn=Bt?Bt.isBuffer:i,pn=e.isFinite,vn=Ct.join,gn=tn(St.keys,St),yn=Et.max,mn=Et.min,bn=it.now,_n=e.parseInt,xn=Et.random,wn=Ct.reverse,En=co(e,"DataView"),Sn=co(e,"Map"),An=co(e,"Promise"),Tn=co(e,"Set"),In=co(e,"WeakMap"),Cn=co(St,"create"),Dn=In&&new In,Nn={},kn=Fo(En),Rn=Fo(Sn),On=Fo(An),Mn=Fo(Tn),Pn=Fo(In),Gn=zt?zt.prototype:i,Ln=Gn?Gn.valueOf:i,Un=Gn?Gn.toString:i;function Fn(t){if(nu(t)&&!Xa(t)&&!(t instanceof Wn)){if(t instanceof jn)return t;if(Ot.call(t,"__wrapped__"))return Bo(t)}return new jn(t)}var Bn=function(){function t(){}return function(e){if(!eu(e))return{};if(Yt)return Yt(e);t.prototype=e;var n=new t;return t.prototype=i,n}}();function zn(){}function jn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=i}function Wn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Vn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Xn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Hn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function qn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Hn;++e<n;)this.add(t[e])}function Yn(t){var e=this.__data__=new Xn(t);this.size=e.size}function Kn(t,e){var n=Xa(t),r=!n&&Va(t),i=!n&&!r&&Ka(t),o=!n&&!r&&!i&&fu(t),a=n||r||i||o,u=a?ze(t.length,Tt):[],s=u.length;for(var c in t)!e&&!Ot.call(t,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||yo(c,s))||u.push(c);return u}function Zn(t){var e=t.length;return e?t[Hr(0,e-1)]:i}function $n(t,e){return Mo(Ii(t),ar(e,0,t.length))}function Jn(t){return Mo(Ii(t))}function Qn(t,e,n){(n!==i&&!za(t[e],n)||n===i&&!(e in t))&&ir(t,e,n)}function tr(t,e,n){var r=t[e];Ot.call(t,e)&&za(r,n)&&(n!==i||e in t)||ir(t,e,n)}function er(t,e){for(var n=t.length;n--;)if(za(t[n][0],e))return n;return-1}function nr(t,e,n,r){return lr(t,(function(t,i,o){e(r,t,n(t),o)})),r}function rr(t,e){return t&&Ci(e,Ru(e),t)}function ir(t,e,n){"__proto__"==e&&ce?ce(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function or(t,e){for(var n=-1,o=e.length,a=r(o),u=null==t;++n<o;)a[n]=u?i:Iu(t,e[n]);return a}function ar(t,e,n){return t==t&&(n!==i&&(t=t<=n?t:n),e!==i&&(t=t>=e?t:e)),t}function ur(t,e,n,r,o,a){var u,s=1&e,c=2&e,f=4&e;if(n&&(u=o?n(t,r,o,a):n(t)),u!==i)return u;if(!eu(t))return t;var l=Xa(t);if(l){if(u=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Ot.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!s)return Ii(t,u)}else{var h=ho(t),d=h==_||h==x;if(Ka(t))return xi(t,s);if(h==S||h==v||d&&!o){if(u=c||d?{}:vo(t),!s)return c?function(t,e){return Ci(t,lo(t),e)}(t,function(t,e){return t&&Ci(e,Ou(e),t)}(u,t)):function(t,e){return Ci(t,fo(t),e)}(t,rr(u,t))}else{if(!Qt[h])return o?t:{};u=function(t,e,n){var r,i=t.constructor;switch(e){case k:return wi(t);case y:case m:return new i(+t);case R:return function(t,e){var n=e?wi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case O:case M:case P:case G:case L:case U:case F:case B:case z:return Ei(t,n);case w:case I:return new i;case E:case C:return new i(t);case T:return function(t){var e=new t.constructor(t.source,ht.exec(t));return e.lastIndex=t.lastIndex,e}(t);case D:return r=t,Ln?St(Ln.call(r)):{}}}(t,h,s)}}a||(a=new Yn);var p=a.get(t);if(p)return p;a.set(t,u),uu(t)?t.forEach((function(r){u.add(ur(r,e,n,r,t,a))})):ru(t)&&t.forEach((function(r,i){u.set(i,ur(r,e,n,i,t,a))}));var g=l?i:(f?c?no:eo:c?Ou:Ru)(t);return be(g||t,(function(r,i){g&&(r=t[i=r]),tr(u,i,ur(r,e,n,i,t,a))})),u}function sr(t,e,n){var r=n.length;if(null==t)return!r;for(t=St(t);r--;){var o=n[r],a=e[o],u=t[o];if(u===i&&!(o in t)||!a(u))return!1}return!0}function cr(t,e,n){if("function"!=typeof t)throw new It(o);return No((function(){t.apply(i,n)}),e)}function fr(t,e,n,r){var i=-1,o=Ee,a=!0,u=t.length,s=[],c=e.length;if(!u)return s;n&&(e=Ae(e,We(n))),r?(o=Se,a=!1):e.length>=200&&(o=Xe,a=!1,e=new qn(e));t:for(;++i<u;){var f=t[i],l=null==n?f:n(f);if(f=r||0!==f?f:0,a&&l==l){for(var h=c;h--;)if(e[h]===l)continue t;s.push(f)}else o(e,l,r)||s.push(f)}return s}Fn.templateSettings={escape:K,evaluate:Z,interpolate:$,variable:"",imports:{_:Fn}},Fn.prototype=zn.prototype,Fn.prototype.constructor=Fn,jn.prototype=Bn(zn.prototype),jn.prototype.constructor=jn,Wn.prototype=Bn(zn.prototype),Wn.prototype.constructor=Wn,Vn.prototype.clear=function(){this.__data__=Cn?Cn(null):{},this.size=0},Vn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Vn.prototype.get=function(t){var e=this.__data__;if(Cn){var n=e[t];return n===a?i:n}return Ot.call(e,t)?e[t]:i},Vn.prototype.has=function(t){var e=this.__data__;return Cn?e[t]!==i:Ot.call(e,t)},Vn.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Cn&&e===i?a:e,this},Xn.prototype.clear=function(){this.__data__=[],this.size=0},Xn.prototype.delete=function(t){var e=this.__data__,n=er(e,t);return!(n<0||(n==e.length-1?e.pop():re.call(e,n,1),--this.size,0))},Xn.prototype.get=function(t){var e=this.__data__,n=er(e,t);return n<0?i:e[n][1]},Xn.prototype.has=function(t){return er(this.__data__,t)>-1},Xn.prototype.set=function(t,e){var n=this.__data__,r=er(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Hn.prototype.clear=function(){this.size=0,this.__data__={hash:new Vn,map:new(Sn||Xn),string:new Vn}},Hn.prototype.delete=function(t){var e=uo(this,t).delete(t);return this.size-=e?1:0,e},Hn.prototype.get=function(t){return uo(this,t).get(t)},Hn.prototype.has=function(t){return uo(this,t).has(t)},Hn.prototype.set=function(t,e){var n=uo(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},qn.prototype.add=qn.prototype.push=function(t){return this.__data__.set(t,a),this},qn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.clear=function(){this.__data__=new Xn,this.size=0},Yn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Yn.prototype.get=function(t){return this.__data__.get(t)},Yn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Xn){var r=n.__data__;if(!Sn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Hn(r)}return n.set(t,e),this.size=n.size,this};var lr=ki(br),hr=ki(_r,!0);function dr(t,e){var n=!0;return lr(t,(function(t,r,i){return n=!!e(t,r,i)})),n}function pr(t,e,n){for(var r=-1,o=t.length;++r<o;){var a=t[r],u=e(a);if(null!=u&&(s===i?u==u&&!cu(u):n(u,s)))var s=u,c=a}return c}function vr(t,e){var n=[];return lr(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}function gr(t,e,n,r,i){var o=-1,a=t.length;for(n||(n=go),i||(i=[]);++o<a;){var u=t[o];e>0&&n(u)?e>1?gr(u,e-1,n,r,i):Te(i,u):r||(i[i.length]=u)}return i}var yr=Ri(),mr=Ri(!0);function br(t,e){return t&&yr(t,e,Ru)}function _r(t,e){return t&&mr(t,e,Ru)}function xr(t,e){return we(e,(function(e){return Ja(t[e])}))}function wr(t,e){for(var n=0,r=(e=yi(e,t)).length;null!=t&&n<r;)t=t[Uo(e[n++])];return n&&n==r?t:i}function Er(t,e,n){var r=e(t);return Xa(t)?r:Te(r,n(t))}function Sr(t){return null==t?t===i?"[object Undefined]":"[object Null]":ue&&ue in St(t)?function(t){var e=Ot.call(t,ue),n=t[ue];try{t[ue]=i;var r=!0}catch(t){}var o=Gt.call(t);return r&&(e?t[ue]=n:delete t[ue]),o}(t):function(t){return Gt.call(t)}(t)}function Ar(t,e){return t>e}function Tr(t,e){return null!=t&&Ot.call(t,e)}function Ir(t,e){return null!=t&&e in St(t)}function Cr(t,e,n){for(var o=n?Se:Ee,a=t[0].length,u=t.length,s=u,c=r(u),f=1/0,l=[];s--;){var h=t[s];s&&e&&(h=Ae(h,We(e))),f=mn(h.length,f),c[s]=!n&&(e||a>=120&&h.length>=120)?new qn(s&&h):i}h=t[0];var d=-1,p=c[0];t:for(;++d<a&&l.length<f;){var v=h[d],g=e?e(v):v;if(v=n||0!==v?v:0,!(p?Xe(p,g):o(l,g,n))){for(s=u;--s;){var y=c[s];if(!(y?Xe(y,g):o(t[s],g,n)))continue t}p&&p.push(g),l.push(v)}}return l}function Dr(t,e,n){var r=null==(t=To(t,e=yi(e,t)))?t:t[Uo($o(e))];return null==r?i:ye(r,t,n)}function Nr(t){return nu(t)&&Sr(t)==v}function kr(t,e,n,r,o){return t===e||(null==t||null==e||!nu(t)&&!nu(e)?t!=t&&e!=e:function(t,e,n,r,o,a){var u=Xa(t),s=Xa(e),c=u?g:ho(t),f=s?g:ho(e),l=(c=c==v?S:c)==S,h=(f=f==v?S:f)==S,d=c==f;if(d&&Ka(t)){if(!Ka(e))return!1;u=!0,l=!1}if(d&&!l)return a||(a=new Yn),u||fu(t)?Qi(t,e,n,r,o,a):function(t,e,n,r,i,o,a){switch(n){case R:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case k:return!(t.byteLength!=e.byteLength||!o(new jt(t),new jt(e)));case y:case m:case E:return za(+t,+e);case b:return t.name==e.name&&t.message==e.message;case T:case C:return t==e+"";case w:var u=Qe;case I:var s=1&r;if(u||(u=nn),t.size!=e.size&&!s)return!1;var c=a.get(t);if(c)return c==e;r|=2,a.set(t,e);var f=Qi(u(t),u(e),r,i,o,a);return a.delete(t),f;case D:if(Ln)return Ln.call(t)==Ln.call(e)}return!1}(t,e,c,n,r,o,a);if(!(1&n)){var p=l&&Ot.call(t,"__wrapped__"),_=h&&Ot.call(e,"__wrapped__");if(p||_){var x=p?t.value():t,A=_?e.value():e;return a||(a=new Yn),o(x,A,n,r,a)}}return!!d&&(a||(a=new Yn),function(t,e,n,r,o,a){var u=1&n,s=eo(t),c=s.length;if(c!=eo(e).length&&!u)return!1;for(var f=c;f--;){var l=s[f];if(!(u?l in e:Ot.call(e,l)))return!1}var h=a.get(t),d=a.get(e);if(h&&d)return h==e&&d==t;var p=!0;a.set(t,e),a.set(e,t);for(var v=u;++f<c;){var g=t[l=s[f]],y=e[l];if(r)var m=u?r(y,g,l,e,t,a):r(g,y,l,t,e,a);if(!(m===i?g===y||o(g,y,n,r,a):m)){p=!1;break}v||(v="constructor"==l)}if(p&&!v){var b=t.constructor,_=e.constructor;b==_||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _||(p=!1)}return a.delete(t),a.delete(e),p}(t,e,n,r,o,a))}(t,e,n,r,kr,o))}function Rr(t,e,n,r){var o=n.length,a=o,u=!r;if(null==t)return!a;for(t=St(t);o--;){var s=n[o];if(u&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++o<a;){var c=(s=n[o])[0],f=t[c],l=s[1];if(u&&s[2]){if(f===i&&!(c in t))return!1}else{var h=new Yn;if(r)var d=r(f,l,c,t,e,h);if(!(d===i?kr(l,f,3,r,h):d))return!1}}return!0}function Or(t){return!(!eu(t)||(e=t,Pt&&Pt in e))&&(Ja(t)?Ft:vt).test(Fo(t));var e}function Mr(t){return"function"==typeof t?t:null==t?is:"object"==typeof t?Xa(t)?Fr(t[0],t[1]):Ur(t):ds(t)}function Pr(t){if(!wo(t))return gn(t);var e=[];for(var n in St(t))Ot.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Gr(t,e){return t<e}function Lr(t,e){var n=-1,i=qa(t)?r(t.length):[];return lr(t,(function(t,r,o){i[++n]=e(t,r,o)})),i}function Ur(t){var e=so(t);return 1==e.length&&e[0][2]?So(e[0][0],e[0][1]):function(n){return n===t||Rr(n,t,e)}}function Fr(t,e){return bo(t)&&Eo(e)?So(Uo(t),e):function(n){var r=Iu(n,t);return r===i&&r===e?Cu(n,t):kr(e,r,3)}}function Br(t,e,n,r,o){t!==e&&yr(e,(function(a,u){if(o||(o=new Yn),eu(a))!function(t,e,n,r,o,a,u){var s=Co(t,n),c=Co(e,n),f=u.get(c);if(f)Qn(t,n,f);else{var l=a?a(s,c,n+"",t,e,u):i,h=l===i;if(h){var d=Xa(c),p=!d&&Ka(c),v=!d&&!p&&fu(c);l=c,d||p||v?Xa(s)?l=s:Ya(s)?l=Ii(s):p?(h=!1,l=xi(c,!0)):v?(h=!1,l=Ei(c,!0)):l=[]:ou(c)||Va(c)?(l=s,Va(s)?l=mu(s):eu(s)&&!Ja(s)||(l=vo(c))):h=!1}h&&(u.set(c,l),o(l,c,r,a,u),u.delete(c)),Qn(t,n,l)}}(t,e,u,n,Br,r,o);else{var s=r?r(Co(t,u),a,u+"",t,e,o):i;s===i&&(s=a),Qn(t,u,s)}}),Ou)}function zr(t,e){var n=t.length;if(n)return yo(e+=e<0?n:0,n)?t[e]:i}function jr(t,e,n){e=e.length?Ae(e,(function(t){return Xa(t)?function(e){return wr(e,1===t.length?t[0]:t)}:t})):[is];var r=-1;e=Ae(e,We(ao()));var i=Lr(t,(function(t,n,i){var o=Ae(e,(function(e){return e(t)}));return{criteria:o,index:++r,value:t}}));return function(t,e){var r=t.length;for(t.sort((function(t,e){return function(t,e,n){for(var r=-1,i=t.criteria,o=e.criteria,a=i.length,u=n.length;++r<a;){var s=Si(i[r],o[r]);if(s)return r>=u?s:s*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}));r--;)t[r]=t[r].value;return t}(i)}function Wr(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var a=e[r],u=wr(t,a);n(u,a)&&$r(o,yi(a,t),u)}return o}function Vr(t,e,n,r){var i=r?Me:Oe,o=-1,a=e.length,u=t;for(t===e&&(e=Ii(e)),n&&(u=Ae(t,We(n)));++o<a;)for(var s=0,c=e[o],f=n?n(c):c;(s=i(u,f,s,r))>-1;)u!==t&&re.call(u,s,1),re.call(t,s,1);return t}function Xr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;yo(i)?re.call(t,i,1):ci(t,i)}}return t}function Hr(t,e){return t+ln(xn()*(e-t+1))}function qr(t,e){var n="";if(!t||e<1||e>l)return n;do{e%2&&(n+=t),(e=ln(e/2))&&(t+=t)}while(e);return n}function Yr(t,e){return ko(Ao(t,e,is),t+"")}function Kr(t){return Zn(zu(t))}function Zr(t,e){var n=zu(t);return Mo(n,ar(e,0,n.length))}function $r(t,e,n,r){if(!eu(t))return t;for(var o=-1,a=(e=yi(e,t)).length,u=a-1,s=t;null!=s&&++o<a;){var c=Uo(e[o]),f=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return t;if(o!=u){var l=s[c];(f=r?r(l,c,s):i)===i&&(f=eu(l)?l:yo(e[o+1])?[]:{})}tr(s,c,f),s=s[c]}return t}var Jr=Dn?function(t,e){return Dn.set(t,e),t}:is,Qr=ce?function(t,e){return ce(t,"toString",{configurable:!0,enumerable:!1,value:es(e),writable:!0})}:is;function ti(t){return Mo(zu(t))}function ei(t,e,n){var i=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var a=r(o);++i<o;)a[i]=t[i+e];return a}function ni(t,e){var n;return lr(t,(function(t,r,i){return!(n=e(t,r,i))})),!!n}function ri(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e==e&&i<=2147483647){for(;r<i;){var o=r+i>>>1,a=t[o];null!==a&&!cu(a)&&(n?a<=e:a<e)?r=o+1:i=o}return i}return ii(t,e,is,n)}function ii(t,e,n,r){var o=0,a=null==t?0:t.length;if(0===a)return 0;for(var u=(e=n(e))!=e,s=null===e,c=cu(e),f=e===i;o<a;){var l=ln((o+a)/2),h=n(t[l]),d=h!==i,p=null===h,v=h==h,g=cu(h);if(u)var y=r||v;else y=f?v&&(r||d):s?v&&d&&(r||!p):c?v&&d&&!p&&(r||!g):!p&&!g&&(r?h<=e:h<e);y?o=l+1:a=l}return mn(a,4294967294)}function oi(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n],u=e?e(a):a;if(!n||!za(u,s)){var s=u;o[i++]=0===a?0:a}}return o}function ai(t){return"number"==typeof t?t:cu(t)?h:+t}function ui(t){if("string"==typeof t)return t;if(Xa(t))return Ae(t,ui)+"";if(cu(t))return Un?Un.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function si(t,e,n){var r=-1,i=Ee,o=t.length,a=!0,u=[],s=u;if(n)a=!1,i=Se;else if(o>=200){var c=e?null:qi(t);if(c)return nn(c);a=!1,i=Xe,s=new qn}else s=e?[]:u;t:for(;++r<o;){var f=t[r],l=e?e(f):f;if(f=n||0!==f?f:0,a&&l==l){for(var h=s.length;h--;)if(s[h]===l)continue t;e&&s.push(l),u.push(f)}else i(s,l,n)||(s!==u&&s.push(l),u.push(f))}return u}function ci(t,e){return null==(t=To(t,e=yi(e,t)))||delete t[Uo($o(e))]}function fi(t,e,n,r){return $r(t,e,n(wr(t,e)),r)}function li(t,e,n,r){for(var i=t.length,o=r?i:-1;(r?o--:++o<i)&&e(t[o],o,t););return n?ei(t,r?0:o,r?o+1:i):ei(t,r?o+1:0,r?i:o)}function hi(t,e){var n=t;return n instanceof Wn&&(n=n.value()),Ie(e,(function(t,e){return e.func.apply(e.thisArg,Te([t],e.args))}),n)}function di(t,e,n){var i=t.length;if(i<2)return i?si(t[0]):[];for(var o=-1,a=r(i);++o<i;)for(var u=t[o],s=-1;++s<i;)s!=o&&(a[o]=fr(a[o]||u,t[s],e,n));return si(gr(a,1),e,n)}function pi(t,e,n){for(var r=-1,o=t.length,a=e.length,u={};++r<o;){var s=r<a?e[r]:i;n(u,t[r],s)}return u}function vi(t){return Ya(t)?t:[]}function gi(t){return"function"==typeof t?t:is}function yi(t,e){return Xa(t)?t:bo(t,e)?[t]:Lo(bu(t))}var mi=Yr;function bi(t,e,n){var r=t.length;return n=n===i?r:n,!e&&n>=r?t:ei(t,e,n)}var _i=fe||function(t){return oe.clearTimeout(t)};function xi(t,e){if(e)return t.slice();var n=t.length,r=Wt?Wt(n):new t.constructor(n);return t.copy(r),r}function wi(t){var e=new t.constructor(t.byteLength);return new jt(e).set(new jt(t)),e}function Ei(t,e){var n=e?wi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Si(t,e){if(t!==e){var n=t!==i,r=null===t,o=t==t,a=cu(t),u=e!==i,s=null===e,c=e==e,f=cu(e);if(!s&&!f&&!a&&t>e||a&&u&&c&&!s&&!f||r&&u&&c||!n&&c||!o)return 1;if(!r&&!a&&!f&&t<e||f&&n&&o&&!r&&!a||s&&n&&o||!u&&o||!c)return-1}return 0}function Ai(t,e,n,i){for(var o=-1,a=t.length,u=n.length,s=-1,c=e.length,f=yn(a-u,0),l=r(c+f),h=!i;++s<c;)l[s]=e[s];for(;++o<u;)(h||o<a)&&(l[n[o]]=t[o]);for(;f--;)l[s++]=t[o++];return l}function Ti(t,e,n,i){for(var o=-1,a=t.length,u=-1,s=n.length,c=-1,f=e.length,l=yn(a-s,0),h=r(l+f),d=!i;++o<l;)h[o]=t[o];for(var p=o;++c<f;)h[p+c]=e[c];for(;++u<s;)(d||o<a)&&(h[p+n[u]]=t[o++]);return h}function Ii(t,e){var n=-1,i=t.length;for(e||(e=r(i));++n<i;)e[n]=t[n];return e}function Ci(t,e,n,r){var o=!n;n||(n={});for(var a=-1,u=e.length;++a<u;){var s=e[a],c=r?r(n[s],t[s],s,n,t):i;c===i&&(c=t[s]),o?ir(n,s,c):tr(n,s,c)}return n}function Di(t,e){return function(n,r){var i=Xa(n)?me:nr,o=e?e():{};return i(n,t,ao(r,2),o)}}function Ni(t){return Yr((function(e,n){var r=-1,o=n.length,a=o>1?n[o-1]:i,u=o>2?n[2]:i;for(a=t.length>3&&"function"==typeof a?(o--,a):i,u&&mo(n[0],n[1],u)&&(a=o<3?i:a,o=1),e=St(e);++r<o;){var s=n[r];s&&t(e,s,r,a)}return e}))}function ki(t,e){return function(n,r){if(null==n)return n;if(!qa(n))return t(n,r);for(var i=n.length,o=e?i:-1,a=St(n);(e?o--:++o<i)&&!1!==r(a[o],o,a););return n}}function Ri(t){return function(e,n,r){for(var i=-1,o=St(e),a=r(e),u=a.length;u--;){var s=a[t?u:++i];if(!1===n(o[s],s,o))break}return e}}function Oi(t){return function(e){var n=Je(e=bu(e))?an(e):i,r=n?n[0]:e.charAt(0),o=n?bi(n,1).join(""):e.slice(1);return r[t]()+o}}function Mi(t){return function(e){return Ie(Ju(Vu(e).replace(Vt,"")),t,"")}}function Pi(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=Bn(t.prototype),r=t.apply(n,e);return eu(r)?r:n}}function Gi(t){return function(e,n,r){var o=St(e);if(!qa(e)){var a=ao(n,3);e=Ru(e),n=function(t){return a(o[t],t,o)}}var u=t(e,n,r);return u>-1?o[a?e[u]:u]:i}}function Li(t){return to((function(e){var n=e.length,r=n,a=jn.prototype.thru;for(t&&e.reverse();r--;){var u=e[r];if("function"!=typeof u)throw new It(o);if(a&&!s&&"wrapper"==io(u))var s=new jn([],!0)}for(r=s?r:n;++r<n;){var c=io(u=e[r]),f="wrapper"==c?ro(u):i;s=f&&_o(f[0])&&424==f[1]&&!f[4].length&&1==f[9]?s[io(f[0])].apply(s,f[3]):1==u.length&&_o(u)?s[c]():s.thru(u)}return function(){var t=arguments,r=t[0];if(s&&1==t.length&&Xa(r))return s.plant(r).value();for(var i=0,o=n?e[i].apply(this,t):r;++i<n;)o=e[i].call(this,o);return o}}))}function Ui(t,e,n,o,a,u,s,f,l,h){var d=e&c,p=1&e,v=2&e,g=24&e,y=512&e,m=v?i:Pi(t);return function i(){for(var c=arguments.length,b=r(c),_=c;_--;)b[_]=arguments[_];if(g)var x=oo(i),w=Ye(b,x);if(o&&(b=Ai(b,o,a,g)),u&&(b=Ti(b,u,s,g)),c-=w,g&&c<h){var E=en(b,x);return Xi(t,e,Ui,i.placeholder,n,b,E,f,l,h-c)}var S=p?n:this,A=v?S[t]:t;return c=b.length,f?b=Io(b,f):y&&c>1&&b.reverse(),d&&l<c&&(b.length=l),this&&this!==oe&&this instanceof i&&(A=m||Pi(A)),A.apply(S,b)}}function Fi(t,e){return function(n,r){return function(t,e,n,r){return br(t,(function(t,i,o){e(r,n(t),i,o)})),r}(n,t,e(r),{})}}function Bi(t,e){return function(n,r){var o;if(n===i&&r===i)return e;if(n!==i&&(o=n),r!==i){if(o===i)return r;"string"==typeof n||"string"==typeof r?(n=ui(n),r=ui(r)):(n=ai(n),r=ai(r)),o=t(n,r)}return o}}function zi(t){return to((function(e){return e=Ae(e,We(ao())),Yr((function(n){var r=this;return t(e,(function(t){return ye(t,r,n)}))}))}))}function ji(t,e){var n=(e=e===i?" ":ui(e)).length;if(n<2)return n?qr(e,t):e;var r=qr(e,fn(t/on(e)));return Je(e)?bi(an(r),0,t).join(""):r.slice(0,t)}function Wi(t){return function(e,n,o){return o&&"number"!=typeof o&&mo(e,n,o)&&(n=o=i),e=pu(e),n===i?(n=e,e=0):n=pu(n),function(t,e,n,i){for(var o=-1,a=yn(fn((e-t)/(n||1)),0),u=r(a);a--;)u[i?a:++o]=t,t+=n;return u}(e,n,o=o===i?e<n?1:-1:pu(o),t)}}function Vi(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=yu(e),n=yu(n)),t(e,n)}}function Xi(t,e,n,r,o,a,u,c,f,l){var h=8&e;e|=h?s:64,4&(e&=~(h?64:s))||(e&=-4);var d=[t,e,o,h?a:i,h?u:i,h?i:a,h?i:u,c,f,l],p=n.apply(i,d);return _o(t)&&Do(p,d),p.placeholder=r,Ro(p,t,e)}function Hi(t){var e=Et[t];return function(t,n){if(t=yu(t),(n=null==n?0:mn(vu(n),292))&&pn(t)){var r=(bu(t)+"e").split("e");return+((r=(bu(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var qi=Tn&&1/nn(new Tn([,-0]))[1]==f?function(t){return new Tn(t)}:cs;function Yi(t){return function(e){var n=ho(e);return n==w?Qe(e):n==I?rn(e):function(t,e){return Ae(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Ki(t,e,n,a,f,l,h,d){var p=2&e;if(!p&&"function"!=typeof t)throw new It(o);var v=a?a.length:0;if(v||(e&=-97,a=f=i),h=h===i?h:yn(vu(h),0),d=d===i?d:vu(d),v-=f?f.length:0,64&e){var g=a,y=f;a=f=i}var m=p?i:ro(t),b=[t,e,n,a,f,g,y,l,h,d];if(m&&function(t,e){var n=t[1],r=e[1],i=n|r,o=i<131,a=r==c&&8==n||r==c&&256==n&&t[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==n;if(!o&&!a)return t;1&r&&(t[2]=e[2],i|=1&n?0:4);var s=e[3];if(s){var f=t[3];t[3]=f?Ai(f,s,e[4]):s,t[4]=f?en(t[3],u):e[4]}(s=e[5])&&(f=t[5],t[5]=f?Ti(f,s,e[6]):s,t[6]=f?en(t[5],u):e[6]),(s=e[7])&&(t[7]=s),r&c&&(t[8]=null==t[8]?e[8]:mn(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i}(b,m),t=b[0],e=b[1],n=b[2],a=b[3],f=b[4],!(d=b[9]=b[9]===i?p?0:t.length:yn(b[9]-v,0))&&24&e&&(e&=-25),e&&1!=e)_=8==e||16==e?function(t,e,n){var o=Pi(t);return function a(){for(var u=arguments.length,s=r(u),c=u,f=oo(a);c--;)s[c]=arguments[c];var l=u<3&&s[0]!==f&&s[u-1]!==f?[]:en(s,f);return(u-=l.length)<n?Xi(t,e,Ui,a.placeholder,i,s,l,i,i,n-u):ye(this&&this!==oe&&this instanceof a?o:t,this,s)}}(t,e,d):e!=s&&33!=e||f.length?Ui.apply(i,b):function(t,e,n,i){var o=1&e,a=Pi(t);return function e(){for(var u=-1,s=arguments.length,c=-1,f=i.length,l=r(f+s),h=this&&this!==oe&&this instanceof e?a:t;++c<f;)l[c]=i[c];for(;s--;)l[c++]=arguments[++u];return ye(h,o?n:this,l)}}(t,e,n,a);else var _=function(t,e,n){var r=1&e,i=Pi(t);return function e(){return(this&&this!==oe&&this instanceof e?i:t).apply(r?n:this,arguments)}}(t,e,n);return Ro((m?Jr:Do)(_,b),t,e)}function Zi(t,e,n,r){return t===i||za(t,Nt[n])&&!Ot.call(r,n)?e:t}function $i(t,e,n,r,o,a){return eu(t)&&eu(e)&&(a.set(e,t),Br(t,e,i,$i,a),a.delete(e)),t}function Ji(t){return ou(t)?i:t}function Qi(t,e,n,r,o,a){var u=1&n,s=t.length,c=e.length;if(s!=c&&!(u&&c>s))return!1;var f=a.get(t),l=a.get(e);if(f&&l)return f==e&&l==t;var h=-1,d=!0,p=2&n?new qn:i;for(a.set(t,e),a.set(e,t);++h<s;){var v=t[h],g=e[h];if(r)var y=u?r(g,v,h,e,t,a):r(v,g,h,t,e,a);if(y!==i){if(y)continue;d=!1;break}if(p){if(!De(e,(function(t,e){if(!Xe(p,e)&&(v===t||o(v,t,n,r,a)))return p.push(e)}))){d=!1;break}}else if(v!==g&&!o(v,g,n,r,a)){d=!1;break}}return a.delete(t),a.delete(e),d}function to(t){return ko(Ao(t,i,Ho),t+"")}function eo(t){return Er(t,Ru,fo)}function no(t){return Er(t,Ou,lo)}var ro=Dn?function(t){return Dn.get(t)}:cs;function io(t){for(var e=t.name+"",n=Nn[e],r=Ot.call(Nn,e)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==t)return i.name}return e}function oo(t){return(Ot.call(Fn,"placeholder")?Fn:t).placeholder}function ao(){var t=Fn.iteratee||os;return t=t===os?Mr:t,arguments.length?t(arguments[0],arguments[1]):t}function uo(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function so(t){for(var e=Ru(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,Eo(i)]}return e}function co(t,e){var n=function(t,e){return null==t?i:t[e]}(t,e);return Or(n)?n:i}var fo=hn?function(t){return null==t?[]:(t=St(t),we(hn(t),(function(e){return te.call(t,e)})))}:gs,lo=hn?function(t){for(var e=[];t;)Te(e,fo(t)),t=Ht(t);return e}:gs,ho=Sr;function po(t,e,n){for(var r=-1,i=(e=yi(e,t)).length,o=!1;++r<i;){var a=Uo(e[r]);if(!(o=null!=t&&n(t,a)))break;t=t[a]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&tu(i)&&yo(a,i)&&(Xa(t)||Va(t))}function vo(t){return"function"!=typeof t.constructor||wo(t)?{}:Bn(Ht(t))}function go(t){return Xa(t)||Va(t)||!!(ie&&t&&t[ie])}function yo(t,e){var n=typeof t;return!!(e=null==e?l:e)&&("number"==n||"symbol"!=n&&yt.test(t))&&t>-1&&t%1==0&&t<e}function mo(t,e,n){if(!eu(n))return!1;var r=typeof e;return!!("number"==r?qa(n)&&yo(e,n.length):"string"==r&&e in n)&&za(n[e],t)}function bo(t,e){if(Xa(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!cu(t))||Q.test(t)||!J.test(t)||null!=e&&t in St(e)}function _o(t){var e=io(t),n=Fn[e];if("function"!=typeof n||!(e in Wn.prototype))return!1;if(t===n)return!0;var r=ro(n);return!!r&&t===r[0]}(En&&ho(new En(new ArrayBuffer(1)))!=R||Sn&&ho(new Sn)!=w||An&&ho(An.resolve())!=A||Tn&&ho(new Tn)!=I||In&&ho(new In)!=N)&&(ho=function(t){var e=Sr(t),n=e==S?t.constructor:i,r=n?Fo(n):"";if(r)switch(r){case kn:return R;case Rn:return w;case On:return A;case Mn:return I;case Pn:return N}return e});var xo=kt?Ja:ys;function wo(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Nt)}function Eo(t){return t==t&&!eu(t)}function So(t,e){return function(n){return null!=n&&n[t]===e&&(e!==i||t in St(n))}}function Ao(t,e,n){return e=yn(e===i?t.length-1:e,0),function(){for(var i=arguments,o=-1,a=yn(i.length-e,0),u=r(a);++o<a;)u[o]=i[e+o];o=-1;for(var s=r(e+1);++o<e;)s[o]=i[o];return s[e]=n(u),ye(t,this,s)}}function To(t,e){return e.length<2?t:wr(t,ei(e,0,-1))}function Io(t,e){for(var n=t.length,r=mn(e.length,n),o=Ii(t);r--;){var a=e[r];t[r]=yo(a,n)?o[a]:i}return t}function Co(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Do=Oo(Jr),No=Ue||function(t,e){return oe.setTimeout(t,e)},ko=Oo(Qr);function Ro(t,e,n){var r=e+"";return ko(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(ot,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return be(p,(function(n){var r="_."+n[0];e&n[1]&&!Ee(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(at);return e?e[1].split(ut):[]}(r),n)))}function Oo(t){var e=0,n=0;return function(){var r=bn(),o=16-(r-n);if(n=r,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(i,arguments)}}function Mo(t,e){var n=-1,r=t.length,o=r-1;for(e=e===i?r:e;++n<e;){var a=Hr(n,o),u=t[a];t[a]=t[n],t[n]=u}return t.length=e,t}var Po,Go,Lo=(Po=Pa((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(tt,(function(t,n,r,i){e.push(r?i.replace(ft,"$1"):n||t)})),e}),(function(t){return 500===Go.size&&Go.clear(),t})),Go=Po.cache,Po);function Uo(t){if("string"==typeof t||cu(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Fo(t){if(null!=t){try{return Rt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Bo(t){if(t instanceof Wn)return t.clone();var e=new jn(t.__wrapped__,t.__chain__);return e.__actions__=Ii(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var zo=Yr((function(t,e){return Ya(t)?fr(t,gr(e,1,Ya,!0)):[]})),jo=Yr((function(t,e){var n=$o(e);return Ya(n)&&(n=i),Ya(t)?fr(t,gr(e,1,Ya,!0),ao(n,2)):[]})),Wo=Yr((function(t,e){var n=$o(e);return Ya(n)&&(n=i),Ya(t)?fr(t,gr(e,1,Ya,!0),i,n):[]}));function Vo(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:vu(n);return i<0&&(i=yn(r+i,0)),Re(t,ao(e,3),i)}function Xo(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r-1;return n!==i&&(o=vu(n),o=n<0?yn(r+o,0):mn(o,r-1)),Re(t,ao(e,3),o,!0)}function Ho(t){return null!=t&&t.length?gr(t,1):[]}function qo(t){return t&&t.length?t[0]:i}var Yo=Yr((function(t){var e=Ae(t,vi);return e.length&&e[0]===t[0]?Cr(e):[]})),Ko=Yr((function(t){var e=$o(t),n=Ae(t,vi);return e===$o(n)?e=i:n.pop(),n.length&&n[0]===t[0]?Cr(n,ao(e,2)):[]})),Zo=Yr((function(t){var e=$o(t),n=Ae(t,vi);return(e="function"==typeof e?e:i)&&n.pop(),n.length&&n[0]===t[0]?Cr(n,i,e):[]}));function $o(t){var e=null==t?0:t.length;return e?t[e-1]:i}var Jo=Yr(Qo);function Qo(t,e){return t&&t.length&&e&&e.length?Vr(t,e):t}var ta=to((function(t,e){var n=null==t?0:t.length,r=or(t,e);return Xr(t,Ae(e,(function(t){return yo(t,n)?+t:t})).sort(Si)),r}));function ea(t){return null==t?t:wn.call(t)}var na=Yr((function(t){return si(gr(t,1,Ya,!0))})),ra=Yr((function(t){var e=$o(t);return Ya(e)&&(e=i),si(gr(t,1,Ya,!0),ao(e,2))})),ia=Yr((function(t){var e=$o(t);return e="function"==typeof e?e:i,si(gr(t,1,Ya,!0),i,e)}));function oa(t){if(!t||!t.length)return[];var e=0;return t=we(t,(function(t){if(Ya(t))return e=yn(t.length,e),!0})),ze(e,(function(e){return Ae(t,Le(e))}))}function aa(t,e){if(!t||!t.length)return[];var n=oa(t);return null==e?n:Ae(n,(function(t){return ye(e,i,t)}))}var ua=Yr((function(t,e){return Ya(t)?fr(t,e):[]})),sa=Yr((function(t){return di(we(t,Ya))})),ca=Yr((function(t){var e=$o(t);return Ya(e)&&(e=i),di(we(t,Ya),ao(e,2))})),fa=Yr((function(t){var e=$o(t);return e="function"==typeof e?e:i,di(we(t,Ya),i,e)})),la=Yr(oa),ha=Yr((function(t){var e=t.length,n=e>1?t[e-1]:i;return n="function"==typeof n?(t.pop(),n):i,aa(t,n)}));function da(t){var e=Fn(t);return e.__chain__=!0,e}function pa(t,e){return e(t)}var va=to((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,o=function(e){return or(e,t)};return!(e>1||this.__actions__.length)&&r instanceof Wn&&yo(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:pa,args:[o],thisArg:i}),new jn(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(i),t}))):this.thru(o)})),ga=Di((function(t,e,n){Ot.call(t,n)?++t[n]:ir(t,n,1)})),ya=Gi(Vo),ma=Gi(Xo);function ba(t,e){return(Xa(t)?be:lr)(t,ao(e,3))}function _a(t,e){return(Xa(t)?_e:hr)(t,ao(e,3))}var xa=Di((function(t,e,n){Ot.call(t,n)?t[n].push(e):ir(t,n,[e])})),wa=Yr((function(t,e,n){var i=-1,o="function"==typeof e,a=qa(t)?r(t.length):[];return lr(t,(function(t){a[++i]=o?ye(e,t,n):Dr(t,e,n)})),a})),Ea=Di((function(t,e,n){ir(t,n,e)}));function Sa(t,e){return(Xa(t)?Ae:Lr)(t,ao(e,3))}var Aa=Di((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]})),Ta=Yr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&mo(t,e[0],e[1])?e=[]:n>2&&mo(e[0],e[1],e[2])&&(e=[e[0]]),jr(t,gr(e,1),[])})),Ia=Ne||function(){return oe.Date.now()};function Ca(t,e,n){return e=n?i:e,e=t&&null==e?t.length:e,Ki(t,c,i,i,i,i,e)}function Da(t,e){var n;if("function"!=typeof e)throw new It(o);return t=vu(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=i),n}}var Na=Yr((function(t,e,n){var r=1;if(n.length){var i=en(n,oo(Na));r|=s}return Ki(t,r,e,n,i)})),ka=Yr((function(t,e,n){var r=3;if(n.length){var i=en(n,oo(ka));r|=s}return Ki(e,r,t,n,i)}));function Ra(t,e,n){var r,a,u,s,c,f,l=0,h=!1,d=!1,p=!0;if("function"!=typeof t)throw new It(o);function v(e){var n=r,o=a;return r=a=i,l=e,s=t.apply(o,n)}function g(t){return l=t,c=No(m,e),h?v(t):s}function y(t){var n=t-f;return f===i||n>=e||n<0||d&&t-l>=u}function m(){var t=Ia();if(y(t))return b(t);c=No(m,function(t){var n=e-(t-f);return d?mn(n,u-(t-l)):n}(t))}function b(t){return c=i,p&&r?v(t):(r=a=i,s)}function _(){var t=Ia(),n=y(t);if(r=arguments,a=this,f=t,n){if(c===i)return g(f);if(d)return _i(c),c=No(m,e),v(f)}return c===i&&(c=No(m,e)),s}return e=yu(e)||0,eu(n)&&(h=!!n.leading,u=(d="maxWait"in n)?yn(yu(n.maxWait)||0,e):u,p="trailing"in n?!!n.trailing:p),_.cancel=function(){c!==i&&_i(c),l=0,r=f=a=c=i},_.flush=function(){return c===i?s:b(Ia())},_}var Oa=Yr((function(t,e){return cr(t,1,e)})),Ma=Yr((function(t,e,n){return cr(t,yu(e)||0,n)}));function Pa(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new It(o);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Pa.Cache||Hn),n}function Ga(t){if("function"!=typeof t)throw new It(o);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Pa.Cache=Hn;var La=mi((function(t,e){var n=(e=1==e.length&&Xa(e[0])?Ae(e[0],We(ao())):Ae(gr(e,1),We(ao()))).length;return Yr((function(r){for(var i=-1,o=mn(r.length,n);++i<o;)r[i]=e[i].call(this,r[i]);return ye(t,this,r)}))})),Ua=Yr((function(t,e){var n=en(e,oo(Ua));return Ki(t,s,i,e,n)})),Fa=Yr((function(t,e){var n=en(e,oo(Fa));return Ki(t,64,i,e,n)})),Ba=to((function(t,e){return Ki(t,256,i,i,i,e)}));function za(t,e){return t===e||t!=t&&e!=e}var ja=Vi(Ar),Wa=Vi((function(t,e){return t>=e})),Va=Nr(function(){return arguments}())?Nr:function(t){return nu(t)&&Ot.call(t,"callee")&&!te.call(t,"callee")},Xa=r.isArray,Ha=le?We(le):function(t){return nu(t)&&Sr(t)==k};function qa(t){return null!=t&&tu(t.length)&&!Ja(t)}function Ya(t){return nu(t)&&qa(t)}var Ka=dn||ys,Za=he?We(he):function(t){return nu(t)&&Sr(t)==m};function $a(t){if(!nu(t))return!1;var e=Sr(t);return e==b||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!ou(t)}function Ja(t){if(!eu(t))return!1;var e=Sr(t);return e==_||e==x||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Qa(t){return"number"==typeof t&&t==vu(t)}function tu(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=l}function eu(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function nu(t){return null!=t&&"object"==typeof t}var ru=de?We(de):function(t){return nu(t)&&ho(t)==w};function iu(t){return"number"==typeof t||nu(t)&&Sr(t)==E}function ou(t){if(!nu(t)||Sr(t)!=S)return!1;var e=Ht(t);if(null===e)return!0;var n=Ot.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Rt.call(n)==Lt}var au=pe?We(pe):function(t){return nu(t)&&Sr(t)==T},uu=ve?We(ve):function(t){return nu(t)&&ho(t)==I};function su(t){return"string"==typeof t||!Xa(t)&&nu(t)&&Sr(t)==C}function cu(t){return"symbol"==typeof t||nu(t)&&Sr(t)==D}var fu=ge?We(ge):function(t){return nu(t)&&tu(t.length)&&!!Jt[Sr(t)]},lu=Vi(Gr),hu=Vi((function(t,e){return t<=e}));function du(t){if(!t)return[];if(qa(t))return su(t)?an(t):Ii(t);if(ae&&t[ae])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[ae]());var e=ho(t);return(e==w?Qe:e==I?nn:zu)(t)}function pu(t){return t?(t=yu(t))===f||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function vu(t){var e=pu(t),n=e%1;return e==e?n?e-n:e:0}function gu(t){return t?ar(vu(t),0,d):0}function yu(t){if("number"==typeof t)return t;if(cu(t))return h;if(eu(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=eu(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=je(t);var n=pt.test(t);return n||gt.test(t)?ne(t.slice(2),n?2:8):dt.test(t)?h:+t}function mu(t){return Ci(t,Ou(t))}function bu(t){return null==t?"":ui(t)}var _u=Ni((function(t,e){if(wo(e)||qa(e))Ci(e,Ru(e),t);else for(var n in e)Ot.call(e,n)&&tr(t,n,e[n])})),xu=Ni((function(t,e){Ci(e,Ou(e),t)})),wu=Ni((function(t,e,n,r){Ci(e,Ou(e),t,r)})),Eu=Ni((function(t,e,n,r){Ci(e,Ru(e),t,r)})),Su=to(or),Au=Yr((function(t,e){t=St(t);var n=-1,r=e.length,o=r>2?e[2]:i;for(o&&mo(e[0],e[1],o)&&(r=1);++n<r;)for(var a=e[n],u=Ou(a),s=-1,c=u.length;++s<c;){var f=u[s],l=t[f];(l===i||za(l,Nt[f])&&!Ot.call(t,f))&&(t[f]=a[f])}return t})),Tu=Yr((function(t){return t.push(i,$i),ye(Pu,i,t)}));function Iu(t,e,n){var r=null==t?i:wr(t,e);return r===i?n:r}function Cu(t,e){return null!=t&&po(t,e,Ir)}var Du=Fi((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Gt.call(e)),t[e]=n}),es(is)),Nu=Fi((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Gt.call(e)),Ot.call(t,e)?t[e].push(n):t[e]=[n]}),ao),ku=Yr(Dr);function Ru(t){return qa(t)?Kn(t):Pr(t)}function Ou(t){return qa(t)?Kn(t,!0):function(t){if(!eu(t))return function(t){var e=[];if(null!=t)for(var n in St(t))e.push(n);return e}(t);var e=wo(t),n=[];for(var r in t)("constructor"!=r||!e&&Ot.call(t,r))&&n.push(r);return n}(t)}var Mu=Ni((function(t,e,n){Br(t,e,n)})),Pu=Ni((function(t,e,n,r){Br(t,e,n,r)})),Gu=to((function(t,e){var n={};if(null==t)return n;var r=!1;e=Ae(e,(function(e){return e=yi(e,t),r||(r=e.length>1),e})),Ci(t,no(t),n),r&&(n=ur(n,7,Ji));for(var i=e.length;i--;)ci(n,e[i]);return n})),Lu=to((function(t,e){return null==t?{}:function(t,e){return Wr(t,e,(function(e,n){return Cu(t,n)}))}(t,e)}));function Uu(t,e){if(null==t)return{};var n=Ae(no(t),(function(t){return[t]}));return e=ao(e),Wr(t,n,(function(t,n){return e(t,n[0])}))}var Fu=Yi(Ru),Bu=Yi(Ou);function zu(t){return null==t?[]:Ve(t,Ru(t))}var ju=Mi((function(t,e,n){return e=e.toLowerCase(),t+(n?Wu(e):e)}));function Wu(t){return $u(bu(t).toLowerCase())}function Vu(t){return(t=bu(t))&&t.replace(mt,Ke).replace(Xt,"")}var Xu=Mi((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Hu=Mi((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),qu=Oi("toLowerCase"),Yu=Mi((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()})),Ku=Mi((function(t,e,n){return t+(n?" ":"")+$u(e)})),Zu=Mi((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),$u=Oi("toUpperCase");function Ju(t,e,n){return t=bu(t),(e=n?i:e)===i?function(t){return Kt.test(t)}(t)?function(t){return t.match(qt)||[]}(t):function(t){return t.match(st)||[]}(t):t.match(e)||[]}var Qu=Yr((function(t,e){try{return ye(t,i,e)}catch(t){return $a(t)?t:new xt(t)}})),ts=to((function(t,e){return be(e,(function(e){e=Uo(e),ir(t,e,Na(t[e],t))})),t}));function es(t){return function(){return t}}var ns=Li(),rs=Li(!0);function is(t){return t}function os(t){return Mr("function"==typeof t?t:ur(t,1))}var as=Yr((function(t,e){return function(n){return Dr(n,t,e)}})),us=Yr((function(t,e){return function(n){return Dr(t,n,e)}}));function ss(t,e,n){var r=Ru(e),i=xr(e,r);null!=n||eu(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=xr(e,Ru(e)));var o=!(eu(n)&&"chain"in n&&!n.chain),a=Ja(t);return be(i,(function(n){var r=e[n];t[n]=r,a&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__),i=n.__actions__=Ii(this.__actions__);return i.push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,Te([this.value()],arguments))})})),t}function cs(){}var fs=zi(Ae),ls=zi(xe),hs=zi(De);function ds(t){return bo(t)?Le(Uo(t)):function(t){return function(e){return wr(e,t)}}(t)}var ps=Wi(),vs=Wi(!0);function gs(){return[]}function ys(){return!1}var ms,bs=Bi((function(t,e){return t+e}),0),_s=Hi("ceil"),xs=Bi((function(t,e){return t/e}),1),ws=Hi("floor"),Es=Bi((function(t,e){return t*e}),1),Ss=Hi("round"),As=Bi((function(t,e){return t-e}),0);return Fn.after=function(t,e){if("function"!=typeof e)throw new It(o);return t=vu(t),function(){if(--t<1)return e.apply(this,arguments)}},Fn.ary=Ca,Fn.assign=_u,Fn.assignIn=xu,Fn.assignInWith=wu,Fn.assignWith=Eu,Fn.at=Su,Fn.before=Da,Fn.bind=Na,Fn.bindAll=ts,Fn.bindKey=ka,Fn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Xa(t)?t:[t]},Fn.chain=da,Fn.chunk=function(t,e,n){e=(n?mo(t,e,n):e===i)?1:yn(vu(e),0);var o=null==t?0:t.length;if(!o||e<1)return[];for(var a=0,u=0,s=r(fn(o/e));a<o;)s[u++]=ei(t,a,a+=e);return s},Fn.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var o=t[e];o&&(i[r++]=o)}return i},Fn.concat=function(){var t=arguments.length;if(!t)return[];for(var e=r(t-1),n=arguments[0],i=t;i--;)e[i-1]=arguments[i];return Te(Xa(n)?Ii(n):[n],gr(e,1))},Fn.cond=function(t){var e=null==t?0:t.length,n=ao();return t=e?Ae(t,(function(t){if("function"!=typeof t[1])throw new It(o);return[n(t[0]),t[1]]})):[],Yr((function(n){for(var r=-1;++r<e;){var i=t[r];if(ye(i[0],this,n))return ye(i[1],this,n)}}))},Fn.conforms=function(t){return function(t){var e=Ru(t);return function(n){return sr(n,t,e)}}(ur(t,1))},Fn.constant=es,Fn.countBy=ga,Fn.create=function(t,e){var n=Bn(t);return null==e?n:rr(n,e)},Fn.curry=function t(e,n,r){var o=Ki(e,8,i,i,i,i,i,n=r?i:n);return o.placeholder=t.placeholder,o},Fn.curryRight=function t(e,n,r){var o=Ki(e,16,i,i,i,i,i,n=r?i:n);return o.placeholder=t.placeholder,o},Fn.debounce=Ra,Fn.defaults=Au,Fn.defaultsDeep=Tu,Fn.defer=Oa,Fn.delay=Ma,Fn.difference=zo,Fn.differenceBy=jo,Fn.differenceWith=Wo,Fn.drop=function(t,e,n){var r=null==t?0:t.length;return r?ei(t,(e=n||e===i?1:vu(e))<0?0:e,r):[]},Fn.dropRight=function(t,e,n){var r=null==t?0:t.length;return r?ei(t,0,(e=r-(e=n||e===i?1:vu(e)))<0?0:e):[]},Fn.dropRightWhile=function(t,e){return t&&t.length?li(t,ao(e,3),!0,!0):[]},Fn.dropWhile=function(t,e){return t&&t.length?li(t,ao(e,3),!0):[]},Fn.fill=function(t,e,n,r){var o=null==t?0:t.length;return o?(n&&"number"!=typeof n&&mo(t,e,n)&&(n=0,r=o),function(t,e,n,r){var o=t.length;for((n=vu(n))<0&&(n=-n>o?0:o+n),(r=r===i||r>o?o:vu(r))<0&&(r+=o),r=n>r?0:gu(r);n<r;)t[n++]=e;return t}(t,e,n,r)):[]},Fn.filter=function(t,e){return(Xa(t)?we:vr)(t,ao(e,3))},Fn.flatMap=function(t,e){return gr(Sa(t,e),1)},Fn.flatMapDeep=function(t,e){return gr(Sa(t,e),f)},Fn.flatMapDepth=function(t,e,n){return n=n===i?1:vu(n),gr(Sa(t,e),n)},Fn.flatten=Ho,Fn.flattenDeep=function(t){return null!=t&&t.length?gr(t,f):[]},Fn.flattenDepth=function(t,e){return null!=t&&t.length?gr(t,e=e===i?1:vu(e)):[]},Fn.flip=function(t){return Ki(t,512)},Fn.flow=ns,Fn.flowRight=rs,Fn.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r},Fn.functions=function(t){return null==t?[]:xr(t,Ru(t))},Fn.functionsIn=function(t){return null==t?[]:xr(t,Ou(t))},Fn.groupBy=xa,Fn.initial=function(t){return null!=t&&t.length?ei(t,0,-1):[]},Fn.intersection=Yo,Fn.intersectionBy=Ko,Fn.intersectionWith=Zo,Fn.invert=Du,Fn.invertBy=Nu,Fn.invokeMap=wa,Fn.iteratee=os,Fn.keyBy=Ea,Fn.keys=Ru,Fn.keysIn=Ou,Fn.map=Sa,Fn.mapKeys=function(t,e){var n={};return e=ao(e,3),br(t,(function(t,r,i){ir(n,e(t,r,i),t)})),n},Fn.mapValues=function(t,e){var n={};return e=ao(e,3),br(t,(function(t,r,i){ir(n,r,e(t,r,i))})),n},Fn.matches=function(t){return Ur(ur(t,1))},Fn.matchesProperty=function(t,e){return Fr(t,ur(e,1))},Fn.memoize=Pa,Fn.merge=Mu,Fn.mergeWith=Pu,Fn.method=as,Fn.methodOf=us,Fn.mixin=ss,Fn.negate=Ga,Fn.nthArg=function(t){return t=vu(t),Yr((function(e){return zr(e,t)}))},Fn.omit=Gu,Fn.omitBy=function(t,e){return Uu(t,Ga(ao(e)))},Fn.once=function(t){return Da(2,t)},Fn.orderBy=function(t,e,n,r){return null==t?[]:(Xa(e)||(e=null==e?[]:[e]),Xa(n=r?i:n)||(n=null==n?[]:[n]),jr(t,e,n))},Fn.over=fs,Fn.overArgs=La,Fn.overEvery=ls,Fn.overSome=hs,Fn.partial=Ua,Fn.partialRight=Fa,Fn.partition=Aa,Fn.pick=Lu,Fn.pickBy=Uu,Fn.property=ds,Fn.propertyOf=function(t){return function(e){return null==t?i:wr(t,e)}},Fn.pull=Jo,Fn.pullAll=Qo,Fn.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?Vr(t,e,ao(n,2)):t},Fn.pullAllWith=function(t,e,n){return t&&t.length&&e&&e.length?Vr(t,e,i,n):t},Fn.pullAt=ta,Fn.range=ps,Fn.rangeRight=vs,Fn.rearg=Ba,Fn.reject=function(t,e){return(Xa(t)?we:vr)(t,Ga(ao(e,3)))},Fn.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],o=t.length;for(e=ao(e,3);++r<o;){var a=t[r];e(a,r,t)&&(n.push(a),i.push(r))}return Xr(t,i),n},Fn.rest=function(t,e){if("function"!=typeof t)throw new It(o);return Yr(t,e=e===i?e:vu(e))},Fn.reverse=ea,Fn.sampleSize=function(t,e,n){return e=(n?mo(t,e,n):e===i)?1:vu(e),(Xa(t)?$n:Zr)(t,e)},Fn.set=function(t,e,n){return null==t?t:$r(t,e,n)},Fn.setWith=function(t,e,n,r){return r="function"==typeof r?r:i,null==t?t:$r(t,e,n,r)},Fn.shuffle=function(t){return(Xa(t)?Jn:ti)(t)},Fn.slice=function(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&mo(t,e,n)?(e=0,n=r):(e=null==e?0:vu(e),n=n===i?r:vu(n)),ei(t,e,n)):[]},Fn.sortBy=Ta,Fn.sortedUniq=function(t){return t&&t.length?oi(t):[]},Fn.sortedUniqBy=function(t,e){return t&&t.length?oi(t,ao(e,2)):[]},Fn.split=function(t,e,n){return n&&"number"!=typeof n&&mo(t,e,n)&&(e=n=i),(n=n===i?d:n>>>0)?(t=bu(t))&&("string"==typeof e||null!=e&&!au(e))&&!(e=ui(e))&&Je(t)?bi(an(t),0,n):t.split(e,n):[]},Fn.spread=function(t,e){if("function"!=typeof t)throw new It(o);return e=null==e?0:yn(vu(e),0),Yr((function(n){var r=n[e],i=bi(n,0,e);return r&&Te(i,r),ye(t,this,i)}))},Fn.tail=function(t){var e=null==t?0:t.length;return e?ei(t,1,e):[]},Fn.take=function(t,e,n){return t&&t.length?ei(t,0,(e=n||e===i?1:vu(e))<0?0:e):[]},Fn.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?ei(t,(e=r-(e=n||e===i?1:vu(e)))<0?0:e,r):[]},Fn.takeRightWhile=function(t,e){return t&&t.length?li(t,ao(e,3),!1,!0):[]},Fn.takeWhile=function(t,e){return t&&t.length?li(t,ao(e,3)):[]},Fn.tap=function(t,e){return e(t),t},Fn.throttle=function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new It(o);return eu(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Ra(t,e,{leading:r,maxWait:e,trailing:i})},Fn.thru=pa,Fn.toArray=du,Fn.toPairs=Fu,Fn.toPairsIn=Bu,Fn.toPath=function(t){return Xa(t)?Ae(t,Uo):cu(t)?[t]:Ii(Lo(bu(t)))},Fn.toPlainObject=mu,Fn.transform=function(t,e,n){var r=Xa(t),i=r||Ka(t)||fu(t);if(e=ao(e,4),null==n){var o=t&&t.constructor;n=i?r?new o:[]:eu(t)&&Ja(o)?Bn(Ht(t)):{}}return(i?be:br)(t,(function(t,r,i){return e(n,t,r,i)})),n},Fn.unary=function(t){return Ca(t,1)},Fn.union=na,Fn.unionBy=ra,Fn.unionWith=ia,Fn.uniq=function(t){return t&&t.length?si(t):[]},Fn.uniqBy=function(t,e){return t&&t.length?si(t,ao(e,2)):[]},Fn.uniqWith=function(t,e){return e="function"==typeof e?e:i,t&&t.length?si(t,i,e):[]},Fn.unset=function(t,e){return null==t||ci(t,e)},Fn.unzip=oa,Fn.unzipWith=aa,Fn.update=function(t,e,n){return null==t?t:fi(t,e,gi(n))},Fn.updateWith=function(t,e,n,r){return r="function"==typeof r?r:i,null==t?t:fi(t,e,gi(n),r)},Fn.values=zu,Fn.valuesIn=function(t){return null==t?[]:Ve(t,Ou(t))},Fn.without=ua,Fn.words=Ju,Fn.wrap=function(t,e){return Ua(gi(e),t)},Fn.xor=sa,Fn.xorBy=ca,Fn.xorWith=fa,Fn.zip=la,Fn.zipObject=function(t,e){return pi(t||[],e||[],tr)},Fn.zipObjectDeep=function(t,e){return pi(t||[],e||[],$r)},Fn.zipWith=ha,Fn.entries=Fu,Fn.entriesIn=Bu,Fn.extend=xu,Fn.extendWith=wu,ss(Fn,Fn),Fn.add=bs,Fn.attempt=Qu,Fn.camelCase=ju,Fn.capitalize=Wu,Fn.ceil=_s,Fn.clamp=function(t,e,n){return n===i&&(n=e,e=i),n!==i&&(n=(n=yu(n))==n?n:0),e!==i&&(e=(e=yu(e))==e?e:0),ar(yu(t),e,n)},Fn.clone=function(t){return ur(t,4)},Fn.cloneDeep=function(t){return ur(t,5)},Fn.cloneDeepWith=function(t,e){return ur(t,5,e="function"==typeof e?e:i)},Fn.cloneWith=function(t,e){return ur(t,4,e="function"==typeof e?e:i)},Fn.conformsTo=function(t,e){return null==e||sr(t,e,Ru(e))},Fn.deburr=Vu,Fn.defaultTo=function(t,e){return null==t||t!=t?e:t},Fn.divide=xs,Fn.endsWith=function(t,e,n){t=bu(t),e=ui(e);var r=t.length,o=n=n===i?r:ar(vu(n),0,r);return(n-=e.length)>=0&&t.slice(n,o)==e},Fn.eq=za,Fn.escape=function(t){return(t=bu(t))&&Y.test(t)?t.replace(H,Ze):t},Fn.escapeRegExp=function(t){return(t=bu(t))&&nt.test(t)?t.replace(et,"\\$&"):t},Fn.every=function(t,e,n){var r=Xa(t)?xe:dr;return n&&mo(t,e,n)&&(e=i),r(t,ao(e,3))},Fn.find=ya,Fn.findIndex=Vo,Fn.findKey=function(t,e){return ke(t,ao(e,3),br)},Fn.findLast=ma,Fn.findLastIndex=Xo,Fn.findLastKey=function(t,e){return ke(t,ao(e,3),_r)},Fn.floor=ws,Fn.forEach=ba,Fn.forEachRight=_a,Fn.forIn=function(t,e){return null==t?t:yr(t,ao(e,3),Ou)},Fn.forInRight=function(t,e){return null==t?t:mr(t,ao(e,3),Ou)},Fn.forOwn=function(t,e){return t&&br(t,ao(e,3))},Fn.forOwnRight=function(t,e){return t&&_r(t,ao(e,3))},Fn.get=Iu,Fn.gt=ja,Fn.gte=Wa,Fn.has=function(t,e){return null!=t&&po(t,e,Tr)},Fn.hasIn=Cu,Fn.head=qo,Fn.identity=is,Fn.includes=function(t,e,n,r){t=qa(t)?t:zu(t),n=n&&!r?vu(n):0;var i=t.length;return n<0&&(n=yn(i+n,0)),su(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&Oe(t,e,n)>-1},Fn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:vu(n);return i<0&&(i=yn(r+i,0)),Oe(t,e,i)},Fn.inRange=function(t,e,n){return e=pu(e),n===i?(n=e,e=0):n=pu(n),function(t,e,n){return t>=mn(e,n)&&t<yn(e,n)}(t=yu(t),e,n)},Fn.invoke=ku,Fn.isArguments=Va,Fn.isArray=Xa,Fn.isArrayBuffer=Ha,Fn.isArrayLike=qa,Fn.isArrayLikeObject=Ya,Fn.isBoolean=function(t){return!0===t||!1===t||nu(t)&&Sr(t)==y},Fn.isBuffer=Ka,Fn.isDate=Za,Fn.isElement=function(t){return nu(t)&&1===t.nodeType&&!ou(t)},Fn.isEmpty=function(t){if(null==t)return!0;if(qa(t)&&(Xa(t)||"string"==typeof t||"function"==typeof t.splice||Ka(t)||fu(t)||Va(t)))return!t.length;var e=ho(t);if(e==w||e==I)return!t.size;if(wo(t))return!Pr(t).length;for(var n in t)if(Ot.call(t,n))return!1;return!0},Fn.isEqual=function(t,e){return kr(t,e)},Fn.isEqualWith=function(t,e,n){var r=(n="function"==typeof n?n:i)?n(t,e):i;return r===i?kr(t,e,i,n):!!r},Fn.isError=$a,Fn.isFinite=function(t){return"number"==typeof t&&pn(t)},Fn.isFunction=Ja,Fn.isInteger=Qa,Fn.isLength=tu,Fn.isMap=ru,Fn.isMatch=function(t,e){return t===e||Rr(t,e,so(e))},Fn.isMatchWith=function(t,e,n){return n="function"==typeof n?n:i,Rr(t,e,so(e),n)},Fn.isNaN=function(t){return iu(t)&&t!=+t},Fn.isNative=function(t){if(xo(t))throw new xt("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Or(t)},Fn.isNil=function(t){return null==t},Fn.isNull=function(t){return null===t},Fn.isNumber=iu,Fn.isObject=eu,Fn.isObjectLike=nu,Fn.isPlainObject=ou,Fn.isRegExp=au,Fn.isSafeInteger=function(t){return Qa(t)&&t>=-9007199254740991&&t<=l},Fn.isSet=uu,Fn.isString=su,Fn.isSymbol=cu,Fn.isTypedArray=fu,Fn.isUndefined=function(t){return t===i},Fn.isWeakMap=function(t){return nu(t)&&ho(t)==N},Fn.isWeakSet=function(t){return nu(t)&&"[object WeakSet]"==Sr(t)},Fn.join=function(t,e){return null==t?"":vn.call(t,e)},Fn.kebabCase=Xu,Fn.last=$o,Fn.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=vu(n))<0?yn(r+o,0):mn(o,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,o):Re(t,Pe,o,!0)},Fn.lowerCase=Hu,Fn.lowerFirst=qu,Fn.lt=lu,Fn.lte=hu,Fn.max=function(t){return t&&t.length?pr(t,is,Ar):i},Fn.maxBy=function(t,e){return t&&t.length?pr(t,ao(e,2),Ar):i},Fn.mean=function(t){return Ge(t,is)},Fn.meanBy=function(t,e){return Ge(t,ao(e,2))},Fn.min=function(t){return t&&t.length?pr(t,is,Gr):i},Fn.minBy=function(t,e){return t&&t.length?pr(t,ao(e,2),Gr):i},Fn.stubArray=gs,Fn.stubFalse=ys,Fn.stubObject=function(){return{}},Fn.stubString=function(){return""},Fn.stubTrue=function(){return!0},Fn.multiply=Es,Fn.nth=function(t,e){return t&&t.length?zr(t,vu(e)):i},Fn.noConflict=function(){return oe._===this&&(oe._=Ut),this},Fn.noop=cs,Fn.now=Ia,Fn.pad=function(t,e,n){t=bu(t);var r=(e=vu(e))?on(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return ji(ln(i),n)+t+ji(fn(i),n)},Fn.padEnd=function(t,e,n){t=bu(t);var r=(e=vu(e))?on(t):0;return e&&r<e?t+ji(e-r,n):t},Fn.padStart=function(t,e,n){t=bu(t);var r=(e=vu(e))?on(t):0;return e&&r<e?ji(e-r,n)+t:t},Fn.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),_n(bu(t).replace(rt,""),e||0)},Fn.random=function(t,e,n){if(n&&"boolean"!=typeof n&&mo(t,e,n)&&(e=n=i),n===i&&("boolean"==typeof e?(n=e,e=i):"boolean"==typeof t&&(n=t,t=i)),t===i&&e===i?(t=0,e=1):(t=pu(t),e===i?(e=t,t=0):e=pu(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var o=xn();return mn(t+o*(e-t+ee("1e-"+((o+"").length-1))),e)}return Hr(t,e)},Fn.reduce=function(t,e,n){var r=Xa(t)?Ie:Fe,i=arguments.length<3;return r(t,ao(e,4),n,i,lr)},Fn.reduceRight=function(t,e,n){var r=Xa(t)?Ce:Fe,i=arguments.length<3;return r(t,ao(e,4),n,i,hr)},Fn.repeat=function(t,e,n){return e=(n?mo(t,e,n):e===i)?1:vu(e),qr(bu(t),e)},Fn.replace=function(){var t=arguments,e=bu(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Fn.result=function(t,e,n){var r=-1,o=(e=yi(e,t)).length;for(o||(o=1,t=i);++r<o;){var a=null==t?i:t[Uo(e[r])];a===i&&(r=o,a=n),t=Ja(a)?a.call(t):a}return t},Fn.round=Ss,Fn.runInContext=t,Fn.sample=function(t){return(Xa(t)?Zn:Kr)(t)},Fn.size=function(t){if(null==t)return 0;if(qa(t))return su(t)?on(t):t.length;var e=ho(t);return e==w||e==I?t.size:Pr(t).length},Fn.snakeCase=Yu,Fn.some=function(t,e,n){var r=Xa(t)?De:ni;return n&&mo(t,e,n)&&(e=i),r(t,ao(e,3))},Fn.sortedIndex=function(t,e){return ri(t,e)},Fn.sortedIndexBy=function(t,e,n){return ii(t,e,ao(n,2))},Fn.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=ri(t,e);if(r<n&&za(t[r],e))return r}return-1},Fn.sortedLastIndex=function(t,e){return ri(t,e,!0)},Fn.sortedLastIndexBy=function(t,e,n){return ii(t,e,ao(n,2),!0)},Fn.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var n=ri(t,e,!0)-1;if(za(t[n],e))return n}return-1},Fn.startCase=Ku,Fn.startsWith=function(t,e,n){return t=bu(t),n=null==n?0:ar(vu(n),0,t.length),e=ui(e),t.slice(n,n+e.length)==e},Fn.subtract=As,Fn.sum=function(t){return t&&t.length?Be(t,is):0},Fn.sumBy=function(t,e){return t&&t.length?Be(t,ao(e,2)):0},Fn.template=function(t,e,n){var r=Fn.templateSettings;n&&mo(t,e,n)&&(e=i),t=bu(t),e=wu({},e,r,Zi);var o,a,u=wu({},e.imports,r.imports,Zi),s=Ru(u),c=Ve(u,s),f=0,l=e.interpolate||bt,h="__p += '",d=At((e.escape||bt).source+"|"+l.source+"|"+(l===$?lt:bt).source+"|"+(e.evaluate||bt).source+"|$","g"),p="//# sourceURL="+(Ot.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++$t+"]")+"\n";t.replace(d,(function(e,n,r,i,u,s){return r||(r=i),h+=t.slice(f,s).replace(_t,$e),n&&(o=!0,h+="' +\n__e("+n+") +\n'"),u&&(a=!0,h+="';\n"+u+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),f=s+e.length,e})),h+="';\n";var v=Ot.call(e,"variable")&&e.variable;if(v){if(ct.test(v))throw new xt("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(a?h.replace(j,""):h).replace(W,"$1").replace(V,"$1;"),h="function("+(v||"obj")+") {\n"+(v?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var g=Qu((function(){return wt(s,p+"return "+h).apply(i,c)}));if(g.source=h,$a(g))throw g;return g},Fn.times=function(t,e){if((t=vu(t))<1||t>l)return[];var n=d,r=mn(t,d);e=ao(e),t-=d;for(var i=ze(r,e);++n<t;)e(n);return i},Fn.toFinite=pu,Fn.toInteger=vu,Fn.toLength=gu,Fn.toLower=function(t){return bu(t).toLowerCase()},Fn.toNumber=yu,Fn.toSafeInteger=function(t){return t?ar(vu(t),-9007199254740991,l):0===t?t:0},Fn.toString=bu,Fn.toUpper=function(t){return bu(t).toUpperCase()},Fn.trim=function(t,e,n){if((t=bu(t))&&(n||e===i))return je(t);if(!t||!(e=ui(e)))return t;var r=an(t),o=an(e);return bi(r,He(r,o),qe(r,o)+1).join("")},Fn.trimEnd=function(t,e,n){if((t=bu(t))&&(n||e===i))return t.slice(0,un(t)+1);if(!t||!(e=ui(e)))return t;var r=an(t);return bi(r,0,qe(r,an(e))+1).join("")},Fn.trimStart=function(t,e,n){if((t=bu(t))&&(n||e===i))return t.replace(rt,"");if(!t||!(e=ui(e)))return t;var r=an(t);return bi(r,He(r,an(e))).join("")},Fn.truncate=function(t,e){var n=30,r="...";if(eu(e)){var o="separator"in e?e.separator:o;n="length"in e?vu(e.length):n,r="omission"in e?ui(e.omission):r}var a=(t=bu(t)).length;if(Je(t)){var u=an(t);a=u.length}if(n>=a)return t;var s=n-on(r);if(s<1)return r;var c=u?bi(u,0,s).join(""):t.slice(0,s);if(o===i)return c+r;if(u&&(s+=c.length-s),au(o)){if(t.slice(s).search(o)){var f,l=c;for(o.global||(o=At(o.source,bu(ht.exec(o))+"g")),o.lastIndex=0;f=o.exec(l);)var h=f.index;c=c.slice(0,h===i?s:h)}}else if(t.indexOf(ui(o),s)!=s){var d=c.lastIndexOf(o);d>-1&&(c=c.slice(0,d))}return c+r},Fn.unescape=function(t){return(t=bu(t))&&q.test(t)?t.replace(X,sn):t},Fn.uniqueId=function(t){var e=++Mt;return bu(t)+e},Fn.upperCase=Zu,Fn.upperFirst=$u,Fn.each=ba,Fn.eachRight=_a,Fn.first=qo,ss(Fn,(ms={},br(Fn,(function(t,e){Ot.call(Fn.prototype,e)||(ms[e]=t)})),ms),{chain:!1}),Fn.VERSION="4.17.21",be(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Fn[t].placeholder=Fn})),be(["drop","take"],(function(t,e){Wn.prototype[t]=function(n){n=n===i?1:yn(vu(n),0);var r=this.__filtered__&&!e?new Wn(this):this.clone();return r.__filtered__?r.__takeCount__=mn(n,r.__takeCount__):r.__views__.push({size:mn(n,d),type:t+(r.__dir__<0?"Right":"")}),r},Wn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),be(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Wn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:ao(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),be(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Wn.prototype[t]=function(){return this[n](1).value()[0]}})),be(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Wn.prototype[t]=function(){return this.__filtered__?new Wn(this):this[n](1)}})),Wn.prototype.compact=function(){return this.filter(is)},Wn.prototype.find=function(t){return this.filter(t).head()},Wn.prototype.findLast=function(t){return this.reverse().find(t)},Wn.prototype.invokeMap=Yr((function(t,e){return"function"==typeof t?new Wn(this):this.map((function(n){return Dr(n,t,e)}))})),Wn.prototype.reject=function(t){return this.filter(Ga(ao(t)))},Wn.prototype.slice=function(t,e){t=vu(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Wn(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==i&&(n=(e=vu(e))<0?n.dropRight(-e):n.take(e-t)),n)},Wn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Wn.prototype.toArray=function(){return this.take(d)},br(Wn.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),o=Fn[r?"take"+("last"==e?"Right":""):e],a=r||/^find/.test(e);o&&(Fn.prototype[e]=function(){var e=this.__wrapped__,u=r?[1]:arguments,s=e instanceof Wn,c=u[0],f=s||Xa(e),l=function(t){var e=o.apply(Fn,Te([t],u));return r&&h?e[0]:e};f&&n&&"function"==typeof c&&1!=c.length&&(s=f=!1);var h=this.__chain__,d=!!this.__actions__.length,p=a&&!h,v=s&&!d;if(!a&&f){e=v?e:new Wn(this);var g=t.apply(e,u);return g.__actions__.push({func:pa,args:[l],thisArg:i}),new jn(g,h)}return p&&v?t.apply(this,u):(g=this.thru(l),p?r?g.value()[0]:g.value():g)})})),be(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Ct[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Fn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(Xa(i)?i:[],t)}return this[n]((function(n){return e.apply(Xa(n)?n:[],t)}))}})),br(Wn.prototype,(function(t,e){var n=Fn[e];if(n){var r=n.name+"";Ot.call(Nn,r)||(Nn[r]=[]),Nn[r].push({name:e,func:n})}})),Nn[Ui(i,2).name]=[{name:"wrapper",func:i}],Wn.prototype.clone=function(){var t=new Wn(this.__wrapped__);return t.__actions__=Ii(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ii(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ii(this.__views__),t},Wn.prototype.reverse=function(){if(this.__filtered__){var t=new Wn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Wn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Xa(t),r=e<0,i=n?t.length:0,o=function(t,e,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=mn(e,t+a);break;case"takeRight":t=yn(t,e-a)}}return{start:t,end:e}}(0,i,this.__views__),a=o.start,u=o.end,s=u-a,c=r?u:a-1,f=this.__iteratees__,l=f.length,h=0,d=mn(s,this.__takeCount__);if(!n||!r&&i==s&&d==s)return hi(t,this.__actions__);var p=[];t:for(;s--&&h<d;){for(var v=-1,g=t[c+=e];++v<l;){var y=f[v],m=y.iteratee,b=y.type,_=m(g);if(2==b)g=_;else if(!_){if(1==b)continue t;break t}}p[h++]=g}return p},Fn.prototype.at=va,Fn.prototype.chain=function(){return da(this)},Fn.prototype.commit=function(){return new jn(this.value(),this.__chain__)},Fn.prototype.next=function(){this.__values__===i&&(this.__values__=du(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?i:this.__values__[this.__index__++]}},Fn.prototype.plant=function(t){for(var e,n=this;n instanceof zn;){var r=Bo(n);r.__index__=0,r.__values__=i,e?o.__wrapped__=r:e=r;var o=r;n=n.__wrapped__}return o.__wrapped__=t,e},Fn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Wn){var e=t;return this.__actions__.length&&(e=new Wn(this)),(e=e.reverse()).__actions__.push({func:pa,args:[ea],thisArg:i}),new jn(e,this.__chain__)}return this.thru(ea)},Fn.prototype.toJSON=Fn.prototype.valueOf=Fn.prototype.value=function(){return hi(this.__wrapped__,this.__actions__)},Fn.prototype.first=Fn.prototype.head,ae&&(Fn.prototype[ae]=function(){return this}),Fn}();oe._=cn,(r=function(){return cn}.call(e,n,e,t))===i||(t.exports=r)}.call(this)},1739:(t,e,n)=>{var r=n(5229),i=n(6765),o=n(5927),a=n(4186),u=n(6064),s=[0,0];t.exports.x7=function(t,e,n,a,c){return r(t,n,a),o(t,t),i(e,-t[1],t[0]),i(s,-n[1],n[0]),c/u(e,s)},t.exports.mJ=function(t,e){return i(t,-e[1],e[0]),t},t.exports.o7=function(t,e,n){return a(t,e,n),o(t,t),t}},8892:(t,e,n)=>{var r;!function(t){!function(e){var r="object"==typeof n.g?n.g:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),i=o(t);function o(t,e){return function(n,r){"function"!=typeof t[n]&&Object.defineProperty(t,n,{configurable:!0,writable:!0,value:r}),e&&e(n,r)}}void 0===r.Reflect?r.Reflect=t:i=o(r.Reflect,i),function(t){var e=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,r=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,a={__proto__:[]}instanceof Array,u=!o&&!a,s={create:o?function(){return P(Object.create(null))}:a?function(){return P({__proto__:null})}:function(){return P({})},has:u?function(t,n){return e.call(t,n)}:function(t,e){return e in t},get:u?function(t,n){return e.call(t,n)?t[n]:void 0}:function(t,e){return t[e]}},c=Object.getPrototypeOf(Function),f="object"==typeof process&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,l=f||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?function(){var t={},e=[],n=function(){function t(t,e,n){this._index=0,this._keys=t,this._values=e,this._selector=n}return t.prototype["@@iterator"]=function(){return this},t.prototype[i]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t<this._keys.length){var n=this._selector(this._keys[t],this._values[t]);return t+1>=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){var n=this._find(t,!0);return this._values[n]=e,this},e.prototype.delete=function(e){var n=this._find(e,!1);if(n>=0){for(var r=this._keys.length,i=n+1;i<r;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,e===this._cacheKey&&(this._cacheKey=t,this._cacheIndex=-2),!0}return!1},e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=t,this._cacheIndex=-2},e.prototype.keys=function(){return new n(this._keys,this._values,r)},e.prototype.values=function(){return new n(this._keys,this._values,o)},e.prototype.entries=function(){return new n(this._keys,this._values,a)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[i]=function(){return this.entries()},e.prototype._find=function(t,e){return this._cacheKey!==t&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=t)),this._cacheIndex<0&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function r(t,e){return t}function o(t,e){return e}function a(t,e){return[t,e]}}():Map,h=f||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?function(){function t(){this._map=new l}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.values()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[i]=function(){return this.keys()},t}():Set,d=new(f||"function"!=typeof WeakMap?function(){var t=s.create(),n=r();return function(){function t(){this._key=r()}return t.prototype.has=function(t){var e=i(t,!1);return void 0!==e&&s.has(e,this._key)},t.prototype.get=function(t){var e=i(t,!1);return void 0!==e?s.get(e,this._key):void 0},t.prototype.set=function(t,e){return i(t,!0)[this._key]=e,this},t.prototype.delete=function(t){var e=i(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=r()},t}();function r(){var e;do{e="@@WeakMap@@"+a()}while(s.has(t,e));return t[e]=!0,e}function i(t,r){if(!e.call(t,n)){if(!r)return;Object.defineProperty(t,n,{value:s.create()})}return t[n]}function o(t,e){for(var n=0;n<e;++n)t[n]=255*Math.random()|0;return t}function a(){var t,e=(t=16,"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(t)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(t)):o(new Uint8Array(t),t):o(new Array(t),t));e[6]=79&e[6]|64,e[8]=191&e[8]|128;for(var n="",r=0;r<16;++r){var i=e[r];4!==r&&6!==r&&8!==r||(n+="-"),i<16&&(n+="0"),n+=i.toString(16).toLowerCase()}return n}}():WeakMap);function p(t,e,n){var r=d.get(t);if(E(r)){if(!n)return;r=new l,d.set(t,r)}var i=r.get(e);if(E(i)){if(!n)return;i=new l,r.set(e,i)}return i}function v(t,e,n){if(g(t,e,n))return!0;var r=M(e);return!S(r)&&v(t,r,n)}function g(t,e,n){var r=p(e,n,!1);return!E(r)&&!!r.has(t)}function y(t,e,n){if(g(t,e,n))return m(t,e,n);var r=M(e);return S(r)?void 0:y(t,r,n)}function m(t,e,n){var r=p(e,n,!1);if(!E(r))return r.get(t)}function b(t,e,n,r){p(n,r,!0).set(t,e)}function _(t,e){var n=x(t,e),r=M(t);if(null===r)return n;var i=_(r,e);if(i.length<=0)return n;if(n.length<=0)return i;for(var o=new h,a=[],u=0,s=n;u<s.length;u++){var c=s[u];o.has(c)||(o.add(c),a.push(c))}for(var f=0,l=i;f<l.length;f++)c=l[f],o.has(c)||(o.add(c),a.push(c));return a}function x(t,e){var n=[],r=p(t,e,!1);if(E(r))return n;for(var o=function(t){var e=k(t,i);if(!D(e))throw new TypeError;var n=e.call(t);if(!A(n))throw new TypeError;return n}(r.keys()),a=0;;){var u=R(o);if(!u)return n.length=a,n;var s=u.value;try{n[a]=s}catch(t){try{O(o)}finally{throw t}}a++}}function w(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}function E(t){return void 0===t}function S(t){return null===t}function A(t){return"object"==typeof t?null!==t:"function"==typeof t}function T(t,e){switch(w(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var n=3===e?"string":5===e?"number":"default",i=k(t,r);if(void 0!==i){var o=i.call(t,n);if(A(o))throw new TypeError;return o}return function(t,e){if("string"===e){var n=t.toString;if(D(n)&&!A(i=n.call(t)))return i;if(D(r=t.valueOf)&&!A(i=r.call(t)))return i}else{var r;if(D(r=t.valueOf)&&!A(i=r.call(t)))return i;var i,o=t.toString;if(D(o)&&!A(i=o.call(t)))return i}throw new TypeError}(t,"default"===n?"number":n)}function I(t){var e=T(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function C(t){return Array.isArray?Array.isArray(t):t instanceof Object?t instanceof Array:"[object Array]"===Object.prototype.toString.call(t)}function D(t){return"function"==typeof t}function N(t){return"function"==typeof t}function k(t,e){var n=t[e];if(null!=n){if(!D(n))throw new TypeError;return n}}function R(t){var e=t.next();return!e.done&&e}function O(t){var e=t.return;e&&e.call(t)}function M(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===c)return e;if(e!==c)return e;var n=t.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return e;var i=r.constructor;return"function"!=typeof i||i===t?e:i}function P(t){return t.__=void 0,delete t.__,t}t("decorate",(function(t,e,n,r){if(E(n)){if(!C(t))throw new TypeError;if(!N(e))throw new TypeError;return function(t,e){for(var n=t.length-1;n>=0;--n){var r=(0,t[n])(e);if(!E(r)&&!S(r)){if(!N(r))throw new TypeError;e=r}}return e}(t,e)}if(!C(t))throw new TypeError;if(!A(e))throw new TypeError;if(!A(r)&&!E(r)&&!S(r))throw new TypeError;return S(r)&&(r=void 0),function(t,e,n,r){for(var i=t.length-1;i>=0;--i){var o=(0,t[i])(e,n,r);if(!E(o)&&!S(o)){if(!A(o))throw new TypeError;r=o}}return r}(t,e,n=I(n),r)})),t("metadata",(function(t,e){return function(n,r){if(!A(n))throw new TypeError;if(!E(r)&&!function(t){switch(w(t)){case 3:case 4:return!0;default:return!1}}(r))throw new TypeError;b(t,e,n,r)}})),t("defineMetadata",(function(t,e,n,r){if(!A(n))throw new TypeError;return E(r)||(r=I(r)),b(t,e,n,r)})),t("hasMetadata",(function(t,e,n){if(!A(e))throw new TypeError;return E(n)||(n=I(n)),v(t,e,n)})),t("hasOwnMetadata",(function(t,e,n){if(!A(e))throw new TypeError;return E(n)||(n=I(n)),g(t,e,n)})),t("getMetadata",(function(t,e,n){if(!A(e))throw new TypeError;return E(n)||(n=I(n)),y(t,e,n)})),t("getOwnMetadata",(function(t,e,n){if(!A(e))throw new TypeError;return E(n)||(n=I(n)),m(t,e,n)})),t("getMetadataKeys",(function(t,e){if(!A(t))throw new TypeError;return E(e)||(e=I(e)),_(t,e)})),t("getOwnMetadataKeys",(function(t,e){if(!A(t))throw new TypeError;return E(e)||(e=I(e)),x(t,e)})),t("deleteMetadata",(function(t,e,n){if(!A(e))throw new TypeError;E(n)||(n=I(n));var r=p(e,n,!1);if(E(r))return!1;if(!r.delete(t))return!1;if(r.size>0)return!0;var i=d.get(e);return i.delete(n),i.size>0||d.delete(e),!0}))}(i)}()}(r||(r={}))},405:t=>{var e=function(t){"use strict";var e,n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var i=e&&e.prototype instanceof g?e:g,o=Object.create(i.prototype),a=new C(r||[]);return o._invoke=function(t,e,n){var r=l;return function(i,o){if(r===d)throw new Error("Generator is already running");if(r===p){if("throw"===i)throw o;return N()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var u=A(a,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===l)throw r=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=d;var s=f(t,e,n);if("normal"===s.type){if(r=n.done?p:h,s.arg===v)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r=p,n.method="throw",n.arg=s.arg)}}}(t,n,a),o}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var l="suspendedStart",h="suspendedYield",d="executing",p="completed",v={};function g(){}function y(){}function m(){}var b={};s(b,o,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&r.call(x,o)&&(b=x);var w=m.prototype=g.prototype=Object.create(b);function E(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function n(i,o,a,u){var s=f(t[i],t,o);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,u)}))}u(s.arg)}var i;this._invoke=function(t,r){function o(){return new e((function(e,i){n(t,r,e,i)}))}return i=i?i.then(o,o):o()}}function A(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,A(t,n),"throw"===n.method))return v;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var i=f(r,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function D(t){if(t){var n=t[o];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}return{next:N}}function N(){return{value:e,done:!0}}return y.prototype=m,s(w,"constructor",m),s(m,"constructor",y),y.displayName=s(m,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,s(t,u,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},E(S.prototype),s(S.prototype,a,(function(){return this})),t.AsyncIterator=S,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new S(c(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(w),s(w,u,"Generator"),s(w,o,(function(){return this})),s(w,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=D,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(I),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return u.type="throw",u.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),I(n),v}},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;I(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},6377:function(t){t.exports=function(){"use strict";var t=function(t){return t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Float32Array||t instanceof Float64Array||t instanceof Uint8ClampedArray},e=function(t,e){for(var n=Object.keys(e),r=0;r<n.length;++r)t[n[r]]=e[n[r]];return t},n="\n";function r(t){var e=new Error("(regl) "+t);throw console.error(e),e}function i(t,e){t||r(e)}function o(t){return t?": "+t:""}function a(t,e){switch(e){case"number":return"number"==typeof t;case"object":return"object"==typeof t;case"string":return"string"==typeof t;case"boolean":return"boolean"==typeof t;case"function":return"function"==typeof t;case"undefined":return void 0===t;case"symbol":return"symbol"==typeof t}}function u(t,e,n){e.indexOf(t)<0&&r("invalid value"+o(n)+". must be one of: "+e)}var s=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"];function c(t,e){for(t+="";t.length<e;)t=" "+t;return t}function f(){this.name="unknown",this.lines=[],this.index={},this.hasErrors=!1}function l(t,e){this.number=t,this.line=e,this.errors=[]}function h(t,e,n){this.file=t,this.line=e,this.message=n}function d(){var t=new Error,e=(t.stack||t).toString(),n=/compileProcedure.*\n\s*at.*\((.*)\)/.exec(e);if(n)return n[1];var r=/compileProcedure.*\n\s*at\s+(.*)(\n|$)/.exec(e);return r?r[1]:"unknown"}function p(){var t=new Error,e=(t.stack||t).toString(),n=/at REGLCommand.*\n\s+at.*\((.*)\)/.exec(e);if(n)return n[1];var r=/at REGLCommand.*\n\s+at\s+(.*)\n/.exec(e);return r?r[1]:"unknown"}function v(t,e){var n,r=t.split("\n"),i=1,o=0,a={unknown:new f,0:new f};a.unknown.name=a[0].name=e||d(),a.unknown.lines.push(new l(0,""));for(var u=0;u<r.length;++u){var s=r[u],c=/^\s*#\s*(\w+)\s+(.+)\s*$/.exec(s);if(c)switch(c[1]){case"line":var h=/(\d+)(\s+\d+)?/.exec(c[2]);h&&(i=0|h[1],h[2]&&((o=0|h[2])in a||(a[o]=new f)));break;case"define":var p=/SHADER_NAME(_B64)?\s+(.*)$/.exec(c[2]);p&&(a[o].name=p[1]?(n=p[2],"undefined"!=typeof atob?atob(n):"base64:"+n):p[2])}a[o].lines.push(new l(i++,s))}return Object.keys(a).forEach((function(t){var e=a[t];e.lines.forEach((function(t){e.index[t.number]=t}))})),a}function g(t){t._commandRef=d()}function y(t,e){var n=p();r(t+" in command "+(e||d())+("unknown"===n?"":" called from "+n))}function m(t,e,n,r){a(t,e)||y("invalid parameter type"+o(n)+". expected "+e+", got "+typeof t,r||d())}var b=33071,_={};function x(t,e){return 32820===t||32819===t||33635===t?2:34042===t?4:_[t]*e}function w(t){return!(t&t-1||!t)}_[5120]=_[5121]=1,_[5122]=_[5123]=_[36193]=_[33635]=_[32819]=_[32820]=2,_[5124]=_[5125]=_[5126]=_[34042]=4;var E=e(i,{optional:function(t){t()},raise:r,commandRaise:y,command:function(t,e,n){t||y(e,n||d())},parameter:function(t,e,n){t in e||r("unknown parameter ("+t+")"+o(n)+". possible values: "+Object.keys(e).join())},commandParameter:function(t,e,n,r){t in e||y("unknown parameter ("+t+")"+o(n)+". possible values: "+Object.keys(e).join(),r||d())},constructor:function(t){Object.keys(t).forEach((function(t){s.indexOf(t)<0&&r('invalid regl constructor argument "'+t+'". must be one of '+s)}))},type:function(t,e,n){a(t,e)||r("invalid parameter type"+o(n)+". expected "+e+", got "+typeof t)},commandType:m,isTypedArray:function(e,n){t(e)||r("invalid parameter type"+o(n)+". must be a typed array")},nni:function(t,e){t>=0&&(0|t)===t||r("invalid parameter type, ("+t+")"+o(e)+". must be a nonnegative integer")},oneOf:u,shaderError:function(t,e,r,o,a){if(!t.getShaderParameter(e,t.COMPILE_STATUS)){var u=t.getShaderInfoLog(e),s=o===t.FRAGMENT_SHADER?"fragment":"vertex";m(r,"string",s+" shader source must be a string",a);var f=v(r,a),l=function(t){var e=[];return t.split("\n").forEach((function(t){if(!(t.length<5)){var n=/^ERROR:\s+(\d+):(\d+):\s*(.*)$/.exec(t);n?e.push(new h(0|n[1],0|n[2],n[3].trim())):t.length>0&&e.push(new h("unknown",0,t))}})),e}(u);(function(t,e){e.forEach((function(e){var n=t[e.file];if(n){var r=n.index[e.line];if(r)return r.errors.push(e),void(n.hasErrors=!0)}t.unknown.hasErrors=!0,t.unknown.lines[0].errors.push(e)}))})(f,l),Object.keys(f).forEach((function(t){var e=f[t];if(e.hasErrors){var r=[""],i=[""];o("file number "+t+": "+e.name+"\n","color:red;text-decoration:underline;font-weight:bold"),e.lines.forEach((function(t){if(t.errors.length>0){o(c(t.number,4)+"| ","background-color:yellow; font-weight:bold"),o(t.line+n,"color:red; background-color:yellow; font-weight:bold");var e=0;t.errors.forEach((function(r){var i=r.message,a=/^\s*'(.*)'\s*:\s*(.*)$/.exec(i);if(a){var u=a[1];i=a[2],"assign"===u&&(u="="),e=Math.max(t.line.indexOf(u,e),0)}else e=0;o(c("| ",6)),o(c("^^^",e+3)+n,"font-weight:bold"),o(c("| ",6)),o(i+n,"font-weight:bold")})),o(c("| ",6)+n)}else o(c(t.number,4)+"| "),o(t.line+n,"color:red")})),"undefined"==typeof document||window.chrome?console.log(r.join("")):(i[0]=r.join("%c"),console.log.apply(console,i))}function o(t,e){r.push(t),i.push(e||"")}})),i.raise("Error compiling "+s+" shader, "+f[0].name)}},linkError:function(t,e,r,o,a){if(!t.getProgramParameter(e,t.LINK_STATUS)){var u=t.getProgramInfoLog(e),s=v(r,a),c='Error linking program with vertex shader, "'+v(o,a)[0].name+'", and fragment shader "'+s[0].name+'"';"undefined"!=typeof document?console.log("%c"+c+"\n%c"+u,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(c+n+u),i.raise(c)}},callSite:p,saveCommandRef:g,saveDrawInfo:function(t,e,n,r){function i(t){return t?r.id(t):0}function o(t,e){Object.keys(e).forEach((function(e){t[r.id(e)]=!0}))}g(t),t._fragId=i(t.static.frag),t._vertId=i(t.static.vert);var a=t._uniformSet={};o(a,e.static),o(a,e.dynamic);var u=t._attributeSet={};o(u,n.static),o(u,n.dynamic),t._hasCount="count"in t.static||"count"in t.dynamic||"elements"in t.static||"elements"in t.dynamic},framebufferFormat:function(t,e,n){t.texture?u(t.texture._texture.internalformat,e,"unsupported texture format for attachment"):u(t.renderbuffer._renderbuffer.format,n,"unsupported renderbuffer format for attachment")},guessCommand:d,texture2D:function(t,e,n){var r,o=e.width,a=e.height,u=e.channels;i(o>0&&o<=n.maxTextureSize&&a>0&&a<=n.maxTextureSize,"invalid texture shape"),t.wrapS===b&&t.wrapT===b||i(w(o)&&w(a),"incompatible wrap mode for texture, both width and height must be power of 2"),1===e.mipmask?1!==o&&1!==a&&i(9984!==t.minFilter&&9986!==t.minFilter&&9985!==t.minFilter&&9987!==t.minFilter,"min filter requires mipmap"):(i(w(o)&&w(a),"texture must be a square power of 2 to support mipmapping"),i(e.mipmask===(o<<1)-1,"missing or incomplete mipmap data")),5126===e.type&&(n.extensions.indexOf("oes_texture_float_linear")<0&&i(9728===t.minFilter&&9728===t.magFilter,"filter not supported, must enable oes_texture_float_linear"),i(!t.genMipmaps,"mipmap generation not supported with float textures"));var s=e.images;for(r=0;r<16;++r)if(s[r]){var c=o>>r,f=a>>r;i(e.mipmask&1<<r,"missing mipmap data");var l=s[r];if(i(l.width===c&&l.height===f,"invalid shape for mip images"),i(l.format===e.format&&l.internalformat===e.internalformat&&l.type===e.type,"incompatible type for mip image"),l.compressed);else if(l.data){var h=Math.ceil(x(l.type,u)*c/l.unpackAlignment)*l.unpackAlignment;i(l.data.byteLength===h*f,"invalid data for image, buffer size is inconsistent with image format")}else l.element||l.copy}else t.genMipmaps||i(0==(e.mipmask&1<<r),"extra mipmap data");e.compressed&&i(!t.genMipmaps,"mipmap generation for compressed images not supported")},textureCube:function(t,e,n,r){var o=t.width,a=t.height,u=t.channels;i(o>0&&o<=r.maxTextureSize&&a>0&&a<=r.maxTextureSize,"invalid texture shape"),i(o===a,"cube map must be square"),i(e.wrapS===b&&e.wrapT===b,"wrap mode not supported by cube map");for(var s=0;s<n.length;++s){var c=n[s];i(c.width===o&&c.height===a,"inconsistent cube map face shape"),e.genMipmaps&&(i(!c.compressed,"can not generate mipmap for compressed textures"),i(1===c.mipmask,"can not specify mipmaps and generate mipmaps"));for(var f=c.images,l=0;l<16;++l){var h=f[l];if(h){var d=o>>l,p=a>>l;i(c.mipmask&1<<l,"missing mipmap data"),i(h.width===d&&h.height===p,"invalid shape for mip images"),i(h.format===t.format&&h.internalformat===t.internalformat&&h.type===t.type,"incompatible type for mip image"),h.compressed||(h.data?i(h.data.byteLength===d*p*Math.max(x(h.type,u),h.unpackAlignment),"invalid data for image, buffer size is inconsistent with image format"):h.element||h.copy)}}}}}),S=0;function A(t,e){this.id=S++,this.type=t,this.data=e}function T(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function I(t){if(0===t.length)return[];var e=t.charAt(0),n=t.charAt(t.length-1);if(t.length>1&&e===n&&('"'===e||"'"===e))return['"'+T(t.substr(1,t.length-2))+'"'];var r=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(t);if(r)return I(t.substr(0,r.index)).concat(I(r[1])).concat(I(t.substr(r.index+r[0].length)));var i=t.split(".");if(1===i.length)return['"'+T(t)+'"'];for(var o=[],a=0;a<i.length;++a)o=o.concat(I(i[a]));return o}function C(t){return"["+I(t).join("][")+"]"}var D={DynamicVariable:A,define:function(t,e){return new A(t,C(e+""))},isDynamic:function(t){return"function"==typeof t&&!t._reglType||t instanceof A},unbox:function t(e,n){return"function"==typeof e?new A(0,e):"number"==typeof e||"boolean"==typeof e?new A(5,e):Array.isArray(e)?new A(6,e.map(((e,r)=>t(e,n+"["+r+"]")))):e instanceof A?e:void E(!1,"invalid option type in uniform "+n)},accessor:C},N={next:"function"==typeof requestAnimationFrame?function(t){return requestAnimationFrame(t)}:function(t){return setTimeout(t,16)},cancel:"function"==typeof cancelAnimationFrame?function(t){return cancelAnimationFrame(t)}:clearTimeout},k="undefined"!=typeof performance&&performance.now?function(){return performance.now()}:function(){return+new Date};function R(t){return"string"==typeof t?t.split():(E(Array.isArray(t),"invalid extension array"),t)}function O(t){return"string"==typeof t?(E("undefined"!=typeof document,"not supported outside of DOM"),document.querySelector(t)):t}function M(t){var n,r,i,o,a,u=t||{},s={},c=[],f=[],l="undefined"==typeof window?1:window.devicePixelRatio,h=!1,d=function(t){t&&E.raise(t)},p=function(){};if("string"==typeof u?(E("undefined"!=typeof document,"selector queries only supported in DOM enviroments"),n=document.querySelector(u),E(n,"invalid query string for element")):"object"==typeof u?"string"==typeof(a=u).nodeName&&"function"==typeof a.appendChild&&"function"==typeof a.getBoundingClientRect?n=u:function(t){return"function"==typeof t.drawArrays||"function"==typeof t.drawElements}(u)?i=(o=u).canvas:(E.constructor(u),"gl"in u?o=u.gl:"canvas"in u?i=O(u.canvas):"container"in u&&(r=O(u.container)),"attributes"in u&&(s=u.attributes,E.type(s,"object","invalid context attributes")),"extensions"in u&&(c=R(u.extensions)),"optionalExtensions"in u&&(f=R(u.optionalExtensions)),"onDone"in u&&(E.type(u.onDone,"function","invalid or missing onDone callback"),d=u.onDone),"profile"in u&&(h=!!u.profile),"pixelRatio"in u&&(l=+u.pixelRatio,E(l>0,"invalid pixel ratio"))):E.raise("invalid arguments to regl"),n&&("canvas"===n.nodeName.toLowerCase()?i=n:r=n),!o){if(!i){E("undefined"!=typeof document,"must manually specify webgl context outside of DOM environments");var v=function(t,n,r){var i,o=document.createElement("canvas");function a(){var n=window.innerWidth,i=window.innerHeight;if(t!==document.body){var a=t.getBoundingClientRect();n=a.right-a.left,i=a.bottom-a.top}o.width=r*n,o.height=r*i,e(o.style,{width:n+"px",height:i+"px"})}return e(o.style,{border:0,margin:0,padding:0,top:0,left:0}),t.appendChild(o),t===document.body&&(o.style.position="absolute",e(t.style,{margin:0,padding:0})),t!==document.body&&"function"==typeof ResizeObserver?(i=new ResizeObserver((function(){setTimeout(a)}))).observe(t):window.addEventListener("resize",a,!1),a(),{canvas:o,onDestroy:function(){i?i.disconnect():window.removeEventListener("resize",a),t.removeChild(o)}}}(r||document.body,0,l);if(!v)return null;i=v.canvas,p=v.onDestroy}void 0===s.premultipliedAlpha&&(s.premultipliedAlpha=!0),o=function(t,e){function n(n){try{return t.getContext(n,e)}catch(t){return null}}return n("webgl")||n("experimental-webgl")||n("webgl-experimental")}(i,s)}return o?{gl:o,canvas:i,container:r,extensions:c,optionalExtensions:f,pixelRatio:l,profile:h,onDone:d,onDestroy:p}:(p(),d("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function P(t,e){for(var n=Array(t),r=0;r<t;++r)n[r]=e(r);return n}function G(t){var e,n;return e=(t>65535)<<4,e|=n=((t>>>=e)>255)<<3,e|=n=((t>>>=n)>15)<<2,(e|=n=((t>>>=n)>3)<<1)|(t>>>=n)>>1}function L(){var t=P(8,(function(){return[]}));function e(e){var n=function(t){for(var e=16;e<=1<<28;e*=16)if(t<=e)return e;return 0}(e),r=t[G(n)>>2];return r.length>0?r.pop():new ArrayBuffer(n)}function n(e){t[G(e.byteLength)>>2].push(e)}return{alloc:e,free:n,allocType:function(t,n){var r=null;switch(t){case 5120:r=new Int8Array(e(n),0,n);break;case 5121:r=new Uint8Array(e(n),0,n);break;case 5122:r=new Int16Array(e(2*n),0,n);break;case 5123:r=new Uint16Array(e(2*n),0,n);break;case 5124:r=new Int32Array(e(4*n),0,n);break;case 5125:r=new Uint32Array(e(4*n),0,n);break;case 5126:r=new Float32Array(e(4*n),0,n);break;default:return null}return r.length!==n?r.subarray(0,n):r},freeType:function(t){n(t.buffer)}}}var U=L();U.zero=L();var F=3553,B=6408,z=5126,j=36160;function W(e){return!!e&&"object"==typeof e&&Array.isArray(e.shape)&&Array.isArray(e.stride)&&"number"==typeof e.offset&&e.shape.length===e.stride.length&&(Array.isArray(e.data)||t(e.data))}var V=function(t){return Object.keys(t).map((function(e){return t[e]}))},X={shape:function(t){for(var e=[],n=t;n.length;n=n[0])e.push(n.length);return e},flatten:function(t,e,n,r){var i=1;if(e.length)for(var o=0;o<e.length;++o)i*=e[o];else i=0;var a=r||U.allocType(n,i);switch(e.length){case 0:break;case 1:!function(t,e,n){for(var r=0;r<e;++r)n[r]=t[r]}(t,e[0],a);break;case 2:!function(t,e,n,r){for(var i=0,o=0;o<e;++o)for(var a=t[o],u=0;u<n;++u)r[i++]=a[u]}(t,e[0],e[1],a);break;case 3:H(t,e[0],e[1],e[2],a,0);break;default:q(t,e,0,a,0)}return a}};function H(t,e,n,r,i,o){for(var a=o,u=0;u<e;++u)for(var s=t[u],c=0;c<n;++c)for(var f=s[c],l=0;l<r;++l)i[a++]=f[l]}function q(t,e,n,r,i){for(var o=1,a=n+1;a<e.length;++a)o*=e[a];var u=e[n];if(e.length-n==4){var s=e[n+1],c=e[n+2],f=e[n+3];for(a=0;a<u;++a)H(t[a],s,c,f,r,i),i+=o}else for(a=0;a<u;++a)q(t[a],e,n+1,r,i),i+=o}var Y={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},K={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},Z={dynamic:35048,stream:35040,static:35044},$=X.flatten,J=X.shape,Q=5121,tt=5126,et=[];function nt(t){return 0|Y[Object.prototype.toString.call(t)]}function rt(t,e){for(var n=0;n<e.length;++n)t[n]=e[n]}function it(t,e,n,r,i,o,a){for(var u=0,s=0;s<n;++s)for(var c=0;c<r;++c)t[u++]=e[i*s+o*c+a]}et[5120]=1,et[5122]=2,et[5124]=4,et[5121]=1,et[5123]=2,et[5125]=4,et[5126]=4;var ot={points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},at=5121,ut=5123,st=5125,ct=34963;var ft=new Float32Array(1),lt=new Uint32Array(ft.buffer);function ht(t){for(var e=U.allocType(5123,t.length),n=0;n<t.length;++n)if(isNaN(t[n]))e[n]=65535;else if(t[n]===1/0)e[n]=31744;else if(t[n]===-1/0)e[n]=64512;else{ft[0]=t[n];var r=lt[0],i=r>>>31<<15,o=(r<<1>>>24)-127,a=r>>13&1023;if(o<-24)e[n]=i;else if(o<-14){var u=-14-o;e[n]=i+(a+1024>>u)}else e[n]=o>15?i+31744:i+(o+15<<10)+a}return e}function dt(e){return Array.isArray(e)||t(e)}var pt=function(t){return!(t&t-1||!t)},vt=3553,gt=34067,yt=34069,mt=6408,bt=6406,_t=6407,xt=6409,wt=6410,Et=32855,St=6402,At=34041,Tt=35904,It=35906,Ct=36193,Dt=33776,Nt=33777,kt=33778,Rt=33779,Ot=5121,Mt=5123,Pt=5125,Gt=5126,Lt=33071,Ut=9728,Ft=9984,Bt=9987,zt=4352,jt=33984,Wt=[Ft,9986,9985,Bt],Vt=[0,xt,wt,_t,mt],Xt={};function Ht(t){return"[object "+t+"]"}Xt[6409]=Xt[6406]=Xt[6402]=1,Xt[34041]=Xt[6410]=2,Xt[6407]=Xt[35904]=3,Xt[6408]=Xt[35906]=4;var qt=Ht("HTMLCanvasElement"),Yt=Ht("OffscreenCanvas"),Kt=Ht("CanvasRenderingContext2D"),Zt=Ht("ImageBitmap"),$t=Ht("HTMLImageElement"),Jt=Ht("HTMLVideoElement"),Qt=Object.keys(Y).concat([qt,Yt,Kt,Zt,$t,Jt]),te=[];te[5121]=1,te[5126]=4,te[36193]=2,te[5123]=2,te[5125]=4;var ee=[];function ne(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function re(t){return!!Array.isArray(t)&&!(0===t.length||!dt(t[0]))}function ie(t){return Object.prototype.toString.call(t)}function oe(t){return ie(t)===qt}function ae(t){return ie(t)===Yt}function ue(t){if(!t)return!1;var e=ie(t);return Qt.indexOf(e)>=0||ne(t)||re(t)||W(t)}function se(t){return 0|Y[Object.prototype.toString.call(t)]}function ce(t,e){return U.allocType(t.type===Ct?Gt:t.type,e)}function fe(t,e){t.type===Ct?(t.data=ht(e),U.freeType(e)):t.data=e}function le(t,e,n,r,i,o){var a;if(a=void 0!==ee[t]?ee[t]:Xt[t]*te[e],o&&(a*=6),i){for(var u=0,s=n;s>=1;)u+=a*s*s,s/=2;return u}return a*n*r}function he(n,r,i,o,a,u,s){var c={"don't care":zt,"dont care":zt,nice:4354,fast:4353},f={repeat:10497,clamp:Lt,mirror:33648},l={nearest:Ut,linear:9729},h=e({mipmap:Bt,"nearest mipmap nearest":Ft,"linear mipmap nearest":9985,"nearest mipmap linear":9986,"linear mipmap linear":Bt},l),d={none:0,browser:37444},p={uint8:Ot,rgba4:32819,rgb565:33635,"rgb5 a1":32820},v={alpha:bt,luminance:xt,"luminance alpha":wt,rgb:_t,rgba:mt,rgba4:32854,"rgb5 a1":Et,rgb565:36194},g={};r.ext_srgb&&(v.srgb=Tt,v.srgba=It),r.oes_texture_float&&(p.float32=p.float=Gt),r.oes_texture_half_float&&(p.float16=p["half float"]=Ct),r.webgl_depth_texture&&(e(v,{depth:St,"depth stencil":At}),e(p,{uint16:Mt,uint32:Pt,"depth stencil":34042})),r.webgl_compressed_texture_s3tc&&e(g,{"rgb s3tc dxt1":Dt,"rgba s3tc dxt1":Nt,"rgba s3tc dxt3":kt,"rgba s3tc dxt5":Rt}),r.webgl_compressed_texture_atc&&e(g,{"rgb atc":35986,"rgba atc explicit alpha":35987,"rgba atc interpolated alpha":34798}),r.webgl_compressed_texture_pvrtc&&e(g,{"rgb pvrtc 4bppv1":35840,"rgb pvrtc 2bppv1":35841,"rgba pvrtc 4bppv1":35842,"rgba pvrtc 2bppv1":35843}),r.webgl_compressed_texture_etc1&&(g["rgb etc1"]=36196);var y=Array.prototype.slice.call(n.getParameter(34467));Object.keys(g).forEach((function(t){var e=g[t];y.indexOf(e)>=0&&(v[t]=e)}));var m=Object.keys(v);i.textureFormats=m;var b=[];Object.keys(v).forEach((function(t){var e=v[t];b[e]=t}));var _=[];Object.keys(p).forEach((function(t){var e=p[t];_[e]=t}));var x=[];Object.keys(l).forEach((function(t){x[l[t]]=t}));var w=[];Object.keys(h).forEach((function(t){var e=h[t];w[e]=t}));var S=[];Object.keys(f).forEach((function(t){S[f[t]]=t}));var A=m.reduce((function(t,e){var n=v[e];return n===xt||n===bt||n===xt||n===wt||n===St||n===At||r.ext_srgb&&(n===Tt||n===It)?t[n]=n:n===Et||e.indexOf("rgba")>=0?t[n]=mt:t[n]=_t,t}),{});function T(){this.internalformat=mt,this.format=mt,this.type=Ot,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=37444,this.width=0,this.height=0,this.channels=0}function I(t,e){t.internalformat=e.internalformat,t.format=e.format,t.type=e.type,t.compressed=e.compressed,t.premultiplyAlpha=e.premultiplyAlpha,t.flipY=e.flipY,t.unpackAlignment=e.unpackAlignment,t.colorSpace=e.colorSpace,t.width=e.width,t.height=e.height,t.channels=e.channels}function C(t,e){if("object"==typeof e&&e){if("premultiplyAlpha"in e&&(E.type(e.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),t.premultiplyAlpha=e.premultiplyAlpha),"flipY"in e&&(E.type(e.flipY,"boolean","invalid texture flip"),t.flipY=e.flipY),"alignment"in e&&(E.oneOf(e.alignment,[1,2,4,8],"invalid texture unpack alignment"),t.unpackAlignment=e.alignment),"colorSpace"in e&&(E.parameter(e.colorSpace,d,"invalid colorSpace"),t.colorSpace=d[e.colorSpace]),"type"in e){var n=e.type;E(r.oes_texture_float||!("float"===n||"float32"===n),"you must enable the OES_texture_float extension in order to use floating point textures."),E(r.oes_texture_half_float||!("half float"===n||"float16"===n),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),E(r.webgl_depth_texture||!("uint16"===n||"uint32"===n||"depth stencil"===n),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),E.parameter(n,p,"invalid texture type"),t.type=p[n]}var o=t.width,a=t.height,u=t.channels,s=!1;"shape"in e?(E(Array.isArray(e.shape)&&e.shape.length>=2,"shape must be an array"),o=e.shape[0],a=e.shape[1],3===e.shape.length&&(u=e.shape[2],E(u>0&&u<=4,"invalid number of channels"),s=!0),E(o>=0&&o<=i.maxTextureSize,"invalid width"),E(a>=0&&a<=i.maxTextureSize,"invalid height")):("radius"in e&&(o=a=e.radius,E(o>=0&&o<=i.maxTextureSize,"invalid radius")),"width"in e&&(o=e.width,E(o>=0&&o<=i.maxTextureSize,"invalid width")),"height"in e&&(a=e.height,E(a>=0&&a<=i.maxTextureSize,"invalid height")),"channels"in e&&(u=e.channels,E(u>0&&u<=4,"invalid number of channels"),s=!0)),t.width=0|o,t.height=0|a,t.channels=0|u;var c=!1;if("format"in e){var f=e.format;E(r.webgl_depth_texture||!("depth"===f||"depth stencil"===f),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),E.parameter(f,v,"invalid texture format");var l=t.internalformat=v[f];t.format=A[l],f in p&&("type"in e||(t.type=p[f])),f in g&&(t.compressed=!0),c=!0}!s&&c?t.channels=Xt[t.format]:s&&!c?t.channels!==Vt[t.format]&&(t.format=t.internalformat=Vt[t.channels]):c&&s&&E(t.channels===Xt[t.format],"number of channels inconsistent with specified format")}}function D(t){n.pixelStorei(37440,t.flipY),n.pixelStorei(37441,t.premultiplyAlpha),n.pixelStorei(37443,t.colorSpace),n.pixelStorei(3317,t.unpackAlignment)}function N(){T.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function k(e,n){var r=null;if(ue(n)?r=n:n&&(E.type(n,"object","invalid pixel data type"),C(e,n),"x"in n&&(e.xOffset=0|n.x),"y"in n&&(e.yOffset=0|n.y),ue(n.data)&&(r=n.data)),E(!e.compressed||r instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),n.copy){E(!r,"can not specify copy and data field for the same texture");var o=a.viewportWidth,u=a.viewportHeight;e.width=e.width||o-e.xOffset,e.height=e.height||u-e.yOffset,e.needsCopy=!0,E(e.xOffset>=0&&e.xOffset<o&&e.yOffset>=0&&e.yOffset<u&&e.width>0&&e.width<=o&&e.height>0&&e.height<=u,"copy texture read out of bounds")}else if(r){if(t(r))e.channels=e.channels||4,e.data=r,"type"in n||e.type!==Ot||(e.type=se(r));else if(ne(r))e.channels=e.channels||4,function(t,e){var n=e.length;switch(t.type){case Ot:case Mt:case Pt:case Gt:var r=U.allocType(t.type,n);r.set(e),t.data=r;break;case Ct:t.data=ht(e);break;default:E.raise("unsupported texture type, must specify a typed array")}}(e,r),e.alignment=1,e.needsFree=!0;else if(W(r)){var s=r.data;Array.isArray(s)||e.type!==Ot||(e.type=se(s));var c,f,l,h,d,p,v=r.shape,g=r.stride;3===v.length?(l=v[2],p=g[2]):(E(2===v.length,"invalid ndarray pixel data, must be 2 or 3D"),l=1,p=1),c=v[0],f=v[1],h=g[0],d=g[1],e.alignment=1,e.width=c,e.height=f,e.channels=l,e.format=e.internalformat=Vt[l],e.needsFree=!0,function(t,e,n,r,i,o){for(var a=t.width,u=t.height,s=t.channels,c=ce(t,a*u*s),f=0,l=0;l<u;++l)for(var h=0;h<a;++h)for(var d=0;d<s;++d)c[f++]=e[n*h+r*l+i*d+o];fe(t,c)}(e,s,h,d,p,r.offset)}else if(oe(r)||ae(r)||ie(r)===Kt)oe(r)||ae(r)?e.element=r:e.element=r.canvas,e.width=e.element.width,e.height=e.element.height,e.channels=4;else if(function(t){return ie(t)===Zt}(r))e.element=r,e.width=r.width,e.height=r.height,e.channels=4;else if(function(t){return ie(t)===$t}(r))e.element=r,e.width=r.naturalWidth,e.height=r.naturalHeight,e.channels=4;else if(function(t){return ie(t)===Jt}(r))e.element=r,e.width=r.videoWidth,e.height=r.videoHeight,e.channels=4;else if(re(r)){var y=e.width||r[0].length,m=e.height||r.length,b=e.channels;b=dt(r[0][0])?b||r[0][0].length:b||1;for(var _=X.shape(r),x=1,w=0;w<_.length;++w)x*=_[w];var S=ce(e,x);X.flatten(r,_,"",S),fe(e,S),e.alignment=1,e.width=y,e.height=m,e.channels=b,e.format=e.internalformat=Vt[b],e.needsFree=!0}}else e.width=e.width||1,e.height=e.height||1,e.channels=e.channels||4;e.type===Gt?E(i.extensions.indexOf("oes_texture_float")>=0,"oes_texture_float extension not enabled"):e.type===Ct&&E(i.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function R(t,e,r){var i=t.element,a=t.data,u=t.internalformat,s=t.format,c=t.type,f=t.width,l=t.height;D(t),i?n.texImage2D(e,r,s,s,c,i):t.compressed?n.compressedTexImage2D(e,r,u,f,l,0,a):t.needsCopy?(o(),n.copyTexImage2D(e,r,s,t.xOffset,t.yOffset,f,l,0)):n.texImage2D(e,r,s,f,l,0,s,c,a||null)}function O(t,e,r,i,a){var u=t.element,s=t.data,c=t.internalformat,f=t.format,l=t.type,h=t.width,d=t.height;D(t),u?n.texSubImage2D(e,a,r,i,f,l,u):t.compressed?n.compressedTexSubImage2D(e,a,r,i,c,h,d,s):t.needsCopy?(o(),n.copyTexSubImage2D(e,a,r,i,t.xOffset,t.yOffset,h,d)):n.texSubImage2D(e,a,r,i,h,d,f,l,s)}var M=[];function P(){return M.pop()||new N}function G(t){t.needsFree&&U.freeType(t.data),N.call(t),M.push(t)}function L(){T.call(this),this.genMipmaps=!1,this.mipmapHint=zt,this.mipmask=0,this.images=Array(16)}function F(t,e,n){var r=t.images[0]=P();t.mipmask=1,r.width=t.width=e,r.height=t.height=n,r.channels=t.channels=4}function B(t,e){var n=null;if(ue(e))I(n=t.images[0]=P(),t),k(n,e),t.mipmask=1;else if(C(t,e),Array.isArray(e.mipmap))for(var r=e.mipmap,i=0;i<r.length;++i)I(n=t.images[i]=P(),t),n.width>>=i,n.height>>=i,k(n,r[i]),t.mipmask|=1<<i;else I(n=t.images[0]=P(),t),k(n,e),t.mipmask=1;I(t,t.images[0]),!t.compressed||t.internalformat!==Dt&&t.internalformat!==Nt&&t.internalformat!==kt&&t.internalformat!==Rt||E(t.width%4==0&&t.height%4==0,"for compressed texture formats, mipmap level 0 must have width and height that are a multiple of 4")}function z(t,e){for(var n=t.images,r=0;r<n.length;++r){if(!n[r])return;R(n[r],e,r)}}var j=[];function H(){var t=j.pop()||new L;T.call(t),t.mipmask=0;for(var e=0;e<16;++e)t.images[e]=null;return t}function q(t){for(var e=t.images,n=0;n<e.length;++n)e[n]&&G(e[n]),e[n]=null;j.push(t)}function Y(){this.minFilter=Ut,this.magFilter=Ut,this.wrapS=Lt,this.wrapT=Lt,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=zt}function K(t,e){if("min"in e){var n=e.min;E.parameter(n,h),t.minFilter=h[n],Wt.indexOf(t.minFilter)>=0&&!("faces"in e)&&(t.genMipmaps=!0)}if("mag"in e){var r=e.mag;E.parameter(r,l),t.magFilter=l[r]}var o=t.wrapS,a=t.wrapT;if("wrap"in e){var u=e.wrap;"string"==typeof u?(E.parameter(u,f),o=a=f[u]):Array.isArray(u)&&(E.parameter(u[0],f),E.parameter(u[1],f),o=f[u[0]],a=f[u[1]])}else{if("wrapS"in e){var s=e.wrapS;E.parameter(s,f),o=f[s]}if("wrapT"in e){var d=e.wrapT;E.parameter(d,f),a=f[d]}}if(t.wrapS=o,t.wrapT=a,"anisotropic"in e){var p=e.anisotropic;E("number"==typeof p&&p>=1&&p<=i.maxAnisotropic,"aniso samples must be between 1 and "),t.anisotropic=e.anisotropic}if("mipmap"in e){var v=!1;switch(typeof e.mipmap){case"string":E.parameter(e.mipmap,c,"invalid mipmap hint"),t.mipmapHint=c[e.mipmap],t.genMipmaps=!0,v=!0;break;case"boolean":v=t.genMipmaps=e.mipmap;break;case"object":E(Array.isArray(e.mipmap),"invalid mipmap type"),t.genMipmaps=!1,v=!0;break;default:E.raise("invalid mipmap type")}v&&!("min"in e)&&(t.minFilter=Ft)}}function Z(t,e){n.texParameteri(e,10241,t.minFilter),n.texParameteri(e,10240,t.magFilter),n.texParameteri(e,10242,t.wrapS),n.texParameteri(e,10243,t.wrapT),r.ext_texture_filter_anisotropic&&n.texParameteri(e,34046,t.anisotropic),t.genMipmaps&&(n.hint(33170,t.mipmapHint),n.generateMipmap(e))}var $=0,J={},Q=i.maxTextureUnits,tt=Array(Q).map((function(){return null}));function et(t){T.call(this),this.mipmask=0,this.internalformat=mt,this.id=$++,this.refCount=1,this.target=t,this.texture=n.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Y,s.profile&&(this.stats={size:0})}function nt(t){n.activeTexture(jt),n.bindTexture(t.target,t.texture)}function rt(){var t=tt[0];t?n.bindTexture(t.target,t.texture):n.bindTexture(vt,null)}function it(t){var e=t.texture;E(e,"must not double destroy texture");var r=t.unit,i=t.target;r>=0&&(n.activeTexture(jt+r),n.bindTexture(i,null),tt[r]=null),n.deleteTexture(e),t.texture=null,t.params=null,t.pixels=null,t.refCount=0,delete J[t.id],u.textureCount--}return e(et.prototype,{bind:function(){var t=this;t.bindCount+=1;var e=t.unit;if(e<0){for(var r=0;r<Q;++r){var i=tt[r];if(i){if(i.bindCount>0)continue;i.unit=-1}tt[r]=t,e=r;break}e>=Q&&E.raise("insufficient number of texture units"),s.profile&&u.maxTextureUnits<e+1&&(u.maxTextureUnits=e+1),t.unit=e,n.activeTexture(jt+e),n.bindTexture(t.target,t.texture)}return e},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&it(this)}}),s.profile&&(u.getTotalTextureSize=function(){var t=0;return Object.keys(J).forEach((function(e){t+=J[e].stats.size})),t}),{create2D:function(t,e){var r=new et(vt);function o(t,e){var n=r.texInfo;Y.call(n);var a=H();return"number"==typeof t?F(a,0|t,"number"==typeof e?0|e:0|t):t?(E.type(t,"object","invalid arguments to regl.texture"),K(n,t),B(a,t)):F(a,1,1),n.genMipmaps&&(a.mipmask=(a.width<<1)-1),r.mipmask=a.mipmask,I(r,a),E.texture2D(n,a,i),r.internalformat=a.internalformat,o.width=a.width,o.height=a.height,nt(r),z(a,vt),Z(n,vt),rt(),q(a),s.profile&&(r.stats.size=le(r.internalformat,r.type,a.width,a.height,n.genMipmaps,!1)),o.format=b[r.internalformat],o.type=_[r.type],o.mag=x[n.magFilter],o.min=w[n.minFilter],o.wrapS=S[n.wrapS],o.wrapT=S[n.wrapT],o}return J[r.id]=r,u.textureCount++,o(t,e),o.subimage=function(t,e,n,i){E(!!t,"must specify image data");var a=0|e,u=0|n,s=0|i,c=P();return I(c,r),c.width=0,c.height=0,k(c,t),c.width=c.width||(r.width>>s)-a,c.height=c.height||(r.height>>s)-u,E(r.type===c.type&&r.format===c.format&&r.internalformat===c.internalformat,"incompatible format for texture.subimage"),E(a>=0&&u>=0&&a+c.width<=r.width&&u+c.height<=r.height,"texture.subimage write out of bounds"),E(r.mipmask&1<<s,"missing mipmap data"),E(c.data||c.element||c.needsCopy,"missing image data"),nt(r),O(c,vt,a,u,s),rt(),G(c),o},o.resize=function(t,e){var i=0|t,a=0|e||i;if(i===r.width&&a===r.height)return o;o.width=r.width=i,o.height=r.height=a,nt(r);for(var u=0;r.mipmask>>u;++u){var c=i>>u,f=a>>u;if(!c||!f)break;n.texImage2D(vt,u,r.format,c,f,0,r.format,r.type,null)}return rt(),s.profile&&(r.stats.size=le(r.internalformat,r.type,i,a,!1,!1)),o},o._reglType="texture2d",o._texture=r,s.profile&&(o.stats=r.stats),o.destroy=function(){r.decRef()},o},createCube:function(t,e,r,o,a,c){var f=new et(gt);J[f.id]=f,u.cubeCount++;var l=new Array(6);function h(t,e,n,r,o,a){var u,c=f.texInfo;for(Y.call(c),u=0;u<6;++u)l[u]=H();if("number"!=typeof t&&t)if("object"==typeof t)if(e)B(l[0],t),B(l[1],e),B(l[2],n),B(l[3],r),B(l[4],o),B(l[5],a);else if(K(c,t),C(f,t),"faces"in t){var d=t.faces;for(E(Array.isArray(d)&&6===d.length,"cube faces must be a length 6 array"),u=0;u<6;++u)E("object"==typeof d[u]&&!!d[u],"invalid input for cube map face"),I(l[u],f),B(l[u],d[u])}else for(u=0;u<6;++u)B(l[u],t);else E.raise("invalid arguments to cube map");else{var p=0|t||1;for(u=0;u<6;++u)F(l[u],p,p)}for(I(f,l[0]),i.npotTextureCube||E(pt(f.width)&&pt(f.height),"your browser does not support non power or two texture dimensions"),c.genMipmaps?f.mipmask=(l[0].width<<1)-1:f.mipmask=l[0].mipmask,E.textureCube(f,c,l,i),f.internalformat=l[0].internalformat,h.width=l[0].width,h.height=l[0].height,nt(f),u=0;u<6;++u)z(l[u],yt+u);for(Z(c,gt),rt(),s.profile&&(f.stats.size=le(f.internalformat,f.type,h.width,h.height,c.genMipmaps,!0)),h.format=b[f.internalformat],h.type=_[f.type],h.mag=x[c.magFilter],h.min=w[c.minFilter],h.wrapS=S[c.wrapS],h.wrapT=S[c.wrapT],u=0;u<6;++u)q(l[u]);return h}return h(t,e,r,o,a,c),h.subimage=function(t,e,n,r,i){E(!!e,"must specify image data"),E("number"==typeof t&&t===(0|t)&&t>=0&&t<6,"invalid face");var o=0|n,a=0|r,u=0|i,s=P();return I(s,f),s.width=0,s.height=0,k(s,e),s.width=s.width||(f.width>>u)-o,s.height=s.height||(f.height>>u)-a,E(f.type===s.type&&f.format===s.format&&f.internalformat===s.internalformat,"incompatible format for texture.subimage"),E(o>=0&&a>=0&&o+s.width<=f.width&&a+s.height<=f.height,"texture.subimage write out of bounds"),E(f.mipmask&1<<u,"missing mipmap data"),E(s.data||s.element||s.needsCopy,"missing image data"),nt(f),O(s,yt+t,o,a,u),rt(),G(s),h},h.resize=function(t){var e=0|t;if(e!==f.width){h.width=f.width=e,h.height=f.height=e,nt(f);for(var r=0;r<6;++r)for(var i=0;f.mipmask>>i;++i)n.texImage2D(yt+r,i,f.format,e>>i,e>>i,0,f.format,f.type,null);return rt(),s.profile&&(f.stats.size=le(f.internalformat,f.type,h.width,h.height,!1,!0)),h}},h._reglType="textureCube",h._texture=f,s.profile&&(h.stats=f.stats),h.destroy=function(){f.decRef()},h},clear:function(){for(var t=0;t<Q;++t)n.activeTexture(jt+t),n.bindTexture(vt,null),tt[t]=null;V(J).forEach(it),u.cubeCount=0,u.textureCount=0},getTexture:function(t){return null},restore:function(){for(var t=0;t<Q;++t){var e=tt[t];e&&(e.bindCount=0,e.unit=-1,tt[t]=null)}V(J).forEach((function(t){t.texture=n.createTexture(),n.bindTexture(t.target,t.texture);for(var e=0;e<32;++e)if(0!=(t.mipmask&1<<e))if(t.target===vt)n.texImage2D(vt,e,t.internalformat,t.width>>e,t.height>>e,0,t.internalformat,t.type,null);else for(var r=0;r<6;++r)n.texImage2D(yt+r,e,t.internalformat,t.width>>e,t.height>>e,0,t.internalformat,t.type,null);Z(t.texInfo,t.target)}))},refresh:function(){for(var t=0;t<Q;++t){var e=tt[t];e&&(e.bindCount=0,e.unit=-1,tt[t]=null),n.activeTexture(jt+t),n.bindTexture(vt,null),n.bindTexture(gt,null)}}}}ee[32854]=2,ee[32855]=2,ee[36194]=2,ee[34041]=4,ee[33776]=.5,ee[33777]=.5,ee[33778]=1,ee[33779]=1,ee[35986]=.5,ee[35987]=1,ee[34798]=1,ee[35840]=.5,ee[35841]=.25,ee[35842]=.5,ee[35843]=.25,ee[36196]=.5;var de=36161,pe=32854,ve=[];function ge(t,e,n){return ve[t]*e*n}ve[32854]=2,ve[32855]=2,ve[36194]=2,ve[33189]=2,ve[36168]=1,ve[34041]=4,ve[35907]=4,ve[34836]=16,ve[34842]=8,ve[34843]=6;var ye=36160,me=36161,be=3553,_e=34069,xe=[6407,6408],we=[];we[6408]=4,we[6407]=3;var Ee=[];Ee[5121]=1,Ee[5126]=4,Ee[36193]=2;var Se=[32854,32855,36194,35907,34842,34843,34836],Ae={};Ae[36053]="complete",Ae[36054]="incomplete attachment",Ae[36057]="incomplete dimensions",Ae[36055]="incomplete, missing attachment",Ae[36061]="unsupported";function Te(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.offset=0,this.stride=0,this.divisor=0}var Ie=5121,Ce=5126;function De(e,n,r,i,o,a,u){function s(s){var c;null===n.next?(E(o.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),c=Ie):(E(null!==n.next.colorAttachments[0].texture,"You cannot read from a renderbuffer"),c=n.next.colorAttachments[0].texture._texture.type,a.oes_texture_float?(E(c===Ie||c===Ce,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"),c===Ce&&E(u.readFloat,"Reading 'float' values is not permitted in your browser. For a fallback, please see: https://www.npmjs.com/package/glsl-read-float")):E(c===Ie,"Reading from a framebuffer is only allowed for the type 'uint8'"));var f=0,l=0,h=i.framebufferWidth,d=i.framebufferHeight,p=null;t(s)?p=s:s&&(E.type(s,"object","invalid arguments to regl.read()"),f=0|s.x,l=0|s.y,E(f>=0&&f<i.framebufferWidth,"invalid x offset for regl.read"),E(l>=0&&l<i.framebufferHeight,"invalid y offset for regl.read"),h=0|(s.width||i.framebufferWidth-f),d=0|(s.height||i.framebufferHeight-l),p=s.data||null),p&&(c===Ie?E(p instanceof Uint8Array,"buffer must be 'Uint8Array' when reading from a framebuffer of type 'uint8'"):c===Ce&&E(p instanceof Float32Array,"buffer must be 'Float32Array' when reading from a framebuffer of type 'float'")),E(h>0&&h+f<=i.framebufferWidth,"invalid width for read pixels"),E(d>0&&d+l<=i.framebufferHeight,"invalid height for read pixels"),r();var v=h*d*4;return p||(c===Ie?p=new Uint8Array(v):c===Ce&&(p=p||new Float32Array(v))),E.isTypedArray(p,"data buffer for regl.read() must be a typedarray"),E(p.byteLength>=v,"data buffer for regl.read() too small"),e.pixelStorei(3333,4),e.readPixels(f,l,h,d,6408,c,p),p}return function(t){return t&&"framebuffer"in t?function(t){var e;return n.setFBO({framebuffer:t.framebuffer},(function(){e=s(t)})),e}(t):s(t)}}function Ne(t){return Array.prototype.slice.call(t)}function ke(t){return Ne(t).join("")}var Re="xyzw".split(""),Oe="dither",Me="blend.enable",Pe="blend.color",Ge="blend.equation",Le="blend.func",Ue="depth.enable",Fe="depth.func",Be="depth.range",ze="depth.mask",je="colorMask",We="cull.enable",Ve="cull.face",Xe="frontFace",He="lineWidth",qe="polygonOffset.enable",Ye="polygonOffset.offset",Ke="sample.alpha",Ze="sample.enable",$e="sample.coverage",Je="stencil.enable",Qe="stencil.mask",tn="stencil.func",en="stencil.opFront",nn="stencil.opBack",rn="scissor.enable",on="scissor.box",an="viewport",un="profile",sn="framebuffer",cn="vert",fn="frag",ln="elements",hn="primitive",dn="count",pn="offset",vn="instances",gn="vao",yn="Width",mn="Height",bn=sn+yn,_n=sn+mn,xn="drawingBufferWidth",wn="drawingBufferHeight",En=[Le,Ge,tn,en,nn,$e,an,on,Ye],Sn=34962,An=5126,Tn=35664,In=35665,Cn=35666,Dn=5124,Nn=35667,kn=35668,Rn=35669,On=35670,Mn=35671,Pn=35672,Gn=35673,Ln=35674,Un=35675,Fn=35676,Bn=35678,zn=35680,jn=1028,Wn=1029,Vn=2305,Xn=7680,Hn={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},qn=["constant color, constant alpha","one minus constant color, constant alpha","constant color, one minus constant alpha","one minus constant color, one minus constant alpha","constant alpha, constant color","constant alpha, one minus constant color","one minus constant alpha, constant color","one minus constant alpha, one minus constant color"],Yn={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Kn={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Zn={frag:35632,vert:35633},$n={cw:2304,ccw:Vn};function Jn(e){return Array.isArray(e)||t(e)||W(e)}function Qn(t){return t.sort((function(t,e){return t===an?-1:e===an?1:t<e?-1:1}))}function tr(t,e,n,r){this.thisDep=t,this.contextDep=e,this.propDep=n,this.append=r}function er(t){return t&&!(t.thisDep||t.contextDep||t.propDep)}function nr(t){return new tr(!1,!1,!1,t)}function rr(t,e){var n=t.type;if(0===n){var r=t.data.length;return new tr(!0,r>=1,r>=2,e)}if(4===n){var i=t.data;return new tr(i.thisDep,i.contextDep,i.propDep,e)}if(5===n)return new tr(!1,!1,!1,e);if(6===n){for(var o=!1,a=!1,u=!1,s=0;s<t.data.length;++s){var c=t.data[s];if(1===c.type)u=!0;else if(2===c.type)a=!0;else if(3===c.type)o=!0;else if(0===c.type){o=!0;var f=c.data;f>=1&&(a=!0),f>=2&&(u=!0)}else 4===c.type&&(o=o||c.data.thisDep,a=a||c.data.contextDep,u=u||c.data.propDep)}return new tr(o,a,u,e)}return new tr(3===n,2===n,1===n,e)}var ir=new tr(!1,!1,!1,(function(){}));function or(t,n,r,i,o,a,u,s,c,f,l,h,d,p,v){var g=f.Record,y={add:32774,subtract:32778,"reverse subtract":32779};r.ext_blend_minmax&&(y.min=32775,y.max=32776);var m=r.angle_instanced_arrays,b=r.webgl_draw_buffers,_={dirty:!0,profile:v.profile},x={},w=[],S={},A={};function T(t){return t.replace(".","_")}function I(t,e,n){var r=T(t);w.push(t),x[r]=_[r]=!!n,S[r]=e}function C(t,e,n){var r=T(t);w.push(t),Array.isArray(n)?(_[r]=n.slice(),x[r]=n.slice()):_[r]=x[r]=n,A[r]=e}I(Oe,3024),I(Me,3042),C(Pe,"blendColor",[0,0,0,0]),C(Ge,"blendEquationSeparate",[32774,32774]),C(Le,"blendFuncSeparate",[1,0,1,0]),I(Ue,2929,!0),C(Fe,"depthFunc",513),C(Be,"depthRange",[0,1]),C(ze,"depthMask",!0),C(je,je,[!0,!0,!0,!0]),I(We,2884),C(Ve,"cullFace",Wn),C(Xe,Xe,Vn),C(He,He,1),I(qe,32823),C(Ye,"polygonOffset",[0,0]),I(Ke,32926),I(Ze,32928),C($e,"sampleCoverage",[1,!1]),I(Je,2960),C(Qe,"stencilMask",-1),C(tn,"stencilFunc",[519,0,-1]),C(en,"stencilOpSeparate",[jn,Xn,Xn,Xn]),C(nn,"stencilOpSeparate",[Wn,Xn,Xn,Xn]),I(rn,3089),C(on,"scissor",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]),C(an,an,[0,0,t.drawingBufferWidth,t.drawingBufferHeight]);var N={gl:t,context:d,strings:n,next:x,current:_,draw:h,elements:a,buffer:o,shader:l,attributes:f.state,vao:f,uniforms:c,framebuffer:s,extensions:r,timer:p,isBufferArgs:Jn},k={primTypes:ot,compareFuncs:Yn,blendFuncs:Hn,blendEquations:y,stencilOps:Kn,glTypes:K,orientationType:$n};E.optional((function(){N.isArrayLike=dt})),b&&(k.backBuffer=[Wn],k.drawBuffer=P(i.maxDrawbuffers,(function(t){return 0===t?[0]:P(t,(function(t){return 36064+t}))})));var R=0;function O(){var t=function(){var t=0,n=[],r=[];function i(){var n=[],r=[];return e((function(){n.push.apply(n,Ne(arguments))}),{def:function(){var e="v"+t++;return r.push(e),arguments.length>0&&(n.push(e,"="),n.push.apply(n,Ne(arguments)),n.push(";")),e},toString:function(){return ke([r.length>0?"var "+r.join(",")+";":"",ke(n)])}})}function o(){var t=i(),n=i(),r=t.toString,o=n.toString;function a(e,r){n(e,r,"=",t.def(e,r),";")}return e((function(){t.apply(t,Ne(arguments))}),{def:t.def,entry:t,exit:n,save:a,set:function(e,n,r){a(e,n),t(e,n,"=",r,";")},toString:function(){return r()+o()}})}var a=i(),u={};return{global:a,link:function(e){for(var i=0;i<r.length;++i)if(r[i]===e)return n[i];var o="g"+t++;return n.push(o),r.push(e),o},block:i,proc:function(t,n){var r=[];function i(){var t="a"+r.length;return r.push(t),t}n=n||0;for(var a=0;a<n;++a)i();var s=o(),c=s.toString;return u[t]=e(s,{arg:i,toString:function(){return ke(["function(",r.join(),"){",c(),"}"])}})},scope:o,cond:function(){var t=ke(arguments),n=o(),r=o(),i=n.toString,a=r.toString;return e(n,{then:function(){return n.apply(n,Ne(arguments)),this},else:function(){return r.apply(r,Ne(arguments)),this},toString:function(){var e=a();return e&&(e="else{"+e+"}"),ke(["if(",t,"){",i(),"}",e])}})},compile:function(){var t=['"use strict";',a,"return {"];Object.keys(u).forEach((function(e){t.push('"',e,'":',u[e].toString(),",")})),t.push("}");var e=ke(t).replace(/;/g,";\n").replace(/}/g,"}\n").replace(/{/g,"{\n");return Function.apply(null,n.concat(e)).apply(null,r)}}}(),r=t.link,i=t.global;t.id=R++,t.batchId="0";var o=r(N),a=t.shared={props:"a0"};Object.keys(N).forEach((function(t){a[t]=i.def(o,".",t)})),E.optional((function(){t.CHECK=r(E),t.commandStr=E.guessCommand(),t.command=r(t.commandStr),t.assert=function(t,e,n){t("if(!(",e,"))",this.CHECK,".commandRaise(",r(n),",",this.command,");")},k.invalidBlendCombinations=qn}));var u=t.next={},s=t.current={};Object.keys(A).forEach((function(t){Array.isArray(_[t])&&(u[t]=i.def(a.next,".",t),s[t]=i.def(a.current,".",t))}));var c=t.constants={};Object.keys(k).forEach((function(t){c[t]=i.def(JSON.stringify(k[t]))})),t.invoke=function(e,n){switch(n.type){case 0:var i=["this",a.context,a.props,t.batchId];return e.def(r(n.data),".call(",i.slice(0,Math.max(n.data.length+1,4)),")");case 1:return e.def(a.props,n.data);case 2:return e.def(a.context,n.data);case 3:return e.def("this",n.data);case 4:return n.data.append(t,e),n.data.ref;case 5:return n.data.toString();case 6:return n.data.map((function(n){return t.invoke(e,n)}))}},t.attribCache={};var l={};return t.scopeAttrib=function(t){var e=n.id(t);if(e in l)return l[e];var i=f.scope[e];return i||(i=f.scope[e]=new g),l[e]=r(i)},t}function M(t,e,u,c,h){var d=t.static,p=t.dynamic;E.optional((function(){var t=[sn,cn,fn,ln,hn,pn,dn,vn,un,gn].concat(w);function e(e){Object.keys(e).forEach((function(e){E.command(t.indexOf(e)>=0,'unknown parameter "'+e+'"',h.commandStr)}))}e(d),e(p)}));var v=function(t,e){var n=t.static;if("string"==typeof n[fn]&&"string"==typeof n[cn]){if(Object.keys(e.dynamic).length>0)return null;var r=e.static,i=Object.keys(r);if(i.length>0&&"number"==typeof r[i[0]]){for(var o=[],a=0;a<i.length;++a)E("number"==typeof r[i[a]],"must specify all vertex attribute locations when using vaos"),o.push([0|r[i[a]],i[a]]);return o}}return null}(t,e),b=function(t,e){var n=t.static,r=t.dynamic;if(sn in n){var i=n[sn];return i?(i=s.getFramebuffer(i),E.command(i,"invalid framebuffer object"),nr((function(t,e){var n=t.link(i),r=t.shared;e.set(r.framebuffer,".next",n);var o=r.context;return e.set(o,"."+bn,n+".width"),e.set(o,"."+_n,n+".height"),n}))):nr((function(t,e){var n=t.shared;e.set(n.framebuffer,".next","null");var r=n.context;return e.set(r,"."+bn,r+"."+xn),e.set(r,"."+_n,r+"."+wn),"null"}))}if(sn in r){var o=r[sn];return rr(o,(function(t,e){var n=t.invoke(e,o),r=t.shared,i=r.framebuffer,a=e.def(i,".getFramebuffer(",n,")");E.optional((function(){t.assert(e,"!"+n+"||"+a,"invalid framebuffer object")})),e.set(i,".next",a);var u=r.context;return e.set(u,"."+bn,a+"?"+a+".width:"+u+"."+xn),e.set(u,"."+_n,a+"?"+a+".height:"+u+"."+wn),a}))}return null}(t),_=function(t,e,n){var r=t.static,i=t.dynamic;function o(t){if(t in r){var o=r[t];E.commandType(o,"object","invalid "+t,n.commandStr);var a,u,s=!0,c=0|o.x,f=0|o.y;return"width"in o?(a=0|o.width,E.command(a>=0,"invalid "+t,n.commandStr)):s=!1,"height"in o?(u=0|o.height,E.command(u>=0,"invalid "+t,n.commandStr)):s=!1,new tr(!s&&e&&e.thisDep,!s&&e&&e.contextDep,!s&&e&&e.propDep,(function(t,e){var n=t.shared.context,r=a;"width"in o||(r=e.def(n,".",bn,"-",c));var i=u;return"height"in o||(i=e.def(n,".",_n,"-",f)),[c,f,r,i]}))}if(t in i){var l=i[t],h=rr(l,(function(e,n){var r=e.invoke(n,l);E.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)}));var i=e.shared.context,o=n.def(r,".x|0"),a=n.def(r,".y|0"),u=n.def('"width" in ',r,"?",r,".width|0:","(",i,".",bn,"-",o,")"),s=n.def('"height" in ',r,"?",r,".height|0:","(",i,".",_n,"-",a,")");return E.optional((function(){e.assert(n,u+">=0&&"+s+">=0","invalid "+t)})),[o,a,u,s]}));return e&&(h.thisDep=h.thisDep||e.thisDep,h.contextDep=h.contextDep||e.contextDep,h.propDep=h.propDep||e.propDep),h}return e?new tr(e.thisDep,e.contextDep,e.propDep,(function(t,e){var n=t.shared.context;return[0,0,e.def(n,".",bn),e.def(n,".",_n)]})):null}var a=o(an);if(a){var u=a;a=new tr(a.thisDep,a.contextDep,a.propDep,(function(t,e){var n=u.append(t,e),r=t.shared.context;return e.set(r,".viewportWidth",n[2]),e.set(r,".viewportHeight",n[3]),n}))}return{viewport:a,scissor_box:o(on)}}(t,b,h),x=function(t,e){var n=t.static,r=t.dynamic,i=function(){if(ln in n){var t=n[ln];Jn(t)?t=a.getElements(a.create(t,!0)):t&&(t=a.getElements(t),E.command(t,"invalid elements",e.commandStr));var i=nr((function(e,n){if(t){var r=e.link(t);return e.ELEMENTS=r,r}return e.ELEMENTS=null,null}));return i.value=t,i}if(ln in r){var o=r[ln];return rr(o,(function(t,e){var n=t.shared,r=n.isBufferArgs,i=n.elements,a=t.invoke(e,o),u=e.def("null"),s=e.def(r,"(",a,")"),c=t.cond(s).then(u,"=",i,".createStream(",a,");").else(u,"=",i,".getElements(",a,");");return E.optional((function(){t.assert(c.else,"!"+a+"||"+u,"invalid elements")})),e.entry(c),e.exit(t.cond(s).then(i,".destroyStream(",u,");")),t.ELEMENTS=u,u}))}return null}();function o(t,o){if(t in n){var a=0|n[t];return E.command(!o||a>=0,"invalid "+t,e.commandStr),nr((function(t,e){return o&&(t.OFFSET=a),a}))}if(t in r){var u=r[t];return rr(u,(function(e,n){var r=e.invoke(n,u);return o&&(e.OFFSET=r,E.optional((function(){e.assert(n,r+">=0","invalid "+t)}))),r}))}return o&&i?nr((function(t,e){return t.OFFSET="0",0})):null}var u=o(pn,!0);return{elements:i,primitive:function(){if(hn in n){var t=n[hn];return E.commandParameter(t,ot,"invalid primitve",e.commandStr),nr((function(e,n){return ot[t]}))}if(hn in r){var o=r[hn];return rr(o,(function(t,e){var n=t.constants.primTypes,r=t.invoke(e,o);return E.optional((function(){t.assert(e,r+" in "+n,"invalid primitive, must be one of "+Object.keys(ot))})),e.def(n,"[",r,"]")}))}return i?er(i)?i.value?nr((function(t,e){return e.def(t.ELEMENTS,".primType")})):nr((function(){return 4})):new tr(i.thisDep,i.contextDep,i.propDep,(function(t,e){var n=t.ELEMENTS;return e.def(n,"?",n,".primType:",4)})):null}(),count:function(){if(dn in n){var t=0|n[dn];return E.command("number"==typeof t&&t>=0,"invalid vertex count",e.commandStr),nr((function(){return t}))}if(dn in r){var o=r[dn];return rr(o,(function(t,e){var n=t.invoke(e,o);return E.optional((function(){t.assert(e,"typeof "+n+'==="number"&&'+n+">=0&&"+n+"===("+n+"|0)","invalid vertex count")})),n}))}if(i){if(er(i)){if(i)return u?new tr(u.thisDep,u.contextDep,u.propDep,(function(t,e){var n=e.def(t.ELEMENTS,".vertCount-",t.OFFSET);return E.optional((function(){t.assert(e,n+">=0","invalid vertex offset/element buffer too small")})),n})):nr((function(t,e){return e.def(t.ELEMENTS,".vertCount")}));var a=nr((function(){return-1}));return E.optional((function(){a.MISSING=!0})),a}var s=new tr(i.thisDep||u.thisDep,i.contextDep||u.contextDep,i.propDep||u.propDep,(function(t,e){var n=t.ELEMENTS;return t.OFFSET?e.def(n,"?",n,".vertCount-",t.OFFSET,":-1"):e.def(n,"?",n,".vertCount:-1")}));return E.optional((function(){s.DYNAMIC=!0})),s}return null}(),instances:o(vn,!1),offset:u}}(t,h),S=function(t,e){var n=t.static,r=t.dynamic,o={};return w.forEach((function(t){var a=T(t);function u(e,i){if(t in n){var u=e(n[t]);o[a]=nr((function(){return u}))}else if(t in r){var s=r[t];o[a]=rr(s,(function(t,e){return i(t,e,t.invoke(e,s))}))}}switch(t){case We:case Me:case Oe:case Je:case Ue:case rn:case qe:case Ke:case Ze:case ze:return u((function(n){return E.commandType(n,"boolean",t,e.commandStr),n}),(function(e,n,r){return E.optional((function(){e.assert(n,"typeof "+r+'==="boolean"',"invalid flag "+t,e.commandStr)})),r}));case Fe:return u((function(n){return E.commandParameter(n,Yn,"invalid "+t,e.commandStr),Yn[n]}),(function(e,n,r){var i=e.constants.compareFuncs;return E.optional((function(){e.assert(n,r+" in "+i,"invalid "+t+", must be one of "+Object.keys(Yn))})),n.def(i,"[",r,"]")}));case Be:return u((function(t){return E.command(dt(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]&&t[0]<=t[1],"depth range is 2d array",e.commandStr),t}),(function(t,e,n){return E.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===2&&typeof "+n+'[0]==="number"&&typeof '+n+'[1]==="number"&&'+n+"[0]<="+n+"[1]","depth range must be a 2d array")})),[e.def("+",n,"[0]"),e.def("+",n,"[1]")]}));case Le:return u((function(t){E.commandType(t,"object","blend.func",e.commandStr);var n="srcRGB"in t?t.srcRGB:t.src,r="srcAlpha"in t?t.srcAlpha:t.src,i="dstRGB"in t?t.dstRGB:t.dst,o="dstAlpha"in t?t.dstAlpha:t.dst;return E.commandParameter(n,Hn,a+".srcRGB",e.commandStr),E.commandParameter(r,Hn,a+".srcAlpha",e.commandStr),E.commandParameter(i,Hn,a+".dstRGB",e.commandStr),E.commandParameter(o,Hn,a+".dstAlpha",e.commandStr),E.command(-1===qn.indexOf(n+", "+i),"unallowed blending combination (srcRGB, dstRGB) = ("+n+", "+i+")",e.commandStr),[Hn[n],Hn[i],Hn[r],Hn[o]]}),(function(e,n,r){var i=e.constants.blendFuncs;function o(o,a){var u=n.def('"',o,a,'" in ',r,"?",r,".",o,a,":",r,".",o);return E.optional((function(){e.assert(n,u+" in "+i,"invalid "+t+"."+o+a+", must be one of "+Object.keys(Hn))})),u}E.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid blend func, must be an object")}));var a=o("src","RGB"),u=o("dst","RGB");E.optional((function(){var t=e.constants.invalidBlendCombinations;e.assert(n,t+".indexOf("+a+'+", "+'+u+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")}));var s=n.def(i,"[",a,"]"),c=n.def(i,"[",o("src","Alpha"),"]");return[s,n.def(i,"[",u,"]"),c,n.def(i,"[",o("dst","Alpha"),"]")]}));case Ge:return u((function(n){return"string"==typeof n?(E.commandParameter(n,y,"invalid "+t,e.commandStr),[y[n],y[n]]):"object"==typeof n?(E.commandParameter(n.rgb,y,t+".rgb",e.commandStr),E.commandParameter(n.alpha,y,t+".alpha",e.commandStr),[y[n.rgb],y[n.alpha]]):void E.commandRaise("invalid blend.equation",e.commandStr)}),(function(e,n,r){var i=e.constants.blendEquations,o=n.def(),a=n.def(),u=e.cond("typeof ",r,'==="string"');return E.optional((function(){function n(t,n,r){e.assert(t,r+" in "+i,"invalid "+n+", must be one of "+Object.keys(y))}n(u.then,t,r),e.assert(u.else,r+"&&typeof "+r+'==="object"',"invalid "+t),n(u.else,t+".rgb",r+".rgb"),n(u.else,t+".alpha",r+".alpha")})),u.then(o,"=",a,"=",i,"[",r,"];"),u.else(o,"=",i,"[",r,".rgb];",a,"=",i,"[",r,".alpha];"),n(u),[o,a]}));case Pe:return u((function(t){return E.command(dt(t)&&4===t.length,"blend.color must be a 4d array",e.commandStr),P(4,(function(e){return+t[e]}))}),(function(t,e,n){return E.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===4","blend.color must be a 4d array")})),P(4,(function(t){return e.def("+",n,"[",t,"]")}))}));case Qe:return u((function(t){return E.commandType(t,"number",a,e.commandStr),0|t}),(function(t,e,n){return E.optional((function(){t.assert(e,"typeof "+n+'==="number"',"invalid stencil.mask")})),e.def(n,"|0")}));case tn:return u((function(n){E.commandType(n,"object",a,e.commandStr);var r=n.cmp||"keep",i=n.ref||0,o="mask"in n?n.mask:-1;return E.commandParameter(r,Yn,t+".cmp",e.commandStr),E.commandType(i,"number",t+".ref",e.commandStr),E.commandType(o,"number",t+".mask",e.commandStr),[Yn[r],i,o]}),(function(t,e,n){var r=t.constants.compareFuncs;return E.optional((function(){function i(){t.assert(e,Array.prototype.join.call(arguments,""),"invalid stencil.func")}i(n+"&&typeof ",n,'==="object"'),i('!("cmp" in ',n,")||(",n,".cmp in ",r,")")})),[e.def('"cmp" in ',n,"?",r,"[",n,".cmp]",":",Xn),e.def(n,".ref|0"),e.def('"mask" in ',n,"?",n,".mask|0:-1")]}));case en:case nn:return u((function(n){E.commandType(n,"object",a,e.commandStr);var r=n.fail||"keep",i=n.zfail||"keep",o=n.zpass||"keep";return E.commandParameter(r,Kn,t+".fail",e.commandStr),E.commandParameter(i,Kn,t+".zfail",e.commandStr),E.commandParameter(o,Kn,t+".zpass",e.commandStr),[t===nn?Wn:jn,Kn[r],Kn[i],Kn[o]]}),(function(e,n,r){var i=e.constants.stencilOps;function o(o){return E.optional((function(){e.assert(n,'!("'+o+'" in '+r+")||("+r+"."+o+" in "+i+")","invalid "+t+"."+o+", must be one of "+Object.keys(Kn))})),n.def('"',o,'" in ',r,"?",i,"[",r,".",o,"]:",Xn)}return E.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)})),[t===nn?Wn:jn,o("fail"),o("zfail"),o("zpass")]}));case Ye:return u((function(t){E.commandType(t,"object",a,e.commandStr);var n=0|t.factor,r=0|t.units;return E.commandType(n,"number",a+".factor",e.commandStr),E.commandType(r,"number",a+".units",e.commandStr),[n,r]}),(function(e,n,r){return E.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)})),[n.def(r,".factor|0"),n.def(r,".units|0")]}));case Ve:return u((function(t){var n=0;return"front"===t?n=jn:"back"===t&&(n=Wn),E.command(!!n,a,e.commandStr),n}),(function(t,e,n){return E.optional((function(){t.assert(e,n+'==="front"||'+n+'==="back"',"invalid cull.face")})),e.def(n,'==="front"?',jn,":",Wn)}));case He:return u((function(t){return E.command("number"==typeof t&&t>=i.lineWidthDims[0]&&t<=i.lineWidthDims[1],"invalid line width, must be a positive number between "+i.lineWidthDims[0]+" and "+i.lineWidthDims[1],e.commandStr),t}),(function(t,e,n){return E.optional((function(){t.assert(e,"typeof "+n+'==="number"&&'+n+">="+i.lineWidthDims[0]+"&&"+n+"<="+i.lineWidthDims[1],"invalid line width")})),n}));case Xe:return u((function(t){return E.commandParameter(t,$n,a,e.commandStr),$n[t]}),(function(t,e,n){return E.optional((function(){t.assert(e,n+'==="cw"||'+n+'==="ccw"',"invalid frontFace, must be one of cw,ccw")})),e.def(n+'==="cw"?2304:'+Vn)}));case je:return u((function(t){return E.command(dt(t)&&4===t.length,"color.mask must be length 4 array",e.commandStr),t.map((function(t){return!!t}))}),(function(t,e,n){return E.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===4","invalid color.mask")})),P(4,(function(t){return"!!"+n+"["+t+"]"}))}));case $e:return u((function(t){E.command("object"==typeof t&&t,a,e.commandStr);var n="value"in t?t.value:1,r=!!t.invert;return E.command("number"==typeof n&&n>=0&&n<=1,"sample.coverage.value must be a number between 0 and 1",e.commandStr),[n,r]}),(function(t,e,n){return E.optional((function(){t.assert(e,n+"&&typeof "+n+'==="object"',"invalid sample.coverage")})),[e.def('"value" in ',n,"?+",n,".value:1"),e.def("!!",n,".invert")]}))}})),o}(t,h),A=function(t,e,r){var i=t.static,o=t.dynamic;function a(t){if(t in i){var e=n.id(i[t]);E.optional((function(){l.shader(Zn[t],e,E.guessCommand())}));var r=nr((function(){return e}));return r.id=e,r}if(t in o){var a=o[t];return rr(a,(function(e,n){var r=e.invoke(n,a),i=n.def(e.shared.strings,".id(",r,")");return E.optional((function(){n(e.shared.shader,".shader(",Zn[t],",",i,",",e.command,");")})),i}))}return null}var u,s=a(fn),c=a(cn),f=null;return er(s)&&er(c)?(f=l.program(c.id,s.id,null,r),u=nr((function(t,e){return t.link(f)}))):u=new tr(s&&s.thisDep||c&&c.thisDep,s&&s.contextDep||c&&c.contextDep,s&&s.propDep||c&&c.propDep,(function(t,e){var n,r=t.shared.shader;n=s?s.append(t,e):e.def(r,".",fn);var i=r+".program("+(c?c.append(t,e):e.def(r,".",cn))+","+n;return E.optional((function(){i+=","+t.command})),e.def(i+")")})),{frag:s,vert:c,progVar:u,program:f}}(t,0,v);function I(t){var e=_[t];e&&(S[t]=e)}I(an),I(T(on));var C=Object.keys(S).length>0,D={framebuffer:b,draw:x,shader:A,state:S,dirty:C,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(D.profile=function(t){var e,n=t.static,r=t.dynamic;if(un in n){var i=!!n[un];(e=nr((function(t,e){return i}))).enable=i}else if(un in r){var o=r[un];e=rr(o,(function(t,e){return t.invoke(e,o)}))}return e}(t),D.uniforms=function(t,e){var n=t.static,r=t.dynamic,i={};return Object.keys(n).forEach((function(t){var r,o=n[t];if("number"==typeof o||"boolean"==typeof o)r=nr((function(){return o}));else if("function"==typeof o){var a=o._reglType;"texture2d"===a||"textureCube"===a?r=nr((function(t){return t.link(o)})):"framebuffer"===a||"framebufferCube"===a?(E.command(o.color.length>0,'missing color attachment for framebuffer sent to uniform "'+t+'"',e.commandStr),r=nr((function(t){return t.link(o.color[0])}))):E.commandRaise('invalid data for uniform "'+t+'"',e.commandStr)}else dt(o)?r=nr((function(e){return e.global.def("[",P(o.length,(function(n){return E.command("number"==typeof o[n]||"boolean"==typeof o[n],"invalid uniform "+t,e.commandStr),o[n]})),"]")})):E.commandRaise('invalid or missing data for uniform "'+t+'"',e.commandStr);r.value=o,i[t]=r})),Object.keys(r).forEach((function(t){var e=r[t];i[t]=rr(e,(function(t,n){return t.invoke(n,e)}))})),i}(u,h),D.drawVAO=D.scopeVAO=function(t,e){var n=t.static,r=t.dynamic;if(gn in n){var i=n[gn];return null!==i&&null===f.getVAO(i)&&(i=f.createVAO(i)),nr((function(t){return t.link(f.getVAO(i))}))}if(gn in r){var o=r[gn];return rr(o,(function(t,e){var n=t.invoke(e,o);return e.def(t.shared.vao+".getVAO("+n+")")}))}return null}(t),!D.drawVAO&&A.program&&!v&&r.angle_instanced_arrays){var N=!0,k=A.program.attributes.map((function(t){var n=e.static[t];return N=N&&!!n,n}));if(N&&k.length>0){var R=f.getVAO(f.createVAO(k));D.drawVAO=new tr(null,null,null,(function(t,e){return t.link(R)})),D.useVAO=!0}}return v?D.useVAO=!0:D.attributes=function(t,e){var r=t.static,i=t.dynamic,a={};return Object.keys(r).forEach((function(t){var i=r[t],u=n.id(t),s=new g;if(Jn(i))s.state=1,s.buffer=o.getBuffer(o.create(i,Sn,!1,!0)),s.type=0;else{var c=o.getBuffer(i);if(c)s.state=1,s.buffer=c,s.type=0;else if(E.command("object"==typeof i&&i,"invalid data for attribute "+t,e.commandStr),"constant"in i){var f=i.constant;s.buffer="null",s.state=2,"number"==typeof f?s.x=f:(E.command(dt(f)&&f.length>0&&f.length<=4,"invalid constant for attribute "+t,e.commandStr),Re.forEach((function(t,e){e<f.length&&(s[t]=f[e])})))}else{c=Jn(i.buffer)?o.getBuffer(o.create(i.buffer,Sn,!1,!0)):o.getBuffer(i.buffer),E.command(!!c,'missing buffer for attribute "'+t+'"',e.commandStr);var l=0|i.offset;E.command(l>=0,'invalid offset for attribute "'+t+'"',e.commandStr);var h=0|i.stride;E.command(h>=0&&h<256,'invalid stride for attribute "'+t+'", must be integer betweeen [0, 255]',e.commandStr);var d=0|i.size;E.command(!("size"in i)||d>0&&d<=4,'invalid size for attribute "'+t+'", must be 1,2,3,4',e.commandStr);var p=!!i.normalized,v=0;"type"in i&&(E.commandParameter(i.type,K,"invalid type for attribute "+t,e.commandStr),v=K[i.type]);var y=0|i.divisor;"divisor"in i&&(E.command(0===y||m,'cannot specify divisor for attribute "'+t+'", instancing not supported',e.commandStr),E.command(y>=0,'invalid divisor for attribute "'+t+'"',e.commandStr)),E.optional((function(){var n=e.commandStr,r=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(i).forEach((function(e){E.command(r.indexOf(e)>=0,'unknown parameter "'+e+'" for attribute pointer "'+t+'" (valid parameters are '+r+")",n)}))})),s.buffer=c,s.state=1,s.size=d,s.normalized=p,s.type=v||c.dtype,s.offset=l,s.stride=h,s.divisor=y}}a[t]=nr((function(t,e){var n=t.attribCache;if(u in n)return n[u];var r={isStream:!1};return Object.keys(s).forEach((function(t){r[t]=s[t]})),s.buffer&&(r.buffer=t.link(s.buffer),r.type=r.type||r.buffer+".dtype"),n[u]=r,r}))})),Object.keys(i).forEach((function(t){var e=i[t];a[t]=rr(e,(function(n,r){var i=n.invoke(r,e),o=n.shared,a=n.constants,u=o.isBufferArgs,s=o.buffer;E.optional((function(){n.assert(r,i+"&&(typeof "+i+'==="object"||typeof '+i+'==="function")&&('+u+"("+i+")||"+s+".getBuffer("+i+")||"+s+".getBuffer("+i+".buffer)||"+u+"("+i+'.buffer)||("constant" in '+i+"&&(typeof "+i+'.constant==="number"||'+o.isArrayLike+"("+i+".constant))))",'invalid dynamic attribute "'+t+'"')}));var c={isStream:r.def(!1)},f=new g;f.state=1,Object.keys(f).forEach((function(t){c[t]=r.def(""+f[t])}));var l=c.buffer,h=c.type;function d(t){r(c[t],"=",i,".",t,"|0;")}return r("if(",u,"(",i,")){",c.isStream,"=true;",l,"=",s,".createStream(",Sn,",",i,");",h,"=",l,".dtype;","}else{",l,"=",s,".getBuffer(",i,");","if(",l,"){",h,"=",l,".dtype;",'}else if("constant" in ',i,"){",c.state,"=",2,";","if(typeof "+i+'.constant === "number"){',c[Re[0]],"=",i,".constant;",Re.slice(1).map((function(t){return c[t]})).join("="),"=0;","}else{",Re.map((function(t,e){return c[t]+"="+i+".constant.length>"+e+"?"+i+".constant["+e+"]:0;"})).join(""),"}}else{","if(",u,"(",i,".buffer)){",l,"=",s,".createStream(",Sn,",",i,".buffer);","}else{",l,"=",s,".getBuffer(",i,".buffer);","}",h,'="type" in ',i,"?",a.glTypes,"[",i,".type]:",l,".dtype;",c.normalized,"=!!",i,".normalized;"),d("size"),d("offset"),d("stride"),d("divisor"),r("}}"),r.exit("if(",c.isStream,"){",s,".destroyStream(",l,");","}"),c}))})),a}(e,h),D.context=function(t){var e=t.static,n=t.dynamic,r={};return Object.keys(e).forEach((function(t){var n=e[t];r[t]=nr((function(t,e){return"number"==typeof n||"boolean"==typeof n?""+n:t.link(n)}))})),Object.keys(n).forEach((function(t){var e=n[t];r[t]=rr(e,(function(t,n){return t.invoke(n,e)}))})),r}(c),D}function G(t,e,n){var r=t.shared.context,i=t.scope();Object.keys(n).forEach((function(o){e.save(r,"."+o);var a=n[o].append(t,e);Array.isArray(a)?i(r,".",o,"=[",a.join(),"];"):i(r,".",o,"=",a,";")})),e(i)}function L(t,e,n,r){var i,o=t.shared,a=o.gl,u=o.framebuffer;b&&(i=e.def(o.extensions,".webgl_draw_buffers"));var s,c=t.constants,f=c.drawBuffer,l=c.backBuffer;s=n?n.append(t,e):e.def(u,".next"),r||e("if(",s,"!==",u,".cur){"),e("if(",s,"){",a,".bindFramebuffer(",36160,",",s,".framebuffer);"),b&&e(i,".drawBuffersWEBGL(",f,"[",s,".colorAttachments.length]);"),e("}else{",a,".bindFramebuffer(",36160,",null);"),b&&e(i,".drawBuffersWEBGL(",l,");"),e("}",u,".cur=",s,";"),r||e("}")}function U(t,e,n){var r=t.shared,i=r.gl,o=t.current,a=t.next,u=r.current,s=r.next,c=t.cond(u,".dirty");w.forEach((function(e){var r,f,l=T(e);if(!(l in n.state))if(l in a){r=a[l],f=o[l];var h=P(_[l].length,(function(t){return c.def(r,"[",t,"]")}));c(t.cond(h.map((function(t,e){return t+"!=="+f+"["+e+"]"})).join("||")).then(i,".",A[l],"(",h,");",h.map((function(t,e){return f+"["+e+"]="+t})).join(";"),";"))}else{r=c.def(s,".",l);var d=t.cond(r,"!==",u,".",l);c(d),l in S?d(t.cond(r).then(i,".enable(",S[l],");").else(i,".disable(",S[l],");"),u,".",l,"=",r,";"):d(i,".",A[l],"(",r,");",u,".",l,"=",r,";")}})),0===Object.keys(n.state).length&&c(u,".dirty=false;"),e(c)}function F(t,e,n,r){var i=t.shared,o=t.current,a=i.current,u=i.gl;Qn(Object.keys(n)).forEach((function(i){var s=n[i];if(!r||r(s)){var c=s.append(t,e);if(S[i]){var f=S[i];er(s)?e(u,c?".enable(":".disable(",f,");"):e(t.cond(c).then(u,".enable(",f,");").else(u,".disable(",f,");")),e(a,".",i,"=",c,";")}else if(dt(c)){var l=o[i];e(u,".",A[i],"(",c,");",c.map((function(t,e){return l+"["+e+"]="+t})).join(";"),";")}else e(u,".",A[i],"(",c,");",a,".",i,"=",c,";")}}))}function B(t,e){m&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function z(t,e,n,r,i){var o,a,u,s=t.shared,c=t.stats,f=s.current,l=s.timer,h=n.profile;function d(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function v(t){t(o=e.def(),"=",d(),";"),"string"==typeof i?t(c,".count+=",i,";"):t(c,".count++;"),p&&(r?t(a=e.def(),"=",l,".getNumPendingQueries();"):t(l,".beginQuery(",c,");"))}function g(t){t(c,".cpuTime+=",d(),"-",o,";"),p&&(r?t(l,".pushScopeStats(",a,",",l,".getNumPendingQueries(),",c,");"):t(l,".endQuery();"))}function y(t){var n=e.def(f,".profile");e(f,".profile=",t,";"),e.exit(f,".profile=",n,";")}if(h){if(er(h))return void(h.enable?(v(e),g(e.exit),y("true")):y("false"));y(u=h.append(t,e))}else u=e.def(f,".profile");var m=t.block();v(m),e("if(",u,"){",m,"}");var b=t.block();g(b),e.exit("if(",u,"){",b,"}")}function j(t,e,n,r,i){var o=t.shared;r.forEach((function(r){var a,u=r.name,s=n.attributes[u];if(s){if(!i(s))return;a=s.append(t,e)}else{if(!i(ir))return;var c=t.scopeAttrib(u);E.optional((function(){t.assert(e,c+".state","missing attribute "+u)})),a={},Object.keys(new g).forEach((function(t){a[t]=e.def(c,".",t)}))}!function(n,r,i){var a=o.gl,u=e.def(n,".location"),s=e.def(o.attributes,"[",u,"]"),c=i.state,f=i.buffer,l=[i.x,i.y,i.z,i.w],h=["buffer","normalized","offset","stride"];function d(){e("if(!",s,".buffer){",a,".enableVertexAttribArray(",u,");}");var n,o=i.type;if(n=i.size?e.def(i.size,"||",r):r,e("if(",s,".type!==",o,"||",s,".size!==",n,"||",h.map((function(t){return s+"."+t+"!=="+i[t]})).join("||"),"){",a,".bindBuffer(",Sn,",",f,".buffer);",a,".vertexAttribPointer(",[u,n,o,i.normalized,i.stride,i.offset],");",s,".type=",o,";",s,".size=",n,";",h.map((function(t){return s+"."+t+"="+i[t]+";"})).join(""),"}"),m){var c=i.divisor;e("if(",s,".divisor!==",c,"){",t.instancing,".vertexAttribDivisorANGLE(",[u,c],");",s,".divisor=",c,";}")}}function p(){e("if(",s,".buffer){",a,".disableVertexAttribArray(",u,");",s,".buffer=null;","}if(",Re.map((function(t,e){return s+"."+t+"!=="+l[e]})).join("||"),"){",a,".vertexAttrib4f(",u,",",l,");",Re.map((function(t,e){return s+"."+t+"="+l[e]+";"})).join(""),"}")}1===c?d():2===c?p():(e("if(",c,"===",1,"){"),d(),e("}else{"),p(),e("}"))}(t.link(r),function(t){switch(t){case Tn:case Nn:case Mn:return 2;case In:case kn:case Pn:return 3;case Cn:case Rn:case Gn:return 4;default:return 1}}(r.info.type),a)}))}function W(t,e,r,i,o){for(var a,u=t.shared,s=u.gl,c=0;c<i.length;++c){var f,l=i[c],h=l.name,d=l.info.type,p=r.uniforms[h],v=t.link(l)+".location";if(p){if(!o(p))continue;if(er(p)){var g=p.value;if(E.command(null!=g,'missing uniform "'+h+'"',t.commandStr),d===Bn||d===zn){E.command("function"==typeof g&&(d===Bn&&("texture2d"===g._reglType||"framebuffer"===g._reglType)||d===zn&&("textureCube"===g._reglType||"framebufferCube"===g._reglType)),"invalid texture for uniform "+h,t.commandStr);var y=t.link(g._texture||g.color[0]._texture);e(s,".uniform1i(",v,",",y+".bind());"),e.exit(y,".unbind();")}else if(d===Ln||d===Un||d===Fn){E.optional((function(){E.command(dt(g),"invalid matrix for uniform "+h,t.commandStr),E.command(d===Ln&&4===g.length||d===Un&&9===g.length||d===Fn&&16===g.length,"invalid length for matrix uniform "+h,t.commandStr)}));var m=t.global.def("new Float32Array(["+Array.prototype.slice.call(g)+"])"),b=2;d===Un?b=3:d===Fn&&(b=4),e(s,".uniformMatrix",b,"fv(",v,",false,",m,");")}else{switch(d){case An:E.commandType(g,"number","uniform "+h,t.commandStr),a="1f";break;case Tn:E.command(dt(g)&&2===g.length,"uniform "+h,t.commandStr),a="2f";break;case In:E.command(dt(g)&&3===g.length,"uniform "+h,t.commandStr),a="3f";break;case Cn:E.command(dt(g)&&4===g.length,"uniform "+h,t.commandStr),a="4f";break;case On:E.commandType(g,"boolean","uniform "+h,t.commandStr),a="1i";break;case Dn:E.commandType(g,"number","uniform "+h,t.commandStr),a="1i";break;case Mn:case Nn:E.command(dt(g)&&2===g.length,"uniform "+h,t.commandStr),a="2i";break;case Pn:case kn:E.command(dt(g)&&3===g.length,"uniform "+h,t.commandStr),a="3i";break;case Gn:case Rn:E.command(dt(g)&&4===g.length,"uniform "+h,t.commandStr),a="4i"}e(s,".uniform",a,"(",v,",",dt(g)?Array.prototype.slice.call(g):g,");")}continue}f=p.append(t,e)}else{if(!o(ir))continue;f=e.def(u.uniforms,"[",n.id(h),"]")}d===Bn?(E(!Array.isArray(f),"must specify a scalar prop for textures"),e("if(",f,"&&",f,'._reglType==="framebuffer"){',f,"=",f,".color[0];","}")):d===zn&&(E(!Array.isArray(f),"must specify a scalar prop for cube maps"),e("if(",f,"&&",f,'._reglType==="framebufferCube"){',f,"=",f,".color[0];","}")),E.optional((function(){function n(n,r){t.assert(e,n,'bad data or missing for uniform "'+h+'". '+r)}function r(t){E(!Array.isArray(f),"must not specify an array type for uniform"),n("typeof "+f+'==="'+t+'"',"invalid type, expected "+t)}function i(e,r){Array.isArray(f)?E(f.length===e,"must have length "+e):n(u.isArrayLike+"("+f+")&&"+f+".length==="+e,"invalid vector, should have length "+e,t.commandStr)}function o(e){E(!Array.isArray(f),"must not specify a value type"),n("typeof "+f+'==="function"&&'+f+'._reglType==="texture'+(3553===e?"2d":"Cube")+'"',"invalid texture type",t.commandStr)}switch(d){case Dn:case An:r("number");break;case Nn:case Tn:case Mn:i(2);break;case kn:case In:case Pn:i(3);break;case Rn:case Cn:case Ln:case Gn:i(4);break;case On:r("boolean");break;case Un:i(9);break;case Fn:i(16);break;case Bn:o(3553);break;case zn:o(34067)}}));var _=1;switch(d){case Bn:case zn:var x=e.def(f,"._texture");e(s,".uniform1i(",v,",",x,".bind());"),e.exit(x,".unbind();");continue;case Dn:case On:a="1i";break;case Nn:case Mn:a="2i",_=2;break;case kn:case Pn:a="3i",_=3;break;case Rn:case Gn:a="4i",_=4;break;case An:a="1f";break;case Tn:a="2f",_=2;break;case In:a="3f",_=3;break;case Cn:a="4f",_=4;break;case Ln:a="Matrix2fv";break;case Un:a="Matrix3fv";break;case Fn:a="Matrix4fv"}if(e(s,".uniform",a,"(",v,","),"M"===a.charAt(0)){var w=Math.pow(d-Ln+2,2),S=t.global.def("new Float32Array(",w,")");Array.isArray(f)?e("false,(",P(w,(function(t){return S+"["+t+"]="+f[t]})),",",S,")"):e("false,(Array.isArray(",f,")||",f," instanceof Float32Array)?",f,":(",P(w,(function(t){return S+"["+t+"]="+f+"["+t+"]"})),",",S,")")}else _>1?e(P(_,(function(t){return Array.isArray(f)?f[t]:f+"["+t+"]"}))):(E(!Array.isArray(f),"uniform value must not be an array"),e(f));e(");")}}function V(t,e,n,r){var i=t.shared,o=i.gl,a=i.draw,u=r.draw;var s=function(){var i,s=u.elements,c=e;return s?((s.contextDep&&r.contextDynamic||s.propDep)&&(c=n),i=s.append(t,c)):i=c.def(a,".",ln),i&&c("if("+i+")"+o+".bindBuffer(34963,"+i+".buffer.buffer);"),i}();function c(i){var o=u[i];return o?o.contextDep&&r.contextDynamic||o.propDep?o.append(t,n):o.append(t,e):e.def(a,".",i)}var f,l,h=c(hn),d=c(pn),p=function(){var i,o=u.count,s=e;return o?((o.contextDep&&r.contextDynamic||o.propDep)&&(s=n),i=o.append(t,s),E.optional((function(){o.MISSING&&t.assert(e,"false","missing vertex count"),o.DYNAMIC&&t.assert(s,i+">=0","missing vertex count")}))):(i=s.def(a,".",dn),E.optional((function(){t.assert(s,i+">=0","missing vertex count")}))),i}();if("number"==typeof p){if(0===p)return}else n("if(",p,"){"),n.exit("}");m&&(f=c(vn),l=t.instancing);var v=s+".type",g=u.elements&&er(u.elements);function y(){function t(){n(l,".drawElementsInstancedANGLE(",[h,p,v,d+"<<(("+v+"-5121)>>1)",f],");")}function e(){n(l,".drawArraysInstancedANGLE(",[h,d,p,f],");")}s?g?t():(n("if(",s,"){"),t(),n("}else{"),e(),n("}")):e()}function b(){function t(){n(o+".drawElements("+[h,p,v,d+"<<(("+v+"-5121)>>1)"]+");")}function e(){n(o+".drawArrays("+[h,d,p]+");")}s?g?t():(n("if(",s,"){"),t(),n("}else{"),e(),n("}")):e()}m&&("number"!=typeof f||f>=0)?"string"==typeof f?(n("if(",f,">0){"),y(),n("}else if(",f,"<0){"),b(),n("}")):y():b()}function X(t,e,n,r,i){var o=O(),a=o.proc("body",i);return E.optional((function(){o.commandStr=e.commandStr,o.command=o.link(e.commandStr)})),m&&(o.instancing=a.def(o.shared.extensions,".angle_instanced_arrays")),t(o,a,n,r),o.compile().body}function H(t,e,n,r){B(t,e),n.useVAO?n.drawVAO?e(t.shared.vao,".setVAO(",n.drawVAO.append(t,e),");"):e(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(e(t.shared.vao,".setVAO(null);"),j(t,e,n,r.attributes,(function(){return!0}))),W(t,e,n,r.uniforms,(function(){return!0})),V(t,e,e,n)}function q(t,e,n,r){function i(){return!0}t.batchId="a1",B(t,e),j(t,e,n,r.attributes,i),W(t,e,n,r.uniforms,i),V(t,e,e,n)}function Y(t,e,n,r){B(t,e);var i=n.contextDep,o=e.def(),a=e.def();t.shared.props=a,t.batchId=o;var u=t.scope(),s=t.scope();function c(t){return t.contextDep&&i||t.propDep}function f(t){return!c(t)}if(e(u.entry,"for(",o,"=0;",o,"<","a1",";++",o,"){",a,"=","a0","[",o,"];",s,"}",u.exit),n.needsContext&&G(t,s,n.context),n.needsFramebuffer&&L(t,s,n.framebuffer),F(t,s,n.state,c),n.profile&&c(n.profile)&&z(t,s,n,!1,!0),r)n.useVAO?n.drawVAO?c(n.drawVAO)?s(t.shared.vao,".setVAO(",n.drawVAO.append(t,s),");"):u(t.shared.vao,".setVAO(",n.drawVAO.append(t,u),");"):u(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(u(t.shared.vao,".setVAO(null);"),j(t,u,n,r.attributes,f),j(t,s,n,r.attributes,c)),W(t,u,n,r.uniforms,f),W(t,s,n,r.uniforms,c),V(t,u,s,n);else{var l=t.global.def("{}"),h=n.shader.progVar.append(t,s),d=s.def(h,".id"),p=s.def(l,"[",d,"]");s(t.shared.gl,".useProgram(",h,".program);","if(!",p,"){",p,"=",l,"[",d,"]=",t.link((function(e){return X(q,t,n,e,2)})),"(",h,");}",p,".call(this,a0[",o,"],",o,");")}}function Z(t,e,n){var r=e.static[n];if(r&&function(t){if("object"==typeof t&&!dt(t)){for(var e=Object.keys(t),n=0;n<e.length;++n)if(D.isDynamic(t[e[n]]))return!0;return!1}}(r)){var i=t.global,o=Object.keys(r),a=!1,u=!1,s=!1,c=t.global.def("{}");o.forEach((function(e){var n=r[e];if(D.isDynamic(n)){"function"==typeof n&&(n=r[e]=D.unbox(n));var o=rr(n,null);a=a||o.thisDep,s=s||o.propDep,u=u||o.contextDep}else{switch(i(c,".",e,"="),typeof n){case"number":i(n);break;case"string":i('"',n,'"');break;case"object":Array.isArray(n)&&i("[",n.join(),"]");break;default:i(t.link(n))}i(";")}})),e.dynamic[n]=new D.DynamicVariable(4,{thisDep:a,contextDep:u,propDep:s,ref:c,append:function(t,e){o.forEach((function(n){var i=r[n];if(D.isDynamic(i)){var o=t.invoke(e,i);e(c,".",n,"=",o,";")}}))}}),delete e.static[n]}}return{next:x,current:_,procs:function(){var t=O(),e=t.proc("poll"),n=t.proc("refresh"),o=t.block();e(o),n(o);var a,u=t.shared,s=u.gl,c=u.next,f=u.current;o(f,".dirty=false;"),L(t,e),L(t,n,null,!0),m&&(a=t.link(m)),r.oes_vertex_array_object&&n(t.link(r.oes_vertex_array_object),".bindVertexArrayOES(null);");for(var l=0;l<i.maxAttributes;++l){var h=n.def(u.attributes,"[",l,"]"),d=t.cond(h,".buffer");d.then(s,".enableVertexAttribArray(",l,");",s,".bindBuffer(",Sn,",",h,".buffer.buffer);",s,".vertexAttribPointer(",l,",",h,".size,",h,".type,",h,".normalized,",h,".stride,",h,".offset);").else(s,".disableVertexAttribArray(",l,");",s,".vertexAttrib4f(",l,",",h,".x,",h,".y,",h,".z,",h,".w);",h,".buffer=null;"),n(d),m&&n(a,".vertexAttribDivisorANGLE(",l,",",h,".divisor);")}return n(t.shared.vao,".currentVAO=null;",t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"),Object.keys(S).forEach((function(r){var i=S[r],a=o.def(c,".",r),u=t.block();u("if(",a,"){",s,".enable(",i,")}else{",s,".disable(",i,")}",f,".",r,"=",a,";"),n(u),e("if(",a,"!==",f,".",r,"){",u,"}")})),Object.keys(A).forEach((function(r){var i,a,u=A[r],l=_[r],h=t.block();if(h(s,".",u,"("),dt(l)){var d=l.length;i=t.global.def(c,".",r),a=t.global.def(f,".",r),h(P(d,(function(t){return i+"["+t+"]"})),");",P(d,(function(t){return a+"["+t+"]="+i+"["+t+"];"})).join("")),e("if(",P(d,(function(t){return i+"["+t+"]!=="+a+"["+t+"]"})).join("||"),"){",h,"}")}else i=o.def(c,".",r),a=o.def(f,".",r),h(i,");",f,".",r,"=",i,";"),e("if(",i,"!==",a,"){",h,"}");n(h)})),t.compile()}(),compile:function(t,r,i,o,a){var u=O();u.stats=u.link(a),Object.keys(r.static).forEach((function(t){Z(u,r,t)})),En.forEach((function(e){Z(u,t,e)}));var s=M(t,r,i,o,u);return function(t,e){var n=t.proc("draw",1);B(t,n),G(t,n,e.context),L(t,n,e.framebuffer),U(t,n,e),F(t,n,e.state),z(t,n,e,!1,!0);var r=e.shader.progVar.append(t,n);if(n(t.shared.gl,".useProgram(",r,".program);"),e.shader.program)H(t,n,e,e.shader.program);else{n(t.shared.vao,".setVAO(null);");var i=t.global.def("{}"),o=n.def(r,".id"),a=n.def(i,"[",o,"]");n(t.cond(a).then(a,".call(this,a0);").else(a,"=",i,"[",o,"]=",t.link((function(n){return X(H,t,e,n,1)})),"(",r,");",a,".call(this,a0);"))}Object.keys(e.state).length>0&&n(t.shared.current,".dirty=true;")}(u,s),function(t,e){var r=t.proc("scope",3);t.batchId="a2";var i=t.shared,o=i.current;function a(n){var o=e.shader[n];o&&r.set(i.shader,"."+n,o.append(t,r))}G(t,r,e.context),e.framebuffer&&e.framebuffer.append(t,r),Qn(Object.keys(e.state)).forEach((function(n){var o=e.state[n].append(t,r);dt(o)?o.forEach((function(e,i){r.set(t.next[n],"["+i+"]",e)})):r.set(i.next,"."+n,o)})),z(t,r,e,!0,!0),[ln,pn,dn,vn,hn].forEach((function(n){var o=e.draw[n];o&&r.set(i.draw,"."+n,""+o.append(t,r))})),Object.keys(e.uniforms).forEach((function(o){var a=e.uniforms[o].append(t,r);Array.isArray(a)&&(a="["+a.join()+"]"),r.set(i.uniforms,"["+n.id(o)+"]",a)})),Object.keys(e.attributes).forEach((function(n){var i=e.attributes[n].append(t,r),o=t.scopeAttrib(n);Object.keys(new g).forEach((function(t){r.set(o,"."+t,i[t])}))})),e.scopeVAO&&r.set(i.vao,".targetVAO",e.scopeVAO.append(t,r)),a(cn),a(fn),Object.keys(e.state).length>0&&(r(o,".dirty=true;"),r.exit(o,".dirty=true;")),r("a1(",t.shared.context,",a0,",t.batchId,");")}(u,s),function(t,e){var n=t.proc("batch",2);t.batchId="0",B(t,n);var r=!1,i=!0;Object.keys(e.context).forEach((function(t){r=r||e.context[t].propDep})),r||(G(t,n,e.context),i=!1);var o=e.framebuffer,a=!1;function u(t){return t.contextDep&&r||t.propDep}o?(o.propDep?r=a=!0:o.contextDep&&r&&(a=!0),a||L(t,n,o)):L(t,n,null),e.state.viewport&&e.state.viewport.propDep&&(r=!0),U(t,n,e),F(t,n,e.state,(function(t){return!u(t)})),e.profile&&u(e.profile)||z(t,n,e,!1,"a1"),e.contextDep=r,e.needsContext=i,e.needsFramebuffer=a;var s=e.shader.progVar;if(s.contextDep&&r||s.propDep)Y(t,n,e,null);else{var c=s.append(t,n);if(n(t.shared.gl,".useProgram(",c,".program);"),e.shader.program)Y(t,n,e,e.shader.program);else{n(t.shared.vao,".setVAO(null);");var f=t.global.def("{}"),l=n.def(c,".id"),h=n.def(f,"[",l,"]");n(t.cond(h).then(h,".call(this,a0,a1);").else(h,"=",f,"[",l,"]=",t.link((function(n){return X(Y,t,e,n,2)})),"(",c,");",h,".call(this,a0,a1);"))}}Object.keys(e.state).length>0&&n(t.shared.current,".dirty=true;")}(u,s),e(u.compile(),{destroy:function(){s.shader.program.destroy()}})}}}var ar=function(t,e){if(!e.ext_disjoint_timer_query)return null;var n=[];function r(t){n.push(t)}var i=[];function o(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var a=[];function u(t){a.push(t)}var s=[];function c(t,e,n){var r=a.pop()||new o;r.startQueryIndex=t,r.endQueryIndex=e,r.sum=0,r.stats=n,s.push(r)}var f=[],l=[];return{beginQuery:function(t){var r=n.pop()||e.ext_disjoint_timer_query.createQueryEXT();e.ext_disjoint_timer_query.beginQueryEXT(35007,r),i.push(r),c(i.length-1,i.length,t)},endQuery:function(){e.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:c,update:function(){var t,n,o=i.length;if(0!==o){l.length=Math.max(l.length,o+1),f.length=Math.max(f.length,o+1),f[0]=0,l[0]=0;var a=0;for(t=0,n=0;n<i.length;++n){var c=i[n];e.ext_disjoint_timer_query.getQueryObjectEXT(c,34919)?(a+=e.ext_disjoint_timer_query.getQueryObjectEXT(c,34918),r(c)):i[t++]=c,f[n+1]=a,l[n+1]=t}for(i.length=t,t=0,n=0;n<s.length;++n){var h=s[n],d=h.startQueryIndex,p=h.endQueryIndex;h.sum+=f[p]-f[d];var v=l[d],g=l[p];g===v?(h.stats.gpuTime+=h.sum/1e6,u(h)):(h.startQueryIndex=v,h.endQueryIndex=g,s[t++]=h)}s.length=t}},getNumPendingQueries:function(){return i.length},clear:function(){n.push.apply(n,i);for(var t=0;t<n.length;t++)e.ext_disjoint_timer_query.deleteQueryEXT(n[t]);i.length=0,n.length=0},restore:function(){i.length=0,n.length=0}}},ur="webglcontextlost",sr="webglcontextrestored";function cr(t,e){for(var n=0;n<t.length;++n)if(t[n]===e)return n;return-1}return function(n){var r=M(n);if(!r)return null;var i=r.gl,o=i.getContextAttributes(),a=i.isContextLost(),u=function(t,e){var n={};function r(e){E.type(e,"string","extension name must be string");var r,i=e.toLowerCase();try{r=n[i]=t.getExtension(i)}catch(t){}return!!r}for(var i=0;i<e.extensions.length;++i){var o=e.extensions[i];if(!r(o))return e.onDestroy(),e.onDone('"'+o+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return e.optionalExtensions.forEach(r),{extensions:n,restore:function(){Object.keys(n).forEach((function(t){if(n[t]&&!r(t))throw new Error("(regl): error restoring extension "+t)}))}}}(i,r);if(!u)return null;var s,c,f=(s={"":0},c=[""],{id:function(t){var e=s[t];return e||(e=s[t]=c.length,c.push(t),e)},str:function(t){return c[t]}}),l={vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0},h=u.extensions,d=ar(0,h),p=k(),v=i.drawingBufferWidth,g=i.drawingBufferHeight,y={tick:0,time:0,viewportWidth:v,viewportHeight:g,framebufferWidth:v,framebufferHeight:g,drawingBufferWidth:v,drawingBufferHeight:g,pixelRatio:r.pixelRatio},m=function(t,e){var n=1;e.ext_texture_filter_anisotropic&&(n=t.getParameter(34047));var r=1,i=1;e.webgl_draw_buffers&&(r=t.getParameter(34852),i=t.getParameter(36063));var o=!!e.oes_texture_float;if(o){var a=t.createTexture();t.bindTexture(F,a),t.texImage2D(F,0,B,1,1,0,B,z,null);var u=t.createFramebuffer();if(t.bindFramebuffer(j,u),t.framebufferTexture2D(j,36064,F,a,0),t.bindTexture(F,null),36053!==t.checkFramebufferStatus(j))o=!1;else{t.viewport(0,0,1,1),t.clearColor(1,0,0,1),t.clear(16384);var s=U.allocType(z,4);t.readPixels(0,0,1,1,B,z,s),t.getError()?o=!1:(t.deleteFramebuffer(u),t.deleteTexture(a),o=1===s[0]),U.freeType(s)}}var c=!0;if("undefined"==typeof navigator||!(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent))){var f=t.createTexture(),l=U.allocType(5121,36);t.activeTexture(33984),t.bindTexture(34067,f),t.texImage2D(34069,0,B,3,3,0,B,5121,l),U.freeType(l),t.bindTexture(34067,null),t.deleteTexture(f),c=!t.getError()}return{colorBits:[t.getParameter(3410),t.getParameter(3411),t.getParameter(3412),t.getParameter(3413)],depthBits:t.getParameter(3414),stencilBits:t.getParameter(3415),subpixelBits:t.getParameter(3408),extensions:Object.keys(e).filter((function(t){return!!e[t]})),maxAnisotropic:n,maxDrawbuffers:r,maxColorAttachments:i,pointSizeDims:t.getParameter(33901),lineWidthDims:t.getParameter(33902),maxViewportDims:t.getParameter(3386),maxCombinedTextureUnits:t.getParameter(35661),maxCubeMapSize:t.getParameter(34076),maxRenderbufferSize:t.getParameter(34024),maxTextureUnits:t.getParameter(34930),maxTextureSize:t.getParameter(3379),maxAttributes:t.getParameter(34921),maxVertexUniforms:t.getParameter(36347),maxVertexTextureUnits:t.getParameter(35660),maxVaryingVectors:t.getParameter(36348),maxFragmentUniforms:t.getParameter(36349),glsl:t.getParameter(35724),renderer:t.getParameter(7937),vendor:t.getParameter(7936),version:t.getParameter(7938),readFloat:o,npotTextureCube:c}}(i,h),b=function(e,n,r,i){var o=0,a={};function u(t){this.id=o++,this.buffer=e.createBuffer(),this.type=t,this.usage=35044,this.byteLength=0,this.dimension=1,this.dtype=Q,this.persistentData=null,r.profile&&(this.stats={size:0})}u.prototype.bind=function(){e.bindBuffer(this.type,this.buffer)},u.prototype.destroy=function(){l(this)};var s=[];function c(t,n,r){t.byteLength=n.byteLength,e.bufferData(t.type,n,r)}function f(e,n,r,i,o,a){var u,s;if(e.usage=r,Array.isArray(n)){if(e.dtype=i||tt,n.length>0)if(Array.isArray(n[0])){u=J(n);for(var f=1,l=1;l<u.length;++l)f*=u[l];e.dimension=f,c(e,s=$(n,u,e.dtype),r),a?e.persistentData=s:U.freeType(s)}else if("number"==typeof n[0]){e.dimension=o;var h=U.allocType(e.dtype,n.length);rt(h,n),c(e,h,r),a?e.persistentData=h:U.freeType(h)}else t(n[0])?(e.dimension=n[0].length,e.dtype=i||nt(n[0])||tt,c(e,s=$(n,[n.length,n[0].length],e.dtype),r),a?e.persistentData=s:U.freeType(s)):E.raise("invalid buffer data")}else if(t(n))e.dtype=i||nt(n),e.dimension=o,c(e,n,r),a&&(e.persistentData=new Uint8Array(new Uint8Array(n.buffer)));else if(W(n)){u=n.shape;var d=n.stride,p=n.offset,v=0,g=0,y=0,m=0;1===u.length?(v=u[0],g=1,y=d[0],m=0):2===u.length?(v=u[0],g=u[1],y=d[0],m=d[1]):E.raise("invalid shape"),e.dtype=i||nt(n.data)||tt,e.dimension=g;var b=U.allocType(e.dtype,v*g);it(b,n.data,v,g,y,m,p),c(e,b,r),a?e.persistentData=b:U.freeType(b)}else n instanceof ArrayBuffer?(e.dtype=Q,e.dimension=o,c(e,n,r),a&&(e.persistentData=new Uint8Array(new Uint8Array(n)))):E.raise("invalid buffer data")}function l(t){n.bufferCount--,i(t);var r=t.buffer;E(r,"buffer must not be deleted already"),e.deleteBuffer(r),t.buffer=null,delete a[t.id]}return r.profile&&(n.getTotalBufferSize=function(){var t=0;return Object.keys(a).forEach((function(e){t+=a[e].stats.size})),t}),{create:function(i,o,s,c){n.bufferCount++;var h=new u(o);function d(n){var i=35044,o=null,a=0,u=0,s=1;return Array.isArray(n)||t(n)||W(n)||n instanceof ArrayBuffer?o=n:"number"==typeof n?a=0|n:n&&(E.type(n,"object","buffer arguments must be an object, a number or an array"),"data"in n&&(E(null===o||Array.isArray(o)||t(o)||W(o),"invalid data for buffer"),o=n.data),"usage"in n&&(E.parameter(n.usage,Z,"invalid buffer usage"),i=Z[n.usage]),"type"in n&&(E.parameter(n.type,K,"invalid buffer type"),u=K[n.type]),"dimension"in n&&(E.type(n.dimension,"number","invalid dimension"),s=0|n.dimension),"length"in n&&(E.nni(a,"buffer length must be a nonnegative integer"),a=0|n.length)),h.bind(),o?f(h,o,i,u,s,c):(a&&e.bufferData(h.type,a,i),h.dtype=u||Q,h.usage=i,h.dimension=s,h.byteLength=a),r.profile&&(h.stats.size=h.byteLength*et[h.dtype]),d}function p(t,n){E(n+t.byteLength<=h.byteLength,"invalid buffer subdata call, buffer is too small. Can't write data of size "+t.byteLength+" starting from offset "+n+" to a buffer of size "+h.byteLength),e.bufferSubData(h.type,n,t)}return a[h.id]=h,s||d(i),d._reglType="buffer",d._buffer=h,d.subdata=function(e,n){var r,i=0|(n||0);if(h.bind(),t(e)||e instanceof ArrayBuffer)p(e,i);else if(Array.isArray(e)){if(e.length>0)if("number"==typeof e[0]){var o=U.allocType(h.dtype,e.length);rt(o,e),p(o,i),U.freeType(o)}else if(Array.isArray(e[0])||t(e[0])){r=J(e);var a=$(e,r,h.dtype);p(a,i),U.freeType(a)}else E.raise("invalid buffer data")}else if(W(e)){r=e.shape;var u=e.stride,s=0,c=0,f=0,l=0;1===r.length?(s=r[0],c=1,f=u[0],l=0):2===r.length?(s=r[0],c=r[1],f=u[0],l=u[1]):E.raise("invalid shape");var v=Array.isArray(e.data)?h.dtype:nt(e.data),g=U.allocType(v,s*c);it(g,e.data,s,c,f,l,e.offset),p(g,i),U.freeType(g)}else E.raise("invalid data for buffer subdata");return d},r.profile&&(d.stats=h.stats),d.destroy=function(){l(h)},d},createStream:function(t,e){var n=s.pop();return n||(n=new u(t)),n.bind(),f(n,e,35040,0,1,!1),n},destroyStream:function(t){s.push(t)},clear:function(){V(a).forEach(l),s.forEach(l)},getBuffer:function(t){return t&&t._buffer instanceof u?t._buffer:null},restore:function(){V(a).forEach((function(t){t.buffer=e.createBuffer(),e.bindBuffer(t.type,t.buffer),e.bufferData(t.type,t.persistentData||t.byteLength,t.usage)}))},_initBuffer:f}}(i,l,r,(function(t){return _.destroyBuffer(t)})),_=function(e,n,r,i,o){for(var a=r.maxAttributes,u=new Array(a),s=0;s<a;++s)u[s]=new Te;var c=0,f={},l={Record:Te,scope:{},state:u,currentVAO:null,targetVAO:null,restore:h()?function(){h()&&V(f).forEach((function(t){t.refresh()}))}:function(){},createVAO:function(e){var r=new p;function u(e){E(Array.isArray(e),"arguments to vertex array constructor must be an array"),E(e.length<a,"too many attributes"),E(e.length>0,"must specify at least one attribute");var i={},s=r.attributes;s.length=e.length;for(var c=0;c<e.length;++c){var f,l=e[c],h=s[c]=new Te,d=l.data||l;Array.isArray(d)||t(d)||W(d)?(r.buffers[c]&&(f=r.buffers[c],t(d)&&f._buffer.byteLength>=d.byteLength?f.subdata(d):(f.destroy(),r.buffers[c]=null)),r.buffers[c]||(f=r.buffers[c]=o.create(l,34962,!1,!0)),h.buffer=o.getBuffer(f),h.size=0|h.buffer.dimension,h.normalized=!1,h.type=h.buffer.dtype,h.offset=0,h.stride=0,h.divisor=0,h.state=1,i[c]=1):o.getBuffer(l)?(h.buffer=o.getBuffer(l),h.size=0|h.buffer.dimension,h.normalized=!1,h.type=h.buffer.dtype,h.offset=0,h.stride=0,h.divisor=0,h.state=1):o.getBuffer(l.buffer)?(h.buffer=o.getBuffer(l.buffer),h.size=0|(+l.size||h.buffer.dimension),h.normalized=!!l.normalized||!1,"type"in l?(E.parameter(l.type,K,"invalid buffer type"),h.type=K[l.type]):h.type=h.buffer.dtype,h.offset=0|(l.offset||0),h.stride=0|(l.stride||0),h.divisor=0|(l.divisor||0),h.state=1,E(h.size>=1&&h.size<=4,"size must be between 1 and 4"),E(h.offset>=0,"invalid offset"),E(h.stride>=0&&h.stride<=255,"stride must be between 0 and 255"),E(h.divisor>=0,"divisor must be positive"),E(!h.divisor||!!n.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in l?(E(c>0,"first attribute must not be a constant"),h.x=+l.x||0,h.y=+l.y||0,h.z=+l.z||0,h.w=+l.w||0,h.state=2):E(!1,"invalid attribute spec for location "+c)}for(var p=0;p<r.buffers.length;++p)!i[p]&&r.buffers[p]&&(r.buffers[p].destroy(),r.buffers[p]=null);return r.refresh(),u}return i.vaoCount+=1,u.destroy=function(){for(var t=0;t<r.buffers.length;++t)r.buffers[t]&&r.buffers[t].destroy();r.buffers.length=0,r.destroy()},u._vao=r,u._reglType="vao",u(e)},getVAO:function(t){return"function"==typeof t&&t._vao?t._vao:null},destroyBuffer:function(t){for(var n=0;n<u.length;++n){var r=u[n];r.buffer===t&&(e.disableVertexAttribArray(n),r.buffer=null)}},setVAO:h()?function(t){if(t!==l.currentVAO){var e=h();t?e.bindVertexArrayOES(t.vao):e.bindVertexArrayOES(null),l.currentVAO=t}}:function(t){if(t!==l.currentVAO){if(t)t.bindAttrs();else for(var n=d(),r=0;r<u.length;++r){var i=u[r];i.buffer?(e.enableVertexAttribArray(r),e.vertexAttribPointer(r,i.size,i.type,i.normalized,i.stride,i.offfset),n&&i.divisor&&n.vertexAttribDivisorANGLE(r,i.divisor)):(e.disableVertexAttribArray(r),e.vertexAttrib4f(r,i.x,i.y,i.z,i.w))}l.currentVAO=t}},clear:h()?function(){V(f).forEach((function(t){t.destroy()}))}:function(){}};function h(){return n.oes_vertex_array_object}function d(){return n.angle_instanced_arrays}function p(){this.id=++c,this.attributes=[];var t=h();this.vao=t?t.createVertexArrayOES():null,f[this.id]=this,this.buffers=[]}return p.prototype.bindAttrs=function(){for(var t=d(),n=this.attributes,r=0;r<n.length;++r){var i=n[r];i.buffer?(e.enableVertexAttribArray(r),e.bindBuffer(34962,i.buffer.buffer),e.vertexAttribPointer(r,i.size,i.type,i.normalized,i.stride,i.offset),t&&i.divisor&&t.vertexAttribDivisorANGLE(r,i.divisor)):(e.disableVertexAttribArray(r),e.vertexAttrib4f(r,i.x,i.y,i.z,i.w))}for(var o=n.length;o<a;++o)e.disableVertexAttribArray(o)},p.prototype.refresh=function(){var t=h();t&&(t.bindVertexArrayOES(this.vao),this.bindAttrs(),l.currentVAO=this)},p.prototype.destroy=function(){if(this.vao){var t=h();this===l.currentVAO&&(l.currentVAO=null,t.bindVertexArrayOES(null)),t.deleteVertexArrayOES(this.vao),this.vao=null}f[this.id]&&(delete f[this.id],i.vaoCount-=1)},l}(i,h,m,l,b),x=function(e,n,r,i){var o={},a=0,u={uint8:at,uint16:ut};function s(t){this.id=a++,o[this.id]=this,this.buffer=t,this.primType=4,this.vertCount=0,this.type=0}n.oes_element_index_uint&&(u.uint32=st),s.prototype.bind=function(){this.buffer.bind()};var c=[];function f(i,o,a,u,s,c,f){var l;if(i.buffer.bind(),o){var h=f;f||t(o)&&(!W(o)||t(o.data))||(h=n.oes_element_index_uint?st:ut),r._initBuffer(i.buffer,o,a,h,3)}else e.bufferData(ct,c,a),i.buffer.dtype=l||at,i.buffer.usage=a,i.buffer.dimension=3,i.buffer.byteLength=c;if(l=f,!f){switch(i.buffer.dtype){case at:case 5120:l=at;break;case ut:case 5122:l=ut;break;case st:case 5124:l=st;break;default:E.raise("unsupported type for element array")}i.buffer.dtype=l}i.type=l,E(l!==st||!!n.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var d=s;d<0&&(d=i.buffer.byteLength,l===ut?d>>=1:l===st&&(d>>=2)),i.vertCount=d;var p=u;if(u<0){p=4;var v=i.buffer.dimension;1===v&&(p=0),2===v&&(p=1),3===v&&(p=4)}i.primType=p}function l(t){i.elementsCount--,E(null!==t.buffer,"must not double destroy elements"),delete o[t.id],t.buffer.destroy(),t.buffer=null}return{create:function(e,n){var o=r.create(null,ct,!0),a=new s(o._buffer);function c(e){if(e)if("number"==typeof e)o(e),a.primType=4,a.vertCount=0|e,a.type=at;else{var n=null,r=35044,i=-1,s=-1,l=0,h=0;Array.isArray(e)||t(e)||W(e)?n=e:(E.type(e,"object","invalid arguments for elements"),"data"in e&&(n=e.data,E(Array.isArray(n)||t(n)||W(n),"invalid data for element buffer")),"usage"in e&&(E.parameter(e.usage,Z,"invalid element buffer usage"),r=Z[e.usage]),"primitive"in e&&(E.parameter(e.primitive,ot,"invalid element buffer primitive"),i=ot[e.primitive]),"count"in e&&(E("number"==typeof e.count&&e.count>=0,"invalid vertex count for elements"),s=0|e.count),"type"in e&&(E.parameter(e.type,u,"invalid buffer type"),h=u[e.type]),"length"in e?l=0|e.length:(l=s,h===ut||5122===h?l*=2:h!==st&&5124!==h||(l*=4))),f(a,n,r,i,s,l,h)}else o(),a.primType=4,a.vertCount=0,a.type=at;return c}return i.elementsCount++,c(e),c._reglType="elements",c._elements=a,c.subdata=function(t,e){return o.subdata(t,e),c},c.destroy=function(){l(a)},c},createStream:function(t){var e=c.pop();return e||(e=new s(r.create(null,ct,!0,!1)._buffer)),f(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){c.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof s?t._elements:null},clear:function(){V(o).forEach(l)}}}(i,h,b,l),w=function(t,n,r,i){var o={},a={};function u(t,e,n,r){this.name=t,this.id=e,this.location=n,this.info=r}function s(t,e){for(var n=0;n<t.length;++n)if(t[n].id===e.id)return void(t[n].location=e.location);t.push(e)}function c(e,r,i){var u=35632===e?o:a,s=u[r];if(!s){var c=n.str(r);s=t.createShader(e),t.shaderSource(s,c),t.compileShader(s),E.shaderError(t,s,c,e,i),u[r]=s}return s}var f={},l=[],h=0;function d(t,e){this.id=h++,this.fragId=t,this.vertId=e,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,i.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function p(e,r,o){var a,f,l=c(35632,e.fragId),h=c(35633,e.vertId),d=e.program=t.createProgram();if(t.attachShader(d,l),t.attachShader(d,h),o)for(a=0;a<o.length;++a){var p=o[a];t.bindAttribLocation(d,p[0],p[1])}t.linkProgram(d),E.linkError(t,d,n.str(e.fragId),n.str(e.vertId),r);var v=t.getProgramParameter(d,35718);i.profile&&(e.stats.uniformsCount=v);var g=e.uniforms;for(a=0;a<v;++a)if(f=t.getActiveUniform(d,a))if(f.size>1)for(var y=0;y<f.size;++y){var m=f.name.replace("[0]","["+y+"]");s(g,new u(m,n.id(m),t.getUniformLocation(d,m),f))}else s(g,new u(f.name,n.id(f.name),t.getUniformLocation(d,f.name),f));var b=t.getProgramParameter(d,35721);i.profile&&(e.stats.attributesCount=b);var _=e.attributes;for(a=0;a<b;++a)(f=t.getActiveAttrib(d,a))&&s(_,new u(f.name,n.id(f.name),t.getAttribLocation(d,f.name),f))}return i.profile&&(r.getMaxUniformsCount=function(){var t=0;return l.forEach((function(e){e.stats.uniformsCount>t&&(t=e.stats.uniformsCount)})),t},r.getMaxAttributesCount=function(){var t=0;return l.forEach((function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)})),t}),{clear:function(){var e=t.deleteShader.bind(t);V(o).forEach(e),o={},V(a).forEach(e),a={},l.forEach((function(e){t.deleteProgram(e.program)})),l.length=0,f={},r.shaderCount=0},program:function(n,i,u,s){E.command(n>=0,"missing vertex shader",u),E.command(i>=0,"missing fragment shader",u);var c=f[i];c||(c=f[i]={});var h=c[n];if(h&&(h.refCount++,!s))return h;var v=new d(i,n);return r.shaderCount++,p(v,u,s),h||(c[n]=v),l.push(v),e(v,{destroy:function(){if(v.refCount--,v.refCount<=0){t.deleteProgram(v.program);var e=l.indexOf(v);l.splice(e,1),r.shaderCount--}c[v.vertId].refCount<=0&&(t.deleteShader(a[v.vertId]),delete a[v.vertId],delete f[v.fragId][v.vertId]),Object.keys(f[v.fragId]).length||(t.deleteShader(o[v.fragId]),delete o[v.fragId],delete f[v.fragId])}})},restore:function(){o={},a={};for(var t=0;t<l.length;++t)p(l[t],null,l[t].attributes.map((function(t){return[t.location,t.name]})))},shader:c,frag:-1,vert:-1}}(i,f,l,r),S=he(i,h,m,(function(){I.procs.poll()}),y,l,r),A=function(t,e,n,r,i){var o={rgba4:pe,rgb565:36194,"rgb5 a1":32855,depth:33189,stencil:36168,"depth stencil":34041};e.ext_srgb&&(o.srgba=35907),e.ext_color_buffer_half_float&&(o.rgba16f=34842,o.rgb16f=34843),e.webgl_color_buffer_float&&(o.rgba32f=34836);var a=[];Object.keys(o).forEach((function(t){var e=o[t];a[e]=t}));var u=0,s={};function c(t){this.id=u++,this.refCount=1,this.renderbuffer=t,this.format=pe,this.width=0,this.height=0,i.profile&&(this.stats={size:0})}function f(e){var n=e.renderbuffer;E(n,"must not double destroy renderbuffer"),t.bindRenderbuffer(de,null),t.deleteRenderbuffer(n),e.renderbuffer=null,e.refCount=0,delete s[e.id],r.renderbufferCount--}return c.prototype.decRef=function(){--this.refCount<=0&&f(this)},i.profile&&(r.getTotalRenderbufferSize=function(){var t=0;return Object.keys(s).forEach((function(e){t+=s[e].stats.size})),t}),{create:function(e,u){var f=new c(t.createRenderbuffer());function l(e,r){var u=0,s=0,c=pe;if("object"==typeof e&&e){var h=e;if("shape"in h){var d=h.shape;E(Array.isArray(d)&&d.length>=2,"invalid renderbuffer shape"),u=0|d[0],s=0|d[1]}else"radius"in h&&(u=s=0|h.radius),"width"in h&&(u=0|h.width),"height"in h&&(s=0|h.height);"format"in h&&(E.parameter(h.format,o,"invalid renderbuffer format"),c=o[h.format])}else"number"==typeof e?(u=0|e,s="number"==typeof r?0|r:u):e?E.raise("invalid arguments to renderbuffer constructor"):u=s=1;if(E(u>0&&s>0&&u<=n.maxRenderbufferSize&&s<=n.maxRenderbufferSize,"invalid renderbuffer size"),u!==f.width||s!==f.height||c!==f.format)return l.width=f.width=u,l.height=f.height=s,f.format=c,t.bindRenderbuffer(de,f.renderbuffer),t.renderbufferStorage(de,c,u,s),E(0===t.getError(),"invalid render buffer format"),i.profile&&(f.stats.size=ge(f.format,f.width,f.height)),l.format=a[f.format],l}return s[f.id]=f,r.renderbufferCount++,l(e,u),l.resize=function(e,r){var o=0|e,a=0|r||o;return o===f.width&&a===f.height||(E(o>0&&a>0&&o<=n.maxRenderbufferSize&&a<=n.maxRenderbufferSize,"invalid renderbuffer size"),l.width=f.width=o,l.height=f.height=a,t.bindRenderbuffer(de,f.renderbuffer),t.renderbufferStorage(de,f.format,o,a),E(0===t.getError(),"invalid render buffer format"),i.profile&&(f.stats.size=ge(f.format,f.width,f.height))),l},l._reglType="renderbuffer",l._renderbuffer=f,i.profile&&(l.stats=f.stats),l.destroy=function(){f.decRef()},l},clear:function(){V(s).forEach(f)},restore:function(){V(s).forEach((function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(de,e.renderbuffer),t.renderbufferStorage(de,e.format,e.width,e.height)})),t.bindRenderbuffer(de,null)}}}(i,h,m,l,r),T=function(t,n,r,i,o,a){var u={cur:null,next:null,dirty:!1,setFBO:null},s=["rgba"],c=["rgba4","rgb565","rgb5 a1"];n.ext_srgb&&c.push("srgba"),n.ext_color_buffer_half_float&&c.push("rgba16f","rgb16f"),n.webgl_color_buffer_float&&c.push("rgba32f");var f=["uint8"];function l(t,e,n){this.target=t,this.texture=e,this.renderbuffer=n;var r=0,i=0;e?(r=e.width,i=e.height):n&&(r=n.width,i=n.height),this.width=r,this.height=i}function h(t){t&&(t.texture&&t.texture._texture.decRef(),t.renderbuffer&&t.renderbuffer._renderbuffer.decRef())}function d(t,e,n){if(t)if(t.texture){var r=t.texture._texture,i=Math.max(1,r.width),o=Math.max(1,r.height);E(i===e&&o===n,"inconsistent width/height for supplied texture"),r.refCount+=1}else{var a=t.renderbuffer._renderbuffer;E(a.width===e&&a.height===n,"inconsistent width/height for renderbuffer"),a.refCount+=1}}function p(e,n){n&&(n.texture?t.framebufferTexture2D(ye,e,n.target,n.texture._texture.texture,0):t.framebufferRenderbuffer(ye,e,me,n.renderbuffer._renderbuffer.renderbuffer))}function v(t){var e=be,n=null,r=null,i=t;"object"==typeof t&&(i=t.data,"target"in t&&(e=0|t.target)),E.type(i,"function","invalid attachment data");var o=i._reglType;return"texture2d"===o?(n=i,E(e===be)):"textureCube"===o?(n=i,E(e>=_e&&e<34075,"invalid cube map target")):"renderbuffer"===o?(r=i,e=me):E.raise("invalid regl object for attachment"),new l(e,n,r)}function g(t,e,n,r,a){if(n){var u=i.create2D({width:t,height:e,format:r,type:a});return u._texture.refCount=0,new l(be,u,null)}var s=o.create({width:t,height:e,format:r});return s._renderbuffer.refCount=0,new l(me,null,s)}function y(t){return t&&(t.texture||t.renderbuffer)}function m(t,e,n){t&&(t.texture?t.texture.resize(e,n):t.renderbuffer&&t.renderbuffer.resize(e,n),t.width=e,t.height=n)}n.oes_texture_half_float&&f.push("half float","float16"),n.oes_texture_float&&f.push("float","float32");var b=0,_={};function x(){this.id=b++,_[this.id]=this,this.framebuffer=t.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function w(t){t.colorAttachments.forEach(h),h(t.depthAttachment),h(t.stencilAttachment),h(t.depthStencilAttachment)}function S(e){var n=e.framebuffer;E(n,"must not double destroy framebuffer"),t.deleteFramebuffer(n),e.framebuffer=null,a.framebufferCount--,delete _[e.id]}function A(e){var n;t.bindFramebuffer(ye,e.framebuffer);var i=e.colorAttachments;for(n=0;n<i.length;++n)p(36064+n,i[n]);for(n=i.length;n<r.maxColorAttachments;++n)t.framebufferTexture2D(ye,36064+n,be,null,0);t.framebufferTexture2D(ye,33306,be,null,0),t.framebufferTexture2D(ye,36096,be,null,0),t.framebufferTexture2D(ye,36128,be,null,0),p(36096,e.depthAttachment),p(36128,e.stencilAttachment),p(33306,e.depthStencilAttachment);var o=t.checkFramebufferStatus(ye);t.isContextLost()||36053===o||E.raise("framebuffer configuration not supported, status = "+Ae[o]),t.bindFramebuffer(ye,u.next?u.next.framebuffer:null),u.cur=u.next,t.getError()}function T(t,i){var o=new x;function l(t,e){var i;E(u.next!==o,"can not update framebuffer which is currently in use");var a=0,h=0,p=!0,m=!0,b=null,_=!0,x="rgba",S="uint8",T=1,I=null,C=null,D=null,N=!1;if("number"==typeof t)a=0|t,h=0|e||a;else if(t){E.type(t,"object","invalid arguments for framebuffer");var k=t;if("shape"in k){var R=k.shape;E(Array.isArray(R)&&R.length>=2,"invalid shape for framebuffer"),a=R[0],h=R[1]}else"radius"in k&&(a=h=k.radius),"width"in k&&(a=k.width),"height"in k&&(h=k.height);("color"in k||"colors"in k)&&(b=k.color||k.colors,Array.isArray(b)&&E(1===b.length||n.webgl_draw_buffers,"multiple render targets not supported")),b||("colorCount"in k&&(T=0|k.colorCount,E(T>0,"invalid color buffer count")),"colorTexture"in k&&(_=!!k.colorTexture,x="rgba4"),"colorType"in k&&(S=k.colorType,_?(E(n.oes_texture_float||!("float"===S||"float32"===S),"you must enable OES_texture_float in order to use floating point framebuffer objects"),E(n.oes_texture_half_float||!("half float"===S||"float16"===S),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):"half float"===S||"float16"===S?(E(n.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),x="rgba16f"):"float"!==S&&"float32"!==S||(E(n.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),x="rgba32f"),E.oneOf(S,f,"invalid color type")),"colorFormat"in k&&(x=k.colorFormat,s.indexOf(x)>=0?_=!0:c.indexOf(x)>=0?_=!1:_?E.oneOf(k.colorFormat,s,"invalid color format for texture"):E.oneOf(k.colorFormat,c,"invalid color format for renderbuffer"))),("depthTexture"in k||"depthStencilTexture"in k)&&(N=!(!k.depthTexture&&!k.depthStencilTexture),E(!N||n.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in k&&("boolean"==typeof k.depth?p=k.depth:(I=k.depth,m=!1)),"stencil"in k&&("boolean"==typeof k.stencil?m=k.stencil:(C=k.stencil,p=!1)),"depthStencil"in k&&("boolean"==typeof k.depthStencil?p=m=k.depthStencil:(D=k.depthStencil,p=!1,m=!1))}else a=h=1;var O=null,M=null,P=null,G=null;if(Array.isArray(b))O=b.map(v);else if(b)O=[v(b)];else for(O=new Array(T),i=0;i<T;++i)O[i]=g(a,h,_,x,S);E(n.webgl_draw_buffers||O.length<=1,"you must enable the WEBGL_draw_buffers extension in order to use multiple color buffers."),E(O.length<=r.maxColorAttachments,"too many color attachments, not supported"),a=a||O[0].width,h=h||O[0].height,I?M=v(I):p&&!m&&(M=g(a,h,N,"depth","uint32")),C?P=v(C):m&&!p&&(P=g(a,h,!1,"stencil","uint8")),D?G=v(D):!I&&!C&&m&&p&&(G=g(a,h,N,"depth stencil","depth stencil")),E(!!I+!!C+!!D<=1,"invalid framebuffer configuration, can specify exactly one depth/stencil attachment");var L=null;for(i=0;i<O.length;++i)if(d(O[i],a,h),E(!O[i]||O[i].texture&&xe.indexOf(O[i].texture._texture.format)>=0||O[i].renderbuffer&&Se.indexOf(O[i].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+i+" is invalid"),O[i]&&O[i].texture){var U=we[O[i].texture._texture.format]*Ee[O[i].texture._texture.type];null===L?L=U:E(L===U,"all color attachments much have the same number of bits per pixel.")}return d(M,a,h),E(!M||M.texture&&6402===M.texture._texture.format||M.renderbuffer&&33189===M.renderbuffer._renderbuffer.format,"invalid depth attachment for framebuffer object"),d(P,a,h),E(!P||P.renderbuffer&&36168===P.renderbuffer._renderbuffer.format,"invalid stencil attachment for framebuffer object"),d(G,a,h),E(!G||G.texture&&34041===G.texture._texture.format||G.renderbuffer&&34041===G.renderbuffer._renderbuffer.format,"invalid depth-stencil attachment for framebuffer object"),w(o),o.width=a,o.height=h,o.colorAttachments=O,o.depthAttachment=M,o.stencilAttachment=P,o.depthStencilAttachment=G,l.color=O.map(y),l.depth=y(M),l.stencil=y(P),l.depthStencil=y(G),l.width=o.width,l.height=o.height,A(o),l}return a.framebufferCount++,l(t,i),e(l,{resize:function(t,e){E(u.next!==o,"can not resize a framebuffer which is currently in use");var n=Math.max(0|t,1),r=Math.max(0|e||n,1);if(n===o.width&&r===o.height)return l;for(var i=o.colorAttachments,a=0;a<i.length;++a)m(i[a],n,r);return m(o.depthAttachment,n,r),m(o.stencilAttachment,n,r),m(o.depthStencilAttachment,n,r),o.width=l.width=n,o.height=l.height=r,A(o),l},_reglType:"framebuffer",_framebuffer:o,destroy:function(){S(o),w(o)},use:function(t){u.setFBO({framebuffer:l},t)}})}return e(u,{getFramebuffer:function(t){if("function"==typeof t&&"framebuffer"===t._reglType){var e=t._framebuffer;if(e instanceof x)return e}return null},create:T,createCube:function(t){var o=Array(6);function a(t){var r;E(o.indexOf(u.next)<0,"can not update framebuffer which is currently in use");var c,l={color:null},h=0,d=null,p="rgba",v="uint8",g=1;if("number"==typeof t)h=0|t;else if(t){E.type(t,"object","invalid arguments for framebuffer");var y=t;if("shape"in y){var m=y.shape;E(Array.isArray(m)&&m.length>=2,"invalid shape for framebuffer"),E(m[0]===m[1],"cube framebuffer must be square"),h=m[0]}else"radius"in y&&(h=0|y.radius),"width"in y?(h=0|y.width,"height"in y&&E(y.height===h,"must be square")):"height"in y&&(h=0|y.height);("color"in y||"colors"in y)&&(d=y.color||y.colors,Array.isArray(d)&&E(1===d.length||n.webgl_draw_buffers,"multiple render targets not supported")),d||("colorCount"in y&&(g=0|y.colorCount,E(g>0,"invalid color buffer count")),"colorType"in y&&(E.oneOf(y.colorType,f,"invalid color type"),v=y.colorType),"colorFormat"in y&&(p=y.colorFormat,E.oneOf(y.colorFormat,s,"invalid color format for texture"))),"depth"in y&&(l.depth=y.depth),"stencil"in y&&(l.stencil=y.stencil),"depthStencil"in y&&(l.depthStencil=y.depthStencil)}else h=1;if(d)if(Array.isArray(d))for(c=[],r=0;r<d.length;++r)c[r]=d[r];else c=[d];else{c=Array(g);var b={radius:h,format:p,type:v};for(r=0;r<g;++r)c[r]=i.createCube(b)}for(l.color=Array(c.length),r=0;r<c.length;++r){var _=c[r];E("function"==typeof _&&"textureCube"===_._reglType,"invalid cube map"),h=h||_.width,E(_.width===h&&_.height===h,"invalid cube map shape"),l.color[r]={target:_e,data:c[r]}}for(r=0;r<6;++r){for(var x=0;x<c.length;++x)l.color[x].target=_e+r;r>0&&(l.depth=o[0].depth,l.stencil=o[0].stencil,l.depthStencil=o[0].depthStencil),o[r]?o[r](l):o[r]=T(l)}return e(a,{width:h,height:h,color:c})}return a(t),e(a,{faces:o,resize:function(t){var e,n=0|t;if(E(n>0&&n<=r.maxCubeMapSize,"invalid radius for cube fbo"),n===a.width)return a;var i=a.color;for(e=0;e<i.length;++e)i[e].resize(n);for(e=0;e<6;++e)o[e].resize(n);return a.width=a.height=n,a},_reglType:"framebufferCube",destroy:function(){o.forEach((function(t){t.destroy()}))}})},clear:function(){V(_).forEach(S)},restore:function(){u.cur=null,u.next=null,u.dirty=!0,V(_).forEach((function(e){e.framebuffer=t.createFramebuffer(),A(e)}))}})}(i,h,m,S,A,l),I=or(i,f,h,m,b,x,0,T,{},_,w,{elements:null,primitive:4,count:-1,offset:0,instances:-1},y,d,r),C=De(i,T,I.procs.poll,y,o,h,m),R=I.next,O=i.canvas,P=[],G=[],L=[],X=[r.onDestroy],H=null;function q(){if(0===P.length)return d&&d.update(),void(H=null);H=N.next(q),mt();for(var t=P.length-1;t>=0;--t){var e=P[t];e&&e(y,null,0)}i.flush(),d&&d.update()}function Y(){!H&&P.length>0&&(H=N.next(q))}function ft(){H&&(N.cancel(q),H=null)}function lt(t){t.preventDefault(),a=!0,ft(),G.forEach((function(t){t()}))}function ht(t){i.getError(),a=!1,u.restore(),w.restore(),b.restore(),S.restore(),A.restore(),T.restore(),_.restore(),d&&d.restore(),I.procs.refresh(),Y(),L.forEach((function(t){t()}))}function dt(t){function n(t,e){var n={},r={};return Object.keys(t).forEach((function(i){var o=t[i];if(D.isDynamic(o))r[i]=D.unbox(o,i);else{if(e&&Array.isArray(o))for(var a=0;a<o.length;++a)if(D.isDynamic(o[a]))return void(r[i]=D.unbox(o,i));n[i]=o}})),{dynamic:r,static:n}}E(!!t,"invalid args to regl({...})"),E.type(t,"object","invalid args to regl({...})");var r=n(t.context||{},!0),i=n(t.uniforms||{},!0),o=n(t.attributes||{},!1),u=n(function(t){var n=e({},t);function r(t){if(t in n){var e=n[t];delete n[t],Object.keys(e).forEach((function(r){n[t+"."+r]=e[r]}))}}return delete n.uniforms,delete n.attributes,delete n.context,delete n.vao,"stencil"in n&&n.stencil.op&&(n.stencil.opBack=n.stencil.opFront=n.stencil.op,delete n.stencil.op),r("blend"),r("depth"),r("cull"),r("stencil"),r("polygonOffset"),r("scissor"),r("sample"),"vao"in t&&(n.vao=t.vao),n}(t),!1),s={gpuTime:0,cpuTime:0,count:0},c=I.compile(u,o,i,r,s),f=c.draw,l=c.batch,h=c.scope,d=[];return e((function(t,e){var n;if(a&&E.raise("context lost"),"function"==typeof t)return h.call(this,null,t,0);if("function"==typeof e)if("number"==typeof t)for(n=0;n<t;++n)h.call(this,null,e,n);else{if(!Array.isArray(t))return h.call(this,t,e,0);for(n=0;n<t.length;++n)h.call(this,t[n],e,n)}else if("number"==typeof t){if(t>0)return l.call(this,function(t){for(;d.length<t;)d.push(null);return d}(0|t),0|t)}else{if(!Array.isArray(t))return f.call(this,t);if(t.length)return l.call(this,t,t.length)}}),{stats:s,destroy:function(){c.destroy()}})}O&&(O.addEventListener(ur,lt,!1),O.addEventListener(sr,ht,!1));var pt=T.setFBO=dt({framebuffer:D.define.call(null,1,"framebuffer")});function vt(t,e){var n=0;I.procs.poll();var r=e.color;r&&(i.clearColor(+r[0]||0,+r[1]||0,+r[2]||0,+r[3]||0),n|=16384),"depth"in e&&(i.clearDepth(+e.depth),n|=256),"stencil"in e&&(i.clearStencil(0|e.stencil),n|=1024),E(!!n,"called regl.clear with no buffer specified"),i.clear(n)}function gt(t){return E.type(t,"function","regl.frame() callback must be a function"),P.push(t),Y(),{cancel:function(){var e=cr(P,t);E(e>=0,"cannot cancel a frame twice"),P[e]=function t(){var e=cr(P,t);P[e]=P[P.length-1],P.length-=1,P.length<=0&&ft()}}}}function yt(){var t=R.viewport,e=R.scissor_box;t[0]=t[1]=e[0]=e[1]=0,y.viewportWidth=y.framebufferWidth=y.drawingBufferWidth=t[2]=e[2]=i.drawingBufferWidth,y.viewportHeight=y.framebufferHeight=y.drawingBufferHeight=t[3]=e[3]=i.drawingBufferHeight}function mt(){y.tick+=1,y.time=_t(),yt(),I.procs.poll()}function bt(){S.refresh(),yt(),I.procs.refresh(),d&&d.update()}function _t(){return(k()-p)/1e3}bt();var xt=e(dt,{clear:function(t){if(E("object"==typeof t&&t,"regl.clear() takes an object as input"),"framebuffer"in t)if(t.framebuffer&&"framebufferCube"===t.framebuffer_reglType)for(var n=0;n<6;++n)pt(e({framebuffer:t.framebuffer.faces[n]},t),vt);else pt(t,vt);else vt(0,t)},prop:D.define.bind(null,1),context:D.define.bind(null,2),this:D.define.bind(null,3),draw:dt({}),buffer:function(t){return b.create(t,34962,!1,!1)},elements:function(t){return x.create(t,!1)},texture:S.create2D,cube:S.createCube,renderbuffer:A.create,framebuffer:T.create,framebufferCube:T.createCube,vao:_.createVAO,attributes:o,frame:gt,on:function(t,e){var n;switch(E.type(e,"function","listener callback must be a function"),t){case"frame":return gt(e);case"lost":n=G;break;case"restore":n=L;break;case"destroy":n=X;break;default:E.raise("invalid event, must be one of frame,lost,restore,destroy")}return n.push(e),{cancel:function(){for(var t=0;t<n.length;++t)if(n[t]===e)return n[t]=n[n.length-1],void n.pop()}}},limits:m,hasExtension:function(t){return m.extensions.indexOf(t.toLowerCase())>=0},read:C,destroy:function(){P.length=0,ft(),O&&(O.removeEventListener(ur,lt),O.removeEventListener(sr,ht)),w.clear(),T.clear(),A.clear(),S.clear(),x.clear(),b.clear(),_.clear(),d&&d.clear(),X.forEach((function(t){t()}))},_gl:i,_refresh:bt,poll:function(){mt(),d&&d.update()},now:_t,stats:l});return r.onDone(null,xt),xt}}()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={id:r,loaded:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.n=t=>{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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),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})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var r={};return(()=>{"use strict";n(9216);var t,e=(t=n(2680))&&t.__esModule?t:{default:t};e.default._babelPolyfill&&"undefined"!=typeof console&&console.warn&&console.warn("@babel/polyfill is loaded more than once on this page. This is probably not desirable/intended and may have consequences if different versions of the polyfills are applied sequentially. If you do need to load the polyfill more than once, use @babel/polyfill/noConflict instead to bypass the warning."),e.default._babelPolyfill=!0})(),(()=>{"use strict";n.r(r),n.d(r,{CircularLayout:()=>Ot,ComboForceLayout:()=>nd,ConcentricLayout:()=>dr,DagreLayout:()=>Mn,ERLayout:()=>Sd,ForceAtlas2Layout:()=>sd,ForceLayout:()=>Dt,FruchtermanGPULayout:()=>Zh,FruchtermanLayout:()=>yr,GForceGPULayout:()=>td,GForceLayout:()=>k,GridLayout:()=>T,Layout:()=>Ad,Layouts:()=>Td,MDSLayout:()=>vr,RadialLayout:()=>lr,RandomLayout:()=>C,getLayoutByName:()=>S,registerLayout:()=>w,unRegisterLayout:()=>E});var t=function(){function t(){this.nodes=[],this.edges=[],this.combos=[],this.positions=[],this.destroyed=!1,this.onLayoutEnd=function(){}}return t.prototype.layout=function(t){return this.init(t),this.execute(!0)},t.prototype.init=function(t){this.nodes=t.nodes||[],this.edges=t.edges||[],this.combos=t.combos||[]},t.prototype.execute=function(t){},t.prototype.executeWithWorker=function(){},t.prototype.getDefaultCfg=function(){return{}},t.prototype.updateCfg=function(t){t&&Object.assign(this,t)},t.prototype.getType=function(){return"base"},t.prototype.destroy=function(){this.nodes=null,this.edges=null,this.combos=null,this.positions=null,this.destroyed=!0},t}(),e=function(t){return"string"==typeof t},i=/-(\w)/g,o=(function(t){return t.replace(i,(function(t,e){return e?e.toUpperCase():""}))},Object.create(null),Array.isArray),a=function(t){return"number"==typeof t},u=function(t){return Number.isNaN(Number(t))};function s(t){return s="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},s(t)}var c,f=function(){return f=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},f.apply(this,arguments)},l=function(t){return null!==t&&"object"===s(t)},h=function t(e){if(null===e)return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Array){var n=[];return e.forEach((function(t){n.push(t)})),n.map((function(e){return t(e)}))}if("object"===s(e)&&e!=={}){var r=f({},e);return Object.keys(r).forEach((function(e){r[e]=t(r[e])})),r}return e},d=function(t,e){var n=t[e];return l(n)?n.cell:n},p=function(t,e,n){for(var r=[],i=0;i<t;i++)r[i]=0;return n?(n.forEach((function(t){var n=d(t,"source"),i=d(t,"target");n&&(r[e[n]]+=1),i&&(r[e[i]]+=1)})),r):r},v=function(t){for(var e=[],n=t.length,r=0;r<n;r+=1){e[r]=[];for(var i=0;i<n;i+=1)r===i?e[r][i]=0:0!==t[r][i]&&t[r][i]?e[r][i]=t[r][i]:e[r][i]=1/0}for(var o=0;o<n;o+=1)for(r=0;r<n;r+=1)for(i=0;i<n;i+=1)e[r][i]>e[r][o]+e[o][i]&&(e[r][i]=e[r][o]+e[o][i]);return e},g=function(t,e){var n=t.nodes,r=t.edges,i=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach((function(t,e){o[t.id]=e,i.push([])})),r&&r.forEach((function(t){var n=d(t,"source"),r=d(t,"target"),a=o[n],u=o[r];i[a][u]=1,e||(i[u][a]=1)})),i},y=function t(e,n){if(e&&e.children)for(var r=e.children.length-1;r>=0;r--)if(!t(e.children[r],n))return;return!!n(e)},m=function(t,e){"function"==typeof e&&y(t,e)},b=function(t){return"function"==typeof t},_=(c=function(t,e){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},c(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}c(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),x=new Map,w=function(e,n){if(x.get(e)&&console.warn("The layout with the name "+e+" exists already, it will be overridden"),l(n)){var r=function(t){function e(e){var r=t.call(this)||this,i=r,o={},a=i.getDefaultCfg();return Object.assign(o,a,n,e),Object.keys(o).forEach((function(t){var e=o[t];i[t]=e})),r}return _(e,t),e}(t);x.set(e,r)}else x.set(e,n);return x.get(e)},E=function(t){x.has(t)&&x.delete(t)},S=function(t){return x.has(t)?x.get(t):null},A=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),T=function(t){function n(e){var n=t.call(this)||this;return n.begin=[0,0],n.preventOverlap=!0,n.preventOverlapPadding=10,n.condense=!1,n.sortBy="degree",n.nodeSize=30,n.nodes=[],n.edges=[],n.width=300,n.height=300,n.row=0,n.col=0,n.cellWidth=0,n.cellHeight=0,n.cellUsed={},n.id2manPos={},n.onLayoutEnd=function(){},n.updateCfg(e),n}return A(n,t),n.prototype.getDefaultCfg=function(){return{begin:[0,0],preventOverlap:!0,preventOverlapPadding:10,condense:!1,rows:void 0,cols:void 0,position:void 0,sortBy:"degree",nodeSize:30}},n.prototype.execute=function(){var t=this,n=t.nodes,r=t.edges,i=n.length,s=t.begin;if(0===i)return t.onLayoutEnd&&t.onLayoutEnd(),{nodes:n,edges:r};if(1===i)return n[0].x=s[0],n[0].y=s[1],t.onLayoutEnd&&t.onLayoutEnd(),{nodes:n,edges:r};var c=[];n.forEach((function(t){c.push(t)}));var f={};if(c.forEach((function(t,e){f[t.id]=e})),("degree"===t.sortBy||!e(t.sortBy)||void 0===c[0][t.sortBy])&&(t.sortBy="degree",u(n[0].degree))){var h=p(c.length,f,r);c.forEach((function(t,e){t.degree=h[e]}))}c.sort((function(e,n){return n[t.sortBy]-e[t.sortBy]})),t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight);var d=t.rows,v=null!=t.cols?t.cols:t.columns;if(t.cells=i,null!=d&&null!=v?(t.rows=d,t.cols=v):null!=d&&null==v?(t.rows=d,t.cols=Math.ceil(t.cells/t.rows)):null==d&&null!=v?(t.cols=v,t.rows=Math.ceil(t.cells/t.cols)):(t.splits=Math.sqrt(t.cells*t.height/t.width),t.rows=Math.round(t.splits),t.cols=Math.round(t.width/t.height*t.splits)),t.cols*t.rows>t.cells)((y=t.small())-1)*(g=t.large())>=t.cells?t.small(y-1):(g-1)*y>=t.cells&&t.large(g-1);else for(;t.cols*t.rows<t.cells;){var g,y=t.small();((g=t.large())+1)*y>=t.cells?t.large(g+1):t.small(y+1)}t.cellWidth=t.width/t.cols,t.cellHeight=t.height/t.rows,t.condense&&(t.cellWidth=0,t.cellHeight=0),t.preventOverlap&&c.forEach((function(e){var n,r;e.x&&e.y||(e.x=0,e.y=0),o(e.size)?(n=e.size[0],r=e.size[1]):a(e.size)?(n=e.size,r=e.size):l(e.size)&&(n=e.size.width,r=e.size.height),void 0!==n&&void 0!==r||(o(t.nodeSize)?(n=t.nodeSize[0],r=t.nodeSize[1]):a(t.nodeSize)?(n=t.nodeSize,r=t.nodeSize):(n=30,r=30));var i=t.preventOverlapPadding,u=n+i,s=r+i;t.cellWidth=Math.max(t.cellWidth,u),t.cellHeight=Math.max(t.cellHeight,s)})),t.cellUsed={},t.row=0,t.col=0,t.id2manPos={};for(var m=0;m<c.length;m++){var b=c[m],_=void 0;if(t.position&&(_=t.position(b)),_&&(void 0!==_.row||void 0!==_.col)){var x={row:_.row,col:_.col};if(void 0===x.col)for(x.col=0;t.used(x.row,x.col);)x.col++;else if(void 0===x.row)for(x.row=0;t.used(x.row,x.col);)x.row++;t.id2manPos[b.id]=x,t.use(x.row,x.col)}t.getPos(b)}return t.onLayoutEnd&&t.onLayoutEnd(),{edges:r,nodes:c}},n.prototype.small=function(t){var e,n=this,r=n.rows||5,i=n.cols||5;return null==t?e=Math.min(r,i):Math.min(r,i)===n.rows?n.rows=t:n.cols=t,e},n.prototype.large=function(t){var e,n=this,r=n.rows||5,i=n.cols||5;return null==t?e=Math.max(r,i):Math.max(r,i)===n.rows?n.rows=t:n.cols=t,e},n.prototype.used=function(t,e){return this.cellUsed["c-"+t+"-"+e]||!1},n.prototype.use=function(t,e){this.cellUsed["c-"+t+"-"+e]=!0},n.prototype.moveToNextCell=function(){var t=this,e=t.cols||5;t.col++,t.col>=e&&(t.col=0,t.row++)},n.prototype.getPos=function(t){var e,n,r=this,i=r.begin,o=r.cellWidth,a=r.cellHeight,u=r.id2manPos[t.id];if(u)e=u.col*o+o/2+i[0],n=u.row*a+a/2+i[1];else{for(;r.used(r.row,r.col);)r.moveToNextCell();e=r.col*o+o/2+i[0],n=r.row*a+a/2+i[1],r.use(r.row,r.col),r.moveToNextCell()}t.x=e,t.y=n},n.prototype.getType=function(){return"grid"},n}(t),I=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),C=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.width=300,n.height=300,n.nodes=[],n.edges=[],n.onLayoutEnd=function(){},n.updateCfg(e),n}return I(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],width:300,height:300}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.center;return t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),e&&e.forEach((function(e){e.x=.9*(Math.random()-.5)*t.width+n[0],e.y=.9*(Math.random()-.5)*t.height+n[1]})),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:this.edges}},e.prototype.getType=function(){return"random"},e}(t),D=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),N=function(t,e){return t?a(t)?function(e){return t}:t:function(t){return e||1}},k=function(t){function e(e){var n=t.call(this)||this;return n.maxIteration=1e3,n.workerEnabled=!1,n.edgeStrength=200,n.nodeStrength=1e3,n.coulombDisScale=.005,n.damping=.9,n.maxSpeed=1e3,n.minMovement=.5,n.interval=.02,n.factor=1,n.linkDistance=1,n.gravity=10,n.preventOverlap=!0,n.tick=function(){},n.nodes=[],n.edges=[],n.width=300,n.height=300,n.nodeMap={},n.nodeIdxMap={},n.updateCfg(e),n}return D(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:500,gravity:10,enableTick:!0}},e.prototype.execute=function(){var t,e,n=this,r=n.nodes;if(void 0!==n.timeInterval&&"undefined"!=typeof window&&window.clearInterval(n.timeInterval),r&&0!==r.length){n.width||"undefined"==typeof window||(n.width=window.innerWidth),n.height||"undefined"==typeof window||(n.height=window.innerHeight),n.center||(n.center=[n.width/2,n.height/2]);var i=n.center;if(1===r.length)return r[0].x=i[0],r[0].y=i[1],void(null===(e=n.onLayoutEnd)||void 0===e||e.call(n));var u={},s={};r.forEach((function(t,e){a(t.x)||(t.x=Math.random()*n.width),a(t.y)||(t.y=Math.random()*n.height),u[t.id]=t,s[t.id]=e})),n.nodeMap=u,n.nodeIdxMap=s,n.linkDistance=N(n.linkDistance,1),n.nodeStrength=N(n.nodeStrength,1),n.edgeStrength=N(n.edgeStrength,1);var c,f=n.nodeSize;if(n.preventOverlap){var h,d=n.nodeSpacing;h=a(d)?function(){return d}:b(d)?d:function(){return 0},c=f?o(f)?function(t){return(f[0]>f[1]?f[0]:f[1])+h(t)}:function(t){return f+h(t)}:function(t){return t.size?o(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])+h(t):l(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)+h(t):t.size+h(t):10+h(t)}}n.nodeSize=c;var v=n.edges;n.degrees=p(r.length,n.nodeIdxMap,v),n.getMass||(n.getMass=function(t){return n.degrees[n.nodeIdxMap[t.id]]||1}),n.run()}else null===(t=n.onLayoutEnd)||void 0===t||t.call(n)},e.prototype.run=function(){var t,e=this,n=e.maxIteration,r=e.nodes,i=e.workerEnabled,o=e.minMovement;if(r)if(i){for(var a=0;a<n;a++){var u=e.runOneStep(a);if(e.reachMoveThreshold(r,u,o))break}null===(t=e.onLayoutEnd)||void 0===t||t.call(e)}else{if("undefined"==typeof window)return;var s=0;this.timeInterval=window.setInterval((function(){var t,i;if(r){var a=e.runOneStep(s)||[];e.reachMoveThreshold(r,a,o)&&(null===(t=e.onLayoutEnd)||void 0===t||t.call(e),window.clearInterval(e.timeInterval)),++s>=n&&(null===(i=e.onLayoutEnd)||void 0===i||i.call(e),window.clearInterval(e.timeInterval))}}),0)}},e.prototype.reachMoveThreshold=function(t,e,n){var r=0;return t.forEach((function(t,n){var i=t.x-e[n].x,o=t.y-e[n].y;r+=Math.sqrt(i*i+o*o)})),(r/=t.length)<n},e.prototype.runOneStep=function(t){var e,n=this,r=n.nodes,i=n.edges,o=[],a=[];if(r){r.forEach((function(t,e){o[2*e]=0,o[2*e+1]=0,a[2*e]=0,a[2*e+1]=0})),n.calRepulsive(o,r),i&&n.calAttractive(o,i),n.calGravity(o,r);var u=Math.max(.02,n.interval-.002*t);n.updateVelocity(o,a,u,r);var s=[];return r.forEach((function(t){s.push({x:t.x,y:t.y})})),n.updatePosition(a,u,r),null===(e=n.tick)||void 0===e||e.call(n),s}},e.prototype.calRepulsive=function(t,e){var n=this,r=n.getMass,i=n.nodeStrength,o=n.factor,a=n.coulombDisScale,u=n.preventOverlap,s=n.nodeSize;e.forEach((function(n,c){var f=r?r(n):1;e.forEach((function(e,l){if(!(c>=l)){var h=n.x-e.x,d=n.y-e.y,p=Math.sqrt(h*h+d*d)+.01,v=(p+.1)*a,g=h/p,y=d/p,m=(i(n)+i(e))/2*o/(v*v),b=r?r(e):1;if(t[2*c]+=g*m,t[2*c+1]+=y*m,t[2*l]-=g*m,t[2*l+1]-=y*m,u&&p<(s(n)+s(e))/2){var _=(i(n)+i(e))/2/(p*p);t[2*c]+=g*_/f,t[2*c+1]+=y*_/f,t[2*l]-=g*_/b,t[2*l+1]-=y*_/b}}}))}))},e.prototype.calAttractive=function(t,e){var n=this,r=n.nodeMap,i=n.nodeIdxMap,o=n.linkDistance,a=n.edgeStrength,u=n.getMass;e.forEach((function(e,n){var s=d(e,"source"),c=d(e,"target"),f=r[s],l=r[c],h=l.x-f.x,p=l.y-f.y,v=Math.sqrt(h*h+p*p)+.01,g=h/v,y=p/v,m=((o(e)||1)-v)*a(e),b=i[s],_=i[c],x=u?u(f):1,w=u?u(l):1;t[2*b]-=g*m/x,t[2*b+1]-=y*m/x,t[2*_]+=g*m/w,t[2*_+1]+=y*m/w}))},e.prototype.calGravity=function(t,e){for(var n=this,r=n.center,i=n.gravity,o=n.degrees,u=e.length,s=0;s<u;s++){var c=e[s],f=c.x-r[0],l=c.y-r[1],h=i;if(n.getCenter){var d=n.getCenter(c,o[s]);d&&a(d[0])&&a(d[1])&&a(d[2])&&(f=c.x-d[0],l=c.y-d[1],h=d[2])}h&&(t[2*s]-=h*f,t[2*s+1]-=h*l)}},e.prototype.updateVelocity=function(t,e,n,r){var i=this,o=n*i.damping;r.forEach((function(n,r){var a=t[2*r]*o||.01,u=t[2*r+1]*o||.01,s=Math.sqrt(a*a+u*u);if(s>i.maxSpeed){var c=i.maxSpeed/s;a*=c,u*=c}e[2*r]=a,e[2*r+1]=u}))},e.prototype.updatePosition=function(t,e,n){n.forEach((function(n,r){if(a(n.fx)&&a(n.fy))return n.x=n.fx,void(n.y=n.fy);var i=t[2*r]*e,o=t[2*r+1]*e;n.x+=i,n.y+=o}))},e.prototype.stop=function(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){var t=this;t.stop(),t.tick=null,t.nodes=null,t.edges=null,t.destroyed=!0},e.prototype.getType=function(){return"gForce"},e}(t);function R(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,o,a,u,s,c,f,l,h,d=t._root,p={data:r},v=t._x0,g=t._y0,y=t._x1,m=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((c=e>=(o=(v+y)/2))?v=o:y=o,(f=n>=(a=(g+m)/2))?g=a:m=a,i=d,!(d=d[l=f<<1|c]))return i[l]=p,t;if(u=+t._x.call(null,d.data),s=+t._y.call(null,d.data),e===u&&n===s)return p.next=d,i?i[l]=p:t._root=p,t;do{i=i?i[l]=new Array(4):t._root=new Array(4),(c=e>=(o=(v+y)/2))?v=o:y=o,(f=n>=(a=(g+m)/2))?g=a:m=a}while((l=f<<1|c)==(h=(s>=a)<<1|u>=o));return i[h]=d,i[l]=p,t}function O(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function M(t){return t[0]}function P(t){return t[1]}function G(t,e,n){var r=new L(null==e?M:e,null==n?P:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function L(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 U(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var F=G.prototype=L.prototype;function B(t){return function(){return t}}function z(t){return 1e-6*(t()-.5)}F.copy=function(){var t,e,n=new L(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=U(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=U(e));return n},F.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return R(this.cover(e,n),e,n,t)},F.addAll=function(t){var e,n,r,i,o=t.length,a=new Array(o),u=new Array(o),s=1/0,c=1/0,f=-1/0,l=-1/0;for(n=0;n<o;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(i=+this._y.call(null,e))||(a[n]=r,u[n]=i,r<s&&(s=r),r>f&&(f=r),i<c&&(c=i),i>l&&(l=i));if(s>f||c>l)return this;for(this.cover(s,c).cover(f,l),n=0;n<o;++n)R(this,a[n],u[n],t[n]);return this},F.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,o=(r=Math.floor(e))+1;else{for(var a,u,s=i-n||1,c=this._root;n>t||t>=i||r>e||e>=o;)switch(u=(e<r)<<1|t<n,(a=new Array(4))[u]=c,c=a,s*=2,u){case 0:i=n+s,o=r+s;break;case 1:n=i-s,o=r+s;break;case 2:i=n+s,r=o-s;break;case 3:n=i-s,r=o-s}this._root&&this._root.length&&(this._root=c)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this},F.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},F.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},F.find=function(t,e,n){var r,i,o,a,u,s,c,f=this._x0,l=this._y0,h=this._x1,d=this._y1,p=[],v=this._root;for(v&&p.push(new O(v,f,l,h,d)),null==n?n=1/0:(f=t-n,l=e-n,h=t+n,d=e+n,n*=n);s=p.pop();)if(!(!(v=s.node)||(i=s.x0)>h||(o=s.y0)>d||(a=s.x1)<f||(u=s.y1)<l))if(v.length){var g=(i+a)/2,y=(o+u)/2;p.push(new O(v[3],g,y,a,u),new O(v[2],i,y,g,u),new O(v[1],g,o,a,y),new O(v[0],i,o,g,y)),(c=(e>=y)<<1|t>=g)&&(s=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=s)}else{var m=t-+this._x.call(null,v.data),b=e-+this._y.call(null,v.data),_=m*m+b*b;if(_<n){var x=Math.sqrt(n=_);f=t-x,l=e-x,h=t+x,d=e+x,r=v.data}}return r},F.remove=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t)))return this;var e,n,r,i,o,a,u,s,c,f,l,h,d=this._root,p=this._x0,v=this._y0,g=this._x1,y=this._y1;if(!d)return this;if(d.length)for(;;){if((c=o>=(u=(p+g)/2))?p=u:g=u,(f=a>=(s=(v+y)/2))?v=s:y=s,e=d,!(d=d[l=f<<1|c]))return this;if(!d.length)break;(e[l+1&3]||e[l+2&3]||e[l+3&3])&&(n=e,h=l)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):e?(i?e[l]=i:delete e[l],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(n?n[h]=d:this._root=d),this):(this._root=i,this)},F.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},F.root=function(){return this._root},F.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},F.visit=function(t){var e,n,r,i,o,a,u=[],s=this._root;for(s&&u.push(new O(s,this._x0,this._y0,this._x1,this._y1));e=u.pop();)if(!t(s=e.node,r=e.x0,i=e.y0,o=e.x1,a=e.y1)&&s.length){var c=(r+o)/2,f=(i+a)/2;(n=s[3])&&u.push(new O(n,c,f,o,a)),(n=s[2])&&u.push(new O(n,r,f,c,a)),(n=s[1])&&u.push(new O(n,c,i,o,f)),(n=s[0])&&u.push(new O(n,r,i,c,f))}return this},F.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new O(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var o,a=e.x0,u=e.y0,s=e.x1,c=e.y1,f=(a+s)/2,l=(u+c)/2;(o=i[0])&&n.push(new O(o,a,u,f,l)),(o=i[1])&&n.push(new O(o,f,u,s,l)),(o=i[2])&&n.push(new O(o,a,l,f,c)),(o=i[3])&&n.push(new O(o,f,l,s,c))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},F.x=function(t){return arguments.length?(this._x=t,this):this._x},F.y=function(t){return arguments.length?(this._y=t,this):this._y};var j={value:()=>{}};function W(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new V(r)}function V(t){this._=t}function X(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function H(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function q(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=j,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}V.prototype=W.prototype={constructor:V,on:function(t,e){var n,r=this._,i=X(t+"",r),o=-1,a=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<a;)if(n=(t=i[o]).type)r[n]=q(r[n],t.name,e);else if(null==e)for(n in r)r[n]=q(r[n],t.name,null);return this}for(;++o<a;)if((n=(t=i[o]).type)&&(n=H(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new V(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(r=this._[t]).length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};const Y=W;var K,Z,$=0,J=0,Q=0,tt=0,et=0,nt=0,rt="object"==typeof performance&&performance.now?performance:Date,it="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function ot(){return et||(it(at),et=rt.now()+nt)}function at(){et=0}function ut(){this._call=this._time=this._next=null}function st(t,e,n){var r=new ut;return r.restart(t,e,n),r}function ct(){et=(tt=rt.now())+nt,$=J=0;try{!function(){ot(),++$;for(var t,e=K;e;)(t=et-e._time)>=0&&e._call.call(null,t),e=e._next;--$}()}finally{$=0,function(){for(var t,e,n=K,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:K=e);Z=t,lt(r)}(),et=0}}function ft(){var t=rt.now(),e=t-tt;e>1e3&&(nt-=e,tt=t)}function lt(t){$||(J&&(J=clearTimeout(J)),t-et>24?(t<1/0&&(J=setTimeout(ct,t-rt.now()-nt)),Q&&(Q=clearInterval(Q))):(Q||(tt=rt.now(),Q=setInterval(ft,1e3)),$=1,it(ct)))}ut.prototype=st.prototype={constructor:ut,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?ot():+n)+(null==e?0:+e),this._next||Z===this||(Z?Z._next=this:K=this,Z=this),this._call=t,this._time=n,lt()},stop:function(){this._call&&(this._call=null,this._time=1/0,lt())}};const ht=4294967296;function dt(t){return t.x}function pt(t){return t.y}var vt=Math.PI*(3-Math.sqrt(5));function gt(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,u=new Map,s=st(l),c=Y("tick","end"),f=function(){let t=1;return()=>(t=(1664525*t+1013904223)%ht)/ht}();function l(){h(),c.call("tick",e),n<r&&(s.stop(),c.call("end",e))}function h(r){var s,c,f=t.length;void 0===r&&(r=1);for(var l=0;l<r;++l)for(n+=(o-n)*i,u.forEach((function(t){t(n)})),s=0;s<f;++s)null==(c=t[s]).fx?c.x+=c.vx*=a:(c.x=c.fx,c.vx=0),null==c.fy?c.y+=c.vy*=a:(c.y=c.fy,c.vy=0);return e}function d(){for(var e,n=0,r=t.length;n<r;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var i=10*Math.sqrt(.5+n),o=n*vt;e.x=i*Math.cos(o),e.y=i*Math.sin(o)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function p(e){return e.initialize&&e.initialize(t,f),e}return null==t&&(t=[]),d(),e={tick:h,restart:function(){return s.restart(l),e},stop:function(){return s.stop(),e},nodes:function(n){return arguments.length?(t=n,d(),u.forEach(p),e):t},alpha:function(t){return arguments.length?(n=+t,e):n},alphaMin:function(t){return arguments.length?(r=+t,e):r},alphaDecay:function(t){return arguments.length?(i=+t,e):+i},alphaTarget:function(t){return arguments.length?(o=+t,e):o},velocityDecay:function(t){return arguments.length?(a=1-t,e):1-a},randomSource:function(t){return arguments.length?(f=t,u.forEach(p),e):f},force:function(t,n){return arguments.length>1?(null==n?u.delete(t):u.set(t,p(n)),e):u.get(t)},find:function(e,n,r){var i,o,a,u,s,c=0,f=t.length;for(null==r?r=1/0:r*=r,c=0;c<f;++c)(a=(i=e-(u=t[c]).x)*i+(o=n-u.y)*o)<r&&(s=u,r=a);return s},on:function(t,n){return arguments.length>1?(c.on(t,n),e):c.on(t)}}}function yt(){var t,e,n,r,i,o=B(-30),a=1,u=1/0,s=.81;function c(n){var i,o=t.length,a=G(t,dt,pt).visitAfter(l);for(r=n,i=0;i<o;++i)e=t[i],a.visit(h)}function f(){if(t){var e,n,r=t.length;for(i=new Array(r),e=0;e<r;++e)n=t[e],i[n.index]=+o(n,e,t)}}function l(t){var e,n,r,o,a,u=0,s=0;if(t.length){for(r=o=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(u+=e.value,s+=n,r+=n*e.x,o+=n*e.y);t.x=r/s,t.y=o/s}else{(e=t).x=e.data.x,e.y=e.data.y;do{u+=i[e.data.index]}while(e=e.next)}t.value=u}function h(t,o,c,f){if(!t.value)return!0;var l=t.x-e.x,h=t.y-e.y,d=f-o,p=l*l+h*h;if(d*d/s<p)return p<u&&(0===l&&(p+=(l=z(n))*l),0===h&&(p+=(h=z(n))*h),p<a&&(p=Math.sqrt(a*p)),e.vx+=l*t.value*r/p,e.vy+=h*t.value*r/p),!0;if(!(t.length||p>=u)){(t.data!==e||t.next)&&(0===l&&(p+=(l=z(n))*l),0===h&&(p+=(h=z(n))*h),p<a&&(p=Math.sqrt(a*p)));do{t.data!==e&&(d=i[t.data.index]*r/p,e.vx+=l*d,e.vy+=h*d)}while(t=t.next)}}return c.initialize=function(e,r){t=e,n=r,f()},c.strength=function(t){return arguments.length?(o="function"==typeof t?t:B(+t),f(),c):o},c.distanceMin=function(t){return arguments.length?(a=t*t,c):Math.sqrt(a)},c.distanceMax=function(t){return arguments.length?(u=t*t,c):Math.sqrt(u)},c.theta=function(t){return arguments.length?(s=t*t,c):Math.sqrt(s)},c}function mt(t,e){var n,r=1;function i(){var i,o,a=n.length,u=0,s=0;for(i=0;i<a;++i)u+=(o=n[i]).x,s+=o.y;for(u=(u/a-t)*r,s=(s/a-e)*r,i=0;i<a;++i)(o=n[i]).x-=u,o.y-=s}return null==t&&(t=0),null==e&&(e=0),i.initialize=function(t){n=t},i.x=function(e){return arguments.length?(t=+e,i):t},i.y=function(t){return arguments.length?(e=+t,i):e},i.strength=function(t){return arguments.length?(r=+t,i):r},i}function bt(t){return t.index}function _t(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}function xt(t){var e,n,r,i,o,a,u=bt,s=function(t){return 1/Math.min(i[t.source.index],i[t.target.index])},c=B(30),f=1;function l(r){for(var i=0,u=t.length;i<f;++i)for(var s,c,l,h,d,p,v,g=0;g<u;++g)c=(s=t[g]).source,h=(l=s.target).x+l.vx-c.x-c.vx||z(a),d=l.y+l.vy-c.y-c.vy||z(a),h*=p=((p=Math.sqrt(h*h+d*d))-n[g])/p*r*e[g],d*=p,l.vx-=h*(v=o[g]),l.vy-=d*v,c.vx+=h*(v=1-v),c.vy+=d*v}function h(){if(r){var a,s,c=r.length,f=t.length,l=new Map(r.map(((t,e)=>[u(t,e,r),t])));for(a=0,i=new Array(c);a<f;++a)(s=t[a]).index=a,"object"!=typeof s.source&&(s.source=_t(l,s.source)),"object"!=typeof s.target&&(s.target=_t(l,s.target)),i[s.source.index]=(i[s.source.index]||0)+1,i[s.target.index]=(i[s.target.index]||0)+1;for(a=0,o=new Array(f);a<f;++a)s=t[a],o[a]=i[s.source.index]/(i[s.source.index]+i[s.target.index]);e=new Array(f),d(),n=new Array(f),p()}}function d(){if(r)for(var n=0,i=t.length;n<i;++n)e[n]=+s(t[n],n,t)}function p(){if(r)for(var e=0,i=t.length;e<i;++e)n[e]=+c(t[e],e,t)}return null==t&&(t=[]),l.initialize=function(t,e){r=t,a=e,h()},l.links=function(e){return arguments.length?(t=e,h(),l):t},l.id=function(t){return arguments.length?(u=t,l):u},l.iterations=function(t){return arguments.length?(f=+t,l):f},l.strength=function(t){return arguments.length?(s="function"==typeof t?t:B(+t),d(),l):s},l.distance=function(t){return arguments.length?(c="function"==typeof t?t:B(+t),p(),l):c},l}function wt(t){return t.x+t.vx}function Et(t){return t.y+t.vy}function St(t){var e,n,r,i=1,o=1;function a(){for(var t,a,s,c,f,l,h,d=e.length,p=0;p<o;++p)for(a=G(e,wt,Et).visitAfter(u),t=0;t<d;++t)s=e[t],l=n[s.index],h=l*l,c=s.x+s.vx,f=s.y+s.vy,a.visit(v);function v(t,e,n,o,a){var u=t.data,d=t.r,p=l+d;if(!u)return e>c+p||o<c-p||n>f+p||a<f-p;if(u.index>s.index){var v=c-u.x-u.vx,g=f-u.y-u.vy,y=v*v+g*g;y<p*p&&(0===v&&(y+=(v=z(r))*v),0===g&&(y+=(g=z(r))*g),y=(p-(y=Math.sqrt(y)))/y*i,s.vx+=(v*=y)*(p=(d*=d)/(h+d)),s.vy+=(g*=y)*p,u.vx-=v*(p=1-p),u.vy-=g*p)}}}function u(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function s(){if(e){var r,i,o=e.length;for(n=new Array(o),r=0;r<o;++r)i=e[r],n[i.index]=+t(i,r,e)}}return"function"!=typeof t&&(t=B(null==t?1:+t)),a.initialize=function(t,n){e=t,r=n,s()},a.iterations=function(t){return arguments.length?(o=+t,a):o},a.strength=function(t){return arguments.length?(i=+t,a):i},a.radius=function(e){return arguments.length?(t="function"==typeof e?e:B(+e),s(),a):t},a}function At(t){var e,n,r,i=B(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vx+=(r[o]-i.x)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=B(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:B(+t),a(),o):i},o.x=function(e){return arguments.length?(t="function"==typeof e?e:B(+e),a(),o):t},o}function Tt(t){var e,n,r,i=B(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vy+=(r[o]-i.y)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=B(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:B(+t),a(),o):i},o.y=function(e){return arguments.length?(t="function"==typeof e?e:B(+e),a(),o):t},o}var It="GPU_LAYOUT_END",Ct=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Dt=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.nodeStrength=null,n.edgeStrength=null,n.preventOverlap=!1,n.clusterNodeStrength=null,n.clusterEdgeStrength=null,n.clusterEdgeDistance=null,n.clusterNodeSize=null,n.clusterFociStrength=null,n.linkDistance=50,n.alphaDecay=.028,n.alphaMin=.001,n.alpha=.3,n.collideStrength=1,n.workerEnabled=!1,n.tick=function(){},n.onLayoutEnd=function(){},n.ticking=void 0,e&&n.updateCfg(e),n}return Ct(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],nodeStrength:null,edgeStrength:null,preventOverlap:!1,nodeSize:void 0,nodeSpacing:void 0,linkDistance:50,forceSimulation:null,alphaDecay:.028,alphaMin:.001,alpha:.3,collideStrength:1,clustering:!1,clusterNodeStrength:-1,clusterEdgeStrength:.1,clusterEdgeDistance:100,clusterFociStrength:.8,clusterNodeSize:10,tick:function(){},onLayoutEnd:function(){},workerEnabled:!1}},e.prototype.init=function(t){var e=this;e.nodes=t.nodes||[];var n=t.edges||[];e.edges=n.map((function(t){var e={},n=["targetNode","sourceNode","startPoint","endPoint"];return Object.keys(t).forEach((function(r){n.indexOf(r)>-1||(e[r]=t[r])})),e})),e.ticking=!1},e.prototype.execute=function(t){var e=this,n=e.nodes,r=e.edges;if(!e.ticking){var i=e.forceSimulation,o=e.alphaMin,a=e.alphaDecay,u=e.alpha;if(i)t&&(e.clustering&&e.clusterForce&&(e.clusterForce.nodes(n),e.clusterForce.links(r)),i.nodes(n),r&&e.edgeForce?e.edgeForce.links(r):r&&!e.edgeForce&&(f=xt().id((function(t){return t.id})).links(r),e.edgeStrength&&f.strength(e.edgeStrength),e.linkDistance&&f.distance(e.linkDistance),e.edgeForce=f,i.force("link",f))),e.preventOverlap&&e.overlapProcess(i),i.alpha(u).restart(),this.ticking=!0;else try{var s=yt();if(e.nodeStrength&&s.strength(e.nodeStrength),i=gt().nodes(n),e.clustering){var c=function(){function t(t){return function(){return t}}var e,n=function(t){return t.cluster},r=t(1),i=t(-1),o=t(100),a=t(.1),u=[0,0],s=[],c={},f=[],l=100,h=100,p={none:{x:0,y:0}},v=[],g="force",y=!0,m=.1;function b(t){if(!y)return b;e.tick(),x();for(var r=0,i=s.length,o=void 0,a=t*m;r<i;++r)(o=s[r]).vx+=(p[n(o)].x-o.x)*a,o.vy+=(p[n(o)].y-o.y)*a}function _(){s&&function(){if(s&&s.length){if(void 0===n(s[0]))throw Error("Couldnt find the grouping attribute for the nodes. Make sure to set it up with forceInABox.groupBy('clusterAttr') before calling .links()");var t,u,p,g,y,m=(t=[],u=[],p={},y=[],g=function(t){var e={};return t.forEach((function(t){var r=n(t);e[r]||(e[r]={count:0,sumforceNodeSize:0})})),t.forEach((function(t){var i=n(t),o=r(t),a=e[i];a.count=a.count+1,a.sumforceNodeSize=a.sumforceNodeSize+Math.PI*(o*o)*1.3,e[i]=a})),e}(s),y=function(t){var e={},r=[];return t.forEach((function(t){var r=function(t){var e=d(t,"source"),r=d(t,"target"),i=n(c[e]),o=n(c[r]);return i<=o?i+"~"+o:o+"~"+i}(t),i=0;void 0!==e[r]&&(i=e[r]),i+=1,e[r]=i})),Object.entries(e).forEach((function(t){var e=t[0],n=t[1],i=e.split("~")[0],o=e.split("~")[1];void 0!==i&&void 0!==o&&r.push({source:i,target:o,count:n})})),r}(f),Object.keys(g).forEach((function(e,n){var r=g[e];t.push({id:e,size:r.count,r:Math.sqrt(r.sumforceNodeSize/Math.PI)}),p[e]=n})),y.forEach((function(t){var e=d(t,"source"),n=d(t,"target"),r=p[e],i=p[n];void 0!==r&&void 0!==i&&u.push({source:r,target:i,count:t.count})})),{nodes:t,links:u});e=gt(m.nodes).force("x",At(l).strength(.1)).force("y",Tt(h).strength(.1)).force("collide",St((function(t){return t.r})).iterations(4)).force("charge",yt().strength(i)).force("links",xt(m.nodes.length?m.links:[]).distance(o).strength(a)),v=e.nodes(),x()}}()}function x(){return p={none:{x:0,y:0}},v.forEach((function(t){p[t.id]={x:t.x-u[0],y:t.y-u[1]}})),p}function w(t){c={},t.forEach((function(t){c[t.id]=t}))}return b.initialize=function(t){s=t,_()},b.template=function(t){return arguments.length?(g=t,_(),b):g},b.groupBy=function(t){return arguments.length?"string"==typeof t?(n=function(e){return e[t]},b):(n=t,b):n},b.enableGrouping=function(t){return arguments.length?(y=t,b):y},b.strength=function(t){return arguments.length?(m=t,b):m},b.centerX=function(t){return arguments.length?(l=t,b):l},b.centerY=function(t){return arguments.length?(h=t,b):h},b.nodes=function(t){return arguments.length?(w(t||[]),s=t||[],b):s},b.links=function(t){return arguments.length?(f=t||[],_(),b):f},b.forceNodeSize=function(e){return arguments.length?(r="function"==typeof e?e:t(+e),_(),b):r},b.nodeSize=b.forceNodeSize,b.forceCharge=function(e){return arguments.length?(i="function"==typeof e?e:t(+e),_(),b):i},b.forceLinkDistance=function(e){return arguments.length?(o="function"==typeof e?e:t(+e),_(),b):o},b.forceLinkStrength=function(e){return arguments.length?(a="function"==typeof e?e:t(+e),_(),b):a},b.offset=function(t){return arguments.length?(u=t,b):u},b.getFocis=x,b}();c.centerX(e.center[0]).centerY(e.center[1]).template("force").strength(e.clusterFociStrength),r&&c.links(r),n&&c.nodes(n),c.forceLinkDistance(e.clusterEdgeDistance).forceLinkStrength(e.clusterEdgeStrength).forceCharge(e.clusterNodeStrength).forceNodeSize(e.clusterNodeSize),e.clusterForce=c,i.force("group",c)}if(i.force("center",mt(e.center[0],e.center[1])).force("charge",s).alpha(u).alphaDecay(a).alphaMin(o),e.preventOverlap&&e.overlapProcess(i),r){var f=xt().id((function(t){return t.id})).links(r);e.edgeStrength&&f.strength(e.edgeStrength),e.linkDistance&&f.distance(e.linkDistance),e.edgeForce=f,i.force("link",f)}if(e.workerEnabled&&!Nt()&&(e.workerEnabled=!1,console.warn("workerEnabled option is only supported when running in web worker.")),e.workerEnabled){i.stop();for(var l=function(t){var e=t.alphaMin(),n=t.alphaTarget(),r=t.alpha(),i=Math.log((e-n)/(r-n))/Math.log(1-t.alphaDecay());return Math.ceil(i)}(i),h=1;h<=l;h++)i.tick(),postMessage({nodes:n,currentTick:h,totalTicks:l,type:"LAYOUT_TICK"},void 0);e.ticking=!1}else i.on("tick",(function(){e.tick()})).on("end",(function(){e.ticking=!1,e.onLayoutEnd&&e.onLayoutEnd()})),e.ticking=!0;e.forceSimulation=i,e.ticking=!0}catch(t){e.ticking=!1,console.warn(t)}}},e.prototype.overlapProcess=function(t){var e,n,r=this,i=r.nodeSize,u=r.nodeSpacing,s=r.collideStrength;if(n=a(u)?function(){return u}:b(u)?u:function(){return 0},i)if(b(i))e=function(t){return i(t)+n(t)};else if(o(i)){var c=(i[0]>i[1]?i[0]:i[1])/2;e=function(t){return c+n(t)}}else if(a(i)){var f=i/2;e=function(t){return f+n(t)}}else e=function(){return 10};else e=function(t){return t.size?o(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])/2+n(t):l(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)/2+n(t):t.size/2+n(t):10+n(t)};t.force("collisionForce",St(e).strength(s))},e.prototype.updateCfg=function(t){var e=this;e.ticking&&(e.forceSimulation.stop(),e.ticking=!1),e.forceSimulation=null,Object.assign(e,t)},e.prototype.destroy=function(){var t=this;t.ticking&&(t.forceSimulation.stop(),t.ticking=!1),t.nodes=null,t.edges=null,t.destroyed=!0},e}(t);function Nt(){return"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope}var kt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function Rt(t,e){var n=t.degree,r=e.degree;return n<r?-1:n>r?1:0}var Ot=function(t){function e(e){var n=t.call(this)||this;return n.radius=null,n.startRadius=null,n.endRadius=null,n.startAngle=0,n.endAngle=2*Math.PI,n.clockwise=!0,n.divisions=1,n.ordering=null,n.angleRatio=1,n.nodes=[],n.edges=[],n.nodeMap={},n.degrees=[],n.width=300,n.height=300,n.updateCfg(e),n}return kt(e,t),e.prototype.getDefaultCfg=function(){return{radius:null,startRadius:null,endRadius:null,startAngle:0,endAngle:2*Math.PI,clockwise:!0,divisions:1,ordering:null,angleRatio:1}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.edges,r=e.length;if(0!==r){t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),t.center||(t.center=[t.width/2,t.height/2]);var i=t.center;if(1===r)return e[0].x=i[0],e[0].y=i[1],void(t.onLayoutEnd&&t.onLayoutEnd());var o=t.radius,a=t.startRadius,u=t.endRadius,s=t.divisions,c=t.startAngle,f=t.endAngle,l=(f-c)/r,h={};e.forEach((function(t,e){h[t.id]=e})),t.nodeMap=h;var d=p(e.length,h,n);t.degrees=d,o||a||u?!a&&u?a=u:a&&!u&&(u=a):o=t.height>t.width?t.width/2:t.height/2;var v=l*t.angleRatio,g=t.ordering,y=[];y="topology"===g?t.topologyOrdering():"topology-directed"===g?t.topologyOrdering(!0):"degree"===g?t.degreeOrdering():e;for(var m=t.clockwise,b=Math.ceil(r/s),_=0;_<r;++_){var x=o;x||null===a||null===u||(x=a+_*(u-a)/(r-1)),x||(x=10+100*_/(r-1));var w=c+_%b*v+2*Math.PI/s*Math.floor(_/b);m||(w=f-_%b*v-2*Math.PI/s*Math.floor(_/b)),y[_].x=i[0]+Math.cos(w)*x,y[_].y=i[1]+Math.sin(w)*x,y[_].weight=d[_]}return t.onLayoutEnd&&t.onLayoutEnd(),{nodes:y,edges:this.edges}}t.onLayoutEnd&&t.onLayoutEnd()},e.prototype.topologyOrdering=function(t){void 0===t&&(t=!1);var e=this,n=e.degrees,r=e.edges,i=e.nodes,o=h(i),a=e.nodeMap,u=[o[0]],s=[i[0]],c=[],f=i.length;c[0]=!0,function(t,e,n,r){t.forEach((function(e,n){t[n].children=[],t[n].parent=[]})),r?e.forEach((function(e){var r=d(e,"source"),i=d(e,"target"),o=0;r&&(o=n[r]);var a=0;i&&(a=n[i]);var u=t[o].children,s=t[a].parent;u.push(t[a].id),s.push(t[o].id)})):e.forEach((function(e){var r=d(e,"source"),i=d(e,"target"),o=0;r&&(o=n[r]);var a=0;i&&(a=n[i]);var u=t[o].children,s=t[a].children;u.push(t[a].id),s.push(t[o].id)}))}(o,r,a,t);var l=0;return o.forEach((function(t,e){if(0!==e)if(e!==f-1&&n[e]===n[e+1]&&!function(t,e,n){for(var r=n.length,i=0;i<r;i++){var o=d(n[i],"source"),a=d(n[i],"target");if(t.id===o&&e.id===a||e.id===o&&t.id===a)return!0}return!1}(u[l],t,r)||c[e]){for(var h=u[l].children,p=!1,v=0;v<h.length;v++){var g=a[h[v]];if(n[g]===n[e]&&!c[g]){u.push(o[g]),s.push(i[a[o[g].id]]),c[g]=!0,p=!0;break}}for(var y=0;!p&&(c[y]||(u.push(o[y]),s.push(i[a[o[y].id]]),c[y]=!0,p=!0),++y!==f););}else u.push(t),s.push(i[a[t.id]]),c[e]=!0,l++})),s},e.prototype.degreeOrdering=function(){var t=this.nodes,e=[],n=this.degrees;return t.forEach((function(t,r){t.degree=n[r],e.push(t)})),e.sort(Rt),e},e.prototype.getType=function(){return"circular"},e}(t),Mt=n(8311),Pt=n.n(Mt)();Pt||"undefined"==typeof window||(Pt=window.graphlib);const Gt=Pt;var Lt=function(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev},Ut=function(t,e){if("_next"!==t&&"_prev"!==t)return e};const Ft=function(){function t(){var t={};t._next=t._prev=t,this.isentinel=t}return t.prototype.dequeue=function(){var t=this.isentinel,e=t._prev;if(e!==t)return Lt(e),e},t.prototype.enqueue=function(){var t=this.isentinel,e=t._prev;if(e!==t)return Lt(e),e},t.prototype.toString=function(){for(var t=[],e=this.isentinel,n=e._prev;n!==e;)t.push(JSON.stringify(n,Ut)),n=n._prev;return"["+t.join(", ")+"]"},t}();var Bt=Gt.Graph,zt=function(){return 1},jt=function(t,e,n,r,i){var o,a,u=i?[]:void 0;return null===(o=t.inEdges(r.v))||void 0===o||o.forEach((function(r){var o=t.edge(r),a=t.node(r.v);i&&u.push({v:r.v,w:r.w}),void 0===a.out&&(a.out=0),a.out-=o,Wt(e,n,a)})),null===(a=t.outEdges(r.v))||void 0===a||a.forEach((function(r){var i=t.edge(r),o=r.w,a=t.node(o);void 0===a.in&&(a.in=0),a.in-=i,Wt(e,n,a)})),t.removeNode(r.v),u},Wt=function(t,e,n){n.out?n.in?t[n.out-n.in+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)};const Vt=function(t,e){var n;if(t.nodeCount()<=1)return[];var r=function(t,e){var n=new Bt,r=0,i=0;t.nodes().forEach((function(t){n.setNode(t,{v:t,in:0,out:0})})),t.edges().forEach((function(t){var o=n.edge(t.v,t.w)||0,a=null==e?void 0:e(t),u=o+a;n.setEdge(t.v,t.w,u),i=Math.max(i,n.node(t.v).out+=a),r=Math.max(r,n.node(t.w).in+=a)}));for(var o=[],a=i+r+3,u=0;u<a;u++)o.push(new Ft);var s=r+1;return n.nodes().forEach((function(t){Wt(o,s,n.node(t))})),{buckets:o,zeroIdx:s,graph:n}}(t,e||zt);return null===(n=function(t,e,n){for(var r,i=[],o=e[e.length-1],a=e[0];t.nodeCount();){for(;r=a.dequeue();)jt(t,e,n,r);for(;r=o.dequeue();)jt(t,e,n,r);if(t.nodeCount())for(var u=e.length-2;u>0;--u)if(r=e[u].dequeue()){i=i.concat(jt(t,e,n,r,!0));break}}return i}(r.graph,r.buckets,r.zeroIdx).map((function(e){return t.outEdges(e.v,e.w)})))||void 0===n?void 0:n.flat()};var Xt=Gt.Graph,Ht=function(t,e,n,r){var i;do{i=""+r+Math.random()}while(t.hasNode(i));return n.dummy=e,t.setNode(i,n),i},qt=function(t){var e=(new Xt).setGraph(t.graph());return t.nodes().forEach((function(n){e.setNode(n,t.node(n))})),t.edges().forEach((function(n){var r=e.edge(n.v,n.w)||{weight:0,minlen:1},i=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})})),e},Yt=function(t,e){var n={};return t.forEach((function(t,r){n[t]=e[r]})),n},Kt=function(t){var e=t.nodes().map((function(e){return t.node(e).rank})),n=Math.min.apply(Math,e);t.nodes().forEach((function(e){var r=t.node(e);r.hasOwnProperty("rank")&&(r.rank||(r.rank=0),r.rank-=n)}))},Zt=function(t){var e=t.nodes().map((function(e){return t.node(e).rank})),n=Math.min.apply(Math,e),r=[];t.nodes().forEach((function(e){var i,o=((null===(i=t.node(e))||void 0===i?void 0:i.rank)||0)-n;r[o]||(r[o]=[]),r[o].push(e)}));var i=0,o=t.graph().nodeRankFactor||0;r.forEach((function(e,n){void 0===e&&n%o!=0?--i:i&&e.forEach((function(e){t.node(e).rank||(t.node(e).rank=0),t.node(e).rank+=i}))}))},$t=function(t){var e=t.nodes().map((function(e){var n=t.node(e).rank;return void 0!==n?n:-1/0}));return Math.max.apply(Math,e)},Jt=function(t,e){var n=Date.now();try{return e()}finally{console.log(t+" time: "+(Date.now()-n)+"ms")}},Qt=function(t,e){return e()},te=function(t,e){var n,r=1/0;return t.forEach((function(t){var i=e(t);r>i&&(r=i,n=t)})),n};const ee={addDummyNode:Ht,simplify:qt,asNonCompoundGraph:function(t){var e=new Xt({multigraph:t.isMultigraph()}).setGraph(t.graph());return t.nodes().forEach((function(n){var r;(null===(r=t.children(n))||void 0===r?void 0:r.length)||e.setNode(n,t.node(n))})),t.edges().forEach((function(n){return e.setEdge(n,t.edge(n))})),e},successorWeights:function(t){var e=t.nodes().map((function(e){var n,r={};return null===(n=t.outEdges(e))||void 0===n||n.forEach((function(e){r[e.w]=(r[e.w]||0)+t.edge(e).weight})),r}));return Yt(t.nodes(),e)},predecessorWeights:function(t){var e=t.nodes().map((function(e){var n,r={};return null===(n=t.inEdges(e))||void 0===n||n.forEach((function(e){r[e.v]=(r[e.v]||0)+t.edge(e).weight})),r}));return Yt(t.nodes(),e)},intersectRect:function(t,e){var n,r,i=t.x,o=t.y,a=e.x-i,u=e.y-o,s=t.width/2,c=t.height/2;return a||u?(Math.abs(u)*s>Math.abs(a)*c?(u<0&&(c=-c),n=c*a/u,r=c):(a<0&&(s=-s),n=s,r=s*u/a),{x:i+n,y:o+r}):{x:0,y:0}},buildLayerMatrix:function(t){for(var e=[],n=$t(t)+1,r=0;r<n;r++)e.push([]);return t.nodes().forEach((function(n){var r=t.node(n),i=r.rank;void 0!==i&&(e[i][r.order||0]=n)})),e},normalizeRanks:Kt,removeEmptyRanks:Zt,addBorderNode:function(t,e,n,r){var i={width:0,height:0};return a(n)&&a(r)&&(i.rank=n,i.order=r),Ht(t,"border",i,e)},maxRank:$t,partition:function(t,e){var n={lhs:[],rhs:[]};return t.forEach((function(t){e(t)?n.lhs.push(t):n.rhs.push(t)})),n},time:Jt,notime:Qt,zipObject:Yt,minBy:te};const ne=function(t){t.graph().dummyChains=[],t.edges().forEach((function(e){return function(t,e){var n,r,i=e.v,o=t.node(i).rank,a=e.w,u=t.node(a).rank,s=e.name,c=t.edge(e),f=c.labelRank;if(u!==o+1){var l,h,d;for(t.removeEdge(e),d=0,++o;o<u;++d,++o)c.points=[],l=ee.addDummyNode(t,"edge",h={edgeLabel:c,width:0,height:0,edgeObj:e,rank:o},"_d"),o===f&&(h.width=c.width,h.height=c.height,h.dummy="edge-label",h.labelpos=c.labelpos),t.setEdge(i,l,{weight:c.weight},s),0===d&&(t.graph().dummyChains||(t.graph().dummyChains=[]),null===(r=null===(n=t.graph())||void 0===n?void 0:n.dummyChains)||void 0===r||r.push(l)),i=l;t.setEdge(i,a,{weight:c.weight},s)}}(t,e)}))};var re=function(t){var e={},n=function n(r){var i,o=t.node(r);if(e.hasOwnProperty(r))return o.rank;e[r]=!0;var a=null===(i=t.outEdges(r))||void 0===i?void 0:i.map((function(e){return n(e.w)-t.edge(e).minlen||1/0})),u=Math.min.apply(Math,a);return u!==Number.POSITIVE_INFINITY&&null!=u||(u=0),o.rank=u,u};t.sources().forEach((function(t){return n(t)}))},ie=function(t){var e={},n=0,r=function r(i){var o,a=t.node(i);if(e.hasOwnProperty(i))return a.rank;e[i]=!0;var u=null===(o=t.outEdges(i))||void 0===o?void 0:o.map((function(e){return r(e.w)-t.edge(e).minlen||1/0})),s=Math.min.apply(Math,u);return s!==Number.POSITIVE_INFINITY&&null!=s||(s=0),a.rank=s,n=Math.min(a.rank,n),a.rank};t.sources().forEach((function(t){return r(t)})),n+=1;var i=function e(n,r){var i,o=t.node(n),a=isNaN(o.layer)?r:o.layer;(void 0===o.rank||o.rank<a)&&(o.rank=a),null===(i=t.outEdges(n))||void 0===i||i.map((function(n){e(n.w,a+t.edge(n).minlen)}))};t.nodes().forEach((function(e){var r=t.node(e);isNaN(r.layer)?r.rank-=n:i(e,r.layer)}))},oe=function(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen},ae=Gt.Graph,ue=function(t,e){return t.nodes().forEach((function n(r){e.nodeEdges(r).forEach((function(i){var o=i.v,a=r===o?i.w:o;t.hasNode(a)||oe(e,i)||(t.setNode(a,{}),t.setEdge(r,a,{}),n(a))}))})),t.nodeCount()},se=function(t,e){return t.nodes().forEach((function n(r){var i;null===(i=e.nodeEdges(r))||void 0===i||i.forEach((function(i){var o=i.v,a=r===o?i.w:o;t.hasNode(a)||void 0===e.node(a).layer&&oe(e,i)||(t.setNode(a,{}),t.setEdge(r,a,{}),n(a))}))})),t.nodeCount()},ce=function(t,e){return te(e.edges(),(function(n){return t.hasNode(n.v)!==t.hasNode(n.w)?oe(e,n):1/0}))},fe=function(t,e,n){t.nodes().forEach((function(t){e.node(t).rank||(e.node(t).rank=0),e.node(t).rank+=n}))},le=Gt.alg,he=le.preorder,de=le.postorder,pe=function(t){t=qt(t),re(t);var e,n,r=function(t){var e,n,r=new ae({directed:!1}),i=t.nodes()[0],o=t.nodeCount();for(r.setNode(i,{});ue(r,t)<o;)e=ce(r,t),n=r.hasNode(e.v)?oe(t,e):-oe(t,e),fe(r,t,n);return r}(t);for(me(r),ve(r,t);e=_e(r);)n=xe(r,t,e),we(r,t,e,n)},ve=function(t,e){var n=de(t,t.nodes());(n=n.slice(0,n.length-1)).forEach((function(n){ge(t,e,n)}))},ge=function(t,e,n){var r=t.node(n).parent;t.edge(n,r).cutvalue=ye(t,e,n)},ye=function(t,e,n){var r=t.node(n).parent,i=!0,o=e.edge(n,r),a=0;return o||(i=!1,o=e.edge(r,n)),a=o.weight,e.nodeEdges(n).forEach((function(o){var u=o.v===n,s=u?o.w:o.v;if(s!==r){var c=u===i,f=e.edge(o).weight;if(a+=c?f:-f,Se(t,n,s)){var l=t.edge(n,s).cutvalue;a+=c?-l:l}}})),a},me=function(t,e){void 0!==e&&(e=t.nodes()[0]),be(t,{},1,e)},be=function t(e,n,r,i,o){var a,u=r,s=r,c=e.node(i);return n[i]=!0,null===(a=e.neighbors(i))||void 0===a||a.forEach((function(r){n.hasOwnProperty(r)||(s=t(e,n,s,r,i))})),c.low=u,c.lim=s++,o?c.parent=o:delete c.parent,s},_e=function(t){return t.edges().find((function(e){return t.edge(e).cutvalue<0}))},xe=function(t,e,n){var r=n.v,i=n.w;e.hasEdge(r,i)||(r=n.w,i=n.v);var o=t.node(r),a=t.node(i),u=o,s=!1;o.lim>a.lim&&(u=a,s=!0);var c=e.edges().filter((function(e){return s===Ae(t,t.node(e.v),u)&&s!==Ae(t,t.node(e.w),u)}));return te(c,(function(t){return oe(e,t)}))},we=function(t,e,n,r){var i=n.v,o=n.w;t.removeEdge(i,o),t.setEdge(r.v,r.w,{}),me(t),ve(t,e),Ee(t,e)},Ee=function(t,e){var n=t.nodes().find((function(t){return!e.node(t).parent})),r=he(t,n);(r=r.slice(1)).forEach((function(n){var r=t.node(n).parent,i=e.edge(n,r),o=!1;i||(i=e.edge(r,n),o=!0),e.node(n).rank=e.node(r).rank+(o?i.minlen:-i.minlen)}))},Se=function(t,e,n){return t.hasEdge(e,n)},Ae=function(t,e,n){return n.low<=e.lim&&e.lim<=n.lim};pe.initLowLimValues=me,pe.initCutValues=ve,pe.calcCutValue=ye,pe.leaveEdge=_e,pe.enterEdge=xe,pe.exchangeEdges=we;const Te=pe;var Ie=re,Ce=function(t){ie(t),function(t){var e,n,r=new ae({directed:!1}),i=t.nodes()[0],o=t.nodeCount();for(r.setNode(i,{});se(r,t)<o;)e=ce(r,t),n=r.hasNode(e.v)?oe(t,e):-oe(t,e),fe(r,t,n)}(t)};const De=function(t){switch(t.graph().ranker){case"network-simplex":!function(t){Te(t)}(t);break;default:Ce(t);break;case"longest-path":Ie(t)}};const Ne=function(t){var e,n=function(t){var e,n={},r=0;return null===(e=t.children())||void 0===e||e.forEach((function e(i){var o,a=r;null===(o=t.children(i))||void 0===o||o.forEach(e),n[i]={low:a,lim:r++}})),n}(t);null===(e=t.graph().dummyChains)||void 0===e||e.forEach((function(e){var r,i,o=t.node(e),a=o.edgeObj;if(a)for(var u=function(t,e,n,r){var i,o,a=[],u=[],s=Math.min(e[n].low,e[r].low),c=Math.max(e[n].lim,e[r].lim);i=n;do{i=t.parent(i),a.push(i)}while(i&&(e[i].low>s||c>e[i].lim));for(o=i,i=r;(i=t.parent(i))!==o;)u.push(i);return{lca:o,path:a.concat(u.reverse())}}(t,n,a.v,a.w),s=u.path,c=u.lca,f=0,l=s[f],h=!0;e!==a.w;){if(o=t.node(e),h){for(;(l=s[f])!==c&&t.node(l).maxRank<o.rank;)f++;l===c&&(h=!1)}if(!h){for(;f<s.length-1&&(null===(r=t.node(l=s[f+1]))||void 0===r?void 0:r.minRank)<=o.rank;)f++;l=s[f]}t.setParent(e,l),e=null===(i=t.successors(e))||void 0===i?void 0:i[0]}}))};var ke=function t(e,n,r,i,o,a,u){var s=e.children(u);if(null==s?void 0:s.length){var c=ee.addBorderNode(e,"_bt"),f=ee.addBorderNode(e,"_bb"),l=e.node(u);e.setParent(c,u),l.borderTop=c,e.setParent(f,u),l.borderBottom=f,null==s||s.forEach((function(s){t(e,n,r,i,o,a,s);var l=e.node(s),h=l.borderTop?l.borderTop:s,d=l.borderBottom?l.borderBottom:s,p=l.borderTop?i:2*i,v=h!==d?1:o-a[u]+1;e.setEdge(c,h,{minlen:v,weight:p,nestingEdge:!0}),e.setEdge(d,f,{minlen:v,weight:p,nestingEdge:!0})})),e.parent(u)||e.setEdge(n,c,{weight:0,minlen:o+a[u]})}else u!==n&&e.setEdge(n,u,{weight:0,minlen:r})},Re=function(t){var e,n={},r=function e(r,i){var o=t.children(r);null==o||o.forEach((function(t){return e(t,i+1)})),n[r]=i};return null===(e=t.children())||void 0===e||e.forEach((function(t){return r(t,1)})),n};const Oe=function(t){var e,n=ee.addDummyNode(t,"root",{},"_root"),r=Re(t),i=Math.max.apply(Math,Object.values(r))-1,o=2*i+1;t.graph().nestingRoot=n,t.edges().forEach((function(e){t.edge(e).minlen*=o}));var a=function(t){var e=0;return t.edges().forEach((function(n){e+=t.edge(n).weight})),e}(t)+1;null===(e=t.children())||void 0===e||e.forEach((function(e){ke(t,n,o,a,i,r,e)})),t.graph().nodeRankFactor=o};var Me=function(t,e,n,r,i,o){var a={rank:o,width:0,height:0,borderType:e},u=i[e][o-1],s=ee.addDummyNode(t,"border",a,n);i[e][o]=s,t.setParent(s,r),u&&t.setEdge(u,s,{weight:1})};const Pe=function(t){var e,n=function e(n){var r=t.children(n),i=t.node(n);if((null==r?void 0:r.length)&&r.forEach((function(t){return e(t)})),i.hasOwnProperty("minRank")){i.borderLeft=[],i.borderRight=[];for(var o=i.minRank,a=i.maxRank+1;o<a;++o)Me(t,"borderLeft","_bl",n,i,o),Me(t,"borderRight","_br",n,i,o)}};null===(e=t.children())||void 0===e||e.forEach((function(t){return n(t)}))};var Ge=function(t){t.nodes().forEach((function(e){Le(t.node(e))})),t.edges().forEach((function(e){Le(t.edge(e))}))},Le=function(t){var e=t.width;t.width=t.height,t.height=e},Ue=function(t){t.y=-t.y},Fe=function(t){var e=t.x;t.x=t.y,t.y=e};const Be=function(t){var e,n=null===(e=t.graph().rankdir)||void 0===e?void 0:e.toLowerCase();"bt"!==n&&"rl"!==n||function(t){t.nodes().forEach((function(e){Ue(t.node(e))})),t.edges().forEach((function(e){var n=t.edge(e);n.points.forEach((function(t){return Ue(t)})),n.hasOwnProperty("y")&&Ue(n)}))}(t),"lr"!==n&&"rl"!==n||(function(t){t.nodes().forEach((function(e){Fe(t.node(e))})),t.edges().forEach((function(e){var n=t.edge(e);n.points.forEach((function(t){return Fe(t)})),n.hasOwnProperty("x")&&Fe(n)}))}(t),Ge(t))},ze=function(t){for(var e={},n=t.nodes().filter((function(e){var n;return!(null===(n=t.children(e))||void 0===n?void 0:n.length)})),r=n.map((function(e){return t.node(e).rank})),i=Math.max.apply(Math,r),o=[],a=0;a<i+1;a++)o.push([]);var u=n.sort((function(e,n){return t.node(e).rank-t.node(n).rank}));return u.filter((function(e){return void 0!==t.node(e).fixorder})).sort((function(e,n){return t.node(e).fixorder-t.node(n).fixorder})).forEach((function(n){o[t.node(n).rank].push(n),e[n]=!0})),u.forEach((function n(r){var i;if(!e.hasOwnProperty(r)){e[r]=!0;var a=t.node(r);o[a.rank].push(r),null===(i=t.successors(r))||void 0===i||i.forEach((function(t){return n(t)}))}})),o};var je=function(t,e,n){for(var r=Yt(n,n.map((function(t,e){return e}))),i=e.map((function(e){var n,i=null===(n=t.outEdges(e))||void 0===n?void 0:n.map((function(e){return{pos:r[e.w],weight:t.edge(e).weight}}));return null==i?void 0:i.sort((function(t,e){return t.pos-e.pos}))})).flat(),o=1;o<n.length;)o<<=1;var a=2*o-1;o-=1;var u=Array(a).fill(0,0,a),s=0;return i.forEach((function(t){var e=t.pos+o;u[e]+=t.weight;for(var n=0;e>0;)e%2&&(n+=u[e+1]),u[e=e-1>>1]+=t.weight;s+=t.weight*n})),s};const We=function(t,e){for(var n=0,r=1;r<e.length;++r)n+=je(t,e[r-1],e[r]);return n};var Ve=Gt.Graph;const Xe=function(t,e,n){var r=function(t){for(var e;t.hasNode(e="_root"+Math.random()););return e}(t),i=new Ve({compound:!0}).setGraph({root:r}).setDefaultNodeLabel((function(e){return t.node(e)}));return t.nodes().forEach((function(o){var a=t.node(o),u=t.parent(o);(a.rank===e||a.minRank<=e&&e<=a.maxRank)&&(i.setNode(o),i.setParent(o,u||r),t[n](o).forEach((function(e){var n=e.v===o?e.w:e.v,r=i.edge(n,o),a=void 0!==r?r.weight:0;i.setEdge(n,o,{weight:t.edge(e).weight+a})})),a.hasOwnProperty("minRank")&&i.setNode(o,{borderLeft:a.borderLeft[e],borderRight:a.borderRight[e]}))})),i};var He=function(t,e){var n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0};const qe=function(t,e){var n,r,i={};return t.forEach((function(t,e){var n=i[t.v]={i:e,indegree:0,in:[],out:[],vs:[t.v]};void 0!==t.barycenter&&(n.barycenter=t.barycenter,n.weight=t.weight)})),e.edges().forEach((function(t){var e=i[t.v],n=i[t.w];void 0!==e&&void 0!==n&&(n.indegree++,e.out.push(i[t.w]))})),function(t){for(var e=[],n=function(){var n=t.pop();e.push(n),n.in.reverse().forEach((function(t){return e=n,function(t){t.merged||(void 0!==t.barycenter||void 0!==e.barycenter||t.barycenter>=e.barycenter)&&He(e,t)};var e})),n.out.forEach((function(e){return r=n,function(e){e.in.push(r),0==--e.indegree&&t.push(e)};var r}))};null==t?void 0:t.length;)n();var r=e.filter((function(t){return!t.merged})),i=["vs","i","barycenter","weight"];return r.map((function(t){var e={};return i.forEach((function(n){void 0!==t[n]&&(e[n]=t[n])})),e}))}(null===(r=(n=Object.values(i)).filter)||void 0===r?void 0:r.call(n,(function(t){return!t.indegree})))};var Ye=function(t,e,n){for(var r,i=n;e.length&&(r=e[e.length-1]).i<=i;)e.pop(),t.push(r.vs),i++;return i};const Ke=function t(e,n,r,i,o){var a,u,s,c=e.children(n),f=e.node(n),l=f?f.borderLeft:void 0,h=f?f.borderRight:void 0,d={};l&&(c=null==c?void 0:c.filter((function(t){return t!==l&&t!==h})));var p=function(t,e){return e.map((function(e){var n=t.inEdges(e);if(!(null==n?void 0:n.length))return{v:e};var r={sum:0,weight:0};return n.forEach((function(e){var n=t.edge(e),i=t.node(e.v);r.sum+=n.weight*i.order,r.weight+=n.weight})),{v:e,barycenter:r.sum/r.weight,weight:r.weight}}))}(e,c||[]);p.forEach((function(n){var o,a,u;if(null===(o=e.children(n.v))||void 0===o?void 0:o.length){var s=t(e,n.v,r,i);d[n.v]=s,s.hasOwnProperty("barycenter")&&(u=s,void 0!==(a=n).barycenter?(a.barycenter=(a.barycenter*a.weight+u.barycenter*u.weight)/(a.weight+u.weight),a.weight+=u.weight):(a.barycenter=u.barycenter,a.weight=u.weight))}}));var v=qe(p,r);(function(t,e){t.forEach((function(t){var n=t.vs.map((function(t){return e[t]?e[t].vs:t}));t.vs=n.flat()}))})(v,d),v.forEach((function(t){var n=e.node(t.vs[0]);t.fixorder=n.fixorder,t.order=n.order}));var g=function(t,e,n){var r=ee.partition(t,(function(t){return t.hasOwnProperty("fixorder")&&!isNaN(t.fixorder)||t.hasOwnProperty("barycenter")})),i=r.lhs,o=r.rhs.sort((function(t,e){return-t.i- -e.i})),a=[],u=0,s=0,c=0;i.sort(function(t,e){return function(n,r){if(void 0!==n.fixorder&&void 0!==r.fixorder)return n.fixorder-r.fixorder;if(n.barycenter<r.barycenter)return-1;if(n.barycenter>r.barycenter)return 1;if(e&&void 0!==n.order&&void 0!==r.order){if(n.order<r.order)return-1;if(n.order>r.order)return 1}return t?r.i-n.i:n.i-r.i}}(!!e,!!n)),c=Ye(a,o,c),i.forEach((function(t){c+=t.vs.length,a.push(t.vs),u+=t.barycenter*t.weight,s+=t.weight,c=Ye(a,o,c)}));var f={vs:a.flat()};return s&&(f.barycenter=u/s,f.weight=s),f}(v,i,o);if(l&&(g.vs=[l,g.vs,h].flat(),null===(a=e.predecessors(l))||void 0===a?void 0:a.length)){var y=e.node((null===(u=e.predecessors(l))||void 0===u?void 0:u[0])||{}),m=e.node((null===(s=e.predecessors(h))||void 0===s?void 0:s[0])||{});g.hasOwnProperty("barycenter")||(g.barycenter=0,g.weight=0),g.barycenter=(g.barycenter*g.weight+y.order+m.order)/(g.weight+2),g.weight+=2}return g};var Ze=Gt.Graph,$e=function(t,e,n){return e.map((function(e){return Xe(t,e,n)}))},Je=function(t,e,n){var r=new Ze;null==t||t.forEach((function(t){var i=t.graph().root,o=Ke(t,i,r,e,n);o.vs.forEach((function(e,n){t.node(e).order=n})),function(t,e,n){var r,i={};n.forEach((function(n){for(var o,a,u=t.parent(n);u;){if((o=t.parent(u))?(a=i[o],i[o]=u):(a=r,r=u),a&&a!==u)return void e.setEdge(a,u);u=o}}))}(t,r,o.vs)}))},Qe=function(t,e){null==e||e.forEach((function(e){e.forEach((function(e,n){t.node(e).order=n}))}))};var tn=Gt.Graph,en=function(t,e){var n;if(t.node(e).dummy)return null===(n=t.predecessors(e))||void 0===n?void 0:n.find((function(e){return t.node(e).dummy}))},nn=function(t,e,n){var r=e,i=n;if(r>i){var o=r;r=i,i=o}var a=t[r];a||(t[r]=a={}),a[i]=!0},rn=function(t,e,n){var r=e,i=n;return r>i&&(r=i,i=e),t[r]&&t[r].hasOwnProperty(i)},on=function(t,e,n,r){var i=new tn,o=t.graph(),a=an(o.nodesep,o.edgesep,r);return e.forEach((function(e){var r;e.forEach((function(e){var o=n[e];if(i.setNode(o),r){var u=n[r],s=i.edge(u,o);i.setEdge(u,o,Math.max(a(t,e,r),s||0))}r=e}))})),i};var an=function(t,e,n){return function(r,i,o){var a,u=r.node(i),s=r.node(o),c=0;if(c+=u.width/2,u.hasOwnProperty("labelpos"))switch((u.labelpos||"").toLowerCase()){case"l":a=-u.width/2;break;case"r":a=u.width/2}if(a&&(c+=n?a:-a),a=0,c+=(u.dummy?e:t)/2,c+=(s.dummy?e:t)/2,c+=s.width/2,s.hasOwnProperty("labelpos"))switch((s.labelpos||"").toLowerCase()){case"l":a=s.width/2;break;case"r":a=-s.width/2}return a&&(c+=n?a:-a),a=0,c}},un=function(t,e){var n;return(null===(n=t.node(e))||void 0===n?void 0:n.width)||0};const sn=function(t){var e;!function(t){var e=ee.buildLayerMatrix(t),n=t.graph().ranksep,r=0;e.forEach((function(e){var i=e.map((function(e){return t.node(e).height})),o=Math.max.apply(Math,i);e.forEach((function(e){t.node(e).y=r+o/2})),r+=o+n}))}(t=ee.asNonCompoundGraph(t));var n=function(t){var e,n=ee.buildLayerMatrix(t),r=Object.assign(function(t,e){var n={};return(null==e?void 0:e.length)&&e.reduce((function(e,r){var i=0,o=0,a=e.length,u=r[(null==r?void 0:r.length)-1];return r.forEach((function(e,s){var c=en(t,e),f=c?t.node(c).order:a;(c||e===u)&&(r.slice(o,s+1).forEach((function(e){var r;null===(r=t.predecessors(e))||void 0===r||r.forEach((function(r){var o=t.node(r),a=o.order;!(a<i||f<a)||o.dummy&&t.node(e).dummy||nn(n,r,e)}))})),o=s+1,i=f)})),r})),n}(t,n),function(t,e){var n={},r=function(e,r,i,o,a){for(var u,s=[],c=r;c<i;c++)s.push(c);s.forEach((function(r){var i;u=e[r],t.node(u).dummy&&(null===(i=t.predecessors(u))||void 0===i||i.forEach((function(e){var r=t.node(e);r.dummy&&(r.order<o||r.order>a)&&nn(n,e,u)})))}))};return(null==e?void 0:e.length)&&e.reduce((function(e,n){var i,o=-1,a=0;return n.forEach((function(u,s){if("border"===t.node(u).dummy){var c=t.predecessors(u)||[];c.length&&(i=t.node(c[0]).order,r(n,a,s,o,i),a=s,o=i)}r(n,a,n.length,i,e.length)})),n})),n}(t,n)),i={};["u","d"].forEach((function(o){e="u"===o?n:Object.values(n).reverse(),["l","r"].forEach((function(n){"r"===n&&(e=e.map((function(t){return Object.values(t).reverse()})));var a=("u"===o?t.predecessors:t.successors).bind(t),u=function(t,e,n,r){var i={},o={},a={};return e.forEach((function(t){t.forEach((function(t,e){i[t]=t,o[t]=t,a[t]=e}))})),e.forEach((function(t){var e=-1;t.forEach((function(t){var u=r(t);if(u.length)for(var s=((u=u.sort((function(t,e){return a[t]-a[e]}))).length-1)/2,c=Math.floor(s),f=Math.ceil(s);c<=f;++c){var l=u[c];o[t]===t&&e<a[l]&&!rn(n,t,l)&&(o[l]=t,o[t]=i[t]=i[l],e=a[l])}}))})),{root:i,align:o}}(0,e,r,a),s=function(t,e,n,r,i){var o={},a=on(t,e,n,i),u=i?"borderLeft":"borderRight",s=function(t,e){for(var n=a.nodes(),r=n.pop(),i={};r;)i[r]?t(r):(i[r]=!0,n.push(r),n=n.concat(e(r))),r=n.pop()};return s((function(t){o[t]=(a.inEdges(t)||[]).reduce((function(t,e){return Math.max(t,(o[e.v]||0)+a.edge(e))}),0)}),a.predecessors.bind(a)),s((function(e){var n=(a.outEdges(e)||[]).reduce((function(t,e){return Math.min(t,(o[e.w]||0)-a.edge(e))}),Number.POSITIVE_INFINITY),r=t.node(e);n!==Number.POSITIVE_INFINITY&&r.borderType!==u&&(o[e]=Math.max(o[e],n))}),a.successors.bind(a)),Object.values(r).forEach((function(t){o[t]=o[n[t]]})),o}(t,e,u.root,u.align,"r"===n);"r"===n&&Object.keys(s).forEach((function(t){return s[t]=-s[t]})),i[o+n]=s}))}));var o=function(t,e){return ee.minBy(Object.values(e),(function(e){var n=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY;return Object.keys(e).forEach((function(i){var o=e[i],a=un(t,i)/2;n=Math.max(o+a,n),r=Math.min(o-a,r)})),n-r}))}(t,i);return o&&function(t,e){var n=Object.values(e),r=Math.min.apply(Math,n),i=Math.max.apply(Math,n);["u","d"].forEach((function(n){["l","r"].forEach((function(o){var a,u=n+o,s=t[u];if(s!==e){var c=Object.values(s);(a="l"===o?r-Math.min.apply(Math,c):i-Math.max.apply(Math,c))&&(t[u]={},Object.keys(s).forEach((function(e){t[u][e]=s[e]+a})))}}))}))}(i,o),function(t,e){var n={};return Object.keys(t.ul).forEach((function(r){if(e)n[r]=t[e.toLowerCase()][r];else{var i=Object.values(t).map((function(t){return t[r]})).sort((function(t,e){return t-e}));n[r]=(i[1]+i[2])/2}})),n}(i,t.graph().align)}(t);null===(e=Object.keys(n))||void 0===e||e.forEach((function(e){t.node(e).x=n[e]}))};var cn=Gt.Graph,fn=function(t,e,n){e(" removeSelfEdges",(function(){In(t)})),e(" acyclic",(function(){!function(t){("greedy"===t.graph().acyclicer?Vt(t,function(t){return function(e){return t.edge(e).weight}}(t)):function(t){var e=[],n={},r={};return t.nodes().forEach((function i(o){var a;r.hasOwnProperty(o)||(r[o]=!0,n[o]=!0,null===(a=t.outEdges(o))||void 0===a||a.forEach((function(t){n.hasOwnProperty(t.w)?e.push(t):i(t.w)})),delete n[o])})),e}(t)).forEach((function(e){var n=t.edge(e);t.removeEdge(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,"rev-"+Math.random())}))}(t)})),e(" nestingGraph.run",(function(){Oe(t)})),e(" rank",(function(){De(ee.asNonCompoundGraph(t))})),e(" injectEdgeLabelProxies",(function(){bn(t)})),e(" removeEmptyRanks",(function(){Zt(t)})),e(" nestingGraph.cleanup",(function(){!function(t){var e=t.graph();e.nestingRoot&&t.removeNode(e.nestingRoot),delete e.nestingRoot,t.edges().forEach((function(e){t.edge(e).nestingEdge&&t.removeEdge(e)}))}(t)})),e(" normalizeRanks",(function(){Kt(t)})),e(" assignRankMinMax",(function(){_n(t)})),e(" removeEdgeLabelProxies",(function(){xn(t)})),e(" normalize.run",(function(){ne(t)})),e(" parentDummyChains",(function(){Ne(t)})),e(" addBorderSegments",(function(){Pe(t)})),n&&n.keepNodeOrder&&e(" initDataOrder",(function(){!function(t,e){for(var n=t.nodes().filter((function(e){var n;return!(null===(n=t.children(e))||void 0===n?void 0:n.length)})).map((function(e){return t.node(e).rank})),r=Math.max.apply(Math,n),i=[],o=0;o<r+1;o++)i.push([]);e.forEach((function(e){var n=t.node(e);n&&!n.dummy&&(n.fixorder=i[n.rank].length,i[n.rank].push(e))}))}(t,n.nodeOrder)})),e(" order",(function(){!function(t){for(var e=ee.maxRank(t),n=[],r=[],i=1;i<e+1;i++)n.push(i);for(i=e-1;i>-1;i--)r.push(i);var o=$e(t,n,"inEdges"),a=$e(t,r,"outEdges"),u=ze(t);Qe(t,u);for(var s,c=Number.POSITIVE_INFINITY,f=(i=0,0);f<4;++i,++f)Je(i%2?o:a,i%4>=2),u=ee.buildLayerMatrix(t),(l=We(t,u))<c&&(f=0,s=h(u),c=l);for(u=ze(t),Qe(t,u),i=0,f=0;f<4;++i,++f){var l;Je(i%2?o:a,i%4>=2,!0),u=ee.buildLayerMatrix(t),(l=We(t,u))<c&&(f=0,s=h(u),c=l)}Qe(t,s)}(t)})),e(" insertSelfEdges",(function(){Cn(t)})),e(" adjustCoordinateSystem",(function(){!function(t){var e,n=null===(e=t.graph().rankdir)||void 0===e?void 0:e.toLowerCase();"lr"!==n&&"rl"!==n||Ge(t)}(t)})),e(" position",(function(){sn(t)})),e(" positionSelfEdges",(function(){Dn(t)})),e(" removeBorderNodes",(function(){Tn(t)})),e(" normalize.undo",(function(){!function(t){var e;null===(e=t.graph().dummyChains)||void 0===e||e.forEach((function(e){var n,r,i=t.node(e),o=i.edgeLabel;i.edgeObj&&t.setEdge(i.edgeObj,o);for(var a=e;i.dummy;)r=null===(n=t.successors(a))||void 0===n?void 0:n[0],t.removeNode(a),o.points.push({x:i.x,y:i.y}),"edge-label"===i.dummy&&(o.x=i.x,o.y=i.y,o.width=i.width,o.height=i.height),a=r,i=t.node(a)}))}(t)})),e(" fixupEdgeLabelCoords",(function(){Sn(t)})),e(" undoCoordinateSystem",(function(){Be(t)})),e(" translateGraph",(function(){wn(t)})),e(" assignNodeIntersects",(function(){En(t)})),e(" reversePoints",(function(){An(t)})),e(" acyclic.undo",(function(){!function(t){t.edges().forEach((function(e){var n=t.edge(e);if(n.reversed){t.removeEdge(e);var r=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,r)}}))}(t)}))},ln=["nodesep","edgesep","ranksep","marginx","marginy"],hn={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},dn=["acyclicer","ranker","rankdir","align"],pn=["width","height","layer","fixorder"],vn={width:0,height:0},gn=["minlen","weight","width","height","labeloffset"],yn={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},mn=["labelpos"],bn=function(t){t.edges().forEach((function(e){var n=t.edge(e);if(n.width&&n.height){var r=t.node(e.v),i={e,rank:(t.node(e.w).rank-r.rank)/2+r.rank};ee.addDummyNode(t,"edge-proxy",i,"_ep")}}))},_n=function(t){var e=0;t.nodes().forEach((function(n){var r=t.node(n);r.borderTop&&(r.minRank=t.node(r.borderTop).rank,r.maxRank=t.node(r.borderBottom).rank,e=Math.max(e,r.maxRank||-1/0))})),t.graph().maxRank=e},xn=function(t){t.nodes().forEach((function(e){var n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))}))},wn=function(t){var e=Number.POSITIVE_INFINITY,n=0,r=Number.POSITIVE_INFINITY,i=0,o=t.graph(),a=o.marginx||0,u=o.marginy||0,s=function(t){var o=t.x,a=t.y,u=t.width,s=t.height;e=Math.min(e,o-u/2),n=Math.max(n,o+u/2),r=Math.min(r,a-s/2),i=Math.max(i,a+s/2)};t.nodes().forEach((function(e){s(t.node(e))})),t.edges().forEach((function(e){var n=t.edge(e);n.hasOwnProperty("x")&&s(n)})),e-=a,r-=u,t.nodes().forEach((function(n){var i=t.node(n);i.x-=e,i.y-=r})),t.edges().forEach((function(n){var i,o=t.edge(n);null===(i=o.points)||void 0===i||i.forEach((function(t){t.x-=e,t.y-=r})),o.hasOwnProperty("x")&&(o.x-=e),o.hasOwnProperty("y")&&(o.y-=r)})),o.width=n-e+a,o.height=i-r+u},En=function(t){t.edges().forEach((function(e){var n,r,i=t.edge(e),o=t.node(e.v),a=t.node(e.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=a,r=o),i.points.unshift(ee.intersectRect(o,n)),i.points.push(ee.intersectRect(a,r))}))},Sn=function(t){t.edges().forEach((function(e){var n=t.edge(e);if(n.hasOwnProperty("x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))},An=function(t){t.edges().forEach((function(e){var n=t.edge(e);n.reversed&&n.points.reverse()}))},Tn=function(t){t.nodes().forEach((function(e){var n,r,i;if(null===(n=t.children(e))||void 0===n?void 0:n.length){var o=t.node(e),a=t.node(o.borderTop),u=t.node(o.borderBottom),s=t.node(o.borderLeft[(null===(r=o.borderLeft)||void 0===r?void 0:r.length)-1]),c=t.node(o.borderRight[(null===(i=o.borderRight)||void 0===i?void 0:i.length)-1]);o.width=Math.abs(c.x-s.x),o.height=Math.abs(u.y-a.y),o.x=s.x+o.width/2,o.y=a.y+o.height/2}})),t.nodes().forEach((function(e){"border"===t.node(e).dummy&&t.removeNode(e)}))},In=function(t){t.edges().forEach((function(e){if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}}))},Cn=function(t){ee.buildLayerMatrix(t).forEach((function(e){var n=0;e.forEach((function(e,r){var i,o=t.node(e);o.order=r+n,null===(i=o.selfEdges)||void 0===i||i.forEach((function(e){ee.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:o.rank,order:r+ ++n,e:e.e,label:e.label},"_se")})),delete o.selfEdges}))}))},Dn=function(t){t.nodes().forEach((function(e){var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),i=r.x+r.width/2,o=r.y,a=n.x-i,u=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:i+2*a/3,y:o-u},{x:i+5*a/6,y:o-u},{y:o,x:i+a},{x:i+5*a/6,y:o+u},{x:i+2*a/3,y:o+u}],n.label.x=n.x,n.label.y=n.y}}))},Nn=function(t,e){var n={};return e.forEach((function(e){void 0!==t[e]&&(n[e]=+t[e])})),n},kn=function(t){var e={};return Object.keys(t).forEach((function(n){var r=t[n];e[n.toLowerCase()]=r})),e};const Rn={graphlib:Gt,layout:function(t,e){var n=e&&e.debugTiming?ee.time:ee.notime;n("layout",(function(){e&&!e.keepNodeOrder&&e.prevGraph&&n(" inheritOrder",(function(){var n,r,i;n=t,r=e.prevGraph,i=r._nodes||{},n.nodes().forEach((function(t){var e=n.node(t);void 0!==i[t]?(e.fixorder=i[t]._order,delete i[t]._order):delete e.fixorder}))}));var r=n(" buildLayoutGraph",(function(){return function(t){var e=new cn({multigraph:!0,compound:!0}),n=kn(t.graph()),r={};return dn.forEach((function(t){void 0!==n[t]&&(r[t]=n[t])})),e.setGraph(Object.assign({},hn,Nn(n,ln),r)),t.nodes().forEach((function(n){var r=kn(t.node(n)),i=Nn(r,pn);Object.keys(vn).forEach((function(t){void 0===i[t]&&(i[t]=vn[t])})),e.setNode(n,i),e.setParent(n,t.parent(n))})),t.edges().forEach((function(n){var r=kn(t.edge(n)),i={};mn.forEach((function(t){void 0!==r[t]&&(i[t]=r[t])})),e.setEdge(n,Object.assign({},yn,Nn(r,gn),i))})),e}(t)}));e&&!1===e.edgeLabelSpace||n(" makeSpaceForEdgeLabels",(function(){!function(t){var e=t.graph();e.ranksep||(e.ranksep=0),e.ranksep/=2,t.nodes().forEach((function(e){var n=t.node(e);isNaN(n.layer)||(n.layer?n.layer*=2:n.layer=0)})),t.edges().forEach((function(n){var r,i=t.edge(n);i.minlen*=2,"c"!==(null===(r=i.labelpos)||void 0===r?void 0:r.toLowerCase())&&("TB"===e.rankdir||"BT"===e.rankdir?i.width+=i.labeloffset:i.height+=i.labeloffset)}))}(r)}));try{n(" runLayout",(function(){fn(r,n,e)}))}catch(t){if("Not possible to find intersection inside of the rectangle"===t.message)return void console.error("The following error may be caused by improper layer setting, please make sure your manual layer setting does not violate the graph's structure:\n",t);throw t}n(" updateInputGraph",(function(){!function(t,e){t.nodes().forEach((function(n){var r,i=t.node(n),o=e.node(n);i&&(i.x=o.x,i.y=o.y,i._order=o.order,i._rank=o.rank,(null===(r=e.children(n))||void 0===r?void 0:r.length)&&(i.width=o.width,i.height=o.height))})),t.edges().forEach((function(n){var r=t.edge(n),i=e.edge(n);r.points=i.points,i.hasOwnProperty("x")&&(r.x=i.x,r.y=i.y)})),t.graph().width=e.graph().width,t.graph().height=e.graph().height}(t,r)}))}))},util:{time:Jt,notime:Qt}};var On=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Mn=function(t){function e(e){var n=t.call(this)||this;return n.rankdir="TB",n.nodesep=50,n.ranksep=50,n.controlPoints=!1,n.sortByCombo=!1,n.edgeLabelSpace=!0,n.nodes=[],n.edges=[],n.onLayoutEnd=function(){},n.layoutNode=function(t){var e=n.nodes.find((function(e){return e.id===t}));return!e||!1!==e.layout},n.updateCfg(e),n}return On(e,t),e.prototype.getDefaultCfg=function(){return{rankdir:"TB",align:void 0,nodeSize:void 0,nodesepFunc:void 0,ranksepFunc:void 0,nodesep:50,ranksep:50,controlPoints:!1}},e.prototype.execute=function(){var t=this,e=this,n=e.nodes,r=e.nodeSize,i=e.rankdir,u=e.combos,s=e.begin;if(n){var c,f=e.edges||[],h=new Rn.graphlib.Graph({multigraph:!0,compound:!0});c=r?o(r)?function(){return r}:function(){return[r,r]}:function(t){return t.size?o(t.size)?t.size:l(t.size)?[t.size.width||40,t.size.height||40]:[t.size,t.size]:[40,40]};var p=Pn(e.nodesepFunc,e.nodesep,50),v=Pn(e.ranksepFunc,e.ranksep,50);"LR"!==i&&"RL"!==i||(p=Pn(e.ranksepFunc,e.ranksep,50),v=Pn(e.nodesepFunc,e.nodesep,50)),h.setDefaultEdgeLabel((function(){return{}})),h.setGraph(e);var g={};n.filter((function(t){return!1!==t.layout})).forEach((function(e){var n=c(e),r=v(e),i=p(e),o=n[0]+2*i,u=n[1]+2*r,s=e.layer;a(s)?h.setNode(e.id,{width:o,height:u,layer:s}):h.setNode(e.id,{width:o,height:u}),t.sortByCombo&&e.comboId&&(g[e.comboId]||(g[e.comboId]=!0,h.setNode(e.comboId,{})),h.setParent(e.id,e.comboId))})),this.sortByCombo&&u&&u.forEach((function(t){t.parentId&&(g[t.parentId]||(g[t.parentId]=!0,h.setNode(t.parentId,{})),h.setParent(t.id,t.parentId))})),f.forEach((function(e){var n=d(e,"source"),r=d(e,"target");t.layoutNode(n)&&t.layoutNode(r)&&h.setEdge(n,r,{weight:e.weight||1})}));var y=void 0;e.preset&&(y=new Rn.graphlib.Graph({multigraph:!0,compound:!0}),e.preset.nodes.forEach((function(t){null==y||y.setNode(t.id,t)}))),Rn.layout(h,{prevGraph:y,edgeLabelSpace:e.edgeLabelSpace,keepNodeOrder:Boolean(!!e.nodeOrder),nodeOrder:e.nodeOrder});var m=[0,0];if(s){var b=1/0,_=1/0;h.nodes().forEach((function(t){var e=h.node(t);b>e.x&&(b=e.x),_>e.y&&(_=e.y)})),h.edges().forEach((function(t){h.edge(t).points.forEach((function(t){b>t.x&&(b=t.x),_>t.y&&(_=t.y)}))})),m[0]=s[0]-b,m[1]=s[1]-_}return h.nodes().forEach((function(t){var e=h.node(t),r=n.findIndex((function(e){return e.id===t}));n[r]&&(n[r].x=e.x+m[0],n[r].y=e.y+m[1],n[r]._order=e._order)})),h.edges().forEach((function(t){var n=h.edge(t),r=f.findIndex((function(e){var n=d(e,"source"),r=d(e,"target");return n===t.v&&r===t.w}));e.edgeLabelSpace&&e.controlPoints&&"loop"!==f[r].type&&(f[r].controlPoints=n.points.slice(1,n.points.length-1),f[r].controlPoints.forEach((function(t){t.x+=m[0],t.y+=m[1]})))})),e.onLayoutEnd&&e.onLayoutEnd(),{nodes:n,edges:f}}},e.prototype.getType=function(){return"dagre"},e}(t);function Pn(t,e,n){return t||(a(e)?function(){return e}:function(){return n})}const Gn=Object.prototype.toString;function Ln(t){return Gn.call(t).endsWith("Array]")}const Un=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Ln(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");var n=e.fromIndex,r=void 0===n?0:n,i=e.toIndex,o=void 0===i?t.length:i;if(r<0||r>=t.length||!Number.isInteger(r))throw new Error("fromIndex must be a positive integer smaller than length");if(o<=r||o>t.length||!Number.isInteger(o))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var a=t[r],u=r+1;u<o;u++)t[u]>a&&(a=t[u]);return a},Fn=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Ln(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");var n=e.fromIndex,r=void 0===n?0:n,i=e.toIndex,o=void 0===i?t.length:i;if(r<0||r>=t.length||!Number.isInteger(r))throw new Error("fromIndex must be a positive integer smaller than length");if(o<=r||o>t.length||!Number.isInteger(o))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var a=t[r],u=r+1;u<o;u++)t[u]<a&&(a=t[u]);return a};function Bn(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Ln(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");if(void 0!==n.output){if(!Ln(n.output))throw new TypeError("output option must be an array if specified");e=n.output}else e=new Array(t.length);var r=Fn(t),i=Un(t);if(r===i)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var o=n.min,a=void 0===o?n.autoMinMax?r:0:o,u=n.max,s=void 0===u?n.autoMinMax?i:1:u;if(a>=s)throw new RangeError("min option must be smaller than max option");for(var c=(s-a)/(i-r),f=0;f<t.length;f++)e[f]=(t[f]-r)*c+a;return e}const zn=" ".repeat(2),jn=" ".repeat(4);function Wn(t,e={}){const{maxRows:n=15,maxColumns:r=10,maxNumSize:i=8}=e;return`${t.constructor.name} {\n${zn}[\n${jn}${function(t,e,n,r){const{rows:i,columns:o}=t,a=Math.min(i,e),u=Math.min(o,n),s=[];for(let e=0;e<a;e++){let n=[];for(let i=0;i<u;i++)n.push(Vn(t.get(e,i),r));s.push(`${n.join(" ")}`)}return u!==o&&(s[s.length-1]+=` ... ${o-n} more columns`),a!==i&&s.push(`... ${i-e} more rows`),s.join(`\n${jn}`)}(t,n,r,i)}\n${zn}]\n${zn}rows: ${t.rows}\n${zn}columns: ${t.columns}\n}`}function Vn(t,e){const n=String(t);if(n.length<=e)return n.padEnd(e," ");const r=t.toPrecision(e-2);if(r.length<=e)return r;const i=t.toExponential(e-2),o=i.indexOf("e"),a=i.slice(o);return i.slice(0,e-a.length)+a}function Xn(t,e,n){let r=n?t.rows:t.rows-1;if(e<0||e>r)throw new RangeError("Row index out of range")}function Hn(t,e,n){let r=n?t.columns:t.columns-1;if(e<0||e>r)throw new RangeError("Column index out of range")}function qn(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.columns)throw new RangeError("vector size must be the same as the number of columns");return e}function Yn(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.rows)throw new RangeError("vector size must be the same as the number of rows");return e}function Kn(t,e){if("object"!=typeof e)throw new TypeError("unexpected type for row indices");if(e.some((e=>e<0||e>=t.rows)))throw new RangeError("row indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function Zn(t,e){if("object"!=typeof e)throw new TypeError("unexpected type for column indices");if(e.some((e=>e<0||e>=t.columns)))throw new RangeError("column indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function $n(t,e,n,r,i){if(5!==arguments.length)throw new RangeError("expected 4 arguments");if(Qn("startRow",e),Qn("endRow",n),Qn("startColumn",r),Qn("endColumn",i),e>n||r>i||e<0||e>=t.rows||n<0||n>=t.rows||r<0||r>=t.columns||i<0||i>=t.columns)throw new RangeError("Submatrix indices are out of range")}function Jn(t,e=0){let n=[];for(let r=0;r<t;r++)n.push(e);return n}function Qn(t,e){if("number"!=typeof e)throw new TypeError(`${t} must be a number`)}function tr(t){if(t.isEmpty())throw new Error("Empty matrix has no elements to index")}class er{static from1DArray(t,e,n){if(t*e!==n.length)throw new RangeError("data length does not match given dimensions");let r=new rr(t,e);for(let i=0;i<t;i++)for(let t=0;t<e;t++)r.set(i,t,n[i*e+t]);return r}static rowVector(t){let e=new rr(1,t.length);for(let n=0;n<t.length;n++)e.set(0,n,t[n]);return e}static columnVector(t){let e=new rr(t.length,1);for(let n=0;n<t.length;n++)e.set(n,0,t[n]);return e}static zeros(t,e){return new rr(t,e)}static ones(t,e){return new rr(t,e).fill(1)}static rand(t,e,n={}){if("object"!=typeof n)throw new TypeError("options must be an object");const{random:r=Math.random}=n;let i=new rr(t,e);for(let n=0;n<t;n++)for(let t=0;t<e;t++)i.set(n,t,r());return i}static randInt(t,e,n={}){if("object"!=typeof n)throw new TypeError("options must be an object");const{min:r=0,max:i=1e3,random:o=Math.random}=n;if(!Number.isInteger(r))throw new TypeError("min must be an integer");if(!Number.isInteger(i))throw new TypeError("max must be an integer");if(r>=i)throw new RangeError("min must be smaller than max");let a=i-r,u=new rr(t,e);for(let n=0;n<t;n++)for(let t=0;t<e;t++){let e=r+Math.round(o()*a);u.set(n,t,e)}return u}static eye(t,e,n){void 0===e&&(e=t),void 0===n&&(n=1);let r=Math.min(t,e),i=this.zeros(t,e);for(let t=0;t<r;t++)i.set(t,t,n);return i}static diag(t,e,n){let r=t.length;void 0===e&&(e=r),void 0===n&&(n=e);let i=Math.min(r,e,n),o=this.zeros(e,n);for(let e=0;e<i;e++)o.set(e,e,t[e]);return o}static min(t,e){t=this.checkMatrix(t),e=this.checkMatrix(e);let n=t.rows,r=t.columns,i=new rr(n,r);for(let o=0;o<n;o++)for(let n=0;n<r;n++)i.set(o,n,Math.min(t.get(o,n),e.get(o,n)));return i}static max(t,e){t=this.checkMatrix(t),e=this.checkMatrix(e);let n=t.rows,r=t.columns,i=new this(n,r);for(let o=0;o<n;o++)for(let n=0;n<r;n++)i.set(o,n,Math.max(t.get(o,n),e.get(o,n)));return i}static checkMatrix(t){return er.isMatrix(t)?t:new rr(t)}static isMatrix(t){return null!=t&&"Matrix"===t.klass}get size(){return this.rows*this.columns}apply(t){if("function"!=typeof t)throw new TypeError("callback must be a function");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)t.call(this,e,n);return this}to1DArray(){let t=[];for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)t.push(this.get(e,n));return t}to2DArray(){let t=[];for(let e=0;e<this.rows;e++){t.push([]);for(let n=0;n<this.columns;n++)t[e].push(this.get(e,n))}return t}toJSON(){return this.to2DArray()}isRowVector(){return 1===this.rows}isColumnVector(){return 1===this.columns}isVector(){return 1===this.rows||1===this.columns}isSquare(){return this.rows===this.columns}isEmpty(){return 0===this.rows||0===this.columns}isSymmetric(){if(this.isSquare()){for(let t=0;t<this.rows;t++)for(let e=0;e<=t;e++)if(this.get(t,e)!==this.get(e,t))return!1;return!0}return!1}isEchelonForm(){let t=0,e=0,n=-1,r=!0,i=!1;for(;t<this.rows&&r;){for(e=0,i=!1;e<this.columns&&!1===i;)0===this.get(t,e)?e++:1===this.get(t,e)&&e>n?(i=!0,n=e):(r=!1,i=!0);t++}return r}isReducedEchelonForm(){let t=0,e=0,n=-1,r=!0,i=!1;for(;t<this.rows&&r;){for(e=0,i=!1;e<this.columns&&!1===i;)0===this.get(t,e)?e++:1===this.get(t,e)&&e>n?(i=!0,n=e):(r=!1,i=!0);for(let n=e+1;n<this.rows;n++)0!==this.get(t,n)&&(r=!1);t++}return r}echelonForm(){let t=this.clone(),e=0,n=0;for(;e<t.rows&&n<t.columns;){let r=e;for(let i=e;i<t.rows;i++)t.get(i,n)>t.get(r,n)&&(r=i);if(0===t.get(r,n))n++;else{t.swapRows(e,r);let i=t.get(e,n);for(let r=n;r<t.columns;r++)t.set(e,r,t.get(e,r)/i);for(let r=e+1;r<t.rows;r++){let i=t.get(r,n)/t.get(e,n);t.set(r,n,0);for(let o=n+1;o<t.columns;o++)t.set(r,o,t.get(r,o)-t.get(e,o)*i)}e++,n++}}return t}reducedEchelonForm(){let t=this.echelonForm(),e=t.columns,n=t.rows,r=n-1;for(;r>=0;)if(0===t.maxRow(r))r--;else{let i=0,o=!1;for(;i<n&&!1===o;)1===t.get(r,i)?o=!0:i++;for(let n=0;n<r;n++){let o=t.get(n,i);for(let a=i;a<e;a++){let e=t.get(n,a)-o*t.get(r,a);t.set(n,a,e)}}r--}return t}set(){throw new Error("set method is unimplemented")}get(){throw new Error("get method is unimplemented")}repeat(t={}){if("object"!=typeof t)throw new TypeError("options must be an object");const{rows:e=1,columns:n=1}=t;if(!Number.isInteger(e)||e<=0)throw new TypeError("rows must be a positive integer");if(!Number.isInteger(n)||n<=0)throw new TypeError("columns must be a positive integer");let r=new rr(this.rows*e,this.columns*n);for(let t=0;t<e;t++)for(let e=0;e<n;e++)r.setSubMatrix(this,this.rows*t,this.columns*e);return r}fill(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,t);return this}neg(){return this.mulS(-1)}getRow(t){Xn(this,t);let e=[];for(let n=0;n<this.columns;n++)e.push(this.get(t,n));return e}getRowVector(t){return rr.rowVector(this.getRow(t))}setRow(t,e){Xn(this,t),e=qn(this,e);for(let n=0;n<this.columns;n++)this.set(t,n,e[n]);return this}swapRows(t,e){Xn(this,t),Xn(this,e);for(let n=0;n<this.columns;n++){let r=this.get(t,n);this.set(t,n,this.get(e,n)),this.set(e,n,r)}return this}getColumn(t){Hn(this,t);let e=[];for(let n=0;n<this.rows;n++)e.push(this.get(n,t));return e}getColumnVector(t){return rr.columnVector(this.getColumn(t))}setColumn(t,e){Hn(this,t),e=Yn(this,e);for(let n=0;n<this.rows;n++)this.set(n,t,e[n]);return this}swapColumns(t,e){Hn(this,t),Hn(this,e);for(let n=0;n<this.rows;n++){let r=this.get(n,t);this.set(n,t,this.get(n,e)),this.set(n,e,r)}return this}addRowVector(t){t=qn(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)+t[n]);return this}subRowVector(t){t=qn(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)-t[n]);return this}mulRowVector(t){t=qn(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)*t[n]);return this}divRowVector(t){t=qn(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)/t[n]);return this}addColumnVector(t){t=Yn(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)+t[e]);return this}subColumnVector(t){t=Yn(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)-t[e]);return this}mulColumnVector(t){t=Yn(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)*t[e]);return this}divColumnVector(t){t=Yn(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)/t[e]);return this}mulRow(t,e){Xn(this,t);for(let n=0;n<this.columns;n++)this.set(t,n,this.get(t,n)*e);return this}mulColumn(t,e){Hn(this,t);for(let n=0;n<this.rows;n++)this.set(n,t,this.get(n,t)*e);return this}max(){if(this.isEmpty())return NaN;let t=this.get(0,0);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.get(e,n)>t&&(t=this.get(e,n));return t}maxIndex(){tr(this);let t=this.get(0,0),e=[0,0];for(let n=0;n<this.rows;n++)for(let r=0;r<this.columns;r++)this.get(n,r)>t&&(t=this.get(n,r),e[0]=n,e[1]=r);return e}min(){if(this.isEmpty())return NaN;let t=this.get(0,0);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.get(e,n)<t&&(t=this.get(e,n));return t}minIndex(){tr(this);let t=this.get(0,0),e=[0,0];for(let n=0;n<this.rows;n++)for(let r=0;r<this.columns;r++)this.get(n,r)<t&&(t=this.get(n,r),e[0]=n,e[1]=r);return e}maxRow(t){if(Xn(this,t),this.isEmpty())return NaN;let e=this.get(t,0);for(let n=1;n<this.columns;n++)this.get(t,n)>e&&(e=this.get(t,n));return e}maxRowIndex(t){Xn(this,t),tr(this);let e=this.get(t,0),n=[t,0];for(let r=1;r<this.columns;r++)this.get(t,r)>e&&(e=this.get(t,r),n[1]=r);return n}minRow(t){if(Xn(this,t),this.isEmpty())return NaN;let e=this.get(t,0);for(let n=1;n<this.columns;n++)this.get(t,n)<e&&(e=this.get(t,n));return e}minRowIndex(t){Xn(this,t),tr(this);let e=this.get(t,0),n=[t,0];for(let r=1;r<this.columns;r++)this.get(t,r)<e&&(e=this.get(t,r),n[1]=r);return n}maxColumn(t){if(Hn(this,t),this.isEmpty())return NaN;let e=this.get(0,t);for(let n=1;n<this.rows;n++)this.get(n,t)>e&&(e=this.get(n,t));return e}maxColumnIndex(t){Hn(this,t),tr(this);let e=this.get(0,t),n=[0,t];for(let r=1;r<this.rows;r++)this.get(r,t)>e&&(e=this.get(r,t),n[0]=r);return n}minColumn(t){if(Hn(this,t),this.isEmpty())return NaN;let e=this.get(0,t);for(let n=1;n<this.rows;n++)this.get(n,t)<e&&(e=this.get(n,t));return e}minColumnIndex(t){Hn(this,t),tr(this);let e=this.get(0,t),n=[0,t];for(let r=1;r<this.rows;r++)this.get(r,t)<e&&(e=this.get(r,t),n[0]=r);return n}diag(){let t=Math.min(this.rows,this.columns),e=[];for(let n=0;n<t;n++)e.push(this.get(n,n));return e}norm(t="frobenius"){let e=0;if("max"===t)return this.max();if("frobenius"===t){for(let t=0;t<this.rows;t++)for(let n=0;n<this.columns;n++)e+=this.get(t,n)*this.get(t,n);return Math.sqrt(e)}throw new RangeError(`unknown norm type: ${t}`)}cumulativeSum(){let t=0;for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)t+=this.get(e,n),this.set(e,n,t);return this}dot(t){er.isMatrix(t)&&(t=t.to1DArray());let e=this.to1DArray();if(e.length!==t.length)throw new RangeError("vectors do not have the same size");let n=0;for(let r=0;r<e.length;r++)n+=e[r]*t[r];return n}mmul(t){t=rr.checkMatrix(t);let e=this.rows,n=this.columns,r=t.columns,i=new rr(e,r),o=new Float64Array(n);for(let a=0;a<r;a++){for(let e=0;e<n;e++)o[e]=t.get(e,a);for(let t=0;t<e;t++){let e=0;for(let r=0;r<n;r++)e+=this.get(t,r)*o[r];i.set(t,a,e)}}return i}strassen2x2(t){t=rr.checkMatrix(t);let e=new rr(2,2);const n=this.get(0,0),r=t.get(0,0),i=this.get(0,1),o=t.get(0,1),a=this.get(1,0),u=t.get(1,0),s=this.get(1,1),c=t.get(1,1),f=(n+s)*(r+c),l=(a+s)*r,h=n*(o-c),d=s*(u-r),p=(n+i)*c,v=f+d-p+(i-s)*(u+c),g=h+p,y=l+d,m=f-l+h+(a-n)*(r+o);return e.set(0,0,v),e.set(0,1,g),e.set(1,0,y),e.set(1,1,m),e}strassen3x3(t){t=rr.checkMatrix(t);let e=new rr(3,3);const n=this.get(0,0),r=this.get(0,1),i=this.get(0,2),o=this.get(1,0),a=this.get(1,1),u=this.get(1,2),s=this.get(2,0),c=this.get(2,1),f=this.get(2,2),l=t.get(0,0),h=t.get(0,1),d=t.get(0,2),p=t.get(1,0),v=t.get(1,1),g=t.get(1,2),y=t.get(2,0),m=t.get(2,1),b=t.get(2,2),_=(n-o)*(-h+v),x=(-n+o+a)*(l-h+v),w=(o+a)*(-l+h),E=n*l,S=(-n+s+c)*(l-d+g),A=(-n+s)*(d-g),T=(s+c)*(-l+d),I=(-i+c+f)*(v+y-m),C=(i-f)*(v-m),D=i*y,N=(c+f)*(-y+m),k=(-i+a+u)*(g+y-b),R=(i-u)*(g-b),O=(a+u)*(-y+b),M=E+D+r*p,P=(n+r+i-o-a-c-f)*v+x+w+E+I+D+N,G=E+S+T+(n+r+i-a-u-s-c)*g+D+k+O,L=_+a*(-l+h+p-v-g-y+b)+x+E+D+k+R,U=_+x+w+E+u*m,F=D+k+R+O+o*d,B=E+S+A+c*(-l+d+p-v-g-y+m)+I+C+D,z=I+C+D+N+s*h,j=E+S+A+T+f*b;return e.set(0,0,M),e.set(0,1,P),e.set(0,2,G),e.set(1,0,L),e.set(1,1,U),e.set(1,2,F),e.set(2,0,B),e.set(2,1,z),e.set(2,2,j),e}mmulStrassen(t){t=rr.checkMatrix(t);let e=this.clone(),n=e.rows,r=e.columns,i=t.rows,o=t.columns;function a(t,e,n){let r=t.rows,i=t.columns;if(r===e&&i===n)return t;{let r=er.zeros(e,n);return r=r.setSubMatrix(t,0,0),r}}r!==i&&console.warn(`Multiplying ${n} x ${r} and ${i} x ${o} matrix: dimensions do not match.`);let u=Math.max(n,i),s=Math.max(r,o);return e=a(e,u,s),function t(e,n,r,i){if(r<=512||i<=512)return e.mmul(n);r%2==1&&i%2==1?(e=a(e,r+1,i+1),n=a(n,r+1,i+1)):r%2==1?(e=a(e,r+1,i),n=a(n,r+1,i)):i%2==1&&(e=a(e,r,i+1),n=a(n,r,i+1));let o=parseInt(e.rows/2,10),u=parseInt(e.columns/2,10),s=e.subMatrix(0,o-1,0,u-1),c=n.subMatrix(0,o-1,0,u-1),f=e.subMatrix(0,o-1,u,e.columns-1),l=n.subMatrix(0,o-1,u,n.columns-1),h=e.subMatrix(o,e.rows-1,0,u-1),d=n.subMatrix(o,n.rows-1,0,u-1),p=e.subMatrix(o,e.rows-1,u,e.columns-1),v=n.subMatrix(o,n.rows-1,u,n.columns-1),g=t(er.add(s,p),er.add(c,v),o,u),y=t(er.add(h,p),c,o,u),m=t(s,er.sub(l,v),o,u),b=t(p,er.sub(d,c),o,u),_=t(er.add(s,f),v,o,u),x=t(er.sub(h,s),er.add(c,l),o,u),w=t(er.sub(f,p),er.add(d,v),o,u),E=er.add(g,b);E.sub(_),E.add(w);let S=er.add(m,_),A=er.add(y,b),T=er.sub(g,y);T.add(m),T.add(x);let I=er.zeros(2*E.rows,2*E.columns);return I=I.setSubMatrix(E,0,0),I=I.setSubMatrix(S,E.rows,0),I=I.setSubMatrix(A,0,E.columns),I=I.setSubMatrix(T,E.rows,E.columns),I.subMatrix(0,r-1,0,i-1)}(e,t=a(t,u,s),u,s)}scaleRows(t={}){if("object"!=typeof t)throw new TypeError("options must be an object");const{min:e=0,max:n=1}=t;if(!Number.isFinite(e))throw new TypeError("min must be a number");if(!Number.isFinite(n))throw new TypeError("max must be a number");if(e>=n)throw new RangeError("min must be smaller than max");let r=new rr(this.rows,this.columns);for(let t=0;t<this.rows;t++){const i=this.getRow(t);i.length>0&&Bn(i,{min:e,max:n,output:i}),r.setRow(t,i)}return r}scaleColumns(t={}){if("object"!=typeof t)throw new TypeError("options must be an object");const{min:e=0,max:n=1}=t;if(!Number.isFinite(e))throw new TypeError("min must be a number");if(!Number.isFinite(n))throw new TypeError("max must be a number");if(e>=n)throw new RangeError("min must be smaller than max");let r=new rr(this.rows,this.columns);for(let t=0;t<this.columns;t++){const i=this.getColumn(t);i.length&&Bn(i,{min:e,max:n,output:i}),r.setColumn(t,i)}return r}flipRows(){const t=Math.ceil(this.columns/2);for(let e=0;e<this.rows;e++)for(let n=0;n<t;n++){let t=this.get(e,n),r=this.get(e,this.columns-1-n);this.set(e,n,r),this.set(e,this.columns-1-n,t)}return this}flipColumns(){const t=Math.ceil(this.rows/2);for(let e=0;e<this.columns;e++)for(let n=0;n<t;n++){let t=this.get(n,e),r=this.get(this.rows-1-n,e);this.set(n,e,r),this.set(this.rows-1-n,e,t)}return this}kroneckerProduct(t){t=rr.checkMatrix(t);let e=this.rows,n=this.columns,r=t.rows,i=t.columns,o=new rr(e*r,n*i);for(let a=0;a<e;a++)for(let e=0;e<n;e++)for(let n=0;n<r;n++)for(let u=0;u<i;u++)o.set(r*a+n,i*e+u,this.get(a,e)*t.get(n,u));return o}kroneckerSum(t){if(t=rr.checkMatrix(t),!this.isSquare()||!t.isSquare())throw new Error("Kronecker Sum needs two Square Matrices");let e=this.rows,n=t.rows,r=this.kroneckerProduct(rr.eye(n,n)),i=rr.eye(e,e).kroneckerProduct(t);return r.add(i)}transpose(){let t=new rr(this.columns,this.rows);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)t.set(n,e,this.get(e,n));return t}sortRows(t=nr){for(let e=0;e<this.rows;e++)this.setRow(e,this.getRow(e).sort(t));return this}sortColumns(t=nr){for(let e=0;e<this.columns;e++)this.setColumn(e,this.getColumn(e).sort(t));return this}subMatrix(t,e,n,r){$n(this,t,e,n,r);let i=new rr(e-t+1,r-n+1);for(let o=t;o<=e;o++)for(let e=n;e<=r;e++)i.set(o-t,e-n,this.get(o,e));return i}subMatrixRow(t,e,n){if(void 0===e&&(e=0),void 0===n&&(n=this.columns-1),e>n||e<0||e>=this.columns||n<0||n>=this.columns)throw new RangeError("Argument out of range");let r=new rr(t.length,n-e+1);for(let i=0;i<t.length;i++)for(let o=e;o<=n;o++){if(t[i]<0||t[i]>=this.rows)throw new RangeError(`Row index out of range: ${t[i]}`);r.set(i,o-e,this.get(t[i],o))}return r}subMatrixColumn(t,e,n){if(void 0===e&&(e=0),void 0===n&&(n=this.rows-1),e>n||e<0||e>=this.rows||n<0||n>=this.rows)throw new RangeError("Argument out of range");let r=new rr(n-e+1,t.length);for(let i=0;i<t.length;i++)for(let o=e;o<=n;o++){if(t[i]<0||t[i]>=this.columns)throw new RangeError(`Column index out of range: ${t[i]}`);r.set(o-e,i,this.get(o,t[i]))}return r}setSubMatrix(t,e,n){if((t=rr.checkMatrix(t)).isEmpty())return this;$n(this,e,e+t.rows-1,n,n+t.columns-1);for(let r=0;r<t.rows;r++)for(let i=0;i<t.columns;i++)this.set(e+r,n+i,t.get(r,i));return this}selection(t,e){let n=function(t,e,n){return{row:Kn(t,e),column:Zn(t,n)}}(this,t,e),r=new rr(t.length,e.length);for(let t=0;t<n.row.length;t++){let e=n.row[t];for(let i=0;i<n.column.length;i++){let o=n.column[i];r.set(t,i,this.get(e,o))}}return r}trace(){let t=Math.min(this.rows,this.columns),e=0;for(let n=0;n<t;n++)e+=this.get(n,n);return e}clone(){let t=new rr(this.rows,this.columns);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)t.set(e,n,this.get(e,n));return t}sum(t){switch(t){case"row":return function(t){let e=Jn(t.rows);for(let n=0;n<t.rows;++n)for(let r=0;r<t.columns;++r)e[n]+=t.get(n,r);return e}(this);case"column":return function(t){let e=Jn(t.columns);for(let n=0;n<t.rows;++n)for(let r=0;r<t.columns;++r)e[r]+=t.get(n,r);return e}(this);case void 0:return function(t){let e=0;for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)e+=t.get(n,r);return e}(this);default:throw new Error(`invalid option: ${t}`)}}product(t){switch(t){case"row":return function(t){let e=Jn(t.rows,1);for(let n=0;n<t.rows;++n)for(let r=0;r<t.columns;++r)e[n]*=t.get(n,r);return e}(this);case"column":return function(t){let e=Jn(t.columns,1);for(let n=0;n<t.rows;++n)for(let r=0;r<t.columns;++r)e[r]*=t.get(n,r);return e}(this);case void 0:return function(t){let e=1;for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)e*=t.get(n,r);return e}(this);default:throw new Error(`invalid option: ${t}`)}}mean(t){const e=this.sum(t);switch(t){case"row":for(let t=0;t<this.rows;t++)e[t]/=this.columns;return e;case"column":for(let t=0;t<this.columns;t++)e[t]/=this.rows;return e;case void 0:return e/this.size;default:throw new Error(`invalid option: ${t}`)}}variance(t,e={}){if("object"==typeof t&&(e=t,t=void 0),"object"!=typeof e)throw new TypeError("options must be an object");const{unbiased:n=!0,mean:r=this.mean(t)}=e;if("boolean"!=typeof n)throw new TypeError("unbiased must be a boolean");switch(t){case"row":if(!Array.isArray(r))throw new TypeError("mean must be an array");return function(t,e,n){const r=t.rows,i=t.columns,o=[];for(let a=0;a<r;a++){let r=0,u=0,s=0;for(let e=0;e<i;e++)s=t.get(a,e)-n[a],r+=s,u+=s*s;e?o.push((u-r*r/i)/(i-1)):o.push((u-r*r/i)/i)}return o}(this,n,r);case"column":if(!Array.isArray(r))throw new TypeError("mean must be an array");return function(t,e,n){const r=t.rows,i=t.columns,o=[];for(let a=0;a<i;a++){let i=0,u=0,s=0;for(let e=0;e<r;e++)s=t.get(e,a)-n[a],i+=s,u+=s*s;e?o.push((u-i*i/r)/(r-1)):o.push((u-i*i/r)/r)}return o}(this,n,r);case void 0:if("number"!=typeof r)throw new TypeError("mean must be a number");return function(t,e,n){const r=t.rows,i=t.columns,o=r*i;let a=0,u=0,s=0;for(let e=0;e<r;e++)for(let r=0;r<i;r++)s=t.get(e,r)-n,a+=s,u+=s*s;return e?(u-a*a/o)/(o-1):(u-a*a/o)/o}(this,n,r);default:throw new Error(`invalid option: ${t}`)}}standardDeviation(t,e){"object"==typeof t&&(e=t,t=void 0);const n=this.variance(t,e);if(void 0===t)return Math.sqrt(n);for(let t=0;t<n.length;t++)n[t]=Math.sqrt(n[t]);return n}center(t,e={}){if("object"==typeof t&&(e=t,t=void 0),"object"!=typeof e)throw new TypeError("options must be an object");const{center:n=this.mean(t)}=e;switch(t){case"row":if(!Array.isArray(n))throw new TypeError("center must be an array");return function(t,e){for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)-e[n])}(this,n),this;case"column":if(!Array.isArray(n))throw new TypeError("center must be an array");return function(t,e){for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)-e[r])}(this,n),this;case void 0:if("number"!=typeof n)throw new TypeError("center must be a number");return function(t,e){for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)-e)}(this,n),this;default:throw new Error(`invalid option: ${t}`)}}scale(t,e={}){if("object"==typeof t&&(e=t,t=void 0),"object"!=typeof e)throw new TypeError("options must be an object");let n=e.scale;switch(t){case"row":if(void 0===n)n=function(t){const e=[];for(let n=0;n<t.rows;n++){let r=0;for(let e=0;e<t.columns;e++)r+=Math.pow(t.get(n,e),2)/(t.columns-1);e.push(Math.sqrt(r))}return e}(this);else if(!Array.isArray(n))throw new TypeError("scale must be an array");return function(t,e){for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)/e[n])}(this,n),this;case"column":if(void 0===n)n=function(t){const e=[];for(let n=0;n<t.columns;n++){let r=0;for(let e=0;e<t.rows;e++)r+=Math.pow(t.get(e,n),2)/(t.rows-1);e.push(Math.sqrt(r))}return e}(this);else if(!Array.isArray(n))throw new TypeError("scale must be an array");return function(t,e){for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)/e[r])}(this,n),this;case void 0:if(void 0===n)n=function(t){const e=t.size-1;let n=0;for(let r=0;r<t.columns;r++)for(let i=0;i<t.rows;i++)n+=Math.pow(t.get(i,r),2)/e;return Math.sqrt(n)}(this);else if("number"!=typeof n)throw new TypeError("scale must be a number");return function(t,e){for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)/e)}(this,n),this;default:throw new Error(`invalid option: ${t}`)}}toString(t){return Wn(this,t)}}function nr(t,e){return t-e}er.prototype.klass="Matrix","undefined"!=typeof Symbol&&(er.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return Wn(this)}),er.random=er.rand,er.randomInt=er.randInt,er.diagonal=er.diag,er.prototype.diagonal=er.prototype.diag,er.identity=er.eye,er.prototype.negate=er.prototype.neg,er.prototype.tensorProduct=er.prototype.kroneckerProduct;class rr extends er{constructor(t,e){if(super(),rr.isMatrix(t))return t.clone();if(Number.isInteger(t)&&t>=0){if(this.data=[],!(Number.isInteger(e)&&e>=0))throw new TypeError("nColumns must be a positive integer");for(let n=0;n<t;n++)this.data.push(new Float64Array(e))}else{if(!Array.isArray(t))throw new TypeError("First argument must be a positive number or an array");{const n=t;if("number"!=typeof(e=(t=n.length)?n[0].length:0))throw new TypeError("Data must be a 2D array with at least one element");this.data=[];for(let r=0;r<t;r++){if(n[r].length!==e)throw new RangeError("Inconsistent array dimensions");this.data.push(Float64Array.from(n[r]))}}}this.rows=t,this.columns=e}set(t,e,n){return this.data[t][e]=n,this}get(t,e){return this.data[t][e]}removeRow(t){return Xn(this,t),this.data.splice(t,1),this.rows-=1,this}addRow(t,e){return void 0===e&&(e=t,t=this.rows),Xn(this,t,!0),e=Float64Array.from(qn(this,e)),this.data.splice(t,0,e),this.rows+=1,this}removeColumn(t){Hn(this,t);for(let e=0;e<this.rows;e++){const n=new Float64Array(this.columns-1);for(let r=0;r<t;r++)n[r]=this.data[e][r];for(let r=t+1;r<this.columns;r++)n[r-1]=this.data[e][r];this.data[e]=n}return this.columns-=1,this}addColumn(t,e){void 0===e&&(e=t,t=this.columns),Hn(this,t,!0),e=Yn(this,e);for(let n=0;n<this.rows;n++){const r=new Float64Array(this.columns+1);let i=0;for(;i<t;i++)r[i]=this.data[n][i];for(r[i++]=e[n];i<this.columns+1;i++)r[i]=this.data[n][i-1];this.data[n]=r}return this.columns+=1,this}}!function(t,e){t.prototype.add=function(t){return"number"==typeof t?this.addS(t):this.addM(t)},t.prototype.addS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)+t);return this},t.prototype.addM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)+t.get(e,n));return this},t.add=function(t,n){return new e(t).add(n)},t.prototype.sub=function(t){return"number"==typeof t?this.subS(t):this.subM(t)},t.prototype.subS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)-t);return this},t.prototype.subM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)-t.get(e,n));return this},t.sub=function(t,n){return new e(t).sub(n)},t.prototype.subtract=t.prototype.sub,t.prototype.subtractS=t.prototype.subS,t.prototype.subtractM=t.prototype.subM,t.subtract=t.sub,t.prototype.mul=function(t){return"number"==typeof t?this.mulS(t):this.mulM(t)},t.prototype.mulS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)*t);return this},t.prototype.mulM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)*t.get(e,n));return this},t.mul=function(t,n){return new e(t).mul(n)},t.prototype.multiply=t.prototype.mul,t.prototype.multiplyS=t.prototype.mulS,t.prototype.multiplyM=t.prototype.mulM,t.multiply=t.mul,t.prototype.div=function(t){return"number"==typeof t?this.divS(t):this.divM(t)},t.prototype.divS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)/t);return this},t.prototype.divM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)/t.get(e,n));return this},t.div=function(t,n){return new e(t).div(n)},t.prototype.divide=t.prototype.div,t.prototype.divideS=t.prototype.divS,t.prototype.divideM=t.prototype.divM,t.divide=t.div,t.prototype.mod=function(t){return"number"==typeof t?this.modS(t):this.modM(t)},t.prototype.modS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)%t);return this},t.prototype.modM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)%t.get(e,n));return this},t.mod=function(t,n){return new e(t).mod(n)},t.prototype.modulus=t.prototype.mod,t.prototype.modulusS=t.prototype.modS,t.prototype.modulusM=t.prototype.modM,t.modulus=t.mod,t.prototype.and=function(t){return"number"==typeof t?this.andS(t):this.andM(t)},t.prototype.andS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)&t);return this},t.prototype.andM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)&t.get(e,n));return this},t.and=function(t,n){return new e(t).and(n)},t.prototype.or=function(t){return"number"==typeof t?this.orS(t):this.orM(t)},t.prototype.orS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)|t);return this},t.prototype.orM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)|t.get(e,n));return this},t.or=function(t,n){return new e(t).or(n)},t.prototype.xor=function(t){return"number"==typeof t?this.xorS(t):this.xorM(t)},t.prototype.xorS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)^t);return this},t.prototype.xorM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)^t.get(e,n));return this},t.xor=function(t,n){return new e(t).xor(n)},t.prototype.leftShift=function(t){return"number"==typeof t?this.leftShiftS(t):this.leftShiftM(t)},t.prototype.leftShiftS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)<<t);return this},t.prototype.leftShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)<<t.get(e,n));return this},t.leftShift=function(t,n){return new e(t).leftShift(n)},t.prototype.signPropagatingRightShift=function(t){return"number"==typeof t?this.signPropagatingRightShiftS(t):this.signPropagatingRightShiftM(t)},t.prototype.signPropagatingRightShiftS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)>>t);return this},t.prototype.signPropagatingRightShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)>>t.get(e,n));return this},t.signPropagatingRightShift=function(t,n){return new e(t).signPropagatingRightShift(n)},t.prototype.rightShift=function(t){return"number"==typeof t?this.rightShiftS(t):this.rightShiftM(t)},t.prototype.rightShiftS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)>>>t);return this},t.prototype.rightShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)>>>t.get(e,n));return this},t.rightShift=function(t,n){return new e(t).rightShift(n)},t.prototype.zeroFillRightShift=t.prototype.rightShift,t.prototype.zeroFillRightShiftS=t.prototype.rightShiftS,t.prototype.zeroFillRightShiftM=t.prototype.rightShiftM,t.zeroFillRightShift=t.rightShift,t.prototype.not=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,~this.get(t,e));return this},t.not=function(t){return new e(t).not()},t.prototype.abs=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.abs(this.get(t,e)));return this},t.abs=function(t){return new e(t).abs()},t.prototype.acos=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.acos(this.get(t,e)));return this},t.acos=function(t){return new e(t).acos()},t.prototype.acosh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.acosh(this.get(t,e)));return this},t.acosh=function(t){return new e(t).acosh()},t.prototype.asin=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.asin(this.get(t,e)));return this},t.asin=function(t){return new e(t).asin()},t.prototype.asinh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.asinh(this.get(t,e)));return this},t.asinh=function(t){return new e(t).asinh()},t.prototype.atan=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.atan(this.get(t,e)));return this},t.atan=function(t){return new e(t).atan()},t.prototype.atanh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.atanh(this.get(t,e)));return this},t.atanh=function(t){return new e(t).atanh()},t.prototype.cbrt=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.cbrt(this.get(t,e)));return this},t.cbrt=function(t){return new e(t).cbrt()},t.prototype.ceil=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.ceil(this.get(t,e)));return this},t.ceil=function(t){return new e(t).ceil()},t.prototype.clz32=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.clz32(this.get(t,e)));return this},t.clz32=function(t){return new e(t).clz32()},t.prototype.cos=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.cos(this.get(t,e)));return this},t.cos=function(t){return new e(t).cos()},t.prototype.cosh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.cosh(this.get(t,e)));return this},t.cosh=function(t){return new e(t).cosh()},t.prototype.exp=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.exp(this.get(t,e)));return this},t.exp=function(t){return new e(t).exp()},t.prototype.expm1=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.expm1(this.get(t,e)));return this},t.expm1=function(t){return new e(t).expm1()},t.prototype.floor=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.floor(this.get(t,e)));return this},t.floor=function(t){return new e(t).floor()},t.prototype.fround=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.fround(this.get(t,e)));return this},t.fround=function(t){return new e(t).fround()},t.prototype.log=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.log(this.get(t,e)));return this},t.log=function(t){return new e(t).log()},t.prototype.log1p=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.log1p(this.get(t,e)));return this},t.log1p=function(t){return new e(t).log1p()},t.prototype.log10=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.log10(this.get(t,e)));return this},t.log10=function(t){return new e(t).log10()},t.prototype.log2=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.log2(this.get(t,e)));return this},t.log2=function(t){return new e(t).log2()},t.prototype.round=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.round(this.get(t,e)));return this},t.round=function(t){return new e(t).round()},t.prototype.sign=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.sign(this.get(t,e)));return this},t.sign=function(t){return new e(t).sign()},t.prototype.sin=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.sin(this.get(t,e)));return this},t.sin=function(t){return new e(t).sin()},t.prototype.sinh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.sinh(this.get(t,e)));return this},t.sinh=function(t){return new e(t).sinh()},t.prototype.sqrt=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.sqrt(this.get(t,e)));return this},t.sqrt=function(t){return new e(t).sqrt()},t.prototype.tan=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.tan(this.get(t,e)));return this},t.tan=function(t){return new e(t).tan()},t.prototype.tanh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.tanh(this.get(t,e)));return this},t.tanh=function(t){return new e(t).tanh()},t.prototype.trunc=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.trunc(this.get(t,e)));return this},t.trunc=function(t){return new e(t).trunc()},t.pow=function(t,n){return new e(t).pow(n)},t.prototype.pow=function(t){return"number"==typeof t?this.powS(t):this.powM(t)},t.prototype.powS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,Math.pow(this.get(e,n),t));return this},t.prototype.powM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,Math.pow(this.get(e,n),t.get(e,n)));return this}}(er,rr);class ir extends er{constructor(t){super(),this.data=t,this.rows=t.length,this.columns=t[0].length}set(t,e,n){return this.data[t][e]=n,this}get(t,e){return this.data[t][e]}}function or(t,e){let n=0;return Math.abs(t)>Math.abs(e)?(n=e/t,Math.abs(t)*Math.sqrt(1+n*n)):0!==e?(n=t/e,Math.abs(e)*Math.sqrt(1+n*n)):0}class ar{constructor(t,e={}){if((t=ir.checkMatrix(t)).isEmpty())throw new Error("Matrix must be non-empty");let n=t.rows,r=t.columns;const{computeLeftSingularVectors:i=!0,computeRightSingularVectors:o=!0,autoTranspose:a=!1}=e;let u,s=Boolean(i),c=Boolean(o),f=!1;if(n<r)if(a){u=t.transpose(),n=u.rows,r=u.columns,f=!0;let e=s;s=c,c=e}else u=t.clone(),console.warn("Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose");else u=t.clone();let l=Math.min(n,r),h=Math.min(n+1,r),d=new Float64Array(h),p=new rr(n,l),v=new rr(r,r),g=new Float64Array(r),y=new Float64Array(n),m=new Float64Array(h);for(let t=0;t<h;t++)m[t]=t;let b=Math.min(n-1,r),_=Math.max(0,Math.min(r-2,n)),x=Math.max(b,_);for(let t=0;t<x;t++){if(t<b){d[t]=0;for(let e=t;e<n;e++)d[t]=or(d[t],u.get(e,t));if(0!==d[t]){u.get(t,t)<0&&(d[t]=-d[t]);for(let e=t;e<n;e++)u.set(e,t,u.get(e,t)/d[t]);u.set(t,t,u.get(t,t)+1)}d[t]=-d[t]}for(let e=t+1;e<r;e++){if(t<b&&0!==d[t]){let r=0;for(let i=t;i<n;i++)r+=u.get(i,t)*u.get(i,e);r=-r/u.get(t,t);for(let i=t;i<n;i++)u.set(i,e,u.get(i,e)+r*u.get(i,t))}g[e]=u.get(t,e)}if(s&&t<b)for(let e=t;e<n;e++)p.set(e,t,u.get(e,t));if(t<_){g[t]=0;for(let e=t+1;e<r;e++)g[t]=or(g[t],g[e]);if(0!==g[t]){g[t+1]<0&&(g[t]=0-g[t]);for(let e=t+1;e<r;e++)g[e]/=g[t];g[t+1]+=1}if(g[t]=-g[t],t+1<n&&0!==g[t]){for(let e=t+1;e<n;e++)y[e]=0;for(let e=t+1;e<n;e++)for(let n=t+1;n<r;n++)y[e]+=g[n]*u.get(e,n);for(let e=t+1;e<r;e++){let r=-g[e]/g[t+1];for(let i=t+1;i<n;i++)u.set(i,e,u.get(i,e)+r*y[i])}}if(c)for(let e=t+1;e<r;e++)v.set(e,t,g[e])}}let w=Math.min(r,n+1);if(b<r&&(d[b]=u.get(b,b)),n<w&&(d[w-1]=0),_+1<w&&(g[_]=u.get(_,w-1)),g[w-1]=0,s){for(let t=b;t<l;t++){for(let e=0;e<n;e++)p.set(e,t,0);p.set(t,t,1)}for(let t=b-1;t>=0;t--)if(0!==d[t]){for(let e=t+1;e<l;e++){let r=0;for(let i=t;i<n;i++)r+=p.get(i,t)*p.get(i,e);r=-r/p.get(t,t);for(let i=t;i<n;i++)p.set(i,e,p.get(i,e)+r*p.get(i,t))}for(let e=t;e<n;e++)p.set(e,t,-p.get(e,t));p.set(t,t,1+p.get(t,t));for(let e=0;e<t-1;e++)p.set(e,t,0)}else{for(let e=0;e<n;e++)p.set(e,t,0);p.set(t,t,1)}}if(c)for(let t=r-1;t>=0;t--){if(t<_&&0!==g[t])for(let e=t+1;e<r;e++){let n=0;for(let i=t+1;i<r;i++)n+=v.get(i,t)*v.get(i,e);n=-n/v.get(t+1,t);for(let i=t+1;i<r;i++)v.set(i,e,v.get(i,e)+n*v.get(i,t))}for(let e=0;e<r;e++)v.set(e,t,0);v.set(t,t,1)}let E=w-1,S=0,A=Number.EPSILON;for(;w>0;){let t,e;for(t=w-2;t>=-1&&-1!==t;t--){const e=Number.MIN_VALUE+A*Math.abs(d[t]+Math.abs(d[t+1]));if(Math.abs(g[t])<=e||Number.isNaN(g[t])){g[t]=0;break}}if(t===w-2)e=4;else{let n;for(n=w-1;n>=t&&n!==t;n--){let e=(n!==w?Math.abs(g[n]):0)+(n!==t+1?Math.abs(g[n-1]):0);if(Math.abs(d[n])<=A*e){d[n]=0;break}}n===t?e=3:n===w-1?e=1:(e=2,t=n)}switch(t++,e){case 1:{let e=g[w-2];g[w-2]=0;for(let n=w-2;n>=t;n--){let i=or(d[n],e),o=d[n]/i,a=e/i;if(d[n]=i,n!==t&&(e=-a*g[n-1],g[n-1]=o*g[n-1]),c)for(let t=0;t<r;t++)i=o*v.get(t,n)+a*v.get(t,w-1),v.set(t,w-1,-a*v.get(t,n)+o*v.get(t,w-1)),v.set(t,n,i)}break}case 2:{let e=g[t-1];g[t-1]=0;for(let r=t;r<w;r++){let i=or(d[r],e),o=d[r]/i,a=e/i;if(d[r]=i,e=-a*g[r],g[r]=o*g[r],s)for(let e=0;e<n;e++)i=o*p.get(e,r)+a*p.get(e,t-1),p.set(e,t-1,-a*p.get(e,r)+o*p.get(e,t-1)),p.set(e,r,i)}break}case 3:{const e=Math.max(Math.abs(d[w-1]),Math.abs(d[w-2]),Math.abs(g[w-2]),Math.abs(d[t]),Math.abs(g[t])),i=d[w-1]/e,o=d[w-2]/e,a=g[w-2]/e,u=d[t]/e,f=g[t]/e,l=((o+i)*(o-i)+a*a)/2,h=i*a*(i*a);let y=0;0===l&&0===h||(y=l<0?0-Math.sqrt(l*l+h):Math.sqrt(l*l+h),y=h/(l+y));let m=(u+i)*(u-i)+y,b=u*f;for(let e=t;e<w-1;e++){let i=or(m,b);0===i&&(i=Number.MIN_VALUE);let o=m/i,a=b/i;if(e!==t&&(g[e-1]=i),m=o*d[e]+a*g[e],g[e]=o*g[e]-a*d[e],b=a*d[e+1],d[e+1]=o*d[e+1],c)for(let t=0;t<r;t++)i=o*v.get(t,e)+a*v.get(t,e+1),v.set(t,e+1,-a*v.get(t,e)+o*v.get(t,e+1)),v.set(t,e,i);if(i=or(m,b),0===i&&(i=Number.MIN_VALUE),o=m/i,a=b/i,d[e]=i,m=o*g[e]+a*d[e+1],d[e+1]=-a*g[e]+o*d[e+1],b=a*g[e+1],g[e+1]=o*g[e+1],s&&e<n-1)for(let t=0;t<n;t++)i=o*p.get(t,e)+a*p.get(t,e+1),p.set(t,e+1,-a*p.get(t,e)+o*p.get(t,e+1)),p.set(t,e,i)}g[w-2]=m,S+=1;break}case 4:if(d[t]<=0&&(d[t]=d[t]<0?-d[t]:0,c))for(let e=0;e<=E;e++)v.set(e,t,-v.get(e,t));for(;t<E&&!(d[t]>=d[t+1]);){let e=d[t];if(d[t]=d[t+1],d[t+1]=e,c&&t<r-1)for(let n=0;n<r;n++)e=v.get(n,t+1),v.set(n,t+1,v.get(n,t)),v.set(n,t,e);if(s&&t<n-1)for(let r=0;r<n;r++)e=p.get(r,t+1),p.set(r,t+1,p.get(r,t)),p.set(r,t,e);t++}S=0,w--}}if(f){let t=v;v=p,p=t}this.m=n,this.n=r,this.s=d,this.U=p,this.V=v}solve(t){let e=t,n=this.threshold,r=this.s.length,i=rr.zeros(r,r);for(let t=0;t<r;t++)Math.abs(this.s[t])<=n?i.set(t,t,0):i.set(t,t,1/this.s[t]);let o=this.U,a=this.rightSingularVectors,u=a.mmul(i),s=a.rows,c=o.rows,f=rr.zeros(s,c);for(let t=0;t<s;t++)for(let e=0;e<c;e++){let n=0;for(let i=0;i<r;i++)n+=u.get(t,i)*o.get(e,i);f.set(t,e,n)}return f.mmul(e)}solveForDiagonal(t){return this.solve(rr.diag(t))}inverse(){let t=this.V,e=this.threshold,n=t.rows,r=t.columns,i=new rr(n,this.s.length);for(let o=0;o<n;o++)for(let n=0;n<r;n++)Math.abs(this.s[n])>e&&i.set(o,n,t.get(o,n)/this.s[n]);let o=this.U,a=o.rows,u=o.columns,s=new rr(n,a);for(let t=0;t<n;t++)for(let e=0;e<a;e++){let n=0;for(let r=0;r<u;r++)n+=i.get(t,r)*o.get(e,r);s.set(t,e,n)}return s}get condition(){return this.s[0]/this.s[Math.min(this.m,this.n)-1]}get norm2(){return this.s[0]}get rank(){let t=Math.max(this.m,this.n)*this.s[0]*Number.EPSILON,e=0,n=this.s;for(let r=0,i=n.length;r<i;r++)n[r]>t&&e++;return e}get diagonal(){return Array.from(this.s)}get threshold(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}get leftSingularVectors(){return this.U}get rightSingularVectors(){return this.V}get diagonalMatrix(){return rr.diag(this.s)}}const ur=function(){function t(t){this.distances=t.distances,this.dimension=t.dimension||2,this.linkDistance=t.linkDistance}return t.prototype.layout=function(){var t=this,e=t.dimension,n=t.distances,r=t.linkDistance;try{var i=rr.mul(rr.pow(n,2),-.5),o=i.mean("row"),a=i.mean("column"),u=i.mean();i.add(u).subRowVector(o).subColumnVector(a);var s=new ar(i),c=rr.sqrt(s.diagonalMatrix).diagonal();return s.leftSingularVectors.toJSON().map((function(t){return rr.mul([t],[c]).toJSON()[0].splice(0,e)}))}catch(t){for(var f=[],l=0;l<n.length;l++){var h=Math.random()*r,d=Math.random()*r;f.push([h,d])}return f}},t}(),sr=function(){function t(t){this.disp=[],this.positions=t.positions,this.adjMatrix=t.adjMatrix,this.focusID=t.focusID,this.radii=t.radii,this.iterations=t.iterations||10,this.height=t.height||10,this.width=t.width||10,this.speed=t.speed||100,this.gravity=t.gravity||10,this.nodeSizeFunc=t.nodeSizeFunc,this.k=t.k||5,this.strictRadial=t.strictRadial,this.nodes=t.nodes}return t.prototype.layout=function(){var t=this,e=t.positions,n=[],r=t.iterations,i=t.width/10;t.maxDisplace=i,t.disp=n;for(var o=0;o<r;o++)e.forEach((function(t,e){n[e]={x:0,y:0}})),t.getRepulsion(),t.updatePositions();return e},t.prototype.getRepulsion=function(){var t=this,e=t.positions,n=t.nodes,r=t.disp,i=t.k,o=t.radii||[];e.forEach((function(a,u){r[u]={x:0,y:0},e.forEach((function(e,s){if(u!==s&&o[u]===o[s]){var c=a[0]-e[0],f=a[1]-e[1],l=Math.sqrt(c*c+f*f);if(0===l){l=1;var h=u>s?1:-1;c=.01*h,f=.01*h}if(l<t.nodeSizeFunc(n[u])/2+t.nodeSizeFunc(n[s])/2){var d=i*i/l;r[u].x+=c/l*d,r[u].y+=f/l*d}}}))}))},t.prototype.updatePositions=function(){var t=this,e=t.positions,n=t.disp,r=t.speed,i=t.strictRadial,o=t.focusID,a=t.maxDisplace||t.width/10;i&&n.forEach((function(t,n){var r=e[n][0]-e[o][0],i=e[n][1]-e[o][1],a=Math.sqrt(r*r+i*i),u=i/a,s=-r/a,c=Math.sqrt(t.x*t.x+t.y*t.y),f=Math.acos((u*t.x+s*t.y)/c);f>Math.PI/2&&(f-=Math.PI/2,u*=-1,s*=-1);var l=Math.cos(f)*c;t.x=u*l,t.y=s*l}));var u=t.radii;e.forEach((function(t,s){if(s!==o){var c=Math.sqrt(n[s].x*n[s].x+n[s].y*n[s].y);if(c>0&&s!==o){var f=Math.min(a*(r/800),c);if(t[0]+=n[s].x/c*f,t[1]+=n[s].y/c*f,i){var l=t[0]-e[o][0],h=t[1]-e[o][1],d=Math.sqrt(l*l+h*h);l=l/d*u[s],h=h/d*u[s],t[0]=e[o][0]+l,t[1]=e[o][1]+h}}}}))},t}();var cr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function fr(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var lr=function(t){function n(e){var n=t.call(this)||this;return n.maxIteration=1e3,n.focusNode=null,n.unitRadius=null,n.linkDistance=50,n.preventOverlap=!1,n.strictRadial=!0,n.maxPreventOverlapIteration=200,n.sortStrength=10,n.nodes=[],n.edges=[],n.updateCfg(e),n}return cr(n,t),n.prototype.getDefaultCfg=function(){return{maxIteration:1e3,focusNode:null,unitRadius:null,linkDistance:50,preventOverlap:!1,nodeSize:void 0,nodeSpacing:void 0,strictRadial:!0,maxPreventOverlapIteration:200,sortBy:void 0,sortStrength:10}},n.prototype.execute=function(){var t=this,n=t.nodes,r=t.edges||[];if(n&&0!==n.length){t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),t.center||(t.center=[t.width/2,t.height/2]);var i=t.center;if(1===n.length)return n[0].x=i[0],n[0].y=i[1],void(t.onLayoutEnd&&t.onLayoutEnd());var s=t.linkDistance,c=null;if(e(t.focusNode)){for(var f=!1,h=0;h<n.length;h++)n[h].id===t.focusNode&&(c=n[h],t.focusNode=c,f=!0,h=n.length);f||(c=null)}else c=t.focusNode;c||(c=n[0],t.focusNode=c);var d=function(t,e){var n=-1;return t.forEach((function(t,r){t.id===e&&(n=r)})),n}(n,c.id);t.focusIndex=d;var p=g({nodes:n,edges:r},!1),y=v(p),m=t.maxToFocus(y,d);t.handleInfinity(y,d,m+1),t.distances=y;var _=y[d],x=t.width||500,w=t.height||500,E=x-i[0]>i[0]?i[0]:x-i[0],S=w-i[1]>i[1]?i[1]:w-i[1];0===E&&(E=x/2),0===S&&(S=w/2);var A=S>E?E:S,T=Math.max.apply(Math,_),I=[];_.forEach((function(e,n){t.unitRadius||(t.unitRadius=A/T),I[n]=e*t.unitRadius})),t.radii=I;var C=t.eIdealDisMatrix();t.eIdealDistances=C;var D=function(t){for(var e=t.length,n=t[0].length,r=[],i=0;i<e;i++){for(var o=[],a=0;a<n;a++)0!==t[i][a]?o.push(1/(t[i][a]*t[i][a])):o.push(0);r.push(o)}return r}(C);t.weights=D;var N=new ur({linkDistance:s,distances:C}).layout();N.forEach((function(t){u(t[0])&&(t[0]=Math.random()*s),u(t[1])&&(t[1]=Math.random()*s)})),t.positions=N,N.forEach((function(t,e){n[e].x=t[0]+i[0],n[e].y=t[1]+i[1]})),N.forEach((function(t){t[0]-=N[d][0],t[1]-=N[d][1]})),t.run();var k,R=t.preventOverlap,O=t.nodeSize,M=t.strictRadial;if(R){var P,G=t.nodeSpacing;P=a(G)?function(){return G}:b(G)?G:function(){return 0},k=O?o(O)?function(t){return(O[0]>O[1]?O[0]:O[1])+P(t)}:function(t){return O+P(t)}:function(t){return t.size?o(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])+P(t):l(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)+P(t):t.size+P(t):10+P(t)};var L={nodes:n,nodeSizeFunc:k,adjMatrix:p,positions:N,radii:I,height:w,width:x,strictRadial:M,focusID:d,iterations:t.maxPreventOverlapIteration||200,k:N.length/4.5},U=new sr(L);N=U.layout()}return N.forEach((function(t,e){n[e].x=t[0]+i[0],n[e].y=t[1]+i[1]})),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:n,edges:r}}t.onLayoutEnd&&t.onLayoutEnd()},n.prototype.run=function(){for(var t=this,e=t.maxIteration,n=t.positions||[],r=t.weights||[],i=t.eIdealDistances||[],o=t.radii||[],a=0;a<=e;a++){var u=a/e;t.oneIteration(u,n,o,i,r)}},n.prototype.oneIteration=function(t,e,n,r,i){var o=1-t,a=this.focusIndex;e.forEach((function(u,s){var c=fr(u,[0,0]),f=0===c?0:1/c;if(s!==a){var l=0,h=0,d=0;e.forEach((function(t,e){if(s!==e){var n=fr(u,t),o=0===n?0:1/n,a=r[e][s];d+=i[s][e],l+=i[s][e]*(t[0]+a*(u[0]-t[0])*o),h+=i[s][e]*(t[1]+a*(u[1]-t[1])*o)}}));var p=0===n[s]?0:1/n[s];d*=o,d+=t*p*p,l*=o,l+=t*p*u[0]*f,u[0]=l/d,h*=o,h+=t*p*u[1]*f,u[1]=h/d}}))},n.prototype.eIdealDisMatrix=function(){var t=this,n=t.nodes;if(!n)return[];var r=t.distances,i=t.linkDistance,o=t.radii||[],a=t.unitRadius||50,u=[];return r&&r.forEach((function(r,s){var c=[];r.forEach((function(r,u){if(s===u)c.push(0);else if(o[s]===o[u])if("data"===t.sortBy)c.push(r*(Math.abs(s-u)*t.sortStrength)/(o[s]/a));else if(t.sortBy){var f=n[s][t.sortBy]||0,l=n[u][t.sortBy]||0;e(f)&&(f=f.charCodeAt(0)),e(l)&&(l=l.charCodeAt(0)),c.push(r*(Math.abs(f-l)*t.sortStrength)/(o[s]/a))}else c.push(r*i/(o[s]/a));else{var h=(i+a)/2;c.push(r*h)}})),u.push(c)})),u},n.prototype.handleInfinity=function(t,e,n){for(var r=t.length,i=0;i<r;i++)if(t[e][i]===1/0){t[e][i]=n,t[i][e]=n;for(var o=0;o<r;o++)t[i][o]!==1/0&&t[e][o]===1/0&&(t[e][o]=n+t[i][o],t[o][e]=n+t[i][o])}for(i=0;i<r;i++)if(i!==e)for(o=0;o<r;o++)if(t[i][o]===1/0){var a=Math.abs(t[e][i]-t[e][o]);a=0===a?1:a,t[i][o]=a}},n.prototype.maxToFocus=function(t,e){for(var n=0,r=0;r<t[e].length;r++)t[e][r]!==1/0&&(n=t[e][r]>n?t[e][r]:n);return n},n.prototype.getType=function(){return"radial"},n}(t),hr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),dr=function(t){function n(e){var n=t.call(this)||this;return n.nodeSize=30,n.minNodeSpacing=10,n.preventOverlap=!1,n.equidistant=!1,n.startAngle=1.5*Math.PI,n.clockwise=!0,n.sortBy="degree",n.nodes=[],n.edges=[],n.width=300,n.height=300,n.onLayoutEnd=function(){},n.updateCfg(e),n}return hr(n,t),n.prototype.getDefaultCfg=function(){return{nodeSize:30,minNodeSpacing:10,preventOverlap:!1,sweep:void 0,equidistant:!1,startAngle:1.5*Math.PI,clockwise:!0,maxLevelDiff:void 0,sortBy:"degree"}},n.prototype.execute=function(){var t=this,n=t.nodes,r=t.edges,i=n.length;if(0!==i){t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),t.center||(t.center=[t.width/2,t.height/2]);var u=t.center;if(1===i)return n[0].x=u[0],n[0].y=u[1],void(t.onLayoutEnd&&t.onLayoutEnd());var s,c=[];s=o(t.nodeSize)?Math.max(t.nodeSize[0],t.nodeSize[1]):t.nodeSize,n.forEach((function(t){c.push(t);var e=s;o(t.size)?e=Math.max(t.size[0],t.size[1]):a(t.size)?e=t.size:l(t.size)&&(e=Math.max(t.size.width,t.size.height)),s=Math.max(s,e)})),t.clockwise=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise;var f={},h={};if(c.forEach((function(t,e){f[t.id]=t,h[t.id]=e})),!("degree"!==t.sortBy&&e(t.sortBy)&&void 0!==c[0][t.sortBy]||(t.sortBy="degree",a(n[0].degree)))){var d=p(n.length,h,r);c.forEach((function(t,e){t.degree=d[e]}))}c.sort((function(e,n){return n[t.sortBy]-e[t.sortBy]})),t.maxValueNode=c[0],t.maxLevelDiff=t.maxLevelDiff||t.maxValueNode[t.sortBy]/4;var v=[[]],g=v[0];c.forEach((function(e){if(g.length>0){var n=Math.abs(g[0][t.sortBy]-e[t.sortBy]);t.maxLevelDiff&&n>=t.maxLevelDiff&&(g=[],v.push(g))}g.push(e)}));var y=s+t.minNodeSpacing;if(!t.preventOverlap){var m=v.length>0&&v[0].length>1,b=(Math.min(t.width,t.height)/2-y)/(v.length+(m?1:0));y=Math.min(y,b)}var _=0;if(v.forEach((function(e){var n=t.sweep;void 0===n&&(n=2*Math.PI-2*Math.PI/e.length);var r=e.dTheta=n/Math.max(1,e.length-1);if(e.length>1&&t.preventOverlap){var i=Math.cos(r)-Math.cos(0),o=Math.sin(r)-Math.sin(0),a=Math.sqrt(y*y/(i*i+o*o));_=Math.max(a,_)}e.r=_,_+=y})),t.equidistant){for(var x=0,w=0,E=0;E<v.length;E++){var S=v[E].r-w;x=Math.max(x,S)}w=0,v.forEach((function(t,e){0===e&&(w=t.r),t.r=w,w+=x}))}return v.forEach((function(e){var n=e.dTheta,r=e.r;e.forEach((function(e,i){var o=t.startAngle+(t.clockwise?1:-1)*n*i;e.x=u[0]+r*Math.cos(o),e.y=u[1]+r*Math.sin(o)}))})),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:n,edges:r}}t.onLayoutEnd&&t.onLayoutEnd()},n.prototype.getType=function(){return"concentric"},n}(t),pr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),vr=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.linkDistance=50,n.nodes=[],n.edges=[],n.onLayoutEnd=function(){},n.updateCfg(e),n}return pr(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],linkDistance:50}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.edges,r=void 0===n?[]:n,i=t.center;if(e&&0!==e.length){if(1===e.length)return e[0].x=i[0],e[0].y=i[1],void(t.onLayoutEnd&&t.onLayoutEnd());var o=t.linkDistance,a=g({nodes:e,edges:r},!1),u=v(a);t.handleInfinity(u);var s,c,f=(s=o,c=[],u.forEach((function(t){var e=[];t.forEach((function(t){e.push(t*s)})),c.push(e)})),c);t.scaledDistances=f;var l=t.runMDS();return t.positions=l,l.forEach((function(t,n){e[n].x=t[0]+i[0],e[n].y=t[1]+i[1]})),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:r}}t.onLayoutEnd&&t.onLayoutEnd()},e.prototype.runMDS=function(){var t=this.scaledDistances,e=rr.mul(rr.pow(t,2),-.5),n=e.mean("row"),r=e.mean("column"),i=e.mean();e.add(i).subRowVector(n).subColumnVector(r);var o=new ar(e),a=rr.sqrt(o.diagonalMatrix).diagonal();return o.leftSingularVectors.toJSON().map((function(t){return rr.mul([t],[a]).toJSON()[0].splice(0,2)}))},e.prototype.handleInfinity=function(t){var e=-999999;t.forEach((function(t){t.forEach((function(t){t!==1/0&&e<t&&(e=t)}))})),t.forEach((function(n,r){n.forEach((function(n,i){n===1/0&&(t[r][i]=e)}))}))},e.prototype.getType=function(){return"mds"},e}(t),gr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),yr=function(t){function e(e){var n=t.call(this)||this;return n.maxIteration=1e3,n.workerEnabled=!1,n.gravity=10,n.speed=5,n.clustering=!1,n.clusterGravity=10,n.nodes=[],n.edges=[],n.width=300,n.height=300,n.nodeMap={},n.nodeIdxMap={},n.onLayoutEnd=function(){},n.tick=function(){},n.updateCfg(e),n}return gr(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:1e3,gravity:10,speed:1,clustering:!1,clusterGravity:10}},e.prototype.execute=function(){var t,e,n=this,r=this,i=r.nodes;if(void 0!==r.timeInterval&&"undefined"!=typeof window&&window.clearInterval(r.timeInterval),i&&0!==i.length){r.width||"undefined"==typeof window||(r.width=window.innerWidth),r.height||"undefined"==typeof window||(r.height=window.innerHeight),r.center||(r.center=[r.width/2,r.height/2]);var o=r.center;if(1===i.length)return i[0].x=o[0],i[0].y=o[1],void(null===(e=r.onLayoutEnd)||void 0===e||e.call(r));var u={},s={};return i.forEach((function(t,e){a(t.x)||(t.x=Math.random()*n.width),a(t.y)||(t.y=Math.random()*n.height),u[t.id]=t,s[t.id]=e})),r.nodeMap=u,r.nodeIdxMap=s,r.run()}null===(t=r.onLayoutEnd)||void 0===t||t.call(r)},e.prototype.run=function(){var t,e=this,n=e.nodes;if(n){var r=e.edges,i=e.maxIteration,o=e.workerEnabled,a={};if(o){for(var u=0;u<i;u++)e.runOneStep(a);null===(t=e.onLayoutEnd)||void 0===t||t.call(e)}else{if("undefined"==typeof window)return;var s=0;this.timeInterval=window.setInterval((function(){var t;e.runOneStep(a),++s>=i&&(null===(t=e.onLayoutEnd)||void 0===t||t.call(e),window.clearInterval(e.timeInterval))}),0)}return{nodes:n,edges:r}}},e.prototype.runOneStep=function(t){var e,n=this,r=n.nodes;if(r){var i=n.edges,o=n.center,u=n.gravity,s=n.speed,c=n.clustering,f=n.height*n.width,l=Math.sqrt(f)/10,h=f/(r.length+1),d=Math.sqrt(h),p=[];if(r.forEach((function(t,e){p[e]={x:0,y:0}})),n.applyCalculate(r,i,p,d,h),c){for(var v in t)t[v].cx=0,t[v].cy=0,t[v].count=0;for(var v in r.forEach((function(e){var n=t[e.cluster];a(e.x)&&(n.cx+=e.x),a(e.y)&&(n.cy+=e.y),n.count++})),t)t[v].cx/=t[v].count,t[v].cy/=t[v].count;var g=n.clusterGravity||u;r.forEach((function(e,n){if(a(e.x)&&a(e.y)){var r=t[e.cluster],i=Math.sqrt((e.x-r.cx)*(e.x-r.cx)+(e.y-r.cy)*(e.y-r.cy)),o=d*g;p[n].x-=o*(e.x-r.cx)/i,p[n].y-=o*(e.y-r.cy)/i}}))}r.forEach((function(t,e){if(a(t.x)&&a(t.y)){var n=.01*d*u;p[e].x-=n*(t.x-o[0]),p[e].y-=n*(t.y-o[1])}})),r.forEach((function(t,e){if(a(t.fx)&&a(t.fy))return t.x=t.fx,void(t.y=t.fy);if(a(t.x)&&a(t.y)){var n=Math.sqrt(p[e].x*p[e].x+p[e].y*p[e].y);if(n>0){var r=Math.min(l*(s/800),n);t.x+=p[e].x/n*r,t.y+=p[e].y/n*r}}})),null===(e=n.tick)||void 0===e||e.call(n)}},e.prototype.applyCalculate=function(t,e,n,r,i){this.calRepulsive(t,n,i),e&&this.calAttractive(e,n,r)},e.prototype.calRepulsive=function(t,e,n){t.forEach((function(r,i){e[i]={x:0,y:0},t.forEach((function(t,o){if(i!==o&&a(r.x)&&a(t.x)&&a(r.y)&&a(t.y)){var u=r.x-t.x,s=r.y-t.y,c=u*u+s*s;if(0===c){c=1;var f=i>o?1:-1;u=.01*f,s=.01*f}var l=n/c;e[i].x+=u*l,e[i].y+=s*l}}))}))},e.prototype.calAttractive=function(t,e,n){var r=this;t.forEach((function(t){var i=d(t,"source"),o=d(t,"target");if(i&&o){var u=r.nodeIdxMap[i],s=r.nodeIdxMap[o];if(u!==s){var c=r.nodeMap[i],f=r.nodeMap[o];if(a(f.x)&&a(c.x)&&a(f.y)&&a(c.y)){var l=f.x-c.x,h=f.y-c.y,p=Math.sqrt(l*l+h*h),v=p*p/n;e[s].x-=l/p*v,e[s].y-=h/p*v,e[u].x+=l/p*v,e[u].y+=h/p*v}}}}))},e.prototype.stop=function(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){var t=this;t.stop(),t.tick=null,t.nodes=null,t.edges=null,t.destroyed=!0},e.prototype.getType=function(){return"fruchterman"},e}(t);function mr(t,e,n,r){n&&Object.defineProperty(t,e,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function br(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function xr(t,e,n){return e&&_r(t.prototype,e),n&&_r(t,n),t}function wr(t,e,n,r,i){var o={};return Object.keys(r).forEach((function(t){o[t]=r[t]})),o.enumerable=!!o.enumerable,o.configurable=!!o.configurable,("value"in o||o.initializer)&&(o.writable=!0),o=n.slice().reverse().reduce((function(n,r){return r(t,e,n)||n}),o),i&&void 0!==o.initializer&&(o.value=o.initializer?o.initializer.call(i):void 0,o.initializer=void 0),void 0===o.initializer&&(Object.defineProperty(t,e,o),o=null),o}n(8892);var Er=n(122),Sr=n.n(Er);function Ar(t,e,n,r,i,o,a){try{var u=t[o](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,i)}function Tr(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){Ar(o,r,i,a,u,"next",t)}function u(t){Ar(o,r,i,a,u,"throw",t)}a(void 0)}))}}var Ir=1;function Cr(){return Ir++}var Dr=function t(e){br(this,t)},Nr=function(){function t(e){br(this,t),this.clazz=void 0,this.components=[],this.entities=[],this.lookup={},this.clazz=e}var e;return xr(t,[{key:"clear",value:function(){this.components=[],this.entities=[],this.lookup={}}},{key:"contains",value:function(t){return this.lookup[t]>-1}},{key:"create",value:function(t,e){this.lookup[t]=this.components.length;var n=new this.clazz(e||{});return this.components.push(n),this.entities.push(t),n}},{key:"remove",value:function(t){var e=this.lookup[t];e>-1&&e<this.components.length-1&&(this.components[e]=this.components[this.components.length-1],this.entities[e]=this.entities[this.entities.length-1],this.lookup[this.entities[e]]=e),this.components.pop(),this.entities.pop(),delete this.lookup[t]}},{key:"removeKeepSorted",value:function(t){var e=this.lookup[t];if(e>-1){var n=this.entities[e];if(e<this.components.length-1){for(var r=e+1;r<this.components.length;++r)this.components[r-1]=this.components[r];for(var i=e+1;i<this.entities.length;++i)this.entities[i-1]=this.entities[i],this.lookup[this.entities[i-1]]=i-1}this.components.pop(),this.entities.pop(),delete this.lookup[n]}}},{key:"moveItem",value:function(t,e){if(t!==e){for(var n=this.components[t],r=this.entities[t],i=t<e?1:-1,o=t;o!==e;o+=i){var a=o+i;this.components[o]=this.components[a],this.entities[o]=this.entities[a],this.lookup[this.entities[o]]=o}this.components[e]=n,this.entities[e]=r,this.lookup[r]=e}}},{key:"getEntity",value:function(t){return this.entities[t]}},{key:"getComponent",value:function(t){return this.components[t]}},{key:"getComponentByEntity",value:function(t){var e=this.lookup[t];return e>-1?this.components[e]:null}},{key:"getCount",value:function(){return this.components.length}},{key:"getEntityByComponentIndex",value:function(t){for(var e=0,n=Object.keys(this.lookup);e<n.length;e++){var r=n[e],i=Number(r);if(this.lookup[i]===t)return i}return-1}},{key:"find",value:function(t){for(var e=0;e<this.getCount();e++){var n=this.getComponent(e);if(t(n,e))return n}return null}},{key:"findIndex",value:function(t){for(var e=0;e<this.getCount();e++)if(t(this.getComponent(e),e))return e;return-1}},{key:"forEach",value:function(t){for(var e=0,n=Object.keys(this.lookup);e<n.length;e++){var r=n[e],i=Number(r),o=this.lookup[i];t(i,this.getComponent(o))}}},{key:"forEachAsync",value:(e=Tr(Sr().mark((function t(e){var n,r,i,o,a;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=0,r=Object.keys(this.lookup);case 1:if(!(n<r.length)){t.next=10;break}return i=r[n],o=Number(i),a=this.lookup[o],t.next=7,e(o,this.getComponent(a));case 7:n++,t.next=1;break;case 10:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"map",value:function(t){for(var e=[],n=0,r=Object.keys(this.lookup);n<r.length;n++){var i=r[n],o=Number(i),a=this.lookup[o];e.push(t(o,this.getComponent(a)))}return e}}]),t}();function kr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Rr(t,e){if(t){if("string"==typeof t)return kr(t,e);var n=Object.prototype.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)?kr(t,e):void 0}}function Or(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){u=!0,i=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw i}}return o}}(t,e)||Rr(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Mr=n(9311),Pr={HierarchyComponentManager:Symbol("HierarchyComponentManager"),TransformComponentManager:Symbol("TransformComponentManager"),NameComponentManager:Symbol("NameComponentManager"),SceneGraphSystem:Symbol("SceneGraphSystem"),FrameGraphSystem:Symbol("FrameGraphSystem"),ResourcePool:Symbol("ResourcePool"),ResourceHandleComponentManager:Symbol("ResourceHandleComponentManager"),PassNodeComponentManager:Symbol("PassNodeComponentManager"),RendererSystem:Symbol("RendererSystem"),RenderPass:Symbol("RenderPass"),RenderPassFactory:Symbol("Factory<IRenderPass>"),Renderable:Symbol("Factory<IRenderPass>"),MeshSystem:Symbol("MeshSystem"),MeshComponentManager:Symbol("MeshComponentManager"),CullableComponentManager:Symbol("CullableComponentManager"),Geometry:Symbol("Geometry"),GeometrySystem:Symbol("GeometrySystem"),GeometryComponentManager:Symbol("GeometryComponentManager"),Material:Symbol("Material"),MaterialSystem:Symbol("MaterialSystem"),MaterialComponentManager:Symbol("MaterialComponentManager"),ForwardRenderPath:Symbol("ForwardRenderPath"),ComputeSystem:Symbol("ComputeSystem"),ComputeComponentManager:Symbol("ComputeComponentManager"),ComputeStrategy:Symbol("ComputeStrategy"),Systems:Symbol("Systems"),World:Symbol("World"),RenderEngine:Symbol("RenderEngine"),WebGPUEngine:Symbol("WebGPUEngine"),WebGLEngine:Symbol("WebGLEngine"),ShaderModuleService:Symbol("ShaderModuleService"),ConfigService:Symbol("ConfigService"),InteractorService:Symbol("InteractorService"),IEventEmitter:Symbol("IEventEmitter"),Light:Symbol("Light")},Gr=function t(){br(this,t),this.index=void 0},Lr=function t(){br(this,t),this.name=void 0,this.data=void 0,this.execute=void 0,this.tearDown=void 0},Ur=function(){function t(){br(this,t),this.name=void 0,this.refCount=0,this.hasSideEffect=!1,this.devirtualize=[],this.destroy=[],this.reads=[],this.writes=[]}return xr(t,[{key:"read",value:function(t){return this.reads.find((function(e){return e.index===t.index}))||this.reads.push(t),t}},{key:"sample",value:function(t){return this.read(t),t}},{key:"write",value:function(t,e){if(this.writes.find((function(t){return t.index===e.index})))return e;var n=t.getResourceNode(e);n.resource.version++,n.resource.imported&&(this.hasSideEffect=!0);var r=t.createResourceNode(n.resource);return t.getResourceNode(r).writer=this,this.writes.push(r),r}}]),t}();function Fr(t,e){return Fr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Fr(t,e)}function Br(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}}),e&&Fr(t,e)}function zr(t){return zr="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},zr(t)}function jr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Wr(t,e){if(e&&("object"===zr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return jr(t)}function Vr(t){return Vr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Vr(t)}var Xr,Hr,qr,Yr,Kr,Zr,$r=function(t){Br(i,(function t(){br(this,t),this.first=void 0,this.last=void 0}));var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vr(e);if(n){var i=Vr(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wr(this,t)});function i(){var t;br(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return(t=r.call.apply(r,[this].concat(n))).version=0,t.refs=0,t.name=void 0,t.imported=void 0,t.priority=void 0,t.discardStart=!0,t.discardEnd=!1,t.descriptor=void 0,t.resource=void 0,t}return xr(i,[{key:"preExecuteDestroy",value:function(){this.discardEnd=!0}},{key:"postExecuteDestroy",value:function(){this.imported}},{key:"postExecuteDevirtualize",value:function(){this.discardStart=!1}},{key:"preExecuteDevirtualize",value:function(){this.imported}}]),i}(),Jr=function t(){br(this,t),this.resource=void 0,this.writer=void 0,this.readerCount=0,this.version=void 0};function Qr(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return ti(t,e);var n=Object.prototype.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)?ti(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function ti(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var ei=(Xr=(0,Mr.b2)(),Hr=(0,Mr.f3)(Pr.RenderEngine),Xr((Zr=function(){function t(){br(this,t),this.passNodes=[],this.resourceNodes=[],this.frameGraphPasses=[],mr(this,"engine",Kr,this)}var e,n;return xr(t,[{key:"execute",value:(n=Tr(Sr().mark((function t(e){return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.compile(),t.next=3,this.executePassNodes(e);case 3:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"tearDown",value:function(){this.frameGraphPasses.forEach((function(t){t.tearDown&&t.tearDown()})),this.reset()}},{key:"addPass",value:function(t,e,n,r){var i=new Lr;i.execute=n,r&&(i.tearDown=r),i.name=t;var o=new Ur;return o.name=t,this.passNodes.push(o),this.frameGraphPasses.push(i),e(this,o,i),i}},{key:"getPass",value:function(t){return this.frameGraphPasses.find((function(e){return e.name===t}))}},{key:"compile",value:function(){var t,e=this,n=Qr(this.passNodes);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.refCount=r.writes.length+(r.hasSideEffect?1:0),r.reads.forEach((function(t){e.resourceNodes[t.index].readerCount++}))}}catch(t){n.e(t)}finally{n.f()}var i,o=[],a=Qr(this.resourceNodes);try{for(a.s();!(i=a.n()).done;){var u=i.value;0===u.readerCount&&o.push(u)}}catch(t){a.e(t)}finally{a.f()}for(;o.length;){var s=o.pop(),c=s&&s.writer;if(c&&0==--c.refCount){var f,l=Qr(c.reads);try{for(l.s();!(f=l.n()).done;){var h=f.value,d=this.resourceNodes[h.index];0==--d.readerCount&&o.push(d)}}catch(t){l.e(t)}finally{l.f()}}}this.resourceNodes.forEach((function(t){t.resource.refs+=t.readerCount}));var p,v=Qr(this.passNodes);try{for(v.s();!(p=v.n()).done;){var g=p.value;if(g.refCount){var y,m=Qr(g.reads);try{for(m.s();!(y=m.n()).done;){var b=y.value,_=this.resourceNodes[b.index].resource;_.first=_.first?_.first:g,_.last=g}}catch(t){m.e(t)}finally{m.f()}var x,w=Qr(g.writes);try{for(w.s();!(x=w.n()).done;){var E=x.value,S=this.resourceNodes[E.index].resource;S.first=S.first?S.first:g,S.last=g}}catch(t){w.e(t)}finally{w.f()}}}}catch(t){v.e(t)}finally{v.f()}for(var A=0;A<2;A++){var T,I=Qr(this.resourceNodes);try{for(I.s();!(T=I.n()).done;){var C=T.value.resource;if(C.priority===A&&C.refs){var D=C.first,N=C.last;D&&N&&(D.devirtualize.push(C),N.destroy.push(C))}}}catch(t){I.e(t)}finally{I.f()}}}},{key:"executePassNodes",value:(e=Tr(Sr().mark((function t(e){var n,r,i,o,a,u,s,c,f,l,h,d,p;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=Qr(this.passNodes.entries()),t.prev=1,n.s();case 3:if((r=n.n()).done){t.next=18;break}if(i=Or(r.value,2),o=i[0],!(a=i[1]).refCount){t.next=16;break}u=Qr(a.devirtualize);try{for(u.s();!(s=u.n()).done;)s.value.preExecuteDevirtualize(this.engine)}catch(t){u.e(t)}finally{u.f()}c=Qr(a.destroy);try{for(c.s();!(f=c.n()).done;)f.value.preExecuteDestroy(this.engine)}catch(t){c.e(t)}finally{c.f()}return t.next=12,this.frameGraphPasses[o].execute(this,this.frameGraphPasses[o],e);case 12:l=Qr(a.devirtualize);try{for(l.s();!(h=l.n()).done;)h.value.postExecuteDevirtualize(this.engine)}catch(t){l.e(t)}finally{l.f()}d=Qr(a.destroy);try{for(d.s();!(p=d.n()).done;)p.value.postExecuteDestroy(this.engine)}catch(t){d.e(t)}finally{d.f()}case 16:t.next=3;break;case 18:t.next=23;break;case 20:t.prev=20,t.t0=t.catch(1),n.e(t.t0);case 23:return t.prev=23,n.f(),t.finish(23);case 26:this.reset();case 27:case"end":return t.stop()}}),t,this,[[1,20,23,26]])}))),function(t){return e.apply(this,arguments)})},{key:"reset",value:function(){this.passNodes=[],this.resourceNodes=[],this.frameGraphPasses=[]}},{key:"getResourceNode",value:function(t){return this.resourceNodes[t.index]}},{key:"createResourceNode",value:function(t){var e=new Jr;e.resource=t,e.version=t.version,this.resourceNodes.push(e);var n=new Gr;return n.index=this.resourceNodes.length-1,n}},{key:"createTexture",value:function(t,e,n){var r=new $r;return r.name=e,r.descriptor=n,this.createResourceNode(r)}},{key:"createRenderTarget",value:function(t,e,n){var r=new $r;return r.name=e,r.descriptor=n,this.createResourceNode(r)}},{key:"present",value:function(t){this.addPass("Present",(function(e,n){n.read(t),n.hasSideEffect=!0}),Tr(Sr().mark((function t(){return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)}))))}}]),t}(),Kr=wr((Yr=Zr).prototype,"engine",[Hr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),qr=Yr))||qr);function ni(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var ri=1e-6,ii="undefined"!=typeof Float32Array?Float32Array:Array;function oi(){var t=new ii(4);return ii!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function ai(t,e,n,r){var i=new ii(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i}function ui(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}function si(){var t=new ii(9);return ii!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function ci(){var t=new ii(3);return ii!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function fi(t){var e=new ii(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function li(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)}function hi(t,e,n){var r=new ii(3);return r[0]=t,r[1]=e,r[2]=n,r}function di(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function pi(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function vi(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function gi(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function yi(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function mi(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function bi(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function _i(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t}function xi(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function wi(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t}Math.random,Math.PI,Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)}),oi();var Ei=gi,Si=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.hypot(n,r,i)},Ai=li,Ti=(ci(),9007199254740991),Ii={};Ii["[object Float32Array]"]=Ii["[object Float64Array]"]=Ii["[object Int8Array]"]=Ii["[object Int16Array]"]=Ii["[object Int32Array]"]=Ii["[object Uint8Array]"]=Ii["[object Uint8ClampedArray]"]=Ii["[object Uint16Array]"]=Ii["[object Uint32Array]"]=!0,Ii["[object Arguments]"]=Ii["[object Array]"]=Ii["[object ArrayBuffer]"]=Ii["[object Boolean]"]=Ii["[object DataView]"]=Ii["[object Date]"]=Ii["[object Error]"]=Ii["[object Function]"]=Ii["[object Map]"]=Ii["[object Number]"]=Ii["[object Object]"]=Ii["[object RegExp]"]=Ii["[object Set]"]=Ii["[object String]"]=Ii["[object WeakMap]"]=!1;var Ci=Object.prototype.toString,Di=function(t){return function(t){return!!t&&"object"===zr(t)}(t)&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=Ti}(t.length)&&!!Ii[Ci.call(t)]};function Ni(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 ki(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ni(Object(n),!0).forEach((function(e){ni(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ni(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Ri,Oi,Mi,Pi,Gi,Li,Ui,Fi,Bi,zi=function(t){Br(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vr(e);if(n){var i=Vr(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wr(this,t)});function i(t){var e;return br(this,i),(e=r.call(this,t)).dirty=!0,e.attributes=[],e.indices=void 0,e.indicesBuffer=void 0,e.vertexCount=0,e.maxInstancedCount=void 0,e.aabb=void 0,e.entity=void 0,Object.assign(jr(e),t),e}return xr(i,[{key:"setAttribute",value:function(t,e,n,r){var i=this.attributes.find((function(e){return e.name===t}));return i?(i.data=e,i.dirty=!0):this.attributes.push(ki(ki({dirty:!0,name:t,data:e},n),{},{bufferGetter:r})),this.dirty=!0,this}},{key:"setIndex",value:function(t){return this.indices=new Uint32Array(t.buffer?t.buffer:t),this.dirty=!0,this}},{key:"applyMatrix",value:function(t){var e,n,r,i,o,a,u,s,c,f,l,h,d,p,v,g,y,m,b,_,x,w,E,S,A,T,I,C,D,N,k,R=this.attributes.find((function(t){return"position"===t.name})),O=this.attributes.find((function(t){return"normal"===t.name}));if(R&&(R.dirty=!0,R.data&&R.data.length))for(var M=0;M<R.data.length;M+=3){var P=ai(R.data[M],R.data[M+1],R.data[M+2],1);ui(P,P,t),Di(R.data)?R.data.set([P[0],P[1],P[2]],M):(R.data[M]=P[0],R.data[M+1]=P[1],R.data[M+2]=P[2])}if(O){var G=(e=si(),r=(n=t)[0],i=n[1],o=n[2],a=n[3],u=n[4],s=n[5],c=n[6],f=n[7],l=n[8],h=n[9],d=n[10],p=n[11],v=n[12],g=n[13],y=n[14],m=n[15],(k=(b=r*s-i*u)*(N=d*m-p*y)-(_=r*c-o*u)*(D=h*m-p*g)+(x=r*f-a*u)*(C=h*y-d*g)+(w=i*c-o*s)*(I=l*m-p*v)-(E=i*f-a*s)*(T=l*y-d*v)+(S=o*f-a*c)*(A=l*g-h*v))?(k=1/k,e[0]=(s*N-c*D+f*C)*k,e[1]=(c*I-u*N-f*T)*k,e[2]=(u*D-s*I+f*A)*k,e[3]=(o*D-i*N-a*C)*k,e[4]=(r*N-o*I+a*T)*k,e[5]=(i*I-r*D-a*A)*k,e[6]=(g*S-y*E+m*w)*k,e[7]=(y*x-v*S-m*_)*k,e[8]=(v*E-g*x+m*b)*k,e):null);if(O.data&&O.data.length)for(var L=0;L<O.data.length;L+=3){var U=hi(O.data[L],O.data[L+1],O.data[L+2]);wi(U,U,G),mi(U,U),Di(O.data)?O.data.set([U[0],U[1],U[2]],L):(O.data[L]=U[0],O.data[L+1]=U[1],O.data[L+2]=U[2])}}}}]),i}(Dr);!function(t){t[t.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",t[t.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",t[t.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t[t.ZERO=0]="ZERO",t[t.ONE=1]="ONE",t[t.SRC_COLOR=768]="SRC_COLOR",t[t.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",t[t.SRC_ALPHA=770]="SRC_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",t[t.DST_ALPHA=772]="DST_ALPHA",t[t.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",t[t.DST_COLOR=774]="DST_COLOR",t[t.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",t[t.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",t[t.FUNC_ADD=32774]="FUNC_ADD",t[t.BLEND_EQUATION=32777]="BLEND_EQUATION",t[t.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",t[t.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",t[t.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",t[t.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",t[t.MAX_EXT=32776]="MAX_EXT",t[t.MIN_EXT=32775]="MIN_EXT",t[t.BLEND_DST_RGB=32968]="BLEND_DST_RGB",t[t.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",t[t.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",t[t.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",t[t.CONSTANT_COLOR=32769]="CONSTANT_COLOR",t[t.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",t[t.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",t[t.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",t[t.BLEND_COLOR=32773]="BLEND_COLOR",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",t[t.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",t[t.STREAM_DRAW=35040]="STREAM_DRAW",t[t.STATIC_DRAW=35044]="STATIC_DRAW",t[t.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",t[t.BUFFER_SIZE=34660]="BUFFER_SIZE",t[t.BUFFER_USAGE=34661]="BUFFER_USAGE",t[t.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",t[t.FRONT=1028]="FRONT",t[t.BACK=1029]="BACK",t[t.FRONT_AND_BACK=1032]="FRONT_AND_BACK",t[t.CULL_FACE=2884]="CULL_FACE",t[t.BLEND=3042]="BLEND",t[t.DITHER=3024]="DITHER",t[t.STENCIL_TEST=2960]="STENCIL_TEST",t[t.DEPTH_TEST=2929]="DEPTH_TEST",t[t.SCISSOR_TEST=3089]="SCISSOR_TEST",t[t.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",t[t.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",t[t.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",t[t.NO_ERROR=0]="NO_ERROR",t[t.INVALID_ENUM=1280]="INVALID_ENUM",t[t.INVALID_VALUE=1281]="INVALID_VALUE",t[t.INVALID_OPERATION=1282]="INVALID_OPERATION",t[t.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",t[t.CW=2304]="CW",t[t.CCW=2305]="CCW",t[t.LINE_WIDTH=2849]="LINE_WIDTH",t[t.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",t[t.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",t[t.CULL_FACE_MODE=2885]="CULL_FACE_MODE",t[t.FRONT_FACE=2886]="FRONT_FACE",t[t.DEPTH_RANGE=2928]="DEPTH_RANGE",t[t.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",t[t.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",t[t.DEPTH_FUNC=2932]="DEPTH_FUNC",t[t.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",t[t.STENCIL_FUNC=2962]="STENCIL_FUNC",t[t.STENCIL_FAIL=2964]="STENCIL_FAIL",t[t.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",t[t.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",t[t.STENCIL_REF=2967]="STENCIL_REF",t[t.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",t[t.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",t[t.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",t[t.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",t[t.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",t[t.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",t[t.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",t[t.VIEWPORT=2978]="VIEWPORT",t[t.SCISSOR_BOX=3088]="SCISSOR_BOX",t[t.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",t[t.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",t[t.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",t[t.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",t[t.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",t[t.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",t[t.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",t[t.RED_BITS=3410]="RED_BITS",t[t.GREEN_BITS=3411]="GREEN_BITS",t[t.BLUE_BITS=3412]="BLUE_BITS",t[t.ALPHA_BITS=3413]="ALPHA_BITS",t[t.DEPTH_BITS=3414]="DEPTH_BITS",t[t.STENCIL_BITS=3415]="STENCIL_BITS",t[t.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",t[t.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",t[t.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",t[t.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",t[t.SAMPLES=32937]="SAMPLES",t[t.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",t[t.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",t[t.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",t[t.DONT_CARE=4352]="DONT_CARE",t[t.FASTEST=4353]="FASTEST",t[t.NICEST=4354]="NICEST",t[t.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",t[t.BYTE=5120]="BYTE",t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.SHORT=5122]="SHORT",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.INT=5124]="INT",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.FLOAT=5126]="FLOAT",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.ALPHA=6406]="ALPHA",t[t.RGB=6407]="RGB",t[t.RGBA=6408]="RGBA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",t[t.VERTEX_SHADER=35633]="VERTEX_SHADER",t[t.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",t[t.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",t[t.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",t[t.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",t[t.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",t[t.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",t[t.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",t[t.SHADER_TYPE=35663]="SHADER_TYPE",t[t.DELETE_STATUS=35712]="DELETE_STATUS",t[t.LINK_STATUS=35714]="LINK_STATUS",t[t.VALIDATE_STATUS=35715]="VALIDATE_STATUS",t[t.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",t[t.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",t[t.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",t[t.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",t[t.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",t[t.NEVER=512]="NEVER",t[t.LESS=513]="LESS",t[t.EQUAL=514]="EQUAL",t[t.LEQUAL=515]="LEQUAL",t[t.GREATER=516]="GREATER",t[t.NOTEQUAL=517]="NOTEQUAL",t[t.GEQUAL=518]="GEQUAL",t[t.ALWAYS=519]="ALWAYS",t[t.KEEP=7680]="KEEP",t[t.REPLACE=7681]="REPLACE",t[t.INCR=7682]="INCR",t[t.DECR=7683]="DECR",t[t.INVERT=5386]="INVERT",t[t.INCR_WRAP=34055]="INCR_WRAP",t[t.DECR_WRAP=34056]="DECR_WRAP",t[t.VENDOR=7936]="VENDOR",t[t.RENDERER=7937]="RENDERER",t[t.VERSION=7938]="VERSION",t[t.NEAREST=9728]="NEAREST",t[t.LINEAR=9729]="LINEAR",t[t.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",t[t.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",t[t.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",t[t.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",t[t.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",t[t.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",t[t.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",t[t.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE=5890]="TEXTURE",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t[t.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",t[t.TEXTURE0=33984]="TEXTURE0",t[t.TEXTURE1=33985]="TEXTURE1",t[t.TEXTURE2=33986]="TEXTURE2",t[t.TEXTURE3=33987]="TEXTURE3",t[t.TEXTURE4=33988]="TEXTURE4",t[t.TEXTURE5=33989]="TEXTURE5",t[t.TEXTURE6=33990]="TEXTURE6",t[t.TEXTURE7=33991]="TEXTURE7",t[t.TEXTURE8=33992]="TEXTURE8",t[t.TEXTURE9=33993]="TEXTURE9",t[t.TEXTURE10=33994]="TEXTURE10",t[t.TEXTURE11=33995]="TEXTURE11",t[t.TEXTURE12=33996]="TEXTURE12",t[t.TEXTURE13=33997]="TEXTURE13",t[t.TEXTURE14=33998]="TEXTURE14",t[t.TEXTURE15=33999]="TEXTURE15",t[t.TEXTURE16=34e3]="TEXTURE16",t[t.TEXTURE17=34001]="TEXTURE17",t[t.TEXTURE18=34002]="TEXTURE18",t[t.TEXTURE19=34003]="TEXTURE19",t[t.TEXTURE20=34004]="TEXTURE20",t[t.TEXTURE21=34005]="TEXTURE21",t[t.TEXTURE22=34006]="TEXTURE22",t[t.TEXTURE23=34007]="TEXTURE23",t[t.TEXTURE24=34008]="TEXTURE24",t[t.TEXTURE25=34009]="TEXTURE25",t[t.TEXTURE26=34010]="TEXTURE26",t[t.TEXTURE27=34011]="TEXTURE27",t[t.TEXTURE28=34012]="TEXTURE28",t[t.TEXTURE29=34013]="TEXTURE29",t[t.TEXTURE30=34014]="TEXTURE30",t[t.TEXTURE31=34015]="TEXTURE31",t[t.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",t[t.REPEAT=10497]="REPEAT",t[t.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t[t.FLOAT_VEC2=35664]="FLOAT_VEC2",t[t.FLOAT_VEC3=35665]="FLOAT_VEC3",t[t.FLOAT_VEC4=35666]="FLOAT_VEC4",t[t.INT_VEC2=35667]="INT_VEC2",t[t.INT_VEC3=35668]="INT_VEC3",t[t.INT_VEC4=35669]="INT_VEC4",t[t.BOOL=35670]="BOOL",t[t.BOOL_VEC2=35671]="BOOL_VEC2",t[t.BOOL_VEC3=35672]="BOOL_VEC3",t[t.BOOL_VEC4=35673]="BOOL_VEC4",t[t.FLOAT_MAT2=35674]="FLOAT_MAT2",t[t.FLOAT_MAT3=35675]="FLOAT_MAT3",t[t.FLOAT_MAT4=35676]="FLOAT_MAT4",t[t.SAMPLER_2D=35678]="SAMPLER_2D",t[t.SAMPLER_CUBE=35680]="SAMPLER_CUBE",t[t.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",t[t.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",t[t.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",t[t.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",t[t.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",t[t.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",t[t.COMPILE_STATUS=35713]="COMPILE_STATUS",t[t.LOW_FLOAT=36336]="LOW_FLOAT",t[t.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",t[t.HIGH_FLOAT=36338]="HIGH_FLOAT",t[t.LOW_INT=36339]="LOW_INT",t[t.MEDIUM_INT=36340]="MEDIUM_INT",t[t.HIGH_INT=36341]="HIGH_INT",t[t.FRAMEBUFFER=36160]="FRAMEBUFFER",t[t.RENDERBUFFER=36161]="RENDERBUFFER",t[t.RGBA4=32854]="RGBA4",t[t.RGB5_A1=32855]="RGB5_A1",t[t.RGB565=36194]="RGB565",t[t.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",t[t.STENCIL_INDEX=6401]="STENCIL_INDEX",t[t.STENCIL_INDEX8=36168]="STENCIL_INDEX8",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t[t.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",t[t.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",t[t.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",t[t.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",t[t.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",t[t.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",t[t.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",t[t.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",t[t.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",t[t.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",t[t.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",t[t.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",t[t.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",t[t.NONE=0]="NONE",t[t.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",t[t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",t[t.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",t[t.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",t[t.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",t[t.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",t[t.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",t[t.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",t[t.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",t[t.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",t[t.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",t[t.COPY_SRC=1]="COPY_SRC",t[t.COPY_DST=2]="COPY_DST",t[t.SAMPLED=4]="SAMPLED",t[t.STORAGE=8]="STORAGE",t[t.RENDER_ATTACHMENT=16]="RENDER_ATTACHMENT"}(Ri||(Ri={}));var ji=(Oi=(0,Mr.b2)(),Mi=(0,Mr.f3)(Pr.GeometryComponentManager),Pi=(0,Mr.f3)(Pr.RenderEngine),Oi((Bi=function(){function t(){br(this,t),mr(this,"geometry",Ui,this),mr(this,"engine",Fi,this)}var e;return xr(t,[{key:"execute",value:(e=Tr(Sr().mark((function t(){var e=this;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.geometry.forEach((function(t,n){n.dirty&&(n.attributes.forEach((function(t){var n;t.dirty&&t.data&&(t.buffer?null===(n=t.buffer)||void 0===n||n.subData({data:t.data,offset:0}):t.buffer=e.engine.createBuffer({data:t.data,type:Ri.FLOAT}),t.dirty=!1)})),n.indices&&(n.indicesBuffer?n.indicesBuffer.subData({data:n.indices,offset:0}):n.indicesBuffer=e.engine.createElements({data:n.indices,count:n.indices.length,type:Ri.UNSIGNED_INT,usage:Ri.STATIC_DRAW})),n.dirty=!1)}));case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"tearDown",value:function(){this.geometry.forEach((function(t,e){e.indicesBuffer&&e.indicesBuffer.destroy(),e.attributes.forEach((function(t){t.buffer&&t.buffer.destroy()}))})),this.geometry.clear()}},{key:"createBufferGeometry",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{vertexCount:3},e=t.vertexCount,n=Cr();return this.geometry.create(n,{vertexCount:e})}},{key:"createInstancedBufferGeometry",value:function(t){var e=t.maxInstancedCount,n=t.vertexCount,r=Cr();return this.geometry.create(r,{maxInstancedCount:e,vertexCount:n})}}]),t}(),Ui=wr((Li=Bi).prototype,"geometry",[Mi],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Fi=wr(Li.prototype,"engine",[Pi],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Gi=Li))||Gi);function Wi(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 Vi(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Wi(Object(n),!0).forEach((function(e){ni(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Wi(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Xi,Hi,qi,Yi,Ki,Zi,$i,Ji,Qi,to,eo=function(t){Br(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vr(e);if(n){var i=Vr(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wr(this,t)});function i(t){var e;return br(this,i),(e=r.call(this,t)).vertexShaderGLSL=void 0,e.fragmentShaderGLSL=void 0,e.defines={},e.dirty=!0,e.uniforms=[],e.cull={enable:!0,face:Ri.BACK},e.depth={enable:!0},e.blend=void 0,e.entity=void 0,e.type=void 0,Object.assign(jr(e),t),e}return xr(i,[{key:"setDefines",value:function(t){return this.defines=Vi(Vi({},this.defines),t),this}},{key:"setCull",value:function(t){return this.cull=t,this}},{key:"setDepth",value:function(t){return this.depth=t,this}},{key:"setBlend",value:function(t){return this.blend=t,this}},{key:"setUniform",value:function(t,e){var n=this;if("string"!=typeof t)return Object.keys(t).forEach((function(e){return n.setUniform(e,t[e])})),this;var r=this.uniforms.find((function(e){return e.name===t}));return r?(r.dirty=!0,r.data=e):this.uniforms.push({name:t,dirty:!0,data:e}),this.dirty=!0,this}}]),i}(Dr);function no(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 ro(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?no(Object(n),!0).forEach((function(e){ni(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):no(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var io,oo=(Xi=(0,Mr.b2)(),Hi=(0,Mr.f3)(Pr.MaterialComponentManager),qi=(0,Mr.f3)(Pr.RenderEngine),Yi=(0,Mr.f3)(Pr.ShaderModuleService),Xi((to=function(){function t(){br(this,t),mr(this,"material",$i,this),mr(this,"engine",Ji,this),mr(this,"shaderModule",Qi,this)}var e;return xr(t,[{key:"execute",value:(e=Tr(Sr().mark((function t(){return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)}))),function(){return e.apply(this,arguments)})},{key:"tearDown",value:function(){this.material.clear()}},{key:"createShaderMaterial",value:function(t){var e=Cr(),n=t.vertexShader,r=t.fragmentShader,i=[];if(!this.engine.supportWebGPU){var o="material-".concat(e);this.shaderModule.registerModule(o,{vs:t.vertexShader,fs:t.fragmentShader});var a=this.shaderModule.getModule(o);n=a.vs,r=a.fs,a.uniforms&&(i=Object.keys(a.uniforms).map((function(t){return{dirty:!0,name:t,data:a.uniforms[t]}})))}return this.material.create(e,ro(ro({vertexShaderGLSL:n,fragmentShaderGLSL:r},t),{},{uniforms:i}))}}]),t}(),$i=wr((Zi=to).prototype,"material",[Hi],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ji=wr(Zi.prototype,"engine",[qi],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Qi=wr(Zi.prototype,"shaderModule",[Yi],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ki=Zi))||Ki);!function(t){t[t.Standard=0]="Standard"}(io||(io={}));var ao=function(t){Br(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vr(e);if(n){var i=Vr(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wr(this,t)});function i(t){var e;return br(this,i),(e=r.call(this,t)).strategy=io.Standard,e.visibilityPlaneMask=0,e.visible=!1,Object.assign(jr(e),t),e}return i}(Dr),uo=function(){function t(e,n){br(this,t),this.center=void 0,this.halfExtents=void 0,this.min=ci(),this.max=ci(),this.update(e,n)}return xr(t,[{key:"update",value:function(t,e){this.center=t||ci(),this.halfExtents=e||hi(.5,.5,.5),this.min=Ei(this.min,this.center,this.halfExtents),this.max=vi(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(t,e){vi(this.center,e,t),yi(this.center,this.center,.5),Ei(this.halfExtents,e,t),yi(this.halfExtents,this.halfExtents,.5),di(this.min,t),di(this.max,e)}},{key:"getMin",value:function(){return this.min}},{key:"getMax",value:function(){return this.max}},{key:"add",value:function(t){var e=this.center,n=e[0],r=e[1],i=e[2],o=this.halfExtents,a=o[0],u=o[1],s=o[2],c=n-a,f=n+a,l=r-u,h=r+u,d=i-s,p=i+s,v=t.center,g=v[0],y=v[1],m=v[2],b=t.halfExtents,_=b[0],x=b[1],w=b[2],E=g-_,S=g+_,A=y-x,T=y+x,I=m-w,C=m+w;E<c&&(c=E),S>f&&(f=S),A<l&&(l=A),T>h&&(h=T),I<d&&(d=I),C>p&&(p=C),e[0]=.5*(c+f),e[1]=.5*(l+h),e[2]=.5*(d+p),o[0]=.5*(f-c),o[1]=.5*(h-l),o[2]=.5*(p-d),this.min[0]=c,this.min[1]=l,this.min[2]=d,this.max[0]=f,this.max[1]=h,this.max[2]=p}},{key:"intersects",value:function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),i=t.getMin();return n[0]<=r[0]&&e[0]>=i[0]&&n[1]<=r[1]&&e[1]>=i[1]&&n[2]<=r[2]&&e[2]>=i[2]}},{key:"containsPoint",value:function(t){var e=this.getMin(),n=this.getMax();return!(t[0]<e[0]||t[0]>n[0]||t[1]<e[1]||t[1]>n[1]||t[2]<e[2]||t[2]>n[2])}},{key:"getNegativeFarPoint",value:function(t){return 273===t.pnVertexFlag?di(ci(),this.min):272===t.pnVertexFlag?hi(this.min[0],this.min[1],this.max[2]):257===t.pnVertexFlag?hi(this.min[0],this.max[1],this.min[2]):256===t.pnVertexFlag?hi(this.min[0],this.max[1],this.max[2]):17===t.pnVertexFlag?hi(this.max[0],this.min[1],this.min[2]):16===t.pnVertexFlag?hi(this.max[0],this.min[1],this.max[2]):1===t.pnVertexFlag?hi(this.max[0],this.max[1],this.min[2]):hi(this.max[0],this.max[1],this.max[2])}},{key:"getPositiveFarPoint",value:function(t){return 273===t.pnVertexFlag?di(ci(),this.max):272===t.pnVertexFlag?hi(this.max[0],this.max[1],this.min[2]):257===t.pnVertexFlag?hi(this.max[0],this.min[1],this.max[2]):256===t.pnVertexFlag?hi(this.max[0],this.min[1],this.min[2]):17===t.pnVertexFlag?hi(this.min[0],this.max[1],this.max[2]):16===t.pnVertexFlag?hi(this.min[0],this.max[1],this.min[2]):1===t.pnVertexFlag?hi(this.min[0],this.min[1],this.max[2]):hi(this.min[0],this.min[1],this.min[2])}}]),t}();var so,co=function(t){Br(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vr(e);if(n){var i=Vr(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wr(this,t)});function i(t){var e;return br(this,i),(e=r.call(this,t)).material=void 0,e.geometry=void 0,e.aabb=new uo,e.aabbDirty=!0,e.model=void 0,e.visible=!0,e.children=[],Object.assign(jr(e),t),e}return i}(Dr),fo=function(){function t(e,n){br(this,t),this.distance=void 0,this.normal=void 0,this.pnVertexFlag=void 0,this.distance=e||0,this.normal=n||hi(0,1,0),this.updatePNVertexFlag()}return xr(t,[{key:"updatePNVertexFlag",value:function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)}},{key:"distanceToPoint",value:function(t){return bi(t,this.normal)-this.distance}},{key:"normalize",value:function(){var t=1/Ai(this.normal);yi(this.normal,this.normal,t),this.distance*=t}},{key:"intersectsLine",value:function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),o=i>=0&&i<=1;return o&&n&&_i(n,t,e,i),o}}]),t}();!function(t){t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE"}(so||(so={}));var lo,ho,po,vo,go,yo,mo,bo,_o,xo,wo,Eo,So,Ao,To=function(){function t(e){if(br(this,t),this.planes=[],e)this.planes=e;else for(var n=0;n<6;n++)this.planes.push(new fo)}return xr(t,[{key:"extractFromVPMatrix",value:function(t){var e=Or(t,16),n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],u=e[5],s=e[6],c=e[7],f=e[8],l=e[9],h=e[10],d=e[11],p=e[12],v=e[13],g=e[14],y=e[15];pi(this.planes[0].normal,o-n,c-a,d-f),this.planes[0].distance=-(y-p),pi(this.planes[1].normal,o+n,c+a,d+f),this.planes[1].distance=-(y+p),pi(this.planes[2].normal,o+r,c+u,d+l),this.planes[2].distance=-(y+v),pi(this.planes[3].normal,o-r,c-u,d-l),this.planes[3].distance=-(y-v),pi(this.planes[4].normal,o-i,c-s,d-h),this.planes[4].distance=-(y-g),pi(this.planes[5].normal,o+i,c+s,d+h),this.planes[5].distance=-(y+g),this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))}}]),t}();function Io(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Co(t,e);var n=Object.prototype.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)?Co(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Co(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Do=(lo=(0,Mr.b2)(),ho=(0,Mr.f3)(Pr.MeshComponentManager),po=(0,Mr.f3)(Pr.CullableComponentManager),vo=(0,Mr.f3)(Pr.GeometryComponentManager),go=(0,Mr.f3)(Pr.HierarchyComponentManager),yo=(0,Mr.f3)(Pr.TransformComponentManager),lo((Ao=function(){function t(){br(this,t),mr(this,"mesh",_o,this),mr(this,"cullable",xo,this),mr(this,"geometry",wo,this),mr(this,"hierarchy",Eo,this),mr(this,"transform",So,this),this.planes=void 0}var e;return xr(t,[{key:"setFrustumPlanes",value:function(t){this.planes=t}},{key:"execute",value:(e=Tr(Sr().mark((function t(e){var n,r,i,o,a,u,s,c,f,l,h,d,p,v,g,y,m,b,_,x,w;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=Io(e);try{for(n.s();!(r=n.n()).done;){i=r.value,o=i.getScene(),a=i.getCamera(),u=Io(o.getEntities());try{for(u.s();!(s=u.n()).done;)c=s.value,(f=this.mesh.getComponentByEntity(c))&&(l=this.hierarchy.getComponentByEntity(c),h=this.cullable.getComponentByEntity(c),d=f.geometry,p=this.transform.getComponentByEntity(c),d&&d.aabb&&p&&f.aabbDirty&&(v=p.worldTransform,g=d.aabb,y=g.center,m=g.halfExtents,b=xi(ci(),y,v),E=v,(S=si())[0]=E[0],S[1]=E[1],S[2]=E[2],S[3]=E[4],S[4]=E[5],S[5]=E[6],S[6]=E[8],S[7]=E[9],S[8]=E[10],_=S,x=wi(ci(),m,_),f.aabb.update(b,x),f.aabbDirty=!1),h&&d&&(w=this.cullable.getComponentByEntity((null==l?void 0:l.parentID)||-1),h.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(f.aabb,(null==w?void 0:w.visibilityPlaneMask)||so.INDETERMINATE,this.planes||a.getFrustum().planes),h.visible=h.visibilityPlaneMask!==so.OUTSIDE))}catch(t){u.e(t)}finally{u.f()}}}catch(t){n.e(t)}finally{n.f()}case 2:case"end":return t.stop()}var E,S}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"tearDown",value:function(){this.cullable.clear(),this.mesh.clear()}},{key:"computeVisibilityWithPlaneMask",value:function(t,e,n){if(e===so.OUTSIDE||e===so.INSIDE)return e;for(var r=so.INSIDE,i=0,o=n.length;i<o;++i){var a=i<31?1<<i:0;if(!(i<31&&0==(e&a))){var u=n[i],s=u.normal,c=u.distance;if(bi(s,t.getNegativeFarPoint(n[i]))+c>0)return so.OUTSIDE;bi(s,t.getPositiveFarPoint(n[i]))+c>0&&(r|=a)}}return r}}]),t}(),_o=wr((bo=Ao).prototype,"mesh",[ho],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),xo=wr(bo.prototype,"cullable",[po],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),wo=wr(bo.prototype,"geometry",[vo],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Eo=wr(bo.prototype,"hierarchy",[go],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),So=wr(bo.prototype,"transform",[yo],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),mo=bo))||mo);function No(){var t=new ii(16);return ii!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function ko(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Ro(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Oo(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],u=e[5],s=e[6],c=e[7],f=e[8],l=e[9],h=e[10],d=e[11],p=e[12],v=e[13],g=e[14],y=e[15],m=n*u-r*a,b=n*s-i*a,_=n*c-o*a,x=r*s-i*u,w=r*c-o*u,E=i*c-o*s,S=f*v-l*p,A=f*g-h*p,T=f*y-d*p,I=l*g-h*v,C=l*y-d*v,D=h*y-d*g,N=m*D-b*C+_*I+x*T-w*A+E*S;return N?(N=1/N,t[0]=(u*D-s*C+c*I)*N,t[1]=(i*C-r*D-o*I)*N,t[2]=(v*E-g*w+y*x)*N,t[3]=(h*w-l*E-d*x)*N,t[4]=(s*T-a*D-c*A)*N,t[5]=(n*D-i*T+o*A)*N,t[6]=(g*_-p*E-y*b)*N,t[7]=(f*E-h*_+d*b)*N,t[8]=(a*C-u*T+c*S)*N,t[9]=(r*T-n*C-o*S)*N,t[10]=(p*w-v*_+y*m)*N,t[11]=(l*_-f*w-d*m)*N,t[12]=(u*A-a*I-s*S)*N,t[13]=(n*I-r*A+i*S)*N,t[14]=(v*b-p*x-g*m)*N,t[15]=(f*x-l*b+h*m)*N,t):null}function Mo(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],u=e[4],s=e[5],c=e[6],f=e[7],l=e[8],h=e[9],d=e[10],p=e[11],v=e[12],g=e[13],y=e[14],m=e[15],b=n[0],_=n[1],x=n[2],w=n[3];return t[0]=b*r+_*u+x*l+w*v,t[1]=b*i+_*s+x*h+w*g,t[2]=b*o+_*c+x*d+w*y,t[3]=b*a+_*f+x*p+w*m,b=n[4],_=n[5],x=n[6],w=n[7],t[4]=b*r+_*u+x*l+w*v,t[5]=b*i+_*s+x*h+w*g,t[6]=b*o+_*c+x*d+w*y,t[7]=b*a+_*f+x*p+w*m,b=n[8],_=n[9],x=n[10],w=n[11],t[8]=b*r+_*u+x*l+w*v,t[9]=b*i+_*s+x*h+w*g,t[10]=b*o+_*c+x*d+w*y,t[11]=b*a+_*f+x*p+w*m,b=n[12],_=n[13],x=n[14],w=n[15],t[12]=b*r+_*u+x*l+w*v,t[13]=b*i+_*s+x*h+w*g,t[14]=b*o+_*c+x*d+w*y,t[15]=b*a+_*f+x*p+w*m,t}function Po(t,e,n){var r,i,o,a,u,s,c,f,l,h,d,p,v=n[0],g=n[1],y=n[2];return e===t?(t[12]=e[0]*v+e[4]*g+e[8]*y+e[12],t[13]=e[1]*v+e[5]*g+e[9]*y+e[13],t[14]=e[2]*v+e[6]*g+e[10]*y+e[14],t[15]=e[3]*v+e[7]*g+e[11]*y+e[15]):(r=e[0],i=e[1],o=e[2],a=e[3],u=e[4],s=e[5],c=e[6],f=e[7],l=e[8],h=e[9],d=e[10],p=e[11],t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=u,t[5]=s,t[6]=c,t[7]=f,t[8]=l,t[9]=h,t[10]=d,t[11]=p,t[12]=r*v+u*g+l*y+e[12],t[13]=i*v+s*g+h*y+e[13],t[14]=o*v+c*g+d*y+e[14],t[15]=a*v+f*g+p*y+e[15]),t}function Go(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Lo(t,e){var n=e[0],r=e[1],i=e[2],o=e[4],a=e[5],u=e[6],s=e[8],c=e[9],f=e[10];return t[0]=Math.hypot(n,r,i),t[1]=Math.hypot(o,a,u),t[2]=Math.hypot(s,c,f),t}function Uo(t,e){var n=new ii(3);Lo(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],a=e[0]*r,u=e[1]*i,s=e[2]*o,c=e[4]*r,f=e[5]*i,l=e[6]*o,h=e[8]*r,d=e[9]*i,p=e[10]*o,v=a+f+p,g=0;return v>0?(g=2*Math.sqrt(v+1),t[3]=.25*g,t[0]=(l-d)/g,t[1]=(h-s)/g,t[2]=(u-c)/g):a>f&&a>p?(g=2*Math.sqrt(1+a-f-p),t[3]=(l-d)/g,t[0]=.25*g,t[1]=(u+c)/g,t[2]=(h+s)/g):f>p?(g=2*Math.sqrt(1+f-a-p),t[3]=(h-s)/g,t[0]=(u+c)/g,t[1]=.25*g,t[2]=(l+d)/g):(g=2*Math.sqrt(1+p-a-f),t[3]=(u-c)/g,t[0]=(h+s)/g,t[1]=(l+d)/g,t[2]=.25*g),t}function Fo(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,u=r+r,s=i+i,c=n*a,f=r*a,l=r*u,h=i*a,d=i*u,p=i*s,v=o*a,g=o*u,y=o*s;return t[0]=1-l-p,t[1]=f+y,t[2]=h-g,t[3]=0,t[4]=f-y,t[5]=1-c-p,t[6]=d+v,t[7]=0,t[8]=h+g,t[9]=d-v,t[10]=1-c-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}var Bo,zo,jo,Wo,Vo,Xo,Ho,qo,Yo,Ko,Zo,$o,Jo,Qo,ta,ea,na,ra,ia,oa,aa,ua,sa,ca;function fa(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return la(t,e);var n=Object.prototype.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)?la(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function la(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var ha,da,pa,va,ga,ya,ma,ba,_a,xa,wa,Ea,Sa,Aa=(Bo=(0,Mr.b2)(),zo=(0,Mr.f3)(Pr.MeshComponentManager),jo=(0,Mr.f3)(Pr.GeometryComponentManager),Wo=(0,Mr.f3)(Pr.MaterialComponentManager),Vo=(0,Mr.f3)(Pr.CullableComponentManager),Xo=(0,Mr.f3)(Pr.TransformComponentManager),Ho=(0,Mr.f3)(Pr.HierarchyComponentManager),qo=(0,Mr.f3)(Pr.Systems),Yo=(0,Mr.t6)(Pr.FrameGraphSystem),Ko=(0,Mr.f3)(Pr.RenderEngine),Zo=(0,Mr.f3)(Pr.ResourcePool),Bo((ca=sa=function(){function t(){var e=this;br(this,t),mr(this,"mesh",Qo,this),mr(this,"geometry",ta,this),mr(this,"material",ea,this),mr(this,"cullable",na,this),mr(this,"transform",ra,this),mr(this,"hierarchy",ia,this),mr(this,"frameGraphSystem",oa,this),mr(this,"engine",aa,this),mr(this,"resourcePool",ua,this),this.modelCache={},this.setup=function(t,e,n){var r=t.createRenderTarget(e,"color buffer",{width:1,height:1,usage:Ri.RENDER_ATTACHMENT|Ri.SAMPLED|Ri.COPY_SRC});n.data={output:e.write(t,r)}},this.execute=function(){var t=Tr(Sr().mark((function t(n,r,i){var o,a,u,s,c,f;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=n.getResourceNode(r.data.output),a=e.resourcePool.getOrCreateResource(o.resource),u=fa(i),t.prev=3,u.s();case 5:if((s=u.n()).done){t.next=11;break}return c=s.value,t.next=9,e.initView(c);case 9:t.next=5;break;case 11:t.next=16;break;case 13:t.prev=13,t.t0=t.catch(3),u.e(t.t0);case 16:return t.prev=16,u.f(),t.finish(16);case 19:f=e.engine.getCanvas(),a.resize({width:f.width,height:f.height}),e.engine.setScissor({enable:!1}),e.engine.clear({framebuffer:a,color:i[0].getClearColor(),depth:1}),e.engine.useFramebuffer(a,(function(){var t,n=fa(i);try{for(n.s();!(t=n.n()).done;){var r=t.value;e.renderView(r)}}catch(t){n.e(t)}finally{n.f()}}));case 24:case"end":return t.stop()}}),t,null,[[3,13,16,19]])})));return function(e,n,r){return t.apply(this,arguments)}}()}var e,n;return xr(t,[{key:"renderView",value:function(t){var e=t.getScene(),n=t.getCamera(),r=n.getViewTransform(),i=Mo(No(),n.getPerspective(),r);n.getFrustum().extractFromVPMatrix(i);var o=t.getViewport(),a=o.x,u=o.y,s=o.width,c=o.height;this.engine.viewport({x:a,y:u,width:s,height:c});var f,l=fa(e.getEntities());try{for(l.s();!(f=l.n()).done;){var h=f.value;this.renderMesh(h,{camera:n,view:t,viewMatrix:r})}}catch(t){l.e(t)}finally{l.f()}}},{key:"renderMesh",value:function(t,e){var n=e.camera,r=e.view,i=e.viewMatrix,o=this.mesh.getComponentByEntity(t);if(o&&o.visible){var a=o.material,u=o.geometry;if(u&&!u.dirty&&a){var s=this.transform.getComponentByEntity(t),c=Mo(No(),i,s.worldTransform),f=r.getViewport(),l=f.width,h=f.height;a.setUniform({projectionMatrix:n.getPerspective(),modelViewMatrix:c,modelMatrix:s.worldTransform,viewMatrix:i,cameraPosition:n.getPosition(),u_viewport:[l,h]}),o.model&&(o.model.draw({uniforms:a.uniforms.reduce((function(t,e){return t[e.name]=e.data,t}),{})}),a.uniforms.forEach((function(t){t.dirty=!1})),a.dirty=!1)}}}},{key:"initMesh",value:(n=Tr(Sr().mark((function t(e,n){var r,i,o,a,u,s,c,f;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.mesh.getComponentByEntity(e)){t.next=3;break}return t.abrupt("return");case 3:if(i=r.material,(o=r.geometry)&&!o.dirty&&i){t.next=7;break}return t.abrupt("return");case 7:if(r.model){t.next=24;break}if(a="m-".concat(i.entity,"-g-").concat(o.entity),!this.modelCache[a]){t.next=12;break}return r.model=this.modelCache[a],t.abrupt("return");case 12:return i.setUniform({projectionMatrix:1,modelViewMatrix:1,modelMatrix:1,viewMatrix:1,cameraPosition:1,u_viewport:1}),u=this.engine,s=u.createModel,c=u.createAttribute,f={vs:i.vertexShaderGLSL,fs:i.fragmentShaderGLSL,defines:i.defines,attributes:o.attributes.reduce((function(t,e){return e.data&&e.buffer&&(t[e.name]=c({buffer:e.buffer,attributes:e.attributes,arrayStride:e.arrayStride,stepMode:e.stepMode,divisor:"vertex"===e.stepMode?0:1})),t}),{}),uniforms:i.uniforms.reduce((function(t,e){return t[e.name]=e.data,t}),{}),scissor:{enable:!0,box:function(){return n.getViewport()}}},i.cull&&(f.cull=i.cull),i.depth&&(f.depth=i.depth),i.blend&&(f.blend=i.blend),o.indicesBuffer&&(f.elements=o.indicesBuffer),o.maxInstancedCount&&(f.instances=o.maxInstancedCount,f.count=o.vertexCount||3),t.next=22,s(f);case 22:r.model=t.sent,this.modelCache[a]=r.model;case 24:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"initView",value:(e=Tr(Sr().mark((function t(e){var n,r,i,o;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.getScene(),r=fa(n.getEntities()),t.prev=2,r.s();case 4:if((i=r.n()).done){t.next=10;break}return o=i.value,t.next=8,this.initMesh(o,e);case 8:t.next=4;break;case 10:t.next=15;break;case 12:t.prev=12,t.t0=t.catch(2),r.e(t.t0);case 15:return t.prev=15,r.f(),t.finish(15);case 18:case"end":return t.stop()}}),t,this,[[2,12,15,18]])}))),function(t){return e.apply(this,arguments)})}]),t}(),sa.IDENTIFIER="Render Pass",Qo=wr((Jo=ca).prototype,"mesh",[zo],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ta=wr(Jo.prototype,"geometry",[jo],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ea=wr(Jo.prototype,"material",[Wo],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),na=wr(Jo.prototype,"cullable",[Vo],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ra=wr(Jo.prototype,"transform",[Xo],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ia=wr(Jo.prototype,"hierarchy",[Ho],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),oa=wr(Jo.prototype,"frameGraphSystem",[qo,Yo],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),aa=wr(Jo.prototype,"engine",[Ko],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ua=wr(Jo.prototype,"resourcePool",[Zo],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),$o=Jo))||$o);function Ta(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Ia(t,e);var n=Object.prototype.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)?Ia(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Ia(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Ca,Da,Na,ka,Ra,Oa,Ma,Pa,Ga,La,Ua,Fa,Ba,za,ja,Wa,Va,Xa,Ha,qa,Ya,Ka,Za=(ha=(0,Mr.b2)(),da=(0,Mr.f3)(Pr.RenderEngine),pa=(0,Mr.f3)(Pr.ResourcePool),va=(0,Mr.f3)(Pr.RenderPassFactory),ga=(0,Mr.f3)(Pr.MeshComponentManager),ha((Sa=Ea=function(){function t(){var e=this;br(this,t),mr(this,"engine",ba,this),mr(this,"resourcePool",_a,this),mr(this,"renderPassFactory",xa,this),mr(this,"mesh",wa,this),this.pickingFBO=void 0,this.views=void 0,this.highlightEnabled=!0,this.highlightColor=[255,0,0,255],this.alreadyInRendering=!1,this.setup=function(t,e,n){var r=t.createRenderTarget(e,"picking fbo",{width:1,height:1});n.data={output:e.write(t,r)},e.hasSideEffect=!0},this.execute=function(){var t=Tr(Sr().mark((function t(n,r,i){var o,a,u;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.views=i,!e.alreadyInRendering){t.next=3;break}return t.abrupt("return");case 3:o=Ta(i);try{for(u=function(){var t=a.value,i=t.getViewport(),o=i.width,u=i.height;e.alreadyInRendering=!0;var s=n.getResourceNode(r.data.output);e.pickingFBO=e.resourcePool.getOrCreateResource(s.resource),e.pickingFBO.resize({width:o,height:u}),e.engine.useFramebuffer(e.pickingFBO,(function(){e.engine.clear({framebuffer:e.pickingFBO,color:[0,0,0,0],stencil:0,depth:1});var n,r=e.renderPassFactory(Aa.IDENTIFIER),i=[],o=Ta(t.getScene().getEntities());try{for(o.s();!(n=o.n()).done;){var a=n.value,u=e.mesh.getComponentByEntity(a);u.material.setUniform("u_PickingStage",1),i.push(u)}}catch(t){o.e(t)}finally{o.f()}r.renderView(t),i.forEach((function(t){t.material.setUniform("u_PickingStage",2)})),e.alreadyInRendering=!1}))},o.s();!(a=o.n()).done;)u()}catch(t){o.e(t)}finally{o.f()}case 5:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}(),this.pick=function(t,n){var r,i,o=t.x,a=t.y,u=e.engine,s=u.readPixels,c=u.useFramebuffer,f=n.getViewport(),l=f.width,h=f.height,d=o*window.devicePixelRatio,p=a*window.devicePixelRatio;if(!(d>l||d<0||p>h||p<0))return c(e.pickingFBO,(function(){var t;0===(r=s({x:Math.round(d),y:Math.round(h-(a+1)*window.devicePixelRatio),width:1,height:1,data:new Uint8Array(4),framebuffer:e.pickingFBO}))[0]&&0===r[1]&&0===r[2]||(t=Or(r,3),i=t[0]+256*t[1]+65536*t[2]-1,e.highlightEnabled&&e.highlightPickedFeature(r,n))})),i}}return xr(t,[{key:"enableHighlight",value:function(t){this.highlightEnabled=t}},{key:"setHighlightColor",value:function(t){this.highlightColor=t}},{key:"highlightPickedFeature",value:function(t,e){if(t){var n,r=Ta(e.getScene().getEntities());try{for(r.s();!(n=r.n()).done;){var i=n.value,o=this.mesh.getComponentByEntity(i).material;o.setUniform("u_PickingStage",2),o.setUniform("u_PickingColor",[t[0],t[1],t[2]]),o.setUniform("u_HighlightColor",this.highlightColor)}}catch(t){r.e(t)}finally{r.f()}}}}]),t}(),Ea.IDENTIFIER="PixelPicking Pass",ba=wr((ma=Sa).prototype,"engine",[da],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),_a=wr(ma.prototype,"resourcePool",[pa],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),xa=wr(ma.prototype,"renderPassFactory",[va],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),wa=wr(ma.prototype,"mesh",[ga],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ya=ma))||ya),$a=(Ca=(0,Mr.b2)(),Da=(0,Mr.f3)(Pr.RenderEngine),Na=(0,Mr.f3)(Pr.ResourcePool),Ca((Ga=Pa=function t(){var e=this;br(this,t),mr(this,"engine",Oa,this),mr(this,"resourcePool",Ma,this),this.model=void 0,this.setup=function(t,e,n){var r=t.getPass(Aa.IDENTIFIER);if(r){var i=t.createRenderTarget(e,"render to screen",{width:1,height:1});n.data={input:e.read(r.data.output),output:e.write(t,i)}}},this.execute=function(){var t=Tr(Sr().mark((function t(n,r){var i,o,a,u,s,c,f;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=e.engine,o=i.createModel,a=i.createAttribute,u=i.createBuffer,e.model){t.next=6;break}return t.next=4,o({vs:e.engine.supportWebGPU?"layout(location = 0) in vec2 a_Position;\nlayout(location = 0) out vec2 v_UV;\n\nvoid main() {\n v_UV = 0.5 * (a_Position + 1.0);\n gl_Position = vec4(a_Position, 0., 1.);\n}":"attribute vec2 a_Position;\n\nvarying vec2 v_UV;\n\nvoid main() {\n v_UV = 0.5 * (a_Position + 1.0);\n gl_Position = vec4(a_Position, 0., 1.);\n}",fs:e.engine.supportWebGPU?"layout(set = 0, binding = 0) uniform sampler u_TextureSampler;\nlayout(set = 0, binding = 1) uniform texture2D u_Texture;\n\nlayout(location = 0) in vec2 v_UV;\nlayout(location = 0) out vec4 outColor;\n\nvoid main() {\n outColor = texture(sampler2D(u_Texture, u_TextureSampler), v_UV);\n}":"varying vec2 v_UV;\n\nuniform sampler2D u_Texture;\n\nvoid main() {\n gl_FragColor = vec4(texture2D(u_Texture, v_UV));\n}",attributes:{a_Position:a({buffer:u({data:[-4,-4,4,-4,0,4],type:Ri.FLOAT}),size:2,arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float2"}]})},uniforms:{u_Texture:null},depth:{enable:!1},count:3,blend:{enable:!0}});case 4:s=t.sent,e.model=s;case 6:c=n.getResourceNode(r.data.input),f=e.resourcePool.getOrCreateResource(c.resource),e.engine.useFramebuffer(null,(function(){e.engine.clear({framebuffer:null,color:[0,0,0,0],depth:1,stencil:0}),e.model.draw({uniforms:{u_Texture:f}})}));case 9:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),this.tearDown=function(){e.model=void 0}},Pa.IDENTIFIER="Copy Pass",Oa=wr((Ra=Ga).prototype,"engine",[Da],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ma=wr(Ra.prototype,"resourcePool",[Na],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ka=Ra))||ka),Ja=(La=(0,Mr.b2)(),Ua=(0,Mr.f3)(Pr.Systems),Fa=(0,Mr.t6)(Pr.FrameGraphSystem),Ba=(0,Mr.f3)(Pr.RenderPassFactory),za=(0,Mr.f3)(Pr.ConfigService),ja=(0,Mr.f3)(Pr.ResourcePool),La((Ka=function(){function t(){br(this,t),mr(this,"frameGraphSystem",Xa,this),mr(this,"renderPassFactory",Ha,this),mr(this,"configService",qa,this),mr(this,"resourcePool",Ya,this)}var e;return xr(t,[{key:"execute",value:(e=Tr(Sr().mark((function t(e){var n,r,i,o,a,u,s,c;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=this.renderPassFactory(Aa.IDENTIFIER),r=n.setup,i=n.execute,this.frameGraphSystem.addPass(Aa.IDENTIFIER,r,i),o=this.renderPassFactory($a.IDENTIFIER),a=o.setup,u=o.execute,s=o.tearDown,c=this.frameGraphSystem.addPass($a.IDENTIFIER,a,u,s),this.frameGraphSystem.present(c.data.output);case 5:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"tearDown",value:function(){this.resourcePool.clean()}},{key:"pick",value:function(t,e){return this.renderPassFactory(Za.IDENTIFIER).pick(t,e)}}]),t}(),Xa=wr((Va=Ka).prototype,"frameGraphSystem",[Ua,Fa],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ha=wr(Va.prototype,"renderPassFactory",[Ba],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),qa=wr(Va.prototype,"configService",[za],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ya=wr(Va.prototype,"resourcePool",[ja],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Wa=Va))||Wa);var Qa,tu,eu,nu,ru,iu,ou,au,uu,su,cu=function(t){Br(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vr(e);if(n){var i=Vr(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wr(this,t)});function i(t){var e;return br(this,i),(e=r.call(this,t)).parentID=void 0,Object.assign(jr(e),t),e}return i}(Dr),fu=(Qa=(0,Mr.b2)(),tu=(0,Mr.f3)(Pr.HierarchyComponentManager),eu=(0,Mr.f3)(Pr.TransformComponentManager),nu=(0,Mr.f3)(Pr.MeshComponentManager),Qa((su=function(){function t(){br(this,t),mr(this,"hierarchy",ou,this),mr(this,"transform",au,this),mr(this,"mesh",uu,this)}var e;return xr(t,[{key:"execute",value:(e=Tr(Sr().mark((function t(){return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.runTransformUpdateSystem(),this.runHierarchyUpdateSystem();case 2:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"tearDown",value:function(){this.hierarchy.clear(),this.transform.clear()}},{key:"getHierarchyComponentManager",value:function(){return this.hierarchy}},{key:"getTransformComponentManager",value:function(){return this.transform}},{key:"runTransformUpdateSystem",value:function(){var t=this;this.transform.forEach((function(e,n){(n.isDirty()||n.isLocalDirty())&&(t.setMeshAABBDirty(t.mesh.getComponentByEntity(e)),n.updateTransform())}))}},{key:"runHierarchyUpdateSystem",value:function(){var t=this;this.hierarchy.forEach((function(e,n){var r=t.transform.getComponentByEntity(e),i=t.transform.getComponentByEntity(n.parentID);null!==r&&null!==i&&r.updateTransformWithParent(i)}))}},{key:"attach",value:function(t,e,n){this.hierarchy.contains(t)&&this.detach(t),this.hierarchy.create(t,{parentID:e});var r=this.mesh.getComponentByEntity(e);if(this.setMeshAABBDirty(r),r&&-1===r.children.indexOf(t)&&r.children.push(t),this.hierarchy.getCount()>1)for(var i=this.hierarchy.getCount()-1;i>0;--i)for(var o=this.hierarchy.getEntity(i),a=0;a<i;++a)if(this.hierarchy.getComponent(a).parentID===o){this.hierarchy.moveItem(i,a),++i;break}this.hierarchy.getComponentByEntity(t);var u=this.transform.getComponentByEntity(e);null===u&&(u=this.transform.create(e));var s=this.transform.getComponentByEntity(t);null===s&&(s=this.transform.create(t),u=this.transform.getComponentByEntity(e)),s.parent=u,!n&&u&&(s.matrixTransform(Oo(No(),u.worldTransform)),s.updateTransform()),u&&s.updateTransformWithParent(u)}},{key:"detach",value:function(t){var e=this.hierarchy.getComponentByEntity(t);if(null!==e){var n=this.transform.getComponentByEntity(t);null!==n&&(n.parent=null,n.applyTransform()),this.hierarchy.removeKeepSorted(t);var r=this.mesh.getComponentByEntity(e.parentID);if(r){var i=r.children.indexOf(t);r.children.splice(i,1)}this.setMeshAABBDirty(r)}}},{key:"detachChildren",value:function(t){var e=this.mesh.getComponentByEntity(t);e&&(e.children=[]);for(var n=0;n<this.hierarchy.getCount();){var r;if((null===(r=this.hierarchy.getComponent(n))||void 0===r?void 0:r.parentID)===t){var i=this.hierarchy.getEntity(n);this.detach(i)}else++n}}},{key:"setMeshAABBDirty",value:function(t){t&&(t.aabbDirty=!0)}}]),t}(),ou=wr((iu=su).prototype,"hierarchy",[tu],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),au=wr(iu.prototype,"transform",[eu],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),uu=wr(iu.prototype,"mesh",[nu],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ru=iu))||ru);function lu(){var t=new ii(4);return ii!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function hu(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function du(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],u=n[0],s=n[1],c=n[2],f=n[3];return t[0]=r*f+a*u+i*c-o*s,t[1]=i*f+a*s+o*u-r*c,t[2]=o*f+a*c+r*s-i*u,t[3]=a*f-r*u-i*s-o*c,t}function pu(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,u=a?1/a:0;return t[0]=-n*u,t[1]=-r*u,t[2]=-i*u,t[3]=o*u,t}function vu(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var o=Math.sin(e),a=Math.cos(e),u=Math.sin(n),s=Math.cos(n),c=Math.sin(r),f=Math.cos(r);return t[0]=o*s*f-a*u*c,t[1]=a*u*f+o*s*c,t[2]=a*s*c-o*u*f,t[3]=a*s*f+o*u*c,t}var gu=ai,yu=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},mu=du,bu=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t};ci(),hi(1,0,0),hi(0,1,0),lu(),lu(),si();var _u=function(t){Br(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vr(e);if(n){var i=Vr(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wr(this,t)});function i(t){var e,n,o,a,u,s,c,f,l,h,d,p,v,g,y;return br(this,i),(e=r.call(this,t)).dirtyFlag=void 0,e.localDirtyFlag=void 0,e.parent=null,e.localPosition=hi(0,0,0),e.localRotation=gu(0,0,0,1),e.localScale=hi(1,1,1),e.localTransform=No(),e.position=hi(0,0,0),e.rotation=gu(0,0,0,1),e.scaling=hi(1,1,1),e.worldTransform=No(),e.matrixTransform=(n=No(),function(t){Mo(n,e.getLocalTransform(),t),Lo(e.localScale,n),Go(e.localPosition,n),Uo(e.localRotation,n)}),e.rotateRollPitchYaw=(o=lu(),a=lu(),u=lu(),function(t,n,r){e.setDirty(),vu(o,t,0,0),vu(a,0,n,0),vu(u,0,0,r),du(e.localRotation,o,e.localRotation),du(e.localRotation,e.localRotation,a),du(e.localRotation,u,e.localRotation),bu(e.localRotation,e.localRotation)}),e.lerp=(s=ci(),c=lu(),f=ci(),l=ci(),h=lu(),d=ci(),function(t,n,r){e.setDirty(),Lo(s,t.worldTransform),Go(f,t.worldTransform),Uo(c,t.worldTransform),Lo(l,n.worldTransform),Go(d,n.worldTransform),Uo(h,n.worldTransform),_i(e.localScale,s,l,r),function(t,e,n,r){var i,o,a,u,s,c=e[0],f=e[1],l=e[2],h=e[3],d=n[0],p=n[1],v=n[2],g=n[3];(o=c*d+f*p+l*v+h*g)<0&&(o=-o,d=-d,p=-p,v=-v,g=-g),1-o>ri?(i=Math.acos(o),a=Math.sin(i),u=Math.sin((1-r)*i)/a,s=Math.sin(r*i)/a):(u=1-r,s=r),t[0]=u*c+s*d,t[1]=u*f+s*p,t[2]=u*l+s*v,t[3]=u*h+s*g}(e.localRotation,c,h,r),_i(e.localPosition,f,d,r)}),e.translate=(p=ci(),function(t){return vi(p,e.getPosition(),t),e.setPosition(p),e.setDirty(!0),jr(e)}),e.translateLocal=function(t){return n=t,r=t,i=e.localRotation,o=i[0],a=i[1],u=i[2],s=i[3],c=r[0],f=r[1],l=r[2],v=a*(p=o*f-a*c)-u*(d=u*c-o*l),g=u*(h=a*l-u*f)-o*p,y=o*d-a*h,h*=m=2*s,d*=m,p*=m,v*=2,g*=2,y*=2,n[0]=c+h+v,n[1]=f+d+g,n[2]=l+p+y,vi(e.localPosition,e.localPosition,t),e.setLocalDirty(!0),jr(e);var n,r,i,o,a,u,s,c,f,l,h,d,p,v,g,y,m},e.setPosition=(v=No(),function(t){return e.position=t,e.setLocalDirty(!0),null===e.parent?di(e.localPosition,t):(ko(v,e.parent.worldTransform),Oo(v,v),xi(e.localPosition,t,v)),jr(e)}),e.rotate=(g=lu(),function(t){if(null===e.parent)du(e.localRotation,e.localRotation,t),bu(e.localRotation,e.localRotation);else{var n=e.getRotation(),r=e.parent.getRotation();yu(g,r),pu(g,g),du(g,g,t),du(e.localRotation,t,n),bu(e.localRotation,e.localRotation)}return e.setLocalDirty(),jr(e)}),e.rotateLocal=function(t){return du(e.localRotation,e.localRotation,t),bu(e.localRotation,e.localRotation),e.setLocalDirty(!0),jr(e)},e.setRotation=(y=lu(),function(t){return null===e.parent?yu(e.localRotation,t):(yu(y,e.parent.getRotation()),pu(y,y),yu(e.localRotation,y),mu(e.localRotation,e.localRotation,t)),e.setLocalDirty(!0),jr(e)}),e}return xr(i,[{key:"setLocalPosition",value:function(t){di(this.localPosition,t),this.setLocalDirty(!0)}},{key:"setLocalScale",value:function(t){di(this.localScale,t),this.setLocalDirty(!0)}},{key:"setLocalRotation",value:function(t){return yu(this.localRotation,t),this.setLocalDirty(!0),this}},{key:"isDirty",value:function(){return this.dirtyFlag}},{key:"setDirty",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t?this.dirtyFlag|=i.DIRTY:this.dirtyFlag&=~i.DIRTY}},{key:"isLocalDirty",value:function(){return this.localDirtyFlag}},{key:"setLocalDirty",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t?(this.localDirtyFlag|=i.DIRTY,this.setDirty(!0)):this.localDirtyFlag&=~i.DIRTY}},{key:"updateTransform",value:function(){this.isLocalDirty()&&this.getLocalTransform(),this.isDirty()&&null===this.parent&&(ko(this.worldTransform,this.getLocalTransform()),this.setDirty(!1))}},{key:"updateTransformWithParent",value:function(t){Mo(this.worldTransform,t.worldTransform,this.getLocalTransform())}},{key:"applyTransform",value:function(){this.setDirty(),Lo(this.localScale,this.worldTransform),Go(this.localPosition,this.worldTransform),Uo(this.localRotation,this.worldTransform)}},{key:"clearTransform",value:function(){this.setDirty(),this.localPosition=hi(0,0,0),this.localRotation=gu(0,0,0,1),this.localScale=hi(1,1,1)}},{key:"scaleLocal",value:function(t){return this.setLocalDirty(),e=this.localScale,n=this.localScale,r=t,e[0]=n[0]*r[0],e[1]=n[1]*r[1],e[2]=n[2]*r[2],this;var e,n,r}},{key:"getLocalPosition",value:function(){return this.localPosition}},{key:"getLocalRotation",value:function(){return this.localRotation}},{key:"getLocalScale",value:function(){return this.localScale}},{key:"getLocalTransform",value:function(){return this.localDirtyFlag&&(t=this.localTransform,e=this.localRotation,n=this.localPosition,r=this.localScale,i=e[0],o=e[1],a=e[2],u=e[3],l=i*(s=i+i),h=i*(c=o+o),d=i*(f=a+a),p=o*c,v=o*f,g=a*f,y=u*s,m=u*c,b=u*f,_=r[0],x=r[1],w=r[2],t[0]=(1-(p+g))*_,t[1]=(h+b)*_,t[2]=(d-m)*_,t[3]=0,t[4]=(h-b)*x,t[5]=(1-(l+g))*x,t[6]=(v+y)*x,t[7]=0,t[8]=(d+m)*w,t[9]=(v-y)*w,t[10]=(1-(l+p))*w,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,this.setLocalDirty(!1)),this.localTransform;var t,e,n,r,i,o,a,u,s,c,f,l,h,d,p,v,g,y,m,b,_,x,w}},{key:"getWorldTransform",value:function(){return this.isLocalDirty()||this.isDirty()?(this.parent&&this.parent.getWorldTransform(),this.updateTransform(),this.worldTransform):this.worldTransform}},{key:"getPosition",value:function(){return Go(this.position,this.worldTransform),this.position}},{key:"getRotation",value:function(){return Uo(this.rotation,this.worldTransform),this.rotation}},{key:"getScale",value:function(){return Lo(this.scaling,this.worldTransform),this.scaling}}]),i}(Dr);_u.DIRTY=1;var xu,wu,Eu,Su,Au,Tu,Iu=n(1922),Cu=(xu=(0,Mr.b2)(),wu=(0,Mr.f3)(Pr.RenderEngine),xu((Tu=function(){function t(){br(this,t),mr(this,"engine",Au,this),this.resourcePool={}}return xr(t,[{key:"getOrCreateResource",value:function(t){if(!this.resourcePool[t.name]){var e=t.descriptor,n=e.width,r=e.height,i=e.usage;this.resourcePool[t.name]=this.engine.createFramebuffer({color:this.engine.createTexture2D({width:n,height:r,wrapS:Ri.CLAMP_TO_EDGE,wrapT:Ri.CLAMP_TO_EDGE,usage:i})})}return this.resourcePool[t.name]}},{key:"clean",value:function(){this.resourcePool={}}}]),t}(),Au=wr((Su=Tu).prototype,"engine",[wu],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Eu=Su))||Eu);var Du,Nu,ku,Ru,Ou=function(t){Br(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vr(e);if(n){var i=Vr(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wr(this,t)});function i(t){var e;return br(this,i),(e=r.call(this,t)).name=void 0,e.name=t.name||"",e}return i}(Dr),Mu=(0,Mr.b2)()((Nu=function(){function t(){br(this,t),this.config=void 0}return xr(t,[{key:"get",value:function(){return this.config}},{key:"set",value:function(t){this.config=t}}]),t}(),Du=Nu))||Du;!function(t){t.PANSTART="PANSTART",t.PANEND="PANEND",t.PANMOVE="PANMOVE",t.PINCH="PINCH",t.KEYDOWN="KEYDOWN",t.KEYUP="KEYUP",t.HOVER="HOVER"}(Ru||(Ru={}));var Pu,Gu,Lu=(0,Mr.b2)()(ku=function(){function t(){br(this,t)}return xr(t,[{key:"listen",value:function(t){}},{key:"on",value:function(t,e){}},{key:"connect",value:function(){}},{key:"disconnect",value:function(){}},{key:"destroy",value:function(){}}]),t}())||ku,Uu=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\s\S]*?);/g;function Fu(t){var e={};return{content:t=t.replace(Uu,(function(t,n,r){var i=r.split(":"),o=i[0].trim(),a="";switch(i.length>1&&(a=i[1].trim()),n){case"bool":a="true"===a;break;case"float":case"int":a=Number(a);break;case"vec2":case"vec3":case"vec4":case"ivec2":case"ivec3":case"ivec4":case"mat2":case"mat3":case"mat4":a=a?a.replace("[","").replace("]","").split(",").reduce((function(t,e){return t.push(Number(e.trim())),t}),[]):new Array(function(t){var e=0;switch(t){case"vec2":case"ivec2":e=2;break;case"vec3":case"ivec3":e=3;break;case"vec4":case"ivec4":case"mat2":e=4;break;case"mat3":e=9;break;case"mat4":e=16}return e}(n)).fill(0)}return e[o]=a,"uniform ".concat(n," ").concat(o,";\n")})),uniforms:e}}function Bu(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 zu(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Bu(Object(n),!0).forEach((function(e){ni(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Bu(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var ju=/precision\s+(high|low|medium)p\s+float/,Wu=/#pragma include (["^+"]?["\ "[a-zA-Z_0-9](.*)"]*?)/g,Vu=(0,Mr.b2)()((Gu=function(){function t(){br(this,t),this.moduleCache={},this.rawContentCache={}}return xr(t,[{key:"registerBuiltinModules",value:function(){this.destroy(),this.registerModule("picking",{vs:"attribute vec3 a_PickingColor;\nvarying vec4 v_PickingResult;\n\nuniform vec3 u_PickingColor : [0, 0, 0];\nuniform vec4 u_HighlightColor : [0, 0, 0, 0];\nuniform float u_PickingStage : 0.0;\nuniform float u_PickingThreshold : 1.0;\nuniform float u_PickingBuffer: 0.0;\n\n#define PICKING_ENCODE 1.0\n#define PICKING_HIGHLIGHT 2.0\n#define COLOR_SCALE 1. / 255.\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n abs(vertexColor.r - u_PickingColor.r) < u_PickingThreshold &&\n abs(vertexColor.g - u_PickingColor.g) < u_PickingThreshold &&\n abs(vertexColor.b - u_PickingColor.b) < u_PickingThreshold;\n}\n\nvoid setPickingColor(vec3 pickingColor) {\n // compares only in highlight stage\n v_PickingResult.a = float((u_PickingStage == PICKING_HIGHLIGHT) && isVertexPicked(pickingColor));\n\n // Stores the picking color so that the fragment shader can render it during picking\n v_PickingResult.rgb = pickingColor * COLOR_SCALE;\n}\n\nfloat setPickingSize(float x) {\n return u_PickingStage == PICKING_ENCODE ? x + u_PickingBuffer : x;\n}",fs:"varying vec4 v_PickingResult;\nuniform vec4 u_HighlightColor : [0, 0, 0, 0];\nuniform float u_PickingStage : 0.0;\n\n#define PICKING_ENCODE 1.0\n#define PICKING_HIGHLIGHT 2.0\n#define COLOR_SCALE 1. / 255.\n\n/*\n * Returns highlight color if this item is selected.\n */\nvec4 filterHighlightColor(vec4 color) {\n bool selected = bool(v_PickingResult.a);\n\n if (selected) {\n vec4 highLightColor = u_HighlightColor * COLOR_SCALE;\n\n float highLightAlpha = highLightColor.a;\n float highLightRatio = highLightAlpha / (highLightAlpha + color.a * (1.0 - highLightAlpha));\n\n vec3 resultRGB = mix(color.rgb, highLightColor.rgb, highLightRatio);\n return vec4(resultRGB, color.a);\n } else {\n return color;\n }\n}\n\n/*\n * Returns picking color if picking enabled else unmodified argument.\n */\nvec4 filterPickingColor(vec4 color) {\n vec3 pickingColor = v_PickingResult.rgb;\n if (u_PickingStage == PICKING_ENCODE && length(pickingColor) < 0.001) {\n discard;\n }\n return u_PickingStage == PICKING_ENCODE ? vec4(pickingColor, step(0.001,color.a)): color;\n}\n\n/*\n * Returns picking color if picking is enabled if not\n * highlight color if this item is selected, otherwise unmodified argument.\n */\nvec4 filterColor(vec4 color) {\n return filterPickingColor(filterHighlightColor(color));\n}\n"}),this.registerModule("sdf2d",{vs:"",fs:"/**\n * 2D signed distance field functions\n * @see http://www.iquilezles.org/www/articles/distfunctions2d/distfunctions2d.htm\n */\n\nfloat ndot(vec2 a, vec2 b ) { return a.x*b.x - a.y*b.y; }\n\nfloat sdCircle(vec2 p, float r) {\n return length(p) - r;\n}\n\nfloat sdEquilateralTriangle(vec2 p) {\n float k = sqrt(3.0);\n p.x = abs(p.x) - 1.0;\n p.y = p.y + 1.0/k;\n if( p.x + k*p.y > 0.0 ) p = vec2(p.x-k*p.y,-k*p.x-p.y)/2.0;\n p.x -= clamp( p.x, -2.0, 0.0 );\n return -length(p)*sign(p.y);\n}\n\nfloat sdBox(vec2 p, vec2 b) {\n vec2 d = abs(p)-b;\n return length(max(d,vec2(0))) + min(max(d.x,d.y),0.0);\n}\n\nfloat sdPentagon(vec2 p, float r) {\n vec3 k = vec3(0.809016994,0.587785252,0.726542528);\n p.x = abs(p.x);\n p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);\n p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);\n p -= vec2(clamp(p.x,-r*k.z,r*k.z),r);\n return length(p)*sign(p.y);\n}\n\nfloat sdHexagon(vec2 p, float r) {\n vec3 k = vec3(-0.866025404,0.5,0.577350269);\n p = abs(p);\n p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;\n p -= vec2(clamp(p.x, -k.z*r, k.z*r), r);\n return length(p)*sign(p.y);\n}\n\nfloat sdOctogon(vec2 p, float r) {\n vec3 k = vec3(-0.9238795325, 0.3826834323, 0.4142135623 );\n p = abs(p);\n p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);\n p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);\n p -= vec2(clamp(p.x, -k.z*r, k.z*r), r);\n return length(p)*sign(p.y);\n}\n\nfloat sdHexagram(vec2 p, float r) {\n vec4 k=vec4(-0.5,0.8660254038,0.5773502692,1.7320508076);\n p = abs(p);\n p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;\n p -= 2.0*min(dot(k.yx,p),0.0)*k.yx;\n p -= vec2(clamp(p.x,r*k.z,r*k.w),r);\n return length(p)*sign(p.y);\n}\n\nfloat sdRhombus(vec2 p, vec2 b) {\n vec2 q = abs(p);\n float h = clamp((-2.0*ndot(q,b)+ndot(b,b))/dot(b,b),-1.0,1.0);\n float d = length( q - 0.5*b*vec2(1.0-h,1.0+h) );\n return d * sign( q.x*b.y + q.y*b.x - b.x*b.y );\n}\n\nfloat sdVesica(vec2 p, float r, float d) {\n p = abs(p);\n float b = sqrt(r*r-d*d); // can delay this sqrt\n return ((p.y-b)*d>p.x*b)\n ? length(p-vec2(0.0,b))\n : length(p-vec2(-d,0.0))-r;\n}"})}},{key:"registerModule",value:function(t,e){if(!this.rawContentCache[t]){var n=e.vs,r=void 0===n?"":n,i=e.fs,o=void 0===i?"":i,a=e.uniforms,u=Fu(r),s=u.content,c=u.uniforms,f=Fu(o),l=f.content,h=f.uniforms;this.rawContentCache[t]={fs:l,uniforms:zu(zu(zu({},c),h),a),vs:s}}}},{key:"destroy",value:function(){this.moduleCache={},this.rawContentCache={}}},{key:"getModule",value:function(t){var e=this;if(this.moduleCache[t])return this.moduleCache[t];var n,r=this.rawContentCache[t].vs||"",i=this.rawContentCache[t].fs||"",o=this.processModule(r,[],"vs"),a=o.content,u=o.includeList,s=this.processModule(i,[],"fs"),c=s.content,f=s.includeList,l=c,h=(n=u.concat(f).concat(t),n.filter((function(t,e,n){return n.indexOf(t)===e}))).reduce((function(t,n){return zu(zu({},t),e.rawContentCache[n].uniforms)}),{});return ju.test(c)||(l="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n #else\n precision mediump float;\n#endif\n"+c),this.moduleCache[t]={fs:l.trim(),uniforms:h,vs:a.trim()},this.moduleCache[t]}},{key:"processModule",value:function(t,e,n){var r=this;return{content:t.replace(Wu,(function(t,i){var o=i.split(" ")[0].replace(/"/g,"");if(e.indexOf(o)>-1)return"";var a=r.rawContentCache[o][n];return e.push(o),r.processModule(a||"",e,n).content})),includeList:e}}}]),t}(),Pu=Gu))||Pu,Xu=new Mr.W2;function Hu(){var t=new Mr.W2;return t.parent=Xu,t.bind(Pr.Systems).to(fu).inSingletonScope().whenTargetNamed(Pr.SceneGraphSystem),t.bind(Pr.Systems).to(ei).inSingletonScope().whenTargetNamed(Pr.FrameGraphSystem),t.bind(Pr.Systems).to(Do).inSingletonScope().whenTargetNamed(Pr.MeshSystem),t.bind(Pr.Systems).to(ji).inSingletonScope().whenTargetNamed(Pr.GeometrySystem),t.bind(Pr.Systems).to(oo).inSingletonScope().whenTargetNamed(Pr.MaterialSystem),t.bind(Pr.Systems).to(Ja).inSingletonScope().whenTargetNamed(Pr.RendererSystem),t.bind(Pr.ResourcePool).to(Cu).inSingletonScope(),t.bind(Pr.ConfigService).to(Mu).inSingletonScope(),t.bind(Pr.InteractorService).to(Lu).inSingletonScope(),t.bind(Pr.RenderPass).to(Aa).inSingletonScope().whenTargetNamed(Aa.IDENTIFIER),t.bind(Pr.RenderPass).to($a).inSingletonScope().whenTargetNamed($a.IDENTIFIER),t.bind(Pr.RenderPass).to(Za).inSingletonScope().whenTargetNamed(Za.IDENTIFIER),t.bind(Pr.RenderPassFactory).toFactory((function(t){return function(e){return t.container.getNamed(Pr.RenderPass,e)}})),t}function qu(t){for(var e=new uo,n=hi(t[0],t[1],t[2]),r=hi(t[0],t[1],t[2]),i=3;i<t.length;){var o=t[i++],a=t[i++],u=t[i++];o<n[0]&&(n[0]=o),a<n[1]&&(n[1]=a),u<n[2]&&(n[2]=u),o>r[0]&&(r[0]=o),a>r[1]&&(r[1]=a),u>r[2]&&(r[2]=u)}return e.setMinMax(n,r),e}(0,Iu.Z)(Xu,!1),Xu.bind(Pr.ShaderModuleService).to(Vu).inSingletonScope(),Xu.bind(Pr.NameComponentManager).toConstantValue(new Nr(Ou)),Xu.bind(Pr.HierarchyComponentManager).toConstantValue(new Nr(cu)),Xu.bind(Pr.TransformComponentManager).toConstantValue(new Nr(_u)),Xu.bind(Pr.MeshComponentManager).toConstantValue(new Nr(co)),Xu.bind(Pr.CullableComponentManager).toConstantValue(new Nr(ao)),Xu.bind(Pr.GeometryComponentManager).toConstantValue(new Nr(zi)),Xu.bind(Pr.MaterialComponentManager).toConstantValue(new Nr(eo));var Yu,Ku,Zu,$u,Ju,Qu="undefined"!=typeof navigator&&/Version\/[\d\.]+.*Safari/.test(navigator.userAgent);function ts(t){return"number"==typeof t}function es(t){return void 0===t?0:t>360||t<-360?t%360:t}function ns(t,e,n){return ts(t)?hi(t,e,n):3===t.length?fi(t):hi(t[0],t[1],t[2])}ci(),ci(),ci(),ci(),ci(),ci(),n(2697),n(1894),n(1186),n(5275),n(2862),n(9633),function(t){t.Normal="normal",t.PostProcessing="post-processing"}(Yu||(Yu={})),n(7222),n(5965),n(2391),n(3945),n(7294),n(9586),function(t){t.Void="Void",t.Boolean="Boolean",t.Float="Float",t.Uint32="Uint32",t.Int32="Int32",t.Vector="Vector",t.Vector2Float="vec2<f32>",t.Vector3Float="vec3<f32>",t.Vector4Float="vec4<f32>",t.Vector2Boolean="vec2<bool>",t.Vector3Boolean="vec3<bool>",t.Vector4Boolean="vec4<bool>",t.Vector2Uint="vec2<u32>",t.Vector3Uint="vec3<u32>",t.Vector4Uint="vec4<u32>",t.Vector2Int="vec2<i32>",t.Vector3Int="vec3<i32>",t.Vector4Int="vec4<i32>",t.Matrix="Matrix",t.Matrix3x3Float="mat3x3<f32>",t.Matrix4x4Float="mat4x4<i32>",t.Struct="Struct",t.FloatArray="Float[]",t.Vector4FloatArray="vec4<f32>[]"}(Ku||(Ku={})),function(t){t.Program="Program",t.Identifier="Identifier",t.VariableDeclaration="VariableDeclaration",t.BlockStatement="BlockStatement",t.ReturnStatement="ReturnStatement",t.FunctionDeclaration="FunctionDeclaration",t.VariableDeclarator="VariableDeclarator",t.AssignmentExpression="AssignmentExpression",t.LogicalExpression="LogicalExpression",t.BinaryExpression="BinaryExpression",t.ArrayExpression="ArrayExpression",t.UnaryExpression="UnaryExpression",t.UpdateExpression="UpdateExpression",t.FunctionExpression="FunctionExpression",t.MemberExpression="MemberExpression",t.ConditionalExpression="ConditionalExpression",t.ExpressionStatement="ExpressionStatement",t.CallExpression="CallExpression",t.NumThreadStatement="NumThreadStatement",t.StorageStatement="StorageStatement",t.DoWhileStatement="DoWhileStatement",t.WhileStatement="WhileStatement",t.ForStatement="ForStatement",t.BreakStatement="BreakStatement",t.ContinueStatement="ContinueStatement",t.IfStatement="IfStatement",t.ImportedFunctionStatement="ImportedFunctionStatement"}(Zu||(Zu={})),function(t){t.Input="Input",t.Output="Output",t.Uniform="Uniform",t.Workgroup="Workgroup",t.UniformConstant="UniformConstant",t.Image="Image",t.StorageBuffer="StorageBuffer",t.Private="Private",t.Function="Function"}($u||($u={})),function(t){t.GLSL100="GLSL100",t.GLSL450="GLSL450",t.WGSL="WGSL"}(Ju||(Ju={}));var rs,is,os,as,us,ss,cs,fs,ls,hs,ds=function(){function t(e,n){var r,i;br(this,t),this.name=void 0,this.matrix=void 0,this.right=void 0,this.up=void 0,this.forward=void 0,this.position=void 0,this.focalPoint=void 0,this.distanceVector=void 0,this.distance=void 0,this.dollyingStep=void 0,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.name=e,this.matrix=(r=n.matrix,(i=new ii(16))[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],i[4]=r[4],i[5]=r[5],i[6]=r[6],i[7]=r[7],i[8]=r[8],i[9]=r[9],i[10]=r[10],i[11]=r[11],i[12]=r[12],i[13]=r[13],i[14]=r[14],i[15]=r[15],i),this.right=fi(n.right),this.up=fi(n.up),this.forward=fi(n.forward),this.position=fi(n.position),this.focalPoint=fi(n.focalPoint),this.distanceVector=fi(n.distanceVector),this.azimuth=n.azimuth,this.elevation=n.elevation,this.roll=n.roll,this.relAzimuth=n.relAzimuth,this.relElevation=n.relElevation,this.relRoll=n.relRoll,this.dollyingStep=n.dollyingStep,this.distance=n.distance}return xr(t,[{key:"getPosition",value:function(){return this.position}},{key:"getFocalPoint",value:function(){return this.focalPoint}},{key:"getRoll",value:function(){return this.roll}},{key:"retrieve",value:function(t){t.matrix=ko(t.matrix,this.matrix),t.right=di(t.right,this.right),t.up=di(t.up,this.up),t.forward=di(t.forward,this.forward),t.position=di(t.position,this.position),t.focalPoint=di(t.focalPoint,this.focalPoint),t.distanceVector=di(t.distanceVector,this.distanceVector),t.azimuth=this.azimuth,t.elevation=this.elevation,t.roll=this.roll,t.relAzimuth=this.relAzimuth,t.relElevation=this.relElevation,t.relRoll=this.relRoll,t.dollyingStep=this.dollyingStep,t.distance=this.distance}}]),t}();!function(t){t.ORBITING="ORBITING",t.EXPLORING="EXPLORING",t.TRACKING="TRACKING"}(fs||(fs={})),function(t){t.DEFAULT="DEFAULT",t.ROTATIONAL="ROTATIONAL",t.TRANSLATIONAL="TRANSLATIONAL",t.CINEMATIC="CINEMATIC"}(ls||(ls={})),function(t){t.ORTHOGRAPHIC="ORTHOGRAPHIC",t.PERSPECTIVE="PERSPECTIVE"}(hs||(hs={}));var ps,vs,gs,ys,ms,bs,_s,xs=Math.PI/180,ws=180/Math.PI,Es=(rs=(0,Mr.b2)(),is=(0,Mr.f3)(Pr.InteractorService),rs((cs=ss=function(){function t(){br(this,t),this.matrix=No(),this.right=hi(1,0,0),this.up=hi(0,1,0),this.forward=hi(0,0,1),this.position=hi(0,0,1),this.focalPoint=hi(0,0,0),this.distanceVector=hi(0,0,0),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.rotateWorld=!1,mr(this,"interactor",us,this),this.fov=30,this.near=.1,this.far=1e4,this.aspect=1,this.left=void 0,this.rright=void 0,this.top=void 0,this.bottom=void 0,this.zoom=1,this.perspective=No(),this.view=void 0,this.following=void 0,this.type=fs.EXPLORING,this.trackingMode=ls.DEFAULT,this.projectionMode=hs.PERSPECTIVE,this.frustum=new To,this.landmarks=[],this.landmarkAnimationID=void 0}return xr(t,[{key:"clone",value:function(){var e=new t;return e.setType(this.type,void 0),e.interactor=this.interactor,e}},{key:"getProjectionMode",value:function(){return this.projectionMode}},{key:"getPerspective",value:function(){return this.perspective}},{key:"getFrustum",value:function(){return this.frustum}},{key:"getPosition",value:function(){return this.position}},{key:"setType",value:function(t,e){return this.type=t,this.type===fs.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===fs.TRACKING&&void 0!==e&&this.setTrackingMode(e),this}},{key:"setProjectionMode",value:function(t){return this.projectionMode=t,this}},{key:"setTrackingMode",value:function(t){if(this.type!==fs.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this}},{key:"setWorldRotation",value:function(t){this.rotateWorld=t,this._getAngles()}},{key:"getViewTransform",value:function(){return Oo(No(),this.matrix)}},{key:"getWorldTransform",value:function(){return this.matrix}},{key:"setMatrix",value:function(t){return this.matrix=t,this._update(),this}},{key:"setAspect",value:function(t){return this.setPerspective(this.near,this.far,this.fov,t),this}},{key:"setViewOffset",value:function(t,e,n,r,i,o){return this.aspect=t/e,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.projectionMode===hs.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"clearViewOffset",value:function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===hs.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"setPerspective",value:function(t,e,n,r){return this.projectionMode=hs.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r,function(t,e,n,r,i){var o,a=1/Math.tan(e/2);t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(r-i),t[10]=(i+r)*o,t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r)}(this.perspective,this.fov*xs,this.aspect,this.near,this.far),this}},{key:"setOrthographic",value:function(t,e,n,r,i,o){this.projectionMode=hs.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=r,this.near=i,this.far=o;var a=(this.rright-this.left)/(2*this.zoom),u=(this.top-this.bottom)/(2*this.zoom),s=(this.rright+this.left)/2,c=(this.top+this.bottom)/2,f=s-a,l=s+a,h=c+u,d=c-u;if(void 0!==this.view&&this.view.enabled){var p=(this.rright-this.left)/this.view.fullWidth/this.zoom,v=(this.top-this.bottom)/this.view.fullHeight/this.zoom;l=(f+=p*this.view.offsetX)+p*this.view.width,d=(h-=v*this.view.offsetY)-v*this.view.height}return function(t,e,n,r,i,o,a){var u=1/(e-n),s=1/(r-i),c=1/(o-a);t[0]=-2*u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*u,t[13]=(i+r)*s,t[14]=(a+o)*c,t[15]=1}(this.perspective,f,l,h,d,i,o),this}},{key:"setPosition",value:function(t,e,n){return this._setPosition(t,e,n),this.setFocalPoint(this.focalPoint),this}},{key:"setFocalPoint",value:function(t,e,n){var r,i,o,a,u,s,c,f,l,h,d,p,v,g=hi(0,1,0);if(this.focalPoint=ns(t,e,n),this.trackingMode===ls.CINEMATIC){var y=gi(ci(),this.focalPoint,this.position);t=y[0],e=y[1],n=y[2];var m=li(y),b=Math.asin(e/m)*ws,_=90+Math.atan2(n,t)*ws,x=No();r=x,i=x,o=_*xs,a=Math.sin(o),u=Math.cos(o),s=i[0],c=i[1],f=i[2],l=i[3],h=i[8],d=i[9],p=i[10],v=i[11],i!==r&&(r[4]=i[4],r[5]=i[5],r[6]=i[6],r[7]=i[7],r[12]=i[12],r[13]=i[13],r[14]=i[14],r[15]=i[15]),r[0]=s*u-h*a,r[1]=c*u-d*a,r[2]=f*u-p*a,r[3]=l*u-v*a,r[8]=s*a+h*u,r[9]=c*a+d*u,r[10]=f*a+p*u,r[11]=l*a+v*u,function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],u=e[6],s=e[7],c=e[8],f=e[9],l=e[10],h=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+c*r,t[5]=a*i+f*r,t[6]=u*i+l*r,t[7]=s*i+h*r,t[8]=c*i-o*r,t[9]=f*i-a*r,t[10]=l*i-u*r,t[11]=h*i-s*r}(x,x,b*xs),g=xi(ci(),[0,1,0],x)}return Oo(this.matrix,function(t,e,n,r){var i,o,a,u,s,c,f,l,h,d,p=e[0],v=e[1],g=e[2],y=r[0],m=r[1],b=r[2],_=n[0],x=n[1],w=n[2];return Math.abs(p-_)<ri&&Math.abs(v-x)<ri&&Math.abs(g-w)<ri?Ro(t):(f=p-_,l=v-x,h=g-w,i=m*(h*=d=1/Math.hypot(f,l,h))-b*(l*=d),o=b*(f*=d)-y*h,a=y*l-m*f,(d=Math.hypot(i,o,a))?(i*=d=1/d,o*=d,a*=d):(i=0,o=0,a=0),u=l*a-h*o,s=h*i-f*a,c=f*o-l*i,(d=Math.hypot(u,s,c))?(u*=d=1/d,s*=d,c*=d):(u=0,s=0,c=0),t[0]=i,t[1]=u,t[2]=f,t[3]=0,t[4]=o,t[5]=s,t[6]=l,t[7]=0,t[8]=a,t[9]=c,t[10]=h,t[11]=0,t[12]=-(i*p+o*v+a*g),t[13]=-(u*p+s*v+c*g),t[14]=-(f*p+l*v+h*g),t[15]=1,t)}(No(),this.position,this.focalPoint,g)),this._getAxes(),this._getDistance(),this._getAngles(),this}},{key:"setDistance",value:function(t){if(!(this.distance===t||t<0)){this.distance=t,this.distance<2e-4&&(this.distance=2e-4),this.dollyingStep=this.distance/100;var e=ci();t=this.distance;var n=this.forward,r=this.focalPoint;return e[0]=t*n[0]+r[0],e[1]=t*n[1]+r[1],e[2]=t*n[2]+r[2],this._setPosition(e),this}}},{key:"setMaxDistance",value:function(t){return this.maxDistance=t,this}},{key:"setMinDistance",value:function(t){return this.minDistance=t,this}},{key:"changeAzimuth",value:function(t){return this.setAzimuth(this.azimuth+t),this}},{key:"changeElevation",value:function(t){return this.setElevation(this.elevation+t),this}},{key:"changeRoll",value:function(t){return this.setRoll(this.roll+t),this}},{key:"setAzimuth",value:function(t){return this.azimuth=es(t),this.computeMatrix(),this._getAxes(),this.type===fs.ORBITING||this.type===fs.EXPLORING?this._getPosition():this.type===fs.TRACKING&&this._getFocalPoint(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(t){return this.elevation=es(t),this.computeMatrix(),this._getAxes(),this.type===fs.ORBITING||this.type===fs.EXPLORING?this._getPosition():this.type===fs.TRACKING&&this._getFocalPoint(),this}},{key:"setRoll",value:function(t){return this.roll=es(t),this.computeMatrix(),this._getAxes(),this.type===fs.ORBITING||this.type===fs.EXPLORING?this._getPosition():this.type===fs.TRACKING&&this._getFocalPoint(),this}},{key:"rotate",value:function(t,e,n){if(this.type===fs.EXPLORING){t=es(t),e=es(e),n=es(n);var r=hu(lu(),[1,0,0],(this.rotateWorld?1:-1)*e*xs),i=hu(lu(),[0,1,0],(this.rotateWorld?1:-1)*t*xs),o=hu(lu(),[0,0,1],n*xs),a=du(lu(),i,r);a=du(lu(),a,o);var u=Fo(No(),a);Po(this.matrix,this.matrix,[0,0,-this.distance]),Mo(this.matrix,this.matrix,u),Po(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation+e)>90)return;this.relElevation=es(e),this.relAzimuth=es(t),this.relRoll=es(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.computeMatrix()}return this._getAxes(),this.type===fs.ORBITING||this.type===fs.EXPLORING?this._getPosition():this.type===fs.TRACKING&&this._getFocalPoint(),this._update(),this}},{key:"pan",value:function(t,e){var n=ns(t,e,0),r=fi(this.position);return vi(r,r,yi(ci(),this.right,n[0])),vi(r,r,yi(ci(),this.up,n[1])),this._setPosition(r),this}},{key:"dolly",value:function(t){var e=this.forward,n=fi(this.position),r=this.dollyingStep,i=this.distance+t*this.dollyingStep;return r=Math.max(Math.min(i,this.maxDistance),this.minDistance)-this.distance,n[0]+=r*e[0],n[1]+=r*e[1],n[2]+=r*e[2],this._setPosition(n),this.type===fs.ORBITING||this.type===fs.EXPLORING?this._getDistance():this.type===fs.TRACKING&&vi(this.focalPoint,n,this.distanceVector),this}},{key:"createLandmark",value:function(t,e){var n=this.clone();n.setPosition(e.position),n.setFocalPoint(e.focalPoint),void 0!==e.roll&&n.setRoll(e.roll);var r=new ds(t,n);return this.landmarks.push(r),r}},{key:"setLandmark",value:function(t){var e=new ds(t,this);return this.landmarks.push(e),this}},{key:"gotoLandmark",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3,r=this.landmarks.find((function(e){return e.name===t}));if(r){if(0===n)return void r.retrieve(this);void 0!==this.landmarkAnimationID&&window.cancelAnimationFrame(this.landmarkAnimationID),this.interactor.disconnect();var i,o=r.getPosition(),a=r.getFocalPoint(),u=r.getRoll(),s=function t(r){void 0===i&&(i=r);var s,c=r-i,f=(1-Math.cos(c/n*Math.PI))/2,l=ci(),h=ci();if(_i(l,e.focalPoint,a,f),_i(h,e.position,o,f),s=e.roll*(1-f)+u*f,e.setFocalPoint(l),e.setPosition(h),e.setRoll(s),e.computeMatrix(),!(Si(l,a)+Si(h,o)>.01))return e.setFocalPoint(l),e.setPosition(h),e.setRoll(s),e.computeMatrix(),void e.interactor.connect();c<n&&(e.landmarkAnimationID=window.requestAnimationFrame(t))};window.requestAnimationFrame(s)}}},{key:"_update",value:function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles()}},{key:"computeMatrix",value:function(){var t,e,n=hu(lu(),[0,0,1],this.roll*xs);Ro(this.matrix),t=hu(lu(),[1,0,0],(this.rotateWorld&&this.type!==fs.TRACKING||this.type===fs.TRACKING?1:-1)*this.elevation*xs),e=hu(lu(),[0,1,0],(this.rotateWorld&&this.type!==fs.TRACKING||this.type===fs.TRACKING?1:-1)*this.azimuth*xs);var r=du(lu(),e,t);r=du(lu(),r,n);var i=Fo(No(),r);this.type===fs.ORBITING||this.type===fs.EXPLORING?(Po(this.matrix,this.matrix,this.focalPoint),Mo(this.matrix,this.matrix,i),Po(this.matrix,this.matrix,[0,0,this.distance])):this.type===fs.TRACKING&&(Po(this.matrix,this.matrix,this.position),Mo(this.matrix,this.matrix,i))}},{key:"_setPosition",value:function(t,e,n){this.position=ns(t,e,n);var r=this.matrix;r[12]=this.position[0],r[13]=this.position[1],r[14]=this.position[2],r[15]=1}},{key:"_getAxes",value:function(){di(this.right,ns(ui(oi(),[1,0,0,0],this.matrix))),di(this.up,ns(ui(oi(),[0,1,0,0],this.matrix))),di(this.forward,ns(ui(oi(),[0,0,1,0],this.matrix))),mi(this.right,this.right),mi(this.up,this.up),mi(this.forward,this.forward)}},{key:"_getAngles",value:function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=li(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===fs.TRACKING||this.rotateWorld?(this.elevation=Math.asin(e/r)*ws,this.azimuth=Math.atan2(-t,-n)*ws):(this.elevation=-Math.asin(e/r)*ws,this.azimuth=-Math.atan2(-t,-n)*ws)}},{key:"_getPosition",value:function(){di(this.position,ns(ui(oi(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){var t,e;wi(this.distanceVector,[0,0,-this.distance],(t=si(),e=this.matrix,t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t)),vi(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=gi(ci(),this.focalPoint,this.position),this.distance=li(this.distanceVector),this.dollyingStep=this.distance/100}}]),t}(),ss.ProjectionMode={ORTHOGRAPHIC:"ORTHOGRAPHIC",PERSPECTIVE:"PERSPECTIVE"},us=wr((as=cs).prototype,"interactor",[is],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),os=as))||os),Ss=(ps=(0,Mr.b2)(),vs=(0,Mr.f3)(Pr.GeometryComponentManager),ps((_s=bs=function(){function t(){br(this,t),this.config=void 0,mr(this,"geometry",ms,this),this.entity=void 0,this.component=void 0}return xr(t,[{key:"getEntity",value:function(){return this.entity}},{key:"getComponent",value:function(){return this.component}},{key:"setConfig",value:function(t){this.config=t}},{key:"setEntity",value:function(t){this.entity=t,this.component=this.geometry.create(t),this.component.entity=t,this.onEntityCreated()}},{key:"onEntityCreated",value:function(){}}]),t}(),bs.BOX="box",bs.SPHERE="sphere",bs.PLANE="plane",bs.MERGED="merged",ms=wr((ys=_s).prototype,"geometry",[vs],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),gs=ys))||gs),As=n(8344);function Ts(){if("undefined"!=typeof document)return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}var Is={}.toString;var Cs={};Cs["[object Float32Array]"]=Cs["[object Float64Array]"]=Cs["[object Int8Array]"]=Cs["[object Int16Array]"]=Cs["[object Int32Array]"]=Cs["[object Uint8Array]"]=Cs["[object Uint8ClampedArray]"]=Cs["[object Uint16Array]"]=Cs["[object Uint32Array]"]=!0,Cs["[object Arguments]"]=Cs["[object Array]"]=Cs["[object ArrayBuffer]"]=Cs["[object Boolean]"]=Cs["[object DataView]"]=Cs["[object Date]"]=Cs["[object Error]"]=Cs["[object Function]"]=Cs["[object Map]"]=Cs["[object Number]"]=Cs["[object Object]"]=Cs["[object RegExp]"]=Cs["[object Set]"]=Cs["[object String]"]=Cs["[object WeakMap]"]=!1;var Ds,Ns,ks,Rs,Os,Ms,Ps,Gs,Ls=Object.prototype.toString,Us=function(t){return function(t){return!!t&&"object"===zr(t)}(t)&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}(t.length)&&!!Cs[Ls.call(t)]};function Fs(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 Bs(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Fs(Object(n),!0).forEach((function(e){ni(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Fs(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var zs,js,Ws,Vs,Xs,Hs,qs,Ys,Ks,Zs,$s,Js,Qs,tc,ec,nc,rc,ic,oc,ac,uc,sc,cc,fc,lc,hc,dc,pc,vc,gc,yc,mc,bc,_c,xc,wc=(Ds=(0,Mr.b2)(),Ns=(0,Mr.f3)(Pr.RenderEngine),ks=(0,Mr.f3)(Pr.ConfigService),Ds((Gs=function(){function t(){br(this,t),mr(this,"engine",Ms,this),mr(this,"configService",Ps,this),this.entity=Cr(),this.model=void 0,this.dirty=!0,this.compiledBundle=void 0,this.initPromise=void 0}var e,n,r;return xr(t,[{key:"init",value:function(){var t=this.configService.get(),e=t.canvas,n=t.engineOptions;this.initPromise=this.engine.init(Bs({canvas:e||Ts(),swapChainFormat:As.EV.BGRA8Unorm,antialiasing:!1},n))}},{key:"setBundle",value:function(t){this.compiledBundle=JSON.parse(JSON.stringify(t))}},{key:"setDispatch",value:function(t){return this.compiledBundle.context&&(this.compiledBundle.context.dispatch=t),this}},{key:"setMaxIteration",value:function(t){return this.compiledBundle.context&&(this.compiledBundle.context.maxIteration=t),this}},{key:"setBinding",value:function(t,e){var n,r=this;if("string"==typeof t){var i=ts(e)||Us(e)||(n=e,Array.isArray?Array.isArray(n):function(t,e){return Is.call(t)==="[object "+e+"]"}(n,"Array"));if(this.compiledBundle&&this.compiledBundle.context){var o=this.compiledBundle.context.defines.find((function(e){return e.name===t}));if(o)return o.value=e,this;var a=this.compiledBundle.context.uniforms.find((function(e){return e.name===t}));a&&(i?(a.data=e,a.isReferer=!1,a.storageClass===$u.Uniform?this.model&&this.model.updateUniform(t,e):this.model&&this.model.updateBuffer(t,e)):(a.isReferer=!0,a.data=e))}}else Object.keys(t).forEach((function(e){r.setBinding(e,t[e])}));return this}},{key:"execute",value:(r=Tr(Sr().mark((function t(){var e,n,r=this,i=arguments;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=i.length>0&&void 0!==i[0]?i[0]:1,!this.dirty){t.next=6;break}return this.compiledBundle.context&&(e>1?this.compiledBundle.context.maxIteration=e:this.compiledBundle.context.maxIteration++),t.next=5,this.compile();case 5:this.dirty=!1;case 6:for(this.engine.beginFrame(),this.engine.clear({}),this.compiledBundle.context&&this.compiledBundle.context.uniforms.filter((function(t){return t.isReferer})).forEach((function(t){var e=t.data,n=t.name;r.model.confirmInput(e.model,n)})),n=0;n<e;n++)this.model.run();return this.engine.endFrame(),t.abrupt("return",this);case 12:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"getOutput",value:(n=Tr(Sr().mark((function t(){return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.model.readData());case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"compile",value:(e=Tr(Sr().mark((function t(){var e,n,r;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.initPromise;case 2:return e=Bs({},this.compiledBundle.context),n=this.engine.supportWebGPU?this.engine.useWGSL?Ju.WGSL:Ju.GLSL450:Ju.GLSL100,r=this.compiledBundle.shaders[n],e.defines.filter((function(t){return t.runtime})).forEach((function(t){var e="".concat("__DefineValuePlaceholder__").concat(t.name);r=r.replace(e,"".concat(t.value))})),e.shader=r,e.uniforms.forEach((function(t){if(!t.data&&t.storageClass===$u.StorageBuffer){var n=1;t.type===Ku.FloatArray?n=1:t.type===Ku.Vector4FloatArray&&(n=4),t.data=new Float32Array(e.output.length*n).fill(0)}})),this.compiledBundle.context=e,t.next=11,this.engine.createComputeModel(this.compiledBundle.context);case 11:this.model=t.sent;case 12:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}]),t}(),Ms=wr((Os=Gs).prototype,"engine",[Ns],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ps=wr(Os.prototype,"configService",[ks],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Rs=Os))||Rs),Ec=(zs=(0,Mr.b2)(),js=(0,Mr.f3)(Pr.MaterialComponentManager),zs((qs=Hs=function(){function t(){br(this,t),this.config=void 0,mr(this,"material",Xs,this),this.entity=void 0,this.component=void 0}return xr(t,[{key:"getEntity",value:function(){return this.entity}},{key:"getComponent",value:function(){return this.component}},{key:"setConfig",value:function(t){this.config=t}},{key:"setEntity",value:function(t,e){this.entity=t,this.component=this.material.create(t),this.component.entity=t,this.component.type=e,this.onEntityCreated()}},{key:"onEntityCreated",value:function(){}}]),t}(),Hs.BASIC="basic",Xs=wr((Vs=qs).prototype,"material",[js],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ws=Vs))||Ws),Sc=(Ys=(0,Mr.b2)(),Ks=(0,Mr.f3)(Pr.MeshComponentManager),Zs=(0,Mr.f3)(Pr.CullableComponentManager),$s=(0,Mr.f3)(Pr.TransformComponentManager),Js=(0,Mr.f3)(Pr.Systems),Qs=(0,Mr.t6)(Pr.SceneGraphSystem),Ys((uc=ac=function(){function t(){br(this,t),this.attributes={},this.config=void 0,mr(this,"mesh",nc,this),mr(this,"cullable",rc,this),mr(this,"transform",ic,this),mr(this,"sceneGraphSystem",oc,this),this.meshComponent=void 0,this.transformComponent=void 0,this.entity=void 0}return xr(t,[{key:"getEntity",value:function(){return this.entity}},{key:"getTransformComponent",value:function(){return this.transformComponent}},{key:"getMeshComponent",value:function(){return this.meshComponent}},{key:"setConfig",value:function(t){this.config=t}},{key:"setEntity",value:function(t){this.entity=t,this.cullable.create(t),this.meshComponent=this.mesh.create(t),this.transformComponent=this.transform.create(t),this.onEntityCreated()}},{key:"setMaterial",value:function(t){return this.meshComponent.material=t,this}},{key:"setGeometry",value:function(t){return this.meshComponent.geometry=t,this}},{key:"setAttributes",value:function(t){var e=this;Object.keys(t).forEach((function(n){void 0!==t[n]&&t[n]!==e.attributes[n]&&(e.onAttributeChanged({name:n,data:t[n]}),e.attributes[n]=t[n])}))}},{key:"setVisible",value:function(t){var e=this;return this.meshComponent.visible=t,this.meshComponent.children.forEach((function(n){var r=e.mesh.getComponentByEntity(n);r&&(r.visible=t)})),this}},{key:"isVisible",value:function(){return this.meshComponent.visible}},{key:"attach",value:function(t){return this.sceneGraphSystem.attach(this.entity,t.entity),this}},{key:"detach",value:function(){return this.sceneGraphSystem.detach(this.entity),this}},{key:"detachChildren",value:function(){return this.sceneGraphSystem.detachChildren(this.entity),this}},{key:"onEntityCreated",value:function(){}},{key:"onAttributeChanged",value:function(t){var e=t.name,n=t.data;this.meshComponent&&this.meshComponent.material&&this.meshComponent.material.setUniform(this.convertAttributeName2UniformName(e),n)}},{key:"convertAttributeName2UniformName",value:function(t){return t}}]),t}(),ac.POINT="point",ac.LINE="line",ac.GRID="grid",nc=wr((ec=uc).prototype,"mesh",[Ks],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),rc=wr(ec.prototype,"cullable",[Zs],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ic=wr(ec.prototype,"transform",[$s],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),oc=wr(ec.prototype,"sceneGraphSystem",[Js,Qs],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),tc=ec))||tc),Ac=n(6377),Tc=n.n(Ac),Ic=function(){function t(e,n){br(this,t),this.attribute=void 0,this.buffer=void 0;var r=n.buffer,i=n.offset,o=n.stride,a=n.normalized,u=n.size,s=n.divisor;this.buffer=r,this.attribute={buffer:r.get(),offset:i||0,stride:o||0,normalized:a||!1,divisor:s||0},u&&(this.attribute.size=u)}return xr(t,[{key:"get",value:function(){return this.attribute}},{key:"updateBuffer",value:function(t){this.buffer.subData(t)}},{key:"destroy",value:function(){this.buffer.destroy()}}]),t}(),Cc=(ni(sc={},Ri.POINTS,"points"),ni(sc,Ri.LINES,"lines"),ni(sc,Ri.LINE_LOOP,"line loop"),ni(sc,Ri.LINE_STRIP,"line strip"),ni(sc,Ri.TRIANGLES,"triangles"),ni(sc,Ri.TRIANGLE_FAN,"triangle fan"),ni(sc,Ri.TRIANGLE_STRIP,"triangle strip"),sc),Dc=(ni(cc={},Ri.STATIC_DRAW,"static"),ni(cc,Ri.DYNAMIC_DRAW,"dynamic"),ni(cc,Ri.STREAM_DRAW,"stream"),cc),Nc=(ni(fc={},Ri.BYTE,"int8"),ni(fc,Ri.UNSIGNED_INT,"int16"),ni(fc,Ri.INT,"int32"),ni(fc,Ri.UNSIGNED_BYTE,"uint8"),ni(fc,Ri.UNSIGNED_SHORT,"uint16"),ni(fc,Ri.UNSIGNED_INT,"uint32"),ni(fc,Ri.FLOAT,"float"),fc),kc=(ni(lc={},Ri.ALPHA,"alpha"),ni(lc,Ri.LUMINANCE,"luminance"),ni(lc,Ri.LUMINANCE_ALPHA,"luminance alpha"),ni(lc,Ri.RGB,"rgb"),ni(lc,Ri.RGBA,"rgba"),ni(lc,Ri.RGBA4,"rgba4"),ni(lc,Ri.RGB5_A1,"rgb5 a1"),ni(lc,Ri.RGB565,"rgb565"),ni(lc,Ri.DEPTH_COMPONENT,"depth"),ni(lc,Ri.DEPTH_STENCIL,"depth stencil"),lc),Rc=(ni(hc={},Ri.DONT_CARE,"dont care"),ni(hc,Ri.NICEST,"nice"),ni(hc,Ri.FASTEST,"fast"),hc),Oc=(ni(dc={},Ri.NEAREST,"nearest"),ni(dc,Ri.LINEAR,"linear"),ni(dc,Ri.LINEAR_MIPMAP_LINEAR,"mipmap"),ni(dc,Ri.NEAREST_MIPMAP_LINEAR,"nearest mipmap linear"),ni(dc,Ri.LINEAR_MIPMAP_NEAREST,"linear mipmap nearest"),ni(dc,Ri.NEAREST_MIPMAP_NEAREST,"nearest mipmap nearest"),dc),Mc=(ni(pc={},Ri.REPEAT,"repeat"),ni(pc,Ri.CLAMP_TO_EDGE,"clamp"),ni(pc,Ri.MIRRORED_REPEAT,"mirror"),pc),Pc=(ni(vc={},Ri.NONE,"none"),ni(vc,Ri.BROWSER_DEFAULT_WEBGL,"browser"),vc),Gc=(ni(gc={},Ri.NEVER,"never"),ni(gc,Ri.ALWAYS,"always"),ni(gc,Ri.LESS,"less"),ni(gc,Ri.LEQUAL,"lequal"),ni(gc,Ri.GREATER,"greater"),ni(gc,Ri.GEQUAL,"gequal"),ni(gc,Ri.EQUAL,"equal"),ni(gc,Ri.NOTEQUAL,"notequal"),gc),Lc=(ni(yc={},Ri.FUNC_ADD,"add"),ni(yc,Ri.MIN_EXT,"min"),ni(yc,Ri.MAX_EXT,"max"),ni(yc,Ri.FUNC_SUBTRACT,"subtract"),ni(yc,Ri.FUNC_REVERSE_SUBTRACT,"reverse subtract"),yc),Uc=(ni(mc={},Ri.ZERO,"zero"),ni(mc,Ri.ONE,"one"),ni(mc,Ri.SRC_COLOR,"src color"),ni(mc,Ri.ONE_MINUS_SRC_COLOR,"one minus src color"),ni(mc,Ri.SRC_ALPHA,"src alpha"),ni(mc,Ri.ONE_MINUS_SRC_ALPHA,"one minus src alpha"),ni(mc,Ri.DST_COLOR,"dst color"),ni(mc,Ri.ONE_MINUS_DST_COLOR,"one minus dst color"),ni(mc,Ri.DST_ALPHA,"dst alpha"),ni(mc,Ri.ONE_MINUS_DST_ALPHA,"one minus dst alpha"),ni(mc,Ri.CONSTANT_COLOR,"constant color"),ni(mc,Ri.ONE_MINUS_CONSTANT_COLOR,"one minus constant color"),ni(mc,Ri.CONSTANT_ALPHA,"constant alpha"),ni(mc,Ri.ONE_MINUS_CONSTANT_ALPHA,"one minus constant alpha"),ni(mc,Ri.SRC_ALPHA_SATURATE,"src alpha saturate"),mc),Fc=(ni(bc={},Ri.NEVER,"never"),ni(bc,Ri.ALWAYS,"always"),ni(bc,Ri.LESS,"less"),ni(bc,Ri.LEQUAL,"lequal"),ni(bc,Ri.GREATER,"greater"),ni(bc,Ri.GEQUAL,"gequal"),ni(bc,Ri.EQUAL,"equal"),ni(bc,Ri.NOTEQUAL,"notequal"),bc),Bc=(ni(_c={},Ri.ZERO,"zero"),ni(_c,Ri.KEEP,"keep"),ni(_c,Ri.REPLACE,"replace"),ni(_c,Ri.INVERT,"invert"),ni(_c,Ri.INCR,"increment"),ni(_c,Ri.DECR,"decrement"),ni(_c,Ri.INCR_WRAP,"increment wrap"),ni(_c,Ri.DECR_WRAP,"decrement wrap"),_c),zc=(ni(xc={},Ri.FRONT,"front"),ni(xc,Ri.BACK,"back"),xc),jc=function(){function t(e,n){br(this,t),this.buffer=void 0;var r=n.data,i=n.usage,o=n.type;this.buffer=e.buffer({data:r,usage:Dc[i||Ri.STATIC_DRAW],type:Nc[o||Ri.UNSIGNED_BYTE]})}return xr(t,[{key:"get",value:function(){return this.buffer}},{key:"destroy",value:function(){}},{key:"subData",value:function(t){var e=t.data,n=t.offset;this.buffer.subdata(e,n)}}]),t}();function Wc(t){return function(t){if(Array.isArray(t))return kr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Rr(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.")}()}var Vc={};Vc["[object Float32Array]"]=Vc["[object Float64Array]"]=Vc["[object Int8Array]"]=Vc["[object Int16Array]"]=Vc["[object Int32Array]"]=Vc["[object Uint8Array]"]=Vc["[object Uint8ClampedArray]"]=Vc["[object Uint16Array]"]=Vc["[object Uint32Array]"]=!0,Vc["[object Arguments]"]=Vc["[object Array]"]=Vc["[object ArrayBuffer]"]=Vc["[object Boolean]"]=Vc["[object DataView]"]=Vc["[object Date]"]=Vc["[object Error]"]=Vc["[object Function]"]=Vc["[object Map]"]=Vc["[object Number]"]=Vc["[object Object]"]=Vc["[object RegExp]"]=Vc["[object Set]"]=Vc["[object String]"]=Vc["[object WeakMap]"]=!1;var Xc=Object.prototype.toString,Hc=function(t){return function(t){return!!t&&"object"===zr(t)}(t)&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}(t.length)&&!!Vc[Xc.call(t)]};function qc(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 Yc(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?qc(Object(n),!0).forEach((function(e){ni(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):qc(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Kc=0,Zc=function(){function t(e,n){var r=this;br(this,t),this.reGl=e,this.context=n,this.entity=Cr(),this.texFBO=void 0,this.computeCommand=void 0,this.textureCache={},this.outputTextureName=void 0,this.swapOutputTextureName=void 0,this.compiledPingpong=void 0,this.dynamicPingpong=void 0;var i={};this.context.uniforms.forEach((function(t){var e=t.name,n=t.type,o=t.data,a=t.isReferer,u=t.storageClass;if(u===$u.StorageBuffer){if(a)r.textureCache[e]={data:void 0},i["".concat(e,"Size")]=function(){return o.compiledBundle.context.output.textureSize};else{r.textureCache[e]=r.calcDataTexture(e,n,o);var s=r.textureCache[e],c=s.textureWidth,f=s.isOutput;i["".concat(e,"Size")]=[c,c],f&&(r.outputTextureName=e,r.context.needPingpong&&(r.outputTextureName="".concat(e,"Output"),r.textureCache[r.outputTextureName]=r.calcDataTexture(e,n,o)))}i[e]=function(){return r.textureCache[e].texture}}else if(u===$u.Uniform){if(o&&(Array.isArray(o)||Hc(o))&&o.length>16)throw new Error("invalid data type ".concat(n));i[e]=function(){return t.data}}}));var o=this.getOuputDataTexture(),a=o.textureWidth,u=o.texelCount;i.u_OutputTextureSize=[a,a],i.u_OutputTexelCount=u,this.context.output.textureSize=[a,a];var s={attributes:{a_Position:[[-1,1,0],[-1,-1,0],[1,1,0],[1,-1,0]],a_TexCoord:[[0,1],[0,0],[1,1],[1,0]]},frag:"#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n#else\n precision mediump float;\n#endif\n".concat(this.context.shader),uniforms:i,vert:"attribute vec3 a_Position;\nattribute vec2 a_TexCoord;\n\nvarying vec2 v_TexCoord;\n\nvoid main() {\n gl_Position = vec4(a_Position, 1.0);\n v_TexCoord = a_TexCoord;\n}",primitive:"triangle strip",count:4};this.computeCommand=this.reGl(s)}var e;return xr(t,[{key:"run",value:function(){var t=this;this.context.maxIteration>1&&this.context.needPingpong&&(this.compiledPingpong=!0),(this.compiledPingpong||this.dynamicPingpong)&&this.swap(),this.texFBO=this.reGl.framebuffer({color:this.getOuputDataTexture().texture}),this.texFBO.use((function(){t.computeCommand()}))}},{key:"readData",value:(e=Tr(Sr().mark((function t(){var e,n,r,i,o,a,u,s,c=this;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.reGl({framebuffer:this.texFBO})((function(){e=c.reGl.read()})),!e){t.next=6;break}if(n=this.getOuputDataTexture(),r=n.originalDataLength,i=n.elementsPerTexel,o=n.typedArrayConstructor,a=void 0===o?Float32Array:o,u=[],4!==i)for(s=0;s<e.length;s+=4)1===i?u.push(e[s]):2===i?u.push(e[s],e[s+1]):u.push(e[s],e[s+1],e[s+2]);else u=e;return t.abrupt("return",new a(u.slice(0,r)));case 6:return t.abrupt("return",new Float32Array);case 7:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"confirmInput",value:function(t,e){var n;this.entity===t.entity?(this.dynamicPingpong=!0,n=this):n=t,this.textureCache[e].id=n.getOuputDataTexture().id,this.textureCache[e].texture=n.getOuputDataTexture().texture}},{key:"updateUniform",value:function(){}},{key:"updateBuffer",value:function(t,e){var n=this.context.uniforms.find((function(e){return e.name===t}));if(n){var r=this.calcDataTexture(t,n.type,e),i=r.texture,o=r.data;this.textureCache[t].data=o,this.textureCache[t].texture=i}}},{key:"destroy",value:function(){}},{key:"swap",value:function(){if(this.swapOutputTextureName||this.createSwapOutputDataTexture(),this.compiledPingpong){var t=this.context.output.name;this.textureCache[t].id=this.getOuputDataTexture().id,this.textureCache[t].texture=this.getOuputDataTexture().texture}var e=this.outputTextureName;this.outputTextureName=this.swapOutputTextureName,this.swapOutputTextureName=e}},{key:"getOuputDataTexture",value:function(){return this.textureCache[this.outputTextureName]}},{key:"createSwapOutputDataTexture",value:function(){var t=this.cloneDataTexture(this.getOuputDataTexture());this.swapOutputTextureName="".concat(this.entity,"-swap"),this.textureCache[this.swapOutputTextureName]=t}},{key:"cloneDataTexture",value:function(t){var e=t.data,n=t.textureWidth;return Yc(Yc({},t),{},{id:Kc++,texture:this.reGl.texture({width:n,height:n,data:e,type:"float"})})}},{key:"calcDataTexture",value:function(t,e,n){var r=1;e===Ku.Vector4FloatArray&&(r=4);for(var i=[],o=0;o<n.length;o+=r)1===r?i.push(n[o],0,0,0):2===r?i.push(n[o],n[o+1],0,0):3===r?i.push(n[o],n[o+1],n[o+2],0):4===r&&i.push(n[o],n[o+1],n[o+2],n[o+3]);var a=n.length,u=Math.ceil(a/r),s=Math.ceil(Math.sqrt(u)),c=s*s;u<c&&i.push.apply(i,Wc(new Array(4*(c-u)).fill(0)));var f=this.reGl.texture({width:s,height:s,data:i,type:"float"});return{id:Kc++,data:i,originalDataLength:a,typedArrayConstructor:Hc(n)?n.constructor:void 0,textureWidth:s,texture:f,texelCount:u,elementsPerTexel:r,isOutput:t===this.context.output.name}}}]),t}(),$c=function(){function t(e,n){br(this,t),this.elements=void 0;var r=n.data,i=n.usage,o=n.type,a=n.count;this.elements=e.elements({data:r,usage:Dc[i||Ri.STATIC_DRAW],type:Nc[o||Ri.UNSIGNED_BYTE],count:a})}return xr(t,[{key:"get",value:function(){return this.elements}},{key:"subData",value:function(t){var e=t.data;this.elements.subdata(e)}},{key:"destroy",value:function(){this.elements.destroy()}}]),t}(),Jc=function(){function t(e,n){br(this,t),this.framebuffer=void 0;var r=n.width,i=n.height,o=n.color,a=n.colors,u=(n.depth,n.stencil,{width:r,height:i});Array.isArray(a)&&(u.colors=a.map((function(t){return t.get()}))),o&&"boolean"!=typeof o&&(u.color=o.get()),this.framebuffer=e.framebuffer(u)}return xr(t,[{key:"get",value:function(){return this.framebuffer}},{key:"destroy",value:function(){this.framebuffer.destroy()}},{key:"resize",value:function(t){var e=t.width,n=t.height;this.framebuffer.resize(e,n)}}]),t}();function Qc(t){var e={};return Object.keys(t).forEach((function(n){tf(n,t[n],e,"")})),e}function tf(t,e,n,r){var i,o;null===e||"number"==typeof e||"boolean"==typeof e||Array.isArray(e)&&"number"==typeof e[0]||Hc(e)||""===e||void 0!==e.resize?n["".concat(r&&r+".").concat(t)]=e:(o=zr(i=e),null==i||"object"!==o&&"function"!==o||Object.keys(e).forEach((function(i){tf(i,e[i],n,"".concat(r&&r+".").concat(t))})),Array.isArray(e)&&e.forEach((function(e,i){Object.keys(e).forEach((function(o){tf(o,e[o],n,"".concat(r&&r+".").concat(t,"[").concat(i,"]"))}))})))}function ef(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 nf(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ef(Object(n),!0).forEach((function(e){ni(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ef(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var rf,of,af,uf=function(){function t(e,n){br(this,t),this.reGl=void 0,this.drawCommand=void 0,this.uniforms={},this.reGl=e;var r=n.vs,i=n.fs,o=n.defines,a=n.attributes,u=n.uniforms,s=n.primitive,c=n.count,f=n.elements,l=n.depth,h=n.blend,d=n.stencil,p=n.cull,v=n.instances,g=n.scissor,y=n.viewport,m={};u&&(this.uniforms=Qc(u),Object.keys(u).forEach((function(t){m[t]=e.prop(t)})));var b={};Object.keys(a).forEach((function(t){b[t]=a[t].get()}));var _=o&&this.generateDefines(o)||"",x={attributes:b,frag:"#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n#else\n precision mediump float;\n#endif\n".concat(_,"\n").concat(i),uniforms:m,vert:"\n".concat(_,"\n").concat(r),primitive:Cc[void 0===s?Ri.TRIANGLES:s]};v&&(x.instances=v),c&&(x.count=c),f&&(x.elements=f.get()),g&&(x.scissor=g),y&&(x.viewport=y),this.initDepthDrawParams({depth:l},x),this.initBlendDrawParams({blend:h},x),this.initStencilDrawParams({stencil:d},x),this.initCullDrawParams({cull:p},x),this.drawCommand=e(x)}return xr(t,[{key:"addUniforms",value:function(t){this.uniforms=nf(nf({},this.uniforms),Qc(t))}},{key:"draw",value:function(t){var e=nf(nf({},this.uniforms),Qc(t.uniforms||{})),n={};Object.keys(e).forEach((function(t){var r=zr(e[t]);"boolean"===r||"number"===r||Array.isArray(e[t])||e[t].BYTES_PER_ELEMENT?n[t]=e[t]:"string"===r||(n[t]=e[t].get())})),this.drawCommand(n)}},{key:"destroy",value:function(){}},{key:"initDepthDrawParams",value:function(t,e){var n=t.depth;n&&(e.depth={enable:void 0===n.enable||!!n.enable,mask:void 0===n.mask||!!n.mask,func:Gc[n.func||Ri.LESS],range:n.range||[0,1]})}},{key:"initBlendDrawParams",value:function(t,e){var n=t.blend;if(n){var r=n.enable,i=n.func,o=n.equation,a=n.color,u=void 0===a?[0,0,0,0]:a;e.blend={enable:!!r,func:{srcRGB:Uc[i&&i.srcRGB||Ri.SRC_ALPHA],srcAlpha:Uc[i&&i.srcAlpha||Ri.SRC_ALPHA],dstRGB:Uc[i&&i.dstRGB||Ri.ONE_MINUS_SRC_ALPHA],dstAlpha:Uc[i&&i.dstAlpha||Ri.ONE_MINUS_SRC_ALPHA]},equation:{rgb:Lc[o&&o.rgb||Ri.FUNC_ADD],alpha:Lc[o&&o.alpha||Ri.FUNC_ADD]},color:u}}}},{key:"initStencilDrawParams",value:function(t,e){var n=t.stencil;if(n){var r=n.enable,i=n.mask,o=void 0===i?-1:i,a=n.func,u=void 0===a?{cmp:Ri.ALWAYS,ref:0,mask:-1}:a,s=n.opFront,c=void 0===s?{fail:Ri.KEEP,zfail:Ri.KEEP,zpass:Ri.KEEP}:s,f=n.opBack,l=void 0===f?{fail:Ri.KEEP,zfail:Ri.KEEP,zpass:Ri.KEEP}:f;e.stencil={enable:!!r,mask:o,func:nf(nf({},u),{},{cmp:Fc[u.cmp]}),opFront:{fail:Bc[c.fail],zfail:Bc[c.zfail],zpass:Bc[c.zpass]},opBack:{fail:Bc[l.fail],zfail:Bc[l.zfail],zpass:Bc[l.zpass]}}}}},{key:"initCullDrawParams",value:function(t,e){var n=t.cull;if(n){var r=n.enable,i=n.face,o=void 0===i?Ri.BACK:i;e.cull={enable:!!r,face:zc[o]}}}},{key:"generateDefines",value:function(t){return Object.keys(t).map((function(e){return"#define ".concat(e," ").concat(Number(t[e]))})).join("\n")}}]),t}(),sf=function(){function t(e,n){br(this,t),this.texture=void 0,this.width=void 0,this.height=void 0;var r=n.data,i=n.type,o=void 0===i?Ri.UNSIGNED_BYTE:i,a=n.width,u=n.height,s=n.flipY,c=void 0!==s&&s,f=n.format,l=void 0===f?Ri.RGBA:f,h=n.mipmap,d=void 0!==h&&h,p=n.wrapS,v=void 0===p?Ri.CLAMP_TO_EDGE:p,g=n.wrapT,y=void 0===g?Ri.CLAMP_TO_EDGE:g,m=n.aniso,b=void 0===m?0:m,_=n.alignment,x=void 0===_?1:_,w=n.premultiplyAlpha,E=void 0!==w&&w,S=n.mag,A=void 0===S?Ri.NEAREST:S,T=n.min,I=void 0===T?Ri.NEAREST:T,C=n.colorSpace,D=void 0===C?Ri.BROWSER_DEFAULT_WEBGL:C;this.width=a,this.height=u;var N={width:a,height:u,type:Nc[o],format:kc[l],wrapS:Mc[v],wrapT:Mc[y],mag:Oc[A],min:Oc[I],alignment:x,flipY:c,colorSpace:Pc[D],premultiplyAlpha:E,aniso:b};r&&(N.data=r),"number"==typeof d?N.mipmap=Rc[d]:"boolean"==typeof d&&(N.mipmap=d),this.texture=e.texture(N)}return xr(t,[{key:"get",value:function(){return this.texture}},{key:"update",value:function(){this.texture._texture.bind()}},{key:"resize",value:function(t){var e=t.width,n=t.height;this.texture.resize(e,n),this.width=e,this.height=n}},{key:"destroy",value:function(){this.texture.destroy()}}]),t}(),cf=(0,Mr.b2)()((of=function(){function t(){var e=this;br(this,t),this.supportWebGPU=!1,this.useWGSL=!1,this.$canvas=void 0,this.gl=void 0,this.inited=void 0,this.createModel=function(){var t=Tr(Sr().mark((function t(n){return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!n.uniforms){t.next=3;break}return t.next=3,Promise.all(Object.keys(n.uniforms).map(function(){var t=Tr(Sr().mark((function t(e){var r;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!n.uniforms[e]||void 0===n.uniforms[e].load){t.next=5;break}return t.next=3,n.uniforms[e].load();case 3:r=t.sent,n.uniforms[e]=r;case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 3:return t.abrupt("return",new uf(e.gl,n));case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.createAttribute=function(t){return new Ic(e.gl,t)},this.createBuffer=function(t){return new jc(e.gl,t)},this.createElements=function(t){return new $c(e.gl,t)},this.createTexture2D=function(t){return new sf(e.gl,t)},this.createFramebuffer=function(t){return new Jc(e.gl,t)},this.useFramebuffer=function(t,n){e.gl({framebuffer:t?t.get():null})(n)},this.createComputeModel=function(){var t=Tr(Sr().mark((function t(n){return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Zc(e.gl,n));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.clear=function(t){var n=t.color,r=t.depth,i=t.stencil,o=t.framebuffer,a=void 0===o?null:o,u={color:n,depth:r,stencil:i};u.framebuffer=null===a?a:a.get(),e.gl.clear(u)},this.setScissor=function(t){e.gl&&e.gl._gl&&(t.enable&&t.box?(e.gl._gl.enable(Ri.SCISSOR_TEST),e.gl._gl.scissor(t.box.x,t.box.y,t.box.width,t.box.height)):e.gl._gl.disable(Ri.SCISSOR_TEST),e.gl._refresh())},this.viewport=function(t){var n=t.x,r=t.y,i=t.width,o=t.height;e.gl&&e.gl._gl&&(e.gl._gl.viewport(n,r,i,o),e.gl._refresh())},this.readPixels=function(t){var n=t.framebuffer,r={x:t.x,y:t.y,width:t.width,height:t.height};return n&&(r.framebuffer=n.get()),e.gl.read(r)},this.getCanvas=function(){return e.$canvas},this.getGLContext=function(){return e.gl._gl},this.destroy=function(){e.gl&&(e.gl.destroy(),e.inited=!1)}}var e;return xr(t,[{key:"init",value:(e=Tr(Sr().mark((function t(e){return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.inited){t.next=2;break}return t.abrupt("return");case 2:return this.$canvas=e.canvas,t.next=5,new Promise((function(t,n){Tc()({canvas:e.canvas,attributes:{alpha:!0,antialias:e.antialias,premultipliedAlpha:!0},pixelRatio:1,extensions:["OES_element_index_uint","OES_texture_float","OES_standard_derivatives","angle_instanced_arrays"],optionalExtensions:["EXT_texture_filter_anisotropic","EXT_blend_minmax","WEBGL_depth_texture"],profile:!0,onDone:function(e,r){!e&&r||n(e),t(r)}})}));case 5:this.gl=t.sent,this.inited=!0;case 7:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"isFloatSupported",value:function(){return this.gl.limits.readFloat}},{key:"beginFrame",value:function(){}},{key:"endFrame",value:function(){}}]),t}(),rf=of))||rf;function ff(t,e){return new Promise((function(e,n){!function(t,e,n,r){if("undefined"!=typeof window){var i=document.getElementsByTagName("head")[0],o=document.createElement("script");o.setAttribute("type","text/javascript"),o.setAttribute("src",t),r&&(o.id=r),o.onload=function(){e&&e()},o.onerror=function(e){n&&n("Unable to load script '".concat(t,"'"),e)},i.appendChild(o)}}(t,(function(){e()}),(function(t,e){n(e)}))}))}function lf(){return hf.apply(this,arguments)}function hf(){return(hf=Tr(Sr().mark((function t(){return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!af){t.next=2;break}return t.abrupt("return",af);case 2:return t.next=4,ff("https://preview.babylonjs.com/glslang/glslang.js");case 4:return af=window.glslang("https://preview.babylonjs.com/glslang/glslang.wasm"),t.abrupt("return",af);case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var df,pf,vf,gf,yf,mf,bf,_f=function(){function t(e,n){br(this,t),this.engine=e,this.options=n,this.attribute=void 0,this.buffer=void 0;var r=n,i=r.buffer,o=r.offset,a=r.stride,u=r.normalized,s=r.size,c=r.divisor,f=r.arrayStride,l=r.attributes,h=r.stepMode;this.buffer=i,this.attribute={buffer:i.get(),offset:o||0,stride:a||0,normalized:u||!1,divisor:c||0,arrayStride:f||0,attributes:l,stepMode:h||"vertex"},s&&(this.attribute.size=s)}return xr(t,[{key:"get",value:function(){return this.attribute}},{key:"updateBuffer",value:function(t){this.buffer.subData(t)}},{key:"destroy",value:function(){this.buffer.destroy()}}]),t}(),xf=function(){function t(e,n){br(this,t),this.engine=e,this.options=n,this.buffer=void 0;var r=n,i=r.data,o=r.usage;r.type,this.buffer=this.createBuffer(i instanceof Array?new Float32Array(i):i,o||As.FB.Vertex|As.FB.CopyDst)}return xr(t,[{key:"get",value:function(){return this.buffer}},{key:"destroy",value:function(){this.buffer.destroy()}},{key:"subData",value:function(t){var e=t.data,n=t.offset;this.setSubData(this.buffer,n,e instanceof Array?new Float32Array(e):e)}},{key:"createBuffer",value:function(t,e){var n=t.byteLength%4,r={size:t.byteLength+n,usage:e},i=this.engine.device.createBuffer(r);return this.setSubData(i,0,t),i}},{key:"setSubData",value:function(t,e,n){(Qu?this.engine.device.getQueue():this.engine.device.defaultQueue).writeBuffer(t,e,n)}}]),t}(),wf=function(){function t(e,n){br(this,t),this.engine=e,this.context=n,this.entity=Cr(),this.uniformGPUBufferLayout=[],this.uniformBuffer=void 0,this.vertexBuffers={},this.outputBuffer=void 0,this.bindGroupEntries=void 0,this.bindGroup=void 0,this.computePipeline=void 0}var e,n,r;return xr(t,[{key:"init",value:(r=Tr(Sr().mark((function t(){var e,n,r,i,o,a,u,s=this;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.compileComputePipelineStageDescriptor(this.context.shader);case 2:e=t.sent,n=e.computeStage,r=this.context.uniforms.filter((function(t){return t.storageClass===$u.StorageBuffer})),i=this.context.uniforms.filter((function(t){return t.storageClass===$u.Uniform})),o=i.length?1:0,this.bindGroupEntries=[],o&&(a=0,u=[],i.forEach((function(t){if("number"==typeof t.data)s.uniformGPUBufferLayout.push({name:t.name,offset:a}),a+=4,u.push(t.data);else{var e,n=(null===(e=t.data)||void 0===e?void 0:e.length)||1;3===n&&(n=4,t.data.push(0));var r=a/4%4;if(r>0){var i=4-r;if(n>1&&n<=i)2===n&&(3===i&&(a+=4,u.push(0)),u.push.apply(u,Wc(t.data)),s.uniformGPUBufferLayout.push({name:t.name,offset:a}));else{for(var o=0;o<i;o++)a+=4,u.push(0);u.push.apply(u,Wc(t.data)),s.uniformGPUBufferLayout.push({name:t.name,offset:a})}}a+=4*n}})),this.uniformBuffer=new xf(this.engine,{data:u instanceof Array?new Float32Array(u):u,usage:As.FB.Uniform|As.FB.CopyDst}),this.bindGroupEntries.push({binding:0,resource:{buffer:this.uniformBuffer.get()}})),r.forEach((function(t){var e;null!==t.data&&(t.type!==Ku.Vector4FloatArray&&t.type!==Ku.FloatArray||(t.name===s.context.output.name?(e=new xf(s.engine,{data:isFinite(Number(t.data))?[t.data]:t.data,usage:As.FB.Storage|As.FB.CopyDst|As.FB.CopySrc}),s.outputBuffer=e,s.context.output={name:t.name,length:isFinite(Number(t.data))?1:t.data.length,typedArrayConstructor:Float32Array,gpuBuffer:e.get()}):t.isReferer?t.data.model&&t.data.model.outputBuffer&&(e=t.data.model.outputBuffer):e=new xf(s.engine,{data:isFinite(Number(t.data))?[t.data]:t.data,usage:As.FB.Storage|As.FB.CopyDst|As.FB.CopySrc}),s.vertexBuffers[t.name]=e,s.bindGroupEntries.push({binding:o,resource:{name:t.name,refer:e?void 0:t.data,buffer:e?e.get():void 0}}),o++))})),this.computePipeline=this.engine.device.createComputePipeline({computeStage:n}),console.log(this.bindGroupEntries),this.bindGroup=this.engine.device.createBindGroup({layout:this.computePipeline.getBindGroupLayout(0),entries:this.bindGroupEntries});case 13:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"destroy",value:function(){var t=this;this.uniformBuffer&&this.uniformBuffer.destroy(),Object.keys(this.vertexBuffers).forEach((function(e){return t.vertexBuffers[e].destroy()}))}},{key:"readData",value:(n=Tr(Sr().mark((function t(){var e,n,r,i,o,a,u,s,c;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(e=this.context.output)){t.next=16;break}if(n=e.length,r=e.typedArrayConstructor,!(i=e.gpuBuffer)){t.next=16;break}return o=n*r.BYTES_PER_ELEMENT,a=this.engine.device.createBuffer({size:o,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ}),(u=this.engine.device.createCommandEncoder()).copyBufferToBuffer(i,0,a,0,o),(Qu?this.engine.device.getQueue():this.engine.device.defaultQueue).submit([u.finish()]),t.next=12,a.mapAsync(As.gc.Read);case 12:return s=a.getMappedRange(),c=new r(s.slice(0)),a.unmap(),t.abrupt("return",c);case 16:return t.abrupt("return",new Float32Array);case 17:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"run",value:function(){var t;this.engine.currentComputePass&&(this.engine.currentComputePass.setPipeline(this.computePipeline),this.engine.currentComputePass.setBindGroup(0,this.bindGroup),(t=this.engine.currentComputePass).dispatch.apply(t,Wc(this.context.dispatch)))}},{key:"updateBuffer",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.vertexBuffers[t];r&&r.subData({data:e,offset:n})}},{key:"updateUniform",value:function(t,e){var n=this.uniformGPUBufferLayout.find((function(e){return e.name===t}));n&&this.uniformBuffer.subData({data:Number.isFinite(e)?new Float32Array([e]):new Float32Array(e),offset:n.offset})}},{key:"confirmInput",value:function(t,e){var n=this.vertexBuffers[e],r=t.outputBuffer;if(n&&r&&n!==r){var i=this.engine.device.createCommandEncoder(),o=t.context.output,a=o.length*o.typedArrayConstructor.BYTES_PER_ELEMENT;i.copyBufferToBuffer(r.get(),0,n.get(),0,a),(Qu?this.engine.device.getQueue():this.engine.device.defaultQueue).submit([i.finish()])}}},{key:"compileShaderToSpirV",value:function(t,e,n){return this.compileRawShaderToSpirV(n+t,e)}},{key:"compileRawShaderToSpirV",value:function(t,e){return this.engine.glslang.compileGLSL(t,e)}},{key:"compileComputePipelineStageDescriptor",value:(e=Tr(Sr().mark((function t(e){var n;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e,this.engine.options.useWGSL){t.next=6;break}return t.next=5,this.compileShaderToSpirV(e,"compute","#version 450\n");case 5:n=t.sent;case 6:return t.abrupt("return",{computeStage:{module:this.engine.device.createShaderModule({code:n,isWHLSL:Qu}),entryPoint:"main"}});case 7:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})}]),t}(),Ef=function(){function t(e,n){br(this,t),this.engine=e,this.options=n,this.indexCount=void 0,this.buffer=void 0;var r=n,i=r.data,o=(r.usage,r.type,r.count);this.indexCount=o||0,this.buffer=new xf(e,{data:i instanceof Array?new Uint16Array(i):i,usage:As.FB.Index|As.FB.CopyDst})}return xr(t,[{key:"get",value:function(){return this.buffer}},{key:"subData",value:function(t){this.buffer.subData(t)}},{key:"destroy",value:function(){this.buffer.destroy()}}]),t}(),Sf=function(){function t(e,n){br(this,t),this.engine=e,this.options=n,this.colorTexture=void 0,this.depthTexture=void 0,this.width=0,this.height=0;var r=n,i=(r.width,r.height,r.color),o=(r.colors,r.depth);r.stencil,i&&(this.colorTexture=i),o&&(this.depthTexture=o)}return xr(t,[{key:"get",value:function(){var t,e;return{color:null===(t=this.colorTexture)||void 0===t?void 0:t.get(),depth:null===(e=this.depthTexture)||void 0===e?void 0:e.get()}}},{key:"destroy",value:function(){var t,e;null===(t=this.colorTexture)||void 0===t||t.destroy(),null===(e=this.depthTexture)||void 0===e||e.destroy()}},{key:"resize",value:function(t){var e,n,r=t.width,i=t.height;r===this.width&&i===this.height||(null===(e=this.colorTexture)||void 0===e||e.resize({width:r,height:i}),null===(n=this.depthTexture)||void 0===n||n.resize({width:r,height:i})),this.width=r,this.height=i}}]),t}(),Af=(ni(df={},Ri.POINTS,As.YV.PointList),ni(df,Ri.LINES,As.YV.LineList),ni(df,Ri.LINE_LOOP,As.YV.LineList),ni(df,Ri.LINE_STRIP,As.YV.LineStrip),ni(df,Ri.TRIANGLES,As.YV.TriangleList),ni(df,Ri.TRIANGLE_FAN,As.YV.TriangleList),ni(df,Ri.TRIANGLE_STRIP,As.YV.TriangleStrip),df),Tf=(ni(pf={},Ri.NEVER,As.wb.Never),ni(pf,Ri.ALWAYS,As.wb.Always),ni(pf,Ri.LESS,As.wb.Less),ni(pf,Ri.LEQUAL,As.wb.LessEqual),ni(pf,Ri.GREATER,As.wb.Greater),ni(pf,Ri.GEQUAL,As.wb.GreaterEqual),ni(pf,Ri.EQUAL,As.wb.Equal),ni(pf,Ri.NOTEQUAL,As.wb.NotEqual),pf),If=(ni(vf={},Ri.FUNC_ADD,As.db.Add),ni(vf,Ri.MIN_EXT,As.db.Min),ni(vf,Ri.MAX_EXT,As.db.Max),ni(vf,Ri.FUNC_SUBTRACT,As.db.Subtract),ni(vf,Ri.FUNC_REVERSE_SUBTRACT,As.db.ReverseSubtract),vf),Cf=(ni(gf={},Ri.ZERO,As.zi.Zero),ni(gf,Ri.ONE,As.zi.One),ni(gf,Ri.SRC_COLOR,As.zi.SrcColor),ni(gf,Ri.ONE_MINUS_SRC_COLOR,As.zi.OneMinusSrcColor),ni(gf,Ri.SRC_ALPHA,As.zi.SrcAlpha),ni(gf,Ri.ONE_MINUS_SRC_ALPHA,As.zi.OneMinusSrcAlpha),ni(gf,Ri.DST_COLOR,As.zi.DstColor),ni(gf,Ri.ONE_MINUS_DST_COLOR,As.zi.OneMinusDstColor),ni(gf,Ri.DST_ALPHA,As.zi.DstAlpha),ni(gf,Ri.ONE_MINUS_DST_ALPHA,As.zi.OneMinusDstAlpha),ni(gf,Ri.CONSTANT_COLOR,As.zi.BlendColor),ni(gf,Ri.ONE_MINUS_CONSTANT_COLOR,As.zi.OneMinusBlendColor),ni(gf,Ri.SRC_ALPHA_SATURATE,As.zi.SrcAlphaSaturated),gf),Df=(ni(yf={},Ri.ALPHA,"r8unorm"),ni(yf,Ri.RGBA,"rgba8unorm"),ni(yf,Ri.DEPTH_COMPONENT,"depth32float"),ni(yf,Ri.DEPTH_STENCIL,"depth24plus-stencil8"),yf),Nf=(ni(mf={},Ri.NEAREST,"nearest"),ni(mf,Ri.LINEAR,"linear"),mf),kf=(ni(bf={},Ri.REPEAT,"repeat"),ni(bf,Ri.CLAMP_TO_EDGE,"clamp-to-edge"),ni(bf,Ri.MIRRORED_REPEAT,"mirror-repeat"),bf);function Rf(t){var e=t.cull;return e&&e.enable?e.face?e.face===Ri.FRONT?As.Wf.Front:As.Wf.Back:void 0:As.Wf.None}function Of(t){var e=t.depth,n=(t.stencil,{compare:As.wb.Always,depthFailOp:As.xS.Keep,failOp:As.xS.Keep,passOp:As.xS.Keep});return{depthWriteEnabled:e&&e.enable,depthCompare:Tf[(null==e?void 0:e.func)||Ri.ALWAYS],format:As.EV.Depth24PlusStencil8,stencilFront:n,stencilBack:n,stencilReadMask:4294967295,stencilWriteMask:4294967295}}function Mf(t,e){var n=t.blend;return[{format:e,alphaBlend:{srcFactor:Cf[n&&n.func&&n.func.srcAlpha||Ri.ONE],dstFactor:Cf[n&&n.func&&n.func.dstAlpha||Ri.ZERO],operation:If[n&&n.equation&&n.equation.alpha||Ri.FUNC_ADD]},colorBlend:{srcFactor:Cf[n&&n.func&&n.func.srcRGB||Ri.ONE],dstFactor:Cf[n&&n.func&&n.func.dstRGB||Ri.ZERO],operation:If[n&&n.equation&&n.equation.rgb||Ri.FUNC_ADD]},writeMask:As.Yw.All}]}function Pf(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 Gf(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Pf(Object(n),!0).forEach((function(e){ni(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Pf(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Lf(t){for(var e=0,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];for(var o=0,a=r;o<a.length;o++){var u=a[o];e+=u.length}for(var s=new t(e),c=0,f=0,l=r;f<l.length;f++){var h=l[f];s.set(h,c),c+=h.length}return s}var Uf,Ff,Bf,zf=function(){function t(e,n){br(this,t),this.engine=e,this.options=n,this.pipelineLayout=void 0,this.renderPipeline=void 0,this.uniformsBindGroupLayout=void 0,this.uniformBindGroup=void 0,this.uniformBuffer=void 0,this.uniforms={},this.uniformGPUBufferLayout=[],this.attributeCache={},this.indexBuffer=void 0,this.indexCount=void 0}var e,n;return xr(t,[{key:"init",value:(n=Tr(Sr().mark((function t(){var e,n,r,i,o,a,u,s,c,f,l,h,d,p,v,g,y=this;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.options,n=e.vs,r=e.fs,i=e.attributes,o=e.uniforms,a=e.primitive,e.count,u=e.elements,s=e.depth,c=e.blend,f=e.stencil,l=e.cull,e.instances,t.next=3,this.compilePipelineStageDescriptor(n,r,null);case 3:h=t.sent,d=h.vertexStage,p=h.fragmentStage,o&&this.buildUniformBindGroup(o),u&&(this.indexBuffer=u.get(),this.indexCount=u.indexCount),v={vertexBuffers:Object.keys(i).map((function(t,e){var n=i[t],r=n.get(),o=r.arrayStride,a=r.stepMode,u=r.attributes;return y.attributeCache[t]=n,{arrayStride:o,stepMode:a,attributes:u}}))},g={sampleCount:this.engine.mainPassSampleCount,primitiveTopology:Af[a||Ri.TRIANGLES],rasterizationState:Gf(Gf({},this.getDefaultRasterizationStateDescriptor()),{},{cullMode:Rf({cull:l})}),depthStencilState:Of({depth:s,stencil:f}),colorStates:Mf({blend:c},this.engine.options.swapChainFormat),layout:this.pipelineLayout,vertexStage:d,fragmentStage:p,vertexState:v},this.renderPipeline=this.engine.device.createRenderPipeline(g);case 11:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"addUniforms",value:function(t){this.uniforms=Gf(Gf({},this.uniforms),Qc(t))}},{key:"draw",value:function(t){var e=this,n=this.engine.getCurrentRenderPass(),r=Gf(Gf({},this.uniforms),Qc(t.uniforms||{})),i=[];Object.keys(r).forEach((function(t){var n=zr(r[t]);if("boolean"===n||"number"===n||Array.isArray(r[t])||r[t].BYTES_PER_ELEMENT){var o,a=null===(o=e.uniformGPUBufferLayout.find((function(e){return e.name===t})))||void 0===o?void 0:o.offset;null!==a&&e.uniformBuffer.subData({data:r[t],offset:a})}else{var u,s=null===(u=e.uniformGPUBufferLayout.find((function(e){return e.name===t})))||void 0===u?void 0:u.offset;if(null!==s){var c=r[t].get(),f=c.color||c,l=f.texture,h=f.sampler;h&&(i.push({binding:s,resource:h}),s++),i.push({binding:s,resource:l.createView()})}}})),this.uniformBuffer&&(i[0]={binding:0,resource:{buffer:this.uniformBuffer.get()}}),this.uniformBindGroup=this.engine.device.createBindGroup({layout:this.uniformsBindGroupLayout,entries:i}),this.renderPipeline&&n.setPipeline(this.renderPipeline),n.setBindGroup(0,this.uniformBindGroup),this.indexBuffer&&n.setIndexBuffer(this.indexBuffer.get(),As.iD.Uint32,0),Object.keys(this.attributeCache).forEach((function(t,r){n.setVertexBuffer(0+r,e.attributeCache[t].get().buffer,0)})),this.indexBuffer?n.drawIndexed(this.indexCount,this.options.instances||1,0,0,0):n.draw(this.options.count||0,this.options.instances||0,0,0)}},{key:"destroy",value:function(){throw new Error("Method not implemented.")}},{key:"compilePipelineStageDescriptor",value:(e=Tr(Sr().mark((function t(e,n,r){var i,o,a;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i="#version 450\n",o=e,a=n,this.engine.options.useWGSL){t.next=10;break}return t.next=6,this.compileShaderToSpirV(e,"vertex",i);case 6:return o=t.sent,t.next=9,this.compileShaderToSpirV(n,"fragment",i);case 9:a=t.sent;case 10:return t.abrupt("return",this.createPipelineStageDescriptor(o,a));case 11:case"end":return t.stop()}}),t,this)}))),function(t,n,r){return e.apply(this,arguments)})},{key:"compileShaderToSpirV",value:function(t,e,n){return this.compileRawShaderToSpirV(n+t,e)}},{key:"compileRawShaderToSpirV",value:function(t,e){return this.engine.glslang.compileGLSL(t,e)}},{key:"createPipelineStageDescriptor",value:function(t,e){return{vertexStage:{module:this.engine.device.createShaderModule({code:t,isWHLSL:Qu}),entryPoint:"main"},fragmentStage:{module:this.engine.device.createShaderModule({code:e,isWHLSL:Qu}),entryPoint:"main"}}}},{key:"getDefaultRasterizationStateDescriptor",value:function(){return{frontFace:As.zX.CCW,cullMode:As.Wf.None,depthBias:0,depthBiasSlopeScale:0,depthBiasClamp:0}}},{key:"buildUniformBindGroup",value:function(t){var e=this,n=0,r=Lf.apply(void 0,[Float32Array].concat(Wc(Object.keys(t).map((function(r){return t[r]?(e.uniformGPUBufferLayout.push({name:r,offset:n}),n+=4*(t[r].length||1),t[r]):[]}))))),i=[],o=!1;r.length&&(o=!0,i.push({binding:0,visibility:As.$X.Fragment|As.$X.Vertex,type:As.$l.UniformBuffer})),Object.keys(t).filter((function(e){return null===t[e]})).forEach((function(t,n){e.uniformGPUBufferLayout.push({name:t,offset:2*n+(o?1:0)}),i.push({binding:2*n+(o?1:0),visibility:As.$X.Fragment,type:As.$l.Sampler},{binding:2*n+(o?1:0)+1,visibility:As.$X.Fragment,type:As.$l.SampledTexture})})),this.uniformsBindGroupLayout=this.engine.device.createBindGroupLayout({entries:i}),this.pipelineLayout=this.engine.device.createPipelineLayout({bindGroupLayouts:[this.uniformsBindGroupLayout]}),o&&(this.uniformBuffer=new xf(this.engine,{data:r instanceof Array?new Float32Array(r):r,usage:As.FB.Uniform|As.FB.CopyDst}))}}]),t}(),jf=function(){function t(e,n){br(this,t),this.engine=e,this.options=n,this.texture=void 0,this.sampler=void 0,this.width=void 0,this.height=void 0,this.createTexture()}return xr(t,[{key:"get",value:function(){return{texture:this.texture,sampler:this.sampler}}},{key:"update",value:function(){}},{key:"resize",value:function(t){var e=t.width,n=t.height;e===this.width&&n===this.height||(this.destroy(),this.createTexture()),this.width=e,this.height=n}},{key:"destroy",value:function(){this.texture&&this.texture.destroy()}},{key:"createTexture",value:function(){var t=this.options,e=(void 0===(t.data,t.type)&&Ri.UNSIGNED_BYTE,t.width),n=t.height,r=(t.flipY,t.format),i=void 0===r?Ri.RGBA:r,o=(t.mipmap,t.wrapS),a=void 0===o?Ri.CLAMP_TO_EDGE:o,u=t.wrapT,s=void 0===u?Ri.CLAMP_TO_EDGE:u,c=t.aniso,f=void 0===c?0:c,l=(t.alignment,t.premultiplyAlpha,t.mag),h=void 0===l?Ri.NEAREST:l,d=t.min,p=void 0===d?Ri.NEAREST:d,v=(void 0===t.colorSpace&&Ri.BROWSER_DEFAULT_WEBGL,t.usage);this.width=e,this.height=n,this.texture=this.engine.device.createTexture({size:[e,n,1],mipLevelCount:1,sampleCount:1,dimension:As.kd.E2d,format:Df[i],usage:v||As.v2.Sampled|As.v2.CopyDst}),(!v||v&As.v2.Sampled)&&(this.sampler=this.engine.device.createSampler({addressModeU:kf[a],addressModeV:kf[s],addressModeW:kf[a],magFilter:Nf[h],minFilter:Nf[p],maxAnisotropy:f}))}}]),t}(),Wf=(0,Mr.b2)()((Ff=function(){function t(){var e=this;br(this,t),this.supportWebGPU=!0,this.useWGSL=!1,this.options=void 0,this.canvas=void 0,this.context=void 0,this.glslang=void 0,this.adapter=void 0,this.device=void 0,this.swapChain=void 0,this.mainPassSampleCount=void 0,this.mainTexture=void 0,this.depthTexture=void 0,this.mainColorAttachments=void 0,this.mainTextureExtends=void 0,this.mainDepthAttachment=void 0,this.uploadEncoder=void 0,this.renderEncoder=void 0,this.computeEncoder=void 0,this.renderTargetEncoder=void 0,this.commandBuffers=new Array(4).fill(void 0),this.currentRenderPass=null,this.mainRenderPass=null,this.currentRenderTargetViewDescriptor=void 0,this.currentComputePass=null,this.bundleEncoder=void 0,this.tempBuffers=[],this.currentRenderTarget=null,this.uploadEncoderDescriptor={label:"upload"},this.renderEncoderDescriptor={label:"render"},this.renderTargetEncoderDescriptor={label:"renderTarget"},this.computeEncoderDescriptor={label:"compute"},this.pipelines={},this.computePipelines={},this.defaultSampleCount=4,this.clearDepthValue=1,this.clearStencilValue=0,this.transientViewport={x:1/0,y:0,width:0,height:0},this.cachedViewport={x:0,y:0,width:0,height:0},this.clear=function(t){t.framebuffer;var n=t.color,r=t.depth,i=t.stencil;e.options.supportCompute&&e.startComputePass(),e.currentRenderTarget?(e.currentRenderPass&&e.endRenderTargetRenderPass(),e.startRenderTargetRenderPass(e.currentRenderTarget,n||null,!!r,!!i)):(e.mainColorAttachments[0].loadValue=n||As.Ws.Load,e.mainDepthAttachment.depthLoadValue=r||As.Ws.Load,e.mainDepthAttachment.stencilLoadValue=i?e.clearStencilValue:As.Ws.Load,e.mainRenderPass&&e.endMainRenderPass(),e.startMainRenderPass())},this.createModel=function(){var t=Tr(Sr().mark((function t(n){var r;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new zf(e,n),t.next=3,r.init();case 3:return t.abrupt("return",r);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.createAttribute=function(t){return new _f(e,t)},this.createBuffer=function(t){return new xf(e,t)},this.createElements=function(t){return new Ef(e,t)},this.createTexture2D=function(t){return new jf(e,t)},this.createFramebuffer=function(t){return new Sf(e,t)},this.useFramebuffer=function(t,n){e.currentRenderTarget&&e.unbindFramebuffer(e.currentRenderTarget),e.currentRenderTarget=t,e.currentRenderTargetViewDescriptor={dimension:As.p_.E2d,arrayLayerCount:1,aspect:As.H7.All},e.currentRenderPass=null,n()},this.createComputeModel=function(){var t=Tr(Sr().mark((function t(n){var r;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new wf(e,n),t.next=3,r.init();case 3:return t.abrupt("return",r);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.getCanvas=function(){return e.canvas},this.getGLContext=function(){throw new Error("Method not implemented.")},this.viewport=function(t){var n=t.x,r=t.y,i=t.width,o=t.height;e.currentRenderPass?e.transientViewport.x!==1/0?e.getCurrentRenderPass().setViewport(e.transientViewport.x,e.transientViewport.y,e.transientViewport.width,e.transientViewport.height,0,1):n===e.cachedViewport.x&&r===e.cachedViewport.y&&i===e.cachedViewport.width&&o===e.cachedViewport.height||(e.cachedViewport={x:n,y:r,width:i,height:o},e.getCurrentRenderPass().setViewport(n,r,i,o,0,1)):e.transientViewport={x:n,y:r,width:i,height:o}},this.readPixels=function(t){throw new Error("Method not implemented.")}}var e,n;return xr(t,[{key:"isFloatSupported",value:function(){return!0}},{key:"init",value:(n=Tr(Sr().mark((function t(e){return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.canvas=e.canvas,this.options=e,this.useWGSL=!!e.useWGSL,this.mainPassSampleCount=e.antialiasing?this.defaultSampleCount:1,t.next=6,this.initGlslang();case 6:this.initContextAndSwapChain(),this.initMainAttachments();case 8:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"setScissor",value:function(t){throw new Error("Method not implemented.")}},{key:"destroy",value:function(){this.mainTexture&&this.mainTexture.destroy(),this.depthTexture&&this.depthTexture.destroy(),this.tempBuffers.forEach((function(t){return t.destroy()})),this.tempBuffers=[]}},{key:"beginFrame",value:function(){this.uploadEncoder=this.device.createCommandEncoder(this.uploadEncoderDescriptor),this.renderEncoder=this.device.createCommandEncoder(this.renderEncoderDescriptor),this.renderTargetEncoder=this.device.createCommandEncoder(this.renderTargetEncoderDescriptor),this.options.supportCompute&&(this.computeEncoder=this.device.createCommandEncoder(this.computeEncoderDescriptor))}},{key:"endFrame",value:function(){this.options.supportCompute&&this.endComputePass(),this.endMainRenderPass(),this.commandBuffers[0]=this.uploadEncoder.finish(),this.commandBuffers[1]=this.renderEncoder.finish(),this.options.supportCompute&&(this.commandBuffers[2]=this.computeEncoder.finish()),this.commandBuffers[3]=this.renderTargetEncoder.finish(),Qu?this.device.getQueue().submit(this.commandBuffers.filter((function(t){return t}))):this.device.defaultQueue.submit(this.commandBuffers.filter((function(t){return t})))}},{key:"getCurrentRenderPass",value:function(){return this.currentRenderTarget&&!this.currentRenderPass?this.startRenderTargetRenderPass(this.currentRenderTarget,null,!1,!1):this.currentRenderPass||this.startMainRenderPass(),this.currentRenderPass}},{key:"initGlslang",value:(e=Tr(Sr().mark((function t(){var e,n;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,lf();case 2:return this.glslang=t.sent,t.next=5,null===(e=navigator)||void 0===e||null===(n=e.gpu)||void 0===n?void 0:n.requestAdapter();case 5:return this.adapter=t.sent,t.next=8,this.adapter.requestDevice();case 8:this.device=t.sent;case 9:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"initContextAndSwapChain",value:function(){this.context=this.canvas.getContext(Qu?"gpu":"gpupresent"),this.swapChain=this.context.configureSwapChain({device:this.device,format:this.options.swapChainFormat,usage:As.v2.OutputAttachment|As.v2.CopySrc})}},{key:"initMainAttachments",value:function(){if(this.mainTextureExtends={width:this.canvas.width,height:this.canvas.height,depth:1},this.options.antialiasing){var t={size:this.mainTextureExtends,mipLevelCount:1,sampleCount:this.mainPassSampleCount,dimension:As.kd.E2d,format:As.EV.BGRA8Unorm,usage:As.v2.OutputAttachment};this.mainTexture&&this.mainTexture.destroy(),this.mainTexture=this.device.createTexture(t),this.mainColorAttachments=[{attachment:Qu?this.mainTexture.createDefaultView():this.mainTexture.createView(),loadValue:[0,0,0,1],storeOp:As.EG.Store}]}else this.mainColorAttachments=[{attachment:Qu?this.swapChain.getCurrentTexture().createDefaultView():this.swapChain.getCurrentTexture().createView(),loadValue:[0,0,0,1],storeOp:As.EG.Store}];var e={size:this.mainTextureExtends,mipLevelCount:1,sampleCount:this.mainPassSampleCount,dimension:As.kd.E2d,format:Qu?"depth32float-stencil8":As.EV.Depth24PlusStencil8,usage:As.v2.OutputAttachment};this.depthTexture&&this.depthTexture.destroy(),this.depthTexture=this.device.createTexture(e),this.mainDepthAttachment={attachment:Qu?this.depthTexture.createDefaultView():this.depthTexture.createView(),depthLoadValue:this.clearDepthValue,depthStoreOp:As.EG.Store,stencilLoadValue:this.clearStencilValue,stencilStoreOp:As.EG.Store}}},{key:"startComputePass",value:function(){this.currentComputePass&&this.endComputePass(),this.currentComputePass=this.computeEncoder.beginComputePass()}},{key:"startMainRenderPass",value:function(){this.currentRenderPass&&!this.currentRenderTarget&&this.endMainRenderPass(),this.options.antialiasing?this.mainColorAttachments[0].resolveTarget=Qu?this.swapChain.getCurrentTexture().createDefaultView():this.swapChain.getCurrentTexture().createView():this.mainColorAttachments[0].attachment=Qu?this.swapChain.getCurrentTexture().createDefaultView():this.swapChain.getCurrentTexture().createView(),this.currentRenderPass=this.renderEncoder.beginRenderPass({colorAttachments:this.mainColorAttachments,depthStencilAttachment:this.mainDepthAttachment}),this.mainRenderPass=this.currentRenderPass,this.cachedViewport&&this.viewport(this.cachedViewport)}},{key:"startRenderTargetRenderPass",value:function(t,e,n){var r,i,o,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],u=null===(r=t.get().color)||void 0===r?void 0:r.texture;u&&(o=u.createView(this.currentRenderTargetViewDescriptor));var s,c=null===(i=t.get().depth)||void 0===i?void 0:i.texture;c&&(s=c.createView());var f=this.renderTargetEncoder.beginRenderPass({colorAttachments:[{attachment:o,loadValue:null!==e?e:As.Ws.Load,storeOp:As.EG.Store}],depthStencilAttachment:c&&s?{attachment:s,depthLoadValue:n?this.clearDepthValue:As.Ws.Load,depthStoreOp:As.EG.Store,stencilLoadValue:a?this.clearStencilValue:As.Ws.Load,stencilStoreOp:As.EG.Store}:void 0});this.currentRenderPass=f,this.cachedViewport&&this.viewport(this.cachedViewport)}},{key:"endMainRenderPass",value:function(){this.currentRenderPass===this.mainRenderPass&&null!==this.currentRenderPass&&(this.currentRenderPass.endPass(),this.resetCachedViewport(),this.currentRenderPass=null,this.mainRenderPass=null)}},{key:"endComputePass",value:function(){this.currentComputePass&&(this.currentComputePass.endPass(),this.currentComputePass=null)}},{key:"endRenderTargetRenderPass",value:function(){this.currentRenderPass&&(this.currentRenderPass.endPass(),this.resetCachedViewport())}},{key:"resetCachedViewport",value:function(){this.cachedViewport={x:0,y:0,width:0,height:0}}},{key:"unbindFramebuffer",value:function(t){this.currentRenderPass&&this.currentRenderPass!==this.mainRenderPass&&this.endRenderTargetRenderPass(),this.transientViewport.x=1/0,this.currentRenderTarget=null,this.currentRenderPass=this.mainRenderPass}}]),t}(),Uf=Ff))||Uf;var Vf,Xf=4/64,Hf=(0,Mr.b2)()(Bf=function(t){Br(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vr(e);if(n){var i=Vr(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wr(this,t)});function i(){return br(this,i),r.apply(this,arguments)}return xr(i,[{key:"onEntityCreated",value:function(){var t=this.config,e=t.widthSegments,n=void 0===e?1:e,r=t.heightSegments,i=void 0===r?1:r,o=t.depthSegments,a=void 0===o?1:o,u=t.halfExtents,s=n,c=i,f=a,l=Or(void 0===u?hi(.5,.5,.5):u,3),h=l[0],d=l[1],p=l[2],v=[hi(-h,-d,p),hi(h,-d,p),hi(h,d,p),hi(-h,d,p),hi(h,-d,-p),hi(-h,-d,-p),hi(-h,d,-p),hi(h,d,-p)],g=[[0,1,3],[4,5,7],[3,2,6],[1,0,4],[1,4,2],[5,0,6]],y=[[0,0,1],[0,0,-1],[0,1,0],[0,-1,0],[1,0,0],[-1,0,0]],m=[],b=[],_=[],x=[],w=[],E=0,S=function(t,e,n){var r,i,o,a;for(o=0;o<=e;o++)for(a=0;a<=n;a++){var u=ci(),s=ci(),c=ci(),f=ci();_i(u,v[g[t][0]],v[g[t][1]],o/e),_i(s,v[g[t][0]],v[g[t][2]],a/n),Ei(c,s,v[g[t][0]]),vi(f,u,c),r=o/e,i=a/n,m.push(f[0],f[1],f[2]),b.push(y[t][0],y[t][1],y[t][2]),_.push(r,i),r=.875*(r/=3)+Xf,i=.875*(i/=3)+Xf,r+=t%3/3,i+=Math.floor(t/3)/3,x.push(r,i),o<e&&a<n&&(w.push(E+n+1,E+1,E),w.push(E+n+1,E+n+2,E+1)),E++}};S(0,s,c),S(1,s,c),S(2,s,f),S(3,s,f),S(4,f,c),S(5,f,c);var A=qu(m),T=this.getComponent();T.indices=Uint32Array.from(w),T.aabb=A,T.vertexCount=E,T.attributes=[{dirty:!0,name:"position",data:Float32Array.from(m),arrayStride:12,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float3"}]},{dirty:!0,name:"normal",data:Float32Array.from(b),arrayStride:12,stepMode:"vertex",attributes:[{shaderLocation:1,offset:0,format:"float3"}]},{dirty:!0,name:"uv",data:Float32Array.from(_),arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:2,offset:0,format:"float2"}]}]}}]),i}(Ss))||Bf;var qf,Yf=(0,Mr.b2)()(Vf=function(t){Br(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vr(e);if(n){var i=Vr(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wr(this,t)});function i(){return br(this,i),r.apply(this,arguments)}return xr(i,[{key:"onEntityCreated",value:function(){var t=this.config.geometries,e=void 0===t?[]:t,n=this.getComponent();n.aabb=new uo;var r=[],i=[],o=0;e.forEach((function(t){var e=t.aabb,a=t.indices,u=t.vertexCount,s=t.attributes;n.aabb.add(e),n.vertexCount+=u,a&&i.push.apply(i,Wc(a.map((function(t){return t+o})))),o+=u,s.forEach((function(t,e){r[e]?t.data&&(ts(t.data)?r[e].push(t.data):Us(t.data)?r[e].data=function(t,e){if(!t&&!e)throw new Error("Please specify valid arguments for parameters a and b.");if(!e||0===e.length)return t;if(!t||0===t.length)return e;if(Object.prototype.toString.call(t)!==Object.prototype.toString.call(e))throw new Error("The types of the two arguments passed for parameters a and b do not match.");var n=new t.constructor(t.length+e.length);return n.set(t),n.set(e,t.length),n}(r[e].data,t.data):r[e].data=r[e].data.concat(t.data)):(r[e]=t,r[e].dirty=!0)}))})),n.attributes=r,n.indices=Uint32Array.from(i),n.dirty=!0}}]),i}(Ss))||Vf;var Kf,Zf=(0,Mr.b2)()(qf=function(t){Br(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vr(e);if(n){var i=Vr(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wr(this,t)});function i(){return br(this,i),r.apply(this,arguments)}return xr(i,[{key:"onEntityCreated",value:function(){for(var t=this.config,e=t.halfExtents,n=void 0===e?[.5,.5]:e,r=t.widthSegments,i=void 0===r?5:r,o=t.lengthSegments,a=void 0===o?5:o,u=[],s=[],c=[],f=[],l=0,h=0;h<=i;h++)for(var d=0;d<=a;d++){var p=-n[0]+2*n[0]*h/i,v=-(-n[1]+2*n[1]*d/a),g=h/i,y=d/a;u.push(p,0,v),s.push(0,1,0),c.push(g,y),h<i&&d<a&&(f.push(l+a+1,l+1,l),f.push(l+a+1,l+a+2,l+1)),l++}var m=qu(u),b=this.getComponent();b.indices=Uint32Array.from(f),b.aabb=m,b.vertexCount=l,b.attributes=[{dirty:!0,name:"position",data:Float32Array.from(u),arrayStride:12,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float3"}]},{dirty:!0,name:"normal",data:Float32Array.from(s),arrayStride:12,stepMode:"vertex",attributes:[{shaderLocation:1,offset:0,format:"float3"}]},{dirty:!0,name:"uv",data:Float32Array.from(c),arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:2,offset:0,format:"float2"}]}]}}]),i}(Ss))||qf;var $f,Jf,Qf,tl,el,nl,rl,il,ol=(0,Mr.b2)()(Kf=function(t){Br(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vr(e);if(n){var i=Vr(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wr(this,t)});function i(){return br(this,i),r.apply(this,arguments)}return xr(i,[{key:"onEntityCreated",value:function(){for(var t=this.config,e=t.radius,n=void 0===e?.5:e,r=t.latitudeBands,i=void 0===r?16:r,o=t.longitudeBands,a=void 0===o?16:o,u=[],s=[],c=[],f=[],l=0;l<=i;l++)for(var h=l*Math.PI/i,d=Math.sin(h),p=Math.cos(h),v=0;v<=a;v++){var g=2*v*Math.PI/a-Math.PI/2,y=Math.sin(g),m=Math.cos(g)*d,b=p,_=y*d,x=1-v/a,w=1-l/i;u.push(m*n,b*n,_*n),s.push(m,b,_),c.push(x,w)}for(var E=0;E<i;++E)for(var S=0;S<a;++S){var A=E*(a+1)+S,T=A+a+1;f.push(A+1,T,A),f.push(A+1,T+1,T)}var I=qu(u),C=this.getComponent();C.indices=Uint32Array.from(f),C.aabb=I,C.vertexCount=u.length/3,C.attributes=[{dirty:!0,name:"position",data:Float32Array.from(u),arrayStride:12,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float3"}]},{dirty:!0,name:"normal",data:Float32Array.from(s),arrayStride:12,stepMode:"vertex",attributes:[{shaderLocation:1,offset:0,format:"float3"}]},{dirty:!0,name:"uv",data:Float32Array.from(c),arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:2,offset:0,format:"float2"}]}]}}]),i}(Ss))||Kf;var al,ul,sl,cl,fl,ll,hl,dl,pl,vl,gl,yl,ml=($f=(0,Mr.b2)(),Jf=(0,Mr.f3)(Pr.RenderEngine),Qf=(0,Mr.f3)(Pr.ShaderModuleService),$f((il=function(t){Br(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vr(e);if(n){var i=Vr(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wr(this,t)});function i(){var t;br(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return mr(t=r.call.apply(r,[this].concat(n)),"engine",nl,jr(t)),mr(t,"shaderModuleService",rl,jr(t)),t}return xr(i,[{key:"onEntityCreated",value:function(){var t=this.getComponent(),e=this.engine.supportWebGPU?"layout(set = 0, binding = 0) uniform Uniforms {\n vec4 color;\n mat4 projectionMatrix;\n mat4 modelViewMatrix;\n} uniforms;\n\nlayout(location = 0) in vec3 position;\n// layout(location = 1) in vec3 barycentric;\n\nlayout(location = 0) out vec4 fragColor;\n// layout(location = 1) out vec3 v_Barycentric;\n\nvoid main() {\n gl_Position = uniforms.projectionMatrix * uniforms.modelViewMatrix * vec4(position, 1.0);\n fragColor = uniforms.color;\n // v_Barycentric = barycentric;\n}":'attribute vec3 position;\nattribute vec3 normal;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform vec4 color;\n\nvarying vec4 fragColor;\n\n#pragma include "uv.vert.declaration"\n\nvoid main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n fragColor = color;\n\n #pragma include "uv.vert.main"\n}',n=this.engine.supportWebGPU?"// layout(set = 0, binding = 1) uniform WireframeUniforms {\n// float lineWidth;\n// vec4 lineColor;\n// } wireframe;\n\nlayout(location = 0) in vec4 fragColor;\n// layout(location = 1) in vec3 v_Barycentric;\n\nlayout(location = 0) out vec4 outColor;\n\n// wireframe\n// float edgeFactor() {\n// vec3 d = fwidth(v_Barycentric);\n// vec3 a3 = smoothstep(vec3(0.0), d * wireframe.lineWidth, v_Barycentric);\n// return min(min(a3.x, a3.y), a3.z);\n// }\n\nvoid main() {\n // outColor = mix(fragColor, wireframe.lineColor, (1.0 - edgeFactor()));\n outColor = fragColor;\n}":'varying vec4 fragColor;\n\n#pragma include "uv.frag.declaration"\n#pragma include "map.frag.declaration"\n\nvoid main() {\n vec4 diffuseColor = fragColor;\n\n #pragma include "map.frag.main"\n\n gl_FragColor = diffuseColor;\n}';this.shaderModuleService.registerModule("material-basic",{vs:e,fs:n});var r=this.shaderModuleService.getModule("material-basic"),i=r.vs,o=r.fs,a=r.uniforms;t.vertexShaderGLSL=i,t.fragmentShaderGLSL=o,t.setUniform(a),this.config.map&&(t.setDefines({USE_UV:1,USE_MAP:1}),t.setUniform({map:this.config.map,uvTransform:si()}))}}]),i}(Ec),nl=wr((el=il).prototype,"engine",[Jf],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),rl=wr(el.prototype,"shaderModuleService",[Qf],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),tl=el))||tl);var bl,_l,xl,wl,El,Sl,Al,Tl,Il,Cl,Dl,Nl,kl=(al=(0,Mr.b2)(),ul=(0,Mr.f3)(Pr.Systems),sl=(0,Mr.t6)(Pr.MaterialSystem),cl=(0,Mr.f3)(Pr.Systems),fl=(0,Mr.t6)(Pr.GeometrySystem),ll=(0,Mr.f3)(Pr.ShaderModuleService),al((yl=function(t){Br(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vr(e);if(n){var i=Vr(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wr(this,t)});function i(){var t;br(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return mr(t=r.call.apply(r,[this].concat(n)),"materialSystem",pl,jr(t)),mr(t,"geometrySystem",vl,jr(t)),mr(t,"shaderModuleService",gl,jr(t)),t}return xr(i,[{key:"onAttributeChanged",value:function(t){var e=t.name,n=t.data,r=this.getMeshComponent();r&&r.material&&("gridColor"===e?(r.material.setUniform("u_GridColor",n),r.material.setUniform("u_GridColor2",n)):"gridSize"===e&&(r.material.setUniform("u_GridSize",n),r.material.setUniform("u_GridSize2",n)))}},{key:"onEntityCreated",value:function(){this.shaderModuleService.registerModule("grid",{vs:"attribute vec3 a_Position;\n\nvarying vec3 v_Position;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\n\nvoid main() {\n v_Position = a_Position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(a_Position, 1.);\n}",fs:"// generate grid, borrow from clay.gl viewer\n// @see https://github.com/pissang/clay-viewer/blob/master/src/graphic/ground.glsl\n#extension GL_OES_standard_derivatives : enable\n\nvarying vec3 v_Position;\n// varying vec3 v_Normal;\n\nuniform float u_GridSize : 5;\nuniform float u_GridSize2 : .5;\nuniform vec4 u_GridColor : [0, 0, 0, 1];\nuniform vec4 u_GridColor2 : [0.3, 0.3, 0.3, 1];\nuniform bool u_GridEnabled : true;\n\n// uniform vec3 u_LightDirection;\n// uniform vec3 u_LightColor;\n// uniform vec3 u_Camera;\n\nvoid main() {\n // vec3 n = v_Normal;\n // vec3 l = normalize(u_LightDirection);\n // float NdotL = clamp(dot(n, l), 0.001, 1.0);\n\n gl_FragColor = vec4(1.);\n\n if (u_GridEnabled) {\n float wx = v_Position.x;\n float wz = v_Position.z;\n // float x0 = abs(fract(wx / u_GridSize - 0.5) - 0.5) / fwidth(wx) * u_GridSize / 2.0;\n // float z0 = abs(fract(wz / u_GridSize - 0.5) - 0.5) / fwidth(wz) * u_GridSize / 2.0;\n\n float x1 = abs(fract(wx / u_GridSize2 - 0.5) - 0.5) / fwidth(wx) * u_GridSize2;\n float z1 = abs(fract(wz / u_GridSize2 - 0.5) - 0.5) / fwidth(wz) * u_GridSize2;\n\n // float v0 = 1.0 - clamp(min(x0, z0), 0.0, 1.0);\n float v1 = 1.0 - clamp(min(x1, z1), 0.0, 1.0);\n // if (v0 > 0.1) {\n // gl_FragColor = mix(gl_FragColor, u_GridColor, v0);\n // }\n // else {\n gl_FragColor = mix(gl_FragColor, u_GridColor2, v1);\n // }\n }\n\n // float shadowFactor = calcShadow(u_ShadowMap, v_PositionFromLight, l, n);\n // vec3 diffuseColor = u_LightColor * NdotL * shadowFactor;\n\n // gl_FragColor.rgb *= diffuseColor;\n}"});var t=this.shaderModuleService.getModule("grid"),e=t.vs,n=t.fs,r=t.uniforms,i=this.materialSystem.createShaderMaterial({vertexShader:e,fragmentShader:n});this.setMaterial(i);var o=this.geometrySystem.createBufferGeometry({vertexCount:4});this.setGeometry(o),i.setCull({enable:!1,face:Ri.BACK}).setDepth({enable:!0,func:Ri.LESS}),i.setUniform(r),this.setAttributes({gridColor:this.config.gridColor,gridSize:this.config.gridSize}),o.setIndex([0,3,2,2,1,0]),o.setAttribute("a_Position",Float32Array.from([-4,-1,-4,4,-1,-4,4,-1,4,-4,-1,4]),{arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float2"}]})}}]),i}(Sc),pl=wr((dl=yl).prototype,"materialSystem",[ul,sl],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),vl=wr(dl.prototype,"geometrySystem",[cl,fl],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),gl=wr(dl.prototype,"shaderModuleService",[ll],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),hl=dl))||hl),Rl=n(7801),Ol=n(1739);function Ml(t,e,n,r,i){Pl(e,r,-i),Pl(e,r,i),t.push(n),t.push(n)}function Pl(t,e,n){t.push([[e[0],e[1]],n])}var Gl,Ll,Ul,Fl,Bl,zl,jl,Wl,Vl,Xl,Hl,ql,Yl=(bl=(0,Mr.b2)(),_l=(0,Mr.f3)(Pr.Systems),xl=(0,Mr.t6)(Pr.MaterialSystem),wl=(0,Mr.f3)(Pr.Systems),El=(0,Mr.t6)(Pr.GeometrySystem),Sl=(0,Mr.f3)(Pr.ShaderModuleService),bl((Nl=function(t){Br(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vr(e);if(n){var i=Vr(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wr(this,t)});function i(){var t;br(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return mr(t=r.call.apply(r,[this].concat(n)),"materialSystem",Il,jr(t)),mr(t,"geometrySystem",Cl,jr(t)),mr(t,"shaderModuleService",Dl,jr(t)),t.vertexCount=void 0,t}return xr(i,[{key:"onAttributeChanged",value:function(t){var e=t.name,n=t.data,r=this.getMeshComponent();if(r&&r.material)switch(e){case"dashArray":r.material.setUniform("u_dash_array",n);break;case"dashOffset":r.material.setUniform("u_dash_offset",n);break;case"dashRatio":r.material.setUniform("u_dash_ratio",n);break;case"thickness":r.material.setUniform("u_thickness",n);break;case"color":var i=new Array(this.vertexCount).fill(void 0).map((function(){return n})).reduce((function(t,e){return[].concat(Wc(t),Wc(e))}),[]);r.geometry.setAttribute("a_color",Float32Array.from(i),{arrayStride:16,stepMode:"vertex",attributes:[{shaderLocation:1,offset:0,format:"float4"}]})}}},{key:"onEntityCreated",value:function(){var t=this;this.shaderModuleService.registerModule("line",{vs:"attribute vec2 a_pos;\nattribute vec4 a_color;\nattribute float a_line_miter;\nattribute vec2 a_line_normal;\nattribute float a_counters;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform float u_thickness : 0.02;\nuniform vec2 u_viewport;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_counters;\n\nvoid main() {\n v_color = a_color;\n v_counters = a_counters;\n\n vec3 normal = normalize(vec3(a_line_normal, 0.0));\n\n vec4 offset = vec4(normal * u_thickness / 2.0 * a_line_miter, 0.0);\n\n v_normal = vec2(normal * sign(a_line_miter));\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4(a_pos, 0.0, 1.0) + offset;\n}\n",fs:"uniform float u_dash_array : 0.02;\nuniform float u_dash_offset : 0;\nuniform float u_dash_ratio : 0;\nuniform float u_thickness : 0.02;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_counters;\n\nvoid main() {\n float blur = 1. - smoothstep(0.98, 1., length(v_normal));\n\n gl_FragColor = v_color;\n gl_FragColor.a *= blur * ceil(mod(v_counters + u_dash_offset, u_dash_array) - (u_dash_array * u_dash_ratio));\n}"});var e=this.shaderModuleService.getModule("line"),n=e.vs,r=e.fs,i=e.uniforms,o=this.materialSystem.createShaderMaterial({vertexShader:n,fragmentShader:r}),a=function(t,e,n){for(var r=[0,0],i=[0,0],o=[0,0],a=[0,0],u=-1,s=!1,c=null,f=(0,Rl.create)(),l=0,h=[],d=[],p=[],v=[0,0],g=t.length,y=1;y<g;y++){var m=l,b=t[y-1],_=t[y],x=y<t.length-1?t[y+1]:null;if(v.push(y/g,y/g),(0,Ol.o7)(r,_,b),c||(c=[0,0],(0,Ol.mJ)(c,r)),s||(s=!0,Ml(d,h,b,c,1)),p.push([m+0,m+1,m+2]),x){(0,Ol.o7)(i,x,_);var w=(0,Ol.x7)(o,a,r,i,1),E=(0,Rl.dot)(o,c)<0?-1:1,S=w>3;if(!isFinite(w)){(0,Ol.mJ)(c,r),Ml(d,h,_,c,1),p.push(1===u?[m,m+2,m+3]:[m+2,m+1,m+3]),l+=2,u=E;continue}S?(w=3,v.push(y/g),Pl(h,c,-E),d.push(_),Pl(h,a,w*E),d.push(_),p.push(u!==-E?[m,m+2,m+3]:[m+2,m+1,m+3]),p.push([m+2,m+3,m+4]),(0,Ol.mJ)(f,i),(0,Rl.copy)(c,f),Pl(h,c,-E),d.push(_),l+=3):(Ml(d,h,_,a,w),p.push(1===u?[m,m+2,m+3]:[m+2,m+1,m+3]),E=-1,(0,Rl.copy)(c,a),l+=2),u=E}else(0,Ol.mJ)(c,r),Ml(d,h,_,c,1),p.push(1===u?[m,m+2,m+3]:[m+2,m+1,m+3]),l+=2}return{normals:h,attrIndex:p,attrPos:d,attrCounters:v}}(this.config.points),u=a.normals,s=a.attrIndex,c=a.attrPos,f=a.attrCounters,l=c.length;this.vertexCount=l;var h=this.geometrySystem.createBufferGeometry({vertexCount:l});this.setMaterial(o),this.setGeometry(h),o.setCull({enable:!1,face:Ri.BACK}).setUniform(i),this.setAttributes({dashArray:this.config.dashArray,dashOffset:this.config.dashOffset,dashRatio:this.config.dashRatio,thickness:this.config.thickness});var d=[],p=[];u.forEach((function(t){var e=t[0],n=t[1];d.push([e[0],e[1]]),p.push(n)})),h.setIndex(s.reduce((function(t,e){return[].concat(Wc(t),Wc(e))}),[])),h.setAttribute("a_pos",Float32Array.from(c.reduce((function(t,e){return[].concat(Wc(t),Wc(e))}),[])),{arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float2"}]});var v=new Array(l).fill(void 0).map((function(){return Wc(t.config.color)})).reduce((function(t,e){return[].concat(Wc(t),Wc(e))}),[]);h.setAttribute("a_color",Float32Array.from(v),{arrayStride:16,stepMode:"vertex",attributes:[{shaderLocation:1,offset:0,format:"float4"}]}),h.setAttribute("a_line_miter",Float32Array.from(p),{arrayStride:4,stepMode:"vertex",attributes:[{shaderLocation:2,offset:0,format:"float"}]}),h.setAttribute("a_line_normal",Float32Array.from(d.reduce((function(t,e){return[].concat(Wc(t),Wc(e))}),[])),{arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:3,offset:0,format:"float2"}]}),h.setAttribute("a_counters",Float32Array.from(f),{arrayStride:4,stepMode:"vertex",attributes:[{shaderLocation:4,offset:0,format:"float"}]})}}]),i}(Sc),Il=wr((Tl=Nl).prototype,"materialSystem",[_l,xl],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Cl=wr(Tl.prototype,"geometrySystem",[wl,El],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Dl=wr(Tl.prototype,"shaderModuleService",[Sl],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Al=Tl))||Al);function Kl(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}var Zl,$l,Jl,Ql,th,eh,nh,rh,ih,oh,ah=["circle","triangle","square","pentagon","hexagon","octogon","hexagram","rhombus","vesica"],uh=(Gl=(0,Mr.b2)(),Ll=(0,Mr.f3)(Pr.Systems),Ul=(0,Mr.t6)(Pr.MaterialSystem),Fl=(0,Mr.f3)(Pr.Systems),Bl=(0,Mr.t6)(Pr.GeometrySystem),zl=(0,Mr.f3)(Pr.ShaderModuleService),Gl((ql=function(t){Br(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vr(e);if(n){var i=Vr(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wr(this,t)});function i(){var t;br(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return mr(t=r.call.apply(r,[this].concat(n)),"materialSystem",Vl,jr(t)),mr(t,"geometrySystem",Xl,jr(t)),mr(t,"shaderModuleService",Hl,jr(t)),t}return xr(i,[{key:"onAttributeChanged",value:function(t){var e=t.name,n=t.data,r=this.getMeshComponent();r&&r.material&&("strokeWidth"===e?r.material.setUniform("u_stroke_width",n):"strokeColor"===e?r.material.setUniform("u_stroke_color",n):"strokeOpacity"===e?r.material.setUniform("u_stroke_opacity",n):"opacity"===e?r.material.setUniform("u_opacity",n):"blur"===e&&r.material.setUniform("u_blur",n))}},{key:"onEntityCreated",value:function(){this.shaderModuleService.registerModule("grid",{vs:'attribute vec2 position;\nattribute vec4 color;\nattribute float shape;\nattribute vec2 offset;\nattribute float size;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\n\nuniform float u_stroke_width : 0.01;\nuniform float u_device_pixel_ratio;\nuniform vec2 u_viewport;\n\nvarying vec4 v_color;\nvarying vec4 v_data;\nvarying float v_radius;\n\n#pragma include "picking"\n\nvoid main() {\n v_color = color;\n v_radius = size;\n\n lowp float antialiasblur = 1.0 / u_device_pixel_ratio * (size + u_stroke_width);\n\n // construct point coords\n v_data = vec4(position, antialiasblur, shape);\n\n gl_Position = projectionMatrix * modelViewMatrix\n * vec4(position * size + offset, 0.0, 1.0);\n\n setPickingColor(a_PickingColor);\n}',fs:"uniform float u_blur : 0.05;\nuniform float u_opacity : 0.7;\nuniform float u_stroke_width : 0.01;\nuniform vec4 u_stroke_color : [0, 0, 0, 0];\nuniform float u_stroke_opacity : 1;\n\nvarying vec4 v_color;\nvarying vec4 v_data;\nvarying float v_radius;\n\n#pragma include \"sdf2d\"\n#pragma include \"picking\"\n\nvoid main() {\n int shape = int(floor(v_data.w + 0.5));\n\n float antialiasblur = v_data.z;\n float antialiased_blur = -max(u_blur, antialiasblur);\n float r = v_radius / (v_radius + u_stroke_width);\n\n float outer_df;\n float inner_df;\n // 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'\n // if (shape == 0) {\n outer_df = sdCircle(v_data.xy, 1.0);\n inner_df = sdCircle(v_data.xy, r);\n // } else if (shape == 1) {\n // outer_df = sdEquilateralTriangle(1.1 * v_data.xy);\n // inner_df = sdEquilateralTriangle(1.1 / r * v_data.xy);\n // } else if (shape == 2) {\n // outer_df = sdBox(v_data.xy, vec2(1.));\n // inner_df = sdBox(v_data.xy, vec2(r));\n // } else if (shape == 3) {\n // outer_df = sdPentagon(v_data.xy, 0.8);\n // inner_df = sdPentagon(v_data.xy, r * 0.8);\n // } else if (shape == 4) {\n // outer_df = sdHexagon(v_data.xy, 0.8);\n // inner_df = sdHexagon(v_data.xy, r * 0.8);\n // } else if (shape == 5) {\n // outer_df = sdOctogon(v_data.xy, 1.0);\n // inner_df = sdOctogon(v_data.xy, r);\n // } else if (shape == 6) {\n // outer_df = sdHexagram(v_data.xy, 0.52);\n // inner_df = sdHexagram(v_data.xy, r * 0.52);\n // } else if (shape == 7) {\n // outer_df = sdRhombus(v_data.xy, vec2(1.0));\n // inner_df = sdRhombus(v_data.xy, vec2(r));\n // } else if (shape == 8) {\n // outer_df = sdVesica(v_data.xy, 1.1, 0.8);\n // inner_df = sdVesica(v_data.xy, r * 1.1, r * 0.8);\n // }\n\n float opacity_t = smoothstep(0.0, antialiased_blur, outer_df);\n\n float color_t = u_stroke_width < 0.01 ? 0.0 : smoothstep(\n antialiased_blur,\n 0.0,\n inner_df\n );\n vec4 strokeColor = u_stroke_color == vec4(0) ? v_color : u_stroke_color;\n\n gl_FragColor = mix(vec4(v_color.rgb, v_color.a * u_opacity), strokeColor * u_stroke_opacity, color_t);\n gl_FragColor.a = gl_FragColor.a * opacity_t;\n\n gl_FragColor = filterColor(gl_FragColor);\n}"});var t=this.shaderModuleService.getModule("grid"),e=t.vs,n=t.fs,r=t.uniforms,i=this.materialSystem.createShaderMaterial({vertexShader:e,fragmentShader:n,cull:{enable:!1},depth:{enable:!1},blend:{enable:!0,func:{srcRGB:Ri.SRC_ALPHA,dstRGB:Ri.ONE_MINUS_SRC_ALPHA,srcAlpha:1,dstAlpha:1}}});i.setUniform(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Kl(Object(n),!0).forEach((function(e){ni(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Kl(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({u_device_pixel_ratio:window.devicePixelRatio},r));var o=this.buildAttributes(),a=this.geometrySystem.createInstancedBufferGeometry({maxInstancedCount:o.instancedOffsets.length/2,vertexCount:6});a.setIndex([0,2,1,0,3,2]),a.setAttribute("position",Float32Array.from(o.positions),{arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float2"}]}),a.setAttribute("offset",Float32Array.from(o.instancedOffsets),{arrayStride:8,stepMode:"instance",attributes:[{shaderLocation:1,offset:0,format:"float2"}]}),a.setAttribute("color",Float32Array.from(o.instancedColors),{arrayStride:16,stepMode:"instance",attributes:[{shaderLocation:2,offset:0,format:"float4"}]}),a.setAttribute("size",Float32Array.from(o.instancedSizes),{arrayStride:4,stepMode:"instance",attributes:[{shaderLocation:3,offset:0,format:"float"}]}),a.setAttribute("shape",Float32Array.from(o.instancedShapes),{arrayStride:4,stepMode:"instance",attributes:[{shaderLocation:4,offset:0,format:"float"}]}),a.setAttribute("a_PickingColor",Float32Array.from(o.instancedPickingColors),{arrayStride:12,stepMode:"instance",attributes:[{shaderLocation:6,offset:0,format:"float3"}]}),this.setMaterial(i),this.setGeometry(a)}},{key:"buildAttribute",value:function(t,e,n){var r,i,o,a,u;(r=e.instancedPickingColors).push.apply(r,Wc([(u=t.id||n)+1&255,u+1>>8&255,u+1>>8>>8&255])),e.instancedShapes.push(ah.indexOf(t.shape||"circle")),(i=e.instancedColors).push.apply(i,Wc(t.color||[1,0,0,1])),(o=e.instancedOffsets).push.apply(o,Wc(t.position||[0,0])),(a=e.instancedSizes).push.apply(a,Wc(t.size||[.2,.2]))}},{key:"buildAttributes",value:function(){var t=this,e={positions:[1,1,1,-1,-1,-1,-1,1],instancedOffsets:[],instancedColors:[],instancedSizes:[],instancedShapes:[],instancedPickingColors:[]};return Array.isArray(this.config)?this.config.forEach((function(n,r){t.buildAttribute(n,e,r)})):this.buildAttribute(this.config,e,0),e}}]),i}(Sc),Vl=wr((Wl=ql).prototype,"materialSystem",[Ll,Ul],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Xl=wr(Wl.prototype,"geometrySystem",[Fl,Bl],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Hl=wr(Wl.prototype,"shaderModuleService",[zl],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),jl=Wl))||jl);function sh(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return ch(t,e);var n=Object.prototype.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)?ch(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function ch(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var fh,lh,hh,dh,ph,vh,gh,yh,mh,bh,_h,xh,wh=(Zl=(0,Mr.b2)(),$l=(0,Mr.f3)(Pr.RenderEngine),Jl=(0,Mr.f3)(Pr.ShaderModuleService),Ql=(0,Mr.f3)(Pr.ConfigService),Zl((oh=function(){function t(){br(this,t),this.container=void 0,mr(this,"engine",nh,this),mr(this,"shaderModule",rh,this),mr(this,"configService",ih,this),this.inited=!1,this.rendering=!1,this.pendings=[],this.views=[],this.size=void 0}var e,n;return xr(t,[{key:"init",value:(n=Tr(Sr().mark((function t(){var e,n,r,i,o;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.shaderModule.registerBuiltinModules(),this.shaderModule.registerModule("uv.vert.declaration",{vs:"#ifdef USE_UV\n attribute vec2 uv;\n\t#ifdef UVS_VERTEX_ONLY\n vec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif"}),this.shaderModule.registerModule("uv.vert.main",{vs:"#ifdef USE_UV\n vUv = (uvTransform * vec3(uv, 1)).xy;\n#endif"}),this.shaderModule.registerModule("uv.frag.declaration",{fs:"#if (defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ))\n varying vec2 vUv;\n#endif"}),this.shaderModule.registerModule("map.frag.declaration",{fs:"#ifdef USE_MAP\n uniform sampler2D map;\n#endif"}),this.shaderModule.registerModule("map.frag.main",{fs:"#ifdef USE_MAP\n vec4 texelColor = texture2D(map, vUv);\n // texelColor = mapTexelToLinear(texelColor);\n diffuseColor *= texelColor;\n#endif"}),e=this.container.getAll(Pr.Systems),!(n=this.configService.get()).canvas){t.next=30;break}return t.next=11,this.engine.init({canvas:n.canvas,swapChainFormat:As.EV.BGRA8Unorm,antialiasing:!1});case 11:r=sh(e),t.prev=12,r.s();case 14:if((i=r.n()).done){t.next=21;break}if(!(o=i.value).initialize){t.next=19;break}return t.next=19,o.initialize();case 19:t.next=14;break;case 21:t.next=26;break;case 23:t.prev=23,t.t0=t.catch(12),r.e(t.t0);case 26:return t.prev=26,r.f(),t.finish(26);case 29:this.inited=!0;case 30:case"end":return t.stop()}}),t,this,[[12,23,26,29]])}))),function(){return n.apply(this,arguments)})},{key:"render",value:(e=Tr(Sr().mark((function t(){var e,n,r,i,o,a,u,s=arguments;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.inited&&!this.rendering){t.next=2;break}return t.abrupt("return");case 2:for(this.pendings.length&&this.pendings.forEach((function(t){t()})),this.rendering=!0,this.engine.beginFrame(),e=this.container.getAll(Pr.Systems),n=s.length,r=new Array(n),i=0;i<n;i++)r[i]=s[i];o=sh(e),t.prev=8,o.s();case 10:if((a=o.n()).done){t.next=17;break}if(!(u=a.value).execute){t.next=15;break}return t.next=15,u.execute(r);case 15:t.next=10;break;case 17:t.next=22;break;case 19:t.prev=19,t.t0=t.catch(8),o.e(t.t0);case 22:return t.prev=22,o.f(),t.finish(22);case 25:this.engine.endFrame(),this.rendering=!1;case 27:case"end":return t.stop()}}),t,this,[[8,19,22,25]])}))),function(){return e.apply(this,arguments)})},{key:"clear",value:function(t){var e=this;return this.inited?this.engine.clear(t):this.pendings.unshift((function(){e.engine.clear(t),e.pendings.shift()})),this}},{key:"setSize",value:function(t){var e=t.width,n=t.height,r=this.engine.getCanvas();return this.size={width:e,height:n},r.width=e,r.height=n,this}},{key:"getSize",value:function(){return this.size}}]),t}(),nh=wr((eh=oh).prototype,"engine",[$l],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),rh=wr(eh.prototype,"shaderModule",[Jl],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ih=wr(eh.prototype,"configService",[Ql],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),th=eh))||th),Eh=(0,Mr.b2)()((lh=function(){function t(){br(this,t),this.entities=[]}return xr(t,[{key:"getEntities",value:function(){return this.entities}},{key:"addRenderable",value:function(t){return this.addEntity(t.getEntity()),this}},{key:"removeRenderable",value:function(t){return this.removeEntity(t.getEntity()),this}},{key:"addLight",value:function(){}},{key:"addEntity",value:function(t){return-1===this.entities.indexOf(t)&&this.entities.push(t),this}},{key:"removeEntity",value:function(t){var e=this.entities.indexOf(t);return this.entities.splice(e,1),this}}]),t}(),fh=lh))||fh,Sh=(0,Mr.b2)()((dh=function(){function t(){br(this,t),this.cache={}}return xr(t,[{key:"get",value:function(t){return this.cache[t]}},{key:"set",value:function(t,e){this.cache[t]=e}}]),t}(),hh=dh))||hh;function Ah(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 Th(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ah(Object(n),!0).forEach((function(e){ni(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ah(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Ih,Ch,Dh,Nh,kh,Rh,Oh,Mh,Ph,Gh,Lh,Uh,Fh,Bh=(ph=(0,Mr.b2)(),vh=(0,Mr.f3)(Sh),gh=(0,Mr.f3)(Pr.RenderEngine),ph((xh=function(){function t(){br(this,t),mr(this,"textureCache",bh,this),mr(this,"engine",_h,this),this.config=void 0,this.loaded=!1,this.texture=void 0}var e;return xr(t,[{key:"setConfig",value:function(t){this.config=t}},{key:"isLoaded",value:function(){return this.loaded}},{key:"load",value:(e=Tr(Sr().mark((function t(){var e=this;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.config.url){t.next=4;break}return t.abrupt("return",new Promise((function(t,n){var r=e.textureCache.get(e.config.url);if(r)t(r);else{var i=new Image;i.crossOrigin="Anonymous",i.src=e.config.url,i.onload=function(){var n=e.engine.createTexture2D(Th(Th({},e.config),{},{data:i,width:i.width,height:i.height,flipY:!0}));e.textureCache.set(e.config.url,n),e.texture=n,e.loaded=!0,t(n)},i.onerror=function(){n()}}})));case 4:return this.loaded=!0,this.texture=this.engine.createTexture2D(this.config),t.abrupt("return",this.texture);case 7:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}]),t}(),bh=wr((mh=xh).prototype,"textureCache",[vh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),_h=wr(mh.prototype,"engine",[gh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),yh=mh))||yh),zh=(Ih=(0,Mr.b2)(),Ch=(0,Mr.f3)(Pr.Systems),Dh=(0,Mr.t6)(Pr.RendererSystem),Ih((Oh=function(){function t(){br(this,t),mr(this,"rendererSystem",Rh,this),this.camera=void 0,this.scene=void 0,this.viewport={x:0,y:0,width:0,height:0},this.clearColor=[1,1,1,1]}return xr(t,[{key:"getCamera",value:function(){return this.camera}},{key:"getScene",value:function(){return this.scene}},{key:"getViewport",value:function(){return this.viewport}},{key:"getClearColor",value:function(){return this.clearColor}},{key:"setCamera",value:function(t){return this.camera=t,this}},{key:"setScene",value:function(t){return this.scene=t,this}},{key:"setViewport",value:function(t){return this.viewport=t,this}},{key:"setClearColor",value:function(t){return this.clearColor=t,this}},{key:"pick",value:function(t){return this.rendererSystem.pick(t,this)}}]),t}(),Rh=wr((kh=Oh).prototype,"rendererSystem",[Ch,Dh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Nh=kh))||Nh);function jh(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 Wh(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?jh(Object(n),!0).forEach((function(e){ni(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):jh(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Vh=(Mh=(0,Mr.b2)(),Ph=(0,Mr.f3)(Pr.ConfigService),Mh((Fh=function(){function t(){br(this,t),mr(this,"configService",Uh,this),this.container=void 0}var e;return xr(t,[{key:"getEngine",value:(e=Tr(Sr().mark((function t(){var e,n,r,i;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.container.get(Pr.RenderEngine),n=this.configService.get(),r=n.canvas,i=n.engineOptions,t.next=4,e.init(Wh({canvas:r||Ts(),swapChainFormat:As.EV.BGRA8Unorm,antialiasing:!1},i));case 4:return t.abrupt("return",e);case 5:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"getTransformComponent",value:function(t){return this.container.get(Pr.TransformComponentManager).getComponentByEntity(t)}},{key:"getMeshComponent",value:function(t){return this.container.get(Pr.MeshComponentManager).getComponentByEntity(t)}},{key:"setConfig",value:function(t){this.configService.set(t)}},{key:"setContainer",value:function(t){this.container=t}},{key:"getContainer",value:function(){return this.container}},{key:"createEntity",value:function(){return Cr()}},{key:"createScene",value:function(){return this.container.get(Eh)}},{key:"createCamera",value:function(){return this.container.get(Es)}},{key:"createView",value:function(){return this.container.get(zh)}},{key:"createRenderable",value:function(t,e){var n=t?this.container.getNamed(Pr.Renderable,t):this.container.get(Sc),r=Cr();return n.setConfig(e||{}),n.setEntity(r),n}},{key:"createGeometry",value:function(t,e){var n=this.container.getNamed(Pr.Geometry,t),r=Cr();return n.setConfig(e||{}),n.setEntity(r),n.getComponent()}},{key:"createMaterial",value:function(t,e){var n=this.container.getNamed(Pr.Material,t),r=Cr();return n.setConfig(e||{}),n.setEntity(r,t),n.getComponent()}},{key:"createTexture2D",value:function(t){var e=this.container.get(Bh);return e.setConfig(t),e}},{key:"createBufferGeometry",value:function(t){return this.container.getNamed(Pr.Systems,Pr.GeometrySystem).createBufferGeometry(t)}},{key:"createInstancedBufferGeometry",value:function(t){return this.container.getNamed(Pr.Systems,Pr.GeometrySystem).createInstancedBufferGeometry(t)}},{key:"createShaderMaterial",value:function(t){return this.container.getNamed(Pr.Systems,Pr.MaterialSystem).createShaderMaterial(t)}},{key:"createKernel",value:function(t){var e=this.container.get(wc);return"string"==typeof t?e.setBundle(JSON.parse(t)):e.setBundle(t),e.init(),e}},{key:"createRenderer",value:function(){var t=this.container.get(wh);return t.container=this.container,t.init(),t}},{key:"destroy",value:function(){this.container.getAll(Pr.Systems).forEach((function(t){t.tearDown&&t.tearDown()})),this.container.get(Pr.RenderEngine).destroy(),this.container.get(Pr.InteractorService).destroy()}}],[{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=Hu(),r=navigator.gpu?Wf:cf;n.isBound(Pr.RenderEngine)||n.bind(Pr.RenderEngine).to(r).inSingletonScope(),n.bind(wh).toSelf(),n.bind(wc).toSelf(),n.bind(Sc).toSelf(),n.bind(zh).toSelf(),n.bind(Es).toSelf(),n.bind(Eh).toSelf(),n.bind(t).toSelf(),n.bind(Sh).toSelf(),n.bind(Bh).toSelf(),n.bind(Pr.Geometry).to(Hf).whenTargetNamed(Ss.BOX),n.bind(Pr.Geometry).to(ol).whenTargetNamed(Ss.SPHERE),n.bind(Pr.Geometry).to(Zf).whenTargetNamed(Ss.PLANE),n.bind(Pr.Geometry).to(Yf).whenTargetNamed(Ss.MERGED),n.bind(Pr.Material).to(ml).whenTargetNamed(Ec.BASIC),n.bind(Pr.Renderable).to(uh).whenTargetNamed(Sc.POINT),n.bind(Pr.Renderable).to(Yl).whenTargetNamed(Sc.LINE),n.bind(Pr.Renderable).to(kl).whenTargetNamed(Sc.GRID);var i=n.get(t);return i.setContainer(n),i.setConfig(e),i}}]),t}(),Uh=wr((Lh=Fh).prototype,"configService",[Ph],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Gh=Lh))||Gh),Xh=function(t,e){return t?a(t)?function(){return t}:t:function(){return e||1}},Hh=function(t){for(var e=[],n=t.length,r=t[0].length,i=function(r){t.forEach((function(t,i){if(e.push(t[r]),i===n-1)for(;e.length%4!=0;)e.push(0)}))},o=0;o<r;o++)i(o);return new Float32Array(e)},qh=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Yh=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{s(r.next(t))}catch(t){o(t)}}function u(t){try{s(r.throw(t))}catch(t){o(t)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}s((r=r.apply(t,e||[])).next())}))},Kh=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},Zh=function(t){function e(e){var n=t.call(this)||this;return n.maxIteration=1e3,n.gravity=10,n.speed=1,n.clustering=!1,n.clusterField="cluster",n.clusterGravity=10,n.workerEnabled=!1,n.nodes=[],n.edges=[],n.width=300,n.height=300,n.nodeMap={},n.nodeIdxMap={},n.updateCfg(e),n}return qh(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:1e3,gravity:10,speed:1,clustering:!1,clusterGravity:10}},e.prototype.execute=function(){return Yh(this,void 0,void 0,(function(){var t,e,n,r,i,o=this;return Kh(this,(function(u){switch(u.label){case 0:return(e=(t=this).nodes)&&0!==e.length?(t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),t.center||(t.center=[t.width/2,t.height/2]),n=t.center,1===e.length?(e[0].x=n[0],e[0].y=n[1],t.onLayoutEnd&&t.onLayoutEnd(),[2]):(r={},i={},e.forEach((function(t,e){a(t.x)||(t.x=Math.random()*o.width),a(t.y)||(t.y=Math.random()*o.height),r[t.id]=t,i[t.id]=e})),t.nodeMap=r,t.nodeIdxMap=i,[4,t.run()])):(t.onLayoutEnd&&t.onLayoutEnd(),[2]);case 1:return u.sent(),[2]}}))}))},e.prototype.executeWithWorker=function(t,e){return Yh(this,void 0,void 0,(function(){var n,r,i,o,u,s=this;return Kh(this,(function(c){switch(c.label){case 0:return r=(n=this).nodes,i=n.center,r&&0!==r.length?1===r.length?(r[0].x=i[0],r[0].y=i[1],[2]):(o={},u={},r.forEach((function(t,e){a(t.x)||(t.x=Math.random()*s.width),a(t.y)||(t.y=Math.random()*s.height),o[t.id]=t,u[t.id]=e})),n.nodeMap=o,n.nodeIdxMap=u,[4,n.run(t,e)]):[2];case 1:return c.sent(),[2]}}))}))},e.prototype.run=function(t,e){return Yh(this,void 0,void 0,(function(){var n,r,i,o,u,s,c,f,l,h,p,v,g,y,m,b,_,x,w,E,S,A,T,I,C,D,N=this;return Kh(this,(function(k){switch(k.label){case 0:for(r=(n=this).nodes,i=n.edges,o=n.maxIteration,u=n.center,s=n.height*n.width,c=Math.sqrt(s)/10,f=s/(r.length+1),l=Math.sqrt(f),h=n.speed,p=n.clustering,R=[n.clusterField],O=r,M=[],P=R.length,G={},O.forEach((function(t){R.forEach((function(e,n){if(void 0===G[t[e]]&&(G[t[e]]=Object.keys(G).length),M.push(G[t[e]]),n===P-1)for(;M.length%4!=0;)M.push(0)}))})),v={array:new Float32Array(M),count:Object.keys(G).length},g=v.array,y=v.count,r.forEach((function(t,e){var n=0,r=0;a(t.fx)&&a(t.fy)&&(n=t.fx||.001,r=t.fy||.001),g[4*e+1]=n,g[4*e+2]=r})),m=r.length,b=function(t,e){var n=[],r=[],i={},o=0;for(o=0;o<t.length;o++){var a=t[o];i[a.id]=o,n.push(a.x),n.push(a.y),n.push(0),n.push(0),r.push([])}for(o=0;o<e.length;o++){var u=e[o],s=d(u,"source"),c=d(u,"target");r[i[s]].push(i[c]),r[i[c]].push(i[s])}var f=0;for(o=0;o<t.length;o++){var l=n.length,h=r[o],p=h.length;n[4*o+2]=l,n[4*o+3]=h.length,f=Math.max(f,h.length);for(var v=0;v<p;++v){var g=h[v];n.push(+g)}}for(;n.length%4!=0;)n.push(0);return{maxEdgePerVetex:f,array:new Float32Array(n)}}(r,i),_=b.maxEdgePerVetex,x=b.array,w=n.workerEnabled,E=w?Vh.create({canvas:t,engineOptions:{supportCompute:!0}}):Vh.create({engineOptions:{supportCompute:!0}}),S=n.onLayoutEnd,A=[],T=0;T<y;T++)A.push(0,0,0,0);return I=E.createKernel('{"shaders":{"WGSL":"import \\"GLSL.std.450\\" as std;\\n\\n\\n# var gWebGPUDebug : bool = false;\\n# var gWebGPUDebugOutput : vec4<f32> = vec4<f32>(0.0);\\n\\n[[builtin global_invocation_id]] var<in> globalInvocationID : vec3<u32>;\\n# [[builtin work_group_size]] var<in> workGroupSize : vec3<u32>;\\n# [[builtin work_group_id]] var<in> workGroupID : vec3<u32>;\\n[[builtin local_invocation_id]] var<in> localInvocationID : vec3<u32>;\\n# [[builtin num_work_groups]] var<in> numWorkGroups : vec3<u32>;\\n[[builtin local_invocation_idx]] var<in> localInvocationIndex : u32;\\n\\ntype GWebGPUParams = [[block]] struct {\\n [[offset 0]] u_K : f32;\\n [[offset 4]] u_K2 : f32;\\n [[offset 8]] u_Center : vec2<f32>;\\n [[offset 16]] u_Gravity : f32;\\n [[offset 20]] u_ClusterGravity : f32;\\n [[offset 24]] u_Speed : f32;\\n [[offset 28]] u_MaxDisplace : f32;\\n [[offset 32]] u_Clustering : f32;\\n};\\n[[binding 0, set 0]] var<uniform> gWebGPUUniformParams : GWebGPUParams;\\ntype GWebGPUBuffer0 = [[block]] struct {\\n [[offset 0]] u_Data : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 1, set 0]] var<storage_buffer> gWebGPUBuffer0 : GWebGPUBuffer0;\\ntype GWebGPUBuffer1 = [[block]] struct {\\n [[offset 0]] u_AttributeArray : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 2, set 0]] var<storage_buffer> gWebGPUBuffer1 : GWebGPUBuffer1;\\ntype GWebGPUBuffer2 = [[block]] struct {\\n [[offset 0]] u_ClusterCenters : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 3, set 0]] var<storage_buffer> gWebGPUBuffer2 : GWebGPUBuffer2;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nfn calcRepulsive(i : i32, currentNode : vec4<f32>) -> vec2<f32> {var dx : f32 = 0.0;\\nvar dy : f32 = 0.0;\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {if (i != j) {var nextNode : vec4<f32> = gWebGPUBuffer0.u_Data[j];\\nvar xDist : f32 = currentNode.x - nextNode.x;\\nvar yDist : f32 = currentNode.y - nextNode.y;\\nvar dist : f32 = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\nvar param : f32 = gWebGPUUniformParams.u_K2 / dist;\\nif (dist > 0.0) {dx = dx + param * xDist;\\ndy = dy + param * yDist;\\nif ((xDist == 0.0) && (yDist == 0.0)) {var sign : f32 = select(1.0, -1.0, i < j);\\ndx = dx + param * std::sign;\\ndy = dy + param * std::sign;}}}}\\nreturn vec2<f32>(dx, dy);}\\nfn calcGravity(currentNode : vec4<f32>, nodeAttributes : vec4<f32>) -> vec2<f32> {var dx : f32 = 0.0;\\nvar dy : f32 = 0.0;\\nvar vx : f32 = currentNode.x - gWebGPUUniformParams.u_Center.x;\\nvar vy : f32 = currentNode.y - gWebGPUUniformParams.u_Center.y;\\nvar gf : f32 = (0.01 * gWebGPUUniformParams.u_K) * gWebGPUUniformParams.u_Gravity;\\ndx = gf * vx;\\ndy = gf * vy;\\nif (gWebGPUUniformParams.u_Clustering == 1.0) {var clusterIdx : i32 = i32(nodeAttributes.x);\\nvar center : vec4<f32> = gWebGPUBuffer2.u_ClusterCenters[clusterIdx];\\nvar cvx : f32 = currentNode.x - center.x;\\nvar cvy : f32 = currentNode.y - center.y;\\nvar dist : f32 = std::sqrt((cvx * cvx) + (cvy * cvy)) + 0.01;\\nvar parma : f32 = (gWebGPUUniformParams.u_K * gWebGPUUniformParams.u_ClusterGravity) / dist;\\ndx = dx + parma * cvx;\\ndy = dy + parma * cvy;}\\nreturn vec2<f32>(dx, dy);}\\nfn calcAttractive(i : i32, currentNode : vec4<f32>) -> vec2<f32> {var dx : f32 = 0.0;\\nvar dy : f32 = 0.0;\\nvar arr_offset : i32 = i32(std::floor(currentNode.z + 0.5));\\nvar length : i32 = i32(std::floor(currentNode.w + 0.5));\\nvar node_buffer : vec4<f32>;\\nfor (var p : i32 = 0; p < __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX; p = p + 1) {if (p >= length) {break;}\\nvar arr_idx : i32 = arr_offset + i32(p);\\nvar buf_offset : i32 = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = gWebGPUBuffer0.u_Data[i32(arr_idx / 4)];}\\nvar float_j : f32 = select(node_buffer.x, select(node_buffer.y, select(node_buffer.z, node_buffer.w, buf_offset == 2), buf_offset == 1), buf_offset == 0);\\nvar nextNode : vec4<f32> = gWebGPUBuffer0.u_Data[i32(float_j)];\\nvar xDist : f32 = currentNode.x - nextNode.x;\\nvar yDist : f32 = currentNode.y - nextNode.y;\\nvar dist : f32 = std::sqrt((xDist * xDist) + (yDist * yDist)) + 0.01;\\nvar attractiveF : f32 = dist / gWebGPUUniformParams.u_K;\\nif (dist > 0.0) {dx = dx - xDist * attractiveF;\\ndy = dy - yDist * attractiveF;\\nif ((xDist == 0.0) && (yDist == 0.0)) {var sign : f32 = select(1.0, -1.0, i < i32(float_j));\\ndx = dx - std::sign * attractiveF;\\ndy = dy - std::sign * attractiveF;}}}\\nreturn vec2<f32>(dx, dy);}\\nfn main() -> void {var i : i32 = globalInvocationID.x;\\nvar currentNode : vec4<f32> = gWebGPUBuffer0.u_Data[i];\\nvar dx : f32 = 0.0;\\nvar dy : f32 = 0.0;\\nif (i >= __DefineValuePlaceholder__VERTEX_COUNT) {gWebGPUBuffer0.u_Data[i] = currentNode;\\nreturn ;}\\nvar nodeAttributes : vec4<f32> = gWebGPUBuffer1.u_AttributeArray[i];\\nif ((nodeAttributes.y != 0.0) && (nodeAttributes.z != 0.0)) {gWebGPUBuffer0.u_Data[i] = vec4<f32>(nodeAttributes.y, nodeAttributes.z, currentNode.z, currentNode.w);\\nreturn ;}\\nvar repulsive : vec2<f32> = calcRepulsive(i, currentNode);\\ndx = dx + repulsive.x;\\ndy = dy + repulsive.y;\\nvar attractive : vec2<f32> = calcAttractive(i, currentNode);\\ndx = dx + attractive.x;\\ndy = dy + attractive.y;\\nvar gravity : vec2<f32> = calcGravity(currentNode, nodeAttributes);\\ndx = dx - gravity.x;\\ndy = dy - gravity.y;\\ndx = dx * gWebGPUUniformParams.u_Speed;\\ndy = dy * gWebGPUUniformParams.u_Speed;\\nvar distLength : f32 = std::sqrt((dx * dx) + (dy * dy));\\nif (distLength > 0.0) {var limitedDist : f32 = std::min(gWebGPUUniformParams.u_MaxDisplace * gWebGPUUniformParams.u_Speed, distLength);\\ngWebGPUBuffer0.u_Data[i] = vec4<f32>(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w);}\\nreturn;}\\n\\nentry_point compute as \\"main\\" = main;\\n","GLSL450":"\\n\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\nivec3 workGroupSize = ivec3(1,1,1);\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\n\\nlayout(std140, set = 0, binding = 0) uniform GWebGPUParams {\\n float u_K;\\n float u_K2;\\n vec2 u_Center;\\n float u_Gravity;\\n float u_ClusterGravity;\\n float u_Speed;\\n float u_MaxDisplace;\\n float u_Clustering;\\n} gWebGPUUniformParams;\\nlayout(std430, set = 0, binding = 1) buffer GWebGPUBuffer0 {\\n vec4 u_Data[];\\n} gWebGPUBuffer0;\\n\\nlayout(std430, set = 0, binding = 2) buffer readonly GWebGPUBuffer1 {\\n vec4 u_AttributeArray[];\\n} gWebGPUBuffer1;\\n\\nlayout(std430, set = 0, binding = 3) buffer readonly GWebGPUBuffer2 {\\n vec4 u_ClusterCenters[];\\n} gWebGPUBuffer2;\\n\\n\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\nlayout (\\n local_size_x = 1,\\n local_size_y = 1,\\n local_size_z = 1\\n) in;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nvec2 calcRepulsive(int i, vec4 currentNode) {float dx = 0.0;\\nfloat dy = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = gWebGPUBuffer0.u_Data[j];\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat param = gWebGPUUniformParams.u_K2 / dist;\\nif (dist > 0.0) {dx += param * xDist;\\ndy += param * yDist;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < j) ? (1.0) : (-1.0);\\ndx += param * sign;\\ndy += param * sign;}}}}\\nreturn vec2(dx, dy);}\\nvec2 calcGravity(vec4 currentNode, vec4 nodeAttributes) {float dx = 0.0;\\nfloat dy = 0.0;\\nfloat vx = currentNode.x - gWebGPUUniformParams.u_Center.x;\\nfloat vy = currentNode.y - gWebGPUUniformParams.u_Center.y;\\nfloat gf = (0.01 * gWebGPUUniformParams.u_K) * gWebGPUUniformParams.u_Gravity;\\ndx = gf * vx;\\ndy = gf * vy;\\nif (gWebGPUUniformParams.u_Clustering == 1.0) {int clusterIdx = int(nodeAttributes.x);\\nvec4 center = gWebGPUBuffer2.u_ClusterCenters[clusterIdx];\\nfloat cvx = currentNode.x - center.x;\\nfloat cvy = currentNode.y - center.y;\\nfloat dist = sqrt((cvx * cvx) + (cvy * cvy)) + 0.01;\\nfloat parma = (gWebGPUUniformParams.u_K * gWebGPUUniformParams.u_ClusterGravity) / dist;\\ndx += parma * cvx;\\ndy += parma * cvy;}\\nreturn vec2(dx, dy);}\\nvec2 calcAttractive(int i, vec4 currentNode) {float dx = 0.0;\\nfloat dy = 0.0;\\nint arr_offset = int(floor(currentNode.z + 0.5));\\nint length = int(floor(currentNode.w + 0.5));\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + int(p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = gWebGPUBuffer0.u_Data[int(arr_idx / 4)];}\\nfloat float_j = (buf_offset == 0) ? (node_buffer.x) : ((buf_offset == 1) ? (node_buffer.y) : ((buf_offset == 2) ? (node_buffer.z) : (node_buffer.w)));\\nvec4 nextNode = gWebGPUBuffer0.u_Data[int(float_j)];\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = sqrt((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat attractiveF = dist / gWebGPUUniformParams.u_K;\\nif (dist > 0.0) {dx -= xDist * attractiveF;\\ndy -= yDist * attractiveF;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < int(float_j)) ? (1.0) : (-1.0);\\ndx -= sign * attractiveF;\\ndy -= sign * attractiveF;}}}\\nreturn vec2(dx, dy);}\\nvoid main() {int i = globalInvocationID.x;\\nvec4 currentNode = gWebGPUBuffer0.u_Data[i];\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nif (i >= VERTEX_COUNT) {gWebGPUBuffer0.u_Data[i] = currentNode;\\nreturn ;}\\nvec4 nodeAttributes = gWebGPUBuffer1.u_AttributeArray[i];\\nif ((nodeAttributes.y != 0.0) && (nodeAttributes.z != 0.0)) {gWebGPUBuffer0.u_Data[i] = vec4(nodeAttributes.y, nodeAttributes.z, currentNode.z, currentNode.w);\\nreturn ;}\\nvec2 repulsive = calcRepulsive(i, currentNode);\\ndx += repulsive.x;\\ndy += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode);\\ndx += attractive.x;\\ndy += attractive.y;\\nvec2 gravity = calcGravity(currentNode, nodeAttributes);\\ndx -= gravity.x;\\ndy -= gravity.y;\\ndx *= gWebGPUUniformParams.u_Speed;\\ndy *= gWebGPUUniformParams.u_Speed;\\nfloat distLength = sqrt((dx * dx) + (dy * dy));\\nif (distLength > 0.0) {float limitedDist = min(gWebGPUUniformParams.u_MaxDisplace * gWebGPUUniformParams.u_Speed, distLength);\\ngWebGPUBuffer0.u_Data[i] = vec4(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w);}}\\n","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_K;\\nuniform float u_K2;\\nuniform vec2 u_Center;\\nuniform float u_Gravity;\\nuniform float u_ClusterGravity;\\nuniform float u_Speed;\\nuniform float u_MaxDisplace;\\nuniform float u_Clustering;\\nuniform sampler2D u_AttributeArray;\\nuniform vec2 u_AttributeArraySize;\\nvec4 getDatau_AttributeArray(vec2 address2D) {\\n return vec4(texture2D(u_AttributeArray, address2D).rgba);\\n}\\nvec4 getDatau_AttributeArray(float address1D) {\\n return getDatau_AttributeArray(addrTranslation_1Dto2D(address1D, u_AttributeArraySize));\\n}\\nvec4 getDatau_AttributeArray(int address1D) {\\n return getDatau_AttributeArray(float(address1D));\\n}\\nuniform sampler2D u_ClusterCenters;\\nuniform vec2 u_ClusterCentersSize;\\nvec4 getDatau_ClusterCenters(vec2 address2D) {\\n return vec4(texture2D(u_ClusterCenters, address2D).rgba);\\n}\\nvec4 getDatau_ClusterCenters(float address1D) {\\n return getDatau_ClusterCenters(addrTranslation_1Dto2D(address1D, u_ClusterCentersSize));\\n}\\nvec4 getDatau_ClusterCenters(int address1D) {\\n return getDatau_ClusterCenters(float(address1D));\\n}\\nvec2 calcRepulsive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = getDatau_Data(j);\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat param = u_K2 / dist;\\nif (dist > 0.0) {dx += param * xDist;\\ndy += param * yDist;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < j) ? (1.0) : (-1.0);\\ndx += param * sign;\\ndy += param * sign;}}}}\\nreturn vec2(dx, dy);}\\nvec2 calcGravity(vec4 currentNode, vec4 nodeAttributes) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nfloat vx = currentNode.x - u_Center.x;\\nfloat vy = currentNode.y - u_Center.y;\\nfloat gf = (0.01 * u_K) * u_Gravity;\\ndx = gf * vx;\\ndy = gf * vy;\\nif (u_Clustering == 1.0) {int clusterIdx = int(nodeAttributes.x);\\nvec4 center = getDatau_ClusterCenters(clusterIdx);\\nfloat cvx = currentNode.x - center.x;\\nfloat cvy = currentNode.y - center.y;\\nfloat dist = sqrt((cvx * cvx) + (cvy * cvy)) + 0.01;\\nfloat parma = (u_K * u_ClusterGravity) / dist;\\ndx += parma * cvx;\\ndy += parma * cvy;}\\nreturn vec2(dx, dy);}\\nvec2 calcAttractive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nint arr_offset = int(floor(currentNode.z + 0.5));\\nint length = int(floor(currentNode.w + 0.5));\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + int(p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = getDatau_Data(int(arr_idx / 4));}\\nfloat float_j = (buf_offset == 0) ? (node_buffer.x) : ((buf_offset == 1) ? (node_buffer.y) : ((buf_offset == 2) ? (node_buffer.z) : (node_buffer.w)));\\nvec4 nextNode = getDatau_Data(int(float_j));\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = sqrt((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat attractiveF = dist / u_K;\\nif (dist > 0.0) {dx -= xDist * attractiveF;\\ndy -= yDist * attractiveF;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < int(float_j)) ? (1.0) : (-1.0);\\ndx -= sign * attractiveF;\\ndy -= sign * attractiveF;}}}\\nreturn vec2(dx, dy);}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 currentNode = getDatau_Data(i);\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nif (i >= VERTEX_COUNT) {gl_FragColor = vec4(currentNode);\\nreturn ;}\\nvec4 nodeAttributes = getDatau_AttributeArray(i);\\nif ((nodeAttributes.y != 0.0) && (nodeAttributes.z != 0.0)) {gl_FragColor = vec4(vec4(nodeAttributes.y, nodeAttributes.z, currentNode.z, currentNode.w));\\nreturn ;}\\nvec2 repulsive = calcRepulsive(i, currentNode);\\ndx += repulsive.x;\\ndy += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode);\\ndx += attractive.x;\\ndy += attractive.y;\\nvec2 gravity = calcGravity(currentNode, nodeAttributes);\\ndx -= gravity.x;\\ndy -= gravity.y;\\ndx *= u_Speed;\\ndy *= u_Speed;\\nfloat distLength = sqrt((dx * dx) + (dy * dy));\\nif (distLength > 0.0) {float limitedDist = min(u_MaxDisplace * u_Speed, distLength);\\ngl_FragColor = vec4(vec4(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w));}if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"MAX_EDGE_PER_VERTEX","type":"Float","runtime":true},{"name":"VERTEX_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]},{"name":"u_K","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_K2","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Center","type":"vec2<f32>","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Gravity","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterGravity","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Speed","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_MaxDisplace","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Clustering","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AttributeArray","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterCenters","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_Data","size":[1,1],"length":1},"needPingpong":true}}').setDispatch([m,1,1]).setBinding({u_Data:x,u_K:l,u_K2:f,u_Gravity:n.gravity,u_ClusterGravity:n.clusterGravity||n.gravity||1,u_Speed:h,u_MaxDisplace:c,u_Clustering:p?1:0,u_Center:u,u_AttributeArray:g,u_ClusterCenters:A,MAX_EDGE_PER_VERTEX:_,VERTEX_COUNT:m}),p&&(C=E.createKernel('{"shaders":{"WGSL":"import \\"GLSL.std.450\\" as std;\\n\\n\\n# var gWebGPUDebug : bool = false;\\n# var gWebGPUDebugOutput : vec4<f32> = vec4<f32>(0.0);\\n\\n[[builtin global_invocation_id]] var<in> globalInvocationID : vec3<u32>;\\n# [[builtin work_group_size]] var<in> workGroupSize : vec3<u32>;\\n# [[builtin work_group_id]] var<in> workGroupID : vec3<u32>;\\n[[builtin local_invocation_id]] var<in> localInvocationID : vec3<u32>;\\n# [[builtin num_work_groups]] var<in> numWorkGroups : vec3<u32>;\\n[[builtin local_invocation_idx]] var<in> localInvocationIndex : u32;\\n\\n\\ntype GWebGPUBuffer0 = [[block]] struct {\\n [[offset 0]] u_Data : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 0, set 0]] var<storage_buffer> gWebGPUBuffer0 : GWebGPUBuffer0;\\ntype GWebGPUBuffer1 = [[block]] struct {\\n [[offset 0]] u_NodeAttributes : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 1, set 0]] var<storage_buffer> gWebGPUBuffer1 : GWebGPUBuffer1;\\ntype GWebGPUBuffer2 = [[block]] struct {\\n [[offset 0]] u_ClusterCenters : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 2, set 0]] var<storage_buffer> gWebGPUBuffer2 : GWebGPUBuffer2;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nfn main() -> void {var i : i32 = globalInvocationID.x;\\nvar center : vec4<f32> = gWebGPUBuffer2.u_ClusterCenters[i];\\nvar sumx : f32 = 0.0;\\nvar sumy : f32 = 0.0;\\nvar count : f32 = 0.0;\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {var attributes : vec4<f32> = gWebGPUBuffer1.u_NodeAttributes[j];\\nvar clusterIdx : i32 = i32(attributes.x);\\nvar vertex : vec4<f32> = gWebGPUBuffer0.u_Data[j];\\nif (clusterIdx == i) {sumx = sumx + vertex.x;\\nsumy = sumy + vertex.y;\\ncount = count + 1.0;}}\\ngWebGPUBuffer2.u_ClusterCenters[i] = vec4<f32>(sumx / count, sumy / count, count, i);\\nreturn;}\\n\\nentry_point compute as \\"main\\" = main;\\n","GLSL450":"\\n\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\nivec3 workGroupSize = ivec3(1,1,1);\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\n\\n\\nlayout(std430, set = 0, binding = 0) buffer readonly GWebGPUBuffer0 {\\n vec4 u_Data[];\\n} gWebGPUBuffer0;\\n\\nlayout(std430, set = 0, binding = 1) buffer readonly GWebGPUBuffer1 {\\n vec4 u_NodeAttributes[];\\n} gWebGPUBuffer1;\\n\\nlayout(std430, set = 0, binding = 2) buffer GWebGPUBuffer2 {\\n vec4 u_ClusterCenters[];\\n} gWebGPUBuffer2;\\n\\n\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define CLUSTER_COUNT __DefineValuePlaceholder__CLUSTER_COUNT\\nlayout (\\n local_size_x = 1,\\n local_size_y = 1,\\n local_size_z = 1\\n) in;\\n\\n\\n\\nvoid main() {int i = globalInvocationID.x;\\nvec4 center = gWebGPUBuffer2.u_ClusterCenters[i];\\nfloat sumx = 0.0;\\nfloat sumy = 0.0;\\nfloat count = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 attributes = gWebGPUBuffer1.u_NodeAttributes[j];\\nint clusterIdx = int(attributes.x);\\nvec4 vertex = gWebGPUBuffer0.u_Data[j];\\nif (clusterIdx == i) {sumx += vertex.x;\\nsumy += vertex.y;\\ncount += 1.0;}}\\ngWebGPUBuffer2.u_ClusterCenters[i] = vec4(sumx / count, sumy / count, count, i);}\\n","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define CLUSTER_COUNT __DefineValuePlaceholder__CLUSTER_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform sampler2D u_NodeAttributes;\\nuniform vec2 u_NodeAttributesSize;\\nvec4 getDatau_NodeAttributes(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributes, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributes(float address1D) {\\n return getDatau_NodeAttributes(addrTranslation_1Dto2D(address1D, u_NodeAttributesSize));\\n}\\nvec4 getDatau_NodeAttributes(int address1D) {\\n return getDatau_NodeAttributes(float(address1D));\\n}\\nuniform sampler2D u_ClusterCenters;\\nuniform vec2 u_ClusterCentersSize;\\nvec4 getDatau_ClusterCenters(vec2 address2D) {\\n return vec4(texture2D(u_ClusterCenters, address2D).rgba);\\n}\\nvec4 getDatau_ClusterCenters(float address1D) {\\n return getDatau_ClusterCenters(addrTranslation_1Dto2D(address1D, u_ClusterCentersSize));\\n}\\nvec4 getDatau_ClusterCenters(int address1D) {\\n return getDatau_ClusterCenters(float(address1D));\\n}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 center = getDatau_ClusterCenters(i);\\nfloat sumx = 0.0;\\nfloat sumy = 0.0;\\nfloat count = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 attributes = getDatau_NodeAttributes(j);\\nint clusterIdx = int(attributes.x);\\nvec4 vertex = getDatau_Data(j);\\nif (clusterIdx == i) {sumx += vertex.x;\\nsumy += vertex.y;\\ncount += 1.0;}}\\ngl_FragColor = vec4(vec4(sumx / count, sumy / count, count, i));if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"VERTEX_COUNT","type":"Float","runtime":true},{"name":"CLUSTER_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributes","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterCenters","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_ClusterCenters","size":[1,1],"length":1},"needPingpong":true}}').setDispatch([y,1,1]).setBinding({u_Data:x,u_NodeAttributes:g,u_ClusterCenters:A,VERTEX_COUNT:m,CLUSTER_COUNT:y})),D=function(){return Yh(N,void 0,void 0,(function(){var n,i;return Kh(this,(function(a){switch(a.label){case 0:n=0,a.label=1;case 1:return n<o?[4,I.execute()]:[3,6];case 2:return a.sent(),p?(C.setBinding({u_Data:I}),[4,C.execute()]):[3,4];case 3:a.sent(),I.setBinding({u_ClusterCenters:C}),a.label=4;case 4:I.setBinding({u_MaxDisplace:c*=.99}),a.label=5;case 5:return n++,[3,1];case 6:return[4,I.getOutput()];case 7:return i=a.sent(),t?e.postMessage({type:It,vertexEdgeData:i}):r.forEach((function(t,e){var n=i[4*e],r=i[4*e+1];t.x=n,t.y=r})),S&&S(),[2]}}))}))},[4,D()];case 1:return k.sent(),[2]}var R,O,M,P,G}))}))},e.prototype.getType=function(){return"fruchterman-gpu"},e}(t),$h=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Jh=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{s(r.next(t))}catch(t){o(t)}}function u(t){try{s(r.throw(t))}catch(t){o(t)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}s((r=r.apply(t,e||[])).next())}))},Qh=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},td=function(t){function e(e){var n=t.call(this)||this;return n.maxIteration=1e3,n.edgeStrength=200,n.nodeStrength=1e3,n.coulombDisScale=.005,n.damping=.9,n.maxSpeed=1e3,n.minMovement=.5,n.interval=.02,n.factor=1,n.linkDistance=1,n.gravity=10,n.workerEnabled=!1,n.nodes=[],n.edges=[],n.width=300,n.height=300,n.nodeMap={},n.nodeIdxMap={},n.updateCfg(e),n}return $h(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:2e3,gravity:10,clustering:!1,clusterGravity:10}},e.prototype.execute=function(){return Jh(this,void 0,void 0,(function(){var t,e,n,r,i;return Qh(this,(function(o){switch(o.label){case 0:return(e=(t=this).nodes)&&0!==e.length?(t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),t.center||(t.center=[t.width/2,t.height/2]),n=t.center,1===e.length?(e[0].x=n[0],e[0].y=n[1],t.onLayoutEnd&&t.onLayoutEnd(),[2]):(r={},i={},e.forEach((function(e,n){a(e.x)||(e.x=Math.random()*t.width),a(e.y)||(e.y=Math.random()*t.height),r[e.id]=e,i[e.id]=n})),t.nodeMap=r,t.nodeIdxMap=i,t.nodeStrength=Xh(t.nodeStrength,1),t.edgeStrength=Xh(t.edgeStrength,1),[4,t.run()])):(t.onLayoutEnd&&t.onLayoutEnd(),[2]);case 1:return o.sent(),[2]}}))}))},e.prototype.executeWithWorker=function(t,e){var n=this,r=n.nodes,i=n.center;if(r&&0!==r.length){if(1===r.length)return r[0].x=i[0],void(r[0].y=i[1]);var o={},u={};r.forEach((function(t,e){a(t.x)||(t.x=Math.random()*n.width),a(t.y)||(t.y=Math.random()*n.height),o[t.id]=t,u[t.id]=e})),n.nodeMap=o,n.nodeIdxMap=u,n.nodeStrength=Xh(n.nodeStrength,1),n.edgeStrength=Xh(n.edgeStrength,1),n.run(t,e)}},e.prototype.run=function(t,e){return Jh(this,void 0,void 0,(function(){var n,r,i,o,u,s,c,f,l,h,v,g,y,m,b,_,x,w,E,S,A,T,I,C,D,N,k,R=this;return Qh(this,(function(O){switch(O.label){case 0:for(r=(n=this).nodes,i=n.edges,o=n.maxIteration,n.width||"undefined"==typeof window||(n.width=window.innerWidth),n.height||"undefined"==typeof window||(n.height=window.innerHeight),u=r.length,n.linkDistance=Xh(n.linkDistance),n.edgeStrength=Xh(n.edgeStrength),s=function(t,e,n,r){var i=[],o=[],a={},u=0;for(u=0;u<t.length;u++){var s=t[u];a[s.id]=u,i.push(s.x),i.push(s.y),i.push(0),i.push(0),o.push([])}for(u=0;u<e.length;u++){var c=e[u],f=d(c,"source"),l=d(c,"target");o[a[f]].push(a[l]),o[a[f]].push(n(c)),o[a[f]].push(r(c)),o[a[f]].push(0),o[a[l]].push(a[f]),o[a[l]].push(n(c)),o[a[l]].push(r(c)),o[a[l]].push(0)}var h=0;for(u=0;u<t.length;u++){var p=i.length,v=o[u],g=v.length;i[4*u+2]=p+1048576*g/4,i[4*u+3]=0,h=Math.max(h,g/4);for(var y=0;y<g;++y){var m=v[y];i.push(+m)}}for(;i.length%4!=0;)i.push(0);return{maxEdgePerVetex:h,array:new Float32Array(i)}}(r,i,n.linkDistance,n.edgeStrength),c=s.maxEdgePerVetex,f=s.array,n.degrees=p(r.length,n.nodeIdxMap,i),l=[],h=[],v=[],g=[],y=[],m=[],b=[],n.getMass||(n.getMass=function(t){return n.degrees[n.nodeIdxMap[t.id]]||1}),_=n.gravity,x=n.center,r.forEach((function(t,e){l.push(n.getMass(t)),h.push(n.nodeStrength(t)),n.degrees[e]||(n.degrees[e]=0);var r=[x[0],x[1],_];if(n.getCenter){var i=n.getCenter(t,n.degrees[e]);i&&a(i[0])&&a(i[1])&&a(i[2])&&(r=i)}v.push(r[0]),g.push(r[1]),y.push(r[2]),a(t.fx)&&a(t.fy)?(m.push(t.fx||.001),b.push(t.fy||.001)):(m.push(0),b.push(0))})),w=Hh([l,n.degrees,h,m]),E=Hh([v,g,y,b]),S=n.workerEnabled,A=S?Vh.create({canvas:t,engineOptions:{supportCompute:!0}}):Vh.create({engineOptions:{supportCompute:!0}}),T=n.onLayoutEnd,I=[],f.forEach((function(t){I.push(t)})),C=0;C<4;C++)I.push(0);return D=A.createKernel('{"shaders":{"WGSL":"import \\"GLSL.std.450\\" as std;\\n\\n\\n# var gWebGPUDebug : bool = false;\\n# var gWebGPUDebugOutput : vec4<f32> = vec4<f32>(0.0);\\n\\n[[builtin global_invocation_id]] var<in> globalInvocationID : vec3<u32>;\\n# [[builtin work_group_size]] var<in> workGroupSize : vec3<u32>;\\n# [[builtin work_group_id]] var<in> workGroupID : vec3<u32>;\\n[[builtin local_invocation_id]] var<in> localInvocationID : vec3<u32>;\\n# [[builtin num_work_groups]] var<in> numWorkGroups : vec3<u32>;\\n[[builtin local_invocation_idx]] var<in> localInvocationIndex : u32;\\n\\ntype GWebGPUParams = [[block]] struct {\\n [[offset 0]] u_damping : f32;\\n [[offset 4]] u_maxSpeed : f32;\\n [[offset 8]] u_minMovement : f32;\\n \\n [[offset 12]] u_coulombDisScale : f32;\\n [[offset 16]] u_factor : f32;\\n \\n \\n [[offset 20]] u_interval : f32;\\n};\\n[[binding 0, set 0]] var<uniform> gWebGPUUniformParams : GWebGPUParams;\\ntype GWebGPUBuffer0 = [[block]] struct {\\n [[offset 0]] u_Data : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 1, set 0]] var<storage_buffer> gWebGPUBuffer0 : GWebGPUBuffer0;\\ntype GWebGPUBuffer1 = [[block]] struct {\\n [[offset 0]] u_AveMovement : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 2, set 0]] var<storage_buffer> gWebGPUBuffer1 : GWebGPUBuffer1;\\ntype GWebGPUBuffer2 = [[block]] struct {\\n [[offset 0]] u_NodeAttributeArray1 : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 3, set 0]] var<storage_buffer> gWebGPUBuffer2 : GWebGPUBuffer2;\\ntype GWebGPUBuffer3 = [[block]] struct {\\n [[offset 0]] u_NodeAttributeArray2 : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 4, set 0]] var<storage_buffer> gWebGPUBuffer3 : GWebGPUBuffer3;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nfn unpack_float(packedValue : f32) -> vec2<i32> {var packedIntValue : i32 = i32(packedValue);\\nvar v0 : i32 = packedIntValue / 1048576;\\nreturn vec2<i32>(v0, packedIntValue - (v0 * 1048576));}\\nfn calcRepulsive(i : i32, currentNode : vec4<f32>) -> vec2<f32> {var ax : f32 = 0.0;\\nvar ay : f32 = 0.0;\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {if (i != j) {var nextNode : vec4<f32> = gWebGPUBuffer0.u_Data[j];\\nvar vx : f32 = currentNode.x - nextNode.x;\\nvar vy : f32 = currentNode.y - nextNode.y;\\nvar dist : f32 = std::sqrt((vx * vx) + (vy * vy)) + 0.01;\\nvar n_dist : f32 = (dist + 0.1) * gWebGPUUniformParams.u_coulombDisScale;\\nvar direx : f32 = vx / dist;\\nvar direy : f32 = vy / dist;\\nvar attributesi : vec4<f32> = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\nvar attributesj : vec4<f32> = gWebGPUBuffer2.u_NodeAttributeArray1[j];\\nvar massi : f32 = attributesi.x;\\nvar nodeStrengthi : f32 = attributesi.z;\\nvar nodeStrengthj : f32 = attributesj.z;\\nvar nodeStrength : f32 = (nodeStrengthi + nodeStrengthj) / 2.0;\\nvar param : f32 = (nodeStrength * gWebGPUUniformParams.u_factor) / (n_dist * n_dist);\\nax = ax + direx * param;\\nay = ay + direy * param;}}\\nreturn vec2<f32>(ax, ay);}\\nfn calcGravity(i : i32, currentNode : vec4<f32>, attributes2 : vec4<f32>) -> vec2<f32> {var vx : f32 = currentNode.x - attributes2.x;\\nvar vy : f32 = currentNode.y - attributes2.y;\\nvar ax : f32 = vx * attributes2.z;\\nvar ay : f32 = vy * attributes2.z;\\nreturn vec2<f32>(ax, ay);}\\nfn calcAttractive(i : i32, currentNode : vec4<f32>, attributes1 : vec4<f32>) -> vec2<f32> {var mass : f32 = attributes1.x;\\nvar ax : f32 = 0.0;\\nvar ay : f32 = 0.0;\\nvar compressed : vec2<i32> = unpack_float(currentNode.z);\\nvar length : i32 = compressed.x;\\nvar arr_offset : i32 = compressed.y;\\nvar node_buffer : vec4<f32>;\\nfor (var p : i32 = 0; p < __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX; p = p + 1) {if (p >= length) {break;}\\nvar arr_idx : i32 = arr_offset + (4 * p);\\nvar buf_offset : i32 = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = gWebGPUBuffer0.u_Data[i32(arr_idx / 4)];}\\nvar float_j : f32 = node_buffer.x;\\nvar nextNode : vec4<f32> = gWebGPUBuffer0.u_Data[i32(float_j)];\\nvar vx : f32 = nextNode.x - currentNode.x;\\nvar vy : f32 = nextNode.y - currentNode.y;\\nvar dist : f32 = std::sqrt((vx * vx) + (vy * vy)) + 0.01;\\nvar direx : f32 = vx / dist;\\nvar direy : f32 = vy / dist;\\nvar edgeLength : f32 = node_buffer.y;\\nvar edgeStrength : f32 = node_buffer.z;\\nvar diff : f32 = edgeLength - dist;\\nvar param : f32 = (diff * edgeStrength) / mass;\\nax = ax - direx * param;\\nay = ay - direy * param;}\\nreturn vec2<f32>(ax, ay);}\\nfn main() -> void {var i : i32 = globalInvocationID.x;\\nvar currentNode : vec4<f32> = gWebGPUBuffer0.u_Data[i];\\nvar movement : vec4<f32> = gWebGPUBuffer1.u_AveMovement[0];\\nvar ax : f32 = 0.0;\\nvar ay : f32 = 0.0;\\nif ((i >= __DefineValuePlaceholder__VERTEX_COUNT) || (movement.x < gWebGPUUniformParams.u_minMovement)) {gWebGPUBuffer0.u_Data[i] = currentNode;\\nreturn ;}\\nvar nodeAttributes1 : vec4<f32> = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\nvar nodeAttributes2 : vec4<f32> = gWebGPUBuffer3.u_NodeAttributeArray2[i];\\nvar repulsive : vec2<f32> = calcRepulsive(i, currentNode);\\nax = ax + repulsive.x;\\nay = ay + repulsive.y;\\nvar attractive : vec2<f32> = calcAttractive(i, currentNode, nodeAttributes1);\\nax = ax + attractive.x;\\nay = ay + attractive.y;\\nvar gravity : vec2<f32> = calcGravity(i, currentNode, nodeAttributes2);\\nax = ax - gravity.x;\\nay = ay - gravity.y;\\nvar param : f32 = gWebGPUUniformParams.u_interval * gWebGPUUniformParams.u_damping;\\nvar vx : f32 = ax * param;\\nvar vy : f32 = ay * param;\\nvar vlength : f32 = std::sqrt((vx * vx) + (vy * vy)) + 0.0001;\\nif (vlength > gWebGPUUniformParams.u_maxSpeed) {var param2 : f32 = gWebGPUUniformParams.u_maxSpeed / vlength;\\nvx = param2 * vx;\\nvy = param2 * vy;}\\nvar distx : f32 = vx * gWebGPUUniformParams.u_interval;\\nvar disty : f32 = vy * gWebGPUUniformParams.u_interval;\\nvar distLength : f32 = std::sqrt((distx * distx) + (disty * disty));\\nif ((nodeAttributes1.w != 0.0) && (nodeAttributes2.w != 0.0)) {gWebGPUBuffer0.u_Data[i] = vec4<f32>(nodeAttributes1.w, nodeAttributes2.w, currentNode.z, 0.0);}else {gWebGPUBuffer0.u_Data[i] = vec4<f32>(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength);}\\nreturn;}\\n\\nentry_point compute as \\"main\\" = main;\\n","GLSL450":"\\n\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\nivec3 workGroupSize = ivec3(1,1,1);\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\n\\nlayout(std140, set = 0, binding = 0) uniform GWebGPUParams {\\n float u_damping;\\n float u_maxSpeed;\\n float u_minMovement;\\n \\n float u_coulombDisScale;\\n float u_factor;\\n \\n \\n float u_interval;\\n} gWebGPUUniformParams;\\nlayout(std430, set = 0, binding = 1) buffer GWebGPUBuffer0 {\\n vec4 u_Data[];\\n} gWebGPUBuffer0;\\n\\nlayout(std430, set = 0, binding = 2) buffer readonly GWebGPUBuffer1 {\\n vec4 u_AveMovement[];\\n} gWebGPUBuffer1;\\n\\nlayout(std430, set = 0, binding = 3) buffer readonly GWebGPUBuffer2 {\\n vec4 u_NodeAttributeArray1[];\\n} gWebGPUBuffer2;\\n\\nlayout(std430, set = 0, binding = 4) buffer readonly GWebGPUBuffer3 {\\n vec4 u_NodeAttributeArray2[];\\n} gWebGPUBuffer3;\\n\\n\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define SHIFT_20 1048576.0\\nlayout (\\n local_size_x = 1,\\n local_size_y = 1,\\n local_size_z = 1\\n) in;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nivec2 unpack_float(float packedValue) {int packedIntValue = int(packedValue);\\nint v0 = packedIntValue / int(SHIFT_20);\\nreturn ivec2(v0, packedIntValue - (v0 * int(SHIFT_20)));}\\nvec2 calcRepulsive(int i, vec4 currentNode) {float ax = 0.0;\\nfloat ay = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = gWebGPUBuffer0.u_Data[j];\\nfloat vx = currentNode.x - nextNode.x;\\nfloat vy = currentNode.y - nextNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat n_dist = (dist + 0.1) * gWebGPUUniformParams.u_coulombDisScale;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nvec4 attributesi = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\nvec4 attributesj = gWebGPUBuffer2.u_NodeAttributeArray1[j];\\nfloat massi = attributesi.x;\\nfloat nodeStrengthi = attributesi.z;\\nfloat nodeStrengthj = attributesj.z;\\nfloat nodeStrength = (nodeStrengthi + nodeStrengthj) / 2.0;\\nfloat param = (nodeStrength * gWebGPUUniformParams.u_factor) / (n_dist * n_dist);\\nax += direx * param;\\nay += direy * param;}}\\nreturn vec2(ax, ay);}\\nvec2 calcGravity(int i, vec4 currentNode, vec4 attributes2) {float vx = currentNode.x - attributes2.x;\\nfloat vy = currentNode.y - attributes2.y;\\nfloat ax = vx * attributes2.z;\\nfloat ay = vy * attributes2.z;\\nreturn vec2(ax, ay);}\\nvec2 calcAttractive(int i, vec4 currentNode, vec4 attributes1) {float mass = attributes1.x;\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nivec2 compressed = unpack_float(currentNode.z);\\nint length = compressed.x;\\nint arr_offset = compressed.y;\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + (4 * p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = gWebGPUBuffer0.u_Data[int(arr_idx / 4)];}\\nfloat float_j = node_buffer.x;\\nvec4 nextNode = gWebGPUBuffer0.u_Data[int(float_j)];\\nfloat vx = nextNode.x - currentNode.x;\\nfloat vy = nextNode.y - currentNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nfloat edgeLength = node_buffer.y;\\nfloat edgeStrength = node_buffer.z;\\nfloat diff = edgeLength - dist;\\nfloat param = (diff * edgeStrength) / mass;\\nax -= direx * param;\\nay -= direy * param;}\\nreturn vec2(ax, ay);}\\nvoid main() {int i = globalInvocationID.x;\\nvec4 currentNode = gWebGPUBuffer0.u_Data[i];\\nvec4 movement = gWebGPUBuffer1.u_AveMovement[0];\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nif ((i >= VERTEX_COUNT) || (movement.x < gWebGPUUniformParams.u_minMovement)) {gWebGPUBuffer0.u_Data[i] = currentNode;\\nreturn ;}\\nvec4 nodeAttributes1 = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\nvec4 nodeAttributes2 = gWebGPUBuffer3.u_NodeAttributeArray2[i];\\nvec2 repulsive = calcRepulsive(i, currentNode);\\nax += repulsive.x;\\nay += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode, nodeAttributes1);\\nax += attractive.x;\\nay += attractive.y;\\nvec2 gravity = calcGravity(i, currentNode, nodeAttributes2);\\nax -= gravity.x;\\nay -= gravity.y;\\nfloat param = gWebGPUUniformParams.u_interval * gWebGPUUniformParams.u_damping;\\nfloat vx = ax * param;\\nfloat vy = ay * param;\\nfloat vlength = sqrt((vx * vx) + (vy * vy)) + 0.0001;\\nif (vlength > gWebGPUUniformParams.u_maxSpeed) {float param2 = gWebGPUUniformParams.u_maxSpeed / vlength;\\nvx = param2 * vx;\\nvy = param2 * vy;}\\nfloat distx = vx * gWebGPUUniformParams.u_interval;\\nfloat disty = vy * gWebGPUUniformParams.u_interval;\\nfloat distLength = sqrt((distx * distx) + (disty * disty));\\nif ((nodeAttributes1.w != 0.0) && (nodeAttributes2.w != 0.0)) {gWebGPUBuffer0.u_Data[i] = vec4(nodeAttributes1.w, nodeAttributes2.w, currentNode.z, 0.0);}else {gWebGPUBuffer0.u_Data[i] = vec4(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength);}}\\n","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define SHIFT_20 1048576.0\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_damping;\\nuniform float u_maxSpeed;\\nuniform float u_minMovement;\\nuniform sampler2D u_AveMovement;\\nuniform vec2 u_AveMovementSize;\\nvec4 getDatau_AveMovement(vec2 address2D) {\\n return vec4(texture2D(u_AveMovement, address2D).rgba);\\n}\\nvec4 getDatau_AveMovement(float address1D) {\\n return getDatau_AveMovement(addrTranslation_1Dto2D(address1D, u_AveMovementSize));\\n}\\nvec4 getDatau_AveMovement(int address1D) {\\n return getDatau_AveMovement(float(address1D));\\n}\\nuniform float u_coulombDisScale;\\nuniform float u_factor;\\nuniform sampler2D u_NodeAttributeArray1;\\nuniform vec2 u_NodeAttributeArray1Size;\\nvec4 getDatau_NodeAttributeArray1(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributeArray1, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributeArray1(float address1D) {\\n return getDatau_NodeAttributeArray1(addrTranslation_1Dto2D(address1D, u_NodeAttributeArray1Size));\\n}\\nvec4 getDatau_NodeAttributeArray1(int address1D) {\\n return getDatau_NodeAttributeArray1(float(address1D));\\n}\\nuniform sampler2D u_NodeAttributeArray2;\\nuniform vec2 u_NodeAttributeArray2Size;\\nvec4 getDatau_NodeAttributeArray2(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributeArray2, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributeArray2(float address1D) {\\n return getDatau_NodeAttributeArray2(addrTranslation_1Dto2D(address1D, u_NodeAttributeArray2Size));\\n}\\nvec4 getDatau_NodeAttributeArray2(int address1D) {\\n return getDatau_NodeAttributeArray2(float(address1D));\\n}\\nuniform float u_interval;\\nivec2 unpack_float(float packedValue) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint packedIntValue = int(packedValue);\\nint v0 = packedIntValue / int(SHIFT_20);\\nreturn ivec2(v0, packedIntValue - (v0 * int(SHIFT_20)));}\\nvec2 calcRepulsive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = getDatau_Data(j);\\nfloat vx = currentNode.x - nextNode.x;\\nfloat vy = currentNode.y - nextNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat n_dist = (dist + 0.1) * u_coulombDisScale;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nvec4 attributesi = getDatau_NodeAttributeArray1(i);\\nvec4 attributesj = getDatau_NodeAttributeArray1(j);\\nfloat massi = attributesi.x;\\nfloat nodeStrengthi = attributesi.z;\\nfloat nodeStrengthj = attributesj.z;\\nfloat nodeStrength = (nodeStrengthi + nodeStrengthj) / 2.0;\\nfloat param = (nodeStrength * u_factor) / (n_dist * n_dist);\\nax += direx * param;\\nay += direy * param;}}\\nreturn vec2(ax, ay);}\\nvec2 calcGravity(int i, vec4 currentNode, vec4 attributes2) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat vx = currentNode.x - attributes2.x;\\nfloat vy = currentNode.y - attributes2.y;\\nfloat ax = vx * attributes2.z;\\nfloat ay = vy * attributes2.z;\\nreturn vec2(ax, ay);}\\nvec2 calcAttractive(int i, vec4 currentNode, vec4 attributes1) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat mass = attributes1.x;\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nivec2 compressed = unpack_float(currentNode.z);\\nint length = compressed.x;\\nint arr_offset = compressed.y;\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + (4 * p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = getDatau_Data(int(arr_idx / 4));}\\nfloat float_j = node_buffer.x;\\nvec4 nextNode = getDatau_Data(int(float_j));\\nfloat vx = nextNode.x - currentNode.x;\\nfloat vy = nextNode.y - currentNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nfloat edgeLength = node_buffer.y;\\nfloat edgeStrength = node_buffer.z;\\nfloat diff = edgeLength - dist;\\nfloat param = (diff * edgeStrength) / mass;\\nax -= direx * param;\\nay -= direy * param;}\\nreturn vec2(ax, ay);}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 currentNode = getDatau_Data(i);\\nvec4 movement = getDatau_AveMovement(0.0);\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nif ((i >= VERTEX_COUNT) || (movement.x < u_minMovement)) {gl_FragColor = vec4(currentNode);\\nreturn ;}\\nvec4 nodeAttributes1 = getDatau_NodeAttributeArray1(i);\\nvec4 nodeAttributes2 = getDatau_NodeAttributeArray2(i);\\nvec2 repulsive = calcRepulsive(i, currentNode);\\nax += repulsive.x;\\nay += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode, nodeAttributes1);\\nax += attractive.x;\\nay += attractive.y;\\nvec2 gravity = calcGravity(i, currentNode, nodeAttributes2);\\nax -= gravity.x;\\nay -= gravity.y;\\nfloat param = u_interval * u_damping;\\nfloat vx = ax * param;\\nfloat vy = ay * param;\\nfloat vlength = sqrt((vx * vx) + (vy * vy)) + 0.0001;\\nif (vlength > u_maxSpeed) {float param2 = u_maxSpeed / vlength;\\nvx = param2 * vx;\\nvy = param2 * vy;}\\nfloat distx = vx * u_interval;\\nfloat disty = vy * u_interval;\\nfloat distLength = sqrt((distx * distx) + (disty * disty));\\nif ((nodeAttributes1.w != 0.0) && (nodeAttributes2.w != 0.0)) {gl_FragColor = vec4(vec4(nodeAttributes1.w, nodeAttributes2.w, currentNode.z, 0.0));}else {gl_FragColor = vec4(vec4(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength));}if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"MAX_EDGE_PER_VERTEX","type":"Float","runtime":true},{"name":"VERTEX_COUNT","type":"Float","runtime":true},{"name":"SHIFT_20","type":"Float","value":1048576,"runtime":false}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]},{"name":"u_damping","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_maxSpeed","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_minMovement","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AveMovement","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_coulombDisScale","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_factor","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributeArray1","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributeArray2","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_interval","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_Data","size":[1,1],"length":1},"needPingpong":true}}').setDispatch([u,1,1]).setBinding({u_Data:f,u_damping:n.damping,u_maxSpeed:n.maxSpeed,u_minMovement:n.minMovement,u_coulombDisScale:n.coulombDisScale,u_factor:n.factor,u_NodeAttributeArray1:w,u_NodeAttributeArray2:E,MAX_EDGE_PER_VERTEX:c,VERTEX_COUNT:u,u_AveMovement:I,u_interval:n.interval}),N=A.createKernel('{"shaders":{"WGSL":"import \\"GLSL.std.450\\" as std;\\n\\n\\n# var gWebGPUDebug : bool = false;\\n# var gWebGPUDebugOutput : vec4<f32> = vec4<f32>(0.0);\\n\\n[[builtin global_invocation_id]] var<in> globalInvocationID : vec3<u32>;\\n# [[builtin work_group_size]] var<in> workGroupSize : vec3<u32>;\\n# [[builtin work_group_id]] var<in> workGroupID : vec3<u32>;\\n[[builtin local_invocation_id]] var<in> localInvocationID : vec3<u32>;\\n# [[builtin num_work_groups]] var<in> numWorkGroups : vec3<u32>;\\n[[builtin local_invocation_idx]] var<in> localInvocationIndex : u32;\\n\\ntype GWebGPUParams = [[block]] struct {\\n [[offset 0]] u_iter : f32;\\n};\\n[[binding 0, set 0]] var<uniform> gWebGPUUniformParams : GWebGPUParams;\\ntype GWebGPUBuffer0 = [[block]] struct {\\n [[offset 0]] u_Data : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 1, set 0]] var<storage_buffer> gWebGPUBuffer0 : GWebGPUBuffer0;\\ntype GWebGPUBuffer1 = [[block]] struct {\\n [[offset 0]] u_AveMovement : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 2, set 0]] var<storage_buffer> gWebGPUBuffer1 : GWebGPUBuffer1;\\n\\n\\n\\n\\n\\n\\n\\n\\nfn main() -> void {var movement : f32 = 0.0;\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {var vertex : vec4<f32> = gWebGPUBuffer0.u_Data[j];\\nmovement = movement + vertex.w;}\\nmovement = movement / f32(__DefineValuePlaceholder__VERTEX_COUNT);\\ngWebGPUBuffer1.u_AveMovement[0] = vec4<f32>(movement, 0.0, 0.0, 0.0);\\nreturn;}\\n\\nentry_point compute as \\"main\\" = main;\\n","GLSL450":"\\n\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\nivec3 workGroupSize = ivec3(1,1,1);\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\n\\nlayout(std140, set = 0, binding = 0) uniform GWebGPUParams {\\n float u_iter;\\n} gWebGPUUniformParams;\\nlayout(std430, set = 0, binding = 1) buffer readonly GWebGPUBuffer0 {\\n vec4 u_Data[];\\n} gWebGPUBuffer0;\\n\\nlayout(std430, set = 0, binding = 2) buffer GWebGPUBuffer1 {\\n vec4 u_AveMovement[];\\n} gWebGPUBuffer1;\\n\\n\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\nlayout (\\n local_size_x = 1,\\n local_size_y = 1,\\n local_size_z = 1\\n) in;\\n\\n\\n\\nvoid main() {float movement = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 vertex = gWebGPUBuffer0.u_Data[j];\\nmovement += vertex.w;}\\nmovement = movement / float(VERTEX_COUNT);\\ngWebGPUBuffer1.u_AveMovement[0] = vec4(movement, 0.0, 0.0, 0.0);}\\n","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_iter;\\nuniform sampler2D u_AveMovement;\\nuniform vec2 u_AveMovementSize;\\nvec4 getDatau_AveMovement(vec2 address2D) {\\n return vec4(texture2D(u_AveMovement, address2D).rgba);\\n}\\nvec4 getDatau_AveMovement(float address1D) {\\n return getDatau_AveMovement(addrTranslation_1Dto2D(address1D, u_AveMovementSize));\\n}\\nvec4 getDatau_AveMovement(int address1D) {\\n return getDatau_AveMovement(float(address1D));\\n}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat movement = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 vertex = getDatau_Data(j);\\nmovement += vertex.w;}\\nmovement = movement / float(VERTEX_COUNT);\\ngl_FragColor = vec4(vec4(movement, 0.0, 0.0, 0.0));if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"VERTEX_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_iter","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AveMovement","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_AveMovement","size":[1,1],"length":1},"needPingpong":true}}').setDispatch([1,1,1]).setBinding({u_Data:f,VERTEX_COUNT:u,u_AveMovement:[0,0,0,0]}),k=function(){return Jh(R,void 0,void 0,(function(){var i,a,u;return Qh(this,(function(s){switch(s.label){case 0:i=0,s.label=1;case 1:return i<o?[4,D.execute()]:[3,5];case 2:return s.sent(),N.setBinding({u_Data:D}),[4,N.execute()];case 3:s.sent(),a=Math.max(.02,n.interval-.002*i),D.setBinding({u_interval:a,u_AveMovement:N}),s.label=4;case 4:return i++,[3,1];case 5:return[4,D.getOutput()];case 6:return u=s.sent(),t?e.postMessage({type:It,vertexEdgeData:u}):r.forEach((function(t,e){var n=u[4*e],r=u[4*e+1];t.x=n,t.y=r})),T&&T(),[2]}}))}))},[4,k()];case 1:return O.sent(),[2]}}))}))},e.prototype.getType=function(){return"gForce-gpu"},e}(t),ed=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),nd=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.maxIteration=100,n.gravity=10,n.comboGravity=10,n.linkDistance=10,n.alpha=1,n.alphaMin=.001,n.alphaDecay=1-Math.pow(n.alphaMin,1/300),n.alphaTarget=0,n.velocityDecay=.6,n.edgeStrength=.6,n.nodeStrength=30,n.preventOverlap=!1,n.preventNodeOverlap=!1,n.preventComboOverlap=!1,n.collideStrength=void 0,n.nodeCollideStrength=.5,n.comboCollideStrength=.5,n.comboSpacing=20,n.comboPadding=10,n.optimizeRangeFactor=1,n.onTick=function(){},n.onLayoutEnd=function(){},n.depthAttractiveForceScale=1,n.depthRepulsiveForceScale=2,n.nodes=[],n.edges=[],n.combos=[],n.comboTrees=[],n.width=300,n.height=300,n.bias=[],n.nodeMap={},n.oriComboMap={},n.indexMap={},n.comboMap={},n.previousLayouted=!1,n.updateCfg(e),n}return ed(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:100,center:[0,0],gravity:10,speed:1,comboGravity:30,preventOverlap:!1,preventComboOverlap:!0,preventNodeOverlap:!0,nodeSpacing:void 0,collideStrength:void 0,nodeCollideStrength:.5,comboCollideStrength:.5,comboSpacing:20,comboPadding:10,edgeStrength:.6,nodeStrength:30,linkDistance:10}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.center;if(t.comboTree={id:"comboTreeRoot",depth:-1,children:t.comboTrees},e&&0!==e.length){if(1===e.length)return e[0].x=n[0],e[0].y=n[1],void(t.onLayoutEnd&&t.onLayoutEnd());t.initVals(),t.run(),t.onLayoutEnd&&t.onLayoutEnd()}else t.onLayoutEnd&&t.onLayoutEnd()},e.prototype.run=function(){var t=this,e=t.nodes,n=t.previousLayouted?t.maxIteration/5:t.maxIteration;t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight);var r=t.center,i=t.velocityDecay,o=t.comboMap;t.previousLayouted||t.initPos(o);for(var u=function(n){var r=[];e.forEach((function(t,e){r[e]={x:0,y:0}})),t.applyCalculate(r),t.applyComboCenterForce(r),e.forEach((function(t,e){a(t.x)&&a(t.y)&&(t.x+=r[e].x*i,t.y+=r[e].y*i)})),t.alpha+=(t.alphaTarget-t.alpha)*t.alphaDecay,t.onTick()},s=0;s<n;s++)u();var c=[0,0];e.forEach((function(t){a(t.x)&&a(t.y)&&(c[0]+=t.x,c[1]+=t.y)})),c[0]/=e.length,c[1]/=e.length;var f=[r[0]-c[0],r[1]-c[1]];e.forEach((function(t,e){a(t.x)&&a(t.y)&&(t.x+=f[0],t.y+=f[1])})),t.combos.forEach((function(t){var e=o[t.id];e&&e.empty&&(t.x=e.cx||t.x,t.y=e.cy||t.y)})),t.previousLayouted=!0},e.prototype.initVals=function(){var t=this,e=t.edges,n=t.nodes,r=t.combos,i={},u={},s={};n.forEach((function(t,e){u[t.id]=t,s[t.id]=e})),t.nodeMap=u,t.indexMap=s;var c={};r.forEach((function(t){c[t.id]=t})),t.oriComboMap=c,t.comboMap=t.getComboMap();var f=t.preventOverlap;t.preventComboOverlap=t.preventComboOverlap||f,t.preventNodeOverlap=t.preventNodeOverlap||f;var h=t.collideStrength;h&&(t.comboCollideStrength=h,t.nodeCollideStrength=h),t.comboCollideStrength=t.comboCollideStrength?t.comboCollideStrength:0,t.nodeCollideStrength=t.nodeCollideStrength?t.nodeCollideStrength:0;for(var p=0;p<e.length;++p){var v=d(e[p],"source"),g=d(e[p],"target");i[v]?i[v]++:i[v]=1,i[g]?i[g]++:i[g]=1}var y=[];for(p=0;p<e.length;++p)v=d(e[p],"source"),g=d(e[p],"target"),y[p]=i[v]/(i[v]+i[g]);this.bias=y;var m,_,x=t.nodeSize,w=t.nodeSpacing;if(_=a(w)?function(){return w}:b(w)?w:function(){return 0},this.nodeSpacing=_,x)if(b(x))m=function(t){return x(t)};else if(o(x)){var E=(x[0]>x[1]?x[0]:x[1])/2;m=function(t){return E}}else{var S=x/2;m=function(t){return S}}else m=function(t){return t.size?o(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])/2:l(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)/2:t.size/2:10};this.nodeSize=m;var A,T=t.comboSpacing;A=a(T)?function(){return T}:b(T)?T:function(){return 0},this.comboSpacing=A;var I,C=t.comboPadding;I=a(C)?function(){return C}:o(C)?function(){return Math.max.apply(null,C)}:b(C)?C:function(){return 0},this.comboPadding=I;var D,N=this.linkDistance;N||(N=10),D=a(N)?function(t){return N}:N,this.linkDistance=D;var k,R=this.edgeStrength;R||(R=1),k=a(R)?function(t){return R}:R,this.edgeStrength=k;var O,M=this.nodeStrength;M||(M=30),O=a(M)?function(t){return M}:M,this.nodeStrength=O},e.prototype.initPos=function(t){this.nodes.forEach((function(e,n){var r=e.comboId,i=t[r];r&&i?(e.x=i.cx+100/(n+1),e.y=i.cy+100/(n+1)):(e.x=100/(n+1),e.y=100/(n+1))}))},e.prototype.getComboMap=function(){var t=this,e=t.nodeMap,n=t.comboTrees,r=t.oriComboMap,i={};return(n||[]).forEach((function(n){var o=[];m(n,(function(n){if("node"===n.itemType)return!0;if(!r[n.id])return!0;if(void 0===i[n.id]){var u={id:n.id,name:n.id,cx:0,cy:0,count:0,depth:t.oriComboMap[n.id].depth||0,children:[]};i[n.id]=u}var s=n.children;s&&s.forEach((function(t){if(!i[t.id]&&!e[t.id])return!0;o.push(t)}));var c=i[n.id];if(c.cx=0,c.cy=0,0===o.length){c.empty=!0;var f=r[n.id];c.cx=f.x,c.cy=f.y}return o.forEach((function(t){if(c.count++,"node"!==t.itemType){var n=i[t.id];return a(n.cx)&&(c.cx+=n.cx),void(a(n.cy)&&(c.cy+=n.cy))}var r=e[t.id];r&&(a(r.x)&&(c.cx+=r.x),a(r.y)&&(c.cy+=r.y))})),c.cx/=c.count||1,c.cy/=c.count||1,c.children=o,!0}))})),i},e.prototype.applyComboCenterForce=function(t){var e=this,n=e.gravity,r=e.comboGravity||n,i=this.alpha,o=e.comboTrees,u=e.indexMap,s=e.nodeMap,c=e.comboMap;(o||[]).forEach((function(e){m(e,(function(e){if("node"===e.itemType)return!0;if(!c[e.id])return!0;var n=c[e.id],o=(n.depth+1)/10*.5,f=n.cx,l=n.cy;return n.cx=0,n.cy=0,n.children.forEach((function(e){if("node"!==e.itemType){var h=c[e.id];return h&&a(h.cx)&&(n.cx+=h.cx),void(h&&a(h.cy)&&(n.cy+=h.cy))}var d=s[e.id],p=d.x-f||.005,v=d.y-l||.005,g=Math.sqrt(p*p+v*v),y=u[d.id],m=r*i/g*o;t[y].x-=p*m,t[y].y-=v*m,a(d.x)&&(n.cx+=d.x),a(d.y)&&(n.cy+=d.y)})),n.cx/=n.count||1,n.cy/=n.count||1,!0}))}))},e.prototype.applyCalculate=function(t){var e=this,n=e.comboMap,r=e.nodes,i={};r.forEach((function(t,e){r.forEach((function(n,r){if(!(e<r)){var o=t.x-n.x||.005,a=t.y-n.y||.005,u=o*o+a*a,s=Math.sqrt(u);u<1&&(u=s),i[t.id+"-"+n.id]={vx:o,vy:a,vl2:u,vl:s},i[n.id+"-"+t.id]={vl2:u,vl:s,vx:-o,vy:-a}}}))})),e.updateComboSizes(n),e.calRepulsive(t,i),e.calAttractive(t,i),e.preventComboOverlap&&e.comboNonOverlapping(t,n)},e.prototype.updateComboSizes=function(t){var e=this,n=e.comboTrees,r=e.nodeMap,i=e.nodeSize,a=e.comboSpacing,u=e.comboPadding;(n||[]).forEach((function(n){var s=[];m(n,(function(n){if("node"===n.itemType)return!0;var c=t[n.id];if(!c)return!1;var f=n.children;f&&f.forEach((function(e){(t[e.id]||r[e.id])&&s.push(e)})),c.minX=1/0,c.minY=1/0,c.maxX=-1/0,c.maxY=-1/0,s.forEach((function(t){if("node"!==t.itemType)return!0;var e=r[t.id];if(!e)return!0;var n=i(e),o=e.x-n,a=e.y-n,u=e.x+n,s=e.y+n;c.minX>o&&(c.minX=o),c.minY>a&&(c.minY=a),c.maxX<u&&(c.maxX=u),c.maxY<s&&(c.maxY=s)}));var l=e.oriComboMap[n.id].size||10;o(l)&&(l=l[0]);var h=Math.max(c.maxX-c.minX,c.maxY-c.minY,l);return c.r=h/2+a(c)/2+u(c),!0}))}))},e.prototype.comboNonOverlapping=function(t,e){var n=this,r=n.comboTree,i=n.comboCollideStrength,o=n.indexMap,a=n.nodeMap;m(r,(function(n){if(!e[n.id]&&!a[n.id]&&"comboTreeRoot"!==n.id)return!1;var r=n.children;return r&&r.length>1&&r.forEach((function(n,u){if("node"===n.itemType)return!1;var s=e[n.id];s&&r.forEach((function(r,c){if(u<=c)return!1;if("node"===r.itemType)return!1;var f=e[r.id];if(!f)return!1;var l=s.cx-f.cx||.005,h=s.cy-f.cy||.005,d=l*l+h*h,p=s.r||1,v=f.r||1,g=p+v,y=v*v,m=p*p;if(d<g*g){var b=n.children;if(!b||0===b.length)return!1;var _=r.children;if(!_||0===_.length)return!1;var x=Math.sqrt(d),w=(g-x)/x*i,E=l*w,S=h*w,A=y/(m+y),T=1-A;b.forEach((function(e){if("node"!==e.itemType)return!1;if(a[e.id]){var n=o[e.id];_.forEach((function(e){if("node"!==e.itemType)return!1;if(!a[e.id])return!1;var r=o[e.id];t[n].x+=E*A,t[n].y+=S*A,t[r].x-=E*T,t[r].y-=S*T}))}}))}}))})),!0}))},e.prototype.calRepulsive=function(t,e){var n=this,r=n.nodes,i=n.width*n.optimizeRangeFactor,o=n.nodeStrength,a=n.alpha,u=n.nodeCollideStrength,s=n.preventNodeOverlap,c=n.nodeSize,f=n.nodeSpacing,l=n.depthRepulsiveForceScale,h=n.center;r.forEach((function(d,p){if(d.x&&d.y){if(h){var v=n.gravity,g=d.x-h[0]||.005,y=d.y-h[1]||.005,m=Math.sqrt(g*g+y*y);t[p].x-=g*v*a/m,t[p].y-=y*v*a/m}r.forEach((function(n,r){if(p!==r&&n.x&&n.y){var h=e[d.id+"-"+n.id],v=h.vl2,g=h.vl;if(!(g>i)){var y=e[d.id+"-"+n.id],m=y.vx,b=y.vy,_=Math.log(Math.abs(n.depth-d.depth)/10)+1||1;_=_<1?1:_,n.comboId!==d.comboId&&(_+=1);var x=_?Math.pow(l,_):1,w=o(n)*a/v*x;if(t[p].x+=m*w,t[p].y+=b*w,p<r&&s){var E=c(d)+f(d)||1,S=c(n)+f(n)||1,A=E+S;if(v<A*A){var T=(A-g)/g*u,I=S*S,C=I/(E*E+I),D=m*T,N=b*T;t[p].x+=D*C,t[p].y+=N*C,C=1-C,t[r].x-=D*C,t[r].y-=N*C}}}}}))}}))},e.prototype.calAttractive=function(t,e){var n=this,r=n.edges,i=n.linkDistance,o=n.alpha,u=n.edgeStrength,s=n.bias,c=n.depthAttractiveForceScale;r.forEach((function(r,f){var l=d(r,"source"),h=d(r,"target");if(l&&h&&l!==h){var p=n.indexMap[l],v=n.indexMap[h],g=n.nodeMap[l],y=n.nodeMap[h];if(g&&y){var m=g.depth===y.depth?0:Math.log(Math.abs(g.depth-y.depth)/10);g.comboId===y.comboId&&(m/=2);var b=m?Math.pow(c,m):1;if(g.comboId!==y.comboId&&1===b?b=c/2:g.comboId===y.comboId&&(b=2),a(y.x)&&a(g.x)&&a(y.y)&&a(g.y)){var _=e[h+"-"+l],x=_.vl,w=_.vx,E=_.vy,S=(x-i(r))/x*o*u(r)*b,A=w*S,T=E*S,I=s[f];t[v].x-=A*I,t[v].y-=T*I,t[p].x+=A*(1-I),t[p].y+=T*(1-I)}}}}))},e.prototype.getType=function(){return"comboForce"},e}(t),rd=function(){function t(t){this.id=t.id||0,this.rx=t.rx,this.ry=t.ry,this.fx=0,this.fy=0,this.mass=t.mass,this.degree=t.degree,this.g=t.g||0}return t.prototype.distanceTo=function(t){var e=this.rx-t.rx,n=this.ry-t.ry;return Math.hypot(e,n)},t.prototype.setPos=function(t,e){this.rx=t,this.ry=e},t.prototype.resetForce=function(){this.fx=0,this.fy=0},t.prototype.addForce=function(t){var e=t.rx-this.rx,n=t.ry-this.ry,r=Math.hypot(e,n);r=r<1e-4?1e-4:r;var i=this.g*(this.degree+1)*(t.degree+1)/r;this.fx+=i*e/r,this.fy+=i*n/r},t.prototype.in=function(t){return t.contains(this.rx,this.ry)},t.prototype.add=function(e){var n=this.mass+e.mass;return new t({rx:(this.rx*this.mass+e.rx*e.mass)/n,ry:(this.ry*this.mass+e.ry*e.mass)/n,mass:n,degree:this.degree+e.degree})},t}();const id=rd;const od=function(){function t(t){this.xmid=t.xmid,this.ymid=t.ymid,this.length=t.length,this.massCenter=t.massCenter||[0,0],this.mass=t.mass||1}return t.prototype.getLength=function(){return this.length},t.prototype.contains=function(t,e){var n=this.length/2;return t<=this.xmid+n&&t>=this.xmid-n&&e<=this.ymid+n&&e>=this.ymid-n},t.prototype.NW=function(){return new t({xmid:this.xmid-this.length/4,ymid:this.ymid+this.length/4,length:this.length/2})},t.prototype.NE=function(){return new t({xmid:this.xmid+this.length/4,ymid:this.ymid+this.length/4,length:this.length/2})},t.prototype.SW=function(){return new t({xmid:this.xmid-this.length/4,ymid:this.ymid-this.length/4,length:this.length/2})},t.prototype.SE=function(){return new t({xmid:this.xmid+this.length/4,ymid:this.ymid-this.length/4,length:this.length/2})},t}(),ad=function(){function t(t){this.body=null,this.quad=null,this.NW=null,this.NE=null,this.SW=null,this.SE=null,this.theta=.5,null!=t&&(this.quad=t)}return t.prototype.insert=function(e){null!=this.body?this._isExternal()?(this.quad&&(this.NW=new t(this.quad.NW()),this.NE=new t(this.quad.NE()),this.SW=new t(this.quad.SW()),this.SE=new t(this.quad.SE())),this._putBody(this.body),this._putBody(e),this.body=this.body.add(e)):(this.body=this.body.add(e),this._putBody(e)):this.body=e},t.prototype._putBody=function(t){this.quad&&(t.in(this.quad.NW())&&this.NW?this.NW.insert(t):t.in(this.quad.NE())&&this.NE?this.NE.insert(t):t.in(this.quad.SW())&&this.SW?this.SW.insert(t):t.in(this.quad.SE())&&this.SE&&this.SE.insert(t))},t.prototype._isExternal=function(){return null==this.NW&&null==this.NE&&null==this.SW&&null==this.SE},t.prototype.updateForce=function(t){null!=this.body&&t!==this.body&&(this._isExternal()||(this.quad?this.quad.getLength():0)/this.body.distanceTo(t)<this.theta?t.addForce(this.body):(this.NW&&this.NW.updateForce(t),this.NE&&this.NE.updateForce(t),this.SW&&this.SW.updateForce(t),this.SE&&this.SE.updateForce(t)))},t}();var ud=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),sd=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.width=300,n.height=300,n.nodes=[],n.edges=[],n.kr=5,n.kg=1,n.mode="normal",n.preventOverlap=!1,n.dissuadeHubs=!1,n.barnesHut=void 0,n.maxIteration=0,n.ks=.1,n.ksmax=10,n.tao=.1,n.onLayoutEnd=function(){},n.prune=void 0,n.updateCfg(e),n}return ud(e,t),e.prototype.getDefaultCfg=function(){return{}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.onLayoutEnd,r=t.prune,i=t.maxIteration;t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight);for(var u=[],s=e.length,c=0;c<s;c+=1){var f=e[c],h=10,d=10;a(f.size)&&(h=f.size,d=f.size),o(f.size)?(isNaN(f.size[0])||(h=f.size[0]),isNaN(f.size[1])||(d=f.size[1])):l(f.size)&&(h=f.size.width,d=f.size.height),t.getWidth&&!isNaN(t.getWidth(f))&&(d=t.getWidth(f)),t.getHeight&&!isNaN(t.getHeight(f))&&(h=t.getHeight(f));var p=Math.max(h,d);u.push(p)}void 0===t.barnesHut&&s>250&&(t.barnesHut=!0),void 0===t.prune&&s>100&&(t.prune=!0),0!==this.maxIteration||t.prune?0===this.maxIteration&&r&&(i=100,s<=200&&s>100?i=500:s>200&&(i=950),this.maxIteration=i):(i=250,s<=200&&s>100?i=1e3:s>200&&(i=1200),this.maxIteration=i),t.kr||(t.kr=50,s>100&&s<=500?t.kr=20:s>500&&(t.kr=1)),t.kg||(t.kg=20,s>100&&s<=500?t.kg=10:s>500&&(t.kg=1)),this.nodes=t.updateNodesByForces(u),n()},e.prototype.updateNodesByForces=function(t){for(var e=this,n=e.edges,r=e.maxIteration,i=e.nodes,o=n.filter((function(t){return d(t,"source")!==d(t,"target")})),a=i.length,u=o.length,s=[],c={},f={},l=[],h=0;h<a;h+=1)c[i[h].id]=h,s[h]=0,(void 0===i[h].x||isNaN(i[h].x))&&(i[h].x=1e3*Math.random()),(void 0===i[h].y||isNaN(i[h].y))&&(i[h].y=1e3*Math.random()),l.push({x:i[h].x,y:i[h].y});for(h=0;h<u;h+=1){for(var p=void 0,v=void 0,g=0,y=0,m=0;m<a;m+=1){var b=d(o[h],"source"),_=d(o[h],"target");i[m].id===b?(p=i[m],g=m):i[m].id===_&&(v=i[m],y=m),f[h]={sourceIdx:g,targetIdx:y}}p&&(s[c[p.id]]+=1),v&&(s[c[v.id]]+=1)}var x=r;if(i=this.iterate(x,c,f,u,s,t),e.prune){for(m=0;m<u;m+=1)s[f[m].sourceIdx]<=1?(i[f[m].sourceIdx].x=i[f[m].targetIdx].x,i[f[m].sourceIdx].y=i[f[m].targetIdx].y):s[f[m].targetIdx]<=1&&(i[f[m].targetIdx].x=i[f[m].sourceIdx].x,i[f[m].targetIdx].y=i[f[m].sourceIdx].y);e.prune=!1,e.barnesHut=!1,x=100,i=this.iterate(x,c,f,u,s,t)}return i},e.prototype.iterate=function(t,e,n,r,i,o){for(var a=this,u=a.nodes,s=a.kr,c=a.preventOverlap,f=a.barnesHut,l=u.length,h=0,d=t,p=[],v=[],g=[],y=0;y<l;y+=1)if(p[2*y]=0,p[2*y+1]=0,f){var m={id:y,rx:u[y].x,ry:u[y].y,mass:1,g:s,degree:i[y]};g[y]=new id(m)}for(;d>0;){for(y=0;y<l;y+=1)v[2*y]=p[2*y],v[2*y+1]=p[2*y+1],p[2*y]=0,p[2*y+1]=0;p=this.getAttrForces(d,50,r,e,n,i,o,p),p=f&&(c&&d>50||!c)?this.getOptRepGraForces(p,g,i):this.getRepGraForces(d,50,p,100,o,i);var b=this.updatePos(p,v,h,i);u=b.nodes,h=b.sg,d--,a.tick&&a.tick()}return u},e.prototype.getAttrForces=function(t,e,n,r,i,o,a,u){for(var s=this,c=s.nodes,f=s.preventOverlap,l=s.dissuadeHubs,h=s.mode,d=s.prune,p=0;p<n;p+=1){var v=c[i[p].sourceIdx],g=i[p].sourceIdx,y=c[i[p].targetIdx],m=i[p].targetIdx;if(!d||!(o[g]<=1||o[m]<=1)){var b=[y.x-v.x,y.y-v.y],_=Math.hypot(b[0],b[1]);_=_<1e-4?1e-4:_,b[0]=b[0]/_,b[1]=b[1]/_,f&&t<e&&(_=_-a[g]-a[m]);var x=_,w=x;"linlog"===h&&(w=x=Math.log(1+_)),l&&(x=_/o[g],w=_/o[m]),f&&t<e&&_<=0?(x=0,w=0):f&&t<e&&_>0&&(x=_,w=_),u[2*r[v.id]]+=x*b[0],u[2*r[y.id]]-=w*b[0],u[2*r[v.id]+1]+=x*b[1],u[2*r[y.id]+1]-=w*b[1]}}return u},e.prototype.getRepGraForces=function(t,e,n,r,i,o){for(var a=this,u=a.nodes,s=a.preventOverlap,c=a.kr,f=a.kg,l=a.center,h=a.prune,d=u.length,p=0;p<d;p+=1){for(var v=p+1;v<d;v+=1)if(!h||!(o[p]<=1||o[v]<=1)){var g=[u[v].x-u[p].x,u[v].y-u[p].y],y=Math.hypot(g[0],g[1]);y=y<1e-4?1e-4:y,g[0]=g[0]/y,g[1]=g[1]/y,s&&t<e&&(y=y-i[p]-i[v]);var m=c*(o[p]+1)*(o[v]+1)/y;s&&t<e&&y<0?m=r*(o[p]+1)*(o[v]+1):s&&t<e&&0===y?m=0:s&&t<e&&y>0&&(m=c*(o[p]+1)*(o[v]+1)/y),n[2*p]-=m*g[0],n[2*v]+=m*g[0],n[2*p+1]-=m*g[1],n[2*v+1]+=m*g[1]}var b=[u[p].x-l[0],u[p].y-l[1]],_=Math.hypot(b[0],b[1]);b[0]=b[0]/_,b[1]=b[1]/_;var x=f*(o[p]+1);n[2*p]-=x*b[0],n[2*p+1]-=x*b[1]}return n},e.prototype.getOptRepGraForces=function(t,e,n){for(var r=this,i=r.nodes,o=r.kg,a=r.center,u=r.prune,s=i.length,c=9e10,f=-9e10,l=9e10,h=-9e10,d=0;d<s;d+=1)u&&n[d]<=1||(e[d].setPos(i[d].x,i[d].y),i[d].x>=f&&(f=i[d].x),i[d].x<=c&&(c=i[d].x),i[d].y>=h&&(h=i[d].y),i[d].y<=l&&(l=i[d].y));var p=Math.max(f-c,h-l),v=new od({xmid:(f+c)/2,ymid:(h+l)/2,length:p,massCenter:a,mass:s}),g=new ad(v);for(d=0;d<s;d+=1)u&&n[d]<=1||e[d].in(v)&&g.insert(e[d]);for(d=0;d<s;d+=1)if(!(u&&n[d]<=1)){e[d].resetForce(),g.updateForce(e[d]),t[2*d]-=e[d].fx,t[2*d+1]-=e[d].fy;var y=[i[d].x-a[0],i[d].y-a[1]],m=Math.hypot(y[0],y[1]);m=m<1e-4?1e-4:m,y[0]=y[0]/m,y[1]=y[1]/m;var b=o*(n[d]+1);t[2*d]-=b*y[0],t[2*d+1]-=b*y[1]}return t},e.prototype.updatePos=function(t,e,n,r){for(var i=this,o=i.nodes,a=i.ks,u=i.tao,s=i.prune,c=i.ksmax,f=o.length,l=[],h=[],d=0,p=0,v=0;v<f;v+=1)if(!(s&&r[v]<=1)){var g=[t[2*v]-e[2*v],t[2*v+1]-e[2*v+1]],y=Math.hypot(g[0],g[1]),m=[t[2*v]+e[2*v],t[2*v+1]+e[2*v+1]],b=Math.hypot(m[0],m[1]);l[v]=y,h[v]=b/2,d+=(r[v]+1)*l[v],p+=(r[v]+1)*h[v]}var _=n;for(n=u*p/d,0!==_&&(n=n>1.5*_?1.5*_:n),v=0;v<f;v+=1)if(!(s&&r[v]<=1)){var x=a*n/(1+n*Math.sqrt(l[v])),w=Math.hypot(t[2*v],t[2*v+1]),E=c/(w=w<1e-4?1e-4:w),S=(x=x>E?E:x)*t[2*v],A=x*t[2*v+1];o[v].x+=S,o[v].y+=A}return{nodes:o,sg:n}},e}(t),cd=function(){return cd=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},cd.apply(this,arguments)},fd=function(){function t(){this.cells=[],this.columnNum=0,this.rowNum=0,this.additionColumn=[],this.additionRow=[]}return t.prototype.init=function(e,n,r){this.cells=[],this.CELL_W=r.CELL_W||t.DEFAULT_CELL_W,this.CELL_H=r.CELL_H||t.DEFAULT_CELL_H,this.columnNum=Math.ceil(e/this.CELL_W),this.rowNum=Math.ceil(n/this.CELL_H),t.MIN_DIST=Math.pow(e,2)+Math.pow(n,2);for(var i=0;i<this.columnNum;i++){for(var o=[],a=0;a<this.rowNum;a++){var u={dx:i,dy:a,x:i*this.CELL_W,y:a*this.CELL_H,occupied:!1};o.push(u)}this.cells.push(o)}},t.prototype.findGridByNodeId=function(t){for(var e,n,r=0;r<this.columnNum;r++)for(var i=0;i<this.rowNum;i++)if(this.cells[r][i].node&&(null===(n=null===(e=this.cells[r][i])||void 0===e?void 0:e.node)||void 0===n?void 0:n.id)===t)return{column:r,row:i};return null},t.prototype.sqdist=function(t,e){return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)},t.prototype.occupyNearest=function(e){for(var n,r=t.MIN_DIST,i=null,o=0;o<this.columnNum;o++)for(var a=0;a<this.rowNum;a++)!this.cells[o][a].occupied&&(n=this.sqdist(e,this.cells[o][a]))<r&&(r=n,i=this.cells[o][a]);return i&&(i.occupied=!0),i},t.prototype.insertColumn=function(t,e){if(!(e<=0)){for(var n=0;n<e;n++){this.cells[n+this.columnNum]=[];for(var r=0;r<this.rowNum;r++)this.cells[n+this.columnNum][r]={dx:n,dy:r,x:n*this.CELL_W,y:r*this.CELL_H,occupied:!1,node:null}}for(n=this.columnNum-1;n>t;n--)for(r=0;r<this.rowNum;r++)this.cells[n+e][r]=cd(cd({},this.cells[n][r]),{x:(n+e)*this.CELL_W,y:r*this.CELL_H}),this.cells[n][r]={x:n*this.CELL_W,y:r*this.CELL_H,occupied:!0,node:null};for(r=0;r<this.additionColumn.length;r++)this.additionColumn[r]>=t&&(this.additionColumn[r]+=e);for(n=0;n<e;n++)this.additionColumn.push(t+n+1);this.columnNum+=e}},t.prototype.insertRow=function(t,e){if(!(e<=0)){for(var n=0;n<e;n++)for(var r=0;r<this.columnNum;r++)this.cells[r][n+this.rowNum]={dx:r,dy:n,x:r*this.CELL_W,y:n*this.CELL_H,occupied:!1,node:null};for(r=0;r<this.columnNum;r++)for(n=this.rowNum-1;n>t;n--)this.cells[r][n+e]=cd(cd({},this.cells[r][n]),{dx:r,dy:n+e,x:r*this.CELL_W,y:(n+e)*this.CELL_H}),this.cells[r][n]={dx:r,dy:n,x:r*this.CELL_W,y:n*this.CELL_H,occupied:!1,node:null};for(n=0;n<this.additionRow.length;n++)this.additionRow[n]>=t&&(this.additionRow[n]+=e);for(r=0;r<e;r++)this.additionRow.push(t+r+1);this.rowNum+=e}},t.prototype.getNodes=function(){for(var t=[],e=0;e<this.columnNum;e++)for(var n=0;n<this.rowNum;n++)this.cells[e][n].node&&t.push(this.cells[e][n]);return t},t.MIN_DIST=50,t.DEFAULT_CELL_W=80,t.DEFAULT_CELL_H=80,t}();const ld=fd;var hd=1e7,dd=1.5707963267948966,pd=new Map,vd=.8;function gd(t,e){var n=(pd.get(t.id)||[]).find((function(t){return t.source===e.id||t.target===e.id})),r=t.size[0]*t.size[1],i=e.size[0]*e.size[1],o=r>i?e:t,a=r>i?t:e,u=o.x-o.size[0]/2,s=o.y-o.size[1]/2,c=o.x+o.size[0]/2,f=o.y+o.size[1]/2,l=a.x-a.size[0]/2,h=a.y-a.size[1]/2,d=a.x+a.size[0]/2,p=a.y+a.size[1]/2,v=o.x,g=o.y,y=a.x,m=a.y,b=0,_=0;if(c>=l&&d>=u&&f>=h&&p>=s)0===(_=Math.sqrt(Math.pow(y-v,2)+Math.pow(m-g,2)))&&(_=1e-7),b=10/_*100+((c<d?c:d)-(u>l?u:l))*((f<p?f:p)-(s>h?s:h)),b*=hd;else{var x=!1,w=function(t,e,n){var r=t.x-t.size[0]/2,i=t.y-t.size[1]/2,o=t.x+t.size[0]/2,a=t.y+t.size[1]/2,u=e.x-e.size[0]/2,s=e.y-e.size[1]/2,c=e.x+e.size[0]/2,f=e.y+e.size[1]/2,l=t.x,h=t.y,d=e.x,p=e.y,v=d-l,g=Math.atan2(v,p-h),y=0,m=0,b=0,_=0;g>dd?(m=i-f,y=u-o,b=parseFloat(m?(m/Math.cos(g)).toFixed(2):y.toFixed(2)),_=parseFloat(y?(y/Math.sin(g)).toFixed(2):m.toFixed(2))):b=_=0<g&&g<=dd?(m=s-a)>(y=u-o)?parseFloat(m?(m/Math.cos(g)).toFixed(2):y.toFixed(2)):parseFloat(y?(y/Math.sin(g)).toFixed(2):m.toFixed(2)):g<-dd?(m=i-f)>(y=-(c-r))?parseFloat(m?(m/Math.cos(g)).toFixed(2):y.toFixed(2)):parseFloat(y?(y/Math.sin(g)).toFixed(2):m.toFixed(2)):(m=s-a)>(y=Math.abs(v)>(o-r)/2?r-c:v)?parseFloat(m?(m/Math.cos(g)).toFixed(2):y.toFixed(2)):parseFloat(y&&0!==g?(y/Math.sin(g)).toFixed(2):m.toFixed(2));var x=parseFloat(g.toFixed(2)),w=n;return n&&(w=1.1780972450961724<x&&x<1.9634954084936207),{distance:Math.abs(b<_?b:_),isHoriz:w}}(o,a,x);_=w.distance,x=w.isHoriz,_<=10?b+=0!==_?n?10+1e7/_:10+1e8/_:hd:(b+=_,n&&(b+=_*_))}return b}function yd(t){for(var e=0,n=0;n<t.length;n++){var r=t[n];(r.x<0||r.y<0||r.x>1200||r.y>800)&&(e+=1e12);for(var i=n+1;i<t.length;i++)e+=gd(r,t[i])}return e}function md(t,e,n,r){var i=new Map;n.forEach((function(t,e){i.set(t.id,t)}));var o=r.filter((function(e){return e.source===t.id||e.target===t.id}))||[],a=[];o.forEach((function(e){var n=e.source===t.id?e.target:e.source,r=i.get(n);r&&a.push(r)}));for(var u=!0,s=0;s<a.length;s++){var c=a[s],f=180*Math.atan((t.y-c.y)/(c.x-t.y)),l=180*Math.atan((e.y-c.y)/(c.x-e.y)),h=f>70&&f<110,d=l>70&&l<110;if((f<30||f>150)&&!(l<30||l>150)||f*l<0){u=!1;break}if(h&&!d||f*l<0){u=!1;break}if((c.x-t.x)*(c.x-e.x)<0){u=!1;break}if((c.y-t.y)*(c.y-e.y)<0){u=!1;break}}return u}function bd(t,e){for(var n=!1,r=[10,-10,0,0],i=[0,0,10,-10],o=0;o<t.length;++o)for(var a=t[o],u=_d(a,t),s=0;s<r.length;s++)if(md(a,{x:a.x+r[s],y:a.y+i[s]},t,e)){a.x+=r[s],a.y+=i[s];var c=_d(a,t),f=Math.random();c<u||f<vd&&f>.1?(u=c,n=!0):(a.x-=r[s],a.y-=i[s])}return vd>.1&&(vd*=.5),n?yd(t):0}function _d(t,e){var n=0;(t.x<0||t.y<0||t.x+t.size[0]+20>1200||t.y+t.size[1]+20>800)&&(n+=1e12);for(var r=0;r<e.length;++r)t.id!==e[r].id&&(n+=gd(t,e[r]));return n}var xd=function(){return xd=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},xd.apply(this,arguments)};function wd(t,e){var n=t.nodes,r=t.edges,i=e.width,o=e.height;if(!(null==n?void 0:n.length))return Promise.resolve();var a=[];n.forEach((function(t){if(r.filter((function(e){return e.source===t.id||e.target===t.id})).length>1){var e=xd({},t);delete e.size,a.push(e)}}));var u=[];r.forEach((function(t){var e=a.find((function(e){return e.id===t.source})),n=a.find((function(e){return e.id===t.target}));e&&n&&u.push(t)}));var s=new Mn({type:"dagre",ranksep:e.nodeMinGap,nodesep:e.nodeMinGap}).layout({nodes:a,edges:u}).nodes;n.forEach((function(t){var e=(s||[]).find((function(e){return e.id===t.id}));t.x=(null==e?void 0:e.x)||i/2,t.y=(null==e?void 0:e.y)||o/2}));var c=JSON.parse(JSON.stringify(n)),f=JSON.parse(JSON.stringify(r)),l=gt().nodes(c).force("link",xt(f).id((function(t){return t.id})).distance((function(t){return u.find((function(e){return e.source===t.source&&e.target===t.target}))?30:20}))).force("charge",yt()).force("center",mt(i/2,o/2)).force("x",At(i/2)).force("y",Tt(o/2)).alpha(.3).alphaDecay(.08).alphaMin(.001),h=new Promise((function(t){l.on("end",(function(){n.forEach((function(t){var e=c.find((function(e){return e.id===t.id}));e&&(t.x=e.x,t.y=e.y)}));var a=Math.min.apply(Math,n.map((function(t){return t.x}))),u=Math.max.apply(Math,n.map((function(t){return t.x}))),s=Math.min.apply(Math,n.map((function(t){return t.y}))),f=Math.max.apply(Math,n.map((function(t){return t.y}))),l=i/(u-a),h=o/(f-s);n.forEach((function(t){void 0!==t.x&&l<1&&(t.x=(t.x-a)*l),void 0!==t.y&&h<1&&(t.y=(t.y-s)*h)})),n.forEach((function(t){t.sizeTemp=t.size,t.size=[10,10]})),function(t,e){if(0===t.length)return{nodes:t,edges:e};t.forEach((function(t){var n=e.filter((function(e){return e.source===t.id||e.target===t.id}));pd.set(t,n)})),t.sort((function(t,e){var n,r;return(null===(n=pd.get(t.id))||void 0===n?void 0:n.length)-(null===(r=pd.get(e.id))||void 0===r?void 0:r.length)}));for(var n=yd(t),r=20,i=1,o=0,a=0;r>0&&!(++a>=50);){var u=bd(t,e);0!==u&&(o=u),i=o-n,n=o,0===i?--r:r=20}t.forEach((function(t){t.x=t.x-t.size[0]/2,t.y=t.y-t.size[1]/2}))}(n,r),n.forEach((function(t){t.size=t.sizeTemp||[],delete t.sizeTemp})),function(t,e){if(!t.nodes||0===t.nodes.length)return t;var n=e.width,r=e.height,i=e.nodeMinGap,o=1e4,a=1e4;t.nodes.forEach((function(t){var e=t.size[0]||50,n=t.size[1]||50;o=Math.min(e,o),a=Math.min(n,a)}));var u=new ld;u.init(n,r,{CELL_H:a,CELL_W:o}),t.nodes.forEach((function(t){var e=u.occupyNearest(t);e&&(e.node={id:t.id,size:t.size},t.x=e.x,t.y=e.y,t.dx=e.dx,t.dy=e.dy)}));for(var s=0;s<t.nodes.length;s++){var c=t.nodes[s],f=u.findGridByNodeId(c.id);if(!f)throw new Error("can not find node cell");var l=f.column,h=f.row;if(c.size[0]+i>o){for(var d=v=Math.ceil((c.size[0]+i)/o)-1,p=0;p<v&&u.additionColumn.indexOf(l+p+1)>-1&&!u.cells[l+p+1][h].node;p++)d--;u.insertColumn(l,d)}if(c.size[1]+i>a){var v;for(d=v=Math.ceil((c.size[1]+i)/a)-1,p=0;p<v&&u.additionRow.indexOf(h+p+1)>-1&&!u.cells[l][h+p+1].node;p++)d--;u.insertRow(h,d)}}for(s=0;s<u.columnNum;s++){var g=function(e){var n=u.cells[s][e];if(n.node){var r=t.nodes.find((function(t){var e;return t.id===(null===(e=null==n?void 0:n.node)||void 0===e?void 0:e.id)}));r&&(r.x=n.x+r.size[0]/2,r.y=n.y+r.size[1]/2)}};for(p=0;p<u.rowNum;p++)g(p)}}({nodes:n,edges:r},e),t()}))}));return h}var Ed=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Sd=function(t){function e(e){var n=t.call(this)||this;return n.width=300,n.height=300,n.nodeMinGap=50,n.onLayoutEnd=function(){},e&&n.updateCfg(e),n}return Ed(e,t),e.prototype.getDefaultCfg=function(){return{width:300,height:300,nodeMinGap:50}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.edges;return null==e||e.forEach((function(t){t.size||(t.size=[50,50])})),wd({nodes:e,edges:n},{width:this.width,height:this.height,nodeMinGap:this.nodeMinGap}).then((function(){t.onLayoutEnd&&t.onLayoutEnd()}))},e.prototype.getType=function(){return"er"},e}(t),Ad=function(){function t(t){var e=S(t.type);this.layoutInstance=new e(t)}return t.prototype.layout=function(t){return this.layoutInstance.layout(t)},t.prototype.updateCfg=function(t){this.layoutInstance.updateCfg(t)},t.prototype.init=function(t){this.layoutInstance.init(t)},t.prototype.execute=function(){this.layoutInstance.execute()},t.prototype.getDefaultCfg=function(){return this.layoutInstance.getDefaultCfg()},t.prototype.destroy=function(){return this.layoutInstance.destroy()},t}(),Td={force:Dt,fruchterman:yr,forceAtlas2:sd,gForce:k,dagre:Mn,circular:Ot,radial:lr,concentric:dr,grid:T,mds:vr,comboForce:nd,random:C,"gForce-gpu":td,"fruchterman-gpu":Zh,er:Sd}})(),r})()}));
|
|
2
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.layout=e():t.layout=e()}(self,(function(){return(()=>{var t={7294:()=>{},9586:()=>{},2697:()=>{},1894:()=>{},1186:()=>{},5275:()=>{},2862:()=>{},9633:()=>{},7222:()=>{},5965:()=>{},2391:()=>{},3945:()=>{},9216:(t,e,n)=>{"use strict";n(9504),n(3982),n(721),n(5778),n(3898),n(7536),n(5834),n(6945),n(547),n(5967),n(3515),n(3042),n(4962),n(405)},122:(t,e,n)=>{t.exports=n(405)},8311:(t,e,n)=>{var r=n(1946);t.exports={Graph:r.Graph,json:n(1603),alg:n(638),version:r.version}},5267:(t,e,n)=>{var r=n(6879);t.exports=function(t){var e,n={},i=[];function o(i){r.has(n,i)||(n[i]=!0,e.push(i),r.each(t.successors(i),o),r.each(t.predecessors(i),o))}return r.each(t.nodes(),(function(t){e=[],o(t),e.length&&i.push(e)})),i}},4370:(t,e,n)=>{var r=n(6879);function i(t,e,n,o,a,u){r.has(o,e)||(o[e]=!0,n||u.push(e),r.each(a(e),(function(e){i(t,e,n,o,a,u)})),n&&u.push(e))}t.exports=function(t,e,n){r.isArray(e)||(e=[e]);var o=(t.isDirected()?t.successors:t.neighbors).bind(t),a=[],u={};return r.each(e,(function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);i(t,e,"post"===n,u,o,a)})),a}},5566:(t,e,n)=>{var r=n(7435),i=n(6879);t.exports=function(t,e,n){return i.transform(t.nodes(),(function(i,o){i[o]=r(t,o,e,n)}),{})}},7435:(t,e,n)=>{var r=n(6879),i=n(758);t.exports=function(t,e,n,r){return function(t,e,n,r){var o,a,u={},s=new i,c=function(t){var e=t.v!==o?t.v:t.w,r=u[e],i=n(t),c=a.distance+i;if(i<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+t+" Weight: "+i);c<r.distance&&(r.distance=c,r.predecessor=o,s.decrease(e,c))};for(t.nodes().forEach((function(t){var n=t===e?0:Number.POSITIVE_INFINITY;u[t]={distance:n},s.add(t,n)}));s.size()>0&&(o=s.removeMin(),(a=u[o]).distance!==Number.POSITIVE_INFINITY);)r(o).forEach(c);return u}(t,String(e),n||o,r||function(e){return t.outEdges(e)})};var o=r.constant(1)},5488:(t,e,n)=>{var r=n(6879),i=n(4155);t.exports=function(t){return r.filter(i(t),(function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])}))}},7003:(t,e,n)=>{var r=n(6879);t.exports=function(t,e,n){return function(t,e,n){var r={},i=t.nodes();return i.forEach((function(t){r[t]={},r[t][t]={distance:0},i.forEach((function(e){t!==e&&(r[t][e]={distance:Number.POSITIVE_INFINITY})})),n(t).forEach((function(n){var i=n.v===t?n.w:n.v,o=e(n);r[t][i]={distance:o,predecessor:t}}))})),i.forEach((function(t){var e=r[t];i.forEach((function(n){var o=r[n];i.forEach((function(n){var r=o[t],i=e[n],a=o[n],u=r.distance+i.distance;u<a.distance&&(a.distance=u,a.predecessor=i.predecessor)}))}))})),r}(t,e||i,n||function(e){return t.outEdges(e)})};var i=r.constant(1)},638:(t,e,n)=>{t.exports={components:n(5267),dijkstra:n(7435),dijkstraAll:n(5566),findCycles:n(5488),floydWarshall:n(7003),isAcyclic:n(6515),postorder:n(4654),preorder:n(2746),prim:n(6828),tarjan:n(4155),topsort:n(4417)}},6515:(t,e,n)=>{var r=n(4417);t.exports=function(t){try{r(t)}catch(t){if(t instanceof r.CycleException)return!1;throw t}return!0}},4654:(t,e,n)=>{var r=n(4370);t.exports=function(t,e){return r(t,e,"post")}},2746:(t,e,n)=>{var r=n(4370);t.exports=function(t,e){return r(t,e,"pre")}},6828:(t,e,n)=>{var r=n(6879),i=n(5256),o=n(758);t.exports=function(t,e){var n,a=new i,u={},s=new o;function c(t){var r=t.v===n?t.w:t.v,i=s.priority(r);if(void 0!==i){var o=e(t);o<i&&(u[r]=n,s.decrease(r,o))}}if(0===t.nodeCount())return a;r.each(t.nodes(),(function(t){s.add(t,Number.POSITIVE_INFINITY),a.setNode(t)})),s.decrease(t.nodes()[0],0);for(var f=!1;s.size()>0;){if(n=s.removeMin(),r.has(u,n))a.setEdge(n,u[n]);else{if(f)throw new Error("Input graph is not connected: "+t);f=!0}t.nodeEdges(n).forEach(c)}return a}},4155:(t,e,n)=>{var r=n(6879);t.exports=function(t){var e=0,n=[],i={},o=[];function a(u){var s=i[u]={onStack:!0,lowlink:e,index:e++};if(n.push(u),t.successors(u).forEach((function(t){r.has(i,t)?i[t].onStack&&(s.lowlink=Math.min(s.lowlink,i[t].index)):(a(t),s.lowlink=Math.min(s.lowlink,i[t].lowlink))})),s.lowlink===s.index){var c,f=[];do{c=n.pop(),i[c].onStack=!1,f.push(c)}while(u!==c);o.push(f)}}return t.nodes().forEach((function(t){r.has(i,t)||a(t)})),o}},4417:(t,e,n)=>{var r=n(6879);function i(t){var e={},n={},i=[];if(r.each(t.sinks(),(function a(u){if(r.has(n,u))throw new o;r.has(e,u)||(n[u]=!0,e[u]=!0,r.each(t.predecessors(u),a),delete n[u],i.push(u))})),r.size(e)!==t.nodeCount())throw new o;return i}function o(){}t.exports=i,i.CycleException=o},758:(t,e,n)=>{var r=n(6879);function i(){this._arr=[],this._keyIndices={}}t.exports=i,i.prototype.size=function(){return this._arr.length},i.prototype.keys=function(){return this._arr.map((function(t){return t.key}))},i.prototype.has=function(t){return r.has(this._keyIndices,t)},i.prototype.priority=function(t){var e=this._keyIndices[t];if(void 0!==e)return this._arr[e].priority},i.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},i.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!r.has(n,t)){var i=this._arr,o=i.length;return n[t]=o,i.push({key:t,priority:e}),this._decrease(o),!0}return!1},i.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},i.prototype.decrease=function(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)},i.prototype._heapify=function(t){var e=this._arr,n=2*t,r=n+1,i=t;n<e.length&&(i=e[n].priority<e[i].priority?n:i,r<e.length&&(i=e[r].priority<e[i].priority?r:i),i!==t&&(this._swap(t,i),this._heapify(i)))},i.prototype._decrease=function(t){for(var e,n=this._arr,r=n[t].priority;0!==t&&!(n[e=t>>1].priority<r);)this._swap(t,e),t=e},i.prototype._swap=function(t,e){var n=this._arr,r=this._keyIndices,i=n[t],o=n[e];n[t]=o,n[e]=i,r[o.key]=t,r[i.key]=e}},5256:(t,e,n)=>{"use strict";var r=n(6879);t.exports=o;var i="\0";function o(t){this._isDirected=!r.has(t,"directed")||t.directed,this._isMultigraph=!!r.has(t,"multigraph")&&t.multigraph,this._isCompound=!!r.has(t,"compound")&&t.compound,this._label=void 0,this._defaultNodeLabelFn=r.constant(void 0),this._defaultEdgeLabelFn=r.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\0"]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function a(t,e){t[e]?t[e]++:t[e]=1}function u(t,e){--t[e]||delete t[e]}function s(t,e,n,i){var o=""+e,a=""+n;if(!t&&o>a){var u=o;o=a,a=u}return o+""+a+""+(r.isUndefined(i)?"\0":i)}function c(t,e,n,r){var i=""+e,o=""+n;if(!t&&i>o){var a=i;i=o,o=a}var u={v:i,w:o};return r&&(u.name=r),u}function f(t,e){return s(t,e.v,e.w,e.name)}o.prototype._nodeCount=0,o.prototype._edgeCount=0,o.prototype.isDirected=function(){return this._isDirected},o.prototype.isMultigraph=function(){return this._isMultigraph},o.prototype.isCompound=function(){return this._isCompound},o.prototype.setGraph=function(t){return this._label=t,this},o.prototype.graph=function(){return this._label},o.prototype.setDefaultNodeLabel=function(t){return r.isFunction(t)||(t=r.constant(t)),this._defaultNodeLabelFn=t,this},o.prototype.nodeCount=function(){return this._nodeCount},o.prototype.nodes=function(){return r.keys(this._nodes)},o.prototype.sources=function(){return r.filter(this.nodes(),r.bind((function(t){return r.isEmpty(this._in[t])}),this))},o.prototype.sinks=function(){return r.filter(this.nodes(),r.bind((function(t){return r.isEmpty(this._out[t])}),this))},o.prototype.setNodes=function(t,e){var n=arguments;return r.each(t,r.bind((function(t){n.length>1?this.setNode(t,e):this.setNode(t)}),this)),this},o.prototype.setNode=function(t,e){return r.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=i,this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},o.prototype.node=function(t){return this._nodes[t]},o.prototype.hasNode=function(t){return r.has(this._nodes,t)},o.prototype.removeNode=function(t){var e=this;if(r.has(this._nodes,t)){var n=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],r.each(this.children(t),r.bind((function(t){this.setParent(t)}),this)),delete this._children[t]),r.each(r.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],r.each(r.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},o.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(e))e=i;else{for(var n=e+="";!r.isUndefined(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},o.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},o.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if(e!==i)return e}},o.prototype.children=function(t){if(r.isUndefined(t)&&(t=i),this._isCompound){var e=this._children[t];if(e)return r.keys(e)}else{if(t===i)return this.nodes();if(this.hasNode(t))return[]}},o.prototype.predecessors=function(t){var e=this._preds[t];if(e)return r.keys(e)},o.prototype.successors=function(t){var e=this._sucs[t];if(e)return r.keys(e)},o.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return r.union(e,this.successors(t))},o.prototype.isLeaf=function(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length},o.prototype.filterNodes=function(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph()),r.each(this._nodes,r.bind((function(n,r){t(r)&&e.setNode(r,n)}),this)),r.each(this._edgeObjs,r.bind((function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,this.edge(t))}),this));var n=this,i={};function o(t){var r=n.parent(t);return void 0===r||e.hasNode(r)?(i[t]=r,r):r in i?i[r]:o(r)}return this._isCompound&&r.each(e.nodes(),(function(t){e.setParent(t,o(t))})),e},o.prototype.setDefaultEdgeLabel=function(t){return r.isFunction(t)||(t=r.constant(t)),this._defaultEdgeLabelFn=t,this},o.prototype.edgeCount=function(){return this._edgeCount},o.prototype.edges=function(){return r.values(this._edgeObjs)},o.prototype.setPath=function(t,e){var n=this,i=arguments;return r.reduce(t,(function(t,r){return i.length>1?n.setEdge(t,r,e):n.setEdge(t,r),r})),this},o.prototype.setEdge=function(){var t,e,n,i,o=!1,u=arguments[0];"object"==typeof u&&null!==u&&"v"in u?(t=u.v,e=u.w,n=u.name,2===arguments.length&&(i=arguments[1],o=!0)):(t=u,e=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),t=""+t,e=""+e,r.isUndefined(n)||(n=""+n);var f=s(this._isDirected,t,e,n);if(r.has(this._edgeLabels,f))return o&&(this._edgeLabels[f]=i),this;if(!r.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[f]=o?i:this._defaultEdgeLabelFn(t,e,n);var l=c(this._isDirected,t,e,n);return t=l.v,e=l.w,Object.freeze(l),this._edgeObjs[f]=l,a(this._preds[e],t),a(this._sucs[t],e),this._in[e][f]=l,this._out[t][f]=l,this._edgeCount++,this},o.prototype.edge=function(t,e,n){var r=1===arguments.length?f(this._isDirected,arguments[0]):s(this._isDirected,t,e,n);return this._edgeLabels[r]},o.prototype.hasEdge=function(t,e,n){var i=1===arguments.length?f(this._isDirected,arguments[0]):s(this._isDirected,t,e,n);return r.has(this._edgeLabels,i)},o.prototype.removeEdge=function(t,e,n){var r=1===arguments.length?f(this._isDirected,arguments[0]):s(this._isDirected,t,e,n),i=this._edgeObjs[r];return i&&(t=i.v,e=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],u(this._preds[e],t),u(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this},o.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var i=r.values(n);return e?r.filter(i,(function(t){return t.v===e})):i}},o.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var i=r.values(n);return e?r.filter(i,(function(t){return t.w===e})):i}},o.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))}},1946:(t,e,n)=>{t.exports={Graph:n(5256),version:n(7942)}},1603:(t,e,n)=>{var r=n(6879),i=n(5256);function o(t){return r.map(t.nodes(),(function(e){var n=t.node(e),i=t.parent(e),o={v:e};return r.isUndefined(n)||(o.value=n),r.isUndefined(i)||(o.parent=i),o}))}function a(t){return r.map(t.edges(),(function(e){var n=t.edge(e),i={v:e.v,w:e.w};return r.isUndefined(e.name)||(i.name=e.name),r.isUndefined(n)||(i.value=n),i}))}t.exports={write:function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:o(t),edges:a(t)};return r.isUndefined(t.graph())||(e.value=r.clone(t.graph())),e},read:function(t){var e=new i(t.options).setGraph(t.value);return r.each(t.nodes,(function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)})),r.each(t.edges,(function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)})),e}}},6879:(t,e,n)=>{var r;try{r=n(9392)}catch(t){}r||(r=window._),t.exports=r},7942:t=>{t.exports="2.1.4"},8344:(t,e)=>{"use strict";var n,r,i,o,a,u,s,c,f,l,h,d,p,v,g,y,m,b,_,x,w,E,S,A,T;(e.UX||(e.UX={})).TextureCompressionBC="texture-compression-bc",(T=e.OB||(e.OB={})).ClampToEdge="clamp-to-edge",T.Repeat="repeat",T.MirrorRepeat="mirror-repeat",(A=e.$l||(e.$l={})).UniformBuffer="uniform-buffer",A.StorageBuffer="storage-buffer",A.ReadonlyStorageBuffer="readonly-storage-buffer",A.Sampler="sampler",A.ComparisonSampler="comparison-sampler",A.SampledTexture="sampled-texture",A.ReadonlyStorageTexture="readonly-storage-texture",A.WriteonlyStorageTexture="writeonly-storage-texture",(S=e.zi||(e.zi={})).Zero="zero",S.One="one",S.SrcColor="src-color",S.OneMinusSrcColor="one-minus-src-color",S.SrcAlpha="src-alpha",S.OneMinusSrcAlpha="one-minus-src-alpha",S.DstColor="dst-color",S.OneMinusDstColor="one-minus-dst-color",S.DstAlpha="dst-alpha",S.OneMinusDstAlpha="one-minus-dst-alpha",S.SrcAlphaSaturated="src-alpha-saturated",S.BlendColor="blend-color",S.OneMinusBlendColor="one-minus-blend-color",(E=e.db||(e.db={})).Add="add",E.Subtract="subtract",E.ReverseSubtract="reverse-subtract",E.Min="min",E.Max="max",(w=e.wb||(e.wb={})).Never="never",w.Less="less",w.Equal="equal",w.LessEqual="less-equal",w.Greater="greater",w.NotEqual="not-equal",w.GreaterEqual="greater-equal",w.Always="always",(x=e.Wf||(e.Wf={})).None="none",x.Front="front",x.Back="back",(_=e.X9||(e.X9={})).Nearest="nearest",_.Linear="linear",(b=e.zX||(e.zX={})).CCW="ccw",b.CW="cw",(m=e.iD||(e.iD={})).Uint16="uint16",m.Uint32="uint32",(y=e.V||(e.V={})).Vertex="vertex",y.Instance="instance",(e.Ws||(e.Ws={})).Load="load",(g=e.YV||(e.YV={})).PointList="point-list",g.LineList="line-list",g.LineStrip="line-strip",g.TriangleList="triangle-list",g.TriangleStrip="triangle-strip",(v=e.xS||(e.xS={})).Keep="keep",v.Zero="zero",v.Replace="replace",v.Invert="invert",v.IncrementClamp="increment-clamp",v.DecrementClamp="decrement-clamp",v.IncrementWrap="increment-wrap",v.DecrementWrap="decrement-wrap",(p=e.EG||(e.EG={})).Store="store",p.Clear="clear",(d=e.kd||(e.kd={})).E1d="1d",d.E2d="2d",d.E3d="3d",(h=e.EV||(e.EV={})).R8Unorm="r8unorm",h.R8Snorm="r8snorm",h.R8Uint="r8uint",h.R8Sint="r8sint",h.R16Uint="r16uint",h.R16Sint="r16sint",h.R16Float="r16float",h.RG8Unorm="rg8unorm",h.RG8Snorm="rg8snorm",h.RG8Uint="rg8uint",h.RG8Sint="rg8sint",h.R32Uint="r32uint",h.R32Sint="r32sint",h.R32Float="r32float",h.RG16Uint="rg16uint",h.RG16Sint="rg16sint",h.RG16Float="rg16float",h.RGBA8Unorm="rgba8unorm",h.RGBA8UnormSRGB="rgba8unorm-srgb",h.RGBA8Snorm="rgba8snorm",h.RGBA8Uint="rgba8uint",h.RGBA8Sint="rgba8sint",h.BGRA8Unorm="bgra8unorm",h.BGRA8UnormSRGB="bgra8unorm-srgb",h.RGB10A2Unorm="rgb10a2unorm",h.RG11B10Float="rg11b10float",h.RG32Uint="rg32uint",h.RG32Sint="rg32sint",h.RG32Float="rg32float",h.RGBA16Uint="rgba16uint",h.RGBA16Sint="rgba16sint",h.RGBA16Float="rgba16float",h.RGBA32Uint="rgba32uint",h.RGBA32Sint="rgba32sint",h.RGBA32Float="rgba32float",h.Depth32Float="depth32float",h.Depth24Plus="depth24plus",h.Depth24PlusStencil8="depth24plus-stencil8",(l=e.Ek||(e.Ek={})).Float="float",l.Sint="sint",l.Uint="uint",(f=e.p_||(e.p_={})).E1d="1d",f.E2d="2d",f.E2dArray="2d-array",f.Cube="cube",f.CubeArray="cube-array",f.E3d="3d",(c=e.gB||(e.gB={})).Uchar2="uchar2",c.Uchar4="uchar4",c.Char2="char2",c.Char4="char4",c.Uchar2Norm="uchar2norm",c.Uchar4Norm="uchar4norm",c.Char2Norm="char2norm",c.Char4Norm="char4norm",c.Ushort2="ushort2",c.Ushort4="ushort4",c.Short2="short2",c.Short4="short4",c.Ushort2Norm="ushort2norm",c.Ushort4Norm="ushort4norm",c.Short2Norm="short2norm",c.Short4Norm="short4norm",c.Half2="half2",c.Half4="half4",c.Float="float",c.Float2="float2",c.Float3="float3",c.Float4="float4",c.Uint="uint",c.Uint2="uint2",c.Uint3="uint3",c.Uint4="uint4",c.Int="int",c.Int2="int2",c.Int3="int3",c.Int4="int4",(s=e.H7||(e.H7={})).All="all",s.StencilOnly="stencil-only",s.DepthOnly="depth-only",(u=e.mj||(e.mj={})).Error="error",u.Warning="warning",u.Info="info",(e.xL||(e.xL={})).Occlusion="occlusion",(a=e.FB||(e.FB={}))[a.MapRead=1]="MapRead",a[a.MapWrite=2]="MapWrite",a[a.CopySrc=4]="CopySrc",a[a.CopyDst=8]="CopyDst",a[a.Index=16]="Index",a[a.Vertex=32]="Vertex",a[a.Uniform=64]="Uniform",a[a.Storage=128]="Storage",a[a.Indirect=256]="Indirect",a[a.QueryResolve=512]="QueryResolve",(o=e.Yw||(e.Yw={}))[o.Red=1]="Red",o[o.Green=2]="Green",o[o.Blue=4]="Blue",o[o.Alpha=8]="Alpha",o[o.All=15]="All",(i=e.$X||(e.$X={}))[i.Vertex=1]="Vertex",i[i.Fragment=2]="Fragment",i[i.Compute=4]="Compute",(r=e.v2||(e.v2={}))[r.CopySrc=1]="CopySrc",r[r.CopyDst=2]="CopyDst",r[r.Sampled=4]="Sampled",r[r.Storage=8]="Storage",r[r.OutputAttachment=16]="OutputAttachment",(n=e.gc||(e.gc={}))[n.Read=1]="Read",n[n.Write=2]="Write"},9504:(t,e,n)=>{n(2825),n(6051),n(2640),n(9518),n(8201),n(470),n(5723),n(7525),n(9788),n(1498),n(7577),n(6129),n(2802),n(7940),n(5261),n(9340),n(1584),n(7298),n(1765),n(5747),n(7451),n(2784),n(2809),n(7454),n(3053),n(8032),n(7551),n(2929),n(215),n(6183),n(8190),n(476),n(948),n(942),n(2870),n(2212),n(4230),n(9754),n(2811),n(3998),n(1769),n(8789),n(2848),n(1762),n(1323),n(6063),n(3282),n(6816),n(1854),n(3303),n(4421),n(2203),n(1028),n(6818),n(5557),n(7938),n(8316),n(7937),n(637),n(8219),n(9029),n(3157),n(9791),n(2296),n(4555),n(6505),n(4722),n(9713),n(7392),n(4687),n(3684),n(3339),n(4148),n(7754),n(4094),n(8781),n(5013),n(3735),n(8723),n(2247),n(9689),n(9003),n(9026),n(4088),n(535),n(5788),n(7878),n(5119),n(3135),n(5015),n(8059),n(646),n(5377),n(9879),n(5305),n(6341),n(5915),n(4488),n(9281),n(163),n(6668),n(7139),n(6408),n(8686),n(5480),n(9121),n(914),n(7742),n(7843),n(6441),n(429),n(2214),n(498),n(6349),n(3742),n(9604),n(2592),n(9290),n(9363),n(3871),n(8632),n(1838),n(3421),n(6144),n(8275),n(2552),n(3077),n(1031),n(8916),n(8978),n(8531),n(7323),n(3704),n(3153),n(8812),n(2636),n(1602),n(377),t.exports=n(2845)},721:(t,e,n)=>{n(7744),t.exports=n(2845).Array.flatMap},3982:(t,e,n)=>{n(5448),t.exports=n(2845).Array.includes},3515:(t,e,n)=>{n(8938),t.exports=n(2845).Object.entries},547:(t,e,n)=>{n(7819),t.exports=n(2845).Object.getOwnPropertyDescriptors},5967:(t,e,n)=>{n(6572),t.exports=n(2845).Object.values},3042:(t,e,n)=>{"use strict";n(7843),n(8228),t.exports=n(2845).Promise.finally},3898:(t,e,n)=>{n(3336),t.exports=n(2845).String.padEnd},5778:(t,e,n)=>{n(3718),t.exports=n(2845).String.padStart},5834:(t,e,n)=>{n(6642),t.exports=n(2845).String.trimRight},7536:(t,e,n)=>{n(7831),t.exports=n(2845).String.trimLeft},6945:(t,e,n)=>{n(9956),t.exports=n(7686).f("asyncIterator")},2680:(t,e,n)=>{n(8358),t.exports=n(3142).global},3749:t=>{t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},8891:(t,e,n)=>{var r=n(2799);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},3142:t=>{var e=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=e)},5526:(t,e,n)=>{var r=n(3749);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},7498:(t,e,n)=>{t.exports=!n(9880)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},2004:(t,e,n)=>{var r=n(2799),i=n(5505).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},2069:(t,e,n)=>{var r=n(5505),i=n(3142),o=n(5526),a=n(5954),u=n(9761),s=function(t,e,n){var c,f,l,h=t&s.F,d=t&s.G,p=t&s.S,v=t&s.P,g=t&s.B,y=t&s.W,m=d?i:i[e]||(i[e]={}),b=m.prototype,_=d?r:p?r[e]:(r[e]||{}).prototype;for(c in d&&(n=e),n)(f=!h&&_&&void 0!==_[c])&&u(m,c)||(l=f?_[c]:n[c],m[c]=d&&"function"!=typeof _[c]?n[c]:g&&f?o(l,r):y&&_[c]==l?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(l):v&&"function"==typeof l?o(Function.call,l):l,v&&((m.virtual||(m.virtual={}))[c]=l,t&s.R&&b&&!b[c]&&a(b,c,l)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},9880:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},5505:t=>{var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},9761:t=>{var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},5954:(t,e,n)=>{var r=n(5584),i=n(5734);t.exports=n(7498)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},4053:(t,e,n)=>{t.exports=!n(7498)&&!n(9880)((function(){return 7!=Object.defineProperty(n(2004)("div"),"a",{get:function(){return 7}}).a}))},2799:t=>{t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},5584:(t,e,n)=>{var r=n(8891),i=n(4053),o=n(923),a=Object.defineProperty;e.f=n(7498)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},5734:t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},923:(t,e,n)=>{var r=n(2799);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},8358:(t,e,n)=>{var r=n(2069);r(r.G,{global:n(5505)})},1464:t=>{t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},8347:(t,e,n)=>{var r=n(1669);t.exports=function(t,e){if("number"!=typeof t&&"Number"!=r(t))throw TypeError(e);return+t}},4691:(t,e,n)=>{var r=n(341)("unscopables"),i=Array.prototype;null==i[r]&&n(913)(i,r,{}),t.exports=function(t){i[r][t]=!0}},178:(t,e,n)=>{"use strict";var r=n(8016)(!0);t.exports=function(t,e,n){return e+(n?r(t,e).length:1)}},6903:t=>{t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},486:(t,e,n)=>{var r=n(1255);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},1064:(t,e,n)=>{"use strict";var r=n(7583),i=n(9260),o=n(8087);t.exports=[].copyWithin||function(t,e){var n=r(this),a=o(n.length),u=i(t,a),s=i(e,a),c=arguments.length>2?arguments[2]:void 0,f=Math.min((void 0===c?a:i(c,a))-s,a-u),l=1;for(s<u&&u<s+f&&(l=-1,s+=f-1,u+=f-1);f-- >0;)s in n?n[u]=n[s]:delete n[u],u+=l,s+=l;return n}},8676:(t,e,n)=>{"use strict";var r=n(7583),i=n(9260),o=n(8087);t.exports=function(t){for(var e=r(this),n=o(e.length),a=arguments.length,u=i(a>1?arguments[1]:void 0,n),s=a>2?arguments[2]:void 0,c=void 0===s?n:i(s,n);c>u;)e[u++]=t;return e}},4538:(t,e,n)=>{var r=n(8182),i=n(8087),o=n(9260);t.exports=function(t){return function(e,n,a){var u,s=r(e),c=i(s.length),f=o(a,c);if(t&&n!=n){for(;c>f;)if((u=s[f++])!=u)return!0}else for(;c>f;f++)if((t||f in s)&&s[f]===n)return t||f||0;return!t&&-1}}},7622:(t,e,n)=>{var r=n(994),i=n(8579),o=n(7583),a=n(8087),u=n(6699);t.exports=function(t,e){var n=1==t,s=2==t,c=3==t,f=4==t,l=6==t,h=5==t||l,d=e||u;return function(e,u,p){for(var v,g,y=o(e),m=i(y),b=r(u,p,3),_=a(m.length),x=0,w=n?d(e,_):s?d(e,0):void 0;_>x;x++)if((h||x in m)&&(g=b(v=m[x],x,y),t))if(n)w[x]=g;else if(g)switch(t){case 3:return!0;case 5:return v;case 6:return x;case 2:w.push(v)}else if(f)return!1;return l?-1:c||f?f:w}}},5336:(t,e,n)=>{var r=n(1464),i=n(7583),o=n(8579),a=n(8087);t.exports=function(t,e,n,u,s){r(e);var c=i(t),f=o(c),l=a(c.length),h=s?l-1:0,d=s?-1:1;if(n<2)for(;;){if(h in f){u=f[h],h+=d;break}if(h+=d,s?h<0:l<=h)throw TypeError("Reduce of empty array with no initial value")}for(;s?h>=0:l>h;h+=d)h in f&&(u=e(u,f[h],h,c));return u}},7600:(t,e,n)=>{var r=n(1255),i=n(7183),o=n(341)("species");t.exports=function(t){var e;return i(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!i(e.prototype)||(e=void 0),r(e)&&null===(e=e[o])&&(e=void 0)),void 0===e?Array:e}},6699:(t,e,n)=>{var r=n(7600);t.exports=function(t,e){return new(r(t))(e)}},8366:(t,e,n)=>{"use strict";var r=n(1464),i=n(1255),o=n(8262),a=[].slice,u={},s=function(t,e,n){if(!(e in u)){for(var r=[],i=0;i<e;i++)r[i]="a["+i+"]";u[e]=Function("F,a","return new F("+r.join(",")+")")}return u[e](t,n)};t.exports=Function.bind||function(t){var e=r(this),n=a.call(arguments,1),u=function(){var r=n.concat(a.call(arguments));return this instanceof u?s(e,r.length,r):o(e,r,t)};return i(e.prototype)&&(u.prototype=e.prototype),u}},4939:(t,e,n)=>{var r=n(1669),i=n(341)("toStringTag"),o="Arguments"==r(function(){return arguments}());t.exports=function(t){var e,n,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),i))?n:o?r(e):"Object"==(a=r(e))&&"function"==typeof e.callee?"Arguments":a}},1669:t=>{var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},3050:(t,e,n)=>{"use strict";var r=n(3886).f,i=n(9055),o=n(8565),a=n(994),u=n(6903),s=n(9822),c=n(966),f=n(8782),l=n(4412),h=n(1216),d=n(4278).fastKey,p=n(4664),v=h?"_s":"size",g=function(t,e){var n,r=d(e);if("F"!==r)return t._i[r];for(n=t._f;n;n=n.n)if(n.k==e)return n};t.exports={getConstructor:function(t,e,n,c){var f=t((function(t,r){u(t,f,e,"_i"),t._t=e,t._i=i(null),t._f=void 0,t._l=void 0,t[v]=0,null!=r&&s(r,n,t[c],t)}));return o(f.prototype,{clear:function(){for(var t=p(this,e),n=t._i,r=t._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];t._f=t._l=void 0,t[v]=0},delete:function(t){var n=p(this,e),r=g(n,t);if(r){var i=r.n,o=r.p;delete n._i[r.i],r.r=!0,o&&(o.n=i),i&&(i.p=o),n._f==r&&(n._f=i),n._l==r&&(n._l=o),n[v]--}return!!r},forEach:function(t){p(this,e);for(var n,r=a(t,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(t){return!!g(p(this,e),t)}}),h&&r(f.prototype,"size",{get:function(){return p(this,e)[v]}}),f},def:function(t,e,n){var r,i,o=g(t,e);return o?o.v=n:(t._l=o={i:i=d(e,!0),k:e,v:n,p:r=t._l,n:void 0,r:!1},t._f||(t._f=o),r&&(r.n=o),t[v]++,"F"!==i&&(t._i[i]=o)),t},getEntry:g,setStrong:function(t,e,n){c(t,e,(function(t,n){this._t=p(t,e),this._k=n,this._l=void 0}),(function(){for(var t=this,e=t._k,n=t._l;n&&n.r;)n=n.p;return t._t&&(t._l=n=n?n.n:t._t._f)?f(0,"keys"==e?n.k:"values"==e?n.v:[n.k,n.v]):(t._t=void 0,f(1))}),n?"entries":"values",!n,!0),l(e)}}},1990:(t,e,n)=>{"use strict";var r=n(8565),i=n(4278).getWeak,o=n(486),a=n(1255),u=n(6903),s=n(9822),c=n(7622),f=n(7384),l=n(4664),h=c(5),d=c(6),p=0,v=function(t){return t._l||(t._l=new g)},g=function(){this.a=[]},y=function(t,e){return h(t.a,(function(t){return t[0]===e}))};g.prototype={get:function(t){var e=y(this,t);if(e)return e[1]},has:function(t){return!!y(this,t)},set:function(t,e){var n=y(this,t);n?n[1]=e:this.a.push([t,e])},delete:function(t){var e=d(this.a,(function(e){return e[0]===t}));return~e&&this.a.splice(e,1),!!~e}},t.exports={getConstructor:function(t,e,n,o){var c=t((function(t,r){u(t,c,e,"_i"),t._t=e,t._i=p++,t._l=void 0,null!=r&&s(r,n,t[o],t)}));return r(c.prototype,{delete:function(t){if(!a(t))return!1;var n=i(t);return!0===n?v(l(this,e)).delete(t):n&&f(n,this._i)&&delete n[this._i]},has:function(t){if(!a(t))return!1;var n=i(t);return!0===n?v(l(this,e)).has(t):n&&f(n,this._i)}}),c},def:function(t,e,n){var r=i(o(e),!0);return!0===r?v(t).set(e,n):r[t._i]=n,t},ufstore:v}},859:(t,e,n)=>{"use strict";var r=n(7571),i=n(7044),o=n(6476),a=n(8565),u=n(4278),s=n(9822),c=n(6903),f=n(1255),l=n(5338),h=n(2803),d=n(5837),p=n(116);t.exports=function(t,e,n,v,g,y){var m=r[t],b=m,_=g?"set":"add",x=b&&b.prototype,w={},E=function(t){var e=x[t];o(x,t,"delete"==t||"has"==t?function(t){return!(y&&!f(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return y&&!f(t)?void 0:e.call(this,0===t?0:t)}:"add"==t?function(t){return e.call(this,0===t?0:t),this}:function(t,n){return e.call(this,0===t?0:t,n),this})};if("function"==typeof b&&(y||x.forEach&&!l((function(){(new b).entries().next()})))){var S=new b,A=S[_](y?{}:-0,1)!=S,T=l((function(){S.has(1)})),I=h((function(t){new b(t)})),C=!y&&l((function(){for(var t=new b,e=5;e--;)t[_](e,e);return!t.has(-0)}));I||((b=e((function(e,n){c(e,b,t);var r=p(new m,e,b);return null!=n&&s(n,g,r[_],r),r}))).prototype=x,x.constructor=b),(T||C)&&(E("delete"),E("has"),g&&E("get")),(C||A)&&E(_),y&&x.clear&&delete x.clear}else b=v.getConstructor(e,t,g,_),a(b.prototype,n),u.NEED=!0;return d(b,t),w[t]=b,i(i.G+i.W+i.F*(b!=m),w),y||v.setStrong(b,t,g),b}},2845:t=>{var e=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=e)},1395:(t,e,n)=>{"use strict";var r=n(3886),i=n(8328);t.exports=function(t,e,n){e in t?r.f(t,e,i(0,n)):t[e]=n}},994:(t,e,n)=>{var r=n(1464);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},4506:(t,e,n)=>{"use strict";var r=n(5338),i=Date.prototype.getTime,o=Date.prototype.toISOString,a=function(t){return t>9?t:"0"+t};t.exports=r((function(){return"0385-07-25T07:06:39.999Z"!=o.call(new Date(-50000000000001))}))||!r((function(){o.call(new Date(NaN))}))?function(){if(!isFinite(i.call(this)))throw RangeError("Invalid time value");var t=this,e=t.getUTCFullYear(),n=t.getUTCMilliseconds(),r=e<0?"-":e>9999?"+":"";return r+("00000"+Math.abs(e)).slice(r?-6:-4)+"-"+a(t.getUTCMonth()+1)+"-"+a(t.getUTCDate())+"T"+a(t.getUTCHours())+":"+a(t.getUTCMinutes())+":"+a(t.getUTCSeconds())+"."+(n>99?n:"0"+a(n))+"Z"}:o},9514:(t,e,n)=>{"use strict";var r=n(486),i=n(4467),o="number";t.exports=function(t){if("string"!==t&&t!==o&&"default"!==t)throw TypeError("Incorrect hint");return i(r(this),t!=o)}},5091:t=>{t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},1216:(t,e,n)=>{t.exports=!n(5338)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},3438:(t,e,n)=>{var r=n(1255),i=n(7571).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},9824:t=>{t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},6397:(t,e,n)=>{var r=n(9804),i=n(3844),o=n(4179);t.exports=function(t){var e=r(t),n=i.f;if(n)for(var a,u=n(t),s=o.f,c=0;u.length>c;)s.call(t,a=u[c++])&&e.push(a);return e}},7044:(t,e,n)=>{var r=n(7571),i=n(2845),o=n(913),a=n(6476),u=n(994),s=function(t,e,n){var c,f,l,h,d=t&s.F,p=t&s.G,v=t&s.S,g=t&s.P,y=t&s.B,m=p?r:v?r[e]||(r[e]={}):(r[e]||{}).prototype,b=p?i:i[e]||(i[e]={}),_=b.prototype||(b.prototype={});for(c in p&&(n=e),n)l=((f=!d&&m&&void 0!==m[c])?m:n)[c],h=y&&f?u(l,r):g&&"function"==typeof l?u(Function.call,l):l,m&&a(m,c,l,t&s.U),b[c]!=l&&o(b,c,h),g&&_[c]!=l&&(_[c]=l)};r.core=i,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},2910:(t,e,n)=>{var r=n(341)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,!"/./"[t](e)}catch(t){}}return!0}},5338:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},6719:(t,e,n)=>{"use strict";n(7139);var r=n(6476),i=n(913),o=n(5338),a=n(5091),u=n(341),s=n(9020),c=u("species"),f=!o((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),l=function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();t.exports=function(t,e,n){var h=u(t),d=!o((function(){var e={};return e[h]=function(){return 7},7!=""[t](e)})),p=d?!o((function(){var e=!1,n=/a/;return n.exec=function(){return e=!0,null},"split"===t&&(n.constructor={},n.constructor[c]=function(){return n}),n[h](""),!e})):void 0;if(!d||!p||"replace"===t&&!f||"split"===t&&!l){var v=/./[h],g=n(a,h,""[t],(function(t,e,n,r,i){return e.exec===s?d&&!i?{done:!0,value:v.call(e,n,r)}:{done:!0,value:t.call(n,e,r)}:{done:!1}})),y=g[0],m=g[1];r(String.prototype,t,y),i(RegExp.prototype,h,2==e?function(t,e){return m.call(t,this,e)}:function(t){return m.call(t,this)})}}},3649:(t,e,n)=>{"use strict";var r=n(486);t.exports=function(){var t=r(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},6806:(t,e,n)=>{"use strict";var r=n(7183),i=n(1255),o=n(8087),a=n(994),u=n(341)("isConcatSpreadable");t.exports=function t(e,n,s,c,f,l,h,d){for(var p,v,g=f,y=0,m=!!h&&a(h,d,3);y<c;){if(y in s){if(p=m?m(s[y],y,n):s[y],v=!1,i(p)&&(v=void 0!==(v=p[u])?!!v:r(p)),v&&l>0)g=t(e,n,p,o(p.length),g,l-1)-1;else{if(g>=9007199254740991)throw TypeError();e[g]=p}g++}y++}return g}},9822:(t,e,n)=>{var r=n(994),i=n(4902),o=n(9981),a=n(486),u=n(8087),s=n(9685),c={},f={},l=t.exports=function(t,e,n,l,h){var d,p,v,g,y=h?function(){return t}:s(t),m=r(n,l,e?2:1),b=0;if("function"!=typeof y)throw TypeError(t+" is not iterable!");if(o(y)){for(d=u(t.length);d>b;b++)if((g=e?m(a(p=t[b])[0],p[1]):m(t[b]))===c||g===f)return g}else for(v=y.call(t);!(p=v.next()).done;)if((g=i(v,m,p.value,e))===c||g===f)return g};l.BREAK=c,l.RETURN=f},8454:(t,e,n)=>{t.exports=n(5570)("native-function-to-string",Function.toString)},7571:t=>{var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},7384:t=>{var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},913:(t,e,n)=>{var r=n(3886),i=n(8328);t.exports=n(1216)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},7680:(t,e,n)=>{var r=n(7571).document;t.exports=r&&r.documentElement},6252:(t,e,n)=>{t.exports=!n(1216)&&!n(5338)((function(){return 7!=Object.defineProperty(n(3438)("div"),"a",{get:function(){return 7}}).a}))},116:(t,e,n)=>{var r=n(1255),i=n(473).set;t.exports=function(t,e,n){var o,a=e.constructor;return a!==n&&"function"==typeof a&&(o=a.prototype)!==n.prototype&&r(o)&&i&&i(t,o),t}},8262:t=>{t.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},8579:(t,e,n)=>{var r=n(1669);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},9981:(t,e,n)=>{var r=n(9740),i=n(341)("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||o[i]===t)}},7183:(t,e,n)=>{var r=n(1669);t.exports=Array.isArray||function(t){return"Array"==r(t)}},1272:(t,e,n)=>{var r=n(1255),i=Math.floor;t.exports=function(t){return!r(t)&&isFinite(t)&&i(t)===t}},1255:t=>{t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},8990:(t,e,n)=>{var r=n(1255),i=n(1669),o=n(341)("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[o])?!!e:"RegExp"==i(t))}},4902:(t,e,n)=>{var r=n(486);t.exports=function(t,e,n,i){try{return i?e(r(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&r(o.call(t)),e}}},4529:(t,e,n)=>{"use strict";var r=n(9055),i=n(8328),o=n(5837),a={};n(913)(a,n(341)("iterator"),(function(){return this})),t.exports=function(t,e,n){t.prototype=r(a,{next:i(1,n)}),o(t,e+" Iterator")}},966:(t,e,n)=>{"use strict";var r=n(2725),i=n(7044),o=n(6476),a=n(913),u=n(9740),s=n(4529),c=n(5837),f=n(9881),l=n(341)("iterator"),h=!([].keys&&"next"in[].keys()),d="keys",p="values",v=function(){return this};t.exports=function(t,e,n,g,y,m,b){s(n,e,g);var _,x,w,E=function(t){if(!h&&t in I)return I[t];switch(t){case d:case p:return function(){return new n(this,t)}}return function(){return new n(this,t)}},S=e+" Iterator",A=y==p,T=!1,I=t.prototype,C=I[l]||I["@@iterator"]||y&&I[y],D=C||E(y),N=y?A?E("entries"):D:void 0,k="Array"==e&&I.entries||C;if(k&&(w=f(k.call(new t)))!==Object.prototype&&w.next&&(c(w,S,!0),r||"function"==typeof w[l]||a(w,l,v)),A&&C&&C.name!==p&&(T=!0,D=function(){return C.call(this)}),r&&!b||!h&&!T&&I[l]||a(I,l,D),u[e]=D,u[S]=v,y)if(_={values:A?D:E(p),keys:m?D:E(d),entries:N},b)for(x in _)x in I||o(I,x,_[x]);else i(i.P+i.F*(h||T),e,_);return _}},2803:(t,e,n)=>{var r=n(341)("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!i)return!1;var n=!1;try{var o=[7],a=o[r]();a.next=function(){return{done:n=!0}},o[r]=function(){return a},t(o)}catch(t){}return n}},8782:t=>{t.exports=function(t,e){return{value:e,done:!!t}}},9740:t=>{t.exports={}},2725:t=>{t.exports=!1},959:t=>{var e=Math.expm1;t.exports=!e||e(10)>22025.465794806718||e(10)<22025.465794806718||-2e-17!=e(-2e-17)?function(t){return 0==(t=+t)?t:t>-1e-6&&t<1e-6?t+t*t/2:Math.exp(t)-1}:e},7682:(t,e,n)=>{var r=n(2987),i=Math.pow,o=i(2,-52),a=i(2,-23),u=i(2,127)*(2-a),s=i(2,-126);t.exports=Math.fround||function(t){var e,n,i=Math.abs(t),c=r(t);return i<s?c*(i/s/a+1/o-1/o)*s*a:(n=(e=(1+a/o)*i)-(e-i))>u||n!=n?c*(1/0):c*n}},1618:t=>{t.exports=Math.log1p||function(t){return(t=+t)>-1e-8&&t<1e-8?t-t*t/2:Math.log(1+t)}},2987:t=>{t.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},4278:(t,e,n)=>{var r=n(4316)("meta"),i=n(1255),o=n(7384),a=n(3886).f,u=0,s=Object.isExtensible||function(){return!0},c=!n(5338)((function(){return s(Object.preventExtensions({}))})),f=function(t){a(t,r,{value:{i:"O"+ ++u,w:{}}})},l=t.exports={KEY:r,NEED:!1,fastKey:function(t,e){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,r)){if(!s(t))return"F";if(!e)return"E";f(t)}return t[r].i},getWeak:function(t,e){if(!o(t,r)){if(!s(t))return!0;if(!e)return!1;f(t)}return t[r].w},onFreeze:function(t){return c&&l.NEED&&s(t)&&!o(t,r)&&f(t),t}}},7485:(t,e,n)=>{var r=n(7571),i=n(7225).set,o=r.MutationObserver||r.WebKitMutationObserver,a=r.process,u=r.Promise,s="process"==n(1669)(a);t.exports=function(){var t,e,n,c=function(){var r,i;for(s&&(r=a.domain)&&r.exit();t;){i=t.fn,t=t.next;try{i()}catch(r){throw t?n():e=void 0,r}}e=void 0,r&&r.enter()};if(s)n=function(){a.nextTick(c)};else if(!o||r.navigator&&r.navigator.standalone)if(u&&u.resolve){var f=u.resolve(void 0);n=function(){f.then(c)}}else n=function(){i.call(r,c)};else{var l=!0,h=document.createTextNode("");new o(c).observe(h,{characterData:!0}),n=function(){h.data=l=!l}}return function(r){var i={fn:r,next:void 0};e&&(e.next=i),t||(t=i,n()),e=i}}},449:(t,e,n)=>{"use strict";var r=n(1464);function i(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=r(e),this.reject=r(n)}t.exports.f=function(t){return new i(t)}},4643:(t,e,n)=>{"use strict";var r=n(1216),i=n(9804),o=n(3844),a=n(4179),u=n(7583),s=n(8579),c=Object.assign;t.exports=!c||n(5338)((function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach((function(t){e[t]=t})),7!=c({},t)[n]||Object.keys(c({},e)).join("")!=r}))?function(t,e){for(var n=u(t),c=arguments.length,f=1,l=o.f,h=a.f;c>f;)for(var d,p=s(arguments[f++]),v=l?i(p).concat(l(p)):i(p),g=v.length,y=0;g>y;)d=v[y++],r&&!h.call(p,d)||(n[d]=p[d]);return n}:c},9055:(t,e,n)=>{var r=n(486),i=n(6283),o=n(9824),a=n(3574)("IE_PROTO"),u=function(){},s=function(){var t,e=n(3438)("iframe"),r=o.length;for(e.style.display="none",n(7680).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),s=t.F;r--;)delete s.prototype[o[r]];return s()};t.exports=Object.create||function(t,e){var n;return null!==t?(u.prototype=r(t),n=new u,u.prototype=null,n[a]=t):n=s(),void 0===e?n:i(n,e)}},3886:(t,e,n)=>{var r=n(486),i=n(6252),o=n(4467),a=Object.defineProperty;e.f=n(1216)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},6283:(t,e,n)=>{var r=n(3886),i=n(486),o=n(9804);t.exports=n(1216)?Object.defineProperties:function(t,e){i(t);for(var n,a=o(e),u=a.length,s=0;u>s;)r.f(t,n=a[s++],e[n]);return t}},5385:(t,e,n)=>{var r=n(4179),i=n(8328),o=n(8182),a=n(4467),u=n(7384),s=n(6252),c=Object.getOwnPropertyDescriptor;e.f=n(1216)?c:function(t,e){if(t=o(t),e=a(e,!0),s)try{return c(t,e)}catch(t){}if(u(t,e))return i(!r.f.call(t,e),t[e])}},3473:(t,e,n)=>{var r=n(8182),i=n(6907).f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return a&&"[object Window]"==o.call(t)?function(t){try{return i(t)}catch(t){return a.slice()}}(t):i(r(t))}},6907:(t,e,n)=>{var r=n(946),i=n(9824).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},3844:(t,e)=>{e.f=Object.getOwnPropertySymbols},9881:(t,e,n)=>{var r=n(7384),i=n(7583),o=n(3574)("IE_PROTO"),a=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),r(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},946:(t,e,n)=>{var r=n(7384),i=n(8182),o=n(4538)(!1),a=n(3574)("IE_PROTO");t.exports=function(t,e){var n,u=i(t),s=0,c=[];for(n in u)n!=a&&r(u,n)&&c.push(n);for(;e.length>s;)r(u,n=e[s++])&&(~o(c,n)||c.push(n));return c}},9804:(t,e,n)=>{var r=n(946),i=n(9824);t.exports=Object.keys||function(t){return r(t,i)}},4179:(t,e)=>{e.f={}.propertyIsEnumerable},381:(t,e,n)=>{var r=n(7044),i=n(2845),o=n(5338);t.exports=function(t,e){var n=(i.Object||{})[t]||Object[t],a={};a[t]=e(n),r(r.S+r.F*o((function(){n(1)})),"Object",a)}},6460:(t,e,n)=>{var r=n(1216),i=n(9804),o=n(8182),a=n(4179).f;t.exports=function(t){return function(e){for(var n,u=o(e),s=i(u),c=s.length,f=0,l=[];c>f;)n=s[f++],r&&!a.call(u,n)||l.push(t?[n,u[n]]:u[n]);return l}}},8125:(t,e,n)=>{var r=n(6907),i=n(3844),o=n(486),a=n(7571).Reflect;t.exports=a&&a.ownKeys||function(t){var e=r.f(o(t)),n=i.f;return n?e.concat(n(t)):e}},1885:(t,e,n)=>{var r=n(7571).parseFloat,i=n(4961).trim;t.exports=1/r(n(1644)+"-0")!=-1/0?function(t){var e=i(String(t),3),n=r(e);return 0===n&&"-"==e.charAt(0)?-0:n}:r},343:(t,e,n)=>{var r=n(7571).parseInt,i=n(4961).trim,o=n(1644),a=/^[-+]?0[xX]/;t.exports=8!==r(o+"08")||22!==r(o+"0x16")?function(t,e){var n=i(String(t),3);return r(n,e>>>0||(a.test(n)?16:10))}:r},9696:t=>{t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},909:(t,e,n)=>{var r=n(486),i=n(1255),o=n(449);t.exports=function(t,e){if(r(t),i(e)&&e.constructor===t)return e;var n=o.f(t);return(0,n.resolve)(e),n.promise}},8328:t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},8565:(t,e,n)=>{var r=n(6476);t.exports=function(t,e,n){for(var i in e)r(t,i,e[i],n);return t}},6476:(t,e,n)=>{var r=n(7571),i=n(913),o=n(7384),a=n(4316)("src"),u=n(8454),s="toString",c=(""+u).split(s);n(2845).inspectSource=function(t){return u.call(t)},(t.exports=function(t,e,n,u){var s="function"==typeof n;s&&(o(n,"name")||i(n,"name",e)),t[e]!==n&&(s&&(o(n,a)||i(n,a,t[e]?""+t[e]:c.join(String(e)))),t===r?t[e]=n:u?t[e]?t[e]=n:i(t,e,n):(delete t[e],i(t,e,n)))})(Function.prototype,s,(function(){return"function"==typeof this&&this[a]||u.call(this)}))},2968:(t,e,n)=>{"use strict";var r=n(4939),i=RegExp.prototype.exec;t.exports=function(t,e){var n=t.exec;if("function"==typeof n){var o=n.call(t,e);if("object"!=typeof o)throw new TypeError("RegExp exec method returned something other than an Object or null");return o}if("RegExp"!==r(t))throw new TypeError("RegExp#exec called on incompatible receiver");return i.call(t,e)}},9020:(t,e,n)=>{"use strict";var r,i,o=n(3649),a=RegExp.prototype.exec,u=String.prototype.replace,s=a,c=(r=/a/,i=/b*/g,a.call(r,"a"),a.call(i,"a"),0!==r.lastIndex||0!==i.lastIndex),f=void 0!==/()??/.exec("")[1];(c||f)&&(s=function(t){var e,n,r,i,s=this;return f&&(n=new RegExp("^"+s.source+"$(?!\\s)",o.call(s))),c&&(e=s.lastIndex),r=a.call(s,t),c&&r&&(s.lastIndex=s.global?r.index+r[0].length:e),f&&r&&r.length>1&&u.call(r[0],n,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(r[i]=void 0)})),r}),t.exports=s},6962:t=>{t.exports=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}},473:(t,e,n)=>{var r=n(1255),i=n(486),o=function(t,e){if(i(t),!r(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,r){try{(r=n(994)(Function.call,n(5385).f(Object.prototype,"__proto__").set,2))(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,n){return o(t,n),e?t.__proto__=n:r(t,n),t}}({},!1):void 0),check:o}},4412:(t,e,n)=>{"use strict";var r=n(7571),i=n(3886),o=n(1216),a=n(341)("species");t.exports=function(t){var e=r[t];o&&e&&!e[a]&&i.f(e,a,{configurable:!0,get:function(){return this}})}},5837:(t,e,n)=>{var r=n(3886).f,i=n(7384),o=n(341)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},3574:(t,e,n)=>{var r=n(5570)("keys"),i=n(4316);t.exports=function(t){return r[t]||(r[t]=i(t))}},5570:(t,e,n)=>{var r=n(2845),i=n(7571),o="__core-js_shared__",a=i[o]||(i[o]={});(t.exports=function(t,e){return a[t]||(a[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n(2725)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},8713:(t,e,n)=>{var r=n(486),i=n(1464),o=n(341)("species");t.exports=function(t,e){var n,a=r(t).constructor;return void 0===a||null==(n=r(a)[o])?e:i(n)}},5296:(t,e,n)=>{"use strict";var r=n(5338);t.exports=function(t,e){return!!t&&r((function(){e?t.call(null,(function(){}),1):t.call(null)}))}},8016:(t,e,n)=>{var r=n(5845),i=n(5091);t.exports=function(t){return function(e,n){var o,a,u=String(i(e)),s=r(n),c=u.length;return s<0||s>=c?t?"":void 0:(o=u.charCodeAt(s))<55296||o>56319||s+1===c||(a=u.charCodeAt(s+1))<56320||a>57343?t?u.charAt(s):o:t?u.slice(s,s+2):a-56320+(o-55296<<10)+65536}}},5692:(t,e,n)=>{var r=n(8990),i=n(5091);t.exports=function(t,e,n){if(r(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(t))}},5264:(t,e,n)=>{var r=n(7044),i=n(5338),o=n(5091),a=/"/g,u=function(t,e,n,r){var i=String(o(t)),u="<"+e;return""!==n&&(u+=" "+n+'="'+String(r).replace(a,""")+'"'),u+">"+i+"</"+e+">"};t.exports=function(t,e){var n={};n[t]=e(u),r(r.P+r.F*i((function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3})),"String",n)}},8261:(t,e,n)=>{var r=n(8087),i=n(5458),o=n(5091);t.exports=function(t,e,n,a){var u=String(o(t)),s=u.length,c=void 0===n?" ":String(n),f=r(e);if(f<=s||""==c)return u;var l=f-s,h=i.call(c,Math.ceil(l/c.length));return h.length>l&&(h=h.slice(0,l)),a?h+u:u+h}},5458:(t,e,n)=>{"use strict";var r=n(5845),i=n(5091);t.exports=function(t){var e=String(i(this)),n="",o=r(t);if(o<0||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(e+=e))1&o&&(n+=e);return n}},4961:(t,e,n)=>{var r=n(7044),i=n(5091),o=n(5338),a=n(1644),u="["+a+"]",s=RegExp("^"+u+u+"*"),c=RegExp(u+u+"*$"),f=function(t,e,n){var i={},u=o((function(){return!!a[t]()||"
"!="
"[t]()})),s=i[t]=u?e(l):a[t];n&&(i[n]=s),r(r.P+r.F*u,"String",i)},l=f.trim=function(t,e){return t=String(i(t)),1&e&&(t=t.replace(s,"")),2&e&&(t=t.replace(c,"")),t};t.exports=f},1644:t=>{t.exports="\t\n\v\f\r \u2028\u2029\ufeff"},7225:(t,e,n)=>{var r,i,o,a=n(994),u=n(8262),s=n(7680),c=n(3438),f=n(7571),l=f.process,h=f.setImmediate,d=f.clearImmediate,p=f.MessageChannel,v=f.Dispatch,g=0,y={},m=function(){var t=+this;if(y.hasOwnProperty(t)){var e=y[t];delete y[t],e()}},b=function(t){m.call(t.data)};h&&d||(h=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return y[++g]=function(){u("function"==typeof t?t:Function(t),e)},r(g),g},d=function(t){delete y[t]},"process"==n(1669)(l)?r=function(t){l.nextTick(a(m,t,1))}:v&&v.now?r=function(t){v.now(a(m,t,1))}:p?(o=(i=new p).port2,i.port1.onmessage=b,r=a(o.postMessage,o,1)):f.addEventListener&&"function"==typeof postMessage&&!f.importScripts?(r=function(t){f.postMessage(t+"","*")},f.addEventListener("message",b,!1)):r="onreadystatechange"in c("script")?function(t){s.appendChild(c("script")).onreadystatechange=function(){s.removeChild(this),m.call(t)}}:function(t){setTimeout(a(m,t,1),0)}),t.exports={set:h,clear:d}},9260:(t,e,n)=>{var r=n(5845),i=Math.max,o=Math.min;t.exports=function(t,e){return(t=r(t))<0?i(t+e,0):o(t,e)}},5e3:(t,e,n)=>{var r=n(5845),i=n(8087);t.exports=function(t){if(void 0===t)return 0;var e=r(t),n=i(e);if(e!==n)throw RangeError("Wrong length!");return n}},5845:t=>{var e=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:e)(t)}},8182:(t,e,n)=>{var r=n(8579),i=n(5091);t.exports=function(t){return r(i(t))}},8087:(t,e,n)=>{var r=n(5845),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},7583:(t,e,n)=>{var r=n(5091);t.exports=function(t){return Object(r(t))}},4467:(t,e,n)=>{var r=n(1255);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},1063:(t,e,n)=>{"use strict";if(n(1216)){var r=n(2725),i=n(7571),o=n(5338),a=n(7044),u=n(604),s=n(1541),c=n(994),f=n(6903),l=n(8328),h=n(913),d=n(8565),p=n(5845),v=n(8087),g=n(5e3),y=n(9260),m=n(4467),b=n(7384),_=n(4939),x=n(1255),w=n(7583),E=n(9981),S=n(9055),A=n(9881),T=n(6907).f,I=n(9685),C=n(4316),D=n(341),N=n(7622),k=n(4538),R=n(8713),O=n(163),M=n(9740),P=n(2803),G=n(4412),L=n(8676),U=n(1064),F=n(3886),B=n(5385),z=F.f,j=B.f,W=i.RangeError,V=i.TypeError,X=i.Uint8Array,H="ArrayBuffer",q="SharedArrayBuffer",Y="BYTES_PER_ELEMENT",K=Array.prototype,Z=s.ArrayBuffer,$=s.DataView,J=N(0),Q=N(2),tt=N(3),et=N(4),nt=N(5),rt=N(6),it=k(!0),ot=k(!1),at=O.values,ut=O.keys,st=O.entries,ct=K.lastIndexOf,ft=K.reduce,lt=K.reduceRight,ht=K.join,dt=K.sort,pt=K.slice,vt=K.toString,gt=K.toLocaleString,yt=D("iterator"),mt=D("toStringTag"),bt=C("typed_constructor"),_t=C("def_constructor"),xt=u.CONSTR,wt=u.TYPED,Et=u.VIEW,St="Wrong length!",At=N(1,(function(t,e){return Nt(R(t,t[_t]),e)})),Tt=o((function(){return 1===new X(new Uint16Array([1]).buffer)[0]})),It=!!X&&!!X.prototype.set&&o((function(){new X(1).set({})})),Ct=function(t,e){var n=p(t);if(n<0||n%e)throw W("Wrong offset!");return n},Dt=function(t){if(x(t)&&wt in t)return t;throw V(t+" is not a typed array!")},Nt=function(t,e){if(!x(t)||!(bt in t))throw V("It is not a typed array constructor!");return new t(e)},kt=function(t,e){return Rt(R(t,t[_t]),e)},Rt=function(t,e){for(var n=0,r=e.length,i=Nt(t,r);r>n;)i[n]=e[n++];return i},Ot=function(t,e,n){z(t,e,{get:function(){return this._d[n]}})},Mt=function(t){var e,n,r,i,o,a,u=w(t),s=arguments.length,f=s>1?arguments[1]:void 0,l=void 0!==f,h=I(u);if(null!=h&&!E(h)){for(a=h.call(u),r=[],e=0;!(o=a.next()).done;e++)r.push(o.value);u=r}for(l&&s>2&&(f=c(f,arguments[2],2)),e=0,n=v(u.length),i=Nt(this,n);n>e;e++)i[e]=l?f(u[e],e):u[e];return i},Pt=function(){for(var t=0,e=arguments.length,n=Nt(this,e);e>t;)n[t]=arguments[t++];return n},Gt=!!X&&o((function(){gt.call(new X(1))})),Lt=function(){return gt.apply(Gt?pt.call(Dt(this)):Dt(this),arguments)},Ut={copyWithin:function(t,e){return U.call(Dt(this),t,e,arguments.length>2?arguments[2]:void 0)},every:function(t){return et(Dt(this),t,arguments.length>1?arguments[1]:void 0)},fill:function(t){return L.apply(Dt(this),arguments)},filter:function(t){return kt(this,Q(Dt(this),t,arguments.length>1?arguments[1]:void 0))},find:function(t){return nt(Dt(this),t,arguments.length>1?arguments[1]:void 0)},findIndex:function(t){return rt(Dt(this),t,arguments.length>1?arguments[1]:void 0)},forEach:function(t){J(Dt(this),t,arguments.length>1?arguments[1]:void 0)},indexOf:function(t){return ot(Dt(this),t,arguments.length>1?arguments[1]:void 0)},includes:function(t){return it(Dt(this),t,arguments.length>1?arguments[1]:void 0)},join:function(t){return ht.apply(Dt(this),arguments)},lastIndexOf:function(t){return ct.apply(Dt(this),arguments)},map:function(t){return At(Dt(this),t,arguments.length>1?arguments[1]:void 0)},reduce:function(t){return ft.apply(Dt(this),arguments)},reduceRight:function(t){return lt.apply(Dt(this),arguments)},reverse:function(){for(var t,e=this,n=Dt(e).length,r=Math.floor(n/2),i=0;i<r;)t=e[i],e[i++]=e[--n],e[n]=t;return e},some:function(t){return tt(Dt(this),t,arguments.length>1?arguments[1]:void 0)},sort:function(t){return dt.call(Dt(this),t)},subarray:function(t,e){var n=Dt(this),r=n.length,i=y(t,r);return new(R(n,n[_t]))(n.buffer,n.byteOffset+i*n.BYTES_PER_ELEMENT,v((void 0===e?r:y(e,r))-i))}},Ft=function(t,e){return kt(this,pt.call(Dt(this),t,e))},Bt=function(t){Dt(this);var e=Ct(arguments[1],1),n=this.length,r=w(t),i=v(r.length),o=0;if(i+e>n)throw W(St);for(;o<i;)this[e+o]=r[o++]},zt={entries:function(){return st.call(Dt(this))},keys:function(){return ut.call(Dt(this))},values:function(){return at.call(Dt(this))}},jt=function(t,e){return x(t)&&t[wt]&&"symbol"!=typeof e&&e in t&&String(+e)==String(e)},Wt=function(t,e){return jt(t,e=m(e,!0))?l(2,t[e]):j(t,e)},Vt=function(t,e,n){return!(jt(t,e=m(e,!0))&&x(n)&&b(n,"value"))||b(n,"get")||b(n,"set")||n.configurable||b(n,"writable")&&!n.writable||b(n,"enumerable")&&!n.enumerable?z(t,e,n):(t[e]=n.value,t)};xt||(B.f=Wt,F.f=Vt),a(a.S+a.F*!xt,"Object",{getOwnPropertyDescriptor:Wt,defineProperty:Vt}),o((function(){vt.call({})}))&&(vt=gt=function(){return ht.call(this)});var Xt=d({},Ut);d(Xt,zt),h(Xt,yt,zt.values),d(Xt,{slice:Ft,set:Bt,constructor:function(){},toString:vt,toLocaleString:Lt}),Ot(Xt,"buffer","b"),Ot(Xt,"byteOffset","o"),Ot(Xt,"byteLength","l"),Ot(Xt,"length","e"),z(Xt,mt,{get:function(){return this[wt]}}),t.exports=function(t,e,n,s){var c=t+((s=!!s)?"Clamped":"")+"Array",l="get"+t,d="set"+t,p=i[c],y=p||{},m=p&&A(p),b=!p||!u.ABV,w={},E=p&&p.prototype,I=function(t,n){z(t,n,{get:function(){return function(t,n){var r=t._d;return r.v[l](n*e+r.o,Tt)}(this,n)},set:function(t){return function(t,n,r){var i=t._d;s&&(r=(r=Math.round(r))<0?0:r>255?255:255&r),i.v[d](n*e+i.o,r,Tt)}(this,n,t)},enumerable:!0})};b?(p=n((function(t,n,r,i){f(t,p,c,"_d");var o,a,u,s,l=0,d=0;if(x(n)){if(!(n instanceof Z||(s=_(n))==H||s==q))return wt in n?Rt(p,n):Mt.call(p,n);o=n,d=Ct(r,e);var y=n.byteLength;if(void 0===i){if(y%e)throw W(St);if((a=y-d)<0)throw W(St)}else if((a=v(i)*e)+d>y)throw W(St);u=a/e}else u=g(n),o=new Z(a=u*e);for(h(t,"_d",{b:o,o:d,l:a,e:u,v:new $(o)});l<u;)I(t,l++)})),E=p.prototype=S(Xt),h(E,"constructor",p)):o((function(){p(1)}))&&o((function(){new p(-1)}))&&P((function(t){new p,new p(null),new p(1.5),new p(t)}),!0)||(p=n((function(t,n,r,i){var o;return f(t,p,c),x(n)?n instanceof Z||(o=_(n))==H||o==q?void 0!==i?new y(n,Ct(r,e),i):void 0!==r?new y(n,Ct(r,e)):new y(n):wt in n?Rt(p,n):Mt.call(p,n):new y(g(n))})),J(m!==Function.prototype?T(y).concat(T(m)):T(y),(function(t){t in p||h(p,t,y[t])})),p.prototype=E,r||(E.constructor=p));var C=E[yt],D=!!C&&("values"==C.name||null==C.name),N=zt.values;h(p,bt,!0),h(E,wt,c),h(E,Et,!0),h(E,_t,p),(s?new p(1)[mt]==c:mt in E)||z(E,mt,{get:function(){return c}}),w[c]=p,a(a.G+a.W+a.F*(p!=y),w),a(a.S,c,{BYTES_PER_ELEMENT:e}),a(a.S+a.F*o((function(){y.of.call(p,1)})),c,{from:Mt,of:Pt}),Y in E||h(E,Y,e),a(a.P,c,Ut),G(c),a(a.P+a.F*It,c,{set:Bt}),a(a.P+a.F*!D,c,zt),r||E.toString==vt||(E.toString=vt),a(a.P+a.F*o((function(){new p(1).slice()})),c,{slice:Ft}),a(a.P+a.F*(o((function(){return[1,2].toLocaleString()!=new p([1,2]).toLocaleString()}))||!o((function(){E.toLocaleString.call([1,2])}))),c,{toLocaleString:Lt}),M[c]=D?C:N,r||D||h(E,yt,N)}}else t.exports=function(){}},1541:(t,e,n)=>{"use strict";var r=n(7571),i=n(1216),o=n(2725),a=n(604),u=n(913),s=n(8565),c=n(5338),f=n(6903),l=n(5845),h=n(8087),d=n(5e3),p=n(6907).f,v=n(3886).f,g=n(8676),y=n(5837),m="ArrayBuffer",b="DataView",_="Wrong index!",x=r.ArrayBuffer,w=r.DataView,E=r.Math,S=r.RangeError,A=r.Infinity,T=x,I=E.abs,C=E.pow,D=E.floor,N=E.log,k=E.LN2,R="buffer",O="byteLength",M="byteOffset",P=i?"_b":R,G=i?"_l":O,L=i?"_o":M;function U(t,e,n){var r,i,o,a=new Array(n),u=8*n-e-1,s=(1<<u)-1,c=s>>1,f=23===e?C(2,-24)-C(2,-77):0,l=0,h=t<0||0===t&&1/t<0?1:0;for((t=I(t))!=t||t===A?(i=t!=t?1:0,r=s):(r=D(N(t)/k),t*(o=C(2,-r))<1&&(r--,o*=2),(t+=r+c>=1?f/o:f*C(2,1-c))*o>=2&&(r++,o/=2),r+c>=s?(i=0,r=s):r+c>=1?(i=(t*o-1)*C(2,e),r+=c):(i=t*C(2,c-1)*C(2,e),r=0));e>=8;a[l++]=255&i,i/=256,e-=8);for(r=r<<e|i,u+=e;u>0;a[l++]=255&r,r/=256,u-=8);return a[--l]|=128*h,a}function F(t,e,n){var r,i=8*n-e-1,o=(1<<i)-1,a=o>>1,u=i-7,s=n-1,c=t[s--],f=127&c;for(c>>=7;u>0;f=256*f+t[s],s--,u-=8);for(r=f&(1<<-u)-1,f>>=-u,u+=e;u>0;r=256*r+t[s],s--,u-=8);if(0===f)f=1-a;else{if(f===o)return r?NaN:c?-A:A;r+=C(2,e),f-=a}return(c?-1:1)*r*C(2,f-e)}function B(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]}function z(t){return[255&t]}function j(t){return[255&t,t>>8&255]}function W(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function V(t){return U(t,52,8)}function X(t){return U(t,23,4)}function H(t,e,n){v(t.prototype,e,{get:function(){return this[n]}})}function q(t,e,n,r){var i=d(+n);if(i+e>t[G])throw S(_);var o=t[P]._b,a=i+t[L],u=o.slice(a,a+e);return r?u:u.reverse()}function Y(t,e,n,r,i,o){var a=d(+n);if(a+e>t[G])throw S(_);for(var u=t[P]._b,s=a+t[L],c=r(+i),f=0;f<e;f++)u[s+f]=c[o?f:e-f-1]}if(a.ABV){if(!c((function(){x(1)}))||!c((function(){new x(-1)}))||c((function(){return new x,new x(1.5),new x(NaN),x.name!=m}))){for(var K,Z=(x=function(t){return f(this,x),new T(d(t))}).prototype=T.prototype,$=p(T),J=0;$.length>J;)(K=$[J++])in x||u(x,K,T[K]);o||(Z.constructor=x)}var Q=new w(new x(2)),tt=w.prototype.setInt8;Q.setInt8(0,2147483648),Q.setInt8(1,2147483649),!Q.getInt8(0)&&Q.getInt8(1)||s(w.prototype,{setInt8:function(t,e){tt.call(this,t,e<<24>>24)},setUint8:function(t,e){tt.call(this,t,e<<24>>24)}},!0)}else x=function(t){f(this,x,m);var e=d(t);this._b=g.call(new Array(e),0),this[G]=e},w=function(t,e,n){f(this,w,b),f(t,x,b);var r=t[G],i=l(e);if(i<0||i>r)throw S("Wrong offset!");if(i+(n=void 0===n?r-i:h(n))>r)throw S("Wrong length!");this[P]=t,this[L]=i,this[G]=n},i&&(H(x,O,"_l"),H(w,R,"_b"),H(w,O,"_l"),H(w,M,"_o")),s(w.prototype,{getInt8:function(t){return q(this,1,t)[0]<<24>>24},getUint8:function(t){return q(this,1,t)[0]},getInt16:function(t){var e=q(this,2,t,arguments[1]);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=q(this,2,t,arguments[1]);return e[1]<<8|e[0]},getInt32:function(t){return B(q(this,4,t,arguments[1]))},getUint32:function(t){return B(q(this,4,t,arguments[1]))>>>0},getFloat32:function(t){return F(q(this,4,t,arguments[1]),23,4)},getFloat64:function(t){return F(q(this,8,t,arguments[1]),52,8)},setInt8:function(t,e){Y(this,1,t,z,e)},setUint8:function(t,e){Y(this,1,t,z,e)},setInt16:function(t,e){Y(this,2,t,j,e,arguments[2])},setUint16:function(t,e){Y(this,2,t,j,e,arguments[2])},setInt32:function(t,e){Y(this,4,t,W,e,arguments[2])},setUint32:function(t,e){Y(this,4,t,W,e,arguments[2])},setFloat32:function(t,e){Y(this,4,t,X,e,arguments[2])},setFloat64:function(t,e){Y(this,8,t,V,e,arguments[2])}});y(x,m),y(w,b),u(w.prototype,a.VIEW,!0),e.ArrayBuffer=x,e.DataView=w},604:(t,e,n)=>{for(var r,i=n(7571),o=n(913),a=n(4316),u=a("typed_array"),s=a("view"),c=!(!i.ArrayBuffer||!i.DataView),f=c,l=0,h="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");l<9;)(r=i[h[l++]])?(o(r.prototype,u,!0),o(r.prototype,s,!0)):f=!1;t.exports={ABV:c,CONSTR:f,TYPED:u,VIEW:s}},4316:t=>{var e=0,n=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++e+n).toString(36))}},2541:(t,e,n)=>{var r=n(7571).navigator;t.exports=r&&r.userAgent||""},4664:(t,e,n)=>{var r=n(1255);t.exports=function(t,e){if(!r(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t}},6262:(t,e,n)=>{var r=n(7571),i=n(2845),o=n(2725),a=n(7686),u=n(3886).f;t.exports=function(t){var e=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||u(e,t,{value:a.f(t)})}},7686:(t,e,n)=>{e.f=n(341)},341:(t,e,n)=>{var r=n(5570)("wks"),i=n(4316),o=n(7571).Symbol,a="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=a&&o[t]||(a?o:i)("Symbol."+t))}).store=r},9685:(t,e,n)=>{var r=n(4939),i=n(341)("iterator"),o=n(9740);t.exports=n(2845).getIteratorMethod=function(t){if(null!=t)return t[i]||t["@@iterator"]||o[r(t)]}},5305:(t,e,n)=>{var r=n(7044);r(r.P,"Array",{copyWithin:n(1064)}),n(4691)("copyWithin")},5015:(t,e,n)=>{"use strict";var r=n(7044),i=n(7622)(4);r(r.P+r.F*!n(5296)([].every,!0),"Array",{every:function(t){return i(this,t,arguments[1])}})},6341:(t,e,n)=>{var r=n(7044);r(r.P,"Array",{fill:n(8676)}),n(4691)("fill")},5119:(t,e,n)=>{"use strict";var r=n(7044),i=n(7622)(2);r(r.P+r.F*!n(5296)([].filter,!0),"Array",{filter:function(t){return i(this,t,arguments[1])}})},4488:(t,e,n)=>{"use strict";var r=n(7044),i=n(7622)(6),o="findIndex",a=!0;o in[]&&Array(1)[o]((function(){a=!1})),r(r.P+r.F*a,"Array",{findIndex:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),n(4691)(o)},5915:(t,e,n)=>{"use strict";var r=n(7044),i=n(7622)(5),o="find",a=!0;o in[]&&Array(1).find((function(){a=!1})),r(r.P+r.F*a,"Array",{find:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),n(4691)(o)},5788:(t,e,n)=>{"use strict";var r=n(7044),i=n(7622)(0),o=n(5296)([].forEach,!0);r(r.P+r.F*!o,"Array",{forEach:function(t){return i(this,t,arguments[1])}})},9689:(t,e,n)=>{"use strict";var r=n(994),i=n(7044),o=n(7583),a=n(4902),u=n(9981),s=n(8087),c=n(1395),f=n(9685);i(i.S+i.F*!n(2803)((function(t){Array.from(t)})),"Array",{from:function(t){var e,n,i,l,h=o(t),d="function"==typeof this?this:Array,p=arguments.length,v=p>1?arguments[1]:void 0,g=void 0!==v,y=0,m=f(h);if(g&&(v=r(v,p>2?arguments[2]:void 0,2)),null==m||d==Array&&u(m))for(n=new d(e=s(h.length));e>y;y++)c(n,y,g?v(h[y],y):h[y]);else for(l=m.call(h),n=new d;!(i=l.next()).done;y++)c(n,y,g?a(l,v,[i.value,y],!0):i.value);return n.length=y,n}})},5377:(t,e,n)=>{"use strict";var r=n(7044),i=n(4538)(!1),o=[].indexOf,a=!!o&&1/[1].indexOf(1,-0)<0;r(r.P+r.F*(a||!n(5296)(o)),"Array",{indexOf:function(t){return a?o.apply(this,arguments)||0:i(this,t,arguments[1])}})},2247:(t,e,n)=>{var r=n(7044);r(r.S,"Array",{isArray:n(7183)})},163:(t,e,n)=>{"use strict";var r=n(4691),i=n(8782),o=n(9740),a=n(8182);t.exports=n(966)(Array,"Array",(function(t,e){this._t=a(t),this._i=0,this._k=e}),(function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):i(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])}),"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},9026:(t,e,n)=>{"use strict";var r=n(7044),i=n(8182),o=[].join;r(r.P+r.F*(n(8579)!=Object||!n(5296)(o)),"Array",{join:function(t){return o.call(i(this),void 0===t?",":t)}})},9879:(t,e,n)=>{"use strict";var r=n(7044),i=n(8182),o=n(5845),a=n(8087),u=[].lastIndexOf,s=!!u&&1/[1].lastIndexOf(1,-0)<0;r(r.P+r.F*(s||!n(5296)(u)),"Array",{lastIndexOf:function(t){if(s)return u.apply(this,arguments)||0;var e=i(this),n=a(e.length),r=n-1;for(arguments.length>1&&(r=Math.min(r,o(arguments[1]))),r<0&&(r=n+r);r>=0;r--)if(r in e&&e[r]===t)return r||0;return-1}})},7878:(t,e,n)=>{"use strict";var r=n(7044),i=n(7622)(1);r(r.P+r.F*!n(5296)([].map,!0),"Array",{map:function(t){return i(this,t,arguments[1])}})},9003:(t,e,n)=>{"use strict";var r=n(7044),i=n(1395);r(r.S+r.F*n(5338)((function(){function t(){}return!(Array.of.call(t)instanceof t)})),"Array",{of:function(){for(var t=0,e=arguments.length,n=new("function"==typeof this?this:Array)(e);e>t;)i(n,t,arguments[t++]);return n.length=e,n}})},646:(t,e,n)=>{"use strict";var r=n(7044),i=n(5336);r(r.P+r.F*!n(5296)([].reduceRight,!0),"Array",{reduceRight:function(t){return i(this,t,arguments.length,arguments[1],!0)}})},8059:(t,e,n)=>{"use strict";var r=n(7044),i=n(5336);r(r.P+r.F*!n(5296)([].reduce,!0),"Array",{reduce:function(t){return i(this,t,arguments.length,arguments[1],!1)}})},4088:(t,e,n)=>{"use strict";var r=n(7044),i=n(7680),o=n(1669),a=n(9260),u=n(8087),s=[].slice;r(r.P+r.F*n(5338)((function(){i&&s.call(i)})),"Array",{slice:function(t,e){var n=u(this.length),r=o(this);if(e=void 0===e?n:e,"Array"==r)return s.call(this,t,e);for(var i=a(t,n),c=a(e,n),f=u(c-i),l=new Array(f),h=0;h<f;h++)l[h]="String"==r?this.charAt(i+h):this[i+h];return l}})},3135:(t,e,n)=>{"use strict";var r=n(7044),i=n(7622)(3);r(r.P+r.F*!n(5296)([].some,!0),"Array",{some:function(t){return i(this,t,arguments[1])}})},535:(t,e,n)=>{"use strict";var r=n(7044),i=n(1464),o=n(7583),a=n(5338),u=[].sort,s=[1,2,3];r(r.P+r.F*(a((function(){s.sort(void 0)}))||!a((function(){s.sort(null)}))||!n(5296)(u)),"Array",{sort:function(t){return void 0===t?u.call(o(this)):u.call(o(this),i(t))}})},9281:(t,e,n)=>{n(4412)("Array")},4094:(t,e,n)=>{var r=n(7044);r(r.S,"Date",{now:function(){return(new Date).getTime()}})},5013:(t,e,n)=>{var r=n(7044),i=n(4506);r(r.P+r.F*(Date.prototype.toISOString!==i),"Date",{toISOString:i})},8781:(t,e,n)=>{"use strict";var r=n(7044),i=n(7583),o=n(4467);r(r.P+r.F*n(5338)((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})})),"Date",{toJSON:function(t){var e=i(this),n=o(e);return"number"!=typeof n||isFinite(n)?e.toISOString():null}})},8723:(t,e,n)=>{var r=n(341)("toPrimitive"),i=Date.prototype;r in i||n(913)(i,r,n(9514))},3735:(t,e,n)=>{var r=Date.prototype,i="Invalid Date",o=r.toString,a=r.getTime;new Date(NaN)+""!=i&&n(6476)(r,"toString",(function(){var t=a.call(this);return t==t?o.call(this):i}))},1765:(t,e,n)=>{var r=n(7044);r(r.P,"Function",{bind:n(8366)})},7451:(t,e,n)=>{"use strict";var r=n(1255),i=n(9881),o=n(341)("hasInstance"),a=Function.prototype;o in a||n(3886).f(a,o,{value:function(t){if("function"!=typeof this||!r(t))return!1;if(!r(this.prototype))return t instanceof this;for(;t=i(t);)if(this.prototype===t)return!0;return!1}})},5747:(t,e,n)=>{var r=n(3886).f,i=Function.prototype,o=/^\s*function ([^ (]*)/,a="name";a in i||n(1216)&&r(i,a,{configurable:!0,get:function(){try{return(""+this).match(o)[1]}catch(t){return""}}})},6441:(t,e,n)=>{"use strict";var r=n(3050),i=n(4664),o="Map";t.exports=n(859)(o,(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{get:function(t){var e=r.getEntry(i(this,o),t);return e&&e.v},set:function(t,e){return r.def(i(this,o),0===t?0:t,e)}},r,!0)},2212:(t,e,n)=>{var r=n(7044),i=n(1618),o=Math.sqrt,a=Math.acosh;r(r.S+r.F*!(a&&710==Math.floor(a(Number.MAX_VALUE))&&a(1/0)==1/0),"Math",{acosh:function(t){return(t=+t)<1?NaN:t>94906265.62425156?Math.log(t)+Math.LN2:i(t-1+o(t-1)*o(t+1))}})},4230:(t,e,n)=>{var r=n(7044),i=Math.asinh;r(r.S+r.F*!(i&&1/i(0)>0),"Math",{asinh:function t(e){return isFinite(e=+e)&&0!=e?e<0?-t(-e):Math.log(e+Math.sqrt(e*e+1)):e}})},9754:(t,e,n)=>{var r=n(7044),i=Math.atanh;r(r.S+r.F*!(i&&1/i(-0)<0),"Math",{atanh:function(t){return 0==(t=+t)?t:Math.log((1+t)/(1-t))/2}})},2811:(t,e,n)=>{var r=n(7044),i=n(2987);r(r.S,"Math",{cbrt:function(t){return i(t=+t)*Math.pow(Math.abs(t),1/3)}})},3998:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{clz32:function(t){return(t>>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},1769:(t,e,n)=>{var r=n(7044),i=Math.exp;r(r.S,"Math",{cosh:function(t){return(i(t=+t)+i(-t))/2}})},8789:(t,e,n)=>{var r=n(7044),i=n(959);r(r.S+r.F*(i!=Math.expm1),"Math",{expm1:i})},2848:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{fround:n(7682)})},1762:(t,e,n)=>{var r=n(7044),i=Math.abs;r(r.S,"Math",{hypot:function(t,e){for(var n,r,o=0,a=0,u=arguments.length,s=0;a<u;)s<(n=i(arguments[a++]))?(o=o*(r=s/n)*r+1,s=n):o+=n>0?(r=n/s)*r:n;return s===1/0?1/0:s*Math.sqrt(o)}})},1323:(t,e,n)=>{var r=n(7044),i=Math.imul;r(r.S+r.F*n(5338)((function(){return-5!=i(4294967295,5)||2!=i.length})),"Math",{imul:function(t,e){var n=65535,r=+t,i=+e,o=n&r,a=n&i;return 0|o*a+((n&r>>>16)*a+o*(n&i>>>16)<<16>>>0)}})},6063:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{log10:function(t){return Math.log(t)*Math.LOG10E}})},3282:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{log1p:n(1618)})},6816:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{log2:function(t){return Math.log(t)/Math.LN2}})},1854:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{sign:n(2987)})},3303:(t,e,n)=>{var r=n(7044),i=n(959),o=Math.exp;r(r.S+r.F*n(5338)((function(){return-2e-17!=!Math.sinh(-2e-17)})),"Math",{sinh:function(t){return Math.abs(t=+t)<1?(i(t)-i(-t))/2:(o(t-1)-o(-t-1))*(Math.E/2)}})},4421:(t,e,n)=>{var r=n(7044),i=n(959),o=Math.exp;r(r.S,"Math",{tanh:function(t){var e=i(t=+t),n=i(-t);return e==1/0?1:n==1/0?-1:(e-n)/(o(t)+o(-t))}})},2203:(t,e,n)=>{var r=n(7044);r(r.S,"Math",{trunc:function(t){return(t>0?Math.floor:Math.ceil)(t)}})},7454:(t,e,n)=>{"use strict";var r=n(7571),i=n(7384),o=n(1669),a=n(116),u=n(4467),s=n(5338),c=n(6907).f,f=n(5385).f,l=n(3886).f,h=n(4961).trim,d="Number",p=r.Number,v=p,g=p.prototype,y=o(n(9055)(g))==d,m="trim"in String.prototype,b=function(t){var e=u(t,!1);if("string"==typeof e&&e.length>2){var n,r,i,o=(e=m?e.trim():h(e,3)).charCodeAt(0);if(43===o||45===o){if(88===(n=e.charCodeAt(2))||120===n)return NaN}else if(48===o){switch(e.charCodeAt(1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+e}for(var a,s=e.slice(2),c=0,f=s.length;c<f;c++)if((a=s.charCodeAt(c))<48||a>i)return NaN;return parseInt(s,r)}}return+e};if(!p(" 0o1")||!p("0b1")||p("+0x1")){p=function(t){var e=arguments.length<1?0:t,n=this;return n instanceof p&&(y?s((function(){g.valueOf.call(n)})):o(n)!=d)?a(new v(b(e)),n,p):b(e)};for(var _,x=n(1216)?c(v):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),w=0;x.length>w;w++)i(v,_=x[w])&&!i(p,_)&&l(p,_,f(v,_));p.prototype=g,g.constructor=p,n(6476)(r,d,p)}},7551:(t,e,n)=>{var r=n(7044);r(r.S,"Number",{EPSILON:Math.pow(2,-52)})},2929:(t,e,n)=>{var r=n(7044),i=n(7571).isFinite;r(r.S,"Number",{isFinite:function(t){return"number"==typeof t&&i(t)}})},215:(t,e,n)=>{var r=n(7044);r(r.S,"Number",{isInteger:n(1272)})},6183:(t,e,n)=>{var r=n(7044);r(r.S,"Number",{isNaN:function(t){return t!=t}})},8190:(t,e,n)=>{var r=n(7044),i=n(1272),o=Math.abs;r(r.S,"Number",{isSafeInteger:function(t){return i(t)&&o(t)<=9007199254740991}})},476:(t,e,n)=>{var r=n(7044);r(r.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},948:(t,e,n)=>{var r=n(7044);r(r.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},942:(t,e,n)=>{var r=n(7044),i=n(1885);r(r.S+r.F*(Number.parseFloat!=i),"Number",{parseFloat:i})},2870:(t,e,n)=>{var r=n(7044),i=n(343);r(r.S+r.F*(Number.parseInt!=i),"Number",{parseInt:i})},3053:(t,e,n)=>{"use strict";var r=n(7044),i=n(5845),o=n(8347),a=n(5458),u=1..toFixed,s=Math.floor,c=[0,0,0,0,0,0],f="Number.toFixed: incorrect invocation!",l="0",h=function(t,e){for(var n=-1,r=e;++n<6;)r+=t*c[n],c[n]=r%1e7,r=s(r/1e7)},d=function(t){for(var e=6,n=0;--e>=0;)n+=c[e],c[e]=s(n/t),n=n%t*1e7},p=function(){for(var t=6,e="";--t>=0;)if(""!==e||0===t||0!==c[t]){var n=String(c[t]);e=""===e?n:e+a.call(l,7-n.length)+n}return e},v=function(t,e,n){return 0===e?n:e%2==1?v(t,e-1,n*t):v(t*t,e/2,n)};r(r.P+r.F*(!!u&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!n(5338)((function(){u.call({})}))),"Number",{toFixed:function(t){var e,n,r,u,s=o(this,f),c=i(t),g="",y=l;if(c<0||c>20)throw RangeError(f);if(s!=s)return"NaN";if(s<=-1e21||s>=1e21)return String(s);if(s<0&&(g="-",s=-s),s>1e-21)if(e=function(t){for(var e=0,n=t;n>=4096;)e+=12,n/=4096;for(;n>=2;)e+=1,n/=2;return e}(s*v(2,69,1))-69,n=e<0?s*v(2,-e,1):s/v(2,e,1),n*=4503599627370496,(e=52-e)>0){for(h(0,n),r=c;r>=7;)h(1e7,0),r-=7;for(h(v(10,r,1),0),r=e-1;r>=23;)d(1<<23),r-=23;d(1<<r),h(1,1),d(2),y=p()}else h(0,n),h(1<<-e,0),y=p()+a.call(l,c);return c>0?g+((u=y.length)<=c?"0."+a.call(l,c-u)+y:y.slice(0,u-c)+"."+y.slice(u-c)):g+y}})},8032:(t,e,n)=>{"use strict";var r=n(7044),i=n(5338),o=n(8347),a=1..toPrecision;r(r.P+r.F*(i((function(){return"1"!==a.call(1,void 0)}))||!i((function(){a.call({})}))),"Number",{toPrecision:function(t){var e=o(this,"Number#toPrecision: incorrect invocation!");return void 0===t?a.call(e):a.call(e,t)}})},5261:(t,e,n)=>{var r=n(7044);r(r.S+r.F,"Object",{assign:n(4643)})},6051:(t,e,n)=>{var r=n(7044);r(r.S,"Object",{create:n(9055)})},9518:(t,e,n)=>{var r=n(7044);r(r.S+r.F*!n(1216),"Object",{defineProperties:n(6283)})},2640:(t,e,n)=>{var r=n(7044);r(r.S+r.F*!n(1216),"Object",{defineProperty:n(3886).f})},9788:(t,e,n)=>{var r=n(1255),i=n(4278).onFreeze;n(381)("freeze",(function(t){return function(e){return t&&r(e)?t(i(e)):e}}))},8201:(t,e,n)=>{var r=n(8182),i=n(5385).f;n(381)("getOwnPropertyDescriptor",(function(){return function(t,e){return i(r(t),e)}}))},7525:(t,e,n)=>{n(381)("getOwnPropertyNames",(function(){return n(3473).f}))},470:(t,e,n)=>{var r=n(7583),i=n(9881);n(381)("getPrototypeOf",(function(){return function(t){return i(r(t))}}))},7940:(t,e,n)=>{var r=n(1255);n(381)("isExtensible",(function(t){return function(e){return!!r(e)&&(!t||t(e))}}))},6129:(t,e,n)=>{var r=n(1255);n(381)("isFrozen",(function(t){return function(e){return!r(e)||!!t&&t(e)}}))},2802:(t,e,n)=>{var r=n(1255);n(381)("isSealed",(function(t){return function(e){return!r(e)||!!t&&t(e)}}))},9340:(t,e,n)=>{var r=n(7044);r(r.S,"Object",{is:n(6962)})},5723:(t,e,n)=>{var r=n(7583),i=n(9804);n(381)("keys",(function(){return function(t){return i(r(t))}}))},7577:(t,e,n)=>{var r=n(1255),i=n(4278).onFreeze;n(381)("preventExtensions",(function(t){return function(e){return t&&r(e)?t(i(e)):e}}))},1498:(t,e,n)=>{var r=n(1255),i=n(4278).onFreeze;n(381)("seal",(function(t){return function(e){return t&&r(e)?t(i(e)):e}}))},1584:(t,e,n)=>{var r=n(7044);r(r.S,"Object",{setPrototypeOf:n(473).set})},7298:(t,e,n)=>{"use strict";var r=n(4939),i={};i[n(341)("toStringTag")]="z",i+""!="[object z]"&&n(6476)(Object.prototype,"toString",(function(){return"[object "+r(this)+"]"}),!0)},2809:(t,e,n)=>{var r=n(7044),i=n(1885);r(r.G+r.F*(parseFloat!=i),{parseFloat:i})},2784:(t,e,n)=>{var r=n(7044),i=n(343);r(r.G+r.F*(parseInt!=i),{parseInt:i})},7843:(t,e,n)=>{"use strict";var r,i,o,a,u=n(2725),s=n(7571),c=n(994),f=n(4939),l=n(7044),h=n(1255),d=n(1464),p=n(6903),v=n(9822),g=n(8713),y=n(7225).set,m=n(7485)(),b=n(449),_=n(9696),x=n(2541),w=n(909),E="Promise",S=s.TypeError,A=s.process,T=A&&A.versions,I=T&&T.v8||"",C=s.Promise,D="process"==f(A),N=function(){},k=i=b.f,R=!!function(){try{var t=C.resolve(1),e=(t.constructor={})[n(341)("species")]=function(t){t(N,N)};return(D||"function"==typeof PromiseRejectionEvent)&&t.then(N)instanceof e&&0!==I.indexOf("6.6")&&-1===x.indexOf("Chrome/66")}catch(t){}}(),O=function(t){var e;return!(!h(t)||"function"!=typeof(e=t.then))&&e},M=function(t,e){if(!t._n){t._n=!0;var n=t._c;m((function(){for(var r=t._v,i=1==t._s,o=0,a=function(e){var n,o,a,u=i?e.ok:e.fail,s=e.resolve,c=e.reject,f=e.domain;try{u?(i||(2==t._h&&L(t),t._h=1),!0===u?n=r:(f&&f.enter(),n=u(r),f&&(f.exit(),a=!0)),n===e.promise?c(S("Promise-chain cycle")):(o=O(n))?o.call(n,s,c):s(n)):c(r)}catch(t){f&&!a&&f.exit(),c(t)}};n.length>o;)a(n[o++]);t._c=[],t._n=!1,e&&!t._h&&P(t)}))}},P=function(t){y.call(s,(function(){var e,n,r,i=t._v,o=G(t);if(o&&(e=_((function(){D?A.emit("unhandledRejection",i,t):(n=s.onunhandledrejection)?n({promise:t,reason:i}):(r=s.console)&&r.error&&r.error("Unhandled promise rejection",i)})),t._h=D||G(t)?2:1),t._a=void 0,o&&e.e)throw e.v}))},G=function(t){return 1!==t._h&&0===(t._a||t._c).length},L=function(t){y.call(s,(function(){var e;D?A.emit("rejectionHandled",t):(e=s.onrejectionhandled)&&e({promise:t,reason:t._v})}))},U=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),M(e,!0))},F=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw S("Promise can't be resolved itself");(e=O(t))?m((function(){var r={_w:n,_d:!1};try{e.call(t,c(F,r,1),c(U,r,1))}catch(t){U.call(r,t)}})):(n._v=t,n._s=1,M(n,!1))}catch(t){U.call({_w:n,_d:!1},t)}}};R||(C=function(t){p(this,C,E,"_h"),d(t),r.call(this);try{t(c(F,this,1),c(U,this,1))}catch(t){U.call(this,t)}},(r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(8565)(C.prototype,{then:function(t,e){var n=k(g(this,C));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=D?A.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&M(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new r;this.promise=t,this.resolve=c(F,t,1),this.reject=c(U,t,1)},b.f=k=function(t){return t===C||t===a?new o(t):i(t)}),l(l.G+l.W+l.F*!R,{Promise:C}),n(5837)(C,E),n(4412)(E),a=n(2845).Promise,l(l.S+l.F*!R,E,{reject:function(t){var e=k(this);return(0,e.reject)(t),e.promise}}),l(l.S+l.F*(u||!R),E,{resolve:function(t){return w(u&&this===a?C:this,t)}}),l(l.S+l.F*!(R&&n(2803)((function(t){C.all(t).catch(N)}))),E,{all:function(t){var e=this,n=k(e),r=n.resolve,i=n.reject,o=_((function(){var n=[],o=0,a=1;v(t,!1,(function(t){var u=o++,s=!1;n.push(void 0),a++,e.resolve(t).then((function(t){s||(s=!0,n[u]=t,--a||r(n))}),i)})),--a||r(n)}));return o.e&&i(o.v),n.promise},race:function(t){var e=this,n=k(e),r=n.reject,i=_((function(){v(t,!1,(function(t){e.resolve(t).then(n.resolve,r)}))}));return i.e&&r(i.v),n.promise}})},8275:(t,e,n)=>{var r=n(7044),i=n(1464),o=n(486),a=(n(7571).Reflect||{}).apply,u=Function.apply;r(r.S+r.F*!n(5338)((function(){a((function(){}))})),"Reflect",{apply:function(t,e,n){var r=i(t),s=o(n);return a?a(r,e,s):u.call(r,e,s)}})},2552:(t,e,n)=>{var r=n(7044),i=n(9055),o=n(1464),a=n(486),u=n(1255),s=n(5338),c=n(8366),f=(n(7571).Reflect||{}).construct,l=s((function(){function t(){}return!(f((function(){}),[],t)instanceof t)})),h=!s((function(){f((function(){}))}));r(r.S+r.F*(l||h),"Reflect",{construct:function(t,e){o(t),a(e);var n=arguments.length<3?t:o(arguments[2]);if(h&&!l)return f(t,e,n);if(t==n){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var r=[null];return r.push.apply(r,e),new(c.apply(t,r))}var s=n.prototype,d=i(u(s)?s:Object.prototype),p=Function.apply.call(t,d,e);return u(p)?p:d}})},3077:(t,e,n)=>{var r=n(3886),i=n(7044),o=n(486),a=n(4467);i(i.S+i.F*n(5338)((function(){Reflect.defineProperty(r.f({},1,{value:1}),1,{value:2})})),"Reflect",{defineProperty:function(t,e,n){o(t),e=a(e,!0),o(n);try{return r.f(t,e,n),!0}catch(t){return!1}}})},1031:(t,e,n)=>{var r=n(7044),i=n(5385).f,o=n(486);r(r.S,"Reflect",{deleteProperty:function(t,e){var n=i(o(t),e);return!(n&&!n.configurable)&&delete t[e]}})},8916:(t,e,n)=>{"use strict";var r=n(7044),i=n(486),o=function(t){this._t=i(t),this._i=0;var e,n=this._k=[];for(e in t)n.push(e)};n(4529)(o,"Object",(function(){var t,e=this,n=e._k;do{if(e._i>=n.length)return{value:void 0,done:!0}}while(!((t=n[e._i++])in e._t));return{value:t,done:!1}})),r(r.S,"Reflect",{enumerate:function(t){return new o(t)}})},8531:(t,e,n)=>{var r=n(5385),i=n(7044),o=n(486);i(i.S,"Reflect",{getOwnPropertyDescriptor:function(t,e){return r.f(o(t),e)}})},7323:(t,e,n)=>{var r=n(7044),i=n(9881),o=n(486);r(r.S,"Reflect",{getPrototypeOf:function(t){return i(o(t))}})},8978:(t,e,n)=>{var r=n(5385),i=n(9881),o=n(7384),a=n(7044),u=n(1255),s=n(486);a(a.S,"Reflect",{get:function t(e,n){var a,c,f=arguments.length<3?e:arguments[2];return s(e)===f?e[n]:(a=r.f(e,n))?o(a,"value")?a.value:void 0!==a.get?a.get.call(f):void 0:u(c=i(e))?t(c,n,f):void 0}})},3704:(t,e,n)=>{var r=n(7044);r(r.S,"Reflect",{has:function(t,e){return e in t}})},3153:(t,e,n)=>{var r=n(7044),i=n(486),o=Object.isExtensible;r(r.S,"Reflect",{isExtensible:function(t){return i(t),!o||o(t)}})},8812:(t,e,n)=>{var r=n(7044);r(r.S,"Reflect",{ownKeys:n(8125)})},2636:(t,e,n)=>{var r=n(7044),i=n(486),o=Object.preventExtensions;r(r.S,"Reflect",{preventExtensions:function(t){i(t);try{return o&&o(t),!0}catch(t){return!1}}})},377:(t,e,n)=>{var r=n(7044),i=n(473);i&&r(r.S,"Reflect",{setPrototypeOf:function(t,e){i.check(t,e);try{return i.set(t,e),!0}catch(t){return!1}}})},1602:(t,e,n)=>{var r=n(3886),i=n(5385),o=n(9881),a=n(7384),u=n(7044),s=n(8328),c=n(486),f=n(1255);u(u.S,"Reflect",{set:function t(e,n,u){var l,h,d=arguments.length<4?e:arguments[3],p=i.f(c(e),n);if(!p){if(f(h=o(e)))return t(h,n,u,d);p=s(0)}if(a(p,"value")){if(!1===p.writable||!f(d))return!1;if(l=i.f(d,n)){if(l.get||l.set||!1===l.writable)return!1;l.value=u,r.f(d,n,l)}else r.f(d,n,s(0,u));return!0}return void 0!==p.set&&(p.set.call(d,u),!0)}})},6668:(t,e,n)=>{var r=n(7571),i=n(116),o=n(3886).f,a=n(6907).f,u=n(8990),s=n(3649),c=r.RegExp,f=c,l=c.prototype,h=/a/g,d=/a/g,p=new c(h)!==h;if(n(1216)&&(!p||n(5338)((function(){return d[n(341)("match")]=!1,c(h)!=h||c(d)==d||"/a/i"!=c(h,"i")})))){c=function(t,e){var n=this instanceof c,r=u(t),o=void 0===e;return!n&&r&&t.constructor===c&&o?t:i(p?new f(r&&!o?t.source:t,e):f((r=t instanceof c)?t.source:t,r&&o?s.call(t):e),n?this:l,c)};for(var v=function(t){t in c||o(c,t,{configurable:!0,get:function(){return f[t]},set:function(e){f[t]=e}})},g=a(f),y=0;g.length>y;)v(g[y++]);l.constructor=c,c.prototype=l,n(6476)(r,"RegExp",c)}n(4412)("RegExp")},7139:(t,e,n)=>{"use strict";var r=n(9020);n(7044)({target:"RegExp",proto:!0,forced:r!==/./.exec},{exec:r})},8686:(t,e,n)=>{n(1216)&&"g"!=/./g.flags&&n(3886).f(RegExp.prototype,"flags",{configurable:!0,get:n(3649)})},5480:(t,e,n)=>{"use strict";var r=n(486),i=n(8087),o=n(178),a=n(2968);n(6719)("match",1,(function(t,e,n,u){return[function(n){var r=t(this),i=null==n?void 0:n[e];return void 0!==i?i.call(n,r):new RegExp(n)[e](String(r))},function(t){var e=u(n,t,this);if(e.done)return e.value;var s=r(t),c=String(this);if(!s.global)return a(s,c);var f=s.unicode;s.lastIndex=0;for(var l,h=[],d=0;null!==(l=a(s,c));){var p=String(l[0]);h[d]=p,""===p&&(s.lastIndex=o(c,i(s.lastIndex),f)),d++}return 0===d?null:h}]}))},9121:(t,e,n)=>{"use strict";var r=n(486),i=n(7583),o=n(8087),a=n(5845),u=n(178),s=n(2968),c=Math.max,f=Math.min,l=Math.floor,h=/\$([$&`']|\d\d?|<[^>]*>)/g,d=/\$([$&`']|\d\d?)/g;n(6719)("replace",2,(function(t,e,n,p){return[function(r,i){var o=t(this),a=null==r?void 0:r[e];return void 0!==a?a.call(r,o,i):n.call(String(o),r,i)},function(t,e){var i=p(n,t,this,e);if(i.done)return i.value;var l=r(t),h=String(this),d="function"==typeof e;d||(e=String(e));var g=l.global;if(g){var y=l.unicode;l.lastIndex=0}for(var m=[];;){var b=s(l,h);if(null===b)break;if(m.push(b),!g)break;""===String(b[0])&&(l.lastIndex=u(h,o(l.lastIndex),y))}for(var _,x="",w=0,E=0;E<m.length;E++){b=m[E];for(var S=String(b[0]),A=c(f(a(b.index),h.length),0),T=[],I=1;I<b.length;I++)T.push(void 0===(_=b[I])?_:String(_));var C=b.groups;if(d){var D=[S].concat(T,A,h);void 0!==C&&D.push(C);var N=String(e.apply(void 0,D))}else N=v(S,h,A,T,C,e);A>=w&&(x+=h.slice(w,A)+N,w=A+S.length)}return x+h.slice(w)}];function v(t,e,r,o,a,u){var s=r+t.length,c=o.length,f=d;return void 0!==a&&(a=i(a),f=h),n.call(u,f,(function(n,i){var u;switch(i.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,r);case"'":return e.slice(s);case"<":u=a[i.slice(1,-1)];break;default:var f=+i;if(0===f)return n;if(f>c){var h=l(f/10);return 0===h?n:h<=c?void 0===o[h-1]?i.charAt(1):o[h-1]+i.charAt(1):n}u=o[f-1]}return void 0===u?"":u}))}}))},914:(t,e,n)=>{"use strict";var r=n(486),i=n(6962),o=n(2968);n(6719)("search",1,(function(t,e,n,a){return[function(n){var r=t(this),i=null==n?void 0:n[e];return void 0!==i?i.call(n,r):new RegExp(n)[e](String(r))},function(t){var e=a(n,t,this);if(e.done)return e.value;var u=r(t),s=String(this),c=u.lastIndex;i(c,0)||(u.lastIndex=0);var f=o(u,s);return i(u.lastIndex,c)||(u.lastIndex=c),null===f?-1:f.index}]}))},7742:(t,e,n)=>{"use strict";var r=n(8990),i=n(486),o=n(8713),a=n(178),u=n(8087),s=n(2968),c=n(9020),f=n(5338),l=Math.min,h=[].push,d=4294967295,p=!f((function(){RegExp(d,"y")}));n(6719)("split",2,(function(t,e,n,f){var v;return v="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,e){var i=String(this);if(void 0===t&&0===e)return[];if(!r(t))return n.call(i,t,e);for(var o,a,u,s=[],f=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),l=0,p=void 0===e?d:e>>>0,v=new RegExp(t.source,f+"g");(o=c.call(v,i))&&!((a=v.lastIndex)>l&&(s.push(i.slice(l,o.index)),o.length>1&&o.index<i.length&&h.apply(s,o.slice(1)),u=o[0].length,l=a,s.length>=p));)v.lastIndex===o.index&&v.lastIndex++;return l===i.length?!u&&v.test("")||s.push(""):s.push(i.slice(l)),s.length>p?s.slice(0,p):s}:"0".split(void 0,0).length?function(t,e){return void 0===t&&0===e?[]:n.call(this,t,e)}:n,[function(n,r){var i=t(this),o=null==n?void 0:n[e];return void 0!==o?o.call(n,i,r):v.call(String(i),n,r)},function(t,e){var r=f(v,t,this,e,v!==n);if(r.done)return r.value;var c=i(t),h=String(this),g=o(c,RegExp),y=c.unicode,m=(c.ignoreCase?"i":"")+(c.multiline?"m":"")+(c.unicode?"u":"")+(p?"y":"g"),b=new g(p?c:"^(?:"+c.source+")",m),_=void 0===e?d:e>>>0;if(0===_)return[];if(0===h.length)return null===s(b,h)?[h]:[];for(var x=0,w=0,E=[];w<h.length;){b.lastIndex=p?w:0;var S,A=s(b,p?h:h.slice(w));if(null===A||(S=l(u(b.lastIndex+(p?0:w)),h.length))===x)w=a(h,w,y);else{if(E.push(h.slice(x,w)),E.length===_)return E;for(var T=1;T<=A.length-1;T++)if(E.push(A[T]),E.length===_)return E;w=x=S}}return E.push(h.slice(x)),E}]}))},6408:(t,e,n)=>{"use strict";n(8686);var r=n(486),i=n(3649),o=n(1216),a="toString",u=/./.toString,s=function(t){n(6476)(RegExp.prototype,a,t,!0)};n(5338)((function(){return"/a/b"!=u.call({source:"a",flags:"b"})}))?s((function(){var t=r(this);return"/".concat(t.source,"/","flags"in t?t.flags:!o&&t instanceof RegExp?i.call(t):void 0)})):u.name!=a&&s((function(){return u.call(this)}))},429:(t,e,n)=>{"use strict";var r=n(3050),i=n(4664);t.exports=n(859)("Set",(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(t){return r.def(i(this,"Set"),t=0===t?0:t,t)}},r)},3157:(t,e,n)=>{"use strict";n(5264)("anchor",(function(t){return function(e){return t(this,"a","name",e)}}))},9791:(t,e,n)=>{"use strict";n(5264)("big",(function(t){return function(){return t(this,"big","","")}}))},2296:(t,e,n)=>{"use strict";n(5264)("blink",(function(t){return function(){return t(this,"blink","","")}}))},4555:(t,e,n)=>{"use strict";n(5264)("bold",(function(t){return function(){return t(this,"b","","")}}))},8316:(t,e,n)=>{"use strict";var r=n(7044),i=n(8016)(!1);r(r.P,"String",{codePointAt:function(t){return i(this,t)}})},7937:(t,e,n)=>{"use strict";var r=n(7044),i=n(8087),o=n(5692),a="endsWith",u="".endsWith;r(r.P+r.F*n(2910)(a),"String",{endsWith:function(t){var e=o(this,t,a),n=arguments.length>1?arguments[1]:void 0,r=i(e.length),s=void 0===n?r:Math.min(i(n),r),c=String(t);return u?u.call(e,c,s):e.slice(s-c.length,s)===c}})},6505:(t,e,n)=>{"use strict";n(5264)("fixed",(function(t){return function(){return t(this,"tt","","")}}))},4722:(t,e,n)=>{"use strict";n(5264)("fontcolor",(function(t){return function(e){return t(this,"font","color",e)}}))},9713:(t,e,n)=>{"use strict";n(5264)("fontsize",(function(t){return function(e){return t(this,"font","size",e)}}))},1028:(t,e,n)=>{var r=n(7044),i=n(9260),o=String.fromCharCode,a=String.fromCodePoint;r(r.S+r.F*(!!a&&1!=a.length),"String",{fromCodePoint:function(t){for(var e,n=[],r=arguments.length,a=0;r>a;){if(e=+arguments[a++],i(e,1114111)!==e)throw RangeError(e+" is not a valid code point");n.push(e<65536?o(e):o(55296+((e-=65536)>>10),e%1024+56320))}return n.join("")}})},637:(t,e,n)=>{"use strict";var r=n(7044),i=n(5692),o="includes";r(r.P+r.F*n(2910)(o),"String",{includes:function(t){return!!~i(this,t,o).indexOf(t,arguments.length>1?arguments[1]:void 0)}})},7392:(t,e,n)=>{"use strict";n(5264)("italics",(function(t){return function(){return t(this,"i","","")}}))},7938:(t,e,n)=>{"use strict";var r=n(8016)(!0);n(966)(String,"String",(function(t){this._t=String(t),this._i=0}),(function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})}))},4687:(t,e,n)=>{"use strict";n(5264)("link",(function(t){return function(e){return t(this,"a","href",e)}}))},6818:(t,e,n)=>{var r=n(7044),i=n(8182),o=n(8087);r(r.S,"String",{raw:function(t){for(var e=i(t.raw),n=o(e.length),r=arguments.length,a=[],u=0;n>u;)a.push(String(e[u++])),u<r&&a.push(String(arguments[u]));return a.join("")}})},8219:(t,e,n)=>{var r=n(7044);r(r.P,"String",{repeat:n(5458)})},3684:(t,e,n)=>{"use strict";n(5264)("small",(function(t){return function(){return t(this,"small","","")}}))},9029:(t,e,n)=>{"use strict";var r=n(7044),i=n(8087),o=n(5692),a="startsWith",u="".startsWith;r(r.P+r.F*n(2910)(a),"String",{startsWith:function(t){var e=o(this,t,a),n=i(Math.min(arguments.length>1?arguments[1]:void 0,e.length)),r=String(t);return u?u.call(e,r,n):e.slice(n,n+r.length)===r}})},3339:(t,e,n)=>{"use strict";n(5264)("strike",(function(t){return function(){return t(this,"strike","","")}}))},4148:(t,e,n)=>{"use strict";n(5264)("sub",(function(t){return function(){return t(this,"sub","","")}}))},7754:(t,e,n)=>{"use strict";n(5264)("sup",(function(t){return function(){return t(this,"sup","","")}}))},5557:(t,e,n)=>{"use strict";n(4961)("trim",(function(t){return function(){return t(this,3)}}))},2825:(t,e,n)=>{"use strict";var r=n(7571),i=n(7384),o=n(1216),a=n(7044),u=n(6476),s=n(4278).KEY,c=n(5338),f=n(5570),l=n(5837),h=n(4316),d=n(341),p=n(7686),v=n(6262),g=n(6397),y=n(7183),m=n(486),b=n(1255),_=n(7583),x=n(8182),w=n(4467),E=n(8328),S=n(9055),A=n(3473),T=n(5385),I=n(3844),C=n(3886),D=n(9804),N=T.f,k=C.f,R=A.f,O=r.Symbol,M=r.JSON,P=M&&M.stringify,G=d("_hidden"),L=d("toPrimitive"),U={}.propertyIsEnumerable,F=f("symbol-registry"),B=f("symbols"),z=f("op-symbols"),j=Object.prototype,W="function"==typeof O&&!!I.f,V=r.QObject,X=!V||!V.prototype||!V.prototype.findChild,H=o&&c((function(){return 7!=S(k({},"a",{get:function(){return k(this,"a",{value:7}).a}})).a}))?function(t,e,n){var r=N(j,e);r&&delete j[e],k(t,e,n),r&&t!==j&&k(j,e,r)}:k,q=function(t){var e=B[t]=S(O.prototype);return e._k=t,e},Y=W&&"symbol"==typeof O.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof O},K=function(t,e,n){return t===j&&K(z,e,n),m(t),e=w(e,!0),m(n),i(B,e)?(n.enumerable?(i(t,G)&&t[G][e]&&(t[G][e]=!1),n=S(n,{enumerable:E(0,!1)})):(i(t,G)||k(t,G,E(1,{})),t[G][e]=!0),H(t,e,n)):k(t,e,n)},Z=function(t,e){m(t);for(var n,r=g(e=x(e)),i=0,o=r.length;o>i;)K(t,n=r[i++],e[n]);return t},$=function(t){var e=U.call(this,t=w(t,!0));return!(this===j&&i(B,t)&&!i(z,t))&&(!(e||!i(this,t)||!i(B,t)||i(this,G)&&this[G][t])||e)},J=function(t,e){if(t=x(t),e=w(e,!0),t!==j||!i(B,e)||i(z,e)){var n=N(t,e);return!n||!i(B,e)||i(t,G)&&t[G][e]||(n.enumerable=!0),n}},Q=function(t){for(var e,n=R(x(t)),r=[],o=0;n.length>o;)i(B,e=n[o++])||e==G||e==s||r.push(e);return r},tt=function(t){for(var e,n=t===j,r=R(n?z:x(t)),o=[],a=0;r.length>a;)!i(B,e=r[a++])||n&&!i(j,e)||o.push(B[e]);return o};W||(O=function(){if(this instanceof O)throw TypeError("Symbol is not a constructor!");var t=h(arguments.length>0?arguments[0]:void 0),e=function(n){this===j&&e.call(z,n),i(this,G)&&i(this[G],t)&&(this[G][t]=!1),H(this,t,E(1,n))};return o&&X&&H(j,t,{configurable:!0,set:e}),q(t)},u(O.prototype,"toString",(function(){return this._k})),T.f=J,C.f=K,n(6907).f=A.f=Q,n(4179).f=$,I.f=tt,o&&!n(2725)&&u(j,"propertyIsEnumerable",$,!0),p.f=function(t){return q(d(t))}),a(a.G+a.W+a.F*!W,{Symbol:O});for(var et="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),nt=0;et.length>nt;)d(et[nt++]);for(var rt=D(d.store),it=0;rt.length>it;)v(rt[it++]);a(a.S+a.F*!W,"Symbol",{for:function(t){return i(F,t+="")?F[t]:F[t]=O(t)},keyFor:function(t){if(!Y(t))throw TypeError(t+" is not a symbol!");for(var e in F)if(F[e]===t)return e},useSetter:function(){X=!0},useSimple:function(){X=!1}}),a(a.S+a.F*!W,"Object",{create:function(t,e){return void 0===e?S(t):Z(S(t),e)},defineProperty:K,defineProperties:Z,getOwnPropertyDescriptor:J,getOwnPropertyNames:Q,getOwnPropertySymbols:tt});var ot=c((function(){I.f(1)}));a(a.S+a.F*ot,"Object",{getOwnPropertySymbols:function(t){return I.f(_(t))}}),M&&a(a.S+a.F*(!W||c((function(){var t=O();return"[null]"!=P([t])||"{}"!=P({a:t})||"{}"!=P(Object(t))}))),"JSON",{stringify:function(t){for(var e,n,r=[t],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=e=r[1],(b(e)||void 0!==t)&&!Y(t))return y(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!Y(e))return e}),r[1]=e,P.apply(M,r)}}),O.prototype[L]||n(913)(O.prototype,L,O.prototype.valueOf),l(O,"Symbol"),l(Math,"Math",!0),l(r.JSON,"JSON",!0)},6349:(t,e,n)=>{"use strict";var r=n(7044),i=n(604),o=n(1541),a=n(486),u=n(9260),s=n(8087),c=n(1255),f=n(7571).ArrayBuffer,l=n(8713),h=o.ArrayBuffer,d=o.DataView,p=i.ABV&&f.isView,v=h.prototype.slice,g=i.VIEW,y="ArrayBuffer";r(r.G+r.W+r.F*(f!==h),{ArrayBuffer:h}),r(r.S+r.F*!i.CONSTR,y,{isView:function(t){return p&&p(t)||c(t)&&g in t}}),r(r.P+r.U+r.F*n(5338)((function(){return!new h(2).slice(1,void 0).byteLength})),y,{slice:function(t,e){if(void 0!==v&&void 0===e)return v.call(a(this),t);for(var n=a(this).byteLength,r=u(t,n),i=u(void 0===e?n:e,n),o=new(l(this,h))(s(i-r)),c=new d(this),f=new d(o),p=0;r<i;)f.setUint8(p++,c.getUint8(r++));return o}}),n(4412)(y)},3742:(t,e,n)=>{var r=n(7044);r(r.G+r.W+r.F*!n(604).ABV,{DataView:n(1541).DataView})},3421:(t,e,n)=>{n(1063)("Float32",4,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},6144:(t,e,n)=>{n(1063)("Float64",8,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},9363:(t,e,n)=>{n(1063)("Int16",2,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},8632:(t,e,n)=>{n(1063)("Int32",4,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},9604:(t,e,n)=>{n(1063)("Int8",1,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},3871:(t,e,n)=>{n(1063)("Uint16",2,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},1838:(t,e,n)=>{n(1063)("Uint32",4,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},2592:(t,e,n)=>{n(1063)("Uint8",1,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},9290:(t,e,n)=>{n(1063)("Uint8",1,(function(t){return function(e,n,r){return t(this,e,n,r)}}),!0)},2214:(t,e,n)=>{"use strict";var r,i=n(7571),o=n(7622)(0),a=n(6476),u=n(4278),s=n(4643),c=n(1990),f=n(1255),l=n(4664),h=n(4664),d=!i.ActiveXObject&&"ActiveXObject"in i,p="WeakMap",v=u.getWeak,g=Object.isExtensible,y=c.ufstore,m=function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},b={get:function(t){if(f(t)){var e=v(t);return!0===e?y(l(this,p)).get(t):e?e[this._i]:void 0}},set:function(t,e){return c.def(l(this,p),t,e)}},_=t.exports=n(859)(p,m,b,c,!0,!0);h&&d&&(s((r=c.getConstructor(m,p)).prototype,b),u.NEED=!0,o(["delete","has","get","set"],(function(t){var e=_.prototype,n=e[t];a(e,t,(function(e,i){if(f(e)&&!g(e)){this._f||(this._f=new r);var o=this._f[t](e,i);return"set"==t?this:o}return n.call(this,e,i)}))})))},498:(t,e,n)=>{"use strict";var r=n(1990),i=n(4664),o="WeakSet";n(859)(o,(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(t){return r.def(i(this,o),t,!0)}},r,!1,!0)},7744:(t,e,n)=>{"use strict";var r=n(7044),i=n(6806),o=n(7583),a=n(8087),u=n(1464),s=n(6699);r(r.P,"Array",{flatMap:function(t){var e,n,r=o(this);return u(t),e=a(r.length),n=s(r,0),i(n,r,r,e,0,1,t,arguments[1]),n}}),n(4691)("flatMap")},5448:(t,e,n)=>{"use strict";var r=n(7044),i=n(4538)(!0);r(r.P,"Array",{includes:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),n(4691)("includes")},8938:(t,e,n)=>{var r=n(7044),i=n(6460)(!0);r(r.S,"Object",{entries:function(t){return i(t)}})},7819:(t,e,n)=>{var r=n(7044),i=n(8125),o=n(8182),a=n(5385),u=n(1395);r(r.S,"Object",{getOwnPropertyDescriptors:function(t){for(var e,n,r=o(t),s=a.f,c=i(r),f={},l=0;c.length>l;)void 0!==(n=s(r,e=c[l++]))&&u(f,e,n);return f}})},6572:(t,e,n)=>{var r=n(7044),i=n(6460)(!1);r(r.S,"Object",{values:function(t){return i(t)}})},8228:(t,e,n)=>{"use strict";var r=n(7044),i=n(2845),o=n(7571),a=n(8713),u=n(909);r(r.P+r.R,"Promise",{finally:function(t){var e=a(this,i.Promise||o.Promise),n="function"==typeof t;return this.then(n?function(n){return u(e,t()).then((function(){return n}))}:t,n?function(n){return u(e,t()).then((function(){throw n}))}:t)}})},3336:(t,e,n)=>{"use strict";var r=n(7044),i=n(8261),o=n(2541),a=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(o);r(r.P+r.F*a,"String",{padEnd:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0,!1)}})},3718:(t,e,n)=>{"use strict";var r=n(7044),i=n(8261),o=n(2541),a=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(o);r(r.P+r.F*a,"String",{padStart:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0,!0)}})},7831:(t,e,n)=>{"use strict";n(4961)("trimLeft",(function(t){return function(){return t(this,1)}}),"trimStart")},6642:(t,e,n)=>{"use strict";n(4961)("trimRight",(function(t){return function(){return t(this,2)}}),"trimEnd")},9956:(t,e,n)=>{n(6262)("asyncIterator")},4367:(t,e,n)=>{for(var r=n(163),i=n(9804),o=n(6476),a=n(7571),u=n(913),s=n(9740),c=n(341),f=c("iterator"),l=c("toStringTag"),h=s.Array,d={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},p=i(d),v=0;v<p.length;v++){var g,y=p[v],m=d[y],b=a[y],_=b&&b.prototype;if(_&&(_[f]||u(_,f,h),_[l]||u(_,l,y),s[y]=h,m))for(g in r)_[g]||o(_,g,r[g],!0)}},4433:(t,e,n)=>{var r=n(7044),i=n(7225);r(r.G+r.B,{setImmediate:i.set,clearImmediate:i.clear})},110:(t,e,n)=>{var r=n(7571),i=n(7044),o=n(2541),a=[].slice,u=/MSIE .\./.test(o),s=function(t){return function(e,n){var r=arguments.length>2,i=!!r&&a.call(arguments,2);return t(r?function(){("function"==typeof e?e:Function(e)).apply(this,i)}:e,n)}};i(i.G+i.B+i.F*u,{setTimeout:s(r.setTimeout),setInterval:s(r.setInterval)})},4962:(t,e,n)=>{n(110),n(4433),n(4367),t.exports=n(2845)},5229:t=>{t.exports=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}},8356:t=>{t.exports=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}},5375:t=>{t.exports=function(t){var e=new Float32Array(2);return e[0]=t[0],e[1]=t[1],e}},3422:t=>{t.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t}},5128:t=>{t.exports=function(){var t=new Float32Array(2);return t[0]=0,t[1]=0,t}},134:t=>{t.exports=function(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t}},7223:(t,e,n)=>{t.exports=n(2274)},2274:t=>{t.exports=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)}},6770:(t,e,n)=>{t.exports=n(236)},236:t=>{t.exports=function(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}},6064:t=>{t.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]}},2157:t=>{t.exports=1e-6},6922:(t,e,n)=>{t.exports=function(t,e){var n=t[0],i=t[1],o=e[0],a=e[1];return Math.abs(n-o)<=r*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-a)<=r*Math.max(1,Math.abs(i),Math.abs(a))};var r=n(2157)},6066:t=>{t.exports=function(t,e){return t[0]===e[0]&&t[1]===e[1]}},4860:t=>{t.exports=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}},7395:(t,e,n)=>{t.exports=function(t,e,n,i,o,a){var u,s;for(e||(e=2),n||(n=0),s=i?Math.min(i*e+n,t.length):t.length,u=n;u<s;u+=e)r[0]=t[u],r[1]=t[u+1],o(r,r,a),t[u]=r[0],t[u+1]=r[1];return t};var r=n(5128)()},4697:t=>{t.exports=function(t,e){var n=new Float32Array(2);return n[0]=t,n[1]=e,n}},7801:(t,e,n)=>{t.exports={EPSILON:n(2157),create:n(5128),clone:n(5375),fromValues:n(4697),copy:n(3422),set:n(6765),equals:n(6922),exactEquals:n(6066),add:n(5229),subtract:n(4186),sub:n(5302),multiply:n(3848),mul:n(1665),divide:n(236),div:n(6770),inverse:n(1873),min:n(6780),max:n(9564),rotate:n(8615),floor:n(4860),ceil:n(8356),round:n(7313),scale:n(6526),scaleAndAdd:n(7781),distance:n(2274),dist:n(7223),squaredDistance:n(6534),sqrDist:n(4969),length:n(360),len:n(2256),squaredLength:n(5476),sqrLen:n(508),negate:n(388),normalize:n(5927),dot:n(6064),cross:n(134),lerp:n(1099),random:n(679),transformMat2:n(367),transformMat2d:n(655),transformMat3:n(2730),transformMat4:n(4020),forEach:n(7395),limit:n(8709)}},1873:t=>{t.exports=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}},2256:(t,e,n)=>{t.exports=n(360)},360:t=>{t.exports=function(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)}},1099:t=>{t.exports=function(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t}},8709:t=>{t.exports=function(t,e,n){var r=e[0]*e[0]+e[1]*e[1];if(r>n*n){var i=Math.sqrt(r);t[0]=e[0]/i*n,t[1]=e[1]/i*n}else t[0]=e[0],t[1]=e[1];return t}},9564:t=>{t.exports=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}},6780:t=>{t.exports=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t}},1665:(t,e,n)=>{t.exports=n(3848)},3848:t=>{t.exports=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}},388:t=>{t.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t}},5927:t=>{t.exports=function(t,e){var n=e[0],r=e[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i),t}},679:t=>{t.exports=function(t,e){e=e||1;var n=2*Math.random()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t}},8615:t=>{t.exports=function(t,e,n){var r=Math.cos(n),i=Math.sin(n),o=e[0],a=e[1];return t[0]=o*r-a*i,t[1]=o*i+a*r,t}},7313:t=>{t.exports=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}},6526:t=>{t.exports=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}},7781:t=>{t.exports=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t}},6765:t=>{t.exports=function(t,e,n){return t[0]=e,t[1]=n,t}},4969:(t,e,n)=>{t.exports=n(6534)},508:(t,e,n)=>{t.exports=n(5476)},6534:t=>{t.exports=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}},5476:t=>{t.exports=function(t){var e=t[0],n=t[1];return e*e+n*n}},5302:(t,e,n)=>{t.exports=n(4186)},4186:t=>{t.exports=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}},367:t=>{t.exports=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t}},655:t=>{t.exports=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t}},2730:t=>{t.exports=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t}},4020:t=>{t.exports=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t}},3039:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=Symbol.for("INJECTION");function r(t,e,r,i){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:function(){return i&&!Reflect.hasMetadata(n,this,e)&&Reflect.defineMetadata(n,r(),this,e),Reflect.hasMetadata(n,this,e)?Reflect.getMetadata(n,this,e):r()},set:function(t){Reflect.defineMetadata(n,t,this,e)}})}e.makePropertyInjectDecorator=function(t,e){return function(n){return function(i,o){r(i,o,(function(){return t.get(n)}),e)}}},e.makePropertyInjectNamedDecorator=function(t,e){return function(n,i){return function(o,a){r(o,a,(function(){return t.getNamed(n,i)}),e)}}},e.makePropertyInjectTaggedDecorator=function(t,e){return function(n,i,o){return function(a,u){r(a,u,(function(){return t.getTagged(n,i,o)}),e)}}},e.makePropertyMultiInjectDecorator=function(t,e){return function(n){return function(i,o){r(i,o,(function(){return t.getAll(n)}),e)}}}},1922:(t,e,n)=>{"use strict";var r=n(3039);e.Z=function(t,e){return void 0===e&&(e=!0),{lazyInject:r.makePropertyInjectDecorator(t,e),lazyInjectNamed:r.makePropertyInjectNamedDecorator(t,e),lazyInjectTagged:r.makePropertyInjectTaggedDecorator(t,e),lazyMultiInject:r.makePropertyMultiInjectDecorator(t,e)}}},626:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tagProperty=e.tagParameter=e.decorate=void 0;var r=n(6078),i=n(295);function o(t,e,n,i,o){var a={},u="number"==typeof o,s=void 0!==o&&u?o.toString():n;if(u&&void 0!==n)throw new Error(r.INVALID_DECORATOR_OPERATION);Reflect.hasOwnMetadata(t,e)&&(a=Reflect.getMetadata(t,e));var c=a[s];if(Array.isArray(c))for(var f=0,l=c;f<l.length;f++){var h=l[f];if(h.key===i.key)throw new Error(r.DUPLICATED_METADATA+" "+h.key.toString())}else c=[];c.push(i),a[s]=c,Reflect.defineMetadata(t,a,e)}function a(t,e){Reflect.decorate(t,e)}function u(t,e){return function(n,r){e(n,r,t)}}e.tagParameter=function(t,e,n,r){o(i.TAGGED,t,e,r,n)},e.tagProperty=function(t,e,n){o(i.TAGGED_PROP,t.constructor,e,n)},e.decorate=function(t,e,n){"number"==typeof n?a([u(n,t)],e):"string"==typeof n?Reflect.decorate([t],e,n):a([t],e)}},6213:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.inject=e.LazyServiceIdentifer=void 0;var r=n(6078),i=n(295),o=n(5092),a=n(626),u=function(){function t(t){this._cb=t}return t.prototype.unwrap=function(){return this._cb()},t}();e.LazyServiceIdentifer=u,e.inject=function(t){return function(e,n,u){if(void 0===t)throw new Error(r.UNDEFINED_INJECT_ANNOTATION(e.name));var s=new o.Metadata(i.INJECT_TAG,t);"number"==typeof u?a.tagParameter(e,n,u,s):a.tagProperty(e,n,s)}}},1773:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.injectable=void 0;var r=n(6078),i=n(295);e.injectable=function(){return function(t){if(Reflect.hasOwnMetadata(i.PARAM_TYPES,t))throw new Error(r.DUPLICATED_INJECTABLE_DECORATOR);var e=Reflect.getMetadata(i.DESIGN_PARAM_TYPES,t)||[];return Reflect.defineMetadata(i.PARAM_TYPES,e,t),t}}},1528:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.multiInject=void 0;var r=n(295),i=n(5092),o=n(626);e.multiInject=function(t){return function(e,n,a){var u=new i.Metadata(r.MULTI_INJECT_TAG,t);"number"==typeof a?o.tagParameter(e,n,a,u):o.tagProperty(e,n,u)}}},9817:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.named=void 0;var r=n(295),i=n(5092),o=n(626);e.named=function(t){return function(e,n,a){var u=new i.Metadata(r.NAMED_TAG,t);"number"==typeof a?o.tagParameter(e,n,a,u):o.tagProperty(e,n,u)}}},1316:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.optional=void 0;var r=n(295),i=n(5092),o=n(626);e.optional=function(){return function(t,e,n){var a=new i.Metadata(r.OPTIONAL_TAG,!0);"number"==typeof n?o.tagParameter(t,e,n,a):o.tagProperty(t,e,a)}}},1971:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.postConstruct=void 0;var r=n(6078),i=n(295),o=n(5092);e.postConstruct=function(){return function(t,e,n){var a=new o.Metadata(i.POST_CONSTRUCT,e);if(Reflect.hasOwnMetadata(i.POST_CONSTRUCT,t.constructor))throw new Error(r.MULTIPLE_POST_CONSTRUCT_METHODS);Reflect.defineMetadata(i.POST_CONSTRUCT,a,t.constructor)}}},9189:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tagged=void 0;var r=n(5092),i=n(626);e.tagged=function(t,e){return function(n,o,a){var u=new r.Metadata(t,e);"number"==typeof a?i.tagParameter(n,o,a,u):i.tagProperty(n,o,u)}}},8245:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.targetName=void 0;var r=n(295),i=n(5092),o=n(626);e.targetName=function(t){return function(e,n,a){var u=new i.Metadata(r.NAME_TAG,t);o.tagParameter(e,n,a,u)}}},9235:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.unmanaged=void 0;var r=n(295),i=n(5092),o=n(626);e.unmanaged=function(){return function(t,e,n){var a=new i.Metadata(r.UNMANAGED_TAG,!0);o.tagParameter(t,e,n,a)}}},683:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Binding=void 0;var r=n(7690),i=n(23),o=function(){function t(t,e){this.id=i.id(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=r.BindingTypeEnum.Invalid,this.constraint=function(t){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.dynamicValue=null}return t.prototype.clone=function(){var e=new t(this.serviceIdentifier,this.scope);return e.activated=e.scope===r.BindingScopeEnum.Singleton&&this.activated,e.implementationType=this.implementationType,e.dynamicValue=this.dynamicValue,e.scope=this.scope,e.type=this.type,e.factory=this.factory,e.provider=this.provider,e.constraint=this.constraint,e.onActivation=this.onActivation,e.cache=this.cache,e},t}();e.Binding=o},3497:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingCount=void 0,e.BindingCount={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1}},6078:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.STACK_OVERFLOW=e.CIRCULAR_DEPENDENCY_IN_FACTORY=e.POST_CONSTRUCT_ERROR=e.MULTIPLE_POST_CONSTRUCT_METHODS=e.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK=e.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE=e.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE=e.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT=e.ARGUMENTS_LENGTH_MISMATCH=e.INVALID_DECORATOR_OPERATION=e.INVALID_TO_SELF_VALUE=e.INVALID_FUNCTION_BINDING=e.INVALID_MIDDLEWARE_RETURN=e.NO_MORE_SNAPSHOTS_AVAILABLE=e.INVALID_BINDING_TYPE=e.NOT_IMPLEMENTED=e.CIRCULAR_DEPENDENCY=e.UNDEFINED_INJECT_ANNOTATION=e.MISSING_INJECT_ANNOTATION=e.MISSING_INJECTABLE_ANNOTATION=e.NOT_REGISTERED=e.CANNOT_UNBIND=e.AMBIGUOUS_MATCH=e.KEY_NOT_FOUND=e.NULL_ARGUMENT=e.DUPLICATED_METADATA=e.DUPLICATED_INJECTABLE_DECORATOR=void 0,e.DUPLICATED_INJECTABLE_DECORATOR="Cannot apply @injectable decorator multiple times.",e.DUPLICATED_METADATA="Metadata key was used more than once in a parameter:",e.NULL_ARGUMENT="NULL argument",e.KEY_NOT_FOUND="Key Not Found",e.AMBIGUOUS_MATCH="Ambiguous match found for serviceIdentifier:",e.CANNOT_UNBIND="Could not unbind serviceIdentifier:",e.NOT_REGISTERED="No matching bindings found for serviceIdentifier:",e.MISSING_INJECTABLE_ANNOTATION="Missing required @injectable annotation in:",e.MISSING_INJECT_ANNOTATION="Missing required @inject or @multiInject annotation in:",e.UNDEFINED_INJECT_ANNOTATION=function(t){return"@inject called with undefined this could mean that the class "+t+" has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation."},e.CIRCULAR_DEPENDENCY="Circular dependency found:",e.NOT_IMPLEMENTED="Sorry, this feature is not fully implemented yet.",e.INVALID_BINDING_TYPE="Invalid binding type:",e.NO_MORE_SNAPSHOTS_AVAILABLE="No snapshot available to restore.",e.INVALID_MIDDLEWARE_RETURN="Invalid return type in middleware. Middleware must return!",e.INVALID_FUNCTION_BINDING="Value provided to function binding must be a function!",e.INVALID_TO_SELF_VALUE="The toSelf function can only be applied when a constructor is used as service identifier",e.INVALID_DECORATOR_OPERATION="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.",e.ARGUMENTS_LENGTH_MISMATCH=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"The number of constructor arguments in the derived class "+t[0]+" must be >= than the number of constructor arguments of its base class."},e.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT="Invalid Container constructor argument. Container options must be an object.",e.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE="Invalid Container option. Default scope must be a string ('singleton' or 'transient').",e.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE="Invalid Container option. Auto bind injectable must be a boolean",e.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK="Invalid Container option. Skip base check must be a boolean",e.MULTIPLE_POST_CONSTRUCT_METHODS="Cannot apply @postConstruct decorator multiple times in the same class",e.POST_CONSTRUCT_ERROR=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"@postConstruct error in class "+t[0]+": "+t[1]},e.CIRCULAR_DEPENDENCY_IN_FACTORY=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"It looks like there is a circular dependency in one of the '"+t[0]+"' bindings. Please investigate bindings withservice identifier '"+t[1]+"'."},e.STACK_OVERFLOW="Maximum call stack size exceeded"},7690:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TargetTypeEnum=e.BindingTypeEnum=e.BindingScopeEnum=void 0,e.BindingScopeEnum={Request:"Request",Singleton:"Singleton",Transient:"Transient"},e.BindingTypeEnum={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"},e.TargetTypeEnum={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"}},295:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NON_CUSTOM_TAG_KEYS=e.POST_CONSTRUCT=e.DESIGN_PARAM_TYPES=e.PARAM_TYPES=e.TAGGED_PROP=e.TAGGED=e.MULTI_INJECT_TAG=e.INJECT_TAG=e.OPTIONAL_TAG=e.UNMANAGED_TAG=e.NAME_TAG=e.NAMED_TAG=void 0,e.NAMED_TAG="named",e.NAME_TAG="name",e.UNMANAGED_TAG="unmanaged",e.OPTIONAL_TAG="optional",e.INJECT_TAG="inject",e.MULTI_INJECT_TAG="multi_inject",e.TAGGED="inversify:tagged",e.TAGGED_PROP="inversify:tagged_props",e.PARAM_TYPES="inversify:paramtypes",e.DESIGN_PARAM_TYPES="design:paramtypes",e.POST_CONSTRUCT="post_construct",e.NON_CUSTOM_TAG_KEYS=[e.INJECT_TAG,e.MULTI_INJECT_TAG,e.NAME_TAG,e.UNMANAGED_TAG,e.NAMED_TAG,e.OPTIONAL_TAG]},596:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{s(r.next(t))}catch(t){o(t)}}function u(t){try{s(r.throw(t))}catch(t){o(t)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}s((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},o=this&&this.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.Container=void 0;var a=n(683),u=n(6078),s=n(7690),c=n(295),f=n(3870),l=n(4142),h=n(9386),d=n(3313),p=n(23),v=n(9552),g=n(1878),y=n(2543),m=function(){function t(t){this._appliedMiddleware=[];var e=t||{};if("object"!=typeof e)throw new Error(""+u.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT);if(void 0===e.defaultScope)e.defaultScope=s.BindingScopeEnum.Transient;else if(e.defaultScope!==s.BindingScopeEnum.Singleton&&e.defaultScope!==s.BindingScopeEnum.Transient&&e.defaultScope!==s.BindingScopeEnum.Request)throw new Error(""+u.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE);if(void 0===e.autoBindInjectable)e.autoBindInjectable=!1;else if("boolean"!=typeof e.autoBindInjectable)throw new Error(""+u.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE);if(void 0===e.skipBaseClassChecks)e.skipBaseClassChecks=!1;else if("boolean"!=typeof e.skipBaseClassChecks)throw new Error(""+u.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK);this.options={autoBindInjectable:e.autoBindInjectable,defaultScope:e.defaultScope,skipBaseClassChecks:e.skipBaseClassChecks},this.id=p.id(),this._bindingDictionary=new y.Lookup,this._snapshots=[],this._middleware=null,this.parent=null,this._metadataReader=new f.MetadataReader}return t.merge=function(e,n){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];var a=new t,u=o([e,n],r).map((function(t){return l.getBindingDictionary(t)})),s=l.getBindingDictionary(a);function c(t,e){t.traverse((function(t,n){n.forEach((function(t){e.add(t.serviceIdentifier,t.clone())}))}))}return u.forEach((function(t){c(t,s)})),a},t.prototype.load=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=this._getContainerModuleHelpersFactory(),r=0,i=t;r<i.length;r++){var o=i[r],a=n(o.id);o.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction)}},t.prototype.loadAsync=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return r(this,void 0,void 0,(function(){var e,n,r,o,a;return i(this,(function(i){switch(i.label){case 0:e=this._getContainerModuleHelpersFactory(),n=0,r=t,i.label=1;case 1:return n<r.length?(o=r[n],a=e(o.id),[4,o.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction)]):[3,4];case 2:i.sent(),i.label=3;case 3:return n++,[3,1];case 4:return[2]}}))}))},t.prototype.unload=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=function(t){return function(e){return e.moduleId===t}};e.forEach((function(e){var n=r(e.id);t._bindingDictionary.removeByCondition(n)}))},t.prototype.bind=function(t){var e=this.options.defaultScope||s.BindingScopeEnum.Transient,n=new a.Binding(t,e);return this._bindingDictionary.add(t,n),new d.BindingToSyntax(n)},t.prototype.rebind=function(t){return this.unbind(t),this.bind(t)},t.prototype.unbind=function(t){try{this._bindingDictionary.remove(t)}catch(e){throw new Error(u.CANNOT_UNBIND+" "+v.getServiceIdentifierAsString(t))}},t.prototype.unbindAll=function(){this._bindingDictionary=new y.Lookup},t.prototype.isBound=function(t){var e=this._bindingDictionary.hasKey(t);return!e&&this.parent&&(e=this.parent.isBound(t)),e},t.prototype.isBoundNamed=function(t,e){return this.isBoundTagged(t,c.NAMED_TAG,e)},t.prototype.isBoundTagged=function(t,e,n){var r=!1;if(this._bindingDictionary.hasKey(t)){var i=this._bindingDictionary.get(t),o=l.createMockRequest(this,t,e,n);r=i.some((function(t){return t.constraint(o)}))}return!r&&this.parent&&(r=this.parent.isBoundTagged(t,e,n)),r},t.prototype.snapshot=function(){this._snapshots.push(g.ContainerSnapshot.of(this._bindingDictionary.clone(),this._middleware))},t.prototype.restore=function(){var t=this._snapshots.pop();if(void 0===t)throw new Error(u.NO_MORE_SNAPSHOTS_AVAILABLE);this._bindingDictionary=t.bindings,this._middleware=t.middleware},t.prototype.createChild=function(e){var n=new t(e||this.options);return n.parent=this,n},t.prototype.applyMiddleware=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._appliedMiddleware=this._appliedMiddleware.concat(t);var n=this._middleware?this._middleware:this._planAndResolve();this._middleware=t.reduce((function(t,e){return e(t)}),n)},t.prototype.applyCustomMetadataReader=function(t){this._metadataReader=t},t.prototype.get=function(t){return this._get(!1,!1,s.TargetTypeEnum.Variable,t)},t.prototype.getTagged=function(t,e,n){return this._get(!1,!1,s.TargetTypeEnum.Variable,t,e,n)},t.prototype.getNamed=function(t,e){return this.getTagged(t,c.NAMED_TAG,e)},t.prototype.getAll=function(t){return this._get(!0,!0,s.TargetTypeEnum.Variable,t)},t.prototype.getAllTagged=function(t,e,n){return this._get(!1,!0,s.TargetTypeEnum.Variable,t,e,n)},t.prototype.getAllNamed=function(t,e){return this.getAllTagged(t,c.NAMED_TAG,e)},t.prototype.resolve=function(t){var e=this.createChild();return e.bind(t).toSelf(),this._appliedMiddleware.forEach((function(t){e.applyMiddleware(t)})),e.get(t)},t.prototype._getContainerModuleHelpersFactory=function(){var t=this,e=function(t,e){t._binding.moduleId=e},n=function(n){return function(r){var i=t.rebind.bind(t)(r);return e(i,n),i}};return function(r){return{bindFunction:(i=r,function(n){var r=t.bind.bind(t)(n);return e(r,i),r}),isboundFunction:function(e){return t.isBound.bind(t)(e)},rebindFunction:n(r),unbindFunction:function(e){t.unbind.bind(t)(e)}};var i}},t.prototype._get=function(t,e,n,r,i,o){var a=null,s={avoidConstraints:t,contextInterceptor:function(t){return t},isMultiInject:e,key:i,serviceIdentifier:r,targetType:n,value:o};if(this._middleware){if(null==(a=this._middleware(s)))throw new Error(u.INVALID_MIDDLEWARE_RETURN)}else a=this._planAndResolve()(s);return a},t.prototype._planAndResolve=function(){var t=this;return function(e){var n=l.plan(t._metadataReader,t,e.isMultiInject,e.targetType,e.serviceIdentifier,e.key,e.value,e.avoidConstraints);return n=e.contextInterceptor(n),h.resolve(n)}},t}();e.Container=m},2913:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AsyncContainerModule=e.ContainerModule=void 0;var r=n(23);e.ContainerModule=function(t){this.id=r.id(),this.registry=t};e.AsyncContainerModule=function(t){this.id=r.id(),this.registry=t}},1878:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContainerSnapshot=void 0;var n=function(){function t(){}return t.of=function(e,n){var r=new t;return r.bindings=e,r.middleware=n,r},t}();e.ContainerSnapshot=n},2543:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Lookup=void 0;var r=n(6078),i=function(){function t(){this._map=new Map}return t.prototype.getMap=function(){return this._map},t.prototype.add=function(t,e){if(null==t)throw new Error(r.NULL_ARGUMENT);if(null==e)throw new Error(r.NULL_ARGUMENT);var n=this._map.get(t);void 0!==n?(n.push(e),this._map.set(t,n)):this._map.set(t,[e])},t.prototype.get=function(t){if(null==t)throw new Error(r.NULL_ARGUMENT);var e=this._map.get(t);if(void 0!==e)return e;throw new Error(r.KEY_NOT_FOUND)},t.prototype.remove=function(t){if(null==t)throw new Error(r.NULL_ARGUMENT);if(!this._map.delete(t))throw new Error(r.KEY_NOT_FOUND)},t.prototype.removeByCondition=function(t){var e=this;this._map.forEach((function(n,r){var i=n.filter((function(e){return!t(e)}));i.length>0?e._map.set(r,i):e._map.delete(r)}))},t.prototype.hasKey=function(t){if(null==t)throw new Error(r.NULL_ARGUMENT);return this._map.has(t)},t.prototype.clone=function(){var e=new t;return this._map.forEach((function(t,n){t.forEach((function(t){return e.add(n,t.clone())}))})),e},t.prototype.traverse=function(t){this._map.forEach((function(e,n){t(n,e)}))},t}();e.Lookup=i},9311:(t,e,n)=>{"use strict";e.f3=e.t6=e.b2=e.W2=void 0,n(295);var r=n(596);Object.defineProperty(e,"W2",{enumerable:!0,get:function(){return r.Container}});n(7690),n(2913);var i=n(1773);Object.defineProperty(e,"b2",{enumerable:!0,get:function(){return i.injectable}});n(9189);var o=n(9817);Object.defineProperty(e,"t6",{enumerable:!0,get:function(){return o.named}});var a=n(6213);Object.defineProperty(e,"f3",{enumerable:!0,get:function(){return a.inject}});n(1316),n(9235),n(1528),n(8245),n(1971),n(3870),n(23),n(626),n(3140),n(9552),n(4384)},1519:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Context=void 0;var r=n(23),i=function(){function t(t){this.id=r.id(),this.container=t}return t.prototype.addPlan=function(t){this.plan=t},t.prototype.setCurrentRequest=function(t){this.currentRequest=t},t}();e.Context=i},5092:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;var r=n(295),i=function(){function t(t,e){this.key=t,this.value=e}return t.prototype.toString=function(){return this.key===r.NAMED_TAG?"named: "+this.value.toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+this.value+" }"},t}();e.Metadata=i},3870:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MetadataReader=void 0;var r=n(295),i=function(){function t(){}return t.prototype.getConstructorMetadata=function(t){return{compilerGeneratedMetadata:Reflect.getMetadata(r.PARAM_TYPES,t),userGeneratedMetadata:Reflect.getMetadata(r.TAGGED,t)||{}}},t.prototype.getPropertiesMetadata=function(t){return Reflect.getMetadata(r.TAGGED_PROP,t)||[]},t}();e.MetadataReader=i},6335:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Plan=void 0;e.Plan=function(t,e){this.parentContext=t,this.rootRequest=e}},4142:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getBindingDictionary=e.createMockRequest=e.plan=void 0;var r=n(3497),i=n(6078),o=n(7690),a=n(295),u=n(2542),s=n(9552),c=n(1519),f=n(5092),l=n(6335),h=n(6664),d=n(4810),p=n(9660);function v(t){return t._bindingDictionary}function g(t,e,n,o,a){var u,c=m(n.container,a.serviceIdentifier);return c.length===r.BindingCount.NoBindingsAvailable&&n.container.options.autoBindInjectable&&"function"==typeof a.serviceIdentifier&&t.getConstructorMetadata(a.serviceIdentifier).compilerGeneratedMetadata&&(n.container.bind(a.serviceIdentifier).toSelf(),c=m(n.container,a.serviceIdentifier)),u=e?c:c.filter((function(t){var e=new d.Request(t.serviceIdentifier,n,o,t,a);return t.constraint(e)})),function(t,e,n,o){switch(e.length){case r.BindingCount.NoBindingsAvailable:if(n.isOptional())return e;var a=s.getServiceIdentifierAsString(t),u=i.NOT_REGISTERED;throw u+=s.listMetadataForTarget(a,n),u+=s.listRegisteredBindingsForServiceIdentifier(o,a,m),new Error(u);case r.BindingCount.OnlyOneBindingAvailable:if(!n.isArray())return e;case r.BindingCount.MultipleBindingsAvailable:default:if(n.isArray())return e;throw a=s.getServiceIdentifierAsString(t),u=i.AMBIGUOUS_MATCH+" "+a,u+=s.listRegisteredBindingsForServiceIdentifier(o,a,m),new Error(u)}}(a.serviceIdentifier,u,a,n.container),u}function y(t,e,n,r,a,u){var s,c;if(null===a){s=g(t,e,r,null,u),c=new d.Request(n,r,null,s,u);var f=new l.Plan(r,c);r.addPlan(f)}else s=g(t,e,r,a,u),c=a.addChildRequest(u.serviceIdentifier,s,u);s.forEach((function(e){var n=null;if(u.isArray())n=c.addChildRequest(e.serviceIdentifier,e,u);else{if(e.cache)return;n=c}if(e.type===o.BindingTypeEnum.Instance&&null!==e.implementationType){var a=h.getDependencies(t,e.implementationType);if(!r.container.options.skipBaseClassChecks){var s=h.getBaseClassDependencyCount(t,e.implementationType);if(a.length<s){var f=i.ARGUMENTS_LENGTH_MISMATCH(h.getFunctionName(e.implementationType));throw new Error(f)}}a.forEach((function(e){y(t,!1,e.serviceIdentifier,r,n,e)}))}}))}function m(t,e){var n=[],r=v(t);return r.hasKey(e)?n=r.get(e):null!==t.parent&&(n=m(t.parent,e)),n}e.getBindingDictionary=v,e.plan=function(t,e,n,r,i,o,l,h){void 0===h&&(h=!1);var d=new c.Context(e),v=function(t,e,n,r,i,o){var u=t?a.MULTI_INJECT_TAG:a.INJECT_TAG,s=new f.Metadata(u,n),c=new p.Target(e,"",n,s);if(void 0!==i){var l=new f.Metadata(i,o);c.metadata.push(l)}return c}(n,r,i,0,o,l);try{return y(t,h,i,d,null,v),d}catch(t){throw u.isStackOverflowExeption(t)&&d.plan&&s.circularDependencyToException(d.plan.rootRequest),t}},e.createMockRequest=function(t,e,n,r){var i=new p.Target(o.TargetTypeEnum.Variable,"",e,new f.Metadata(n,r)),a=new c.Context(t);return new d.Request(e,a,null,[],i)}},8634:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QueryableString=void 0;var n=function(){function t(t){this.str=t}return t.prototype.startsWith=function(t){return 0===this.str.indexOf(t)},t.prototype.endsWith=function(t){var e,n=t.split("").reverse().join("");return e=this.str.split("").reverse().join(""),this.startsWith.call({str:e},n)},t.prototype.contains=function(t){return-1!==this.str.indexOf(t)},t.prototype.equals=function(t){return this.str===t},t.prototype.value=function(){return this.str},t}();e.QueryableString=n},6664:function(t,e,n){"use strict";var r=this&&this.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.getFunctionName=e.getBaseClassDependencyCount=e.getDependencies=void 0;var i=n(6213),o=n(6078),a=n(7690),u=n(295),s=n(9552);Object.defineProperty(e,"getFunctionName",{enumerable:!0,get:function(){return s.getFunctionName}});var c=n(9660);function f(t,e,n,i){var a=t.getConstructorMetadata(n),u=a.compilerGeneratedMetadata;if(void 0===u){var s=o.MISSING_INJECTABLE_ANNOTATION+" "+e+".";throw new Error(s)}var c=a.userGeneratedMetadata,f=Object.keys(c),d=0===n.length&&f.length>0,p=f.length>n.length,v=function(t,e,n,r,i){for(var o=[],a=0;a<i;a++){var u=l(a,t,e,n,r);null!==u&&o.push(u)}return o}(i,e,u,c,d||p?f.length:n.length),g=h(t,n);return r(r([],v),g)}function l(t,e,n,r,u){var s=u[t.toString()]||[],f=d(s),l=!0!==f.unmanaged,h=r[t];if((h=f.inject||f.multiInject||h)instanceof i.LazyServiceIdentifer&&(h=h.unwrap()),l){if(!e&&(h===Object||h===Function||void 0===h)){var p=o.MISSING_INJECT_ANNOTATION+" argument "+t+" in class "+n+".";throw new Error(p)}var v=new c.Target(a.TargetTypeEnum.ConstructorArgument,f.targetName,h);return v.metadata=s,v}return null}function h(t,e){for(var n=t.getPropertiesMetadata(e),i=[],o=0,u=Object.keys(n);o<u.length;o++){var s=u[o],f=n[s],l=d(n[s]),p=l.targetName||s,v=l.inject||l.multiInject,g=new c.Target(a.TargetTypeEnum.ClassProperty,p,v);g.metadata=f,i.push(g)}var y=Object.getPrototypeOf(e.prototype).constructor;if(y!==Object){var m=h(t,y);i=r(r([],i),m)}return i}function d(t){var e={};return t.forEach((function(t){e[t.key.toString()]=t.value})),{inject:e[u.INJECT_TAG],multiInject:e[u.MULTI_INJECT_TAG],targetName:e[u.NAME_TAG],unmanaged:e[u.UNMANAGED_TAG]}}e.getDependencies=function(t,e){return f(t,s.getFunctionName(e),e,!1)},e.getBaseClassDependencyCount=function t(e,n){var r=Object.getPrototypeOf(n.prototype).constructor;if(r!==Object){var i=f(e,s.getFunctionName(r),r,!0),o=i.map((function(t){return t.metadata.filter((function(t){return t.key===u.UNMANAGED_TAG}))})),a=[].concat.apply([],o).length,c=i.length-a;return c>0?c:t(e,r)}return 0}},4810:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Request=void 0;var r=n(23),i=function(){function t(t,e,n,i,o){this.id=r.id(),this.serviceIdentifier=t,this.parentContext=e,this.parentRequest=n,this.target=o,this.childRequests=[],this.bindings=Array.isArray(i)?i:[i],this.requestScope=null===n?new Map:null}return t.prototype.addChildRequest=function(e,n,r){var i=new t(e,this.parentContext,this,n,r);return this.childRequests.push(i),i},t}();e.Request=i},9660:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Target=void 0;var r=n(295),i=n(23),o=n(5092),a=n(8634),u=function(){function t(t,e,n,u){this.id=i.id(),this.type=t,this.serviceIdentifier=n,this.name=new a.QueryableString(e||""),this.metadata=new Array;var s=null;"string"==typeof u?s=new o.Metadata(r.NAMED_TAG,u):u instanceof o.Metadata&&(s=u),null!==s&&this.metadata.push(s)}return t.prototype.hasTag=function(t){for(var e=0,n=this.metadata;e<n.length;e++)if(n[e].key===t)return!0;return!1},t.prototype.isArray=function(){return this.hasTag(r.MULTI_INJECT_TAG)},t.prototype.matchesArray=function(t){return this.matchesTag(r.MULTI_INJECT_TAG)(t)},t.prototype.isNamed=function(){return this.hasTag(r.NAMED_TAG)},t.prototype.isTagged=function(){return this.metadata.some((function(t){return r.NON_CUSTOM_TAG_KEYS.every((function(e){return t.key!==e}))}))},t.prototype.isOptional=function(){return this.matchesTag(r.OPTIONAL_TAG)(!0)},t.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter((function(t){return t.key===r.NAMED_TAG}))[0]:null},t.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter((function(t){return r.NON_CUSTOM_TAG_KEYS.every((function(e){return t.key!==e}))})):null},t.prototype.matchesNamedTag=function(t){return this.matchesTag(r.NAMED_TAG)(t)},t.prototype.matchesTag=function(t){var e=this;return function(n){for(var r=0,i=e.metadata;r<i.length;r++){var o=i[r];if(o.key===t&&o.value===n)return!0}return!1}},t}();e.Target=u},8544:function(t,e,n){"use strict";var r=this&&this.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.resolveInstance=void 0;var i=n(6078),o=n(7690),a=n(295);e.resolveInstance=function(t,e,n){var u,s,c=null;e.length>0?(s=e.filter((function(t){return null!==t.target&&t.target.type===o.TargetTypeEnum.ConstructorArgument})).map(n),c=function(t,e,n){var r=e.filter((function(t){return null!==t.target&&t.target.type===o.TargetTypeEnum.ClassProperty})),i=r.map(n);return r.forEach((function(e,n){var r;r=e.target.name.value();var o=i[n];t[r]=o})),t}(c=new((u=t).bind.apply(u,r([void 0],s))),e,n)):c=new t;return function(t,e){if(Reflect.hasMetadata(a.POST_CONSTRUCT,t)){var n=Reflect.getMetadata(a.POST_CONSTRUCT,t);try{e[n.value]()}catch(e){throw new Error(i.POST_CONSTRUCT_ERROR(t.name,e.message))}}}(t,c),c}},9386:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.resolve=void 0;var r=n(6078),i=n(7690),o=n(2542),a=n(9552),u=n(8544),s=function(t,e,n){try{return n()}catch(n){throw o.isStackOverflowExeption(n)?new Error(r.CIRCULAR_DEPENDENCY_IN_FACTORY(t,e.toString())):n}},c=function(t){return function(e){e.parentContext.setCurrentRequest(e);var n=e.bindings,o=e.childRequests,f=e.target&&e.target.isArray(),l=!(e.parentRequest&&e.parentRequest.target&&e.target&&e.parentRequest.target.matchesArray(e.target.serviceIdentifier));if(f&&l)return o.map((function(e){return c(t)(e)}));var h=null;if(!e.target.isOptional()||0!==n.length){var d=n[0],p=d.scope===i.BindingScopeEnum.Singleton,v=d.scope===i.BindingScopeEnum.Request;if(p&&d.activated)return d.cache;if(v&&null!==t&&t.has(d.id))return t.get(d.id);if(d.type===i.BindingTypeEnum.ConstantValue)h=d.cache,d.activated=!0;else if(d.type===i.BindingTypeEnum.Function)h=d.cache,d.activated=!0;else if(d.type===i.BindingTypeEnum.Constructor)h=d.implementationType;else if(d.type===i.BindingTypeEnum.DynamicValue&&null!==d.dynamicValue)h=s("toDynamicValue",d.serviceIdentifier,(function(){return d.dynamicValue(e.parentContext)}));else if(d.type===i.BindingTypeEnum.Factory&&null!==d.factory)h=s("toFactory",d.serviceIdentifier,(function(){return d.factory(e.parentContext)}));else if(d.type===i.BindingTypeEnum.Provider&&null!==d.provider)h=s("toProvider",d.serviceIdentifier,(function(){return d.provider(e.parentContext)}));else{if(d.type!==i.BindingTypeEnum.Instance||null===d.implementationType){var g=a.getServiceIdentifierAsString(e.serviceIdentifier);throw new Error(r.INVALID_BINDING_TYPE+" "+g)}h=u.resolveInstance(d.implementationType,o,c(t))}return"function"==typeof d.onActivation&&(h=d.onActivation(e.parentContext,h)),p&&(d.cache=h,d.activated=!0),v&&null!==t&&!t.has(d.id)&&t.set(d.id,h),h}}};e.resolve=function(t){return c(t.plan.rootRequest.requestScope)(t.plan.rootRequest)}},1640:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInSyntax=void 0;var r=n(7690),i=n(6890),o=function(){function t(t){this._binding=t}return t.prototype.inRequestScope=function(){return this._binding.scope=r.BindingScopeEnum.Request,new i.BindingWhenOnSyntax(this._binding)},t.prototype.inSingletonScope=function(){return this._binding.scope=r.BindingScopeEnum.Singleton,new i.BindingWhenOnSyntax(this._binding)},t.prototype.inTransientScope=function(){return this._binding.scope=r.BindingScopeEnum.Transient,new i.BindingWhenOnSyntax(this._binding)},t}();e.BindingInSyntax=o},2386:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInWhenOnSyntax=void 0;var r=n(1640),i=n(8926),o=n(2700),a=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new o.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new i.BindingOnSyntax(this._binding),this._bindingInSyntax=new r.BindingInSyntax(t)}return t.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},t.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},t.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t}();e.BindingInWhenOnSyntax=a},8926:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingOnSyntax=void 0;var r=n(2700),i=function(){function t(t){this._binding=t}return t.prototype.onActivation=function(t){return this._binding.onActivation=t,new r.BindingWhenSyntax(this._binding)},t}();e.BindingOnSyntax=i},3313:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingToSyntax=void 0;var r=n(6078),i=n(7690),o=n(2386),a=n(6890),u=function(){function t(t){this._binding=t}return t.prototype.to=function(t){return this._binding.type=i.BindingTypeEnum.Instance,this._binding.implementationType=t,new o.BindingInWhenOnSyntax(this._binding)},t.prototype.toSelf=function(){if("function"!=typeof this._binding.serviceIdentifier)throw new Error(""+r.INVALID_TO_SELF_VALUE);var t=this._binding.serviceIdentifier;return this.to(t)},t.prototype.toConstantValue=function(t){return this._binding.type=i.BindingTypeEnum.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toDynamicValue=function(t){return this._binding.type=i.BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new o.BindingInWhenOnSyntax(this._binding)},t.prototype.toConstructor=function(t){return this._binding.type=i.BindingTypeEnum.Constructor,this._binding.implementationType=t,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toFactory=function(t){return this._binding.type=i.BindingTypeEnum.Factory,this._binding.factory=t,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toFunction=function(t){if("function"!=typeof t)throw new Error(r.INVALID_FUNCTION_BINDING);var e=this.toConstantValue(t);return this._binding.type=i.BindingTypeEnum.Function,this._binding.scope=i.BindingScopeEnum.Singleton,e},t.prototype.toAutoFactory=function(t){return this._binding.type=i.BindingTypeEnum.Factory,this._binding.factory=function(e){return function(){return e.container.get(t)}},this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toProvider=function(t){return this._binding.type=i.BindingTypeEnum.Provider,this._binding.provider=t,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toService=function(t){this.toDynamicValue((function(e){return e.container.get(t)}))},t}();e.BindingToSyntax=u},6890:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenOnSyntax=void 0;var r=n(8926),i=n(2700),o=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new i.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new r.BindingOnSyntax(this._binding)}return t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t}();e.BindingWhenOnSyntax=o},2700:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenSyntax=void 0;var r=n(8926),i=n(3140),o=function(){function t(t){this._binding=t}return t.prototype.when=function(t){return this._binding.constraint=t,new r.BindingOnSyntax(this._binding)},t.prototype.whenTargetNamed=function(t){return this._binding.constraint=i.namedConstraint(t),new r.BindingOnSyntax(this._binding)},t.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(t){return null!==t.target&&!t.target.isNamed()&&!t.target.isTagged()},new r.BindingOnSyntax(this._binding)},t.prototype.whenTargetTagged=function(t,e){return this._binding.constraint=i.taggedConstraint(t)(e),new r.BindingOnSyntax(this._binding)},t.prototype.whenInjectedInto=function(t){return this._binding.constraint=function(e){return i.typeConstraint(t)(e.parentRequest)},new r.BindingOnSyntax(this._binding)},t.prototype.whenParentNamed=function(t){return this._binding.constraint=function(e){return i.namedConstraint(t)(e.parentRequest)},new r.BindingOnSyntax(this._binding)},t.prototype.whenParentTagged=function(t,e){return this._binding.constraint=function(n){return i.taggedConstraint(t)(e)(n.parentRequest)},new r.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorIs=function(t){return this._binding.constraint=function(e){return i.traverseAncerstors(e,i.typeConstraint(t))},new r.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorIs=function(t){return this._binding.constraint=function(e){return!i.traverseAncerstors(e,i.typeConstraint(t))},new r.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorNamed=function(t){return this._binding.constraint=function(e){return i.traverseAncerstors(e,i.namedConstraint(t))},new r.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorNamed=function(t){return this._binding.constraint=function(e){return!i.traverseAncerstors(e,i.namedConstraint(t))},new r.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._binding.constraint=function(n){return i.traverseAncerstors(n,i.taggedConstraint(t)(e))},new r.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorTagged=function(t,e){return this._binding.constraint=function(n){return!i.traverseAncerstors(n,i.taggedConstraint(t)(e))},new r.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorMatches=function(t){return this._binding.constraint=function(e){return i.traverseAncerstors(e,t)},new r.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorMatches=function(t){return this._binding.constraint=function(e){return!i.traverseAncerstors(e,t)},new r.BindingOnSyntax(this._binding)},t}();e.BindingWhenSyntax=o},3140:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.typeConstraint=e.namedConstraint=e.taggedConstraint=e.traverseAncerstors=void 0;var r=n(295),i=n(5092),o=function(t,e){var n=t.parentRequest;return null!==n&&(!!e(n)||o(n,e))};e.traverseAncerstors=o;var a=function(t){return function(e){var n=function(n){return null!==n&&null!==n.target&&n.target.matchesTag(t)(e)};return n.metaData=new i.Metadata(t,e),n}};e.taggedConstraint=a;var u=a(r.NAMED_TAG);e.namedConstraint=u,e.typeConstraint=function(t){return function(e){var n=null;if(null!==e){if(n=e.bindings[0],"string"==typeof t)return n.serviceIdentifier===t;var r=e.bindings[0].implementationType;return t===r}return!1}}},4384:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.multiBindToService=void 0,e.multiBindToService=function(t){return function(e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return n.forEach((function(n){return t.bind(n).toService(e)}))}}}},2542:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isStackOverflowExeption=void 0;var r=n(6078);e.isStackOverflowExeption=function(t){return t instanceof RangeError||t.message===r.STACK_OVERFLOW}},23:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.id=void 0;var n=0;e.id=function(){return n++}},9552:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.circularDependencyToException=e.listMetadataForTarget=e.listRegisteredBindingsForServiceIdentifier=e.getServiceIdentifierAsString=e.getFunctionName=void 0;var r=n(6078);function i(t){return"function"==typeof t?t.name:"symbol"==typeof t?t.toString():t}function o(t,e){return null!==t.parentRequest&&(t.parentRequest.serviceIdentifier===e||o(t.parentRequest,e))}function a(t){if(t.name)return t.name;var e=t.toString(),n=e.match(/^function\s*([^\s(]+)/);return n?n[1]:"Anonymous function: "+e}e.getServiceIdentifierAsString=i,e.listRegisteredBindingsForServiceIdentifier=function(t,e,n){var r="",i=n(t,e);return 0!==i.length&&(r="\nRegistered bindings:",i.forEach((function(t){var e="Object";null!==t.implementationType&&(e=a(t.implementationType)),r=r+"\n "+e,t.constraint.metaData&&(r=r+" - "+t.constraint.metaData)}))),r},e.circularDependencyToException=function t(e){e.childRequests.forEach((function(e){if(o(e,e.serviceIdentifier)){var n=function(t){return function t(e,n){void 0===n&&(n=[]);var r=i(e.serviceIdentifier);return n.push(r),null!==e.parentRequest?t(e.parentRequest,n):n}(t).reverse().join(" --\x3e ")}(e);throw new Error(r.CIRCULAR_DEPENDENCY+" "+n)}t(e)}))},e.listMetadataForTarget=function(t,e){if(e.isTagged()||e.isNamed()){var n="",r=e.getNamedTag(),i=e.getCustomTags();return null!==r&&(n+=r.toString()+"\n"),null!==i&&i.forEach((function(t){n+=t.toString()+"\n"}))," "+t+"\n "+t+" - "+n}return" "+t},e.getFunctionName=a},9392:function(t,e,n){var r;t=n.nmd(t),function(){var i,o="Expected a function",a="__lodash_hash_undefined__",u="__lodash_placeholder__",s=32,c=128,f=1/0,l=9007199254740991,h=NaN,d=4294967295,p=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",s],["partialRight",64],["rearg",256]],v="[object Arguments]",g="[object Array]",y="[object Boolean]",m="[object Date]",b="[object Error]",_="[object Function]",x="[object GeneratorFunction]",w="[object Map]",E="[object Number]",S="[object Object]",A="[object Promise]",T="[object RegExp]",I="[object Set]",C="[object String]",D="[object Symbol]",N="[object WeakMap]",k="[object ArrayBuffer]",R="[object DataView]",O="[object Float32Array]",M="[object Float64Array]",P="[object Int8Array]",G="[object Int16Array]",L="[object Int32Array]",U="[object Uint8Array]",F="[object Uint8ClampedArray]",B="[object Uint16Array]",z="[object Uint32Array]",j=/\b__p \+= '';/g,W=/\b(__p \+=) '' \+/g,V=/(__e\(.*?\)|\b__t\)) \+\n'';/g,X=/&(?:amp|lt|gt|quot|#39);/g,H=/[&<>"']/g,q=RegExp(X.source),Y=RegExp(H.source),K=/<%-([\s\S]+?)%>/g,Z=/<%([\s\S]+?)%>/g,$=/<%=([\s\S]+?)%>/g,J=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,et=/[\\^$.*+?()[\]{}|]/g,nt=RegExp(et.source),rt=/^\s+/,it=/\s/,ot=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,at=/\{\n\/\* \[wrapped with (.+)\] \*/,ut=/,? & /,st=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ct=/[()=,{}\[\]\/\s]/,ft=/\\(\\)?/g,lt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ht=/\w*$/,dt=/^[-+]0x[0-9a-f]+$/i,pt=/^0b[01]+$/i,vt=/^\[object .+?Constructor\]$/,gt=/^0o[0-7]+$/i,yt=/^(?:0|[1-9]\d*)$/,mt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bt=/($^)/,_t=/['\n\r\u2028\u2029\\]/g,xt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",wt="a-z\\xdf-\\xf6\\xf8-\\xff",Et="A-Z\\xc0-\\xd6\\xd8-\\xde",St="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",At="["+St+"]",Tt="["+xt+"]",It="\\d+",Ct="["+wt+"]",Dt="[^\\ud800-\\udfff"+St+It+"\\u2700-\\u27bf"+wt+Et+"]",Nt="\\ud83c[\\udffb-\\udfff]",kt="[^\\ud800-\\udfff]",Rt="(?:\\ud83c[\\udde6-\\uddff]){2}",Ot="[\\ud800-\\udbff][\\udc00-\\udfff]",Mt="["+Et+"]",Pt="(?:"+Ct+"|"+Dt+")",Gt="(?:"+Mt+"|"+Dt+")",Lt="(?:['’](?:d|ll|m|re|s|t|ve))?",Ut="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ft="(?:"+Tt+"|"+Nt+")?",Bt="[\\ufe0e\\ufe0f]?",zt=Bt+Ft+"(?:\\u200d(?:"+[kt,Rt,Ot].join("|")+")"+Bt+Ft+")*",jt="(?:"+["[\\u2700-\\u27bf]",Rt,Ot].join("|")+")"+zt,Wt="(?:"+[kt+Tt+"?",Tt,Rt,Ot,"[\\ud800-\\udfff]"].join("|")+")",Vt=RegExp("['’]","g"),Xt=RegExp(Tt,"g"),Ht=RegExp(Nt+"(?="+Nt+")|"+Wt+zt,"g"),qt=RegExp([Mt+"?"+Ct+"+"+Lt+"(?="+[At,Mt,"$"].join("|")+")",Gt+"+"+Ut+"(?="+[At,Mt+Pt,"$"].join("|")+")",Mt+"?"+Pt+"+"+Lt,Mt+"+"+Ut,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",It,jt].join("|"),"g"),Yt=RegExp("[\\u200d\\ud800-\\udfff"+xt+"\\ufe0e\\ufe0f]"),Kt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Zt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],$t=-1,Jt={};Jt[O]=Jt[M]=Jt[P]=Jt[G]=Jt[L]=Jt[U]=Jt[F]=Jt[B]=Jt[z]=!0,Jt[v]=Jt[g]=Jt[k]=Jt[y]=Jt[R]=Jt[m]=Jt[b]=Jt[_]=Jt[w]=Jt[E]=Jt[S]=Jt[T]=Jt[I]=Jt[C]=Jt[N]=!1;var Qt={};Qt[v]=Qt[g]=Qt[k]=Qt[R]=Qt[y]=Qt[m]=Qt[O]=Qt[M]=Qt[P]=Qt[G]=Qt[L]=Qt[w]=Qt[E]=Qt[S]=Qt[T]=Qt[I]=Qt[C]=Qt[D]=Qt[U]=Qt[F]=Qt[B]=Qt[z]=!0,Qt[b]=Qt[_]=Qt[N]=!1;var te={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ee=parseFloat,ne=parseInt,re="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,ie="object"==typeof self&&self&&self.Object===Object&&self,oe=re||ie||Function("return this")(),ae=e&&!e.nodeType&&e,ue=ae&&t&&!t.nodeType&&t,se=ue&&ue.exports===ae,ce=se&&re.process,fe=function(){try{return ue&&ue.require&&ue.require("util").types||ce&&ce.binding&&ce.binding("util")}catch(t){}}(),le=fe&&fe.isArrayBuffer,he=fe&&fe.isDate,de=fe&&fe.isMap,pe=fe&&fe.isRegExp,ve=fe&&fe.isSet,ge=fe&&fe.isTypedArray;function ye(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function me(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i<o;){var a=t[i];e(r,a,n(a),t)}return r}function be(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function _e(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function xe(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function we(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o}function Ee(t,e){return!(null==t||!t.length)&&Oe(t,e,0)>-1}function Se(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function Ae(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function Te(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function Ie(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}function Ce(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function De(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var Ne=Le("length");function ke(t,e,n){var r;return n(t,(function(t,n,i){if(e(t,n,i))return r=n,!1})),r}function Re(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function Oe(t,e,n){return e==e?function(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):Re(t,Pe,n)}function Me(t,e,n,r){for(var i=n-1,o=t.length;++i<o;)if(r(t[i],e))return i;return-1}function Pe(t){return t!=t}function Ge(t,e){var n=null==t?0:t.length;return n?Be(t,e)/n:h}function Le(t){return function(e){return null==e?i:e[t]}}function Ue(t){return function(e){return null==t?i:t[e]}}function Fe(t,e,n,r,i){return i(t,(function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)})),n}function Be(t,e){for(var n,r=-1,o=t.length;++r<o;){var a=e(t[r]);a!==i&&(n=n===i?a:n+a)}return n}function ze(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function je(t){return t?t.slice(0,un(t)+1).replace(rt,""):t}function We(t){return function(e){return t(e)}}function Ve(t,e){return Ae(e,(function(e){return t[e]}))}function Xe(t,e){return t.has(e)}function He(t,e){for(var n=-1,r=t.length;++n<r&&Oe(e,t[n],0)>-1;);return n}function qe(t,e){for(var n=t.length;n--&&Oe(e,t[n],0)>-1;);return n}function Ye(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}var Ke=Ue({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),Ze=Ue({"&":"&","<":"<",">":">",'"':""","'":"'"});function $e(t){return"\\"+te[t]}function Je(t){return Yt.test(t)}function Qe(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function tn(t,e){return function(n){return t(e(n))}}function en(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n];a!==e&&a!==u||(t[n]=u,o[i++]=n)}return o}function nn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function rn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}function on(t){return Je(t)?function(t){for(var e=Ht.lastIndex=0;Ht.test(t);)++e;return e}(t):Ne(t)}function an(t){return Je(t)?function(t){return t.match(Ht)||[]}(t):function(t){return t.split("")}(t)}function un(t){for(var e=t.length;e--&&it.test(t.charAt(e)););return e}var sn=Ue({"&":"&","<":"<",">":">",""":'"',"'":"'"}),cn=function t(e){var n,r=(e=null==e?oe:cn.defaults(oe.Object(),e,cn.pick(oe,Zt))).Array,it=e.Date,xt=e.Error,wt=e.Function,Et=e.Math,St=e.Object,At=e.RegExp,Tt=e.String,It=e.TypeError,Ct=r.prototype,Dt=wt.prototype,Nt=St.prototype,kt=e["__core-js_shared__"],Rt=Dt.toString,Ot=Nt.hasOwnProperty,Mt=0,Pt=(n=/[^.]+$/.exec(kt&&kt.keys&&kt.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Gt=Nt.toString,Lt=Rt.call(St),Ut=oe._,Ft=At("^"+Rt.call(Ot).replace(et,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Bt=se?e.Buffer:i,zt=e.Symbol,jt=e.Uint8Array,Wt=Bt?Bt.allocUnsafe:i,Ht=tn(St.getPrototypeOf,St),Yt=St.create,te=Nt.propertyIsEnumerable,re=Ct.splice,ie=zt?zt.isConcatSpreadable:i,ae=zt?zt.iterator:i,ue=zt?zt.toStringTag:i,ce=function(){try{var t=co(St,"defineProperty");return t({},"",{}),t}catch(t){}}(),fe=e.clearTimeout!==oe.clearTimeout&&e.clearTimeout,Ne=it&&it.now!==oe.Date.now&&it.now,Ue=e.setTimeout!==oe.setTimeout&&e.setTimeout,fn=Et.ceil,ln=Et.floor,hn=St.getOwnPropertySymbols,dn=Bt?Bt.isBuffer:i,pn=e.isFinite,vn=Ct.join,gn=tn(St.keys,St),yn=Et.max,mn=Et.min,bn=it.now,_n=e.parseInt,xn=Et.random,wn=Ct.reverse,En=co(e,"DataView"),Sn=co(e,"Map"),An=co(e,"Promise"),Tn=co(e,"Set"),In=co(e,"WeakMap"),Cn=co(St,"create"),Dn=In&&new In,Nn={},kn=Fo(En),Rn=Fo(Sn),On=Fo(An),Mn=Fo(Tn),Pn=Fo(In),Gn=zt?zt.prototype:i,Ln=Gn?Gn.valueOf:i,Un=Gn?Gn.toString:i;function Fn(t){if(nu(t)&&!Xa(t)&&!(t instanceof Wn)){if(t instanceof jn)return t;if(Ot.call(t,"__wrapped__"))return Bo(t)}return new jn(t)}var Bn=function(){function t(){}return function(e){if(!eu(e))return{};if(Yt)return Yt(e);t.prototype=e;var n=new t;return t.prototype=i,n}}();function zn(){}function jn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=i}function Wn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Vn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Xn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Hn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function qn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Hn;++e<n;)this.add(t[e])}function Yn(t){var e=this.__data__=new Xn(t);this.size=e.size}function Kn(t,e){var n=Xa(t),r=!n&&Va(t),i=!n&&!r&&Ka(t),o=!n&&!r&&!i&&fu(t),a=n||r||i||o,u=a?ze(t.length,Tt):[],s=u.length;for(var c in t)!e&&!Ot.call(t,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||yo(c,s))||u.push(c);return u}function Zn(t){var e=t.length;return e?t[Hr(0,e-1)]:i}function $n(t,e){return Mo(Ii(t),ar(e,0,t.length))}function Jn(t){return Mo(Ii(t))}function Qn(t,e,n){(n!==i&&!za(t[e],n)||n===i&&!(e in t))&&ir(t,e,n)}function tr(t,e,n){var r=t[e];Ot.call(t,e)&&za(r,n)&&(n!==i||e in t)||ir(t,e,n)}function er(t,e){for(var n=t.length;n--;)if(za(t[n][0],e))return n;return-1}function nr(t,e,n,r){return lr(t,(function(t,i,o){e(r,t,n(t),o)})),r}function rr(t,e){return t&&Ci(e,Ru(e),t)}function ir(t,e,n){"__proto__"==e&&ce?ce(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function or(t,e){for(var n=-1,o=e.length,a=r(o),u=null==t;++n<o;)a[n]=u?i:Iu(t,e[n]);return a}function ar(t,e,n){return t==t&&(n!==i&&(t=t<=n?t:n),e!==i&&(t=t>=e?t:e)),t}function ur(t,e,n,r,o,a){var u,s=1&e,c=2&e,f=4&e;if(n&&(u=o?n(t,r,o,a):n(t)),u!==i)return u;if(!eu(t))return t;var l=Xa(t);if(l){if(u=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Ot.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!s)return Ii(t,u)}else{var h=ho(t),d=h==_||h==x;if(Ka(t))return xi(t,s);if(h==S||h==v||d&&!o){if(u=c||d?{}:vo(t),!s)return c?function(t,e){return Ci(t,lo(t),e)}(t,function(t,e){return t&&Ci(e,Ou(e),t)}(u,t)):function(t,e){return Ci(t,fo(t),e)}(t,rr(u,t))}else{if(!Qt[h])return o?t:{};u=function(t,e,n){var r,i=t.constructor;switch(e){case k:return wi(t);case y:case m:return new i(+t);case R:return function(t,e){var n=e?wi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case O:case M:case P:case G:case L:case U:case F:case B:case z:return Ei(t,n);case w:case I:return new i;case E:case C:return new i(t);case T:return function(t){var e=new t.constructor(t.source,ht.exec(t));return e.lastIndex=t.lastIndex,e}(t);case D:return r=t,Ln?St(Ln.call(r)):{}}}(t,h,s)}}a||(a=new Yn);var p=a.get(t);if(p)return p;a.set(t,u),uu(t)?t.forEach((function(r){u.add(ur(r,e,n,r,t,a))})):ru(t)&&t.forEach((function(r,i){u.set(i,ur(r,e,n,i,t,a))}));var g=l?i:(f?c?no:eo:c?Ou:Ru)(t);return be(g||t,(function(r,i){g&&(r=t[i=r]),tr(u,i,ur(r,e,n,i,t,a))})),u}function sr(t,e,n){var r=n.length;if(null==t)return!r;for(t=St(t);r--;){var o=n[r],a=e[o],u=t[o];if(u===i&&!(o in t)||!a(u))return!1}return!0}function cr(t,e,n){if("function"!=typeof t)throw new It(o);return No((function(){t.apply(i,n)}),e)}function fr(t,e,n,r){var i=-1,o=Ee,a=!0,u=t.length,s=[],c=e.length;if(!u)return s;n&&(e=Ae(e,We(n))),r?(o=Se,a=!1):e.length>=200&&(o=Xe,a=!1,e=new qn(e));t:for(;++i<u;){var f=t[i],l=null==n?f:n(f);if(f=r||0!==f?f:0,a&&l==l){for(var h=c;h--;)if(e[h]===l)continue t;s.push(f)}else o(e,l,r)||s.push(f)}return s}Fn.templateSettings={escape:K,evaluate:Z,interpolate:$,variable:"",imports:{_:Fn}},Fn.prototype=zn.prototype,Fn.prototype.constructor=Fn,jn.prototype=Bn(zn.prototype),jn.prototype.constructor=jn,Wn.prototype=Bn(zn.prototype),Wn.prototype.constructor=Wn,Vn.prototype.clear=function(){this.__data__=Cn?Cn(null):{},this.size=0},Vn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Vn.prototype.get=function(t){var e=this.__data__;if(Cn){var n=e[t];return n===a?i:n}return Ot.call(e,t)?e[t]:i},Vn.prototype.has=function(t){var e=this.__data__;return Cn?e[t]!==i:Ot.call(e,t)},Vn.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Cn&&e===i?a:e,this},Xn.prototype.clear=function(){this.__data__=[],this.size=0},Xn.prototype.delete=function(t){var e=this.__data__,n=er(e,t);return!(n<0||(n==e.length-1?e.pop():re.call(e,n,1),--this.size,0))},Xn.prototype.get=function(t){var e=this.__data__,n=er(e,t);return n<0?i:e[n][1]},Xn.prototype.has=function(t){return er(this.__data__,t)>-1},Xn.prototype.set=function(t,e){var n=this.__data__,r=er(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Hn.prototype.clear=function(){this.size=0,this.__data__={hash:new Vn,map:new(Sn||Xn),string:new Vn}},Hn.prototype.delete=function(t){var e=uo(this,t).delete(t);return this.size-=e?1:0,e},Hn.prototype.get=function(t){return uo(this,t).get(t)},Hn.prototype.has=function(t){return uo(this,t).has(t)},Hn.prototype.set=function(t,e){var n=uo(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},qn.prototype.add=qn.prototype.push=function(t){return this.__data__.set(t,a),this},qn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.clear=function(){this.__data__=new Xn,this.size=0},Yn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Yn.prototype.get=function(t){return this.__data__.get(t)},Yn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Xn){var r=n.__data__;if(!Sn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Hn(r)}return n.set(t,e),this.size=n.size,this};var lr=ki(br),hr=ki(_r,!0);function dr(t,e){var n=!0;return lr(t,(function(t,r,i){return n=!!e(t,r,i)})),n}function pr(t,e,n){for(var r=-1,o=t.length;++r<o;){var a=t[r],u=e(a);if(null!=u&&(s===i?u==u&&!cu(u):n(u,s)))var s=u,c=a}return c}function vr(t,e){var n=[];return lr(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}function gr(t,e,n,r,i){var o=-1,a=t.length;for(n||(n=go),i||(i=[]);++o<a;){var u=t[o];e>0&&n(u)?e>1?gr(u,e-1,n,r,i):Te(i,u):r||(i[i.length]=u)}return i}var yr=Ri(),mr=Ri(!0);function br(t,e){return t&&yr(t,e,Ru)}function _r(t,e){return t&&mr(t,e,Ru)}function xr(t,e){return we(e,(function(e){return Ja(t[e])}))}function wr(t,e){for(var n=0,r=(e=yi(e,t)).length;null!=t&&n<r;)t=t[Uo(e[n++])];return n&&n==r?t:i}function Er(t,e,n){var r=e(t);return Xa(t)?r:Te(r,n(t))}function Sr(t){return null==t?t===i?"[object Undefined]":"[object Null]":ue&&ue in St(t)?function(t){var e=Ot.call(t,ue),n=t[ue];try{t[ue]=i;var r=!0}catch(t){}var o=Gt.call(t);return r&&(e?t[ue]=n:delete t[ue]),o}(t):function(t){return Gt.call(t)}(t)}function Ar(t,e){return t>e}function Tr(t,e){return null!=t&&Ot.call(t,e)}function Ir(t,e){return null!=t&&e in St(t)}function Cr(t,e,n){for(var o=n?Se:Ee,a=t[0].length,u=t.length,s=u,c=r(u),f=1/0,l=[];s--;){var h=t[s];s&&e&&(h=Ae(h,We(e))),f=mn(h.length,f),c[s]=!n&&(e||a>=120&&h.length>=120)?new qn(s&&h):i}h=t[0];var d=-1,p=c[0];t:for(;++d<a&&l.length<f;){var v=h[d],g=e?e(v):v;if(v=n||0!==v?v:0,!(p?Xe(p,g):o(l,g,n))){for(s=u;--s;){var y=c[s];if(!(y?Xe(y,g):o(t[s],g,n)))continue t}p&&p.push(g),l.push(v)}}return l}function Dr(t,e,n){var r=null==(t=To(t,e=yi(e,t)))?t:t[Uo($o(e))];return null==r?i:ye(r,t,n)}function Nr(t){return nu(t)&&Sr(t)==v}function kr(t,e,n,r,o){return t===e||(null==t||null==e||!nu(t)&&!nu(e)?t!=t&&e!=e:function(t,e,n,r,o,a){var u=Xa(t),s=Xa(e),c=u?g:ho(t),f=s?g:ho(e),l=(c=c==v?S:c)==S,h=(f=f==v?S:f)==S,d=c==f;if(d&&Ka(t)){if(!Ka(e))return!1;u=!0,l=!1}if(d&&!l)return a||(a=new Yn),u||fu(t)?Qi(t,e,n,r,o,a):function(t,e,n,r,i,o,a){switch(n){case R:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case k:return!(t.byteLength!=e.byteLength||!o(new jt(t),new jt(e)));case y:case m:case E:return za(+t,+e);case b:return t.name==e.name&&t.message==e.message;case T:case C:return t==e+"";case w:var u=Qe;case I:var s=1&r;if(u||(u=nn),t.size!=e.size&&!s)return!1;var c=a.get(t);if(c)return c==e;r|=2,a.set(t,e);var f=Qi(u(t),u(e),r,i,o,a);return a.delete(t),f;case D:if(Ln)return Ln.call(t)==Ln.call(e)}return!1}(t,e,c,n,r,o,a);if(!(1&n)){var p=l&&Ot.call(t,"__wrapped__"),_=h&&Ot.call(e,"__wrapped__");if(p||_){var x=p?t.value():t,A=_?e.value():e;return a||(a=new Yn),o(x,A,n,r,a)}}return!!d&&(a||(a=new Yn),function(t,e,n,r,o,a){var u=1&n,s=eo(t),c=s.length;if(c!=eo(e).length&&!u)return!1;for(var f=c;f--;){var l=s[f];if(!(u?l in e:Ot.call(e,l)))return!1}var h=a.get(t),d=a.get(e);if(h&&d)return h==e&&d==t;var p=!0;a.set(t,e),a.set(e,t);for(var v=u;++f<c;){var g=t[l=s[f]],y=e[l];if(r)var m=u?r(y,g,l,e,t,a):r(g,y,l,t,e,a);if(!(m===i?g===y||o(g,y,n,r,a):m)){p=!1;break}v||(v="constructor"==l)}if(p&&!v){var b=t.constructor,_=e.constructor;b==_||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _||(p=!1)}return a.delete(t),a.delete(e),p}(t,e,n,r,o,a))}(t,e,n,r,kr,o))}function Rr(t,e,n,r){var o=n.length,a=o,u=!r;if(null==t)return!a;for(t=St(t);o--;){var s=n[o];if(u&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++o<a;){var c=(s=n[o])[0],f=t[c],l=s[1];if(u&&s[2]){if(f===i&&!(c in t))return!1}else{var h=new Yn;if(r)var d=r(f,l,c,t,e,h);if(!(d===i?kr(l,f,3,r,h):d))return!1}}return!0}function Or(t){return!(!eu(t)||(e=t,Pt&&Pt in e))&&(Ja(t)?Ft:vt).test(Fo(t));var e}function Mr(t){return"function"==typeof t?t:null==t?is:"object"==typeof t?Xa(t)?Fr(t[0],t[1]):Ur(t):ds(t)}function Pr(t){if(!wo(t))return gn(t);var e=[];for(var n in St(t))Ot.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Gr(t,e){return t<e}function Lr(t,e){var n=-1,i=qa(t)?r(t.length):[];return lr(t,(function(t,r,o){i[++n]=e(t,r,o)})),i}function Ur(t){var e=so(t);return 1==e.length&&e[0][2]?So(e[0][0],e[0][1]):function(n){return n===t||Rr(n,t,e)}}function Fr(t,e){return bo(t)&&Eo(e)?So(Uo(t),e):function(n){var r=Iu(n,t);return r===i&&r===e?Cu(n,t):kr(e,r,3)}}function Br(t,e,n,r,o){t!==e&&yr(e,(function(a,u){if(o||(o=new Yn),eu(a))!function(t,e,n,r,o,a,u){var s=Co(t,n),c=Co(e,n),f=u.get(c);if(f)Qn(t,n,f);else{var l=a?a(s,c,n+"",t,e,u):i,h=l===i;if(h){var d=Xa(c),p=!d&&Ka(c),v=!d&&!p&&fu(c);l=c,d||p||v?Xa(s)?l=s:Ya(s)?l=Ii(s):p?(h=!1,l=xi(c,!0)):v?(h=!1,l=Ei(c,!0)):l=[]:ou(c)||Va(c)?(l=s,Va(s)?l=mu(s):eu(s)&&!Ja(s)||(l=vo(c))):h=!1}h&&(u.set(c,l),o(l,c,r,a,u),u.delete(c)),Qn(t,n,l)}}(t,e,u,n,Br,r,o);else{var s=r?r(Co(t,u),a,u+"",t,e,o):i;s===i&&(s=a),Qn(t,u,s)}}),Ou)}function zr(t,e){var n=t.length;if(n)return yo(e+=e<0?n:0,n)?t[e]:i}function jr(t,e,n){e=e.length?Ae(e,(function(t){return Xa(t)?function(e){return wr(e,1===t.length?t[0]:t)}:t})):[is];var r=-1;e=Ae(e,We(ao()));var i=Lr(t,(function(t,n,i){var o=Ae(e,(function(e){return e(t)}));return{criteria:o,index:++r,value:t}}));return function(t,e){var r=t.length;for(t.sort((function(t,e){return function(t,e,n){for(var r=-1,i=t.criteria,o=e.criteria,a=i.length,u=n.length;++r<a;){var s=Si(i[r],o[r]);if(s)return r>=u?s:s*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}));r--;)t[r]=t[r].value;return t}(i)}function Wr(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var a=e[r],u=wr(t,a);n(u,a)&&$r(o,yi(a,t),u)}return o}function Vr(t,e,n,r){var i=r?Me:Oe,o=-1,a=e.length,u=t;for(t===e&&(e=Ii(e)),n&&(u=Ae(t,We(n)));++o<a;)for(var s=0,c=e[o],f=n?n(c):c;(s=i(u,f,s,r))>-1;)u!==t&&re.call(u,s,1),re.call(t,s,1);return t}function Xr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;yo(i)?re.call(t,i,1):ci(t,i)}}return t}function Hr(t,e){return t+ln(xn()*(e-t+1))}function qr(t,e){var n="";if(!t||e<1||e>l)return n;do{e%2&&(n+=t),(e=ln(e/2))&&(t+=t)}while(e);return n}function Yr(t,e){return ko(Ao(t,e,is),t+"")}function Kr(t){return Zn(zu(t))}function Zr(t,e){var n=zu(t);return Mo(n,ar(e,0,n.length))}function $r(t,e,n,r){if(!eu(t))return t;for(var o=-1,a=(e=yi(e,t)).length,u=a-1,s=t;null!=s&&++o<a;){var c=Uo(e[o]),f=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return t;if(o!=u){var l=s[c];(f=r?r(l,c,s):i)===i&&(f=eu(l)?l:yo(e[o+1])?[]:{})}tr(s,c,f),s=s[c]}return t}var Jr=Dn?function(t,e){return Dn.set(t,e),t}:is,Qr=ce?function(t,e){return ce(t,"toString",{configurable:!0,enumerable:!1,value:es(e),writable:!0})}:is;function ti(t){return Mo(zu(t))}function ei(t,e,n){var i=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var a=r(o);++i<o;)a[i]=t[i+e];return a}function ni(t,e){var n;return lr(t,(function(t,r,i){return!(n=e(t,r,i))})),!!n}function ri(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e==e&&i<=2147483647){for(;r<i;){var o=r+i>>>1,a=t[o];null!==a&&!cu(a)&&(n?a<=e:a<e)?r=o+1:i=o}return i}return ii(t,e,is,n)}function ii(t,e,n,r){var o=0,a=null==t?0:t.length;if(0===a)return 0;for(var u=(e=n(e))!=e,s=null===e,c=cu(e),f=e===i;o<a;){var l=ln((o+a)/2),h=n(t[l]),d=h!==i,p=null===h,v=h==h,g=cu(h);if(u)var y=r||v;else y=f?v&&(r||d):s?v&&d&&(r||!p):c?v&&d&&!p&&(r||!g):!p&&!g&&(r?h<=e:h<e);y?o=l+1:a=l}return mn(a,4294967294)}function oi(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n],u=e?e(a):a;if(!n||!za(u,s)){var s=u;o[i++]=0===a?0:a}}return o}function ai(t){return"number"==typeof t?t:cu(t)?h:+t}function ui(t){if("string"==typeof t)return t;if(Xa(t))return Ae(t,ui)+"";if(cu(t))return Un?Un.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function si(t,e,n){var r=-1,i=Ee,o=t.length,a=!0,u=[],s=u;if(n)a=!1,i=Se;else if(o>=200){var c=e?null:qi(t);if(c)return nn(c);a=!1,i=Xe,s=new qn}else s=e?[]:u;t:for(;++r<o;){var f=t[r],l=e?e(f):f;if(f=n||0!==f?f:0,a&&l==l){for(var h=s.length;h--;)if(s[h]===l)continue t;e&&s.push(l),u.push(f)}else i(s,l,n)||(s!==u&&s.push(l),u.push(f))}return u}function ci(t,e){return null==(t=To(t,e=yi(e,t)))||delete t[Uo($o(e))]}function fi(t,e,n,r){return $r(t,e,n(wr(t,e)),r)}function li(t,e,n,r){for(var i=t.length,o=r?i:-1;(r?o--:++o<i)&&e(t[o],o,t););return n?ei(t,r?0:o,r?o+1:i):ei(t,r?o+1:0,r?i:o)}function hi(t,e){var n=t;return n instanceof Wn&&(n=n.value()),Ie(e,(function(t,e){return e.func.apply(e.thisArg,Te([t],e.args))}),n)}function di(t,e,n){var i=t.length;if(i<2)return i?si(t[0]):[];for(var o=-1,a=r(i);++o<i;)for(var u=t[o],s=-1;++s<i;)s!=o&&(a[o]=fr(a[o]||u,t[s],e,n));return si(gr(a,1),e,n)}function pi(t,e,n){for(var r=-1,o=t.length,a=e.length,u={};++r<o;){var s=r<a?e[r]:i;n(u,t[r],s)}return u}function vi(t){return Ya(t)?t:[]}function gi(t){return"function"==typeof t?t:is}function yi(t,e){return Xa(t)?t:bo(t,e)?[t]:Lo(bu(t))}var mi=Yr;function bi(t,e,n){var r=t.length;return n=n===i?r:n,!e&&n>=r?t:ei(t,e,n)}var _i=fe||function(t){return oe.clearTimeout(t)};function xi(t,e){if(e)return t.slice();var n=t.length,r=Wt?Wt(n):new t.constructor(n);return t.copy(r),r}function wi(t){var e=new t.constructor(t.byteLength);return new jt(e).set(new jt(t)),e}function Ei(t,e){var n=e?wi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Si(t,e){if(t!==e){var n=t!==i,r=null===t,o=t==t,a=cu(t),u=e!==i,s=null===e,c=e==e,f=cu(e);if(!s&&!f&&!a&&t>e||a&&u&&c&&!s&&!f||r&&u&&c||!n&&c||!o)return 1;if(!r&&!a&&!f&&t<e||f&&n&&o&&!r&&!a||s&&n&&o||!u&&o||!c)return-1}return 0}function Ai(t,e,n,i){for(var o=-1,a=t.length,u=n.length,s=-1,c=e.length,f=yn(a-u,0),l=r(c+f),h=!i;++s<c;)l[s]=e[s];for(;++o<u;)(h||o<a)&&(l[n[o]]=t[o]);for(;f--;)l[s++]=t[o++];return l}function Ti(t,e,n,i){for(var o=-1,a=t.length,u=-1,s=n.length,c=-1,f=e.length,l=yn(a-s,0),h=r(l+f),d=!i;++o<l;)h[o]=t[o];for(var p=o;++c<f;)h[p+c]=e[c];for(;++u<s;)(d||o<a)&&(h[p+n[u]]=t[o++]);return h}function Ii(t,e){var n=-1,i=t.length;for(e||(e=r(i));++n<i;)e[n]=t[n];return e}function Ci(t,e,n,r){var o=!n;n||(n={});for(var a=-1,u=e.length;++a<u;){var s=e[a],c=r?r(n[s],t[s],s,n,t):i;c===i&&(c=t[s]),o?ir(n,s,c):tr(n,s,c)}return n}function Di(t,e){return function(n,r){var i=Xa(n)?me:nr,o=e?e():{};return i(n,t,ao(r,2),o)}}function Ni(t){return Yr((function(e,n){var r=-1,o=n.length,a=o>1?n[o-1]:i,u=o>2?n[2]:i;for(a=t.length>3&&"function"==typeof a?(o--,a):i,u&&mo(n[0],n[1],u)&&(a=o<3?i:a,o=1),e=St(e);++r<o;){var s=n[r];s&&t(e,s,r,a)}return e}))}function ki(t,e){return function(n,r){if(null==n)return n;if(!qa(n))return t(n,r);for(var i=n.length,o=e?i:-1,a=St(n);(e?o--:++o<i)&&!1!==r(a[o],o,a););return n}}function Ri(t){return function(e,n,r){for(var i=-1,o=St(e),a=r(e),u=a.length;u--;){var s=a[t?u:++i];if(!1===n(o[s],s,o))break}return e}}function Oi(t){return function(e){var n=Je(e=bu(e))?an(e):i,r=n?n[0]:e.charAt(0),o=n?bi(n,1).join(""):e.slice(1);return r[t]()+o}}function Mi(t){return function(e){return Ie(Ju(Vu(e).replace(Vt,"")),t,"")}}function Pi(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=Bn(t.prototype),r=t.apply(n,e);return eu(r)?r:n}}function Gi(t){return function(e,n,r){var o=St(e);if(!qa(e)){var a=ao(n,3);e=Ru(e),n=function(t){return a(o[t],t,o)}}var u=t(e,n,r);return u>-1?o[a?e[u]:u]:i}}function Li(t){return to((function(e){var n=e.length,r=n,a=jn.prototype.thru;for(t&&e.reverse();r--;){var u=e[r];if("function"!=typeof u)throw new It(o);if(a&&!s&&"wrapper"==io(u))var s=new jn([],!0)}for(r=s?r:n;++r<n;){var c=io(u=e[r]),f="wrapper"==c?ro(u):i;s=f&&_o(f[0])&&424==f[1]&&!f[4].length&&1==f[9]?s[io(f[0])].apply(s,f[3]):1==u.length&&_o(u)?s[c]():s.thru(u)}return function(){var t=arguments,r=t[0];if(s&&1==t.length&&Xa(r))return s.plant(r).value();for(var i=0,o=n?e[i].apply(this,t):r;++i<n;)o=e[i].call(this,o);return o}}))}function Ui(t,e,n,o,a,u,s,f,l,h){var d=e&c,p=1&e,v=2&e,g=24&e,y=512&e,m=v?i:Pi(t);return function i(){for(var c=arguments.length,b=r(c),_=c;_--;)b[_]=arguments[_];if(g)var x=oo(i),w=Ye(b,x);if(o&&(b=Ai(b,o,a,g)),u&&(b=Ti(b,u,s,g)),c-=w,g&&c<h){var E=en(b,x);return Xi(t,e,Ui,i.placeholder,n,b,E,f,l,h-c)}var S=p?n:this,A=v?S[t]:t;return c=b.length,f?b=Io(b,f):y&&c>1&&b.reverse(),d&&l<c&&(b.length=l),this&&this!==oe&&this instanceof i&&(A=m||Pi(A)),A.apply(S,b)}}function Fi(t,e){return function(n,r){return function(t,e,n,r){return br(t,(function(t,i,o){e(r,n(t),i,o)})),r}(n,t,e(r),{})}}function Bi(t,e){return function(n,r){var o;if(n===i&&r===i)return e;if(n!==i&&(o=n),r!==i){if(o===i)return r;"string"==typeof n||"string"==typeof r?(n=ui(n),r=ui(r)):(n=ai(n),r=ai(r)),o=t(n,r)}return o}}function zi(t){return to((function(e){return e=Ae(e,We(ao())),Yr((function(n){var r=this;return t(e,(function(t){return ye(t,r,n)}))}))}))}function ji(t,e){var n=(e=e===i?" ":ui(e)).length;if(n<2)return n?qr(e,t):e;var r=qr(e,fn(t/on(e)));return Je(e)?bi(an(r),0,t).join(""):r.slice(0,t)}function Wi(t){return function(e,n,o){return o&&"number"!=typeof o&&mo(e,n,o)&&(n=o=i),e=pu(e),n===i?(n=e,e=0):n=pu(n),function(t,e,n,i){for(var o=-1,a=yn(fn((e-t)/(n||1)),0),u=r(a);a--;)u[i?a:++o]=t,t+=n;return u}(e,n,o=o===i?e<n?1:-1:pu(o),t)}}function Vi(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=yu(e),n=yu(n)),t(e,n)}}function Xi(t,e,n,r,o,a,u,c,f,l){var h=8&e;e|=h?s:64,4&(e&=~(h?64:s))||(e&=-4);var d=[t,e,o,h?a:i,h?u:i,h?i:a,h?i:u,c,f,l],p=n.apply(i,d);return _o(t)&&Do(p,d),p.placeholder=r,Ro(p,t,e)}function Hi(t){var e=Et[t];return function(t,n){if(t=yu(t),(n=null==n?0:mn(vu(n),292))&&pn(t)){var r=(bu(t)+"e").split("e");return+((r=(bu(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var qi=Tn&&1/nn(new Tn([,-0]))[1]==f?function(t){return new Tn(t)}:cs;function Yi(t){return function(e){var n=ho(e);return n==w?Qe(e):n==I?rn(e):function(t,e){return Ae(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Ki(t,e,n,a,f,l,h,d){var p=2&e;if(!p&&"function"!=typeof t)throw new It(o);var v=a?a.length:0;if(v||(e&=-97,a=f=i),h=h===i?h:yn(vu(h),0),d=d===i?d:vu(d),v-=f?f.length:0,64&e){var g=a,y=f;a=f=i}var m=p?i:ro(t),b=[t,e,n,a,f,g,y,l,h,d];if(m&&function(t,e){var n=t[1],r=e[1],i=n|r,o=i<131,a=r==c&&8==n||r==c&&256==n&&t[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==n;if(!o&&!a)return t;1&r&&(t[2]=e[2],i|=1&n?0:4);var s=e[3];if(s){var f=t[3];t[3]=f?Ai(f,s,e[4]):s,t[4]=f?en(t[3],u):e[4]}(s=e[5])&&(f=t[5],t[5]=f?Ti(f,s,e[6]):s,t[6]=f?en(t[5],u):e[6]),(s=e[7])&&(t[7]=s),r&c&&(t[8]=null==t[8]?e[8]:mn(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i}(b,m),t=b[0],e=b[1],n=b[2],a=b[3],f=b[4],!(d=b[9]=b[9]===i?p?0:t.length:yn(b[9]-v,0))&&24&e&&(e&=-25),e&&1!=e)_=8==e||16==e?function(t,e,n){var o=Pi(t);return function a(){for(var u=arguments.length,s=r(u),c=u,f=oo(a);c--;)s[c]=arguments[c];var l=u<3&&s[0]!==f&&s[u-1]!==f?[]:en(s,f);return(u-=l.length)<n?Xi(t,e,Ui,a.placeholder,i,s,l,i,i,n-u):ye(this&&this!==oe&&this instanceof a?o:t,this,s)}}(t,e,d):e!=s&&33!=e||f.length?Ui.apply(i,b):function(t,e,n,i){var o=1&e,a=Pi(t);return function e(){for(var u=-1,s=arguments.length,c=-1,f=i.length,l=r(f+s),h=this&&this!==oe&&this instanceof e?a:t;++c<f;)l[c]=i[c];for(;s--;)l[c++]=arguments[++u];return ye(h,o?n:this,l)}}(t,e,n,a);else var _=function(t,e,n){var r=1&e,i=Pi(t);return function e(){return(this&&this!==oe&&this instanceof e?i:t).apply(r?n:this,arguments)}}(t,e,n);return Ro((m?Jr:Do)(_,b),t,e)}function Zi(t,e,n,r){return t===i||za(t,Nt[n])&&!Ot.call(r,n)?e:t}function $i(t,e,n,r,o,a){return eu(t)&&eu(e)&&(a.set(e,t),Br(t,e,i,$i,a),a.delete(e)),t}function Ji(t){return ou(t)?i:t}function Qi(t,e,n,r,o,a){var u=1&n,s=t.length,c=e.length;if(s!=c&&!(u&&c>s))return!1;var f=a.get(t),l=a.get(e);if(f&&l)return f==e&&l==t;var h=-1,d=!0,p=2&n?new qn:i;for(a.set(t,e),a.set(e,t);++h<s;){var v=t[h],g=e[h];if(r)var y=u?r(g,v,h,e,t,a):r(v,g,h,t,e,a);if(y!==i){if(y)continue;d=!1;break}if(p){if(!De(e,(function(t,e){if(!Xe(p,e)&&(v===t||o(v,t,n,r,a)))return p.push(e)}))){d=!1;break}}else if(v!==g&&!o(v,g,n,r,a)){d=!1;break}}return a.delete(t),a.delete(e),d}function to(t){return ko(Ao(t,i,Ho),t+"")}function eo(t){return Er(t,Ru,fo)}function no(t){return Er(t,Ou,lo)}var ro=Dn?function(t){return Dn.get(t)}:cs;function io(t){for(var e=t.name+"",n=Nn[e],r=Ot.call(Nn,e)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==t)return i.name}return e}function oo(t){return(Ot.call(Fn,"placeholder")?Fn:t).placeholder}function ao(){var t=Fn.iteratee||os;return t=t===os?Mr:t,arguments.length?t(arguments[0],arguments[1]):t}function uo(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function so(t){for(var e=Ru(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,Eo(i)]}return e}function co(t,e){var n=function(t,e){return null==t?i:t[e]}(t,e);return Or(n)?n:i}var fo=hn?function(t){return null==t?[]:(t=St(t),we(hn(t),(function(e){return te.call(t,e)})))}:gs,lo=hn?function(t){for(var e=[];t;)Te(e,fo(t)),t=Ht(t);return e}:gs,ho=Sr;function po(t,e,n){for(var r=-1,i=(e=yi(e,t)).length,o=!1;++r<i;){var a=Uo(e[r]);if(!(o=null!=t&&n(t,a)))break;t=t[a]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&tu(i)&&yo(a,i)&&(Xa(t)||Va(t))}function vo(t){return"function"!=typeof t.constructor||wo(t)?{}:Bn(Ht(t))}function go(t){return Xa(t)||Va(t)||!!(ie&&t&&t[ie])}function yo(t,e){var n=typeof t;return!!(e=null==e?l:e)&&("number"==n||"symbol"!=n&&yt.test(t))&&t>-1&&t%1==0&&t<e}function mo(t,e,n){if(!eu(n))return!1;var r=typeof e;return!!("number"==r?qa(n)&&yo(e,n.length):"string"==r&&e in n)&&za(n[e],t)}function bo(t,e){if(Xa(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!cu(t))||Q.test(t)||!J.test(t)||null!=e&&t in St(e)}function _o(t){var e=io(t),n=Fn[e];if("function"!=typeof n||!(e in Wn.prototype))return!1;if(t===n)return!0;var r=ro(n);return!!r&&t===r[0]}(En&&ho(new En(new ArrayBuffer(1)))!=R||Sn&&ho(new Sn)!=w||An&&ho(An.resolve())!=A||Tn&&ho(new Tn)!=I||In&&ho(new In)!=N)&&(ho=function(t){var e=Sr(t),n=e==S?t.constructor:i,r=n?Fo(n):"";if(r)switch(r){case kn:return R;case Rn:return w;case On:return A;case Mn:return I;case Pn:return N}return e});var xo=kt?Ja:ys;function wo(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Nt)}function Eo(t){return t==t&&!eu(t)}function So(t,e){return function(n){return null!=n&&n[t]===e&&(e!==i||t in St(n))}}function Ao(t,e,n){return e=yn(e===i?t.length-1:e,0),function(){for(var i=arguments,o=-1,a=yn(i.length-e,0),u=r(a);++o<a;)u[o]=i[e+o];o=-1;for(var s=r(e+1);++o<e;)s[o]=i[o];return s[e]=n(u),ye(t,this,s)}}function To(t,e){return e.length<2?t:wr(t,ei(e,0,-1))}function Io(t,e){for(var n=t.length,r=mn(e.length,n),o=Ii(t);r--;){var a=e[r];t[r]=yo(a,n)?o[a]:i}return t}function Co(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Do=Oo(Jr),No=Ue||function(t,e){return oe.setTimeout(t,e)},ko=Oo(Qr);function Ro(t,e,n){var r=e+"";return ko(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(ot,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return be(p,(function(n){var r="_."+n[0];e&n[1]&&!Ee(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(at);return e?e[1].split(ut):[]}(r),n)))}function Oo(t){var e=0,n=0;return function(){var r=bn(),o=16-(r-n);if(n=r,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(i,arguments)}}function Mo(t,e){var n=-1,r=t.length,o=r-1;for(e=e===i?r:e;++n<e;){var a=Hr(n,o),u=t[a];t[a]=t[n],t[n]=u}return t.length=e,t}var Po,Go,Lo=(Po=Pa((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(tt,(function(t,n,r,i){e.push(r?i.replace(ft,"$1"):n||t)})),e}),(function(t){return 500===Go.size&&Go.clear(),t})),Go=Po.cache,Po);function Uo(t){if("string"==typeof t||cu(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Fo(t){if(null!=t){try{return Rt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Bo(t){if(t instanceof Wn)return t.clone();var e=new jn(t.__wrapped__,t.__chain__);return e.__actions__=Ii(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var zo=Yr((function(t,e){return Ya(t)?fr(t,gr(e,1,Ya,!0)):[]})),jo=Yr((function(t,e){var n=$o(e);return Ya(n)&&(n=i),Ya(t)?fr(t,gr(e,1,Ya,!0),ao(n,2)):[]})),Wo=Yr((function(t,e){var n=$o(e);return Ya(n)&&(n=i),Ya(t)?fr(t,gr(e,1,Ya,!0),i,n):[]}));function Vo(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:vu(n);return i<0&&(i=yn(r+i,0)),Re(t,ao(e,3),i)}function Xo(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r-1;return n!==i&&(o=vu(n),o=n<0?yn(r+o,0):mn(o,r-1)),Re(t,ao(e,3),o,!0)}function Ho(t){return null!=t&&t.length?gr(t,1):[]}function qo(t){return t&&t.length?t[0]:i}var Yo=Yr((function(t){var e=Ae(t,vi);return e.length&&e[0]===t[0]?Cr(e):[]})),Ko=Yr((function(t){var e=$o(t),n=Ae(t,vi);return e===$o(n)?e=i:n.pop(),n.length&&n[0]===t[0]?Cr(n,ao(e,2)):[]})),Zo=Yr((function(t){var e=$o(t),n=Ae(t,vi);return(e="function"==typeof e?e:i)&&n.pop(),n.length&&n[0]===t[0]?Cr(n,i,e):[]}));function $o(t){var e=null==t?0:t.length;return e?t[e-1]:i}var Jo=Yr(Qo);function Qo(t,e){return t&&t.length&&e&&e.length?Vr(t,e):t}var ta=to((function(t,e){var n=null==t?0:t.length,r=or(t,e);return Xr(t,Ae(e,(function(t){return yo(t,n)?+t:t})).sort(Si)),r}));function ea(t){return null==t?t:wn.call(t)}var na=Yr((function(t){return si(gr(t,1,Ya,!0))})),ra=Yr((function(t){var e=$o(t);return Ya(e)&&(e=i),si(gr(t,1,Ya,!0),ao(e,2))})),ia=Yr((function(t){var e=$o(t);return e="function"==typeof e?e:i,si(gr(t,1,Ya,!0),i,e)}));function oa(t){if(!t||!t.length)return[];var e=0;return t=we(t,(function(t){if(Ya(t))return e=yn(t.length,e),!0})),ze(e,(function(e){return Ae(t,Le(e))}))}function aa(t,e){if(!t||!t.length)return[];var n=oa(t);return null==e?n:Ae(n,(function(t){return ye(e,i,t)}))}var ua=Yr((function(t,e){return Ya(t)?fr(t,e):[]})),sa=Yr((function(t){return di(we(t,Ya))})),ca=Yr((function(t){var e=$o(t);return Ya(e)&&(e=i),di(we(t,Ya),ao(e,2))})),fa=Yr((function(t){var e=$o(t);return e="function"==typeof e?e:i,di(we(t,Ya),i,e)})),la=Yr(oa),ha=Yr((function(t){var e=t.length,n=e>1?t[e-1]:i;return n="function"==typeof n?(t.pop(),n):i,aa(t,n)}));function da(t){var e=Fn(t);return e.__chain__=!0,e}function pa(t,e){return e(t)}var va=to((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,o=function(e){return or(e,t)};return!(e>1||this.__actions__.length)&&r instanceof Wn&&yo(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:pa,args:[o],thisArg:i}),new jn(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(i),t}))):this.thru(o)})),ga=Di((function(t,e,n){Ot.call(t,n)?++t[n]:ir(t,n,1)})),ya=Gi(Vo),ma=Gi(Xo);function ba(t,e){return(Xa(t)?be:lr)(t,ao(e,3))}function _a(t,e){return(Xa(t)?_e:hr)(t,ao(e,3))}var xa=Di((function(t,e,n){Ot.call(t,n)?t[n].push(e):ir(t,n,[e])})),wa=Yr((function(t,e,n){var i=-1,o="function"==typeof e,a=qa(t)?r(t.length):[];return lr(t,(function(t){a[++i]=o?ye(e,t,n):Dr(t,e,n)})),a})),Ea=Di((function(t,e,n){ir(t,n,e)}));function Sa(t,e){return(Xa(t)?Ae:Lr)(t,ao(e,3))}var Aa=Di((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]})),Ta=Yr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&mo(t,e[0],e[1])?e=[]:n>2&&mo(e[0],e[1],e[2])&&(e=[e[0]]),jr(t,gr(e,1),[])})),Ia=Ne||function(){return oe.Date.now()};function Ca(t,e,n){return e=n?i:e,e=t&&null==e?t.length:e,Ki(t,c,i,i,i,i,e)}function Da(t,e){var n;if("function"!=typeof e)throw new It(o);return t=vu(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=i),n}}var Na=Yr((function(t,e,n){var r=1;if(n.length){var i=en(n,oo(Na));r|=s}return Ki(t,r,e,n,i)})),ka=Yr((function(t,e,n){var r=3;if(n.length){var i=en(n,oo(ka));r|=s}return Ki(e,r,t,n,i)}));function Ra(t,e,n){var r,a,u,s,c,f,l=0,h=!1,d=!1,p=!0;if("function"!=typeof t)throw new It(o);function v(e){var n=r,o=a;return r=a=i,l=e,s=t.apply(o,n)}function g(t){return l=t,c=No(m,e),h?v(t):s}function y(t){var n=t-f;return f===i||n>=e||n<0||d&&t-l>=u}function m(){var t=Ia();if(y(t))return b(t);c=No(m,function(t){var n=e-(t-f);return d?mn(n,u-(t-l)):n}(t))}function b(t){return c=i,p&&r?v(t):(r=a=i,s)}function _(){var t=Ia(),n=y(t);if(r=arguments,a=this,f=t,n){if(c===i)return g(f);if(d)return _i(c),c=No(m,e),v(f)}return c===i&&(c=No(m,e)),s}return e=yu(e)||0,eu(n)&&(h=!!n.leading,u=(d="maxWait"in n)?yn(yu(n.maxWait)||0,e):u,p="trailing"in n?!!n.trailing:p),_.cancel=function(){c!==i&&_i(c),l=0,r=f=a=c=i},_.flush=function(){return c===i?s:b(Ia())},_}var Oa=Yr((function(t,e){return cr(t,1,e)})),Ma=Yr((function(t,e,n){return cr(t,yu(e)||0,n)}));function Pa(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new It(o);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Pa.Cache||Hn),n}function Ga(t){if("function"!=typeof t)throw new It(o);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Pa.Cache=Hn;var La=mi((function(t,e){var n=(e=1==e.length&&Xa(e[0])?Ae(e[0],We(ao())):Ae(gr(e,1),We(ao()))).length;return Yr((function(r){for(var i=-1,o=mn(r.length,n);++i<o;)r[i]=e[i].call(this,r[i]);return ye(t,this,r)}))})),Ua=Yr((function(t,e){var n=en(e,oo(Ua));return Ki(t,s,i,e,n)})),Fa=Yr((function(t,e){var n=en(e,oo(Fa));return Ki(t,64,i,e,n)})),Ba=to((function(t,e){return Ki(t,256,i,i,i,e)}));function za(t,e){return t===e||t!=t&&e!=e}var ja=Vi(Ar),Wa=Vi((function(t,e){return t>=e})),Va=Nr(function(){return arguments}())?Nr:function(t){return nu(t)&&Ot.call(t,"callee")&&!te.call(t,"callee")},Xa=r.isArray,Ha=le?We(le):function(t){return nu(t)&&Sr(t)==k};function qa(t){return null!=t&&tu(t.length)&&!Ja(t)}function Ya(t){return nu(t)&&qa(t)}var Ka=dn||ys,Za=he?We(he):function(t){return nu(t)&&Sr(t)==m};function $a(t){if(!nu(t))return!1;var e=Sr(t);return e==b||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!ou(t)}function Ja(t){if(!eu(t))return!1;var e=Sr(t);return e==_||e==x||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Qa(t){return"number"==typeof t&&t==vu(t)}function tu(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=l}function eu(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function nu(t){return null!=t&&"object"==typeof t}var ru=de?We(de):function(t){return nu(t)&&ho(t)==w};function iu(t){return"number"==typeof t||nu(t)&&Sr(t)==E}function ou(t){if(!nu(t)||Sr(t)!=S)return!1;var e=Ht(t);if(null===e)return!0;var n=Ot.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Rt.call(n)==Lt}var au=pe?We(pe):function(t){return nu(t)&&Sr(t)==T},uu=ve?We(ve):function(t){return nu(t)&&ho(t)==I};function su(t){return"string"==typeof t||!Xa(t)&&nu(t)&&Sr(t)==C}function cu(t){return"symbol"==typeof t||nu(t)&&Sr(t)==D}var fu=ge?We(ge):function(t){return nu(t)&&tu(t.length)&&!!Jt[Sr(t)]},lu=Vi(Gr),hu=Vi((function(t,e){return t<=e}));function du(t){if(!t)return[];if(qa(t))return su(t)?an(t):Ii(t);if(ae&&t[ae])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[ae]());var e=ho(t);return(e==w?Qe:e==I?nn:zu)(t)}function pu(t){return t?(t=yu(t))===f||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function vu(t){var e=pu(t),n=e%1;return e==e?n?e-n:e:0}function gu(t){return t?ar(vu(t),0,d):0}function yu(t){if("number"==typeof t)return t;if(cu(t))return h;if(eu(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=eu(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=je(t);var n=pt.test(t);return n||gt.test(t)?ne(t.slice(2),n?2:8):dt.test(t)?h:+t}function mu(t){return Ci(t,Ou(t))}function bu(t){return null==t?"":ui(t)}var _u=Ni((function(t,e){if(wo(e)||qa(e))Ci(e,Ru(e),t);else for(var n in e)Ot.call(e,n)&&tr(t,n,e[n])})),xu=Ni((function(t,e){Ci(e,Ou(e),t)})),wu=Ni((function(t,e,n,r){Ci(e,Ou(e),t,r)})),Eu=Ni((function(t,e,n,r){Ci(e,Ru(e),t,r)})),Su=to(or),Au=Yr((function(t,e){t=St(t);var n=-1,r=e.length,o=r>2?e[2]:i;for(o&&mo(e[0],e[1],o)&&(r=1);++n<r;)for(var a=e[n],u=Ou(a),s=-1,c=u.length;++s<c;){var f=u[s],l=t[f];(l===i||za(l,Nt[f])&&!Ot.call(t,f))&&(t[f]=a[f])}return t})),Tu=Yr((function(t){return t.push(i,$i),ye(Pu,i,t)}));function Iu(t,e,n){var r=null==t?i:wr(t,e);return r===i?n:r}function Cu(t,e){return null!=t&&po(t,e,Ir)}var Du=Fi((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Gt.call(e)),t[e]=n}),es(is)),Nu=Fi((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Gt.call(e)),Ot.call(t,e)?t[e].push(n):t[e]=[n]}),ao),ku=Yr(Dr);function Ru(t){return qa(t)?Kn(t):Pr(t)}function Ou(t){return qa(t)?Kn(t,!0):function(t){if(!eu(t))return function(t){var e=[];if(null!=t)for(var n in St(t))e.push(n);return e}(t);var e=wo(t),n=[];for(var r in t)("constructor"!=r||!e&&Ot.call(t,r))&&n.push(r);return n}(t)}var Mu=Ni((function(t,e,n){Br(t,e,n)})),Pu=Ni((function(t,e,n,r){Br(t,e,n,r)})),Gu=to((function(t,e){var n={};if(null==t)return n;var r=!1;e=Ae(e,(function(e){return e=yi(e,t),r||(r=e.length>1),e})),Ci(t,no(t),n),r&&(n=ur(n,7,Ji));for(var i=e.length;i--;)ci(n,e[i]);return n})),Lu=to((function(t,e){return null==t?{}:function(t,e){return Wr(t,e,(function(e,n){return Cu(t,n)}))}(t,e)}));function Uu(t,e){if(null==t)return{};var n=Ae(no(t),(function(t){return[t]}));return e=ao(e),Wr(t,n,(function(t,n){return e(t,n[0])}))}var Fu=Yi(Ru),Bu=Yi(Ou);function zu(t){return null==t?[]:Ve(t,Ru(t))}var ju=Mi((function(t,e,n){return e=e.toLowerCase(),t+(n?Wu(e):e)}));function Wu(t){return $u(bu(t).toLowerCase())}function Vu(t){return(t=bu(t))&&t.replace(mt,Ke).replace(Xt,"")}var Xu=Mi((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Hu=Mi((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),qu=Oi("toLowerCase"),Yu=Mi((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()})),Ku=Mi((function(t,e,n){return t+(n?" ":"")+$u(e)})),Zu=Mi((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),$u=Oi("toUpperCase");function Ju(t,e,n){return t=bu(t),(e=n?i:e)===i?function(t){return Kt.test(t)}(t)?function(t){return t.match(qt)||[]}(t):function(t){return t.match(st)||[]}(t):t.match(e)||[]}var Qu=Yr((function(t,e){try{return ye(t,i,e)}catch(t){return $a(t)?t:new xt(t)}})),ts=to((function(t,e){return be(e,(function(e){e=Uo(e),ir(t,e,Na(t[e],t))})),t}));function es(t){return function(){return t}}var ns=Li(),rs=Li(!0);function is(t){return t}function os(t){return Mr("function"==typeof t?t:ur(t,1))}var as=Yr((function(t,e){return function(n){return Dr(n,t,e)}})),us=Yr((function(t,e){return function(n){return Dr(t,n,e)}}));function ss(t,e,n){var r=Ru(e),i=xr(e,r);null!=n||eu(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=xr(e,Ru(e)));var o=!(eu(n)&&"chain"in n&&!n.chain),a=Ja(t);return be(i,(function(n){var r=e[n];t[n]=r,a&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__),i=n.__actions__=Ii(this.__actions__);return i.push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,Te([this.value()],arguments))})})),t}function cs(){}var fs=zi(Ae),ls=zi(xe),hs=zi(De);function ds(t){return bo(t)?Le(Uo(t)):function(t){return function(e){return wr(e,t)}}(t)}var ps=Wi(),vs=Wi(!0);function gs(){return[]}function ys(){return!1}var ms,bs=Bi((function(t,e){return t+e}),0),_s=Hi("ceil"),xs=Bi((function(t,e){return t/e}),1),ws=Hi("floor"),Es=Bi((function(t,e){return t*e}),1),Ss=Hi("round"),As=Bi((function(t,e){return t-e}),0);return Fn.after=function(t,e){if("function"!=typeof e)throw new It(o);return t=vu(t),function(){if(--t<1)return e.apply(this,arguments)}},Fn.ary=Ca,Fn.assign=_u,Fn.assignIn=xu,Fn.assignInWith=wu,Fn.assignWith=Eu,Fn.at=Su,Fn.before=Da,Fn.bind=Na,Fn.bindAll=ts,Fn.bindKey=ka,Fn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Xa(t)?t:[t]},Fn.chain=da,Fn.chunk=function(t,e,n){e=(n?mo(t,e,n):e===i)?1:yn(vu(e),0);var o=null==t?0:t.length;if(!o||e<1)return[];for(var a=0,u=0,s=r(fn(o/e));a<o;)s[u++]=ei(t,a,a+=e);return s},Fn.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var o=t[e];o&&(i[r++]=o)}return i},Fn.concat=function(){var t=arguments.length;if(!t)return[];for(var e=r(t-1),n=arguments[0],i=t;i--;)e[i-1]=arguments[i];return Te(Xa(n)?Ii(n):[n],gr(e,1))},Fn.cond=function(t){var e=null==t?0:t.length,n=ao();return t=e?Ae(t,(function(t){if("function"!=typeof t[1])throw new It(o);return[n(t[0]),t[1]]})):[],Yr((function(n){for(var r=-1;++r<e;){var i=t[r];if(ye(i[0],this,n))return ye(i[1],this,n)}}))},Fn.conforms=function(t){return function(t){var e=Ru(t);return function(n){return sr(n,t,e)}}(ur(t,1))},Fn.constant=es,Fn.countBy=ga,Fn.create=function(t,e){var n=Bn(t);return null==e?n:rr(n,e)},Fn.curry=function t(e,n,r){var o=Ki(e,8,i,i,i,i,i,n=r?i:n);return o.placeholder=t.placeholder,o},Fn.curryRight=function t(e,n,r){var o=Ki(e,16,i,i,i,i,i,n=r?i:n);return o.placeholder=t.placeholder,o},Fn.debounce=Ra,Fn.defaults=Au,Fn.defaultsDeep=Tu,Fn.defer=Oa,Fn.delay=Ma,Fn.difference=zo,Fn.differenceBy=jo,Fn.differenceWith=Wo,Fn.drop=function(t,e,n){var r=null==t?0:t.length;return r?ei(t,(e=n||e===i?1:vu(e))<0?0:e,r):[]},Fn.dropRight=function(t,e,n){var r=null==t?0:t.length;return r?ei(t,0,(e=r-(e=n||e===i?1:vu(e)))<0?0:e):[]},Fn.dropRightWhile=function(t,e){return t&&t.length?li(t,ao(e,3),!0,!0):[]},Fn.dropWhile=function(t,e){return t&&t.length?li(t,ao(e,3),!0):[]},Fn.fill=function(t,e,n,r){var o=null==t?0:t.length;return o?(n&&"number"!=typeof n&&mo(t,e,n)&&(n=0,r=o),function(t,e,n,r){var o=t.length;for((n=vu(n))<0&&(n=-n>o?0:o+n),(r=r===i||r>o?o:vu(r))<0&&(r+=o),r=n>r?0:gu(r);n<r;)t[n++]=e;return t}(t,e,n,r)):[]},Fn.filter=function(t,e){return(Xa(t)?we:vr)(t,ao(e,3))},Fn.flatMap=function(t,e){return gr(Sa(t,e),1)},Fn.flatMapDeep=function(t,e){return gr(Sa(t,e),f)},Fn.flatMapDepth=function(t,e,n){return n=n===i?1:vu(n),gr(Sa(t,e),n)},Fn.flatten=Ho,Fn.flattenDeep=function(t){return null!=t&&t.length?gr(t,f):[]},Fn.flattenDepth=function(t,e){return null!=t&&t.length?gr(t,e=e===i?1:vu(e)):[]},Fn.flip=function(t){return Ki(t,512)},Fn.flow=ns,Fn.flowRight=rs,Fn.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r},Fn.functions=function(t){return null==t?[]:xr(t,Ru(t))},Fn.functionsIn=function(t){return null==t?[]:xr(t,Ou(t))},Fn.groupBy=xa,Fn.initial=function(t){return null!=t&&t.length?ei(t,0,-1):[]},Fn.intersection=Yo,Fn.intersectionBy=Ko,Fn.intersectionWith=Zo,Fn.invert=Du,Fn.invertBy=Nu,Fn.invokeMap=wa,Fn.iteratee=os,Fn.keyBy=Ea,Fn.keys=Ru,Fn.keysIn=Ou,Fn.map=Sa,Fn.mapKeys=function(t,e){var n={};return e=ao(e,3),br(t,(function(t,r,i){ir(n,e(t,r,i),t)})),n},Fn.mapValues=function(t,e){var n={};return e=ao(e,3),br(t,(function(t,r,i){ir(n,r,e(t,r,i))})),n},Fn.matches=function(t){return Ur(ur(t,1))},Fn.matchesProperty=function(t,e){return Fr(t,ur(e,1))},Fn.memoize=Pa,Fn.merge=Mu,Fn.mergeWith=Pu,Fn.method=as,Fn.methodOf=us,Fn.mixin=ss,Fn.negate=Ga,Fn.nthArg=function(t){return t=vu(t),Yr((function(e){return zr(e,t)}))},Fn.omit=Gu,Fn.omitBy=function(t,e){return Uu(t,Ga(ao(e)))},Fn.once=function(t){return Da(2,t)},Fn.orderBy=function(t,e,n,r){return null==t?[]:(Xa(e)||(e=null==e?[]:[e]),Xa(n=r?i:n)||(n=null==n?[]:[n]),jr(t,e,n))},Fn.over=fs,Fn.overArgs=La,Fn.overEvery=ls,Fn.overSome=hs,Fn.partial=Ua,Fn.partialRight=Fa,Fn.partition=Aa,Fn.pick=Lu,Fn.pickBy=Uu,Fn.property=ds,Fn.propertyOf=function(t){return function(e){return null==t?i:wr(t,e)}},Fn.pull=Jo,Fn.pullAll=Qo,Fn.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?Vr(t,e,ao(n,2)):t},Fn.pullAllWith=function(t,e,n){return t&&t.length&&e&&e.length?Vr(t,e,i,n):t},Fn.pullAt=ta,Fn.range=ps,Fn.rangeRight=vs,Fn.rearg=Ba,Fn.reject=function(t,e){return(Xa(t)?we:vr)(t,Ga(ao(e,3)))},Fn.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],o=t.length;for(e=ao(e,3);++r<o;){var a=t[r];e(a,r,t)&&(n.push(a),i.push(r))}return Xr(t,i),n},Fn.rest=function(t,e){if("function"!=typeof t)throw new It(o);return Yr(t,e=e===i?e:vu(e))},Fn.reverse=ea,Fn.sampleSize=function(t,e,n){return e=(n?mo(t,e,n):e===i)?1:vu(e),(Xa(t)?$n:Zr)(t,e)},Fn.set=function(t,e,n){return null==t?t:$r(t,e,n)},Fn.setWith=function(t,e,n,r){return r="function"==typeof r?r:i,null==t?t:$r(t,e,n,r)},Fn.shuffle=function(t){return(Xa(t)?Jn:ti)(t)},Fn.slice=function(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&mo(t,e,n)?(e=0,n=r):(e=null==e?0:vu(e),n=n===i?r:vu(n)),ei(t,e,n)):[]},Fn.sortBy=Ta,Fn.sortedUniq=function(t){return t&&t.length?oi(t):[]},Fn.sortedUniqBy=function(t,e){return t&&t.length?oi(t,ao(e,2)):[]},Fn.split=function(t,e,n){return n&&"number"!=typeof n&&mo(t,e,n)&&(e=n=i),(n=n===i?d:n>>>0)?(t=bu(t))&&("string"==typeof e||null!=e&&!au(e))&&!(e=ui(e))&&Je(t)?bi(an(t),0,n):t.split(e,n):[]},Fn.spread=function(t,e){if("function"!=typeof t)throw new It(o);return e=null==e?0:yn(vu(e),0),Yr((function(n){var r=n[e],i=bi(n,0,e);return r&&Te(i,r),ye(t,this,i)}))},Fn.tail=function(t){var e=null==t?0:t.length;return e?ei(t,1,e):[]},Fn.take=function(t,e,n){return t&&t.length?ei(t,0,(e=n||e===i?1:vu(e))<0?0:e):[]},Fn.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?ei(t,(e=r-(e=n||e===i?1:vu(e)))<0?0:e,r):[]},Fn.takeRightWhile=function(t,e){return t&&t.length?li(t,ao(e,3),!1,!0):[]},Fn.takeWhile=function(t,e){return t&&t.length?li(t,ao(e,3)):[]},Fn.tap=function(t,e){return e(t),t},Fn.throttle=function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new It(o);return eu(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Ra(t,e,{leading:r,maxWait:e,trailing:i})},Fn.thru=pa,Fn.toArray=du,Fn.toPairs=Fu,Fn.toPairsIn=Bu,Fn.toPath=function(t){return Xa(t)?Ae(t,Uo):cu(t)?[t]:Ii(Lo(bu(t)))},Fn.toPlainObject=mu,Fn.transform=function(t,e,n){var r=Xa(t),i=r||Ka(t)||fu(t);if(e=ao(e,4),null==n){var o=t&&t.constructor;n=i?r?new o:[]:eu(t)&&Ja(o)?Bn(Ht(t)):{}}return(i?be:br)(t,(function(t,r,i){return e(n,t,r,i)})),n},Fn.unary=function(t){return Ca(t,1)},Fn.union=na,Fn.unionBy=ra,Fn.unionWith=ia,Fn.uniq=function(t){return t&&t.length?si(t):[]},Fn.uniqBy=function(t,e){return t&&t.length?si(t,ao(e,2)):[]},Fn.uniqWith=function(t,e){return e="function"==typeof e?e:i,t&&t.length?si(t,i,e):[]},Fn.unset=function(t,e){return null==t||ci(t,e)},Fn.unzip=oa,Fn.unzipWith=aa,Fn.update=function(t,e,n){return null==t?t:fi(t,e,gi(n))},Fn.updateWith=function(t,e,n,r){return r="function"==typeof r?r:i,null==t?t:fi(t,e,gi(n),r)},Fn.values=zu,Fn.valuesIn=function(t){return null==t?[]:Ve(t,Ou(t))},Fn.without=ua,Fn.words=Ju,Fn.wrap=function(t,e){return Ua(gi(e),t)},Fn.xor=sa,Fn.xorBy=ca,Fn.xorWith=fa,Fn.zip=la,Fn.zipObject=function(t,e){return pi(t||[],e||[],tr)},Fn.zipObjectDeep=function(t,e){return pi(t||[],e||[],$r)},Fn.zipWith=ha,Fn.entries=Fu,Fn.entriesIn=Bu,Fn.extend=xu,Fn.extendWith=wu,ss(Fn,Fn),Fn.add=bs,Fn.attempt=Qu,Fn.camelCase=ju,Fn.capitalize=Wu,Fn.ceil=_s,Fn.clamp=function(t,e,n){return n===i&&(n=e,e=i),n!==i&&(n=(n=yu(n))==n?n:0),e!==i&&(e=(e=yu(e))==e?e:0),ar(yu(t),e,n)},Fn.clone=function(t){return ur(t,4)},Fn.cloneDeep=function(t){return ur(t,5)},Fn.cloneDeepWith=function(t,e){return ur(t,5,e="function"==typeof e?e:i)},Fn.cloneWith=function(t,e){return ur(t,4,e="function"==typeof e?e:i)},Fn.conformsTo=function(t,e){return null==e||sr(t,e,Ru(e))},Fn.deburr=Vu,Fn.defaultTo=function(t,e){return null==t||t!=t?e:t},Fn.divide=xs,Fn.endsWith=function(t,e,n){t=bu(t),e=ui(e);var r=t.length,o=n=n===i?r:ar(vu(n),0,r);return(n-=e.length)>=0&&t.slice(n,o)==e},Fn.eq=za,Fn.escape=function(t){return(t=bu(t))&&Y.test(t)?t.replace(H,Ze):t},Fn.escapeRegExp=function(t){return(t=bu(t))&&nt.test(t)?t.replace(et,"\\$&"):t},Fn.every=function(t,e,n){var r=Xa(t)?xe:dr;return n&&mo(t,e,n)&&(e=i),r(t,ao(e,3))},Fn.find=ya,Fn.findIndex=Vo,Fn.findKey=function(t,e){return ke(t,ao(e,3),br)},Fn.findLast=ma,Fn.findLastIndex=Xo,Fn.findLastKey=function(t,e){return ke(t,ao(e,3),_r)},Fn.floor=ws,Fn.forEach=ba,Fn.forEachRight=_a,Fn.forIn=function(t,e){return null==t?t:yr(t,ao(e,3),Ou)},Fn.forInRight=function(t,e){return null==t?t:mr(t,ao(e,3),Ou)},Fn.forOwn=function(t,e){return t&&br(t,ao(e,3))},Fn.forOwnRight=function(t,e){return t&&_r(t,ao(e,3))},Fn.get=Iu,Fn.gt=ja,Fn.gte=Wa,Fn.has=function(t,e){return null!=t&&po(t,e,Tr)},Fn.hasIn=Cu,Fn.head=qo,Fn.identity=is,Fn.includes=function(t,e,n,r){t=qa(t)?t:zu(t),n=n&&!r?vu(n):0;var i=t.length;return n<0&&(n=yn(i+n,0)),su(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&Oe(t,e,n)>-1},Fn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:vu(n);return i<0&&(i=yn(r+i,0)),Oe(t,e,i)},Fn.inRange=function(t,e,n){return e=pu(e),n===i?(n=e,e=0):n=pu(n),function(t,e,n){return t>=mn(e,n)&&t<yn(e,n)}(t=yu(t),e,n)},Fn.invoke=ku,Fn.isArguments=Va,Fn.isArray=Xa,Fn.isArrayBuffer=Ha,Fn.isArrayLike=qa,Fn.isArrayLikeObject=Ya,Fn.isBoolean=function(t){return!0===t||!1===t||nu(t)&&Sr(t)==y},Fn.isBuffer=Ka,Fn.isDate=Za,Fn.isElement=function(t){return nu(t)&&1===t.nodeType&&!ou(t)},Fn.isEmpty=function(t){if(null==t)return!0;if(qa(t)&&(Xa(t)||"string"==typeof t||"function"==typeof t.splice||Ka(t)||fu(t)||Va(t)))return!t.length;var e=ho(t);if(e==w||e==I)return!t.size;if(wo(t))return!Pr(t).length;for(var n in t)if(Ot.call(t,n))return!1;return!0},Fn.isEqual=function(t,e){return kr(t,e)},Fn.isEqualWith=function(t,e,n){var r=(n="function"==typeof n?n:i)?n(t,e):i;return r===i?kr(t,e,i,n):!!r},Fn.isError=$a,Fn.isFinite=function(t){return"number"==typeof t&&pn(t)},Fn.isFunction=Ja,Fn.isInteger=Qa,Fn.isLength=tu,Fn.isMap=ru,Fn.isMatch=function(t,e){return t===e||Rr(t,e,so(e))},Fn.isMatchWith=function(t,e,n){return n="function"==typeof n?n:i,Rr(t,e,so(e),n)},Fn.isNaN=function(t){return iu(t)&&t!=+t},Fn.isNative=function(t){if(xo(t))throw new xt("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Or(t)},Fn.isNil=function(t){return null==t},Fn.isNull=function(t){return null===t},Fn.isNumber=iu,Fn.isObject=eu,Fn.isObjectLike=nu,Fn.isPlainObject=ou,Fn.isRegExp=au,Fn.isSafeInteger=function(t){return Qa(t)&&t>=-9007199254740991&&t<=l},Fn.isSet=uu,Fn.isString=su,Fn.isSymbol=cu,Fn.isTypedArray=fu,Fn.isUndefined=function(t){return t===i},Fn.isWeakMap=function(t){return nu(t)&&ho(t)==N},Fn.isWeakSet=function(t){return nu(t)&&"[object WeakSet]"==Sr(t)},Fn.join=function(t,e){return null==t?"":vn.call(t,e)},Fn.kebabCase=Xu,Fn.last=$o,Fn.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=vu(n))<0?yn(r+o,0):mn(o,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,o):Re(t,Pe,o,!0)},Fn.lowerCase=Hu,Fn.lowerFirst=qu,Fn.lt=lu,Fn.lte=hu,Fn.max=function(t){return t&&t.length?pr(t,is,Ar):i},Fn.maxBy=function(t,e){return t&&t.length?pr(t,ao(e,2),Ar):i},Fn.mean=function(t){return Ge(t,is)},Fn.meanBy=function(t,e){return Ge(t,ao(e,2))},Fn.min=function(t){return t&&t.length?pr(t,is,Gr):i},Fn.minBy=function(t,e){return t&&t.length?pr(t,ao(e,2),Gr):i},Fn.stubArray=gs,Fn.stubFalse=ys,Fn.stubObject=function(){return{}},Fn.stubString=function(){return""},Fn.stubTrue=function(){return!0},Fn.multiply=Es,Fn.nth=function(t,e){return t&&t.length?zr(t,vu(e)):i},Fn.noConflict=function(){return oe._===this&&(oe._=Ut),this},Fn.noop=cs,Fn.now=Ia,Fn.pad=function(t,e,n){t=bu(t);var r=(e=vu(e))?on(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return ji(ln(i),n)+t+ji(fn(i),n)},Fn.padEnd=function(t,e,n){t=bu(t);var r=(e=vu(e))?on(t):0;return e&&r<e?t+ji(e-r,n):t},Fn.padStart=function(t,e,n){t=bu(t);var r=(e=vu(e))?on(t):0;return e&&r<e?ji(e-r,n)+t:t},Fn.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),_n(bu(t).replace(rt,""),e||0)},Fn.random=function(t,e,n){if(n&&"boolean"!=typeof n&&mo(t,e,n)&&(e=n=i),n===i&&("boolean"==typeof e?(n=e,e=i):"boolean"==typeof t&&(n=t,t=i)),t===i&&e===i?(t=0,e=1):(t=pu(t),e===i?(e=t,t=0):e=pu(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var o=xn();return mn(t+o*(e-t+ee("1e-"+((o+"").length-1))),e)}return Hr(t,e)},Fn.reduce=function(t,e,n){var r=Xa(t)?Ie:Fe,i=arguments.length<3;return r(t,ao(e,4),n,i,lr)},Fn.reduceRight=function(t,e,n){var r=Xa(t)?Ce:Fe,i=arguments.length<3;return r(t,ao(e,4),n,i,hr)},Fn.repeat=function(t,e,n){return e=(n?mo(t,e,n):e===i)?1:vu(e),qr(bu(t),e)},Fn.replace=function(){var t=arguments,e=bu(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Fn.result=function(t,e,n){var r=-1,o=(e=yi(e,t)).length;for(o||(o=1,t=i);++r<o;){var a=null==t?i:t[Uo(e[r])];a===i&&(r=o,a=n),t=Ja(a)?a.call(t):a}return t},Fn.round=Ss,Fn.runInContext=t,Fn.sample=function(t){return(Xa(t)?Zn:Kr)(t)},Fn.size=function(t){if(null==t)return 0;if(qa(t))return su(t)?on(t):t.length;var e=ho(t);return e==w||e==I?t.size:Pr(t).length},Fn.snakeCase=Yu,Fn.some=function(t,e,n){var r=Xa(t)?De:ni;return n&&mo(t,e,n)&&(e=i),r(t,ao(e,3))},Fn.sortedIndex=function(t,e){return ri(t,e)},Fn.sortedIndexBy=function(t,e,n){return ii(t,e,ao(n,2))},Fn.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=ri(t,e);if(r<n&&za(t[r],e))return r}return-1},Fn.sortedLastIndex=function(t,e){return ri(t,e,!0)},Fn.sortedLastIndexBy=function(t,e,n){return ii(t,e,ao(n,2),!0)},Fn.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var n=ri(t,e,!0)-1;if(za(t[n],e))return n}return-1},Fn.startCase=Ku,Fn.startsWith=function(t,e,n){return t=bu(t),n=null==n?0:ar(vu(n),0,t.length),e=ui(e),t.slice(n,n+e.length)==e},Fn.subtract=As,Fn.sum=function(t){return t&&t.length?Be(t,is):0},Fn.sumBy=function(t,e){return t&&t.length?Be(t,ao(e,2)):0},Fn.template=function(t,e,n){var r=Fn.templateSettings;n&&mo(t,e,n)&&(e=i),t=bu(t),e=wu({},e,r,Zi);var o,a,u=wu({},e.imports,r.imports,Zi),s=Ru(u),c=Ve(u,s),f=0,l=e.interpolate||bt,h="__p += '",d=At((e.escape||bt).source+"|"+l.source+"|"+(l===$?lt:bt).source+"|"+(e.evaluate||bt).source+"|$","g"),p="//# sourceURL="+(Ot.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++$t+"]")+"\n";t.replace(d,(function(e,n,r,i,u,s){return r||(r=i),h+=t.slice(f,s).replace(_t,$e),n&&(o=!0,h+="' +\n__e("+n+") +\n'"),u&&(a=!0,h+="';\n"+u+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),f=s+e.length,e})),h+="';\n";var v=Ot.call(e,"variable")&&e.variable;if(v){if(ct.test(v))throw new xt("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(a?h.replace(j,""):h).replace(W,"$1").replace(V,"$1;"),h="function("+(v||"obj")+") {\n"+(v?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var g=Qu((function(){return wt(s,p+"return "+h).apply(i,c)}));if(g.source=h,$a(g))throw g;return g},Fn.times=function(t,e){if((t=vu(t))<1||t>l)return[];var n=d,r=mn(t,d);e=ao(e),t-=d;for(var i=ze(r,e);++n<t;)e(n);return i},Fn.toFinite=pu,Fn.toInteger=vu,Fn.toLength=gu,Fn.toLower=function(t){return bu(t).toLowerCase()},Fn.toNumber=yu,Fn.toSafeInteger=function(t){return t?ar(vu(t),-9007199254740991,l):0===t?t:0},Fn.toString=bu,Fn.toUpper=function(t){return bu(t).toUpperCase()},Fn.trim=function(t,e,n){if((t=bu(t))&&(n||e===i))return je(t);if(!t||!(e=ui(e)))return t;var r=an(t),o=an(e);return bi(r,He(r,o),qe(r,o)+1).join("")},Fn.trimEnd=function(t,e,n){if((t=bu(t))&&(n||e===i))return t.slice(0,un(t)+1);if(!t||!(e=ui(e)))return t;var r=an(t);return bi(r,0,qe(r,an(e))+1).join("")},Fn.trimStart=function(t,e,n){if((t=bu(t))&&(n||e===i))return t.replace(rt,"");if(!t||!(e=ui(e)))return t;var r=an(t);return bi(r,He(r,an(e))).join("")},Fn.truncate=function(t,e){var n=30,r="...";if(eu(e)){var o="separator"in e?e.separator:o;n="length"in e?vu(e.length):n,r="omission"in e?ui(e.omission):r}var a=(t=bu(t)).length;if(Je(t)){var u=an(t);a=u.length}if(n>=a)return t;var s=n-on(r);if(s<1)return r;var c=u?bi(u,0,s).join(""):t.slice(0,s);if(o===i)return c+r;if(u&&(s+=c.length-s),au(o)){if(t.slice(s).search(o)){var f,l=c;for(o.global||(o=At(o.source,bu(ht.exec(o))+"g")),o.lastIndex=0;f=o.exec(l);)var h=f.index;c=c.slice(0,h===i?s:h)}}else if(t.indexOf(ui(o),s)!=s){var d=c.lastIndexOf(o);d>-1&&(c=c.slice(0,d))}return c+r},Fn.unescape=function(t){return(t=bu(t))&&q.test(t)?t.replace(X,sn):t},Fn.uniqueId=function(t){var e=++Mt;return bu(t)+e},Fn.upperCase=Zu,Fn.upperFirst=$u,Fn.each=ba,Fn.eachRight=_a,Fn.first=qo,ss(Fn,(ms={},br(Fn,(function(t,e){Ot.call(Fn.prototype,e)||(ms[e]=t)})),ms),{chain:!1}),Fn.VERSION="4.17.21",be(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Fn[t].placeholder=Fn})),be(["drop","take"],(function(t,e){Wn.prototype[t]=function(n){n=n===i?1:yn(vu(n),0);var r=this.__filtered__&&!e?new Wn(this):this.clone();return r.__filtered__?r.__takeCount__=mn(n,r.__takeCount__):r.__views__.push({size:mn(n,d),type:t+(r.__dir__<0?"Right":"")}),r},Wn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),be(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Wn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:ao(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),be(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Wn.prototype[t]=function(){return this[n](1).value()[0]}})),be(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Wn.prototype[t]=function(){return this.__filtered__?new Wn(this):this[n](1)}})),Wn.prototype.compact=function(){return this.filter(is)},Wn.prototype.find=function(t){return this.filter(t).head()},Wn.prototype.findLast=function(t){return this.reverse().find(t)},Wn.prototype.invokeMap=Yr((function(t,e){return"function"==typeof t?new Wn(this):this.map((function(n){return Dr(n,t,e)}))})),Wn.prototype.reject=function(t){return this.filter(Ga(ao(t)))},Wn.prototype.slice=function(t,e){t=vu(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Wn(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==i&&(n=(e=vu(e))<0?n.dropRight(-e):n.take(e-t)),n)},Wn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Wn.prototype.toArray=function(){return this.take(d)},br(Wn.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),o=Fn[r?"take"+("last"==e?"Right":""):e],a=r||/^find/.test(e);o&&(Fn.prototype[e]=function(){var e=this.__wrapped__,u=r?[1]:arguments,s=e instanceof Wn,c=u[0],f=s||Xa(e),l=function(t){var e=o.apply(Fn,Te([t],u));return r&&h?e[0]:e};f&&n&&"function"==typeof c&&1!=c.length&&(s=f=!1);var h=this.__chain__,d=!!this.__actions__.length,p=a&&!h,v=s&&!d;if(!a&&f){e=v?e:new Wn(this);var g=t.apply(e,u);return g.__actions__.push({func:pa,args:[l],thisArg:i}),new jn(g,h)}return p&&v?t.apply(this,u):(g=this.thru(l),p?r?g.value()[0]:g.value():g)})})),be(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Ct[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Fn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(Xa(i)?i:[],t)}return this[n]((function(n){return e.apply(Xa(n)?n:[],t)}))}})),br(Wn.prototype,(function(t,e){var n=Fn[e];if(n){var r=n.name+"";Ot.call(Nn,r)||(Nn[r]=[]),Nn[r].push({name:e,func:n})}})),Nn[Ui(i,2).name]=[{name:"wrapper",func:i}],Wn.prototype.clone=function(){var t=new Wn(this.__wrapped__);return t.__actions__=Ii(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ii(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ii(this.__views__),t},Wn.prototype.reverse=function(){if(this.__filtered__){var t=new Wn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Wn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Xa(t),r=e<0,i=n?t.length:0,o=function(t,e,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=mn(e,t+a);break;case"takeRight":t=yn(t,e-a)}}return{start:t,end:e}}(0,i,this.__views__),a=o.start,u=o.end,s=u-a,c=r?u:a-1,f=this.__iteratees__,l=f.length,h=0,d=mn(s,this.__takeCount__);if(!n||!r&&i==s&&d==s)return hi(t,this.__actions__);var p=[];t:for(;s--&&h<d;){for(var v=-1,g=t[c+=e];++v<l;){var y=f[v],m=y.iteratee,b=y.type,_=m(g);if(2==b)g=_;else if(!_){if(1==b)continue t;break t}}p[h++]=g}return p},Fn.prototype.at=va,Fn.prototype.chain=function(){return da(this)},Fn.prototype.commit=function(){return new jn(this.value(),this.__chain__)},Fn.prototype.next=function(){this.__values__===i&&(this.__values__=du(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?i:this.__values__[this.__index__++]}},Fn.prototype.plant=function(t){for(var e,n=this;n instanceof zn;){var r=Bo(n);r.__index__=0,r.__values__=i,e?o.__wrapped__=r:e=r;var o=r;n=n.__wrapped__}return o.__wrapped__=t,e},Fn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Wn){var e=t;return this.__actions__.length&&(e=new Wn(this)),(e=e.reverse()).__actions__.push({func:pa,args:[ea],thisArg:i}),new jn(e,this.__chain__)}return this.thru(ea)},Fn.prototype.toJSON=Fn.prototype.valueOf=Fn.prototype.value=function(){return hi(this.__wrapped__,this.__actions__)},Fn.prototype.first=Fn.prototype.head,ae&&(Fn.prototype[ae]=function(){return this}),Fn}();oe._=cn,(r=function(){return cn}.call(e,n,e,t))===i||(t.exports=r)}.call(this)},1739:(t,e,n)=>{var r=n(5229),i=n(6765),o=n(5927),a=n(4186),u=n(6064),s=[0,0];t.exports.x7=function(t,e,n,a,c){return r(t,n,a),o(t,t),i(e,-t[1],t[0]),i(s,-n[1],n[0]),c/u(e,s)},t.exports.mJ=function(t,e){return i(t,-e[1],e[0]),t},t.exports.o7=function(t,e,n){return a(t,e,n),o(t,t),t}},8892:(t,e,n)=>{var r;!function(t){!function(e){var r="object"==typeof n.g?n.g:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),i=o(t);function o(t,e){return function(n,r){"function"!=typeof t[n]&&Object.defineProperty(t,n,{configurable:!0,writable:!0,value:r}),e&&e(n,r)}}void 0===r.Reflect?r.Reflect=t:i=o(r.Reflect,i),function(t){var e=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,r=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,a={__proto__:[]}instanceof Array,u=!o&&!a,s={create:o?function(){return P(Object.create(null))}:a?function(){return P({__proto__:null})}:function(){return P({})},has:u?function(t,n){return e.call(t,n)}:function(t,e){return e in t},get:u?function(t,n){return e.call(t,n)?t[n]:void 0}:function(t,e){return t[e]}},c=Object.getPrototypeOf(Function),f="object"==typeof process&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,l=f||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?function(){var t={},e=[],n=function(){function t(t,e,n){this._index=0,this._keys=t,this._values=e,this._selector=n}return t.prototype["@@iterator"]=function(){return this},t.prototype[i]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t<this._keys.length){var n=this._selector(this._keys[t],this._values[t]);return t+1>=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){var n=this._find(t,!0);return this._values[n]=e,this},e.prototype.delete=function(e){var n=this._find(e,!1);if(n>=0){for(var r=this._keys.length,i=n+1;i<r;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,e===this._cacheKey&&(this._cacheKey=t,this._cacheIndex=-2),!0}return!1},e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=t,this._cacheIndex=-2},e.prototype.keys=function(){return new n(this._keys,this._values,r)},e.prototype.values=function(){return new n(this._keys,this._values,o)},e.prototype.entries=function(){return new n(this._keys,this._values,a)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[i]=function(){return this.entries()},e.prototype._find=function(t,e){return this._cacheKey!==t&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=t)),this._cacheIndex<0&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function r(t,e){return t}function o(t,e){return e}function a(t,e){return[t,e]}}():Map,h=f||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?function(){function t(){this._map=new l}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.values()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[i]=function(){return this.keys()},t}():Set,d=new(f||"function"!=typeof WeakMap?function(){var t=s.create(),n=r();return function(){function t(){this._key=r()}return t.prototype.has=function(t){var e=i(t,!1);return void 0!==e&&s.has(e,this._key)},t.prototype.get=function(t){var e=i(t,!1);return void 0!==e?s.get(e,this._key):void 0},t.prototype.set=function(t,e){return i(t,!0)[this._key]=e,this},t.prototype.delete=function(t){var e=i(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=r()},t}();function r(){var e;do{e="@@WeakMap@@"+a()}while(s.has(t,e));return t[e]=!0,e}function i(t,r){if(!e.call(t,n)){if(!r)return;Object.defineProperty(t,n,{value:s.create()})}return t[n]}function o(t,e){for(var n=0;n<e;++n)t[n]=255*Math.random()|0;return t}function a(){var t,e=(t=16,"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(t)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(t)):o(new Uint8Array(t),t):o(new Array(t),t));e[6]=79&e[6]|64,e[8]=191&e[8]|128;for(var n="",r=0;r<16;++r){var i=e[r];4!==r&&6!==r&&8!==r||(n+="-"),i<16&&(n+="0"),n+=i.toString(16).toLowerCase()}return n}}():WeakMap);function p(t,e,n){var r=d.get(t);if(E(r)){if(!n)return;r=new l,d.set(t,r)}var i=r.get(e);if(E(i)){if(!n)return;i=new l,r.set(e,i)}return i}function v(t,e,n){if(g(t,e,n))return!0;var r=M(e);return!S(r)&&v(t,r,n)}function g(t,e,n){var r=p(e,n,!1);return!E(r)&&!!r.has(t)}function y(t,e,n){if(g(t,e,n))return m(t,e,n);var r=M(e);return S(r)?void 0:y(t,r,n)}function m(t,e,n){var r=p(e,n,!1);if(!E(r))return r.get(t)}function b(t,e,n,r){p(n,r,!0).set(t,e)}function _(t,e){var n=x(t,e),r=M(t);if(null===r)return n;var i=_(r,e);if(i.length<=0)return n;if(n.length<=0)return i;for(var o=new h,a=[],u=0,s=n;u<s.length;u++){var c=s[u];o.has(c)||(o.add(c),a.push(c))}for(var f=0,l=i;f<l.length;f++)c=l[f],o.has(c)||(o.add(c),a.push(c));return a}function x(t,e){var n=[],r=p(t,e,!1);if(E(r))return n;for(var o=function(t){var e=k(t,i);if(!D(e))throw new TypeError;var n=e.call(t);if(!A(n))throw new TypeError;return n}(r.keys()),a=0;;){var u=R(o);if(!u)return n.length=a,n;var s=u.value;try{n[a]=s}catch(t){try{O(o)}finally{throw t}}a++}}function w(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}function E(t){return void 0===t}function S(t){return null===t}function A(t){return"object"==typeof t?null!==t:"function"==typeof t}function T(t,e){switch(w(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var n=3===e?"string":5===e?"number":"default",i=k(t,r);if(void 0!==i){var o=i.call(t,n);if(A(o))throw new TypeError;return o}return function(t,e){if("string"===e){var n=t.toString;if(D(n)&&!A(i=n.call(t)))return i;if(D(r=t.valueOf)&&!A(i=r.call(t)))return i}else{var r;if(D(r=t.valueOf)&&!A(i=r.call(t)))return i;var i,o=t.toString;if(D(o)&&!A(i=o.call(t)))return i}throw new TypeError}(t,"default"===n?"number":n)}function I(t){var e=T(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function C(t){return Array.isArray?Array.isArray(t):t instanceof Object?t instanceof Array:"[object Array]"===Object.prototype.toString.call(t)}function D(t){return"function"==typeof t}function N(t){return"function"==typeof t}function k(t,e){var n=t[e];if(null!=n){if(!D(n))throw new TypeError;return n}}function R(t){var e=t.next();return!e.done&&e}function O(t){var e=t.return;e&&e.call(t)}function M(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===c)return e;if(e!==c)return e;var n=t.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return e;var i=r.constructor;return"function"!=typeof i||i===t?e:i}function P(t){return t.__=void 0,delete t.__,t}t("decorate",(function(t,e,n,r){if(E(n)){if(!C(t))throw new TypeError;if(!N(e))throw new TypeError;return function(t,e){for(var n=t.length-1;n>=0;--n){var r=(0,t[n])(e);if(!E(r)&&!S(r)){if(!N(r))throw new TypeError;e=r}}return e}(t,e)}if(!C(t))throw new TypeError;if(!A(e))throw new TypeError;if(!A(r)&&!E(r)&&!S(r))throw new TypeError;return S(r)&&(r=void 0),function(t,e,n,r){for(var i=t.length-1;i>=0;--i){var o=(0,t[i])(e,n,r);if(!E(o)&&!S(o)){if(!A(o))throw new TypeError;r=o}}return r}(t,e,n=I(n),r)})),t("metadata",(function(t,e){return function(n,r){if(!A(n))throw new TypeError;if(!E(r)&&!function(t){switch(w(t)){case 3:case 4:return!0;default:return!1}}(r))throw new TypeError;b(t,e,n,r)}})),t("defineMetadata",(function(t,e,n,r){if(!A(n))throw new TypeError;return E(r)||(r=I(r)),b(t,e,n,r)})),t("hasMetadata",(function(t,e,n){if(!A(e))throw new TypeError;return E(n)||(n=I(n)),v(t,e,n)})),t("hasOwnMetadata",(function(t,e,n){if(!A(e))throw new TypeError;return E(n)||(n=I(n)),g(t,e,n)})),t("getMetadata",(function(t,e,n){if(!A(e))throw new TypeError;return E(n)||(n=I(n)),y(t,e,n)})),t("getOwnMetadata",(function(t,e,n){if(!A(e))throw new TypeError;return E(n)||(n=I(n)),m(t,e,n)})),t("getMetadataKeys",(function(t,e){if(!A(t))throw new TypeError;return E(e)||(e=I(e)),_(t,e)})),t("getOwnMetadataKeys",(function(t,e){if(!A(t))throw new TypeError;return E(e)||(e=I(e)),x(t,e)})),t("deleteMetadata",(function(t,e,n){if(!A(e))throw new TypeError;E(n)||(n=I(n));var r=p(e,n,!1);if(E(r))return!1;if(!r.delete(t))return!1;if(r.size>0)return!0;var i=d.get(e);return i.delete(n),i.size>0||d.delete(e),!0}))}(i)}()}(r||(r={}))},405:t=>{var e=function(t){"use strict";var e,n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var i=e&&e.prototype instanceof g?e:g,o=Object.create(i.prototype),a=new C(r||[]);return o._invoke=function(t,e,n){var r=l;return function(i,o){if(r===d)throw new Error("Generator is already running");if(r===p){if("throw"===i)throw o;return N()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var u=A(a,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===l)throw r=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=d;var s=f(t,e,n);if("normal"===s.type){if(r=n.done?p:h,s.arg===v)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r=p,n.method="throw",n.arg=s.arg)}}}(t,n,a),o}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var l="suspendedStart",h="suspendedYield",d="executing",p="completed",v={};function g(){}function y(){}function m(){}var b={};s(b,o,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(D([])));x&&x!==n&&r.call(x,o)&&(b=x);var w=m.prototype=g.prototype=Object.create(b);function E(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function n(i,o,a,u){var s=f(t[i],t,o);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,u)}))}u(s.arg)}var i;this._invoke=function(t,r){function o(){return new e((function(e,i){n(t,r,e,i)}))}return i=i?i.then(o,o):o()}}function A(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,A(t,n),"throw"===n.method))return v;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var i=f(r,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function D(t){if(t){var n=t[o];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}return{next:N}}function N(){return{value:e,done:!0}}return y.prototype=m,s(w,"constructor",m),s(m,"constructor",y),y.displayName=s(m,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,s(t,u,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},E(S.prototype),s(S.prototype,a,(function(){return this})),t.AsyncIterator=S,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new S(c(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(w),s(w,u,"Generator"),s(w,o,(function(){return this})),s(w,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=D,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(I),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return u.type="throw",u.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),I(n),v}},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;I(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},6377:function(t){t.exports=function(){"use strict";var t=function(t){return t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Float32Array||t instanceof Float64Array||t instanceof Uint8ClampedArray},e=function(t,e){for(var n=Object.keys(e),r=0;r<n.length;++r)t[n[r]]=e[n[r]];return t},n="\n";function r(t){var e=new Error("(regl) "+t);throw console.error(e),e}function i(t,e){t||r(e)}function o(t){return t?": "+t:""}function a(t,e){switch(e){case"number":return"number"==typeof t;case"object":return"object"==typeof t;case"string":return"string"==typeof t;case"boolean":return"boolean"==typeof t;case"function":return"function"==typeof t;case"undefined":return void 0===t;case"symbol":return"symbol"==typeof t}}function u(t,e,n){e.indexOf(t)<0&&r("invalid value"+o(n)+". must be one of: "+e)}var s=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"];function c(t,e){for(t+="";t.length<e;)t=" "+t;return t}function f(){this.name="unknown",this.lines=[],this.index={},this.hasErrors=!1}function l(t,e){this.number=t,this.line=e,this.errors=[]}function h(t,e,n){this.file=t,this.line=e,this.message=n}function d(){var t=new Error,e=(t.stack||t).toString(),n=/compileProcedure.*\n\s*at.*\((.*)\)/.exec(e);if(n)return n[1];var r=/compileProcedure.*\n\s*at\s+(.*)(\n|$)/.exec(e);return r?r[1]:"unknown"}function p(){var t=new Error,e=(t.stack||t).toString(),n=/at REGLCommand.*\n\s+at.*\((.*)\)/.exec(e);if(n)return n[1];var r=/at REGLCommand.*\n\s+at\s+(.*)\n/.exec(e);return r?r[1]:"unknown"}function v(t,e){var n,r=t.split("\n"),i=1,o=0,a={unknown:new f,0:new f};a.unknown.name=a[0].name=e||d(),a.unknown.lines.push(new l(0,""));for(var u=0;u<r.length;++u){var s=r[u],c=/^\s*#\s*(\w+)\s+(.+)\s*$/.exec(s);if(c)switch(c[1]){case"line":var h=/(\d+)(\s+\d+)?/.exec(c[2]);h&&(i=0|h[1],h[2]&&((o=0|h[2])in a||(a[o]=new f)));break;case"define":var p=/SHADER_NAME(_B64)?\s+(.*)$/.exec(c[2]);p&&(a[o].name=p[1]?(n=p[2],"undefined"!=typeof atob?atob(n):"base64:"+n):p[2])}a[o].lines.push(new l(i++,s))}return Object.keys(a).forEach((function(t){var e=a[t];e.lines.forEach((function(t){e.index[t.number]=t}))})),a}function g(t){t._commandRef=d()}function y(t,e){var n=p();r(t+" in command "+(e||d())+("unknown"===n?"":" called from "+n))}function m(t,e,n,r){a(t,e)||y("invalid parameter type"+o(n)+". expected "+e+", got "+typeof t,r||d())}var b=33071,_={};function x(t,e){return 32820===t||32819===t||33635===t?2:34042===t?4:_[t]*e}function w(t){return!(t&t-1||!t)}_[5120]=_[5121]=1,_[5122]=_[5123]=_[36193]=_[33635]=_[32819]=_[32820]=2,_[5124]=_[5125]=_[5126]=_[34042]=4;var E=e(i,{optional:function(t){t()},raise:r,commandRaise:y,command:function(t,e,n){t||y(e,n||d())},parameter:function(t,e,n){t in e||r("unknown parameter ("+t+")"+o(n)+". possible values: "+Object.keys(e).join())},commandParameter:function(t,e,n,r){t in e||y("unknown parameter ("+t+")"+o(n)+". possible values: "+Object.keys(e).join(),r||d())},constructor:function(t){Object.keys(t).forEach((function(t){s.indexOf(t)<0&&r('invalid regl constructor argument "'+t+'". must be one of '+s)}))},type:function(t,e,n){a(t,e)||r("invalid parameter type"+o(n)+". expected "+e+", got "+typeof t)},commandType:m,isTypedArray:function(e,n){t(e)||r("invalid parameter type"+o(n)+". must be a typed array")},nni:function(t,e){t>=0&&(0|t)===t||r("invalid parameter type, ("+t+")"+o(e)+". must be a nonnegative integer")},oneOf:u,shaderError:function(t,e,r,o,a){if(!t.getShaderParameter(e,t.COMPILE_STATUS)){var u=t.getShaderInfoLog(e),s=o===t.FRAGMENT_SHADER?"fragment":"vertex";m(r,"string",s+" shader source must be a string",a);var f=v(r,a),l=function(t){var e=[];return t.split("\n").forEach((function(t){if(!(t.length<5)){var n=/^ERROR:\s+(\d+):(\d+):\s*(.*)$/.exec(t);n?e.push(new h(0|n[1],0|n[2],n[3].trim())):t.length>0&&e.push(new h("unknown",0,t))}})),e}(u);(function(t,e){e.forEach((function(e){var n=t[e.file];if(n){var r=n.index[e.line];if(r)return r.errors.push(e),void(n.hasErrors=!0)}t.unknown.hasErrors=!0,t.unknown.lines[0].errors.push(e)}))})(f,l),Object.keys(f).forEach((function(t){var e=f[t];if(e.hasErrors){var r=[""],i=[""];o("file number "+t+": "+e.name+"\n","color:red;text-decoration:underline;font-weight:bold"),e.lines.forEach((function(t){if(t.errors.length>0){o(c(t.number,4)+"| ","background-color:yellow; font-weight:bold"),o(t.line+n,"color:red; background-color:yellow; font-weight:bold");var e=0;t.errors.forEach((function(r){var i=r.message,a=/^\s*'(.*)'\s*:\s*(.*)$/.exec(i);if(a){var u=a[1];i=a[2],"assign"===u&&(u="="),e=Math.max(t.line.indexOf(u,e),0)}else e=0;o(c("| ",6)),o(c("^^^",e+3)+n,"font-weight:bold"),o(c("| ",6)),o(i+n,"font-weight:bold")})),o(c("| ",6)+n)}else o(c(t.number,4)+"| "),o(t.line+n,"color:red")})),"undefined"==typeof document||window.chrome?console.log(r.join("")):(i[0]=r.join("%c"),console.log.apply(console,i))}function o(t,e){r.push(t),i.push(e||"")}})),i.raise("Error compiling "+s+" shader, "+f[0].name)}},linkError:function(t,e,r,o,a){if(!t.getProgramParameter(e,t.LINK_STATUS)){var u=t.getProgramInfoLog(e),s=v(r,a),c='Error linking program with vertex shader, "'+v(o,a)[0].name+'", and fragment shader "'+s[0].name+'"';"undefined"!=typeof document?console.log("%c"+c+"\n%c"+u,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(c+n+u),i.raise(c)}},callSite:p,saveCommandRef:g,saveDrawInfo:function(t,e,n,r){function i(t){return t?r.id(t):0}function o(t,e){Object.keys(e).forEach((function(e){t[r.id(e)]=!0}))}g(t),t._fragId=i(t.static.frag),t._vertId=i(t.static.vert);var a=t._uniformSet={};o(a,e.static),o(a,e.dynamic);var u=t._attributeSet={};o(u,n.static),o(u,n.dynamic),t._hasCount="count"in t.static||"count"in t.dynamic||"elements"in t.static||"elements"in t.dynamic},framebufferFormat:function(t,e,n){t.texture?u(t.texture._texture.internalformat,e,"unsupported texture format for attachment"):u(t.renderbuffer._renderbuffer.format,n,"unsupported renderbuffer format for attachment")},guessCommand:d,texture2D:function(t,e,n){var r,o=e.width,a=e.height,u=e.channels;i(o>0&&o<=n.maxTextureSize&&a>0&&a<=n.maxTextureSize,"invalid texture shape"),t.wrapS===b&&t.wrapT===b||i(w(o)&&w(a),"incompatible wrap mode for texture, both width and height must be power of 2"),1===e.mipmask?1!==o&&1!==a&&i(9984!==t.minFilter&&9986!==t.minFilter&&9985!==t.minFilter&&9987!==t.minFilter,"min filter requires mipmap"):(i(w(o)&&w(a),"texture must be a square power of 2 to support mipmapping"),i(e.mipmask===(o<<1)-1,"missing or incomplete mipmap data")),5126===e.type&&(n.extensions.indexOf("oes_texture_float_linear")<0&&i(9728===t.minFilter&&9728===t.magFilter,"filter not supported, must enable oes_texture_float_linear"),i(!t.genMipmaps,"mipmap generation not supported with float textures"));var s=e.images;for(r=0;r<16;++r)if(s[r]){var c=o>>r,f=a>>r;i(e.mipmask&1<<r,"missing mipmap data");var l=s[r];if(i(l.width===c&&l.height===f,"invalid shape for mip images"),i(l.format===e.format&&l.internalformat===e.internalformat&&l.type===e.type,"incompatible type for mip image"),l.compressed);else if(l.data){var h=Math.ceil(x(l.type,u)*c/l.unpackAlignment)*l.unpackAlignment;i(l.data.byteLength===h*f,"invalid data for image, buffer size is inconsistent with image format")}else l.element||l.copy}else t.genMipmaps||i(0==(e.mipmask&1<<r),"extra mipmap data");e.compressed&&i(!t.genMipmaps,"mipmap generation for compressed images not supported")},textureCube:function(t,e,n,r){var o=t.width,a=t.height,u=t.channels;i(o>0&&o<=r.maxTextureSize&&a>0&&a<=r.maxTextureSize,"invalid texture shape"),i(o===a,"cube map must be square"),i(e.wrapS===b&&e.wrapT===b,"wrap mode not supported by cube map");for(var s=0;s<n.length;++s){var c=n[s];i(c.width===o&&c.height===a,"inconsistent cube map face shape"),e.genMipmaps&&(i(!c.compressed,"can not generate mipmap for compressed textures"),i(1===c.mipmask,"can not specify mipmaps and generate mipmaps"));for(var f=c.images,l=0;l<16;++l){var h=f[l];if(h){var d=o>>l,p=a>>l;i(c.mipmask&1<<l,"missing mipmap data"),i(h.width===d&&h.height===p,"invalid shape for mip images"),i(h.format===t.format&&h.internalformat===t.internalformat&&h.type===t.type,"incompatible type for mip image"),h.compressed||(h.data?i(h.data.byteLength===d*p*Math.max(x(h.type,u),h.unpackAlignment),"invalid data for image, buffer size is inconsistent with image format"):h.element||h.copy)}}}}}),S=0;function A(t,e){this.id=S++,this.type=t,this.data=e}function T(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function I(t){if(0===t.length)return[];var e=t.charAt(0),n=t.charAt(t.length-1);if(t.length>1&&e===n&&('"'===e||"'"===e))return['"'+T(t.substr(1,t.length-2))+'"'];var r=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(t);if(r)return I(t.substr(0,r.index)).concat(I(r[1])).concat(I(t.substr(r.index+r[0].length)));var i=t.split(".");if(1===i.length)return['"'+T(t)+'"'];for(var o=[],a=0;a<i.length;++a)o=o.concat(I(i[a]));return o}function C(t){return"["+I(t).join("][")+"]"}var D={DynamicVariable:A,define:function(t,e){return new A(t,C(e+""))},isDynamic:function(t){return"function"==typeof t&&!t._reglType||t instanceof A},unbox:function t(e,n){return"function"==typeof e?new A(0,e):"number"==typeof e||"boolean"==typeof e?new A(5,e):Array.isArray(e)?new A(6,e.map(((e,r)=>t(e,n+"["+r+"]")))):e instanceof A?e:void E(!1,"invalid option type in uniform "+n)},accessor:C},N={next:"function"==typeof requestAnimationFrame?function(t){return requestAnimationFrame(t)}:function(t){return setTimeout(t,16)},cancel:"function"==typeof cancelAnimationFrame?function(t){return cancelAnimationFrame(t)}:clearTimeout},k="undefined"!=typeof performance&&performance.now?function(){return performance.now()}:function(){return+new Date};function R(t){return"string"==typeof t?t.split():(E(Array.isArray(t),"invalid extension array"),t)}function O(t){return"string"==typeof t?(E("undefined"!=typeof document,"not supported outside of DOM"),document.querySelector(t)):t}function M(t){var n,r,i,o,a,u=t||{},s={},c=[],f=[],l="undefined"==typeof window?1:window.devicePixelRatio,h=!1,d=function(t){t&&E.raise(t)},p=function(){};if("string"==typeof u?(E("undefined"!=typeof document,"selector queries only supported in DOM enviroments"),n=document.querySelector(u),E(n,"invalid query string for element")):"object"==typeof u?"string"==typeof(a=u).nodeName&&"function"==typeof a.appendChild&&"function"==typeof a.getBoundingClientRect?n=u:function(t){return"function"==typeof t.drawArrays||"function"==typeof t.drawElements}(u)?i=(o=u).canvas:(E.constructor(u),"gl"in u?o=u.gl:"canvas"in u?i=O(u.canvas):"container"in u&&(r=O(u.container)),"attributes"in u&&(s=u.attributes,E.type(s,"object","invalid context attributes")),"extensions"in u&&(c=R(u.extensions)),"optionalExtensions"in u&&(f=R(u.optionalExtensions)),"onDone"in u&&(E.type(u.onDone,"function","invalid or missing onDone callback"),d=u.onDone),"profile"in u&&(h=!!u.profile),"pixelRatio"in u&&(l=+u.pixelRatio,E(l>0,"invalid pixel ratio"))):E.raise("invalid arguments to regl"),n&&("canvas"===n.nodeName.toLowerCase()?i=n:r=n),!o){if(!i){E("undefined"!=typeof document,"must manually specify webgl context outside of DOM environments");var v=function(t,n,r){var i,o=document.createElement("canvas");function a(){var n=window.innerWidth,i=window.innerHeight;if(t!==document.body){var a=t.getBoundingClientRect();n=a.right-a.left,i=a.bottom-a.top}o.width=r*n,o.height=r*i,e(o.style,{width:n+"px",height:i+"px"})}return e(o.style,{border:0,margin:0,padding:0,top:0,left:0}),t.appendChild(o),t===document.body&&(o.style.position="absolute",e(t.style,{margin:0,padding:0})),t!==document.body&&"function"==typeof ResizeObserver?(i=new ResizeObserver((function(){setTimeout(a)}))).observe(t):window.addEventListener("resize",a,!1),a(),{canvas:o,onDestroy:function(){i?i.disconnect():window.removeEventListener("resize",a),t.removeChild(o)}}}(r||document.body,0,l);if(!v)return null;i=v.canvas,p=v.onDestroy}void 0===s.premultipliedAlpha&&(s.premultipliedAlpha=!0),o=function(t,e){function n(n){try{return t.getContext(n,e)}catch(t){return null}}return n("webgl")||n("experimental-webgl")||n("webgl-experimental")}(i,s)}return o?{gl:o,canvas:i,container:r,extensions:c,optionalExtensions:f,pixelRatio:l,profile:h,onDone:d,onDestroy:p}:(p(),d("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function P(t,e){for(var n=Array(t),r=0;r<t;++r)n[r]=e(r);return n}function G(t){var e,n;return e=(t>65535)<<4,e|=n=((t>>>=e)>255)<<3,e|=n=((t>>>=n)>15)<<2,(e|=n=((t>>>=n)>3)<<1)|(t>>>=n)>>1}function L(){var t=P(8,(function(){return[]}));function e(e){var n=function(t){for(var e=16;e<=1<<28;e*=16)if(t<=e)return e;return 0}(e),r=t[G(n)>>2];return r.length>0?r.pop():new ArrayBuffer(n)}function n(e){t[G(e.byteLength)>>2].push(e)}return{alloc:e,free:n,allocType:function(t,n){var r=null;switch(t){case 5120:r=new Int8Array(e(n),0,n);break;case 5121:r=new Uint8Array(e(n),0,n);break;case 5122:r=new Int16Array(e(2*n),0,n);break;case 5123:r=new Uint16Array(e(2*n),0,n);break;case 5124:r=new Int32Array(e(4*n),0,n);break;case 5125:r=new Uint32Array(e(4*n),0,n);break;case 5126:r=new Float32Array(e(4*n),0,n);break;default:return null}return r.length!==n?r.subarray(0,n):r},freeType:function(t){n(t.buffer)}}}var U=L();U.zero=L();var F=3553,B=6408,z=5126,j=36160;function W(e){return!!e&&"object"==typeof e&&Array.isArray(e.shape)&&Array.isArray(e.stride)&&"number"==typeof e.offset&&e.shape.length===e.stride.length&&(Array.isArray(e.data)||t(e.data))}var V=function(t){return Object.keys(t).map((function(e){return t[e]}))},X={shape:function(t){for(var e=[],n=t;n.length;n=n[0])e.push(n.length);return e},flatten:function(t,e,n,r){var i=1;if(e.length)for(var o=0;o<e.length;++o)i*=e[o];else i=0;var a=r||U.allocType(n,i);switch(e.length){case 0:break;case 1:!function(t,e,n){for(var r=0;r<e;++r)n[r]=t[r]}(t,e[0],a);break;case 2:!function(t,e,n,r){for(var i=0,o=0;o<e;++o)for(var a=t[o],u=0;u<n;++u)r[i++]=a[u]}(t,e[0],e[1],a);break;case 3:H(t,e[0],e[1],e[2],a,0);break;default:q(t,e,0,a,0)}return a}};function H(t,e,n,r,i,o){for(var a=o,u=0;u<e;++u)for(var s=t[u],c=0;c<n;++c)for(var f=s[c],l=0;l<r;++l)i[a++]=f[l]}function q(t,e,n,r,i){for(var o=1,a=n+1;a<e.length;++a)o*=e[a];var u=e[n];if(e.length-n==4){var s=e[n+1],c=e[n+2],f=e[n+3];for(a=0;a<u;++a)H(t[a],s,c,f,r,i),i+=o}else for(a=0;a<u;++a)q(t[a],e,n+1,r,i),i+=o}var Y={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},K={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},Z={dynamic:35048,stream:35040,static:35044},$=X.flatten,J=X.shape,Q=5121,tt=5126,et=[];function nt(t){return 0|Y[Object.prototype.toString.call(t)]}function rt(t,e){for(var n=0;n<e.length;++n)t[n]=e[n]}function it(t,e,n,r,i,o,a){for(var u=0,s=0;s<n;++s)for(var c=0;c<r;++c)t[u++]=e[i*s+o*c+a]}et[5120]=1,et[5122]=2,et[5124]=4,et[5121]=1,et[5123]=2,et[5125]=4,et[5126]=4;var ot={points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},at=5121,ut=5123,st=5125,ct=34963;var ft=new Float32Array(1),lt=new Uint32Array(ft.buffer);function ht(t){for(var e=U.allocType(5123,t.length),n=0;n<t.length;++n)if(isNaN(t[n]))e[n]=65535;else if(t[n]===1/0)e[n]=31744;else if(t[n]===-1/0)e[n]=64512;else{ft[0]=t[n];var r=lt[0],i=r>>>31<<15,o=(r<<1>>>24)-127,a=r>>13&1023;if(o<-24)e[n]=i;else if(o<-14){var u=-14-o;e[n]=i+(a+1024>>u)}else e[n]=o>15?i+31744:i+(o+15<<10)+a}return e}function dt(e){return Array.isArray(e)||t(e)}var pt=function(t){return!(t&t-1||!t)},vt=3553,gt=34067,yt=34069,mt=6408,bt=6406,_t=6407,xt=6409,wt=6410,Et=32855,St=6402,At=34041,Tt=35904,It=35906,Ct=36193,Dt=33776,Nt=33777,kt=33778,Rt=33779,Ot=5121,Mt=5123,Pt=5125,Gt=5126,Lt=33071,Ut=9728,Ft=9984,Bt=9987,zt=4352,jt=33984,Wt=[Ft,9986,9985,Bt],Vt=[0,xt,wt,_t,mt],Xt={};function Ht(t){return"[object "+t+"]"}Xt[6409]=Xt[6406]=Xt[6402]=1,Xt[34041]=Xt[6410]=2,Xt[6407]=Xt[35904]=3,Xt[6408]=Xt[35906]=4;var qt=Ht("HTMLCanvasElement"),Yt=Ht("OffscreenCanvas"),Kt=Ht("CanvasRenderingContext2D"),Zt=Ht("ImageBitmap"),$t=Ht("HTMLImageElement"),Jt=Ht("HTMLVideoElement"),Qt=Object.keys(Y).concat([qt,Yt,Kt,Zt,$t,Jt]),te=[];te[5121]=1,te[5126]=4,te[36193]=2,te[5123]=2,te[5125]=4;var ee=[];function ne(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function re(t){return!!Array.isArray(t)&&!(0===t.length||!dt(t[0]))}function ie(t){return Object.prototype.toString.call(t)}function oe(t){return ie(t)===qt}function ae(t){return ie(t)===Yt}function ue(t){if(!t)return!1;var e=ie(t);return Qt.indexOf(e)>=0||ne(t)||re(t)||W(t)}function se(t){return 0|Y[Object.prototype.toString.call(t)]}function ce(t,e){return U.allocType(t.type===Ct?Gt:t.type,e)}function fe(t,e){t.type===Ct?(t.data=ht(e),U.freeType(e)):t.data=e}function le(t,e,n,r,i,o){var a;if(a=void 0!==ee[t]?ee[t]:Xt[t]*te[e],o&&(a*=6),i){for(var u=0,s=n;s>=1;)u+=a*s*s,s/=2;return u}return a*n*r}function he(n,r,i,o,a,u,s){var c={"don't care":zt,"dont care":zt,nice:4354,fast:4353},f={repeat:10497,clamp:Lt,mirror:33648},l={nearest:Ut,linear:9729},h=e({mipmap:Bt,"nearest mipmap nearest":Ft,"linear mipmap nearest":9985,"nearest mipmap linear":9986,"linear mipmap linear":Bt},l),d={none:0,browser:37444},p={uint8:Ot,rgba4:32819,rgb565:33635,"rgb5 a1":32820},v={alpha:bt,luminance:xt,"luminance alpha":wt,rgb:_t,rgba:mt,rgba4:32854,"rgb5 a1":Et,rgb565:36194},g={};r.ext_srgb&&(v.srgb=Tt,v.srgba=It),r.oes_texture_float&&(p.float32=p.float=Gt),r.oes_texture_half_float&&(p.float16=p["half float"]=Ct),r.webgl_depth_texture&&(e(v,{depth:St,"depth stencil":At}),e(p,{uint16:Mt,uint32:Pt,"depth stencil":34042})),r.webgl_compressed_texture_s3tc&&e(g,{"rgb s3tc dxt1":Dt,"rgba s3tc dxt1":Nt,"rgba s3tc dxt3":kt,"rgba s3tc dxt5":Rt}),r.webgl_compressed_texture_atc&&e(g,{"rgb atc":35986,"rgba atc explicit alpha":35987,"rgba atc interpolated alpha":34798}),r.webgl_compressed_texture_pvrtc&&e(g,{"rgb pvrtc 4bppv1":35840,"rgb pvrtc 2bppv1":35841,"rgba pvrtc 4bppv1":35842,"rgba pvrtc 2bppv1":35843}),r.webgl_compressed_texture_etc1&&(g["rgb etc1"]=36196);var y=Array.prototype.slice.call(n.getParameter(34467));Object.keys(g).forEach((function(t){var e=g[t];y.indexOf(e)>=0&&(v[t]=e)}));var m=Object.keys(v);i.textureFormats=m;var b=[];Object.keys(v).forEach((function(t){var e=v[t];b[e]=t}));var _=[];Object.keys(p).forEach((function(t){var e=p[t];_[e]=t}));var x=[];Object.keys(l).forEach((function(t){x[l[t]]=t}));var w=[];Object.keys(h).forEach((function(t){var e=h[t];w[e]=t}));var S=[];Object.keys(f).forEach((function(t){S[f[t]]=t}));var A=m.reduce((function(t,e){var n=v[e];return n===xt||n===bt||n===xt||n===wt||n===St||n===At||r.ext_srgb&&(n===Tt||n===It)?t[n]=n:n===Et||e.indexOf("rgba")>=0?t[n]=mt:t[n]=_t,t}),{});function T(){this.internalformat=mt,this.format=mt,this.type=Ot,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=37444,this.width=0,this.height=0,this.channels=0}function I(t,e){t.internalformat=e.internalformat,t.format=e.format,t.type=e.type,t.compressed=e.compressed,t.premultiplyAlpha=e.premultiplyAlpha,t.flipY=e.flipY,t.unpackAlignment=e.unpackAlignment,t.colorSpace=e.colorSpace,t.width=e.width,t.height=e.height,t.channels=e.channels}function C(t,e){if("object"==typeof e&&e){if("premultiplyAlpha"in e&&(E.type(e.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),t.premultiplyAlpha=e.premultiplyAlpha),"flipY"in e&&(E.type(e.flipY,"boolean","invalid texture flip"),t.flipY=e.flipY),"alignment"in e&&(E.oneOf(e.alignment,[1,2,4,8],"invalid texture unpack alignment"),t.unpackAlignment=e.alignment),"colorSpace"in e&&(E.parameter(e.colorSpace,d,"invalid colorSpace"),t.colorSpace=d[e.colorSpace]),"type"in e){var n=e.type;E(r.oes_texture_float||!("float"===n||"float32"===n),"you must enable the OES_texture_float extension in order to use floating point textures."),E(r.oes_texture_half_float||!("half float"===n||"float16"===n),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),E(r.webgl_depth_texture||!("uint16"===n||"uint32"===n||"depth stencil"===n),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),E.parameter(n,p,"invalid texture type"),t.type=p[n]}var o=t.width,a=t.height,u=t.channels,s=!1;"shape"in e?(E(Array.isArray(e.shape)&&e.shape.length>=2,"shape must be an array"),o=e.shape[0],a=e.shape[1],3===e.shape.length&&(u=e.shape[2],E(u>0&&u<=4,"invalid number of channels"),s=!0),E(o>=0&&o<=i.maxTextureSize,"invalid width"),E(a>=0&&a<=i.maxTextureSize,"invalid height")):("radius"in e&&(o=a=e.radius,E(o>=0&&o<=i.maxTextureSize,"invalid radius")),"width"in e&&(o=e.width,E(o>=0&&o<=i.maxTextureSize,"invalid width")),"height"in e&&(a=e.height,E(a>=0&&a<=i.maxTextureSize,"invalid height")),"channels"in e&&(u=e.channels,E(u>0&&u<=4,"invalid number of channels"),s=!0)),t.width=0|o,t.height=0|a,t.channels=0|u;var c=!1;if("format"in e){var f=e.format;E(r.webgl_depth_texture||!("depth"===f||"depth stencil"===f),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),E.parameter(f,v,"invalid texture format");var l=t.internalformat=v[f];t.format=A[l],f in p&&("type"in e||(t.type=p[f])),f in g&&(t.compressed=!0),c=!0}!s&&c?t.channels=Xt[t.format]:s&&!c?t.channels!==Vt[t.format]&&(t.format=t.internalformat=Vt[t.channels]):c&&s&&E(t.channels===Xt[t.format],"number of channels inconsistent with specified format")}}function D(t){n.pixelStorei(37440,t.flipY),n.pixelStorei(37441,t.premultiplyAlpha),n.pixelStorei(37443,t.colorSpace),n.pixelStorei(3317,t.unpackAlignment)}function N(){T.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function k(e,n){var r=null;if(ue(n)?r=n:n&&(E.type(n,"object","invalid pixel data type"),C(e,n),"x"in n&&(e.xOffset=0|n.x),"y"in n&&(e.yOffset=0|n.y),ue(n.data)&&(r=n.data)),E(!e.compressed||r instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),n.copy){E(!r,"can not specify copy and data field for the same texture");var o=a.viewportWidth,u=a.viewportHeight;e.width=e.width||o-e.xOffset,e.height=e.height||u-e.yOffset,e.needsCopy=!0,E(e.xOffset>=0&&e.xOffset<o&&e.yOffset>=0&&e.yOffset<u&&e.width>0&&e.width<=o&&e.height>0&&e.height<=u,"copy texture read out of bounds")}else if(r){if(t(r))e.channels=e.channels||4,e.data=r,"type"in n||e.type!==Ot||(e.type=se(r));else if(ne(r))e.channels=e.channels||4,function(t,e){var n=e.length;switch(t.type){case Ot:case Mt:case Pt:case Gt:var r=U.allocType(t.type,n);r.set(e),t.data=r;break;case Ct:t.data=ht(e);break;default:E.raise("unsupported texture type, must specify a typed array")}}(e,r),e.alignment=1,e.needsFree=!0;else if(W(r)){var s=r.data;Array.isArray(s)||e.type!==Ot||(e.type=se(s));var c,f,l,h,d,p,v=r.shape,g=r.stride;3===v.length?(l=v[2],p=g[2]):(E(2===v.length,"invalid ndarray pixel data, must be 2 or 3D"),l=1,p=1),c=v[0],f=v[1],h=g[0],d=g[1],e.alignment=1,e.width=c,e.height=f,e.channels=l,e.format=e.internalformat=Vt[l],e.needsFree=!0,function(t,e,n,r,i,o){for(var a=t.width,u=t.height,s=t.channels,c=ce(t,a*u*s),f=0,l=0;l<u;++l)for(var h=0;h<a;++h)for(var d=0;d<s;++d)c[f++]=e[n*h+r*l+i*d+o];fe(t,c)}(e,s,h,d,p,r.offset)}else if(oe(r)||ae(r)||ie(r)===Kt)oe(r)||ae(r)?e.element=r:e.element=r.canvas,e.width=e.element.width,e.height=e.element.height,e.channels=4;else if(function(t){return ie(t)===Zt}(r))e.element=r,e.width=r.width,e.height=r.height,e.channels=4;else if(function(t){return ie(t)===$t}(r))e.element=r,e.width=r.naturalWidth,e.height=r.naturalHeight,e.channels=4;else if(function(t){return ie(t)===Jt}(r))e.element=r,e.width=r.videoWidth,e.height=r.videoHeight,e.channels=4;else if(re(r)){var y=e.width||r[0].length,m=e.height||r.length,b=e.channels;b=dt(r[0][0])?b||r[0][0].length:b||1;for(var _=X.shape(r),x=1,w=0;w<_.length;++w)x*=_[w];var S=ce(e,x);X.flatten(r,_,"",S),fe(e,S),e.alignment=1,e.width=y,e.height=m,e.channels=b,e.format=e.internalformat=Vt[b],e.needsFree=!0}}else e.width=e.width||1,e.height=e.height||1,e.channels=e.channels||4;e.type===Gt?E(i.extensions.indexOf("oes_texture_float")>=0,"oes_texture_float extension not enabled"):e.type===Ct&&E(i.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function R(t,e,r){var i=t.element,a=t.data,u=t.internalformat,s=t.format,c=t.type,f=t.width,l=t.height;D(t),i?n.texImage2D(e,r,s,s,c,i):t.compressed?n.compressedTexImage2D(e,r,u,f,l,0,a):t.needsCopy?(o(),n.copyTexImage2D(e,r,s,t.xOffset,t.yOffset,f,l,0)):n.texImage2D(e,r,s,f,l,0,s,c,a||null)}function O(t,e,r,i,a){var u=t.element,s=t.data,c=t.internalformat,f=t.format,l=t.type,h=t.width,d=t.height;D(t),u?n.texSubImage2D(e,a,r,i,f,l,u):t.compressed?n.compressedTexSubImage2D(e,a,r,i,c,h,d,s):t.needsCopy?(o(),n.copyTexSubImage2D(e,a,r,i,t.xOffset,t.yOffset,h,d)):n.texSubImage2D(e,a,r,i,h,d,f,l,s)}var M=[];function P(){return M.pop()||new N}function G(t){t.needsFree&&U.freeType(t.data),N.call(t),M.push(t)}function L(){T.call(this),this.genMipmaps=!1,this.mipmapHint=zt,this.mipmask=0,this.images=Array(16)}function F(t,e,n){var r=t.images[0]=P();t.mipmask=1,r.width=t.width=e,r.height=t.height=n,r.channels=t.channels=4}function B(t,e){var n=null;if(ue(e))I(n=t.images[0]=P(),t),k(n,e),t.mipmask=1;else if(C(t,e),Array.isArray(e.mipmap))for(var r=e.mipmap,i=0;i<r.length;++i)I(n=t.images[i]=P(),t),n.width>>=i,n.height>>=i,k(n,r[i]),t.mipmask|=1<<i;else I(n=t.images[0]=P(),t),k(n,e),t.mipmask=1;I(t,t.images[0]),!t.compressed||t.internalformat!==Dt&&t.internalformat!==Nt&&t.internalformat!==kt&&t.internalformat!==Rt||E(t.width%4==0&&t.height%4==0,"for compressed texture formats, mipmap level 0 must have width and height that are a multiple of 4")}function z(t,e){for(var n=t.images,r=0;r<n.length;++r){if(!n[r])return;R(n[r],e,r)}}var j=[];function H(){var t=j.pop()||new L;T.call(t),t.mipmask=0;for(var e=0;e<16;++e)t.images[e]=null;return t}function q(t){for(var e=t.images,n=0;n<e.length;++n)e[n]&&G(e[n]),e[n]=null;j.push(t)}function Y(){this.minFilter=Ut,this.magFilter=Ut,this.wrapS=Lt,this.wrapT=Lt,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=zt}function K(t,e){if("min"in e){var n=e.min;E.parameter(n,h),t.minFilter=h[n],Wt.indexOf(t.minFilter)>=0&&!("faces"in e)&&(t.genMipmaps=!0)}if("mag"in e){var r=e.mag;E.parameter(r,l),t.magFilter=l[r]}var o=t.wrapS,a=t.wrapT;if("wrap"in e){var u=e.wrap;"string"==typeof u?(E.parameter(u,f),o=a=f[u]):Array.isArray(u)&&(E.parameter(u[0],f),E.parameter(u[1],f),o=f[u[0]],a=f[u[1]])}else{if("wrapS"in e){var s=e.wrapS;E.parameter(s,f),o=f[s]}if("wrapT"in e){var d=e.wrapT;E.parameter(d,f),a=f[d]}}if(t.wrapS=o,t.wrapT=a,"anisotropic"in e){var p=e.anisotropic;E("number"==typeof p&&p>=1&&p<=i.maxAnisotropic,"aniso samples must be between 1 and "),t.anisotropic=e.anisotropic}if("mipmap"in e){var v=!1;switch(typeof e.mipmap){case"string":E.parameter(e.mipmap,c,"invalid mipmap hint"),t.mipmapHint=c[e.mipmap],t.genMipmaps=!0,v=!0;break;case"boolean":v=t.genMipmaps=e.mipmap;break;case"object":E(Array.isArray(e.mipmap),"invalid mipmap type"),t.genMipmaps=!1,v=!0;break;default:E.raise("invalid mipmap type")}v&&!("min"in e)&&(t.minFilter=Ft)}}function Z(t,e){n.texParameteri(e,10241,t.minFilter),n.texParameteri(e,10240,t.magFilter),n.texParameteri(e,10242,t.wrapS),n.texParameteri(e,10243,t.wrapT),r.ext_texture_filter_anisotropic&&n.texParameteri(e,34046,t.anisotropic),t.genMipmaps&&(n.hint(33170,t.mipmapHint),n.generateMipmap(e))}var $=0,J={},Q=i.maxTextureUnits,tt=Array(Q).map((function(){return null}));function et(t){T.call(this),this.mipmask=0,this.internalformat=mt,this.id=$++,this.refCount=1,this.target=t,this.texture=n.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Y,s.profile&&(this.stats={size:0})}function nt(t){n.activeTexture(jt),n.bindTexture(t.target,t.texture)}function rt(){var t=tt[0];t?n.bindTexture(t.target,t.texture):n.bindTexture(vt,null)}function it(t){var e=t.texture;E(e,"must not double destroy texture");var r=t.unit,i=t.target;r>=0&&(n.activeTexture(jt+r),n.bindTexture(i,null),tt[r]=null),n.deleteTexture(e),t.texture=null,t.params=null,t.pixels=null,t.refCount=0,delete J[t.id],u.textureCount--}return e(et.prototype,{bind:function(){var t=this;t.bindCount+=1;var e=t.unit;if(e<0){for(var r=0;r<Q;++r){var i=tt[r];if(i){if(i.bindCount>0)continue;i.unit=-1}tt[r]=t,e=r;break}e>=Q&&E.raise("insufficient number of texture units"),s.profile&&u.maxTextureUnits<e+1&&(u.maxTextureUnits=e+1),t.unit=e,n.activeTexture(jt+e),n.bindTexture(t.target,t.texture)}return e},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&it(this)}}),s.profile&&(u.getTotalTextureSize=function(){var t=0;return Object.keys(J).forEach((function(e){t+=J[e].stats.size})),t}),{create2D:function(t,e){var r=new et(vt);function o(t,e){var n=r.texInfo;Y.call(n);var a=H();return"number"==typeof t?F(a,0|t,"number"==typeof e?0|e:0|t):t?(E.type(t,"object","invalid arguments to regl.texture"),K(n,t),B(a,t)):F(a,1,1),n.genMipmaps&&(a.mipmask=(a.width<<1)-1),r.mipmask=a.mipmask,I(r,a),E.texture2D(n,a,i),r.internalformat=a.internalformat,o.width=a.width,o.height=a.height,nt(r),z(a,vt),Z(n,vt),rt(),q(a),s.profile&&(r.stats.size=le(r.internalformat,r.type,a.width,a.height,n.genMipmaps,!1)),o.format=b[r.internalformat],o.type=_[r.type],o.mag=x[n.magFilter],o.min=w[n.minFilter],o.wrapS=S[n.wrapS],o.wrapT=S[n.wrapT],o}return J[r.id]=r,u.textureCount++,o(t,e),o.subimage=function(t,e,n,i){E(!!t,"must specify image data");var a=0|e,u=0|n,s=0|i,c=P();return I(c,r),c.width=0,c.height=0,k(c,t),c.width=c.width||(r.width>>s)-a,c.height=c.height||(r.height>>s)-u,E(r.type===c.type&&r.format===c.format&&r.internalformat===c.internalformat,"incompatible format for texture.subimage"),E(a>=0&&u>=0&&a+c.width<=r.width&&u+c.height<=r.height,"texture.subimage write out of bounds"),E(r.mipmask&1<<s,"missing mipmap data"),E(c.data||c.element||c.needsCopy,"missing image data"),nt(r),O(c,vt,a,u,s),rt(),G(c),o},o.resize=function(t,e){var i=0|t,a=0|e||i;if(i===r.width&&a===r.height)return o;o.width=r.width=i,o.height=r.height=a,nt(r);for(var u=0;r.mipmask>>u;++u){var c=i>>u,f=a>>u;if(!c||!f)break;n.texImage2D(vt,u,r.format,c,f,0,r.format,r.type,null)}return rt(),s.profile&&(r.stats.size=le(r.internalformat,r.type,i,a,!1,!1)),o},o._reglType="texture2d",o._texture=r,s.profile&&(o.stats=r.stats),o.destroy=function(){r.decRef()},o},createCube:function(t,e,r,o,a,c){var f=new et(gt);J[f.id]=f,u.cubeCount++;var l=new Array(6);function h(t,e,n,r,o,a){var u,c=f.texInfo;for(Y.call(c),u=0;u<6;++u)l[u]=H();if("number"!=typeof t&&t)if("object"==typeof t)if(e)B(l[0],t),B(l[1],e),B(l[2],n),B(l[3],r),B(l[4],o),B(l[5],a);else if(K(c,t),C(f,t),"faces"in t){var d=t.faces;for(E(Array.isArray(d)&&6===d.length,"cube faces must be a length 6 array"),u=0;u<6;++u)E("object"==typeof d[u]&&!!d[u],"invalid input for cube map face"),I(l[u],f),B(l[u],d[u])}else for(u=0;u<6;++u)B(l[u],t);else E.raise("invalid arguments to cube map");else{var p=0|t||1;for(u=0;u<6;++u)F(l[u],p,p)}for(I(f,l[0]),i.npotTextureCube||E(pt(f.width)&&pt(f.height),"your browser does not support non power or two texture dimensions"),c.genMipmaps?f.mipmask=(l[0].width<<1)-1:f.mipmask=l[0].mipmask,E.textureCube(f,c,l,i),f.internalformat=l[0].internalformat,h.width=l[0].width,h.height=l[0].height,nt(f),u=0;u<6;++u)z(l[u],yt+u);for(Z(c,gt),rt(),s.profile&&(f.stats.size=le(f.internalformat,f.type,h.width,h.height,c.genMipmaps,!0)),h.format=b[f.internalformat],h.type=_[f.type],h.mag=x[c.magFilter],h.min=w[c.minFilter],h.wrapS=S[c.wrapS],h.wrapT=S[c.wrapT],u=0;u<6;++u)q(l[u]);return h}return h(t,e,r,o,a,c),h.subimage=function(t,e,n,r,i){E(!!e,"must specify image data"),E("number"==typeof t&&t===(0|t)&&t>=0&&t<6,"invalid face");var o=0|n,a=0|r,u=0|i,s=P();return I(s,f),s.width=0,s.height=0,k(s,e),s.width=s.width||(f.width>>u)-o,s.height=s.height||(f.height>>u)-a,E(f.type===s.type&&f.format===s.format&&f.internalformat===s.internalformat,"incompatible format for texture.subimage"),E(o>=0&&a>=0&&o+s.width<=f.width&&a+s.height<=f.height,"texture.subimage write out of bounds"),E(f.mipmask&1<<u,"missing mipmap data"),E(s.data||s.element||s.needsCopy,"missing image data"),nt(f),O(s,yt+t,o,a,u),rt(),G(s),h},h.resize=function(t){var e=0|t;if(e!==f.width){h.width=f.width=e,h.height=f.height=e,nt(f);for(var r=0;r<6;++r)for(var i=0;f.mipmask>>i;++i)n.texImage2D(yt+r,i,f.format,e>>i,e>>i,0,f.format,f.type,null);return rt(),s.profile&&(f.stats.size=le(f.internalformat,f.type,h.width,h.height,!1,!0)),h}},h._reglType="textureCube",h._texture=f,s.profile&&(h.stats=f.stats),h.destroy=function(){f.decRef()},h},clear:function(){for(var t=0;t<Q;++t)n.activeTexture(jt+t),n.bindTexture(vt,null),tt[t]=null;V(J).forEach(it),u.cubeCount=0,u.textureCount=0},getTexture:function(t){return null},restore:function(){for(var t=0;t<Q;++t){var e=tt[t];e&&(e.bindCount=0,e.unit=-1,tt[t]=null)}V(J).forEach((function(t){t.texture=n.createTexture(),n.bindTexture(t.target,t.texture);for(var e=0;e<32;++e)if(0!=(t.mipmask&1<<e))if(t.target===vt)n.texImage2D(vt,e,t.internalformat,t.width>>e,t.height>>e,0,t.internalformat,t.type,null);else for(var r=0;r<6;++r)n.texImage2D(yt+r,e,t.internalformat,t.width>>e,t.height>>e,0,t.internalformat,t.type,null);Z(t.texInfo,t.target)}))},refresh:function(){for(var t=0;t<Q;++t){var e=tt[t];e&&(e.bindCount=0,e.unit=-1,tt[t]=null),n.activeTexture(jt+t),n.bindTexture(vt,null),n.bindTexture(gt,null)}}}}ee[32854]=2,ee[32855]=2,ee[36194]=2,ee[34041]=4,ee[33776]=.5,ee[33777]=.5,ee[33778]=1,ee[33779]=1,ee[35986]=.5,ee[35987]=1,ee[34798]=1,ee[35840]=.5,ee[35841]=.25,ee[35842]=.5,ee[35843]=.25,ee[36196]=.5;var de=36161,pe=32854,ve=[];function ge(t,e,n){return ve[t]*e*n}ve[32854]=2,ve[32855]=2,ve[36194]=2,ve[33189]=2,ve[36168]=1,ve[34041]=4,ve[35907]=4,ve[34836]=16,ve[34842]=8,ve[34843]=6;var ye=36160,me=36161,be=3553,_e=34069,xe=[6407,6408],we=[];we[6408]=4,we[6407]=3;var Ee=[];Ee[5121]=1,Ee[5126]=4,Ee[36193]=2;var Se=[32854,32855,36194,35907,34842,34843,34836],Ae={};Ae[36053]="complete",Ae[36054]="incomplete attachment",Ae[36057]="incomplete dimensions",Ae[36055]="incomplete, missing attachment",Ae[36061]="unsupported";function Te(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.offset=0,this.stride=0,this.divisor=0}var Ie=5121,Ce=5126;function De(e,n,r,i,o,a,u){function s(s){var c;null===n.next?(E(o.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),c=Ie):(E(null!==n.next.colorAttachments[0].texture,"You cannot read from a renderbuffer"),c=n.next.colorAttachments[0].texture._texture.type,a.oes_texture_float?(E(c===Ie||c===Ce,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"),c===Ce&&E(u.readFloat,"Reading 'float' values is not permitted in your browser. For a fallback, please see: https://www.npmjs.com/package/glsl-read-float")):E(c===Ie,"Reading from a framebuffer is only allowed for the type 'uint8'"));var f=0,l=0,h=i.framebufferWidth,d=i.framebufferHeight,p=null;t(s)?p=s:s&&(E.type(s,"object","invalid arguments to regl.read()"),f=0|s.x,l=0|s.y,E(f>=0&&f<i.framebufferWidth,"invalid x offset for regl.read"),E(l>=0&&l<i.framebufferHeight,"invalid y offset for regl.read"),h=0|(s.width||i.framebufferWidth-f),d=0|(s.height||i.framebufferHeight-l),p=s.data||null),p&&(c===Ie?E(p instanceof Uint8Array,"buffer must be 'Uint8Array' when reading from a framebuffer of type 'uint8'"):c===Ce&&E(p instanceof Float32Array,"buffer must be 'Float32Array' when reading from a framebuffer of type 'float'")),E(h>0&&h+f<=i.framebufferWidth,"invalid width for read pixels"),E(d>0&&d+l<=i.framebufferHeight,"invalid height for read pixels"),r();var v=h*d*4;return p||(c===Ie?p=new Uint8Array(v):c===Ce&&(p=p||new Float32Array(v))),E.isTypedArray(p,"data buffer for regl.read() must be a typedarray"),E(p.byteLength>=v,"data buffer for regl.read() too small"),e.pixelStorei(3333,4),e.readPixels(f,l,h,d,6408,c,p),p}return function(t){return t&&"framebuffer"in t?function(t){var e;return n.setFBO({framebuffer:t.framebuffer},(function(){e=s(t)})),e}(t):s(t)}}function Ne(t){return Array.prototype.slice.call(t)}function ke(t){return Ne(t).join("")}var Re="xyzw".split(""),Oe="dither",Me="blend.enable",Pe="blend.color",Ge="blend.equation",Le="blend.func",Ue="depth.enable",Fe="depth.func",Be="depth.range",ze="depth.mask",je="colorMask",We="cull.enable",Ve="cull.face",Xe="frontFace",He="lineWidth",qe="polygonOffset.enable",Ye="polygonOffset.offset",Ke="sample.alpha",Ze="sample.enable",$e="sample.coverage",Je="stencil.enable",Qe="stencil.mask",tn="stencil.func",en="stencil.opFront",nn="stencil.opBack",rn="scissor.enable",on="scissor.box",an="viewport",un="profile",sn="framebuffer",cn="vert",fn="frag",ln="elements",hn="primitive",dn="count",pn="offset",vn="instances",gn="vao",yn="Width",mn="Height",bn=sn+yn,_n=sn+mn,xn="drawingBufferWidth",wn="drawingBufferHeight",En=[Le,Ge,tn,en,nn,$e,an,on,Ye],Sn=34962,An=5126,Tn=35664,In=35665,Cn=35666,Dn=5124,Nn=35667,kn=35668,Rn=35669,On=35670,Mn=35671,Pn=35672,Gn=35673,Ln=35674,Un=35675,Fn=35676,Bn=35678,zn=35680,jn=1028,Wn=1029,Vn=2305,Xn=7680,Hn={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},qn=["constant color, constant alpha","one minus constant color, constant alpha","constant color, one minus constant alpha","one minus constant color, one minus constant alpha","constant alpha, constant color","constant alpha, one minus constant color","one minus constant alpha, constant color","one minus constant alpha, one minus constant color"],Yn={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Kn={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Zn={frag:35632,vert:35633},$n={cw:2304,ccw:Vn};function Jn(e){return Array.isArray(e)||t(e)||W(e)}function Qn(t){return t.sort((function(t,e){return t===an?-1:e===an?1:t<e?-1:1}))}function tr(t,e,n,r){this.thisDep=t,this.contextDep=e,this.propDep=n,this.append=r}function er(t){return t&&!(t.thisDep||t.contextDep||t.propDep)}function nr(t){return new tr(!1,!1,!1,t)}function rr(t,e){var n=t.type;if(0===n){var r=t.data.length;return new tr(!0,r>=1,r>=2,e)}if(4===n){var i=t.data;return new tr(i.thisDep,i.contextDep,i.propDep,e)}if(5===n)return new tr(!1,!1,!1,e);if(6===n){for(var o=!1,a=!1,u=!1,s=0;s<t.data.length;++s){var c=t.data[s];if(1===c.type)u=!0;else if(2===c.type)a=!0;else if(3===c.type)o=!0;else if(0===c.type){o=!0;var f=c.data;f>=1&&(a=!0),f>=2&&(u=!0)}else 4===c.type&&(o=o||c.data.thisDep,a=a||c.data.contextDep,u=u||c.data.propDep)}return new tr(o,a,u,e)}return new tr(3===n,2===n,1===n,e)}var ir=new tr(!1,!1,!1,(function(){}));function or(t,n,r,i,o,a,u,s,c,f,l,h,d,p,v){var g=f.Record,y={add:32774,subtract:32778,"reverse subtract":32779};r.ext_blend_minmax&&(y.min=32775,y.max=32776);var m=r.angle_instanced_arrays,b=r.webgl_draw_buffers,_={dirty:!0,profile:v.profile},x={},w=[],S={},A={};function T(t){return t.replace(".","_")}function I(t,e,n){var r=T(t);w.push(t),x[r]=_[r]=!!n,S[r]=e}function C(t,e,n){var r=T(t);w.push(t),Array.isArray(n)?(_[r]=n.slice(),x[r]=n.slice()):_[r]=x[r]=n,A[r]=e}I(Oe,3024),I(Me,3042),C(Pe,"blendColor",[0,0,0,0]),C(Ge,"blendEquationSeparate",[32774,32774]),C(Le,"blendFuncSeparate",[1,0,1,0]),I(Ue,2929,!0),C(Fe,"depthFunc",513),C(Be,"depthRange",[0,1]),C(ze,"depthMask",!0),C(je,je,[!0,!0,!0,!0]),I(We,2884),C(Ve,"cullFace",Wn),C(Xe,Xe,Vn),C(He,He,1),I(qe,32823),C(Ye,"polygonOffset",[0,0]),I(Ke,32926),I(Ze,32928),C($e,"sampleCoverage",[1,!1]),I(Je,2960),C(Qe,"stencilMask",-1),C(tn,"stencilFunc",[519,0,-1]),C(en,"stencilOpSeparate",[jn,Xn,Xn,Xn]),C(nn,"stencilOpSeparate",[Wn,Xn,Xn,Xn]),I(rn,3089),C(on,"scissor",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]),C(an,an,[0,0,t.drawingBufferWidth,t.drawingBufferHeight]);var N={gl:t,context:d,strings:n,next:x,current:_,draw:h,elements:a,buffer:o,shader:l,attributes:f.state,vao:f,uniforms:c,framebuffer:s,extensions:r,timer:p,isBufferArgs:Jn},k={primTypes:ot,compareFuncs:Yn,blendFuncs:Hn,blendEquations:y,stencilOps:Kn,glTypes:K,orientationType:$n};E.optional((function(){N.isArrayLike=dt})),b&&(k.backBuffer=[Wn],k.drawBuffer=P(i.maxDrawbuffers,(function(t){return 0===t?[0]:P(t,(function(t){return 36064+t}))})));var R=0;function O(){var t=function(){var t=0,n=[],r=[];function i(){var n=[],r=[];return e((function(){n.push.apply(n,Ne(arguments))}),{def:function(){var e="v"+t++;return r.push(e),arguments.length>0&&(n.push(e,"="),n.push.apply(n,Ne(arguments)),n.push(";")),e},toString:function(){return ke([r.length>0?"var "+r.join(",")+";":"",ke(n)])}})}function o(){var t=i(),n=i(),r=t.toString,o=n.toString;function a(e,r){n(e,r,"=",t.def(e,r),";")}return e((function(){t.apply(t,Ne(arguments))}),{def:t.def,entry:t,exit:n,save:a,set:function(e,n,r){a(e,n),t(e,n,"=",r,";")},toString:function(){return r()+o()}})}var a=i(),u={};return{global:a,link:function(e){for(var i=0;i<r.length;++i)if(r[i]===e)return n[i];var o="g"+t++;return n.push(o),r.push(e),o},block:i,proc:function(t,n){var r=[];function i(){var t="a"+r.length;return r.push(t),t}n=n||0;for(var a=0;a<n;++a)i();var s=o(),c=s.toString;return u[t]=e(s,{arg:i,toString:function(){return ke(["function(",r.join(),"){",c(),"}"])}})},scope:o,cond:function(){var t=ke(arguments),n=o(),r=o(),i=n.toString,a=r.toString;return e(n,{then:function(){return n.apply(n,Ne(arguments)),this},else:function(){return r.apply(r,Ne(arguments)),this},toString:function(){var e=a();return e&&(e="else{"+e+"}"),ke(["if(",t,"){",i(),"}",e])}})},compile:function(){var t=['"use strict";',a,"return {"];Object.keys(u).forEach((function(e){t.push('"',e,'":',u[e].toString(),",")})),t.push("}");var e=ke(t).replace(/;/g,";\n").replace(/}/g,"}\n").replace(/{/g,"{\n");return Function.apply(null,n.concat(e)).apply(null,r)}}}(),r=t.link,i=t.global;t.id=R++,t.batchId="0";var o=r(N),a=t.shared={props:"a0"};Object.keys(N).forEach((function(t){a[t]=i.def(o,".",t)})),E.optional((function(){t.CHECK=r(E),t.commandStr=E.guessCommand(),t.command=r(t.commandStr),t.assert=function(t,e,n){t("if(!(",e,"))",this.CHECK,".commandRaise(",r(n),",",this.command,");")},k.invalidBlendCombinations=qn}));var u=t.next={},s=t.current={};Object.keys(A).forEach((function(t){Array.isArray(_[t])&&(u[t]=i.def(a.next,".",t),s[t]=i.def(a.current,".",t))}));var c=t.constants={};Object.keys(k).forEach((function(t){c[t]=i.def(JSON.stringify(k[t]))})),t.invoke=function(e,n){switch(n.type){case 0:var i=["this",a.context,a.props,t.batchId];return e.def(r(n.data),".call(",i.slice(0,Math.max(n.data.length+1,4)),")");case 1:return e.def(a.props,n.data);case 2:return e.def(a.context,n.data);case 3:return e.def("this",n.data);case 4:return n.data.append(t,e),n.data.ref;case 5:return n.data.toString();case 6:return n.data.map((function(n){return t.invoke(e,n)}))}},t.attribCache={};var l={};return t.scopeAttrib=function(t){var e=n.id(t);if(e in l)return l[e];var i=f.scope[e];return i||(i=f.scope[e]=new g),l[e]=r(i)},t}function M(t,e,u,c,h){var d=t.static,p=t.dynamic;E.optional((function(){var t=[sn,cn,fn,ln,hn,pn,dn,vn,un,gn].concat(w);function e(e){Object.keys(e).forEach((function(e){E.command(t.indexOf(e)>=0,'unknown parameter "'+e+'"',h.commandStr)}))}e(d),e(p)}));var v=function(t,e){var n=t.static;if("string"==typeof n[fn]&&"string"==typeof n[cn]){if(Object.keys(e.dynamic).length>0)return null;var r=e.static,i=Object.keys(r);if(i.length>0&&"number"==typeof r[i[0]]){for(var o=[],a=0;a<i.length;++a)E("number"==typeof r[i[a]],"must specify all vertex attribute locations when using vaos"),o.push([0|r[i[a]],i[a]]);return o}}return null}(t,e),b=function(t,e){var n=t.static,r=t.dynamic;if(sn in n){var i=n[sn];return i?(i=s.getFramebuffer(i),E.command(i,"invalid framebuffer object"),nr((function(t,e){var n=t.link(i),r=t.shared;e.set(r.framebuffer,".next",n);var o=r.context;return e.set(o,"."+bn,n+".width"),e.set(o,"."+_n,n+".height"),n}))):nr((function(t,e){var n=t.shared;e.set(n.framebuffer,".next","null");var r=n.context;return e.set(r,"."+bn,r+"."+xn),e.set(r,"."+_n,r+"."+wn),"null"}))}if(sn in r){var o=r[sn];return rr(o,(function(t,e){var n=t.invoke(e,o),r=t.shared,i=r.framebuffer,a=e.def(i,".getFramebuffer(",n,")");E.optional((function(){t.assert(e,"!"+n+"||"+a,"invalid framebuffer object")})),e.set(i,".next",a);var u=r.context;return e.set(u,"."+bn,a+"?"+a+".width:"+u+"."+xn),e.set(u,"."+_n,a+"?"+a+".height:"+u+"."+wn),a}))}return null}(t),_=function(t,e,n){var r=t.static,i=t.dynamic;function o(t){if(t in r){var o=r[t];E.commandType(o,"object","invalid "+t,n.commandStr);var a,u,s=!0,c=0|o.x,f=0|o.y;return"width"in o?(a=0|o.width,E.command(a>=0,"invalid "+t,n.commandStr)):s=!1,"height"in o?(u=0|o.height,E.command(u>=0,"invalid "+t,n.commandStr)):s=!1,new tr(!s&&e&&e.thisDep,!s&&e&&e.contextDep,!s&&e&&e.propDep,(function(t,e){var n=t.shared.context,r=a;"width"in o||(r=e.def(n,".",bn,"-",c));var i=u;return"height"in o||(i=e.def(n,".",_n,"-",f)),[c,f,r,i]}))}if(t in i){var l=i[t],h=rr(l,(function(e,n){var r=e.invoke(n,l);E.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)}));var i=e.shared.context,o=n.def(r,".x|0"),a=n.def(r,".y|0"),u=n.def('"width" in ',r,"?",r,".width|0:","(",i,".",bn,"-",o,")"),s=n.def('"height" in ',r,"?",r,".height|0:","(",i,".",_n,"-",a,")");return E.optional((function(){e.assert(n,u+">=0&&"+s+">=0","invalid "+t)})),[o,a,u,s]}));return e&&(h.thisDep=h.thisDep||e.thisDep,h.contextDep=h.contextDep||e.contextDep,h.propDep=h.propDep||e.propDep),h}return e?new tr(e.thisDep,e.contextDep,e.propDep,(function(t,e){var n=t.shared.context;return[0,0,e.def(n,".",bn),e.def(n,".",_n)]})):null}var a=o(an);if(a){var u=a;a=new tr(a.thisDep,a.contextDep,a.propDep,(function(t,e){var n=u.append(t,e),r=t.shared.context;return e.set(r,".viewportWidth",n[2]),e.set(r,".viewportHeight",n[3]),n}))}return{viewport:a,scissor_box:o(on)}}(t,b,h),x=function(t,e){var n=t.static,r=t.dynamic,i=function(){if(ln in n){var t=n[ln];Jn(t)?t=a.getElements(a.create(t,!0)):t&&(t=a.getElements(t),E.command(t,"invalid elements",e.commandStr));var i=nr((function(e,n){if(t){var r=e.link(t);return e.ELEMENTS=r,r}return e.ELEMENTS=null,null}));return i.value=t,i}if(ln in r){var o=r[ln];return rr(o,(function(t,e){var n=t.shared,r=n.isBufferArgs,i=n.elements,a=t.invoke(e,o),u=e.def("null"),s=e.def(r,"(",a,")"),c=t.cond(s).then(u,"=",i,".createStream(",a,");").else(u,"=",i,".getElements(",a,");");return E.optional((function(){t.assert(c.else,"!"+a+"||"+u,"invalid elements")})),e.entry(c),e.exit(t.cond(s).then(i,".destroyStream(",u,");")),t.ELEMENTS=u,u}))}return null}();function o(t,o){if(t in n){var a=0|n[t];return E.command(!o||a>=0,"invalid "+t,e.commandStr),nr((function(t,e){return o&&(t.OFFSET=a),a}))}if(t in r){var u=r[t];return rr(u,(function(e,n){var r=e.invoke(n,u);return o&&(e.OFFSET=r,E.optional((function(){e.assert(n,r+">=0","invalid "+t)}))),r}))}return o&&i?nr((function(t,e){return t.OFFSET="0",0})):null}var u=o(pn,!0);return{elements:i,primitive:function(){if(hn in n){var t=n[hn];return E.commandParameter(t,ot,"invalid primitve",e.commandStr),nr((function(e,n){return ot[t]}))}if(hn in r){var o=r[hn];return rr(o,(function(t,e){var n=t.constants.primTypes,r=t.invoke(e,o);return E.optional((function(){t.assert(e,r+" in "+n,"invalid primitive, must be one of "+Object.keys(ot))})),e.def(n,"[",r,"]")}))}return i?er(i)?i.value?nr((function(t,e){return e.def(t.ELEMENTS,".primType")})):nr((function(){return 4})):new tr(i.thisDep,i.contextDep,i.propDep,(function(t,e){var n=t.ELEMENTS;return e.def(n,"?",n,".primType:",4)})):null}(),count:function(){if(dn in n){var t=0|n[dn];return E.command("number"==typeof t&&t>=0,"invalid vertex count",e.commandStr),nr((function(){return t}))}if(dn in r){var o=r[dn];return rr(o,(function(t,e){var n=t.invoke(e,o);return E.optional((function(){t.assert(e,"typeof "+n+'==="number"&&'+n+">=0&&"+n+"===("+n+"|0)","invalid vertex count")})),n}))}if(i){if(er(i)){if(i)return u?new tr(u.thisDep,u.contextDep,u.propDep,(function(t,e){var n=e.def(t.ELEMENTS,".vertCount-",t.OFFSET);return E.optional((function(){t.assert(e,n+">=0","invalid vertex offset/element buffer too small")})),n})):nr((function(t,e){return e.def(t.ELEMENTS,".vertCount")}));var a=nr((function(){return-1}));return E.optional((function(){a.MISSING=!0})),a}var s=new tr(i.thisDep||u.thisDep,i.contextDep||u.contextDep,i.propDep||u.propDep,(function(t,e){var n=t.ELEMENTS;return t.OFFSET?e.def(n,"?",n,".vertCount-",t.OFFSET,":-1"):e.def(n,"?",n,".vertCount:-1")}));return E.optional((function(){s.DYNAMIC=!0})),s}return null}(),instances:o(vn,!1),offset:u}}(t,h),S=function(t,e){var n=t.static,r=t.dynamic,o={};return w.forEach((function(t){var a=T(t);function u(e,i){if(t in n){var u=e(n[t]);o[a]=nr((function(){return u}))}else if(t in r){var s=r[t];o[a]=rr(s,(function(t,e){return i(t,e,t.invoke(e,s))}))}}switch(t){case We:case Me:case Oe:case Je:case Ue:case rn:case qe:case Ke:case Ze:case ze:return u((function(n){return E.commandType(n,"boolean",t,e.commandStr),n}),(function(e,n,r){return E.optional((function(){e.assert(n,"typeof "+r+'==="boolean"',"invalid flag "+t,e.commandStr)})),r}));case Fe:return u((function(n){return E.commandParameter(n,Yn,"invalid "+t,e.commandStr),Yn[n]}),(function(e,n,r){var i=e.constants.compareFuncs;return E.optional((function(){e.assert(n,r+" in "+i,"invalid "+t+", must be one of "+Object.keys(Yn))})),n.def(i,"[",r,"]")}));case Be:return u((function(t){return E.command(dt(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]&&t[0]<=t[1],"depth range is 2d array",e.commandStr),t}),(function(t,e,n){return E.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===2&&typeof "+n+'[0]==="number"&&typeof '+n+'[1]==="number"&&'+n+"[0]<="+n+"[1]","depth range must be a 2d array")})),[e.def("+",n,"[0]"),e.def("+",n,"[1]")]}));case Le:return u((function(t){E.commandType(t,"object","blend.func",e.commandStr);var n="srcRGB"in t?t.srcRGB:t.src,r="srcAlpha"in t?t.srcAlpha:t.src,i="dstRGB"in t?t.dstRGB:t.dst,o="dstAlpha"in t?t.dstAlpha:t.dst;return E.commandParameter(n,Hn,a+".srcRGB",e.commandStr),E.commandParameter(r,Hn,a+".srcAlpha",e.commandStr),E.commandParameter(i,Hn,a+".dstRGB",e.commandStr),E.commandParameter(o,Hn,a+".dstAlpha",e.commandStr),E.command(-1===qn.indexOf(n+", "+i),"unallowed blending combination (srcRGB, dstRGB) = ("+n+", "+i+")",e.commandStr),[Hn[n],Hn[i],Hn[r],Hn[o]]}),(function(e,n,r){var i=e.constants.blendFuncs;function o(o,a){var u=n.def('"',o,a,'" in ',r,"?",r,".",o,a,":",r,".",o);return E.optional((function(){e.assert(n,u+" in "+i,"invalid "+t+"."+o+a+", must be one of "+Object.keys(Hn))})),u}E.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid blend func, must be an object")}));var a=o("src","RGB"),u=o("dst","RGB");E.optional((function(){var t=e.constants.invalidBlendCombinations;e.assert(n,t+".indexOf("+a+'+", "+'+u+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")}));var s=n.def(i,"[",a,"]"),c=n.def(i,"[",o("src","Alpha"),"]");return[s,n.def(i,"[",u,"]"),c,n.def(i,"[",o("dst","Alpha"),"]")]}));case Ge:return u((function(n){return"string"==typeof n?(E.commandParameter(n,y,"invalid "+t,e.commandStr),[y[n],y[n]]):"object"==typeof n?(E.commandParameter(n.rgb,y,t+".rgb",e.commandStr),E.commandParameter(n.alpha,y,t+".alpha",e.commandStr),[y[n.rgb],y[n.alpha]]):void E.commandRaise("invalid blend.equation",e.commandStr)}),(function(e,n,r){var i=e.constants.blendEquations,o=n.def(),a=n.def(),u=e.cond("typeof ",r,'==="string"');return E.optional((function(){function n(t,n,r){e.assert(t,r+" in "+i,"invalid "+n+", must be one of "+Object.keys(y))}n(u.then,t,r),e.assert(u.else,r+"&&typeof "+r+'==="object"',"invalid "+t),n(u.else,t+".rgb",r+".rgb"),n(u.else,t+".alpha",r+".alpha")})),u.then(o,"=",a,"=",i,"[",r,"];"),u.else(o,"=",i,"[",r,".rgb];",a,"=",i,"[",r,".alpha];"),n(u),[o,a]}));case Pe:return u((function(t){return E.command(dt(t)&&4===t.length,"blend.color must be a 4d array",e.commandStr),P(4,(function(e){return+t[e]}))}),(function(t,e,n){return E.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===4","blend.color must be a 4d array")})),P(4,(function(t){return e.def("+",n,"[",t,"]")}))}));case Qe:return u((function(t){return E.commandType(t,"number",a,e.commandStr),0|t}),(function(t,e,n){return E.optional((function(){t.assert(e,"typeof "+n+'==="number"',"invalid stencil.mask")})),e.def(n,"|0")}));case tn:return u((function(n){E.commandType(n,"object",a,e.commandStr);var r=n.cmp||"keep",i=n.ref||0,o="mask"in n?n.mask:-1;return E.commandParameter(r,Yn,t+".cmp",e.commandStr),E.commandType(i,"number",t+".ref",e.commandStr),E.commandType(o,"number",t+".mask",e.commandStr),[Yn[r],i,o]}),(function(t,e,n){var r=t.constants.compareFuncs;return E.optional((function(){function i(){t.assert(e,Array.prototype.join.call(arguments,""),"invalid stencil.func")}i(n+"&&typeof ",n,'==="object"'),i('!("cmp" in ',n,")||(",n,".cmp in ",r,")")})),[e.def('"cmp" in ',n,"?",r,"[",n,".cmp]",":",Xn),e.def(n,".ref|0"),e.def('"mask" in ',n,"?",n,".mask|0:-1")]}));case en:case nn:return u((function(n){E.commandType(n,"object",a,e.commandStr);var r=n.fail||"keep",i=n.zfail||"keep",o=n.zpass||"keep";return E.commandParameter(r,Kn,t+".fail",e.commandStr),E.commandParameter(i,Kn,t+".zfail",e.commandStr),E.commandParameter(o,Kn,t+".zpass",e.commandStr),[t===nn?Wn:jn,Kn[r],Kn[i],Kn[o]]}),(function(e,n,r){var i=e.constants.stencilOps;function o(o){return E.optional((function(){e.assert(n,'!("'+o+'" in '+r+")||("+r+"."+o+" in "+i+")","invalid "+t+"."+o+", must be one of "+Object.keys(Kn))})),n.def('"',o,'" in ',r,"?",i,"[",r,".",o,"]:",Xn)}return E.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)})),[t===nn?Wn:jn,o("fail"),o("zfail"),o("zpass")]}));case Ye:return u((function(t){E.commandType(t,"object",a,e.commandStr);var n=0|t.factor,r=0|t.units;return E.commandType(n,"number",a+".factor",e.commandStr),E.commandType(r,"number",a+".units",e.commandStr),[n,r]}),(function(e,n,r){return E.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)})),[n.def(r,".factor|0"),n.def(r,".units|0")]}));case Ve:return u((function(t){var n=0;return"front"===t?n=jn:"back"===t&&(n=Wn),E.command(!!n,a,e.commandStr),n}),(function(t,e,n){return E.optional((function(){t.assert(e,n+'==="front"||'+n+'==="back"',"invalid cull.face")})),e.def(n,'==="front"?',jn,":",Wn)}));case He:return u((function(t){return E.command("number"==typeof t&&t>=i.lineWidthDims[0]&&t<=i.lineWidthDims[1],"invalid line width, must be a positive number between "+i.lineWidthDims[0]+" and "+i.lineWidthDims[1],e.commandStr),t}),(function(t,e,n){return E.optional((function(){t.assert(e,"typeof "+n+'==="number"&&'+n+">="+i.lineWidthDims[0]+"&&"+n+"<="+i.lineWidthDims[1],"invalid line width")})),n}));case Xe:return u((function(t){return E.commandParameter(t,$n,a,e.commandStr),$n[t]}),(function(t,e,n){return E.optional((function(){t.assert(e,n+'==="cw"||'+n+'==="ccw"',"invalid frontFace, must be one of cw,ccw")})),e.def(n+'==="cw"?2304:'+Vn)}));case je:return u((function(t){return E.command(dt(t)&&4===t.length,"color.mask must be length 4 array",e.commandStr),t.map((function(t){return!!t}))}),(function(t,e,n){return E.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===4","invalid color.mask")})),P(4,(function(t){return"!!"+n+"["+t+"]"}))}));case $e:return u((function(t){E.command("object"==typeof t&&t,a,e.commandStr);var n="value"in t?t.value:1,r=!!t.invert;return E.command("number"==typeof n&&n>=0&&n<=1,"sample.coverage.value must be a number between 0 and 1",e.commandStr),[n,r]}),(function(t,e,n){return E.optional((function(){t.assert(e,n+"&&typeof "+n+'==="object"',"invalid sample.coverage")})),[e.def('"value" in ',n,"?+",n,".value:1"),e.def("!!",n,".invert")]}))}})),o}(t,h),A=function(t,e,r){var i=t.static,o=t.dynamic;function a(t){if(t in i){var e=n.id(i[t]);E.optional((function(){l.shader(Zn[t],e,E.guessCommand())}));var r=nr((function(){return e}));return r.id=e,r}if(t in o){var a=o[t];return rr(a,(function(e,n){var r=e.invoke(n,a),i=n.def(e.shared.strings,".id(",r,")");return E.optional((function(){n(e.shared.shader,".shader(",Zn[t],",",i,",",e.command,");")})),i}))}return null}var u,s=a(fn),c=a(cn),f=null;return er(s)&&er(c)?(f=l.program(c.id,s.id,null,r),u=nr((function(t,e){return t.link(f)}))):u=new tr(s&&s.thisDep||c&&c.thisDep,s&&s.contextDep||c&&c.contextDep,s&&s.propDep||c&&c.propDep,(function(t,e){var n,r=t.shared.shader;n=s?s.append(t,e):e.def(r,".",fn);var i=r+".program("+(c?c.append(t,e):e.def(r,".",cn))+","+n;return E.optional((function(){i+=","+t.command})),e.def(i+")")})),{frag:s,vert:c,progVar:u,program:f}}(t,0,v);function I(t){var e=_[t];e&&(S[t]=e)}I(an),I(T(on));var C=Object.keys(S).length>0,D={framebuffer:b,draw:x,shader:A,state:S,dirty:C,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(D.profile=function(t){var e,n=t.static,r=t.dynamic;if(un in n){var i=!!n[un];(e=nr((function(t,e){return i}))).enable=i}else if(un in r){var o=r[un];e=rr(o,(function(t,e){return t.invoke(e,o)}))}return e}(t),D.uniforms=function(t,e){var n=t.static,r=t.dynamic,i={};return Object.keys(n).forEach((function(t){var r,o=n[t];if("number"==typeof o||"boolean"==typeof o)r=nr((function(){return o}));else if("function"==typeof o){var a=o._reglType;"texture2d"===a||"textureCube"===a?r=nr((function(t){return t.link(o)})):"framebuffer"===a||"framebufferCube"===a?(E.command(o.color.length>0,'missing color attachment for framebuffer sent to uniform "'+t+'"',e.commandStr),r=nr((function(t){return t.link(o.color[0])}))):E.commandRaise('invalid data for uniform "'+t+'"',e.commandStr)}else dt(o)?r=nr((function(e){return e.global.def("[",P(o.length,(function(n){return E.command("number"==typeof o[n]||"boolean"==typeof o[n],"invalid uniform "+t,e.commandStr),o[n]})),"]")})):E.commandRaise('invalid or missing data for uniform "'+t+'"',e.commandStr);r.value=o,i[t]=r})),Object.keys(r).forEach((function(t){var e=r[t];i[t]=rr(e,(function(t,n){return t.invoke(n,e)}))})),i}(u,h),D.drawVAO=D.scopeVAO=function(t,e){var n=t.static,r=t.dynamic;if(gn in n){var i=n[gn];return null!==i&&null===f.getVAO(i)&&(i=f.createVAO(i)),nr((function(t){return t.link(f.getVAO(i))}))}if(gn in r){var o=r[gn];return rr(o,(function(t,e){var n=t.invoke(e,o);return e.def(t.shared.vao+".getVAO("+n+")")}))}return null}(t),!D.drawVAO&&A.program&&!v&&r.angle_instanced_arrays){var N=!0,k=A.program.attributes.map((function(t){var n=e.static[t];return N=N&&!!n,n}));if(N&&k.length>0){var R=f.getVAO(f.createVAO(k));D.drawVAO=new tr(null,null,null,(function(t,e){return t.link(R)})),D.useVAO=!0}}return v?D.useVAO=!0:D.attributes=function(t,e){var r=t.static,i=t.dynamic,a={};return Object.keys(r).forEach((function(t){var i=r[t],u=n.id(t),s=new g;if(Jn(i))s.state=1,s.buffer=o.getBuffer(o.create(i,Sn,!1,!0)),s.type=0;else{var c=o.getBuffer(i);if(c)s.state=1,s.buffer=c,s.type=0;else if(E.command("object"==typeof i&&i,"invalid data for attribute "+t,e.commandStr),"constant"in i){var f=i.constant;s.buffer="null",s.state=2,"number"==typeof f?s.x=f:(E.command(dt(f)&&f.length>0&&f.length<=4,"invalid constant for attribute "+t,e.commandStr),Re.forEach((function(t,e){e<f.length&&(s[t]=f[e])})))}else{c=Jn(i.buffer)?o.getBuffer(o.create(i.buffer,Sn,!1,!0)):o.getBuffer(i.buffer),E.command(!!c,'missing buffer for attribute "'+t+'"',e.commandStr);var l=0|i.offset;E.command(l>=0,'invalid offset for attribute "'+t+'"',e.commandStr);var h=0|i.stride;E.command(h>=0&&h<256,'invalid stride for attribute "'+t+'", must be integer betweeen [0, 255]',e.commandStr);var d=0|i.size;E.command(!("size"in i)||d>0&&d<=4,'invalid size for attribute "'+t+'", must be 1,2,3,4',e.commandStr);var p=!!i.normalized,v=0;"type"in i&&(E.commandParameter(i.type,K,"invalid type for attribute "+t,e.commandStr),v=K[i.type]);var y=0|i.divisor;"divisor"in i&&(E.command(0===y||m,'cannot specify divisor for attribute "'+t+'", instancing not supported',e.commandStr),E.command(y>=0,'invalid divisor for attribute "'+t+'"',e.commandStr)),E.optional((function(){var n=e.commandStr,r=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(i).forEach((function(e){E.command(r.indexOf(e)>=0,'unknown parameter "'+e+'" for attribute pointer "'+t+'" (valid parameters are '+r+")",n)}))})),s.buffer=c,s.state=1,s.size=d,s.normalized=p,s.type=v||c.dtype,s.offset=l,s.stride=h,s.divisor=y}}a[t]=nr((function(t,e){var n=t.attribCache;if(u in n)return n[u];var r={isStream:!1};return Object.keys(s).forEach((function(t){r[t]=s[t]})),s.buffer&&(r.buffer=t.link(s.buffer),r.type=r.type||r.buffer+".dtype"),n[u]=r,r}))})),Object.keys(i).forEach((function(t){var e=i[t];a[t]=rr(e,(function(n,r){var i=n.invoke(r,e),o=n.shared,a=n.constants,u=o.isBufferArgs,s=o.buffer;E.optional((function(){n.assert(r,i+"&&(typeof "+i+'==="object"||typeof '+i+'==="function")&&('+u+"("+i+")||"+s+".getBuffer("+i+")||"+s+".getBuffer("+i+".buffer)||"+u+"("+i+'.buffer)||("constant" in '+i+"&&(typeof "+i+'.constant==="number"||'+o.isArrayLike+"("+i+".constant))))",'invalid dynamic attribute "'+t+'"')}));var c={isStream:r.def(!1)},f=new g;f.state=1,Object.keys(f).forEach((function(t){c[t]=r.def(""+f[t])}));var l=c.buffer,h=c.type;function d(t){r(c[t],"=",i,".",t,"|0;")}return r("if(",u,"(",i,")){",c.isStream,"=true;",l,"=",s,".createStream(",Sn,",",i,");",h,"=",l,".dtype;","}else{",l,"=",s,".getBuffer(",i,");","if(",l,"){",h,"=",l,".dtype;",'}else if("constant" in ',i,"){",c.state,"=",2,";","if(typeof "+i+'.constant === "number"){',c[Re[0]],"=",i,".constant;",Re.slice(1).map((function(t){return c[t]})).join("="),"=0;","}else{",Re.map((function(t,e){return c[t]+"="+i+".constant.length>"+e+"?"+i+".constant["+e+"]:0;"})).join(""),"}}else{","if(",u,"(",i,".buffer)){",l,"=",s,".createStream(",Sn,",",i,".buffer);","}else{",l,"=",s,".getBuffer(",i,".buffer);","}",h,'="type" in ',i,"?",a.glTypes,"[",i,".type]:",l,".dtype;",c.normalized,"=!!",i,".normalized;"),d("size"),d("offset"),d("stride"),d("divisor"),r("}}"),r.exit("if(",c.isStream,"){",s,".destroyStream(",l,");","}"),c}))})),a}(e,h),D.context=function(t){var e=t.static,n=t.dynamic,r={};return Object.keys(e).forEach((function(t){var n=e[t];r[t]=nr((function(t,e){return"number"==typeof n||"boolean"==typeof n?""+n:t.link(n)}))})),Object.keys(n).forEach((function(t){var e=n[t];r[t]=rr(e,(function(t,n){return t.invoke(n,e)}))})),r}(c),D}function G(t,e,n){var r=t.shared.context,i=t.scope();Object.keys(n).forEach((function(o){e.save(r,"."+o);var a=n[o].append(t,e);Array.isArray(a)?i(r,".",o,"=[",a.join(),"];"):i(r,".",o,"=",a,";")})),e(i)}function L(t,e,n,r){var i,o=t.shared,a=o.gl,u=o.framebuffer;b&&(i=e.def(o.extensions,".webgl_draw_buffers"));var s,c=t.constants,f=c.drawBuffer,l=c.backBuffer;s=n?n.append(t,e):e.def(u,".next"),r||e("if(",s,"!==",u,".cur){"),e("if(",s,"){",a,".bindFramebuffer(",36160,",",s,".framebuffer);"),b&&e(i,".drawBuffersWEBGL(",f,"[",s,".colorAttachments.length]);"),e("}else{",a,".bindFramebuffer(",36160,",null);"),b&&e(i,".drawBuffersWEBGL(",l,");"),e("}",u,".cur=",s,";"),r||e("}")}function U(t,e,n){var r=t.shared,i=r.gl,o=t.current,a=t.next,u=r.current,s=r.next,c=t.cond(u,".dirty");w.forEach((function(e){var r,f,l=T(e);if(!(l in n.state))if(l in a){r=a[l],f=o[l];var h=P(_[l].length,(function(t){return c.def(r,"[",t,"]")}));c(t.cond(h.map((function(t,e){return t+"!=="+f+"["+e+"]"})).join("||")).then(i,".",A[l],"(",h,");",h.map((function(t,e){return f+"["+e+"]="+t})).join(";"),";"))}else{r=c.def(s,".",l);var d=t.cond(r,"!==",u,".",l);c(d),l in S?d(t.cond(r).then(i,".enable(",S[l],");").else(i,".disable(",S[l],");"),u,".",l,"=",r,";"):d(i,".",A[l],"(",r,");",u,".",l,"=",r,";")}})),0===Object.keys(n.state).length&&c(u,".dirty=false;"),e(c)}function F(t,e,n,r){var i=t.shared,o=t.current,a=i.current,u=i.gl;Qn(Object.keys(n)).forEach((function(i){var s=n[i];if(!r||r(s)){var c=s.append(t,e);if(S[i]){var f=S[i];er(s)?e(u,c?".enable(":".disable(",f,");"):e(t.cond(c).then(u,".enable(",f,");").else(u,".disable(",f,");")),e(a,".",i,"=",c,";")}else if(dt(c)){var l=o[i];e(u,".",A[i],"(",c,");",c.map((function(t,e){return l+"["+e+"]="+t})).join(";"),";")}else e(u,".",A[i],"(",c,");",a,".",i,"=",c,";")}}))}function B(t,e){m&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function z(t,e,n,r,i){var o,a,u,s=t.shared,c=t.stats,f=s.current,l=s.timer,h=n.profile;function d(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function v(t){t(o=e.def(),"=",d(),";"),"string"==typeof i?t(c,".count+=",i,";"):t(c,".count++;"),p&&(r?t(a=e.def(),"=",l,".getNumPendingQueries();"):t(l,".beginQuery(",c,");"))}function g(t){t(c,".cpuTime+=",d(),"-",o,";"),p&&(r?t(l,".pushScopeStats(",a,",",l,".getNumPendingQueries(),",c,");"):t(l,".endQuery();"))}function y(t){var n=e.def(f,".profile");e(f,".profile=",t,";"),e.exit(f,".profile=",n,";")}if(h){if(er(h))return void(h.enable?(v(e),g(e.exit),y("true")):y("false"));y(u=h.append(t,e))}else u=e.def(f,".profile");var m=t.block();v(m),e("if(",u,"){",m,"}");var b=t.block();g(b),e.exit("if(",u,"){",b,"}")}function j(t,e,n,r,i){var o=t.shared;r.forEach((function(r){var a,u=r.name,s=n.attributes[u];if(s){if(!i(s))return;a=s.append(t,e)}else{if(!i(ir))return;var c=t.scopeAttrib(u);E.optional((function(){t.assert(e,c+".state","missing attribute "+u)})),a={},Object.keys(new g).forEach((function(t){a[t]=e.def(c,".",t)}))}!function(n,r,i){var a=o.gl,u=e.def(n,".location"),s=e.def(o.attributes,"[",u,"]"),c=i.state,f=i.buffer,l=[i.x,i.y,i.z,i.w],h=["buffer","normalized","offset","stride"];function d(){e("if(!",s,".buffer){",a,".enableVertexAttribArray(",u,");}");var n,o=i.type;if(n=i.size?e.def(i.size,"||",r):r,e("if(",s,".type!==",o,"||",s,".size!==",n,"||",h.map((function(t){return s+"."+t+"!=="+i[t]})).join("||"),"){",a,".bindBuffer(",Sn,",",f,".buffer);",a,".vertexAttribPointer(",[u,n,o,i.normalized,i.stride,i.offset],");",s,".type=",o,";",s,".size=",n,";",h.map((function(t){return s+"."+t+"="+i[t]+";"})).join(""),"}"),m){var c=i.divisor;e("if(",s,".divisor!==",c,"){",t.instancing,".vertexAttribDivisorANGLE(",[u,c],");",s,".divisor=",c,";}")}}function p(){e("if(",s,".buffer){",a,".disableVertexAttribArray(",u,");",s,".buffer=null;","}if(",Re.map((function(t,e){return s+"."+t+"!=="+l[e]})).join("||"),"){",a,".vertexAttrib4f(",u,",",l,");",Re.map((function(t,e){return s+"."+t+"="+l[e]+";"})).join(""),"}")}1===c?d():2===c?p():(e("if(",c,"===",1,"){"),d(),e("}else{"),p(),e("}"))}(t.link(r),function(t){switch(t){case Tn:case Nn:case Mn:return 2;case In:case kn:case Pn:return 3;case Cn:case Rn:case Gn:return 4;default:return 1}}(r.info.type),a)}))}function W(t,e,r,i,o){for(var a,u=t.shared,s=u.gl,c=0;c<i.length;++c){var f,l=i[c],h=l.name,d=l.info.type,p=r.uniforms[h],v=t.link(l)+".location";if(p){if(!o(p))continue;if(er(p)){var g=p.value;if(E.command(null!=g,'missing uniform "'+h+'"',t.commandStr),d===Bn||d===zn){E.command("function"==typeof g&&(d===Bn&&("texture2d"===g._reglType||"framebuffer"===g._reglType)||d===zn&&("textureCube"===g._reglType||"framebufferCube"===g._reglType)),"invalid texture for uniform "+h,t.commandStr);var y=t.link(g._texture||g.color[0]._texture);e(s,".uniform1i(",v,",",y+".bind());"),e.exit(y,".unbind();")}else if(d===Ln||d===Un||d===Fn){E.optional((function(){E.command(dt(g),"invalid matrix for uniform "+h,t.commandStr),E.command(d===Ln&&4===g.length||d===Un&&9===g.length||d===Fn&&16===g.length,"invalid length for matrix uniform "+h,t.commandStr)}));var m=t.global.def("new Float32Array(["+Array.prototype.slice.call(g)+"])"),b=2;d===Un?b=3:d===Fn&&(b=4),e(s,".uniformMatrix",b,"fv(",v,",false,",m,");")}else{switch(d){case An:E.commandType(g,"number","uniform "+h,t.commandStr),a="1f";break;case Tn:E.command(dt(g)&&2===g.length,"uniform "+h,t.commandStr),a="2f";break;case In:E.command(dt(g)&&3===g.length,"uniform "+h,t.commandStr),a="3f";break;case Cn:E.command(dt(g)&&4===g.length,"uniform "+h,t.commandStr),a="4f";break;case On:E.commandType(g,"boolean","uniform "+h,t.commandStr),a="1i";break;case Dn:E.commandType(g,"number","uniform "+h,t.commandStr),a="1i";break;case Mn:case Nn:E.command(dt(g)&&2===g.length,"uniform "+h,t.commandStr),a="2i";break;case Pn:case kn:E.command(dt(g)&&3===g.length,"uniform "+h,t.commandStr),a="3i";break;case Gn:case Rn:E.command(dt(g)&&4===g.length,"uniform "+h,t.commandStr),a="4i"}e(s,".uniform",a,"(",v,",",dt(g)?Array.prototype.slice.call(g):g,");")}continue}f=p.append(t,e)}else{if(!o(ir))continue;f=e.def(u.uniforms,"[",n.id(h),"]")}d===Bn?(E(!Array.isArray(f),"must specify a scalar prop for textures"),e("if(",f,"&&",f,'._reglType==="framebuffer"){',f,"=",f,".color[0];","}")):d===zn&&(E(!Array.isArray(f),"must specify a scalar prop for cube maps"),e("if(",f,"&&",f,'._reglType==="framebufferCube"){',f,"=",f,".color[0];","}")),E.optional((function(){function n(n,r){t.assert(e,n,'bad data or missing for uniform "'+h+'". '+r)}function r(t){E(!Array.isArray(f),"must not specify an array type for uniform"),n("typeof "+f+'==="'+t+'"',"invalid type, expected "+t)}function i(e,r){Array.isArray(f)?E(f.length===e,"must have length "+e):n(u.isArrayLike+"("+f+")&&"+f+".length==="+e,"invalid vector, should have length "+e,t.commandStr)}function o(e){E(!Array.isArray(f),"must not specify a value type"),n("typeof "+f+'==="function"&&'+f+'._reglType==="texture'+(3553===e?"2d":"Cube")+'"',"invalid texture type",t.commandStr)}switch(d){case Dn:case An:r("number");break;case Nn:case Tn:case Mn:i(2);break;case kn:case In:case Pn:i(3);break;case Rn:case Cn:case Ln:case Gn:i(4);break;case On:r("boolean");break;case Un:i(9);break;case Fn:i(16);break;case Bn:o(3553);break;case zn:o(34067)}}));var _=1;switch(d){case Bn:case zn:var x=e.def(f,"._texture");e(s,".uniform1i(",v,",",x,".bind());"),e.exit(x,".unbind();");continue;case Dn:case On:a="1i";break;case Nn:case Mn:a="2i",_=2;break;case kn:case Pn:a="3i",_=3;break;case Rn:case Gn:a="4i",_=4;break;case An:a="1f";break;case Tn:a="2f",_=2;break;case In:a="3f",_=3;break;case Cn:a="4f",_=4;break;case Ln:a="Matrix2fv";break;case Un:a="Matrix3fv";break;case Fn:a="Matrix4fv"}if(e(s,".uniform",a,"(",v,","),"M"===a.charAt(0)){var w=Math.pow(d-Ln+2,2),S=t.global.def("new Float32Array(",w,")");Array.isArray(f)?e("false,(",P(w,(function(t){return S+"["+t+"]="+f[t]})),",",S,")"):e("false,(Array.isArray(",f,")||",f," instanceof Float32Array)?",f,":(",P(w,(function(t){return S+"["+t+"]="+f+"["+t+"]"})),",",S,")")}else _>1?e(P(_,(function(t){return Array.isArray(f)?f[t]:f+"["+t+"]"}))):(E(!Array.isArray(f),"uniform value must not be an array"),e(f));e(");")}}function V(t,e,n,r){var i=t.shared,o=i.gl,a=i.draw,u=r.draw;var s=function(){var i,s=u.elements,c=e;return s?((s.contextDep&&r.contextDynamic||s.propDep)&&(c=n),i=s.append(t,c)):i=c.def(a,".",ln),i&&c("if("+i+")"+o+".bindBuffer(34963,"+i+".buffer.buffer);"),i}();function c(i){var o=u[i];return o?o.contextDep&&r.contextDynamic||o.propDep?o.append(t,n):o.append(t,e):e.def(a,".",i)}var f,l,h=c(hn),d=c(pn),p=function(){var i,o=u.count,s=e;return o?((o.contextDep&&r.contextDynamic||o.propDep)&&(s=n),i=o.append(t,s),E.optional((function(){o.MISSING&&t.assert(e,"false","missing vertex count"),o.DYNAMIC&&t.assert(s,i+">=0","missing vertex count")}))):(i=s.def(a,".",dn),E.optional((function(){t.assert(s,i+">=0","missing vertex count")}))),i}();if("number"==typeof p){if(0===p)return}else n("if(",p,"){"),n.exit("}");m&&(f=c(vn),l=t.instancing);var v=s+".type",g=u.elements&&er(u.elements);function y(){function t(){n(l,".drawElementsInstancedANGLE(",[h,p,v,d+"<<(("+v+"-5121)>>1)",f],");")}function e(){n(l,".drawArraysInstancedANGLE(",[h,d,p,f],");")}s?g?t():(n("if(",s,"){"),t(),n("}else{"),e(),n("}")):e()}function b(){function t(){n(o+".drawElements("+[h,p,v,d+"<<(("+v+"-5121)>>1)"]+");")}function e(){n(o+".drawArrays("+[h,d,p]+");")}s?g?t():(n("if(",s,"){"),t(),n("}else{"),e(),n("}")):e()}m&&("number"!=typeof f||f>=0)?"string"==typeof f?(n("if(",f,">0){"),y(),n("}else if(",f,"<0){"),b(),n("}")):y():b()}function X(t,e,n,r,i){var o=O(),a=o.proc("body",i);return E.optional((function(){o.commandStr=e.commandStr,o.command=o.link(e.commandStr)})),m&&(o.instancing=a.def(o.shared.extensions,".angle_instanced_arrays")),t(o,a,n,r),o.compile().body}function H(t,e,n,r){B(t,e),n.useVAO?n.drawVAO?e(t.shared.vao,".setVAO(",n.drawVAO.append(t,e),");"):e(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(e(t.shared.vao,".setVAO(null);"),j(t,e,n,r.attributes,(function(){return!0}))),W(t,e,n,r.uniforms,(function(){return!0})),V(t,e,e,n)}function q(t,e,n,r){function i(){return!0}t.batchId="a1",B(t,e),j(t,e,n,r.attributes,i),W(t,e,n,r.uniforms,i),V(t,e,e,n)}function Y(t,e,n,r){B(t,e);var i=n.contextDep,o=e.def(),a=e.def();t.shared.props=a,t.batchId=o;var u=t.scope(),s=t.scope();function c(t){return t.contextDep&&i||t.propDep}function f(t){return!c(t)}if(e(u.entry,"for(",o,"=0;",o,"<","a1",";++",o,"){",a,"=","a0","[",o,"];",s,"}",u.exit),n.needsContext&&G(t,s,n.context),n.needsFramebuffer&&L(t,s,n.framebuffer),F(t,s,n.state,c),n.profile&&c(n.profile)&&z(t,s,n,!1,!0),r)n.useVAO?n.drawVAO?c(n.drawVAO)?s(t.shared.vao,".setVAO(",n.drawVAO.append(t,s),");"):u(t.shared.vao,".setVAO(",n.drawVAO.append(t,u),");"):u(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(u(t.shared.vao,".setVAO(null);"),j(t,u,n,r.attributes,f),j(t,s,n,r.attributes,c)),W(t,u,n,r.uniforms,f),W(t,s,n,r.uniforms,c),V(t,u,s,n);else{var l=t.global.def("{}"),h=n.shader.progVar.append(t,s),d=s.def(h,".id"),p=s.def(l,"[",d,"]");s(t.shared.gl,".useProgram(",h,".program);","if(!",p,"){",p,"=",l,"[",d,"]=",t.link((function(e){return X(q,t,n,e,2)})),"(",h,");}",p,".call(this,a0[",o,"],",o,");")}}function Z(t,e,n){var r=e.static[n];if(r&&function(t){if("object"==typeof t&&!dt(t)){for(var e=Object.keys(t),n=0;n<e.length;++n)if(D.isDynamic(t[e[n]]))return!0;return!1}}(r)){var i=t.global,o=Object.keys(r),a=!1,u=!1,s=!1,c=t.global.def("{}");o.forEach((function(e){var n=r[e];if(D.isDynamic(n)){"function"==typeof n&&(n=r[e]=D.unbox(n));var o=rr(n,null);a=a||o.thisDep,s=s||o.propDep,u=u||o.contextDep}else{switch(i(c,".",e,"="),typeof n){case"number":i(n);break;case"string":i('"',n,'"');break;case"object":Array.isArray(n)&&i("[",n.join(),"]");break;default:i(t.link(n))}i(";")}})),e.dynamic[n]=new D.DynamicVariable(4,{thisDep:a,contextDep:u,propDep:s,ref:c,append:function(t,e){o.forEach((function(n){var i=r[n];if(D.isDynamic(i)){var o=t.invoke(e,i);e(c,".",n,"=",o,";")}}))}}),delete e.static[n]}}return{next:x,current:_,procs:function(){var t=O(),e=t.proc("poll"),n=t.proc("refresh"),o=t.block();e(o),n(o);var a,u=t.shared,s=u.gl,c=u.next,f=u.current;o(f,".dirty=false;"),L(t,e),L(t,n,null,!0),m&&(a=t.link(m)),r.oes_vertex_array_object&&n(t.link(r.oes_vertex_array_object),".bindVertexArrayOES(null);");for(var l=0;l<i.maxAttributes;++l){var h=n.def(u.attributes,"[",l,"]"),d=t.cond(h,".buffer");d.then(s,".enableVertexAttribArray(",l,");",s,".bindBuffer(",Sn,",",h,".buffer.buffer);",s,".vertexAttribPointer(",l,",",h,".size,",h,".type,",h,".normalized,",h,".stride,",h,".offset);").else(s,".disableVertexAttribArray(",l,");",s,".vertexAttrib4f(",l,",",h,".x,",h,".y,",h,".z,",h,".w);",h,".buffer=null;"),n(d),m&&n(a,".vertexAttribDivisorANGLE(",l,",",h,".divisor);")}return n(t.shared.vao,".currentVAO=null;",t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"),Object.keys(S).forEach((function(r){var i=S[r],a=o.def(c,".",r),u=t.block();u("if(",a,"){",s,".enable(",i,")}else{",s,".disable(",i,")}",f,".",r,"=",a,";"),n(u),e("if(",a,"!==",f,".",r,"){",u,"}")})),Object.keys(A).forEach((function(r){var i,a,u=A[r],l=_[r],h=t.block();if(h(s,".",u,"("),dt(l)){var d=l.length;i=t.global.def(c,".",r),a=t.global.def(f,".",r),h(P(d,(function(t){return i+"["+t+"]"})),");",P(d,(function(t){return a+"["+t+"]="+i+"["+t+"];"})).join("")),e("if(",P(d,(function(t){return i+"["+t+"]!=="+a+"["+t+"]"})).join("||"),"){",h,"}")}else i=o.def(c,".",r),a=o.def(f,".",r),h(i,");",f,".",r,"=",i,";"),e("if(",i,"!==",a,"){",h,"}");n(h)})),t.compile()}(),compile:function(t,r,i,o,a){var u=O();u.stats=u.link(a),Object.keys(r.static).forEach((function(t){Z(u,r,t)})),En.forEach((function(e){Z(u,t,e)}));var s=M(t,r,i,o,u);return function(t,e){var n=t.proc("draw",1);B(t,n),G(t,n,e.context),L(t,n,e.framebuffer),U(t,n,e),F(t,n,e.state),z(t,n,e,!1,!0);var r=e.shader.progVar.append(t,n);if(n(t.shared.gl,".useProgram(",r,".program);"),e.shader.program)H(t,n,e,e.shader.program);else{n(t.shared.vao,".setVAO(null);");var i=t.global.def("{}"),o=n.def(r,".id"),a=n.def(i,"[",o,"]");n(t.cond(a).then(a,".call(this,a0);").else(a,"=",i,"[",o,"]=",t.link((function(n){return X(H,t,e,n,1)})),"(",r,");",a,".call(this,a0);"))}Object.keys(e.state).length>0&&n(t.shared.current,".dirty=true;")}(u,s),function(t,e){var r=t.proc("scope",3);t.batchId="a2";var i=t.shared,o=i.current;function a(n){var o=e.shader[n];o&&r.set(i.shader,"."+n,o.append(t,r))}G(t,r,e.context),e.framebuffer&&e.framebuffer.append(t,r),Qn(Object.keys(e.state)).forEach((function(n){var o=e.state[n].append(t,r);dt(o)?o.forEach((function(e,i){r.set(t.next[n],"["+i+"]",e)})):r.set(i.next,"."+n,o)})),z(t,r,e,!0,!0),[ln,pn,dn,vn,hn].forEach((function(n){var o=e.draw[n];o&&r.set(i.draw,"."+n,""+o.append(t,r))})),Object.keys(e.uniforms).forEach((function(o){var a=e.uniforms[o].append(t,r);Array.isArray(a)&&(a="["+a.join()+"]"),r.set(i.uniforms,"["+n.id(o)+"]",a)})),Object.keys(e.attributes).forEach((function(n){var i=e.attributes[n].append(t,r),o=t.scopeAttrib(n);Object.keys(new g).forEach((function(t){r.set(o,"."+t,i[t])}))})),e.scopeVAO&&r.set(i.vao,".targetVAO",e.scopeVAO.append(t,r)),a(cn),a(fn),Object.keys(e.state).length>0&&(r(o,".dirty=true;"),r.exit(o,".dirty=true;")),r("a1(",t.shared.context,",a0,",t.batchId,");")}(u,s),function(t,e){var n=t.proc("batch",2);t.batchId="0",B(t,n);var r=!1,i=!0;Object.keys(e.context).forEach((function(t){r=r||e.context[t].propDep})),r||(G(t,n,e.context),i=!1);var o=e.framebuffer,a=!1;function u(t){return t.contextDep&&r||t.propDep}o?(o.propDep?r=a=!0:o.contextDep&&r&&(a=!0),a||L(t,n,o)):L(t,n,null),e.state.viewport&&e.state.viewport.propDep&&(r=!0),U(t,n,e),F(t,n,e.state,(function(t){return!u(t)})),e.profile&&u(e.profile)||z(t,n,e,!1,"a1"),e.contextDep=r,e.needsContext=i,e.needsFramebuffer=a;var s=e.shader.progVar;if(s.contextDep&&r||s.propDep)Y(t,n,e,null);else{var c=s.append(t,n);if(n(t.shared.gl,".useProgram(",c,".program);"),e.shader.program)Y(t,n,e,e.shader.program);else{n(t.shared.vao,".setVAO(null);");var f=t.global.def("{}"),l=n.def(c,".id"),h=n.def(f,"[",l,"]");n(t.cond(h).then(h,".call(this,a0,a1);").else(h,"=",f,"[",l,"]=",t.link((function(n){return X(Y,t,e,n,2)})),"(",c,");",h,".call(this,a0,a1);"))}}Object.keys(e.state).length>0&&n(t.shared.current,".dirty=true;")}(u,s),e(u.compile(),{destroy:function(){s.shader.program.destroy()}})}}}var ar=function(t,e){if(!e.ext_disjoint_timer_query)return null;var n=[];function r(t){n.push(t)}var i=[];function o(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var a=[];function u(t){a.push(t)}var s=[];function c(t,e,n){var r=a.pop()||new o;r.startQueryIndex=t,r.endQueryIndex=e,r.sum=0,r.stats=n,s.push(r)}var f=[],l=[];return{beginQuery:function(t){var r=n.pop()||e.ext_disjoint_timer_query.createQueryEXT();e.ext_disjoint_timer_query.beginQueryEXT(35007,r),i.push(r),c(i.length-1,i.length,t)},endQuery:function(){e.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:c,update:function(){var t,n,o=i.length;if(0!==o){l.length=Math.max(l.length,o+1),f.length=Math.max(f.length,o+1),f[0]=0,l[0]=0;var a=0;for(t=0,n=0;n<i.length;++n){var c=i[n];e.ext_disjoint_timer_query.getQueryObjectEXT(c,34919)?(a+=e.ext_disjoint_timer_query.getQueryObjectEXT(c,34918),r(c)):i[t++]=c,f[n+1]=a,l[n+1]=t}for(i.length=t,t=0,n=0;n<s.length;++n){var h=s[n],d=h.startQueryIndex,p=h.endQueryIndex;h.sum+=f[p]-f[d];var v=l[d],g=l[p];g===v?(h.stats.gpuTime+=h.sum/1e6,u(h)):(h.startQueryIndex=v,h.endQueryIndex=g,s[t++]=h)}s.length=t}},getNumPendingQueries:function(){return i.length},clear:function(){n.push.apply(n,i);for(var t=0;t<n.length;t++)e.ext_disjoint_timer_query.deleteQueryEXT(n[t]);i.length=0,n.length=0},restore:function(){i.length=0,n.length=0}}},ur="webglcontextlost",sr="webglcontextrestored";function cr(t,e){for(var n=0;n<t.length;++n)if(t[n]===e)return n;return-1}return function(n){var r=M(n);if(!r)return null;var i=r.gl,o=i.getContextAttributes(),a=i.isContextLost(),u=function(t,e){var n={};function r(e){E.type(e,"string","extension name must be string");var r,i=e.toLowerCase();try{r=n[i]=t.getExtension(i)}catch(t){}return!!r}for(var i=0;i<e.extensions.length;++i){var o=e.extensions[i];if(!r(o))return e.onDestroy(),e.onDone('"'+o+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return e.optionalExtensions.forEach(r),{extensions:n,restore:function(){Object.keys(n).forEach((function(t){if(n[t]&&!r(t))throw new Error("(regl): error restoring extension "+t)}))}}}(i,r);if(!u)return null;var s,c,f=(s={"":0},c=[""],{id:function(t){var e=s[t];return e||(e=s[t]=c.length,c.push(t),e)},str:function(t){return c[t]}}),l={vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0},h=u.extensions,d=ar(0,h),p=k(),v=i.drawingBufferWidth,g=i.drawingBufferHeight,y={tick:0,time:0,viewportWidth:v,viewportHeight:g,framebufferWidth:v,framebufferHeight:g,drawingBufferWidth:v,drawingBufferHeight:g,pixelRatio:r.pixelRatio},m=function(t,e){var n=1;e.ext_texture_filter_anisotropic&&(n=t.getParameter(34047));var r=1,i=1;e.webgl_draw_buffers&&(r=t.getParameter(34852),i=t.getParameter(36063));var o=!!e.oes_texture_float;if(o){var a=t.createTexture();t.bindTexture(F,a),t.texImage2D(F,0,B,1,1,0,B,z,null);var u=t.createFramebuffer();if(t.bindFramebuffer(j,u),t.framebufferTexture2D(j,36064,F,a,0),t.bindTexture(F,null),36053!==t.checkFramebufferStatus(j))o=!1;else{t.viewport(0,0,1,1),t.clearColor(1,0,0,1),t.clear(16384);var s=U.allocType(z,4);t.readPixels(0,0,1,1,B,z,s),t.getError()?o=!1:(t.deleteFramebuffer(u),t.deleteTexture(a),o=1===s[0]),U.freeType(s)}}var c=!0;if("undefined"==typeof navigator||!(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent))){var f=t.createTexture(),l=U.allocType(5121,36);t.activeTexture(33984),t.bindTexture(34067,f),t.texImage2D(34069,0,B,3,3,0,B,5121,l),U.freeType(l),t.bindTexture(34067,null),t.deleteTexture(f),c=!t.getError()}return{colorBits:[t.getParameter(3410),t.getParameter(3411),t.getParameter(3412),t.getParameter(3413)],depthBits:t.getParameter(3414),stencilBits:t.getParameter(3415),subpixelBits:t.getParameter(3408),extensions:Object.keys(e).filter((function(t){return!!e[t]})),maxAnisotropic:n,maxDrawbuffers:r,maxColorAttachments:i,pointSizeDims:t.getParameter(33901),lineWidthDims:t.getParameter(33902),maxViewportDims:t.getParameter(3386),maxCombinedTextureUnits:t.getParameter(35661),maxCubeMapSize:t.getParameter(34076),maxRenderbufferSize:t.getParameter(34024),maxTextureUnits:t.getParameter(34930),maxTextureSize:t.getParameter(3379),maxAttributes:t.getParameter(34921),maxVertexUniforms:t.getParameter(36347),maxVertexTextureUnits:t.getParameter(35660),maxVaryingVectors:t.getParameter(36348),maxFragmentUniforms:t.getParameter(36349),glsl:t.getParameter(35724),renderer:t.getParameter(7937),vendor:t.getParameter(7936),version:t.getParameter(7938),readFloat:o,npotTextureCube:c}}(i,h),b=function(e,n,r,i){var o=0,a={};function u(t){this.id=o++,this.buffer=e.createBuffer(),this.type=t,this.usage=35044,this.byteLength=0,this.dimension=1,this.dtype=Q,this.persistentData=null,r.profile&&(this.stats={size:0})}u.prototype.bind=function(){e.bindBuffer(this.type,this.buffer)},u.prototype.destroy=function(){l(this)};var s=[];function c(t,n,r){t.byteLength=n.byteLength,e.bufferData(t.type,n,r)}function f(e,n,r,i,o,a){var u,s;if(e.usage=r,Array.isArray(n)){if(e.dtype=i||tt,n.length>0)if(Array.isArray(n[0])){u=J(n);for(var f=1,l=1;l<u.length;++l)f*=u[l];e.dimension=f,c(e,s=$(n,u,e.dtype),r),a?e.persistentData=s:U.freeType(s)}else if("number"==typeof n[0]){e.dimension=o;var h=U.allocType(e.dtype,n.length);rt(h,n),c(e,h,r),a?e.persistentData=h:U.freeType(h)}else t(n[0])?(e.dimension=n[0].length,e.dtype=i||nt(n[0])||tt,c(e,s=$(n,[n.length,n[0].length],e.dtype),r),a?e.persistentData=s:U.freeType(s)):E.raise("invalid buffer data")}else if(t(n))e.dtype=i||nt(n),e.dimension=o,c(e,n,r),a&&(e.persistentData=new Uint8Array(new Uint8Array(n.buffer)));else if(W(n)){u=n.shape;var d=n.stride,p=n.offset,v=0,g=0,y=0,m=0;1===u.length?(v=u[0],g=1,y=d[0],m=0):2===u.length?(v=u[0],g=u[1],y=d[0],m=d[1]):E.raise("invalid shape"),e.dtype=i||nt(n.data)||tt,e.dimension=g;var b=U.allocType(e.dtype,v*g);it(b,n.data,v,g,y,m,p),c(e,b,r),a?e.persistentData=b:U.freeType(b)}else n instanceof ArrayBuffer?(e.dtype=Q,e.dimension=o,c(e,n,r),a&&(e.persistentData=new Uint8Array(new Uint8Array(n)))):E.raise("invalid buffer data")}function l(t){n.bufferCount--,i(t);var r=t.buffer;E(r,"buffer must not be deleted already"),e.deleteBuffer(r),t.buffer=null,delete a[t.id]}return r.profile&&(n.getTotalBufferSize=function(){var t=0;return Object.keys(a).forEach((function(e){t+=a[e].stats.size})),t}),{create:function(i,o,s,c){n.bufferCount++;var h=new u(o);function d(n){var i=35044,o=null,a=0,u=0,s=1;return Array.isArray(n)||t(n)||W(n)||n instanceof ArrayBuffer?o=n:"number"==typeof n?a=0|n:n&&(E.type(n,"object","buffer arguments must be an object, a number or an array"),"data"in n&&(E(null===o||Array.isArray(o)||t(o)||W(o),"invalid data for buffer"),o=n.data),"usage"in n&&(E.parameter(n.usage,Z,"invalid buffer usage"),i=Z[n.usage]),"type"in n&&(E.parameter(n.type,K,"invalid buffer type"),u=K[n.type]),"dimension"in n&&(E.type(n.dimension,"number","invalid dimension"),s=0|n.dimension),"length"in n&&(E.nni(a,"buffer length must be a nonnegative integer"),a=0|n.length)),h.bind(),o?f(h,o,i,u,s,c):(a&&e.bufferData(h.type,a,i),h.dtype=u||Q,h.usage=i,h.dimension=s,h.byteLength=a),r.profile&&(h.stats.size=h.byteLength*et[h.dtype]),d}function p(t,n){E(n+t.byteLength<=h.byteLength,"invalid buffer subdata call, buffer is too small. Can't write data of size "+t.byteLength+" starting from offset "+n+" to a buffer of size "+h.byteLength),e.bufferSubData(h.type,n,t)}return a[h.id]=h,s||d(i),d._reglType="buffer",d._buffer=h,d.subdata=function(e,n){var r,i=0|(n||0);if(h.bind(),t(e)||e instanceof ArrayBuffer)p(e,i);else if(Array.isArray(e)){if(e.length>0)if("number"==typeof e[0]){var o=U.allocType(h.dtype,e.length);rt(o,e),p(o,i),U.freeType(o)}else if(Array.isArray(e[0])||t(e[0])){r=J(e);var a=$(e,r,h.dtype);p(a,i),U.freeType(a)}else E.raise("invalid buffer data")}else if(W(e)){r=e.shape;var u=e.stride,s=0,c=0,f=0,l=0;1===r.length?(s=r[0],c=1,f=u[0],l=0):2===r.length?(s=r[0],c=r[1],f=u[0],l=u[1]):E.raise("invalid shape");var v=Array.isArray(e.data)?h.dtype:nt(e.data),g=U.allocType(v,s*c);it(g,e.data,s,c,f,l,e.offset),p(g,i),U.freeType(g)}else E.raise("invalid data for buffer subdata");return d},r.profile&&(d.stats=h.stats),d.destroy=function(){l(h)},d},createStream:function(t,e){var n=s.pop();return n||(n=new u(t)),n.bind(),f(n,e,35040,0,1,!1),n},destroyStream:function(t){s.push(t)},clear:function(){V(a).forEach(l),s.forEach(l)},getBuffer:function(t){return t&&t._buffer instanceof u?t._buffer:null},restore:function(){V(a).forEach((function(t){t.buffer=e.createBuffer(),e.bindBuffer(t.type,t.buffer),e.bufferData(t.type,t.persistentData||t.byteLength,t.usage)}))},_initBuffer:f}}(i,l,r,(function(t){return _.destroyBuffer(t)})),_=function(e,n,r,i,o){for(var a=r.maxAttributes,u=new Array(a),s=0;s<a;++s)u[s]=new Te;var c=0,f={},l={Record:Te,scope:{},state:u,currentVAO:null,targetVAO:null,restore:h()?function(){h()&&V(f).forEach((function(t){t.refresh()}))}:function(){},createVAO:function(e){var r=new p;function u(e){E(Array.isArray(e),"arguments to vertex array constructor must be an array"),E(e.length<a,"too many attributes"),E(e.length>0,"must specify at least one attribute");var i={},s=r.attributes;s.length=e.length;for(var c=0;c<e.length;++c){var f,l=e[c],h=s[c]=new Te,d=l.data||l;Array.isArray(d)||t(d)||W(d)?(r.buffers[c]&&(f=r.buffers[c],t(d)&&f._buffer.byteLength>=d.byteLength?f.subdata(d):(f.destroy(),r.buffers[c]=null)),r.buffers[c]||(f=r.buffers[c]=o.create(l,34962,!1,!0)),h.buffer=o.getBuffer(f),h.size=0|h.buffer.dimension,h.normalized=!1,h.type=h.buffer.dtype,h.offset=0,h.stride=0,h.divisor=0,h.state=1,i[c]=1):o.getBuffer(l)?(h.buffer=o.getBuffer(l),h.size=0|h.buffer.dimension,h.normalized=!1,h.type=h.buffer.dtype,h.offset=0,h.stride=0,h.divisor=0,h.state=1):o.getBuffer(l.buffer)?(h.buffer=o.getBuffer(l.buffer),h.size=0|(+l.size||h.buffer.dimension),h.normalized=!!l.normalized||!1,"type"in l?(E.parameter(l.type,K,"invalid buffer type"),h.type=K[l.type]):h.type=h.buffer.dtype,h.offset=0|(l.offset||0),h.stride=0|(l.stride||0),h.divisor=0|(l.divisor||0),h.state=1,E(h.size>=1&&h.size<=4,"size must be between 1 and 4"),E(h.offset>=0,"invalid offset"),E(h.stride>=0&&h.stride<=255,"stride must be between 0 and 255"),E(h.divisor>=0,"divisor must be positive"),E(!h.divisor||!!n.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in l?(E(c>0,"first attribute must not be a constant"),h.x=+l.x||0,h.y=+l.y||0,h.z=+l.z||0,h.w=+l.w||0,h.state=2):E(!1,"invalid attribute spec for location "+c)}for(var p=0;p<r.buffers.length;++p)!i[p]&&r.buffers[p]&&(r.buffers[p].destroy(),r.buffers[p]=null);return r.refresh(),u}return i.vaoCount+=1,u.destroy=function(){for(var t=0;t<r.buffers.length;++t)r.buffers[t]&&r.buffers[t].destroy();r.buffers.length=0,r.destroy()},u._vao=r,u._reglType="vao",u(e)},getVAO:function(t){return"function"==typeof t&&t._vao?t._vao:null},destroyBuffer:function(t){for(var n=0;n<u.length;++n){var r=u[n];r.buffer===t&&(e.disableVertexAttribArray(n),r.buffer=null)}},setVAO:h()?function(t){if(t!==l.currentVAO){var e=h();t?e.bindVertexArrayOES(t.vao):e.bindVertexArrayOES(null),l.currentVAO=t}}:function(t){if(t!==l.currentVAO){if(t)t.bindAttrs();else for(var n=d(),r=0;r<u.length;++r){var i=u[r];i.buffer?(e.enableVertexAttribArray(r),e.vertexAttribPointer(r,i.size,i.type,i.normalized,i.stride,i.offfset),n&&i.divisor&&n.vertexAttribDivisorANGLE(r,i.divisor)):(e.disableVertexAttribArray(r),e.vertexAttrib4f(r,i.x,i.y,i.z,i.w))}l.currentVAO=t}},clear:h()?function(){V(f).forEach((function(t){t.destroy()}))}:function(){}};function h(){return n.oes_vertex_array_object}function d(){return n.angle_instanced_arrays}function p(){this.id=++c,this.attributes=[];var t=h();this.vao=t?t.createVertexArrayOES():null,f[this.id]=this,this.buffers=[]}return p.prototype.bindAttrs=function(){for(var t=d(),n=this.attributes,r=0;r<n.length;++r){var i=n[r];i.buffer?(e.enableVertexAttribArray(r),e.bindBuffer(34962,i.buffer.buffer),e.vertexAttribPointer(r,i.size,i.type,i.normalized,i.stride,i.offset),t&&i.divisor&&t.vertexAttribDivisorANGLE(r,i.divisor)):(e.disableVertexAttribArray(r),e.vertexAttrib4f(r,i.x,i.y,i.z,i.w))}for(var o=n.length;o<a;++o)e.disableVertexAttribArray(o)},p.prototype.refresh=function(){var t=h();t&&(t.bindVertexArrayOES(this.vao),this.bindAttrs(),l.currentVAO=this)},p.prototype.destroy=function(){if(this.vao){var t=h();this===l.currentVAO&&(l.currentVAO=null,t.bindVertexArrayOES(null)),t.deleteVertexArrayOES(this.vao),this.vao=null}f[this.id]&&(delete f[this.id],i.vaoCount-=1)},l}(i,h,m,l,b),x=function(e,n,r,i){var o={},a=0,u={uint8:at,uint16:ut};function s(t){this.id=a++,o[this.id]=this,this.buffer=t,this.primType=4,this.vertCount=0,this.type=0}n.oes_element_index_uint&&(u.uint32=st),s.prototype.bind=function(){this.buffer.bind()};var c=[];function f(i,o,a,u,s,c,f){var l;if(i.buffer.bind(),o){var h=f;f||t(o)&&(!W(o)||t(o.data))||(h=n.oes_element_index_uint?st:ut),r._initBuffer(i.buffer,o,a,h,3)}else e.bufferData(ct,c,a),i.buffer.dtype=l||at,i.buffer.usage=a,i.buffer.dimension=3,i.buffer.byteLength=c;if(l=f,!f){switch(i.buffer.dtype){case at:case 5120:l=at;break;case ut:case 5122:l=ut;break;case st:case 5124:l=st;break;default:E.raise("unsupported type for element array")}i.buffer.dtype=l}i.type=l,E(l!==st||!!n.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var d=s;d<0&&(d=i.buffer.byteLength,l===ut?d>>=1:l===st&&(d>>=2)),i.vertCount=d;var p=u;if(u<0){p=4;var v=i.buffer.dimension;1===v&&(p=0),2===v&&(p=1),3===v&&(p=4)}i.primType=p}function l(t){i.elementsCount--,E(null!==t.buffer,"must not double destroy elements"),delete o[t.id],t.buffer.destroy(),t.buffer=null}return{create:function(e,n){var o=r.create(null,ct,!0),a=new s(o._buffer);function c(e){if(e)if("number"==typeof e)o(e),a.primType=4,a.vertCount=0|e,a.type=at;else{var n=null,r=35044,i=-1,s=-1,l=0,h=0;Array.isArray(e)||t(e)||W(e)?n=e:(E.type(e,"object","invalid arguments for elements"),"data"in e&&(n=e.data,E(Array.isArray(n)||t(n)||W(n),"invalid data for element buffer")),"usage"in e&&(E.parameter(e.usage,Z,"invalid element buffer usage"),r=Z[e.usage]),"primitive"in e&&(E.parameter(e.primitive,ot,"invalid element buffer primitive"),i=ot[e.primitive]),"count"in e&&(E("number"==typeof e.count&&e.count>=0,"invalid vertex count for elements"),s=0|e.count),"type"in e&&(E.parameter(e.type,u,"invalid buffer type"),h=u[e.type]),"length"in e?l=0|e.length:(l=s,h===ut||5122===h?l*=2:h!==st&&5124!==h||(l*=4))),f(a,n,r,i,s,l,h)}else o(),a.primType=4,a.vertCount=0,a.type=at;return c}return i.elementsCount++,c(e),c._reglType="elements",c._elements=a,c.subdata=function(t,e){return o.subdata(t,e),c},c.destroy=function(){l(a)},c},createStream:function(t){var e=c.pop();return e||(e=new s(r.create(null,ct,!0,!1)._buffer)),f(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){c.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof s?t._elements:null},clear:function(){V(o).forEach(l)}}}(i,h,b,l),w=function(t,n,r,i){var o={},a={};function u(t,e,n,r){this.name=t,this.id=e,this.location=n,this.info=r}function s(t,e){for(var n=0;n<t.length;++n)if(t[n].id===e.id)return void(t[n].location=e.location);t.push(e)}function c(e,r,i){var u=35632===e?o:a,s=u[r];if(!s){var c=n.str(r);s=t.createShader(e),t.shaderSource(s,c),t.compileShader(s),E.shaderError(t,s,c,e,i),u[r]=s}return s}var f={},l=[],h=0;function d(t,e){this.id=h++,this.fragId=t,this.vertId=e,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,i.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function p(e,r,o){var a,f,l=c(35632,e.fragId),h=c(35633,e.vertId),d=e.program=t.createProgram();if(t.attachShader(d,l),t.attachShader(d,h),o)for(a=0;a<o.length;++a){var p=o[a];t.bindAttribLocation(d,p[0],p[1])}t.linkProgram(d),E.linkError(t,d,n.str(e.fragId),n.str(e.vertId),r);var v=t.getProgramParameter(d,35718);i.profile&&(e.stats.uniformsCount=v);var g=e.uniforms;for(a=0;a<v;++a)if(f=t.getActiveUniform(d,a))if(f.size>1)for(var y=0;y<f.size;++y){var m=f.name.replace("[0]","["+y+"]");s(g,new u(m,n.id(m),t.getUniformLocation(d,m),f))}else s(g,new u(f.name,n.id(f.name),t.getUniformLocation(d,f.name),f));var b=t.getProgramParameter(d,35721);i.profile&&(e.stats.attributesCount=b);var _=e.attributes;for(a=0;a<b;++a)(f=t.getActiveAttrib(d,a))&&s(_,new u(f.name,n.id(f.name),t.getAttribLocation(d,f.name),f))}return i.profile&&(r.getMaxUniformsCount=function(){var t=0;return l.forEach((function(e){e.stats.uniformsCount>t&&(t=e.stats.uniformsCount)})),t},r.getMaxAttributesCount=function(){var t=0;return l.forEach((function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)})),t}),{clear:function(){var e=t.deleteShader.bind(t);V(o).forEach(e),o={},V(a).forEach(e),a={},l.forEach((function(e){t.deleteProgram(e.program)})),l.length=0,f={},r.shaderCount=0},program:function(n,i,u,s){E.command(n>=0,"missing vertex shader",u),E.command(i>=0,"missing fragment shader",u);var c=f[i];c||(c=f[i]={});var h=c[n];if(h&&(h.refCount++,!s))return h;var v=new d(i,n);return r.shaderCount++,p(v,u,s),h||(c[n]=v),l.push(v),e(v,{destroy:function(){if(v.refCount--,v.refCount<=0){t.deleteProgram(v.program);var e=l.indexOf(v);l.splice(e,1),r.shaderCount--}c[v.vertId].refCount<=0&&(t.deleteShader(a[v.vertId]),delete a[v.vertId],delete f[v.fragId][v.vertId]),Object.keys(f[v.fragId]).length||(t.deleteShader(o[v.fragId]),delete o[v.fragId],delete f[v.fragId])}})},restore:function(){o={},a={};for(var t=0;t<l.length;++t)p(l[t],null,l[t].attributes.map((function(t){return[t.location,t.name]})))},shader:c,frag:-1,vert:-1}}(i,f,l,r),S=he(i,h,m,(function(){I.procs.poll()}),y,l,r),A=function(t,e,n,r,i){var o={rgba4:pe,rgb565:36194,"rgb5 a1":32855,depth:33189,stencil:36168,"depth stencil":34041};e.ext_srgb&&(o.srgba=35907),e.ext_color_buffer_half_float&&(o.rgba16f=34842,o.rgb16f=34843),e.webgl_color_buffer_float&&(o.rgba32f=34836);var a=[];Object.keys(o).forEach((function(t){var e=o[t];a[e]=t}));var u=0,s={};function c(t){this.id=u++,this.refCount=1,this.renderbuffer=t,this.format=pe,this.width=0,this.height=0,i.profile&&(this.stats={size:0})}function f(e){var n=e.renderbuffer;E(n,"must not double destroy renderbuffer"),t.bindRenderbuffer(de,null),t.deleteRenderbuffer(n),e.renderbuffer=null,e.refCount=0,delete s[e.id],r.renderbufferCount--}return c.prototype.decRef=function(){--this.refCount<=0&&f(this)},i.profile&&(r.getTotalRenderbufferSize=function(){var t=0;return Object.keys(s).forEach((function(e){t+=s[e].stats.size})),t}),{create:function(e,u){var f=new c(t.createRenderbuffer());function l(e,r){var u=0,s=0,c=pe;if("object"==typeof e&&e){var h=e;if("shape"in h){var d=h.shape;E(Array.isArray(d)&&d.length>=2,"invalid renderbuffer shape"),u=0|d[0],s=0|d[1]}else"radius"in h&&(u=s=0|h.radius),"width"in h&&(u=0|h.width),"height"in h&&(s=0|h.height);"format"in h&&(E.parameter(h.format,o,"invalid renderbuffer format"),c=o[h.format])}else"number"==typeof e?(u=0|e,s="number"==typeof r?0|r:u):e?E.raise("invalid arguments to renderbuffer constructor"):u=s=1;if(E(u>0&&s>0&&u<=n.maxRenderbufferSize&&s<=n.maxRenderbufferSize,"invalid renderbuffer size"),u!==f.width||s!==f.height||c!==f.format)return l.width=f.width=u,l.height=f.height=s,f.format=c,t.bindRenderbuffer(de,f.renderbuffer),t.renderbufferStorage(de,c,u,s),E(0===t.getError(),"invalid render buffer format"),i.profile&&(f.stats.size=ge(f.format,f.width,f.height)),l.format=a[f.format],l}return s[f.id]=f,r.renderbufferCount++,l(e,u),l.resize=function(e,r){var o=0|e,a=0|r||o;return o===f.width&&a===f.height||(E(o>0&&a>0&&o<=n.maxRenderbufferSize&&a<=n.maxRenderbufferSize,"invalid renderbuffer size"),l.width=f.width=o,l.height=f.height=a,t.bindRenderbuffer(de,f.renderbuffer),t.renderbufferStorage(de,f.format,o,a),E(0===t.getError(),"invalid render buffer format"),i.profile&&(f.stats.size=ge(f.format,f.width,f.height))),l},l._reglType="renderbuffer",l._renderbuffer=f,i.profile&&(l.stats=f.stats),l.destroy=function(){f.decRef()},l},clear:function(){V(s).forEach(f)},restore:function(){V(s).forEach((function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(de,e.renderbuffer),t.renderbufferStorage(de,e.format,e.width,e.height)})),t.bindRenderbuffer(de,null)}}}(i,h,m,l,r),T=function(t,n,r,i,o,a){var u={cur:null,next:null,dirty:!1,setFBO:null},s=["rgba"],c=["rgba4","rgb565","rgb5 a1"];n.ext_srgb&&c.push("srgba"),n.ext_color_buffer_half_float&&c.push("rgba16f","rgb16f"),n.webgl_color_buffer_float&&c.push("rgba32f");var f=["uint8"];function l(t,e,n){this.target=t,this.texture=e,this.renderbuffer=n;var r=0,i=0;e?(r=e.width,i=e.height):n&&(r=n.width,i=n.height),this.width=r,this.height=i}function h(t){t&&(t.texture&&t.texture._texture.decRef(),t.renderbuffer&&t.renderbuffer._renderbuffer.decRef())}function d(t,e,n){if(t)if(t.texture){var r=t.texture._texture,i=Math.max(1,r.width),o=Math.max(1,r.height);E(i===e&&o===n,"inconsistent width/height for supplied texture"),r.refCount+=1}else{var a=t.renderbuffer._renderbuffer;E(a.width===e&&a.height===n,"inconsistent width/height for renderbuffer"),a.refCount+=1}}function p(e,n){n&&(n.texture?t.framebufferTexture2D(ye,e,n.target,n.texture._texture.texture,0):t.framebufferRenderbuffer(ye,e,me,n.renderbuffer._renderbuffer.renderbuffer))}function v(t){var e=be,n=null,r=null,i=t;"object"==typeof t&&(i=t.data,"target"in t&&(e=0|t.target)),E.type(i,"function","invalid attachment data");var o=i._reglType;return"texture2d"===o?(n=i,E(e===be)):"textureCube"===o?(n=i,E(e>=_e&&e<34075,"invalid cube map target")):"renderbuffer"===o?(r=i,e=me):E.raise("invalid regl object for attachment"),new l(e,n,r)}function g(t,e,n,r,a){if(n){var u=i.create2D({width:t,height:e,format:r,type:a});return u._texture.refCount=0,new l(be,u,null)}var s=o.create({width:t,height:e,format:r});return s._renderbuffer.refCount=0,new l(me,null,s)}function y(t){return t&&(t.texture||t.renderbuffer)}function m(t,e,n){t&&(t.texture?t.texture.resize(e,n):t.renderbuffer&&t.renderbuffer.resize(e,n),t.width=e,t.height=n)}n.oes_texture_half_float&&f.push("half float","float16"),n.oes_texture_float&&f.push("float","float32");var b=0,_={};function x(){this.id=b++,_[this.id]=this,this.framebuffer=t.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function w(t){t.colorAttachments.forEach(h),h(t.depthAttachment),h(t.stencilAttachment),h(t.depthStencilAttachment)}function S(e){var n=e.framebuffer;E(n,"must not double destroy framebuffer"),t.deleteFramebuffer(n),e.framebuffer=null,a.framebufferCount--,delete _[e.id]}function A(e){var n;t.bindFramebuffer(ye,e.framebuffer);var i=e.colorAttachments;for(n=0;n<i.length;++n)p(36064+n,i[n]);for(n=i.length;n<r.maxColorAttachments;++n)t.framebufferTexture2D(ye,36064+n,be,null,0);t.framebufferTexture2D(ye,33306,be,null,0),t.framebufferTexture2D(ye,36096,be,null,0),t.framebufferTexture2D(ye,36128,be,null,0),p(36096,e.depthAttachment),p(36128,e.stencilAttachment),p(33306,e.depthStencilAttachment);var o=t.checkFramebufferStatus(ye);t.isContextLost()||36053===o||E.raise("framebuffer configuration not supported, status = "+Ae[o]),t.bindFramebuffer(ye,u.next?u.next.framebuffer:null),u.cur=u.next,t.getError()}function T(t,i){var o=new x;function l(t,e){var i;E(u.next!==o,"can not update framebuffer which is currently in use");var a=0,h=0,p=!0,m=!0,b=null,_=!0,x="rgba",S="uint8",T=1,I=null,C=null,D=null,N=!1;if("number"==typeof t)a=0|t,h=0|e||a;else if(t){E.type(t,"object","invalid arguments for framebuffer");var k=t;if("shape"in k){var R=k.shape;E(Array.isArray(R)&&R.length>=2,"invalid shape for framebuffer"),a=R[0],h=R[1]}else"radius"in k&&(a=h=k.radius),"width"in k&&(a=k.width),"height"in k&&(h=k.height);("color"in k||"colors"in k)&&(b=k.color||k.colors,Array.isArray(b)&&E(1===b.length||n.webgl_draw_buffers,"multiple render targets not supported")),b||("colorCount"in k&&(T=0|k.colorCount,E(T>0,"invalid color buffer count")),"colorTexture"in k&&(_=!!k.colorTexture,x="rgba4"),"colorType"in k&&(S=k.colorType,_?(E(n.oes_texture_float||!("float"===S||"float32"===S),"you must enable OES_texture_float in order to use floating point framebuffer objects"),E(n.oes_texture_half_float||!("half float"===S||"float16"===S),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):"half float"===S||"float16"===S?(E(n.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),x="rgba16f"):"float"!==S&&"float32"!==S||(E(n.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),x="rgba32f"),E.oneOf(S,f,"invalid color type")),"colorFormat"in k&&(x=k.colorFormat,s.indexOf(x)>=0?_=!0:c.indexOf(x)>=0?_=!1:_?E.oneOf(k.colorFormat,s,"invalid color format for texture"):E.oneOf(k.colorFormat,c,"invalid color format for renderbuffer"))),("depthTexture"in k||"depthStencilTexture"in k)&&(N=!(!k.depthTexture&&!k.depthStencilTexture),E(!N||n.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in k&&("boolean"==typeof k.depth?p=k.depth:(I=k.depth,m=!1)),"stencil"in k&&("boolean"==typeof k.stencil?m=k.stencil:(C=k.stencil,p=!1)),"depthStencil"in k&&("boolean"==typeof k.depthStencil?p=m=k.depthStencil:(D=k.depthStencil,p=!1,m=!1))}else a=h=1;var O=null,M=null,P=null,G=null;if(Array.isArray(b))O=b.map(v);else if(b)O=[v(b)];else for(O=new Array(T),i=0;i<T;++i)O[i]=g(a,h,_,x,S);E(n.webgl_draw_buffers||O.length<=1,"you must enable the WEBGL_draw_buffers extension in order to use multiple color buffers."),E(O.length<=r.maxColorAttachments,"too many color attachments, not supported"),a=a||O[0].width,h=h||O[0].height,I?M=v(I):p&&!m&&(M=g(a,h,N,"depth","uint32")),C?P=v(C):m&&!p&&(P=g(a,h,!1,"stencil","uint8")),D?G=v(D):!I&&!C&&m&&p&&(G=g(a,h,N,"depth stencil","depth stencil")),E(!!I+!!C+!!D<=1,"invalid framebuffer configuration, can specify exactly one depth/stencil attachment");var L=null;for(i=0;i<O.length;++i)if(d(O[i],a,h),E(!O[i]||O[i].texture&&xe.indexOf(O[i].texture._texture.format)>=0||O[i].renderbuffer&&Se.indexOf(O[i].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+i+" is invalid"),O[i]&&O[i].texture){var U=we[O[i].texture._texture.format]*Ee[O[i].texture._texture.type];null===L?L=U:E(L===U,"all color attachments much have the same number of bits per pixel.")}return d(M,a,h),E(!M||M.texture&&6402===M.texture._texture.format||M.renderbuffer&&33189===M.renderbuffer._renderbuffer.format,"invalid depth attachment for framebuffer object"),d(P,a,h),E(!P||P.renderbuffer&&36168===P.renderbuffer._renderbuffer.format,"invalid stencil attachment for framebuffer object"),d(G,a,h),E(!G||G.texture&&34041===G.texture._texture.format||G.renderbuffer&&34041===G.renderbuffer._renderbuffer.format,"invalid depth-stencil attachment for framebuffer object"),w(o),o.width=a,o.height=h,o.colorAttachments=O,o.depthAttachment=M,o.stencilAttachment=P,o.depthStencilAttachment=G,l.color=O.map(y),l.depth=y(M),l.stencil=y(P),l.depthStencil=y(G),l.width=o.width,l.height=o.height,A(o),l}return a.framebufferCount++,l(t,i),e(l,{resize:function(t,e){E(u.next!==o,"can not resize a framebuffer which is currently in use");var n=Math.max(0|t,1),r=Math.max(0|e||n,1);if(n===o.width&&r===o.height)return l;for(var i=o.colorAttachments,a=0;a<i.length;++a)m(i[a],n,r);return m(o.depthAttachment,n,r),m(o.stencilAttachment,n,r),m(o.depthStencilAttachment,n,r),o.width=l.width=n,o.height=l.height=r,A(o),l},_reglType:"framebuffer",_framebuffer:o,destroy:function(){S(o),w(o)},use:function(t){u.setFBO({framebuffer:l},t)}})}return e(u,{getFramebuffer:function(t){if("function"==typeof t&&"framebuffer"===t._reglType){var e=t._framebuffer;if(e instanceof x)return e}return null},create:T,createCube:function(t){var o=Array(6);function a(t){var r;E(o.indexOf(u.next)<0,"can not update framebuffer which is currently in use");var c,l={color:null},h=0,d=null,p="rgba",v="uint8",g=1;if("number"==typeof t)h=0|t;else if(t){E.type(t,"object","invalid arguments for framebuffer");var y=t;if("shape"in y){var m=y.shape;E(Array.isArray(m)&&m.length>=2,"invalid shape for framebuffer"),E(m[0]===m[1],"cube framebuffer must be square"),h=m[0]}else"radius"in y&&(h=0|y.radius),"width"in y?(h=0|y.width,"height"in y&&E(y.height===h,"must be square")):"height"in y&&(h=0|y.height);("color"in y||"colors"in y)&&(d=y.color||y.colors,Array.isArray(d)&&E(1===d.length||n.webgl_draw_buffers,"multiple render targets not supported")),d||("colorCount"in y&&(g=0|y.colorCount,E(g>0,"invalid color buffer count")),"colorType"in y&&(E.oneOf(y.colorType,f,"invalid color type"),v=y.colorType),"colorFormat"in y&&(p=y.colorFormat,E.oneOf(y.colorFormat,s,"invalid color format for texture"))),"depth"in y&&(l.depth=y.depth),"stencil"in y&&(l.stencil=y.stencil),"depthStencil"in y&&(l.depthStencil=y.depthStencil)}else h=1;if(d)if(Array.isArray(d))for(c=[],r=0;r<d.length;++r)c[r]=d[r];else c=[d];else{c=Array(g);var b={radius:h,format:p,type:v};for(r=0;r<g;++r)c[r]=i.createCube(b)}for(l.color=Array(c.length),r=0;r<c.length;++r){var _=c[r];E("function"==typeof _&&"textureCube"===_._reglType,"invalid cube map"),h=h||_.width,E(_.width===h&&_.height===h,"invalid cube map shape"),l.color[r]={target:_e,data:c[r]}}for(r=0;r<6;++r){for(var x=0;x<c.length;++x)l.color[x].target=_e+r;r>0&&(l.depth=o[0].depth,l.stencil=o[0].stencil,l.depthStencil=o[0].depthStencil),o[r]?o[r](l):o[r]=T(l)}return e(a,{width:h,height:h,color:c})}return a(t),e(a,{faces:o,resize:function(t){var e,n=0|t;if(E(n>0&&n<=r.maxCubeMapSize,"invalid radius for cube fbo"),n===a.width)return a;var i=a.color;for(e=0;e<i.length;++e)i[e].resize(n);for(e=0;e<6;++e)o[e].resize(n);return a.width=a.height=n,a},_reglType:"framebufferCube",destroy:function(){o.forEach((function(t){t.destroy()}))}})},clear:function(){V(_).forEach(S)},restore:function(){u.cur=null,u.next=null,u.dirty=!0,V(_).forEach((function(e){e.framebuffer=t.createFramebuffer(),A(e)}))}})}(i,h,m,S,A,l),I=or(i,f,h,m,b,x,0,T,{},_,w,{elements:null,primitive:4,count:-1,offset:0,instances:-1},y,d,r),C=De(i,T,I.procs.poll,y,o,h,m),R=I.next,O=i.canvas,P=[],G=[],L=[],X=[r.onDestroy],H=null;function q(){if(0===P.length)return d&&d.update(),void(H=null);H=N.next(q),mt();for(var t=P.length-1;t>=0;--t){var e=P[t];e&&e(y,null,0)}i.flush(),d&&d.update()}function Y(){!H&&P.length>0&&(H=N.next(q))}function ft(){H&&(N.cancel(q),H=null)}function lt(t){t.preventDefault(),a=!0,ft(),G.forEach((function(t){t()}))}function ht(t){i.getError(),a=!1,u.restore(),w.restore(),b.restore(),S.restore(),A.restore(),T.restore(),_.restore(),d&&d.restore(),I.procs.refresh(),Y(),L.forEach((function(t){t()}))}function dt(t){function n(t,e){var n={},r={};return Object.keys(t).forEach((function(i){var o=t[i];if(D.isDynamic(o))r[i]=D.unbox(o,i);else{if(e&&Array.isArray(o))for(var a=0;a<o.length;++a)if(D.isDynamic(o[a]))return void(r[i]=D.unbox(o,i));n[i]=o}})),{dynamic:r,static:n}}E(!!t,"invalid args to regl({...})"),E.type(t,"object","invalid args to regl({...})");var r=n(t.context||{},!0),i=n(t.uniforms||{},!0),o=n(t.attributes||{},!1),u=n(function(t){var n=e({},t);function r(t){if(t in n){var e=n[t];delete n[t],Object.keys(e).forEach((function(r){n[t+"."+r]=e[r]}))}}return delete n.uniforms,delete n.attributes,delete n.context,delete n.vao,"stencil"in n&&n.stencil.op&&(n.stencil.opBack=n.stencil.opFront=n.stencil.op,delete n.stencil.op),r("blend"),r("depth"),r("cull"),r("stencil"),r("polygonOffset"),r("scissor"),r("sample"),"vao"in t&&(n.vao=t.vao),n}(t),!1),s={gpuTime:0,cpuTime:0,count:0},c=I.compile(u,o,i,r,s),f=c.draw,l=c.batch,h=c.scope,d=[];return e((function(t,e){var n;if(a&&E.raise("context lost"),"function"==typeof t)return h.call(this,null,t,0);if("function"==typeof e)if("number"==typeof t)for(n=0;n<t;++n)h.call(this,null,e,n);else{if(!Array.isArray(t))return h.call(this,t,e,0);for(n=0;n<t.length;++n)h.call(this,t[n],e,n)}else if("number"==typeof t){if(t>0)return l.call(this,function(t){for(;d.length<t;)d.push(null);return d}(0|t),0|t)}else{if(!Array.isArray(t))return f.call(this,t);if(t.length)return l.call(this,t,t.length)}}),{stats:s,destroy:function(){c.destroy()}})}O&&(O.addEventListener(ur,lt,!1),O.addEventListener(sr,ht,!1));var pt=T.setFBO=dt({framebuffer:D.define.call(null,1,"framebuffer")});function vt(t,e){var n=0;I.procs.poll();var r=e.color;r&&(i.clearColor(+r[0]||0,+r[1]||0,+r[2]||0,+r[3]||0),n|=16384),"depth"in e&&(i.clearDepth(+e.depth),n|=256),"stencil"in e&&(i.clearStencil(0|e.stencil),n|=1024),E(!!n,"called regl.clear with no buffer specified"),i.clear(n)}function gt(t){return E.type(t,"function","regl.frame() callback must be a function"),P.push(t),Y(),{cancel:function(){var e=cr(P,t);E(e>=0,"cannot cancel a frame twice"),P[e]=function t(){var e=cr(P,t);P[e]=P[P.length-1],P.length-=1,P.length<=0&&ft()}}}}function yt(){var t=R.viewport,e=R.scissor_box;t[0]=t[1]=e[0]=e[1]=0,y.viewportWidth=y.framebufferWidth=y.drawingBufferWidth=t[2]=e[2]=i.drawingBufferWidth,y.viewportHeight=y.framebufferHeight=y.drawingBufferHeight=t[3]=e[3]=i.drawingBufferHeight}function mt(){y.tick+=1,y.time=_t(),yt(),I.procs.poll()}function bt(){S.refresh(),yt(),I.procs.refresh(),d&&d.update()}function _t(){return(k()-p)/1e3}bt();var xt=e(dt,{clear:function(t){if(E("object"==typeof t&&t,"regl.clear() takes an object as input"),"framebuffer"in t)if(t.framebuffer&&"framebufferCube"===t.framebuffer_reglType)for(var n=0;n<6;++n)pt(e({framebuffer:t.framebuffer.faces[n]},t),vt);else pt(t,vt);else vt(0,t)},prop:D.define.bind(null,1),context:D.define.bind(null,2),this:D.define.bind(null,3),draw:dt({}),buffer:function(t){return b.create(t,34962,!1,!1)},elements:function(t){return x.create(t,!1)},texture:S.create2D,cube:S.createCube,renderbuffer:A.create,framebuffer:T.create,framebufferCube:T.createCube,vao:_.createVAO,attributes:o,frame:gt,on:function(t,e){var n;switch(E.type(e,"function","listener callback must be a function"),t){case"frame":return gt(e);case"lost":n=G;break;case"restore":n=L;break;case"destroy":n=X;break;default:E.raise("invalid event, must be one of frame,lost,restore,destroy")}return n.push(e),{cancel:function(){for(var t=0;t<n.length;++t)if(n[t]===e)return n[t]=n[n.length-1],void n.pop()}}},limits:m,hasExtension:function(t){return m.extensions.indexOf(t.toLowerCase())>=0},read:C,destroy:function(){P.length=0,ft(),O&&(O.removeEventListener(ur,lt),O.removeEventListener(sr,ht)),w.clear(),T.clear(),A.clear(),S.clear(),x.clear(),b.clear(),_.clear(),d&&d.clear(),X.forEach((function(t){t()}))},_gl:i,_refresh:bt,poll:function(){mt(),d&&d.update()},now:_t,stats:l});return r.onDone(null,xt),xt}}()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={id:r,loaded:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.n=t=>{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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),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})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var r={};return(()=>{"use strict";n(9216);var t,e=(t=n(2680))&&t.__esModule?t:{default:t};e.default._babelPolyfill&&"undefined"!=typeof console&&console.warn&&console.warn("@babel/polyfill is loaded more than once on this page. This is probably not desirable/intended and may have consequences if different versions of the polyfills are applied sequentially. If you do need to load the polyfill more than once, use @babel/polyfill/noConflict instead to bypass the warning."),e.default._babelPolyfill=!0})(),(()=>{"use strict";n.r(r),n.d(r,{CircularLayout:()=>Ot,ComboForceLayout:()=>nd,ConcentricLayout:()=>dr,DagreLayout:()=>Mn,ERLayout:()=>Sd,ForceAtlas2Layout:()=>sd,ForceLayout:()=>Dt,FruchtermanGPULayout:()=>Zh,FruchtermanLayout:()=>yr,GForceGPULayout:()=>td,GForceLayout:()=>k,GridLayout:()=>T,Layout:()=>Ad,Layouts:()=>Td,MDSLayout:()=>vr,RadialLayout:()=>lr,RandomLayout:()=>C,getLayoutByName:()=>S,registerLayout:()=>w,unRegisterLayout:()=>E});var t=function(){function t(){this.nodes=[],this.edges=[],this.combos=[],this.positions=[],this.destroyed=!1,this.onLayoutEnd=function(){}}return t.prototype.layout=function(t){return this.init(t),this.execute(!0)},t.prototype.init=function(t){this.nodes=t.nodes||[],this.edges=t.edges||[],this.combos=t.combos||[]},t.prototype.execute=function(t){},t.prototype.executeWithWorker=function(){},t.prototype.getDefaultCfg=function(){return{}},t.prototype.updateCfg=function(t){t&&Object.assign(this,t)},t.prototype.getType=function(){return"base"},t.prototype.destroy=function(){this.nodes=null,this.edges=null,this.combos=null,this.positions=null,this.destroyed=!0},t}(),e=function(t){return"string"==typeof t},i=/-(\w)/g,o=(function(t){return t.replace(i,(function(t,e){return e?e.toUpperCase():""}))},Object.create(null),Array.isArray),a=function(t){return"number"==typeof t},u=function(t){return Number.isNaN(Number(t))};function s(t){return s="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},s(t)}var c,f=function(){return f=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},f.apply(this,arguments)},l=function(t){return null!==t&&"object"===s(t)},h=function t(e){if(null===e)return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Array){var n=[];return e.forEach((function(t){n.push(t)})),n.map((function(e){return t(e)}))}if("object"===s(e)&&e!=={}){var r=f({},e);return Object.keys(r).forEach((function(e){r[e]=t(r[e])})),r}return e},d=function(t,e){var n=t[e];return l(n)?n.cell:n},p=function(t,e,n){for(var r=[],i=0;i<t;i++)r[i]=0;return n?(n.forEach((function(t){var n=d(t,"source"),i=d(t,"target");n&&(r[e[n]]+=1),i&&(r[e[i]]+=1)})),r):r},v=function(t){for(var e=[],n=t.length,r=0;r<n;r+=1){e[r]=[];for(var i=0;i<n;i+=1)r===i?e[r][i]=0:0!==t[r][i]&&t[r][i]?e[r][i]=t[r][i]:e[r][i]=1/0}for(var o=0;o<n;o+=1)for(r=0;r<n;r+=1)for(i=0;i<n;i+=1)e[r][i]>e[r][o]+e[o][i]&&(e[r][i]=e[r][o]+e[o][i]);return e},g=function(t,e){var n=t.nodes,r=t.edges,i=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach((function(t,e){o[t.id]=e,i.push([])})),r&&r.forEach((function(t){var n=d(t,"source"),r=d(t,"target"),a=o[n],u=o[r];i[a][u]=1,e||(i[u][a]=1)})),i},y=function t(e,n){if(e&&e.children)for(var r=e.children.length-1;r>=0;r--)if(!t(e.children[r],n))return;return!!n(e)},m=function(t,e){"function"==typeof e&&y(t,e)},b=function(t){return"function"==typeof t},_=(c=function(t,e){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},c(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}c(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),x=new Map,w=function(e,n){if(x.get(e)&&console.warn("The layout with the name "+e+" exists already, it will be overridden"),l(n)){var r=function(t){function e(e){var r=t.call(this)||this,i=r,o={},a=i.getDefaultCfg();return Object.assign(o,a,n,e),Object.keys(o).forEach((function(t){var e=o[t];i[t]=e})),r}return _(e,t),e}(t);x.set(e,r)}else x.set(e,n);return x.get(e)},E=function(t){x.has(t)&&x.delete(t)},S=function(t){return x.has(t)?x.get(t):null},A=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),T=function(t){function n(e){var n=t.call(this)||this;return n.begin=[0,0],n.preventOverlap=!0,n.preventOverlapPadding=10,n.condense=!1,n.sortBy="degree",n.nodeSize=30,n.nodes=[],n.edges=[],n.width=300,n.height=300,n.row=0,n.col=0,n.cellWidth=0,n.cellHeight=0,n.cellUsed={},n.id2manPos={},n.onLayoutEnd=function(){},n.updateCfg(e),n}return A(n,t),n.prototype.getDefaultCfg=function(){return{begin:[0,0],preventOverlap:!0,preventOverlapPadding:10,condense:!1,rows:void 0,cols:void 0,position:void 0,sortBy:"degree",nodeSize:30}},n.prototype.execute=function(){var t=this,n=t.nodes,r=t.edges,i=n.length,s=t.begin;if(0===i)return t.onLayoutEnd&&t.onLayoutEnd(),{nodes:n,edges:r};if(1===i)return n[0].x=s[0],n[0].y=s[1],t.onLayoutEnd&&t.onLayoutEnd(),{nodes:n,edges:r};var c=[];n.forEach((function(t){c.push(t)}));var f={};if(c.forEach((function(t,e){f[t.id]=e})),("degree"===t.sortBy||!e(t.sortBy)||void 0===c[0][t.sortBy])&&(t.sortBy="degree",u(n[0].degree))){var h=p(c.length,f,r);c.forEach((function(t,e){t.degree=h[e]}))}c.sort((function(e,n){return n[t.sortBy]-e[t.sortBy]})),t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight);var d=t.rows,v=null!=t.cols?t.cols:t.columns;if(t.cells=i,null!=d&&null!=v?(t.rows=d,t.cols=v):null!=d&&null==v?(t.rows=d,t.cols=Math.ceil(t.cells/t.rows)):null==d&&null!=v?(t.cols=v,t.rows=Math.ceil(t.cells/t.cols)):(t.splits=Math.sqrt(t.cells*t.height/t.width),t.rows=Math.round(t.splits),t.cols=Math.round(t.width/t.height*t.splits)),t.cols*t.rows>t.cells)((y=t.small())-1)*(g=t.large())>=t.cells?t.small(y-1):(g-1)*y>=t.cells&&t.large(g-1);else for(;t.cols*t.rows<t.cells;){var g,y=t.small();((g=t.large())+1)*y>=t.cells?t.large(g+1):t.small(y+1)}t.cellWidth=t.width/t.cols,t.cellHeight=t.height/t.rows,t.condense&&(t.cellWidth=0,t.cellHeight=0),t.preventOverlap&&c.forEach((function(e){var n,r;e.x&&e.y||(e.x=0,e.y=0),o(e.size)?(n=e.size[0],r=e.size[1]):a(e.size)?(n=e.size,r=e.size):l(e.size)&&(n=e.size.width,r=e.size.height),void 0!==n&&void 0!==r||(o(t.nodeSize)?(n=t.nodeSize[0],r=t.nodeSize[1]):a(t.nodeSize)?(n=t.nodeSize,r=t.nodeSize):(n=30,r=30));var i=t.preventOverlapPadding,u=n+i,s=r+i;t.cellWidth=Math.max(t.cellWidth,u),t.cellHeight=Math.max(t.cellHeight,s)})),t.cellUsed={},t.row=0,t.col=0,t.id2manPos={};for(var m=0;m<c.length;m++){var b=c[m],_=void 0;if(t.position&&(_=t.position(b)),_&&(void 0!==_.row||void 0!==_.col)){var x={row:_.row,col:_.col};if(void 0===x.col)for(x.col=0;t.used(x.row,x.col);)x.col++;else if(void 0===x.row)for(x.row=0;t.used(x.row,x.col);)x.row++;t.id2manPos[b.id]=x,t.use(x.row,x.col)}t.getPos(b)}return t.onLayoutEnd&&t.onLayoutEnd(),{edges:r,nodes:c}},n.prototype.small=function(t){var e,n=this,r=n.rows||5,i=n.cols||5;return null==t?e=Math.min(r,i):Math.min(r,i)===n.rows?n.rows=t:n.cols=t,e},n.prototype.large=function(t){var e,n=this,r=n.rows||5,i=n.cols||5;return null==t?e=Math.max(r,i):Math.max(r,i)===n.rows?n.rows=t:n.cols=t,e},n.prototype.used=function(t,e){return this.cellUsed["c-"+t+"-"+e]||!1},n.prototype.use=function(t,e){this.cellUsed["c-"+t+"-"+e]=!0},n.prototype.moveToNextCell=function(){var t=this,e=t.cols||5;t.col++,t.col>=e&&(t.col=0,t.row++)},n.prototype.getPos=function(t){var e,n,r=this,i=r.begin,o=r.cellWidth,a=r.cellHeight,u=r.id2manPos[t.id];if(u)e=u.col*o+o/2+i[0],n=u.row*a+a/2+i[1];else{for(;r.used(r.row,r.col);)r.moveToNextCell();e=r.col*o+o/2+i[0],n=r.row*a+a/2+i[1],r.use(r.row,r.col),r.moveToNextCell()}t.x=e,t.y=n},n.prototype.getType=function(){return"grid"},n}(t),I=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),C=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.width=300,n.height=300,n.nodes=[],n.edges=[],n.onLayoutEnd=function(){},n.updateCfg(e),n}return I(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],width:300,height:300}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.center;return t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),e&&e.forEach((function(e){e.x=.9*(Math.random()-.5)*t.width+n[0],e.y=.9*(Math.random()-.5)*t.height+n[1]})),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:this.edges}},e.prototype.getType=function(){return"random"},e}(t),D=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),N=function(t,e){return t?a(t)?function(e){return t}:t:function(t){return e||1}},k=function(t){function e(e){var n=t.call(this)||this;return n.maxIteration=1e3,n.workerEnabled=!1,n.edgeStrength=200,n.nodeStrength=1e3,n.coulombDisScale=.005,n.damping=.9,n.maxSpeed=1e3,n.minMovement=.5,n.interval=.02,n.factor=1,n.linkDistance=1,n.gravity=10,n.preventOverlap=!0,n.tick=function(){},n.nodes=[],n.edges=[],n.width=300,n.height=300,n.nodeMap={},n.nodeIdxMap={},n.updateCfg(e),n}return D(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:500,gravity:10,enableTick:!0}},e.prototype.execute=function(){var t,e,n=this,r=n.nodes;if(void 0!==n.timeInterval&&"undefined"!=typeof window&&window.clearInterval(n.timeInterval),r&&0!==r.length){n.width||"undefined"==typeof window||(n.width=window.innerWidth),n.height||"undefined"==typeof window||(n.height=window.innerHeight),n.center||(n.center=[n.width/2,n.height/2]);var i=n.center;if(1===r.length)return r[0].x=i[0],r[0].y=i[1],void(null===(e=n.onLayoutEnd)||void 0===e||e.call(n));var u={},s={};r.forEach((function(t,e){a(t.x)||(t.x=Math.random()*n.width),a(t.y)||(t.y=Math.random()*n.height),u[t.id]=t,s[t.id]=e})),n.nodeMap=u,n.nodeIdxMap=s,n.linkDistance=N(n.linkDistance,1),n.nodeStrength=N(n.nodeStrength,1),n.edgeStrength=N(n.edgeStrength,1);var c,f=n.nodeSize;if(n.preventOverlap){var h,d=n.nodeSpacing;h=a(d)?function(){return d}:b(d)?d:function(){return 0},c=f?o(f)?function(t){return(f[0]>f[1]?f[0]:f[1])+h(t)}:function(t){return f+h(t)}:function(t){return t.size?o(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])+h(t):l(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)+h(t):t.size+h(t):10+h(t)}}n.nodeSize=c;var v=n.edges;n.degrees=p(r.length,n.nodeIdxMap,v),n.getMass||(n.getMass=function(t){return n.degrees[n.nodeIdxMap[t.id]]||1}),n.run()}else null===(t=n.onLayoutEnd)||void 0===t||t.call(n)},e.prototype.run=function(){var t,e=this,n=e.maxIteration,r=e.nodes,i=e.workerEnabled,o=e.minMovement;if(r)if(i){for(var a=0;a<n;a++){var u=e.runOneStep(a);if(e.reachMoveThreshold(r,u,o))break}null===(t=e.onLayoutEnd)||void 0===t||t.call(e)}else{if("undefined"==typeof window)return;var s=0;this.timeInterval=window.setInterval((function(){var t,i;if(r){var a=e.runOneStep(s)||[];e.reachMoveThreshold(r,a,o)&&(null===(t=e.onLayoutEnd)||void 0===t||t.call(e),window.clearInterval(e.timeInterval)),++s>=n&&(null===(i=e.onLayoutEnd)||void 0===i||i.call(e),window.clearInterval(e.timeInterval))}}),0)}},e.prototype.reachMoveThreshold=function(t,e,n){var r=0;return t.forEach((function(t,n){var i=t.x-e[n].x,o=t.y-e[n].y;r+=Math.sqrt(i*i+o*o)})),(r/=t.length)<n},e.prototype.runOneStep=function(t){var e,n=this,r=n.nodes,i=n.edges,o=[],a=[];if(r){r.forEach((function(t,e){o[2*e]=0,o[2*e+1]=0,a[2*e]=0,a[2*e+1]=0})),n.calRepulsive(o,r),i&&n.calAttractive(o,i),n.calGravity(o,r);var u=Math.max(.02,n.interval-.002*t);n.updateVelocity(o,a,u,r);var s=[];return r.forEach((function(t){s.push({x:t.x,y:t.y})})),n.updatePosition(a,u,r),null===(e=n.tick)||void 0===e||e.call(n),s}},e.prototype.calRepulsive=function(t,e){var n=this,r=n.getMass,i=n.nodeStrength,o=n.factor,a=n.coulombDisScale,u=n.preventOverlap,s=n.nodeSize;e.forEach((function(n,c){var f=r?r(n):1;e.forEach((function(e,l){if(!(c>=l)){var h=n.x-e.x,d=n.y-e.y,p=Math.sqrt(h*h+d*d)+.01,v=(p+.1)*a,g=h/p,y=d/p,m=(i(n)+i(e))/2*o/(v*v),b=r?r(e):1;if(t[2*c]+=g*m,t[2*c+1]+=y*m,t[2*l]-=g*m,t[2*l+1]-=y*m,u&&p<(s(n)+s(e))/2){var _=(i(n)+i(e))/2/(p*p);t[2*c]+=g*_/f,t[2*c+1]+=y*_/f,t[2*l]-=g*_/b,t[2*l+1]-=y*_/b}}}))}))},e.prototype.calAttractive=function(t,e){var n=this,r=n.nodeMap,i=n.nodeIdxMap,o=n.linkDistance,a=n.edgeStrength,u=n.getMass;e.forEach((function(e,n){var s=d(e,"source"),c=d(e,"target"),f=r[s],l=r[c],h=l.x-f.x,p=l.y-f.y,v=Math.sqrt(h*h+p*p)+.01,g=h/v,y=p/v,m=((o(e)||1)-v)*a(e),b=i[s],_=i[c],x=u?u(f):1,w=u?u(l):1;t[2*b]-=g*m/x,t[2*b+1]-=y*m/x,t[2*_]+=g*m/w,t[2*_+1]+=y*m/w}))},e.prototype.calGravity=function(t,e){for(var n=this,r=n.center,i=n.gravity,o=n.degrees,u=e.length,s=0;s<u;s++){var c=e[s],f=c.x-r[0],l=c.y-r[1],h=i;if(n.getCenter){var d=n.getCenter(c,o[s]);d&&a(d[0])&&a(d[1])&&a(d[2])&&(f=c.x-d[0],l=c.y-d[1],h=d[2])}h&&(t[2*s]-=h*f,t[2*s+1]-=h*l)}},e.prototype.updateVelocity=function(t,e,n,r){var i=this,o=n*i.damping;r.forEach((function(n,r){var a=t[2*r]*o||.01,u=t[2*r+1]*o||.01,s=Math.sqrt(a*a+u*u);if(s>i.maxSpeed){var c=i.maxSpeed/s;a*=c,u*=c}e[2*r]=a,e[2*r+1]=u}))},e.prototype.updatePosition=function(t,e,n){n.forEach((function(n,r){if(a(n.fx)&&a(n.fy))return n.x=n.fx,void(n.y=n.fy);var i=t[2*r]*e,o=t[2*r+1]*e;n.x+=i,n.y+=o}))},e.prototype.stop=function(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){var t=this;t.stop(),t.tick=null,t.nodes=null,t.edges=null,t.destroyed=!0},e.prototype.getType=function(){return"gForce"},e}(t);function R(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,o,a,u,s,c,f,l,h,d=t._root,p={data:r},v=t._x0,g=t._y0,y=t._x1,m=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((c=e>=(o=(v+y)/2))?v=o:y=o,(f=n>=(a=(g+m)/2))?g=a:m=a,i=d,!(d=d[l=f<<1|c]))return i[l]=p,t;if(u=+t._x.call(null,d.data),s=+t._y.call(null,d.data),e===u&&n===s)return p.next=d,i?i[l]=p:t._root=p,t;do{i=i?i[l]=new Array(4):t._root=new Array(4),(c=e>=(o=(v+y)/2))?v=o:y=o,(f=n>=(a=(g+m)/2))?g=a:m=a}while((l=f<<1|c)==(h=(s>=a)<<1|u>=o));return i[h]=d,i[l]=p,t}function O(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function M(t){return t[0]}function P(t){return t[1]}function G(t,e,n){var r=new L(null==e?M:e,null==n?P:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function L(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 U(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var F=G.prototype=L.prototype;function B(t){return function(){return t}}function z(t){return 1e-6*(t()-.5)}F.copy=function(){var t,e,n=new L(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=U(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=U(e));return n},F.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return R(this.cover(e,n),e,n,t)},F.addAll=function(t){var e,n,r,i,o=t.length,a=new Array(o),u=new Array(o),s=1/0,c=1/0,f=-1/0,l=-1/0;for(n=0;n<o;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(i=+this._y.call(null,e))||(a[n]=r,u[n]=i,r<s&&(s=r),r>f&&(f=r),i<c&&(c=i),i>l&&(l=i));if(s>f||c>l)return this;for(this.cover(s,c).cover(f,l),n=0;n<o;++n)R(this,a[n],u[n],t[n]);return this},F.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,o=(r=Math.floor(e))+1;else{for(var a,u,s=i-n||1,c=this._root;n>t||t>=i||r>e||e>=o;)switch(u=(e<r)<<1|t<n,(a=new Array(4))[u]=c,c=a,s*=2,u){case 0:i=n+s,o=r+s;break;case 1:n=i-s,o=r+s;break;case 2:i=n+s,r=o-s;break;case 3:n=i-s,r=o-s}this._root&&this._root.length&&(this._root=c)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this},F.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},F.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},F.find=function(t,e,n){var r,i,o,a,u,s,c,f=this._x0,l=this._y0,h=this._x1,d=this._y1,p=[],v=this._root;for(v&&p.push(new O(v,f,l,h,d)),null==n?n=1/0:(f=t-n,l=e-n,h=t+n,d=e+n,n*=n);s=p.pop();)if(!(!(v=s.node)||(i=s.x0)>h||(o=s.y0)>d||(a=s.x1)<f||(u=s.y1)<l))if(v.length){var g=(i+a)/2,y=(o+u)/2;p.push(new O(v[3],g,y,a,u),new O(v[2],i,y,g,u),new O(v[1],g,o,a,y),new O(v[0],i,o,g,y)),(c=(e>=y)<<1|t>=g)&&(s=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=s)}else{var m=t-+this._x.call(null,v.data),b=e-+this._y.call(null,v.data),_=m*m+b*b;if(_<n){var x=Math.sqrt(n=_);f=t-x,l=e-x,h=t+x,d=e+x,r=v.data}}return r},F.remove=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t)))return this;var e,n,r,i,o,a,u,s,c,f,l,h,d=this._root,p=this._x0,v=this._y0,g=this._x1,y=this._y1;if(!d)return this;if(d.length)for(;;){if((c=o>=(u=(p+g)/2))?p=u:g=u,(f=a>=(s=(v+y)/2))?v=s:y=s,e=d,!(d=d[l=f<<1|c]))return this;if(!d.length)break;(e[l+1&3]||e[l+2&3]||e[l+3&3])&&(n=e,h=l)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):e?(i?e[l]=i:delete e[l],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(n?n[h]=d:this._root=d),this):(this._root=i,this)},F.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},F.root=function(){return this._root},F.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},F.visit=function(t){var e,n,r,i,o,a,u=[],s=this._root;for(s&&u.push(new O(s,this._x0,this._y0,this._x1,this._y1));e=u.pop();)if(!t(s=e.node,r=e.x0,i=e.y0,o=e.x1,a=e.y1)&&s.length){var c=(r+o)/2,f=(i+a)/2;(n=s[3])&&u.push(new O(n,c,f,o,a)),(n=s[2])&&u.push(new O(n,r,f,c,a)),(n=s[1])&&u.push(new O(n,c,i,o,f)),(n=s[0])&&u.push(new O(n,r,i,c,f))}return this},F.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new O(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var o,a=e.x0,u=e.y0,s=e.x1,c=e.y1,f=(a+s)/2,l=(u+c)/2;(o=i[0])&&n.push(new O(o,a,u,f,l)),(o=i[1])&&n.push(new O(o,f,u,s,l)),(o=i[2])&&n.push(new O(o,a,l,f,c)),(o=i[3])&&n.push(new O(o,f,l,s,c))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},F.x=function(t){return arguments.length?(this._x=t,this):this._x},F.y=function(t){return arguments.length?(this._y=t,this):this._y};var j={value:()=>{}};function W(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new V(r)}function V(t){this._=t}function X(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function H(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function q(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=j,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}V.prototype=W.prototype={constructor:V,on:function(t,e){var n,r=this._,i=X(t+"",r),o=-1,a=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<a;)if(n=(t=i[o]).type)r[n]=q(r[n],t.name,e);else if(null==e)for(n in r)r[n]=q(r[n],t.name,null);return this}for(;++o<a;)if((n=(t=i[o]).type)&&(n=H(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new V(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(r=this._[t]).length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};const Y=W;var K,Z,$=0,J=0,Q=0,tt=0,et=0,nt=0,rt="object"==typeof performance&&performance.now?performance:Date,it="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function ot(){return et||(it(at),et=rt.now()+nt)}function at(){et=0}function ut(){this._call=this._time=this._next=null}function st(t,e,n){var r=new ut;return r.restart(t,e,n),r}function ct(){et=(tt=rt.now())+nt,$=J=0;try{!function(){ot(),++$;for(var t,e=K;e;)(t=et-e._time)>=0&&e._call.call(null,t),e=e._next;--$}()}finally{$=0,function(){for(var t,e,n=K,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:K=e);Z=t,lt(r)}(),et=0}}function ft(){var t=rt.now(),e=t-tt;e>1e3&&(nt-=e,tt=t)}function lt(t){$||(J&&(J=clearTimeout(J)),t-et>24?(t<1/0&&(J=setTimeout(ct,t-rt.now()-nt)),Q&&(Q=clearInterval(Q))):(Q||(tt=rt.now(),Q=setInterval(ft,1e3)),$=1,it(ct)))}ut.prototype=st.prototype={constructor:ut,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?ot():+n)+(null==e?0:+e),this._next||Z===this||(Z?Z._next=this:K=this,Z=this),this._call=t,this._time=n,lt()},stop:function(){this._call&&(this._call=null,this._time=1/0,lt())}};const ht=4294967296;function dt(t){return t.x}function pt(t){return t.y}var vt=Math.PI*(3-Math.sqrt(5));function gt(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,u=new Map,s=st(l),c=Y("tick","end"),f=function(){let t=1;return()=>(t=(1664525*t+1013904223)%ht)/ht}();function l(){h(),c.call("tick",e),n<r&&(s.stop(),c.call("end",e))}function h(r){var s,c,f=t.length;void 0===r&&(r=1);for(var l=0;l<r;++l)for(n+=(o-n)*i,u.forEach((function(t){t(n)})),s=0;s<f;++s)null==(c=t[s]).fx?c.x+=c.vx*=a:(c.x=c.fx,c.vx=0),null==c.fy?c.y+=c.vy*=a:(c.y=c.fy,c.vy=0);return e}function d(){for(var e,n=0,r=t.length;n<r;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var i=10*Math.sqrt(.5+n),o=n*vt;e.x=i*Math.cos(o),e.y=i*Math.sin(o)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function p(e){return e.initialize&&e.initialize(t,f),e}return null==t&&(t=[]),d(),e={tick:h,restart:function(){return s.restart(l),e},stop:function(){return s.stop(),e},nodes:function(n){return arguments.length?(t=n,d(),u.forEach(p),e):t},alpha:function(t){return arguments.length?(n=+t,e):n},alphaMin:function(t){return arguments.length?(r=+t,e):r},alphaDecay:function(t){return arguments.length?(i=+t,e):+i},alphaTarget:function(t){return arguments.length?(o=+t,e):o},velocityDecay:function(t){return arguments.length?(a=1-t,e):1-a},randomSource:function(t){return arguments.length?(f=t,u.forEach(p),e):f},force:function(t,n){return arguments.length>1?(null==n?u.delete(t):u.set(t,p(n)),e):u.get(t)},find:function(e,n,r){var i,o,a,u,s,c=0,f=t.length;for(null==r?r=1/0:r*=r,c=0;c<f;++c)(a=(i=e-(u=t[c]).x)*i+(o=n-u.y)*o)<r&&(s=u,r=a);return s},on:function(t,n){return arguments.length>1?(c.on(t,n),e):c.on(t)}}}function yt(){var t,e,n,r,i,o=B(-30),a=1,u=1/0,s=.81;function c(n){var i,o=t.length,a=G(t,dt,pt).visitAfter(l);for(r=n,i=0;i<o;++i)e=t[i],a.visit(h)}function f(){if(t){var e,n,r=t.length;for(i=new Array(r),e=0;e<r;++e)n=t[e],i[n.index]=+o(n,e,t)}}function l(t){var e,n,r,o,a,u=0,s=0;if(t.length){for(r=o=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(u+=e.value,s+=n,r+=n*e.x,o+=n*e.y);t.x=r/s,t.y=o/s}else{(e=t).x=e.data.x,e.y=e.data.y;do{u+=i[e.data.index]}while(e=e.next)}t.value=u}function h(t,o,c,f){if(!t.value)return!0;var l=t.x-e.x,h=t.y-e.y,d=f-o,p=l*l+h*h;if(d*d/s<p)return p<u&&(0===l&&(p+=(l=z(n))*l),0===h&&(p+=(h=z(n))*h),p<a&&(p=Math.sqrt(a*p)),e.vx+=l*t.value*r/p,e.vy+=h*t.value*r/p),!0;if(!(t.length||p>=u)){(t.data!==e||t.next)&&(0===l&&(p+=(l=z(n))*l),0===h&&(p+=(h=z(n))*h),p<a&&(p=Math.sqrt(a*p)));do{t.data!==e&&(d=i[t.data.index]*r/p,e.vx+=l*d,e.vy+=h*d)}while(t=t.next)}}return c.initialize=function(e,r){t=e,n=r,f()},c.strength=function(t){return arguments.length?(o="function"==typeof t?t:B(+t),f(),c):o},c.distanceMin=function(t){return arguments.length?(a=t*t,c):Math.sqrt(a)},c.distanceMax=function(t){return arguments.length?(u=t*t,c):Math.sqrt(u)},c.theta=function(t){return arguments.length?(s=t*t,c):Math.sqrt(s)},c}function mt(t,e){var n,r=1;function i(){var i,o,a=n.length,u=0,s=0;for(i=0;i<a;++i)u+=(o=n[i]).x,s+=o.y;for(u=(u/a-t)*r,s=(s/a-e)*r,i=0;i<a;++i)(o=n[i]).x-=u,o.y-=s}return null==t&&(t=0),null==e&&(e=0),i.initialize=function(t){n=t},i.x=function(e){return arguments.length?(t=+e,i):t},i.y=function(t){return arguments.length?(e=+t,i):e},i.strength=function(t){return arguments.length?(r=+t,i):r},i}function bt(t){return t.index}function _t(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}function xt(t){var e,n,r,i,o,a,u=bt,s=function(t){return 1/Math.min(i[t.source.index],i[t.target.index])},c=B(30),f=1;function l(r){for(var i=0,u=t.length;i<f;++i)for(var s,c,l,h,d,p,v,g=0;g<u;++g)c=(s=t[g]).source,h=(l=s.target).x+l.vx-c.x-c.vx||z(a),d=l.y+l.vy-c.y-c.vy||z(a),h*=p=((p=Math.sqrt(h*h+d*d))-n[g])/p*r*e[g],d*=p,l.vx-=h*(v=o[g]),l.vy-=d*v,c.vx+=h*(v=1-v),c.vy+=d*v}function h(){if(r){var a,s,c=r.length,f=t.length,l=new Map(r.map(((t,e)=>[u(t,e,r),t])));for(a=0,i=new Array(c);a<f;++a)(s=t[a]).index=a,"object"!=typeof s.source&&(s.source=_t(l,s.source)),"object"!=typeof s.target&&(s.target=_t(l,s.target)),i[s.source.index]=(i[s.source.index]||0)+1,i[s.target.index]=(i[s.target.index]||0)+1;for(a=0,o=new Array(f);a<f;++a)s=t[a],o[a]=i[s.source.index]/(i[s.source.index]+i[s.target.index]);e=new Array(f),d(),n=new Array(f),p()}}function d(){if(r)for(var n=0,i=t.length;n<i;++n)e[n]=+s(t[n],n,t)}function p(){if(r)for(var e=0,i=t.length;e<i;++e)n[e]=+c(t[e],e,t)}return null==t&&(t=[]),l.initialize=function(t,e){r=t,a=e,h()},l.links=function(e){return arguments.length?(t=e,h(),l):t},l.id=function(t){return arguments.length?(u=t,l):u},l.iterations=function(t){return arguments.length?(f=+t,l):f},l.strength=function(t){return arguments.length?(s="function"==typeof t?t:B(+t),d(),l):s},l.distance=function(t){return arguments.length?(c="function"==typeof t?t:B(+t),p(),l):c},l}function wt(t){return t.x+t.vx}function Et(t){return t.y+t.vy}function St(t){var e,n,r,i=1,o=1;function a(){for(var t,a,s,c,f,l,h,d=e.length,p=0;p<o;++p)for(a=G(e,wt,Et).visitAfter(u),t=0;t<d;++t)s=e[t],l=n[s.index],h=l*l,c=s.x+s.vx,f=s.y+s.vy,a.visit(v);function v(t,e,n,o,a){var u=t.data,d=t.r,p=l+d;if(!u)return e>c+p||o<c-p||n>f+p||a<f-p;if(u.index>s.index){var v=c-u.x-u.vx,g=f-u.y-u.vy,y=v*v+g*g;y<p*p&&(0===v&&(y+=(v=z(r))*v),0===g&&(y+=(g=z(r))*g),y=(p-(y=Math.sqrt(y)))/y*i,s.vx+=(v*=y)*(p=(d*=d)/(h+d)),s.vy+=(g*=y)*p,u.vx-=v*(p=1-p),u.vy-=g*p)}}}function u(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function s(){if(e){var r,i,o=e.length;for(n=new Array(o),r=0;r<o;++r)i=e[r],n[i.index]=+t(i,r,e)}}return"function"!=typeof t&&(t=B(null==t?1:+t)),a.initialize=function(t,n){e=t,r=n,s()},a.iterations=function(t){return arguments.length?(o=+t,a):o},a.strength=function(t){return arguments.length?(i=+t,a):i},a.radius=function(e){return arguments.length?(t="function"==typeof e?e:B(+e),s(),a):t},a}function At(t){var e,n,r,i=B(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vx+=(r[o]-i.x)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=B(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:B(+t),a(),o):i},o.x=function(e){return arguments.length?(t="function"==typeof e?e:B(+e),a(),o):t},o}function Tt(t){var e,n,r,i=B(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vy+=(r[o]-i.y)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=B(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:B(+t),a(),o):i},o.y=function(e){return arguments.length?(t="function"==typeof e?e:B(+e),a(),o):t},o}var It="GPU_LAYOUT_END",Ct=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Dt=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.nodeStrength=null,n.edgeStrength=null,n.preventOverlap=!1,n.clusterNodeStrength=null,n.clusterEdgeStrength=null,n.clusterEdgeDistance=null,n.clusterNodeSize=null,n.clusterFociStrength=null,n.linkDistance=50,n.alphaDecay=.028,n.alphaMin=.001,n.alpha=.3,n.collideStrength=1,n.workerEnabled=!1,n.tick=function(){},n.onLayoutEnd=function(){},n.ticking=void 0,e&&n.updateCfg(e),n}return Ct(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],nodeStrength:null,edgeStrength:null,preventOverlap:!1,nodeSize:void 0,nodeSpacing:void 0,linkDistance:50,forceSimulation:null,alphaDecay:.028,alphaMin:.001,alpha:.3,collideStrength:1,clustering:!1,clusterNodeStrength:-1,clusterEdgeStrength:.1,clusterEdgeDistance:100,clusterFociStrength:.8,clusterNodeSize:10,tick:function(){},onLayoutEnd:function(){},workerEnabled:!1}},e.prototype.init=function(t){var e=this;e.nodes=t.nodes||[];var n=t.edges||[];e.edges=n.map((function(t){var e={},n=["targetNode","sourceNode","startPoint","endPoint"];return Object.keys(t).forEach((function(r){n.indexOf(r)>-1||(e[r]=t[r])})),e})),e.ticking=!1},e.prototype.execute=function(t){var e=this,n=e.nodes,r=e.edges;if(!e.ticking){var i=e.forceSimulation,o=e.alphaMin,a=e.alphaDecay,u=e.alpha;if(i)t&&(e.clustering&&e.clusterForce&&(e.clusterForce.nodes(n),e.clusterForce.links(r)),i.nodes(n),r&&e.edgeForce?e.edgeForce.links(r):r&&!e.edgeForce&&(f=xt().id((function(t){return t.id})).links(r),e.edgeStrength&&f.strength(e.edgeStrength),e.linkDistance&&f.distance(e.linkDistance),e.edgeForce=f,i.force("link",f))),e.preventOverlap&&e.overlapProcess(i),i.alpha(u).restart(),this.ticking=!0;else try{var s=yt();if(e.nodeStrength&&s.strength(e.nodeStrength),i=gt().nodes(n),e.clustering){var c=function(){function t(t){return function(){return t}}var e,n=function(t){return t.cluster},r=t(1),i=t(-1),o=t(100),a=t(.1),u=[0,0],s=[],c={},f=[],l=100,h=100,p={none:{x:0,y:0}},v=[],g="force",y=!0,m=.1;function b(t){if(!y)return b;e.tick(),x();for(var r=0,i=s.length,o=void 0,a=t*m;r<i;++r)(o=s[r]).vx+=(p[n(o)].x-o.x)*a,o.vy+=(p[n(o)].y-o.y)*a}function _(){s&&function(){if(s&&s.length){if(void 0===n(s[0]))throw Error("Couldnt find the grouping attribute for the nodes. Make sure to set it up with forceInABox.groupBy('clusterAttr') before calling .links()");var t,u,p,g,y,m=(t=[],u=[],p={},y=[],g=function(t){var e={};return t.forEach((function(t){var r=n(t);e[r]||(e[r]={count:0,sumforceNodeSize:0})})),t.forEach((function(t){var i=n(t),o=r(t),a=e[i];a.count=a.count+1,a.sumforceNodeSize=a.sumforceNodeSize+Math.PI*(o*o)*1.3,e[i]=a})),e}(s),y=function(t){var e={},r=[];return t.forEach((function(t){var r=function(t){var e=d(t,"source"),r=d(t,"target"),i=n(c[e]),o=n(c[r]);return i<=o?i+"~"+o:o+"~"+i}(t),i=0;void 0!==e[r]&&(i=e[r]),i+=1,e[r]=i})),Object.entries(e).forEach((function(t){var e=t[0],n=t[1],i=e.split("~")[0],o=e.split("~")[1];void 0!==i&&void 0!==o&&r.push({source:i,target:o,count:n})})),r}(f),Object.keys(g).forEach((function(e,n){var r=g[e];t.push({id:e,size:r.count,r:Math.sqrt(r.sumforceNodeSize/Math.PI)}),p[e]=n})),y.forEach((function(t){var e=d(t,"source"),n=d(t,"target"),r=p[e],i=p[n];void 0!==r&&void 0!==i&&u.push({source:r,target:i,count:t.count})})),{nodes:t,links:u});e=gt(m.nodes).force("x",At(l).strength(.1)).force("y",Tt(h).strength(.1)).force("collide",St((function(t){return t.r})).iterations(4)).force("charge",yt().strength(i)).force("links",xt(m.nodes.length?m.links:[]).distance(o).strength(a)),v=e.nodes(),x()}}()}function x(){return p={none:{x:0,y:0}},v.forEach((function(t){p[t.id]={x:t.x-u[0],y:t.y-u[1]}})),p}function w(t){c={},t.forEach((function(t){c[t.id]=t}))}return b.initialize=function(t){s=t,_()},b.template=function(t){return arguments.length?(g=t,_(),b):g},b.groupBy=function(t){return arguments.length?"string"==typeof t?(n=function(e){return e[t]},b):(n=t,b):n},b.enableGrouping=function(t){return arguments.length?(y=t,b):y},b.strength=function(t){return arguments.length?(m=t,b):m},b.centerX=function(t){return arguments.length?(l=t,b):l},b.centerY=function(t){return arguments.length?(h=t,b):h},b.nodes=function(t){return arguments.length?(w(t||[]),s=t||[],b):s},b.links=function(t){return arguments.length?(f=t||[],_(),b):f},b.forceNodeSize=function(e){return arguments.length?(r="function"==typeof e?e:t(+e),_(),b):r},b.nodeSize=b.forceNodeSize,b.forceCharge=function(e){return arguments.length?(i="function"==typeof e?e:t(+e),_(),b):i},b.forceLinkDistance=function(e){return arguments.length?(o="function"==typeof e?e:t(+e),_(),b):o},b.forceLinkStrength=function(e){return arguments.length?(a="function"==typeof e?e:t(+e),_(),b):a},b.offset=function(t){return arguments.length?(u=t,b):u},b.getFocis=x,b}();c.centerX(e.center[0]).centerY(e.center[1]).template("force").strength(e.clusterFociStrength),r&&c.links(r),n&&c.nodes(n),c.forceLinkDistance(e.clusterEdgeDistance).forceLinkStrength(e.clusterEdgeStrength).forceCharge(e.clusterNodeStrength).forceNodeSize(e.clusterNodeSize),e.clusterForce=c,i.force("group",c)}if(i.force("center",mt(e.center[0],e.center[1])).force("charge",s).alpha(u).alphaDecay(a).alphaMin(o),e.preventOverlap&&e.overlapProcess(i),r){var f=xt().id((function(t){return t.id})).links(r);e.edgeStrength&&f.strength(e.edgeStrength),e.linkDistance&&f.distance(e.linkDistance),e.edgeForce=f,i.force("link",f)}if(e.workerEnabled&&!Nt()&&(e.workerEnabled=!1,console.warn("workerEnabled option is only supported when running in web worker.")),e.workerEnabled){i.stop();for(var l=function(t){var e=t.alphaMin(),n=t.alphaTarget(),r=t.alpha(),i=Math.log((e-n)/(r-n))/Math.log(1-t.alphaDecay());return Math.ceil(i)}(i),h=1;h<=l;h++)i.tick(),postMessage({nodes:n,currentTick:h,totalTicks:l,type:"LAYOUT_TICK"},void 0);e.ticking=!1}else i.on("tick",(function(){e.tick()})).on("end",(function(){e.ticking=!1,e.onLayoutEnd&&e.onLayoutEnd()})),e.ticking=!0;e.forceSimulation=i,e.ticking=!0}catch(t){e.ticking=!1,console.warn(t)}}},e.prototype.overlapProcess=function(t){var e,n,r=this,i=r.nodeSize,u=r.nodeSpacing,s=r.collideStrength;if(n=a(u)?function(){return u}:b(u)?u:function(){return 0},i)if(b(i))e=function(t){return i(t)+n(t)};else if(o(i)){var c=(i[0]>i[1]?i[0]:i[1])/2;e=function(t){return c+n(t)}}else if(a(i)){var f=i/2;e=function(t){return f+n(t)}}else e=function(){return 10};else e=function(t){return t.size?o(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])/2+n(t):l(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)/2+n(t):t.size/2+n(t):10+n(t)};t.force("collisionForce",St(e).strength(s))},e.prototype.updateCfg=function(t){var e=this;e.ticking&&(e.forceSimulation.stop(),e.ticking=!1),e.forceSimulation=null,Object.assign(e,t)},e.prototype.destroy=function(){var t=this;t.ticking&&(t.forceSimulation.stop(),t.ticking=!1),t.nodes=null,t.edges=null,t.destroyed=!0},e}(t);function Nt(){return"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope}var kt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function Rt(t,e){var n=t.degree,r=e.degree;return n<r?-1:n>r?1:0}var Ot=function(t){function e(e){var n=t.call(this)||this;return n.radius=null,n.startRadius=null,n.endRadius=null,n.startAngle=0,n.endAngle=2*Math.PI,n.clockwise=!0,n.divisions=1,n.ordering=null,n.angleRatio=1,n.nodes=[],n.edges=[],n.nodeMap={},n.degrees=[],n.width=300,n.height=300,n.updateCfg(e),n}return kt(e,t),e.prototype.getDefaultCfg=function(){return{radius:null,startRadius:null,endRadius:null,startAngle:0,endAngle:2*Math.PI,clockwise:!0,divisions:1,ordering:null,angleRatio:1}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.edges,r=e.length;if(0!==r){t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),t.center||(t.center=[t.width/2,t.height/2]);var i=t.center;if(1===r)return e[0].x=i[0],e[0].y=i[1],void(t.onLayoutEnd&&t.onLayoutEnd());var o=t.radius,a=t.startRadius,u=t.endRadius,s=t.divisions,c=t.startAngle,f=t.endAngle,l=(f-c)/r,h={};e.forEach((function(t,e){h[t.id]=e})),t.nodeMap=h;var d=p(e.length,h,n);t.degrees=d,o||a||u?!a&&u?a=u:a&&!u&&(u=a):o=t.height>t.width?t.width/2:t.height/2;var v=l*t.angleRatio,g=t.ordering,y=[];y="topology"===g?t.topologyOrdering():"topology-directed"===g?t.topologyOrdering(!0):"degree"===g?t.degreeOrdering():e;for(var m=t.clockwise,b=Math.ceil(r/s),_=0;_<r;++_){var x=o;x||null===a||null===u||(x=a+_*(u-a)/(r-1)),x||(x=10+100*_/(r-1));var w=c+_%b*v+2*Math.PI/s*Math.floor(_/b);m||(w=f-_%b*v-2*Math.PI/s*Math.floor(_/b)),y[_].x=i[0]+Math.cos(w)*x,y[_].y=i[1]+Math.sin(w)*x,y[_].weight=d[_]}return t.onLayoutEnd&&t.onLayoutEnd(),{nodes:y,edges:this.edges}}t.onLayoutEnd&&t.onLayoutEnd()},e.prototype.topologyOrdering=function(t){void 0===t&&(t=!1);var e=this,n=e.degrees,r=e.edges,i=e.nodes,o=h(i),a=e.nodeMap,u=[o[0]],s=[i[0]],c=[],f=i.length;c[0]=!0,function(t,e,n,r){t.forEach((function(e,n){t[n].children=[],t[n].parent=[]})),r?e.forEach((function(e){var r=d(e,"source"),i=d(e,"target"),o=0;r&&(o=n[r]);var a=0;i&&(a=n[i]);var u=t[o].children,s=t[a].parent;u.push(t[a].id),s.push(t[o].id)})):e.forEach((function(e){var r=d(e,"source"),i=d(e,"target"),o=0;r&&(o=n[r]);var a=0;i&&(a=n[i]);var u=t[o].children,s=t[a].children;u.push(t[a].id),s.push(t[o].id)}))}(o,r,a,t);var l=0;return o.forEach((function(t,e){if(0!==e)if(e!==f-1&&n[e]===n[e+1]&&!function(t,e,n){for(var r=n.length,i=0;i<r;i++){var o=d(n[i],"source"),a=d(n[i],"target");if(t.id===o&&e.id===a||e.id===o&&t.id===a)return!0}return!1}(u[l],t,r)||c[e]){for(var h=u[l].children,p=!1,v=0;v<h.length;v++){var g=a[h[v]];if(n[g]===n[e]&&!c[g]){u.push(o[g]),s.push(i[a[o[g].id]]),c[g]=!0,p=!0;break}}for(var y=0;!p&&(c[y]||(u.push(o[y]),s.push(i[a[o[y].id]]),c[y]=!0,p=!0),++y!==f););}else u.push(t),s.push(i[a[t.id]]),c[e]=!0,l++})),s},e.prototype.degreeOrdering=function(){var t=this.nodes,e=[],n=this.degrees;return t.forEach((function(t,r){t.degree=n[r],e.push(t)})),e.sort(Rt),e},e.prototype.getType=function(){return"circular"},e}(t),Mt=n(8311),Pt=n.n(Mt)();Pt||"undefined"==typeof window||(Pt=window.graphlib);const Gt=Pt;var Lt=function(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev},Ut=function(t,e){if("_next"!==t&&"_prev"!==t)return e};const Ft=function(){function t(){var t={};t._next=t._prev=t,this.isentinel=t}return t.prototype.dequeue=function(){var t=this.isentinel,e=t._prev;if(e!==t)return Lt(e),e},t.prototype.enqueue=function(){var t=this.isentinel,e=t._prev;if(e!==t)return Lt(e),e},t.prototype.toString=function(){for(var t=[],e=this.isentinel,n=e._prev;n!==e;)t.push(JSON.stringify(n,Ut)),n=n._prev;return"["+t.join(", ")+"]"},t}();var Bt=Gt.Graph,zt=function(){return 1},jt=function(t,e,n,r,i){var o,a,u=i?[]:void 0;return null===(o=t.inEdges(r.v))||void 0===o||o.forEach((function(r){var o=t.edge(r),a=t.node(r.v);i&&u.push({v:r.v,w:r.w}),void 0===a.out&&(a.out=0),a.out-=o,Wt(e,n,a)})),null===(a=t.outEdges(r.v))||void 0===a||a.forEach((function(r){var i=t.edge(r),o=r.w,a=t.node(o);void 0===a.in&&(a.in=0),a.in-=i,Wt(e,n,a)})),t.removeNode(r.v),u},Wt=function(t,e,n){n.out?n.in?t[n.out-n.in+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)};const Vt=function(t,e){var n;if(t.nodeCount()<=1)return[];var r=function(t,e){var n=new Bt,r=0,i=0;t.nodes().forEach((function(t){n.setNode(t,{v:t,in:0,out:0})})),t.edges().forEach((function(t){var o=n.edge(t.v,t.w)||0,a=null==e?void 0:e(t),u=o+a;n.setEdge(t.v,t.w,u),i=Math.max(i,n.node(t.v).out+=a),r=Math.max(r,n.node(t.w).in+=a)}));for(var o=[],a=i+r+3,u=0;u<a;u++)o.push(new Ft);var s=r+1;return n.nodes().forEach((function(t){Wt(o,s,n.node(t))})),{buckets:o,zeroIdx:s,graph:n}}(t,e||zt);return null===(n=function(t,e,n){for(var r,i=[],o=e[e.length-1],a=e[0];t.nodeCount();){for(;r=a.dequeue();)jt(t,e,n,r);for(;r=o.dequeue();)jt(t,e,n,r);if(t.nodeCount())for(var u=e.length-2;u>0;--u)if(r=e[u].dequeue()){i=i.concat(jt(t,e,n,r,!0));break}}return i}(r.graph,r.buckets,r.zeroIdx).map((function(e){return t.outEdges(e.v,e.w)})))||void 0===n?void 0:n.flat()};var Xt=Gt.Graph,Ht=function(t,e,n,r){var i;do{i=""+r+Math.random()}while(t.hasNode(i));return n.dummy=e,t.setNode(i,n),i},qt=function(t){var e=(new Xt).setGraph(t.graph());return t.nodes().forEach((function(n){e.setNode(n,t.node(n))})),t.edges().forEach((function(n){var r=e.edge(n.v,n.w)||{weight:0,minlen:1},i=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})})),e},Yt=function(t,e){var n={};return t.forEach((function(t,r){n[t]=e[r]})),n},Kt=function(t){var e=t.nodes().map((function(e){return t.node(e).rank})),n=Math.min.apply(Math,e);t.nodes().forEach((function(e){var r=t.node(e);r.hasOwnProperty("rank")&&(r.rank||(r.rank=0),r.rank-=n)}))},Zt=function(t){var e=t.nodes().map((function(e){return t.node(e).rank})),n=Math.min.apply(Math,e),r=[];t.nodes().forEach((function(e){var i,o=((null===(i=t.node(e))||void 0===i?void 0:i.rank)||0)-n;r[o]||(r[o]=[]),r[o].push(e)}));var i=0,o=t.graph().nodeRankFactor||0;r.forEach((function(e,n){void 0===e&&n%o!=0?--i:i&&e.forEach((function(e){t.node(e).rank||(t.node(e).rank=0),t.node(e).rank+=i}))}))},$t=function(t){var e=t.nodes().map((function(e){var n=t.node(e).rank;return void 0!==n?n:-1/0}));return Math.max.apply(Math,e)},Jt=function(t,e){var n=Date.now();try{return e()}finally{console.log(t+" time: "+(Date.now()-n)+"ms")}},Qt=function(t,e){return e()},te=function(t,e){var n,r=1/0;return t.forEach((function(t){var i=e(t);r>i&&(r=i,n=t)})),n};const ee={addDummyNode:Ht,simplify:qt,asNonCompoundGraph:function(t){var e=new Xt({multigraph:t.isMultigraph()}).setGraph(t.graph());return t.nodes().forEach((function(n){var r;(null===(r=t.children(n))||void 0===r?void 0:r.length)||e.setNode(n,t.node(n))})),t.edges().forEach((function(n){return e.setEdge(n,t.edge(n))})),e},successorWeights:function(t){var e=t.nodes().map((function(e){var n,r={};return null===(n=t.outEdges(e))||void 0===n||n.forEach((function(e){r[e.w]=(r[e.w]||0)+t.edge(e).weight})),r}));return Yt(t.nodes(),e)},predecessorWeights:function(t){var e=t.nodes().map((function(e){var n,r={};return null===(n=t.inEdges(e))||void 0===n||n.forEach((function(e){r[e.v]=(r[e.v]||0)+t.edge(e).weight})),r}));return Yt(t.nodes(),e)},intersectRect:function(t,e){var n,r,i=t.x,o=t.y,a=e.x-i,u=e.y-o,s=t.width/2,c=t.height/2;return a||u?(Math.abs(u)*s>Math.abs(a)*c?(u<0&&(c=-c),n=c*a/u,r=c):(a<0&&(s=-s),n=s,r=s*u/a),{x:i+n,y:o+r}):{x:0,y:0}},buildLayerMatrix:function(t){for(var e=[],n=$t(t)+1,r=0;r<n;r++)e.push([]);return t.nodes().forEach((function(n){var r=t.node(n),i=r.rank;void 0!==i&&(e[i][r.order||0]=n)})),e},normalizeRanks:Kt,removeEmptyRanks:Zt,addBorderNode:function(t,e,n,r){var i={width:0,height:0};return a(n)&&a(r)&&(i.rank=n,i.order=r),Ht(t,"border",i,e)},maxRank:$t,partition:function(t,e){var n={lhs:[],rhs:[]};return t.forEach((function(t){e(t)?n.lhs.push(t):n.rhs.push(t)})),n},time:Jt,notime:Qt,zipObject:Yt,minBy:te};const ne=function(t){t.graph().dummyChains=[],t.edges().forEach((function(e){return function(t,e){var n,r,i=e.v,o=t.node(i).rank,a=e.w,u=t.node(a).rank,s=e.name,c=t.edge(e),f=c.labelRank;if(u!==o+1){var l,h,d;for(t.removeEdge(e),d=0,++o;o<u;++d,++o)c.points=[],l=ee.addDummyNode(t,"edge",h={edgeLabel:c,width:0,height:0,edgeObj:e,rank:o},"_d"),o===f&&(h.width=c.width,h.height=c.height,h.dummy="edge-label",h.labelpos=c.labelpos),t.setEdge(i,l,{weight:c.weight},s),0===d&&(t.graph().dummyChains||(t.graph().dummyChains=[]),null===(r=null===(n=t.graph())||void 0===n?void 0:n.dummyChains)||void 0===r||r.push(l)),i=l;t.setEdge(i,a,{weight:c.weight},s)}}(t,e)}))};var re=function(t){var e={},n=function n(r){var i,o=t.node(r);if(e.hasOwnProperty(r))return o.rank;e[r]=!0;var a=null===(i=t.outEdges(r))||void 0===i?void 0:i.map((function(e){return n(e.w)-t.edge(e).minlen||1/0})),u=Math.min.apply(Math,a);return u!==Number.POSITIVE_INFINITY&&null!=u||(u=0),o.rank=u,u};t.sources().forEach((function(t){return n(t)}))},ie=function(t){var e={},n=0,r=function r(i){var o,a=t.node(i);if(e.hasOwnProperty(i))return a.rank;e[i]=!0;var u=null===(o=t.outEdges(i))||void 0===o?void 0:o.map((function(e){return r(e.w)-t.edge(e).minlen||1/0})),s=Math.min.apply(Math,u);return s!==Number.POSITIVE_INFINITY&&null!=s||(s=0),a.rank=s,n=Math.min(a.rank,n),a.rank};t.sources().forEach((function(t){return r(t)})),n+=1;var i=function e(n,r){var i,o=t.node(n),a=isNaN(o.layer)?r:o.layer;(void 0===o.rank||o.rank<a)&&(o.rank=a),null===(i=t.outEdges(n))||void 0===i||i.map((function(n){e(n.w,a+t.edge(n).minlen)}))};t.nodes().forEach((function(e){var r=t.node(e);isNaN(r.layer)?r.rank-=n:i(e,r.layer)}))},oe=function(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen},ae=Gt.Graph,ue=function(t,e){return t.nodes().forEach((function n(r){e.nodeEdges(r).forEach((function(i){var o=i.v,a=r===o?i.w:o;t.hasNode(a)||oe(e,i)||(t.setNode(a,{}),t.setEdge(r,a,{}),n(a))}))})),t.nodeCount()},se=function(t,e){return t.nodes().forEach((function n(r){var i;null===(i=e.nodeEdges(r))||void 0===i||i.forEach((function(i){var o=i.v,a=r===o?i.w:o;t.hasNode(a)||void 0===e.node(a).layer&&oe(e,i)||(t.setNode(a,{}),t.setEdge(r,a,{}),n(a))}))})),t.nodeCount()},ce=function(t,e){return te(e.edges(),(function(n){return t.hasNode(n.v)!==t.hasNode(n.w)?oe(e,n):1/0}))},fe=function(t,e,n){t.nodes().forEach((function(t){e.node(t).rank||(e.node(t).rank=0),e.node(t).rank+=n}))},le=Gt.alg,he=le.preorder,de=le.postorder,pe=function(t){t=qt(t),re(t);var e,n,r=function(t){var e,n,r=new ae({directed:!1}),i=t.nodes()[0],o=t.nodeCount();for(r.setNode(i,{});ue(r,t)<o;)e=ce(r,t),n=r.hasNode(e.v)?oe(t,e):-oe(t,e),fe(r,t,n);return r}(t);for(me(r),ve(r,t);e=_e(r);)n=xe(r,t,e),we(r,t,e,n)},ve=function(t,e){var n=de(t,t.nodes());(n=n.slice(0,n.length-1)).forEach((function(n){ge(t,e,n)}))},ge=function(t,e,n){var r=t.node(n).parent;t.edge(n,r).cutvalue=ye(t,e,n)},ye=function(t,e,n){var r=t.node(n).parent,i=!0,o=e.edge(n,r),a=0;return o||(i=!1,o=e.edge(r,n)),a=o.weight,e.nodeEdges(n).forEach((function(o){var u=o.v===n,s=u?o.w:o.v;if(s!==r){var c=u===i,f=e.edge(o).weight;if(a+=c?f:-f,Se(t,n,s)){var l=t.edge(n,s).cutvalue;a+=c?-l:l}}})),a},me=function(t,e){void 0!==e&&(e=t.nodes()[0]),be(t,{},1,e)},be=function t(e,n,r,i,o){var a,u=r,s=r,c=e.node(i);return n[i]=!0,null===(a=e.neighbors(i))||void 0===a||a.forEach((function(r){n.hasOwnProperty(r)||(s=t(e,n,s,r,i))})),c.low=u,c.lim=s++,o?c.parent=o:delete c.parent,s},_e=function(t){return t.edges().find((function(e){return t.edge(e).cutvalue<0}))},xe=function(t,e,n){var r=n.v,i=n.w;e.hasEdge(r,i)||(r=n.w,i=n.v);var o=t.node(r),a=t.node(i),u=o,s=!1;o.lim>a.lim&&(u=a,s=!0);var c=e.edges().filter((function(e){return s===Ae(t,t.node(e.v),u)&&s!==Ae(t,t.node(e.w),u)}));return te(c,(function(t){return oe(e,t)}))},we=function(t,e,n,r){var i=n.v,o=n.w;t.removeEdge(i,o),t.setEdge(r.v,r.w,{}),me(t),ve(t,e),Ee(t,e)},Ee=function(t,e){var n=t.nodes().find((function(t){return!e.node(t).parent})),r=he(t,n);(r=r.slice(1)).forEach((function(n){var r=t.node(n).parent,i=e.edge(n,r),o=!1;i||(i=e.edge(r,n),o=!0),e.node(n).rank=e.node(r).rank+(o?i.minlen:-i.minlen)}))},Se=function(t,e,n){return t.hasEdge(e,n)},Ae=function(t,e,n){return n.low<=e.lim&&e.lim<=n.lim};pe.initLowLimValues=me,pe.initCutValues=ve,pe.calcCutValue=ye,pe.leaveEdge=_e,pe.enterEdge=xe,pe.exchangeEdges=we;const Te=pe;var Ie=re,Ce=function(t){ie(t),function(t){var e,n,r=new ae({directed:!1}),i=t.nodes()[0],o=t.nodeCount();for(r.setNode(i,{});se(r,t)<o;)e=ce(r,t),n=r.hasNode(e.v)?oe(t,e):-oe(t,e),fe(r,t,n)}(t)};const De=function(t){switch(t.graph().ranker){case"network-simplex":!function(t){Te(t)}(t);break;default:Ce(t);break;case"longest-path":Ie(t)}};const Ne=function(t){var e,n=function(t){var e,n={},r=0;return null===(e=t.children())||void 0===e||e.forEach((function e(i){var o,a=r;null===(o=t.children(i))||void 0===o||o.forEach(e),n[i]={low:a,lim:r++}})),n}(t);null===(e=t.graph().dummyChains)||void 0===e||e.forEach((function(e){var r,i,o=t.node(e),a=o.edgeObj;if(a)for(var u=function(t,e,n,r){var i,o,a=[],u=[],s=Math.min(e[n].low,e[r].low),c=Math.max(e[n].lim,e[r].lim);i=n;do{i=t.parent(i),a.push(i)}while(i&&(e[i].low>s||c>e[i].lim));for(o=i,i=r;(i=t.parent(i))!==o;)u.push(i);return{lca:o,path:a.concat(u.reverse())}}(t,n,a.v,a.w),s=u.path,c=u.lca,f=0,l=s[f],h=!0;e!==a.w;){if(o=t.node(e),h){for(;(l=s[f])!==c&&t.node(l).maxRank<o.rank;)f++;l===c&&(h=!1)}if(!h){for(;f<s.length-1&&(null===(r=t.node(l=s[f+1]))||void 0===r?void 0:r.minRank)<=o.rank;)f++;l=s[f]}t.setParent(e,l),e=null===(i=t.successors(e))||void 0===i?void 0:i[0]}}))};var ke=function t(e,n,r,i,o,a,u){var s=e.children(u);if(null==s?void 0:s.length){var c=ee.addBorderNode(e,"_bt"),f=ee.addBorderNode(e,"_bb"),l=e.node(u);e.setParent(c,u),l.borderTop=c,e.setParent(f,u),l.borderBottom=f,null==s||s.forEach((function(s){t(e,n,r,i,o,a,s);var l=e.node(s),h=l.borderTop?l.borderTop:s,d=l.borderBottom?l.borderBottom:s,p=l.borderTop?i:2*i,v=h!==d?1:o-a[u]+1;e.setEdge(c,h,{minlen:v,weight:p,nestingEdge:!0}),e.setEdge(d,f,{minlen:v,weight:p,nestingEdge:!0})})),e.parent(u)||e.setEdge(n,c,{weight:0,minlen:o+a[u]})}else u!==n&&e.setEdge(n,u,{weight:0,minlen:r})},Re=function(t){var e,n={},r=function e(r,i){var o=t.children(r);null==o||o.forEach((function(t){return e(t,i+1)})),n[r]=i};return null===(e=t.children())||void 0===e||e.forEach((function(t){return r(t,1)})),n};const Oe=function(t){var e,n=ee.addDummyNode(t,"root",{},"_root"),r=Re(t),i=Math.max.apply(Math,Object.values(r))-1,o=2*i+1;t.graph().nestingRoot=n,t.edges().forEach((function(e){t.edge(e).minlen*=o}));var a=function(t){var e=0;return t.edges().forEach((function(n){e+=t.edge(n).weight})),e}(t)+1;null===(e=t.children())||void 0===e||e.forEach((function(e){ke(t,n,o,a,i,r,e)})),t.graph().nodeRankFactor=o};var Me=function(t,e,n,r,i,o){var a={rank:o,width:0,height:0,borderType:e},u=i[e][o-1],s=ee.addDummyNode(t,"border",a,n);i[e][o]=s,t.setParent(s,r),u&&t.setEdge(u,s,{weight:1})};const Pe=function(t){var e,n=function e(n){var r=t.children(n),i=t.node(n);if((null==r?void 0:r.length)&&r.forEach((function(t){return e(t)})),i.hasOwnProperty("minRank")){i.borderLeft=[],i.borderRight=[];for(var o=i.minRank,a=i.maxRank+1;o<a;++o)Me(t,"borderLeft","_bl",n,i,o),Me(t,"borderRight","_br",n,i,o)}};null===(e=t.children())||void 0===e||e.forEach((function(t){return n(t)}))};var Ge=function(t){t.nodes().forEach((function(e){Le(t.node(e))})),t.edges().forEach((function(e){Le(t.edge(e))}))},Le=function(t){var e=t.width;t.width=t.height,t.height=e},Ue=function(t){t.y=-t.y},Fe=function(t){var e=t.x;t.x=t.y,t.y=e};const Be=function(t){var e,n=null===(e=t.graph().rankdir)||void 0===e?void 0:e.toLowerCase();"bt"!==n&&"rl"!==n||function(t){t.nodes().forEach((function(e){Ue(t.node(e))})),t.edges().forEach((function(e){var n=t.edge(e);n.points.forEach((function(t){return Ue(t)})),n.hasOwnProperty("y")&&Ue(n)}))}(t),"lr"!==n&&"rl"!==n||(function(t){t.nodes().forEach((function(e){Fe(t.node(e))})),t.edges().forEach((function(e){var n=t.edge(e);n.points.forEach((function(t){return Fe(t)})),n.hasOwnProperty("x")&&Fe(n)}))}(t),Ge(t))},ze=function(t){for(var e={},n=t.nodes().filter((function(e){var n;return!(null===(n=t.children(e))||void 0===n?void 0:n.length)})),r=n.map((function(e){return t.node(e).rank})),i=Math.max.apply(Math,r),o=[],a=0;a<i+1;a++)o.push([]);var u=n.sort((function(e,n){return t.node(e).rank-t.node(n).rank}));return u.filter((function(e){return void 0!==t.node(e).fixorder})).sort((function(e,n){return t.node(e).fixorder-t.node(n).fixorder})).forEach((function(n){o[t.node(n).rank].push(n),e[n]=!0})),u.forEach((function n(r){var i;if(!e.hasOwnProperty(r)){e[r]=!0;var a=t.node(r);o[a.rank].push(r),null===(i=t.successors(r))||void 0===i||i.forEach((function(t){return n(t)}))}})),o};var je=function(t,e,n){for(var r=Yt(n,n.map((function(t,e){return e}))),i=e.map((function(e){var n,i=null===(n=t.outEdges(e))||void 0===n?void 0:n.map((function(e){return{pos:r[e.w],weight:t.edge(e).weight}}));return null==i?void 0:i.sort((function(t,e){return t.pos-e.pos}))})).flat(),o=1;o<n.length;)o<<=1;var a=2*o-1;o-=1;var u=Array(a).fill(0,0,a),s=0;return i.forEach((function(t){var e=t.pos+o;u[e]+=t.weight;for(var n=0;e>0;)e%2&&(n+=u[e+1]),u[e=e-1>>1]+=t.weight;s+=t.weight*n})),s};const We=function(t,e){for(var n=0,r=1;r<e.length;++r)n+=je(t,e[r-1],e[r]);return n};var Ve=Gt.Graph;const Xe=function(t,e,n){var r=function(t){for(var e;t.hasNode(e="_root"+Math.random()););return e}(t),i=new Ve({compound:!0}).setGraph({root:r}).setDefaultNodeLabel((function(e){return t.node(e)}));return t.nodes().forEach((function(o){var a=t.node(o),u=t.parent(o);(a.rank===e||a.minRank<=e&&e<=a.maxRank)&&(i.setNode(o),i.setParent(o,u||r),t[n](o).forEach((function(e){var n=e.v===o?e.w:e.v,r=i.edge(n,o),a=void 0!==r?r.weight:0;i.setEdge(n,o,{weight:t.edge(e).weight+a})})),a.hasOwnProperty("minRank")&&i.setNode(o,{borderLeft:a.borderLeft[e],borderRight:a.borderRight[e]}))})),i};var He=function(t,e){var n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0};const qe=function(t,e){var n,r,i={};return t.forEach((function(t,e){var n=i[t.v]={i:e,indegree:0,in:[],out:[],vs:[t.v]};void 0!==t.barycenter&&(n.barycenter=t.barycenter,n.weight=t.weight)})),e.edges().forEach((function(t){var e=i[t.v],n=i[t.w];void 0!==e&&void 0!==n&&(n.indegree++,e.out.push(i[t.w]))})),function(t){for(var e=[],n=function(){var n=t.pop();e.push(n),n.in.reverse().forEach((function(t){return e=n,function(t){t.merged||(void 0!==t.barycenter||void 0!==e.barycenter||t.barycenter>=e.barycenter)&&He(e,t)};var e})),n.out.forEach((function(e){return r=n,function(e){e.in.push(r),0==--e.indegree&&t.push(e)};var r}))};null==t?void 0:t.length;)n();var r=e.filter((function(t){return!t.merged})),i=["vs","i","barycenter","weight"];return r.map((function(t){var e={};return i.forEach((function(n){void 0!==t[n]&&(e[n]=t[n])})),e}))}(null===(r=(n=Object.values(i)).filter)||void 0===r?void 0:r.call(n,(function(t){return!t.indegree})))};var Ye=function(t,e,n){for(var r,i=n;e.length&&(r=e[e.length-1]).i<=i;)e.pop(),t.push(r.vs),i++;return i};const Ke=function t(e,n,r,i,o){var a,u,s,c=e.children(n),f=e.node(n),l=f?f.borderLeft:void 0,h=f?f.borderRight:void 0,d={};l&&(c=null==c?void 0:c.filter((function(t){return t!==l&&t!==h})));var p=function(t,e){return e.map((function(e){var n=t.inEdges(e);if(!(null==n?void 0:n.length))return{v:e};var r={sum:0,weight:0};return n.forEach((function(e){var n=t.edge(e),i=t.node(e.v);r.sum+=n.weight*i.order,r.weight+=n.weight})),{v:e,barycenter:r.sum/r.weight,weight:r.weight}}))}(e,c||[]);p.forEach((function(n){var o,a,u;if(null===(o=e.children(n.v))||void 0===o?void 0:o.length){var s=t(e,n.v,r,i);d[n.v]=s,s.hasOwnProperty("barycenter")&&(u=s,void 0!==(a=n).barycenter?(a.barycenter=(a.barycenter*a.weight+u.barycenter*u.weight)/(a.weight+u.weight),a.weight+=u.weight):(a.barycenter=u.barycenter,a.weight=u.weight))}}));var v=qe(p,r);(function(t,e){t.forEach((function(t){var n=t.vs.map((function(t){return e[t]?e[t].vs:t}));t.vs=n.flat()}))})(v,d),v.forEach((function(t){var n=e.node(t.vs[0]);t.fixorder=n.fixorder,t.order=n.order}));var g=function(t,e,n){var r=ee.partition(t,(function(t){return t.hasOwnProperty("fixorder")&&!isNaN(t.fixorder)||t.hasOwnProperty("barycenter")})),i=r.lhs,o=r.rhs.sort((function(t,e){return-t.i- -e.i})),a=[],u=0,s=0,c=0;i.sort(function(t,e){return function(n,r){if(void 0!==n.fixorder&&void 0!==r.fixorder)return n.fixorder-r.fixorder;if(n.barycenter<r.barycenter)return-1;if(n.barycenter>r.barycenter)return 1;if(e&&void 0!==n.order&&void 0!==r.order){if(n.order<r.order)return-1;if(n.order>r.order)return 1}return t?r.i-n.i:n.i-r.i}}(!!e,!!n)),c=Ye(a,o,c),i.forEach((function(t){c+=t.vs.length,a.push(t.vs),u+=t.barycenter*t.weight,s+=t.weight,c=Ye(a,o,c)}));var f={vs:a.flat()};return s&&(f.barycenter=u/s,f.weight=s),f}(v,i,o);if(l&&(g.vs=[l,g.vs,h].flat(),null===(a=e.predecessors(l))||void 0===a?void 0:a.length)){var y=e.node((null===(u=e.predecessors(l))||void 0===u?void 0:u[0])||{}),m=e.node((null===(s=e.predecessors(h))||void 0===s?void 0:s[0])||{});g.hasOwnProperty("barycenter")||(g.barycenter=0,g.weight=0),g.barycenter=(g.barycenter*g.weight+y.order+m.order)/(g.weight+2),g.weight+=2}return g};var Ze=Gt.Graph,$e=function(t,e,n){return e.map((function(e){return Xe(t,e,n)}))},Je=function(t,e,n){var r=new Ze;null==t||t.forEach((function(t){var i=t.graph().root,o=Ke(t,i,r,e,n);o.vs.forEach((function(e,n){t.node(e).order=n})),function(t,e,n){var r,i={};n.forEach((function(n){for(var o,a,u=t.parent(n);u;){if((o=t.parent(u))?(a=i[o],i[o]=u):(a=r,r=u),a&&a!==u)return void e.setEdge(a,u);u=o}}))}(t,r,o.vs)}))},Qe=function(t,e){null==e||e.forEach((function(e){e.forEach((function(e,n){t.node(e).order=n}))}))};var tn=Gt.Graph,en=function(t,e){var n;if(t.node(e).dummy)return null===(n=t.predecessors(e))||void 0===n?void 0:n.find((function(e){return t.node(e).dummy}))},nn=function(t,e,n){var r=e,i=n;if(r>i){var o=r;r=i,i=o}var a=t[r];a||(t[r]=a={}),a[i]=!0},rn=function(t,e,n){var r=e,i=n;return r>i&&(r=i,i=e),t[r]&&t[r].hasOwnProperty(i)},on=function(t,e,n,r){var i=new tn,o=t.graph(),a=an(o.nodesep,o.edgesep,r);return e.forEach((function(e){var r;e.forEach((function(e){var o=n[e];if(i.setNode(o),r){var u=n[r],s=i.edge(u,o);i.setEdge(u,o,Math.max(a(t,e,r),s||0))}r=e}))})),i};var an=function(t,e,n){return function(r,i,o){var a,u=r.node(i),s=r.node(o),c=0;if(c+=u.width/2,u.hasOwnProperty("labelpos"))switch((u.labelpos||"").toLowerCase()){case"l":a=-u.width/2;break;case"r":a=u.width/2}if(a&&(c+=n?a:-a),a=0,c+=(u.dummy?e:t)/2,c+=(s.dummy?e:t)/2,c+=s.width/2,s.hasOwnProperty("labelpos"))switch((s.labelpos||"").toLowerCase()){case"l":a=s.width/2;break;case"r":a=-s.width/2}return a&&(c+=n?a:-a),a=0,c}},un=function(t,e){var n;return(null===(n=t.node(e))||void 0===n?void 0:n.width)||0};const sn=function(t){var e;!function(t){var e=ee.buildLayerMatrix(t),n=t.graph().ranksep,r=0;e.forEach((function(e){var i=e.map((function(e){return t.node(e).height})),o=Math.max.apply(Math,i);e.forEach((function(e){t.node(e).y=r+o/2})),r+=o+n}))}(t=ee.asNonCompoundGraph(t));var n=function(t){var e,n=ee.buildLayerMatrix(t),r=Object.assign(function(t,e){var n={};return(null==e?void 0:e.length)&&e.reduce((function(e,r){var i=0,o=0,a=e.length,u=r[(null==r?void 0:r.length)-1];return r.forEach((function(e,s){var c=en(t,e),f=c?t.node(c).order:a;(c||e===u)&&(r.slice(o,s+1).forEach((function(e){var r;null===(r=t.predecessors(e))||void 0===r||r.forEach((function(r){var o=t.node(r),a=o.order;!(a<i||f<a)||o.dummy&&t.node(e).dummy||nn(n,r,e)}))})),o=s+1,i=f)})),r})),n}(t,n),function(t,e){var n={},r=function(e,r,i,o,a){for(var u,s=[],c=r;c<i;c++)s.push(c);s.forEach((function(r){var i;u=e[r],t.node(u).dummy&&(null===(i=t.predecessors(u))||void 0===i||i.forEach((function(e){var r=t.node(e);r.dummy&&(r.order<o||r.order>a)&&nn(n,e,u)})))}))};return(null==e?void 0:e.length)&&e.reduce((function(e,n){var i,o=-1,a=0;return n.forEach((function(u,s){if("border"===t.node(u).dummy){var c=t.predecessors(u)||[];c.length&&(i=t.node(c[0]).order,r(n,a,s,o,i),a=s,o=i)}r(n,a,n.length,i,e.length)})),n})),n}(t,n)),i={};["u","d"].forEach((function(o){e="u"===o?n:Object.values(n).reverse(),["l","r"].forEach((function(n){"r"===n&&(e=e.map((function(t){return Object.values(t).reverse()})));var a=("u"===o?t.predecessors:t.successors).bind(t),u=function(t,e,n,r){var i={},o={},a={};return e.forEach((function(t){t.forEach((function(t,e){i[t]=t,o[t]=t,a[t]=e}))})),e.forEach((function(t){var e=-1;t.forEach((function(t){var u=r(t);if(u.length)for(var s=((u=u.sort((function(t,e){return a[t]-a[e]}))).length-1)/2,c=Math.floor(s),f=Math.ceil(s);c<=f;++c){var l=u[c];o[t]===t&&e<a[l]&&!rn(n,t,l)&&(o[l]=t,o[t]=i[t]=i[l],e=a[l])}}))})),{root:i,align:o}}(0,e,r,a),s=function(t,e,n,r,i){var o={},a=on(t,e,n,i),u=i?"borderLeft":"borderRight",s=function(t,e){for(var n=a.nodes(),r=n.pop(),i={};r;)i[r]?t(r):(i[r]=!0,n.push(r),n=n.concat(e(r))),r=n.pop()};return s((function(t){o[t]=(a.inEdges(t)||[]).reduce((function(t,e){return Math.max(t,(o[e.v]||0)+a.edge(e))}),0)}),a.predecessors.bind(a)),s((function(e){var n=(a.outEdges(e)||[]).reduce((function(t,e){return Math.min(t,(o[e.w]||0)-a.edge(e))}),Number.POSITIVE_INFINITY),r=t.node(e);n!==Number.POSITIVE_INFINITY&&r.borderType!==u&&(o[e]=Math.max(o[e],n))}),a.successors.bind(a)),Object.values(r).forEach((function(t){o[t]=o[n[t]]})),o}(t,e,u.root,u.align,"r"===n);"r"===n&&Object.keys(s).forEach((function(t){return s[t]=-s[t]})),i[o+n]=s}))}));var o=function(t,e){return ee.minBy(Object.values(e),(function(e){var n=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY;return Object.keys(e).forEach((function(i){var o=e[i],a=un(t,i)/2;n=Math.max(o+a,n),r=Math.min(o-a,r)})),n-r}))}(t,i);return o&&function(t,e){var n=Object.values(e),r=Math.min.apply(Math,n),i=Math.max.apply(Math,n);["u","d"].forEach((function(n){["l","r"].forEach((function(o){var a,u=n+o,s=t[u];if(s!==e){var c=Object.values(s);(a="l"===o?r-Math.min.apply(Math,c):i-Math.max.apply(Math,c))&&(t[u]={},Object.keys(s).forEach((function(e){t[u][e]=s[e]+a})))}}))}))}(i,o),function(t,e){var n={};return Object.keys(t.ul).forEach((function(r){if(e)n[r]=t[e.toLowerCase()][r];else{var i=Object.values(t).map((function(t){return t[r]})).sort((function(t,e){return t-e}));n[r]=(i[1]+i[2])/2}})),n}(i,t.graph().align)}(t);null===(e=Object.keys(n))||void 0===e||e.forEach((function(e){t.node(e).x=n[e]}))};var cn=Gt.Graph,fn=function(t,e,n){e(" removeSelfEdges",(function(){In(t)})),e(" acyclic",(function(){!function(t){("greedy"===t.graph().acyclicer?Vt(t,function(t){return function(e){return t.edge(e).weight}}(t)):function(t){var e=[],n={},r={};return t.nodes().forEach((function i(o){var a;r.hasOwnProperty(o)||(r[o]=!0,n[o]=!0,null===(a=t.outEdges(o))||void 0===a||a.forEach((function(t){n.hasOwnProperty(t.w)?e.push(t):i(t.w)})),delete n[o])})),e}(t)).forEach((function(e){var n=t.edge(e);t.removeEdge(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,"rev-"+Math.random())}))}(t)})),e(" nestingGraph.run",(function(){Oe(t)})),e(" rank",(function(){De(ee.asNonCompoundGraph(t))})),e(" injectEdgeLabelProxies",(function(){bn(t)})),e(" removeEmptyRanks",(function(){Zt(t)})),e(" nestingGraph.cleanup",(function(){!function(t){var e=t.graph();e.nestingRoot&&t.removeNode(e.nestingRoot),delete e.nestingRoot,t.edges().forEach((function(e){t.edge(e).nestingEdge&&t.removeEdge(e)}))}(t)})),e(" normalizeRanks",(function(){Kt(t)})),e(" assignRankMinMax",(function(){_n(t)})),e(" removeEdgeLabelProxies",(function(){xn(t)})),e(" normalize.run",(function(){ne(t)})),e(" parentDummyChains",(function(){Ne(t)})),e(" addBorderSegments",(function(){Pe(t)})),n&&n.keepNodeOrder&&e(" initDataOrder",(function(){!function(t,e){for(var n=t.nodes().filter((function(e){var n;return!(null===(n=t.children(e))||void 0===n?void 0:n.length)})).map((function(e){return t.node(e).rank})),r=Math.max.apply(Math,n),i=[],o=0;o<r+1;o++)i.push([]);e.forEach((function(e){var n=t.node(e);n&&!n.dummy&&(n.fixorder=i[n.rank].length,i[n.rank].push(e))}))}(t,n.nodeOrder)})),e(" order",(function(){!function(t){for(var e=ee.maxRank(t),n=[],r=[],i=1;i<e+1;i++)n.push(i);for(i=e-1;i>-1;i--)r.push(i);var o=$e(t,n,"inEdges"),a=$e(t,r,"outEdges"),u=ze(t);Qe(t,u);for(var s,c=Number.POSITIVE_INFINITY,f=(i=0,0);f<4;++i,++f)Je(i%2?o:a,i%4>=2),u=ee.buildLayerMatrix(t),(l=We(t,u))<c&&(f=0,s=h(u),c=l);for(u=ze(t),Qe(t,u),i=0,f=0;f<4;++i,++f){var l;Je(i%2?o:a,i%4>=2,!0),u=ee.buildLayerMatrix(t),(l=We(t,u))<c&&(f=0,s=h(u),c=l)}Qe(t,s)}(t)})),e(" insertSelfEdges",(function(){Cn(t)})),e(" adjustCoordinateSystem",(function(){!function(t){var e,n=null===(e=t.graph().rankdir)||void 0===e?void 0:e.toLowerCase();"lr"!==n&&"rl"!==n||Ge(t)}(t)})),e(" position",(function(){sn(t)})),e(" positionSelfEdges",(function(){Dn(t)})),e(" removeBorderNodes",(function(){Tn(t)})),e(" normalize.undo",(function(){!function(t){var e;null===(e=t.graph().dummyChains)||void 0===e||e.forEach((function(e){var n,r,i=t.node(e),o=i.edgeLabel;i.edgeObj&&t.setEdge(i.edgeObj,o);for(var a=e;i.dummy;)r=null===(n=t.successors(a))||void 0===n?void 0:n[0],t.removeNode(a),o.points.push({x:i.x,y:i.y}),"edge-label"===i.dummy&&(o.x=i.x,o.y=i.y,o.width=i.width,o.height=i.height),a=r,i=t.node(a)}))}(t)})),e(" fixupEdgeLabelCoords",(function(){Sn(t)})),e(" undoCoordinateSystem",(function(){Be(t)})),e(" translateGraph",(function(){wn(t)})),e(" assignNodeIntersects",(function(){En(t)})),e(" reversePoints",(function(){An(t)})),e(" acyclic.undo",(function(){!function(t){t.edges().forEach((function(e){var n=t.edge(e);if(n.reversed){t.removeEdge(e);var r=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,r)}}))}(t)}))},ln=["nodesep","edgesep","ranksep","marginx","marginy"],hn={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},dn=["acyclicer","ranker","rankdir","align"],pn=["width","height","layer","fixorder"],vn={width:0,height:0},gn=["minlen","weight","width","height","labeloffset"],yn={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},mn=["labelpos"],bn=function(t){t.edges().forEach((function(e){var n=t.edge(e);if(n.width&&n.height){var r=t.node(e.v),i={e,rank:(t.node(e.w).rank-r.rank)/2+r.rank};ee.addDummyNode(t,"edge-proxy",i,"_ep")}}))},_n=function(t){var e=0;t.nodes().forEach((function(n){var r=t.node(n);r.borderTop&&(r.minRank=t.node(r.borderTop).rank,r.maxRank=t.node(r.borderBottom).rank,e=Math.max(e,r.maxRank||-1/0))})),t.graph().maxRank=e},xn=function(t){t.nodes().forEach((function(e){var n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))}))},wn=function(t){var e=Number.POSITIVE_INFINITY,n=0,r=Number.POSITIVE_INFINITY,i=0,o=t.graph(),a=o.marginx||0,u=o.marginy||0,s=function(t){var o=t.x,a=t.y,u=t.width,s=t.height;e=Math.min(e,o-u/2),n=Math.max(n,o+u/2),r=Math.min(r,a-s/2),i=Math.max(i,a+s/2)};t.nodes().forEach((function(e){s(t.node(e))})),t.edges().forEach((function(e){var n=t.edge(e);n.hasOwnProperty("x")&&s(n)})),e-=a,r-=u,t.nodes().forEach((function(n){var i=t.node(n);i.x-=e,i.y-=r})),t.edges().forEach((function(n){var i,o=t.edge(n);null===(i=o.points)||void 0===i||i.forEach((function(t){t.x-=e,t.y-=r})),o.hasOwnProperty("x")&&(o.x-=e),o.hasOwnProperty("y")&&(o.y-=r)})),o.width=n-e+a,o.height=i-r+u},En=function(t){t.edges().forEach((function(e){var n,r,i=t.edge(e),o=t.node(e.v),a=t.node(e.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=a,r=o),i.points.unshift(ee.intersectRect(o,n)),i.points.push(ee.intersectRect(a,r))}))},Sn=function(t){t.edges().forEach((function(e){var n=t.edge(e);if(n.hasOwnProperty("x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))},An=function(t){t.edges().forEach((function(e){var n=t.edge(e);n.reversed&&n.points.reverse()}))},Tn=function(t){t.nodes().forEach((function(e){var n,r,i;if(null===(n=t.children(e))||void 0===n?void 0:n.length){var o=t.node(e),a=t.node(o.borderTop),u=t.node(o.borderBottom),s=t.node(o.borderLeft[(null===(r=o.borderLeft)||void 0===r?void 0:r.length)-1]),c=t.node(o.borderRight[(null===(i=o.borderRight)||void 0===i?void 0:i.length)-1]);o.width=Math.abs(c.x-s.x),o.height=Math.abs(u.y-a.y),o.x=s.x+o.width/2,o.y=a.y+o.height/2}})),t.nodes().forEach((function(e){"border"===t.node(e).dummy&&t.removeNode(e)}))},In=function(t){t.edges().forEach((function(e){if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}}))},Cn=function(t){ee.buildLayerMatrix(t).forEach((function(e){var n=0;e.forEach((function(e,r){var i,o=t.node(e);o.order=r+n,null===(i=o.selfEdges)||void 0===i||i.forEach((function(e){ee.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:o.rank,order:r+ ++n,e:e.e,label:e.label},"_se")})),delete o.selfEdges}))}))},Dn=function(t){t.nodes().forEach((function(e){var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),i=r.x+r.width/2,o=r.y,a=n.x-i,u=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:i+2*a/3,y:o-u},{x:i+5*a/6,y:o-u},{y:o,x:i+a},{x:i+5*a/6,y:o+u},{x:i+2*a/3,y:o+u}],n.label.x=n.x,n.label.y=n.y}}))},Nn=function(t,e){var n={};return e.forEach((function(e){void 0!==t[e]&&(n[e]=+t[e])})),n},kn=function(t){var e={};return Object.keys(t).forEach((function(n){var r=t[n];e[n.toLowerCase()]=r})),e};const Rn={graphlib:Gt,layout:function(t,e){var n=e&&e.debugTiming?ee.time:ee.notime;n("layout",(function(){e&&!e.keepNodeOrder&&e.prevGraph&&n(" inheritOrder",(function(){var n,r,i;n=t,r=e.prevGraph,i=r._nodes||{},n.nodes().forEach((function(t){var e=n.node(t);void 0!==i[t]?(e.fixorder=i[t]._order,delete i[t]._order):delete e.fixorder}))}));var r=n(" buildLayoutGraph",(function(){return function(t){var e=new cn({multigraph:!0,compound:!0}),n=kn(t.graph()),r={};return dn.forEach((function(t){void 0!==n[t]&&(r[t]=n[t])})),e.setGraph(Object.assign({},hn,Nn(n,ln),r)),t.nodes().forEach((function(n){var r=kn(t.node(n)),i=Nn(r,pn);Object.keys(vn).forEach((function(t){void 0===i[t]&&(i[t]=vn[t])})),e.setNode(n,i),e.setParent(n,t.parent(n))})),t.edges().forEach((function(n){var r=kn(t.edge(n)),i={};mn.forEach((function(t){void 0!==r[t]&&(i[t]=r[t])})),e.setEdge(n,Object.assign({},yn,Nn(r,gn),i))})),e}(t)}));e&&!1===e.edgeLabelSpace||n(" makeSpaceForEdgeLabels",(function(){!function(t){var e=t.graph();e.ranksep||(e.ranksep=0),e.ranksep/=2,t.nodes().forEach((function(e){var n=t.node(e);isNaN(n.layer)||(n.layer?n.layer*=2:n.layer=0)})),t.edges().forEach((function(n){var r,i=t.edge(n);i.minlen*=2,"c"!==(null===(r=i.labelpos)||void 0===r?void 0:r.toLowerCase())&&("TB"===e.rankdir||"BT"===e.rankdir?i.width+=i.labeloffset:i.height+=i.labeloffset)}))}(r)}));try{n(" runLayout",(function(){fn(r,n,e)}))}catch(t){if("Not possible to find intersection inside of the rectangle"===t.message)return void console.error("The following error may be caused by improper layer setting, please make sure your manual layer setting does not violate the graph's structure:\n",t);throw t}n(" updateInputGraph",(function(){!function(t,e){t.nodes().forEach((function(n){var r,i=t.node(n),o=e.node(n);i&&(i.x=o.x,i.y=o.y,i._order=o.order,i._rank=o.rank,(null===(r=e.children(n))||void 0===r?void 0:r.length)&&(i.width=o.width,i.height=o.height))})),t.edges().forEach((function(n){var r=t.edge(n),i=e.edge(n);r.points=i.points,i.hasOwnProperty("x")&&(r.x=i.x,r.y=i.y)})),t.graph().width=e.graph().width,t.graph().height=e.graph().height}(t,r)}))}))},util:{time:Jt,notime:Qt}};var On=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Mn=function(t){function e(e){var n=t.call(this)||this;return n.rankdir="TB",n.nodesep=50,n.ranksep=50,n.controlPoints=!1,n.sortByCombo=!1,n.edgeLabelSpace=!0,n.nodes=[],n.edges=[],n.onLayoutEnd=function(){},n.layoutNode=function(t){var e=n.nodes.find((function(e){return e.id===t}));return!e||!1!==e.layout},n.updateCfg(e),n}return On(e,t),e.prototype.getDefaultCfg=function(){return{rankdir:"TB",align:void 0,nodeSize:void 0,nodesepFunc:void 0,ranksepFunc:void 0,nodesep:50,ranksep:50,controlPoints:!1}},e.prototype.execute=function(){var t=this,e=this,n=e.nodes,r=e.nodeSize,i=e.rankdir,u=e.combos,s=e.begin;if(n){var c,f=e.edges||[],h=new Rn.graphlib.Graph({multigraph:!0,compound:!0});c=r?o(r)?function(){return r}:function(){return[r,r]}:function(t){return t.size?o(t.size)?t.size:l(t.size)?[t.size.width||40,t.size.height||40]:[t.size,t.size]:[40,40]};var p=Pn(e.nodesepFunc,e.nodesep,50),v=Pn(e.ranksepFunc,e.ranksep,50);"LR"!==i&&"RL"!==i||(p=Pn(e.ranksepFunc,e.ranksep,50),v=Pn(e.nodesepFunc,e.nodesep,50)),h.setDefaultEdgeLabel((function(){return{}})),h.setGraph(e);var g={};n.filter((function(t){return!1!==t.layout})).forEach((function(e){var n=c(e),r=v(e),i=p(e),o=n[0]+2*i,u=n[1]+2*r,s=e.layer;a(s)?h.setNode(e.id,{width:o,height:u,layer:s}):h.setNode(e.id,{width:o,height:u}),t.sortByCombo&&e.comboId&&(g[e.comboId]||(g[e.comboId]=!0,h.setNode(e.comboId,{})),h.setParent(e.id,e.comboId))})),this.sortByCombo&&u&&u.forEach((function(t){t.parentId&&(g[t.parentId]||(g[t.parentId]=!0,h.setNode(t.parentId,{})),h.setParent(t.id,t.parentId))})),f.forEach((function(e){var n=d(e,"source"),r=d(e,"target");t.layoutNode(n)&&t.layoutNode(r)&&h.setEdge(n,r,{weight:e.weight||1})}));var y=void 0;e.preset&&(y=new Rn.graphlib.Graph({multigraph:!0,compound:!0}),e.preset.nodes.forEach((function(t){null==y||y.setNode(t.id,t)}))),Rn.layout(h,{prevGraph:y,edgeLabelSpace:e.edgeLabelSpace,keepNodeOrder:Boolean(!!e.nodeOrder),nodeOrder:e.nodeOrder});var m=[0,0];if(s){var b=1/0,_=1/0;h.nodes().forEach((function(t){var e=h.node(t);b>e.x&&(b=e.x),_>e.y&&(_=e.y)})),h.edges().forEach((function(t){h.edge(t).points.forEach((function(t){b>t.x&&(b=t.x),_>t.y&&(_=t.y)}))})),m[0]=s[0]-b,m[1]=s[1]-_}return h.nodes().forEach((function(t){var e=h.node(t),r=n.findIndex((function(e){return e.id===t}));n[r]&&(n[r].x=e.x+m[0],n[r].y=e.y+m[1],n[r]._order=e._order)})),h.edges().forEach((function(t){var n=h.edge(t),r=f.findIndex((function(e){var n=d(e,"source"),r=d(e,"target");return n===t.v&&r===t.w}));e.edgeLabelSpace&&e.controlPoints&&"loop"!==f[r].type&&(f[r].controlPoints=n.points.slice(1,n.points.length-1),f[r].controlPoints.forEach((function(t){t.x+=m[0],t.y+=m[1]})))})),e.onLayoutEnd&&e.onLayoutEnd(),{nodes:n,edges:f}}},e.prototype.getType=function(){return"dagre"},e}(t);function Pn(t,e,n){return t||(a(e)?function(){return e}:function(){return n})}const Gn=Object.prototype.toString;function Ln(t){return Gn.call(t).endsWith("Array]")}const Un=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Ln(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");var n=e.fromIndex,r=void 0===n?0:n,i=e.toIndex,o=void 0===i?t.length:i;if(r<0||r>=t.length||!Number.isInteger(r))throw new Error("fromIndex must be a positive integer smaller than length");if(o<=r||o>t.length||!Number.isInteger(o))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var a=t[r],u=r+1;u<o;u++)t[u]>a&&(a=t[u]);return a},Fn=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Ln(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");var n=e.fromIndex,r=void 0===n?0:n,i=e.toIndex,o=void 0===i?t.length:i;if(r<0||r>=t.length||!Number.isInteger(r))throw new Error("fromIndex must be a positive integer smaller than length");if(o<=r||o>t.length||!Number.isInteger(o))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var a=t[r],u=r+1;u<o;u++)t[u]<a&&(a=t[u]);return a};function Bn(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Ln(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");if(void 0!==n.output){if(!Ln(n.output))throw new TypeError("output option must be an array if specified");e=n.output}else e=new Array(t.length);var r=Fn(t),i=Un(t);if(r===i)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var o=n.min,a=void 0===o?n.autoMinMax?r:0:o,u=n.max,s=void 0===u?n.autoMinMax?i:1:u;if(a>=s)throw new RangeError("min option must be smaller than max option");for(var c=(s-a)/(i-r),f=0;f<t.length;f++)e[f]=(t[f]-r)*c+a;return e}const zn=" ".repeat(2),jn=" ".repeat(4);function Wn(t,e={}){const{maxRows:n=15,maxColumns:r=10,maxNumSize:i=8}=e;return`${t.constructor.name} {\n${zn}[\n${jn}${function(t,e,n,r){const{rows:i,columns:o}=t,a=Math.min(i,e),u=Math.min(o,n),s=[];for(let e=0;e<a;e++){let n=[];for(let i=0;i<u;i++)n.push(Vn(t.get(e,i),r));s.push(`${n.join(" ")}`)}return u!==o&&(s[s.length-1]+=` ... ${o-n} more columns`),a!==i&&s.push(`... ${i-e} more rows`),s.join(`\n${jn}`)}(t,n,r,i)}\n${zn}]\n${zn}rows: ${t.rows}\n${zn}columns: ${t.columns}\n}`}function Vn(t,e){const n=String(t);if(n.length<=e)return n.padEnd(e," ");const r=t.toPrecision(e-2);if(r.length<=e)return r;const i=t.toExponential(e-2),o=i.indexOf("e"),a=i.slice(o);return i.slice(0,e-a.length)+a}function Xn(t,e,n){let r=n?t.rows:t.rows-1;if(e<0||e>r)throw new RangeError("Row index out of range")}function Hn(t,e,n){let r=n?t.columns:t.columns-1;if(e<0||e>r)throw new RangeError("Column index out of range")}function qn(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.columns)throw new RangeError("vector size must be the same as the number of columns");return e}function Yn(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.rows)throw new RangeError("vector size must be the same as the number of rows");return e}function Kn(t,e){if("object"!=typeof e)throw new TypeError("unexpected type for row indices");if(e.some((e=>e<0||e>=t.rows)))throw new RangeError("row indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function Zn(t,e){if("object"!=typeof e)throw new TypeError("unexpected type for column indices");if(e.some((e=>e<0||e>=t.columns)))throw new RangeError("column indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function $n(t,e,n,r,i){if(5!==arguments.length)throw new RangeError("expected 4 arguments");if(Qn("startRow",e),Qn("endRow",n),Qn("startColumn",r),Qn("endColumn",i),e>n||r>i||e<0||e>=t.rows||n<0||n>=t.rows||r<0||r>=t.columns||i<0||i>=t.columns)throw new RangeError("Submatrix indices are out of range")}function Jn(t,e=0){let n=[];for(let r=0;r<t;r++)n.push(e);return n}function Qn(t,e){if("number"!=typeof e)throw new TypeError(`${t} must be a number`)}function tr(t){if(t.isEmpty())throw new Error("Empty matrix has no elements to index")}class er{static from1DArray(t,e,n){if(t*e!==n.length)throw new RangeError("data length does not match given dimensions");let r=new rr(t,e);for(let i=0;i<t;i++)for(let t=0;t<e;t++)r.set(i,t,n[i*e+t]);return r}static rowVector(t){let e=new rr(1,t.length);for(let n=0;n<t.length;n++)e.set(0,n,t[n]);return e}static columnVector(t){let e=new rr(t.length,1);for(let n=0;n<t.length;n++)e.set(n,0,t[n]);return e}static zeros(t,e){return new rr(t,e)}static ones(t,e){return new rr(t,e).fill(1)}static rand(t,e,n={}){if("object"!=typeof n)throw new TypeError("options must be an object");const{random:r=Math.random}=n;let i=new rr(t,e);for(let n=0;n<t;n++)for(let t=0;t<e;t++)i.set(n,t,r());return i}static randInt(t,e,n={}){if("object"!=typeof n)throw new TypeError("options must be an object");const{min:r=0,max:i=1e3,random:o=Math.random}=n;if(!Number.isInteger(r))throw new TypeError("min must be an integer");if(!Number.isInteger(i))throw new TypeError("max must be an integer");if(r>=i)throw new RangeError("min must be smaller than max");let a=i-r,u=new rr(t,e);for(let n=0;n<t;n++)for(let t=0;t<e;t++){let e=r+Math.round(o()*a);u.set(n,t,e)}return u}static eye(t,e,n){void 0===e&&(e=t),void 0===n&&(n=1);let r=Math.min(t,e),i=this.zeros(t,e);for(let t=0;t<r;t++)i.set(t,t,n);return i}static diag(t,e,n){let r=t.length;void 0===e&&(e=r),void 0===n&&(n=e);let i=Math.min(r,e,n),o=this.zeros(e,n);for(let e=0;e<i;e++)o.set(e,e,t[e]);return o}static min(t,e){t=this.checkMatrix(t),e=this.checkMatrix(e);let n=t.rows,r=t.columns,i=new rr(n,r);for(let o=0;o<n;o++)for(let n=0;n<r;n++)i.set(o,n,Math.min(t.get(o,n),e.get(o,n)));return i}static max(t,e){t=this.checkMatrix(t),e=this.checkMatrix(e);let n=t.rows,r=t.columns,i=new this(n,r);for(let o=0;o<n;o++)for(let n=0;n<r;n++)i.set(o,n,Math.max(t.get(o,n),e.get(o,n)));return i}static checkMatrix(t){return er.isMatrix(t)?t:new rr(t)}static isMatrix(t){return null!=t&&"Matrix"===t.klass}get size(){return this.rows*this.columns}apply(t){if("function"!=typeof t)throw new TypeError("callback must be a function");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)t.call(this,e,n);return this}to1DArray(){let t=[];for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)t.push(this.get(e,n));return t}to2DArray(){let t=[];for(let e=0;e<this.rows;e++){t.push([]);for(let n=0;n<this.columns;n++)t[e].push(this.get(e,n))}return t}toJSON(){return this.to2DArray()}isRowVector(){return 1===this.rows}isColumnVector(){return 1===this.columns}isVector(){return 1===this.rows||1===this.columns}isSquare(){return this.rows===this.columns}isEmpty(){return 0===this.rows||0===this.columns}isSymmetric(){if(this.isSquare()){for(let t=0;t<this.rows;t++)for(let e=0;e<=t;e++)if(this.get(t,e)!==this.get(e,t))return!1;return!0}return!1}isEchelonForm(){let t=0,e=0,n=-1,r=!0,i=!1;for(;t<this.rows&&r;){for(e=0,i=!1;e<this.columns&&!1===i;)0===this.get(t,e)?e++:1===this.get(t,e)&&e>n?(i=!0,n=e):(r=!1,i=!0);t++}return r}isReducedEchelonForm(){let t=0,e=0,n=-1,r=!0,i=!1;for(;t<this.rows&&r;){for(e=0,i=!1;e<this.columns&&!1===i;)0===this.get(t,e)?e++:1===this.get(t,e)&&e>n?(i=!0,n=e):(r=!1,i=!0);for(let n=e+1;n<this.rows;n++)0!==this.get(t,n)&&(r=!1);t++}return r}echelonForm(){let t=this.clone(),e=0,n=0;for(;e<t.rows&&n<t.columns;){let r=e;for(let i=e;i<t.rows;i++)t.get(i,n)>t.get(r,n)&&(r=i);if(0===t.get(r,n))n++;else{t.swapRows(e,r);let i=t.get(e,n);for(let r=n;r<t.columns;r++)t.set(e,r,t.get(e,r)/i);for(let r=e+1;r<t.rows;r++){let i=t.get(r,n)/t.get(e,n);t.set(r,n,0);for(let o=n+1;o<t.columns;o++)t.set(r,o,t.get(r,o)-t.get(e,o)*i)}e++,n++}}return t}reducedEchelonForm(){let t=this.echelonForm(),e=t.columns,n=t.rows,r=n-1;for(;r>=0;)if(0===t.maxRow(r))r--;else{let i=0,o=!1;for(;i<n&&!1===o;)1===t.get(r,i)?o=!0:i++;for(let n=0;n<r;n++){let o=t.get(n,i);for(let a=i;a<e;a++){let e=t.get(n,a)-o*t.get(r,a);t.set(n,a,e)}}r--}return t}set(){throw new Error("set method is unimplemented")}get(){throw new Error("get method is unimplemented")}repeat(t={}){if("object"!=typeof t)throw new TypeError("options must be an object");const{rows:e=1,columns:n=1}=t;if(!Number.isInteger(e)||e<=0)throw new TypeError("rows must be a positive integer");if(!Number.isInteger(n)||n<=0)throw new TypeError("columns must be a positive integer");let r=new rr(this.rows*e,this.columns*n);for(let t=0;t<e;t++)for(let e=0;e<n;e++)r.setSubMatrix(this,this.rows*t,this.columns*e);return r}fill(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,t);return this}neg(){return this.mulS(-1)}getRow(t){Xn(this,t);let e=[];for(let n=0;n<this.columns;n++)e.push(this.get(t,n));return e}getRowVector(t){return rr.rowVector(this.getRow(t))}setRow(t,e){Xn(this,t),e=qn(this,e);for(let n=0;n<this.columns;n++)this.set(t,n,e[n]);return this}swapRows(t,e){Xn(this,t),Xn(this,e);for(let n=0;n<this.columns;n++){let r=this.get(t,n);this.set(t,n,this.get(e,n)),this.set(e,n,r)}return this}getColumn(t){Hn(this,t);let e=[];for(let n=0;n<this.rows;n++)e.push(this.get(n,t));return e}getColumnVector(t){return rr.columnVector(this.getColumn(t))}setColumn(t,e){Hn(this,t),e=Yn(this,e);for(let n=0;n<this.rows;n++)this.set(n,t,e[n]);return this}swapColumns(t,e){Hn(this,t),Hn(this,e);for(let n=0;n<this.rows;n++){let r=this.get(n,t);this.set(n,t,this.get(n,e)),this.set(n,e,r)}return this}addRowVector(t){t=qn(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)+t[n]);return this}subRowVector(t){t=qn(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)-t[n]);return this}mulRowVector(t){t=qn(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)*t[n]);return this}divRowVector(t){t=qn(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)/t[n]);return this}addColumnVector(t){t=Yn(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)+t[e]);return this}subColumnVector(t){t=Yn(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)-t[e]);return this}mulColumnVector(t){t=Yn(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)*t[e]);return this}divColumnVector(t){t=Yn(this,t);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)/t[e]);return this}mulRow(t,e){Xn(this,t);for(let n=0;n<this.columns;n++)this.set(t,n,this.get(t,n)*e);return this}mulColumn(t,e){Hn(this,t);for(let n=0;n<this.rows;n++)this.set(n,t,this.get(n,t)*e);return this}max(){if(this.isEmpty())return NaN;let t=this.get(0,0);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.get(e,n)>t&&(t=this.get(e,n));return t}maxIndex(){tr(this);let t=this.get(0,0),e=[0,0];for(let n=0;n<this.rows;n++)for(let r=0;r<this.columns;r++)this.get(n,r)>t&&(t=this.get(n,r),e[0]=n,e[1]=r);return e}min(){if(this.isEmpty())return NaN;let t=this.get(0,0);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.get(e,n)<t&&(t=this.get(e,n));return t}minIndex(){tr(this);let t=this.get(0,0),e=[0,0];for(let n=0;n<this.rows;n++)for(let r=0;r<this.columns;r++)this.get(n,r)<t&&(t=this.get(n,r),e[0]=n,e[1]=r);return e}maxRow(t){if(Xn(this,t),this.isEmpty())return NaN;let e=this.get(t,0);for(let n=1;n<this.columns;n++)this.get(t,n)>e&&(e=this.get(t,n));return e}maxRowIndex(t){Xn(this,t),tr(this);let e=this.get(t,0),n=[t,0];for(let r=1;r<this.columns;r++)this.get(t,r)>e&&(e=this.get(t,r),n[1]=r);return n}minRow(t){if(Xn(this,t),this.isEmpty())return NaN;let e=this.get(t,0);for(let n=1;n<this.columns;n++)this.get(t,n)<e&&(e=this.get(t,n));return e}minRowIndex(t){Xn(this,t),tr(this);let e=this.get(t,0),n=[t,0];for(let r=1;r<this.columns;r++)this.get(t,r)<e&&(e=this.get(t,r),n[1]=r);return n}maxColumn(t){if(Hn(this,t),this.isEmpty())return NaN;let e=this.get(0,t);for(let n=1;n<this.rows;n++)this.get(n,t)>e&&(e=this.get(n,t));return e}maxColumnIndex(t){Hn(this,t),tr(this);let e=this.get(0,t),n=[0,t];for(let r=1;r<this.rows;r++)this.get(r,t)>e&&(e=this.get(r,t),n[0]=r);return n}minColumn(t){if(Hn(this,t),this.isEmpty())return NaN;let e=this.get(0,t);for(let n=1;n<this.rows;n++)this.get(n,t)<e&&(e=this.get(n,t));return e}minColumnIndex(t){Hn(this,t),tr(this);let e=this.get(0,t),n=[0,t];for(let r=1;r<this.rows;r++)this.get(r,t)<e&&(e=this.get(r,t),n[0]=r);return n}diag(){let t=Math.min(this.rows,this.columns),e=[];for(let n=0;n<t;n++)e.push(this.get(n,n));return e}norm(t="frobenius"){let e=0;if("max"===t)return this.max();if("frobenius"===t){for(let t=0;t<this.rows;t++)for(let n=0;n<this.columns;n++)e+=this.get(t,n)*this.get(t,n);return Math.sqrt(e)}throw new RangeError(`unknown norm type: ${t}`)}cumulativeSum(){let t=0;for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)t+=this.get(e,n),this.set(e,n,t);return this}dot(t){er.isMatrix(t)&&(t=t.to1DArray());let e=this.to1DArray();if(e.length!==t.length)throw new RangeError("vectors do not have the same size");let n=0;for(let r=0;r<e.length;r++)n+=e[r]*t[r];return n}mmul(t){t=rr.checkMatrix(t);let e=this.rows,n=this.columns,r=t.columns,i=new rr(e,r),o=new Float64Array(n);for(let a=0;a<r;a++){for(let e=0;e<n;e++)o[e]=t.get(e,a);for(let t=0;t<e;t++){let e=0;for(let r=0;r<n;r++)e+=this.get(t,r)*o[r];i.set(t,a,e)}}return i}strassen2x2(t){t=rr.checkMatrix(t);let e=new rr(2,2);const n=this.get(0,0),r=t.get(0,0),i=this.get(0,1),o=t.get(0,1),a=this.get(1,0),u=t.get(1,0),s=this.get(1,1),c=t.get(1,1),f=(n+s)*(r+c),l=(a+s)*r,h=n*(o-c),d=s*(u-r),p=(n+i)*c,v=f+d-p+(i-s)*(u+c),g=h+p,y=l+d,m=f-l+h+(a-n)*(r+o);return e.set(0,0,v),e.set(0,1,g),e.set(1,0,y),e.set(1,1,m),e}strassen3x3(t){t=rr.checkMatrix(t);let e=new rr(3,3);const n=this.get(0,0),r=this.get(0,1),i=this.get(0,2),o=this.get(1,0),a=this.get(1,1),u=this.get(1,2),s=this.get(2,0),c=this.get(2,1),f=this.get(2,2),l=t.get(0,0),h=t.get(0,1),d=t.get(0,2),p=t.get(1,0),v=t.get(1,1),g=t.get(1,2),y=t.get(2,0),m=t.get(2,1),b=t.get(2,2),_=(n-o)*(-h+v),x=(-n+o+a)*(l-h+v),w=(o+a)*(-l+h),E=n*l,S=(-n+s+c)*(l-d+g),A=(-n+s)*(d-g),T=(s+c)*(-l+d),I=(-i+c+f)*(v+y-m),C=(i-f)*(v-m),D=i*y,N=(c+f)*(-y+m),k=(-i+a+u)*(g+y-b),R=(i-u)*(g-b),O=(a+u)*(-y+b),M=E+D+r*p,P=(n+r+i-o-a-c-f)*v+x+w+E+I+D+N,G=E+S+T+(n+r+i-a-u-s-c)*g+D+k+O,L=_+a*(-l+h+p-v-g-y+b)+x+E+D+k+R,U=_+x+w+E+u*m,F=D+k+R+O+o*d,B=E+S+A+c*(-l+d+p-v-g-y+m)+I+C+D,z=I+C+D+N+s*h,j=E+S+A+T+f*b;return e.set(0,0,M),e.set(0,1,P),e.set(0,2,G),e.set(1,0,L),e.set(1,1,U),e.set(1,2,F),e.set(2,0,B),e.set(2,1,z),e.set(2,2,j),e}mmulStrassen(t){t=rr.checkMatrix(t);let e=this.clone(),n=e.rows,r=e.columns,i=t.rows,o=t.columns;function a(t,e,n){let r=t.rows,i=t.columns;if(r===e&&i===n)return t;{let r=er.zeros(e,n);return r=r.setSubMatrix(t,0,0),r}}r!==i&&console.warn(`Multiplying ${n} x ${r} and ${i} x ${o} matrix: dimensions do not match.`);let u=Math.max(n,i),s=Math.max(r,o);return e=a(e,u,s),function t(e,n,r,i){if(r<=512||i<=512)return e.mmul(n);r%2==1&&i%2==1?(e=a(e,r+1,i+1),n=a(n,r+1,i+1)):r%2==1?(e=a(e,r+1,i),n=a(n,r+1,i)):i%2==1&&(e=a(e,r,i+1),n=a(n,r,i+1));let o=parseInt(e.rows/2,10),u=parseInt(e.columns/2,10),s=e.subMatrix(0,o-1,0,u-1),c=n.subMatrix(0,o-1,0,u-1),f=e.subMatrix(0,o-1,u,e.columns-1),l=n.subMatrix(0,o-1,u,n.columns-1),h=e.subMatrix(o,e.rows-1,0,u-1),d=n.subMatrix(o,n.rows-1,0,u-1),p=e.subMatrix(o,e.rows-1,u,e.columns-1),v=n.subMatrix(o,n.rows-1,u,n.columns-1),g=t(er.add(s,p),er.add(c,v),o,u),y=t(er.add(h,p),c,o,u),m=t(s,er.sub(l,v),o,u),b=t(p,er.sub(d,c),o,u),_=t(er.add(s,f),v,o,u),x=t(er.sub(h,s),er.add(c,l),o,u),w=t(er.sub(f,p),er.add(d,v),o,u),E=er.add(g,b);E.sub(_),E.add(w);let S=er.add(m,_),A=er.add(y,b),T=er.sub(g,y);T.add(m),T.add(x);let I=er.zeros(2*E.rows,2*E.columns);return I=I.setSubMatrix(E,0,0),I=I.setSubMatrix(S,E.rows,0),I=I.setSubMatrix(A,0,E.columns),I=I.setSubMatrix(T,E.rows,E.columns),I.subMatrix(0,r-1,0,i-1)}(e,t=a(t,u,s),u,s)}scaleRows(t={}){if("object"!=typeof t)throw new TypeError("options must be an object");const{min:e=0,max:n=1}=t;if(!Number.isFinite(e))throw new TypeError("min must be a number");if(!Number.isFinite(n))throw new TypeError("max must be a number");if(e>=n)throw new RangeError("min must be smaller than max");let r=new rr(this.rows,this.columns);for(let t=0;t<this.rows;t++){const i=this.getRow(t);i.length>0&&Bn(i,{min:e,max:n,output:i}),r.setRow(t,i)}return r}scaleColumns(t={}){if("object"!=typeof t)throw new TypeError("options must be an object");const{min:e=0,max:n=1}=t;if(!Number.isFinite(e))throw new TypeError("min must be a number");if(!Number.isFinite(n))throw new TypeError("max must be a number");if(e>=n)throw new RangeError("min must be smaller than max");let r=new rr(this.rows,this.columns);for(let t=0;t<this.columns;t++){const i=this.getColumn(t);i.length&&Bn(i,{min:e,max:n,output:i}),r.setColumn(t,i)}return r}flipRows(){const t=Math.ceil(this.columns/2);for(let e=0;e<this.rows;e++)for(let n=0;n<t;n++){let t=this.get(e,n),r=this.get(e,this.columns-1-n);this.set(e,n,r),this.set(e,this.columns-1-n,t)}return this}flipColumns(){const t=Math.ceil(this.rows/2);for(let e=0;e<this.columns;e++)for(let n=0;n<t;n++){let t=this.get(n,e),r=this.get(this.rows-1-n,e);this.set(n,e,r),this.set(this.rows-1-n,e,t)}return this}kroneckerProduct(t){t=rr.checkMatrix(t);let e=this.rows,n=this.columns,r=t.rows,i=t.columns,o=new rr(e*r,n*i);for(let a=0;a<e;a++)for(let e=0;e<n;e++)for(let n=0;n<r;n++)for(let u=0;u<i;u++)o.set(r*a+n,i*e+u,this.get(a,e)*t.get(n,u));return o}kroneckerSum(t){if(t=rr.checkMatrix(t),!this.isSquare()||!t.isSquare())throw new Error("Kronecker Sum needs two Square Matrices");let e=this.rows,n=t.rows,r=this.kroneckerProduct(rr.eye(n,n)),i=rr.eye(e,e).kroneckerProduct(t);return r.add(i)}transpose(){let t=new rr(this.columns,this.rows);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)t.set(n,e,this.get(e,n));return t}sortRows(t=nr){for(let e=0;e<this.rows;e++)this.setRow(e,this.getRow(e).sort(t));return this}sortColumns(t=nr){for(let e=0;e<this.columns;e++)this.setColumn(e,this.getColumn(e).sort(t));return this}subMatrix(t,e,n,r){$n(this,t,e,n,r);let i=new rr(e-t+1,r-n+1);for(let o=t;o<=e;o++)for(let e=n;e<=r;e++)i.set(o-t,e-n,this.get(o,e));return i}subMatrixRow(t,e,n){if(void 0===e&&(e=0),void 0===n&&(n=this.columns-1),e>n||e<0||e>=this.columns||n<0||n>=this.columns)throw new RangeError("Argument out of range");let r=new rr(t.length,n-e+1);for(let i=0;i<t.length;i++)for(let o=e;o<=n;o++){if(t[i]<0||t[i]>=this.rows)throw new RangeError(`Row index out of range: ${t[i]}`);r.set(i,o-e,this.get(t[i],o))}return r}subMatrixColumn(t,e,n){if(void 0===e&&(e=0),void 0===n&&(n=this.rows-1),e>n||e<0||e>=this.rows||n<0||n>=this.rows)throw new RangeError("Argument out of range");let r=new rr(n-e+1,t.length);for(let i=0;i<t.length;i++)for(let o=e;o<=n;o++){if(t[i]<0||t[i]>=this.columns)throw new RangeError(`Column index out of range: ${t[i]}`);r.set(o-e,i,this.get(o,t[i]))}return r}setSubMatrix(t,e,n){if((t=rr.checkMatrix(t)).isEmpty())return this;$n(this,e,e+t.rows-1,n,n+t.columns-1);for(let r=0;r<t.rows;r++)for(let i=0;i<t.columns;i++)this.set(e+r,n+i,t.get(r,i));return this}selection(t,e){let n=function(t,e,n){return{row:Kn(t,e),column:Zn(t,n)}}(this,t,e),r=new rr(t.length,e.length);for(let t=0;t<n.row.length;t++){let e=n.row[t];for(let i=0;i<n.column.length;i++){let o=n.column[i];r.set(t,i,this.get(e,o))}}return r}trace(){let t=Math.min(this.rows,this.columns),e=0;for(let n=0;n<t;n++)e+=this.get(n,n);return e}clone(){let t=new rr(this.rows,this.columns);for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)t.set(e,n,this.get(e,n));return t}sum(t){switch(t){case"row":return function(t){let e=Jn(t.rows);for(let n=0;n<t.rows;++n)for(let r=0;r<t.columns;++r)e[n]+=t.get(n,r);return e}(this);case"column":return function(t){let e=Jn(t.columns);for(let n=0;n<t.rows;++n)for(let r=0;r<t.columns;++r)e[r]+=t.get(n,r);return e}(this);case void 0:return function(t){let e=0;for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)e+=t.get(n,r);return e}(this);default:throw new Error(`invalid option: ${t}`)}}product(t){switch(t){case"row":return function(t){let e=Jn(t.rows,1);for(let n=0;n<t.rows;++n)for(let r=0;r<t.columns;++r)e[n]*=t.get(n,r);return e}(this);case"column":return function(t){let e=Jn(t.columns,1);for(let n=0;n<t.rows;++n)for(let r=0;r<t.columns;++r)e[r]*=t.get(n,r);return e}(this);case void 0:return function(t){let e=1;for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)e*=t.get(n,r);return e}(this);default:throw new Error(`invalid option: ${t}`)}}mean(t){const e=this.sum(t);switch(t){case"row":for(let t=0;t<this.rows;t++)e[t]/=this.columns;return e;case"column":for(let t=0;t<this.columns;t++)e[t]/=this.rows;return e;case void 0:return e/this.size;default:throw new Error(`invalid option: ${t}`)}}variance(t,e={}){if("object"==typeof t&&(e=t,t=void 0),"object"!=typeof e)throw new TypeError("options must be an object");const{unbiased:n=!0,mean:r=this.mean(t)}=e;if("boolean"!=typeof n)throw new TypeError("unbiased must be a boolean");switch(t){case"row":if(!Array.isArray(r))throw new TypeError("mean must be an array");return function(t,e,n){const r=t.rows,i=t.columns,o=[];for(let a=0;a<r;a++){let r=0,u=0,s=0;for(let e=0;e<i;e++)s=t.get(a,e)-n[a],r+=s,u+=s*s;e?o.push((u-r*r/i)/(i-1)):o.push((u-r*r/i)/i)}return o}(this,n,r);case"column":if(!Array.isArray(r))throw new TypeError("mean must be an array");return function(t,e,n){const r=t.rows,i=t.columns,o=[];for(let a=0;a<i;a++){let i=0,u=0,s=0;for(let e=0;e<r;e++)s=t.get(e,a)-n[a],i+=s,u+=s*s;e?o.push((u-i*i/r)/(r-1)):o.push((u-i*i/r)/r)}return o}(this,n,r);case void 0:if("number"!=typeof r)throw new TypeError("mean must be a number");return function(t,e,n){const r=t.rows,i=t.columns,o=r*i;let a=0,u=0,s=0;for(let e=0;e<r;e++)for(let r=0;r<i;r++)s=t.get(e,r)-n,a+=s,u+=s*s;return e?(u-a*a/o)/(o-1):(u-a*a/o)/o}(this,n,r);default:throw new Error(`invalid option: ${t}`)}}standardDeviation(t,e){"object"==typeof t&&(e=t,t=void 0);const n=this.variance(t,e);if(void 0===t)return Math.sqrt(n);for(let t=0;t<n.length;t++)n[t]=Math.sqrt(n[t]);return n}center(t,e={}){if("object"==typeof t&&(e=t,t=void 0),"object"!=typeof e)throw new TypeError("options must be an object");const{center:n=this.mean(t)}=e;switch(t){case"row":if(!Array.isArray(n))throw new TypeError("center must be an array");return function(t,e){for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)-e[n])}(this,n),this;case"column":if(!Array.isArray(n))throw new TypeError("center must be an array");return function(t,e){for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)-e[r])}(this,n),this;case void 0:if("number"!=typeof n)throw new TypeError("center must be a number");return function(t,e){for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)-e)}(this,n),this;default:throw new Error(`invalid option: ${t}`)}}scale(t,e={}){if("object"==typeof t&&(e=t,t=void 0),"object"!=typeof e)throw new TypeError("options must be an object");let n=e.scale;switch(t){case"row":if(void 0===n)n=function(t){const e=[];for(let n=0;n<t.rows;n++){let r=0;for(let e=0;e<t.columns;e++)r+=Math.pow(t.get(n,e),2)/(t.columns-1);e.push(Math.sqrt(r))}return e}(this);else if(!Array.isArray(n))throw new TypeError("scale must be an array");return function(t,e){for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)/e[n])}(this,n),this;case"column":if(void 0===n)n=function(t){const e=[];for(let n=0;n<t.columns;n++){let r=0;for(let e=0;e<t.rows;e++)r+=Math.pow(t.get(e,n),2)/(t.rows-1);e.push(Math.sqrt(r))}return e}(this);else if(!Array.isArray(n))throw new TypeError("scale must be an array");return function(t,e){for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)/e[r])}(this,n),this;case void 0:if(void 0===n)n=function(t){const e=t.size-1;let n=0;for(let r=0;r<t.columns;r++)for(let i=0;i<t.rows;i++)n+=Math.pow(t.get(i,r),2)/e;return Math.sqrt(n)}(this);else if("number"!=typeof n)throw new TypeError("scale must be a number");return function(t,e){for(let n=0;n<t.rows;n++)for(let r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)/e)}(this,n),this;default:throw new Error(`invalid option: ${t}`)}}toString(t){return Wn(this,t)}}function nr(t,e){return t-e}er.prototype.klass="Matrix","undefined"!=typeof Symbol&&(er.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return Wn(this)}),er.random=er.rand,er.randomInt=er.randInt,er.diagonal=er.diag,er.prototype.diagonal=er.prototype.diag,er.identity=er.eye,er.prototype.negate=er.prototype.neg,er.prototype.tensorProduct=er.prototype.kroneckerProduct;class rr extends er{constructor(t,e){if(super(),rr.isMatrix(t))return t.clone();if(Number.isInteger(t)&&t>=0){if(this.data=[],!(Number.isInteger(e)&&e>=0))throw new TypeError("nColumns must be a positive integer");for(let n=0;n<t;n++)this.data.push(new Float64Array(e))}else{if(!Array.isArray(t))throw new TypeError("First argument must be a positive number or an array");{const n=t;if("number"!=typeof(e=(t=n.length)?n[0].length:0))throw new TypeError("Data must be a 2D array with at least one element");this.data=[];for(let r=0;r<t;r++){if(n[r].length!==e)throw new RangeError("Inconsistent array dimensions");this.data.push(Float64Array.from(n[r]))}}}this.rows=t,this.columns=e}set(t,e,n){return this.data[t][e]=n,this}get(t,e){return this.data[t][e]}removeRow(t){return Xn(this,t),this.data.splice(t,1),this.rows-=1,this}addRow(t,e){return void 0===e&&(e=t,t=this.rows),Xn(this,t,!0),e=Float64Array.from(qn(this,e)),this.data.splice(t,0,e),this.rows+=1,this}removeColumn(t){Hn(this,t);for(let e=0;e<this.rows;e++){const n=new Float64Array(this.columns-1);for(let r=0;r<t;r++)n[r]=this.data[e][r];for(let r=t+1;r<this.columns;r++)n[r-1]=this.data[e][r];this.data[e]=n}return this.columns-=1,this}addColumn(t,e){void 0===e&&(e=t,t=this.columns),Hn(this,t,!0),e=Yn(this,e);for(let n=0;n<this.rows;n++){const r=new Float64Array(this.columns+1);let i=0;for(;i<t;i++)r[i]=this.data[n][i];for(r[i++]=e[n];i<this.columns+1;i++)r[i]=this.data[n][i-1];this.data[n]=r}return this.columns+=1,this}}!function(t,e){t.prototype.add=function(t){return"number"==typeof t?this.addS(t):this.addM(t)},t.prototype.addS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)+t);return this},t.prototype.addM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)+t.get(e,n));return this},t.add=function(t,n){return new e(t).add(n)},t.prototype.sub=function(t){return"number"==typeof t?this.subS(t):this.subM(t)},t.prototype.subS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)-t);return this},t.prototype.subM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)-t.get(e,n));return this},t.sub=function(t,n){return new e(t).sub(n)},t.prototype.subtract=t.prototype.sub,t.prototype.subtractS=t.prototype.subS,t.prototype.subtractM=t.prototype.subM,t.subtract=t.sub,t.prototype.mul=function(t){return"number"==typeof t?this.mulS(t):this.mulM(t)},t.prototype.mulS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)*t);return this},t.prototype.mulM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)*t.get(e,n));return this},t.mul=function(t,n){return new e(t).mul(n)},t.prototype.multiply=t.prototype.mul,t.prototype.multiplyS=t.prototype.mulS,t.prototype.multiplyM=t.prototype.mulM,t.multiply=t.mul,t.prototype.div=function(t){return"number"==typeof t?this.divS(t):this.divM(t)},t.prototype.divS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)/t);return this},t.prototype.divM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)/t.get(e,n));return this},t.div=function(t,n){return new e(t).div(n)},t.prototype.divide=t.prototype.div,t.prototype.divideS=t.prototype.divS,t.prototype.divideM=t.prototype.divM,t.divide=t.div,t.prototype.mod=function(t){return"number"==typeof t?this.modS(t):this.modM(t)},t.prototype.modS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)%t);return this},t.prototype.modM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)%t.get(e,n));return this},t.mod=function(t,n){return new e(t).mod(n)},t.prototype.modulus=t.prototype.mod,t.prototype.modulusS=t.prototype.modS,t.prototype.modulusM=t.prototype.modM,t.modulus=t.mod,t.prototype.and=function(t){return"number"==typeof t?this.andS(t):this.andM(t)},t.prototype.andS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)&t);return this},t.prototype.andM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)&t.get(e,n));return this},t.and=function(t,n){return new e(t).and(n)},t.prototype.or=function(t){return"number"==typeof t?this.orS(t):this.orM(t)},t.prototype.orS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)|t);return this},t.prototype.orM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)|t.get(e,n));return this},t.or=function(t,n){return new e(t).or(n)},t.prototype.xor=function(t){return"number"==typeof t?this.xorS(t):this.xorM(t)},t.prototype.xorS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)^t);return this},t.prototype.xorM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)^t.get(e,n));return this},t.xor=function(t,n){return new e(t).xor(n)},t.prototype.leftShift=function(t){return"number"==typeof t?this.leftShiftS(t):this.leftShiftM(t)},t.prototype.leftShiftS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)<<t);return this},t.prototype.leftShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)<<t.get(e,n));return this},t.leftShift=function(t,n){return new e(t).leftShift(n)},t.prototype.signPropagatingRightShift=function(t){return"number"==typeof t?this.signPropagatingRightShiftS(t):this.signPropagatingRightShiftM(t)},t.prototype.signPropagatingRightShiftS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)>>t);return this},t.prototype.signPropagatingRightShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)>>t.get(e,n));return this},t.signPropagatingRightShift=function(t,n){return new e(t).signPropagatingRightShift(n)},t.prototype.rightShift=function(t){return"number"==typeof t?this.rightShiftS(t):this.rightShiftM(t)},t.prototype.rightShiftS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)>>>t);return this},t.prototype.rightShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)>>>t.get(e,n));return this},t.rightShift=function(t,n){return new e(t).rightShift(n)},t.prototype.zeroFillRightShift=t.prototype.rightShift,t.prototype.zeroFillRightShiftS=t.prototype.rightShiftS,t.prototype.zeroFillRightShiftM=t.prototype.rightShiftM,t.zeroFillRightShift=t.rightShift,t.prototype.not=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,~this.get(t,e));return this},t.not=function(t){return new e(t).not()},t.prototype.abs=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.abs(this.get(t,e)));return this},t.abs=function(t){return new e(t).abs()},t.prototype.acos=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.acos(this.get(t,e)));return this},t.acos=function(t){return new e(t).acos()},t.prototype.acosh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.acosh(this.get(t,e)));return this},t.acosh=function(t){return new e(t).acosh()},t.prototype.asin=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.asin(this.get(t,e)));return this},t.asin=function(t){return new e(t).asin()},t.prototype.asinh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.asinh(this.get(t,e)));return this},t.asinh=function(t){return new e(t).asinh()},t.prototype.atan=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.atan(this.get(t,e)));return this},t.atan=function(t){return new e(t).atan()},t.prototype.atanh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.atanh(this.get(t,e)));return this},t.atanh=function(t){return new e(t).atanh()},t.prototype.cbrt=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.cbrt(this.get(t,e)));return this},t.cbrt=function(t){return new e(t).cbrt()},t.prototype.ceil=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.ceil(this.get(t,e)));return this},t.ceil=function(t){return new e(t).ceil()},t.prototype.clz32=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.clz32(this.get(t,e)));return this},t.clz32=function(t){return new e(t).clz32()},t.prototype.cos=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.cos(this.get(t,e)));return this},t.cos=function(t){return new e(t).cos()},t.prototype.cosh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.cosh(this.get(t,e)));return this},t.cosh=function(t){return new e(t).cosh()},t.prototype.exp=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.exp(this.get(t,e)));return this},t.exp=function(t){return new e(t).exp()},t.prototype.expm1=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.expm1(this.get(t,e)));return this},t.expm1=function(t){return new e(t).expm1()},t.prototype.floor=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.floor(this.get(t,e)));return this},t.floor=function(t){return new e(t).floor()},t.prototype.fround=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.fround(this.get(t,e)));return this},t.fround=function(t){return new e(t).fround()},t.prototype.log=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.log(this.get(t,e)));return this},t.log=function(t){return new e(t).log()},t.prototype.log1p=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.log1p(this.get(t,e)));return this},t.log1p=function(t){return new e(t).log1p()},t.prototype.log10=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.log10(this.get(t,e)));return this},t.log10=function(t){return new e(t).log10()},t.prototype.log2=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.log2(this.get(t,e)));return this},t.log2=function(t){return new e(t).log2()},t.prototype.round=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.round(this.get(t,e)));return this},t.round=function(t){return new e(t).round()},t.prototype.sign=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.sign(this.get(t,e)));return this},t.sign=function(t){return new e(t).sign()},t.prototype.sin=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.sin(this.get(t,e)));return this},t.sin=function(t){return new e(t).sin()},t.prototype.sinh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.sinh(this.get(t,e)));return this},t.sinh=function(t){return new e(t).sinh()},t.prototype.sqrt=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.sqrt(this.get(t,e)));return this},t.sqrt=function(t){return new e(t).sqrt()},t.prototype.tan=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.tan(this.get(t,e)));return this},t.tan=function(t){return new e(t).tan()},t.prototype.tanh=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.tanh(this.get(t,e)));return this},t.tanh=function(t){return new e(t).tanh()},t.prototype.trunc=function(){for(let t=0;t<this.rows;t++)for(let e=0;e<this.columns;e++)this.set(t,e,Math.trunc(this.get(t,e)));return this},t.trunc=function(t){return new e(t).trunc()},t.pow=function(t,n){return new e(t).pow(n)},t.prototype.pow=function(t){return"number"==typeof t?this.powS(t):this.powM(t)},t.prototype.powS=function(t){for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,Math.pow(this.get(e,n),t));return this},t.prototype.powM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(let e=0;e<this.rows;e++)for(let n=0;n<this.columns;n++)this.set(e,n,Math.pow(this.get(e,n),t.get(e,n)));return this}}(er,rr);class ir extends er{constructor(t){super(),this.data=t,this.rows=t.length,this.columns=t[0].length}set(t,e,n){return this.data[t][e]=n,this}get(t,e){return this.data[t][e]}}function or(t,e){let n=0;return Math.abs(t)>Math.abs(e)?(n=e/t,Math.abs(t)*Math.sqrt(1+n*n)):0!==e?(n=t/e,Math.abs(e)*Math.sqrt(1+n*n)):0}class ar{constructor(t,e={}){if((t=ir.checkMatrix(t)).isEmpty())throw new Error("Matrix must be non-empty");let n=t.rows,r=t.columns;const{computeLeftSingularVectors:i=!0,computeRightSingularVectors:o=!0,autoTranspose:a=!1}=e;let u,s=Boolean(i),c=Boolean(o),f=!1;if(n<r)if(a){u=t.transpose(),n=u.rows,r=u.columns,f=!0;let e=s;s=c,c=e}else u=t.clone(),console.warn("Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose");else u=t.clone();let l=Math.min(n,r),h=Math.min(n+1,r),d=new Float64Array(h),p=new rr(n,l),v=new rr(r,r),g=new Float64Array(r),y=new Float64Array(n),m=new Float64Array(h);for(let t=0;t<h;t++)m[t]=t;let b=Math.min(n-1,r),_=Math.max(0,Math.min(r-2,n)),x=Math.max(b,_);for(let t=0;t<x;t++){if(t<b){d[t]=0;for(let e=t;e<n;e++)d[t]=or(d[t],u.get(e,t));if(0!==d[t]){u.get(t,t)<0&&(d[t]=-d[t]);for(let e=t;e<n;e++)u.set(e,t,u.get(e,t)/d[t]);u.set(t,t,u.get(t,t)+1)}d[t]=-d[t]}for(let e=t+1;e<r;e++){if(t<b&&0!==d[t]){let r=0;for(let i=t;i<n;i++)r+=u.get(i,t)*u.get(i,e);r=-r/u.get(t,t);for(let i=t;i<n;i++)u.set(i,e,u.get(i,e)+r*u.get(i,t))}g[e]=u.get(t,e)}if(s&&t<b)for(let e=t;e<n;e++)p.set(e,t,u.get(e,t));if(t<_){g[t]=0;for(let e=t+1;e<r;e++)g[t]=or(g[t],g[e]);if(0!==g[t]){g[t+1]<0&&(g[t]=0-g[t]);for(let e=t+1;e<r;e++)g[e]/=g[t];g[t+1]+=1}if(g[t]=-g[t],t+1<n&&0!==g[t]){for(let e=t+1;e<n;e++)y[e]=0;for(let e=t+1;e<n;e++)for(let n=t+1;n<r;n++)y[e]+=g[n]*u.get(e,n);for(let e=t+1;e<r;e++){let r=-g[e]/g[t+1];for(let i=t+1;i<n;i++)u.set(i,e,u.get(i,e)+r*y[i])}}if(c)for(let e=t+1;e<r;e++)v.set(e,t,g[e])}}let w=Math.min(r,n+1);if(b<r&&(d[b]=u.get(b,b)),n<w&&(d[w-1]=0),_+1<w&&(g[_]=u.get(_,w-1)),g[w-1]=0,s){for(let t=b;t<l;t++){for(let e=0;e<n;e++)p.set(e,t,0);p.set(t,t,1)}for(let t=b-1;t>=0;t--)if(0!==d[t]){for(let e=t+1;e<l;e++){let r=0;for(let i=t;i<n;i++)r+=p.get(i,t)*p.get(i,e);r=-r/p.get(t,t);for(let i=t;i<n;i++)p.set(i,e,p.get(i,e)+r*p.get(i,t))}for(let e=t;e<n;e++)p.set(e,t,-p.get(e,t));p.set(t,t,1+p.get(t,t));for(let e=0;e<t-1;e++)p.set(e,t,0)}else{for(let e=0;e<n;e++)p.set(e,t,0);p.set(t,t,1)}}if(c)for(let t=r-1;t>=0;t--){if(t<_&&0!==g[t])for(let e=t+1;e<r;e++){let n=0;for(let i=t+1;i<r;i++)n+=v.get(i,t)*v.get(i,e);n=-n/v.get(t+1,t);for(let i=t+1;i<r;i++)v.set(i,e,v.get(i,e)+n*v.get(i,t))}for(let e=0;e<r;e++)v.set(e,t,0);v.set(t,t,1)}let E=w-1,S=0,A=Number.EPSILON;for(;w>0;){let t,e;for(t=w-2;t>=-1&&-1!==t;t--){const e=Number.MIN_VALUE+A*Math.abs(d[t]+Math.abs(d[t+1]));if(Math.abs(g[t])<=e||Number.isNaN(g[t])){g[t]=0;break}}if(t===w-2)e=4;else{let n;for(n=w-1;n>=t&&n!==t;n--){let e=(n!==w?Math.abs(g[n]):0)+(n!==t+1?Math.abs(g[n-1]):0);if(Math.abs(d[n])<=A*e){d[n]=0;break}}n===t?e=3:n===w-1?e=1:(e=2,t=n)}switch(t++,e){case 1:{let e=g[w-2];g[w-2]=0;for(let n=w-2;n>=t;n--){let i=or(d[n],e),o=d[n]/i,a=e/i;if(d[n]=i,n!==t&&(e=-a*g[n-1],g[n-1]=o*g[n-1]),c)for(let t=0;t<r;t++)i=o*v.get(t,n)+a*v.get(t,w-1),v.set(t,w-1,-a*v.get(t,n)+o*v.get(t,w-1)),v.set(t,n,i)}break}case 2:{let e=g[t-1];g[t-1]=0;for(let r=t;r<w;r++){let i=or(d[r],e),o=d[r]/i,a=e/i;if(d[r]=i,e=-a*g[r],g[r]=o*g[r],s)for(let e=0;e<n;e++)i=o*p.get(e,r)+a*p.get(e,t-1),p.set(e,t-1,-a*p.get(e,r)+o*p.get(e,t-1)),p.set(e,r,i)}break}case 3:{const e=Math.max(Math.abs(d[w-1]),Math.abs(d[w-2]),Math.abs(g[w-2]),Math.abs(d[t]),Math.abs(g[t])),i=d[w-1]/e,o=d[w-2]/e,a=g[w-2]/e,u=d[t]/e,f=g[t]/e,l=((o+i)*(o-i)+a*a)/2,h=i*a*(i*a);let y=0;0===l&&0===h||(y=l<0?0-Math.sqrt(l*l+h):Math.sqrt(l*l+h),y=h/(l+y));let m=(u+i)*(u-i)+y,b=u*f;for(let e=t;e<w-1;e++){let i=or(m,b);0===i&&(i=Number.MIN_VALUE);let o=m/i,a=b/i;if(e!==t&&(g[e-1]=i),m=o*d[e]+a*g[e],g[e]=o*g[e]-a*d[e],b=a*d[e+1],d[e+1]=o*d[e+1],c)for(let t=0;t<r;t++)i=o*v.get(t,e)+a*v.get(t,e+1),v.set(t,e+1,-a*v.get(t,e)+o*v.get(t,e+1)),v.set(t,e,i);if(i=or(m,b),0===i&&(i=Number.MIN_VALUE),o=m/i,a=b/i,d[e]=i,m=o*g[e]+a*d[e+1],d[e+1]=-a*g[e]+o*d[e+1],b=a*g[e+1],g[e+1]=o*g[e+1],s&&e<n-1)for(let t=0;t<n;t++)i=o*p.get(t,e)+a*p.get(t,e+1),p.set(t,e+1,-a*p.get(t,e)+o*p.get(t,e+1)),p.set(t,e,i)}g[w-2]=m,S+=1;break}case 4:if(d[t]<=0&&(d[t]=d[t]<0?-d[t]:0,c))for(let e=0;e<=E;e++)v.set(e,t,-v.get(e,t));for(;t<E&&!(d[t]>=d[t+1]);){let e=d[t];if(d[t]=d[t+1],d[t+1]=e,c&&t<r-1)for(let n=0;n<r;n++)e=v.get(n,t+1),v.set(n,t+1,v.get(n,t)),v.set(n,t,e);if(s&&t<n-1)for(let r=0;r<n;r++)e=p.get(r,t+1),p.set(r,t+1,p.get(r,t)),p.set(r,t,e);t++}S=0,w--}}if(f){let t=v;v=p,p=t}this.m=n,this.n=r,this.s=d,this.U=p,this.V=v}solve(t){let e=t,n=this.threshold,r=this.s.length,i=rr.zeros(r,r);for(let t=0;t<r;t++)Math.abs(this.s[t])<=n?i.set(t,t,0):i.set(t,t,1/this.s[t]);let o=this.U,a=this.rightSingularVectors,u=a.mmul(i),s=a.rows,c=o.rows,f=rr.zeros(s,c);for(let t=0;t<s;t++)for(let e=0;e<c;e++){let n=0;for(let i=0;i<r;i++)n+=u.get(t,i)*o.get(e,i);f.set(t,e,n)}return f.mmul(e)}solveForDiagonal(t){return this.solve(rr.diag(t))}inverse(){let t=this.V,e=this.threshold,n=t.rows,r=t.columns,i=new rr(n,this.s.length);for(let o=0;o<n;o++)for(let n=0;n<r;n++)Math.abs(this.s[n])>e&&i.set(o,n,t.get(o,n)/this.s[n]);let o=this.U,a=o.rows,u=o.columns,s=new rr(n,a);for(let t=0;t<n;t++)for(let e=0;e<a;e++){let n=0;for(let r=0;r<u;r++)n+=i.get(t,r)*o.get(e,r);s.set(t,e,n)}return s}get condition(){return this.s[0]/this.s[Math.min(this.m,this.n)-1]}get norm2(){return this.s[0]}get rank(){let t=Math.max(this.m,this.n)*this.s[0]*Number.EPSILON,e=0,n=this.s;for(let r=0,i=n.length;r<i;r++)n[r]>t&&e++;return e}get diagonal(){return Array.from(this.s)}get threshold(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}get leftSingularVectors(){return this.U}get rightSingularVectors(){return this.V}get diagonalMatrix(){return rr.diag(this.s)}}const ur=function(){function t(t){this.distances=t.distances,this.dimension=t.dimension||2,this.linkDistance=t.linkDistance}return t.prototype.layout=function(){var t=this,e=t.dimension,n=t.distances,r=t.linkDistance;try{var i=rr.mul(rr.pow(n,2),-.5),o=i.mean("row"),a=i.mean("column"),u=i.mean();i.add(u).subRowVector(o).subColumnVector(a);var s=new ar(i),c=rr.sqrt(s.diagonalMatrix).diagonal();return s.leftSingularVectors.toJSON().map((function(t){return rr.mul([t],[c]).toJSON()[0].splice(0,e)}))}catch(t){for(var f=[],l=0;l<n.length;l++){var h=Math.random()*r,d=Math.random()*r;f.push([h,d])}return f}},t}(),sr=function(){function t(t){this.disp=[],this.positions=t.positions,this.adjMatrix=t.adjMatrix,this.focusID=t.focusID,this.radii=t.radii,this.iterations=t.iterations||10,this.height=t.height||10,this.width=t.width||10,this.speed=t.speed||100,this.gravity=t.gravity||10,this.nodeSizeFunc=t.nodeSizeFunc,this.k=t.k||5,this.strictRadial=t.strictRadial,this.nodes=t.nodes}return t.prototype.layout=function(){var t=this,e=t.positions,n=[],r=t.iterations,i=t.width/10;t.maxDisplace=i,t.disp=n;for(var o=0;o<r;o++)e.forEach((function(t,e){n[e]={x:0,y:0}})),t.getRepulsion(),t.updatePositions();return e},t.prototype.getRepulsion=function(){var t=this,e=t.positions,n=t.nodes,r=t.disp,i=t.k,o=t.radii||[];e.forEach((function(a,u){r[u]={x:0,y:0},e.forEach((function(e,s){if(u!==s&&o[u]===o[s]){var c=a[0]-e[0],f=a[1]-e[1],l=Math.sqrt(c*c+f*f);if(0===l){l=1;var h=u>s?1:-1;c=.01*h,f=.01*h}if(l<t.nodeSizeFunc(n[u])/2+t.nodeSizeFunc(n[s])/2){var d=i*i/l;r[u].x+=c/l*d,r[u].y+=f/l*d}}}))}))},t.prototype.updatePositions=function(){var t=this,e=t.positions,n=t.disp,r=t.speed,i=t.strictRadial,o=t.focusID,a=t.maxDisplace||t.width/10;i&&n.forEach((function(t,n){var r=e[n][0]-e[o][0],i=e[n][1]-e[o][1],a=Math.sqrt(r*r+i*i),u=i/a,s=-r/a,c=Math.sqrt(t.x*t.x+t.y*t.y),f=Math.acos((u*t.x+s*t.y)/c);f>Math.PI/2&&(f-=Math.PI/2,u*=-1,s*=-1);var l=Math.cos(f)*c;t.x=u*l,t.y=s*l}));var u=t.radii;e.forEach((function(t,s){if(s!==o){var c=Math.sqrt(n[s].x*n[s].x+n[s].y*n[s].y);if(c>0&&s!==o){var f=Math.min(a*(r/800),c);if(t[0]+=n[s].x/c*f,t[1]+=n[s].y/c*f,i){var l=t[0]-e[o][0],h=t[1]-e[o][1],d=Math.sqrt(l*l+h*h);l=l/d*u[s],h=h/d*u[s],t[0]=e[o][0]+l,t[1]=e[o][1]+h}}}}))},t}();var cr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function fr(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var lr=function(t){function n(e){var n=t.call(this)||this;return n.maxIteration=1e3,n.focusNode=null,n.unitRadius=null,n.linkDistance=50,n.preventOverlap=!1,n.strictRadial=!0,n.maxPreventOverlapIteration=200,n.sortStrength=10,n.nodes=[],n.edges=[],n.updateCfg(e),n}return cr(n,t),n.prototype.getDefaultCfg=function(){return{maxIteration:1e3,focusNode:null,unitRadius:null,linkDistance:50,preventOverlap:!1,nodeSize:void 0,nodeSpacing:void 0,strictRadial:!0,maxPreventOverlapIteration:200,sortBy:void 0,sortStrength:10}},n.prototype.execute=function(){var t=this,n=t.nodes,r=t.edges||[];if(n&&0!==n.length){t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),t.center||(t.center=[t.width/2,t.height/2]);var i=t.center;if(1===n.length)return n[0].x=i[0],n[0].y=i[1],void(t.onLayoutEnd&&t.onLayoutEnd());var s=t.linkDistance,c=null;if(e(t.focusNode)){for(var f=!1,h=0;h<n.length;h++)n[h].id===t.focusNode&&(c=n[h],t.focusNode=c,f=!0,h=n.length);f||(c=null)}else c=t.focusNode;c||(c=n[0],t.focusNode=c);var d=function(t,e){var n=-1;return t.forEach((function(t,r){t.id===e&&(n=r)})),n}(n,c.id);t.focusIndex=d;var p=g({nodes:n,edges:r},!1),y=v(p),m=t.maxToFocus(y,d);t.handleInfinity(y,d,m+1),t.distances=y;var _=y[d],x=t.width||500,w=t.height||500,E=x-i[0]>i[0]?i[0]:x-i[0],S=w-i[1]>i[1]?i[1]:w-i[1];0===E&&(E=x/2),0===S&&(S=w/2);var A=S>E?E:S,T=Math.max.apply(Math,_),I=[];_.forEach((function(e,n){t.unitRadius||(t.unitRadius=A/T),I[n]=e*t.unitRadius})),t.radii=I;var C=t.eIdealDisMatrix();t.eIdealDistances=C;var D=function(t){for(var e=t.length,n=t[0].length,r=[],i=0;i<e;i++){for(var o=[],a=0;a<n;a++)0!==t[i][a]?o.push(1/(t[i][a]*t[i][a])):o.push(0);r.push(o)}return r}(C);t.weights=D;var N=new ur({linkDistance:s,distances:C}).layout();N.forEach((function(t){u(t[0])&&(t[0]=Math.random()*s),u(t[1])&&(t[1]=Math.random()*s)})),t.positions=N,N.forEach((function(t,e){n[e].x=t[0]+i[0],n[e].y=t[1]+i[1]})),N.forEach((function(t){t[0]-=N[d][0],t[1]-=N[d][1]})),t.run();var k,R=t.preventOverlap,O=t.nodeSize,M=t.strictRadial;if(R){var P,G=t.nodeSpacing;P=a(G)?function(){return G}:b(G)?G:function(){return 0},k=O?o(O)?function(t){return(O[0]>O[1]?O[0]:O[1])+P(t)}:function(t){return O+P(t)}:function(t){return t.size?o(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])+P(t):l(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)+P(t):t.size+P(t):10+P(t)};var L={nodes:n,nodeSizeFunc:k,adjMatrix:p,positions:N,radii:I,height:w,width:x,strictRadial:M,focusID:d,iterations:t.maxPreventOverlapIteration||200,k:N.length/4.5},U=new sr(L);N=U.layout()}return N.forEach((function(t,e){n[e].x=t[0]+i[0],n[e].y=t[1]+i[1]})),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:n,edges:r}}t.onLayoutEnd&&t.onLayoutEnd()},n.prototype.run=function(){for(var t=this,e=t.maxIteration,n=t.positions||[],r=t.weights||[],i=t.eIdealDistances||[],o=t.radii||[],a=0;a<=e;a++){var u=a/e;t.oneIteration(u,n,o,i,r)}},n.prototype.oneIteration=function(t,e,n,r,i){var o=1-t,a=this.focusIndex;e.forEach((function(u,s){var c=fr(u,[0,0]),f=0===c?0:1/c;if(s!==a){var l=0,h=0,d=0;e.forEach((function(t,e){if(s!==e){var n=fr(u,t),o=0===n?0:1/n,a=r[e][s];d+=i[s][e],l+=i[s][e]*(t[0]+a*(u[0]-t[0])*o),h+=i[s][e]*(t[1]+a*(u[1]-t[1])*o)}}));var p=0===n[s]?0:1/n[s];d*=o,d+=t*p*p,l*=o,l+=t*p*u[0]*f,u[0]=l/d,h*=o,h+=t*p*u[1]*f,u[1]=h/d}}))},n.prototype.eIdealDisMatrix=function(){var t=this,n=t.nodes;if(!n)return[];var r=t.distances,i=t.linkDistance,o=t.radii||[],a=t.unitRadius||50,u=[];return r&&r.forEach((function(r,s){var c=[];r.forEach((function(r,u){if(s===u)c.push(0);else if(o[s]===o[u])if("data"===t.sortBy)c.push(r*(Math.abs(s-u)*t.sortStrength)/(o[s]/a));else if(t.sortBy){var f=n[s][t.sortBy]||0,l=n[u][t.sortBy]||0;e(f)&&(f=f.charCodeAt(0)),e(l)&&(l=l.charCodeAt(0)),c.push(r*(Math.abs(f-l)*t.sortStrength)/(o[s]/a))}else c.push(r*i/(o[s]/a));else{var h=(i+a)/2;c.push(r*h)}})),u.push(c)})),u},n.prototype.handleInfinity=function(t,e,n){for(var r=t.length,i=0;i<r;i++)if(t[e][i]===1/0){t[e][i]=n,t[i][e]=n;for(var o=0;o<r;o++)t[i][o]!==1/0&&t[e][o]===1/0&&(t[e][o]=n+t[i][o],t[o][e]=n+t[i][o])}for(i=0;i<r;i++)if(i!==e)for(o=0;o<r;o++)if(t[i][o]===1/0){var a=Math.abs(t[e][i]-t[e][o]);a=0===a?1:a,t[i][o]=a}},n.prototype.maxToFocus=function(t,e){for(var n=0,r=0;r<t[e].length;r++)t[e][r]!==1/0&&(n=t[e][r]>n?t[e][r]:n);return n},n.prototype.getType=function(){return"radial"},n}(t),hr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),dr=function(t){function n(e){var n=t.call(this)||this;return n.nodeSize=30,n.minNodeSpacing=10,n.preventOverlap=!1,n.equidistant=!1,n.startAngle=1.5*Math.PI,n.clockwise=!0,n.sortBy="degree",n.nodes=[],n.edges=[],n.width=300,n.height=300,n.onLayoutEnd=function(){},n.updateCfg(e),n}return hr(n,t),n.prototype.getDefaultCfg=function(){return{nodeSize:30,minNodeSpacing:10,preventOverlap:!1,sweep:void 0,equidistant:!1,startAngle:1.5*Math.PI,clockwise:!0,maxLevelDiff:void 0,sortBy:"degree"}},n.prototype.execute=function(){var t=this,n=t.nodes,r=t.edges,i=n.length;if(0!==i){t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),t.center||(t.center=[t.width/2,t.height/2]);var u=t.center;if(1===i)return n[0].x=u[0],n[0].y=u[1],void(t.onLayoutEnd&&t.onLayoutEnd());var s,c=[];s=o(t.nodeSize)?Math.max(t.nodeSize[0],t.nodeSize[1]):t.nodeSize,n.forEach((function(t){c.push(t);var e=s;o(t.size)?e=Math.max(t.size[0],t.size[1]):a(t.size)?e=t.size:l(t.size)&&(e=Math.max(t.size.width,t.size.height)),s=Math.max(s,e)})),t.clockwise=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise;var f={},h={};if(c.forEach((function(t,e){f[t.id]=t,h[t.id]=e})),!("degree"!==t.sortBy&&e(t.sortBy)&&void 0!==c[0][t.sortBy]||(t.sortBy="degree",a(n[0].degree)))){var d=p(n.length,h,r);c.forEach((function(t,e){t.degree=d[e]}))}c.sort((function(e,n){return n[t.sortBy]-e[t.sortBy]})),t.maxValueNode=c[0],t.maxLevelDiff=t.maxLevelDiff||t.maxValueNode[t.sortBy]/4;var v=[[]],g=v[0];c.forEach((function(e){if(g.length>0){var n=Math.abs(g[0][t.sortBy]-e[t.sortBy]);t.maxLevelDiff&&n>=t.maxLevelDiff&&(g=[],v.push(g))}g.push(e)}));var y=s+t.minNodeSpacing;if(!t.preventOverlap){var m=v.length>0&&v[0].length>1,b=(Math.min(t.width,t.height)/2-y)/(v.length+(m?1:0));y=Math.min(y,b)}var _=0;if(v.forEach((function(e){var n=t.sweep;void 0===n&&(n=2*Math.PI-2*Math.PI/e.length);var r=e.dTheta=n/Math.max(1,e.length-1);if(e.length>1&&t.preventOverlap){var i=Math.cos(r)-Math.cos(0),o=Math.sin(r)-Math.sin(0),a=Math.sqrt(y*y/(i*i+o*o));_=Math.max(a,_)}e.r=_,_+=y})),t.equidistant){for(var x=0,w=0,E=0;E<v.length;E++){var S=v[E].r-w;x=Math.max(x,S)}w=0,v.forEach((function(t,e){0===e&&(w=t.r),t.r=w,w+=x}))}return v.forEach((function(e){var n=e.dTheta,r=e.r;e.forEach((function(e,i){var o=t.startAngle+(t.clockwise?1:-1)*n*i;e.x=u[0]+r*Math.cos(o),e.y=u[1]+r*Math.sin(o)}))})),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:n,edges:r}}t.onLayoutEnd&&t.onLayoutEnd()},n.prototype.getType=function(){return"concentric"},n}(t),pr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),vr=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.linkDistance=50,n.nodes=[],n.edges=[],n.onLayoutEnd=function(){},n.updateCfg(e),n}return pr(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],linkDistance:50}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.edges,r=void 0===n?[]:n,i=t.center;if(e&&0!==e.length){if(1===e.length)return e[0].x=i[0],e[0].y=i[1],void(t.onLayoutEnd&&t.onLayoutEnd());var o=t.linkDistance,a=g({nodes:e,edges:r},!1),u=v(a);t.handleInfinity(u);var s,c,f=(s=o,c=[],u.forEach((function(t){var e=[];t.forEach((function(t){e.push(t*s)})),c.push(e)})),c);t.scaledDistances=f;var l=t.runMDS();return t.positions=l,l.forEach((function(t,n){e[n].x=t[0]+i[0],e[n].y=t[1]+i[1]})),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:r}}t.onLayoutEnd&&t.onLayoutEnd()},e.prototype.runMDS=function(){var t=this.scaledDistances,e=rr.mul(rr.pow(t,2),-.5),n=e.mean("row"),r=e.mean("column"),i=e.mean();e.add(i).subRowVector(n).subColumnVector(r);var o=new ar(e),a=rr.sqrt(o.diagonalMatrix).diagonal();return o.leftSingularVectors.toJSON().map((function(t){return rr.mul([t],[a]).toJSON()[0].splice(0,2)}))},e.prototype.handleInfinity=function(t){var e=-999999;t.forEach((function(t){t.forEach((function(t){t!==1/0&&e<t&&(e=t)}))})),t.forEach((function(n,r){n.forEach((function(n,i){n===1/0&&(t[r][i]=e)}))}))},e.prototype.getType=function(){return"mds"},e}(t),gr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),yr=function(t){function e(e){var n=t.call(this)||this;return n.maxIteration=1e3,n.workerEnabled=!1,n.gravity=10,n.speed=5,n.clustering=!1,n.clusterGravity=10,n.nodes=[],n.edges=[],n.width=300,n.height=300,n.nodeMap={},n.nodeIdxMap={},n.onLayoutEnd=function(){},n.tick=function(){},n.updateCfg(e),n}return gr(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:1e3,gravity:10,speed:1,clustering:!1,clusterGravity:10}},e.prototype.execute=function(){var t,e,n=this,r=this,i=r.nodes;if(void 0!==r.timeInterval&&"undefined"!=typeof window&&window.clearInterval(r.timeInterval),i&&0!==i.length){r.width||"undefined"==typeof window||(r.width=window.innerWidth),r.height||"undefined"==typeof window||(r.height=window.innerHeight),r.center||(r.center=[r.width/2,r.height/2]);var o=r.center;if(1===i.length)return i[0].x=o[0],i[0].y=o[1],void(null===(e=r.onLayoutEnd)||void 0===e||e.call(r));var u={},s={};return i.forEach((function(t,e){a(t.x)||(t.x=Math.random()*n.width),a(t.y)||(t.y=Math.random()*n.height),u[t.id]=t,s[t.id]=e})),r.nodeMap=u,r.nodeIdxMap=s,r.run()}null===(t=r.onLayoutEnd)||void 0===t||t.call(r)},e.prototype.run=function(){var t,e=this,n=e.nodes;if(n){var r=e.edges,i=e.maxIteration,o=e.workerEnabled,a=e.clustering,u={};if(a&&n.forEach((function(t){void 0===u[t.cluster]&&(u[t.cluster]={name:t.cluster,cx:0,cy:0,count:0})})),o){for(var s=0;s<i;s++)e.runOneStep(u);null===(t=e.onLayoutEnd)||void 0===t||t.call(e)}else{if("undefined"==typeof window)return;var c=0;this.timeInterval=window.setInterval((function(){var t;e.runOneStep(u),++c>=i&&(null===(t=e.onLayoutEnd)||void 0===t||t.call(e),window.clearInterval(e.timeInterval))}),0)}return{nodes:n,edges:r}}},e.prototype.runOneStep=function(t){var e,n=this,r=n.nodes;if(r){var i=n.edges,o=n.center,u=n.gravity,s=n.speed,c=n.clustering,f=n.height*n.width,l=Math.sqrt(f)/10,h=f/(r.length+1),d=Math.sqrt(h),p=[];if(r.forEach((function(t,e){p[e]={x:0,y:0}})),n.applyCalculate(r,i,p,d,h),c){for(var v in t)t[v].cx=0,t[v].cy=0,t[v].count=0;for(var v in r.forEach((function(e){var n=t[e.cluster];a(e.x)&&(n.cx+=e.x),a(e.y)&&(n.cy+=e.y),n.count++})),t)t[v].cx/=t[v].count,t[v].cy/=t[v].count;var g=n.clusterGravity||u;r.forEach((function(e,n){if(a(e.x)&&a(e.y)){var r=t[e.cluster],i=Math.sqrt((e.x-r.cx)*(e.x-r.cx)+(e.y-r.cy)*(e.y-r.cy)),o=d*g;p[n].x-=o*(e.x-r.cx)/i,p[n].y-=o*(e.y-r.cy)/i}}))}r.forEach((function(t,e){if(a(t.x)&&a(t.y)){var n=.01*d*u;p[e].x-=n*(t.x-o[0]),p[e].y-=n*(t.y-o[1])}})),r.forEach((function(t,e){if(a(t.fx)&&a(t.fy))return t.x=t.fx,void(t.y=t.fy);if(a(t.x)&&a(t.y)){var n=Math.sqrt(p[e].x*p[e].x+p[e].y*p[e].y);if(n>0){var r=Math.min(l*(s/800),n);t.x+=p[e].x/n*r,t.y+=p[e].y/n*r}}})),null===(e=n.tick)||void 0===e||e.call(n)}},e.prototype.applyCalculate=function(t,e,n,r,i){this.calRepulsive(t,n,i),e&&this.calAttractive(e,n,r)},e.prototype.calRepulsive=function(t,e,n){t.forEach((function(r,i){e[i]={x:0,y:0},t.forEach((function(t,o){if(i!==o&&a(r.x)&&a(t.x)&&a(r.y)&&a(t.y)){var u=r.x-t.x,s=r.y-t.y,c=u*u+s*s;if(0===c){c=1;var f=i>o?1:-1;u=.01*f,s=.01*f}var l=n/c;e[i].x+=u*l,e[i].y+=s*l}}))}))},e.prototype.calAttractive=function(t,e,n){var r=this;t.forEach((function(t){var i=d(t,"source"),o=d(t,"target");if(i&&o){var u=r.nodeIdxMap[i],s=r.nodeIdxMap[o];if(u!==s){var c=r.nodeMap[i],f=r.nodeMap[o];if(a(f.x)&&a(c.x)&&a(f.y)&&a(c.y)){var l=f.x-c.x,h=f.y-c.y,p=Math.sqrt(l*l+h*h),v=p*p/n;e[s].x-=l/p*v,e[s].y-=h/p*v,e[u].x+=l/p*v,e[u].y+=h/p*v}}}}))},e.prototype.stop=function(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){var t=this;t.stop(),t.tick=null,t.nodes=null,t.edges=null,t.destroyed=!0},e.prototype.getType=function(){return"fruchterman"},e}(t);function mr(t,e,n,r){n&&Object.defineProperty(t,e,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function br(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function xr(t,e,n){return e&&_r(t.prototype,e),n&&_r(t,n),t}function wr(t,e,n,r,i){var o={};return Object.keys(r).forEach((function(t){o[t]=r[t]})),o.enumerable=!!o.enumerable,o.configurable=!!o.configurable,("value"in o||o.initializer)&&(o.writable=!0),o=n.slice().reverse().reduce((function(n,r){return r(t,e,n)||n}),o),i&&void 0!==o.initializer&&(o.value=o.initializer?o.initializer.call(i):void 0,o.initializer=void 0),void 0===o.initializer&&(Object.defineProperty(t,e,o),o=null),o}n(8892);var Er=n(122),Sr=n.n(Er);function Ar(t,e,n,r,i,o,a){try{var u=t[o](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,i)}function Tr(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){Ar(o,r,i,a,u,"next",t)}function u(t){Ar(o,r,i,a,u,"throw",t)}a(void 0)}))}}var Ir=1;function Cr(){return Ir++}var Dr=function t(e){br(this,t)},Nr=function(){function t(e){br(this,t),this.clazz=void 0,this.components=[],this.entities=[],this.lookup={},this.clazz=e}var e;return xr(t,[{key:"clear",value:function(){this.components=[],this.entities=[],this.lookup={}}},{key:"contains",value:function(t){return this.lookup[t]>-1}},{key:"create",value:function(t,e){this.lookup[t]=this.components.length;var n=new this.clazz(e||{});return this.components.push(n),this.entities.push(t),n}},{key:"remove",value:function(t){var e=this.lookup[t];e>-1&&e<this.components.length-1&&(this.components[e]=this.components[this.components.length-1],this.entities[e]=this.entities[this.entities.length-1],this.lookup[this.entities[e]]=e),this.components.pop(),this.entities.pop(),delete this.lookup[t]}},{key:"removeKeepSorted",value:function(t){var e=this.lookup[t];if(e>-1){var n=this.entities[e];if(e<this.components.length-1){for(var r=e+1;r<this.components.length;++r)this.components[r-1]=this.components[r];for(var i=e+1;i<this.entities.length;++i)this.entities[i-1]=this.entities[i],this.lookup[this.entities[i-1]]=i-1}this.components.pop(),this.entities.pop(),delete this.lookup[n]}}},{key:"moveItem",value:function(t,e){if(t!==e){for(var n=this.components[t],r=this.entities[t],i=t<e?1:-1,o=t;o!==e;o+=i){var a=o+i;this.components[o]=this.components[a],this.entities[o]=this.entities[a],this.lookup[this.entities[o]]=o}this.components[e]=n,this.entities[e]=r,this.lookup[r]=e}}},{key:"getEntity",value:function(t){return this.entities[t]}},{key:"getComponent",value:function(t){return this.components[t]}},{key:"getComponentByEntity",value:function(t){var e=this.lookup[t];return e>-1?this.components[e]:null}},{key:"getCount",value:function(){return this.components.length}},{key:"getEntityByComponentIndex",value:function(t){for(var e=0,n=Object.keys(this.lookup);e<n.length;e++){var r=n[e],i=Number(r);if(this.lookup[i]===t)return i}return-1}},{key:"find",value:function(t){for(var e=0;e<this.getCount();e++){var n=this.getComponent(e);if(t(n,e))return n}return null}},{key:"findIndex",value:function(t){for(var e=0;e<this.getCount();e++)if(t(this.getComponent(e),e))return e;return-1}},{key:"forEach",value:function(t){for(var e=0,n=Object.keys(this.lookup);e<n.length;e++){var r=n[e],i=Number(r),o=this.lookup[i];t(i,this.getComponent(o))}}},{key:"forEachAsync",value:(e=Tr(Sr().mark((function t(e){var n,r,i,o,a;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=0,r=Object.keys(this.lookup);case 1:if(!(n<r.length)){t.next=10;break}return i=r[n],o=Number(i),a=this.lookup[o],t.next=7,e(o,this.getComponent(a));case 7:n++,t.next=1;break;case 10:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"map",value:function(t){for(var e=[],n=0,r=Object.keys(this.lookup);n<r.length;n++){var i=r[n],o=Number(i),a=this.lookup[o];e.push(t(o,this.getComponent(a)))}return e}}]),t}();function kr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Rr(t,e){if(t){if("string"==typeof t)return kr(t,e);var n=Object.prototype.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)?kr(t,e):void 0}}function Or(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){u=!0,i=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw i}}return o}}(t,e)||Rr(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Mr=n(9311),Pr={HierarchyComponentManager:Symbol("HierarchyComponentManager"),TransformComponentManager:Symbol("TransformComponentManager"),NameComponentManager:Symbol("NameComponentManager"),SceneGraphSystem:Symbol("SceneGraphSystem"),FrameGraphSystem:Symbol("FrameGraphSystem"),ResourcePool:Symbol("ResourcePool"),ResourceHandleComponentManager:Symbol("ResourceHandleComponentManager"),PassNodeComponentManager:Symbol("PassNodeComponentManager"),RendererSystem:Symbol("RendererSystem"),RenderPass:Symbol("RenderPass"),RenderPassFactory:Symbol("Factory<IRenderPass>"),Renderable:Symbol("Factory<IRenderPass>"),MeshSystem:Symbol("MeshSystem"),MeshComponentManager:Symbol("MeshComponentManager"),CullableComponentManager:Symbol("CullableComponentManager"),Geometry:Symbol("Geometry"),GeometrySystem:Symbol("GeometrySystem"),GeometryComponentManager:Symbol("GeometryComponentManager"),Material:Symbol("Material"),MaterialSystem:Symbol("MaterialSystem"),MaterialComponentManager:Symbol("MaterialComponentManager"),ForwardRenderPath:Symbol("ForwardRenderPath"),ComputeSystem:Symbol("ComputeSystem"),ComputeComponentManager:Symbol("ComputeComponentManager"),ComputeStrategy:Symbol("ComputeStrategy"),Systems:Symbol("Systems"),World:Symbol("World"),RenderEngine:Symbol("RenderEngine"),WebGPUEngine:Symbol("WebGPUEngine"),WebGLEngine:Symbol("WebGLEngine"),ShaderModuleService:Symbol("ShaderModuleService"),ConfigService:Symbol("ConfigService"),InteractorService:Symbol("InteractorService"),IEventEmitter:Symbol("IEventEmitter"),Light:Symbol("Light")},Gr=function t(){br(this,t),this.index=void 0},Lr=function t(){br(this,t),this.name=void 0,this.data=void 0,this.execute=void 0,this.tearDown=void 0},Ur=function(){function t(){br(this,t),this.name=void 0,this.refCount=0,this.hasSideEffect=!1,this.devirtualize=[],this.destroy=[],this.reads=[],this.writes=[]}return xr(t,[{key:"read",value:function(t){return this.reads.find((function(e){return e.index===t.index}))||this.reads.push(t),t}},{key:"sample",value:function(t){return this.read(t),t}},{key:"write",value:function(t,e){if(this.writes.find((function(t){return t.index===e.index})))return e;var n=t.getResourceNode(e);n.resource.version++,n.resource.imported&&(this.hasSideEffect=!0);var r=t.createResourceNode(n.resource);return t.getResourceNode(r).writer=this,this.writes.push(r),r}}]),t}();function Fr(t,e){return Fr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Fr(t,e)}function Br(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}}),e&&Fr(t,e)}function zr(t){return zr="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},zr(t)}function jr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Wr(t,e){if(e&&("object"===zr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return jr(t)}function Vr(t){return Vr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Vr(t)}var Xr,Hr,qr,Yr,Kr,Zr,$r=function(t){Br(i,(function t(){br(this,t),this.first=void 0,this.last=void 0}));var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vr(e);if(n){var i=Vr(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wr(this,t)});function i(){var t;br(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return(t=r.call.apply(r,[this].concat(n))).version=0,t.refs=0,t.name=void 0,t.imported=void 0,t.priority=void 0,t.discardStart=!0,t.discardEnd=!1,t.descriptor=void 0,t.resource=void 0,t}return xr(i,[{key:"preExecuteDestroy",value:function(){this.discardEnd=!0}},{key:"postExecuteDestroy",value:function(){this.imported}},{key:"postExecuteDevirtualize",value:function(){this.discardStart=!1}},{key:"preExecuteDevirtualize",value:function(){this.imported}}]),i}(),Jr=function t(){br(this,t),this.resource=void 0,this.writer=void 0,this.readerCount=0,this.version=void 0};function Qr(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return ti(t,e);var n=Object.prototype.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)?ti(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function ti(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var ei=(Xr=(0,Mr.b2)(),Hr=(0,Mr.f3)(Pr.RenderEngine),Xr((Zr=function(){function t(){br(this,t),this.passNodes=[],this.resourceNodes=[],this.frameGraphPasses=[],mr(this,"engine",Kr,this)}var e,n;return xr(t,[{key:"execute",value:(n=Tr(Sr().mark((function t(e){return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.compile(),t.next=3,this.executePassNodes(e);case 3:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"tearDown",value:function(){this.frameGraphPasses.forEach((function(t){t.tearDown&&t.tearDown()})),this.reset()}},{key:"addPass",value:function(t,e,n,r){var i=new Lr;i.execute=n,r&&(i.tearDown=r),i.name=t;var o=new Ur;return o.name=t,this.passNodes.push(o),this.frameGraphPasses.push(i),e(this,o,i),i}},{key:"getPass",value:function(t){return this.frameGraphPasses.find((function(e){return e.name===t}))}},{key:"compile",value:function(){var t,e=this,n=Qr(this.passNodes);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.refCount=r.writes.length+(r.hasSideEffect?1:0),r.reads.forEach((function(t){e.resourceNodes[t.index].readerCount++}))}}catch(t){n.e(t)}finally{n.f()}var i,o=[],a=Qr(this.resourceNodes);try{for(a.s();!(i=a.n()).done;){var u=i.value;0===u.readerCount&&o.push(u)}}catch(t){a.e(t)}finally{a.f()}for(;o.length;){var s=o.pop(),c=s&&s.writer;if(c&&0==--c.refCount){var f,l=Qr(c.reads);try{for(l.s();!(f=l.n()).done;){var h=f.value,d=this.resourceNodes[h.index];0==--d.readerCount&&o.push(d)}}catch(t){l.e(t)}finally{l.f()}}}this.resourceNodes.forEach((function(t){t.resource.refs+=t.readerCount}));var p,v=Qr(this.passNodes);try{for(v.s();!(p=v.n()).done;){var g=p.value;if(g.refCount){var y,m=Qr(g.reads);try{for(m.s();!(y=m.n()).done;){var b=y.value,_=this.resourceNodes[b.index].resource;_.first=_.first?_.first:g,_.last=g}}catch(t){m.e(t)}finally{m.f()}var x,w=Qr(g.writes);try{for(w.s();!(x=w.n()).done;){var E=x.value,S=this.resourceNodes[E.index].resource;S.first=S.first?S.first:g,S.last=g}}catch(t){w.e(t)}finally{w.f()}}}}catch(t){v.e(t)}finally{v.f()}for(var A=0;A<2;A++){var T,I=Qr(this.resourceNodes);try{for(I.s();!(T=I.n()).done;){var C=T.value.resource;if(C.priority===A&&C.refs){var D=C.first,N=C.last;D&&N&&(D.devirtualize.push(C),N.destroy.push(C))}}}catch(t){I.e(t)}finally{I.f()}}}},{key:"executePassNodes",value:(e=Tr(Sr().mark((function t(e){var n,r,i,o,a,u,s,c,f,l,h,d,p;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=Qr(this.passNodes.entries()),t.prev=1,n.s();case 3:if((r=n.n()).done){t.next=18;break}if(i=Or(r.value,2),o=i[0],!(a=i[1]).refCount){t.next=16;break}u=Qr(a.devirtualize);try{for(u.s();!(s=u.n()).done;)s.value.preExecuteDevirtualize(this.engine)}catch(t){u.e(t)}finally{u.f()}c=Qr(a.destroy);try{for(c.s();!(f=c.n()).done;)f.value.preExecuteDestroy(this.engine)}catch(t){c.e(t)}finally{c.f()}return t.next=12,this.frameGraphPasses[o].execute(this,this.frameGraphPasses[o],e);case 12:l=Qr(a.devirtualize);try{for(l.s();!(h=l.n()).done;)h.value.postExecuteDevirtualize(this.engine)}catch(t){l.e(t)}finally{l.f()}d=Qr(a.destroy);try{for(d.s();!(p=d.n()).done;)p.value.postExecuteDestroy(this.engine)}catch(t){d.e(t)}finally{d.f()}case 16:t.next=3;break;case 18:t.next=23;break;case 20:t.prev=20,t.t0=t.catch(1),n.e(t.t0);case 23:return t.prev=23,n.f(),t.finish(23);case 26:this.reset();case 27:case"end":return t.stop()}}),t,this,[[1,20,23,26]])}))),function(t){return e.apply(this,arguments)})},{key:"reset",value:function(){this.passNodes=[],this.resourceNodes=[],this.frameGraphPasses=[]}},{key:"getResourceNode",value:function(t){return this.resourceNodes[t.index]}},{key:"createResourceNode",value:function(t){var e=new Jr;e.resource=t,e.version=t.version,this.resourceNodes.push(e);var n=new Gr;return n.index=this.resourceNodes.length-1,n}},{key:"createTexture",value:function(t,e,n){var r=new $r;return r.name=e,r.descriptor=n,this.createResourceNode(r)}},{key:"createRenderTarget",value:function(t,e,n){var r=new $r;return r.name=e,r.descriptor=n,this.createResourceNode(r)}},{key:"present",value:function(t){this.addPass("Present",(function(e,n){n.read(t),n.hasSideEffect=!0}),Tr(Sr().mark((function t(){return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)}))))}}]),t}(),Kr=wr((Yr=Zr).prototype,"engine",[Hr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),qr=Yr))||qr);function ni(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var ri=1e-6,ii="undefined"!=typeof Float32Array?Float32Array:Array;function oi(){var t=new ii(4);return ii!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function ai(t,e,n,r){var i=new ii(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i}function ui(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}function si(){var t=new ii(9);return ii!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function ci(){var t=new ii(3);return ii!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function fi(t){var e=new ii(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function li(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)}function hi(t,e,n){var r=new ii(3);return r[0]=t,r[1]=e,r[2]=n,r}function di(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function pi(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function vi(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function gi(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function yi(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function mi(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function bi(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function _i(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t}function xi(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function wi(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t}Math.random,Math.PI,Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)}),oi();var Ei=gi,Si=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.hypot(n,r,i)},Ai=li,Ti=(ci(),9007199254740991),Ii={};Ii["[object Float32Array]"]=Ii["[object Float64Array]"]=Ii["[object Int8Array]"]=Ii["[object Int16Array]"]=Ii["[object Int32Array]"]=Ii["[object Uint8Array]"]=Ii["[object Uint8ClampedArray]"]=Ii["[object Uint16Array]"]=Ii["[object Uint32Array]"]=!0,Ii["[object Arguments]"]=Ii["[object Array]"]=Ii["[object ArrayBuffer]"]=Ii["[object Boolean]"]=Ii["[object DataView]"]=Ii["[object Date]"]=Ii["[object Error]"]=Ii["[object Function]"]=Ii["[object Map]"]=Ii["[object Number]"]=Ii["[object Object]"]=Ii["[object RegExp]"]=Ii["[object Set]"]=Ii["[object String]"]=Ii["[object WeakMap]"]=!1;var Ci=Object.prototype.toString,Di=function(t){return function(t){return!!t&&"object"===zr(t)}(t)&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=Ti}(t.length)&&!!Ii[Ci.call(t)]};function Ni(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 ki(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ni(Object(n),!0).forEach((function(e){ni(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ni(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Ri,Oi,Mi,Pi,Gi,Li,Ui,Fi,Bi,zi=function(t){Br(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vr(e);if(n){var i=Vr(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wr(this,t)});function i(t){var e;return br(this,i),(e=r.call(this,t)).dirty=!0,e.attributes=[],e.indices=void 0,e.indicesBuffer=void 0,e.vertexCount=0,e.maxInstancedCount=void 0,e.aabb=void 0,e.entity=void 0,Object.assign(jr(e),t),e}return xr(i,[{key:"setAttribute",value:function(t,e,n,r){var i=this.attributes.find((function(e){return e.name===t}));return i?(i.data=e,i.dirty=!0):this.attributes.push(ki(ki({dirty:!0,name:t,data:e},n),{},{bufferGetter:r})),this.dirty=!0,this}},{key:"setIndex",value:function(t){return this.indices=new Uint32Array(t.buffer?t.buffer:t),this.dirty=!0,this}},{key:"applyMatrix",value:function(t){var e,n,r,i,o,a,u,s,c,f,l,h,d,p,v,g,y,m,b,_,x,w,E,S,A,T,I,C,D,N,k,R=this.attributes.find((function(t){return"position"===t.name})),O=this.attributes.find((function(t){return"normal"===t.name}));if(R&&(R.dirty=!0,R.data&&R.data.length))for(var M=0;M<R.data.length;M+=3){var P=ai(R.data[M],R.data[M+1],R.data[M+2],1);ui(P,P,t),Di(R.data)?R.data.set([P[0],P[1],P[2]],M):(R.data[M]=P[0],R.data[M+1]=P[1],R.data[M+2]=P[2])}if(O){var G=(e=si(),r=(n=t)[0],i=n[1],o=n[2],a=n[3],u=n[4],s=n[5],c=n[6],f=n[7],l=n[8],h=n[9],d=n[10],p=n[11],v=n[12],g=n[13],y=n[14],m=n[15],(k=(b=r*s-i*u)*(N=d*m-p*y)-(_=r*c-o*u)*(D=h*m-p*g)+(x=r*f-a*u)*(C=h*y-d*g)+(w=i*c-o*s)*(I=l*m-p*v)-(E=i*f-a*s)*(T=l*y-d*v)+(S=o*f-a*c)*(A=l*g-h*v))?(k=1/k,e[0]=(s*N-c*D+f*C)*k,e[1]=(c*I-u*N-f*T)*k,e[2]=(u*D-s*I+f*A)*k,e[3]=(o*D-i*N-a*C)*k,e[4]=(r*N-o*I+a*T)*k,e[5]=(i*I-r*D-a*A)*k,e[6]=(g*S-y*E+m*w)*k,e[7]=(y*x-v*S-m*_)*k,e[8]=(v*E-g*x+m*b)*k,e):null);if(O.data&&O.data.length)for(var L=0;L<O.data.length;L+=3){var U=hi(O.data[L],O.data[L+1],O.data[L+2]);wi(U,U,G),mi(U,U),Di(O.data)?O.data.set([U[0],U[1],U[2]],L):(O.data[L]=U[0],O.data[L+1]=U[1],O.data[L+2]=U[2])}}}}]),i}(Dr);!function(t){t[t.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",t[t.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",t[t.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t[t.ZERO=0]="ZERO",t[t.ONE=1]="ONE",t[t.SRC_COLOR=768]="SRC_COLOR",t[t.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",t[t.SRC_ALPHA=770]="SRC_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",t[t.DST_ALPHA=772]="DST_ALPHA",t[t.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",t[t.DST_COLOR=774]="DST_COLOR",t[t.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",t[t.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",t[t.FUNC_ADD=32774]="FUNC_ADD",t[t.BLEND_EQUATION=32777]="BLEND_EQUATION",t[t.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",t[t.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",t[t.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",t[t.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",t[t.MAX_EXT=32776]="MAX_EXT",t[t.MIN_EXT=32775]="MIN_EXT",t[t.BLEND_DST_RGB=32968]="BLEND_DST_RGB",t[t.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",t[t.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",t[t.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",t[t.CONSTANT_COLOR=32769]="CONSTANT_COLOR",t[t.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",t[t.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",t[t.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",t[t.BLEND_COLOR=32773]="BLEND_COLOR",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",t[t.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",t[t.STREAM_DRAW=35040]="STREAM_DRAW",t[t.STATIC_DRAW=35044]="STATIC_DRAW",t[t.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",t[t.BUFFER_SIZE=34660]="BUFFER_SIZE",t[t.BUFFER_USAGE=34661]="BUFFER_USAGE",t[t.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",t[t.FRONT=1028]="FRONT",t[t.BACK=1029]="BACK",t[t.FRONT_AND_BACK=1032]="FRONT_AND_BACK",t[t.CULL_FACE=2884]="CULL_FACE",t[t.BLEND=3042]="BLEND",t[t.DITHER=3024]="DITHER",t[t.STENCIL_TEST=2960]="STENCIL_TEST",t[t.DEPTH_TEST=2929]="DEPTH_TEST",t[t.SCISSOR_TEST=3089]="SCISSOR_TEST",t[t.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",t[t.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",t[t.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",t[t.NO_ERROR=0]="NO_ERROR",t[t.INVALID_ENUM=1280]="INVALID_ENUM",t[t.INVALID_VALUE=1281]="INVALID_VALUE",t[t.INVALID_OPERATION=1282]="INVALID_OPERATION",t[t.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",t[t.CW=2304]="CW",t[t.CCW=2305]="CCW",t[t.LINE_WIDTH=2849]="LINE_WIDTH",t[t.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",t[t.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",t[t.CULL_FACE_MODE=2885]="CULL_FACE_MODE",t[t.FRONT_FACE=2886]="FRONT_FACE",t[t.DEPTH_RANGE=2928]="DEPTH_RANGE",t[t.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",t[t.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",t[t.DEPTH_FUNC=2932]="DEPTH_FUNC",t[t.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",t[t.STENCIL_FUNC=2962]="STENCIL_FUNC",t[t.STENCIL_FAIL=2964]="STENCIL_FAIL",t[t.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",t[t.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",t[t.STENCIL_REF=2967]="STENCIL_REF",t[t.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",t[t.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",t[t.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",t[t.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",t[t.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",t[t.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",t[t.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",t[t.VIEWPORT=2978]="VIEWPORT",t[t.SCISSOR_BOX=3088]="SCISSOR_BOX",t[t.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",t[t.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",t[t.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",t[t.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",t[t.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",t[t.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",t[t.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",t[t.RED_BITS=3410]="RED_BITS",t[t.GREEN_BITS=3411]="GREEN_BITS",t[t.BLUE_BITS=3412]="BLUE_BITS",t[t.ALPHA_BITS=3413]="ALPHA_BITS",t[t.DEPTH_BITS=3414]="DEPTH_BITS",t[t.STENCIL_BITS=3415]="STENCIL_BITS",t[t.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",t[t.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",t[t.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",t[t.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",t[t.SAMPLES=32937]="SAMPLES",t[t.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",t[t.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",t[t.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",t[t.DONT_CARE=4352]="DONT_CARE",t[t.FASTEST=4353]="FASTEST",t[t.NICEST=4354]="NICEST",t[t.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",t[t.BYTE=5120]="BYTE",t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.SHORT=5122]="SHORT",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.INT=5124]="INT",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.FLOAT=5126]="FLOAT",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.ALPHA=6406]="ALPHA",t[t.RGB=6407]="RGB",t[t.RGBA=6408]="RGBA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",t[t.VERTEX_SHADER=35633]="VERTEX_SHADER",t[t.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",t[t.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",t[t.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",t[t.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",t[t.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",t[t.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",t[t.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",t[t.SHADER_TYPE=35663]="SHADER_TYPE",t[t.DELETE_STATUS=35712]="DELETE_STATUS",t[t.LINK_STATUS=35714]="LINK_STATUS",t[t.VALIDATE_STATUS=35715]="VALIDATE_STATUS",t[t.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",t[t.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",t[t.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",t[t.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",t[t.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",t[t.NEVER=512]="NEVER",t[t.LESS=513]="LESS",t[t.EQUAL=514]="EQUAL",t[t.LEQUAL=515]="LEQUAL",t[t.GREATER=516]="GREATER",t[t.NOTEQUAL=517]="NOTEQUAL",t[t.GEQUAL=518]="GEQUAL",t[t.ALWAYS=519]="ALWAYS",t[t.KEEP=7680]="KEEP",t[t.REPLACE=7681]="REPLACE",t[t.INCR=7682]="INCR",t[t.DECR=7683]="DECR",t[t.INVERT=5386]="INVERT",t[t.INCR_WRAP=34055]="INCR_WRAP",t[t.DECR_WRAP=34056]="DECR_WRAP",t[t.VENDOR=7936]="VENDOR",t[t.RENDERER=7937]="RENDERER",t[t.VERSION=7938]="VERSION",t[t.NEAREST=9728]="NEAREST",t[t.LINEAR=9729]="LINEAR",t[t.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",t[t.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",t[t.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",t[t.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",t[t.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",t[t.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",t[t.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",t[t.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE=5890]="TEXTURE",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t[t.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",t[t.TEXTURE0=33984]="TEXTURE0",t[t.TEXTURE1=33985]="TEXTURE1",t[t.TEXTURE2=33986]="TEXTURE2",t[t.TEXTURE3=33987]="TEXTURE3",t[t.TEXTURE4=33988]="TEXTURE4",t[t.TEXTURE5=33989]="TEXTURE5",t[t.TEXTURE6=33990]="TEXTURE6",t[t.TEXTURE7=33991]="TEXTURE7",t[t.TEXTURE8=33992]="TEXTURE8",t[t.TEXTURE9=33993]="TEXTURE9",t[t.TEXTURE10=33994]="TEXTURE10",t[t.TEXTURE11=33995]="TEXTURE11",t[t.TEXTURE12=33996]="TEXTURE12",t[t.TEXTURE13=33997]="TEXTURE13",t[t.TEXTURE14=33998]="TEXTURE14",t[t.TEXTURE15=33999]="TEXTURE15",t[t.TEXTURE16=34e3]="TEXTURE16",t[t.TEXTURE17=34001]="TEXTURE17",t[t.TEXTURE18=34002]="TEXTURE18",t[t.TEXTURE19=34003]="TEXTURE19",t[t.TEXTURE20=34004]="TEXTURE20",t[t.TEXTURE21=34005]="TEXTURE21",t[t.TEXTURE22=34006]="TEXTURE22",t[t.TEXTURE23=34007]="TEXTURE23",t[t.TEXTURE24=34008]="TEXTURE24",t[t.TEXTURE25=34009]="TEXTURE25",t[t.TEXTURE26=34010]="TEXTURE26",t[t.TEXTURE27=34011]="TEXTURE27",t[t.TEXTURE28=34012]="TEXTURE28",t[t.TEXTURE29=34013]="TEXTURE29",t[t.TEXTURE30=34014]="TEXTURE30",t[t.TEXTURE31=34015]="TEXTURE31",t[t.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",t[t.REPEAT=10497]="REPEAT",t[t.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t[t.FLOAT_VEC2=35664]="FLOAT_VEC2",t[t.FLOAT_VEC3=35665]="FLOAT_VEC3",t[t.FLOAT_VEC4=35666]="FLOAT_VEC4",t[t.INT_VEC2=35667]="INT_VEC2",t[t.INT_VEC3=35668]="INT_VEC3",t[t.INT_VEC4=35669]="INT_VEC4",t[t.BOOL=35670]="BOOL",t[t.BOOL_VEC2=35671]="BOOL_VEC2",t[t.BOOL_VEC3=35672]="BOOL_VEC3",t[t.BOOL_VEC4=35673]="BOOL_VEC4",t[t.FLOAT_MAT2=35674]="FLOAT_MAT2",t[t.FLOAT_MAT3=35675]="FLOAT_MAT3",t[t.FLOAT_MAT4=35676]="FLOAT_MAT4",t[t.SAMPLER_2D=35678]="SAMPLER_2D",t[t.SAMPLER_CUBE=35680]="SAMPLER_CUBE",t[t.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",t[t.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",t[t.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",t[t.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",t[t.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",t[t.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",t[t.COMPILE_STATUS=35713]="COMPILE_STATUS",t[t.LOW_FLOAT=36336]="LOW_FLOAT",t[t.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",t[t.HIGH_FLOAT=36338]="HIGH_FLOAT",t[t.LOW_INT=36339]="LOW_INT",t[t.MEDIUM_INT=36340]="MEDIUM_INT",t[t.HIGH_INT=36341]="HIGH_INT",t[t.FRAMEBUFFER=36160]="FRAMEBUFFER",t[t.RENDERBUFFER=36161]="RENDERBUFFER",t[t.RGBA4=32854]="RGBA4",t[t.RGB5_A1=32855]="RGB5_A1",t[t.RGB565=36194]="RGB565",t[t.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",t[t.STENCIL_INDEX=6401]="STENCIL_INDEX",t[t.STENCIL_INDEX8=36168]="STENCIL_INDEX8",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t[t.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",t[t.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",t[t.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",t[t.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",t[t.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",t[t.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",t[t.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",t[t.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",t[t.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",t[t.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",t[t.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",t[t.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",t[t.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",t[t.NONE=0]="NONE",t[t.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",t[t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",t[t.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",t[t.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",t[t.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",t[t.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",t[t.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",t[t.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",t[t.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",t[t.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",t[t.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",t[t.COPY_SRC=1]="COPY_SRC",t[t.COPY_DST=2]="COPY_DST",t[t.SAMPLED=4]="SAMPLED",t[t.STORAGE=8]="STORAGE",t[t.RENDER_ATTACHMENT=16]="RENDER_ATTACHMENT"}(Ri||(Ri={}));var ji=(Oi=(0,Mr.b2)(),Mi=(0,Mr.f3)(Pr.GeometryComponentManager),Pi=(0,Mr.f3)(Pr.RenderEngine),Oi((Bi=function(){function t(){br(this,t),mr(this,"geometry",Ui,this),mr(this,"engine",Fi,this)}var e;return xr(t,[{key:"execute",value:(e=Tr(Sr().mark((function t(){var e=this;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.geometry.forEach((function(t,n){n.dirty&&(n.attributes.forEach((function(t){var n;t.dirty&&t.data&&(t.buffer?null===(n=t.buffer)||void 0===n||n.subData({data:t.data,offset:0}):t.buffer=e.engine.createBuffer({data:t.data,type:Ri.FLOAT}),t.dirty=!1)})),n.indices&&(n.indicesBuffer?n.indicesBuffer.subData({data:n.indices,offset:0}):n.indicesBuffer=e.engine.createElements({data:n.indices,count:n.indices.length,type:Ri.UNSIGNED_INT,usage:Ri.STATIC_DRAW})),n.dirty=!1)}));case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"tearDown",value:function(){this.geometry.forEach((function(t,e){e.indicesBuffer&&e.indicesBuffer.destroy(),e.attributes.forEach((function(t){t.buffer&&t.buffer.destroy()}))})),this.geometry.clear()}},{key:"createBufferGeometry",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{vertexCount:3},e=t.vertexCount,n=Cr();return this.geometry.create(n,{vertexCount:e})}},{key:"createInstancedBufferGeometry",value:function(t){var e=t.maxInstancedCount,n=t.vertexCount,r=Cr();return this.geometry.create(r,{maxInstancedCount:e,vertexCount:n})}}]),t}(),Ui=wr((Li=Bi).prototype,"geometry",[Mi],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Fi=wr(Li.prototype,"engine",[Pi],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Gi=Li))||Gi);function Wi(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 Vi(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Wi(Object(n),!0).forEach((function(e){ni(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Wi(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Xi,Hi,qi,Yi,Ki,Zi,$i,Ji,Qi,to,eo=function(t){Br(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vr(e);if(n){var i=Vr(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wr(this,t)});function i(t){var e;return br(this,i),(e=r.call(this,t)).vertexShaderGLSL=void 0,e.fragmentShaderGLSL=void 0,e.defines={},e.dirty=!0,e.uniforms=[],e.cull={enable:!0,face:Ri.BACK},e.depth={enable:!0},e.blend=void 0,e.entity=void 0,e.type=void 0,Object.assign(jr(e),t),e}return xr(i,[{key:"setDefines",value:function(t){return this.defines=Vi(Vi({},this.defines),t),this}},{key:"setCull",value:function(t){return this.cull=t,this}},{key:"setDepth",value:function(t){return this.depth=t,this}},{key:"setBlend",value:function(t){return this.blend=t,this}},{key:"setUniform",value:function(t,e){var n=this;if("string"!=typeof t)return Object.keys(t).forEach((function(e){return n.setUniform(e,t[e])})),this;var r=this.uniforms.find((function(e){return e.name===t}));return r?(r.dirty=!0,r.data=e):this.uniforms.push({name:t,dirty:!0,data:e}),this.dirty=!0,this}}]),i}(Dr);function no(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 ro(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?no(Object(n),!0).forEach((function(e){ni(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):no(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var io,oo=(Xi=(0,Mr.b2)(),Hi=(0,Mr.f3)(Pr.MaterialComponentManager),qi=(0,Mr.f3)(Pr.RenderEngine),Yi=(0,Mr.f3)(Pr.ShaderModuleService),Xi((to=function(){function t(){br(this,t),mr(this,"material",$i,this),mr(this,"engine",Ji,this),mr(this,"shaderModule",Qi,this)}var e;return xr(t,[{key:"execute",value:(e=Tr(Sr().mark((function t(){return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)}))),function(){return e.apply(this,arguments)})},{key:"tearDown",value:function(){this.material.clear()}},{key:"createShaderMaterial",value:function(t){var e=Cr(),n=t.vertexShader,r=t.fragmentShader,i=[];if(!this.engine.supportWebGPU){var o="material-".concat(e);this.shaderModule.registerModule(o,{vs:t.vertexShader,fs:t.fragmentShader});var a=this.shaderModule.getModule(o);n=a.vs,r=a.fs,a.uniforms&&(i=Object.keys(a.uniforms).map((function(t){return{dirty:!0,name:t,data:a.uniforms[t]}})))}return this.material.create(e,ro(ro({vertexShaderGLSL:n,fragmentShaderGLSL:r},t),{},{uniforms:i}))}}]),t}(),$i=wr((Zi=to).prototype,"material",[Hi],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ji=wr(Zi.prototype,"engine",[qi],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Qi=wr(Zi.prototype,"shaderModule",[Yi],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ki=Zi))||Ki);!function(t){t[t.Standard=0]="Standard"}(io||(io={}));var ao=function(t){Br(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vr(e);if(n){var i=Vr(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wr(this,t)});function i(t){var e;return br(this,i),(e=r.call(this,t)).strategy=io.Standard,e.visibilityPlaneMask=0,e.visible=!1,Object.assign(jr(e),t),e}return i}(Dr),uo=function(){function t(e,n){br(this,t),this.center=void 0,this.halfExtents=void 0,this.min=ci(),this.max=ci(),this.update(e,n)}return xr(t,[{key:"update",value:function(t,e){this.center=t||ci(),this.halfExtents=e||hi(.5,.5,.5),this.min=Ei(this.min,this.center,this.halfExtents),this.max=vi(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(t,e){vi(this.center,e,t),yi(this.center,this.center,.5),Ei(this.halfExtents,e,t),yi(this.halfExtents,this.halfExtents,.5),di(this.min,t),di(this.max,e)}},{key:"getMin",value:function(){return this.min}},{key:"getMax",value:function(){return this.max}},{key:"add",value:function(t){var e=this.center,n=e[0],r=e[1],i=e[2],o=this.halfExtents,a=o[0],u=o[1],s=o[2],c=n-a,f=n+a,l=r-u,h=r+u,d=i-s,p=i+s,v=t.center,g=v[0],y=v[1],m=v[2],b=t.halfExtents,_=b[0],x=b[1],w=b[2],E=g-_,S=g+_,A=y-x,T=y+x,I=m-w,C=m+w;E<c&&(c=E),S>f&&(f=S),A<l&&(l=A),T>h&&(h=T),I<d&&(d=I),C>p&&(p=C),e[0]=.5*(c+f),e[1]=.5*(l+h),e[2]=.5*(d+p),o[0]=.5*(f-c),o[1]=.5*(h-l),o[2]=.5*(p-d),this.min[0]=c,this.min[1]=l,this.min[2]=d,this.max[0]=f,this.max[1]=h,this.max[2]=p}},{key:"intersects",value:function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),i=t.getMin();return n[0]<=r[0]&&e[0]>=i[0]&&n[1]<=r[1]&&e[1]>=i[1]&&n[2]<=r[2]&&e[2]>=i[2]}},{key:"containsPoint",value:function(t){var e=this.getMin(),n=this.getMax();return!(t[0]<e[0]||t[0]>n[0]||t[1]<e[1]||t[1]>n[1]||t[2]<e[2]||t[2]>n[2])}},{key:"getNegativeFarPoint",value:function(t){return 273===t.pnVertexFlag?di(ci(),this.min):272===t.pnVertexFlag?hi(this.min[0],this.min[1],this.max[2]):257===t.pnVertexFlag?hi(this.min[0],this.max[1],this.min[2]):256===t.pnVertexFlag?hi(this.min[0],this.max[1],this.max[2]):17===t.pnVertexFlag?hi(this.max[0],this.min[1],this.min[2]):16===t.pnVertexFlag?hi(this.max[0],this.min[1],this.max[2]):1===t.pnVertexFlag?hi(this.max[0],this.max[1],this.min[2]):hi(this.max[0],this.max[1],this.max[2])}},{key:"getPositiveFarPoint",value:function(t){return 273===t.pnVertexFlag?di(ci(),this.max):272===t.pnVertexFlag?hi(this.max[0],this.max[1],this.min[2]):257===t.pnVertexFlag?hi(this.max[0],this.min[1],this.max[2]):256===t.pnVertexFlag?hi(this.max[0],this.min[1],this.min[2]):17===t.pnVertexFlag?hi(this.min[0],this.max[1],this.max[2]):16===t.pnVertexFlag?hi(this.min[0],this.max[1],this.min[2]):1===t.pnVertexFlag?hi(this.min[0],this.min[1],this.max[2]):hi(this.min[0],this.min[1],this.min[2])}}]),t}();var so,co=function(t){Br(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vr(e);if(n){var i=Vr(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wr(this,t)});function i(t){var e;return br(this,i),(e=r.call(this,t)).material=void 0,e.geometry=void 0,e.aabb=new uo,e.aabbDirty=!0,e.model=void 0,e.visible=!0,e.children=[],Object.assign(jr(e),t),e}return i}(Dr),fo=function(){function t(e,n){br(this,t),this.distance=void 0,this.normal=void 0,this.pnVertexFlag=void 0,this.distance=e||0,this.normal=n||hi(0,1,0),this.updatePNVertexFlag()}return xr(t,[{key:"updatePNVertexFlag",value:function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)}},{key:"distanceToPoint",value:function(t){return bi(t,this.normal)-this.distance}},{key:"normalize",value:function(){var t=1/Ai(this.normal);yi(this.normal,this.normal,t),this.distance*=t}},{key:"intersectsLine",value:function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),o=i>=0&&i<=1;return o&&n&&_i(n,t,e,i),o}}]),t}();!function(t){t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE"}(so||(so={}));var lo,ho,po,vo,go,yo,mo,bo,_o,xo,wo,Eo,So,Ao,To=function(){function t(e){if(br(this,t),this.planes=[],e)this.planes=e;else for(var n=0;n<6;n++)this.planes.push(new fo)}return xr(t,[{key:"extractFromVPMatrix",value:function(t){var e=Or(t,16),n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],u=e[5],s=e[6],c=e[7],f=e[8],l=e[9],h=e[10],d=e[11],p=e[12],v=e[13],g=e[14],y=e[15];pi(this.planes[0].normal,o-n,c-a,d-f),this.planes[0].distance=-(y-p),pi(this.planes[1].normal,o+n,c+a,d+f),this.planes[1].distance=-(y+p),pi(this.planes[2].normal,o+r,c+u,d+l),this.planes[2].distance=-(y+v),pi(this.planes[3].normal,o-r,c-u,d-l),this.planes[3].distance=-(y-v),pi(this.planes[4].normal,o-i,c-s,d-h),this.planes[4].distance=-(y-g),pi(this.planes[5].normal,o+i,c+s,d+h),this.planes[5].distance=-(y+g),this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))}}]),t}();function Io(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Co(t,e);var n=Object.prototype.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)?Co(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Co(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Do=(lo=(0,Mr.b2)(),ho=(0,Mr.f3)(Pr.MeshComponentManager),po=(0,Mr.f3)(Pr.CullableComponentManager),vo=(0,Mr.f3)(Pr.GeometryComponentManager),go=(0,Mr.f3)(Pr.HierarchyComponentManager),yo=(0,Mr.f3)(Pr.TransformComponentManager),lo((Ao=function(){function t(){br(this,t),mr(this,"mesh",_o,this),mr(this,"cullable",xo,this),mr(this,"geometry",wo,this),mr(this,"hierarchy",Eo,this),mr(this,"transform",So,this),this.planes=void 0}var e;return xr(t,[{key:"setFrustumPlanes",value:function(t){this.planes=t}},{key:"execute",value:(e=Tr(Sr().mark((function t(e){var n,r,i,o,a,u,s,c,f,l,h,d,p,v,g,y,m,b,_,x,w;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=Io(e);try{for(n.s();!(r=n.n()).done;){i=r.value,o=i.getScene(),a=i.getCamera(),u=Io(o.getEntities());try{for(u.s();!(s=u.n()).done;)c=s.value,(f=this.mesh.getComponentByEntity(c))&&(l=this.hierarchy.getComponentByEntity(c),h=this.cullable.getComponentByEntity(c),d=f.geometry,p=this.transform.getComponentByEntity(c),d&&d.aabb&&p&&f.aabbDirty&&(v=p.worldTransform,g=d.aabb,y=g.center,m=g.halfExtents,b=xi(ci(),y,v),E=v,(S=si())[0]=E[0],S[1]=E[1],S[2]=E[2],S[3]=E[4],S[4]=E[5],S[5]=E[6],S[6]=E[8],S[7]=E[9],S[8]=E[10],_=S,x=wi(ci(),m,_),f.aabb.update(b,x),f.aabbDirty=!1),h&&d&&(w=this.cullable.getComponentByEntity((null==l?void 0:l.parentID)||-1),h.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(f.aabb,(null==w?void 0:w.visibilityPlaneMask)||so.INDETERMINATE,this.planes||a.getFrustum().planes),h.visible=h.visibilityPlaneMask!==so.OUTSIDE))}catch(t){u.e(t)}finally{u.f()}}}catch(t){n.e(t)}finally{n.f()}case 2:case"end":return t.stop()}var E,S}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"tearDown",value:function(){this.cullable.clear(),this.mesh.clear()}},{key:"computeVisibilityWithPlaneMask",value:function(t,e,n){if(e===so.OUTSIDE||e===so.INSIDE)return e;for(var r=so.INSIDE,i=0,o=n.length;i<o;++i){var a=i<31?1<<i:0;if(!(i<31&&0==(e&a))){var u=n[i],s=u.normal,c=u.distance;if(bi(s,t.getNegativeFarPoint(n[i]))+c>0)return so.OUTSIDE;bi(s,t.getPositiveFarPoint(n[i]))+c>0&&(r|=a)}}return r}}]),t}(),_o=wr((bo=Ao).prototype,"mesh",[ho],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),xo=wr(bo.prototype,"cullable",[po],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),wo=wr(bo.prototype,"geometry",[vo],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Eo=wr(bo.prototype,"hierarchy",[go],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),So=wr(bo.prototype,"transform",[yo],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),mo=bo))||mo);function No(){var t=new ii(16);return ii!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function ko(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Ro(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Oo(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],u=e[5],s=e[6],c=e[7],f=e[8],l=e[9],h=e[10],d=e[11],p=e[12],v=e[13],g=e[14],y=e[15],m=n*u-r*a,b=n*s-i*a,_=n*c-o*a,x=r*s-i*u,w=r*c-o*u,E=i*c-o*s,S=f*v-l*p,A=f*g-h*p,T=f*y-d*p,I=l*g-h*v,C=l*y-d*v,D=h*y-d*g,N=m*D-b*C+_*I+x*T-w*A+E*S;return N?(N=1/N,t[0]=(u*D-s*C+c*I)*N,t[1]=(i*C-r*D-o*I)*N,t[2]=(v*E-g*w+y*x)*N,t[3]=(h*w-l*E-d*x)*N,t[4]=(s*T-a*D-c*A)*N,t[5]=(n*D-i*T+o*A)*N,t[6]=(g*_-p*E-y*b)*N,t[7]=(f*E-h*_+d*b)*N,t[8]=(a*C-u*T+c*S)*N,t[9]=(r*T-n*C-o*S)*N,t[10]=(p*w-v*_+y*m)*N,t[11]=(l*_-f*w-d*m)*N,t[12]=(u*A-a*I-s*S)*N,t[13]=(n*I-r*A+i*S)*N,t[14]=(v*b-p*x-g*m)*N,t[15]=(f*x-l*b+h*m)*N,t):null}function Mo(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],u=e[4],s=e[5],c=e[6],f=e[7],l=e[8],h=e[9],d=e[10],p=e[11],v=e[12],g=e[13],y=e[14],m=e[15],b=n[0],_=n[1],x=n[2],w=n[3];return t[0]=b*r+_*u+x*l+w*v,t[1]=b*i+_*s+x*h+w*g,t[2]=b*o+_*c+x*d+w*y,t[3]=b*a+_*f+x*p+w*m,b=n[4],_=n[5],x=n[6],w=n[7],t[4]=b*r+_*u+x*l+w*v,t[5]=b*i+_*s+x*h+w*g,t[6]=b*o+_*c+x*d+w*y,t[7]=b*a+_*f+x*p+w*m,b=n[8],_=n[9],x=n[10],w=n[11],t[8]=b*r+_*u+x*l+w*v,t[9]=b*i+_*s+x*h+w*g,t[10]=b*o+_*c+x*d+w*y,t[11]=b*a+_*f+x*p+w*m,b=n[12],_=n[13],x=n[14],w=n[15],t[12]=b*r+_*u+x*l+w*v,t[13]=b*i+_*s+x*h+w*g,t[14]=b*o+_*c+x*d+w*y,t[15]=b*a+_*f+x*p+w*m,t}function Po(t,e,n){var r,i,o,a,u,s,c,f,l,h,d,p,v=n[0],g=n[1],y=n[2];return e===t?(t[12]=e[0]*v+e[4]*g+e[8]*y+e[12],t[13]=e[1]*v+e[5]*g+e[9]*y+e[13],t[14]=e[2]*v+e[6]*g+e[10]*y+e[14],t[15]=e[3]*v+e[7]*g+e[11]*y+e[15]):(r=e[0],i=e[1],o=e[2],a=e[3],u=e[4],s=e[5],c=e[6],f=e[7],l=e[8],h=e[9],d=e[10],p=e[11],t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=u,t[5]=s,t[6]=c,t[7]=f,t[8]=l,t[9]=h,t[10]=d,t[11]=p,t[12]=r*v+u*g+l*y+e[12],t[13]=i*v+s*g+h*y+e[13],t[14]=o*v+c*g+d*y+e[14],t[15]=a*v+f*g+p*y+e[15]),t}function Go(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Lo(t,e){var n=e[0],r=e[1],i=e[2],o=e[4],a=e[5],u=e[6],s=e[8],c=e[9],f=e[10];return t[0]=Math.hypot(n,r,i),t[1]=Math.hypot(o,a,u),t[2]=Math.hypot(s,c,f),t}function Uo(t,e){var n=new ii(3);Lo(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],a=e[0]*r,u=e[1]*i,s=e[2]*o,c=e[4]*r,f=e[5]*i,l=e[6]*o,h=e[8]*r,d=e[9]*i,p=e[10]*o,v=a+f+p,g=0;return v>0?(g=2*Math.sqrt(v+1),t[3]=.25*g,t[0]=(l-d)/g,t[1]=(h-s)/g,t[2]=(u-c)/g):a>f&&a>p?(g=2*Math.sqrt(1+a-f-p),t[3]=(l-d)/g,t[0]=.25*g,t[1]=(u+c)/g,t[2]=(h+s)/g):f>p?(g=2*Math.sqrt(1+f-a-p),t[3]=(h-s)/g,t[0]=(u+c)/g,t[1]=.25*g,t[2]=(l+d)/g):(g=2*Math.sqrt(1+p-a-f),t[3]=(u-c)/g,t[0]=(h+s)/g,t[1]=(l+d)/g,t[2]=.25*g),t}function Fo(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,u=r+r,s=i+i,c=n*a,f=r*a,l=r*u,h=i*a,d=i*u,p=i*s,v=o*a,g=o*u,y=o*s;return t[0]=1-l-p,t[1]=f+y,t[2]=h-g,t[3]=0,t[4]=f-y,t[5]=1-c-p,t[6]=d+v,t[7]=0,t[8]=h+g,t[9]=d-v,t[10]=1-c-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}var Bo,zo,jo,Wo,Vo,Xo,Ho,qo,Yo,Ko,Zo,$o,Jo,Qo,ta,ea,na,ra,ia,oa,aa,ua,sa,ca;function fa(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return la(t,e);var n=Object.prototype.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)?la(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function la(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var ha,da,pa,va,ga,ya,ma,ba,_a,xa,wa,Ea,Sa,Aa=(Bo=(0,Mr.b2)(),zo=(0,Mr.f3)(Pr.MeshComponentManager),jo=(0,Mr.f3)(Pr.GeometryComponentManager),Wo=(0,Mr.f3)(Pr.MaterialComponentManager),Vo=(0,Mr.f3)(Pr.CullableComponentManager),Xo=(0,Mr.f3)(Pr.TransformComponentManager),Ho=(0,Mr.f3)(Pr.HierarchyComponentManager),qo=(0,Mr.f3)(Pr.Systems),Yo=(0,Mr.t6)(Pr.FrameGraphSystem),Ko=(0,Mr.f3)(Pr.RenderEngine),Zo=(0,Mr.f3)(Pr.ResourcePool),Bo((ca=sa=function(){function t(){var e=this;br(this,t),mr(this,"mesh",Qo,this),mr(this,"geometry",ta,this),mr(this,"material",ea,this),mr(this,"cullable",na,this),mr(this,"transform",ra,this),mr(this,"hierarchy",ia,this),mr(this,"frameGraphSystem",oa,this),mr(this,"engine",aa,this),mr(this,"resourcePool",ua,this),this.modelCache={},this.setup=function(t,e,n){var r=t.createRenderTarget(e,"color buffer",{width:1,height:1,usage:Ri.RENDER_ATTACHMENT|Ri.SAMPLED|Ri.COPY_SRC});n.data={output:e.write(t,r)}},this.execute=function(){var t=Tr(Sr().mark((function t(n,r,i){var o,a,u,s,c,f;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=n.getResourceNode(r.data.output),a=e.resourcePool.getOrCreateResource(o.resource),u=fa(i),t.prev=3,u.s();case 5:if((s=u.n()).done){t.next=11;break}return c=s.value,t.next=9,e.initView(c);case 9:t.next=5;break;case 11:t.next=16;break;case 13:t.prev=13,t.t0=t.catch(3),u.e(t.t0);case 16:return t.prev=16,u.f(),t.finish(16);case 19:f=e.engine.getCanvas(),a.resize({width:f.width,height:f.height}),e.engine.setScissor({enable:!1}),e.engine.clear({framebuffer:a,color:i[0].getClearColor(),depth:1}),e.engine.useFramebuffer(a,(function(){var t,n=fa(i);try{for(n.s();!(t=n.n()).done;){var r=t.value;e.renderView(r)}}catch(t){n.e(t)}finally{n.f()}}));case 24:case"end":return t.stop()}}),t,null,[[3,13,16,19]])})));return function(e,n,r){return t.apply(this,arguments)}}()}var e,n;return xr(t,[{key:"renderView",value:function(t){var e=t.getScene(),n=t.getCamera(),r=n.getViewTransform(),i=Mo(No(),n.getPerspective(),r);n.getFrustum().extractFromVPMatrix(i);var o=t.getViewport(),a=o.x,u=o.y,s=o.width,c=o.height;this.engine.viewport({x:a,y:u,width:s,height:c});var f,l=fa(e.getEntities());try{for(l.s();!(f=l.n()).done;){var h=f.value;this.renderMesh(h,{camera:n,view:t,viewMatrix:r})}}catch(t){l.e(t)}finally{l.f()}}},{key:"renderMesh",value:function(t,e){var n=e.camera,r=e.view,i=e.viewMatrix,o=this.mesh.getComponentByEntity(t);if(o&&o.visible){var a=o.material,u=o.geometry;if(u&&!u.dirty&&a){var s=this.transform.getComponentByEntity(t),c=Mo(No(),i,s.worldTransform),f=r.getViewport(),l=f.width,h=f.height;a.setUniform({projectionMatrix:n.getPerspective(),modelViewMatrix:c,modelMatrix:s.worldTransform,viewMatrix:i,cameraPosition:n.getPosition(),u_viewport:[l,h]}),o.model&&(o.model.draw({uniforms:a.uniforms.reduce((function(t,e){return t[e.name]=e.data,t}),{})}),a.uniforms.forEach((function(t){t.dirty=!1})),a.dirty=!1)}}}},{key:"initMesh",value:(n=Tr(Sr().mark((function t(e,n){var r,i,o,a,u,s,c,f;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.mesh.getComponentByEntity(e)){t.next=3;break}return t.abrupt("return");case 3:if(i=r.material,(o=r.geometry)&&!o.dirty&&i){t.next=7;break}return t.abrupt("return");case 7:if(r.model){t.next=24;break}if(a="m-".concat(i.entity,"-g-").concat(o.entity),!this.modelCache[a]){t.next=12;break}return r.model=this.modelCache[a],t.abrupt("return");case 12:return i.setUniform({projectionMatrix:1,modelViewMatrix:1,modelMatrix:1,viewMatrix:1,cameraPosition:1,u_viewport:1}),u=this.engine,s=u.createModel,c=u.createAttribute,f={vs:i.vertexShaderGLSL,fs:i.fragmentShaderGLSL,defines:i.defines,attributes:o.attributes.reduce((function(t,e){return e.data&&e.buffer&&(t[e.name]=c({buffer:e.buffer,attributes:e.attributes,arrayStride:e.arrayStride,stepMode:e.stepMode,divisor:"vertex"===e.stepMode?0:1})),t}),{}),uniforms:i.uniforms.reduce((function(t,e){return t[e.name]=e.data,t}),{}),scissor:{enable:!0,box:function(){return n.getViewport()}}},i.cull&&(f.cull=i.cull),i.depth&&(f.depth=i.depth),i.blend&&(f.blend=i.blend),o.indicesBuffer&&(f.elements=o.indicesBuffer),o.maxInstancedCount&&(f.instances=o.maxInstancedCount,f.count=o.vertexCount||3),t.next=22,s(f);case 22:r.model=t.sent,this.modelCache[a]=r.model;case 24:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"initView",value:(e=Tr(Sr().mark((function t(e){var n,r,i,o;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.getScene(),r=fa(n.getEntities()),t.prev=2,r.s();case 4:if((i=r.n()).done){t.next=10;break}return o=i.value,t.next=8,this.initMesh(o,e);case 8:t.next=4;break;case 10:t.next=15;break;case 12:t.prev=12,t.t0=t.catch(2),r.e(t.t0);case 15:return t.prev=15,r.f(),t.finish(15);case 18:case"end":return t.stop()}}),t,this,[[2,12,15,18]])}))),function(t){return e.apply(this,arguments)})}]),t}(),sa.IDENTIFIER="Render Pass",Qo=wr((Jo=ca).prototype,"mesh",[zo],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ta=wr(Jo.prototype,"geometry",[jo],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ea=wr(Jo.prototype,"material",[Wo],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),na=wr(Jo.prototype,"cullable",[Vo],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ra=wr(Jo.prototype,"transform",[Xo],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ia=wr(Jo.prototype,"hierarchy",[Ho],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),oa=wr(Jo.prototype,"frameGraphSystem",[qo,Yo],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),aa=wr(Jo.prototype,"engine",[Ko],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ua=wr(Jo.prototype,"resourcePool",[Zo],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),$o=Jo))||$o);function Ta(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Ia(t,e);var n=Object.prototype.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)?Ia(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function Ia(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Ca,Da,Na,ka,Ra,Oa,Ma,Pa,Ga,La,Ua,Fa,Ba,za,ja,Wa,Va,Xa,Ha,qa,Ya,Ka,Za=(ha=(0,Mr.b2)(),da=(0,Mr.f3)(Pr.RenderEngine),pa=(0,Mr.f3)(Pr.ResourcePool),va=(0,Mr.f3)(Pr.RenderPassFactory),ga=(0,Mr.f3)(Pr.MeshComponentManager),ha((Sa=Ea=function(){function t(){var e=this;br(this,t),mr(this,"engine",ba,this),mr(this,"resourcePool",_a,this),mr(this,"renderPassFactory",xa,this),mr(this,"mesh",wa,this),this.pickingFBO=void 0,this.views=void 0,this.highlightEnabled=!0,this.highlightColor=[255,0,0,255],this.alreadyInRendering=!1,this.setup=function(t,e,n){var r=t.createRenderTarget(e,"picking fbo",{width:1,height:1});n.data={output:e.write(t,r)},e.hasSideEffect=!0},this.execute=function(){var t=Tr(Sr().mark((function t(n,r,i){var o,a,u;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.views=i,!e.alreadyInRendering){t.next=3;break}return t.abrupt("return");case 3:o=Ta(i);try{for(u=function(){var t=a.value,i=t.getViewport(),o=i.width,u=i.height;e.alreadyInRendering=!0;var s=n.getResourceNode(r.data.output);e.pickingFBO=e.resourcePool.getOrCreateResource(s.resource),e.pickingFBO.resize({width:o,height:u}),e.engine.useFramebuffer(e.pickingFBO,(function(){e.engine.clear({framebuffer:e.pickingFBO,color:[0,0,0,0],stencil:0,depth:1});var n,r=e.renderPassFactory(Aa.IDENTIFIER),i=[],o=Ta(t.getScene().getEntities());try{for(o.s();!(n=o.n()).done;){var a=n.value,u=e.mesh.getComponentByEntity(a);u.material.setUniform("u_PickingStage",1),i.push(u)}}catch(t){o.e(t)}finally{o.f()}r.renderView(t),i.forEach((function(t){t.material.setUniform("u_PickingStage",2)})),e.alreadyInRendering=!1}))},o.s();!(a=o.n()).done;)u()}catch(t){o.e(t)}finally{o.f()}case 5:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}(),this.pick=function(t,n){var r,i,o=t.x,a=t.y,u=e.engine,s=u.readPixels,c=u.useFramebuffer,f=n.getViewport(),l=f.width,h=f.height,d=o*window.devicePixelRatio,p=a*window.devicePixelRatio;if(!(d>l||d<0||p>h||p<0))return c(e.pickingFBO,(function(){var t;0===(r=s({x:Math.round(d),y:Math.round(h-(a+1)*window.devicePixelRatio),width:1,height:1,data:new Uint8Array(4),framebuffer:e.pickingFBO}))[0]&&0===r[1]&&0===r[2]||(t=Or(r,3),i=t[0]+256*t[1]+65536*t[2]-1,e.highlightEnabled&&e.highlightPickedFeature(r,n))})),i}}return xr(t,[{key:"enableHighlight",value:function(t){this.highlightEnabled=t}},{key:"setHighlightColor",value:function(t){this.highlightColor=t}},{key:"highlightPickedFeature",value:function(t,e){if(t){var n,r=Ta(e.getScene().getEntities());try{for(r.s();!(n=r.n()).done;){var i=n.value,o=this.mesh.getComponentByEntity(i).material;o.setUniform("u_PickingStage",2),o.setUniform("u_PickingColor",[t[0],t[1],t[2]]),o.setUniform("u_HighlightColor",this.highlightColor)}}catch(t){r.e(t)}finally{r.f()}}}}]),t}(),Ea.IDENTIFIER="PixelPicking Pass",ba=wr((ma=Sa).prototype,"engine",[da],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),_a=wr(ma.prototype,"resourcePool",[pa],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),xa=wr(ma.prototype,"renderPassFactory",[va],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),wa=wr(ma.prototype,"mesh",[ga],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ya=ma))||ya),$a=(Ca=(0,Mr.b2)(),Da=(0,Mr.f3)(Pr.RenderEngine),Na=(0,Mr.f3)(Pr.ResourcePool),Ca((Ga=Pa=function t(){var e=this;br(this,t),mr(this,"engine",Oa,this),mr(this,"resourcePool",Ma,this),this.model=void 0,this.setup=function(t,e,n){var r=t.getPass(Aa.IDENTIFIER);if(r){var i=t.createRenderTarget(e,"render to screen",{width:1,height:1});n.data={input:e.read(r.data.output),output:e.write(t,i)}}},this.execute=function(){var t=Tr(Sr().mark((function t(n,r){var i,o,a,u,s,c,f;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=e.engine,o=i.createModel,a=i.createAttribute,u=i.createBuffer,e.model){t.next=6;break}return t.next=4,o({vs:e.engine.supportWebGPU?"layout(location = 0) in vec2 a_Position;\nlayout(location = 0) out vec2 v_UV;\n\nvoid main() {\n v_UV = 0.5 * (a_Position + 1.0);\n gl_Position = vec4(a_Position, 0., 1.);\n}":"attribute vec2 a_Position;\n\nvarying vec2 v_UV;\n\nvoid main() {\n v_UV = 0.5 * (a_Position + 1.0);\n gl_Position = vec4(a_Position, 0., 1.);\n}",fs:e.engine.supportWebGPU?"layout(set = 0, binding = 0) uniform sampler u_TextureSampler;\nlayout(set = 0, binding = 1) uniform texture2D u_Texture;\n\nlayout(location = 0) in vec2 v_UV;\nlayout(location = 0) out vec4 outColor;\n\nvoid main() {\n outColor = texture(sampler2D(u_Texture, u_TextureSampler), v_UV);\n}":"varying vec2 v_UV;\n\nuniform sampler2D u_Texture;\n\nvoid main() {\n gl_FragColor = vec4(texture2D(u_Texture, v_UV));\n}",attributes:{a_Position:a({buffer:u({data:[-4,-4,4,-4,0,4],type:Ri.FLOAT}),size:2,arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float2"}]})},uniforms:{u_Texture:null},depth:{enable:!1},count:3,blend:{enable:!0}});case 4:s=t.sent,e.model=s;case 6:c=n.getResourceNode(r.data.input),f=e.resourcePool.getOrCreateResource(c.resource),e.engine.useFramebuffer(null,(function(){e.engine.clear({framebuffer:null,color:[0,0,0,0],depth:1,stencil:0}),e.model.draw({uniforms:{u_Texture:f}})}));case 9:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),this.tearDown=function(){e.model=void 0}},Pa.IDENTIFIER="Copy Pass",Oa=wr((Ra=Ga).prototype,"engine",[Da],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ma=wr(Ra.prototype,"resourcePool",[Na],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ka=Ra))||ka),Ja=(La=(0,Mr.b2)(),Ua=(0,Mr.f3)(Pr.Systems),Fa=(0,Mr.t6)(Pr.FrameGraphSystem),Ba=(0,Mr.f3)(Pr.RenderPassFactory),za=(0,Mr.f3)(Pr.ConfigService),ja=(0,Mr.f3)(Pr.ResourcePool),La((Ka=function(){function t(){br(this,t),mr(this,"frameGraphSystem",Xa,this),mr(this,"renderPassFactory",Ha,this),mr(this,"configService",qa,this),mr(this,"resourcePool",Ya,this)}var e;return xr(t,[{key:"execute",value:(e=Tr(Sr().mark((function t(e){var n,r,i,o,a,u,s,c;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=this.renderPassFactory(Aa.IDENTIFIER),r=n.setup,i=n.execute,this.frameGraphSystem.addPass(Aa.IDENTIFIER,r,i),o=this.renderPassFactory($a.IDENTIFIER),a=o.setup,u=o.execute,s=o.tearDown,c=this.frameGraphSystem.addPass($a.IDENTIFIER,a,u,s),this.frameGraphSystem.present(c.data.output);case 5:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"tearDown",value:function(){this.resourcePool.clean()}},{key:"pick",value:function(t,e){return this.renderPassFactory(Za.IDENTIFIER).pick(t,e)}}]),t}(),Xa=wr((Va=Ka).prototype,"frameGraphSystem",[Ua,Fa],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ha=wr(Va.prototype,"renderPassFactory",[Ba],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),qa=wr(Va.prototype,"configService",[za],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ya=wr(Va.prototype,"resourcePool",[ja],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Wa=Va))||Wa);var Qa,tu,eu,nu,ru,iu,ou,au,uu,su,cu=function(t){Br(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vr(e);if(n){var i=Vr(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wr(this,t)});function i(t){var e;return br(this,i),(e=r.call(this,t)).parentID=void 0,Object.assign(jr(e),t),e}return i}(Dr),fu=(Qa=(0,Mr.b2)(),tu=(0,Mr.f3)(Pr.HierarchyComponentManager),eu=(0,Mr.f3)(Pr.TransformComponentManager),nu=(0,Mr.f3)(Pr.MeshComponentManager),Qa((su=function(){function t(){br(this,t),mr(this,"hierarchy",ou,this),mr(this,"transform",au,this),mr(this,"mesh",uu,this)}var e;return xr(t,[{key:"execute",value:(e=Tr(Sr().mark((function t(){return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.runTransformUpdateSystem(),this.runHierarchyUpdateSystem();case 2:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"tearDown",value:function(){this.hierarchy.clear(),this.transform.clear()}},{key:"getHierarchyComponentManager",value:function(){return this.hierarchy}},{key:"getTransformComponentManager",value:function(){return this.transform}},{key:"runTransformUpdateSystem",value:function(){var t=this;this.transform.forEach((function(e,n){(n.isDirty()||n.isLocalDirty())&&(t.setMeshAABBDirty(t.mesh.getComponentByEntity(e)),n.updateTransform())}))}},{key:"runHierarchyUpdateSystem",value:function(){var t=this;this.hierarchy.forEach((function(e,n){var r=t.transform.getComponentByEntity(e),i=t.transform.getComponentByEntity(n.parentID);null!==r&&null!==i&&r.updateTransformWithParent(i)}))}},{key:"attach",value:function(t,e,n){this.hierarchy.contains(t)&&this.detach(t),this.hierarchy.create(t,{parentID:e});var r=this.mesh.getComponentByEntity(e);if(this.setMeshAABBDirty(r),r&&-1===r.children.indexOf(t)&&r.children.push(t),this.hierarchy.getCount()>1)for(var i=this.hierarchy.getCount()-1;i>0;--i)for(var o=this.hierarchy.getEntity(i),a=0;a<i;++a)if(this.hierarchy.getComponent(a).parentID===o){this.hierarchy.moveItem(i,a),++i;break}this.hierarchy.getComponentByEntity(t);var u=this.transform.getComponentByEntity(e);null===u&&(u=this.transform.create(e));var s=this.transform.getComponentByEntity(t);null===s&&(s=this.transform.create(t),u=this.transform.getComponentByEntity(e)),s.parent=u,!n&&u&&(s.matrixTransform(Oo(No(),u.worldTransform)),s.updateTransform()),u&&s.updateTransformWithParent(u)}},{key:"detach",value:function(t){var e=this.hierarchy.getComponentByEntity(t);if(null!==e){var n=this.transform.getComponentByEntity(t);null!==n&&(n.parent=null,n.applyTransform()),this.hierarchy.removeKeepSorted(t);var r=this.mesh.getComponentByEntity(e.parentID);if(r){var i=r.children.indexOf(t);r.children.splice(i,1)}this.setMeshAABBDirty(r)}}},{key:"detachChildren",value:function(t){var e=this.mesh.getComponentByEntity(t);e&&(e.children=[]);for(var n=0;n<this.hierarchy.getCount();){var r;if((null===(r=this.hierarchy.getComponent(n))||void 0===r?void 0:r.parentID)===t){var i=this.hierarchy.getEntity(n);this.detach(i)}else++n}}},{key:"setMeshAABBDirty",value:function(t){t&&(t.aabbDirty=!0)}}]),t}(),ou=wr((iu=su).prototype,"hierarchy",[tu],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),au=wr(iu.prototype,"transform",[eu],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),uu=wr(iu.prototype,"mesh",[nu],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ru=iu))||ru);function lu(){var t=new ii(4);return ii!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function hu(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function du(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],u=n[0],s=n[1],c=n[2],f=n[3];return t[0]=r*f+a*u+i*c-o*s,t[1]=i*f+a*s+o*u-r*c,t[2]=o*f+a*c+r*s-i*u,t[3]=a*f-r*u-i*s-o*c,t}function pu(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,u=a?1/a:0;return t[0]=-n*u,t[1]=-r*u,t[2]=-i*u,t[3]=o*u,t}function vu(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var o=Math.sin(e),a=Math.cos(e),u=Math.sin(n),s=Math.cos(n),c=Math.sin(r),f=Math.cos(r);return t[0]=o*s*f-a*u*c,t[1]=a*u*f+o*s*c,t[2]=a*s*c-o*u*f,t[3]=a*s*f+o*u*c,t}var gu=ai,yu=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},mu=du,bu=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t};ci(),hi(1,0,0),hi(0,1,0),lu(),lu(),si();var _u=function(t){Br(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vr(e);if(n){var i=Vr(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wr(this,t)});function i(t){var e,n,o,a,u,s,c,f,l,h,d,p,v,g,y;return br(this,i),(e=r.call(this,t)).dirtyFlag=void 0,e.localDirtyFlag=void 0,e.parent=null,e.localPosition=hi(0,0,0),e.localRotation=gu(0,0,0,1),e.localScale=hi(1,1,1),e.localTransform=No(),e.position=hi(0,0,0),e.rotation=gu(0,0,0,1),e.scaling=hi(1,1,1),e.worldTransform=No(),e.matrixTransform=(n=No(),function(t){Mo(n,e.getLocalTransform(),t),Lo(e.localScale,n),Go(e.localPosition,n),Uo(e.localRotation,n)}),e.rotateRollPitchYaw=(o=lu(),a=lu(),u=lu(),function(t,n,r){e.setDirty(),vu(o,t,0,0),vu(a,0,n,0),vu(u,0,0,r),du(e.localRotation,o,e.localRotation),du(e.localRotation,e.localRotation,a),du(e.localRotation,u,e.localRotation),bu(e.localRotation,e.localRotation)}),e.lerp=(s=ci(),c=lu(),f=ci(),l=ci(),h=lu(),d=ci(),function(t,n,r){e.setDirty(),Lo(s,t.worldTransform),Go(f,t.worldTransform),Uo(c,t.worldTransform),Lo(l,n.worldTransform),Go(d,n.worldTransform),Uo(h,n.worldTransform),_i(e.localScale,s,l,r),function(t,e,n,r){var i,o,a,u,s,c=e[0],f=e[1],l=e[2],h=e[3],d=n[0],p=n[1],v=n[2],g=n[3];(o=c*d+f*p+l*v+h*g)<0&&(o=-o,d=-d,p=-p,v=-v,g=-g),1-o>ri?(i=Math.acos(o),a=Math.sin(i),u=Math.sin((1-r)*i)/a,s=Math.sin(r*i)/a):(u=1-r,s=r),t[0]=u*c+s*d,t[1]=u*f+s*p,t[2]=u*l+s*v,t[3]=u*h+s*g}(e.localRotation,c,h,r),_i(e.localPosition,f,d,r)}),e.translate=(p=ci(),function(t){return vi(p,e.getPosition(),t),e.setPosition(p),e.setDirty(!0),jr(e)}),e.translateLocal=function(t){return n=t,r=t,i=e.localRotation,o=i[0],a=i[1],u=i[2],s=i[3],c=r[0],f=r[1],l=r[2],v=a*(p=o*f-a*c)-u*(d=u*c-o*l),g=u*(h=a*l-u*f)-o*p,y=o*d-a*h,h*=m=2*s,d*=m,p*=m,v*=2,g*=2,y*=2,n[0]=c+h+v,n[1]=f+d+g,n[2]=l+p+y,vi(e.localPosition,e.localPosition,t),e.setLocalDirty(!0),jr(e);var n,r,i,o,a,u,s,c,f,l,h,d,p,v,g,y,m},e.setPosition=(v=No(),function(t){return e.position=t,e.setLocalDirty(!0),null===e.parent?di(e.localPosition,t):(ko(v,e.parent.worldTransform),Oo(v,v),xi(e.localPosition,t,v)),jr(e)}),e.rotate=(g=lu(),function(t){if(null===e.parent)du(e.localRotation,e.localRotation,t),bu(e.localRotation,e.localRotation);else{var n=e.getRotation(),r=e.parent.getRotation();yu(g,r),pu(g,g),du(g,g,t),du(e.localRotation,t,n),bu(e.localRotation,e.localRotation)}return e.setLocalDirty(),jr(e)}),e.rotateLocal=function(t){return du(e.localRotation,e.localRotation,t),bu(e.localRotation,e.localRotation),e.setLocalDirty(!0),jr(e)},e.setRotation=(y=lu(),function(t){return null===e.parent?yu(e.localRotation,t):(yu(y,e.parent.getRotation()),pu(y,y),yu(e.localRotation,y),mu(e.localRotation,e.localRotation,t)),e.setLocalDirty(!0),jr(e)}),e}return xr(i,[{key:"setLocalPosition",value:function(t){di(this.localPosition,t),this.setLocalDirty(!0)}},{key:"setLocalScale",value:function(t){di(this.localScale,t),this.setLocalDirty(!0)}},{key:"setLocalRotation",value:function(t){return yu(this.localRotation,t),this.setLocalDirty(!0),this}},{key:"isDirty",value:function(){return this.dirtyFlag}},{key:"setDirty",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t?this.dirtyFlag|=i.DIRTY:this.dirtyFlag&=~i.DIRTY}},{key:"isLocalDirty",value:function(){return this.localDirtyFlag}},{key:"setLocalDirty",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t?(this.localDirtyFlag|=i.DIRTY,this.setDirty(!0)):this.localDirtyFlag&=~i.DIRTY}},{key:"updateTransform",value:function(){this.isLocalDirty()&&this.getLocalTransform(),this.isDirty()&&null===this.parent&&(ko(this.worldTransform,this.getLocalTransform()),this.setDirty(!1))}},{key:"updateTransformWithParent",value:function(t){Mo(this.worldTransform,t.worldTransform,this.getLocalTransform())}},{key:"applyTransform",value:function(){this.setDirty(),Lo(this.localScale,this.worldTransform),Go(this.localPosition,this.worldTransform),Uo(this.localRotation,this.worldTransform)}},{key:"clearTransform",value:function(){this.setDirty(),this.localPosition=hi(0,0,0),this.localRotation=gu(0,0,0,1),this.localScale=hi(1,1,1)}},{key:"scaleLocal",value:function(t){return this.setLocalDirty(),e=this.localScale,n=this.localScale,r=t,e[0]=n[0]*r[0],e[1]=n[1]*r[1],e[2]=n[2]*r[2],this;var e,n,r}},{key:"getLocalPosition",value:function(){return this.localPosition}},{key:"getLocalRotation",value:function(){return this.localRotation}},{key:"getLocalScale",value:function(){return this.localScale}},{key:"getLocalTransform",value:function(){return this.localDirtyFlag&&(t=this.localTransform,e=this.localRotation,n=this.localPosition,r=this.localScale,i=e[0],o=e[1],a=e[2],u=e[3],l=i*(s=i+i),h=i*(c=o+o),d=i*(f=a+a),p=o*c,v=o*f,g=a*f,y=u*s,m=u*c,b=u*f,_=r[0],x=r[1],w=r[2],t[0]=(1-(p+g))*_,t[1]=(h+b)*_,t[2]=(d-m)*_,t[3]=0,t[4]=(h-b)*x,t[5]=(1-(l+g))*x,t[6]=(v+y)*x,t[7]=0,t[8]=(d+m)*w,t[9]=(v-y)*w,t[10]=(1-(l+p))*w,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,this.setLocalDirty(!1)),this.localTransform;var t,e,n,r,i,o,a,u,s,c,f,l,h,d,p,v,g,y,m,b,_,x,w}},{key:"getWorldTransform",value:function(){return this.isLocalDirty()||this.isDirty()?(this.parent&&this.parent.getWorldTransform(),this.updateTransform(),this.worldTransform):this.worldTransform}},{key:"getPosition",value:function(){return Go(this.position,this.worldTransform),this.position}},{key:"getRotation",value:function(){return Uo(this.rotation,this.worldTransform),this.rotation}},{key:"getScale",value:function(){return Lo(this.scaling,this.worldTransform),this.scaling}}]),i}(Dr);_u.DIRTY=1;var xu,wu,Eu,Su,Au,Tu,Iu=n(1922),Cu=(xu=(0,Mr.b2)(),wu=(0,Mr.f3)(Pr.RenderEngine),xu((Tu=function(){function t(){br(this,t),mr(this,"engine",Au,this),this.resourcePool={}}return xr(t,[{key:"getOrCreateResource",value:function(t){if(!this.resourcePool[t.name]){var e=t.descriptor,n=e.width,r=e.height,i=e.usage;this.resourcePool[t.name]=this.engine.createFramebuffer({color:this.engine.createTexture2D({width:n,height:r,wrapS:Ri.CLAMP_TO_EDGE,wrapT:Ri.CLAMP_TO_EDGE,usage:i})})}return this.resourcePool[t.name]}},{key:"clean",value:function(){this.resourcePool={}}}]),t}(),Au=wr((Su=Tu).prototype,"engine",[wu],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Eu=Su))||Eu);var Du,Nu,ku,Ru,Ou=function(t){Br(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vr(e);if(n){var i=Vr(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wr(this,t)});function i(t){var e;return br(this,i),(e=r.call(this,t)).name=void 0,e.name=t.name||"",e}return i}(Dr),Mu=(0,Mr.b2)()((Nu=function(){function t(){br(this,t),this.config=void 0}return xr(t,[{key:"get",value:function(){return this.config}},{key:"set",value:function(t){this.config=t}}]),t}(),Du=Nu))||Du;!function(t){t.PANSTART="PANSTART",t.PANEND="PANEND",t.PANMOVE="PANMOVE",t.PINCH="PINCH",t.KEYDOWN="KEYDOWN",t.KEYUP="KEYUP",t.HOVER="HOVER"}(Ru||(Ru={}));var Pu,Gu,Lu=(0,Mr.b2)()(ku=function(){function t(){br(this,t)}return xr(t,[{key:"listen",value:function(t){}},{key:"on",value:function(t,e){}},{key:"connect",value:function(){}},{key:"disconnect",value:function(){}},{key:"destroy",value:function(){}}]),t}())||ku,Uu=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\s\S]*?);/g;function Fu(t){var e={};return{content:t=t.replace(Uu,(function(t,n,r){var i=r.split(":"),o=i[0].trim(),a="";switch(i.length>1&&(a=i[1].trim()),n){case"bool":a="true"===a;break;case"float":case"int":a=Number(a);break;case"vec2":case"vec3":case"vec4":case"ivec2":case"ivec3":case"ivec4":case"mat2":case"mat3":case"mat4":a=a?a.replace("[","").replace("]","").split(",").reduce((function(t,e){return t.push(Number(e.trim())),t}),[]):new Array(function(t){var e=0;switch(t){case"vec2":case"ivec2":e=2;break;case"vec3":case"ivec3":e=3;break;case"vec4":case"ivec4":case"mat2":e=4;break;case"mat3":e=9;break;case"mat4":e=16}return e}(n)).fill(0)}return e[o]=a,"uniform ".concat(n," ").concat(o,";\n")})),uniforms:e}}function Bu(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 zu(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Bu(Object(n),!0).forEach((function(e){ni(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Bu(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var ju=/precision\s+(high|low|medium)p\s+float/,Wu=/#pragma include (["^+"]?["\ "[a-zA-Z_0-9](.*)"]*?)/g,Vu=(0,Mr.b2)()((Gu=function(){function t(){br(this,t),this.moduleCache={},this.rawContentCache={}}return xr(t,[{key:"registerBuiltinModules",value:function(){this.destroy(),this.registerModule("picking",{vs:"attribute vec3 a_PickingColor;\nvarying vec4 v_PickingResult;\n\nuniform vec3 u_PickingColor : [0, 0, 0];\nuniform vec4 u_HighlightColor : [0, 0, 0, 0];\nuniform float u_PickingStage : 0.0;\nuniform float u_PickingThreshold : 1.0;\nuniform float u_PickingBuffer: 0.0;\n\n#define PICKING_ENCODE 1.0\n#define PICKING_HIGHLIGHT 2.0\n#define COLOR_SCALE 1. / 255.\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n abs(vertexColor.r - u_PickingColor.r) < u_PickingThreshold &&\n abs(vertexColor.g - u_PickingColor.g) < u_PickingThreshold &&\n abs(vertexColor.b - u_PickingColor.b) < u_PickingThreshold;\n}\n\nvoid setPickingColor(vec3 pickingColor) {\n // compares only in highlight stage\n v_PickingResult.a = float((u_PickingStage == PICKING_HIGHLIGHT) && isVertexPicked(pickingColor));\n\n // Stores the picking color so that the fragment shader can render it during picking\n v_PickingResult.rgb = pickingColor * COLOR_SCALE;\n}\n\nfloat setPickingSize(float x) {\n return u_PickingStage == PICKING_ENCODE ? x + u_PickingBuffer : x;\n}",fs:"varying vec4 v_PickingResult;\nuniform vec4 u_HighlightColor : [0, 0, 0, 0];\nuniform float u_PickingStage : 0.0;\n\n#define PICKING_ENCODE 1.0\n#define PICKING_HIGHLIGHT 2.0\n#define COLOR_SCALE 1. / 255.\n\n/*\n * Returns highlight color if this item is selected.\n */\nvec4 filterHighlightColor(vec4 color) {\n bool selected = bool(v_PickingResult.a);\n\n if (selected) {\n vec4 highLightColor = u_HighlightColor * COLOR_SCALE;\n\n float highLightAlpha = highLightColor.a;\n float highLightRatio = highLightAlpha / (highLightAlpha + color.a * (1.0 - highLightAlpha));\n\n vec3 resultRGB = mix(color.rgb, highLightColor.rgb, highLightRatio);\n return vec4(resultRGB, color.a);\n } else {\n return color;\n }\n}\n\n/*\n * Returns picking color if picking enabled else unmodified argument.\n */\nvec4 filterPickingColor(vec4 color) {\n vec3 pickingColor = v_PickingResult.rgb;\n if (u_PickingStage == PICKING_ENCODE && length(pickingColor) < 0.001) {\n discard;\n }\n return u_PickingStage == PICKING_ENCODE ? vec4(pickingColor, step(0.001,color.a)): color;\n}\n\n/*\n * Returns picking color if picking is enabled if not\n * highlight color if this item is selected, otherwise unmodified argument.\n */\nvec4 filterColor(vec4 color) {\n return filterPickingColor(filterHighlightColor(color));\n}\n"}),this.registerModule("sdf2d",{vs:"",fs:"/**\n * 2D signed distance field functions\n * @see http://www.iquilezles.org/www/articles/distfunctions2d/distfunctions2d.htm\n */\n\nfloat ndot(vec2 a, vec2 b ) { return a.x*b.x - a.y*b.y; }\n\nfloat sdCircle(vec2 p, float r) {\n return length(p) - r;\n}\n\nfloat sdEquilateralTriangle(vec2 p) {\n float k = sqrt(3.0);\n p.x = abs(p.x) - 1.0;\n p.y = p.y + 1.0/k;\n if( p.x + k*p.y > 0.0 ) p = vec2(p.x-k*p.y,-k*p.x-p.y)/2.0;\n p.x -= clamp( p.x, -2.0, 0.0 );\n return -length(p)*sign(p.y);\n}\n\nfloat sdBox(vec2 p, vec2 b) {\n vec2 d = abs(p)-b;\n return length(max(d,vec2(0))) + min(max(d.x,d.y),0.0);\n}\n\nfloat sdPentagon(vec2 p, float r) {\n vec3 k = vec3(0.809016994,0.587785252,0.726542528);\n p.x = abs(p.x);\n p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);\n p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);\n p -= vec2(clamp(p.x,-r*k.z,r*k.z),r);\n return length(p)*sign(p.y);\n}\n\nfloat sdHexagon(vec2 p, float r) {\n vec3 k = vec3(-0.866025404,0.5,0.577350269);\n p = abs(p);\n p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;\n p -= vec2(clamp(p.x, -k.z*r, k.z*r), r);\n return length(p)*sign(p.y);\n}\n\nfloat sdOctogon(vec2 p, float r) {\n vec3 k = vec3(-0.9238795325, 0.3826834323, 0.4142135623 );\n p = abs(p);\n p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);\n p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);\n p -= vec2(clamp(p.x, -k.z*r, k.z*r), r);\n return length(p)*sign(p.y);\n}\n\nfloat sdHexagram(vec2 p, float r) {\n vec4 k=vec4(-0.5,0.8660254038,0.5773502692,1.7320508076);\n p = abs(p);\n p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;\n p -= 2.0*min(dot(k.yx,p),0.0)*k.yx;\n p -= vec2(clamp(p.x,r*k.z,r*k.w),r);\n return length(p)*sign(p.y);\n}\n\nfloat sdRhombus(vec2 p, vec2 b) {\n vec2 q = abs(p);\n float h = clamp((-2.0*ndot(q,b)+ndot(b,b))/dot(b,b),-1.0,1.0);\n float d = length( q - 0.5*b*vec2(1.0-h,1.0+h) );\n return d * sign( q.x*b.y + q.y*b.x - b.x*b.y );\n}\n\nfloat sdVesica(vec2 p, float r, float d) {\n p = abs(p);\n float b = sqrt(r*r-d*d); // can delay this sqrt\n return ((p.y-b)*d>p.x*b)\n ? length(p-vec2(0.0,b))\n : length(p-vec2(-d,0.0))-r;\n}"})}},{key:"registerModule",value:function(t,e){if(!this.rawContentCache[t]){var n=e.vs,r=void 0===n?"":n,i=e.fs,o=void 0===i?"":i,a=e.uniforms,u=Fu(r),s=u.content,c=u.uniforms,f=Fu(o),l=f.content,h=f.uniforms;this.rawContentCache[t]={fs:l,uniforms:zu(zu(zu({},c),h),a),vs:s}}}},{key:"destroy",value:function(){this.moduleCache={},this.rawContentCache={}}},{key:"getModule",value:function(t){var e=this;if(this.moduleCache[t])return this.moduleCache[t];var n,r=this.rawContentCache[t].vs||"",i=this.rawContentCache[t].fs||"",o=this.processModule(r,[],"vs"),a=o.content,u=o.includeList,s=this.processModule(i,[],"fs"),c=s.content,f=s.includeList,l=c,h=(n=u.concat(f).concat(t),n.filter((function(t,e,n){return n.indexOf(t)===e}))).reduce((function(t,n){return zu(zu({},t),e.rawContentCache[n].uniforms)}),{});return ju.test(c)||(l="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n #else\n precision mediump float;\n#endif\n"+c),this.moduleCache[t]={fs:l.trim(),uniforms:h,vs:a.trim()},this.moduleCache[t]}},{key:"processModule",value:function(t,e,n){var r=this;return{content:t.replace(Wu,(function(t,i){var o=i.split(" ")[0].replace(/"/g,"");if(e.indexOf(o)>-1)return"";var a=r.rawContentCache[o][n];return e.push(o),r.processModule(a||"",e,n).content})),includeList:e}}}]),t}(),Pu=Gu))||Pu,Xu=new Mr.W2;function Hu(){var t=new Mr.W2;return t.parent=Xu,t.bind(Pr.Systems).to(fu).inSingletonScope().whenTargetNamed(Pr.SceneGraphSystem),t.bind(Pr.Systems).to(ei).inSingletonScope().whenTargetNamed(Pr.FrameGraphSystem),t.bind(Pr.Systems).to(Do).inSingletonScope().whenTargetNamed(Pr.MeshSystem),t.bind(Pr.Systems).to(ji).inSingletonScope().whenTargetNamed(Pr.GeometrySystem),t.bind(Pr.Systems).to(oo).inSingletonScope().whenTargetNamed(Pr.MaterialSystem),t.bind(Pr.Systems).to(Ja).inSingletonScope().whenTargetNamed(Pr.RendererSystem),t.bind(Pr.ResourcePool).to(Cu).inSingletonScope(),t.bind(Pr.ConfigService).to(Mu).inSingletonScope(),t.bind(Pr.InteractorService).to(Lu).inSingletonScope(),t.bind(Pr.RenderPass).to(Aa).inSingletonScope().whenTargetNamed(Aa.IDENTIFIER),t.bind(Pr.RenderPass).to($a).inSingletonScope().whenTargetNamed($a.IDENTIFIER),t.bind(Pr.RenderPass).to(Za).inSingletonScope().whenTargetNamed(Za.IDENTIFIER),t.bind(Pr.RenderPassFactory).toFactory((function(t){return function(e){return t.container.getNamed(Pr.RenderPass,e)}})),t}function qu(t){for(var e=new uo,n=hi(t[0],t[1],t[2]),r=hi(t[0],t[1],t[2]),i=3;i<t.length;){var o=t[i++],a=t[i++],u=t[i++];o<n[0]&&(n[0]=o),a<n[1]&&(n[1]=a),u<n[2]&&(n[2]=u),o>r[0]&&(r[0]=o),a>r[1]&&(r[1]=a),u>r[2]&&(r[2]=u)}return e.setMinMax(n,r),e}(0,Iu.Z)(Xu,!1),Xu.bind(Pr.ShaderModuleService).to(Vu).inSingletonScope(),Xu.bind(Pr.NameComponentManager).toConstantValue(new Nr(Ou)),Xu.bind(Pr.HierarchyComponentManager).toConstantValue(new Nr(cu)),Xu.bind(Pr.TransformComponentManager).toConstantValue(new Nr(_u)),Xu.bind(Pr.MeshComponentManager).toConstantValue(new Nr(co)),Xu.bind(Pr.CullableComponentManager).toConstantValue(new Nr(ao)),Xu.bind(Pr.GeometryComponentManager).toConstantValue(new Nr(zi)),Xu.bind(Pr.MaterialComponentManager).toConstantValue(new Nr(eo));var Yu,Ku,Zu,$u,Ju,Qu="undefined"!=typeof navigator&&/Version\/[\d\.]+.*Safari/.test(navigator.userAgent);function ts(t){return"number"==typeof t}function es(t){return void 0===t?0:t>360||t<-360?t%360:t}function ns(t,e,n){return ts(t)?hi(t,e,n):3===t.length?fi(t):hi(t[0],t[1],t[2])}ci(),ci(),ci(),ci(),ci(),ci(),n(2697),n(1894),n(1186),n(5275),n(2862),n(9633),function(t){t.Normal="normal",t.PostProcessing="post-processing"}(Yu||(Yu={})),n(7222),n(5965),n(2391),n(3945),n(7294),n(9586),function(t){t.Void="Void",t.Boolean="Boolean",t.Float="Float",t.Uint32="Uint32",t.Int32="Int32",t.Vector="Vector",t.Vector2Float="vec2<f32>",t.Vector3Float="vec3<f32>",t.Vector4Float="vec4<f32>",t.Vector2Boolean="vec2<bool>",t.Vector3Boolean="vec3<bool>",t.Vector4Boolean="vec4<bool>",t.Vector2Uint="vec2<u32>",t.Vector3Uint="vec3<u32>",t.Vector4Uint="vec4<u32>",t.Vector2Int="vec2<i32>",t.Vector3Int="vec3<i32>",t.Vector4Int="vec4<i32>",t.Matrix="Matrix",t.Matrix3x3Float="mat3x3<f32>",t.Matrix4x4Float="mat4x4<i32>",t.Struct="Struct",t.FloatArray="Float[]",t.Vector4FloatArray="vec4<f32>[]"}(Ku||(Ku={})),function(t){t.Program="Program",t.Identifier="Identifier",t.VariableDeclaration="VariableDeclaration",t.BlockStatement="BlockStatement",t.ReturnStatement="ReturnStatement",t.FunctionDeclaration="FunctionDeclaration",t.VariableDeclarator="VariableDeclarator",t.AssignmentExpression="AssignmentExpression",t.LogicalExpression="LogicalExpression",t.BinaryExpression="BinaryExpression",t.ArrayExpression="ArrayExpression",t.UnaryExpression="UnaryExpression",t.UpdateExpression="UpdateExpression",t.FunctionExpression="FunctionExpression",t.MemberExpression="MemberExpression",t.ConditionalExpression="ConditionalExpression",t.ExpressionStatement="ExpressionStatement",t.CallExpression="CallExpression",t.NumThreadStatement="NumThreadStatement",t.StorageStatement="StorageStatement",t.DoWhileStatement="DoWhileStatement",t.WhileStatement="WhileStatement",t.ForStatement="ForStatement",t.BreakStatement="BreakStatement",t.ContinueStatement="ContinueStatement",t.IfStatement="IfStatement",t.ImportedFunctionStatement="ImportedFunctionStatement"}(Zu||(Zu={})),function(t){t.Input="Input",t.Output="Output",t.Uniform="Uniform",t.Workgroup="Workgroup",t.UniformConstant="UniformConstant",t.Image="Image",t.StorageBuffer="StorageBuffer",t.Private="Private",t.Function="Function"}($u||($u={})),function(t){t.GLSL100="GLSL100",t.GLSL450="GLSL450",t.WGSL="WGSL"}(Ju||(Ju={}));var rs,is,os,as,us,ss,cs,fs,ls,hs,ds=function(){function t(e,n){var r,i;br(this,t),this.name=void 0,this.matrix=void 0,this.right=void 0,this.up=void 0,this.forward=void 0,this.position=void 0,this.focalPoint=void 0,this.distanceVector=void 0,this.distance=void 0,this.dollyingStep=void 0,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.name=e,this.matrix=(r=n.matrix,(i=new ii(16))[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],i[4]=r[4],i[5]=r[5],i[6]=r[6],i[7]=r[7],i[8]=r[8],i[9]=r[9],i[10]=r[10],i[11]=r[11],i[12]=r[12],i[13]=r[13],i[14]=r[14],i[15]=r[15],i),this.right=fi(n.right),this.up=fi(n.up),this.forward=fi(n.forward),this.position=fi(n.position),this.focalPoint=fi(n.focalPoint),this.distanceVector=fi(n.distanceVector),this.azimuth=n.azimuth,this.elevation=n.elevation,this.roll=n.roll,this.relAzimuth=n.relAzimuth,this.relElevation=n.relElevation,this.relRoll=n.relRoll,this.dollyingStep=n.dollyingStep,this.distance=n.distance}return xr(t,[{key:"getPosition",value:function(){return this.position}},{key:"getFocalPoint",value:function(){return this.focalPoint}},{key:"getRoll",value:function(){return this.roll}},{key:"retrieve",value:function(t){t.matrix=ko(t.matrix,this.matrix),t.right=di(t.right,this.right),t.up=di(t.up,this.up),t.forward=di(t.forward,this.forward),t.position=di(t.position,this.position),t.focalPoint=di(t.focalPoint,this.focalPoint),t.distanceVector=di(t.distanceVector,this.distanceVector),t.azimuth=this.azimuth,t.elevation=this.elevation,t.roll=this.roll,t.relAzimuth=this.relAzimuth,t.relElevation=this.relElevation,t.relRoll=this.relRoll,t.dollyingStep=this.dollyingStep,t.distance=this.distance}}]),t}();!function(t){t.ORBITING="ORBITING",t.EXPLORING="EXPLORING",t.TRACKING="TRACKING"}(fs||(fs={})),function(t){t.DEFAULT="DEFAULT",t.ROTATIONAL="ROTATIONAL",t.TRANSLATIONAL="TRANSLATIONAL",t.CINEMATIC="CINEMATIC"}(ls||(ls={})),function(t){t.ORTHOGRAPHIC="ORTHOGRAPHIC",t.PERSPECTIVE="PERSPECTIVE"}(hs||(hs={}));var ps,vs,gs,ys,ms,bs,_s,xs=Math.PI/180,ws=180/Math.PI,Es=(rs=(0,Mr.b2)(),is=(0,Mr.f3)(Pr.InteractorService),rs((cs=ss=function(){function t(){br(this,t),this.matrix=No(),this.right=hi(1,0,0),this.up=hi(0,1,0),this.forward=hi(0,0,1),this.position=hi(0,0,1),this.focalPoint=hi(0,0,0),this.distanceVector=hi(0,0,0),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.rotateWorld=!1,mr(this,"interactor",us,this),this.fov=30,this.near=.1,this.far=1e4,this.aspect=1,this.left=void 0,this.rright=void 0,this.top=void 0,this.bottom=void 0,this.zoom=1,this.perspective=No(),this.view=void 0,this.following=void 0,this.type=fs.EXPLORING,this.trackingMode=ls.DEFAULT,this.projectionMode=hs.PERSPECTIVE,this.frustum=new To,this.landmarks=[],this.landmarkAnimationID=void 0}return xr(t,[{key:"clone",value:function(){var e=new t;return e.setType(this.type,void 0),e.interactor=this.interactor,e}},{key:"getProjectionMode",value:function(){return this.projectionMode}},{key:"getPerspective",value:function(){return this.perspective}},{key:"getFrustum",value:function(){return this.frustum}},{key:"getPosition",value:function(){return this.position}},{key:"setType",value:function(t,e){return this.type=t,this.type===fs.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===fs.TRACKING&&void 0!==e&&this.setTrackingMode(e),this}},{key:"setProjectionMode",value:function(t){return this.projectionMode=t,this}},{key:"setTrackingMode",value:function(t){if(this.type!==fs.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this}},{key:"setWorldRotation",value:function(t){this.rotateWorld=t,this._getAngles()}},{key:"getViewTransform",value:function(){return Oo(No(),this.matrix)}},{key:"getWorldTransform",value:function(){return this.matrix}},{key:"setMatrix",value:function(t){return this.matrix=t,this._update(),this}},{key:"setAspect",value:function(t){return this.setPerspective(this.near,this.far,this.fov,t),this}},{key:"setViewOffset",value:function(t,e,n,r,i,o){return this.aspect=t/e,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.projectionMode===hs.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"clearViewOffset",value:function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===hs.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"setPerspective",value:function(t,e,n,r){return this.projectionMode=hs.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r,function(t,e,n,r,i){var o,a=1/Math.tan(e/2);t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(r-i),t[10]=(i+r)*o,t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r)}(this.perspective,this.fov*xs,this.aspect,this.near,this.far),this}},{key:"setOrthographic",value:function(t,e,n,r,i,o){this.projectionMode=hs.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=r,this.near=i,this.far=o;var a=(this.rright-this.left)/(2*this.zoom),u=(this.top-this.bottom)/(2*this.zoom),s=(this.rright+this.left)/2,c=(this.top+this.bottom)/2,f=s-a,l=s+a,h=c+u,d=c-u;if(void 0!==this.view&&this.view.enabled){var p=(this.rright-this.left)/this.view.fullWidth/this.zoom,v=(this.top-this.bottom)/this.view.fullHeight/this.zoom;l=(f+=p*this.view.offsetX)+p*this.view.width,d=(h-=v*this.view.offsetY)-v*this.view.height}return function(t,e,n,r,i,o,a){var u=1/(e-n),s=1/(r-i),c=1/(o-a);t[0]=-2*u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*u,t[13]=(i+r)*s,t[14]=(a+o)*c,t[15]=1}(this.perspective,f,l,h,d,i,o),this}},{key:"setPosition",value:function(t,e,n){return this._setPosition(t,e,n),this.setFocalPoint(this.focalPoint),this}},{key:"setFocalPoint",value:function(t,e,n){var r,i,o,a,u,s,c,f,l,h,d,p,v,g=hi(0,1,0);if(this.focalPoint=ns(t,e,n),this.trackingMode===ls.CINEMATIC){var y=gi(ci(),this.focalPoint,this.position);t=y[0],e=y[1],n=y[2];var m=li(y),b=Math.asin(e/m)*ws,_=90+Math.atan2(n,t)*ws,x=No();r=x,i=x,o=_*xs,a=Math.sin(o),u=Math.cos(o),s=i[0],c=i[1],f=i[2],l=i[3],h=i[8],d=i[9],p=i[10],v=i[11],i!==r&&(r[4]=i[4],r[5]=i[5],r[6]=i[6],r[7]=i[7],r[12]=i[12],r[13]=i[13],r[14]=i[14],r[15]=i[15]),r[0]=s*u-h*a,r[1]=c*u-d*a,r[2]=f*u-p*a,r[3]=l*u-v*a,r[8]=s*a+h*u,r[9]=c*a+d*u,r[10]=f*a+p*u,r[11]=l*a+v*u,function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],u=e[6],s=e[7],c=e[8],f=e[9],l=e[10],h=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+c*r,t[5]=a*i+f*r,t[6]=u*i+l*r,t[7]=s*i+h*r,t[8]=c*i-o*r,t[9]=f*i-a*r,t[10]=l*i-u*r,t[11]=h*i-s*r}(x,x,b*xs),g=xi(ci(),[0,1,0],x)}return Oo(this.matrix,function(t,e,n,r){var i,o,a,u,s,c,f,l,h,d,p=e[0],v=e[1],g=e[2],y=r[0],m=r[1],b=r[2],_=n[0],x=n[1],w=n[2];return Math.abs(p-_)<ri&&Math.abs(v-x)<ri&&Math.abs(g-w)<ri?Ro(t):(f=p-_,l=v-x,h=g-w,i=m*(h*=d=1/Math.hypot(f,l,h))-b*(l*=d),o=b*(f*=d)-y*h,a=y*l-m*f,(d=Math.hypot(i,o,a))?(i*=d=1/d,o*=d,a*=d):(i=0,o=0,a=0),u=l*a-h*o,s=h*i-f*a,c=f*o-l*i,(d=Math.hypot(u,s,c))?(u*=d=1/d,s*=d,c*=d):(u=0,s=0,c=0),t[0]=i,t[1]=u,t[2]=f,t[3]=0,t[4]=o,t[5]=s,t[6]=l,t[7]=0,t[8]=a,t[9]=c,t[10]=h,t[11]=0,t[12]=-(i*p+o*v+a*g),t[13]=-(u*p+s*v+c*g),t[14]=-(f*p+l*v+h*g),t[15]=1,t)}(No(),this.position,this.focalPoint,g)),this._getAxes(),this._getDistance(),this._getAngles(),this}},{key:"setDistance",value:function(t){if(!(this.distance===t||t<0)){this.distance=t,this.distance<2e-4&&(this.distance=2e-4),this.dollyingStep=this.distance/100;var e=ci();t=this.distance;var n=this.forward,r=this.focalPoint;return e[0]=t*n[0]+r[0],e[1]=t*n[1]+r[1],e[2]=t*n[2]+r[2],this._setPosition(e),this}}},{key:"setMaxDistance",value:function(t){return this.maxDistance=t,this}},{key:"setMinDistance",value:function(t){return this.minDistance=t,this}},{key:"changeAzimuth",value:function(t){return this.setAzimuth(this.azimuth+t),this}},{key:"changeElevation",value:function(t){return this.setElevation(this.elevation+t),this}},{key:"changeRoll",value:function(t){return this.setRoll(this.roll+t),this}},{key:"setAzimuth",value:function(t){return this.azimuth=es(t),this.computeMatrix(),this._getAxes(),this.type===fs.ORBITING||this.type===fs.EXPLORING?this._getPosition():this.type===fs.TRACKING&&this._getFocalPoint(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(t){return this.elevation=es(t),this.computeMatrix(),this._getAxes(),this.type===fs.ORBITING||this.type===fs.EXPLORING?this._getPosition():this.type===fs.TRACKING&&this._getFocalPoint(),this}},{key:"setRoll",value:function(t){return this.roll=es(t),this.computeMatrix(),this._getAxes(),this.type===fs.ORBITING||this.type===fs.EXPLORING?this._getPosition():this.type===fs.TRACKING&&this._getFocalPoint(),this}},{key:"rotate",value:function(t,e,n){if(this.type===fs.EXPLORING){t=es(t),e=es(e),n=es(n);var r=hu(lu(),[1,0,0],(this.rotateWorld?1:-1)*e*xs),i=hu(lu(),[0,1,0],(this.rotateWorld?1:-1)*t*xs),o=hu(lu(),[0,0,1],n*xs),a=du(lu(),i,r);a=du(lu(),a,o);var u=Fo(No(),a);Po(this.matrix,this.matrix,[0,0,-this.distance]),Mo(this.matrix,this.matrix,u),Po(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation+e)>90)return;this.relElevation=es(e),this.relAzimuth=es(t),this.relRoll=es(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.computeMatrix()}return this._getAxes(),this.type===fs.ORBITING||this.type===fs.EXPLORING?this._getPosition():this.type===fs.TRACKING&&this._getFocalPoint(),this._update(),this}},{key:"pan",value:function(t,e){var n=ns(t,e,0),r=fi(this.position);return vi(r,r,yi(ci(),this.right,n[0])),vi(r,r,yi(ci(),this.up,n[1])),this._setPosition(r),this}},{key:"dolly",value:function(t){var e=this.forward,n=fi(this.position),r=this.dollyingStep,i=this.distance+t*this.dollyingStep;return r=Math.max(Math.min(i,this.maxDistance),this.minDistance)-this.distance,n[0]+=r*e[0],n[1]+=r*e[1],n[2]+=r*e[2],this._setPosition(n),this.type===fs.ORBITING||this.type===fs.EXPLORING?this._getDistance():this.type===fs.TRACKING&&vi(this.focalPoint,n,this.distanceVector),this}},{key:"createLandmark",value:function(t,e){var n=this.clone();n.setPosition(e.position),n.setFocalPoint(e.focalPoint),void 0!==e.roll&&n.setRoll(e.roll);var r=new ds(t,n);return this.landmarks.push(r),r}},{key:"setLandmark",value:function(t){var e=new ds(t,this);return this.landmarks.push(e),this}},{key:"gotoLandmark",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3,r=this.landmarks.find((function(e){return e.name===t}));if(r){if(0===n)return void r.retrieve(this);void 0!==this.landmarkAnimationID&&window.cancelAnimationFrame(this.landmarkAnimationID),this.interactor.disconnect();var i,o=r.getPosition(),a=r.getFocalPoint(),u=r.getRoll(),s=function t(r){void 0===i&&(i=r);var s,c=r-i,f=(1-Math.cos(c/n*Math.PI))/2,l=ci(),h=ci();if(_i(l,e.focalPoint,a,f),_i(h,e.position,o,f),s=e.roll*(1-f)+u*f,e.setFocalPoint(l),e.setPosition(h),e.setRoll(s),e.computeMatrix(),!(Si(l,a)+Si(h,o)>.01))return e.setFocalPoint(l),e.setPosition(h),e.setRoll(s),e.computeMatrix(),void e.interactor.connect();c<n&&(e.landmarkAnimationID=window.requestAnimationFrame(t))};window.requestAnimationFrame(s)}}},{key:"_update",value:function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles()}},{key:"computeMatrix",value:function(){var t,e,n=hu(lu(),[0,0,1],this.roll*xs);Ro(this.matrix),t=hu(lu(),[1,0,0],(this.rotateWorld&&this.type!==fs.TRACKING||this.type===fs.TRACKING?1:-1)*this.elevation*xs),e=hu(lu(),[0,1,0],(this.rotateWorld&&this.type!==fs.TRACKING||this.type===fs.TRACKING?1:-1)*this.azimuth*xs);var r=du(lu(),e,t);r=du(lu(),r,n);var i=Fo(No(),r);this.type===fs.ORBITING||this.type===fs.EXPLORING?(Po(this.matrix,this.matrix,this.focalPoint),Mo(this.matrix,this.matrix,i),Po(this.matrix,this.matrix,[0,0,this.distance])):this.type===fs.TRACKING&&(Po(this.matrix,this.matrix,this.position),Mo(this.matrix,this.matrix,i))}},{key:"_setPosition",value:function(t,e,n){this.position=ns(t,e,n);var r=this.matrix;r[12]=this.position[0],r[13]=this.position[1],r[14]=this.position[2],r[15]=1}},{key:"_getAxes",value:function(){di(this.right,ns(ui(oi(),[1,0,0,0],this.matrix))),di(this.up,ns(ui(oi(),[0,1,0,0],this.matrix))),di(this.forward,ns(ui(oi(),[0,0,1,0],this.matrix))),mi(this.right,this.right),mi(this.up,this.up),mi(this.forward,this.forward)}},{key:"_getAngles",value:function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=li(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===fs.TRACKING||this.rotateWorld?(this.elevation=Math.asin(e/r)*ws,this.azimuth=Math.atan2(-t,-n)*ws):(this.elevation=-Math.asin(e/r)*ws,this.azimuth=-Math.atan2(-t,-n)*ws)}},{key:"_getPosition",value:function(){di(this.position,ns(ui(oi(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){var t,e;wi(this.distanceVector,[0,0,-this.distance],(t=si(),e=this.matrix,t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t)),vi(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=gi(ci(),this.focalPoint,this.position),this.distance=li(this.distanceVector),this.dollyingStep=this.distance/100}}]),t}(),ss.ProjectionMode={ORTHOGRAPHIC:"ORTHOGRAPHIC",PERSPECTIVE:"PERSPECTIVE"},us=wr((as=cs).prototype,"interactor",[is],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),os=as))||os),Ss=(ps=(0,Mr.b2)(),vs=(0,Mr.f3)(Pr.GeometryComponentManager),ps((_s=bs=function(){function t(){br(this,t),this.config=void 0,mr(this,"geometry",ms,this),this.entity=void 0,this.component=void 0}return xr(t,[{key:"getEntity",value:function(){return this.entity}},{key:"getComponent",value:function(){return this.component}},{key:"setConfig",value:function(t){this.config=t}},{key:"setEntity",value:function(t){this.entity=t,this.component=this.geometry.create(t),this.component.entity=t,this.onEntityCreated()}},{key:"onEntityCreated",value:function(){}}]),t}(),bs.BOX="box",bs.SPHERE="sphere",bs.PLANE="plane",bs.MERGED="merged",ms=wr((ys=_s).prototype,"geometry",[vs],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),gs=ys))||gs),As=n(8344);function Ts(){if("undefined"!=typeof document)return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}var Is={}.toString;var Cs={};Cs["[object Float32Array]"]=Cs["[object Float64Array]"]=Cs["[object Int8Array]"]=Cs["[object Int16Array]"]=Cs["[object Int32Array]"]=Cs["[object Uint8Array]"]=Cs["[object Uint8ClampedArray]"]=Cs["[object Uint16Array]"]=Cs["[object Uint32Array]"]=!0,Cs["[object Arguments]"]=Cs["[object Array]"]=Cs["[object ArrayBuffer]"]=Cs["[object Boolean]"]=Cs["[object DataView]"]=Cs["[object Date]"]=Cs["[object Error]"]=Cs["[object Function]"]=Cs["[object Map]"]=Cs["[object Number]"]=Cs["[object Object]"]=Cs["[object RegExp]"]=Cs["[object Set]"]=Cs["[object String]"]=Cs["[object WeakMap]"]=!1;var Ds,Ns,ks,Rs,Os,Ms,Ps,Gs,Ls=Object.prototype.toString,Us=function(t){return function(t){return!!t&&"object"===zr(t)}(t)&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}(t.length)&&!!Cs[Ls.call(t)]};function Fs(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 Bs(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Fs(Object(n),!0).forEach((function(e){ni(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Fs(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var zs,js,Ws,Vs,Xs,Hs,qs,Ys,Ks,Zs,$s,Js,Qs,tc,ec,nc,rc,ic,oc,ac,uc,sc,cc,fc,lc,hc,dc,pc,vc,gc,yc,mc,bc,_c,xc,wc=(Ds=(0,Mr.b2)(),Ns=(0,Mr.f3)(Pr.RenderEngine),ks=(0,Mr.f3)(Pr.ConfigService),Ds((Gs=function(){function t(){br(this,t),mr(this,"engine",Ms,this),mr(this,"configService",Ps,this),this.entity=Cr(),this.model=void 0,this.dirty=!0,this.compiledBundle=void 0,this.initPromise=void 0}var e,n,r;return xr(t,[{key:"init",value:function(){var t=this.configService.get(),e=t.canvas,n=t.engineOptions;this.initPromise=this.engine.init(Bs({canvas:e||Ts(),swapChainFormat:As.EV.BGRA8Unorm,antialiasing:!1},n))}},{key:"setBundle",value:function(t){this.compiledBundle=JSON.parse(JSON.stringify(t))}},{key:"setDispatch",value:function(t){return this.compiledBundle.context&&(this.compiledBundle.context.dispatch=t),this}},{key:"setMaxIteration",value:function(t){return this.compiledBundle.context&&(this.compiledBundle.context.maxIteration=t),this}},{key:"setBinding",value:function(t,e){var n,r=this;if("string"==typeof t){var i=ts(e)||Us(e)||(n=e,Array.isArray?Array.isArray(n):function(t,e){return Is.call(t)==="[object "+e+"]"}(n,"Array"));if(this.compiledBundle&&this.compiledBundle.context){var o=this.compiledBundle.context.defines.find((function(e){return e.name===t}));if(o)return o.value=e,this;var a=this.compiledBundle.context.uniforms.find((function(e){return e.name===t}));a&&(i?(a.data=e,a.isReferer=!1,a.storageClass===$u.Uniform?this.model&&this.model.updateUniform(t,e):this.model&&this.model.updateBuffer(t,e)):(a.isReferer=!0,a.data=e))}}else Object.keys(t).forEach((function(e){r.setBinding(e,t[e])}));return this}},{key:"execute",value:(r=Tr(Sr().mark((function t(){var e,n,r=this,i=arguments;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=i.length>0&&void 0!==i[0]?i[0]:1,!this.dirty){t.next=6;break}return this.compiledBundle.context&&(e>1?this.compiledBundle.context.maxIteration=e:this.compiledBundle.context.maxIteration++),t.next=5,this.compile();case 5:this.dirty=!1;case 6:for(this.engine.beginFrame(),this.engine.clear({}),this.compiledBundle.context&&this.compiledBundle.context.uniforms.filter((function(t){return t.isReferer})).forEach((function(t){var e=t.data,n=t.name;r.model.confirmInput(e.model,n)})),n=0;n<e;n++)this.model.run();return this.engine.endFrame(),t.abrupt("return",this);case 12:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"getOutput",value:(n=Tr(Sr().mark((function t(){return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.model.readData());case 1:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"compile",value:(e=Tr(Sr().mark((function t(){var e,n,r;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.initPromise;case 2:return e=Bs({},this.compiledBundle.context),n=this.engine.supportWebGPU?this.engine.useWGSL?Ju.WGSL:Ju.GLSL450:Ju.GLSL100,r=this.compiledBundle.shaders[n],e.defines.filter((function(t){return t.runtime})).forEach((function(t){var e="".concat("__DefineValuePlaceholder__").concat(t.name);r=r.replace(e,"".concat(t.value))})),e.shader=r,e.uniforms.forEach((function(t){if(!t.data&&t.storageClass===$u.StorageBuffer){var n=1;t.type===Ku.FloatArray?n=1:t.type===Ku.Vector4FloatArray&&(n=4),t.data=new Float32Array(e.output.length*n).fill(0)}})),this.compiledBundle.context=e,t.next=11,this.engine.createComputeModel(this.compiledBundle.context);case 11:this.model=t.sent;case 12:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}]),t}(),Ms=wr((Os=Gs).prototype,"engine",[Ns],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ps=wr(Os.prototype,"configService",[ks],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Rs=Os))||Rs),Ec=(zs=(0,Mr.b2)(),js=(0,Mr.f3)(Pr.MaterialComponentManager),zs((qs=Hs=function(){function t(){br(this,t),this.config=void 0,mr(this,"material",Xs,this),this.entity=void 0,this.component=void 0}return xr(t,[{key:"getEntity",value:function(){return this.entity}},{key:"getComponent",value:function(){return this.component}},{key:"setConfig",value:function(t){this.config=t}},{key:"setEntity",value:function(t,e){this.entity=t,this.component=this.material.create(t),this.component.entity=t,this.component.type=e,this.onEntityCreated()}},{key:"onEntityCreated",value:function(){}}]),t}(),Hs.BASIC="basic",Xs=wr((Vs=qs).prototype,"material",[js],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ws=Vs))||Ws),Sc=(Ys=(0,Mr.b2)(),Ks=(0,Mr.f3)(Pr.MeshComponentManager),Zs=(0,Mr.f3)(Pr.CullableComponentManager),$s=(0,Mr.f3)(Pr.TransformComponentManager),Js=(0,Mr.f3)(Pr.Systems),Qs=(0,Mr.t6)(Pr.SceneGraphSystem),Ys((uc=ac=function(){function t(){br(this,t),this.attributes={},this.config=void 0,mr(this,"mesh",nc,this),mr(this,"cullable",rc,this),mr(this,"transform",ic,this),mr(this,"sceneGraphSystem",oc,this),this.meshComponent=void 0,this.transformComponent=void 0,this.entity=void 0}return xr(t,[{key:"getEntity",value:function(){return this.entity}},{key:"getTransformComponent",value:function(){return this.transformComponent}},{key:"getMeshComponent",value:function(){return this.meshComponent}},{key:"setConfig",value:function(t){this.config=t}},{key:"setEntity",value:function(t){this.entity=t,this.cullable.create(t),this.meshComponent=this.mesh.create(t),this.transformComponent=this.transform.create(t),this.onEntityCreated()}},{key:"setMaterial",value:function(t){return this.meshComponent.material=t,this}},{key:"setGeometry",value:function(t){return this.meshComponent.geometry=t,this}},{key:"setAttributes",value:function(t){var e=this;Object.keys(t).forEach((function(n){void 0!==t[n]&&t[n]!==e.attributes[n]&&(e.onAttributeChanged({name:n,data:t[n]}),e.attributes[n]=t[n])}))}},{key:"setVisible",value:function(t){var e=this;return this.meshComponent.visible=t,this.meshComponent.children.forEach((function(n){var r=e.mesh.getComponentByEntity(n);r&&(r.visible=t)})),this}},{key:"isVisible",value:function(){return this.meshComponent.visible}},{key:"attach",value:function(t){return this.sceneGraphSystem.attach(this.entity,t.entity),this}},{key:"detach",value:function(){return this.sceneGraphSystem.detach(this.entity),this}},{key:"detachChildren",value:function(){return this.sceneGraphSystem.detachChildren(this.entity),this}},{key:"onEntityCreated",value:function(){}},{key:"onAttributeChanged",value:function(t){var e=t.name,n=t.data;this.meshComponent&&this.meshComponent.material&&this.meshComponent.material.setUniform(this.convertAttributeName2UniformName(e),n)}},{key:"convertAttributeName2UniformName",value:function(t){return t}}]),t}(),ac.POINT="point",ac.LINE="line",ac.GRID="grid",nc=wr((ec=uc).prototype,"mesh",[Ks],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),rc=wr(ec.prototype,"cullable",[Zs],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ic=wr(ec.prototype,"transform",[$s],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),oc=wr(ec.prototype,"sceneGraphSystem",[Js,Qs],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),tc=ec))||tc),Ac=n(6377),Tc=n.n(Ac),Ic=function(){function t(e,n){br(this,t),this.attribute=void 0,this.buffer=void 0;var r=n.buffer,i=n.offset,o=n.stride,a=n.normalized,u=n.size,s=n.divisor;this.buffer=r,this.attribute={buffer:r.get(),offset:i||0,stride:o||0,normalized:a||!1,divisor:s||0},u&&(this.attribute.size=u)}return xr(t,[{key:"get",value:function(){return this.attribute}},{key:"updateBuffer",value:function(t){this.buffer.subData(t)}},{key:"destroy",value:function(){this.buffer.destroy()}}]),t}(),Cc=(ni(sc={},Ri.POINTS,"points"),ni(sc,Ri.LINES,"lines"),ni(sc,Ri.LINE_LOOP,"line loop"),ni(sc,Ri.LINE_STRIP,"line strip"),ni(sc,Ri.TRIANGLES,"triangles"),ni(sc,Ri.TRIANGLE_FAN,"triangle fan"),ni(sc,Ri.TRIANGLE_STRIP,"triangle strip"),sc),Dc=(ni(cc={},Ri.STATIC_DRAW,"static"),ni(cc,Ri.DYNAMIC_DRAW,"dynamic"),ni(cc,Ri.STREAM_DRAW,"stream"),cc),Nc=(ni(fc={},Ri.BYTE,"int8"),ni(fc,Ri.UNSIGNED_INT,"int16"),ni(fc,Ri.INT,"int32"),ni(fc,Ri.UNSIGNED_BYTE,"uint8"),ni(fc,Ri.UNSIGNED_SHORT,"uint16"),ni(fc,Ri.UNSIGNED_INT,"uint32"),ni(fc,Ri.FLOAT,"float"),fc),kc=(ni(lc={},Ri.ALPHA,"alpha"),ni(lc,Ri.LUMINANCE,"luminance"),ni(lc,Ri.LUMINANCE_ALPHA,"luminance alpha"),ni(lc,Ri.RGB,"rgb"),ni(lc,Ri.RGBA,"rgba"),ni(lc,Ri.RGBA4,"rgba4"),ni(lc,Ri.RGB5_A1,"rgb5 a1"),ni(lc,Ri.RGB565,"rgb565"),ni(lc,Ri.DEPTH_COMPONENT,"depth"),ni(lc,Ri.DEPTH_STENCIL,"depth stencil"),lc),Rc=(ni(hc={},Ri.DONT_CARE,"dont care"),ni(hc,Ri.NICEST,"nice"),ni(hc,Ri.FASTEST,"fast"),hc),Oc=(ni(dc={},Ri.NEAREST,"nearest"),ni(dc,Ri.LINEAR,"linear"),ni(dc,Ri.LINEAR_MIPMAP_LINEAR,"mipmap"),ni(dc,Ri.NEAREST_MIPMAP_LINEAR,"nearest mipmap linear"),ni(dc,Ri.LINEAR_MIPMAP_NEAREST,"linear mipmap nearest"),ni(dc,Ri.NEAREST_MIPMAP_NEAREST,"nearest mipmap nearest"),dc),Mc=(ni(pc={},Ri.REPEAT,"repeat"),ni(pc,Ri.CLAMP_TO_EDGE,"clamp"),ni(pc,Ri.MIRRORED_REPEAT,"mirror"),pc),Pc=(ni(vc={},Ri.NONE,"none"),ni(vc,Ri.BROWSER_DEFAULT_WEBGL,"browser"),vc),Gc=(ni(gc={},Ri.NEVER,"never"),ni(gc,Ri.ALWAYS,"always"),ni(gc,Ri.LESS,"less"),ni(gc,Ri.LEQUAL,"lequal"),ni(gc,Ri.GREATER,"greater"),ni(gc,Ri.GEQUAL,"gequal"),ni(gc,Ri.EQUAL,"equal"),ni(gc,Ri.NOTEQUAL,"notequal"),gc),Lc=(ni(yc={},Ri.FUNC_ADD,"add"),ni(yc,Ri.MIN_EXT,"min"),ni(yc,Ri.MAX_EXT,"max"),ni(yc,Ri.FUNC_SUBTRACT,"subtract"),ni(yc,Ri.FUNC_REVERSE_SUBTRACT,"reverse subtract"),yc),Uc=(ni(mc={},Ri.ZERO,"zero"),ni(mc,Ri.ONE,"one"),ni(mc,Ri.SRC_COLOR,"src color"),ni(mc,Ri.ONE_MINUS_SRC_COLOR,"one minus src color"),ni(mc,Ri.SRC_ALPHA,"src alpha"),ni(mc,Ri.ONE_MINUS_SRC_ALPHA,"one minus src alpha"),ni(mc,Ri.DST_COLOR,"dst color"),ni(mc,Ri.ONE_MINUS_DST_COLOR,"one minus dst color"),ni(mc,Ri.DST_ALPHA,"dst alpha"),ni(mc,Ri.ONE_MINUS_DST_ALPHA,"one minus dst alpha"),ni(mc,Ri.CONSTANT_COLOR,"constant color"),ni(mc,Ri.ONE_MINUS_CONSTANT_COLOR,"one minus constant color"),ni(mc,Ri.CONSTANT_ALPHA,"constant alpha"),ni(mc,Ri.ONE_MINUS_CONSTANT_ALPHA,"one minus constant alpha"),ni(mc,Ri.SRC_ALPHA_SATURATE,"src alpha saturate"),mc),Fc=(ni(bc={},Ri.NEVER,"never"),ni(bc,Ri.ALWAYS,"always"),ni(bc,Ri.LESS,"less"),ni(bc,Ri.LEQUAL,"lequal"),ni(bc,Ri.GREATER,"greater"),ni(bc,Ri.GEQUAL,"gequal"),ni(bc,Ri.EQUAL,"equal"),ni(bc,Ri.NOTEQUAL,"notequal"),bc),Bc=(ni(_c={},Ri.ZERO,"zero"),ni(_c,Ri.KEEP,"keep"),ni(_c,Ri.REPLACE,"replace"),ni(_c,Ri.INVERT,"invert"),ni(_c,Ri.INCR,"increment"),ni(_c,Ri.DECR,"decrement"),ni(_c,Ri.INCR_WRAP,"increment wrap"),ni(_c,Ri.DECR_WRAP,"decrement wrap"),_c),zc=(ni(xc={},Ri.FRONT,"front"),ni(xc,Ri.BACK,"back"),xc),jc=function(){function t(e,n){br(this,t),this.buffer=void 0;var r=n.data,i=n.usage,o=n.type;this.buffer=e.buffer({data:r,usage:Dc[i||Ri.STATIC_DRAW],type:Nc[o||Ri.UNSIGNED_BYTE]})}return xr(t,[{key:"get",value:function(){return this.buffer}},{key:"destroy",value:function(){}},{key:"subData",value:function(t){var e=t.data,n=t.offset;this.buffer.subdata(e,n)}}]),t}();function Wc(t){return function(t){if(Array.isArray(t))return kr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Rr(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.")}()}var Vc={};Vc["[object Float32Array]"]=Vc["[object Float64Array]"]=Vc["[object Int8Array]"]=Vc["[object Int16Array]"]=Vc["[object Int32Array]"]=Vc["[object Uint8Array]"]=Vc["[object Uint8ClampedArray]"]=Vc["[object Uint16Array]"]=Vc["[object Uint32Array]"]=!0,Vc["[object Arguments]"]=Vc["[object Array]"]=Vc["[object ArrayBuffer]"]=Vc["[object Boolean]"]=Vc["[object DataView]"]=Vc["[object Date]"]=Vc["[object Error]"]=Vc["[object Function]"]=Vc["[object Map]"]=Vc["[object Number]"]=Vc["[object Object]"]=Vc["[object RegExp]"]=Vc["[object Set]"]=Vc["[object String]"]=Vc["[object WeakMap]"]=!1;var Xc=Object.prototype.toString,Hc=function(t){return function(t){return!!t&&"object"===zr(t)}(t)&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}(t.length)&&!!Vc[Xc.call(t)]};function qc(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 Yc(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?qc(Object(n),!0).forEach((function(e){ni(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):qc(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Kc=0,Zc=function(){function t(e,n){var r=this;br(this,t),this.reGl=e,this.context=n,this.entity=Cr(),this.texFBO=void 0,this.computeCommand=void 0,this.textureCache={},this.outputTextureName=void 0,this.swapOutputTextureName=void 0,this.compiledPingpong=void 0,this.dynamicPingpong=void 0;var i={};this.context.uniforms.forEach((function(t){var e=t.name,n=t.type,o=t.data,a=t.isReferer,u=t.storageClass;if(u===$u.StorageBuffer){if(a)r.textureCache[e]={data:void 0},i["".concat(e,"Size")]=function(){return o.compiledBundle.context.output.textureSize};else{r.textureCache[e]=r.calcDataTexture(e,n,o);var s=r.textureCache[e],c=s.textureWidth,f=s.isOutput;i["".concat(e,"Size")]=[c,c],f&&(r.outputTextureName=e,r.context.needPingpong&&(r.outputTextureName="".concat(e,"Output"),r.textureCache[r.outputTextureName]=r.calcDataTexture(e,n,o)))}i[e]=function(){return r.textureCache[e].texture}}else if(u===$u.Uniform){if(o&&(Array.isArray(o)||Hc(o))&&o.length>16)throw new Error("invalid data type ".concat(n));i[e]=function(){return t.data}}}));var o=this.getOuputDataTexture(),a=o.textureWidth,u=o.texelCount;i.u_OutputTextureSize=[a,a],i.u_OutputTexelCount=u,this.context.output.textureSize=[a,a];var s={attributes:{a_Position:[[-1,1,0],[-1,-1,0],[1,1,0],[1,-1,0]],a_TexCoord:[[0,1],[0,0],[1,1],[1,0]]},frag:"#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n#else\n precision mediump float;\n#endif\n".concat(this.context.shader),uniforms:i,vert:"attribute vec3 a_Position;\nattribute vec2 a_TexCoord;\n\nvarying vec2 v_TexCoord;\n\nvoid main() {\n gl_Position = vec4(a_Position, 1.0);\n v_TexCoord = a_TexCoord;\n}",primitive:"triangle strip",count:4};this.computeCommand=this.reGl(s)}var e;return xr(t,[{key:"run",value:function(){var t=this;this.context.maxIteration>1&&this.context.needPingpong&&(this.compiledPingpong=!0),(this.compiledPingpong||this.dynamicPingpong)&&this.swap(),this.texFBO=this.reGl.framebuffer({color:this.getOuputDataTexture().texture}),this.texFBO.use((function(){t.computeCommand()}))}},{key:"readData",value:(e=Tr(Sr().mark((function t(){var e,n,r,i,o,a,u,s,c=this;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.reGl({framebuffer:this.texFBO})((function(){e=c.reGl.read()})),!e){t.next=6;break}if(n=this.getOuputDataTexture(),r=n.originalDataLength,i=n.elementsPerTexel,o=n.typedArrayConstructor,a=void 0===o?Float32Array:o,u=[],4!==i)for(s=0;s<e.length;s+=4)1===i?u.push(e[s]):2===i?u.push(e[s],e[s+1]):u.push(e[s],e[s+1],e[s+2]);else u=e;return t.abrupt("return",new a(u.slice(0,r)));case 6:return t.abrupt("return",new Float32Array);case 7:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"confirmInput",value:function(t,e){var n;this.entity===t.entity?(this.dynamicPingpong=!0,n=this):n=t,this.textureCache[e].id=n.getOuputDataTexture().id,this.textureCache[e].texture=n.getOuputDataTexture().texture}},{key:"updateUniform",value:function(){}},{key:"updateBuffer",value:function(t,e){var n=this.context.uniforms.find((function(e){return e.name===t}));if(n){var r=this.calcDataTexture(t,n.type,e),i=r.texture,o=r.data;this.textureCache[t].data=o,this.textureCache[t].texture=i}}},{key:"destroy",value:function(){}},{key:"swap",value:function(){if(this.swapOutputTextureName||this.createSwapOutputDataTexture(),this.compiledPingpong){var t=this.context.output.name;this.textureCache[t].id=this.getOuputDataTexture().id,this.textureCache[t].texture=this.getOuputDataTexture().texture}var e=this.outputTextureName;this.outputTextureName=this.swapOutputTextureName,this.swapOutputTextureName=e}},{key:"getOuputDataTexture",value:function(){return this.textureCache[this.outputTextureName]}},{key:"createSwapOutputDataTexture",value:function(){var t=this.cloneDataTexture(this.getOuputDataTexture());this.swapOutputTextureName="".concat(this.entity,"-swap"),this.textureCache[this.swapOutputTextureName]=t}},{key:"cloneDataTexture",value:function(t){var e=t.data,n=t.textureWidth;return Yc(Yc({},t),{},{id:Kc++,texture:this.reGl.texture({width:n,height:n,data:e,type:"float"})})}},{key:"calcDataTexture",value:function(t,e,n){var r=1;e===Ku.Vector4FloatArray&&(r=4);for(var i=[],o=0;o<n.length;o+=r)1===r?i.push(n[o],0,0,0):2===r?i.push(n[o],n[o+1],0,0):3===r?i.push(n[o],n[o+1],n[o+2],0):4===r&&i.push(n[o],n[o+1],n[o+2],n[o+3]);var a=n.length,u=Math.ceil(a/r),s=Math.ceil(Math.sqrt(u)),c=s*s;u<c&&i.push.apply(i,Wc(new Array(4*(c-u)).fill(0)));var f=this.reGl.texture({width:s,height:s,data:i,type:"float"});return{id:Kc++,data:i,originalDataLength:a,typedArrayConstructor:Hc(n)?n.constructor:void 0,textureWidth:s,texture:f,texelCount:u,elementsPerTexel:r,isOutput:t===this.context.output.name}}}]),t}(),$c=function(){function t(e,n){br(this,t),this.elements=void 0;var r=n.data,i=n.usage,o=n.type,a=n.count;this.elements=e.elements({data:r,usage:Dc[i||Ri.STATIC_DRAW],type:Nc[o||Ri.UNSIGNED_BYTE],count:a})}return xr(t,[{key:"get",value:function(){return this.elements}},{key:"subData",value:function(t){var e=t.data;this.elements.subdata(e)}},{key:"destroy",value:function(){this.elements.destroy()}}]),t}(),Jc=function(){function t(e,n){br(this,t),this.framebuffer=void 0;var r=n.width,i=n.height,o=n.color,a=n.colors,u=(n.depth,n.stencil,{width:r,height:i});Array.isArray(a)&&(u.colors=a.map((function(t){return t.get()}))),o&&"boolean"!=typeof o&&(u.color=o.get()),this.framebuffer=e.framebuffer(u)}return xr(t,[{key:"get",value:function(){return this.framebuffer}},{key:"destroy",value:function(){this.framebuffer.destroy()}},{key:"resize",value:function(t){var e=t.width,n=t.height;this.framebuffer.resize(e,n)}}]),t}();function Qc(t){var e={};return Object.keys(t).forEach((function(n){tf(n,t[n],e,"")})),e}function tf(t,e,n,r){var i,o;null===e||"number"==typeof e||"boolean"==typeof e||Array.isArray(e)&&"number"==typeof e[0]||Hc(e)||""===e||void 0!==e.resize?n["".concat(r&&r+".").concat(t)]=e:(o=zr(i=e),null==i||"object"!==o&&"function"!==o||Object.keys(e).forEach((function(i){tf(i,e[i],n,"".concat(r&&r+".").concat(t))})),Array.isArray(e)&&e.forEach((function(e,i){Object.keys(e).forEach((function(o){tf(o,e[o],n,"".concat(r&&r+".").concat(t,"[").concat(i,"]"))}))})))}function ef(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 nf(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ef(Object(n),!0).forEach((function(e){ni(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ef(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var rf,of,af,uf=function(){function t(e,n){br(this,t),this.reGl=void 0,this.drawCommand=void 0,this.uniforms={},this.reGl=e;var r=n.vs,i=n.fs,o=n.defines,a=n.attributes,u=n.uniforms,s=n.primitive,c=n.count,f=n.elements,l=n.depth,h=n.blend,d=n.stencil,p=n.cull,v=n.instances,g=n.scissor,y=n.viewport,m={};u&&(this.uniforms=Qc(u),Object.keys(u).forEach((function(t){m[t]=e.prop(t)})));var b={};Object.keys(a).forEach((function(t){b[t]=a[t].get()}));var _=o&&this.generateDefines(o)||"",x={attributes:b,frag:"#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n#else\n precision mediump float;\n#endif\n".concat(_,"\n").concat(i),uniforms:m,vert:"\n".concat(_,"\n").concat(r),primitive:Cc[void 0===s?Ri.TRIANGLES:s]};v&&(x.instances=v),c&&(x.count=c),f&&(x.elements=f.get()),g&&(x.scissor=g),y&&(x.viewport=y),this.initDepthDrawParams({depth:l},x),this.initBlendDrawParams({blend:h},x),this.initStencilDrawParams({stencil:d},x),this.initCullDrawParams({cull:p},x),this.drawCommand=e(x)}return xr(t,[{key:"addUniforms",value:function(t){this.uniforms=nf(nf({},this.uniforms),Qc(t))}},{key:"draw",value:function(t){var e=nf(nf({},this.uniforms),Qc(t.uniforms||{})),n={};Object.keys(e).forEach((function(t){var r=zr(e[t]);"boolean"===r||"number"===r||Array.isArray(e[t])||e[t].BYTES_PER_ELEMENT?n[t]=e[t]:"string"===r||(n[t]=e[t].get())})),this.drawCommand(n)}},{key:"destroy",value:function(){}},{key:"initDepthDrawParams",value:function(t,e){var n=t.depth;n&&(e.depth={enable:void 0===n.enable||!!n.enable,mask:void 0===n.mask||!!n.mask,func:Gc[n.func||Ri.LESS],range:n.range||[0,1]})}},{key:"initBlendDrawParams",value:function(t,e){var n=t.blend;if(n){var r=n.enable,i=n.func,o=n.equation,a=n.color,u=void 0===a?[0,0,0,0]:a;e.blend={enable:!!r,func:{srcRGB:Uc[i&&i.srcRGB||Ri.SRC_ALPHA],srcAlpha:Uc[i&&i.srcAlpha||Ri.SRC_ALPHA],dstRGB:Uc[i&&i.dstRGB||Ri.ONE_MINUS_SRC_ALPHA],dstAlpha:Uc[i&&i.dstAlpha||Ri.ONE_MINUS_SRC_ALPHA]},equation:{rgb:Lc[o&&o.rgb||Ri.FUNC_ADD],alpha:Lc[o&&o.alpha||Ri.FUNC_ADD]},color:u}}}},{key:"initStencilDrawParams",value:function(t,e){var n=t.stencil;if(n){var r=n.enable,i=n.mask,o=void 0===i?-1:i,a=n.func,u=void 0===a?{cmp:Ri.ALWAYS,ref:0,mask:-1}:a,s=n.opFront,c=void 0===s?{fail:Ri.KEEP,zfail:Ri.KEEP,zpass:Ri.KEEP}:s,f=n.opBack,l=void 0===f?{fail:Ri.KEEP,zfail:Ri.KEEP,zpass:Ri.KEEP}:f;e.stencil={enable:!!r,mask:o,func:nf(nf({},u),{},{cmp:Fc[u.cmp]}),opFront:{fail:Bc[c.fail],zfail:Bc[c.zfail],zpass:Bc[c.zpass]},opBack:{fail:Bc[l.fail],zfail:Bc[l.zfail],zpass:Bc[l.zpass]}}}}},{key:"initCullDrawParams",value:function(t,e){var n=t.cull;if(n){var r=n.enable,i=n.face,o=void 0===i?Ri.BACK:i;e.cull={enable:!!r,face:zc[o]}}}},{key:"generateDefines",value:function(t){return Object.keys(t).map((function(e){return"#define ".concat(e," ").concat(Number(t[e]))})).join("\n")}}]),t}(),sf=function(){function t(e,n){br(this,t),this.texture=void 0,this.width=void 0,this.height=void 0;var r=n.data,i=n.type,o=void 0===i?Ri.UNSIGNED_BYTE:i,a=n.width,u=n.height,s=n.flipY,c=void 0!==s&&s,f=n.format,l=void 0===f?Ri.RGBA:f,h=n.mipmap,d=void 0!==h&&h,p=n.wrapS,v=void 0===p?Ri.CLAMP_TO_EDGE:p,g=n.wrapT,y=void 0===g?Ri.CLAMP_TO_EDGE:g,m=n.aniso,b=void 0===m?0:m,_=n.alignment,x=void 0===_?1:_,w=n.premultiplyAlpha,E=void 0!==w&&w,S=n.mag,A=void 0===S?Ri.NEAREST:S,T=n.min,I=void 0===T?Ri.NEAREST:T,C=n.colorSpace,D=void 0===C?Ri.BROWSER_DEFAULT_WEBGL:C;this.width=a,this.height=u;var N={width:a,height:u,type:Nc[o],format:kc[l],wrapS:Mc[v],wrapT:Mc[y],mag:Oc[A],min:Oc[I],alignment:x,flipY:c,colorSpace:Pc[D],premultiplyAlpha:E,aniso:b};r&&(N.data=r),"number"==typeof d?N.mipmap=Rc[d]:"boolean"==typeof d&&(N.mipmap=d),this.texture=e.texture(N)}return xr(t,[{key:"get",value:function(){return this.texture}},{key:"update",value:function(){this.texture._texture.bind()}},{key:"resize",value:function(t){var e=t.width,n=t.height;this.texture.resize(e,n),this.width=e,this.height=n}},{key:"destroy",value:function(){this.texture.destroy()}}]),t}(),cf=(0,Mr.b2)()((of=function(){function t(){var e=this;br(this,t),this.supportWebGPU=!1,this.useWGSL=!1,this.$canvas=void 0,this.gl=void 0,this.inited=void 0,this.createModel=function(){var t=Tr(Sr().mark((function t(n){return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!n.uniforms){t.next=3;break}return t.next=3,Promise.all(Object.keys(n.uniforms).map(function(){var t=Tr(Sr().mark((function t(e){var r;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!n.uniforms[e]||void 0===n.uniforms[e].load){t.next=5;break}return t.next=3,n.uniforms[e].load();case 3:r=t.sent,n.uniforms[e]=r;case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 3:return t.abrupt("return",new uf(e.gl,n));case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.createAttribute=function(t){return new Ic(e.gl,t)},this.createBuffer=function(t){return new jc(e.gl,t)},this.createElements=function(t){return new $c(e.gl,t)},this.createTexture2D=function(t){return new sf(e.gl,t)},this.createFramebuffer=function(t){return new Jc(e.gl,t)},this.useFramebuffer=function(t,n){e.gl({framebuffer:t?t.get():null})(n)},this.createComputeModel=function(){var t=Tr(Sr().mark((function t(n){return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Zc(e.gl,n));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.clear=function(t){var n=t.color,r=t.depth,i=t.stencil,o=t.framebuffer,a=void 0===o?null:o,u={color:n,depth:r,stencil:i};u.framebuffer=null===a?a:a.get(),e.gl.clear(u)},this.setScissor=function(t){e.gl&&e.gl._gl&&(t.enable&&t.box?(e.gl._gl.enable(Ri.SCISSOR_TEST),e.gl._gl.scissor(t.box.x,t.box.y,t.box.width,t.box.height)):e.gl._gl.disable(Ri.SCISSOR_TEST),e.gl._refresh())},this.viewport=function(t){var n=t.x,r=t.y,i=t.width,o=t.height;e.gl&&e.gl._gl&&(e.gl._gl.viewport(n,r,i,o),e.gl._refresh())},this.readPixels=function(t){var n=t.framebuffer,r={x:t.x,y:t.y,width:t.width,height:t.height};return n&&(r.framebuffer=n.get()),e.gl.read(r)},this.getCanvas=function(){return e.$canvas},this.getGLContext=function(){return e.gl._gl},this.destroy=function(){e.gl&&(e.gl.destroy(),e.inited=!1)}}var e;return xr(t,[{key:"init",value:(e=Tr(Sr().mark((function t(e){return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.inited){t.next=2;break}return t.abrupt("return");case 2:return this.$canvas=e.canvas,t.next=5,new Promise((function(t,n){Tc()({canvas:e.canvas,attributes:{alpha:!0,antialias:e.antialias,premultipliedAlpha:!0},pixelRatio:1,extensions:["OES_element_index_uint","OES_texture_float","OES_standard_derivatives","angle_instanced_arrays"],optionalExtensions:["EXT_texture_filter_anisotropic","EXT_blend_minmax","WEBGL_depth_texture"],profile:!0,onDone:function(e,r){!e&&r||n(e),t(r)}})}));case 5:this.gl=t.sent,this.inited=!0;case 7:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"isFloatSupported",value:function(){return this.gl.limits.readFloat}},{key:"beginFrame",value:function(){}},{key:"endFrame",value:function(){}}]),t}(),rf=of))||rf;function ff(t,e){return new Promise((function(e,n){!function(t,e,n,r){if("undefined"!=typeof window){var i=document.getElementsByTagName("head")[0],o=document.createElement("script");o.setAttribute("type","text/javascript"),o.setAttribute("src",t),r&&(o.id=r),o.onload=function(){e&&e()},o.onerror=function(e){n&&n("Unable to load script '".concat(t,"'"),e)},i.appendChild(o)}}(t,(function(){e()}),(function(t,e){n(e)}))}))}function lf(){return hf.apply(this,arguments)}function hf(){return(hf=Tr(Sr().mark((function t(){return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!af){t.next=2;break}return t.abrupt("return",af);case 2:return t.next=4,ff("https://preview.babylonjs.com/glslang/glslang.js");case 4:return af=window.glslang("https://preview.babylonjs.com/glslang/glslang.wasm"),t.abrupt("return",af);case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var df,pf,vf,gf,yf,mf,bf,_f=function(){function t(e,n){br(this,t),this.engine=e,this.options=n,this.attribute=void 0,this.buffer=void 0;var r=n,i=r.buffer,o=r.offset,a=r.stride,u=r.normalized,s=r.size,c=r.divisor,f=r.arrayStride,l=r.attributes,h=r.stepMode;this.buffer=i,this.attribute={buffer:i.get(),offset:o||0,stride:a||0,normalized:u||!1,divisor:c||0,arrayStride:f||0,attributes:l,stepMode:h||"vertex"},s&&(this.attribute.size=s)}return xr(t,[{key:"get",value:function(){return this.attribute}},{key:"updateBuffer",value:function(t){this.buffer.subData(t)}},{key:"destroy",value:function(){this.buffer.destroy()}}]),t}(),xf=function(){function t(e,n){br(this,t),this.engine=e,this.options=n,this.buffer=void 0;var r=n,i=r.data,o=r.usage;r.type,this.buffer=this.createBuffer(i instanceof Array?new Float32Array(i):i,o||As.FB.Vertex|As.FB.CopyDst)}return xr(t,[{key:"get",value:function(){return this.buffer}},{key:"destroy",value:function(){this.buffer.destroy()}},{key:"subData",value:function(t){var e=t.data,n=t.offset;this.setSubData(this.buffer,n,e instanceof Array?new Float32Array(e):e)}},{key:"createBuffer",value:function(t,e){var n=t.byteLength%4,r={size:t.byteLength+n,usage:e},i=this.engine.device.createBuffer(r);return this.setSubData(i,0,t),i}},{key:"setSubData",value:function(t,e,n){(Qu?this.engine.device.getQueue():this.engine.device.defaultQueue).writeBuffer(t,e,n)}}]),t}(),wf=function(){function t(e,n){br(this,t),this.engine=e,this.context=n,this.entity=Cr(),this.uniformGPUBufferLayout=[],this.uniformBuffer=void 0,this.vertexBuffers={},this.outputBuffer=void 0,this.bindGroupEntries=void 0,this.bindGroup=void 0,this.computePipeline=void 0}var e,n,r;return xr(t,[{key:"init",value:(r=Tr(Sr().mark((function t(){var e,n,r,i,o,a,u,s=this;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.compileComputePipelineStageDescriptor(this.context.shader);case 2:e=t.sent,n=e.computeStage,r=this.context.uniforms.filter((function(t){return t.storageClass===$u.StorageBuffer})),i=this.context.uniforms.filter((function(t){return t.storageClass===$u.Uniform})),o=i.length?1:0,this.bindGroupEntries=[],o&&(a=0,u=[],i.forEach((function(t){if("number"==typeof t.data)s.uniformGPUBufferLayout.push({name:t.name,offset:a}),a+=4,u.push(t.data);else{var e,n=(null===(e=t.data)||void 0===e?void 0:e.length)||1;3===n&&(n=4,t.data.push(0));var r=a/4%4;if(r>0){var i=4-r;if(n>1&&n<=i)2===n&&(3===i&&(a+=4,u.push(0)),u.push.apply(u,Wc(t.data)),s.uniformGPUBufferLayout.push({name:t.name,offset:a}));else{for(var o=0;o<i;o++)a+=4,u.push(0);u.push.apply(u,Wc(t.data)),s.uniformGPUBufferLayout.push({name:t.name,offset:a})}}a+=4*n}})),this.uniformBuffer=new xf(this.engine,{data:u instanceof Array?new Float32Array(u):u,usage:As.FB.Uniform|As.FB.CopyDst}),this.bindGroupEntries.push({binding:0,resource:{buffer:this.uniformBuffer.get()}})),r.forEach((function(t){var e;null!==t.data&&(t.type!==Ku.Vector4FloatArray&&t.type!==Ku.FloatArray||(t.name===s.context.output.name?(e=new xf(s.engine,{data:isFinite(Number(t.data))?[t.data]:t.data,usage:As.FB.Storage|As.FB.CopyDst|As.FB.CopySrc}),s.outputBuffer=e,s.context.output={name:t.name,length:isFinite(Number(t.data))?1:t.data.length,typedArrayConstructor:Float32Array,gpuBuffer:e.get()}):t.isReferer?t.data.model&&t.data.model.outputBuffer&&(e=t.data.model.outputBuffer):e=new xf(s.engine,{data:isFinite(Number(t.data))?[t.data]:t.data,usage:As.FB.Storage|As.FB.CopyDst|As.FB.CopySrc}),s.vertexBuffers[t.name]=e,s.bindGroupEntries.push({binding:o,resource:{name:t.name,refer:e?void 0:t.data,buffer:e?e.get():void 0}}),o++))})),this.computePipeline=this.engine.device.createComputePipeline({computeStage:n}),console.log(this.bindGroupEntries),this.bindGroup=this.engine.device.createBindGroup({layout:this.computePipeline.getBindGroupLayout(0),entries:this.bindGroupEntries});case 13:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"destroy",value:function(){var t=this;this.uniformBuffer&&this.uniformBuffer.destroy(),Object.keys(this.vertexBuffers).forEach((function(e){return t.vertexBuffers[e].destroy()}))}},{key:"readData",value:(n=Tr(Sr().mark((function t(){var e,n,r,i,o,a,u,s,c;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(e=this.context.output)){t.next=16;break}if(n=e.length,r=e.typedArrayConstructor,!(i=e.gpuBuffer)){t.next=16;break}return o=n*r.BYTES_PER_ELEMENT,a=this.engine.device.createBuffer({size:o,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ}),(u=this.engine.device.createCommandEncoder()).copyBufferToBuffer(i,0,a,0,o),(Qu?this.engine.device.getQueue():this.engine.device.defaultQueue).submit([u.finish()]),t.next=12,a.mapAsync(As.gc.Read);case 12:return s=a.getMappedRange(),c=new r(s.slice(0)),a.unmap(),t.abrupt("return",c);case 16:return t.abrupt("return",new Float32Array);case 17:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"run",value:function(){var t;this.engine.currentComputePass&&(this.engine.currentComputePass.setPipeline(this.computePipeline),this.engine.currentComputePass.setBindGroup(0,this.bindGroup),(t=this.engine.currentComputePass).dispatch.apply(t,Wc(this.context.dispatch)))}},{key:"updateBuffer",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.vertexBuffers[t];r&&r.subData({data:e,offset:n})}},{key:"updateUniform",value:function(t,e){var n=this.uniformGPUBufferLayout.find((function(e){return e.name===t}));n&&this.uniformBuffer.subData({data:Number.isFinite(e)?new Float32Array([e]):new Float32Array(e),offset:n.offset})}},{key:"confirmInput",value:function(t,e){var n=this.vertexBuffers[e],r=t.outputBuffer;if(n&&r&&n!==r){var i=this.engine.device.createCommandEncoder(),o=t.context.output,a=o.length*o.typedArrayConstructor.BYTES_PER_ELEMENT;i.copyBufferToBuffer(r.get(),0,n.get(),0,a),(Qu?this.engine.device.getQueue():this.engine.device.defaultQueue).submit([i.finish()])}}},{key:"compileShaderToSpirV",value:function(t,e,n){return this.compileRawShaderToSpirV(n+t,e)}},{key:"compileRawShaderToSpirV",value:function(t,e){return this.engine.glslang.compileGLSL(t,e)}},{key:"compileComputePipelineStageDescriptor",value:(e=Tr(Sr().mark((function t(e){var n;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e,this.engine.options.useWGSL){t.next=6;break}return t.next=5,this.compileShaderToSpirV(e,"compute","#version 450\n");case 5:n=t.sent;case 6:return t.abrupt("return",{computeStage:{module:this.engine.device.createShaderModule({code:n,isWHLSL:Qu}),entryPoint:"main"}});case 7:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})}]),t}(),Ef=function(){function t(e,n){br(this,t),this.engine=e,this.options=n,this.indexCount=void 0,this.buffer=void 0;var r=n,i=r.data,o=(r.usage,r.type,r.count);this.indexCount=o||0,this.buffer=new xf(e,{data:i instanceof Array?new Uint16Array(i):i,usage:As.FB.Index|As.FB.CopyDst})}return xr(t,[{key:"get",value:function(){return this.buffer}},{key:"subData",value:function(t){this.buffer.subData(t)}},{key:"destroy",value:function(){this.buffer.destroy()}}]),t}(),Sf=function(){function t(e,n){br(this,t),this.engine=e,this.options=n,this.colorTexture=void 0,this.depthTexture=void 0,this.width=0,this.height=0;var r=n,i=(r.width,r.height,r.color),o=(r.colors,r.depth);r.stencil,i&&(this.colorTexture=i),o&&(this.depthTexture=o)}return xr(t,[{key:"get",value:function(){var t,e;return{color:null===(t=this.colorTexture)||void 0===t?void 0:t.get(),depth:null===(e=this.depthTexture)||void 0===e?void 0:e.get()}}},{key:"destroy",value:function(){var t,e;null===(t=this.colorTexture)||void 0===t||t.destroy(),null===(e=this.depthTexture)||void 0===e||e.destroy()}},{key:"resize",value:function(t){var e,n,r=t.width,i=t.height;r===this.width&&i===this.height||(null===(e=this.colorTexture)||void 0===e||e.resize({width:r,height:i}),null===(n=this.depthTexture)||void 0===n||n.resize({width:r,height:i})),this.width=r,this.height=i}}]),t}(),Af=(ni(df={},Ri.POINTS,As.YV.PointList),ni(df,Ri.LINES,As.YV.LineList),ni(df,Ri.LINE_LOOP,As.YV.LineList),ni(df,Ri.LINE_STRIP,As.YV.LineStrip),ni(df,Ri.TRIANGLES,As.YV.TriangleList),ni(df,Ri.TRIANGLE_FAN,As.YV.TriangleList),ni(df,Ri.TRIANGLE_STRIP,As.YV.TriangleStrip),df),Tf=(ni(pf={},Ri.NEVER,As.wb.Never),ni(pf,Ri.ALWAYS,As.wb.Always),ni(pf,Ri.LESS,As.wb.Less),ni(pf,Ri.LEQUAL,As.wb.LessEqual),ni(pf,Ri.GREATER,As.wb.Greater),ni(pf,Ri.GEQUAL,As.wb.GreaterEqual),ni(pf,Ri.EQUAL,As.wb.Equal),ni(pf,Ri.NOTEQUAL,As.wb.NotEqual),pf),If=(ni(vf={},Ri.FUNC_ADD,As.db.Add),ni(vf,Ri.MIN_EXT,As.db.Min),ni(vf,Ri.MAX_EXT,As.db.Max),ni(vf,Ri.FUNC_SUBTRACT,As.db.Subtract),ni(vf,Ri.FUNC_REVERSE_SUBTRACT,As.db.ReverseSubtract),vf),Cf=(ni(gf={},Ri.ZERO,As.zi.Zero),ni(gf,Ri.ONE,As.zi.One),ni(gf,Ri.SRC_COLOR,As.zi.SrcColor),ni(gf,Ri.ONE_MINUS_SRC_COLOR,As.zi.OneMinusSrcColor),ni(gf,Ri.SRC_ALPHA,As.zi.SrcAlpha),ni(gf,Ri.ONE_MINUS_SRC_ALPHA,As.zi.OneMinusSrcAlpha),ni(gf,Ri.DST_COLOR,As.zi.DstColor),ni(gf,Ri.ONE_MINUS_DST_COLOR,As.zi.OneMinusDstColor),ni(gf,Ri.DST_ALPHA,As.zi.DstAlpha),ni(gf,Ri.ONE_MINUS_DST_ALPHA,As.zi.OneMinusDstAlpha),ni(gf,Ri.CONSTANT_COLOR,As.zi.BlendColor),ni(gf,Ri.ONE_MINUS_CONSTANT_COLOR,As.zi.OneMinusBlendColor),ni(gf,Ri.SRC_ALPHA_SATURATE,As.zi.SrcAlphaSaturated),gf),Df=(ni(yf={},Ri.ALPHA,"r8unorm"),ni(yf,Ri.RGBA,"rgba8unorm"),ni(yf,Ri.DEPTH_COMPONENT,"depth32float"),ni(yf,Ri.DEPTH_STENCIL,"depth24plus-stencil8"),yf),Nf=(ni(mf={},Ri.NEAREST,"nearest"),ni(mf,Ri.LINEAR,"linear"),mf),kf=(ni(bf={},Ri.REPEAT,"repeat"),ni(bf,Ri.CLAMP_TO_EDGE,"clamp-to-edge"),ni(bf,Ri.MIRRORED_REPEAT,"mirror-repeat"),bf);function Rf(t){var e=t.cull;return e&&e.enable?e.face?e.face===Ri.FRONT?As.Wf.Front:As.Wf.Back:void 0:As.Wf.None}function Of(t){var e=t.depth,n=(t.stencil,{compare:As.wb.Always,depthFailOp:As.xS.Keep,failOp:As.xS.Keep,passOp:As.xS.Keep});return{depthWriteEnabled:e&&e.enable,depthCompare:Tf[(null==e?void 0:e.func)||Ri.ALWAYS],format:As.EV.Depth24PlusStencil8,stencilFront:n,stencilBack:n,stencilReadMask:4294967295,stencilWriteMask:4294967295}}function Mf(t,e){var n=t.blend;return[{format:e,alphaBlend:{srcFactor:Cf[n&&n.func&&n.func.srcAlpha||Ri.ONE],dstFactor:Cf[n&&n.func&&n.func.dstAlpha||Ri.ZERO],operation:If[n&&n.equation&&n.equation.alpha||Ri.FUNC_ADD]},colorBlend:{srcFactor:Cf[n&&n.func&&n.func.srcRGB||Ri.ONE],dstFactor:Cf[n&&n.func&&n.func.dstRGB||Ri.ZERO],operation:If[n&&n.equation&&n.equation.rgb||Ri.FUNC_ADD]},writeMask:As.Yw.All}]}function Pf(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 Gf(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Pf(Object(n),!0).forEach((function(e){ni(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Pf(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Lf(t){for(var e=0,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];for(var o=0,a=r;o<a.length;o++){var u=a[o];e+=u.length}for(var s=new t(e),c=0,f=0,l=r;f<l.length;f++){var h=l[f];s.set(h,c),c+=h.length}return s}var Uf,Ff,Bf,zf=function(){function t(e,n){br(this,t),this.engine=e,this.options=n,this.pipelineLayout=void 0,this.renderPipeline=void 0,this.uniformsBindGroupLayout=void 0,this.uniformBindGroup=void 0,this.uniformBuffer=void 0,this.uniforms={},this.uniformGPUBufferLayout=[],this.attributeCache={},this.indexBuffer=void 0,this.indexCount=void 0}var e,n;return xr(t,[{key:"init",value:(n=Tr(Sr().mark((function t(){var e,n,r,i,o,a,u,s,c,f,l,h,d,p,v,g,y=this;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.options,n=e.vs,r=e.fs,i=e.attributes,o=e.uniforms,a=e.primitive,e.count,u=e.elements,s=e.depth,c=e.blend,f=e.stencil,l=e.cull,e.instances,t.next=3,this.compilePipelineStageDescriptor(n,r,null);case 3:h=t.sent,d=h.vertexStage,p=h.fragmentStage,o&&this.buildUniformBindGroup(o),u&&(this.indexBuffer=u.get(),this.indexCount=u.indexCount),v={vertexBuffers:Object.keys(i).map((function(t,e){var n=i[t],r=n.get(),o=r.arrayStride,a=r.stepMode,u=r.attributes;return y.attributeCache[t]=n,{arrayStride:o,stepMode:a,attributes:u}}))},g={sampleCount:this.engine.mainPassSampleCount,primitiveTopology:Af[a||Ri.TRIANGLES],rasterizationState:Gf(Gf({},this.getDefaultRasterizationStateDescriptor()),{},{cullMode:Rf({cull:l})}),depthStencilState:Of({depth:s,stencil:f}),colorStates:Mf({blend:c},this.engine.options.swapChainFormat),layout:this.pipelineLayout,vertexStage:d,fragmentStage:p,vertexState:v},this.renderPipeline=this.engine.device.createRenderPipeline(g);case 11:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"addUniforms",value:function(t){this.uniforms=Gf(Gf({},this.uniforms),Qc(t))}},{key:"draw",value:function(t){var e=this,n=this.engine.getCurrentRenderPass(),r=Gf(Gf({},this.uniforms),Qc(t.uniforms||{})),i=[];Object.keys(r).forEach((function(t){var n=zr(r[t]);if("boolean"===n||"number"===n||Array.isArray(r[t])||r[t].BYTES_PER_ELEMENT){var o,a=null===(o=e.uniformGPUBufferLayout.find((function(e){return e.name===t})))||void 0===o?void 0:o.offset;null!==a&&e.uniformBuffer.subData({data:r[t],offset:a})}else{var u,s=null===(u=e.uniformGPUBufferLayout.find((function(e){return e.name===t})))||void 0===u?void 0:u.offset;if(null!==s){var c=r[t].get(),f=c.color||c,l=f.texture,h=f.sampler;h&&(i.push({binding:s,resource:h}),s++),i.push({binding:s,resource:l.createView()})}}})),this.uniformBuffer&&(i[0]={binding:0,resource:{buffer:this.uniformBuffer.get()}}),this.uniformBindGroup=this.engine.device.createBindGroup({layout:this.uniformsBindGroupLayout,entries:i}),this.renderPipeline&&n.setPipeline(this.renderPipeline),n.setBindGroup(0,this.uniformBindGroup),this.indexBuffer&&n.setIndexBuffer(this.indexBuffer.get(),As.iD.Uint32,0),Object.keys(this.attributeCache).forEach((function(t,r){n.setVertexBuffer(0+r,e.attributeCache[t].get().buffer,0)})),this.indexBuffer?n.drawIndexed(this.indexCount,this.options.instances||1,0,0,0):n.draw(this.options.count||0,this.options.instances||0,0,0)}},{key:"destroy",value:function(){throw new Error("Method not implemented.")}},{key:"compilePipelineStageDescriptor",value:(e=Tr(Sr().mark((function t(e,n,r){var i,o,a;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i="#version 450\n",o=e,a=n,this.engine.options.useWGSL){t.next=10;break}return t.next=6,this.compileShaderToSpirV(e,"vertex",i);case 6:return o=t.sent,t.next=9,this.compileShaderToSpirV(n,"fragment",i);case 9:a=t.sent;case 10:return t.abrupt("return",this.createPipelineStageDescriptor(o,a));case 11:case"end":return t.stop()}}),t,this)}))),function(t,n,r){return e.apply(this,arguments)})},{key:"compileShaderToSpirV",value:function(t,e,n){return this.compileRawShaderToSpirV(n+t,e)}},{key:"compileRawShaderToSpirV",value:function(t,e){return this.engine.glslang.compileGLSL(t,e)}},{key:"createPipelineStageDescriptor",value:function(t,e){return{vertexStage:{module:this.engine.device.createShaderModule({code:t,isWHLSL:Qu}),entryPoint:"main"},fragmentStage:{module:this.engine.device.createShaderModule({code:e,isWHLSL:Qu}),entryPoint:"main"}}}},{key:"getDefaultRasterizationStateDescriptor",value:function(){return{frontFace:As.zX.CCW,cullMode:As.Wf.None,depthBias:0,depthBiasSlopeScale:0,depthBiasClamp:0}}},{key:"buildUniformBindGroup",value:function(t){var e=this,n=0,r=Lf.apply(void 0,[Float32Array].concat(Wc(Object.keys(t).map((function(r){return t[r]?(e.uniformGPUBufferLayout.push({name:r,offset:n}),n+=4*(t[r].length||1),t[r]):[]}))))),i=[],o=!1;r.length&&(o=!0,i.push({binding:0,visibility:As.$X.Fragment|As.$X.Vertex,type:As.$l.UniformBuffer})),Object.keys(t).filter((function(e){return null===t[e]})).forEach((function(t,n){e.uniformGPUBufferLayout.push({name:t,offset:2*n+(o?1:0)}),i.push({binding:2*n+(o?1:0),visibility:As.$X.Fragment,type:As.$l.Sampler},{binding:2*n+(o?1:0)+1,visibility:As.$X.Fragment,type:As.$l.SampledTexture})})),this.uniformsBindGroupLayout=this.engine.device.createBindGroupLayout({entries:i}),this.pipelineLayout=this.engine.device.createPipelineLayout({bindGroupLayouts:[this.uniformsBindGroupLayout]}),o&&(this.uniformBuffer=new xf(this.engine,{data:r instanceof Array?new Float32Array(r):r,usage:As.FB.Uniform|As.FB.CopyDst}))}}]),t}(),jf=function(){function t(e,n){br(this,t),this.engine=e,this.options=n,this.texture=void 0,this.sampler=void 0,this.width=void 0,this.height=void 0,this.createTexture()}return xr(t,[{key:"get",value:function(){return{texture:this.texture,sampler:this.sampler}}},{key:"update",value:function(){}},{key:"resize",value:function(t){var e=t.width,n=t.height;e===this.width&&n===this.height||(this.destroy(),this.createTexture()),this.width=e,this.height=n}},{key:"destroy",value:function(){this.texture&&this.texture.destroy()}},{key:"createTexture",value:function(){var t=this.options,e=(void 0===(t.data,t.type)&&Ri.UNSIGNED_BYTE,t.width),n=t.height,r=(t.flipY,t.format),i=void 0===r?Ri.RGBA:r,o=(t.mipmap,t.wrapS),a=void 0===o?Ri.CLAMP_TO_EDGE:o,u=t.wrapT,s=void 0===u?Ri.CLAMP_TO_EDGE:u,c=t.aniso,f=void 0===c?0:c,l=(t.alignment,t.premultiplyAlpha,t.mag),h=void 0===l?Ri.NEAREST:l,d=t.min,p=void 0===d?Ri.NEAREST:d,v=(void 0===t.colorSpace&&Ri.BROWSER_DEFAULT_WEBGL,t.usage);this.width=e,this.height=n,this.texture=this.engine.device.createTexture({size:[e,n,1],mipLevelCount:1,sampleCount:1,dimension:As.kd.E2d,format:Df[i],usage:v||As.v2.Sampled|As.v2.CopyDst}),(!v||v&As.v2.Sampled)&&(this.sampler=this.engine.device.createSampler({addressModeU:kf[a],addressModeV:kf[s],addressModeW:kf[a],magFilter:Nf[h],minFilter:Nf[p],maxAnisotropy:f}))}}]),t}(),Wf=(0,Mr.b2)()((Ff=function(){function t(){var e=this;br(this,t),this.supportWebGPU=!0,this.useWGSL=!1,this.options=void 0,this.canvas=void 0,this.context=void 0,this.glslang=void 0,this.adapter=void 0,this.device=void 0,this.swapChain=void 0,this.mainPassSampleCount=void 0,this.mainTexture=void 0,this.depthTexture=void 0,this.mainColorAttachments=void 0,this.mainTextureExtends=void 0,this.mainDepthAttachment=void 0,this.uploadEncoder=void 0,this.renderEncoder=void 0,this.computeEncoder=void 0,this.renderTargetEncoder=void 0,this.commandBuffers=new Array(4).fill(void 0),this.currentRenderPass=null,this.mainRenderPass=null,this.currentRenderTargetViewDescriptor=void 0,this.currentComputePass=null,this.bundleEncoder=void 0,this.tempBuffers=[],this.currentRenderTarget=null,this.uploadEncoderDescriptor={label:"upload"},this.renderEncoderDescriptor={label:"render"},this.renderTargetEncoderDescriptor={label:"renderTarget"},this.computeEncoderDescriptor={label:"compute"},this.pipelines={},this.computePipelines={},this.defaultSampleCount=4,this.clearDepthValue=1,this.clearStencilValue=0,this.transientViewport={x:1/0,y:0,width:0,height:0},this.cachedViewport={x:0,y:0,width:0,height:0},this.clear=function(t){t.framebuffer;var n=t.color,r=t.depth,i=t.stencil;e.options.supportCompute&&e.startComputePass(),e.currentRenderTarget?(e.currentRenderPass&&e.endRenderTargetRenderPass(),e.startRenderTargetRenderPass(e.currentRenderTarget,n||null,!!r,!!i)):(e.mainColorAttachments[0].loadValue=n||As.Ws.Load,e.mainDepthAttachment.depthLoadValue=r||As.Ws.Load,e.mainDepthAttachment.stencilLoadValue=i?e.clearStencilValue:As.Ws.Load,e.mainRenderPass&&e.endMainRenderPass(),e.startMainRenderPass())},this.createModel=function(){var t=Tr(Sr().mark((function t(n){var r;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new zf(e,n),t.next=3,r.init();case 3:return t.abrupt("return",r);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.createAttribute=function(t){return new _f(e,t)},this.createBuffer=function(t){return new xf(e,t)},this.createElements=function(t){return new Ef(e,t)},this.createTexture2D=function(t){return new jf(e,t)},this.createFramebuffer=function(t){return new Sf(e,t)},this.useFramebuffer=function(t,n){e.currentRenderTarget&&e.unbindFramebuffer(e.currentRenderTarget),e.currentRenderTarget=t,e.currentRenderTargetViewDescriptor={dimension:As.p_.E2d,arrayLayerCount:1,aspect:As.H7.All},e.currentRenderPass=null,n()},this.createComputeModel=function(){var t=Tr(Sr().mark((function t(n){var r;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new wf(e,n),t.next=3,r.init();case 3:return t.abrupt("return",r);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.getCanvas=function(){return e.canvas},this.getGLContext=function(){throw new Error("Method not implemented.")},this.viewport=function(t){var n=t.x,r=t.y,i=t.width,o=t.height;e.currentRenderPass?e.transientViewport.x!==1/0?e.getCurrentRenderPass().setViewport(e.transientViewport.x,e.transientViewport.y,e.transientViewport.width,e.transientViewport.height,0,1):n===e.cachedViewport.x&&r===e.cachedViewport.y&&i===e.cachedViewport.width&&o===e.cachedViewport.height||(e.cachedViewport={x:n,y:r,width:i,height:o},e.getCurrentRenderPass().setViewport(n,r,i,o,0,1)):e.transientViewport={x:n,y:r,width:i,height:o}},this.readPixels=function(t){throw new Error("Method not implemented.")}}var e,n;return xr(t,[{key:"isFloatSupported",value:function(){return!0}},{key:"init",value:(n=Tr(Sr().mark((function t(e){return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.canvas=e.canvas,this.options=e,this.useWGSL=!!e.useWGSL,this.mainPassSampleCount=e.antialiasing?this.defaultSampleCount:1,t.next=6,this.initGlslang();case 6:this.initContextAndSwapChain(),this.initMainAttachments();case 8:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"setScissor",value:function(t){throw new Error("Method not implemented.")}},{key:"destroy",value:function(){this.mainTexture&&this.mainTexture.destroy(),this.depthTexture&&this.depthTexture.destroy(),this.tempBuffers.forEach((function(t){return t.destroy()})),this.tempBuffers=[]}},{key:"beginFrame",value:function(){this.uploadEncoder=this.device.createCommandEncoder(this.uploadEncoderDescriptor),this.renderEncoder=this.device.createCommandEncoder(this.renderEncoderDescriptor),this.renderTargetEncoder=this.device.createCommandEncoder(this.renderTargetEncoderDescriptor),this.options.supportCompute&&(this.computeEncoder=this.device.createCommandEncoder(this.computeEncoderDescriptor))}},{key:"endFrame",value:function(){this.options.supportCompute&&this.endComputePass(),this.endMainRenderPass(),this.commandBuffers[0]=this.uploadEncoder.finish(),this.commandBuffers[1]=this.renderEncoder.finish(),this.options.supportCompute&&(this.commandBuffers[2]=this.computeEncoder.finish()),this.commandBuffers[3]=this.renderTargetEncoder.finish(),Qu?this.device.getQueue().submit(this.commandBuffers.filter((function(t){return t}))):this.device.defaultQueue.submit(this.commandBuffers.filter((function(t){return t})))}},{key:"getCurrentRenderPass",value:function(){return this.currentRenderTarget&&!this.currentRenderPass?this.startRenderTargetRenderPass(this.currentRenderTarget,null,!1,!1):this.currentRenderPass||this.startMainRenderPass(),this.currentRenderPass}},{key:"initGlslang",value:(e=Tr(Sr().mark((function t(){var e,n;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,lf();case 2:return this.glslang=t.sent,t.next=5,null===(e=navigator)||void 0===e||null===(n=e.gpu)||void 0===n?void 0:n.requestAdapter();case 5:return this.adapter=t.sent,t.next=8,this.adapter.requestDevice();case 8:this.device=t.sent;case 9:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"initContextAndSwapChain",value:function(){this.context=this.canvas.getContext(Qu?"gpu":"gpupresent"),this.swapChain=this.context.configureSwapChain({device:this.device,format:this.options.swapChainFormat,usage:As.v2.OutputAttachment|As.v2.CopySrc})}},{key:"initMainAttachments",value:function(){if(this.mainTextureExtends={width:this.canvas.width,height:this.canvas.height,depth:1},this.options.antialiasing){var t={size:this.mainTextureExtends,mipLevelCount:1,sampleCount:this.mainPassSampleCount,dimension:As.kd.E2d,format:As.EV.BGRA8Unorm,usage:As.v2.OutputAttachment};this.mainTexture&&this.mainTexture.destroy(),this.mainTexture=this.device.createTexture(t),this.mainColorAttachments=[{attachment:Qu?this.mainTexture.createDefaultView():this.mainTexture.createView(),loadValue:[0,0,0,1],storeOp:As.EG.Store}]}else this.mainColorAttachments=[{attachment:Qu?this.swapChain.getCurrentTexture().createDefaultView():this.swapChain.getCurrentTexture().createView(),loadValue:[0,0,0,1],storeOp:As.EG.Store}];var e={size:this.mainTextureExtends,mipLevelCount:1,sampleCount:this.mainPassSampleCount,dimension:As.kd.E2d,format:Qu?"depth32float-stencil8":As.EV.Depth24PlusStencil8,usage:As.v2.OutputAttachment};this.depthTexture&&this.depthTexture.destroy(),this.depthTexture=this.device.createTexture(e),this.mainDepthAttachment={attachment:Qu?this.depthTexture.createDefaultView():this.depthTexture.createView(),depthLoadValue:this.clearDepthValue,depthStoreOp:As.EG.Store,stencilLoadValue:this.clearStencilValue,stencilStoreOp:As.EG.Store}}},{key:"startComputePass",value:function(){this.currentComputePass&&this.endComputePass(),this.currentComputePass=this.computeEncoder.beginComputePass()}},{key:"startMainRenderPass",value:function(){this.currentRenderPass&&!this.currentRenderTarget&&this.endMainRenderPass(),this.options.antialiasing?this.mainColorAttachments[0].resolveTarget=Qu?this.swapChain.getCurrentTexture().createDefaultView():this.swapChain.getCurrentTexture().createView():this.mainColorAttachments[0].attachment=Qu?this.swapChain.getCurrentTexture().createDefaultView():this.swapChain.getCurrentTexture().createView(),this.currentRenderPass=this.renderEncoder.beginRenderPass({colorAttachments:this.mainColorAttachments,depthStencilAttachment:this.mainDepthAttachment}),this.mainRenderPass=this.currentRenderPass,this.cachedViewport&&this.viewport(this.cachedViewport)}},{key:"startRenderTargetRenderPass",value:function(t,e,n){var r,i,o,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],u=null===(r=t.get().color)||void 0===r?void 0:r.texture;u&&(o=u.createView(this.currentRenderTargetViewDescriptor));var s,c=null===(i=t.get().depth)||void 0===i?void 0:i.texture;c&&(s=c.createView());var f=this.renderTargetEncoder.beginRenderPass({colorAttachments:[{attachment:o,loadValue:null!==e?e:As.Ws.Load,storeOp:As.EG.Store}],depthStencilAttachment:c&&s?{attachment:s,depthLoadValue:n?this.clearDepthValue:As.Ws.Load,depthStoreOp:As.EG.Store,stencilLoadValue:a?this.clearStencilValue:As.Ws.Load,stencilStoreOp:As.EG.Store}:void 0});this.currentRenderPass=f,this.cachedViewport&&this.viewport(this.cachedViewport)}},{key:"endMainRenderPass",value:function(){this.currentRenderPass===this.mainRenderPass&&null!==this.currentRenderPass&&(this.currentRenderPass.endPass(),this.resetCachedViewport(),this.currentRenderPass=null,this.mainRenderPass=null)}},{key:"endComputePass",value:function(){this.currentComputePass&&(this.currentComputePass.endPass(),this.currentComputePass=null)}},{key:"endRenderTargetRenderPass",value:function(){this.currentRenderPass&&(this.currentRenderPass.endPass(),this.resetCachedViewport())}},{key:"resetCachedViewport",value:function(){this.cachedViewport={x:0,y:0,width:0,height:0}}},{key:"unbindFramebuffer",value:function(t){this.currentRenderPass&&this.currentRenderPass!==this.mainRenderPass&&this.endRenderTargetRenderPass(),this.transientViewport.x=1/0,this.currentRenderTarget=null,this.currentRenderPass=this.mainRenderPass}}]),t}(),Uf=Ff))||Uf;var Vf,Xf=4/64,Hf=(0,Mr.b2)()(Bf=function(t){Br(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vr(e);if(n){var i=Vr(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wr(this,t)});function i(){return br(this,i),r.apply(this,arguments)}return xr(i,[{key:"onEntityCreated",value:function(){var t=this.config,e=t.widthSegments,n=void 0===e?1:e,r=t.heightSegments,i=void 0===r?1:r,o=t.depthSegments,a=void 0===o?1:o,u=t.halfExtents,s=n,c=i,f=a,l=Or(void 0===u?hi(.5,.5,.5):u,3),h=l[0],d=l[1],p=l[2],v=[hi(-h,-d,p),hi(h,-d,p),hi(h,d,p),hi(-h,d,p),hi(h,-d,-p),hi(-h,-d,-p),hi(-h,d,-p),hi(h,d,-p)],g=[[0,1,3],[4,5,7],[3,2,6],[1,0,4],[1,4,2],[5,0,6]],y=[[0,0,1],[0,0,-1],[0,1,0],[0,-1,0],[1,0,0],[-1,0,0]],m=[],b=[],_=[],x=[],w=[],E=0,S=function(t,e,n){var r,i,o,a;for(o=0;o<=e;o++)for(a=0;a<=n;a++){var u=ci(),s=ci(),c=ci(),f=ci();_i(u,v[g[t][0]],v[g[t][1]],o/e),_i(s,v[g[t][0]],v[g[t][2]],a/n),Ei(c,s,v[g[t][0]]),vi(f,u,c),r=o/e,i=a/n,m.push(f[0],f[1],f[2]),b.push(y[t][0],y[t][1],y[t][2]),_.push(r,i),r=.875*(r/=3)+Xf,i=.875*(i/=3)+Xf,r+=t%3/3,i+=Math.floor(t/3)/3,x.push(r,i),o<e&&a<n&&(w.push(E+n+1,E+1,E),w.push(E+n+1,E+n+2,E+1)),E++}};S(0,s,c),S(1,s,c),S(2,s,f),S(3,s,f),S(4,f,c),S(5,f,c);var A=qu(m),T=this.getComponent();T.indices=Uint32Array.from(w),T.aabb=A,T.vertexCount=E,T.attributes=[{dirty:!0,name:"position",data:Float32Array.from(m),arrayStride:12,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float3"}]},{dirty:!0,name:"normal",data:Float32Array.from(b),arrayStride:12,stepMode:"vertex",attributes:[{shaderLocation:1,offset:0,format:"float3"}]},{dirty:!0,name:"uv",data:Float32Array.from(_),arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:2,offset:0,format:"float2"}]}]}}]),i}(Ss))||Bf;var qf,Yf=(0,Mr.b2)()(Vf=function(t){Br(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vr(e);if(n){var i=Vr(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wr(this,t)});function i(){return br(this,i),r.apply(this,arguments)}return xr(i,[{key:"onEntityCreated",value:function(){var t=this.config.geometries,e=void 0===t?[]:t,n=this.getComponent();n.aabb=new uo;var r=[],i=[],o=0;e.forEach((function(t){var e=t.aabb,a=t.indices,u=t.vertexCount,s=t.attributes;n.aabb.add(e),n.vertexCount+=u,a&&i.push.apply(i,Wc(a.map((function(t){return t+o})))),o+=u,s.forEach((function(t,e){r[e]?t.data&&(ts(t.data)?r[e].push(t.data):Us(t.data)?r[e].data=function(t,e){if(!t&&!e)throw new Error("Please specify valid arguments for parameters a and b.");if(!e||0===e.length)return t;if(!t||0===t.length)return e;if(Object.prototype.toString.call(t)!==Object.prototype.toString.call(e))throw new Error("The types of the two arguments passed for parameters a and b do not match.");var n=new t.constructor(t.length+e.length);return n.set(t),n.set(e,t.length),n}(r[e].data,t.data):r[e].data=r[e].data.concat(t.data)):(r[e]=t,r[e].dirty=!0)}))})),n.attributes=r,n.indices=Uint32Array.from(i),n.dirty=!0}}]),i}(Ss))||Vf;var Kf,Zf=(0,Mr.b2)()(qf=function(t){Br(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vr(e);if(n){var i=Vr(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wr(this,t)});function i(){return br(this,i),r.apply(this,arguments)}return xr(i,[{key:"onEntityCreated",value:function(){for(var t=this.config,e=t.halfExtents,n=void 0===e?[.5,.5]:e,r=t.widthSegments,i=void 0===r?5:r,o=t.lengthSegments,a=void 0===o?5:o,u=[],s=[],c=[],f=[],l=0,h=0;h<=i;h++)for(var d=0;d<=a;d++){var p=-n[0]+2*n[0]*h/i,v=-(-n[1]+2*n[1]*d/a),g=h/i,y=d/a;u.push(p,0,v),s.push(0,1,0),c.push(g,y),h<i&&d<a&&(f.push(l+a+1,l+1,l),f.push(l+a+1,l+a+2,l+1)),l++}var m=qu(u),b=this.getComponent();b.indices=Uint32Array.from(f),b.aabb=m,b.vertexCount=l,b.attributes=[{dirty:!0,name:"position",data:Float32Array.from(u),arrayStride:12,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float3"}]},{dirty:!0,name:"normal",data:Float32Array.from(s),arrayStride:12,stepMode:"vertex",attributes:[{shaderLocation:1,offset:0,format:"float3"}]},{dirty:!0,name:"uv",data:Float32Array.from(c),arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:2,offset:0,format:"float2"}]}]}}]),i}(Ss))||qf;var $f,Jf,Qf,tl,el,nl,rl,il,ol=(0,Mr.b2)()(Kf=function(t){Br(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vr(e);if(n){var i=Vr(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wr(this,t)});function i(){return br(this,i),r.apply(this,arguments)}return xr(i,[{key:"onEntityCreated",value:function(){for(var t=this.config,e=t.radius,n=void 0===e?.5:e,r=t.latitudeBands,i=void 0===r?16:r,o=t.longitudeBands,a=void 0===o?16:o,u=[],s=[],c=[],f=[],l=0;l<=i;l++)for(var h=l*Math.PI/i,d=Math.sin(h),p=Math.cos(h),v=0;v<=a;v++){var g=2*v*Math.PI/a-Math.PI/2,y=Math.sin(g),m=Math.cos(g)*d,b=p,_=y*d,x=1-v/a,w=1-l/i;u.push(m*n,b*n,_*n),s.push(m,b,_),c.push(x,w)}for(var E=0;E<i;++E)for(var S=0;S<a;++S){var A=E*(a+1)+S,T=A+a+1;f.push(A+1,T,A),f.push(A+1,T+1,T)}var I=qu(u),C=this.getComponent();C.indices=Uint32Array.from(f),C.aabb=I,C.vertexCount=u.length/3,C.attributes=[{dirty:!0,name:"position",data:Float32Array.from(u),arrayStride:12,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float3"}]},{dirty:!0,name:"normal",data:Float32Array.from(s),arrayStride:12,stepMode:"vertex",attributes:[{shaderLocation:1,offset:0,format:"float3"}]},{dirty:!0,name:"uv",data:Float32Array.from(c),arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:2,offset:0,format:"float2"}]}]}}]),i}(Ss))||Kf;var al,ul,sl,cl,fl,ll,hl,dl,pl,vl,gl,yl,ml=($f=(0,Mr.b2)(),Jf=(0,Mr.f3)(Pr.RenderEngine),Qf=(0,Mr.f3)(Pr.ShaderModuleService),$f((il=function(t){Br(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vr(e);if(n){var i=Vr(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wr(this,t)});function i(){var t;br(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return mr(t=r.call.apply(r,[this].concat(n)),"engine",nl,jr(t)),mr(t,"shaderModuleService",rl,jr(t)),t}return xr(i,[{key:"onEntityCreated",value:function(){var t=this.getComponent(),e=this.engine.supportWebGPU?"layout(set = 0, binding = 0) uniform Uniforms {\n vec4 color;\n mat4 projectionMatrix;\n mat4 modelViewMatrix;\n} uniforms;\n\nlayout(location = 0) in vec3 position;\n// layout(location = 1) in vec3 barycentric;\n\nlayout(location = 0) out vec4 fragColor;\n// layout(location = 1) out vec3 v_Barycentric;\n\nvoid main() {\n gl_Position = uniforms.projectionMatrix * uniforms.modelViewMatrix * vec4(position, 1.0);\n fragColor = uniforms.color;\n // v_Barycentric = barycentric;\n}":'attribute vec3 position;\nattribute vec3 normal;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform vec4 color;\n\nvarying vec4 fragColor;\n\n#pragma include "uv.vert.declaration"\n\nvoid main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n fragColor = color;\n\n #pragma include "uv.vert.main"\n}',n=this.engine.supportWebGPU?"// layout(set = 0, binding = 1) uniform WireframeUniforms {\n// float lineWidth;\n// vec4 lineColor;\n// } wireframe;\n\nlayout(location = 0) in vec4 fragColor;\n// layout(location = 1) in vec3 v_Barycentric;\n\nlayout(location = 0) out vec4 outColor;\n\n// wireframe\n// float edgeFactor() {\n// vec3 d = fwidth(v_Barycentric);\n// vec3 a3 = smoothstep(vec3(0.0), d * wireframe.lineWidth, v_Barycentric);\n// return min(min(a3.x, a3.y), a3.z);\n// }\n\nvoid main() {\n // outColor = mix(fragColor, wireframe.lineColor, (1.0 - edgeFactor()));\n outColor = fragColor;\n}":'varying vec4 fragColor;\n\n#pragma include "uv.frag.declaration"\n#pragma include "map.frag.declaration"\n\nvoid main() {\n vec4 diffuseColor = fragColor;\n\n #pragma include "map.frag.main"\n\n gl_FragColor = diffuseColor;\n}';this.shaderModuleService.registerModule("material-basic",{vs:e,fs:n});var r=this.shaderModuleService.getModule("material-basic"),i=r.vs,o=r.fs,a=r.uniforms;t.vertexShaderGLSL=i,t.fragmentShaderGLSL=o,t.setUniform(a),this.config.map&&(t.setDefines({USE_UV:1,USE_MAP:1}),t.setUniform({map:this.config.map,uvTransform:si()}))}}]),i}(Ec),nl=wr((el=il).prototype,"engine",[Jf],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),rl=wr(el.prototype,"shaderModuleService",[Qf],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),tl=el))||tl);var bl,_l,xl,wl,El,Sl,Al,Tl,Il,Cl,Dl,Nl,kl=(al=(0,Mr.b2)(),ul=(0,Mr.f3)(Pr.Systems),sl=(0,Mr.t6)(Pr.MaterialSystem),cl=(0,Mr.f3)(Pr.Systems),fl=(0,Mr.t6)(Pr.GeometrySystem),ll=(0,Mr.f3)(Pr.ShaderModuleService),al((yl=function(t){Br(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vr(e);if(n){var i=Vr(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wr(this,t)});function i(){var t;br(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return mr(t=r.call.apply(r,[this].concat(n)),"materialSystem",pl,jr(t)),mr(t,"geometrySystem",vl,jr(t)),mr(t,"shaderModuleService",gl,jr(t)),t}return xr(i,[{key:"onAttributeChanged",value:function(t){var e=t.name,n=t.data,r=this.getMeshComponent();r&&r.material&&("gridColor"===e?(r.material.setUniform("u_GridColor",n),r.material.setUniform("u_GridColor2",n)):"gridSize"===e&&(r.material.setUniform("u_GridSize",n),r.material.setUniform("u_GridSize2",n)))}},{key:"onEntityCreated",value:function(){this.shaderModuleService.registerModule("grid",{vs:"attribute vec3 a_Position;\n\nvarying vec3 v_Position;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\n\nvoid main() {\n v_Position = a_Position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(a_Position, 1.);\n}",fs:"// generate grid, borrow from clay.gl viewer\n// @see https://github.com/pissang/clay-viewer/blob/master/src/graphic/ground.glsl\n#extension GL_OES_standard_derivatives : enable\n\nvarying vec3 v_Position;\n// varying vec3 v_Normal;\n\nuniform float u_GridSize : 5;\nuniform float u_GridSize2 : .5;\nuniform vec4 u_GridColor : [0, 0, 0, 1];\nuniform vec4 u_GridColor2 : [0.3, 0.3, 0.3, 1];\nuniform bool u_GridEnabled : true;\n\n// uniform vec3 u_LightDirection;\n// uniform vec3 u_LightColor;\n// uniform vec3 u_Camera;\n\nvoid main() {\n // vec3 n = v_Normal;\n // vec3 l = normalize(u_LightDirection);\n // float NdotL = clamp(dot(n, l), 0.001, 1.0);\n\n gl_FragColor = vec4(1.);\n\n if (u_GridEnabled) {\n float wx = v_Position.x;\n float wz = v_Position.z;\n // float x0 = abs(fract(wx / u_GridSize - 0.5) - 0.5) / fwidth(wx) * u_GridSize / 2.0;\n // float z0 = abs(fract(wz / u_GridSize - 0.5) - 0.5) / fwidth(wz) * u_GridSize / 2.0;\n\n float x1 = abs(fract(wx / u_GridSize2 - 0.5) - 0.5) / fwidth(wx) * u_GridSize2;\n float z1 = abs(fract(wz / u_GridSize2 - 0.5) - 0.5) / fwidth(wz) * u_GridSize2;\n\n // float v0 = 1.0 - clamp(min(x0, z0), 0.0, 1.0);\n float v1 = 1.0 - clamp(min(x1, z1), 0.0, 1.0);\n // if (v0 > 0.1) {\n // gl_FragColor = mix(gl_FragColor, u_GridColor, v0);\n // }\n // else {\n gl_FragColor = mix(gl_FragColor, u_GridColor2, v1);\n // }\n }\n\n // float shadowFactor = calcShadow(u_ShadowMap, v_PositionFromLight, l, n);\n // vec3 diffuseColor = u_LightColor * NdotL * shadowFactor;\n\n // gl_FragColor.rgb *= diffuseColor;\n}"});var t=this.shaderModuleService.getModule("grid"),e=t.vs,n=t.fs,r=t.uniforms,i=this.materialSystem.createShaderMaterial({vertexShader:e,fragmentShader:n});this.setMaterial(i);var o=this.geometrySystem.createBufferGeometry({vertexCount:4});this.setGeometry(o),i.setCull({enable:!1,face:Ri.BACK}).setDepth({enable:!0,func:Ri.LESS}),i.setUniform(r),this.setAttributes({gridColor:this.config.gridColor,gridSize:this.config.gridSize}),o.setIndex([0,3,2,2,1,0]),o.setAttribute("a_Position",Float32Array.from([-4,-1,-4,4,-1,-4,4,-1,4,-4,-1,4]),{arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float2"}]})}}]),i}(Sc),pl=wr((dl=yl).prototype,"materialSystem",[ul,sl],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),vl=wr(dl.prototype,"geometrySystem",[cl,fl],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),gl=wr(dl.prototype,"shaderModuleService",[ll],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),hl=dl))||hl),Rl=n(7801),Ol=n(1739);function Ml(t,e,n,r,i){Pl(e,r,-i),Pl(e,r,i),t.push(n),t.push(n)}function Pl(t,e,n){t.push([[e[0],e[1]],n])}var Gl,Ll,Ul,Fl,Bl,zl,jl,Wl,Vl,Xl,Hl,ql,Yl=(bl=(0,Mr.b2)(),_l=(0,Mr.f3)(Pr.Systems),xl=(0,Mr.t6)(Pr.MaterialSystem),wl=(0,Mr.f3)(Pr.Systems),El=(0,Mr.t6)(Pr.GeometrySystem),Sl=(0,Mr.f3)(Pr.ShaderModuleService),bl((Nl=function(t){Br(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vr(e);if(n){var i=Vr(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wr(this,t)});function i(){var t;br(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return mr(t=r.call.apply(r,[this].concat(n)),"materialSystem",Il,jr(t)),mr(t,"geometrySystem",Cl,jr(t)),mr(t,"shaderModuleService",Dl,jr(t)),t.vertexCount=void 0,t}return xr(i,[{key:"onAttributeChanged",value:function(t){var e=t.name,n=t.data,r=this.getMeshComponent();if(r&&r.material)switch(e){case"dashArray":r.material.setUniform("u_dash_array",n);break;case"dashOffset":r.material.setUniform("u_dash_offset",n);break;case"dashRatio":r.material.setUniform("u_dash_ratio",n);break;case"thickness":r.material.setUniform("u_thickness",n);break;case"color":var i=new Array(this.vertexCount).fill(void 0).map((function(){return n})).reduce((function(t,e){return[].concat(Wc(t),Wc(e))}),[]);r.geometry.setAttribute("a_color",Float32Array.from(i),{arrayStride:16,stepMode:"vertex",attributes:[{shaderLocation:1,offset:0,format:"float4"}]})}}},{key:"onEntityCreated",value:function(){var t=this;this.shaderModuleService.registerModule("line",{vs:"attribute vec2 a_pos;\nattribute vec4 a_color;\nattribute float a_line_miter;\nattribute vec2 a_line_normal;\nattribute float a_counters;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform float u_thickness : 0.02;\nuniform vec2 u_viewport;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_counters;\n\nvoid main() {\n v_color = a_color;\n v_counters = a_counters;\n\n vec3 normal = normalize(vec3(a_line_normal, 0.0));\n\n vec4 offset = vec4(normal * u_thickness / 2.0 * a_line_miter, 0.0);\n\n v_normal = vec2(normal * sign(a_line_miter));\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4(a_pos, 0.0, 1.0) + offset;\n}\n",fs:"uniform float u_dash_array : 0.02;\nuniform float u_dash_offset : 0;\nuniform float u_dash_ratio : 0;\nuniform float u_thickness : 0.02;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_counters;\n\nvoid main() {\n float blur = 1. - smoothstep(0.98, 1., length(v_normal));\n\n gl_FragColor = v_color;\n gl_FragColor.a *= blur * ceil(mod(v_counters + u_dash_offset, u_dash_array) - (u_dash_array * u_dash_ratio));\n}"});var e=this.shaderModuleService.getModule("line"),n=e.vs,r=e.fs,i=e.uniforms,o=this.materialSystem.createShaderMaterial({vertexShader:n,fragmentShader:r}),a=function(t,e,n){for(var r=[0,0],i=[0,0],o=[0,0],a=[0,0],u=-1,s=!1,c=null,f=(0,Rl.create)(),l=0,h=[],d=[],p=[],v=[0,0],g=t.length,y=1;y<g;y++){var m=l,b=t[y-1],_=t[y],x=y<t.length-1?t[y+1]:null;if(v.push(y/g,y/g),(0,Ol.o7)(r,_,b),c||(c=[0,0],(0,Ol.mJ)(c,r)),s||(s=!0,Ml(d,h,b,c,1)),p.push([m+0,m+1,m+2]),x){(0,Ol.o7)(i,x,_);var w=(0,Ol.x7)(o,a,r,i,1),E=(0,Rl.dot)(o,c)<0?-1:1,S=w>3;if(!isFinite(w)){(0,Ol.mJ)(c,r),Ml(d,h,_,c,1),p.push(1===u?[m,m+2,m+3]:[m+2,m+1,m+3]),l+=2,u=E;continue}S?(w=3,v.push(y/g),Pl(h,c,-E),d.push(_),Pl(h,a,w*E),d.push(_),p.push(u!==-E?[m,m+2,m+3]:[m+2,m+1,m+3]),p.push([m+2,m+3,m+4]),(0,Ol.mJ)(f,i),(0,Rl.copy)(c,f),Pl(h,c,-E),d.push(_),l+=3):(Ml(d,h,_,a,w),p.push(1===u?[m,m+2,m+3]:[m+2,m+1,m+3]),E=-1,(0,Rl.copy)(c,a),l+=2),u=E}else(0,Ol.mJ)(c,r),Ml(d,h,_,c,1),p.push(1===u?[m,m+2,m+3]:[m+2,m+1,m+3]),l+=2}return{normals:h,attrIndex:p,attrPos:d,attrCounters:v}}(this.config.points),u=a.normals,s=a.attrIndex,c=a.attrPos,f=a.attrCounters,l=c.length;this.vertexCount=l;var h=this.geometrySystem.createBufferGeometry({vertexCount:l});this.setMaterial(o),this.setGeometry(h),o.setCull({enable:!1,face:Ri.BACK}).setUniform(i),this.setAttributes({dashArray:this.config.dashArray,dashOffset:this.config.dashOffset,dashRatio:this.config.dashRatio,thickness:this.config.thickness});var d=[],p=[];u.forEach((function(t){var e=t[0],n=t[1];d.push([e[0],e[1]]),p.push(n)})),h.setIndex(s.reduce((function(t,e){return[].concat(Wc(t),Wc(e))}),[])),h.setAttribute("a_pos",Float32Array.from(c.reduce((function(t,e){return[].concat(Wc(t),Wc(e))}),[])),{arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float2"}]});var v=new Array(l).fill(void 0).map((function(){return Wc(t.config.color)})).reduce((function(t,e){return[].concat(Wc(t),Wc(e))}),[]);h.setAttribute("a_color",Float32Array.from(v),{arrayStride:16,stepMode:"vertex",attributes:[{shaderLocation:1,offset:0,format:"float4"}]}),h.setAttribute("a_line_miter",Float32Array.from(p),{arrayStride:4,stepMode:"vertex",attributes:[{shaderLocation:2,offset:0,format:"float"}]}),h.setAttribute("a_line_normal",Float32Array.from(d.reduce((function(t,e){return[].concat(Wc(t),Wc(e))}),[])),{arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:3,offset:0,format:"float2"}]}),h.setAttribute("a_counters",Float32Array.from(f),{arrayStride:4,stepMode:"vertex",attributes:[{shaderLocation:4,offset:0,format:"float"}]})}}]),i}(Sc),Il=wr((Tl=Nl).prototype,"materialSystem",[_l,xl],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Cl=wr(Tl.prototype,"geometrySystem",[wl,El],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Dl=wr(Tl.prototype,"shaderModuleService",[Sl],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Al=Tl))||Al);function Kl(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}var Zl,$l,Jl,Ql,th,eh,nh,rh,ih,oh,ah=["circle","triangle","square","pentagon","hexagon","octogon","hexagram","rhombus","vesica"],uh=(Gl=(0,Mr.b2)(),Ll=(0,Mr.f3)(Pr.Systems),Ul=(0,Mr.t6)(Pr.MaterialSystem),Fl=(0,Mr.f3)(Pr.Systems),Bl=(0,Mr.t6)(Pr.GeometrySystem),zl=(0,Mr.f3)(Pr.ShaderModuleService),Gl((ql=function(t){Br(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Vr(e);if(n){var i=Vr(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Wr(this,t)});function i(){var t;br(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return mr(t=r.call.apply(r,[this].concat(n)),"materialSystem",Vl,jr(t)),mr(t,"geometrySystem",Xl,jr(t)),mr(t,"shaderModuleService",Hl,jr(t)),t}return xr(i,[{key:"onAttributeChanged",value:function(t){var e=t.name,n=t.data,r=this.getMeshComponent();r&&r.material&&("strokeWidth"===e?r.material.setUniform("u_stroke_width",n):"strokeColor"===e?r.material.setUniform("u_stroke_color",n):"strokeOpacity"===e?r.material.setUniform("u_stroke_opacity",n):"opacity"===e?r.material.setUniform("u_opacity",n):"blur"===e&&r.material.setUniform("u_blur",n))}},{key:"onEntityCreated",value:function(){this.shaderModuleService.registerModule("grid",{vs:'attribute vec2 position;\nattribute vec4 color;\nattribute float shape;\nattribute vec2 offset;\nattribute float size;\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\n\nuniform float u_stroke_width : 0.01;\nuniform float u_device_pixel_ratio;\nuniform vec2 u_viewport;\n\nvarying vec4 v_color;\nvarying vec4 v_data;\nvarying float v_radius;\n\n#pragma include "picking"\n\nvoid main() {\n v_color = color;\n v_radius = size;\n\n lowp float antialiasblur = 1.0 / u_device_pixel_ratio * (size + u_stroke_width);\n\n // construct point coords\n v_data = vec4(position, antialiasblur, shape);\n\n gl_Position = projectionMatrix * modelViewMatrix\n * vec4(position * size + offset, 0.0, 1.0);\n\n setPickingColor(a_PickingColor);\n}',fs:"uniform float u_blur : 0.05;\nuniform float u_opacity : 0.7;\nuniform float u_stroke_width : 0.01;\nuniform vec4 u_stroke_color : [0, 0, 0, 0];\nuniform float u_stroke_opacity : 1;\n\nvarying vec4 v_color;\nvarying vec4 v_data;\nvarying float v_radius;\n\n#pragma include \"sdf2d\"\n#pragma include \"picking\"\n\nvoid main() {\n int shape = int(floor(v_data.w + 0.5));\n\n float antialiasblur = v_data.z;\n float antialiased_blur = -max(u_blur, antialiasblur);\n float r = v_radius / (v_radius + u_stroke_width);\n\n float outer_df;\n float inner_df;\n // 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'\n // if (shape == 0) {\n outer_df = sdCircle(v_data.xy, 1.0);\n inner_df = sdCircle(v_data.xy, r);\n // } else if (shape == 1) {\n // outer_df = sdEquilateralTriangle(1.1 * v_data.xy);\n // inner_df = sdEquilateralTriangle(1.1 / r * v_data.xy);\n // } else if (shape == 2) {\n // outer_df = sdBox(v_data.xy, vec2(1.));\n // inner_df = sdBox(v_data.xy, vec2(r));\n // } else if (shape == 3) {\n // outer_df = sdPentagon(v_data.xy, 0.8);\n // inner_df = sdPentagon(v_data.xy, r * 0.8);\n // } else if (shape == 4) {\n // outer_df = sdHexagon(v_data.xy, 0.8);\n // inner_df = sdHexagon(v_data.xy, r * 0.8);\n // } else if (shape == 5) {\n // outer_df = sdOctogon(v_data.xy, 1.0);\n // inner_df = sdOctogon(v_data.xy, r);\n // } else if (shape == 6) {\n // outer_df = sdHexagram(v_data.xy, 0.52);\n // inner_df = sdHexagram(v_data.xy, r * 0.52);\n // } else if (shape == 7) {\n // outer_df = sdRhombus(v_data.xy, vec2(1.0));\n // inner_df = sdRhombus(v_data.xy, vec2(r));\n // } else if (shape == 8) {\n // outer_df = sdVesica(v_data.xy, 1.1, 0.8);\n // inner_df = sdVesica(v_data.xy, r * 1.1, r * 0.8);\n // }\n\n float opacity_t = smoothstep(0.0, antialiased_blur, outer_df);\n\n float color_t = u_stroke_width < 0.01 ? 0.0 : smoothstep(\n antialiased_blur,\n 0.0,\n inner_df\n );\n vec4 strokeColor = u_stroke_color == vec4(0) ? v_color : u_stroke_color;\n\n gl_FragColor = mix(vec4(v_color.rgb, v_color.a * u_opacity), strokeColor * u_stroke_opacity, color_t);\n gl_FragColor.a = gl_FragColor.a * opacity_t;\n\n gl_FragColor = filterColor(gl_FragColor);\n}"});var t=this.shaderModuleService.getModule("grid"),e=t.vs,n=t.fs,r=t.uniforms,i=this.materialSystem.createShaderMaterial({vertexShader:e,fragmentShader:n,cull:{enable:!1},depth:{enable:!1},blend:{enable:!0,func:{srcRGB:Ri.SRC_ALPHA,dstRGB:Ri.ONE_MINUS_SRC_ALPHA,srcAlpha:1,dstAlpha:1}}});i.setUniform(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Kl(Object(n),!0).forEach((function(e){ni(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Kl(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({u_device_pixel_ratio:window.devicePixelRatio},r));var o=this.buildAttributes(),a=this.geometrySystem.createInstancedBufferGeometry({maxInstancedCount:o.instancedOffsets.length/2,vertexCount:6});a.setIndex([0,2,1,0,3,2]),a.setAttribute("position",Float32Array.from(o.positions),{arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float2"}]}),a.setAttribute("offset",Float32Array.from(o.instancedOffsets),{arrayStride:8,stepMode:"instance",attributes:[{shaderLocation:1,offset:0,format:"float2"}]}),a.setAttribute("color",Float32Array.from(o.instancedColors),{arrayStride:16,stepMode:"instance",attributes:[{shaderLocation:2,offset:0,format:"float4"}]}),a.setAttribute("size",Float32Array.from(o.instancedSizes),{arrayStride:4,stepMode:"instance",attributes:[{shaderLocation:3,offset:0,format:"float"}]}),a.setAttribute("shape",Float32Array.from(o.instancedShapes),{arrayStride:4,stepMode:"instance",attributes:[{shaderLocation:4,offset:0,format:"float"}]}),a.setAttribute("a_PickingColor",Float32Array.from(o.instancedPickingColors),{arrayStride:12,stepMode:"instance",attributes:[{shaderLocation:6,offset:0,format:"float3"}]}),this.setMaterial(i),this.setGeometry(a)}},{key:"buildAttribute",value:function(t,e,n){var r,i,o,a,u;(r=e.instancedPickingColors).push.apply(r,Wc([(u=t.id||n)+1&255,u+1>>8&255,u+1>>8>>8&255])),e.instancedShapes.push(ah.indexOf(t.shape||"circle")),(i=e.instancedColors).push.apply(i,Wc(t.color||[1,0,0,1])),(o=e.instancedOffsets).push.apply(o,Wc(t.position||[0,0])),(a=e.instancedSizes).push.apply(a,Wc(t.size||[.2,.2]))}},{key:"buildAttributes",value:function(){var t=this,e={positions:[1,1,1,-1,-1,-1,-1,1],instancedOffsets:[],instancedColors:[],instancedSizes:[],instancedShapes:[],instancedPickingColors:[]};return Array.isArray(this.config)?this.config.forEach((function(n,r){t.buildAttribute(n,e,r)})):this.buildAttribute(this.config,e,0),e}}]),i}(Sc),Vl=wr((Wl=ql).prototype,"materialSystem",[Ll,Ul],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Xl=wr(Wl.prototype,"geometrySystem",[Fl,Bl],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Hl=wr(Wl.prototype,"shaderModuleService",[zl],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),jl=Wl))||jl);function sh(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return ch(t,e);var n=Object.prototype.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)?ch(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function ch(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var fh,lh,hh,dh,ph,vh,gh,yh,mh,bh,_h,xh,wh=(Zl=(0,Mr.b2)(),$l=(0,Mr.f3)(Pr.RenderEngine),Jl=(0,Mr.f3)(Pr.ShaderModuleService),Ql=(0,Mr.f3)(Pr.ConfigService),Zl((oh=function(){function t(){br(this,t),this.container=void 0,mr(this,"engine",nh,this),mr(this,"shaderModule",rh,this),mr(this,"configService",ih,this),this.inited=!1,this.rendering=!1,this.pendings=[],this.views=[],this.size=void 0}var e,n;return xr(t,[{key:"init",value:(n=Tr(Sr().mark((function t(){var e,n,r,i,o;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.shaderModule.registerBuiltinModules(),this.shaderModule.registerModule("uv.vert.declaration",{vs:"#ifdef USE_UV\n attribute vec2 uv;\n\t#ifdef UVS_VERTEX_ONLY\n vec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif"}),this.shaderModule.registerModule("uv.vert.main",{vs:"#ifdef USE_UV\n vUv = (uvTransform * vec3(uv, 1)).xy;\n#endif"}),this.shaderModule.registerModule("uv.frag.declaration",{fs:"#if (defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ))\n varying vec2 vUv;\n#endif"}),this.shaderModule.registerModule("map.frag.declaration",{fs:"#ifdef USE_MAP\n uniform sampler2D map;\n#endif"}),this.shaderModule.registerModule("map.frag.main",{fs:"#ifdef USE_MAP\n vec4 texelColor = texture2D(map, vUv);\n // texelColor = mapTexelToLinear(texelColor);\n diffuseColor *= texelColor;\n#endif"}),e=this.container.getAll(Pr.Systems),!(n=this.configService.get()).canvas){t.next=30;break}return t.next=11,this.engine.init({canvas:n.canvas,swapChainFormat:As.EV.BGRA8Unorm,antialiasing:!1});case 11:r=sh(e),t.prev=12,r.s();case 14:if((i=r.n()).done){t.next=21;break}if(!(o=i.value).initialize){t.next=19;break}return t.next=19,o.initialize();case 19:t.next=14;break;case 21:t.next=26;break;case 23:t.prev=23,t.t0=t.catch(12),r.e(t.t0);case 26:return t.prev=26,r.f(),t.finish(26);case 29:this.inited=!0;case 30:case"end":return t.stop()}}),t,this,[[12,23,26,29]])}))),function(){return n.apply(this,arguments)})},{key:"render",value:(e=Tr(Sr().mark((function t(){var e,n,r,i,o,a,u,s=arguments;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.inited&&!this.rendering){t.next=2;break}return t.abrupt("return");case 2:for(this.pendings.length&&this.pendings.forEach((function(t){t()})),this.rendering=!0,this.engine.beginFrame(),e=this.container.getAll(Pr.Systems),n=s.length,r=new Array(n),i=0;i<n;i++)r[i]=s[i];o=sh(e),t.prev=8,o.s();case 10:if((a=o.n()).done){t.next=17;break}if(!(u=a.value).execute){t.next=15;break}return t.next=15,u.execute(r);case 15:t.next=10;break;case 17:t.next=22;break;case 19:t.prev=19,t.t0=t.catch(8),o.e(t.t0);case 22:return t.prev=22,o.f(),t.finish(22);case 25:this.engine.endFrame(),this.rendering=!1;case 27:case"end":return t.stop()}}),t,this,[[8,19,22,25]])}))),function(){return e.apply(this,arguments)})},{key:"clear",value:function(t){var e=this;return this.inited?this.engine.clear(t):this.pendings.unshift((function(){e.engine.clear(t),e.pendings.shift()})),this}},{key:"setSize",value:function(t){var e=t.width,n=t.height,r=this.engine.getCanvas();return this.size={width:e,height:n},r.width=e,r.height=n,this}},{key:"getSize",value:function(){return this.size}}]),t}(),nh=wr((eh=oh).prototype,"engine",[$l],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),rh=wr(eh.prototype,"shaderModule",[Jl],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ih=wr(eh.prototype,"configService",[Ql],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),th=eh))||th),Eh=(0,Mr.b2)()((lh=function(){function t(){br(this,t),this.entities=[]}return xr(t,[{key:"getEntities",value:function(){return this.entities}},{key:"addRenderable",value:function(t){return this.addEntity(t.getEntity()),this}},{key:"removeRenderable",value:function(t){return this.removeEntity(t.getEntity()),this}},{key:"addLight",value:function(){}},{key:"addEntity",value:function(t){return-1===this.entities.indexOf(t)&&this.entities.push(t),this}},{key:"removeEntity",value:function(t){var e=this.entities.indexOf(t);return this.entities.splice(e,1),this}}]),t}(),fh=lh))||fh,Sh=(0,Mr.b2)()((dh=function(){function t(){br(this,t),this.cache={}}return xr(t,[{key:"get",value:function(t){return this.cache[t]}},{key:"set",value:function(t,e){this.cache[t]=e}}]),t}(),hh=dh))||hh;function Ah(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 Th(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ah(Object(n),!0).forEach((function(e){ni(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ah(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Ih,Ch,Dh,Nh,kh,Rh,Oh,Mh,Ph,Gh,Lh,Uh,Fh,Bh=(ph=(0,Mr.b2)(),vh=(0,Mr.f3)(Sh),gh=(0,Mr.f3)(Pr.RenderEngine),ph((xh=function(){function t(){br(this,t),mr(this,"textureCache",bh,this),mr(this,"engine",_h,this),this.config=void 0,this.loaded=!1,this.texture=void 0}var e;return xr(t,[{key:"setConfig",value:function(t){this.config=t}},{key:"isLoaded",value:function(){return this.loaded}},{key:"load",value:(e=Tr(Sr().mark((function t(){var e=this;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.config.url){t.next=4;break}return t.abrupt("return",new Promise((function(t,n){var r=e.textureCache.get(e.config.url);if(r)t(r);else{var i=new Image;i.crossOrigin="Anonymous",i.src=e.config.url,i.onload=function(){var n=e.engine.createTexture2D(Th(Th({},e.config),{},{data:i,width:i.width,height:i.height,flipY:!0}));e.textureCache.set(e.config.url,n),e.texture=n,e.loaded=!0,t(n)},i.onerror=function(){n()}}})));case 4:return this.loaded=!0,this.texture=this.engine.createTexture2D(this.config),t.abrupt("return",this.texture);case 7:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}]),t}(),bh=wr((mh=xh).prototype,"textureCache",[vh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),_h=wr(mh.prototype,"engine",[gh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),yh=mh))||yh),zh=(Ih=(0,Mr.b2)(),Ch=(0,Mr.f3)(Pr.Systems),Dh=(0,Mr.t6)(Pr.RendererSystem),Ih((Oh=function(){function t(){br(this,t),mr(this,"rendererSystem",Rh,this),this.camera=void 0,this.scene=void 0,this.viewport={x:0,y:0,width:0,height:0},this.clearColor=[1,1,1,1]}return xr(t,[{key:"getCamera",value:function(){return this.camera}},{key:"getScene",value:function(){return this.scene}},{key:"getViewport",value:function(){return this.viewport}},{key:"getClearColor",value:function(){return this.clearColor}},{key:"setCamera",value:function(t){return this.camera=t,this}},{key:"setScene",value:function(t){return this.scene=t,this}},{key:"setViewport",value:function(t){return this.viewport=t,this}},{key:"setClearColor",value:function(t){return this.clearColor=t,this}},{key:"pick",value:function(t){return this.rendererSystem.pick(t,this)}}]),t}(),Rh=wr((kh=Oh).prototype,"rendererSystem",[Ch,Dh],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Nh=kh))||Nh);function jh(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 Wh(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?jh(Object(n),!0).forEach((function(e){ni(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):jh(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Vh=(Mh=(0,Mr.b2)(),Ph=(0,Mr.f3)(Pr.ConfigService),Mh((Fh=function(){function t(){br(this,t),mr(this,"configService",Uh,this),this.container=void 0}var e;return xr(t,[{key:"getEngine",value:(e=Tr(Sr().mark((function t(){var e,n,r,i;return Sr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.container.get(Pr.RenderEngine),n=this.configService.get(),r=n.canvas,i=n.engineOptions,t.next=4,e.init(Wh({canvas:r||Ts(),swapChainFormat:As.EV.BGRA8Unorm,antialiasing:!1},i));case 4:return t.abrupt("return",e);case 5:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"getTransformComponent",value:function(t){return this.container.get(Pr.TransformComponentManager).getComponentByEntity(t)}},{key:"getMeshComponent",value:function(t){return this.container.get(Pr.MeshComponentManager).getComponentByEntity(t)}},{key:"setConfig",value:function(t){this.configService.set(t)}},{key:"setContainer",value:function(t){this.container=t}},{key:"getContainer",value:function(){return this.container}},{key:"createEntity",value:function(){return Cr()}},{key:"createScene",value:function(){return this.container.get(Eh)}},{key:"createCamera",value:function(){return this.container.get(Es)}},{key:"createView",value:function(){return this.container.get(zh)}},{key:"createRenderable",value:function(t,e){var n=t?this.container.getNamed(Pr.Renderable,t):this.container.get(Sc),r=Cr();return n.setConfig(e||{}),n.setEntity(r),n}},{key:"createGeometry",value:function(t,e){var n=this.container.getNamed(Pr.Geometry,t),r=Cr();return n.setConfig(e||{}),n.setEntity(r),n.getComponent()}},{key:"createMaterial",value:function(t,e){var n=this.container.getNamed(Pr.Material,t),r=Cr();return n.setConfig(e||{}),n.setEntity(r,t),n.getComponent()}},{key:"createTexture2D",value:function(t){var e=this.container.get(Bh);return e.setConfig(t),e}},{key:"createBufferGeometry",value:function(t){return this.container.getNamed(Pr.Systems,Pr.GeometrySystem).createBufferGeometry(t)}},{key:"createInstancedBufferGeometry",value:function(t){return this.container.getNamed(Pr.Systems,Pr.GeometrySystem).createInstancedBufferGeometry(t)}},{key:"createShaderMaterial",value:function(t){return this.container.getNamed(Pr.Systems,Pr.MaterialSystem).createShaderMaterial(t)}},{key:"createKernel",value:function(t){var e=this.container.get(wc);return"string"==typeof t?e.setBundle(JSON.parse(t)):e.setBundle(t),e.init(),e}},{key:"createRenderer",value:function(){var t=this.container.get(wh);return t.container=this.container,t.init(),t}},{key:"destroy",value:function(){this.container.getAll(Pr.Systems).forEach((function(t){t.tearDown&&t.tearDown()})),this.container.get(Pr.RenderEngine).destroy(),this.container.get(Pr.InteractorService).destroy()}}],[{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=Hu(),r=navigator.gpu?Wf:cf;n.isBound(Pr.RenderEngine)||n.bind(Pr.RenderEngine).to(r).inSingletonScope(),n.bind(wh).toSelf(),n.bind(wc).toSelf(),n.bind(Sc).toSelf(),n.bind(zh).toSelf(),n.bind(Es).toSelf(),n.bind(Eh).toSelf(),n.bind(t).toSelf(),n.bind(Sh).toSelf(),n.bind(Bh).toSelf(),n.bind(Pr.Geometry).to(Hf).whenTargetNamed(Ss.BOX),n.bind(Pr.Geometry).to(ol).whenTargetNamed(Ss.SPHERE),n.bind(Pr.Geometry).to(Zf).whenTargetNamed(Ss.PLANE),n.bind(Pr.Geometry).to(Yf).whenTargetNamed(Ss.MERGED),n.bind(Pr.Material).to(ml).whenTargetNamed(Ec.BASIC),n.bind(Pr.Renderable).to(uh).whenTargetNamed(Sc.POINT),n.bind(Pr.Renderable).to(Yl).whenTargetNamed(Sc.LINE),n.bind(Pr.Renderable).to(kl).whenTargetNamed(Sc.GRID);var i=n.get(t);return i.setContainer(n),i.setConfig(e),i}}]),t}(),Uh=wr((Lh=Fh).prototype,"configService",[Ph],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Gh=Lh))||Gh),Xh=function(t,e){return t?a(t)?function(){return t}:t:function(){return e||1}},Hh=function(t){for(var e=[],n=t.length,r=t[0].length,i=function(r){t.forEach((function(t,i){if(e.push(t[r]),i===n-1)for(;e.length%4!=0;)e.push(0)}))},o=0;o<r;o++)i(o);return new Float32Array(e)},qh=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Yh=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{s(r.next(t))}catch(t){o(t)}}function u(t){try{s(r.throw(t))}catch(t){o(t)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}s((r=r.apply(t,e||[])).next())}))},Kh=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},Zh=function(t){function e(e){var n=t.call(this)||this;return n.maxIteration=1e3,n.gravity=10,n.speed=1,n.clustering=!1,n.clusterField="cluster",n.clusterGravity=10,n.workerEnabled=!1,n.nodes=[],n.edges=[],n.width=300,n.height=300,n.nodeMap={},n.nodeIdxMap={},n.updateCfg(e),n}return qh(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:1e3,gravity:10,speed:1,clustering:!1,clusterGravity:10}},e.prototype.execute=function(){return Yh(this,void 0,void 0,(function(){var t,e,n,r,i,o=this;return Kh(this,(function(u){switch(u.label){case 0:return(e=(t=this).nodes)&&0!==e.length?(t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),t.center||(t.center=[t.width/2,t.height/2]),n=t.center,1===e.length?(e[0].x=n[0],e[0].y=n[1],t.onLayoutEnd&&t.onLayoutEnd(),[2]):(r={},i={},e.forEach((function(t,e){a(t.x)||(t.x=Math.random()*o.width),a(t.y)||(t.y=Math.random()*o.height),r[t.id]=t,i[t.id]=e})),t.nodeMap=r,t.nodeIdxMap=i,[4,t.run()])):(t.onLayoutEnd&&t.onLayoutEnd(),[2]);case 1:return u.sent(),[2]}}))}))},e.prototype.executeWithWorker=function(t,e){return Yh(this,void 0,void 0,(function(){var n,r,i,o,u,s=this;return Kh(this,(function(c){switch(c.label){case 0:return r=(n=this).nodes,i=n.center,r&&0!==r.length?1===r.length?(r[0].x=i[0],r[0].y=i[1],[2]):(o={},u={},r.forEach((function(t,e){a(t.x)||(t.x=Math.random()*s.width),a(t.y)||(t.y=Math.random()*s.height),o[t.id]=t,u[t.id]=e})),n.nodeMap=o,n.nodeIdxMap=u,[4,n.run(t,e)]):[2];case 1:return c.sent(),[2]}}))}))},e.prototype.run=function(t,e){return Yh(this,void 0,void 0,(function(){var n,r,i,o,u,s,c,f,l,h,p,v,g,y,m,b,_,x,w,E,S,A,T,I,C,D,N=this;return Kh(this,(function(k){switch(k.label){case 0:for(r=(n=this).nodes,i=n.edges,o=n.maxIteration,u=n.center,s=n.height*n.width,c=Math.sqrt(s)/10,f=s/(r.length+1),l=Math.sqrt(f),h=n.speed,p=n.clustering,R=[n.clusterField],O=r,M=[],P=R.length,G={},O.forEach((function(t){R.forEach((function(e,n){if(void 0===G[t[e]]&&(G[t[e]]=Object.keys(G).length),M.push(G[t[e]]),n===P-1)for(;M.length%4!=0;)M.push(0)}))})),v={array:new Float32Array(M),count:Object.keys(G).length},g=v.array,y=v.count,r.forEach((function(t,e){var n=0,r=0;a(t.fx)&&a(t.fy)&&(n=t.fx||.001,r=t.fy||.001),g[4*e+1]=n,g[4*e+2]=r})),m=r.length,b=function(t,e){var n=[],r=[],i={},o=0;for(o=0;o<t.length;o++){var a=t[o];i[a.id]=o,n.push(a.x),n.push(a.y),n.push(0),n.push(0),r.push([])}for(o=0;o<e.length;o++){var u=e[o],s=d(u,"source"),c=d(u,"target");r[i[s]].push(i[c]),r[i[c]].push(i[s])}var f=0;for(o=0;o<t.length;o++){var l=n.length,h=r[o],p=h.length;n[4*o+2]=l,n[4*o+3]=h.length,f=Math.max(f,h.length);for(var v=0;v<p;++v){var g=h[v];n.push(+g)}}for(;n.length%4!=0;)n.push(0);return{maxEdgePerVetex:f,array:new Float32Array(n)}}(r,i),_=b.maxEdgePerVetex,x=b.array,w=n.workerEnabled,E=w?Vh.create({canvas:t,engineOptions:{supportCompute:!0}}):Vh.create({engineOptions:{supportCompute:!0}}),S=n.onLayoutEnd,A=[],T=0;T<y;T++)A.push(0,0,0,0);return I=E.createKernel('{"shaders":{"WGSL":"import \\"GLSL.std.450\\" as std;\\n\\n\\n# var gWebGPUDebug : bool = false;\\n# var gWebGPUDebugOutput : vec4<f32> = vec4<f32>(0.0);\\n\\n[[builtin global_invocation_id]] var<in> globalInvocationID : vec3<u32>;\\n# [[builtin work_group_size]] var<in> workGroupSize : vec3<u32>;\\n# [[builtin work_group_id]] var<in> workGroupID : vec3<u32>;\\n[[builtin local_invocation_id]] var<in> localInvocationID : vec3<u32>;\\n# [[builtin num_work_groups]] var<in> numWorkGroups : vec3<u32>;\\n[[builtin local_invocation_idx]] var<in> localInvocationIndex : u32;\\n\\ntype GWebGPUParams = [[block]] struct {\\n [[offset 0]] u_K : f32;\\n [[offset 4]] u_K2 : f32;\\n [[offset 8]] u_Center : vec2<f32>;\\n [[offset 16]] u_Gravity : f32;\\n [[offset 20]] u_ClusterGravity : f32;\\n [[offset 24]] u_Speed : f32;\\n [[offset 28]] u_MaxDisplace : f32;\\n [[offset 32]] u_Clustering : f32;\\n};\\n[[binding 0, set 0]] var<uniform> gWebGPUUniformParams : GWebGPUParams;\\ntype GWebGPUBuffer0 = [[block]] struct {\\n [[offset 0]] u_Data : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 1, set 0]] var<storage_buffer> gWebGPUBuffer0 : GWebGPUBuffer0;\\ntype GWebGPUBuffer1 = [[block]] struct {\\n [[offset 0]] u_AttributeArray : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 2, set 0]] var<storage_buffer> gWebGPUBuffer1 : GWebGPUBuffer1;\\ntype GWebGPUBuffer2 = [[block]] struct {\\n [[offset 0]] u_ClusterCenters : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 3, set 0]] var<storage_buffer> gWebGPUBuffer2 : GWebGPUBuffer2;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nfn calcRepulsive(i : i32, currentNode : vec4<f32>) -> vec2<f32> {var dx : f32 = 0.0;\\nvar dy : f32 = 0.0;\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {if (i != j) {var nextNode : vec4<f32> = gWebGPUBuffer0.u_Data[j];\\nvar xDist : f32 = currentNode.x - nextNode.x;\\nvar yDist : f32 = currentNode.y - nextNode.y;\\nvar dist : f32 = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\nvar param : f32 = gWebGPUUniformParams.u_K2 / dist;\\nif (dist > 0.0) {dx = dx + param * xDist;\\ndy = dy + param * yDist;\\nif ((xDist == 0.0) && (yDist == 0.0)) {var sign : f32 = select(1.0, -1.0, i < j);\\ndx = dx + param * std::sign;\\ndy = dy + param * std::sign;}}}}\\nreturn vec2<f32>(dx, dy);}\\nfn calcGravity(currentNode : vec4<f32>, nodeAttributes : vec4<f32>) -> vec2<f32> {var dx : f32 = 0.0;\\nvar dy : f32 = 0.0;\\nvar vx : f32 = currentNode.x - gWebGPUUniformParams.u_Center.x;\\nvar vy : f32 = currentNode.y - gWebGPUUniformParams.u_Center.y;\\nvar gf : f32 = (0.01 * gWebGPUUniformParams.u_K) * gWebGPUUniformParams.u_Gravity;\\ndx = gf * vx;\\ndy = gf * vy;\\nif (gWebGPUUniformParams.u_Clustering == 1.0) {var clusterIdx : i32 = i32(nodeAttributes.x);\\nvar center : vec4<f32> = gWebGPUBuffer2.u_ClusterCenters[clusterIdx];\\nvar cvx : f32 = currentNode.x - center.x;\\nvar cvy : f32 = currentNode.y - center.y;\\nvar dist : f32 = std::sqrt((cvx * cvx) + (cvy * cvy)) + 0.01;\\nvar parma : f32 = (gWebGPUUniformParams.u_K * gWebGPUUniformParams.u_ClusterGravity) / dist;\\ndx = dx + parma * cvx;\\ndy = dy + parma * cvy;}\\nreturn vec2<f32>(dx, dy);}\\nfn calcAttractive(i : i32, currentNode : vec4<f32>) -> vec2<f32> {var dx : f32 = 0.0;\\nvar dy : f32 = 0.0;\\nvar arr_offset : i32 = i32(std::floor(currentNode.z + 0.5));\\nvar length : i32 = i32(std::floor(currentNode.w + 0.5));\\nvar node_buffer : vec4<f32>;\\nfor (var p : i32 = 0; p < __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX; p = p + 1) {if (p >= length) {break;}\\nvar arr_idx : i32 = arr_offset + i32(p);\\nvar buf_offset : i32 = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = gWebGPUBuffer0.u_Data[i32(arr_idx / 4)];}\\nvar float_j : f32 = select(node_buffer.x, select(node_buffer.y, select(node_buffer.z, node_buffer.w, buf_offset == 2), buf_offset == 1), buf_offset == 0);\\nvar nextNode : vec4<f32> = gWebGPUBuffer0.u_Data[i32(float_j)];\\nvar xDist : f32 = currentNode.x - nextNode.x;\\nvar yDist : f32 = currentNode.y - nextNode.y;\\nvar dist : f32 = std::sqrt((xDist * xDist) + (yDist * yDist)) + 0.01;\\nvar attractiveF : f32 = dist / gWebGPUUniformParams.u_K;\\nif (dist > 0.0) {dx = dx - xDist * attractiveF;\\ndy = dy - yDist * attractiveF;\\nif ((xDist == 0.0) && (yDist == 0.0)) {var sign : f32 = select(1.0, -1.0, i < i32(float_j));\\ndx = dx - std::sign * attractiveF;\\ndy = dy - std::sign * attractiveF;}}}\\nreturn vec2<f32>(dx, dy);}\\nfn main() -> void {var i : i32 = globalInvocationID.x;\\nvar currentNode : vec4<f32> = gWebGPUBuffer0.u_Data[i];\\nvar dx : f32 = 0.0;\\nvar dy : f32 = 0.0;\\nif (i >= __DefineValuePlaceholder__VERTEX_COUNT) {gWebGPUBuffer0.u_Data[i] = currentNode;\\nreturn ;}\\nvar nodeAttributes : vec4<f32> = gWebGPUBuffer1.u_AttributeArray[i];\\nif ((nodeAttributes.y != 0.0) && (nodeAttributes.z != 0.0)) {gWebGPUBuffer0.u_Data[i] = vec4<f32>(nodeAttributes.y, nodeAttributes.z, currentNode.z, currentNode.w);\\nreturn ;}\\nvar repulsive : vec2<f32> = calcRepulsive(i, currentNode);\\ndx = dx + repulsive.x;\\ndy = dy + repulsive.y;\\nvar attractive : vec2<f32> = calcAttractive(i, currentNode);\\ndx = dx + attractive.x;\\ndy = dy + attractive.y;\\nvar gravity : vec2<f32> = calcGravity(currentNode, nodeAttributes);\\ndx = dx - gravity.x;\\ndy = dy - gravity.y;\\ndx = dx * gWebGPUUniformParams.u_Speed;\\ndy = dy * gWebGPUUniformParams.u_Speed;\\nvar distLength : f32 = std::sqrt((dx * dx) + (dy * dy));\\nif (distLength > 0.0) {var limitedDist : f32 = std::min(gWebGPUUniformParams.u_MaxDisplace * gWebGPUUniformParams.u_Speed, distLength);\\ngWebGPUBuffer0.u_Data[i] = vec4<f32>(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w);}\\nreturn;}\\n\\nentry_point compute as \\"main\\" = main;\\n","GLSL450":"\\n\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\nivec3 workGroupSize = ivec3(1,1,1);\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\n\\nlayout(std140, set = 0, binding = 0) uniform GWebGPUParams {\\n float u_K;\\n float u_K2;\\n vec2 u_Center;\\n float u_Gravity;\\n float u_ClusterGravity;\\n float u_Speed;\\n float u_MaxDisplace;\\n float u_Clustering;\\n} gWebGPUUniformParams;\\nlayout(std430, set = 0, binding = 1) buffer GWebGPUBuffer0 {\\n vec4 u_Data[];\\n} gWebGPUBuffer0;\\n\\nlayout(std430, set = 0, binding = 2) buffer readonly GWebGPUBuffer1 {\\n vec4 u_AttributeArray[];\\n} gWebGPUBuffer1;\\n\\nlayout(std430, set = 0, binding = 3) buffer readonly GWebGPUBuffer2 {\\n vec4 u_ClusterCenters[];\\n} gWebGPUBuffer2;\\n\\n\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\nlayout (\\n local_size_x = 1,\\n local_size_y = 1,\\n local_size_z = 1\\n) in;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nvec2 calcRepulsive(int i, vec4 currentNode) {float dx = 0.0;\\nfloat dy = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = gWebGPUBuffer0.u_Data[j];\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat param = gWebGPUUniformParams.u_K2 / dist;\\nif (dist > 0.0) {dx += param * xDist;\\ndy += param * yDist;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < j) ? (1.0) : (-1.0);\\ndx += param * sign;\\ndy += param * sign;}}}}\\nreturn vec2(dx, dy);}\\nvec2 calcGravity(vec4 currentNode, vec4 nodeAttributes) {float dx = 0.0;\\nfloat dy = 0.0;\\nfloat vx = currentNode.x - gWebGPUUniformParams.u_Center.x;\\nfloat vy = currentNode.y - gWebGPUUniformParams.u_Center.y;\\nfloat gf = (0.01 * gWebGPUUniformParams.u_K) * gWebGPUUniformParams.u_Gravity;\\ndx = gf * vx;\\ndy = gf * vy;\\nif (gWebGPUUniformParams.u_Clustering == 1.0) {int clusterIdx = int(nodeAttributes.x);\\nvec4 center = gWebGPUBuffer2.u_ClusterCenters[clusterIdx];\\nfloat cvx = currentNode.x - center.x;\\nfloat cvy = currentNode.y - center.y;\\nfloat dist = sqrt((cvx * cvx) + (cvy * cvy)) + 0.01;\\nfloat parma = (gWebGPUUniformParams.u_K * gWebGPUUniformParams.u_ClusterGravity) / dist;\\ndx += parma * cvx;\\ndy += parma * cvy;}\\nreturn vec2(dx, dy);}\\nvec2 calcAttractive(int i, vec4 currentNode) {float dx = 0.0;\\nfloat dy = 0.0;\\nint arr_offset = int(floor(currentNode.z + 0.5));\\nint length = int(floor(currentNode.w + 0.5));\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + int(p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = gWebGPUBuffer0.u_Data[int(arr_idx / 4)];}\\nfloat float_j = (buf_offset == 0) ? (node_buffer.x) : ((buf_offset == 1) ? (node_buffer.y) : ((buf_offset == 2) ? (node_buffer.z) : (node_buffer.w)));\\nvec4 nextNode = gWebGPUBuffer0.u_Data[int(float_j)];\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = sqrt((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat attractiveF = dist / gWebGPUUniformParams.u_K;\\nif (dist > 0.0) {dx -= xDist * attractiveF;\\ndy -= yDist * attractiveF;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < int(float_j)) ? (1.0) : (-1.0);\\ndx -= sign * attractiveF;\\ndy -= sign * attractiveF;}}}\\nreturn vec2(dx, dy);}\\nvoid main() {int i = globalInvocationID.x;\\nvec4 currentNode = gWebGPUBuffer0.u_Data[i];\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nif (i >= VERTEX_COUNT) {gWebGPUBuffer0.u_Data[i] = currentNode;\\nreturn ;}\\nvec4 nodeAttributes = gWebGPUBuffer1.u_AttributeArray[i];\\nif ((nodeAttributes.y != 0.0) && (nodeAttributes.z != 0.0)) {gWebGPUBuffer0.u_Data[i] = vec4(nodeAttributes.y, nodeAttributes.z, currentNode.z, currentNode.w);\\nreturn ;}\\nvec2 repulsive = calcRepulsive(i, currentNode);\\ndx += repulsive.x;\\ndy += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode);\\ndx += attractive.x;\\ndy += attractive.y;\\nvec2 gravity = calcGravity(currentNode, nodeAttributes);\\ndx -= gravity.x;\\ndy -= gravity.y;\\ndx *= gWebGPUUniformParams.u_Speed;\\ndy *= gWebGPUUniformParams.u_Speed;\\nfloat distLength = sqrt((dx * dx) + (dy * dy));\\nif (distLength > 0.0) {float limitedDist = min(gWebGPUUniformParams.u_MaxDisplace * gWebGPUUniformParams.u_Speed, distLength);\\ngWebGPUBuffer0.u_Data[i] = vec4(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w);}}\\n","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_K;\\nuniform float u_K2;\\nuniform vec2 u_Center;\\nuniform float u_Gravity;\\nuniform float u_ClusterGravity;\\nuniform float u_Speed;\\nuniform float u_MaxDisplace;\\nuniform float u_Clustering;\\nuniform sampler2D u_AttributeArray;\\nuniform vec2 u_AttributeArraySize;\\nvec4 getDatau_AttributeArray(vec2 address2D) {\\n return vec4(texture2D(u_AttributeArray, address2D).rgba);\\n}\\nvec4 getDatau_AttributeArray(float address1D) {\\n return getDatau_AttributeArray(addrTranslation_1Dto2D(address1D, u_AttributeArraySize));\\n}\\nvec4 getDatau_AttributeArray(int address1D) {\\n return getDatau_AttributeArray(float(address1D));\\n}\\nuniform sampler2D u_ClusterCenters;\\nuniform vec2 u_ClusterCentersSize;\\nvec4 getDatau_ClusterCenters(vec2 address2D) {\\n return vec4(texture2D(u_ClusterCenters, address2D).rgba);\\n}\\nvec4 getDatau_ClusterCenters(float address1D) {\\n return getDatau_ClusterCenters(addrTranslation_1Dto2D(address1D, u_ClusterCentersSize));\\n}\\nvec4 getDatau_ClusterCenters(int address1D) {\\n return getDatau_ClusterCenters(float(address1D));\\n}\\nvec2 calcRepulsive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = getDatau_Data(j);\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat param = u_K2 / dist;\\nif (dist > 0.0) {dx += param * xDist;\\ndy += param * yDist;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < j) ? (1.0) : (-1.0);\\ndx += param * sign;\\ndy += param * sign;}}}}\\nreturn vec2(dx, dy);}\\nvec2 calcGravity(vec4 currentNode, vec4 nodeAttributes) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nfloat vx = currentNode.x - u_Center.x;\\nfloat vy = currentNode.y - u_Center.y;\\nfloat gf = (0.01 * u_K) * u_Gravity;\\ndx = gf * vx;\\ndy = gf * vy;\\nif (u_Clustering == 1.0) {int clusterIdx = int(nodeAttributes.x);\\nvec4 center = getDatau_ClusterCenters(clusterIdx);\\nfloat cvx = currentNode.x - center.x;\\nfloat cvy = currentNode.y - center.y;\\nfloat dist = sqrt((cvx * cvx) + (cvy * cvy)) + 0.01;\\nfloat parma = (u_K * u_ClusterGravity) / dist;\\ndx += parma * cvx;\\ndy += parma * cvy;}\\nreturn vec2(dx, dy);}\\nvec2 calcAttractive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nint arr_offset = int(floor(currentNode.z + 0.5));\\nint length = int(floor(currentNode.w + 0.5));\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + int(p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = getDatau_Data(int(arr_idx / 4));}\\nfloat float_j = (buf_offset == 0) ? (node_buffer.x) : ((buf_offset == 1) ? (node_buffer.y) : ((buf_offset == 2) ? (node_buffer.z) : (node_buffer.w)));\\nvec4 nextNode = getDatau_Data(int(float_j));\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = sqrt((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat attractiveF = dist / u_K;\\nif (dist > 0.0) {dx -= xDist * attractiveF;\\ndy -= yDist * attractiveF;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < int(float_j)) ? (1.0) : (-1.0);\\ndx -= sign * attractiveF;\\ndy -= sign * attractiveF;}}}\\nreturn vec2(dx, dy);}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 currentNode = getDatau_Data(i);\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nif (i >= VERTEX_COUNT) {gl_FragColor = vec4(currentNode);\\nreturn ;}\\nvec4 nodeAttributes = getDatau_AttributeArray(i);\\nif ((nodeAttributes.y != 0.0) && (nodeAttributes.z != 0.0)) {gl_FragColor = vec4(vec4(nodeAttributes.y, nodeAttributes.z, currentNode.z, currentNode.w));\\nreturn ;}\\nvec2 repulsive = calcRepulsive(i, currentNode);\\ndx += repulsive.x;\\ndy += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode);\\ndx += attractive.x;\\ndy += attractive.y;\\nvec2 gravity = calcGravity(currentNode, nodeAttributes);\\ndx -= gravity.x;\\ndy -= gravity.y;\\ndx *= u_Speed;\\ndy *= u_Speed;\\nfloat distLength = sqrt((dx * dx) + (dy * dy));\\nif (distLength > 0.0) {float limitedDist = min(u_MaxDisplace * u_Speed, distLength);\\ngl_FragColor = vec4(vec4(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w));}if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"MAX_EDGE_PER_VERTEX","type":"Float","runtime":true},{"name":"VERTEX_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]},{"name":"u_K","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_K2","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Center","type":"vec2<f32>","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Gravity","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterGravity","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Speed","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_MaxDisplace","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Clustering","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AttributeArray","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterCenters","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_Data","size":[1,1],"length":1},"needPingpong":true}}').setDispatch([m,1,1]).setBinding({u_Data:x,u_K:l,u_K2:f,u_Gravity:n.gravity,u_ClusterGravity:n.clusterGravity||n.gravity||1,u_Speed:h,u_MaxDisplace:c,u_Clustering:p?1:0,u_Center:u,u_AttributeArray:g,u_ClusterCenters:A,MAX_EDGE_PER_VERTEX:_,VERTEX_COUNT:m}),p&&(C=E.createKernel('{"shaders":{"WGSL":"import \\"GLSL.std.450\\" as std;\\n\\n\\n# var gWebGPUDebug : bool = false;\\n# var gWebGPUDebugOutput : vec4<f32> = vec4<f32>(0.0);\\n\\n[[builtin global_invocation_id]] var<in> globalInvocationID : vec3<u32>;\\n# [[builtin work_group_size]] var<in> workGroupSize : vec3<u32>;\\n# [[builtin work_group_id]] var<in> workGroupID : vec3<u32>;\\n[[builtin local_invocation_id]] var<in> localInvocationID : vec3<u32>;\\n# [[builtin num_work_groups]] var<in> numWorkGroups : vec3<u32>;\\n[[builtin local_invocation_idx]] var<in> localInvocationIndex : u32;\\n\\n\\ntype GWebGPUBuffer0 = [[block]] struct {\\n [[offset 0]] u_Data : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 0, set 0]] var<storage_buffer> gWebGPUBuffer0 : GWebGPUBuffer0;\\ntype GWebGPUBuffer1 = [[block]] struct {\\n [[offset 0]] u_NodeAttributes : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 1, set 0]] var<storage_buffer> gWebGPUBuffer1 : GWebGPUBuffer1;\\ntype GWebGPUBuffer2 = [[block]] struct {\\n [[offset 0]] u_ClusterCenters : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 2, set 0]] var<storage_buffer> gWebGPUBuffer2 : GWebGPUBuffer2;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nfn main() -> void {var i : i32 = globalInvocationID.x;\\nvar center : vec4<f32> = gWebGPUBuffer2.u_ClusterCenters[i];\\nvar sumx : f32 = 0.0;\\nvar sumy : f32 = 0.0;\\nvar count : f32 = 0.0;\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {var attributes : vec4<f32> = gWebGPUBuffer1.u_NodeAttributes[j];\\nvar clusterIdx : i32 = i32(attributes.x);\\nvar vertex : vec4<f32> = gWebGPUBuffer0.u_Data[j];\\nif (clusterIdx == i) {sumx = sumx + vertex.x;\\nsumy = sumy + vertex.y;\\ncount = count + 1.0;}}\\ngWebGPUBuffer2.u_ClusterCenters[i] = vec4<f32>(sumx / count, sumy / count, count, i);\\nreturn;}\\n\\nentry_point compute as \\"main\\" = main;\\n","GLSL450":"\\n\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\nivec3 workGroupSize = ivec3(1,1,1);\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\n\\n\\nlayout(std430, set = 0, binding = 0) buffer readonly GWebGPUBuffer0 {\\n vec4 u_Data[];\\n} gWebGPUBuffer0;\\n\\nlayout(std430, set = 0, binding = 1) buffer readonly GWebGPUBuffer1 {\\n vec4 u_NodeAttributes[];\\n} gWebGPUBuffer1;\\n\\nlayout(std430, set = 0, binding = 2) buffer GWebGPUBuffer2 {\\n vec4 u_ClusterCenters[];\\n} gWebGPUBuffer2;\\n\\n\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define CLUSTER_COUNT __DefineValuePlaceholder__CLUSTER_COUNT\\nlayout (\\n local_size_x = 1,\\n local_size_y = 1,\\n local_size_z = 1\\n) in;\\n\\n\\n\\nvoid main() {int i = globalInvocationID.x;\\nvec4 center = gWebGPUBuffer2.u_ClusterCenters[i];\\nfloat sumx = 0.0;\\nfloat sumy = 0.0;\\nfloat count = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 attributes = gWebGPUBuffer1.u_NodeAttributes[j];\\nint clusterIdx = int(attributes.x);\\nvec4 vertex = gWebGPUBuffer0.u_Data[j];\\nif (clusterIdx == i) {sumx += vertex.x;\\nsumy += vertex.y;\\ncount += 1.0;}}\\ngWebGPUBuffer2.u_ClusterCenters[i] = vec4(sumx / count, sumy / count, count, i);}\\n","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define CLUSTER_COUNT __DefineValuePlaceholder__CLUSTER_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform sampler2D u_NodeAttributes;\\nuniform vec2 u_NodeAttributesSize;\\nvec4 getDatau_NodeAttributes(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributes, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributes(float address1D) {\\n return getDatau_NodeAttributes(addrTranslation_1Dto2D(address1D, u_NodeAttributesSize));\\n}\\nvec4 getDatau_NodeAttributes(int address1D) {\\n return getDatau_NodeAttributes(float(address1D));\\n}\\nuniform sampler2D u_ClusterCenters;\\nuniform vec2 u_ClusterCentersSize;\\nvec4 getDatau_ClusterCenters(vec2 address2D) {\\n return vec4(texture2D(u_ClusterCenters, address2D).rgba);\\n}\\nvec4 getDatau_ClusterCenters(float address1D) {\\n return getDatau_ClusterCenters(addrTranslation_1Dto2D(address1D, u_ClusterCentersSize));\\n}\\nvec4 getDatau_ClusterCenters(int address1D) {\\n return getDatau_ClusterCenters(float(address1D));\\n}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 center = getDatau_ClusterCenters(i);\\nfloat sumx = 0.0;\\nfloat sumy = 0.0;\\nfloat count = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 attributes = getDatau_NodeAttributes(j);\\nint clusterIdx = int(attributes.x);\\nvec4 vertex = getDatau_Data(j);\\nif (clusterIdx == i) {sumx += vertex.x;\\nsumy += vertex.y;\\ncount += 1.0;}}\\ngl_FragColor = vec4(vec4(sumx / count, sumy / count, count, i));if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"VERTEX_COUNT","type":"Float","runtime":true},{"name":"CLUSTER_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributes","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterCenters","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_ClusterCenters","size":[1,1],"length":1},"needPingpong":true}}').setDispatch([y,1,1]).setBinding({u_Data:x,u_NodeAttributes:g,u_ClusterCenters:A,VERTEX_COUNT:m,CLUSTER_COUNT:y})),D=function(){return Yh(N,void 0,void 0,(function(){var n,i;return Kh(this,(function(a){switch(a.label){case 0:n=0,a.label=1;case 1:return n<o?[4,I.execute()]:[3,6];case 2:return a.sent(),p?(C.setBinding({u_Data:I}),[4,C.execute()]):[3,4];case 3:a.sent(),I.setBinding({u_ClusterCenters:C}),a.label=4;case 4:I.setBinding({u_MaxDisplace:c*=.99}),a.label=5;case 5:return n++,[3,1];case 6:return[4,I.getOutput()];case 7:return i=a.sent(),t?e.postMessage({type:It,vertexEdgeData:i}):r.forEach((function(t,e){var n=i[4*e],r=i[4*e+1];t.x=n,t.y=r})),S&&S(),[2]}}))}))},[4,D()];case 1:return k.sent(),[2]}var R,O,M,P,G}))}))},e.prototype.getType=function(){return"fruchterman-gpu"},e}(t),$h=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Jh=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{s(r.next(t))}catch(t){o(t)}}function u(t){try{s(r.throw(t))}catch(t){o(t)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}s((r=r.apply(t,e||[])).next())}))},Qh=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},td=function(t){function e(e){var n=t.call(this)||this;return n.maxIteration=1e3,n.edgeStrength=200,n.nodeStrength=1e3,n.coulombDisScale=.005,n.damping=.9,n.maxSpeed=1e3,n.minMovement=.5,n.interval=.02,n.factor=1,n.linkDistance=1,n.gravity=10,n.workerEnabled=!1,n.nodes=[],n.edges=[],n.width=300,n.height=300,n.nodeMap={},n.nodeIdxMap={},n.updateCfg(e),n}return $h(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:2e3,gravity:10,clustering:!1,clusterGravity:10}},e.prototype.execute=function(){return Jh(this,void 0,void 0,(function(){var t,e,n,r,i;return Qh(this,(function(o){switch(o.label){case 0:return(e=(t=this).nodes)&&0!==e.length?(t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),t.center||(t.center=[t.width/2,t.height/2]),n=t.center,1===e.length?(e[0].x=n[0],e[0].y=n[1],t.onLayoutEnd&&t.onLayoutEnd(),[2]):(r={},i={},e.forEach((function(e,n){a(e.x)||(e.x=Math.random()*t.width),a(e.y)||(e.y=Math.random()*t.height),r[e.id]=e,i[e.id]=n})),t.nodeMap=r,t.nodeIdxMap=i,t.nodeStrength=Xh(t.nodeStrength,1),t.edgeStrength=Xh(t.edgeStrength,1),[4,t.run()])):(t.onLayoutEnd&&t.onLayoutEnd(),[2]);case 1:return o.sent(),[2]}}))}))},e.prototype.executeWithWorker=function(t,e){var n=this,r=n.nodes,i=n.center;if(r&&0!==r.length){if(1===r.length)return r[0].x=i[0],void(r[0].y=i[1]);var o={},u={};r.forEach((function(t,e){a(t.x)||(t.x=Math.random()*n.width),a(t.y)||(t.y=Math.random()*n.height),o[t.id]=t,u[t.id]=e})),n.nodeMap=o,n.nodeIdxMap=u,n.nodeStrength=Xh(n.nodeStrength,1),n.edgeStrength=Xh(n.edgeStrength,1),n.run(t,e)}},e.prototype.run=function(t,e){return Jh(this,void 0,void 0,(function(){var n,r,i,o,u,s,c,f,l,h,v,g,y,m,b,_,x,w,E,S,A,T,I,C,D,N,k,R=this;return Qh(this,(function(O){switch(O.label){case 0:for(r=(n=this).nodes,i=n.edges,o=n.maxIteration,n.width||"undefined"==typeof window||(n.width=window.innerWidth),n.height||"undefined"==typeof window||(n.height=window.innerHeight),u=r.length,n.linkDistance=Xh(n.linkDistance),n.edgeStrength=Xh(n.edgeStrength),s=function(t,e,n,r){var i=[],o=[],a={},u=0;for(u=0;u<t.length;u++){var s=t[u];a[s.id]=u,i.push(s.x),i.push(s.y),i.push(0),i.push(0),o.push([])}for(u=0;u<e.length;u++){var c=e[u],f=d(c,"source"),l=d(c,"target");o[a[f]].push(a[l]),o[a[f]].push(n(c)),o[a[f]].push(r(c)),o[a[f]].push(0),o[a[l]].push(a[f]),o[a[l]].push(n(c)),o[a[l]].push(r(c)),o[a[l]].push(0)}var h=0;for(u=0;u<t.length;u++){var p=i.length,v=o[u],g=v.length;i[4*u+2]=p+1048576*g/4,i[4*u+3]=0,h=Math.max(h,g/4);for(var y=0;y<g;++y){var m=v[y];i.push(+m)}}for(;i.length%4!=0;)i.push(0);return{maxEdgePerVetex:h,array:new Float32Array(i)}}(r,i,n.linkDistance,n.edgeStrength),c=s.maxEdgePerVetex,f=s.array,n.degrees=p(r.length,n.nodeIdxMap,i),l=[],h=[],v=[],g=[],y=[],m=[],b=[],n.getMass||(n.getMass=function(t){return n.degrees[n.nodeIdxMap[t.id]]||1}),_=n.gravity,x=n.center,r.forEach((function(t,e){l.push(n.getMass(t)),h.push(n.nodeStrength(t)),n.degrees[e]||(n.degrees[e]=0);var r=[x[0],x[1],_];if(n.getCenter){var i=n.getCenter(t,n.degrees[e]);i&&a(i[0])&&a(i[1])&&a(i[2])&&(r=i)}v.push(r[0]),g.push(r[1]),y.push(r[2]),a(t.fx)&&a(t.fy)?(m.push(t.fx||.001),b.push(t.fy||.001)):(m.push(0),b.push(0))})),w=Hh([l,n.degrees,h,m]),E=Hh([v,g,y,b]),S=n.workerEnabled,A=S?Vh.create({canvas:t,engineOptions:{supportCompute:!0}}):Vh.create({engineOptions:{supportCompute:!0}}),T=n.onLayoutEnd,I=[],f.forEach((function(t){I.push(t)})),C=0;C<4;C++)I.push(0);return D=A.createKernel('{"shaders":{"WGSL":"import \\"GLSL.std.450\\" as std;\\n\\n\\n# var gWebGPUDebug : bool = false;\\n# var gWebGPUDebugOutput : vec4<f32> = vec4<f32>(0.0);\\n\\n[[builtin global_invocation_id]] var<in> globalInvocationID : vec3<u32>;\\n# [[builtin work_group_size]] var<in> workGroupSize : vec3<u32>;\\n# [[builtin work_group_id]] var<in> workGroupID : vec3<u32>;\\n[[builtin local_invocation_id]] var<in> localInvocationID : vec3<u32>;\\n# [[builtin num_work_groups]] var<in> numWorkGroups : vec3<u32>;\\n[[builtin local_invocation_idx]] var<in> localInvocationIndex : u32;\\n\\ntype GWebGPUParams = [[block]] struct {\\n [[offset 0]] u_damping : f32;\\n [[offset 4]] u_maxSpeed : f32;\\n [[offset 8]] u_minMovement : f32;\\n \\n [[offset 12]] u_coulombDisScale : f32;\\n [[offset 16]] u_factor : f32;\\n \\n \\n [[offset 20]] u_interval : f32;\\n};\\n[[binding 0, set 0]] var<uniform> gWebGPUUniformParams : GWebGPUParams;\\ntype GWebGPUBuffer0 = [[block]] struct {\\n [[offset 0]] u_Data : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 1, set 0]] var<storage_buffer> gWebGPUBuffer0 : GWebGPUBuffer0;\\ntype GWebGPUBuffer1 = [[block]] struct {\\n [[offset 0]] u_AveMovement : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 2, set 0]] var<storage_buffer> gWebGPUBuffer1 : GWebGPUBuffer1;\\ntype GWebGPUBuffer2 = [[block]] struct {\\n [[offset 0]] u_NodeAttributeArray1 : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 3, set 0]] var<storage_buffer> gWebGPUBuffer2 : GWebGPUBuffer2;\\ntype GWebGPUBuffer3 = [[block]] struct {\\n [[offset 0]] u_NodeAttributeArray2 : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 4, set 0]] var<storage_buffer> gWebGPUBuffer3 : GWebGPUBuffer3;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nfn unpack_float(packedValue : f32) -> vec2<i32> {var packedIntValue : i32 = i32(packedValue);\\nvar v0 : i32 = packedIntValue / 1048576;\\nreturn vec2<i32>(v0, packedIntValue - (v0 * 1048576));}\\nfn calcRepulsive(i : i32, currentNode : vec4<f32>) -> vec2<f32> {var ax : f32 = 0.0;\\nvar ay : f32 = 0.0;\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {if (i != j) {var nextNode : vec4<f32> = gWebGPUBuffer0.u_Data[j];\\nvar vx : f32 = currentNode.x - nextNode.x;\\nvar vy : f32 = currentNode.y - nextNode.y;\\nvar dist : f32 = std::sqrt((vx * vx) + (vy * vy)) + 0.01;\\nvar n_dist : f32 = (dist + 0.1) * gWebGPUUniformParams.u_coulombDisScale;\\nvar direx : f32 = vx / dist;\\nvar direy : f32 = vy / dist;\\nvar attributesi : vec4<f32> = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\nvar attributesj : vec4<f32> = gWebGPUBuffer2.u_NodeAttributeArray1[j];\\nvar massi : f32 = attributesi.x;\\nvar nodeStrengthi : f32 = attributesi.z;\\nvar nodeStrengthj : f32 = attributesj.z;\\nvar nodeStrength : f32 = (nodeStrengthi + nodeStrengthj) / 2.0;\\nvar param : f32 = (nodeStrength * gWebGPUUniformParams.u_factor) / (n_dist * n_dist);\\nax = ax + direx * param;\\nay = ay + direy * param;}}\\nreturn vec2<f32>(ax, ay);}\\nfn calcGravity(i : i32, currentNode : vec4<f32>, attributes2 : vec4<f32>) -> vec2<f32> {var vx : f32 = currentNode.x - attributes2.x;\\nvar vy : f32 = currentNode.y - attributes2.y;\\nvar ax : f32 = vx * attributes2.z;\\nvar ay : f32 = vy * attributes2.z;\\nreturn vec2<f32>(ax, ay);}\\nfn calcAttractive(i : i32, currentNode : vec4<f32>, attributes1 : vec4<f32>) -> vec2<f32> {var mass : f32 = attributes1.x;\\nvar ax : f32 = 0.0;\\nvar ay : f32 = 0.0;\\nvar compressed : vec2<i32> = unpack_float(currentNode.z);\\nvar length : i32 = compressed.x;\\nvar arr_offset : i32 = compressed.y;\\nvar node_buffer : vec4<f32>;\\nfor (var p : i32 = 0; p < __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX; p = p + 1) {if (p >= length) {break;}\\nvar arr_idx : i32 = arr_offset + (4 * p);\\nvar buf_offset : i32 = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = gWebGPUBuffer0.u_Data[i32(arr_idx / 4)];}\\nvar float_j : f32 = node_buffer.x;\\nvar nextNode : vec4<f32> = gWebGPUBuffer0.u_Data[i32(float_j)];\\nvar vx : f32 = nextNode.x - currentNode.x;\\nvar vy : f32 = nextNode.y - currentNode.y;\\nvar dist : f32 = std::sqrt((vx * vx) + (vy * vy)) + 0.01;\\nvar direx : f32 = vx / dist;\\nvar direy : f32 = vy / dist;\\nvar edgeLength : f32 = node_buffer.y;\\nvar edgeStrength : f32 = node_buffer.z;\\nvar diff : f32 = edgeLength - dist;\\nvar param : f32 = (diff * edgeStrength) / mass;\\nax = ax - direx * param;\\nay = ay - direy * param;}\\nreturn vec2<f32>(ax, ay);}\\nfn main() -> void {var i : i32 = globalInvocationID.x;\\nvar currentNode : vec4<f32> = gWebGPUBuffer0.u_Data[i];\\nvar movement : vec4<f32> = gWebGPUBuffer1.u_AveMovement[0];\\nvar ax : f32 = 0.0;\\nvar ay : f32 = 0.0;\\nif ((i >= __DefineValuePlaceholder__VERTEX_COUNT) || (movement.x < gWebGPUUniformParams.u_minMovement)) {gWebGPUBuffer0.u_Data[i] = currentNode;\\nreturn ;}\\nvar nodeAttributes1 : vec4<f32> = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\nvar nodeAttributes2 : vec4<f32> = gWebGPUBuffer3.u_NodeAttributeArray2[i];\\nvar repulsive : vec2<f32> = calcRepulsive(i, currentNode);\\nax = ax + repulsive.x;\\nay = ay + repulsive.y;\\nvar attractive : vec2<f32> = calcAttractive(i, currentNode, nodeAttributes1);\\nax = ax + attractive.x;\\nay = ay + attractive.y;\\nvar gravity : vec2<f32> = calcGravity(i, currentNode, nodeAttributes2);\\nax = ax - gravity.x;\\nay = ay - gravity.y;\\nvar param : f32 = gWebGPUUniformParams.u_interval * gWebGPUUniformParams.u_damping;\\nvar vx : f32 = ax * param;\\nvar vy : f32 = ay * param;\\nvar vlength : f32 = std::sqrt((vx * vx) + (vy * vy)) + 0.0001;\\nif (vlength > gWebGPUUniformParams.u_maxSpeed) {var param2 : f32 = gWebGPUUniformParams.u_maxSpeed / vlength;\\nvx = param2 * vx;\\nvy = param2 * vy;}\\nvar distx : f32 = vx * gWebGPUUniformParams.u_interval;\\nvar disty : f32 = vy * gWebGPUUniformParams.u_interval;\\nvar distLength : f32 = std::sqrt((distx * distx) + (disty * disty));\\nif ((nodeAttributes1.w != 0.0) && (nodeAttributes2.w != 0.0)) {gWebGPUBuffer0.u_Data[i] = vec4<f32>(nodeAttributes1.w, nodeAttributes2.w, currentNode.z, 0.0);}else {gWebGPUBuffer0.u_Data[i] = vec4<f32>(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength);}\\nreturn;}\\n\\nentry_point compute as \\"main\\" = main;\\n","GLSL450":"\\n\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\nivec3 workGroupSize = ivec3(1,1,1);\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\n\\nlayout(std140, set = 0, binding = 0) uniform GWebGPUParams {\\n float u_damping;\\n float u_maxSpeed;\\n float u_minMovement;\\n \\n float u_coulombDisScale;\\n float u_factor;\\n \\n \\n float u_interval;\\n} gWebGPUUniformParams;\\nlayout(std430, set = 0, binding = 1) buffer GWebGPUBuffer0 {\\n vec4 u_Data[];\\n} gWebGPUBuffer0;\\n\\nlayout(std430, set = 0, binding = 2) buffer readonly GWebGPUBuffer1 {\\n vec4 u_AveMovement[];\\n} gWebGPUBuffer1;\\n\\nlayout(std430, set = 0, binding = 3) buffer readonly GWebGPUBuffer2 {\\n vec4 u_NodeAttributeArray1[];\\n} gWebGPUBuffer2;\\n\\nlayout(std430, set = 0, binding = 4) buffer readonly GWebGPUBuffer3 {\\n vec4 u_NodeAttributeArray2[];\\n} gWebGPUBuffer3;\\n\\n\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define SHIFT_20 1048576.0\\nlayout (\\n local_size_x = 1,\\n local_size_y = 1,\\n local_size_z = 1\\n) in;\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nivec2 unpack_float(float packedValue) {int packedIntValue = int(packedValue);\\nint v0 = packedIntValue / int(SHIFT_20);\\nreturn ivec2(v0, packedIntValue - (v0 * int(SHIFT_20)));}\\nvec2 calcRepulsive(int i, vec4 currentNode) {float ax = 0.0;\\nfloat ay = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = gWebGPUBuffer0.u_Data[j];\\nfloat vx = currentNode.x - nextNode.x;\\nfloat vy = currentNode.y - nextNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat n_dist = (dist + 0.1) * gWebGPUUniformParams.u_coulombDisScale;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nvec4 attributesi = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\nvec4 attributesj = gWebGPUBuffer2.u_NodeAttributeArray1[j];\\nfloat massi = attributesi.x;\\nfloat nodeStrengthi = attributesi.z;\\nfloat nodeStrengthj = attributesj.z;\\nfloat nodeStrength = (nodeStrengthi + nodeStrengthj) / 2.0;\\nfloat param = (nodeStrength * gWebGPUUniformParams.u_factor) / (n_dist * n_dist);\\nax += direx * param;\\nay += direy * param;}}\\nreturn vec2(ax, ay);}\\nvec2 calcGravity(int i, vec4 currentNode, vec4 attributes2) {float vx = currentNode.x - attributes2.x;\\nfloat vy = currentNode.y - attributes2.y;\\nfloat ax = vx * attributes2.z;\\nfloat ay = vy * attributes2.z;\\nreturn vec2(ax, ay);}\\nvec2 calcAttractive(int i, vec4 currentNode, vec4 attributes1) {float mass = attributes1.x;\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nivec2 compressed = unpack_float(currentNode.z);\\nint length = compressed.x;\\nint arr_offset = compressed.y;\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + (4 * p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = gWebGPUBuffer0.u_Data[int(arr_idx / 4)];}\\nfloat float_j = node_buffer.x;\\nvec4 nextNode = gWebGPUBuffer0.u_Data[int(float_j)];\\nfloat vx = nextNode.x - currentNode.x;\\nfloat vy = nextNode.y - currentNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nfloat edgeLength = node_buffer.y;\\nfloat edgeStrength = node_buffer.z;\\nfloat diff = edgeLength - dist;\\nfloat param = (diff * edgeStrength) / mass;\\nax -= direx * param;\\nay -= direy * param;}\\nreturn vec2(ax, ay);}\\nvoid main() {int i = globalInvocationID.x;\\nvec4 currentNode = gWebGPUBuffer0.u_Data[i];\\nvec4 movement = gWebGPUBuffer1.u_AveMovement[0];\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nif ((i >= VERTEX_COUNT) || (movement.x < gWebGPUUniformParams.u_minMovement)) {gWebGPUBuffer0.u_Data[i] = currentNode;\\nreturn ;}\\nvec4 nodeAttributes1 = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\nvec4 nodeAttributes2 = gWebGPUBuffer3.u_NodeAttributeArray2[i];\\nvec2 repulsive = calcRepulsive(i, currentNode);\\nax += repulsive.x;\\nay += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode, nodeAttributes1);\\nax += attractive.x;\\nay += attractive.y;\\nvec2 gravity = calcGravity(i, currentNode, nodeAttributes2);\\nax -= gravity.x;\\nay -= gravity.y;\\nfloat param = gWebGPUUniformParams.u_interval * gWebGPUUniformParams.u_damping;\\nfloat vx = ax * param;\\nfloat vy = ay * param;\\nfloat vlength = sqrt((vx * vx) + (vy * vy)) + 0.0001;\\nif (vlength > gWebGPUUniformParams.u_maxSpeed) {float param2 = gWebGPUUniformParams.u_maxSpeed / vlength;\\nvx = param2 * vx;\\nvy = param2 * vy;}\\nfloat distx = vx * gWebGPUUniformParams.u_interval;\\nfloat disty = vy * gWebGPUUniformParams.u_interval;\\nfloat distLength = sqrt((distx * distx) + (disty * disty));\\nif ((nodeAttributes1.w != 0.0) && (nodeAttributes2.w != 0.0)) {gWebGPUBuffer0.u_Data[i] = vec4(nodeAttributes1.w, nodeAttributes2.w, currentNode.z, 0.0);}else {gWebGPUBuffer0.u_Data[i] = vec4(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength);}}\\n","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define SHIFT_20 1048576.0\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_damping;\\nuniform float u_maxSpeed;\\nuniform float u_minMovement;\\nuniform sampler2D u_AveMovement;\\nuniform vec2 u_AveMovementSize;\\nvec4 getDatau_AveMovement(vec2 address2D) {\\n return vec4(texture2D(u_AveMovement, address2D).rgba);\\n}\\nvec4 getDatau_AveMovement(float address1D) {\\n return getDatau_AveMovement(addrTranslation_1Dto2D(address1D, u_AveMovementSize));\\n}\\nvec4 getDatau_AveMovement(int address1D) {\\n return getDatau_AveMovement(float(address1D));\\n}\\nuniform float u_coulombDisScale;\\nuniform float u_factor;\\nuniform sampler2D u_NodeAttributeArray1;\\nuniform vec2 u_NodeAttributeArray1Size;\\nvec4 getDatau_NodeAttributeArray1(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributeArray1, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributeArray1(float address1D) {\\n return getDatau_NodeAttributeArray1(addrTranslation_1Dto2D(address1D, u_NodeAttributeArray1Size));\\n}\\nvec4 getDatau_NodeAttributeArray1(int address1D) {\\n return getDatau_NodeAttributeArray1(float(address1D));\\n}\\nuniform sampler2D u_NodeAttributeArray2;\\nuniform vec2 u_NodeAttributeArray2Size;\\nvec4 getDatau_NodeAttributeArray2(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributeArray2, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributeArray2(float address1D) {\\n return getDatau_NodeAttributeArray2(addrTranslation_1Dto2D(address1D, u_NodeAttributeArray2Size));\\n}\\nvec4 getDatau_NodeAttributeArray2(int address1D) {\\n return getDatau_NodeAttributeArray2(float(address1D));\\n}\\nuniform float u_interval;\\nivec2 unpack_float(float packedValue) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint packedIntValue = int(packedValue);\\nint v0 = packedIntValue / int(SHIFT_20);\\nreturn ivec2(v0, packedIntValue - (v0 * int(SHIFT_20)));}\\nvec2 calcRepulsive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = getDatau_Data(j);\\nfloat vx = currentNode.x - nextNode.x;\\nfloat vy = currentNode.y - nextNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat n_dist = (dist + 0.1) * u_coulombDisScale;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nvec4 attributesi = getDatau_NodeAttributeArray1(i);\\nvec4 attributesj = getDatau_NodeAttributeArray1(j);\\nfloat massi = attributesi.x;\\nfloat nodeStrengthi = attributesi.z;\\nfloat nodeStrengthj = attributesj.z;\\nfloat nodeStrength = (nodeStrengthi + nodeStrengthj) / 2.0;\\nfloat param = (nodeStrength * u_factor) / (n_dist * n_dist);\\nax += direx * param;\\nay += direy * param;}}\\nreturn vec2(ax, ay);}\\nvec2 calcGravity(int i, vec4 currentNode, vec4 attributes2) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat vx = currentNode.x - attributes2.x;\\nfloat vy = currentNode.y - attributes2.y;\\nfloat ax = vx * attributes2.z;\\nfloat ay = vy * attributes2.z;\\nreturn vec2(ax, ay);}\\nvec2 calcAttractive(int i, vec4 currentNode, vec4 attributes1) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat mass = attributes1.x;\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nivec2 compressed = unpack_float(currentNode.z);\\nint length = compressed.x;\\nint arr_offset = compressed.y;\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + (4 * p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = getDatau_Data(int(arr_idx / 4));}\\nfloat float_j = node_buffer.x;\\nvec4 nextNode = getDatau_Data(int(float_j));\\nfloat vx = nextNode.x - currentNode.x;\\nfloat vy = nextNode.y - currentNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nfloat edgeLength = node_buffer.y;\\nfloat edgeStrength = node_buffer.z;\\nfloat diff = edgeLength - dist;\\nfloat param = (diff * edgeStrength) / mass;\\nax -= direx * param;\\nay -= direy * param;}\\nreturn vec2(ax, ay);}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 currentNode = getDatau_Data(i);\\nvec4 movement = getDatau_AveMovement(0.0);\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nif ((i >= VERTEX_COUNT) || (movement.x < u_minMovement)) {gl_FragColor = vec4(currentNode);\\nreturn ;}\\nvec4 nodeAttributes1 = getDatau_NodeAttributeArray1(i);\\nvec4 nodeAttributes2 = getDatau_NodeAttributeArray2(i);\\nvec2 repulsive = calcRepulsive(i, currentNode);\\nax += repulsive.x;\\nay += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode, nodeAttributes1);\\nax += attractive.x;\\nay += attractive.y;\\nvec2 gravity = calcGravity(i, currentNode, nodeAttributes2);\\nax -= gravity.x;\\nay -= gravity.y;\\nfloat param = u_interval * u_damping;\\nfloat vx = ax * param;\\nfloat vy = ay * param;\\nfloat vlength = sqrt((vx * vx) + (vy * vy)) + 0.0001;\\nif (vlength > u_maxSpeed) {float param2 = u_maxSpeed / vlength;\\nvx = param2 * vx;\\nvy = param2 * vy;}\\nfloat distx = vx * u_interval;\\nfloat disty = vy * u_interval;\\nfloat distLength = sqrt((distx * distx) + (disty * disty));\\nif ((nodeAttributes1.w != 0.0) && (nodeAttributes2.w != 0.0)) {gl_FragColor = vec4(vec4(nodeAttributes1.w, nodeAttributes2.w, currentNode.z, 0.0));}else {gl_FragColor = vec4(vec4(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength));}if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"MAX_EDGE_PER_VERTEX","type":"Float","runtime":true},{"name":"VERTEX_COUNT","type":"Float","runtime":true},{"name":"SHIFT_20","type":"Float","value":1048576,"runtime":false}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]},{"name":"u_damping","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_maxSpeed","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_minMovement","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AveMovement","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_coulombDisScale","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_factor","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributeArray1","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributeArray2","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_interval","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_Data","size":[1,1],"length":1},"needPingpong":true}}').setDispatch([u,1,1]).setBinding({u_Data:f,u_damping:n.damping,u_maxSpeed:n.maxSpeed,u_minMovement:n.minMovement,u_coulombDisScale:n.coulombDisScale,u_factor:n.factor,u_NodeAttributeArray1:w,u_NodeAttributeArray2:E,MAX_EDGE_PER_VERTEX:c,VERTEX_COUNT:u,u_AveMovement:I,u_interval:n.interval}),N=A.createKernel('{"shaders":{"WGSL":"import \\"GLSL.std.450\\" as std;\\n\\n\\n# var gWebGPUDebug : bool = false;\\n# var gWebGPUDebugOutput : vec4<f32> = vec4<f32>(0.0);\\n\\n[[builtin global_invocation_id]] var<in> globalInvocationID : vec3<u32>;\\n# [[builtin work_group_size]] var<in> workGroupSize : vec3<u32>;\\n# [[builtin work_group_id]] var<in> workGroupID : vec3<u32>;\\n[[builtin local_invocation_id]] var<in> localInvocationID : vec3<u32>;\\n# [[builtin num_work_groups]] var<in> numWorkGroups : vec3<u32>;\\n[[builtin local_invocation_idx]] var<in> localInvocationIndex : u32;\\n\\ntype GWebGPUParams = [[block]] struct {\\n [[offset 0]] u_iter : f32;\\n};\\n[[binding 0, set 0]] var<uniform> gWebGPUUniformParams : GWebGPUParams;\\ntype GWebGPUBuffer0 = [[block]] struct {\\n [[offset 0]] u_Data : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 1, set 0]] var<storage_buffer> gWebGPUBuffer0 : GWebGPUBuffer0;\\ntype GWebGPUBuffer1 = [[block]] struct {\\n [[offset 0]] u_AveMovement : [[stride 16]] array<vec4<f32>>;\\n};\\n[[binding 2, set 0]] var<storage_buffer> gWebGPUBuffer1 : GWebGPUBuffer1;\\n\\n\\n\\n\\n\\n\\n\\n\\nfn main() -> void {var movement : f32 = 0.0;\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {var vertex : vec4<f32> = gWebGPUBuffer0.u_Data[j];\\nmovement = movement + vertex.w;}\\nmovement = movement / f32(__DefineValuePlaceholder__VERTEX_COUNT);\\ngWebGPUBuffer1.u_AveMovement[0] = vec4<f32>(movement, 0.0, 0.0, 0.0);\\nreturn;}\\n\\nentry_point compute as \\"main\\" = main;\\n","GLSL450":"\\n\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\nivec3 workGroupSize = ivec3(1,1,1);\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\n\\nlayout(std140, set = 0, binding = 0) uniform GWebGPUParams {\\n float u_iter;\\n} gWebGPUUniformParams;\\nlayout(std430, set = 0, binding = 1) buffer readonly GWebGPUBuffer0 {\\n vec4 u_Data[];\\n} gWebGPUBuffer0;\\n\\nlayout(std430, set = 0, binding = 2) buffer GWebGPUBuffer1 {\\n vec4 u_AveMovement[];\\n} gWebGPUBuffer1;\\n\\n\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\nlayout (\\n local_size_x = 1,\\n local_size_y = 1,\\n local_size_z = 1\\n) in;\\n\\n\\n\\nvoid main() {float movement = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 vertex = gWebGPUBuffer0.u_Data[j];\\nmovement += vertex.w;}\\nmovement = movement / float(VERTEX_COUNT);\\ngWebGPUBuffer1.u_AveMovement[0] = vec4(movement, 0.0, 0.0, 0.0);}\\n","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_iter;\\nuniform sampler2D u_AveMovement;\\nuniform vec2 u_AveMovementSize;\\nvec4 getDatau_AveMovement(vec2 address2D) {\\n return vec4(texture2D(u_AveMovement, address2D).rgba);\\n}\\nvec4 getDatau_AveMovement(float address1D) {\\n return getDatau_AveMovement(addrTranslation_1Dto2D(address1D, u_AveMovementSize));\\n}\\nvec4 getDatau_AveMovement(int address1D) {\\n return getDatau_AveMovement(float(address1D));\\n}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat movement = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 vertex = getDatau_Data(j);\\nmovement += vertex.w;}\\nmovement = movement / float(VERTEX_COUNT);\\ngl_FragColor = vec4(vec4(movement, 0.0, 0.0, 0.0));if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"VERTEX_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_iter","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AveMovement","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_AveMovement","size":[1,1],"length":1},"needPingpong":true}}').setDispatch([1,1,1]).setBinding({u_Data:f,VERTEX_COUNT:u,u_AveMovement:[0,0,0,0]}),k=function(){return Jh(R,void 0,void 0,(function(){var i,a,u;return Qh(this,(function(s){switch(s.label){case 0:i=0,s.label=1;case 1:return i<o?[4,D.execute()]:[3,5];case 2:return s.sent(),N.setBinding({u_Data:D}),[4,N.execute()];case 3:s.sent(),a=Math.max(.02,n.interval-.002*i),D.setBinding({u_interval:a,u_AveMovement:N}),s.label=4;case 4:return i++,[3,1];case 5:return[4,D.getOutput()];case 6:return u=s.sent(),t?e.postMessage({type:It,vertexEdgeData:u}):r.forEach((function(t,e){var n=u[4*e],r=u[4*e+1];t.x=n,t.y=r})),T&&T(),[2]}}))}))},[4,k()];case 1:return O.sent(),[2]}}))}))},e.prototype.getType=function(){return"gForce-gpu"},e}(t),ed=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),nd=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.maxIteration=100,n.gravity=10,n.comboGravity=10,n.linkDistance=10,n.alpha=1,n.alphaMin=.001,n.alphaDecay=1-Math.pow(n.alphaMin,1/300),n.alphaTarget=0,n.velocityDecay=.6,n.edgeStrength=.6,n.nodeStrength=30,n.preventOverlap=!1,n.preventNodeOverlap=!1,n.preventComboOverlap=!1,n.collideStrength=void 0,n.nodeCollideStrength=.5,n.comboCollideStrength=.5,n.comboSpacing=20,n.comboPadding=10,n.optimizeRangeFactor=1,n.onTick=function(){},n.onLayoutEnd=function(){},n.depthAttractiveForceScale=1,n.depthRepulsiveForceScale=2,n.nodes=[],n.edges=[],n.combos=[],n.comboTrees=[],n.width=300,n.height=300,n.bias=[],n.nodeMap={},n.oriComboMap={},n.indexMap={},n.comboMap={},n.previousLayouted=!1,n.updateCfg(e),n}return ed(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:100,center:[0,0],gravity:10,speed:1,comboGravity:30,preventOverlap:!1,preventComboOverlap:!0,preventNodeOverlap:!0,nodeSpacing:void 0,collideStrength:void 0,nodeCollideStrength:.5,comboCollideStrength:.5,comboSpacing:20,comboPadding:10,edgeStrength:.6,nodeStrength:30,linkDistance:10}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.center;if(t.comboTree={id:"comboTreeRoot",depth:-1,children:t.comboTrees},e&&0!==e.length){if(1===e.length)return e[0].x=n[0],e[0].y=n[1],void(t.onLayoutEnd&&t.onLayoutEnd());t.initVals(),t.run(),t.onLayoutEnd&&t.onLayoutEnd()}else t.onLayoutEnd&&t.onLayoutEnd()},e.prototype.run=function(){var t=this,e=t.nodes,n=t.previousLayouted?t.maxIteration/5:t.maxIteration;t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight);var r=t.center,i=t.velocityDecay,o=t.comboMap;t.previousLayouted||t.initPos(o);for(var u=function(n){var r=[];e.forEach((function(t,e){r[e]={x:0,y:0}})),t.applyCalculate(r),t.applyComboCenterForce(r),e.forEach((function(t,e){a(t.x)&&a(t.y)&&(t.x+=r[e].x*i,t.y+=r[e].y*i)})),t.alpha+=(t.alphaTarget-t.alpha)*t.alphaDecay,t.onTick()},s=0;s<n;s++)u();var c=[0,0];e.forEach((function(t){a(t.x)&&a(t.y)&&(c[0]+=t.x,c[1]+=t.y)})),c[0]/=e.length,c[1]/=e.length;var f=[r[0]-c[0],r[1]-c[1]];e.forEach((function(t,e){a(t.x)&&a(t.y)&&(t.x+=f[0],t.y+=f[1])})),t.combos.forEach((function(t){var e=o[t.id];e&&e.empty&&(t.x=e.cx||t.x,t.y=e.cy||t.y)})),t.previousLayouted=!0},e.prototype.initVals=function(){var t=this,e=t.edges,n=t.nodes,r=t.combos,i={},u={},s={};n.forEach((function(t,e){u[t.id]=t,s[t.id]=e})),t.nodeMap=u,t.indexMap=s;var c={};r.forEach((function(t){c[t.id]=t})),t.oriComboMap=c,t.comboMap=t.getComboMap();var f=t.preventOverlap;t.preventComboOverlap=t.preventComboOverlap||f,t.preventNodeOverlap=t.preventNodeOverlap||f;var h=t.collideStrength;h&&(t.comboCollideStrength=h,t.nodeCollideStrength=h),t.comboCollideStrength=t.comboCollideStrength?t.comboCollideStrength:0,t.nodeCollideStrength=t.nodeCollideStrength?t.nodeCollideStrength:0;for(var p=0;p<e.length;++p){var v=d(e[p],"source"),g=d(e[p],"target");i[v]?i[v]++:i[v]=1,i[g]?i[g]++:i[g]=1}var y=[];for(p=0;p<e.length;++p)v=d(e[p],"source"),g=d(e[p],"target"),y[p]=i[v]/(i[v]+i[g]);this.bias=y;var m,_,x=t.nodeSize,w=t.nodeSpacing;if(_=a(w)?function(){return w}:b(w)?w:function(){return 0},this.nodeSpacing=_,x)if(b(x))m=function(t){return x(t)};else if(o(x)){var E=(x[0]>x[1]?x[0]:x[1])/2;m=function(t){return E}}else{var S=x/2;m=function(t){return S}}else m=function(t){return t.size?o(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])/2:l(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)/2:t.size/2:10};this.nodeSize=m;var A,T=t.comboSpacing;A=a(T)?function(){return T}:b(T)?T:function(){return 0},this.comboSpacing=A;var I,C=t.comboPadding;I=a(C)?function(){return C}:o(C)?function(){return Math.max.apply(null,C)}:b(C)?C:function(){return 0},this.comboPadding=I;var D,N=this.linkDistance;N||(N=10),D=a(N)?function(t){return N}:N,this.linkDistance=D;var k,R=this.edgeStrength;R||(R=1),k=a(R)?function(t){return R}:R,this.edgeStrength=k;var O,M=this.nodeStrength;M||(M=30),O=a(M)?function(t){return M}:M,this.nodeStrength=O},e.prototype.initPos=function(t){this.nodes.forEach((function(e,n){var r=e.comboId,i=t[r];r&&i?(e.x=i.cx+100/(n+1),e.y=i.cy+100/(n+1)):(e.x=100/(n+1),e.y=100/(n+1))}))},e.prototype.getComboMap=function(){var t=this,e=t.nodeMap,n=t.comboTrees,r=t.oriComboMap,i={};return(n||[]).forEach((function(n){var o=[];m(n,(function(n){if("node"===n.itemType)return!0;if(!r[n.id])return!0;if(void 0===i[n.id]){var u={id:n.id,name:n.id,cx:0,cy:0,count:0,depth:t.oriComboMap[n.id].depth||0,children:[]};i[n.id]=u}var s=n.children;s&&s.forEach((function(t){if(!i[t.id]&&!e[t.id])return!0;o.push(t)}));var c=i[n.id];if(c.cx=0,c.cy=0,0===o.length){c.empty=!0;var f=r[n.id];c.cx=f.x,c.cy=f.y}return o.forEach((function(t){if(c.count++,"node"!==t.itemType){var n=i[t.id];return a(n.cx)&&(c.cx+=n.cx),void(a(n.cy)&&(c.cy+=n.cy))}var r=e[t.id];r&&(a(r.x)&&(c.cx+=r.x),a(r.y)&&(c.cy+=r.y))})),c.cx/=c.count||1,c.cy/=c.count||1,c.children=o,!0}))})),i},e.prototype.applyComboCenterForce=function(t){var e=this,n=e.gravity,r=e.comboGravity||n,i=this.alpha,o=e.comboTrees,u=e.indexMap,s=e.nodeMap,c=e.comboMap;(o||[]).forEach((function(e){m(e,(function(e){if("node"===e.itemType)return!0;if(!c[e.id])return!0;var n=c[e.id],o=(n.depth+1)/10*.5,f=n.cx,l=n.cy;return n.cx=0,n.cy=0,n.children.forEach((function(e){if("node"!==e.itemType){var h=c[e.id];return h&&a(h.cx)&&(n.cx+=h.cx),void(h&&a(h.cy)&&(n.cy+=h.cy))}var d=s[e.id],p=d.x-f||.005,v=d.y-l||.005,g=Math.sqrt(p*p+v*v),y=u[d.id],m=r*i/g*o;t[y].x-=p*m,t[y].y-=v*m,a(d.x)&&(n.cx+=d.x),a(d.y)&&(n.cy+=d.y)})),n.cx/=n.count||1,n.cy/=n.count||1,!0}))}))},e.prototype.applyCalculate=function(t){var e=this,n=e.comboMap,r=e.nodes,i={};r.forEach((function(t,e){r.forEach((function(n,r){if(!(e<r)){var o=t.x-n.x||.005,a=t.y-n.y||.005,u=o*o+a*a,s=Math.sqrt(u);u<1&&(u=s),i[t.id+"-"+n.id]={vx:o,vy:a,vl2:u,vl:s},i[n.id+"-"+t.id]={vl2:u,vl:s,vx:-o,vy:-a}}}))})),e.updateComboSizes(n),e.calRepulsive(t,i),e.calAttractive(t,i),e.preventComboOverlap&&e.comboNonOverlapping(t,n)},e.prototype.updateComboSizes=function(t){var e=this,n=e.comboTrees,r=e.nodeMap,i=e.nodeSize,a=e.comboSpacing,u=e.comboPadding;(n||[]).forEach((function(n){var s=[];m(n,(function(n){if("node"===n.itemType)return!0;var c=t[n.id];if(!c)return!1;var f=n.children;f&&f.forEach((function(e){(t[e.id]||r[e.id])&&s.push(e)})),c.minX=1/0,c.minY=1/0,c.maxX=-1/0,c.maxY=-1/0,s.forEach((function(t){if("node"!==t.itemType)return!0;var e=r[t.id];if(!e)return!0;var n=i(e),o=e.x-n,a=e.y-n,u=e.x+n,s=e.y+n;c.minX>o&&(c.minX=o),c.minY>a&&(c.minY=a),c.maxX<u&&(c.maxX=u),c.maxY<s&&(c.maxY=s)}));var l=e.oriComboMap[n.id].size||10;o(l)&&(l=l[0]);var h=Math.max(c.maxX-c.minX,c.maxY-c.minY,l);return c.r=h/2+a(c)/2+u(c),!0}))}))},e.prototype.comboNonOverlapping=function(t,e){var n=this,r=n.comboTree,i=n.comboCollideStrength,o=n.indexMap,a=n.nodeMap;m(r,(function(n){if(!e[n.id]&&!a[n.id]&&"comboTreeRoot"!==n.id)return!1;var r=n.children;return r&&r.length>1&&r.forEach((function(n,u){if("node"===n.itemType)return!1;var s=e[n.id];s&&r.forEach((function(r,c){if(u<=c)return!1;if("node"===r.itemType)return!1;var f=e[r.id];if(!f)return!1;var l=s.cx-f.cx||.005,h=s.cy-f.cy||.005,d=l*l+h*h,p=s.r||1,v=f.r||1,g=p+v,y=v*v,m=p*p;if(d<g*g){var b=n.children;if(!b||0===b.length)return!1;var _=r.children;if(!_||0===_.length)return!1;var x=Math.sqrt(d),w=(g-x)/x*i,E=l*w,S=h*w,A=y/(m+y),T=1-A;b.forEach((function(e){if("node"!==e.itemType)return!1;if(a[e.id]){var n=o[e.id];_.forEach((function(e){if("node"!==e.itemType)return!1;if(!a[e.id])return!1;var r=o[e.id];t[n].x+=E*A,t[n].y+=S*A,t[r].x-=E*T,t[r].y-=S*T}))}}))}}))})),!0}))},e.prototype.calRepulsive=function(t,e){var n=this,r=n.nodes,i=n.width*n.optimizeRangeFactor,o=n.nodeStrength,a=n.alpha,u=n.nodeCollideStrength,s=n.preventNodeOverlap,c=n.nodeSize,f=n.nodeSpacing,l=n.depthRepulsiveForceScale,h=n.center;r.forEach((function(d,p){if(d.x&&d.y){if(h){var v=n.gravity,g=d.x-h[0]||.005,y=d.y-h[1]||.005,m=Math.sqrt(g*g+y*y);t[p].x-=g*v*a/m,t[p].y-=y*v*a/m}r.forEach((function(n,r){if(p!==r&&n.x&&n.y){var h=e[d.id+"-"+n.id],v=h.vl2,g=h.vl;if(!(g>i)){var y=e[d.id+"-"+n.id],m=y.vx,b=y.vy,_=Math.log(Math.abs(n.depth-d.depth)/10)+1||1;_=_<1?1:_,n.comboId!==d.comboId&&(_+=1);var x=_?Math.pow(l,_):1,w=o(n)*a/v*x;if(t[p].x+=m*w,t[p].y+=b*w,p<r&&s){var E=c(d)+f(d)||1,S=c(n)+f(n)||1,A=E+S;if(v<A*A){var T=(A-g)/g*u,I=S*S,C=I/(E*E+I),D=m*T,N=b*T;t[p].x+=D*C,t[p].y+=N*C,C=1-C,t[r].x-=D*C,t[r].y-=N*C}}}}}))}}))},e.prototype.calAttractive=function(t,e){var n=this,r=n.edges,i=n.linkDistance,o=n.alpha,u=n.edgeStrength,s=n.bias,c=n.depthAttractiveForceScale;r.forEach((function(r,f){var l=d(r,"source"),h=d(r,"target");if(l&&h&&l!==h){var p=n.indexMap[l],v=n.indexMap[h],g=n.nodeMap[l],y=n.nodeMap[h];if(g&&y){var m=g.depth===y.depth?0:Math.log(Math.abs(g.depth-y.depth)/10);g.comboId===y.comboId&&(m/=2);var b=m?Math.pow(c,m):1;if(g.comboId!==y.comboId&&1===b?b=c/2:g.comboId===y.comboId&&(b=2),a(y.x)&&a(g.x)&&a(y.y)&&a(g.y)){var _=e[h+"-"+l],x=_.vl,w=_.vx,E=_.vy,S=(x-i(r))/x*o*u(r)*b,A=w*S,T=E*S,I=s[f];t[v].x-=A*I,t[v].y-=T*I,t[p].x+=A*(1-I),t[p].y+=T*(1-I)}}}}))},e.prototype.getType=function(){return"comboForce"},e}(t),rd=function(){function t(t){this.id=t.id||0,this.rx=t.rx,this.ry=t.ry,this.fx=0,this.fy=0,this.mass=t.mass,this.degree=t.degree,this.g=t.g||0}return t.prototype.distanceTo=function(t){var e=this.rx-t.rx,n=this.ry-t.ry;return Math.hypot(e,n)},t.prototype.setPos=function(t,e){this.rx=t,this.ry=e},t.prototype.resetForce=function(){this.fx=0,this.fy=0},t.prototype.addForce=function(t){var e=t.rx-this.rx,n=t.ry-this.ry,r=Math.hypot(e,n);r=r<1e-4?1e-4:r;var i=this.g*(this.degree+1)*(t.degree+1)/r;this.fx+=i*e/r,this.fy+=i*n/r},t.prototype.in=function(t){return t.contains(this.rx,this.ry)},t.prototype.add=function(e){var n=this.mass+e.mass;return new t({rx:(this.rx*this.mass+e.rx*e.mass)/n,ry:(this.ry*this.mass+e.ry*e.mass)/n,mass:n,degree:this.degree+e.degree})},t}();const id=rd;const od=function(){function t(t){this.xmid=t.xmid,this.ymid=t.ymid,this.length=t.length,this.massCenter=t.massCenter||[0,0],this.mass=t.mass||1}return t.prototype.getLength=function(){return this.length},t.prototype.contains=function(t,e){var n=this.length/2;return t<=this.xmid+n&&t>=this.xmid-n&&e<=this.ymid+n&&e>=this.ymid-n},t.prototype.NW=function(){return new t({xmid:this.xmid-this.length/4,ymid:this.ymid+this.length/4,length:this.length/2})},t.prototype.NE=function(){return new t({xmid:this.xmid+this.length/4,ymid:this.ymid+this.length/4,length:this.length/2})},t.prototype.SW=function(){return new t({xmid:this.xmid-this.length/4,ymid:this.ymid-this.length/4,length:this.length/2})},t.prototype.SE=function(){return new t({xmid:this.xmid+this.length/4,ymid:this.ymid-this.length/4,length:this.length/2})},t}(),ad=function(){function t(t){this.body=null,this.quad=null,this.NW=null,this.NE=null,this.SW=null,this.SE=null,this.theta=.5,null!=t&&(this.quad=t)}return t.prototype.insert=function(e){null!=this.body?this._isExternal()?(this.quad&&(this.NW=new t(this.quad.NW()),this.NE=new t(this.quad.NE()),this.SW=new t(this.quad.SW()),this.SE=new t(this.quad.SE())),this._putBody(this.body),this._putBody(e),this.body=this.body.add(e)):(this.body=this.body.add(e),this._putBody(e)):this.body=e},t.prototype._putBody=function(t){this.quad&&(t.in(this.quad.NW())&&this.NW?this.NW.insert(t):t.in(this.quad.NE())&&this.NE?this.NE.insert(t):t.in(this.quad.SW())&&this.SW?this.SW.insert(t):t.in(this.quad.SE())&&this.SE&&this.SE.insert(t))},t.prototype._isExternal=function(){return null==this.NW&&null==this.NE&&null==this.SW&&null==this.SE},t.prototype.updateForce=function(t){null!=this.body&&t!==this.body&&(this._isExternal()||(this.quad?this.quad.getLength():0)/this.body.distanceTo(t)<this.theta?t.addForce(this.body):(this.NW&&this.NW.updateForce(t),this.NE&&this.NE.updateForce(t),this.SW&&this.SW.updateForce(t),this.SE&&this.SE.updateForce(t)))},t}();var ud=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),sd=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.width=300,n.height=300,n.nodes=[],n.edges=[],n.kr=5,n.kg=1,n.mode="normal",n.preventOverlap=!1,n.dissuadeHubs=!1,n.barnesHut=void 0,n.maxIteration=0,n.ks=.1,n.ksmax=10,n.tao=.1,n.onLayoutEnd=function(){},n.prune=void 0,n.updateCfg(e),n}return ud(e,t),e.prototype.getDefaultCfg=function(){return{}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.onLayoutEnd,r=t.prune,i=t.maxIteration;t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight);for(var u=[],s=e.length,c=0;c<s;c+=1){var f=e[c],h=10,d=10;a(f.size)&&(h=f.size,d=f.size),o(f.size)?(isNaN(f.size[0])||(h=f.size[0]),isNaN(f.size[1])||(d=f.size[1])):l(f.size)&&(h=f.size.width,d=f.size.height),t.getWidth&&!isNaN(t.getWidth(f))&&(d=t.getWidth(f)),t.getHeight&&!isNaN(t.getHeight(f))&&(h=t.getHeight(f));var p=Math.max(h,d);u.push(p)}void 0===t.barnesHut&&s>250&&(t.barnesHut=!0),void 0===t.prune&&s>100&&(t.prune=!0),0!==this.maxIteration||t.prune?0===this.maxIteration&&r&&(i=100,s<=200&&s>100?i=500:s>200&&(i=950),this.maxIteration=i):(i=250,s<=200&&s>100?i=1e3:s>200&&(i=1200),this.maxIteration=i),t.kr||(t.kr=50,s>100&&s<=500?t.kr=20:s>500&&(t.kr=1)),t.kg||(t.kg=20,s>100&&s<=500?t.kg=10:s>500&&(t.kg=1)),this.nodes=t.updateNodesByForces(u),n()},e.prototype.updateNodesByForces=function(t){for(var e=this,n=e.edges,r=e.maxIteration,i=e.nodes,o=n.filter((function(t){return d(t,"source")!==d(t,"target")})),a=i.length,u=o.length,s=[],c={},f={},l=[],h=0;h<a;h+=1)c[i[h].id]=h,s[h]=0,(void 0===i[h].x||isNaN(i[h].x))&&(i[h].x=1e3*Math.random()),(void 0===i[h].y||isNaN(i[h].y))&&(i[h].y=1e3*Math.random()),l.push({x:i[h].x,y:i[h].y});for(h=0;h<u;h+=1){for(var p=void 0,v=void 0,g=0,y=0,m=0;m<a;m+=1){var b=d(o[h],"source"),_=d(o[h],"target");i[m].id===b?(p=i[m],g=m):i[m].id===_&&(v=i[m],y=m),f[h]={sourceIdx:g,targetIdx:y}}p&&(s[c[p.id]]+=1),v&&(s[c[v.id]]+=1)}var x=r;if(i=this.iterate(x,c,f,u,s,t),e.prune){for(m=0;m<u;m+=1)s[f[m].sourceIdx]<=1?(i[f[m].sourceIdx].x=i[f[m].targetIdx].x,i[f[m].sourceIdx].y=i[f[m].targetIdx].y):s[f[m].targetIdx]<=1&&(i[f[m].targetIdx].x=i[f[m].sourceIdx].x,i[f[m].targetIdx].y=i[f[m].sourceIdx].y);e.prune=!1,e.barnesHut=!1,x=100,i=this.iterate(x,c,f,u,s,t)}return i},e.prototype.iterate=function(t,e,n,r,i,o){for(var a=this,u=a.nodes,s=a.kr,c=a.preventOverlap,f=a.barnesHut,l=u.length,h=0,d=t,p=[],v=[],g=[],y=0;y<l;y+=1)if(p[2*y]=0,p[2*y+1]=0,f){var m={id:y,rx:u[y].x,ry:u[y].y,mass:1,g:s,degree:i[y]};g[y]=new id(m)}for(;d>0;){for(y=0;y<l;y+=1)v[2*y]=p[2*y],v[2*y+1]=p[2*y+1],p[2*y]=0,p[2*y+1]=0;p=this.getAttrForces(d,50,r,e,n,i,o,p),p=f&&(c&&d>50||!c)?this.getOptRepGraForces(p,g,i):this.getRepGraForces(d,50,p,100,o,i);var b=this.updatePos(p,v,h,i);u=b.nodes,h=b.sg,d--,a.tick&&a.tick()}return u},e.prototype.getAttrForces=function(t,e,n,r,i,o,a,u){for(var s=this,c=s.nodes,f=s.preventOverlap,l=s.dissuadeHubs,h=s.mode,d=s.prune,p=0;p<n;p+=1){var v=c[i[p].sourceIdx],g=i[p].sourceIdx,y=c[i[p].targetIdx],m=i[p].targetIdx;if(!d||!(o[g]<=1||o[m]<=1)){var b=[y.x-v.x,y.y-v.y],_=Math.hypot(b[0],b[1]);_=_<1e-4?1e-4:_,b[0]=b[0]/_,b[1]=b[1]/_,f&&t<e&&(_=_-a[g]-a[m]);var x=_,w=x;"linlog"===h&&(w=x=Math.log(1+_)),l&&(x=_/o[g],w=_/o[m]),f&&t<e&&_<=0?(x=0,w=0):f&&t<e&&_>0&&(x=_,w=_),u[2*r[v.id]]+=x*b[0],u[2*r[y.id]]-=w*b[0],u[2*r[v.id]+1]+=x*b[1],u[2*r[y.id]+1]-=w*b[1]}}return u},e.prototype.getRepGraForces=function(t,e,n,r,i,o){for(var a=this,u=a.nodes,s=a.preventOverlap,c=a.kr,f=a.kg,l=a.center,h=a.prune,d=u.length,p=0;p<d;p+=1){for(var v=p+1;v<d;v+=1)if(!h||!(o[p]<=1||o[v]<=1)){var g=[u[v].x-u[p].x,u[v].y-u[p].y],y=Math.hypot(g[0],g[1]);y=y<1e-4?1e-4:y,g[0]=g[0]/y,g[1]=g[1]/y,s&&t<e&&(y=y-i[p]-i[v]);var m=c*(o[p]+1)*(o[v]+1)/y;s&&t<e&&y<0?m=r*(o[p]+1)*(o[v]+1):s&&t<e&&0===y?m=0:s&&t<e&&y>0&&(m=c*(o[p]+1)*(o[v]+1)/y),n[2*p]-=m*g[0],n[2*v]+=m*g[0],n[2*p+1]-=m*g[1],n[2*v+1]+=m*g[1]}var b=[u[p].x-l[0],u[p].y-l[1]],_=Math.hypot(b[0],b[1]);b[0]=b[0]/_,b[1]=b[1]/_;var x=f*(o[p]+1);n[2*p]-=x*b[0],n[2*p+1]-=x*b[1]}return n},e.prototype.getOptRepGraForces=function(t,e,n){for(var r=this,i=r.nodes,o=r.kg,a=r.center,u=r.prune,s=i.length,c=9e10,f=-9e10,l=9e10,h=-9e10,d=0;d<s;d+=1)u&&n[d]<=1||(e[d].setPos(i[d].x,i[d].y),i[d].x>=f&&(f=i[d].x),i[d].x<=c&&(c=i[d].x),i[d].y>=h&&(h=i[d].y),i[d].y<=l&&(l=i[d].y));var p=Math.max(f-c,h-l),v=new od({xmid:(f+c)/2,ymid:(h+l)/2,length:p,massCenter:a,mass:s}),g=new ad(v);for(d=0;d<s;d+=1)u&&n[d]<=1||e[d].in(v)&&g.insert(e[d]);for(d=0;d<s;d+=1)if(!(u&&n[d]<=1)){e[d].resetForce(),g.updateForce(e[d]),t[2*d]-=e[d].fx,t[2*d+1]-=e[d].fy;var y=[i[d].x-a[0],i[d].y-a[1]],m=Math.hypot(y[0],y[1]);m=m<1e-4?1e-4:m,y[0]=y[0]/m,y[1]=y[1]/m;var b=o*(n[d]+1);t[2*d]-=b*y[0],t[2*d+1]-=b*y[1]}return t},e.prototype.updatePos=function(t,e,n,r){for(var i=this,o=i.nodes,a=i.ks,u=i.tao,s=i.prune,c=i.ksmax,f=o.length,l=[],h=[],d=0,p=0,v=0;v<f;v+=1)if(!(s&&r[v]<=1)){var g=[t[2*v]-e[2*v],t[2*v+1]-e[2*v+1]],y=Math.hypot(g[0],g[1]),m=[t[2*v]+e[2*v],t[2*v+1]+e[2*v+1]],b=Math.hypot(m[0],m[1]);l[v]=y,h[v]=b/2,d+=(r[v]+1)*l[v],p+=(r[v]+1)*h[v]}var _=n;for(n=u*p/d,0!==_&&(n=n>1.5*_?1.5*_:n),v=0;v<f;v+=1)if(!(s&&r[v]<=1)){var x=a*n/(1+n*Math.sqrt(l[v])),w=Math.hypot(t[2*v],t[2*v+1]),E=c/(w=w<1e-4?1e-4:w),S=(x=x>E?E:x)*t[2*v],A=x*t[2*v+1];o[v].x+=S,o[v].y+=A}return{nodes:o,sg:n}},e}(t),cd=function(){return cd=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},cd.apply(this,arguments)},fd=function(){function t(){this.cells=[],this.columnNum=0,this.rowNum=0,this.additionColumn=[],this.additionRow=[]}return t.prototype.init=function(e,n,r){this.cells=[],this.CELL_W=r.CELL_W||t.DEFAULT_CELL_W,this.CELL_H=r.CELL_H||t.DEFAULT_CELL_H,this.columnNum=Math.ceil(e/this.CELL_W),this.rowNum=Math.ceil(n/this.CELL_H),t.MIN_DIST=Math.pow(e,2)+Math.pow(n,2);for(var i=0;i<this.columnNum;i++){for(var o=[],a=0;a<this.rowNum;a++){var u={dx:i,dy:a,x:i*this.CELL_W,y:a*this.CELL_H,occupied:!1};o.push(u)}this.cells.push(o)}},t.prototype.findGridByNodeId=function(t){for(var e,n,r=0;r<this.columnNum;r++)for(var i=0;i<this.rowNum;i++)if(this.cells[r][i].node&&(null===(n=null===(e=this.cells[r][i])||void 0===e?void 0:e.node)||void 0===n?void 0:n.id)===t)return{column:r,row:i};return null},t.prototype.sqdist=function(t,e){return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)},t.prototype.occupyNearest=function(e){for(var n,r=t.MIN_DIST,i=null,o=0;o<this.columnNum;o++)for(var a=0;a<this.rowNum;a++)!this.cells[o][a].occupied&&(n=this.sqdist(e,this.cells[o][a]))<r&&(r=n,i=this.cells[o][a]);return i&&(i.occupied=!0),i},t.prototype.insertColumn=function(t,e){if(!(e<=0)){for(var n=0;n<e;n++){this.cells[n+this.columnNum]=[];for(var r=0;r<this.rowNum;r++)this.cells[n+this.columnNum][r]={dx:n,dy:r,x:n*this.CELL_W,y:r*this.CELL_H,occupied:!1,node:null}}for(n=this.columnNum-1;n>t;n--)for(r=0;r<this.rowNum;r++)this.cells[n+e][r]=cd(cd({},this.cells[n][r]),{x:(n+e)*this.CELL_W,y:r*this.CELL_H}),this.cells[n][r]={x:n*this.CELL_W,y:r*this.CELL_H,occupied:!0,node:null};for(r=0;r<this.additionColumn.length;r++)this.additionColumn[r]>=t&&(this.additionColumn[r]+=e);for(n=0;n<e;n++)this.additionColumn.push(t+n+1);this.columnNum+=e}},t.prototype.insertRow=function(t,e){if(!(e<=0)){for(var n=0;n<e;n++)for(var r=0;r<this.columnNum;r++)this.cells[r][n+this.rowNum]={dx:r,dy:n,x:r*this.CELL_W,y:n*this.CELL_H,occupied:!1,node:null};for(r=0;r<this.columnNum;r++)for(n=this.rowNum-1;n>t;n--)this.cells[r][n+e]=cd(cd({},this.cells[r][n]),{dx:r,dy:n+e,x:r*this.CELL_W,y:(n+e)*this.CELL_H}),this.cells[r][n]={dx:r,dy:n,x:r*this.CELL_W,y:n*this.CELL_H,occupied:!1,node:null};for(n=0;n<this.additionRow.length;n++)this.additionRow[n]>=t&&(this.additionRow[n]+=e);for(r=0;r<e;r++)this.additionRow.push(t+r+1);this.rowNum+=e}},t.prototype.getNodes=function(){for(var t=[],e=0;e<this.columnNum;e++)for(var n=0;n<this.rowNum;n++)this.cells[e][n].node&&t.push(this.cells[e][n]);return t},t.MIN_DIST=50,t.DEFAULT_CELL_W=80,t.DEFAULT_CELL_H=80,t}();const ld=fd;var hd=1e7,dd=1.5707963267948966,pd=new Map,vd=.8;function gd(t,e){var n=(pd.get(t.id)||[]).find((function(t){return t.source===e.id||t.target===e.id})),r=t.size[0]*t.size[1],i=e.size[0]*e.size[1],o=r>i?e:t,a=r>i?t:e,u=o.x-o.size[0]/2,s=o.y-o.size[1]/2,c=o.x+o.size[0]/2,f=o.y+o.size[1]/2,l=a.x-a.size[0]/2,h=a.y-a.size[1]/2,d=a.x+a.size[0]/2,p=a.y+a.size[1]/2,v=o.x,g=o.y,y=a.x,m=a.y,b=0,_=0;if(c>=l&&d>=u&&f>=h&&p>=s)0===(_=Math.sqrt(Math.pow(y-v,2)+Math.pow(m-g,2)))&&(_=1e-7),b=10/_*100+((c<d?c:d)-(u>l?u:l))*((f<p?f:p)-(s>h?s:h)),b*=hd;else{var x=!1,w=function(t,e,n){var r=t.x-t.size[0]/2,i=t.y-t.size[1]/2,o=t.x+t.size[0]/2,a=t.y+t.size[1]/2,u=e.x-e.size[0]/2,s=e.y-e.size[1]/2,c=e.x+e.size[0]/2,f=e.y+e.size[1]/2,l=t.x,h=t.y,d=e.x,p=e.y,v=d-l,g=Math.atan2(v,p-h),y=0,m=0,b=0,_=0;g>dd?(m=i-f,y=u-o,b=parseFloat(m?(m/Math.cos(g)).toFixed(2):y.toFixed(2)),_=parseFloat(y?(y/Math.sin(g)).toFixed(2):m.toFixed(2))):b=_=0<g&&g<=dd?(m=s-a)>(y=u-o)?parseFloat(m?(m/Math.cos(g)).toFixed(2):y.toFixed(2)):parseFloat(y?(y/Math.sin(g)).toFixed(2):m.toFixed(2)):g<-dd?(m=i-f)>(y=-(c-r))?parseFloat(m?(m/Math.cos(g)).toFixed(2):y.toFixed(2)):parseFloat(y?(y/Math.sin(g)).toFixed(2):m.toFixed(2)):(m=s-a)>(y=Math.abs(v)>(o-r)/2?r-c:v)?parseFloat(m?(m/Math.cos(g)).toFixed(2):y.toFixed(2)):parseFloat(y&&0!==g?(y/Math.sin(g)).toFixed(2):m.toFixed(2));var x=parseFloat(g.toFixed(2)),w=n;return n&&(w=1.1780972450961724<x&&x<1.9634954084936207),{distance:Math.abs(b<_?b:_),isHoriz:w}}(o,a,x);_=w.distance,x=w.isHoriz,_<=10?b+=0!==_?n?10+1e7/_:10+1e8/_:hd:(b+=_,n&&(b+=_*_))}return b}function yd(t){for(var e=0,n=0;n<t.length;n++){var r=t[n];(r.x<0||r.y<0||r.x>1200||r.y>800)&&(e+=1e12);for(var i=n+1;i<t.length;i++)e+=gd(r,t[i])}return e}function md(t,e,n,r){var i=new Map;n.forEach((function(t,e){i.set(t.id,t)}));var o=r.filter((function(e){return e.source===t.id||e.target===t.id}))||[],a=[];o.forEach((function(e){var n=e.source===t.id?e.target:e.source,r=i.get(n);r&&a.push(r)}));for(var u=!0,s=0;s<a.length;s++){var c=a[s],f=180*Math.atan((t.y-c.y)/(c.x-t.y)),l=180*Math.atan((e.y-c.y)/(c.x-e.y)),h=f>70&&f<110,d=l>70&&l<110;if((f<30||f>150)&&!(l<30||l>150)||f*l<0){u=!1;break}if(h&&!d||f*l<0){u=!1;break}if((c.x-t.x)*(c.x-e.x)<0){u=!1;break}if((c.y-t.y)*(c.y-e.y)<0){u=!1;break}}return u}function bd(t,e){for(var n=!1,r=[10,-10,0,0],i=[0,0,10,-10],o=0;o<t.length;++o)for(var a=t[o],u=_d(a,t),s=0;s<r.length;s++)if(md(a,{x:a.x+r[s],y:a.y+i[s]},t,e)){a.x+=r[s],a.y+=i[s];var c=_d(a,t),f=Math.random();c<u||f<vd&&f>.1?(u=c,n=!0):(a.x-=r[s],a.y-=i[s])}return vd>.1&&(vd*=.5),n?yd(t):0}function _d(t,e){var n=0;(t.x<0||t.y<0||t.x+t.size[0]+20>1200||t.y+t.size[1]+20>800)&&(n+=1e12);for(var r=0;r<e.length;++r)t.id!==e[r].id&&(n+=gd(t,e[r]));return n}var xd=function(){return xd=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},xd.apply(this,arguments)};function wd(t,e){var n=t.nodes,r=t.edges,i=e.width,o=e.height;if(!(null==n?void 0:n.length))return Promise.resolve();var a=[];n.forEach((function(t){if(r.filter((function(e){return e.source===t.id||e.target===t.id})).length>1){var e=xd({},t);delete e.size,a.push(e)}}));var u=[];r.forEach((function(t){var e=a.find((function(e){return e.id===t.source})),n=a.find((function(e){return e.id===t.target}));e&&n&&u.push(t)}));var s=new Mn({type:"dagre",ranksep:e.nodeMinGap,nodesep:e.nodeMinGap}).layout({nodes:a,edges:u}).nodes;n.forEach((function(t){var e=(s||[]).find((function(e){return e.id===t.id}));t.x=(null==e?void 0:e.x)||i/2,t.y=(null==e?void 0:e.y)||o/2}));var c=JSON.parse(JSON.stringify(n)),f=JSON.parse(JSON.stringify(r)),l=gt().nodes(c).force("link",xt(f).id((function(t){return t.id})).distance((function(t){return u.find((function(e){return e.source===t.source&&e.target===t.target}))?30:20}))).force("charge",yt()).force("center",mt(i/2,o/2)).force("x",At(i/2)).force("y",Tt(o/2)).alpha(.3).alphaDecay(.08).alphaMin(.001),h=new Promise((function(t){l.on("end",(function(){n.forEach((function(t){var e=c.find((function(e){return e.id===t.id}));e&&(t.x=e.x,t.y=e.y)}));var a=Math.min.apply(Math,n.map((function(t){return t.x}))),u=Math.max.apply(Math,n.map((function(t){return t.x}))),s=Math.min.apply(Math,n.map((function(t){return t.y}))),f=Math.max.apply(Math,n.map((function(t){return t.y}))),l=i/(u-a),h=o/(f-s);n.forEach((function(t){void 0!==t.x&&l<1&&(t.x=(t.x-a)*l),void 0!==t.y&&h<1&&(t.y=(t.y-s)*h)})),n.forEach((function(t){t.sizeTemp=t.size,t.size=[10,10]})),function(t,e){if(0===t.length)return{nodes:t,edges:e};t.forEach((function(t){var n=e.filter((function(e){return e.source===t.id||e.target===t.id}));pd.set(t,n)})),t.sort((function(t,e){var n,r;return(null===(n=pd.get(t.id))||void 0===n?void 0:n.length)-(null===(r=pd.get(e.id))||void 0===r?void 0:r.length)}));for(var n=yd(t),r=20,i=1,o=0,a=0;r>0&&!(++a>=50);){var u=bd(t,e);0!==u&&(o=u),i=o-n,n=o,0===i?--r:r=20}t.forEach((function(t){t.x=t.x-t.size[0]/2,t.y=t.y-t.size[1]/2}))}(n,r),n.forEach((function(t){t.size=t.sizeTemp||[],delete t.sizeTemp})),function(t,e){if(!t.nodes||0===t.nodes.length)return t;var n=e.width,r=e.height,i=e.nodeMinGap,o=1e4,a=1e4;t.nodes.forEach((function(t){var e=t.size[0]||50,n=t.size[1]||50;o=Math.min(e,o),a=Math.min(n,a)}));var u=new ld;u.init(n,r,{CELL_H:a,CELL_W:o}),t.nodes.forEach((function(t){var e=u.occupyNearest(t);e&&(e.node={id:t.id,size:t.size},t.x=e.x,t.y=e.y,t.dx=e.dx,t.dy=e.dy)}));for(var s=0;s<t.nodes.length;s++){var c=t.nodes[s],f=u.findGridByNodeId(c.id);if(!f)throw new Error("can not find node cell");var l=f.column,h=f.row;if(c.size[0]+i>o){for(var d=v=Math.ceil((c.size[0]+i)/o)-1,p=0;p<v&&u.additionColumn.indexOf(l+p+1)>-1&&!u.cells[l+p+1][h].node;p++)d--;u.insertColumn(l,d)}if(c.size[1]+i>a){var v;for(d=v=Math.ceil((c.size[1]+i)/a)-1,p=0;p<v&&u.additionRow.indexOf(h+p+1)>-1&&!u.cells[l][h+p+1].node;p++)d--;u.insertRow(h,d)}}for(s=0;s<u.columnNum;s++){var g=function(e){var n=u.cells[s][e];if(n.node){var r=t.nodes.find((function(t){var e;return t.id===(null===(e=null==n?void 0:n.node)||void 0===e?void 0:e.id)}));r&&(r.x=n.x+r.size[0]/2,r.y=n.y+r.size[1]/2)}};for(p=0;p<u.rowNum;p++)g(p)}}({nodes:n,edges:r},e),t()}))}));return h}var Ed=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Sd=function(t){function e(e){var n=t.call(this)||this;return n.width=300,n.height=300,n.nodeMinGap=50,n.onLayoutEnd=function(){},e&&n.updateCfg(e),n}return Ed(e,t),e.prototype.getDefaultCfg=function(){return{width:300,height:300,nodeMinGap:50}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.edges;return null==e||e.forEach((function(t){t.size||(t.size=[50,50])})),wd({nodes:e,edges:n},{width:this.width,height:this.height,nodeMinGap:this.nodeMinGap}).then((function(){t.onLayoutEnd&&t.onLayoutEnd()}))},e.prototype.getType=function(){return"er"},e}(t),Ad=function(){function t(t){var e=S(t.type);this.layoutInstance=new e(t)}return t.prototype.layout=function(t){return this.layoutInstance.layout(t)},t.prototype.updateCfg=function(t){this.layoutInstance.updateCfg(t)},t.prototype.init=function(t){this.layoutInstance.init(t)},t.prototype.execute=function(){this.layoutInstance.execute()},t.prototype.getDefaultCfg=function(){return this.layoutInstance.getDefaultCfg()},t.prototype.destroy=function(){return this.layoutInstance.destroy()},t}(),Td={force:Dt,fruchterman:yr,forceAtlas2:sd,gForce:k,dagre:Mn,circular:Ot,radial:lr,concentric:dr,grid:T,mds:vr,comboForce:nd,random:C,"gForce-gpu":td,"fruchterman-gpu":Zh,er:Sd}})(),r})()}));
|
|
3
3
|
//# sourceMappingURL=layout.min.js.map
|