@antv/layout 0.1.19-beta.2 → 0.1.19

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.
Files changed (65) hide show
  1. package/dist/layout.min.js +1 -1
  2. package/dist/layout.min.js.map +1 -1
  3. package/es/layout/er/core.d.ts +1 -0
  4. package/es/layout/er/core.js +107 -0
  5. package/es/layout/er/core.js.map +1 -0
  6. package/es/layout/er/forceGrid.d.ts +8 -0
  7. package/es/layout/er/forceGrid.js +88 -0
  8. package/es/layout/er/forceGrid.js.map +1 -0
  9. package/es/layout/er/grid.d.ts +26 -0
  10. package/es/layout/er/grid.js +162 -0
  11. package/es/layout/er/grid.js.map +1 -0
  12. package/es/layout/er/index.d.ts +29 -0
  13. package/es/layout/er/index.js +54 -0
  14. package/es/layout/er/index.js.map +1 -0
  15. package/es/layout/er/mysqlWorkbench.d.ts +6 -0
  16. package/es/layout/er/mysqlWorkbench.js +324 -0
  17. package/es/layout/er/mysqlWorkbench.js.map +1 -0
  18. package/es/layout/er/type.d.ts +35 -0
  19. package/es/layout/er/type.js +2 -0
  20. package/es/layout/er/type.js.map +1 -0
  21. package/es/layout/fruchterman.js +2 -2
  22. package/es/layout/fruchterman.js.map +1 -1
  23. package/es/layout/gForce.js +2 -2
  24. package/es/layout/gForce.js.map +1 -1
  25. package/es/layout/index.d.ts +2 -1
  26. package/es/layout/index.js +2 -1
  27. package/es/layout/index.js.map +1 -1
  28. package/es/layout/layout.js +33 -11
  29. package/es/layout/layout.js.map +1 -1
  30. package/es/layout/types.d.ts +8 -2
  31. package/es/registy/index.d.ts +1 -1
  32. package/es/registy/index.js +1 -0
  33. package/es/registy/index.js.map +1 -1
  34. package/lib/layout/er/core.d.ts +1 -0
  35. package/lib/layout/er/core.js +143 -0
  36. package/lib/layout/er/core.js.map +1 -0
  37. package/lib/layout/er/forceGrid.d.ts +8 -0
  38. package/lib/layout/er/forceGrid.js +97 -0
  39. package/lib/layout/er/forceGrid.js.map +1 -0
  40. package/lib/layout/er/grid.d.ts +26 -0
  41. package/lib/layout/er/grid.js +177 -0
  42. package/lib/layout/er/grid.js.map +1 -0
  43. package/lib/layout/er/index.d.ts +29 -0
  44. package/lib/layout/er/index.js +80 -0
  45. package/lib/layout/er/index.js.map +1 -0
  46. package/lib/layout/er/mysqlWorkbench.d.ts +6 -0
  47. package/lib/layout/er/mysqlWorkbench.js +326 -0
  48. package/lib/layout/er/mysqlWorkbench.js.map +1 -0
  49. package/lib/layout/er/type.d.ts +35 -0
  50. package/lib/layout/er/type.js +3 -0
  51. package/lib/layout/er/type.js.map +1 -0
  52. package/lib/layout/fruchterman.js +2 -2
  53. package/lib/layout/fruchterman.js.map +1 -1
  54. package/lib/layout/gForce.js +2 -2
  55. package/lib/layout/gForce.js.map +1 -1
  56. package/lib/layout/index.d.ts +2 -1
  57. package/lib/layout/index.js +3 -1
  58. package/lib/layout/index.js.map +1 -1
  59. package/lib/layout/layout.js +32 -10
  60. package/lib/layout/layout.js.map +1 -1
  61. package/lib/layout/types.d.ts +8 -2
  62. package/lib/registy/index.d.ts +1 -1
  63. package/lib/registy/index.js +1 -0
  64. package/lib/registy/index.js.map +1 -1
  65. package/package.json +1 -1
@@ -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={27294:()=>{},89586:()=>{},62697:()=>{},71894:()=>{},71186:()=>{},25275:()=>{},72862:()=>{},49633:()=>{},17222:()=>{},25965:()=>{},32391:()=>{},13945:()=>{},49216:(t,e,n)=>{"use strict";n(59504),n(43982),n(90721),n(25778),n(63898),n(67536),n(85834),n(96945),n(20547),n(55967),n(13515),n(13042),n(34962),n(10405)},90122:(t,e,n)=>{t.exports=n(10405)},98344:(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"},59504:(t,e,n)=>{n(82825),n(76051),n(72640),n(29518),n(8201),n(40470),n(15723),n(7525),n(39788),n(61498),n(7577),n(16129),n(52802),n(57940),n(25261),n(59340),n(1584),n(47298),n(71765),n(15747),n(67451),n(82784),n(62809),n(67454),n(23053),n(88032),n(17551),n(62929),n(20215),n(96183),n(48190),n(30473),n(60948),n(50942),n(82870),n(32212),n(54230),n(69754),n(12811),n(73998),n(41769),n(68789),n(12848),n(1762),n(41323),n(96063),n(33282),n(76816),n(51854),n(63303),n(14421),n(12203),n(1028),n(96818),n(85557),n(27938),n(88316),n(7937),n(80637),n(8219),n(99029),n(93157),n(79791),n(92296),n(14555),n(66505),n(4722),n(59713),n(47392),n(64687),n(43684),n(33339),n(44148),n(77754),n(44094),n(78781),n(85013),n(3735),n(88723),n(2247),n(39689),n(29003),n(29026),n(54088),n(30535),n(85788),n(67878),n(85119),n(83135),n(95015),n(78059),n(10646),n(25377),n(59879),n(15305),n(36341),n(95915),n(44488),n(9281),n(40163),n(86668),n(87139),n(96408),n(28686),n(65480),n(19121),n(90914),n(37742),n(47843),n(96441),n(10429),n(52214),n(498),n(96349),n(83742),n(59604),n(72592),n(79290),n(69363),n(16907),n(78632),n(1838),n(73421),n(56144),n(28275),n(92552),n(83077),n(31838),n(18916),n(18978),n(98531),n(57323),n(3704),n(45305),n(28812),n(82636),n(51602),n(83871),t.exports=n(52845)},90721:(t,e,n)=>{n(67744),t.exports=n(52845).Array.flatMap},43982:(t,e,n)=>{n(75448),t.exports=n(52845).Array.includes},13515:(t,e,n)=>{n(8938),t.exports=n(52845).Object.entries},20547:(t,e,n)=>{n(67819),t.exports=n(52845).Object.getOwnPropertyDescriptors},55967:(t,e,n)=>{n(26572),t.exports=n(52845).Object.values},13042:(t,e,n)=>{"use strict";n(47843),n(78228),t.exports=n(52845).Promise.finally},63898:(t,e,n)=>{n(13336),t.exports=n(52845).String.padEnd},25778:(t,e,n)=>{n(3718),t.exports=n(52845).String.padStart},85834:(t,e,n)=>{n(46642),t.exports=n(52845).String.trimRight},67536:(t,e,n)=>{n(47831),t.exports=n(52845).String.trimLeft},96945:(t,e,n)=>{n(79956),t.exports=n(57686).f("asyncIterator")},72680:(t,e,n)=>{n(98358),t.exports=n(23142).global},23749:t=>{t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},98891:(t,e,n)=>{var r=n(92799);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},23142:t=>{var e=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=e)},85526:(t,e,n)=>{var r=n(23749);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(49880)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},22004:(t,e,n)=>{var r=n(92799),i=n(55505).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},52069:(t,e,n)=>{var r=n(55505),i=n(23142),o=n(85526),a=n(95954),u=n(99761),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},49880:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},55505: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)},99761:t=>{var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},95954:(t,e,n)=>{var r=n(45584),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}},44053:(t,e,n)=>{t.exports=!n(7498)&&!n(49880)((function(){return 7!=Object.defineProperty(n(22004)("div"),"a",{get:function(){return 7}}).a}))},92799:t=>{t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},45584:(t,e,n)=>{var r=n(98891),i=n(44053),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(92799);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")}},98358:(t,e,n)=>{var r=n(52069);r(r.G,{global:n(55505)})},51464:t=>{t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},88347:(t,e,n)=>{var r=n(91669);t.exports=function(t,e){if("number"!=typeof t&&"Number"!=r(t))throw TypeError(e);return+t}},24691:(t,e,n)=>{var r=n(10341)("unscopables"),i=Array.prototype;null==i[r]&&n(90913)(i,r,{}),t.exports=function(t){i[r][t]=!0}},40178:(t,e,n)=>{"use strict";var r=n(58016)(!0);t.exports=function(t,e,n){return e+(n?r(t,e).length:1)}},36903: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}},50486:(t,e,n)=>{var r=n(91255);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},61064:(t,e,n)=>{"use strict";var r=n(17583),i=n(59260),o=n(88087);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(17583),i=n(59260),o=n(88087);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(28182),i=n(88087),o=n(59260);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}}},97622:(t,e,n)=>{var r=n(50994),i=n(58579),o=n(17583),a=n(88087),u=n(56699);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}}},85336:(t,e,n)=>{var r=n(51464),i=n(17583),o=n(58579),a=n(88087);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}},77600:(t,e,n)=>{var r=n(91255),i=n(77183),o=n(10341)("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}},56699:(t,e,n)=>{var r=n(77600);t.exports=function(t,e){return new(r(t))(e)}},78366:(t,e,n)=>{"use strict";var r=n(51464),i=n(91255),o=n(18262),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}},54939:(t,e,n)=>{var r=n(91669),i=n(10341)("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}},91669:t=>{var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},53050:(t,e,n)=>{"use strict";var r=n(83886).f,i=n(49055),o=n(88565),a=n(50994),u=n(36903),s=n(39822),c=n(10966),f=n(38782),l=n(24412),h=n(1216),d=n(94278).fastKey,p=n(44664),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)}}},81990:(t,e,n)=>{"use strict";var r=n(88565),i=n(94278).getWeak,o=n(50486),a=n(91255),u=n(36903),s=n(39822),c=n(97622),f=n(67384),l=n(44664),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}},30859:(t,e,n)=>{"use strict";var r=n(57571),i=n(97044),o=n(46476),a=n(88565),u=n(94278),s=n(39822),c=n(36903),f=n(91255),l=n(75338),h=n(62803),d=n(25837),p=n(70116);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)})),D=!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||D)&&(E("delete"),E("has"),g&&E("get")),(D||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}},52845:t=>{var e=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=e)},51395:(t,e,n)=>{"use strict";var r=n(83886),i=n(48328);t.exports=function(t,e,n){e in t?r.f(t,e,i(0,n)):t[e]=n}},50994:(t,e,n)=>{var r=n(51464);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)}}},44506:(t,e,n)=>{"use strict";var r=n(75338),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},59514:(t,e,n)=>{"use strict";var r=n(50486),i=n(34467),o="number";t.exports=function(t){if("string"!==t&&t!==o&&"default"!==t)throw TypeError("Incorrect hint");return i(r(this),t!=o)}},65091: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(75338)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},3438:(t,e,n)=>{var r=n(91255),i=n(57571).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},39824:t=>{t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},66397:(t,e,n)=>{var r=n(39804),i=n(53844),o=n(14179);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}},97044:(t,e,n)=>{var r=n(57571),i=n(52845),o=n(90913),a=n(46476),u=n(50994),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},32910:(t,e,n)=>{var r=n(10341)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,!"/./"[t](e)}catch(t){}}return!0}},75338:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},6719:(t,e,n)=>{"use strict";n(87139);var r=n(46476),i=n(90913),o=n(75338),a=n(65091),u=n(10341),s=n(69020),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)})}}},33649:(t,e,n)=>{"use strict";var r=n(50486);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(77183),i=n(91255),o=n(88087),a=n(50994),u=n(10341)("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}},39822:(t,e,n)=>{var r=n(50994),i=n(24902),o=n(39981),a=n(50486),u=n(88087),s=n(99685),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},98454:(t,e,n)=>{t.exports=n(45570)("native-function-to-string",Function.toString)},57571: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)},67384:t=>{var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},90913:(t,e,n)=>{var r=n(83886),i=n(48328);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}},87680:(t,e,n)=>{var r=n(57571).document;t.exports=r&&r.documentElement},26252:(t,e,n)=>{t.exports=!n(1216)&&!n(75338)((function(){return 7!=Object.defineProperty(n(3438)("div"),"a",{get:function(){return 7}}).a}))},70116:(t,e,n)=>{var r=n(91255),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}},18262: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)}},58579:(t,e,n)=>{var r=n(91669);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},39981:(t,e,n)=>{var r=n(89740),i=n(10341)("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||o[i]===t)}},77183:(t,e,n)=>{var r=n(91669);t.exports=Array.isArray||function(t){return"Array"==r(t)}},91272:(t,e,n)=>{var r=n(91255),i=Math.floor;t.exports=function(t){return!r(t)&&isFinite(t)&&i(t)===t}},91255:t=>{t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},58990:(t,e,n)=>{var r=n(91255),i=n(91669),o=n(10341)("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[o])?!!e:"RegExp"==i(t))}},24902:(t,e,n)=>{var r=n(50486);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}}},64529:(t,e,n)=>{"use strict";var r=n(49055),i=n(48328),o=n(25837),a={};n(90913)(a,n(10341)("iterator"),(function(){return this})),t.exports=function(t,e,n){t.prototype=r(a,{next:i(1,n)}),o(t,e+" Iterator")}},10966:(t,e,n)=>{"use strict";var r=n(62725),i=n(97044),o=n(46476),a=n(90913),u=n(89740),s=n(64529),c=n(25837),f=n(69881),l=n(10341)("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,D=I[l]||I["@@iterator"]||y&&I[y],C=D||E(y),N=y?A?E("entries"):C:void 0,k="Array"==e&&I.entries||D;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&&D&&D.name!==p&&(T=!0,C=function(){return D.call(this)}),r&&!b||!h&&!T&&I[l]||a(I,l,C),u[e]=C,u[S]=v,y)if(_={values:A?C:E(p),keys:m?C: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 _}},62803:(t,e,n)=>{var r=n(10341)("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}},38782:t=>{t.exports=function(t,e){return{value:e,done:!!t}}},89740:t=>{t.exports={}},62725:t=>{t.exports=!1},10959: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(72987),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}},61618:t=>{t.exports=Math.log1p||function(t){return(t=+t)>-1e-8&&t<1e-8?t-t*t/2:Math.log(1+t)}},72987:t=>{t.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},94278:(t,e,n)=>{var r=n(24316)("meta"),i=n(91255),o=n(67384),a=n(83886).f,u=0,s=Object.isExtensible||function(){return!0},c=!n(75338)((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}}},57485:(t,e,n)=>{var r=n(57571),i=n(17225).set,o=r.MutationObserver||r.WebKitMutationObserver,a=r.process,u=r.Promise,s="process"==n(91669)(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}}},10449:(t,e,n)=>{"use strict";var r=n(51464);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(39804),o=n(53844),a=n(14179),u=n(17583),s=n(58579),c=Object.assign;t.exports=!c||n(75338)((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},49055:(t,e,n)=>{var r=n(50486),i=n(16283),o=n(39824),a=n(93574)("IE_PROTO"),u=function(){},s=function(){var t,e=n(3438)("iframe"),r=o.length;for(e.style.display="none",n(87680).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)}},83886:(t,e,n)=>{var r=n(50486),i=n(26252),o=n(34467),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}},16283:(t,e,n)=>{var r=n(83886),i=n(50486),o=n(39804);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}},55385:(t,e,n)=>{var r=n(14179),i=n(48328),o=n(28182),a=n(34467),u=n(67384),s=n(26252),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])}},43473:(t,e,n)=>{var r=n(28182),i=n(36907).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))}},36907:(t,e,n)=>{var r=n(60946),i=n(39824).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},53844:(t,e)=>{e.f=Object.getOwnPropertySymbols},69881:(t,e,n)=>{var r=n(67384),i=n(17583),o=n(93574)("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}},60946:(t,e,n)=>{var r=n(67384),i=n(28182),o=n(4538)(!1),a=n(93574)("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}},39804:(t,e,n)=>{var r=n(60946),i=n(39824);t.exports=Object.keys||function(t){return r(t,i)}},14179:(t,e)=>{e.f={}.propertyIsEnumerable},10381:(t,e,n)=>{var r=n(97044),i=n(52845),o=n(75338);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)}},46460:(t,e,n)=>{var r=n(1216),i=n(39804),o=n(28182),a=n(14179).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}}},18125:(t,e,n)=>{var r=n(36907),i=n(53844),o=n(50486),a=n(57571).Reflect;t.exports=a&&a.ownKeys||function(t){var e=r.f(o(t)),n=i.f;return n?e.concat(n(t)):e}},51885:(t,e,n)=>{var r=n(57571).parseFloat,i=n(24961).trim;t.exports=1/r(n(71644)+"-0")!=-1/0?function(t){var e=i(String(t),3),n=r(e);return 0===n&&"-"==e.charAt(0)?-0:n}:r},90343:(t,e,n)=>{var r=n(57571).parseInt,i=n(24961).trim,o=n(71644),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},79696:t=>{t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},80909:(t,e,n)=>{var r=n(50486),i=n(91255),o=n(10449);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}},48328:t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},88565:(t,e,n)=>{var r=n(46476);t.exports=function(t,e,n){for(var i in e)r(t,i,e[i],n);return t}},46476:(t,e,n)=>{var r=n(57571),i=n(90913),o=n(67384),a=n(24316)("src"),u=n(98454),s="toString",c=(""+u).split(s);n(52845).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)}))},12968:(t,e,n)=>{"use strict";var r=n(54939),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)}},69020:(t,e,n)=>{"use strict";var r,i,o=n(33649),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},76962: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(91255),i=n(50486),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(50994)(Function.call,n(55385).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}},24412:(t,e,n)=>{"use strict";var r=n(57571),i=n(83886),o=n(1216),a=n(10341)("species");t.exports=function(t){var e=r[t];o&&e&&!e[a]&&i.f(e,a,{configurable:!0,get:function(){return this}})}},25837:(t,e,n)=>{var r=n(83886).f,i=n(67384),o=n(10341)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},93574:(t,e,n)=>{var r=n(45570)("keys"),i=n(24316);t.exports=function(t){return r[t]||(r[t]=i(t))}},45570:(t,e,n)=>{var r=n(52845),i=n(57571),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(62725)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},78713:(t,e,n)=>{var r=n(50486),i=n(51464),o=n(10341)("species");t.exports=function(t,e){var n,a=r(t).constructor;return void 0===a||null==(n=r(a)[o])?e:i(n)}},25296:(t,e,n)=>{"use strict";var r=n(75338);t.exports=function(t,e){return!!t&&r((function(){e?t.call(null,(function(){}),1):t.call(null)}))}},58016:(t,e,n)=>{var r=n(95845),i=n(65091);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}}},25692:(t,e,n)=>{var r=n(58990),i=n(65091);t.exports=function(t,e,n){if(r(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(t))}},75264:(t,e,n)=>{var r=n(97044),i=n(75338),o=n(65091),a=/"/g,u=function(t,e,n,r){var i=String(o(t)),u="<"+e;return""!==n&&(u+=" "+n+'="'+String(r).replace(a,"&quot;")+'"'),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)}},38261:(t,e,n)=>{var r=n(88087),i=n(65458),o=n(65091);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}},65458:(t,e,n)=>{"use strict";var r=n(95845),i=n(65091);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}},24961:(t,e,n)=>{var r=n(97044),i=n(65091),o=n(75338),a=n(71644),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},71644:t=>{t.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},17225:(t,e,n)=>{var r,i,o,a=n(50994),u=n(18262),s=n(87680),c=n(3438),f=n(57571),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(91669)(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}},59260:(t,e,n)=>{var r=n(95845),i=Math.max,o=Math.min;t.exports=function(t,e){return(t=r(t))<0?i(t+e,0):o(t,e)}},15e3:(t,e,n)=>{var r=n(95845),i=n(88087);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}},95845:t=>{var e=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:e)(t)}},28182:(t,e,n)=>{var r=n(58579),i=n(65091);t.exports=function(t){return r(i(t))}},88087:(t,e,n)=>{var r=n(95845),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},17583:(t,e,n)=>{var r=n(65091);t.exports=function(t){return Object(r(t))}},34467:(t,e,n)=>{var r=n(91255);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")}},61063:(t,e,n)=>{"use strict";if(n(1216)){var r=n(62725),i=n(57571),o=n(75338),a=n(97044),u=n(40604),s=n(61541),c=n(50994),f=n(36903),l=n(48328),h=n(90913),d=n(88565),p=n(95845),v=n(88087),g=n(15e3),y=n(59260),m=n(34467),b=n(67384),_=n(54939),x=n(91255),w=n(17583),E=n(39981),S=n(49055),A=n(69881),T=n(36907).f,I=n(99685),D=n(24316),C=n(10341),N=n(97622),k=n(4538),R=n(78713),O=n(40163),P=n(89740),M=n(62803),G=n(24412),L=n(8676),U=n(61064),j=n(83886),F=n(55385),B=j.f,z=F.f,V=i.RangeError,W=i.TypeError,X=i.Uint8Array,H="ArrayBuffer",q="SharedArrayBuffer",Y="BYTES_PER_ELEMENT",K=Array.prototype,Z=s.ArrayBuffer,$=s.DataView,Q=N(0),J=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=C("iterator"),mt=C("toStringTag"),bt=D("typed_constructor"),_t=D("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({})})),Dt=function(t,e){var n=p(t);if(n<0||n%e)throw V("Wrong offset!");return n},Ct=function(t){if(x(t)&&wt in t)return t;throw W(t+" is not a typed array!")},Nt=function(t,e){if(!x(t)||!(bt in t))throw W("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){B(t,e,{get:function(){return this._d[n]}})},Pt=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},Mt=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(Ct(this)):Ct(this),arguments)},Ut={copyWithin:function(t,e){return U.call(Ct(this),t,e,arguments.length>2?arguments[2]:void 0)},every:function(t){return et(Ct(this),t,arguments.length>1?arguments[1]:void 0)},fill:function(t){return L.apply(Ct(this),arguments)},filter:function(t){return kt(this,J(Ct(this),t,arguments.length>1?arguments[1]:void 0))},find:function(t){return nt(Ct(this),t,arguments.length>1?arguments[1]:void 0)},findIndex:function(t){return rt(Ct(this),t,arguments.length>1?arguments[1]:void 0)},forEach:function(t){Q(Ct(this),t,arguments.length>1?arguments[1]:void 0)},indexOf:function(t){return ot(Ct(this),t,arguments.length>1?arguments[1]:void 0)},includes:function(t){return it(Ct(this),t,arguments.length>1?arguments[1]:void 0)},join:function(t){return ht.apply(Ct(this),arguments)},lastIndexOf:function(t){return ct.apply(Ct(this),arguments)},map:function(t){return At(Ct(this),t,arguments.length>1?arguments[1]:void 0)},reduce:function(t){return ft.apply(Ct(this),arguments)},reduceRight:function(t){return lt.apply(Ct(this),arguments)},reverse:function(){for(var t,e=this,n=Ct(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(Ct(this),t,arguments.length>1?arguments[1]:void 0)},sort:function(t){return dt.call(Ct(this),t)},subarray:function(t,e){var n=Ct(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))}},jt=function(t,e){return kt(this,pt.call(Ct(this),t,e))},Ft=function(t){Ct(this);var e=Dt(arguments[1],1),n=this.length,r=w(t),i=v(r.length),o=0;if(i+e>n)throw V(St);for(;o<i;)this[e+o]=r[o++]},Bt={entries:function(){return st.call(Ct(this))},keys:function(){return ut.call(Ct(this))},values:function(){return at.call(Ct(this))}},zt=function(t,e){return x(t)&&t[wt]&&"symbol"!=typeof e&&e in t&&String(+e)==String(e)},Vt=function(t,e){return zt(t,e=m(e,!0))?l(2,t[e]):z(t,e)},Wt=function(t,e,n){return!(zt(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?B(t,e,n):(t[e]=n.value,t)};xt||(F.f=Vt,j.f=Wt),a(a.S+a.F*!xt,"Object",{getOwnPropertyDescriptor:Vt,defineProperty:Wt}),o((function(){vt.call({})}))&&(vt=gt=function(){return ht.call(this)});var Xt=d({},Ut);d(Xt,Bt),h(Xt,yt,Bt.values),d(Xt,{slice:jt,set:Ft,constructor:function(){},toString:vt,toLocaleString:Lt}),Ot(Xt,"buffer","b"),Ot(Xt,"byteOffset","o"),Ot(Xt,"byteLength","l"),Ot(Xt,"length","e"),B(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){B(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):Pt.call(p,n);o=n,d=Dt(r,e);var y=n.byteLength;if(void 0===i){if(y%e)throw V(St);if((a=y-d)<0)throw V(St)}else if((a=v(i)*e)+d>y)throw V(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)}))&&M((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,Dt(r,e),i):void 0!==r?new y(n,Dt(r,e)):new y(n):wt in n?Rt(p,n):Pt.call(p,n):new y(g(n))})),Q(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 D=E[yt],C=!!D&&("values"==D.name||null==D.name),N=Bt.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)||B(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:Pt,of:Mt}),Y in E||h(E,Y,e),a(a.P,c,Ut),G(c),a(a.P+a.F*It,c,{set:Ft}),a(a.P+a.F*!C,c,Bt),r||E.toString==vt||(E.toString=vt),a(a.P+a.F*o((function(){new p(1).slice()})),c,{slice:jt}),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}),P[c]=C?D:N,r||C||h(E,yt,N)}}else t.exports=function(){}},61541:(t,e,n)=>{"use strict";var r=n(57571),i=n(1216),o=n(62725),a=n(40604),u=n(90913),s=n(88565),c=n(75338),f=n(36903),l=n(95845),h=n(88087),d=n(15e3),p=n(36907).f,v=n(83886).f,g=n(8676),y=n(25837),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,D=E.pow,C=E.floor,N=E.log,k=E.LN2,R="buffer",O="byteLength",P="byteOffset",M=i?"_b":R,G=i?"_l":O,L=i?"_o":P;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?D(2,-24)-D(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=C(N(t)/k),t*(o=D(2,-r))<1&&(r--,o*=2),(t+=r+c>=1?f/o:f*D(2,1-c))*o>=2&&(r++,o/=2),r+c>=s?(i=0,r=s):r+c>=1?(i=(t*o-1)*D(2,e),r+=c):(i=t*D(2,c-1)*D(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 j(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+=D(2,e),f-=a}return(c?-1:1)*r*D(2,f-e)}function F(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]}function B(t){return[255&t]}function z(t){return[255&t,t>>8&255]}function V(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function W(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[M]._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[M]._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),Q=0;$.length>Q;)(K=$[Q++])in x||u(x,K,T[K]);o||(Z.constructor=x)}var J=new w(new x(2)),tt=w.prototype.setInt8;J.setInt8(0,2147483648),J.setInt8(1,2147483649),!J.getInt8(0)&&J.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[M]=t,this[L]=i,this[G]=n},i&&(H(x,O,"_l"),H(w,R,"_b"),H(w,O,"_l"),H(w,P,"_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 F(q(this,4,t,arguments[1]))},getUint32:function(t){return F(q(this,4,t,arguments[1]))>>>0},getFloat32:function(t){return j(q(this,4,t,arguments[1]),23,4)},getFloat64:function(t){return j(q(this,8,t,arguments[1]),52,8)},setInt8:function(t,e){Y(this,1,t,B,e)},setUint8:function(t,e){Y(this,1,t,B,e)},setInt16:function(t,e){Y(this,2,t,z,e,arguments[2])},setUint16:function(t,e){Y(this,2,t,z,e,arguments[2])},setInt32:function(t,e){Y(this,4,t,V,e,arguments[2])},setUint32:function(t,e){Y(this,4,t,V,e,arguments[2])},setFloat32:function(t,e){Y(this,4,t,X,e,arguments[2])},setFloat64:function(t,e){Y(this,8,t,W,e,arguments[2])}});y(x,m),y(w,b),u(w.prototype,a.VIEW,!0),e.ArrayBuffer=x,e.DataView=w},40604:(t,e,n)=>{for(var r,i=n(57571),o=n(90913),a=n(24316),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}},24316:t=>{var e=0,n=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++e+n).toString(36))}},82541:(t,e,n)=>{var r=n(57571).navigator;t.exports=r&&r.userAgent||""},44664:(t,e,n)=>{var r=n(91255);t.exports=function(t,e){if(!r(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t}},66262:(t,e,n)=>{var r=n(57571),i=n(52845),o=n(62725),a=n(57686),u=n(83886).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)})}},57686:(t,e,n)=>{e.f=n(10341)},10341:(t,e,n)=>{var r=n(45570)("wks"),i=n(24316),o=n(57571).Symbol,a="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=a&&o[t]||(a?o:i)("Symbol."+t))}).store=r},99685:(t,e,n)=>{var r=n(54939),i=n(10341)("iterator"),o=n(89740);t.exports=n(52845).getIteratorMethod=function(t){if(null!=t)return t[i]||t["@@iterator"]||o[r(t)]}},15305:(t,e,n)=>{var r=n(97044);r(r.P,"Array",{copyWithin:n(61064)}),n(24691)("copyWithin")},95015:(t,e,n)=>{"use strict";var r=n(97044),i=n(97622)(4);r(r.P+r.F*!n(25296)([].every,!0),"Array",{every:function(t){return i(this,t,arguments[1])}})},36341:(t,e,n)=>{var r=n(97044);r(r.P,"Array",{fill:n(8676)}),n(24691)("fill")},85119:(t,e,n)=>{"use strict";var r=n(97044),i=n(97622)(2);r(r.P+r.F*!n(25296)([].filter,!0),"Array",{filter:function(t){return i(this,t,arguments[1])}})},44488:(t,e,n)=>{"use strict";var r=n(97044),i=n(97622)(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(24691)(o)},95915:(t,e,n)=>{"use strict";var r=n(97044),i=n(97622)(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(24691)(o)},85788:(t,e,n)=>{"use strict";var r=n(97044),i=n(97622)(0),o=n(25296)([].forEach,!0);r(r.P+r.F*!o,"Array",{forEach:function(t){return i(this,t,arguments[1])}})},39689:(t,e,n)=>{"use strict";var r=n(50994),i=n(97044),o=n(17583),a=n(24902),u=n(39981),s=n(88087),c=n(51395),f=n(99685);i(i.S+i.F*!n(62803)((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}})},25377:(t,e,n)=>{"use strict";var r=n(97044),i=n(4538)(!1),o=[].indexOf,a=!!o&&1/[1].indexOf(1,-0)<0;r(r.P+r.F*(a||!n(25296)(o)),"Array",{indexOf:function(t){return a?o.apply(this,arguments)||0:i(this,t,arguments[1])}})},2247:(t,e,n)=>{var r=n(97044);r(r.S,"Array",{isArray:n(77183)})},40163:(t,e,n)=>{"use strict";var r=n(24691),i=n(38782),o=n(89740),a=n(28182);t.exports=n(10966)(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")},29026:(t,e,n)=>{"use strict";var r=n(97044),i=n(28182),o=[].join;r(r.P+r.F*(n(58579)!=Object||!n(25296)(o)),"Array",{join:function(t){return o.call(i(this),void 0===t?",":t)}})},59879:(t,e,n)=>{"use strict";var r=n(97044),i=n(28182),o=n(95845),a=n(88087),u=[].lastIndexOf,s=!!u&&1/[1].lastIndexOf(1,-0)<0;r(r.P+r.F*(s||!n(25296)(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}})},67878:(t,e,n)=>{"use strict";var r=n(97044),i=n(97622)(1);r(r.P+r.F*!n(25296)([].map,!0),"Array",{map:function(t){return i(this,t,arguments[1])}})},29003:(t,e,n)=>{"use strict";var r=n(97044),i=n(51395);r(r.S+r.F*n(75338)((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}})},10646:(t,e,n)=>{"use strict";var r=n(97044),i=n(85336);r(r.P+r.F*!n(25296)([].reduceRight,!0),"Array",{reduceRight:function(t){return i(this,t,arguments.length,arguments[1],!0)}})},78059:(t,e,n)=>{"use strict";var r=n(97044),i=n(85336);r(r.P+r.F*!n(25296)([].reduce,!0),"Array",{reduce:function(t){return i(this,t,arguments.length,arguments[1],!1)}})},54088:(t,e,n)=>{"use strict";var r=n(97044),i=n(87680),o=n(91669),a=n(59260),u=n(88087),s=[].slice;r(r.P+r.F*n(75338)((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}})},83135:(t,e,n)=>{"use strict";var r=n(97044),i=n(97622)(3);r(r.P+r.F*!n(25296)([].some,!0),"Array",{some:function(t){return i(this,t,arguments[1])}})},30535:(t,e,n)=>{"use strict";var r=n(97044),i=n(51464),o=n(17583),a=n(75338),u=[].sort,s=[1,2,3];r(r.P+r.F*(a((function(){s.sort(void 0)}))||!a((function(){s.sort(null)}))||!n(25296)(u)),"Array",{sort:function(t){return void 0===t?u.call(o(this)):u.call(o(this),i(t))}})},9281:(t,e,n)=>{n(24412)("Array")},44094:(t,e,n)=>{var r=n(97044);r(r.S,"Date",{now:function(){return(new Date).getTime()}})},85013:(t,e,n)=>{var r=n(97044),i=n(44506);r(r.P+r.F*(Date.prototype.toISOString!==i),"Date",{toISOString:i})},78781:(t,e,n)=>{"use strict";var r=n(97044),i=n(17583),o=n(34467);r(r.P+r.F*n(75338)((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}})},88723:(t,e,n)=>{var r=n(10341)("toPrimitive"),i=Date.prototype;r in i||n(90913)(i,r,n(59514))},3735:(t,e,n)=>{var r=Date.prototype,i="Invalid Date",o=r.toString,a=r.getTime;new Date(NaN)+""!=i&&n(46476)(r,"toString",(function(){var t=a.call(this);return t==t?o.call(this):i}))},71765:(t,e,n)=>{var r=n(97044);r(r.P,"Function",{bind:n(78366)})},67451:(t,e,n)=>{"use strict";var r=n(91255),i=n(69881),o=n(10341)("hasInstance"),a=Function.prototype;o in a||n(83886).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}})},15747:(t,e,n)=>{var r=n(83886).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""}}})},96441:(t,e,n)=>{"use strict";var r=n(53050),i=n(44664),o="Map";t.exports=n(30859)(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)},32212:(t,e,n)=>{var r=n(97044),i=n(61618),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))}})},54230:(t,e,n)=>{var r=n(97044),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}})},69754:(t,e,n)=>{var r=n(97044),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}})},12811:(t,e,n)=>{var r=n(97044),i=n(72987);r(r.S,"Math",{cbrt:function(t){return i(t=+t)*Math.pow(Math.abs(t),1/3)}})},73998:(t,e,n)=>{var r=n(97044);r(r.S,"Math",{clz32:function(t){return(t>>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},41769:(t,e,n)=>{var r=n(97044),i=Math.exp;r(r.S,"Math",{cosh:function(t){return(i(t=+t)+i(-t))/2}})},68789:(t,e,n)=>{var r=n(97044),i=n(10959);r(r.S+r.F*(i!=Math.expm1),"Math",{expm1:i})},12848:(t,e,n)=>{var r=n(97044);r(r.S,"Math",{fround:n(7682)})},1762:(t,e,n)=>{var r=n(97044),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)}})},41323:(t,e,n)=>{var r=n(97044),i=Math.imul;r(r.S+r.F*n(75338)((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)}})},96063:(t,e,n)=>{var r=n(97044);r(r.S,"Math",{log10:function(t){return Math.log(t)*Math.LOG10E}})},33282:(t,e,n)=>{var r=n(97044);r(r.S,"Math",{log1p:n(61618)})},76816:(t,e,n)=>{var r=n(97044);r(r.S,"Math",{log2:function(t){return Math.log(t)/Math.LN2}})},51854:(t,e,n)=>{var r=n(97044);r(r.S,"Math",{sign:n(72987)})},63303:(t,e,n)=>{var r=n(97044),i=n(10959),o=Math.exp;r(r.S+r.F*n(75338)((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)}})},14421:(t,e,n)=>{var r=n(97044),i=n(10959),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))}})},12203:(t,e,n)=>{var r=n(97044);r(r.S,"Math",{trunc:function(t){return(t>0?Math.floor:Math.ceil)(t)}})},67454:(t,e,n)=>{"use strict";var r=n(57571),i=n(67384),o=n(91669),a=n(70116),u=n(34467),s=n(75338),c=n(36907).f,f=n(55385).f,l=n(83886).f,h=n(24961).trim,d="Number",p=r.Number,v=p,g=p.prototype,y=o(n(49055)(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(46476)(r,d,p)}},17551:(t,e,n)=>{var r=n(97044);r(r.S,"Number",{EPSILON:Math.pow(2,-52)})},62929:(t,e,n)=>{var r=n(97044),i=n(57571).isFinite;r(r.S,"Number",{isFinite:function(t){return"number"==typeof t&&i(t)}})},20215:(t,e,n)=>{var r=n(97044);r(r.S,"Number",{isInteger:n(91272)})},96183:(t,e,n)=>{var r=n(97044);r(r.S,"Number",{isNaN:function(t){return t!=t}})},48190:(t,e,n)=>{var r=n(97044),i=n(91272),o=Math.abs;r(r.S,"Number",{isSafeInteger:function(t){return i(t)&&o(t)<=9007199254740991}})},30473:(t,e,n)=>{var r=n(97044);r(r.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},60948:(t,e,n)=>{var r=n(97044);r(r.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},50942:(t,e,n)=>{var r=n(97044),i=n(51885);r(r.S+r.F*(Number.parseFloat!=i),"Number",{parseFloat:i})},82870:(t,e,n)=>{var r=n(97044),i=n(90343);r(r.S+r.F*(Number.parseInt!=i),"Number",{parseInt:i})},23053:(t,e,n)=>{"use strict";var r=n(97044),i=n(95845),o=n(88347),a=n(65458),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(75338)((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}})},88032:(t,e,n)=>{"use strict";var r=n(97044),i=n(75338),o=n(88347),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)}})},25261:(t,e,n)=>{var r=n(97044);r(r.S+r.F,"Object",{assign:n(4643)})},76051:(t,e,n)=>{var r=n(97044);r(r.S,"Object",{create:n(49055)})},29518:(t,e,n)=>{var r=n(97044);r(r.S+r.F*!n(1216),"Object",{defineProperties:n(16283)})},72640:(t,e,n)=>{var r=n(97044);r(r.S+r.F*!n(1216),"Object",{defineProperty:n(83886).f})},39788:(t,e,n)=>{var r=n(91255),i=n(94278).onFreeze;n(10381)("freeze",(function(t){return function(e){return t&&r(e)?t(i(e)):e}}))},8201:(t,e,n)=>{var r=n(28182),i=n(55385).f;n(10381)("getOwnPropertyDescriptor",(function(){return function(t,e){return i(r(t),e)}}))},7525:(t,e,n)=>{n(10381)("getOwnPropertyNames",(function(){return n(43473).f}))},40470:(t,e,n)=>{var r=n(17583),i=n(69881);n(10381)("getPrototypeOf",(function(){return function(t){return i(r(t))}}))},57940:(t,e,n)=>{var r=n(91255);n(10381)("isExtensible",(function(t){return function(e){return!!r(e)&&(!t||t(e))}}))},16129:(t,e,n)=>{var r=n(91255);n(10381)("isFrozen",(function(t){return function(e){return!r(e)||!!t&&t(e)}}))},52802:(t,e,n)=>{var r=n(91255);n(10381)("isSealed",(function(t){return function(e){return!r(e)||!!t&&t(e)}}))},59340:(t,e,n)=>{var r=n(97044);r(r.S,"Object",{is:n(76962)})},15723:(t,e,n)=>{var r=n(17583),i=n(39804);n(10381)("keys",(function(){return function(t){return i(r(t))}}))},7577:(t,e,n)=>{var r=n(91255),i=n(94278).onFreeze;n(10381)("preventExtensions",(function(t){return function(e){return t&&r(e)?t(i(e)):e}}))},61498:(t,e,n)=>{var r=n(91255),i=n(94278).onFreeze;n(10381)("seal",(function(t){return function(e){return t&&r(e)?t(i(e)):e}}))},1584:(t,e,n)=>{var r=n(97044);r(r.S,"Object",{setPrototypeOf:n(473).set})},47298:(t,e,n)=>{"use strict";var r=n(54939),i={};i[n(10341)("toStringTag")]="z",i+""!="[object z]"&&n(46476)(Object.prototype,"toString",(function(){return"[object "+r(this)+"]"}),!0)},62809:(t,e,n)=>{var r=n(97044),i=n(51885);r(r.G+r.F*(parseFloat!=i),{parseFloat:i})},82784:(t,e,n)=>{var r=n(97044),i=n(90343);r(r.G+r.F*(parseInt!=i),{parseInt:i})},47843:(t,e,n)=>{"use strict";var r,i,o,a,u=n(62725),s=n(57571),c=n(50994),f=n(54939),l=n(97044),h=n(91255),d=n(51464),p=n(36903),v=n(39822),g=n(78713),y=n(17225).set,m=n(57485)(),b=n(10449),_=n(79696),x=n(82541),w=n(80909),E="Promise",S=s.TypeError,A=s.process,T=A&&A.versions,I=T&&T.v8||"",D=s.Promise,C="process"==f(A),N=function(){},k=i=b.f,R=!!function(){try{var t=D.resolve(1),e=(t.constructor={})[n(10341)("species")]=function(t){t(N,N)};return(C||"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},P=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&&M(t)}))}},M=function(t){y.call(s,(function(){var e,n,r,i=t._v,o=G(t);if(o&&(e=_((function(){C?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=C||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;C?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()),P(e,!0))},j=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(j,r,1),c(U,r,1))}catch(t){U.call(r,t)}})):(n._v=t,n._s=1,P(n,!1))}catch(t){U.call({_w:n,_d:!1},t)}}};R||(D=function(t){p(this,D,E,"_h"),d(t),r.call(this);try{t(c(j,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(88565)(D.prototype,{then:function(t,e){var n=k(g(this,D));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=C?A.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&P(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(j,t,1),this.reject=c(U,t,1)},b.f=k=function(t){return t===D||t===a?new o(t):i(t)}),l(l.G+l.W+l.F*!R,{Promise:D}),n(25837)(D,E),n(24412)(E),a=n(52845).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?D:this,t)}}),l(l.S+l.F*!(R&&n(62803)((function(t){D.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}})},28275:(t,e,n)=>{var r=n(97044),i=n(51464),o=n(50486),a=(n(57571).Reflect||{}).apply,u=Function.apply;r(r.S+r.F*!n(75338)((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)}})},92552:(t,e,n)=>{var r=n(97044),i=n(49055),o=n(51464),a=n(50486),u=n(91255),s=n(75338),c=n(78366),f=(n(57571).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}})},83077:(t,e,n)=>{var r=n(83886),i=n(97044),o=n(50486),a=n(34467);i(i.S+i.F*n(75338)((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}}})},31838:(t,e,n)=>{var r=n(97044),i=n(55385).f,o=n(50486);r(r.S,"Reflect",{deleteProperty:function(t,e){var n=i(o(t),e);return!(n&&!n.configurable)&&delete t[e]}})},18916:(t,e,n)=>{"use strict";var r=n(97044),i=n(50486),o=function(t){this._t=i(t),this._i=0;var e,n=this._k=[];for(e in t)n.push(e)};n(64529)(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)}})},98531:(t,e,n)=>{var r=n(55385),i=n(97044),o=n(50486);i(i.S,"Reflect",{getOwnPropertyDescriptor:function(t,e){return r.f(o(t),e)}})},57323:(t,e,n)=>{var r=n(97044),i=n(69881),o=n(50486);r(r.S,"Reflect",{getPrototypeOf:function(t){return i(o(t))}})},18978:(t,e,n)=>{var r=n(55385),i=n(69881),o=n(67384),a=n(97044),u=n(91255),s=n(50486);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(97044);r(r.S,"Reflect",{has:function(t,e){return e in t}})},45305:(t,e,n)=>{var r=n(97044),i=n(50486),o=Object.isExtensible;r(r.S,"Reflect",{isExtensible:function(t){return i(t),!o||o(t)}})},28812:(t,e,n)=>{var r=n(97044);r(r.S,"Reflect",{ownKeys:n(18125)})},82636:(t,e,n)=>{var r=n(97044),i=n(50486),o=Object.preventExtensions;r(r.S,"Reflect",{preventExtensions:function(t){i(t);try{return o&&o(t),!0}catch(t){return!1}}})},83871:(t,e,n)=>{var r=n(97044),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}}})},51602:(t,e,n)=>{var r=n(83886),i=n(55385),o=n(69881),a=n(67384),u=n(97044),s=n(48328),c=n(50486),f=n(91255);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)}})},86668:(t,e,n)=>{var r=n(57571),i=n(70116),o=n(83886).f,a=n(36907).f,u=n(58990),s=n(33649),c=r.RegExp,f=c,l=c.prototype,h=/a/g,d=/a/g,p=new c(h)!==h;if(n(1216)&&(!p||n(75338)((function(){return d[n(10341)("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(46476)(r,"RegExp",c)}n(24412)("RegExp")},87139:(t,e,n)=>{"use strict";var r=n(69020);n(97044)({target:"RegExp",proto:!0,forced:r!==/./.exec},{exec:r})},28686:(t,e,n)=>{n(1216)&&"g"!=/./g.flags&&n(83886).f(RegExp.prototype,"flags",{configurable:!0,get:n(33649)})},65480:(t,e,n)=>{"use strict";var r=n(50486),i=n(88087),o=n(40178),a=n(12968);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}]}))},19121:(t,e,n)=>{"use strict";var r=n(50486),i=n(17583),o=n(88087),a=n(95845),u=n(40178),s=n(12968),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 D=b.groups;if(d){var C=[S].concat(T,A,h);void 0!==D&&C.push(D);var N=String(e.apply(void 0,C))}else N=v(S,h,A,T,D,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}))}}))},90914:(t,e,n)=>{"use strict";var r=n(50486),i=n(76962),o=n(12968);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}]}))},37742:(t,e,n)=>{"use strict";var r=n(58990),i=n(50486),o=n(78713),a=n(40178),u=n(88087),s=n(12968),c=n(69020),f=n(75338),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}]}))},96408:(t,e,n)=>{"use strict";n(28686);var r=n(50486),i=n(33649),o=n(1216),a="toString",u=/./.toString,s=function(t){n(46476)(RegExp.prototype,a,t,!0)};n(75338)((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)}))},10429:(t,e,n)=>{"use strict";var r=n(53050),i=n(44664);t.exports=n(30859)("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)},93157:(t,e,n)=>{"use strict";n(75264)("anchor",(function(t){return function(e){return t(this,"a","name",e)}}))},79791:(t,e,n)=>{"use strict";n(75264)("big",(function(t){return function(){return t(this,"big","","")}}))},92296:(t,e,n)=>{"use strict";n(75264)("blink",(function(t){return function(){return t(this,"blink","","")}}))},14555:(t,e,n)=>{"use strict";n(75264)("bold",(function(t){return function(){return t(this,"b","","")}}))},88316:(t,e,n)=>{"use strict";var r=n(97044),i=n(58016)(!1);r(r.P,"String",{codePointAt:function(t){return i(this,t)}})},7937:(t,e,n)=>{"use strict";var r=n(97044),i=n(88087),o=n(25692),a="endsWith",u="".endsWith;r(r.P+r.F*n(32910)(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}})},66505:(t,e,n)=>{"use strict";n(75264)("fixed",(function(t){return function(){return t(this,"tt","","")}}))},4722:(t,e,n)=>{"use strict";n(75264)("fontcolor",(function(t){return function(e){return t(this,"font","color",e)}}))},59713:(t,e,n)=>{"use strict";n(75264)("fontsize",(function(t){return function(e){return t(this,"font","size",e)}}))},1028:(t,e,n)=>{var r=n(97044),i=n(59260),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("")}})},80637:(t,e,n)=>{"use strict";var r=n(97044),i=n(25692),o="includes";r(r.P+r.F*n(32910)(o),"String",{includes:function(t){return!!~i(this,t,o).indexOf(t,arguments.length>1?arguments[1]:void 0)}})},47392:(t,e,n)=>{"use strict";n(75264)("italics",(function(t){return function(){return t(this,"i","","")}}))},27938:(t,e,n)=>{"use strict";var r=n(58016)(!0);n(10966)(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})}))},64687:(t,e,n)=>{"use strict";n(75264)("link",(function(t){return function(e){return t(this,"a","href",e)}}))},96818:(t,e,n)=>{var r=n(97044),i=n(28182),o=n(88087);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(97044);r(r.P,"String",{repeat:n(65458)})},43684:(t,e,n)=>{"use strict";n(75264)("small",(function(t){return function(){return t(this,"small","","")}}))},99029:(t,e,n)=>{"use strict";var r=n(97044),i=n(88087),o=n(25692),a="startsWith",u="".startsWith;r(r.P+r.F*n(32910)(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}})},33339:(t,e,n)=>{"use strict";n(75264)("strike",(function(t){return function(){return t(this,"strike","","")}}))},44148:(t,e,n)=>{"use strict";n(75264)("sub",(function(t){return function(){return t(this,"sub","","")}}))},77754:(t,e,n)=>{"use strict";n(75264)("sup",(function(t){return function(){return t(this,"sup","","")}}))},85557:(t,e,n)=>{"use strict";n(24961)("trim",(function(t){return function(){return t(this,3)}}))},82825:(t,e,n)=>{"use strict";var r=n(57571),i=n(67384),o=n(1216),a=n(97044),u=n(46476),s=n(94278).KEY,c=n(75338),f=n(45570),l=n(25837),h=n(24316),d=n(10341),p=n(57686),v=n(66262),g=n(66397),y=n(77183),m=n(50486),b=n(91255),_=n(17583),x=n(28182),w=n(34467),E=n(48328),S=n(49055),A=n(43473),T=n(55385),I=n(53844),D=n(83886),C=n(39804),N=T.f,k=D.f,R=A.f,O=r.Symbol,P=r.JSON,M=P&&P.stringify,G=d("_hidden"),L=d("toPrimitive"),U={}.propertyIsEnumerable,j=f("symbol-registry"),F=f("symbols"),B=f("op-symbols"),z=Object.prototype,V="function"==typeof O&&!!I.f,W=r.QObject,X=!W||!W.prototype||!W.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(z,e);r&&delete z[e],k(t,e,n),r&&t!==z&&k(z,e,r)}:k,q=function(t){var e=F[t]=S(O.prototype);return e._k=t,e},Y=V&&"symbol"==typeof O.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof O},K=function(t,e,n){return t===z&&K(B,e,n),m(t),e=w(e,!0),m(n),i(F,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===z&&i(F,t)&&!i(B,t))&&(!(e||!i(this,t)||!i(F,t)||i(this,G)&&this[G][t])||e)},Q=function(t,e){if(t=x(t),e=w(e,!0),t!==z||!i(F,e)||i(B,e)){var n=N(t,e);return!n||!i(F,e)||i(t,G)&&t[G][e]||(n.enumerable=!0),n}},J=function(t){for(var e,n=R(x(t)),r=[],o=0;n.length>o;)i(F,e=n[o++])||e==G||e==s||r.push(e);return r},tt=function(t){for(var e,n=t===z,r=R(n?B:x(t)),o=[],a=0;r.length>a;)!i(F,e=r[a++])||n&&!i(z,e)||o.push(F[e]);return o};V||(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===z&&e.call(B,n),i(this,G)&&i(this[G],t)&&(this[G][t]=!1),H(this,t,E(1,n))};return o&&X&&H(z,t,{configurable:!0,set:e}),q(t)},u(O.prototype,"toString",(function(){return this._k})),T.f=Q,D.f=K,n(36907).f=A.f=J,n(14179).f=$,I.f=tt,o&&!n(62725)&&u(z,"propertyIsEnumerable",$,!0),p.f=function(t){return q(d(t))}),a(a.G+a.W+a.F*!V,{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=C(d.store),it=0;rt.length>it;)v(rt[it++]);a(a.S+a.F*!V,"Symbol",{for:function(t){return i(j,t+="")?j[t]:j[t]=O(t)},keyFor:function(t){if(!Y(t))throw TypeError(t+" is not a symbol!");for(var e in j)if(j[e]===t)return e},useSetter:function(){X=!0},useSimple:function(){X=!1}}),a(a.S+a.F*!V,"Object",{create:function(t,e){return void 0===e?S(t):Z(S(t),e)},defineProperty:K,defineProperties:Z,getOwnPropertyDescriptor:Q,getOwnPropertyNames:J,getOwnPropertySymbols:tt});var ot=c((function(){I.f(1)}));a(a.S+a.F*ot,"Object",{getOwnPropertySymbols:function(t){return I.f(_(t))}}),P&&a(a.S+a.F*(!V||c((function(){var t=O();return"[null]"!=M([t])||"{}"!=M({a:t})||"{}"!=M(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,M.apply(P,r)}}),O.prototype[L]||n(90913)(O.prototype,L,O.prototype.valueOf),l(O,"Symbol"),l(Math,"Math",!0),l(r.JSON,"JSON",!0)},96349:(t,e,n)=>{"use strict";var r=n(97044),i=n(40604),o=n(61541),a=n(50486),u=n(59260),s=n(88087),c=n(91255),f=n(57571).ArrayBuffer,l=n(78713),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(75338)((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(24412)(y)},83742:(t,e,n)=>{var r=n(97044);r(r.G+r.W+r.F*!n(40604).ABV,{DataView:n(61541).DataView})},73421:(t,e,n)=>{n(61063)("Float32",4,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},56144:(t,e,n)=>{n(61063)("Float64",8,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},69363:(t,e,n)=>{n(61063)("Int16",2,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},78632:(t,e,n)=>{n(61063)("Int32",4,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},59604:(t,e,n)=>{n(61063)("Int8",1,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},16907:(t,e,n)=>{n(61063)("Uint16",2,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},1838:(t,e,n)=>{n(61063)("Uint32",4,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},72592:(t,e,n)=>{n(61063)("Uint8",1,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},79290:(t,e,n)=>{n(61063)("Uint8",1,(function(t){return function(e,n,r){return t(this,e,n,r)}}),!0)},52214:(t,e,n)=>{"use strict";var r,i=n(57571),o=n(97622)(0),a=n(46476),u=n(94278),s=n(4643),c=n(81990),f=n(91255),l=n(44664),h=n(44664),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(30859)(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(81990),i=n(44664),o="WeakSet";n(30859)(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)},67744:(t,e,n)=>{"use strict";var r=n(97044),i=n(6806),o=n(17583),a=n(88087),u=n(51464),s=n(56699);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(24691)("flatMap")},75448:(t,e,n)=>{"use strict";var r=n(97044),i=n(4538)(!0);r(r.P,"Array",{includes:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),n(24691)("includes")},8938:(t,e,n)=>{var r=n(97044),i=n(46460)(!0);r(r.S,"Object",{entries:function(t){return i(t)}})},67819:(t,e,n)=>{var r=n(97044),i=n(18125),o=n(28182),a=n(55385),u=n(51395);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}})},26572:(t,e,n)=>{var r=n(97044),i=n(46460)(!1);r(r.S,"Object",{values:function(t){return i(t)}})},78228:(t,e,n)=>{"use strict";var r=n(97044),i=n(52845),o=n(57571),a=n(78713),u=n(80909);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)}})},13336:(t,e,n)=>{"use strict";var r=n(97044),i=n(38261),o=n(82541),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(97044),i=n(38261),o=n(82541),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)}})},47831:(t,e,n)=>{"use strict";n(24961)("trimLeft",(function(t){return function(){return t(this,1)}}),"trimStart")},46642:(t,e,n)=>{"use strict";n(24961)("trimRight",(function(t){return function(){return t(this,2)}}),"trimEnd")},79956:(t,e,n)=>{n(66262)("asyncIterator")},44367:(t,e,n)=>{for(var r=n(40163),i=n(39804),o=n(46476),a=n(57571),u=n(90913),s=n(89740),c=n(10341),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)}},21602:(t,e,n)=>{var r=n(97044),i=n(17225);r(r.G+r.B,{setImmediate:i.set,clearImmediate:i.clear})},70110:(t,e,n)=>{var r=n(57571),i=n(97044),o=n(82541),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)})},34962:(t,e,n)=>{n(70110),n(21602),n(44367),t.exports=n(52845)},79012:(t,e,n)=>{t.exports={graphlib:n(94248),layout:n(85895),debug:n(8046),util:{time:n(91127).time,notime:n(91127).notime},version:n(62213)}},88496:(t,e,n)=>{"use strict";var r=n(66020),i=n(18946);t.exports={run:function(t){var e="greedy"===t.graph().acyclicer?i(t,function(t){return function(e){return t.edge(e).weight}}(t)):function(t){var e=[],n={},i={};return r.forEach(t.nodes(),(function o(a){r.has(i,a)||(i[a]=!0,n[a]=!0,r.forEach(t.outEdges(a),(function(t){r.has(n,t.w)?e.push(t):o(t.w)})),delete n[a])})),e}(t);r.forEach(e,(function(e){var n=t.edge(e);t.removeEdge(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,r.uniqueId("rev"))}))},undo:function(t){r.forEach(t.edges(),(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)}}))}}},93188:(t,e,n)=>{var r=n(66020),i=n(91127);function o(t,e,n,r,o,a){var u={width:0,height:0,rank:a,borderType:e},s=o[e][a-1],c=i.addDummyNode(t,"border",u,n);o[e][a]=c,t.setParent(c,r),s&&t.setEdge(s,c,{weight:1})}t.exports=function(t){r.forEach(t.children(),(function e(n){var i=t.children(n),a=t.node(n);if(i.length&&r.forEach(i,e),r.has(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var u=a.minRank,s=a.maxRank+1;u<s;++u)o(t,"borderLeft","_bl",n,a,u),o(t,"borderRight","_br",n,a,u)}}))}},26184:(t,e,n)=>{"use strict";var r=n(66020);function i(t){r.forEach(t.nodes(),(function(e){o(t.node(e))})),r.forEach(t.edges(),(function(e){o(t.edge(e))}))}function o(t){var e=t.width;t.width=t.height,t.height=e}function a(t){t.y=-t.y}function u(t){var e=t.x;t.x=t.y,t.y=e}t.exports={adjust:function(t){var e=t.graph().rankdir.toLowerCase();"lr"!==e&&"rl"!==e||i(t)},undo:function(t){var e=t.graph().rankdir.toLowerCase();"bt"!==e&&"rl"!==e||function(t){r.forEach(t.nodes(),(function(e){a(t.node(e))})),r.forEach(t.edges(),(function(e){var n=t.edge(e);r.forEach(n.points,a),r.has(n,"y")&&a(n)}))}(t),"lr"!==e&&"rl"!==e||(function(t){r.forEach(t.nodes(),(function(e){u(t.node(e))})),r.forEach(t.edges(),(function(e){var n=t.edge(e);r.forEach(n.points,u),r.has(n,"x")&&u(n)}))}(t),i(t))}}},78912:t=>{function e(){var t={};t._next=t._prev=t,this._sentinel=t}function n(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function r(t,e){if("_next"!==t&&"_prev"!==t)return e}t.exports=e,e.prototype.dequeue=function(){var t=this._sentinel,e=t._prev;if(e!==t)return n(e),e},e.prototype.enqueue=function(t){var e=this._sentinel;t._prev&&t._next&&n(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e},e.prototype.toString=function(){for(var t=[],e=this._sentinel,n=e._prev;n!==e;)t.push(JSON.stringify(n,r)),n=n._prev;return"["+t.join(", ")+"]"}},8046:(t,e,n)=>{var r=n(66020),i=n(91127),o=n(94248).Graph;t.exports={debugOrdering:function(t){var e=i.buildLayerMatrix(t),n=new o({compound:!0,multigraph:!0}).setGraph({});return r.forEach(t.nodes(),(function(e){n.setNode(e,{label:e}),n.setParent(e,"layer"+t.node(e).rank)})),r.forEach(t.edges(),(function(t){n.setEdge(t.v,t.w,{},t.name)})),r.forEach(e,(function(t,e){var i="layer"+e;n.setNode(i,{rank:"same"}),r.reduce(t,(function(t,e){return n.setEdge(t,e,{style:"invis"}),e}))})),n}}},94248:(t,e,n)=>{var r;try{r=n(75172)}catch(t){}r||(r=window.graphlib),t.exports=r},18946:(t,e,n)=>{var r=n(66020),i=n(94248).Graph,o=n(78912);t.exports=function(t,e){if(t.nodeCount()<=1)return[];var n=function(t,e){var n=new i,a=0,u=0;r.forEach(t.nodes(),(function(t){n.setNode(t,{v:t,in:0,out:0})})),r.forEach(t.edges(),(function(t){var r=n.edge(t.v,t.w)||0,i=e(t),o=r+i;n.setEdge(t.v,t.w,o),u=Math.max(u,n.node(t.v).out+=i),a=Math.max(a,n.node(t.w).in+=i)}));var c=r.range(u+a+3).map((function(){return new o})),f=a+1;return r.forEach(n.nodes(),(function(t){s(c,f,n.node(t))})),{graph:n,buckets:c,zeroIdx:f}}(t,e||a),c=function(t,e,n){for(var r,i=[],o=e[e.length-1],a=e[0];t.nodeCount();){for(;r=a.dequeue();)u(t,e,n,r);for(;r=o.dequeue();)u(t,e,n,r);if(t.nodeCount())for(var s=e.length-2;s>0;--s)if(r=e[s].dequeue()){i=i.concat(u(t,e,n,r,!0));break}}return i}(n.graph,n.buckets,n.zeroIdx);return r.flatten(r.map(c,(function(e){return t.outEdges(e.v,e.w)})),!0)};var a=r.constant(1);function u(t,e,n,i,o){var a=o?[]:void 0;return r.forEach(t.inEdges(i.v),(function(r){var i=t.edge(r),u=t.node(r.v);o&&a.push({v:r.v,w:r.w}),u.out-=i,s(e,n,u)})),r.forEach(t.outEdges(i.v),(function(r){var i=t.edge(r),o=r.w,a=t.node(o);a.in-=i,s(e,n,a)})),t.removeNode(i.v),a}function s(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)}},85895:(t,e,n)=>{"use strict";var r=n(66020),i=n(88496),o=n(72100),a=n(57055),u=n(91127).normalizeRanks,s=n(53916),c=n(91127).removeEmptyRanks,f=n(13223),l=n(93188),h=n(26184),d=n(39907),p=n(68838),v=n(91127),g=n(94248).Graph,y=n(21783);t.exports=function(t,e){var n=e&&e.debugTiming?v.time:v.notime;n("layout",(function(){e&&!e.keepNodeOrder&&e.prevGraph&&n(" inheritOrder",(function(){var n,i,o;n=t,i=e.prevGraph,o=i._nodes,r.forEach(n.nodes(),(function(t){var e=n.node(t);void 0!==o[t]?(e.fixorder=o[t]._order,delete o[t]._order):delete e.fixorder}))}));var D=n(" buildLayoutGraph",(function(){return function(t){var e=new g({multigraph:!0,compound:!0}),n=I(t.graph());return e.setGraph(r.merge({},b,T(n,m),r.pick(n,_))),r.forEach(t.nodes(),(function(n){var i=I(t.node(n));e.setNode(n,r.defaults(T(i,x),w)),e.setParent(n,t.parent(n))})),r.forEach(t.edges(),(function(n){var i=I(t.edge(n));e.setEdge(n,r.merge({},S,T(i,E),r.pick(i,A)))})),e}(t)}));e&&!1===e.edgeLabelSpace||n(" makeSpaceForEdgeLabels",(function(){!function(t){var e=t.graph();e.ranksep/=2,r.forEach(t.nodes(),(function(e){var n=t.node(e);isNaN(n.layer)||(n.layer*=2)})),r.forEach(t.edges(),(function(n){var r=t.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(D)}));try{n(" runLayout",(function(){!function(t,e,n){e(" removeSelfEdges",(function(){!function(t){r.forEach(t.edges(),(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)}}))}(t)})),e(" acyclic",(function(){i.run(t)})),e(" nestingGraph.run",(function(){f.run(t)})),e(" rank",(function(){a(v.asNonCompoundGraph(t))})),e(" injectEdgeLabelProxies",(function(){!function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);if(n.width&&n.height){var r=t.node(e.v),i={rank:(t.node(e.w).rank-r.rank)/2+r.rank,e};v.addDummyNode(t,"edge-proxy",i,"_ep")}}))}(t)})),e(" removeEmptyRanks",(function(){c(t)})),e(" nestingGraph.cleanup",(function(){f.cleanup(t)})),e(" normalizeRanks",(function(){u(t)})),e(" assignRankMinMax",(function(){!function(t){var e=0;r.forEach(t.nodes(),(function(n){var i=t.node(n);i.borderTop&&(i.minRank=t.node(i.borderTop).rank,i.maxRank=t.node(i.borderBottom).rank,e=r.max(e,i.maxRank))})),t.graph().maxRank=e}(t)})),e(" removeEdgeLabelProxies",(function(){!function(t){r.forEach(t.nodes(),(function(e){var n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))}))}(t)})),e(" normalize.run",(function(){o.run(t)})),e(" parentDummyChains",(function(){s(t)})),e(" addBorderSegments",(function(){l(t)})),n&&n.keepNodeOrder&&e(" initDataOrder",(function(){y(t,n.nodeOrder)})),e(" order",(function(){d(t)})),e(" insertSelfEdges",(function(){!function(t){var e=v.buildLayerMatrix(t);r.forEach(e,(function(e){var n=0;r.forEach(e,(function(e,i){var o=t.node(e);o.order=i+n,r.forEach(o.selfEdges,(function(e){v.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:o.rank,order:i+ ++n,e:e.e,label:e.label},"_se")})),delete o.selfEdges}))}))}(t)})),e(" adjustCoordinateSystem",(function(){h.adjust(t)})),e(" position",(function(){p(t)})),e(" positionSelfEdges",(function(){!function(t){r.forEach(t.nodes(),(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},{x:i+a,y:o},{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}}))}(t)})),e(" removeBorderNodes",(function(){!function(t){r.forEach(t.nodes(),(function(e){if(t.children(e).length){var n=t.node(e),i=t.node(n.borderTop),o=t.node(n.borderBottom),a=t.node(r.last(n.borderLeft)),u=t.node(r.last(n.borderRight));n.width=Math.abs(u.x-a.x),n.height=Math.abs(o.y-i.y),n.x=a.x+n.width/2,n.y=i.y+n.height/2}})),r.forEach(t.nodes(),(function(e){"border"===t.node(e).dummy&&t.removeNode(e)}))}(t)})),e(" normalize.undo",(function(){o.undo(t)})),e(" fixupEdgeLabelCoords",(function(){!function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);if(r.has(n,"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}}))}(t)})),e(" undoCoordinateSystem",(function(){h.undo(t)})),e(" translateGraph",(function(){!function(t){var e=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,o=0,a=t.graph(),u=a.marginx||0,s=a.marginy||0;function c(t){var r=t.x,a=t.y,u=t.width,s=t.height;e=Math.min(e,r-u/2),n=Math.max(n,r+u/2),i=Math.min(i,a-s/2),o=Math.max(o,a+s/2)}r.forEach(t.nodes(),(function(e){c(t.node(e))})),r.forEach(t.edges(),(function(e){var n=t.edge(e);r.has(n,"x")&&c(n)})),e-=u,i-=s,r.forEach(t.nodes(),(function(n){var r=t.node(n);r.x-=e,r.y-=i})),r.forEach(t.edges(),(function(n){var o=t.edge(n);r.forEach(o.points,(function(t){t.x-=e,t.y-=i})),r.has(o,"x")&&(o.x-=e),r.has(o,"y")&&(o.y-=i)})),a.width=n-e+u,a.height=o-i+s}(t)})),e(" assignNodeIntersects",(function(){!function(t){r.forEach(t.edges(),(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(v.intersectRect(o,n)),i.points.push(v.intersectRect(a,r))}))}(t)})),e(" reversePoints",(function(){!function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);n.reversed&&n.points.reverse()}))}(t)})),e(" acyclic.undo",(function(){i.undo(t)}))}(D,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){r.forEach(t.nodes(),(function(n){var r=t.node(n),i=e.node(n);r&&(r.x=i.x,r.y=i.y,r._order=i.order,r._rank=i.rank,e.children(n).length&&(r.width=i.width,r.height=i.height))})),r.forEach(t.edges(),(function(n){var i=t.edge(n),o=e.edge(n);i.points=o.points,r.has(o,"x")&&(i.x=o.x,i.y=o.y)})),t.graph().width=e.graph().width,t.graph().height=e.graph().height}(t,D)}))}))};var m=["nodesep","edgesep","ranksep","marginx","marginy"],b={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},_=["acyclicer","ranker","rankdir","align"],x=["width","height","layer","fixorder"],w={width:0,height:0},E=["minlen","weight","width","height","labeloffset"],S={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},A=["labelpos"];function T(t,e){return r.mapValues(r.pick(t,e),Number)}function I(t){var e={};return r.forEach(t,(function(t,n){e[n.toLowerCase()]=t})),e}},66020:(t,e,n)=>{var r;try{r={cloneDeep:n(20250),constant:n(13503),defaults:n(28548),each:n(76934),filter:n(64725),find:n(79785),flatten:n(40151),forEach:n(99204),forIn:n(23190),has:n(99946),isUndefined:n(16513),last:n(10611),map:n(9924),mapValues:n(70642),max:n(95987),merge:n(28440),min:n(73376),minBy:n(83296),now:n(5795),pick:n(89409),range:n(60859),reduce:n(16473),sortBy:n(351),uniqueId:n(95708),values:n(81229),zipObject:n(65441)}}catch(t){}r||(r=window._),t.exports=r},13223:(t,e,n)=>{var r=n(66020),i=n(91127);function o(t,e,n,a,u,s,c){var f=t.children(c);if(f.length){var l=i.addBorderNode(t,"_bt"),h=i.addBorderNode(t,"_bb"),d=t.node(c);t.setParent(l,c),d.borderTop=l,t.setParent(h,c),d.borderBottom=h,r.forEach(f,(function(r){o(t,e,n,a,u,s,r);var i=t.node(r),f=i.borderTop?i.borderTop:r,d=i.borderBottom?i.borderBottom:r,p=i.borderTop?a:2*a,v=f!==d?1:u-s[c]+1;t.setEdge(l,f,{weight:p,minlen:v,nestingEdge:!0}),t.setEdge(d,h,{weight:p,minlen:v,nestingEdge:!0})})),t.parent(c)||t.setEdge(e,l,{weight:0,minlen:u+s[c]})}else c!==e&&t.setEdge(e,c,{weight:0,minlen:n})}t.exports={run:function(t){var e=i.addDummyNode(t,"root",{},"_root"),n=function(t){var e={};function n(i,o){var a=t.children(i);a&&a.length&&r.forEach(a,(function(t){n(t,o+1)})),e[i]=o}return r.forEach(t.children(),(function(t){n(t,1)})),e}(t),a=r.max(r.values(n))-1,u=2*a+1;t.graph().nestingRoot=e,r.forEach(t.edges(),(function(e){t.edge(e).minlen*=u}));var s=function(t){return r.reduce(t.edges(),(function(e,n){return e+t.edge(n).weight}),0)}(t)+1;r.forEach(t.children(),(function(r){o(t,e,u,s,a,n,r)})),t.graph().nodeRankFactor=u},cleanup:function(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,r.forEach(t.edges(),(function(e){t.edge(e).nestingEdge&&t.removeEdge(e)}))}}},72100:(t,e,n)=>{"use strict";var r=n(66020),i=n(91127);t.exports={run:function(t){t.graph().dummyChains=[],r.forEach(t.edges(),(function(e){!function(t,e){var n,r,o,a=e.v,u=t.node(a).rank,s=e.w,c=t.node(s).rank,f=e.name,l=t.edge(e),h=l.labelRank;if(c!==u+1){for(t.removeEdge(e),o=0,++u;u<c;++o,++u)l.points=[],r={width:0,height:0,edgeLabel:l,edgeObj:e,rank:u},n=i.addDummyNode(t,"edge",r,"_d"),u===h&&(r.width=l.width,r.height=l.height,r.dummy="edge-label",r.labelpos=l.labelpos),t.setEdge(a,n,{weight:l.weight},f),0===o&&t.graph().dummyChains.push(n),a=n;t.setEdge(a,s,{weight:l.weight},f)}}(t,e)}))},undo:function(t){r.forEach(t.graph().dummyChains,(function(e){var n,r=t.node(e),i=r.edgeLabel;for(t.setEdge(r.edgeObj,i);r.dummy;)n=t.successors(e)[0],t.removeNode(e),i.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),e=n,r=t.node(e)}))}}},28750:(t,e,n)=>{var r=n(66020);t.exports=function(t,e,n){var i,o={};r.forEach(n,(function(n){for(var r,a,u=t.parent(n);u;){if((r=t.parent(u))?(a=o[r],o[r]=u):(a=i,i=u),a&&a!==u)return void e.setEdge(a,u);u=r}}))}},48366:(t,e,n)=>{var r=n(66020);t.exports=function(t,e){return r.map(e,(function(e){var n=t.inEdges(e);if(n.length){var i=r.reduce(n,(function(e,n){var r=t.edge(n),i=t.node(n.v);return{sum:e.sum+r.weight*i.order,weight:e.weight+r.weight}}),{sum:0,weight:0});return{v:e,barycenter:i.sum/i.weight,weight:i.weight}}return{v:e}}))}},15434:(t,e,n)=>{var r=n(66020),i=n(94248).Graph;t.exports=function(t,e,n){var o=function(t){for(var e;t.hasNode(e=r.uniqueId("_root")););return e}(t),a=new i({compound:!0}).setGraph({root:o}).setDefaultNodeLabel((function(e){return t.node(e)}));return r.forEach(t.nodes(),(function(i){var u=t.node(i),s=t.parent(i);(u.rank===e||u.minRank<=e&&e<=u.maxRank)&&(a.setNode(i),a.setParent(i,s||o),r.forEach(t[n](i),(function(e){var n=e.v===i?e.w:e.v,o=a.edge(n,i),u=r.isUndefined(o)?0:o.weight;a.setEdge(n,i,{weight:t.edge(e).weight+u})})),r.has(u,"minRank")&&a.setNode(i,{borderLeft:u.borderLeft[e],borderRight:u.borderRight[e]}))})),a}},9326:(t,e,n)=>{"use strict";var r=n(66020);function i(t,e,n){for(var i=r.zipObject(n,r.map(n,(function(t,e){return e}))),o=r.flatten(r.map(e,(function(e){return r.sortBy(r.map(t.outEdges(e),(function(e){return{pos:i[e.w],weight:t.edge(e).weight}})),"pos")})),!0),a=1;a<n.length;)a<<=1;var u=2*a-1;a-=1;var s=r.map(new Array(u),(function(){return 0})),c=0;return r.forEach(o.forEach((function(t){var e=t.pos+a;s[e]+=t.weight;for(var n=0;e>0;)e%2&&(n+=s[e+1]),s[e=e-1>>1]+=t.weight;c+=t.weight*n}))),c}t.exports=function(t,e){for(var n=0,r=1;r<e.length;++r)n+=i(t,e[r-1],e[r]);return n}},39907:(t,e,n)=>{"use strict";var r=n(66020),i=n(76849),o=n(9326),a=n(98144),u=n(15434),s=n(28750),c=n(94248).Graph,f=n(91127);function l(t,e,n){return r.map(e,(function(e){return u(t,e,n)}))}function h(t,e,n){var i=new c;r.forEach(t,(function(t){var o=t.graph().root,u=a(t,o,i,e,n);r.forEach(u.vs,(function(e,n){t.node(e).order=n})),s(t,i,u.vs)}))}function d(t,e){r.forEach(e,(function(e){r.forEach(e,(function(e,n){t.node(e).order=n}))}))}t.exports=function(t){var e=f.maxRank(t),n=l(t,r.range(1,e+1),"inEdges"),a=l(t,r.range(e-1,-1,-1),"outEdges"),u=i(t);d(t,u);for(var s,c=Number.POSITIVE_INFINITY,p=0,v=0;v<4;++p,++v){h(p%2?n:a,p%4>=2),u=f.buildLayerMatrix(t);var g=o(t,u);g<c&&(v=0,s=r.cloneDeep(u),c=g)}for(d(t,u=i(t)),p=0,v=0;v<4;++p,++v)h(p%2?n:a,p%4>=2,!0),u=f.buildLayerMatrix(t),(g=o(t,u))<c&&(v=0,s=r.cloneDeep(u),c=g);d(t,s)}},21783:(t,e,n)=>{"use strict";var r=n(66020);t.exports=function(t,e){var n=r.filter(t.nodes(),(function(e){return!t.children(e).length})),i=r.max(r.map(n,(function(e){return t.node(e).rank}))),o=r.map(r.range(i+1),(function(){return[]}));r.forEach(e,(function(e){var n=t.node(e);n.dummy||(n.fixorder=o[n.rank].length,o[n.rank].push(e))}))}},76849:(t,e,n)=>{"use strict";var r=n(66020);t.exports=function(t){var e={},n=r.filter(t.nodes(),(function(e){return!t.children(e).length})),i=r.max(r.map(n,(function(e){return t.node(e).rank}))),o=r.map(r.range(i+1),(function(){return[]})),a=r.sortBy(n,(function(e){return t.node(e).rank})),u=r.sortBy(r.filter(a,(function(e){return void 0!==t.node(e).fixorder})),(function(e){return t.node(e).fixorder}));return r.forEach(u,(function(n){o[t.node(n).rank].push(n),e[n]=!0})),r.forEach(a,(function n(i){if(!r.has(e,i)){e[i]=!0;var a=t.node(i);o[a.rank].push(i),r.forEach(t.successors(i),n)}})),o}},51910:(t,e,n)=>{"use strict";var r=n(66020);t.exports=function(t,e){var n={};return r.forEach(t,(function(t,e){var i=n[t.v]={indegree:0,in:[],out:[],vs:[t.v],i:e};r.isUndefined(t.barycenter)||(i.barycenter=t.barycenter,i.weight=t.weight)})),r.forEach(e.edges(),(function(t){var e=n[t.v],i=n[t.w];r.isUndefined(e)||r.isUndefined(i)||(i.indegree++,e.out.push(n[t.w]))})),function(t){var e=[];function n(t){return function(e){var n,i,o,a;e.merged||(r.isUndefined(e.barycenter)||r.isUndefined(t.barycenter)||e.barycenter>=t.barycenter)&&(i=e,o=0,a=0,(n=t).weight&&(o+=n.barycenter*n.weight,a+=n.weight),i.weight&&(o+=i.barycenter*i.weight,a+=i.weight),n.vs=i.vs.concat(n.vs),n.barycenter=o/a,n.weight=a,n.i=Math.min(i.i,n.i),i.merged=!0)}}function i(e){return function(n){n.in.push(e),0==--n.indegree&&t.push(n)}}for(;t.length;){var o=t.pop();e.push(o),r.forEach(o.in.reverse(),n(o)),r.forEach(o.out,i(o))}return r.map(r.filter(e,(function(t){return!t.merged})),(function(t){return r.pick(t,["vs","i","barycenter","weight"])}))}(r.filter(n,(function(t){return!t.indegree})))}},98144:(t,e,n)=>{var r=n(66020),i=n(48366),o=n(51910),a=n(22988);t.exports=function t(e,n,u,s,c){var f=e.children(n),l=e.node(n),h=l?l.borderLeft:void 0,d=l?l.borderRight:void 0,p={};h&&(f=r.filter(f,(function(t){return t!==h&&t!==d})));var v=i(e,f);r.forEach(v,(function(n){if(e.children(n.v).length){var i=t(e,n.v,u,s);p[n.v]=i,r.has(i,"barycenter")&&(o=n,a=i,r.isUndefined(o.barycenter)?(o.barycenter=a.barycenter,o.weight=a.weight):(o.barycenter=(o.barycenter*o.weight+a.barycenter*a.weight)/(o.weight+a.weight),o.weight+=a.weight))}var o,a}));var g=o(v,u);(function(t,e){r.forEach(t,(function(t){t.vs=r.flatten(t.vs.map((function(t){return e[t]?e[t].vs:t})),!0)}))})(g,p),r.forEach(g,(function(t){var n=e.node(t.vs[0]);t.fixorder=n.fixorder,t.order=n.order}));var y=a(g,s,c);if(h&&(y.vs=r.flatten([h,y.vs,d],!0),e.predecessors(h).length)){var m=e.node(e.predecessors(h)[0]),b=e.node(e.predecessors(d)[0]);r.has(y,"barycenter")||(y.barycenter=0,y.weight=0),y.barycenter=(y.barycenter*y.weight+m.order+b.order)/(y.weight+2),y.weight+=2}return y}},22988:(t,e,n)=>{var r=n(66020),i=n(91127);function o(t,e,n){for(var i;e.length&&(i=r.last(e)).i<=n;)e.pop(),t.push(i.vs),n++;return n}t.exports=function(t,e,n){var a=i.partition(t,(function(t){return r.has(t,"fixorder")&&!isNaN(t.fixorder)||r.has(t,"barycenter")})),u=a.lhs,s=r.sortBy(a.rhs,(function(t){return-t.i})),c=[],f=0,l=0,h=0;u.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)),h=o(c,s,h),r.forEach(u,(function(t){h+=t.vs.length,c.push(t.vs),f+=t.barycenter*t.weight,l+=t.weight,h=o(c,s,h)}));var d={vs:r.flatten(c,!0)};return l&&(d.barycenter=f/l,d.weight=l),d}},53916:(t,e,n)=>{var r=n(66020);t.exports=function(t){var e=function(t){var e={},n=0;return r.forEach(t.children(),(function i(o){var a=n;r.forEach(t.children(o),i),e[o]={low:a,lim:n++}})),e}(t);r.forEach(t.graph().dummyChains,(function(n){for(var r=t.node(n),i=r.edgeObj,o=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{path:a.concat(u.reverse()),lca:o}}(t,e,i.v,i.w),a=o.path,u=o.lca,s=0,c=a[s],f=!0;n!==i.w;){if(r=t.node(n),f){for(;(c=a[s])!==u&&t.node(c).maxRank<r.rank;)s++;c===u&&(f=!1)}if(!f){for(;s<a.length-1&&t.node(c=a[s+1]).minRank<=r.rank;)s++;c=a[s]}t.setParent(n,c),n=t.successors(n)[0]}}))}},37643:(t,e,n)=>{"use strict";var r=n(66020),i=n(94248).Graph,o=n(91127);function a(t,e){var n={};return r.reduce(e,(function(e,i){var o=0,a=0,u=e.length,c=r.last(i);return r.forEach(i,(function(e,f){var l=function(t,e){if(t.node(e).dummy)return r.find(t.predecessors(e),(function(e){return t.node(e).dummy}))}(t,e),h=l?t.node(l).order:u;(l||e===c)&&(r.forEach(i.slice(a,f+1),(function(e){r.forEach(t.predecessors(e),(function(r){var i=t.node(r),a=i.order;!(a<o||h<a)||i.dummy&&t.node(e).dummy||s(n,r,e)}))})),a=f+1,o=h)})),i})),n}function u(t,e){var n={};function i(e,i,o,a,u){var c;r.forEach(r.range(i,o),(function(i){c=e[i],t.node(c).dummy&&r.forEach(t.predecessors(c),(function(e){var r=t.node(e);r.dummy&&(r.order<a||r.order>u)&&s(n,e,c)}))}))}return r.reduce(e,(function(e,n){var o,a=-1,u=0;return r.forEach(n,(function(r,s){if("border"===t.node(r).dummy){var c=t.predecessors(r);c.length&&(o=t.node(c[0]).order,i(n,u,s,a,o),u=s,a=o)}i(n,u,n.length,o,e.length)})),n})),n}function s(t,e,n){if(e>n){var r=e;e=n,n=r}var i=t[e];i||(t[e]=i={}),i[n]=!0}function c(t,e,n){if(e>n){var i=e;e=n,n=i}return r.has(t[e],n)}function f(t,e,n,i){var o={},a={},u={};return r.forEach(e,(function(t){r.forEach(t,(function(t,e){o[t]=t,a[t]=t,u[t]=e}))})),r.forEach(e,(function(t){var e=-1;r.forEach(t,(function(t){var s=i(t);if(s.length){s=r.sortBy(s,(function(t){return u[t]}));for(var f=(s.length-1)/2,l=Math.floor(f),h=Math.ceil(f);l<=h;++l){var d=s[l];a[t]===t&&e<u[d]&&!c(n,t,d)&&(a[d]=t,a[t]=o[t]=o[d],e=u[d])}}}))})),{root:o,align:a}}function l(t,e,n,o,a){var u={},s=function(t,e,n,o){var a=new i,u=t.graph(),s=function(t,e,n){return function(i,o,a){var u,s=i.node(o),c=i.node(a),f=0;if(f+=s.width/2,r.has(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":u=-s.width/2;break;case"r":u=s.width/2}if(u&&(f+=n?u:-u),u=0,f+=(s.dummy?e:t)/2,f+=(c.dummy?e:t)/2,f+=c.width/2,r.has(c,"labelpos"))switch(c.labelpos.toLowerCase()){case"l":u=c.width/2;break;case"r":u=-c.width/2}return u&&(f+=n?u:-u),u=0,f}}(u.nodesep,u.edgesep,o);return r.forEach(e,(function(e){var i;r.forEach(e,(function(e){var r=n[e];if(a.setNode(r),i){var o=n[i],u=a.edge(o,r);a.setEdge(o,r,Math.max(s(t,e,i),u||0))}i=e}))})),a}(t,e,n,a),c=a?"borderLeft":"borderRight";function f(t,e){for(var n=s.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 f((function(t){u[t]=s.inEdges(t).reduce((function(t,e){return Math.max(t,u[e.v]+s.edge(e))}),0)}),s.predecessors.bind(s)),f((function(e){var n=s.outEdges(e).reduce((function(t,e){return Math.min(t,u[e.w]-s.edge(e))}),Number.POSITIVE_INFINITY),r=t.node(e);n!==Number.POSITIVE_INFINITY&&r.borderType!==c&&(u[e]=Math.max(u[e],n))}),s.successors.bind(s)),r.forEach(o,(function(t){u[t]=u[n[t]]})),u}function h(t,e){return r.minBy(r.values(e),(function(e){var n=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return r.forIn(e,(function(e,r){var o=function(t,e){return t.node(e).width}(t,r)/2;n=Math.max(e+o,n),i=Math.min(e-o,i)})),n-i}))}function d(t,e){var n=r.values(e),i=r.min(n),o=r.max(n);r.forEach(["u","d"],(function(n){r.forEach(["l","r"],(function(a){var u,s=n+a,c=t[s];if(c!==e){var f=r.values(c);(u="l"===a?i-r.min(f):o-r.max(f))&&(t[s]=r.mapValues(c,(function(t){return t+u})))}}))}))}function p(t,e){return r.mapValues(t.ul,(function(n,i){if(e)return t[e.toLowerCase()][i];var o=r.sortBy(r.map(t,i));return(o[1]+o[2])/2}))}t.exports={positionX:function(t){var e,n=o.buildLayerMatrix(t),i=r.merge(a(t,n),u(t,n)),s={};r.forEach(["u","d"],(function(o){e="u"===o?n:r.values(n).reverse(),r.forEach(["l","r"],(function(n){"r"===n&&(e=r.map(e,(function(t){return r.values(t).reverse()})));var a=("u"===o?t.predecessors:t.successors).bind(t),u=f(0,e,i,a),c=l(t,e,u.root,u.align,"r"===n);"r"===n&&(c=r.mapValues(c,(function(t){return-t}))),s[o+n]=c}))}));var c=h(t,s);return d(s,c),p(s,t.graph().align)},findType1Conflicts:a,findType2Conflicts:u,addConflict:s,hasConflict:c,verticalAlignment:f,horizontalCompaction:l,alignCoordinates:d,findSmallestWidthAlignment:h,balance:p}},68838:(t,e,n)=>{"use strict";var r=n(66020),i=n(91127),o=n(37643).positionX;t.exports=function(t){(function(t){var e=i.buildLayerMatrix(t),n=t.graph().ranksep,o=0;r.forEach(e,(function(e){var i=r.max(r.map(e,(function(e){return t.node(e).height})));r.forEach(e,(function(e){t.node(e).y=o+i/2})),o+=i+n}))})(t=i.asNonCompoundGraph(t)),r.forEach(o(t),(function(e,n){t.node(n).x=e}))}},36795:(t,e,n)=>{"use strict";var r=n(66020),i=n(94248).Graph,o=n(44939).slack;function a(t,e){return r.forEach(t.nodes(),(function n(i){r.forEach(e.nodeEdges(i),(function(r){var a=r.v,u=i===a?r.w:a;t.hasNode(u)||o(e,r)||(t.setNode(u,{}),t.setEdge(i,u,{}),n(u))}))})),t.nodeCount()}function u(t,e){return r.forEach(t.nodes(),(function n(i){r.forEach(e.nodeEdges(i),(function(r){var a=r.v,u=i===a?r.w:a;t.hasNode(u)||void 0===e.node(u).layer&&o(e,r)||(t.setNode(u,{}),t.setEdge(i,u,{}),n(u))}))})),t.nodeCount()}function s(t,e){return r.minBy(e.edges(),(function(n){if(t.hasNode(n.v)!==t.hasNode(n.w))return o(e,n)}))}function c(t,e,n){r.forEach(t.nodes(),(function(t){e.node(t).rank+=n}))}t.exports={feasibleTree:function(t){var e,n,r=new i({directed:!1}),u=t.nodes()[0],f=t.nodeCount();for(r.setNode(u,{});a(r,t)<f;)e=s(r,t),n=r.hasNode(e.v)?o(t,e):-o(t,e),c(r,t,n);return r},feasibleTreeWithLayer:function(t){var e,n,r=new i({directed:!1}),a=t.nodes()[0],f=t.nodeCount();for(r.setNode(a,{});u(r,t)<f;)e=s(r,t),n=r.hasNode(e.v)?o(t,e):-o(t,e),c(r,t,n);return r}}},57055:(t,e,n)=>{"use strict";var r=n(44939).longestPathWithLayer,i=n(36795).feasibleTreeWithLayer,o=n(10893);t.exports=function(t){switch(t.graph().ranker){case"network-simplex":!function(t){o(t)}(t);break;default:!function(t){r(t),i(t)}(t);break;case"longest-path":a(t)}};var a=r},10893:(t,e,n)=>{"use strict";var r=n(66020),i=n(36795).feasibleTree,o=n(44939).slack,a=n(44939).longestPath,u=n(94248).alg.preorder,s=n(94248).alg.postorder,c=n(91127).simplify;function f(t){t=c(t),a(t);var e,n=i(t);for(d(n),l(n,t);e=v(n);)y(n,t,e,g(n,t,e))}function l(t,e){var n=s(t,t.nodes());n=n.slice(0,n.length-1),r.forEach(n,(function(n){!function(t,e,n){var r=t.node(n).parent;t.edge(n,r).cutvalue=h(t,e,n)}(t,e,n)}))}function h(t,e,n){var i=t.node(n).parent,o=!0,a=e.edge(n,i),u=0;return a||(o=!1,a=e.edge(i,n)),u=a.weight,r.forEach(e.nodeEdges(n),(function(r){var a,s,c=r.v===n,f=c?r.w:r.v;if(f!==i){var l=c===o,h=e.edge(r).weight;if(u+=l?h:-h,a=n,s=f,t.hasEdge(a,s)){var d=t.edge(n,f).cutvalue;u+=l?-d:d}}})),u}function d(t,e){arguments.length<2&&(e=t.nodes()[0]),p(t,{},1,e)}function p(t,e,n,i,o){var a=n,u=t.node(i);return e[i]=!0,r.forEach(t.neighbors(i),(function(o){r.has(e,o)||(n=p(t,e,n,o,i))})),u.low=a,u.lim=n++,o?u.parent=o:delete u.parent,n}function v(t){return r.find(t.edges(),(function(e){return t.edge(e).cutvalue<0}))}function g(t,e,n){var i=n.v,a=n.w;e.hasEdge(i,a)||(i=n.w,a=n.v);var u=t.node(i),s=t.node(a),c=u,f=!1;u.lim>s.lim&&(c=s,f=!0);var l=r.filter(e.edges(),(function(e){return f===m(0,t.node(e.v),c)&&f!==m(0,t.node(e.w),c)}));return r.minBy(l,(function(t){return o(e,t)}))}function y(t,e,n,i){var o=n.v,a=n.w;t.removeEdge(o,a),t.setEdge(i.v,i.w,{}),d(t),l(t,e),function(t,e){var n=r.find(t.nodes(),(function(t){return!e.node(t).parent})),i=u(t,n);i=i.slice(1),r.forEach(i,(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)}))}(t,e)}function m(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}t.exports=f,f.initLowLimValues=d,f.initCutValues=l,f.calcCutValue=h,f.leaveEdge=v,f.enterEdge=g,f.exchangeEdges=y},44939:(t,e,n)=>{"use strict";var r=n(66020);t.exports={longestPath:function(t){var e={};r.forEach(t.sources(),(function n(i){var o=t.node(i);if(r.has(e,i))return o.rank;e[i]=!0;var a=r.min(r.map(t.outEdges(i),(function(e){return n(e.w)-t.edge(e).minlen})));return a!==Number.POSITIVE_INFINITY&&null!=a||(a=0),o.rank=a}))},longestPathWithLayer:function(t){var e={},n=0;function i(e,n){var o=t.node(e),a=isNaN(o.layer)?n:o.layer;(void 0===o.rank||o.rank<a)&&(o.rank=a),r.map(t.outEdges(e),(function(e){i(e.w,a+t.edge(e).minlen)}))}r.forEach(t.sources(),(function i(o){var a=t.node(o);if(r.has(e,o))return a.rank;e[o]=!0;var u=r.min(r.map(t.outEdges(o),(function(e){return i(e.w)-t.edge(e).minlen})));return u!==Number.POSITIVE_INFINITY&&null!=u||(u=0),a.rank=u,n=Math.min(a.rank,n),a.rank})),n+=1,t.nodes().forEach((function(e){var r=t.node(e);isNaN(r.layer)?r.rank-=n:i(e,r.layer)}))},slack:function(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}}},91127:(t,e,n)=>{"use strict";var r=n(66020),i=n(94248).Graph;function o(t,e,n,i){var o;do{o=r.uniqueId(i)}while(t.hasNode(o));return n.dummy=e,t.setNode(o,n),o}function a(t){return r.max(r.map(t.nodes(),(function(e){var n=t.node(e).rank;if(!r.isUndefined(n))return n})))}t.exports={addDummyNode:o,simplify:function(t){var e=(new i).setGraph(t.graph());return r.forEach(t.nodes(),(function(n){e.setNode(n,t.node(n))})),r.forEach(t.edges(),(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},asNonCompoundGraph:function(t){var e=new i({multigraph:t.isMultigraph()}).setGraph(t.graph());return r.forEach(t.nodes(),(function(n){t.children(n).length||e.setNode(n,t.node(n))})),r.forEach(t.edges(),(function(n){e.setEdge(n,t.edge(n))})),e},successorWeights:function(t){var e=r.map(t.nodes(),(function(e){var n={};return r.forEach(t.outEdges(e),(function(e){n[e.w]=(n[e.w]||0)+t.edge(e).weight})),n}));return r.zipObject(t.nodes(),e)},predecessorWeights:function(t){var e=r.map(t.nodes(),(function(e){var n={};return r.forEach(t.inEdges(e),(function(e){n[e.v]=(n[e.v]||0)+t.edge(e).weight})),n}));return r.zipObject(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;if(!a&&!u)throw new Error("Not possible to find intersection inside of the rectangle");return 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}},buildLayerMatrix:function(t){var e=r.map(r.range(a(t)+1),(function(){return[]}));return r.forEach(t.nodes(),(function(n){var i=t.node(n),o=i.rank;r.isUndefined(o)||(e[o][i.order]=n)})),e},normalizeRanks:function(t){var e=r.min(r.map(t.nodes(),(function(e){return t.node(e).rank})));r.forEach(t.nodes(),(function(n){var i=t.node(n);r.has(i,"rank")&&(i.rank-=e)}))},removeEmptyRanks:function(t){var e=r.min(r.map(t.nodes(),(function(e){return t.node(e).rank}))),n=[];r.forEach(t.nodes(),(function(r){var i=t.node(r).rank-e;n[i]||(n[i]=[]),n[i].push(r)}));var i=0,o=t.graph().nodeRankFactor;r.forEach(n,(function(e,n){r.isUndefined(e)&&n%o!=0?--i:i&&r.forEach(e,(function(e){t.node(e).rank+=i}))}))},addBorderNode:function(t,e,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),o(t,"border",i,e)},maxRank:a,partition:function(t,e){var n={lhs:[],rhs:[]};return r.forEach(t,(function(t){e(t)?n.lhs.push(t):n.rhs.push(t)})),n},time:function(t,e){var n=r.now();try{return e()}finally{console.log(t+" time: "+(r.now()-n)+"ms")}},notime:function(t,e){return e()}}},62213:t=>{t.exports="0.1.1"},45229: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}},65375:t=>{t.exports=function(t){var e=new Float32Array(2);return e[0]=t[0],e[1]=t[1],e}},63422:t=>{t.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t}},25128:t=>{t.exports=function(){var t=new Float32Array(2);return t[0]=0,t[1]=0,t}},80134: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}},87878:(t,e,n)=>{t.exports=n(42274)},42274:t=>{t.exports=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)}},26770:(t,e,n)=>{t.exports=n(87622)},87622: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)},26066:t=>{t.exports=function(t,e){return t[0]===e[0]&&t[1]===e[1]}},74860:t=>{t.exports=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}},88926:(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(25128)()},24697:t=>{t.exports=function(t,e){var n=new Float32Array(2);return n[0]=t,n[1]=e,n}},81602:(t,e,n)=>{t.exports={EPSILON:n(2157),create:n(25128),clone:n(65375),fromValues:n(24697),copy:n(63422),set:n(96765),equals:n(6922),exactEquals:n(26066),add:n(45229),subtract:n(24186),sub:n(5302),multiply:n(3848),mul:n(31665),divide:n(87622),div:n(26770),inverse:n(81873),min:n(56780),max:n(39564),rotate:n(68615),floor:n(74860),ceil:n(8356),round:n(87313),scale:n(91838),scaleAndAdd:n(77781),distance:n(42274),dist:n(87878),squaredDistance:n(76534),sqrDist:n(34969),length:n(80360),len:n(92256),squaredLength:n(95476),sqrLen:n(15375),negate:n(80388),normalize:n(95927),dot:n(6064),cross:n(80134),lerp:n(91099),random:n(60679),transformMat2:n(30367),transformMat2d:n(50655),transformMat3:n(32730),transformMat4:n(54020),forEach:n(88926),limit:n(48709)}},81873:t=>{t.exports=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}},92256:(t,e,n)=>{t.exports=n(80360)},80360:t=>{t.exports=function(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)}},91099: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}},48709: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}},39564: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}},56780: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}},31665:(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}},80388:t=>{t.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t}},95927: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}},60679: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}},68615: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}},87313:t=>{t.exports=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}},91838:t=>{t.exports=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}},77781:t=>{t.exports=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t}},96765:t=>{t.exports=function(t,e,n){return t[0]=e,t[1]=n,t}},34969:(t,e,n)=>{t.exports=n(76534)},15375:(t,e,n)=>{t.exports=n(95476)},76534:t=>{t.exports=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}},95476:t=>{t.exports=function(t){var e=t[0],n=t[1];return e*e+n*n}},5302:(t,e,n)=>{t.exports=n(24186)},24186:t=>{t.exports=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}},30367: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}},50655: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}},32730: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}},54020: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}},75172:(t,e,n)=>{var r=n(89224);t.exports={Graph:r.Graph,json:n(17401),alg:n(54613),version:r.version}},91606:(t,e,n)=>{var r=n(95329);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}},21482:(t,e,n)=>{var r=n(95329);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}},40845:(t,e,n)=>{var r=n(13746),i=n(95329);t.exports=function(t,e,n){return i.transform(t.nodes(),(function(i,o){i[o]=r(t,o,e,n)}),{})}},13746:(t,e,n)=>{var r=n(95329),i=n(36614);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)},59324:(t,e,n)=>{var r=n(95329),i=n(94558);t.exports=function(t){return r.filter(i(t),(function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])}))}},22893:(t,e,n)=>{var r=n(95329);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)},54613:(t,e,n)=>{t.exports={components:n(91606),dijkstra:n(13746),dijkstraAll:n(40845),findCycles:n(59324),floydWarshall:n(22893),isAcyclic:n(588),postorder:n(98049),preorder:n(67158),prim:n(66058),tarjan:n(94558),topsort:n(7793)}},588:(t,e,n)=>{var r=n(7793);t.exports=function(t){try{r(t)}catch(t){if(t instanceof r.CycleException)return!1;throw t}return!0}},98049:(t,e,n)=>{var r=n(21482);t.exports=function(t,e){return r(t,e,"post")}},67158:(t,e,n)=>{var r=n(21482);t.exports=function(t,e){return r(t,e,"pre")}},66058:(t,e,n)=>{var r=n(95329),i=n(6349),o=n(36614);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}},94558:(t,e,n)=>{var r=n(95329);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}},7793:(t,e,n)=>{var r=n(95329);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,o.prototype=new Error},36614:(t,e,n)=>{var r=n(95329);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}},6349:(t,e,n)=>{"use strict";var r=n(95329);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(){var t=this;return r.filter(this.nodes(),(function(e){return r.isEmpty(t._in[e])}))},o.prototype.sinks=function(){var t=this;return r.filter(this.nodes(),(function(e){return r.isEmpty(t._out[e])}))},o.prototype.setNodes=function(t,e){var n=arguments,i=this;return r.each(t,(function(t){n.length>1?i.setNode(t,e):i.setNode(t)})),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),(function(t){e.setParent(t)})),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 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());var n=this;r.each(this._nodes,(function(n,r){t(r)&&e.setNode(r,n)})),r.each(this._edgeObjs,(function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,n.edge(t))}));var 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))}},89224:(t,e,n)=>{t.exports={Graph:n(6349),version:n(16544)}},17401:(t,e,n)=>{var r=n(95329),i=n(6349);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}}},95329:(t,e,n)=>{var r;try{r={clone:n(76833),constant:n(13503),each:n(76934),filter:n(64725),has:n(99946),isArray:n(80744),isEmpty:n(61627),isFunction:n(9363),isUndefined:n(16513),keys:n(55451),map:n(9924),reduce:n(16473),size:n(40617),transform:n(91116),union:n(44065),values:n(81229)}}catch(t){}r||(r=window._),t.exports=r},16544:t=>{t.exports="2.1.8"},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)}}}},11922:(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)}}},80626:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tagProperty=e.tagParameter=e.decorate=void 0;var r=n(36078),i=n(50295);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)}},76213:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.inject=e.LazyServiceIdentifer=void 0;var r=n(36078),i=n(50295),o=n(25092),a=n(80626),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)}}},91773:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.injectable=void 0;var r=n(36078),i=n(50295);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}}},41528:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.multiInject=void 0;var r=n(50295),i=n(25092),o=n(80626);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)}}},79817:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.named=void 0;var r=n(50295),i=n(25092),o=n(80626);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)}}},71316:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.optional=void 0;var r=n(50295),i=n(25092),o=n(80626);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)}}},71971:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.postConstruct=void 0;var r=n(36078),i=n(50295),o=n(25092);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)}}},79189:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tagged=void 0;var r=n(25092),i=n(80626);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(50295),i=n(25092),o=n(80626);e.targetName=function(t){return function(e,n,a){var u=new i.Metadata(r.NAME_TAG,t);o.tagParameter(e,n,a,u)}}},19235:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.unmanaged=void 0;var r=n(50295),i=n(25092),o=n(80626);e.unmanaged=function(){return function(t,e,n){var a=new i.Metadata(r.UNMANAGED_TAG,!0);o.tagParameter(t,e,n,a)}}},30683:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Binding=void 0;var r=n(77690),i=n(70023),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},13497:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingCount=void 0,e.BindingCount={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1}},36078:(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"},77690:(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"}},50295:(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]},70596: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(30683),u=n(36078),s=n(77690),c=n(50295),f=n(43870),l=n(54142),h=n(9386),d=n(43313),p=n(70023),v=n(29552),g=n(71878),y=n(82543),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},42913:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AsyncContainerModule=e.ContainerModule=void 0;var r=n(70023);e.ContainerModule=function(t){this.id=r.id(),this.registry=t};e.AsyncContainerModule=function(t){this.id=r.id(),this.registry=t}},71878:(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},82543:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Lookup=void 0;var r=n(36078),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},99311:(t,e,n)=>{"use strict";e.f3=e.t6=e.b2=e.W2=void 0,n(50295);var r=n(70596);Object.defineProperty(e,"W2",{enumerable:!0,get:function(){return r.Container}});n(77690),n(42913);var i=n(91773);Object.defineProperty(e,"b2",{enumerable:!0,get:function(){return i.injectable}});n(79189);var o=n(79817);Object.defineProperty(e,"t6",{enumerable:!0,get:function(){return o.named}});var a=n(76213);Object.defineProperty(e,"f3",{enumerable:!0,get:function(){return a.inject}});n(71316),n(19235),n(41528),n(8245),n(71971),n(43870),n(70023),n(80626),n(83140),n(29552),n(34384)},91519:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Context=void 0;var r=n(70023),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},25092:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;var r=n(50295),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},43870:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MetadataReader=void 0;var r=n(50295),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}},54142:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getBindingDictionary=e.createMockRequest=e.plan=void 0;var r=n(13497),i=n(36078),o=n(77690),a=n(50295),u=n(92542),s=n(29552),c=n(91519),f=n(25092),l=n(6335),h=n(16664),d=n(14810),p=n(69660);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)}},68634:(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},16664: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(76213),o=n(36078),a=n(77690),u=n(50295),s=n(29552);Object.defineProperty(e,"getFunctionName",{enumerable:!0,get:function(){return s.getFunctionName}});var c=n(69660);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}},14810:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Request=void 0;var r=n(70023),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},69660:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Target=void 0;var r=n(50295),i=n(70023),o=n(25092),a=n(68634),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},74962: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(36078),o=n(77690),a=n(50295);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(36078),i=n(77690),o=n(92542),a=n(29552),u=n(74962),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)}},91640:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInSyntax=void 0;var r=n(77690),i=n(46890),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},82386:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInWhenOnSyntax=void 0;var r=n(91640),i=n(8926),o=n(36890),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(36890),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},43313:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingToSyntax=void 0;var r=n(36078),i=n(77690),o=n(82386),a=n(46890),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},46890:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenOnSyntax=void 0;var r=n(8926),i=n(36890),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},36890:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenSyntax=void 0;var r=n(8926),i=n(83140),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},83140:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.typeConstraint=e.namedConstraint=e.taggedConstraint=e.traverseAncerstors=void 0;var r=n(50295),i=n(25092),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}}},34384:(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)}))}}}},92542:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isStackOverflowExeption=void 0;var r=n(36078);e.isStackOverflowExeption=function(t){return t instanceof RangeError||t.message===r.STACK_OVERFLOW}},70023:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.id=void 0;var n=0;e.id=function(){return n++}},29552:(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(36078);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},15584:(t,e,n)=>{var r=n(73893)(n(33152),"DataView");t.exports=r},76414:(t,e,n)=>{var r=n(64696),i=n(16824),o=n(23476),a=n(63122),u=n(37279);function s(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])}}s.prototype.clear=r,s.prototype.delete=i,s.prototype.get=o,s.prototype.has=a,s.prototype.set=u,t.exports=s},99746:(t,e,n)=>{var r=n(34251),i=n(24968),o=n(28290),a=n(88068),u=n(54238);function s(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])}}s.prototype.clear=r,s.prototype.delete=i,s.prototype.get=o,s.prototype.has=a,s.prototype.set=u,t.exports=s},40164:(t,e,n)=>{var r=n(73893)(n(33152),"Map");t.exports=r},52166:(t,e,n)=>{var r=n(35365),i=n(63765),o=n(12608),a=n(10203),u=n(11298);function s(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])}}s.prototype.clear=r,s.prototype.delete=i,s.prototype.get=o,s.prototype.has=a,s.prototype.set=u,t.exports=s},97288:(t,e,n)=>{var r=n(73893)(n(33152),"Promise");t.exports=r},23599:(t,e,n)=>{var r=n(73893)(n(33152),"Set");t.exports=r},98924:(t,e,n)=>{var r=n(52166),i=n(34776),o=n(40393);function a(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new r;++e<n;)this.add(t[e])}a.prototype.add=a.prototype.push=i,a.prototype.has=o,t.exports=a},91866:(t,e,n)=>{var r=n(99746),i=n(31119),o=n(64399),a=n(81897),u=n(90558),s=n(64841);function c(t){var e=this.__data__=new r(t);this.size=e.size}c.prototype.clear=i,c.prototype.delete=o,c.prototype.get=a,c.prototype.has=u,c.prototype.set=s,t.exports=c},91869:(t,e,n)=>{var r=n(33152).Symbol;t.exports=r},77945:(t,e,n)=>{var r=n(33152).Uint8Array;t.exports=r},26873:(t,e,n)=>{var r=n(73893)(n(33152),"WeakMap");t.exports=r},79628:t=>{t.exports=function(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)}},74809:t=>{t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}},86952:t=>{t.exports=function(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}},84271:(t,e,n)=>{var r=n(17424);t.exports=function(t,e){return!(null==t||!t.length)&&r(t,e,0)>-1}},94874:t=>{t.exports=function(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}},63333:(t,e,n)=>{var r=n(67943),i=n(13053),o=n(80744),a=n(57835),u=n(70213),s=n(18397),c=Object.prototype.hasOwnProperty;t.exports=function(t,e){var n=o(t),f=!n&&i(t),l=!n&&!f&&a(t),h=!n&&!f&&!l&&s(t),d=n||f||l||h,p=d?r(t.length,String):[],v=p.length;for(var g in t)!e&&!c.call(t,g)||d&&("length"==g||l&&("offset"==g||"parent"==g)||h&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||u(g,v))||p.push(g);return p}},75010:t=>{t.exports=function(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}},57095:t=>{t.exports=function(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}},99861:t=>{t.exports=function(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}},64045:t=>{t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}},26539:(t,e,n)=>{var r=n(22310)("length");t.exports=r},89135:(t,e,n)=>{var r=n(42813),i=n(43607);t.exports=function(t,e,n){(void 0!==n&&!i(t[e],n)||void 0===n&&!(e in t))&&r(t,e,n)}},60348:(t,e,n)=>{var r=n(42813),i=n(43607),o=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var a=t[e];o.call(t,e)&&i(a,n)&&(void 0!==n||e in t)||r(t,e,n)}},67971:(t,e,n)=>{var r=n(43607);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return-1}},91937:(t,e,n)=>{var r=n(95378),i=n(55451);t.exports=function(t,e){return t&&r(e,i(e),t)}},26680:(t,e,n)=>{var r=n(95378),i=n(56730);t.exports=function(t,e){return t&&r(e,i(e),t)}},42813:(t,e,n)=>{var r=n(35234);t.exports=function(t,e,n){"__proto__"==e&&r?r(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}},99045:(t,e,n)=>{var r=n(91866),i=n(74809),o=n(60348),a=n(91937),u=n(26680),s=n(32315),c=n(47760),f=n(15168),l=n(71678),h=n(12076),d=n(22675),p=n(66139),v=n(79264),g=n(97541),y=n(4084),m=n(80744),b=n(57835),_=n(41626),x=n(20816),w=n(65226),E=n(55451),S=n(56730),A="[object Arguments]",T="[object Function]",I="[object Object]",D={};D[A]=D["[object Array]"]=D["[object ArrayBuffer]"]=D["[object DataView]"]=D["[object Boolean]"]=D["[object Date]"]=D["[object Float32Array]"]=D["[object Float64Array]"]=D["[object Int8Array]"]=D["[object Int16Array]"]=D["[object Int32Array]"]=D["[object Map]"]=D["[object Number]"]=D[I]=D["[object RegExp]"]=D["[object Set]"]=D["[object String]"]=D["[object Symbol]"]=D["[object Uint8Array]"]=D["[object Uint8ClampedArray]"]=D["[object Uint16Array]"]=D["[object Uint32Array]"]=!0,D["[object Error]"]=D[T]=D["[object WeakMap]"]=!1,t.exports=function t(e,n,C,N,k,R){var O,P=1&n,M=2&n,G=4&n;if(C&&(O=k?C(e,N,k,R):C(e)),void 0!==O)return O;if(!x(e))return e;var L=m(e);if(L){if(O=v(e),!P)return c(e,O)}else{var U=p(e),j=U==T||"[object GeneratorFunction]"==U;if(b(e))return s(e,P);if(U==I||U==A||j&&!k){if(O=M||j?{}:y(e),!P)return M?l(e,u(O,e)):f(e,a(O,e))}else{if(!D[U])return k?e:{};O=g(e,U,P)}}R||(R=new r);var F=R.get(e);if(F)return F;R.set(e,O),w(e)?e.forEach((function(r){O.add(t(r,n,C,r,e,R))})):_(e)&&e.forEach((function(r,i){O.set(i,t(r,n,C,i,e,R))}));var B=L?void 0:(G?M?d:h:M?S:E)(e);return i(B||e,(function(r,i){B&&(r=e[i=r]),o(O,i,t(r,n,C,i,e,R))})),O}},35024:(t,e,n)=>{var r=n(20816),i=Object.create,o=function(){function t(){}return function(e){if(!r(e))return{};if(i)return i(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();t.exports=o},44107:(t,e,n)=>{var r=n(1585),i=n(49164)(r);t.exports=i},2659:(t,e,n)=>{var r=n(45029);t.exports=function(t,e,n){for(var i=-1,o=t.length;++i<o;){var a=t[i],u=e(a);if(null!=u&&(void 0===s?u==u&&!r(u):n(u,s)))var s=u,c=a}return c}},32872:(t,e,n)=>{var r=n(44107);t.exports=function(t,e){var n=[];return r(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}},51533:t=>{t.exports=function(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}},9256:(t,e,n)=>{var r=n(57095),i=n(88133);t.exports=function t(e,n,o,a,u){var s=-1,c=e.length;for(o||(o=i),u||(u=[]);++s<c;){var f=e[s];n>0&&o(f)?n>1?t(f,n-1,o,a,u):r(u,f):a||(u[u.length]=f)}return u}},14018:(t,e,n)=>{var r=n(78010)();t.exports=r},1585:(t,e,n)=>{var r=n(14018),i=n(55451);t.exports=function(t,e){return t&&r(t,e,i)}},89147:(t,e,n)=>{var r=n(1186),i=n(9171);t.exports=function(t,e){for(var n=0,o=(e=r(e,t)).length;null!=t&&n<o;)t=t[i(e[n++])];return n&&n==o?t:void 0}},75635:(t,e,n)=>{var r=n(57095),i=n(80744);t.exports=function(t,e,n){var o=e(t);return i(t)?o:r(o,n(t))}},86756:(t,e,n)=>{var r=n(91869),i=n(72533),o=n(74702),a=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?i(t):o(t)}},40302:t=>{t.exports=function(t,e){return t>e}},3251:t=>{var e=Object.prototype.hasOwnProperty;t.exports=function(t,n){return null!=t&&e.call(t,n)}},62348:t=>{t.exports=function(t,e){return null!=t&&e in Object(t)}},17424:(t,e,n)=>{var r=n(51533),i=n(8373),o=n(49237);t.exports=function(t,e,n){return e==e?o(t,e,n):r(t,i,n)}},4977:(t,e,n)=>{var r=n(86756),i=n(93913);t.exports=function(t){return i(t)&&"[object Arguments]"==r(t)}},77295:(t,e,n)=>{var r=n(84412),i=n(93913);t.exports=function t(e,n,o,a,u){return e===n||(null==e||null==n||!i(e)&&!i(n)?e!=e&&n!=n:r(e,n,o,a,t,u))}},84412:(t,e,n)=>{var r=n(91866),i=n(50401),o=n(57710),a=n(4983),u=n(66139),s=n(80744),c=n(57835),f=n(18397),l="[object Arguments]",h="[object Array]",d="[object Object]",p=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,v,g,y){var m=s(t),b=s(e),_=m?h:u(t),x=b?h:u(e),w=(_=_==l?d:_)==d,E=(x=x==l?d:x)==d,S=_==x;if(S&&c(t)){if(!c(e))return!1;m=!0,w=!1}if(S&&!w)return y||(y=new r),m||f(t)?i(t,e,n,v,g,y):o(t,e,_,n,v,g,y);if(!(1&n)){var A=w&&p.call(t,"__wrapped__"),T=E&&p.call(e,"__wrapped__");if(A||T){var I=A?t.value():t,D=T?e.value():e;return y||(y=new r),g(I,D,n,v,y)}}return!!S&&(y||(y=new r),a(t,e,n,v,g,y))}},55005:(t,e,n)=>{var r=n(66139),i=n(93913);t.exports=function(t){return i(t)&&"[object Map]"==r(t)}},51524:(t,e,n)=>{var r=n(91866),i=n(77295);t.exports=function(t,e,n,o){var a=n.length,u=a,s=!o;if(null==t)return!u;for(t=Object(t);a--;){var c=n[a];if(s&&c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++a<u;){var f=(c=n[a])[0],l=t[f],h=c[1];if(s&&c[2]){if(void 0===l&&!(f in t))return!1}else{var d=new r;if(o)var p=o(l,h,f,t,e,d);if(!(void 0===p?i(h,l,3,o,d):p))return!1}}return!0}},8373:t=>{t.exports=function(t){return t!=t}},6367:(t,e,n)=>{var r=n(9363),i=n(89379),o=n(20816),a=n(63256),u=/^\[object .+?Constructor\]$/,s=Function.prototype,c=Object.prototype,f=s.toString,l=c.hasOwnProperty,h=RegExp("^"+f.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!o(t)||i(t))&&(r(t)?h:u).test(a(t))}},38652:(t,e,n)=>{var r=n(66139),i=n(93913);t.exports=function(t){return i(t)&&"[object Set]"==r(t)}},10766:(t,e,n)=>{var r=n(86756),i=n(11156),o=n(93913),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,t.exports=function(t){return o(t)&&i(t.length)&&!!a[r(t)]}},95979:(t,e,n)=>{var r=n(17632),i=n(38933),o=n(46962),a=n(80744),u=n(35769);t.exports=function(t){return"function"==typeof t?t:null==t?o:"object"==typeof t?a(t)?i(t[0],t[1]):r(t):u(t)}},6019:(t,e,n)=>{var r=n(7975),i=n(23730),o=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return i(t);var e=[];for(var n in Object(t))o.call(t,n)&&"constructor"!=n&&e.push(n);return e}},33988:(t,e,n)=>{var r=n(20816),i=n(7975),o=n(97817),a=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return o(t);var e=i(t),n=[];for(var u in t)("constructor"!=u||!e&&a.call(t,u))&&n.push(u);return n}},93757:t=>{t.exports=function(t,e){return t<e}},65487:(t,e,n)=>{var r=n(44107),i=n(24665);t.exports=function(t,e){var n=-1,o=i(t)?Array(t.length):[];return r(t,(function(t,r,i){o[++n]=e(t,r,i)})),o}},17632:(t,e,n)=>{var r=n(51524),i=n(10261),o=n(24122);t.exports=function(t){var e=i(t);return 1==e.length&&e[0][2]?o(e[0][0],e[0][1]):function(n){return n===t||r(n,t,e)}}},38933:(t,e,n)=>{var r=n(77295),i=n(44231),o=n(37879),a=n(86773),u=n(88411),s=n(24122),c=n(9171);t.exports=function(t,e){return a(t)&&u(e)?s(c(t),e):function(n){var a=i(n,t);return void 0===a&&a===e?o(n,t):r(e,a,3)}}},50097:(t,e,n)=>{var r=n(91866),i=n(89135),o=n(14018),a=n(23585),u=n(20816),s=n(56730),c=n(47052);t.exports=function t(e,n,f,l,h){e!==n&&o(n,(function(o,s){if(h||(h=new r),u(o))a(e,n,s,f,t,l,h);else{var d=l?l(c(e,s),o,s+"",e,n,h):void 0;void 0===d&&(d=o),i(e,s,d)}}),s)}},23585:(t,e,n)=>{var r=n(89135),i=n(32315),o=n(78358),a=n(47760),u=n(4084),s=n(13053),c=n(80744),f=n(41590),l=n(57835),h=n(9363),d=n(20816),p=n(19308),v=n(18397),g=n(47052),y=n(20480);t.exports=function(t,e,n,m,b,_,x){var w=g(t,n),E=g(e,n),S=x.get(E);if(S)r(t,n,S);else{var A=_?_(w,E,n+"",t,e,x):void 0,T=void 0===A;if(T){var I=c(E),D=!I&&l(E),C=!I&&!D&&v(E);A=E,I||D||C?c(w)?A=w:f(w)?A=a(w):D?(T=!1,A=i(E,!0)):C?(T=!1,A=o(E,!0)):A=[]:p(E)||s(E)?(A=w,s(w)?A=y(w):d(w)&&!h(w)||(A=u(E))):T=!1}T&&(x.set(E,A),b(A,E,m,_,x),x.delete(E)),r(t,n,A)}}},58506:(t,e,n)=>{var r=n(75010),i=n(89147),o=n(95979),a=n(65487),u=n(33065),s=n(38342),c=n(11249),f=n(46962),l=n(80744);t.exports=function(t,e,n){e=e.length?r(e,(function(t){return l(t)?function(e){return i(e,1===t.length?t[0]:t)}:t})):[f];var h=-1;e=r(e,s(o));var d=a(t,(function(t,n,i){return{criteria:r(e,(function(e){return e(t)})),index:++h,value:t}}));return u(d,(function(t,e){return c(t,e,n)}))}},88832:(t,e,n)=>{var r=n(10867),i=n(37879);t.exports=function(t,e){return r(t,e,(function(e,n){return i(t,n)}))}},10867:(t,e,n)=>{var r=n(89147),i=n(36897),o=n(1186);t.exports=function(t,e,n){for(var a=-1,u=e.length,s={};++a<u;){var c=e[a],f=r(t,c);n(f,c)&&i(s,o(c,t),f)}return s}},22310:t=>{t.exports=function(t){return function(e){return null==e?void 0:e[t]}}},96916:(t,e,n)=>{var r=n(89147);t.exports=function(t){return function(e){return r(e,t)}}},36121:t=>{var e=Math.ceil,n=Math.max;t.exports=function(t,r,i,o){for(var a=-1,u=n(e((r-t)/(i||1)),0),s=Array(u);u--;)s[o?u:++a]=t,t+=i;return s}},30739:t=>{t.exports=function(t,e,n,r,i){return i(t,(function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)})),n}},92918:(t,e,n)=>{var r=n(46962),i=n(19652),o=n(71152);t.exports=function(t,e){return o(i(t,e,r),t+"")}},36897:(t,e,n)=>{var r=n(60348),i=n(1186),o=n(70213),a=n(20816),u=n(9171);t.exports=function(t,e,n,s){if(!a(t))return t;for(var c=-1,f=(e=i(e,t)).length,l=f-1,h=t;null!=h&&++c<f;){var d=u(e[c]),p=n;if("__proto__"===d||"constructor"===d||"prototype"===d)return t;if(c!=l){var v=h[d];void 0===(p=s?s(v,d,h):void 0)&&(p=a(v)?v:o(e[c+1])?[]:{})}r(h,d,p),h=h[d]}return t}},63989:(t,e,n)=>{var r=n(13503),i=n(35234),o=n(46962),a=i?function(t,e){return i(t,"toString",{configurable:!0,enumerable:!1,value:r(e),writable:!0})}:o;t.exports=a},33065:t=>{t.exports=function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}},67943:t=>{t.exports=function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}},50230:(t,e,n)=>{var r=n(91869),i=n(75010),o=n(80744),a=n(45029),u=r?r.prototype:void 0,s=u?u.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(o(e))return i(e,t)+"";if(a(e))return s?s.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n}},13927:(t,e,n)=>{var r=n(15333),i=/^\s+/;t.exports=function(t){return t?t.slice(0,r(t)+1).replace(i,""):t}},38342:t=>{t.exports=function(t){return function(e){return t(e)}}},29098:(t,e,n)=>{var r=n(98924),i=n(84271),o=n(94874),a=n(1931),u=n(47506),s=n(79679);t.exports=function(t,e,n){var c=-1,f=i,l=t.length,h=!0,d=[],p=d;if(n)h=!1,f=o;else if(l>=200){var v=e?null:u(t);if(v)return s(v);h=!1,f=a,p=new r}else p=e?[]:d;t:for(;++c<l;){var g=t[c],y=e?e(g):g;if(g=n||0!==g?g:0,h&&y==y){for(var m=p.length;m--;)if(p[m]===y)continue t;e&&p.push(y),d.push(g)}else f(p,y,n)||(p!==d&&p.push(y),d.push(g))}return d}},20720:(t,e,n)=>{var r=n(75010);t.exports=function(t,e){return r(e,(function(e){return t[e]}))}},94484:t=>{t.exports=function(t,e,n){for(var r=-1,i=t.length,o=e.length,a={};++r<i;){var u=r<o?e[r]:void 0;n(a,t[r],u)}return a}},1931:t=>{t.exports=function(t,e){return t.has(e)}},11756:(t,e,n)=>{var r=n(46962);t.exports=function(t){return"function"==typeof t?t:r}},1186:(t,e,n)=>{var r=n(80744),i=n(86773),o=n(40493),a=n(44140);t.exports=function(t,e){return r(t)?t:i(t,e)?[t]:o(a(t))}},20188:(t,e,n)=>{var r=n(77945);t.exports=function(t){var e=new t.constructor(t.byteLength);return new r(e).set(new r(t)),e}},32315:(t,e,n)=>{t=n.nmd(t);var r=n(33152),i=e&&!e.nodeType&&e,o=i&&t&&!t.nodeType&&t,a=o&&o.exports===i?r.Buffer:void 0,u=a?a.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var n=t.length,r=u?u(n):new t.constructor(n);return t.copy(r),r}},27984:(t,e,n)=>{var r=n(20188);t.exports=function(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}},78583:t=>{var e=/\w*$/;t.exports=function(t){var n=new t.constructor(t.source,e.exec(t));return n.lastIndex=t.lastIndex,n}},28757:(t,e,n)=>{var r=n(91869),i=r?r.prototype:void 0,o=i?i.valueOf:void 0;t.exports=function(t){return o?Object(o.call(t)):{}}},78358:(t,e,n)=>{var r=n(20188);t.exports=function(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}},83018:(t,e,n)=>{var r=n(45029);t.exports=function(t,e){if(t!==e){var n=void 0!==t,i=null===t,o=t==t,a=r(t),u=void 0!==e,s=null===e,c=e==e,f=r(e);if(!s&&!f&&!a&&t>e||a&&u&&c&&!s&&!f||i&&u&&c||!n&&c||!o)return 1;if(!i&&!a&&!f&&t<e||f&&n&&o&&!i&&!a||s&&n&&o||!u&&o||!c)return-1}return 0}},11249:(t,e,n)=>{var r=n(83018);t.exports=function(t,e,n){for(var i=-1,o=t.criteria,a=e.criteria,u=o.length,s=n.length;++i<u;){var c=r(o[i],a[i]);if(c)return i>=s?c:c*("desc"==n[i]?-1:1)}return t.index-e.index}},47760:t=>{t.exports=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}},95378:(t,e,n)=>{var r=n(60348),i=n(42813);t.exports=function(t,e,n,o){var a=!n;n||(n={});for(var u=-1,s=e.length;++u<s;){var c=e[u],f=o?o(n[c],t[c],c,n,t):void 0;void 0===f&&(f=t[c]),a?i(n,c,f):r(n,c,f)}return n}},15168:(t,e,n)=>{var r=n(95378),i=n(58966);t.exports=function(t,e){return r(t,i(t),e)}},71678:(t,e,n)=>{var r=n(95378),i=n(66817);t.exports=function(t,e){return r(t,i(t),e)}},64218:(t,e,n)=>{var r=n(33152)["__core-js_shared__"];t.exports=r},63323:(t,e,n)=>{var r=n(92918),i=n(8138);t.exports=function(t){return r((function(e,n){var r=-1,o=n.length,a=o>1?n[o-1]:void 0,u=o>2?n[2]:void 0;for(a=t.length>3&&"function"==typeof a?(o--,a):void 0,u&&i(n[0],n[1],u)&&(a=o<3?void 0:a,o=1),e=Object(e);++r<o;){var s=n[r];s&&t(e,s,r,a)}return e}))}},49164:(t,e,n)=>{var r=n(24665);t.exports=function(t,e){return function(n,i){if(null==n)return n;if(!r(n))return t(n,i);for(var o=n.length,a=e?o:-1,u=Object(n);(e?a--:++a<o)&&!1!==i(u[a],a,u););return n}}},78010:t=>{t.exports=function(t){return function(e,n,r){for(var i=-1,o=Object(e),a=r(e),u=a.length;u--;){var s=a[t?u:++i];if(!1===n(o[s],s,o))break}return e}}},19554:(t,e,n)=>{var r=n(95979),i=n(24665),o=n(55451);t.exports=function(t){return function(e,n,a){var u=Object(e);if(!i(e)){var s=r(n,3);e=o(e),n=function(t){return s(u[t],t,u)}}var c=t(e,n,a);return c>-1?u[s?e[c]:c]:void 0}}},76106:(t,e,n)=>{var r=n(36121),i=n(8138),o=n(97341);t.exports=function(t){return function(e,n,a){return a&&"number"!=typeof a&&i(e,n,a)&&(n=a=void 0),e=o(e),void 0===n?(n=e,e=0):n=o(n),a=void 0===a?e<n?1:-1:o(a),r(e,n,a,t)}}},47506:(t,e,n)=>{var r=n(23599),i=n(9958),o=n(79679),a=r&&1/o(new r([,-0]))[1]==1/0?function(t){return new r(t)}:i;t.exports=a},35234:(t,e,n)=>{var r=n(73893),i=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=i},50401:(t,e,n)=>{var r=n(98924),i=n(64045),o=n(1931);t.exports=function(t,e,n,a,u,s){var c=1&n,f=t.length,l=e.length;if(f!=l&&!(c&&l>f))return!1;var h=s.get(t),d=s.get(e);if(h&&d)return h==e&&d==t;var p=-1,v=!0,g=2&n?new r:void 0;for(s.set(t,e),s.set(e,t);++p<f;){var y=t[p],m=e[p];if(a)var b=c?a(m,y,p,e,t,s):a(y,m,p,t,e,s);if(void 0!==b){if(b)continue;v=!1;break}if(g){if(!i(e,(function(t,e){if(!o(g,e)&&(y===t||u(y,t,n,a,s)))return g.push(e)}))){v=!1;break}}else if(y!==m&&!u(y,m,n,a,s)){v=!1;break}}return s.delete(t),s.delete(e),v}},57710:(t,e,n)=>{var r=n(91869),i=n(77945),o=n(43607),a=n(50401),u=n(83383),s=n(79679),c=r?r.prototype:void 0,f=c?c.valueOf:void 0;t.exports=function(t,e,n,r,c,l,h){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!l(new i(t),new i(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var d=u;case"[object Set]":var p=1&r;if(d||(d=s),t.size!=e.size&&!p)return!1;var v=h.get(t);if(v)return v==e;r|=2,h.set(t,e);var g=a(d(t),d(e),r,c,l,h);return h.delete(t),g;case"[object Symbol]":if(f)return f.call(t)==f.call(e)}return!1}},4983:(t,e,n)=>{var r=n(12076),i=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,o,a,u){var s=1&n,c=r(t),f=c.length;if(f!=r(e).length&&!s)return!1;for(var l=f;l--;){var h=c[l];if(!(s?h in e:i.call(e,h)))return!1}var d=u.get(t),p=u.get(e);if(d&&p)return d==e&&p==t;var v=!0;u.set(t,e),u.set(e,t);for(var g=s;++l<f;){var y=t[h=c[l]],m=e[h];if(o)var b=s?o(m,y,h,e,t,u):o(y,m,h,t,e,u);if(!(void 0===b?y===m||a(y,m,n,o,u):b)){v=!1;break}g||(g="constructor"==h)}if(v&&!g){var _=t.constructor,x=e.constructor;_==x||!("constructor"in t)||!("constructor"in e)||"function"==typeof _&&_ instanceof _&&"function"==typeof x&&x instanceof x||(v=!1)}return u.delete(t),u.delete(e),v}},522:(t,e,n)=>{var r=n(40151),i=n(19652),o=n(71152);t.exports=function(t){return o(i(t,void 0,r),t+"")}},37675:(t,e,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;t.exports=r},12076:(t,e,n)=>{var r=n(75635),i=n(58966),o=n(55451);t.exports=function(t){return r(t,o,i)}},22675:(t,e,n)=>{var r=n(75635),i=n(66817),o=n(56730);t.exports=function(t){return r(t,o,i)}},89819:(t,e,n)=>{var r=n(94358);t.exports=function(t,e){var n=t.__data__;return r(e)?n["string"==typeof e?"string":"hash"]:n.map}},10261:(t,e,n)=>{var r=n(88411),i=n(55451);t.exports=function(t){for(var e=i(t),n=e.length;n--;){var o=e[n],a=t[o];e[n]=[o,a,r(a)]}return e}},73893:(t,e,n)=>{var r=n(6367),i=n(49966);t.exports=function(t,e){var n=i(t,e);return r(n)?n:void 0}},49217:(t,e,n)=>{var r=n(31030)(Object.getPrototypeOf,Object);t.exports=r},72533:(t,e,n)=>{var r=n(91869),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,u=r?r.toStringTag:void 0;t.exports=function(t){var e=o.call(t,u),n=t[u];try{t[u]=void 0;var r=!0}catch(t){}var i=a.call(t);return r&&(e?t[u]=n:delete t[u]),i}},58966:(t,e,n)=>{var r=n(86952),i=n(4134),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,u=a?function(t){return null==t?[]:(t=Object(t),r(a(t),(function(e){return o.call(t,e)})))}:i;t.exports=u},66817:(t,e,n)=>{var r=n(57095),i=n(49217),o=n(58966),a=n(4134),u=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)r(e,o(t)),t=i(t);return e}:a;t.exports=u},66139:(t,e,n)=>{var r=n(15584),i=n(40164),o=n(97288),a=n(23599),u=n(26873),s=n(86756),c=n(63256),f="[object Map]",l="[object Promise]",h="[object Set]",d="[object WeakMap]",p="[object DataView]",v=c(r),g=c(i),y=c(o),m=c(a),b=c(u),_=s;(r&&_(new r(new ArrayBuffer(1)))!=p||i&&_(new i)!=f||o&&_(o.resolve())!=l||a&&_(new a)!=h||u&&_(new u)!=d)&&(_=function(t){var e=s(t),n="[object Object]"==e?t.constructor:void 0,r=n?c(n):"";if(r)switch(r){case v:return p;case g:return f;case y:return l;case m:return h;case b:return d}return e}),t.exports=_},49966:t=>{t.exports=function(t,e){return null==t?void 0:t[e]}},63100:(t,e,n)=>{var r=n(1186),i=n(13053),o=n(80744),a=n(70213),u=n(11156),s=n(9171);t.exports=function(t,e,n){for(var c=-1,f=(e=r(e,t)).length,l=!1;++c<f;){var h=s(e[c]);if(!(l=null!=t&&n(t,h)))break;t=t[h]}return l||++c!=f?l:!!(f=null==t?0:t.length)&&u(f)&&a(h,f)&&(o(t)||i(t))}},55015:t=>{var e=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");t.exports=function(t){return e.test(t)}},64696:(t,e,n)=>{var r=n(65294);t.exports=function(){this.__data__=r?r(null):{},this.size=0}},16824:t=>{t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},23476:(t,e,n)=>{var r=n(65294),i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(r){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(e,t)?e[t]:void 0}},63122:(t,e,n)=>{var r=n(65294),i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return r?void 0!==e[t]:i.call(e,t)}},37279:(t,e,n)=>{var r=n(65294);t.exports=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=r&&void 0===e?"__lodash_hash_undefined__":e,this}},79264:t=>{var e=Object.prototype.hasOwnProperty;t.exports=function(t){var n=t.length,r=new t.constructor(n);return n&&"string"==typeof t[0]&&e.call(t,"index")&&(r.index=t.index,r.input=t.input),r}},97541:(t,e,n)=>{var r=n(20188),i=n(27984),o=n(78583),a=n(28757),u=n(78358);t.exports=function(t,e,n){var s=t.constructor;switch(e){case"[object ArrayBuffer]":return r(t);case"[object Boolean]":case"[object Date]":return new s(+t);case"[object DataView]":return i(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return u(t,n);case"[object Map]":case"[object Set]":return new s;case"[object Number]":case"[object String]":return new s(t);case"[object RegExp]":return o(t);case"[object Symbol]":return a(t)}}},4084:(t,e,n)=>{var r=n(35024),i=n(49217),o=n(7975);t.exports=function(t){return"function"!=typeof t.constructor||o(t)?{}:r(i(t))}},88133:(t,e,n)=>{var r=n(91869),i=n(13053),o=n(80744),a=r?r.isConcatSpreadable:void 0;t.exports=function(t){return o(t)||i(t)||!!(a&&t&&t[a])}},70213:t=>{var e=/^(?:0|[1-9]\d*)$/;t.exports=function(t,n){var r=typeof t;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&e.test(t))&&t>-1&&t%1==0&&t<n}},8138:(t,e,n)=>{var r=n(43607),i=n(24665),o=n(70213),a=n(20816);t.exports=function(t,e,n){if(!a(n))return!1;var u=typeof e;return!!("number"==u?i(n)&&o(e,n.length):"string"==u&&e in n)&&r(n[e],t)}},86773:(t,e,n)=>{var r=n(80744),i=n(45029),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;t.exports=function(t,e){if(r(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!i(t))||a.test(t)||!o.test(t)||null!=e&&t in Object(e)}},94358:t=>{t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},89379:(t,e,n)=>{var r,i=n(64218),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(t){return!!o&&o in t}},7975:t=>{var e=Object.prototype;t.exports=function(t){var n=t&&t.constructor;return t===("function"==typeof n&&n.prototype||e)}},88411:(t,e,n)=>{var r=n(20816);t.exports=function(t){return t==t&&!r(t)}},34251:t=>{t.exports=function(){this.__data__=[],this.size=0}},24968:(t,e,n)=>{var r=n(67971),i=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=r(e,t);return!(n<0||(n==e.length-1?e.pop():i.call(e,n,1),--this.size,0))}},28290:(t,e,n)=>{var r=n(67971);t.exports=function(t){var e=this.__data__,n=r(e,t);return n<0?void 0:e[n][1]}},88068:(t,e,n)=>{var r=n(67971);t.exports=function(t){return r(this.__data__,t)>-1}},54238:(t,e,n)=>{var r=n(67971);t.exports=function(t,e){var n=this.__data__,i=r(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}},35365:(t,e,n)=>{var r=n(76414),i=n(99746),o=n(40164);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},63765:(t,e,n)=>{var r=n(89819);t.exports=function(t){var e=r(this,t).delete(t);return this.size-=e?1:0,e}},12608:(t,e,n)=>{var r=n(89819);t.exports=function(t){return r(this,t).get(t)}},10203:(t,e,n)=>{var r=n(89819);t.exports=function(t){return r(this,t).has(t)}},11298:(t,e,n)=>{var r=n(89819);t.exports=function(t,e){var n=r(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}},83383:t=>{t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}},24122:t=>{t.exports=function(t,e){return function(n){return null!=n&&n[t]===e&&(void 0!==e||t in Object(n))}}},26332:(t,e,n)=>{var r=n(52858);t.exports=function(t){var e=r(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}},65294:(t,e,n)=>{var r=n(73893)(Object,"create");t.exports=r},23730:(t,e,n)=>{var r=n(31030)(Object.keys,Object);t.exports=r},97817:t=>{t.exports=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}},52495:(t,e,n)=>{t=n.nmd(t);var r=n(37675),i=e&&!e.nodeType&&e,o=i&&t&&!t.nodeType&&t,a=o&&o.exports===i&&r.process,u=function(){try{return o&&o.require&&o.require("util").types||a&&a.binding&&a.binding("util")}catch(t){}}();t.exports=u},74702:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},31030:t=>{t.exports=function(t,e){return function(n){return t(e(n))}}},19652:(t,e,n)=>{var r=n(79628),i=Math.max;t.exports=function(t,e,n){return e=i(void 0===e?t.length-1:e,0),function(){for(var o=arguments,a=-1,u=i(o.length-e,0),s=Array(u);++a<u;)s[a]=o[e+a];a=-1;for(var c=Array(e+1);++a<e;)c[a]=o[a];return c[e]=n(s),r(t,this,c)}}},33152:(t,e,n)=>{var r=n(37675),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();t.exports=o},47052:t=>{t.exports=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}},34776:t=>{t.exports=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this}},40393:t=>{t.exports=function(t){return this.__data__.has(t)}},79679:t=>{t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}},71152:(t,e,n)=>{var r=n(63989),i=n(78437)(r);t.exports=i},78437:t=>{var e=Date.now;t.exports=function(t){var n=0,r=0;return function(){var i=e(),o=16-(i-r);if(r=i,o>0){if(++n>=800)return arguments[0]}else n=0;return t.apply(void 0,arguments)}}},31119:(t,e,n)=>{var r=n(99746);t.exports=function(){this.__data__=new r,this.size=0}},64399:t=>{t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},81897:t=>{t.exports=function(t){return this.__data__.get(t)}},90558:t=>{t.exports=function(t){return this.__data__.has(t)}},64841:(t,e,n)=>{var r=n(99746),i=n(40164),o=n(52166);t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([t,e]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(t,e),this.size=n.size,this}},49237:t=>{t.exports=function(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}},29405:(t,e,n)=>{var r=n(26539),i=n(55015),o=n(60844);t.exports=function(t){return i(t)?o(t):r(t)}},40493:(t,e,n)=>{var r=n(26332),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,a=r((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(i,(function(t,n,r,i){e.push(r?i.replace(o,"$1"):n||t)})),e}));t.exports=a},9171:(t,e,n)=>{var r=n(45029);t.exports=function(t){if("string"==typeof t||r(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}},63256:t=>{var e=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return e.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},15333:t=>{var e=/\s/;t.exports=function(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n}},60844:t=>{var e="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",n="\\ud83c[\\udffb-\\udfff]",r="[^\\ud800-\\udfff]",i="(?:\\ud83c[\\udde6-\\uddff]){2}",o="[\\ud800-\\udbff][\\udc00-\\udfff]",a="(?:"+e+"|"+n+")?",u="[\\ufe0e\\ufe0f]?",s=u+a+"(?:\\u200d(?:"+[r,i,o].join("|")+")"+u+a+")*",c="(?:"+[r+e+"?",e,i,o,"[\\ud800-\\udfff]"].join("|")+")",f=RegExp(n+"(?="+n+")|"+c+s,"g");t.exports=function(t){for(var e=f.lastIndex=0;f.test(t);)++e;return e}},76833:(t,e,n)=>{var r=n(99045);t.exports=function(t){return r(t,4)}},20250:(t,e,n)=>{var r=n(99045);t.exports=function(t){return r(t,5)}},13503:t=>{t.exports=function(t){return function(){return t}}},28548:(t,e,n)=>{var r=n(92918),i=n(43607),o=n(8138),a=n(56730),u=Object.prototype,s=u.hasOwnProperty,c=r((function(t,e){t=Object(t);var n=-1,r=e.length,c=r>2?e[2]:void 0;for(c&&o(e[0],e[1],c)&&(r=1);++n<r;)for(var f=e[n],l=a(f),h=-1,d=l.length;++h<d;){var p=l[h],v=t[p];(void 0===v||i(v,u[p])&&!s.call(t,p))&&(t[p]=f[p])}return t}));t.exports=c},76934:(t,e,n)=>{t.exports=n(99204)},43607:t=>{t.exports=function(t,e){return t===e||t!=t&&e!=e}},64725:(t,e,n)=>{var r=n(86952),i=n(32872),o=n(95979),a=n(80744);t.exports=function(t,e){return(a(t)?r:i)(t,o(e,3))}},79785:(t,e,n)=>{var r=n(19554)(n(9991));t.exports=r},9991:(t,e,n)=>{var r=n(51533),i=n(95979),o=n(12824),a=Math.max;t.exports=function(t,e,n){var u=null==t?0:t.length;if(!u)return-1;var s=null==n?0:o(n);return s<0&&(s=a(u+s,0)),r(t,i(e,3),s)}},40151:(t,e,n)=>{var r=n(9256);t.exports=function(t){return null!=t&&t.length?r(t,1):[]}},99204:(t,e,n)=>{var r=n(74809),i=n(44107),o=n(11756),a=n(80744);t.exports=function(t,e){return(a(t)?r:i)(t,o(e))}},23190:(t,e,n)=>{var r=n(14018),i=n(11756),o=n(56730);t.exports=function(t,e){return null==t?t:r(t,i(e),o)}},44231:(t,e,n)=>{var r=n(89147);t.exports=function(t,e,n){var i=null==t?void 0:r(t,e);return void 0===i?n:i}},99946:(t,e,n)=>{var r=n(3251),i=n(63100);t.exports=function(t,e){return null!=t&&i(t,e,r)}},37879:(t,e,n)=>{var r=n(62348),i=n(63100);t.exports=function(t,e){return null!=t&&i(t,e,r)}},46962:t=>{t.exports=function(t){return t}},13053:(t,e,n)=>{var r=n(4977),i=n(93913),o=Object.prototype,a=o.hasOwnProperty,u=o.propertyIsEnumerable,s=r(function(){return arguments}())?r:function(t){return i(t)&&a.call(t,"callee")&&!u.call(t,"callee")};t.exports=s},80744:t=>{var e=Array.isArray;t.exports=e},24665:(t,e,n)=>{var r=n(9363),i=n(11156);t.exports=function(t){return null!=t&&i(t.length)&&!r(t)}},41590:(t,e,n)=>{var r=n(24665),i=n(93913);t.exports=function(t){return i(t)&&r(t)}},57835:(t,e,n)=>{t=n.nmd(t);var r=n(33152),i=n(55950),o=e&&!e.nodeType&&e,a=o&&t&&!t.nodeType&&t,u=a&&a.exports===o?r.Buffer:void 0,s=(u?u.isBuffer:void 0)||i;t.exports=s},61627:(t,e,n)=>{var r=n(6019),i=n(66139),o=n(13053),a=n(80744),u=n(24665),s=n(57835),c=n(7975),f=n(18397),l=Object.prototype.hasOwnProperty;t.exports=function(t){if(null==t)return!0;if(u(t)&&(a(t)||"string"==typeof t||"function"==typeof t.splice||s(t)||f(t)||o(t)))return!t.length;var e=i(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(c(t))return!r(t).length;for(var n in t)if(l.call(t,n))return!1;return!0}},9363:(t,e,n)=>{var r=n(86756),i=n(20816);t.exports=function(t){if(!i(t))return!1;var e=r(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},11156:t=>{t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},41626:(t,e,n)=>{var r=n(55005),i=n(38342),o=n(52495),a=o&&o.isMap,u=a?i(a):r;t.exports=u},20816:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},93913:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},19308:(t,e,n)=>{var r=n(86756),i=n(49217),o=n(93913),a=Function.prototype,u=Object.prototype,s=a.toString,c=u.hasOwnProperty,f=s.call(Object);t.exports=function(t){if(!o(t)||"[object Object]"!=r(t))return!1;var e=i(t);if(null===e)return!0;var n=c.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&s.call(n)==f}},65226:(t,e,n)=>{var r=n(38652),i=n(38342),o=n(52495),a=o&&o.isSet,u=a?i(a):r;t.exports=u},7941:(t,e,n)=>{var r=n(86756),i=n(80744),o=n(93913);t.exports=function(t){return"string"==typeof t||!i(t)&&o(t)&&"[object String]"==r(t)}},45029:(t,e,n)=>{var r=n(86756),i=n(93913);t.exports=function(t){return"symbol"==typeof t||i(t)&&"[object Symbol]"==r(t)}},18397:(t,e,n)=>{var r=n(10766),i=n(38342),o=n(52495),a=o&&o.isTypedArray,u=a?i(a):r;t.exports=u},16513:t=>{t.exports=function(t){return void 0===t}},55451:(t,e,n)=>{var r=n(63333),i=n(6019),o=n(24665);t.exports=function(t){return o(t)?r(t):i(t)}},56730:(t,e,n)=>{var r=n(63333),i=n(33988),o=n(24665);t.exports=function(t){return o(t)?r(t,!0):i(t)}},10611:t=>{t.exports=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}},9924:(t,e,n)=>{var r=n(75010),i=n(95979),o=n(65487),a=n(80744);t.exports=function(t,e){return(a(t)?r:o)(t,i(e,3))}},70642:(t,e,n)=>{var r=n(42813),i=n(1585),o=n(95979);t.exports=function(t,e){var n={};return e=o(e,3),i(t,(function(t,i,o){r(n,i,e(t,i,o))})),n}},95987:(t,e,n)=>{var r=n(2659),i=n(40302),o=n(46962);t.exports=function(t){return t&&t.length?r(t,o,i):void 0}},52858:(t,e,n)=>{var r=n(52166);function i(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");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(i.Cache||r),n}i.Cache=r,t.exports=i},28440:(t,e,n)=>{var r=n(50097),i=n(63323)((function(t,e,n){r(t,e,n)}));t.exports=i},73376:(t,e,n)=>{var r=n(2659),i=n(93757),o=n(46962);t.exports=function(t){return t&&t.length?r(t,o,i):void 0}},83296:(t,e,n)=>{var r=n(2659),i=n(95979),o=n(93757);t.exports=function(t,e){return t&&t.length?r(t,i(e,2),o):void 0}},9958:t=>{t.exports=function(){}},5795:(t,e,n)=>{var r=n(33152);t.exports=function(){return r.Date.now()}},89409:(t,e,n)=>{var r=n(88832),i=n(522)((function(t,e){return null==t?{}:r(t,e)}));t.exports=i},35769:(t,e,n)=>{var r=n(22310),i=n(96916),o=n(86773),a=n(9171);t.exports=function(t){return o(t)?r(a(t)):i(t)}},60859:(t,e,n)=>{var r=n(76106)();t.exports=r},16473:(t,e,n)=>{var r=n(99861),i=n(44107),o=n(95979),a=n(30739),u=n(80744);t.exports=function(t,e,n){var s=u(t)?r:a,c=arguments.length<3;return s(t,o(e,4),n,c,i)}},40617:(t,e,n)=>{var r=n(6019),i=n(66139),o=n(24665),a=n(7941),u=n(29405);t.exports=function(t){if(null==t)return 0;if(o(t))return a(t)?u(t):t.length;var e=i(t);return"[object Map]"==e||"[object Set]"==e?t.size:r(t).length}},351:(t,e,n)=>{var r=n(9256),i=n(58506),o=n(92918),a=n(8138),u=o((function(t,e){if(null==t)return[];var n=e.length;return n>1&&a(t,e[0],e[1])?e=[]:n>2&&a(e[0],e[1],e[2])&&(e=[e[0]]),i(t,r(e,1),[])}));t.exports=u},4134:t=>{t.exports=function(){return[]}},55950:t=>{t.exports=function(){return!1}},97341:(t,e,n)=>{var r=n(20168);t.exports=function(t){return t?Infinity===(t=r(t))||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}},12824:(t,e,n)=>{var r=n(97341);t.exports=function(t){var e=r(t),n=e%1;return e==e?n?e-n:e:0}},20168:(t,e,n)=>{var r=n(13927),i=n(20816),o=n(45029),a=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,s=/^0o[0-7]+$/i,c=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(o(t))return NaN;if(i(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=r(t);var n=u.test(t);return n||s.test(t)?c(t.slice(2),n?2:8):a.test(t)?NaN:+t}},20480:(t,e,n)=>{var r=n(95378),i=n(56730);t.exports=function(t){return r(t,i(t))}},44140:(t,e,n)=>{var r=n(50230);t.exports=function(t){return null==t?"":r(t)}},91116:(t,e,n)=>{var r=n(74809),i=n(35024),o=n(1585),a=n(95979),u=n(49217),s=n(80744),c=n(57835),f=n(9363),l=n(20816),h=n(18397);t.exports=function(t,e,n){var d=s(t),p=d||c(t)||h(t);if(e=a(e,4),null==n){var v=t&&t.constructor;n=p?d?new v:[]:l(t)&&f(v)?i(u(t)):{}}return(p?r:o)(t,(function(t,r,i){return e(n,t,r,i)})),n}},44065:(t,e,n)=>{var r=n(9256),i=n(92918),o=n(29098),a=n(41590),u=i((function(t){return o(r(t,1,a,!0))}));t.exports=u},95708:(t,e,n)=>{var r=n(44140),i=0;t.exports=function(t){var e=++i;return r(t)+e}},81229:(t,e,n)=>{var r=n(20720),i=n(55451);t.exports=function(t){return null==t?[]:r(t,i(t))}},65441:(t,e,n)=>{var r=n(60348),i=n(94484);t.exports=function(t,e){return i(t||[],e||[],r)}},91739:(t,e,n)=>{var r=n(45229),i=n(96765),o=n(95927),a=n(24186),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}},78892:(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 M(Object.create(null))}:a?function(){return M({__proto__:null})}:function(){return M({})},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=P(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=P(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=P(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(!C(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(C(n)&&!A(i=n.call(t)))return i;if(C(r=t.valueOf)&&!A(i=r.call(t)))return i}else{var r;if(C(r=t.valueOf)&&!A(i=r.call(t)))return i;var i,o=t.toString;if(C(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 D(t){return Array.isArray?Array.isArray(t):t instanceof Object?t instanceof Array:"[object Array]"===Object.prototype.toString.call(t)}function C(t){return"function"==typeof t}function N(t){return"function"==typeof t}function k(t,e){var n=t[e];if(null!=n){if(!C(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 P(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 M(t){return t.__=void 0,delete t.__,t}t("decorate",(function(t,e,n,r){if(E(n)){if(!D(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(!D(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={}))},10405: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 D(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=_&&_(_(C([])));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 D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function C(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=C,D.prototype={constructor:D,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:C(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)}},96377: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 D(t){return"["+I(t).join("][")+"]"}var C={DynamicVariable:A,define:function(t,e){return new A(t,D(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:D},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 P(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 M(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=M(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 j=3553,F=6408,B=5126,z=36160;function V(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 W=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,Q=X.shape,J=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,Dt=36193,Ct=33776,Nt=33777,kt=33778,Rt=33779,Ot=5121,Pt=5123,Mt=5125,Gt=5126,Lt=33071,Ut=9728,jt=9984,Ft=9987,Bt=4352,zt=33984,Vt=[jt,9986,9985,Ft],Wt=[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"),Qt=Ht("HTMLVideoElement"),Jt=Object.keys(Y).concat([qt,Yt,Kt,Zt,$t,Qt]),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 Jt.indexOf(e)>=0||ne(t)||re(t)||V(t)}function se(t){return 0|Y[Object.prototype.toString.call(t)]}function ce(t,e){return U.allocType(t.type===Dt?Gt:t.type,e)}function fe(t,e){t.type===Dt?(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":Bt,"dont care":Bt,nice:4354,fast:4353},f={repeat:10497,clamp:Lt,mirror:33648},l={nearest:Ut,linear:9729},h=e({mipmap:Ft,"nearest mipmap nearest":jt,"linear mipmap nearest":9985,"nearest mipmap linear":9986,"linear mipmap linear":Ft},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"]=Dt),r.webgl_depth_texture&&(e(v,{depth:St,"depth stencil":At}),e(p,{uint16:Pt,uint32:Mt,"depth stencil":34042})),r.webgl_compressed_texture_s3tc&&e(g,{"rgb s3tc dxt1":Ct,"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 D(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!==Wt[t.format]&&(t.format=t.internalformat=Wt[t.channels]):c&&s&&E(t.channels===Xt[t.format],"number of channels inconsistent with specified format")}}function C(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"),D(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 Pt:case Mt:case Gt:var r=U.allocType(t.type,n);r.set(e),t.data=r;break;case Dt: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(V(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=Wt[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)===Qt}(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=Wt[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===Dt&&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;C(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;C(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 P=[];function M(){return P.pop()||new N}function G(t){t.needsFree&&U.freeType(t.data),N.call(t),P.push(t)}function L(){T.call(this),this.genMipmaps=!1,this.mipmapHint=Bt,this.mipmask=0,this.images=Array(16)}function j(t,e,n){var r=t.images[0]=M();t.mipmask=1,r.width=t.width=e,r.height=t.height=n,r.channels=t.channels=4}function F(t,e){var n=null;if(ue(e))I(n=t.images[0]=M(),t),k(n,e),t.mipmask=1;else if(D(t,e),Array.isArray(e.mipmap))for(var r=e.mipmap,i=0;i<r.length;++i)I(n=t.images[i]=M(),t),n.width>>=i,n.height>>=i,k(n,r[i]),t.mipmask|=1<<i;else I(n=t.images[0]=M(),t),k(n,e),t.mipmask=1;I(t,t.images[0]),!t.compressed||t.internalformat!==Ct&&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 B(t,e){for(var n=t.images,r=0;r<n.length;++r){if(!n[r])return;R(n[r],e,r)}}var z=[];function H(){var t=z.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;z.push(t)}function Y(){this.minFilter=Ut,this.magFilter=Ut,this.wrapS=Lt,this.wrapT=Lt,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=Bt}function K(t,e){if("min"in e){var n=e.min;E.parameter(n,h),t.minFilter=h[n],Vt.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=jt)}}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,Q={},J=i.maxTextureUnits,tt=Array(J).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(zt),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(zt+r),n.bindTexture(i,null),tt[r]=null),n.deleteTexture(e),t.texture=null,t.params=null,t.pixels=null,t.refCount=0,delete Q[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<J;++r){var i=tt[r];if(i){if(i.bindCount>0)continue;i.unit=-1}tt[r]=t,e=r;break}e>=J&&E.raise("insufficient number of texture units"),s.profile&&u.maxTextureUnits<e+1&&(u.maxTextureUnits=e+1),t.unit=e,n.activeTexture(zt+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(Q).forEach((function(e){t+=Q[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?j(a,0|t,"number"==typeof e?0|e:0|t):t?(E.type(t,"object","invalid arguments to regl.texture"),K(n,t),F(a,t)):j(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),B(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 Q[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=M();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);Q[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)F(l[0],t),F(l[1],e),F(l[2],n),F(l[3],r),F(l[4],o),F(l[5],a);else if(K(c,t),D(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),F(l[u],d[u])}else for(u=0;u<6;++u)F(l[u],t);else E.raise("invalid arguments to cube map");else{var p=0|t||1;for(u=0;u<6;++u)j(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)B(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=M();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<J;++t)n.activeTexture(zt+t),n.bindTexture(vt,null),tt[t]=null;W(Q).forEach(it),u.cubeCount=0,u.textureCount=0},getTexture:function(t){return null},restore:function(){for(var t=0;t<J;++t){var e=tt[t];e&&(e.bindCount=0,e.unit=-1,tt[t]=null)}W(Q).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<J;++t){var e=tt[t];e&&(e.bindCount=0,e.unit=-1,tt[t]=null),n.activeTexture(zt+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,De=5126;function Ce(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===De,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"),c===De&&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===De&&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===De&&(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",Pe="blend.enable",Me="blend.color",Ge="blend.equation",Le="blend.func",Ue="depth.enable",je="depth.func",Fe="depth.range",Be="depth.mask",ze="colorMask",Ve="cull.enable",We="cull.face",Xe="frontFace",He="lineWidth",qe="polygonOffset.enable",Ye="polygonOffset.offset",Ke="sample.alpha",Ze="sample.enable",$e="sample.coverage",Qe="stencil.enable",Je="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,Dn=35666,Cn=5124,Nn=35667,kn=35668,Rn=35669,On=35670,Pn=35671,Mn=35672,Gn=35673,Ln=35674,Un=35675,jn=35676,Fn=35678,Bn=35680,zn=1028,Vn=1029,Wn=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:Wn};function Qn(e){return Array.isArray(e)||t(e)||V(e)}function Jn(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 D(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(Pe,3042),D(Me,"blendColor",[0,0,0,0]),D(Ge,"blendEquationSeparate",[32774,32774]),D(Le,"blendFuncSeparate",[1,0,1,0]),I(Ue,2929,!0),D(je,"depthFunc",513),D(Fe,"depthRange",[0,1]),D(Be,"depthMask",!0),D(ze,ze,[!0,!0,!0,!0]),I(Ve,2884),D(We,"cullFace",Vn),D(Xe,Xe,Wn),D(He,He,1),I(qe,32823),D(Ye,"polygonOffset",[0,0]),I(Ke,32926),I(Ze,32928),D($e,"sampleCoverage",[1,!1]),I(Qe,2960),D(Je,"stencilMask",-1),D(tn,"stencilFunc",[519,0,-1]),D(en,"stencilOpSeparate",[zn,Xn,Xn,Xn]),D(nn,"stencilOpSeparate",[Vn,Xn,Xn,Xn]),I(rn,3089),D(on,"scissor",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]),D(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:Qn},k={primTypes:ot,compareFuncs:Yn,blendFuncs:Hn,blendEquations:y,stencilOps:Kn,glTypes:K,orientationType:$n};E.optional((function(){N.isArrayLike=dt})),b&&(k.backBuffer=[Vn],k.drawBuffer=M(i.maxDrawbuffers,(function(t){return 0===t?[0]:M(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 P(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];Qn(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 Ve:case Pe:case Oe:case Qe:case Ue:case rn:case qe:case Ke:case Ze:case Be: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 je: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 Fe: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 Me:return u((function(t){return E.command(dt(t)&&4===t.length,"blend.color must be a 4d array",e.commandStr),M(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")})),M(4,(function(t){return e.def("+",n,"[",t,"]")}))}));case Je: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?Vn:zn,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?Vn:zn,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 We:return u((function(t){var n=0;return"front"===t?n=zn:"back"===t&&(n=Vn),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"?',zn,":",Vn)}));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:'+Wn)}));case ze: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")})),M(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 D=Object.keys(S).length>0,C={framebuffer:b,draw:x,shader:A,state:S,dirty:D,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(C.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),C.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("[",M(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),C.drawVAO=C.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),!C.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));C.drawVAO=new tr(null,null,null,(function(t,e){return t.link(R)})),C.useVAO=!0}}return v?C.useVAO=!0:C.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(Qn(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=Qn(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),C.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),C}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=M(_[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 j(t,e,n,r){var i=t.shared,o=t.current,a=i.current,u=i.gl;Jn(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 F(t,e){m&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function B(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 z(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 Pn:return 2;case In:case kn:case Mn:return 3;case Dn:case Rn:case Gn:return 4;default:return 1}}(r.info.type),a)}))}function V(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===Fn||d===Bn){E.command("function"==typeof g&&(d===Fn&&("texture2d"===g._reglType||"framebuffer"===g._reglType)||d===Bn&&("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===jn){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===jn&&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===jn&&(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 Dn: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 Cn:E.commandType(g,"number","uniform "+h,t.commandStr),a="1i";break;case Pn:case Nn:E.command(dt(g)&&2===g.length,"uniform "+h,t.commandStr),a="2i";break;case Mn: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===Fn?(E(!Array.isArray(f),"must specify a scalar prop for textures"),e("if(",f,"&&",f,'._reglType==="framebuffer"){',f,"=",f,".color[0];","}")):d===Bn&&(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 Cn:case An:r("number");break;case Nn:case Tn:case Pn:i(2);break;case kn:case In:case Mn:i(3);break;case Rn:case Dn:case Ln:case Gn:i(4);break;case On:r("boolean");break;case Un:i(9);break;case jn:i(16);break;case Fn:o(3553);break;case Bn:o(34067)}}));var _=1;switch(d){case Fn:case Bn:var x=e.def(f,"._texture");e(s,".uniform1i(",v,",",x,".bind());"),e.exit(x,".unbind();");continue;case Cn:case On:a="1i";break;case Nn:case Pn:a="2i",_=2;break;case kn:case Mn: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 Dn:a="4f",_=4;break;case Ln:a="Matrix2fv";break;case Un:a="Matrix3fv";break;case jn: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,(",M(w,(function(t){return S+"["+t+"]="+f[t]})),",",S,")"):e("false,(Array.isArray(",f,")||",f," instanceof Float32Array)?",f,":(",M(w,(function(t){return S+"["+t+"]="+f+"["+t+"]"})),",",S,")")}else _>1?e(M(_,(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 W(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){F(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);"),z(t,e,n,r.attributes,(function(){return!0}))),V(t,e,n,r.uniforms,(function(){return!0})),W(t,e,e,n)}function q(t,e,n,r){function i(){return!0}t.batchId="a1",F(t,e),z(t,e,n,r.attributes,i),V(t,e,n,r.uniforms,i),W(t,e,e,n)}function Y(t,e,n,r){F(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),j(t,s,n.state,c),n.profile&&c(n.profile)&&B(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);"),z(t,u,n,r.attributes,f),z(t,s,n,r.attributes,c)),V(t,u,n,r.uniforms,f),V(t,s,n,r.uniforms,c),W(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(C.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(C.isDynamic(n)){"function"==typeof n&&(n=r[e]=C.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 C.DynamicVariable(4,{thisDep:a,contextDep:u,propDep:s,ref:c,append:function(t,e){o.forEach((function(n){var i=r[n];if(C.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(M(d,(function(t){return i+"["+t+"]"})),");",M(d,(function(t){return a+"["+t+"]="+i+"["+t+"];"})).join("")),e("if(",M(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=P(t,r,i,o,u);return function(t,e){var n=t.proc("draw",1);F(t,n),G(t,n,e.context),L(t,n,e.framebuffer),U(t,n,e),j(t,n,e.state),B(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),Jn(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)})),B(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",F(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),j(t,n,e.state,(function(t){return!u(t)})),e.profile&&u(e.profile)||B(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=P(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(j,a),t.texImage2D(j,0,F,1,1,0,F,B,null);var u=t.createFramebuffer();if(t.bindFramebuffer(z,u),t.framebufferTexture2D(z,36064,j,a,0),t.bindTexture(j,null),36053!==t.checkFramebufferStatus(z))o=!1;else{t.viewport(0,0,1,1),t.clearColor(1,0,0,1),t.clear(16384);var s=U.allocType(B,4);t.readPixels(0,0,1,1,F,B,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,F,3,3,0,F,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=J,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=Q(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(V(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=J,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)||V(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)||V(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||J,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=Q(e);var a=$(e,r,h.dtype);p(a,i),U.freeType(a)}else E.raise("invalid buffer data")}else if(V(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(){W(a).forEach(l),s.forEach(l)},getBuffer:function(t){return t&&t._buffer instanceof u?t._buffer:null},restore:function(){W(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()&&W(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)||V(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(){W(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)&&(!V(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)||V(e)?n=e:(E.type(e,"object","invalid arguments for elements"),"data"in e&&(n=e.data,E(Array.isArray(n)||t(n)||V(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(){W(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);W(o).forEach(e),o={},W(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(){W(s).forEach(f)},restore:function(){W(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,D=null,C=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:(D=k.stencil,p=!1)),"depthStencil"in k&&("boolean"==typeof k.depthStencil?p=m=k.depthStencil:(C=k.depthStencil,p=!1,m=!1))}else a=h=1;var O=null,P=null,M=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?P=v(I):p&&!m&&(P=g(a,h,N,"depth","uint32")),D?M=v(D):m&&!p&&(M=g(a,h,!1,"stencil","uint8")),C?G=v(C):!I&&!D&&m&&p&&(G=g(a,h,N,"depth stencil","depth stencil")),E(!!I+!!D+!!C<=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(P,a,h),E(!P||P.texture&&6402===P.texture._texture.format||P.renderbuffer&&33189===P.renderbuffer._renderbuffer.format,"invalid depth attachment for framebuffer object"),d(M,a,h),E(!M||M.renderbuffer&&36168===M.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=P,o.stencilAttachment=M,o.depthStencilAttachment=G,l.color=O.map(y),l.depth=y(P),l.stencil=y(M),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(){W(_).forEach(S)},restore:function(){u.cur=null,u.next=null,u.dirty=!0,W(_).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),D=Ce(i,T,I.procs.poll,y,o,h,m),R=I.next,O=i.canvas,M=[],G=[],L=[],X=[r.onDestroy],H=null;function q(){if(0===M.length)return d&&d.update(),void(H=null);H=N.next(q),mt();for(var t=M.length-1;t>=0;--t){var e=M[t];e&&e(y,null,0)}i.flush(),d&&d.update()}function Y(){!H&&M.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(C.isDynamic(o))r[i]=C.unbox(o,i);else{if(e&&Array.isArray(o))for(var a=0;a<o.length;++a)if(C.isDynamic(o[a]))return void(r[i]=C.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:C.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"),M.push(t),Y(),{cancel:function(){var e=cr(M,t);E(e>=0,"cannot cancel a frame twice"),M[e]=function t(){var e=cr(M,t);M[e]=M[M.length-1],M.length-=1,M.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:C.define.bind(null,1),context:C.define.bind(null,2),this:C.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:D,destroy:function(){M.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(49216);var t,e=(t=n(72680))&&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:()=>Rt,ComboForceLayout:()=>ol,ConcentricLayout:()=>ve,DagreLayout:()=>Gt,ForceAtlas2Layout:()=>ll,ForceLayout:()=>Dt,FruchtermanGPULayout:()=>Jf,FruchtermanLayout:()=>be,GForceGPULayout:()=>rl,GForceLayout:()=>k,GridLayout:()=>T,Layout:()=>hl,Layouts:()=>dl,MDSLayout:()=>ye,RadialLayout:()=>de,RandomLayout:()=>D,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)},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)}}(),D=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),C=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 C(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&&"undefined"!=typeof window)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{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 P(t){return t[0]}function M(t){return t[1]}function G(t,e,n){var r=new L(null==e?P:e,null==n?M: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 j=G.prototype=L.prototype;function F(t){return function(){return t}}function B(t){return 1e-6*(t()-.5)}j.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},j.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)},j.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},j.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},j.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},j.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]]},j.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},j.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)},j.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},j.root=function(){return this._root},j.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},j.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},j.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},j.x=function(t){return arguments.length?(this._x=t,this):this._x},j.y=function(t){return arguments.length?(this._y=t,this):this._y};var z={value:()=>{}};function V(){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 W(r)}function W(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]=z,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}W.prototype=V.prototype={constructor:W,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 W(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=V;var K,Z,$=0,Q=0,J=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,$=Q=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){$||(Q&&(Q=clearTimeout(Q)),t-et>24?(t<1/0&&(Q=setTimeout(ct,t-rt.now()-nt)),J&&(J=clearInterval(J))):(J||(tt=rt.now(),J=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=F(-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=B(n))*l),0===h&&(p+=(h=B(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=B(n))*l),0===h&&(p+=(h=B(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:F(+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){return t.index}function bt(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}function _t(t){var e,n,r,i,o,a,u=mt,s=function(t){return 1/Math.min(i[t.source.index],i[t.target.index])},c=F(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||B(a),d=l.y+l.vy-c.y-c.vy||B(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=bt(l,s.source)),"object"!=typeof s.target&&(s.target=bt(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:F(+t),d(),l):s},l.distance=function(t){return arguments.length?(c="function"==typeof t?t:F(+t),p(),l):c},l}function xt(t){return t.x+t.vx}function wt(t){return t.y+t.vy}function Et(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,xt,wt).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=B(r))*v),0===g&&(y+=(g=B(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=F(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:F(+e),s(),a):t},a}function St(t){var e,n,r,i=F(.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=F(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:F(+t),a(),o):i},o.x=function(e){return arguments.length?(t="function"==typeof e?e:F(+e),a(),o):t},o}function At(t){var e,n,r,i=F(.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=F(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:F(+t),a(),o):i},o.y=function(e){return arguments.length?(t="function"==typeof e?e:F(+e),a(),o):t},o}var Tt="GPU_LAYOUT_END",It=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 It(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=_t().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",St(l).strength(.1)).force("y",At(h).strength(.1)).force("collide",Et((function(t){return t.r})).iterations(4)).force("charge",yt().strength(i)).force("links",_t(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",function(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}(e.center[0],e.center[1])).force("charge",s).alpha(u).alphaDecay(a).alphaMin(o),e.preventOverlap&&e.overlapProcess(i),r){var f=_t().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&&!Ct()&&(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",Et(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 Ct(){return"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope}var Nt=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 kt(t,e){var n=t.degree,r=e.degree;return n<r?-1:n>r?1:0}var Rt=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 Nt(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(kt),e},e.prototype.getType=function(){return"circular"},e}(t),Ot=n(79012),Pt=n.n(Ot),Mt=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)}}(),Gt=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.keepNodeOrder=!1,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 Mt(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;if(n){var s,c=e.edges||[],f=new(Pt().graphlib.Graph)({multigraph:!0,compound:!0});s=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 h=Lt(e.nodesepFunc,e.nodesep,50),p=Lt(e.ranksepFunc,e.ranksep,50);"LR"!==i&&"RL"!==i||(h=Lt(e.ranksepFunc,e.ranksep,50),p=Lt(e.nodesepFunc,e.nodesep,50)),f.setDefaultEdgeLabel((function(){return{}})),f.setGraph(e);var v={};n.filter((function(t){return!1!==t.layout})).forEach((function(e){var n=s(e),r=p(e),i=h(e),o=n[0]+2*i,u=n[1]+2*r,c=e.layer;a(c)?f.setNode(e.id,{width:o,height:u,layer:c}):f.setNode(e.id,{width:o,height:u}),t.sortByCombo&&e.comboId&&(v[e.comboId]||(v[e.comboId]=!0,f.setNode(e.comboId,{})),f.setParent(e.id,e.comboId))})),this.sortByCombo&&u&&u.forEach((function(t){t.parentId&&(v[t.parentId]||(v[t.parentId]=!0,f.setNode(t.parentId,{})),f.setParent(t.id,t.parentId))})),c.forEach((function(e){var n=d(e,"source"),r=d(e,"target");t.layoutNode(n)&&t.layoutNode(r)&&f.setEdge(n,r,{weight:e.weight||1})}));var g,y=void 0;return e.preset&&(y=new(Pt().graphlib.Graph)({multigraph:!0,compound:!0}),e.preset.nodes.forEach((function(t){null==y||y.setNode(t.id,t)}))),Pt().layout(f,{prevGraph:y,edgeLabelSpace:e.edgeLabelSpace,keepNodeOrder:e.keepNodeOrder,nodeOrder:e.nodeOrder}),f.nodes().forEach((function(t){g=f.node(t);var e=n.findIndex((function(e){return e.id===t}));n[e]&&(n[e].x=g.x,n[e].y=g.y,n[e]._order=g._order)})),f.edges().forEach((function(t){g=f.edge(t);var n=c.findIndex((function(e){var n=d(e,"source"),r=d(e,"target");return n===t.v&&r===t.w}));e.edgeLabelSpace&&e.controlPoints&&"loop"!==c[n].type&&(c[n].controlPoints=g.points.slice(1,g.points.length-1))})),e.onLayoutEnd&&e.onLayoutEnd(),{nodes:n,edges:c}}},e.prototype.getType=function(){return"dagre"},e}(t);function Lt(t,e,n){return t||(a(e)?function(){return e}:function(){return n})}const Ut=Object.prototype.toString;function jt(t){return Ut.call(t).endsWith("Array]")}const Ft=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!jt(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},Bt=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!jt(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 zt(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!jt(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(!jt(n.output))throw new TypeError("output option must be an array if specified");e=n.output}else e=new Array(t.length);var r=Bt(t),i=Ft(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 Vt=" ".repeat(2),Wt=" ".repeat(4);function Xt(t,e={}){const{maxRows:n=15,maxColumns:r=10,maxNumSize:i=8}=e;return`${t.constructor.name} {\n${Vt}[\n${Wt}${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(Ht(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${Wt}`)}(t,n,r,i)}\n${Vt}]\n${Vt}rows: ${t.rows}\n${Vt}columns: ${t.columns}\n}`}function Ht(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 qt(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 Yt(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 Kt(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 Zt(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 $t(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 Qt(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 Jt(t,e,n,r,i){if(5!==arguments.length)throw new RangeError("expected 4 arguments");if(ee("startRow",e),ee("endRow",n),ee("startColumn",r),ee("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 te(t,e=0){let n=[];for(let r=0;r<t;r++)n.push(e);return n}function ee(t,e){if("number"!=typeof e)throw new TypeError(`${t} must be a number`)}function ne(t){if(t.isEmpty())throw new Error("Empty matrix has no elements to index")}class re{static from1DArray(t,e,n){if(t*e!==n.length)throw new RangeError("data length does not match given dimensions");let r=new oe(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 oe(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 oe(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 oe(t,e)}static ones(t,e){return new oe(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 oe(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 oe(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 oe(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 re.isMatrix(t)?t:new oe(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 oe(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){qt(this,t);let e=[];for(let n=0;n<this.columns;n++)e.push(this.get(t,n));return e}getRowVector(t){return oe.rowVector(this.getRow(t))}setRow(t,e){qt(this,t),e=Kt(this,e);for(let n=0;n<this.columns;n++)this.set(t,n,e[n]);return this}swapRows(t,e){qt(this,t),qt(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){Yt(this,t);let e=[];for(let n=0;n<this.rows;n++)e.push(this.get(n,t));return e}getColumnVector(t){return oe.columnVector(this.getColumn(t))}setColumn(t,e){Yt(this,t),e=Zt(this,e);for(let n=0;n<this.rows;n++)this.set(n,t,e[n]);return this}swapColumns(t,e){Yt(this,t),Yt(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=Kt(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=Kt(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=Kt(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=Kt(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=Zt(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=Zt(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=Zt(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=Zt(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){qt(this,t);for(let n=0;n<this.columns;n++)this.set(t,n,this.get(t,n)*e);return this}mulColumn(t,e){Yt(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(){ne(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(){ne(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(qt(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){qt(this,t),ne(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(qt(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){qt(this,t),ne(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(Yt(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){Yt(this,t),ne(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(Yt(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){Yt(this,t),ne(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){re.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=oe.checkMatrix(t);let e=this.rows,n=this.columns,r=t.columns,i=new oe(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=oe.checkMatrix(t);let e=new oe(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=oe.checkMatrix(t);let e=new oe(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),D=(i-f)*(v-m),C=i*y,N=(c+f)*(-y+m),k=(-i+a+u)*(g+y-b),R=(i-u)*(g-b),O=(a+u)*(-y+b),P=E+C+r*p,M=(n+r+i-o-a-c-f)*v+x+w+E+I+C+N,G=E+S+T+(n+r+i-a-u-s-c)*g+C+k+O,L=_+a*(-l+h+p-v-g-y+b)+x+E+C+k+R,U=_+x+w+E+u*m,j=C+k+R+O+o*d,F=E+S+A+c*(-l+d+p-v-g-y+m)+I+D+C,B=I+D+C+N+s*h,z=E+S+A+T+f*b;return e.set(0,0,P),e.set(0,1,M),e.set(0,2,G),e.set(1,0,L),e.set(1,1,U),e.set(1,2,j),e.set(2,0,F),e.set(2,1,B),e.set(2,2,z),e}mmulStrassen(t){t=oe.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=re.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(re.add(s,p),re.add(c,v),o,u),y=t(re.add(h,p),c,o,u),m=t(s,re.sub(l,v),o,u),b=t(p,re.sub(d,c),o,u),_=t(re.add(s,f),v,o,u),x=t(re.sub(h,s),re.add(c,l),o,u),w=t(re.sub(f,p),re.add(d,v),o,u),E=re.add(g,b);E.sub(_),E.add(w);let S=re.add(m,_),A=re.add(y,b),T=re.sub(g,y);T.add(m),T.add(x);let I=re.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 oe(this.rows,this.columns);for(let t=0;t<this.rows;t++){const i=this.getRow(t);i.length>0&&zt(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 oe(this.rows,this.columns);for(let t=0;t<this.columns;t++){const i=this.getColumn(t);i.length&&zt(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=oe.checkMatrix(t);let e=this.rows,n=this.columns,r=t.rows,i=t.columns,o=new oe(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=oe.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(oe.eye(n,n)),i=oe.eye(e,e).kroneckerProduct(t);return r.add(i)}transpose(){let t=new oe(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=ie){for(let e=0;e<this.rows;e++)this.setRow(e,this.getRow(e).sort(t));return this}sortColumns(t=ie){for(let e=0;e<this.columns;e++)this.setColumn(e,this.getColumn(e).sort(t));return this}subMatrix(t,e,n,r){Jt(this,t,e,n,r);let i=new oe(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 oe(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 oe(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=oe.checkMatrix(t)).isEmpty())return this;Jt(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:$t(t,e),column:Qt(t,n)}}(this,t,e),r=new oe(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 oe(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=te(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=te(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=te(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=te(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 Xt(this,t)}}function ie(t,e){return t-e}re.prototype.klass="Matrix","undefined"!=typeof Symbol&&(re.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return Xt(this)}),re.random=re.rand,re.randomInt=re.randInt,re.diagonal=re.diag,re.prototype.diagonal=re.prototype.diag,re.identity=re.eye,re.prototype.negate=re.prototype.neg,re.prototype.tensorProduct=re.prototype.kroneckerProduct;class oe extends re{constructor(t,e){if(super(),oe.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 qt(this,t),this.data.splice(t,1),this.rows-=1,this}addRow(t,e){return void 0===e&&(e=t,t=this.rows),qt(this,t,!0),e=Float64Array.from(Kt(this,e)),this.data.splice(t,0,e),this.rows+=1,this}removeColumn(t){Yt(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),Yt(this,t,!0),e=Zt(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}}(re,oe);class ae extends re{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 ue(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 se{constructor(t,e={}){if((t=ae.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 oe(n,l),v=new oe(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]=ue(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]=ue(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=ue(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=ue(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=ue(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=ue(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=oe.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=oe.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(oe.diag(t))}inverse(){let t=this.V,e=this.threshold,n=t.rows,r=t.columns,i=new oe(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 oe(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 oe.diag(this.s)}}const ce=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=oe.mul(oe.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 se(i),c=oe.sqrt(s.diagonalMatrix).diagonal();return s.leftSingularVectors.toJSON().map((function(t){return oe.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}(),fe=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 le=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 he(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var de=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 le(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 D=t.eIdealDisMatrix();t.eIdealDistances=D;var C=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}(D);t.weights=C;var N=new ce({linkDistance:s,distances:D}).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,P=t.strictRadial;if(R){var M,G=t.nodeSpacing;M=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])+M(t)}:function(t){return O+M(t)}:function(t){return t.size?o(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])+M(t):l(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)+M(t):t.size+M(t):10+M(t)};var L={nodes:n,nodeSizeFunc:k,adjMatrix:p,positions:N,radii:I,height:w,width:x,strictRadial:P,focusID:d,iterations:t.maxPreventOverlapIteration||200,k:N.length/4.5},U=new fe(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=he(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=he(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),pe=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)}}(),ve=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 pe(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),ge=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)}}(),ye=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 ge(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=oe.mul(oe.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 se(e),a=oe.sqrt(o.diagonalMatrix).diagonal();return o.leftSingularVectors.toJSON().map((function(t){return oe.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),me=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)}}(),be=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 me(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,u=e.clustering,s={};if(u)for(var c in n.forEach((function(t){if(void 0===s[t.cluster]){var e={name:t.cluster,cx:0,cy:0,count:0};s[t.cluster]=e}var n=s[t.cluster];a(t.x)&&(n.cx+=t.x),a(t.y)&&(n.cy+=t.y),n.count++})),s)s[c].cx/=s[c].count,s[c].cy/=s[c].count;if("undefined"!=typeof window){if(o){for(var f=0;f<i;f++)e.runOneStep(s);null===(t=e.onLayoutEnd)||void 0===t||t.call(e)}else{var l=0;this.timeInterval=window.setInterval((function(){var t;e.runOneStep(s),++l>=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){var v=n.clusterGravity||u;for(var g in 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*v;p[n].x-=o*(e.x-r.cx)/i,p[n].y-=o*(e.y-r.cy)/i}})),t)t[g].cx=0,t[g].cy=0,t[g].count=0;for(var g 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[g].cx/=t[g].count,t[g].cy/=t[g].count}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 _e(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 xe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function we(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 Ee(t,e,n){return e&&we(t.prototype,e),n&&we(t,n),t}function Se(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(78892);var Ae=n(90122),Te=n.n(Ae);function Ie(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 De(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){Ie(o,r,i,a,u,"next",t)}function u(t){Ie(o,r,i,a,u,"throw",t)}a(void 0)}))}}var Ce=1;function Ne(){return Ce++}var ke=function t(e){xe(this,t)},Re=function(){function t(e){xe(this,t),this.clazz=void 0,this.components=[],this.entities=[],this.lookup={},this.clazz=e}var e;return Ee(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=De(Te().mark((function t(e){var n,r,i,o,a;return Te().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 Oe(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 Pe(t,e){if(t){if("string"==typeof t)return Oe(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)?Oe(t,e):void 0}}function Me(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)||Pe(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 Ge=n(99311),Le={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")},Ue=function t(){xe(this,t),this.index=void 0},je=function t(){xe(this,t),this.name=void 0,this.data=void 0,this.execute=void 0,this.tearDown=void 0},Fe=function(){function t(){xe(this,t),this.name=void 0,this.refCount=0,this.hasSideEffect=!1,this.devirtualize=[],this.destroy=[],this.reads=[],this.writes=[]}return Ee(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 Be(t,e){return Be=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Be(t,e)}function ze(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&&Be(t,e)}function Ve(t){return Ve="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},Ve(t)}function We(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Xe(t,e){if(e&&("object"===Ve(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return We(t)}function He(t){return He=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},He(t)}var qe,Ye,Ke,Ze,$e,Qe,Je=function(t){ze(i,(function t(){xe(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=He(e);if(n){var i=He(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Xe(this,t)});function i(){var t;xe(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 Ee(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}(),tn=function t(){xe(this,t),this.resource=void 0,this.writer=void 0,this.readerCount=0,this.version=void 0};function en(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 nn(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)?nn(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 nn(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 rn=(qe=(0,Ge.b2)(),Ye=(0,Ge.f3)(Le.RenderEngine),qe((Qe=function(){function t(){xe(this,t),this.passNodes=[],this.resourceNodes=[],this.frameGraphPasses=[],_e(this,"engine",$e,this)}var e,n;return Ee(t,[{key:"execute",value:(n=De(Te().mark((function t(e){return Te().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 je;i.execute=n,r&&(i.tearDown=r),i.name=t;var o=new Fe;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=en(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=en(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=en(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=en(this.passNodes);try{for(v.s();!(p=v.n()).done;){var g=p.value;if(g.refCount){var y,m=en(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=en(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=en(this.resourceNodes);try{for(I.s();!(T=I.n()).done;){var D=T.value.resource;if(D.priority===A&&D.refs){var C=D.first,N=D.last;C&&N&&(C.devirtualize.push(D),N.destroy.push(D))}}}catch(t){I.e(t)}finally{I.f()}}}},{key:"executePassNodes",value:(e=De(Te().mark((function t(e){var n,r,i,o,a,u,s,c,f,l,h,d,p;return Te().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=en(this.passNodes.entries()),t.prev=1,n.s();case 3:if((r=n.n()).done){t.next=18;break}if(i=Me(r.value,2),o=i[0],!(a=i[1]).refCount){t.next=16;break}u=en(a.devirtualize);try{for(u.s();!(s=u.n()).done;)s.value.preExecuteDevirtualize(this.engine)}catch(t){u.e(t)}finally{u.f()}c=en(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=en(a.devirtualize);try{for(l.s();!(h=l.n()).done;)h.value.postExecuteDevirtualize(this.engine)}catch(t){l.e(t)}finally{l.f()}d=en(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 tn;e.resource=t,e.version=t.version,this.resourceNodes.push(e);var n=new Ue;return n.index=this.resourceNodes.length-1,n}},{key:"createTexture",value:function(t,e,n){var r=new Je;return r.name=e,r.descriptor=n,this.createResourceNode(r)}},{key:"createRenderTarget",value:function(t,e,n){var r=new Je;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}),De(Te().mark((function t(){return Te().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)}))))}}]),t}(),$e=Se((Ze=Qe).prototype,"engine",[Ye],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ke=Ze))||Ke);function on(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var an=1e-6,un="undefined"!=typeof Float32Array?Float32Array:Array;function sn(){var t=new un(4);return un!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function cn(t,e,n,r){var i=new un(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i}function fn(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 ln(){var t=new un(9);return un!=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 hn(){var t=new un(3);return un!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function dn(t){var e=new un(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function pn(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)}function vn(t,e,n){var r=new un(3);return r[0]=t,r[1]=e,r[2]=n,r}function gn(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function yn(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function mn(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function bn(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function _n(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function xn(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 wn(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function En(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 Sn(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 An(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)}),sn();var Tn=bn,In=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)},Dn=pn,Cn=(hn(),9007199254740991),Nn={};Nn["[object Float32Array]"]=Nn["[object Float64Array]"]=Nn["[object Int8Array]"]=Nn["[object Int16Array]"]=Nn["[object Int32Array]"]=Nn["[object Uint8Array]"]=Nn["[object Uint8ClampedArray]"]=Nn["[object Uint16Array]"]=Nn["[object Uint32Array]"]=!0,Nn["[object Arguments]"]=Nn["[object Array]"]=Nn["[object ArrayBuffer]"]=Nn["[object Boolean]"]=Nn["[object DataView]"]=Nn["[object Date]"]=Nn["[object Error]"]=Nn["[object Function]"]=Nn["[object Map]"]=Nn["[object Number]"]=Nn["[object Object]"]=Nn["[object RegExp]"]=Nn["[object Set]"]=Nn["[object String]"]=Nn["[object WeakMap]"]=!1;var kn=Object.prototype.toString,Rn=function(t){return function(t){return!!t&&"object"===Ve(t)}(t)&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=Cn}(t.length)&&!!Nn[kn.call(t)]};function On(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 Pn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?On(Object(n),!0).forEach((function(e){on(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):On(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Mn,Gn,Ln,Un,jn,Fn,Bn,zn,Vn,Wn=function(t){ze(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=He(e);if(n){var i=He(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Xe(this,t)});function i(t){var e;return xe(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(We(e),t),e}return Ee(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(Pn(Pn({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,D,C,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 P=0;P<R.data.length;P+=3){var M=cn(R.data[P],R.data[P+1],R.data[P+2],1);fn(M,M,t),Rn(R.data)?R.data.set([M[0],M[1],M[2]],P):(R.data[P]=M[0],R.data[P+1]=M[1],R.data[P+2]=M[2])}if(O){var G=(e=ln(),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)*(C=h*m-p*g)+(x=r*f-a*u)*(D=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*C+f*D)*k,e[1]=(c*I-u*N-f*T)*k,e[2]=(u*C-s*I+f*A)*k,e[3]=(o*C-i*N-a*D)*k,e[4]=(r*N-o*I+a*T)*k,e[5]=(i*I-r*C-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=vn(O.data[L],O.data[L+1],O.data[L+2]);An(U,U,G),xn(U,U),Rn(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}(ke);!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"}(Mn||(Mn={}));var Xn=(Gn=(0,Ge.b2)(),Ln=(0,Ge.f3)(Le.GeometryComponentManager),Un=(0,Ge.f3)(Le.RenderEngine),Gn((Vn=function(){function t(){xe(this,t),_e(this,"geometry",Bn,this),_e(this,"engine",zn,this)}var e;return Ee(t,[{key:"execute",value:(e=De(Te().mark((function t(){var e=this;return Te().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:Mn.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:Mn.UNSIGNED_INT,usage:Mn.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=Ne();return this.geometry.create(n,{vertexCount:e})}},{key:"createInstancedBufferGeometry",value:function(t){var e=t.maxInstancedCount,n=t.vertexCount,r=Ne();return this.geometry.create(r,{maxInstancedCount:e,vertexCount:n})}}]),t}(),Bn=Se((Fn=Vn).prototype,"geometry",[Ln],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),zn=Se(Fn.prototype,"engine",[Un],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),jn=Fn))||jn);function Hn(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 qn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Hn(Object(n),!0).forEach((function(e){on(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Hn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Yn,Kn,Zn,$n,Qn,Jn,tr,er,nr,rr,ir=function(t){ze(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=He(e);if(n){var i=He(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Xe(this,t)});function i(t){var e;return xe(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:Mn.BACK},e.depth={enable:!0},e.blend=void 0,e.entity=void 0,e.type=void 0,Object.assign(We(e),t),e}return Ee(i,[{key:"setDefines",value:function(t){return this.defines=qn(qn({},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}(ke);function or(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 ar(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?or(Object(n),!0).forEach((function(e){on(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):or(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var ur,sr=(Yn=(0,Ge.b2)(),Kn=(0,Ge.f3)(Le.MaterialComponentManager),Zn=(0,Ge.f3)(Le.RenderEngine),$n=(0,Ge.f3)(Le.ShaderModuleService),Yn((rr=function(){function t(){xe(this,t),_e(this,"material",tr,this),_e(this,"engine",er,this),_e(this,"shaderModule",nr,this)}var e;return Ee(t,[{key:"execute",value:(e=De(Te().mark((function t(){return Te().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=Ne(),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,ar(ar({vertexShaderGLSL:n,fragmentShaderGLSL:r},t),{},{uniforms:i}))}}]),t}(),tr=Se((Jn=rr).prototype,"material",[Kn],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),er=Se(Jn.prototype,"engine",[Zn],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),nr=Se(Jn.prototype,"shaderModule",[$n],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Qn=Jn))||Qn);!function(t){t[t.Standard=0]="Standard"}(ur||(ur={}));var cr=function(t){ze(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=He(e);if(n){var i=He(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Xe(this,t)});function i(t){var e;return xe(this,i),(e=r.call(this,t)).strategy=ur.Standard,e.visibilityPlaneMask=0,e.visible=!1,Object.assign(We(e),t),e}return i}(ke),fr=function(){function t(e,n){xe(this,t),this.center=void 0,this.halfExtents=void 0,this.min=hn(),this.max=hn(),this.update(e,n)}return Ee(t,[{key:"update",value:function(t,e){this.center=t||hn(),this.halfExtents=e||vn(.5,.5,.5),this.min=Tn(this.min,this.center,this.halfExtents),this.max=mn(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(t,e){mn(this.center,e,t),_n(this.center,this.center,.5),Tn(this.halfExtents,e,t),_n(this.halfExtents,this.halfExtents,.5),gn(this.min,t),gn(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,D=m+w;E<c&&(c=E),S>f&&(f=S),A<l&&(l=A),T>h&&(h=T),I<d&&(d=I),D>p&&(p=D),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?gn(hn(),this.min):272===t.pnVertexFlag?vn(this.min[0],this.min[1],this.max[2]):257===t.pnVertexFlag?vn(this.min[0],this.max[1],this.min[2]):256===t.pnVertexFlag?vn(this.min[0],this.max[1],this.max[2]):17===t.pnVertexFlag?vn(this.max[0],this.min[1],this.min[2]):16===t.pnVertexFlag?vn(this.max[0],this.min[1],this.max[2]):1===t.pnVertexFlag?vn(this.max[0],this.max[1],this.min[2]):vn(this.max[0],this.max[1],this.max[2])}},{key:"getPositiveFarPoint",value:function(t){return 273===t.pnVertexFlag?gn(hn(),this.max):272===t.pnVertexFlag?vn(this.max[0],this.max[1],this.min[2]):257===t.pnVertexFlag?vn(this.max[0],this.min[1],this.max[2]):256===t.pnVertexFlag?vn(this.max[0],this.min[1],this.min[2]):17===t.pnVertexFlag?vn(this.min[0],this.max[1],this.max[2]):16===t.pnVertexFlag?vn(this.min[0],this.max[1],this.min[2]):1===t.pnVertexFlag?vn(this.min[0],this.min[1],this.max[2]):vn(this.min[0],this.min[1],this.min[2])}}]),t}();var lr,hr=function(t){ze(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=He(e);if(n){var i=He(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Xe(this,t)});function i(t){var e;return xe(this,i),(e=r.call(this,t)).material=void 0,e.geometry=void 0,e.aabb=new fr,e.aabbDirty=!0,e.model=void 0,e.visible=!0,e.children=[],Object.assign(We(e),t),e}return i}(ke),dr=function(){function t(e,n){xe(this,t),this.distance=void 0,this.normal=void 0,this.pnVertexFlag=void 0,this.distance=e||0,this.normal=n||vn(0,1,0),this.updatePNVertexFlag()}return Ee(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 wn(t,this.normal)-this.distance}},{key:"normalize",value:function(){var t=1/Dn(this.normal);_n(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&&En(n,t,e,i),o}}]),t}();!function(t){t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE"}(lr||(lr={}));var pr,vr,gr,yr,mr,br,_r,xr,wr,Er,Sr,Ar,Tr,Ir,Dr=function(){function t(e){if(xe(this,t),this.planes=[],e)this.planes=e;else for(var n=0;n<6;n++)this.planes.push(new dr)}return Ee(t,[{key:"extractFromVPMatrix",value:function(t){var e=Me(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];yn(this.planes[0].normal,o-n,c-a,d-f),this.planes[0].distance=-(y-p),yn(this.planes[1].normal,o+n,c+a,d+f),this.planes[1].distance=-(y+p),yn(this.planes[2].normal,o+r,c+u,d+l),this.planes[2].distance=-(y+v),yn(this.planes[3].normal,o-r,c-u,d-l),this.planes[3].distance=-(y-v),yn(this.planes[4].normal,o-i,c-s,d-h),this.planes[4].distance=-(y-g),yn(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 Cr(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 Nr(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)?Nr(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 Nr(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 kr,Rr,Or,Pr,Mr,Gr,Lr,Ur,jr,Fr,Br,zr,Vr,Wr,Xr,Hr,qr,Yr,Kr,Zr,$r,Qr,Jr,ti,ei=(pr=(0,Ge.b2)(),vr=(0,Ge.f3)(Le.MeshComponentManager),gr=(0,Ge.f3)(Le.CullableComponentManager),yr=(0,Ge.f3)(Le.GeometryComponentManager),mr=(0,Ge.f3)(Le.HierarchyComponentManager),br=(0,Ge.f3)(Le.TransformComponentManager),pr((Ir=function(){function t(){xe(this,t),_e(this,"mesh",wr,this),_e(this,"cullable",Er,this),_e(this,"geometry",Sr,this),_e(this,"hierarchy",Ar,this),_e(this,"transform",Tr,this),this.planes=void 0}var e;return Ee(t,[{key:"setFrustumPlanes",value:function(t){this.planes=t}},{key:"execute",value:(e=De(Te().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 Te().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=Cr(e);try{for(n.s();!(r=n.n()).done;){i=r.value,o=i.getScene(),a=i.getCamera(),u=Cr(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=Sn(hn(),y,v),E=v,(S=ln())[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=An(hn(),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)||lr.INDETERMINATE,this.planes||a.getFrustum().planes),h.visible=h.visibilityPlaneMask!==lr.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===lr.OUTSIDE||e===lr.INSIDE)return e;for(var r=lr.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(wn(s,t.getNegativeFarPoint(n[i]))+c>0)return lr.OUTSIDE;wn(s,t.getPositiveFarPoint(n[i]))+c>0&&(r|=a)}}return r}}]),t}(),wr=Se((xr=Ir).prototype,"mesh",[vr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Er=Se(xr.prototype,"cullable",[gr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Sr=Se(xr.prototype,"geometry",[yr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ar=Se(xr.prototype,"hierarchy",[mr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Tr=Se(xr.prototype,"transform",[br],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),_r=xr))||_r);function ni(){var t=new un(16);return un!=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 ri(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 ii(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 oi(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,D=l*y-d*v,C=h*y-d*g,N=m*C-b*D+_*I+x*T-w*A+E*S;return N?(N=1/N,t[0]=(u*C-s*D+c*I)*N,t[1]=(i*D-r*C-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*C-c*A)*N,t[5]=(n*C-i*T+o*A)*N,t[6]=(g*_-p*E-y*b)*N,t[7]=(f*E-h*_+d*b)*N,t[8]=(a*D-u*T+c*S)*N,t[9]=(r*T-n*D-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 ai(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 ui(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 si(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function ci(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 fi(t,e){var n=new un(3);ci(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 li(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}function hi(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 di(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)?di(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 di(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 pi,vi,gi,yi,mi,bi,_i,xi,wi,Ei,Si,Ai,Ti,Ii=(kr=(0,Ge.b2)(),Rr=(0,Ge.f3)(Le.MeshComponentManager),Or=(0,Ge.f3)(Le.GeometryComponentManager),Pr=(0,Ge.f3)(Le.MaterialComponentManager),Mr=(0,Ge.f3)(Le.CullableComponentManager),Gr=(0,Ge.f3)(Le.TransformComponentManager),Lr=(0,Ge.f3)(Le.HierarchyComponentManager),Ur=(0,Ge.f3)(Le.Systems),jr=(0,Ge.t6)(Le.FrameGraphSystem),Fr=(0,Ge.f3)(Le.RenderEngine),Br=(0,Ge.f3)(Le.ResourcePool),kr((ti=Jr=function(){function t(){var e=this;xe(this,t),_e(this,"mesh",Wr,this),_e(this,"geometry",Xr,this),_e(this,"material",Hr,this),_e(this,"cullable",qr,this),_e(this,"transform",Yr,this),_e(this,"hierarchy",Kr,this),_e(this,"frameGraphSystem",Zr,this),_e(this,"engine",$r,this),_e(this,"resourcePool",Qr,this),this.modelCache={},this.setup=function(t,e,n){var r=t.createRenderTarget(e,"color buffer",{width:1,height:1,usage:Mn.RENDER_ATTACHMENT|Mn.SAMPLED|Mn.COPY_SRC});n.data={output:e.write(t,r)}},this.execute=function(){var t=De(Te().mark((function t(n,r,i){var o,a,u,s,c,f;return Te().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=n.getResourceNode(r.data.output),a=e.resourcePool.getOrCreateResource(o.resource),u=hi(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=hi(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 Ee(t,[{key:"renderView",value:function(t){var e=t.getScene(),n=t.getCamera(),r=n.getViewTransform(),i=ai(ni(),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=hi(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=ai(ni(),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=De(Te().mark((function t(e,n){var r,i,o,a,u,s,c,f;return Te().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=De(Te().mark((function t(e){var n,r,i,o;return Te().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.getScene(),r=hi(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}(),Jr.IDENTIFIER="Render Pass",Wr=Se((Vr=ti).prototype,"mesh",[Rr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Xr=Se(Vr.prototype,"geometry",[Or],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Hr=Se(Vr.prototype,"material",[Pr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),qr=Se(Vr.prototype,"cullable",[Mr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Yr=Se(Vr.prototype,"transform",[Gr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Kr=Se(Vr.prototype,"hierarchy",[Lr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Zr=Se(Vr.prototype,"frameGraphSystem",[Ur,jr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),$r=Se(Vr.prototype,"engine",[Fr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Qr=Se(Vr.prototype,"resourcePool",[Br],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),zr=Vr))||zr);function Di(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 Ci(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)?Ci(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 Ci(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 Ni,ki,Ri,Oi,Pi,Mi,Gi,Li,Ui,ji,Fi,Bi,zi,Vi,Wi,Xi,Hi,qi,Yi,Ki,Zi,$i,Qi=(pi=(0,Ge.b2)(),vi=(0,Ge.f3)(Le.RenderEngine),gi=(0,Ge.f3)(Le.ResourcePool),yi=(0,Ge.f3)(Le.RenderPassFactory),mi=(0,Ge.f3)(Le.MeshComponentManager),pi((Ti=Ai=function(){function t(){var e=this;xe(this,t),_e(this,"engine",xi,this),_e(this,"resourcePool",wi,this),_e(this,"renderPassFactory",Ei,this),_e(this,"mesh",Si,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=De(Te().mark((function t(n,r,i){var o,a,u;return Te().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=Di(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(Ii.IDENTIFIER),i=[],o=Di(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=Me(r,3),i=t[0]+256*t[1]+65536*t[2]-1,e.highlightEnabled&&e.highlightPickedFeature(r,n))})),i}}return Ee(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=Di(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}(),Ai.IDENTIFIER="PixelPicking Pass",xi=Se((_i=Ti).prototype,"engine",[vi],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),wi=Se(_i.prototype,"resourcePool",[gi],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ei=Se(_i.prototype,"renderPassFactory",[yi],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Si=Se(_i.prototype,"mesh",[mi],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),bi=_i))||bi),Ji=(Ni=(0,Ge.b2)(),ki=(0,Ge.f3)(Le.RenderEngine),Ri=(0,Ge.f3)(Le.ResourcePool),Ni((Ui=Li=function t(){var e=this;xe(this,t),_e(this,"engine",Mi,this),_e(this,"resourcePool",Gi,this),this.model=void 0,this.setup=function(t,e,n){var r=t.getPass(Ii.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=De(Te().mark((function t(n,r){var i,o,a,u,s,c,f;return Te().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:Mn.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}},Li.IDENTIFIER="Copy Pass",Mi=Se((Pi=Ui).prototype,"engine",[ki],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Gi=Se(Pi.prototype,"resourcePool",[Ri],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Oi=Pi))||Oi),to=(ji=(0,Ge.b2)(),Fi=(0,Ge.f3)(Le.Systems),Bi=(0,Ge.t6)(Le.FrameGraphSystem),zi=(0,Ge.f3)(Le.RenderPassFactory),Vi=(0,Ge.f3)(Le.ConfigService),Wi=(0,Ge.f3)(Le.ResourcePool),ji(($i=function(){function t(){xe(this,t),_e(this,"frameGraphSystem",qi,this),_e(this,"renderPassFactory",Yi,this),_e(this,"configService",Ki,this),_e(this,"resourcePool",Zi,this)}var e;return Ee(t,[{key:"execute",value:(e=De(Te().mark((function t(e){var n,r,i,o,a,u,s,c;return Te().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=this.renderPassFactory(Ii.IDENTIFIER),r=n.setup,i=n.execute,this.frameGraphSystem.addPass(Ii.IDENTIFIER,r,i),o=this.renderPassFactory(Ji.IDENTIFIER),a=o.setup,u=o.execute,s=o.tearDown,c=this.frameGraphSystem.addPass(Ji.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(Qi.IDENTIFIER).pick(t,e)}}]),t}(),qi=Se((Hi=$i).prototype,"frameGraphSystem",[Fi,Bi],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Yi=Se(Hi.prototype,"renderPassFactory",[zi],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ki=Se(Hi.prototype,"configService",[Vi],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Zi=Se(Hi.prototype,"resourcePool",[Wi],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Xi=Hi))||Xi);var eo,no,ro,io,oo,ao,uo,so,co,fo,lo=function(t){ze(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=He(e);if(n){var i=He(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Xe(this,t)});function i(t){var e;return xe(this,i),(e=r.call(this,t)).parentID=void 0,Object.assign(We(e),t),e}return i}(ke),ho=(eo=(0,Ge.b2)(),no=(0,Ge.f3)(Le.HierarchyComponentManager),ro=(0,Ge.f3)(Le.TransformComponentManager),io=(0,Ge.f3)(Le.MeshComponentManager),eo((fo=function(){function t(){xe(this,t),_e(this,"hierarchy",uo,this),_e(this,"transform",so,this),_e(this,"mesh",co,this)}var e;return Ee(t,[{key:"execute",value:(e=De(Te().mark((function t(){return Te().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(oi(ni(),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}(),uo=Se((ao=fo).prototype,"hierarchy",[no],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),so=Se(ao.prototype,"transform",[ro],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),co=Se(ao.prototype,"mesh",[io],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),oo=ao))||oo);function po(){var t=new un(4);return un!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function vo(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 go(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 yo(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 mo(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 bo=cn,_o=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},xo=go,wo=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};hn(),vn(1,0,0),vn(0,1,0),po(),po(),ln();var Eo=function(t){ze(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=He(e);if(n){var i=He(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Xe(this,t)});function i(t){var e,n,o,a,u,s,c,f,l,h,d,p,v,g,y;return xe(this,i),(e=r.call(this,t)).dirtyFlag=void 0,e.localDirtyFlag=void 0,e.parent=null,e.localPosition=vn(0,0,0),e.localRotation=bo(0,0,0,1),e.localScale=vn(1,1,1),e.localTransform=ni(),e.position=vn(0,0,0),e.rotation=bo(0,0,0,1),e.scaling=vn(1,1,1),e.worldTransform=ni(),e.matrixTransform=(n=ni(),function(t){ai(n,e.getLocalTransform(),t),ci(e.localScale,n),si(e.localPosition,n),fi(e.localRotation,n)}),e.rotateRollPitchYaw=(o=po(),a=po(),u=po(),function(t,n,r){e.setDirty(),mo(o,t,0,0),mo(a,0,n,0),mo(u,0,0,r),go(e.localRotation,o,e.localRotation),go(e.localRotation,e.localRotation,a),go(e.localRotation,u,e.localRotation),wo(e.localRotation,e.localRotation)}),e.lerp=(s=hn(),c=po(),f=hn(),l=hn(),h=po(),d=hn(),function(t,n,r){e.setDirty(),ci(s,t.worldTransform),si(f,t.worldTransform),fi(c,t.worldTransform),ci(l,n.worldTransform),si(d,n.worldTransform),fi(h,n.worldTransform),En(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>an?(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),En(e.localPosition,f,d,r)}),e.translate=(p=hn(),function(t){return mn(p,e.getPosition(),t),e.setPosition(p),e.setDirty(!0),We(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,mn(e.localPosition,e.localPosition,t),e.setLocalDirty(!0),We(e);var n,r,i,o,a,u,s,c,f,l,h,d,p,v,g,y,m},e.setPosition=(v=ni(),function(t){return e.position=t,e.setLocalDirty(!0),null===e.parent?gn(e.localPosition,t):(ri(v,e.parent.worldTransform),oi(v,v),Sn(e.localPosition,t,v)),We(e)}),e.rotate=(g=po(),function(t){if(null===e.parent)go(e.localRotation,e.localRotation,t),wo(e.localRotation,e.localRotation);else{var n=e.getRotation(),r=e.parent.getRotation();_o(g,r),yo(g,g),go(g,g,t),go(e.localRotation,t,n),wo(e.localRotation,e.localRotation)}return e.setLocalDirty(),We(e)}),e.rotateLocal=function(t){return go(e.localRotation,e.localRotation,t),wo(e.localRotation,e.localRotation),e.setLocalDirty(!0),We(e)},e.setRotation=(y=po(),function(t){return null===e.parent?_o(e.localRotation,t):(_o(y,e.parent.getRotation()),yo(y,y),_o(e.localRotation,y),xo(e.localRotation,e.localRotation,t)),e.setLocalDirty(!0),We(e)}),e}return Ee(i,[{key:"setLocalPosition",value:function(t){gn(this.localPosition,t),this.setLocalDirty(!0)}},{key:"setLocalScale",value:function(t){gn(this.localScale,t),this.setLocalDirty(!0)}},{key:"setLocalRotation",value:function(t){return _o(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&&(ri(this.worldTransform,this.getLocalTransform()),this.setDirty(!1))}},{key:"updateTransformWithParent",value:function(t){ai(this.worldTransform,t.worldTransform,this.getLocalTransform())}},{key:"applyTransform",value:function(){this.setDirty(),ci(this.localScale,this.worldTransform),si(this.localPosition,this.worldTransform),fi(this.localRotation,this.worldTransform)}},{key:"clearTransform",value:function(){this.setDirty(),this.localPosition=vn(0,0,0),this.localRotation=bo(0,0,0,1),this.localScale=vn(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 si(this.position,this.worldTransform),this.position}},{key:"getRotation",value:function(){return fi(this.rotation,this.worldTransform),this.rotation}},{key:"getScale",value:function(){return ci(this.scaling,this.worldTransform),this.scaling}}]),i}(ke);Eo.DIRTY=1;var So,Ao,To,Io,Do,Co,No=n(11922),ko=(So=(0,Ge.b2)(),Ao=(0,Ge.f3)(Le.RenderEngine),So((Co=function(){function t(){xe(this,t),_e(this,"engine",Do,this),this.resourcePool={}}return Ee(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:Mn.CLAMP_TO_EDGE,wrapT:Mn.CLAMP_TO_EDGE,usage:i})})}return this.resourcePool[t.name]}},{key:"clean",value:function(){this.resourcePool={}}}]),t}(),Do=Se((Io=Co).prototype,"engine",[Ao],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),To=Io))||To);var Ro,Oo,Po,Mo,Go=function(t){ze(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=He(e);if(n){var i=He(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Xe(this,t)});function i(t){var e;return xe(this,i),(e=r.call(this,t)).name=void 0,e.name=t.name||"",e}return i}(ke),Lo=(0,Ge.b2)()((Oo=function(){function t(){xe(this,t),this.config=void 0}return Ee(t,[{key:"get",value:function(){return this.config}},{key:"set",value:function(t){this.config=t}}]),t}(),Ro=Oo))||Ro;!function(t){t.PANSTART="PANSTART",t.PANEND="PANEND",t.PANMOVE="PANMOVE",t.PINCH="PINCH",t.KEYDOWN="KEYDOWN",t.KEYUP="KEYUP",t.HOVER="HOVER"}(Mo||(Mo={}));var Uo,jo,Fo=(0,Ge.b2)()(Po=function(){function t(){xe(this,t)}return Ee(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}())||Po,Bo=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\s\S]*?);/g;function zo(t){var e={};return{content:t=t.replace(Bo,(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 Vo(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 Wo(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Vo(Object(n),!0).forEach((function(e){on(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Vo(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Xo=/precision\s+(high|low|medium)p\s+float/,Ho=/#pragma include (["^+"]?["\ "[a-zA-Z_0-9](.*)"]*?)/g,qo=(0,Ge.b2)()((jo=function(){function t(){xe(this,t),this.moduleCache={},this.rawContentCache={}}return Ee(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=zo(r),s=u.content,c=u.uniforms,f=zo(o),l=f.content,h=f.uniforms;this.rawContentCache[t]={fs:l,uniforms:Wo(Wo(Wo({},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 Wo(Wo({},t),e.rawContentCache[n].uniforms)}),{});return Xo.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(Ho,(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}(),Uo=jo))||Uo,Yo=new Ge.W2;function Ko(){var t=new Ge.W2;return t.parent=Yo,t.bind(Le.Systems).to(ho).inSingletonScope().whenTargetNamed(Le.SceneGraphSystem),t.bind(Le.Systems).to(rn).inSingletonScope().whenTargetNamed(Le.FrameGraphSystem),t.bind(Le.Systems).to(ei).inSingletonScope().whenTargetNamed(Le.MeshSystem),t.bind(Le.Systems).to(Xn).inSingletonScope().whenTargetNamed(Le.GeometrySystem),t.bind(Le.Systems).to(sr).inSingletonScope().whenTargetNamed(Le.MaterialSystem),t.bind(Le.Systems).to(to).inSingletonScope().whenTargetNamed(Le.RendererSystem),t.bind(Le.ResourcePool).to(ko).inSingletonScope(),t.bind(Le.ConfigService).to(Lo).inSingletonScope(),t.bind(Le.InteractorService).to(Fo).inSingletonScope(),t.bind(Le.RenderPass).to(Ii).inSingletonScope().whenTargetNamed(Ii.IDENTIFIER),t.bind(Le.RenderPass).to(Ji).inSingletonScope().whenTargetNamed(Ji.IDENTIFIER),t.bind(Le.RenderPass).to(Qi).inSingletonScope().whenTargetNamed(Qi.IDENTIFIER),t.bind(Le.RenderPassFactory).toFactory((function(t){return function(e){return t.container.getNamed(Le.RenderPass,e)}})),t}function Zo(t){for(var e=new fr,n=vn(t[0],t[1],t[2]),r=vn(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,No.Z)(Yo,!1),Yo.bind(Le.ShaderModuleService).to(qo).inSingletonScope(),Yo.bind(Le.NameComponentManager).toConstantValue(new Re(Go)),Yo.bind(Le.HierarchyComponentManager).toConstantValue(new Re(lo)),Yo.bind(Le.TransformComponentManager).toConstantValue(new Re(Eo)),Yo.bind(Le.MeshComponentManager).toConstantValue(new Re(hr)),Yo.bind(Le.CullableComponentManager).toConstantValue(new Re(cr)),Yo.bind(Le.GeometryComponentManager).toConstantValue(new Re(Wn)),Yo.bind(Le.MaterialComponentManager).toConstantValue(new Re(ir));var $o,Qo,Jo,ta,ea,na="undefined"!=typeof navigator&&/Version\/[\d\.]+.*Safari/.test(navigator.userAgent);function ra(t){return"number"==typeof t}function ia(t){return void 0===t?0:t>360||t<-360?t%360:t}function oa(t,e,n){return ra(t)?vn(t,e,n):3===t.length?dn(t):vn(t[0],t[1],t[2])}hn(),hn(),hn(),hn(),hn(),hn(),n(62697),n(71894),n(71186),n(25275),n(72862),n(49633),function(t){t.Normal="normal",t.PostProcessing="post-processing"}($o||($o={})),n(17222),n(25965),n(32391),n(13945),n(27294),n(89586),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>[]"}(Qo||(Qo={})),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"}(Jo||(Jo={})),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"}(ta||(ta={})),function(t){t.GLSL100="GLSL100",t.GLSL450="GLSL450",t.WGSL="WGSL"}(ea||(ea={}));var aa,ua,sa,ca,fa,la,ha,da,pa,va,ga=function(){function t(e,n){var r,i;xe(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 un(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=dn(n.right),this.up=dn(n.up),this.forward=dn(n.forward),this.position=dn(n.position),this.focalPoint=dn(n.focalPoint),this.distanceVector=dn(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 Ee(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=ri(t.matrix,this.matrix),t.right=gn(t.right,this.right),t.up=gn(t.up,this.up),t.forward=gn(t.forward,this.forward),t.position=gn(t.position,this.position),t.focalPoint=gn(t.focalPoint,this.focalPoint),t.distanceVector=gn(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"}(da||(da={})),function(t){t.DEFAULT="DEFAULT",t.ROTATIONAL="ROTATIONAL",t.TRANSLATIONAL="TRANSLATIONAL",t.CINEMATIC="CINEMATIC"}(pa||(pa={})),function(t){t.ORTHOGRAPHIC="ORTHOGRAPHIC",t.PERSPECTIVE="PERSPECTIVE"}(va||(va={}));var ya,ma,ba,_a,xa,wa,Ea,Sa=Math.PI/180,Aa=180/Math.PI,Ta=(aa=(0,Ge.b2)(),ua=(0,Ge.f3)(Le.InteractorService),aa((ha=la=function(){function t(){xe(this,t),this.matrix=ni(),this.right=vn(1,0,0),this.up=vn(0,1,0),this.forward=vn(0,0,1),this.position=vn(0,0,1),this.focalPoint=vn(0,0,0),this.distanceVector=vn(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,_e(this,"interactor",fa,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=ni(),this.view=void 0,this.following=void 0,this.type=da.EXPLORING,this.trackingMode=pa.DEFAULT,this.projectionMode=va.PERSPECTIVE,this.frustum=new Dr,this.landmarks=[],this.landmarkAnimationID=void 0}return Ee(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===da.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===da.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!==da.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 oi(ni(),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===va.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===va.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=va.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*Sa,this.aspect,this.near,this.far),this}},{key:"setOrthographic",value:function(t,e,n,r,i,o){this.projectionMode=va.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=vn(0,1,0);if(this.focalPoint=oa(t,e,n),this.trackingMode===pa.CINEMATIC){var y=bn(hn(),this.focalPoint,this.position);t=y[0],e=y[1],n=y[2];var m=pn(y),b=Math.asin(e/m)*Aa,_=90+Math.atan2(n,t)*Aa,x=ni();r=x,i=x,o=_*Sa,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*Sa),g=Sn(hn(),[0,1,0],x)}return oi(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-_)<an&&Math.abs(v-x)<an&&Math.abs(g-w)<an?ii(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)}(ni(),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=hn();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=ia(t),this.computeMatrix(),this._getAxes(),this.type===da.ORBITING||this.type===da.EXPLORING?this._getPosition():this.type===da.TRACKING&&this._getFocalPoint(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(t){return this.elevation=ia(t),this.computeMatrix(),this._getAxes(),this.type===da.ORBITING||this.type===da.EXPLORING?this._getPosition():this.type===da.TRACKING&&this._getFocalPoint(),this}},{key:"setRoll",value:function(t){return this.roll=ia(t),this.computeMatrix(),this._getAxes(),this.type===da.ORBITING||this.type===da.EXPLORING?this._getPosition():this.type===da.TRACKING&&this._getFocalPoint(),this}},{key:"rotate",value:function(t,e,n){if(this.type===da.EXPLORING){t=ia(t),e=ia(e),n=ia(n);var r=vo(po(),[1,0,0],(this.rotateWorld?1:-1)*e*Sa),i=vo(po(),[0,1,0],(this.rotateWorld?1:-1)*t*Sa),o=vo(po(),[0,0,1],n*Sa),a=go(po(),i,r);a=go(po(),a,o);var u=li(ni(),a);ui(this.matrix,this.matrix,[0,0,-this.distance]),ai(this.matrix,this.matrix,u),ui(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation+e)>90)return;this.relElevation=ia(e),this.relAzimuth=ia(t),this.relRoll=ia(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.computeMatrix()}return this._getAxes(),this.type===da.ORBITING||this.type===da.EXPLORING?this._getPosition():this.type===da.TRACKING&&this._getFocalPoint(),this._update(),this}},{key:"pan",value:function(t,e){var n=oa(t,e,0),r=dn(this.position);return mn(r,r,_n(hn(),this.right,n[0])),mn(r,r,_n(hn(),this.up,n[1])),this._setPosition(r),this}},{key:"dolly",value:function(t){var e=this.forward,n=dn(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===da.ORBITING||this.type===da.EXPLORING?this._getDistance():this.type===da.TRACKING&&mn(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 ga(t,n);return this.landmarks.push(r),r}},{key:"setLandmark",value:function(t){var e=new ga(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=hn(),h=hn();if(En(l,e.focalPoint,a,f),En(h,e.position,o,f),s=e.roll*(1-f)+u*f,e.setFocalPoint(l),e.setPosition(h),e.setRoll(s),e.computeMatrix(),!(In(l,a)+In(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=vo(po(),[0,0,1],this.roll*Sa);ii(this.matrix),t=vo(po(),[1,0,0],(this.rotateWorld&&this.type!==da.TRACKING||this.type===da.TRACKING?1:-1)*this.elevation*Sa),e=vo(po(),[0,1,0],(this.rotateWorld&&this.type!==da.TRACKING||this.type===da.TRACKING?1:-1)*this.azimuth*Sa);var r=go(po(),e,t);r=go(po(),r,n);var i=li(ni(),r);this.type===da.ORBITING||this.type===da.EXPLORING?(ui(this.matrix,this.matrix,this.focalPoint),ai(this.matrix,this.matrix,i),ui(this.matrix,this.matrix,[0,0,this.distance])):this.type===da.TRACKING&&(ui(this.matrix,this.matrix,this.position),ai(this.matrix,this.matrix,i))}},{key:"_setPosition",value:function(t,e,n){this.position=oa(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(){gn(this.right,oa(fn(sn(),[1,0,0,0],this.matrix))),gn(this.up,oa(fn(sn(),[0,1,0,0],this.matrix))),gn(this.forward,oa(fn(sn(),[0,0,1,0],this.matrix))),xn(this.right,this.right),xn(this.up,this.up),xn(this.forward,this.forward)}},{key:"_getAngles",value:function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=pn(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===da.TRACKING||this.rotateWorld?(this.elevation=Math.asin(e/r)*Aa,this.azimuth=Math.atan2(-t,-n)*Aa):(this.elevation=-Math.asin(e/r)*Aa,this.azimuth=-Math.atan2(-t,-n)*Aa)}},{key:"_getPosition",value:function(){gn(this.position,oa(fn(sn(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){var t,e;An(this.distanceVector,[0,0,-this.distance],(t=ln(),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)),mn(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=bn(hn(),this.focalPoint,this.position),this.distance=pn(this.distanceVector),this.dollyingStep=this.distance/100}}]),t}(),la.ProjectionMode={ORTHOGRAPHIC:"ORTHOGRAPHIC",PERSPECTIVE:"PERSPECTIVE"},fa=Se((ca=ha).prototype,"interactor",[ua],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),sa=ca))||sa),Ia=(ya=(0,Ge.b2)(),ma=(0,Ge.f3)(Le.GeometryComponentManager),ya((Ea=wa=function(){function t(){xe(this,t),this.config=void 0,_e(this,"geometry",xa,this),this.entity=void 0,this.component=void 0}return Ee(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}(),wa.BOX="box",wa.SPHERE="sphere",wa.PLANE="plane",wa.MERGED="merged",xa=Se((_a=Ea).prototype,"geometry",[ma],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ba=_a))||ba),Da=n(98344);function Ca(){if("undefined"!=typeof document)return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}var Na={}.toString;var ka={};ka["[object Float32Array]"]=ka["[object Float64Array]"]=ka["[object Int8Array]"]=ka["[object Int16Array]"]=ka["[object Int32Array]"]=ka["[object Uint8Array]"]=ka["[object Uint8ClampedArray]"]=ka["[object Uint16Array]"]=ka["[object Uint32Array]"]=!0,ka["[object Arguments]"]=ka["[object Array]"]=ka["[object ArrayBuffer]"]=ka["[object Boolean]"]=ka["[object DataView]"]=ka["[object Date]"]=ka["[object Error]"]=ka["[object Function]"]=ka["[object Map]"]=ka["[object Number]"]=ka["[object Object]"]=ka["[object RegExp]"]=ka["[object Set]"]=ka["[object String]"]=ka["[object WeakMap]"]=!1;var Ra,Oa,Pa,Ma,Ga,La,Ua,ja,Fa=Object.prototype.toString,Ba=function(t){return function(t){return!!t&&"object"===Ve(t)}(t)&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}(t.length)&&!!ka[Fa.call(t)]};function za(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 Va(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?za(Object(n),!0).forEach((function(e){on(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):za(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Wa,Xa,Ha,qa,Ya,Ka,Za,$a,Qa,Ja,tu,eu,nu,ru,iu,ou,au,uu,su,cu,fu,lu,hu,du,pu,vu,gu,yu,mu,bu,_u,xu,wu,Eu,Su,Au=(Ra=(0,Ge.b2)(),Oa=(0,Ge.f3)(Le.RenderEngine),Pa=(0,Ge.f3)(Le.ConfigService),Ra((ja=function(){function t(){xe(this,t),_e(this,"engine",La,this),_e(this,"configService",Ua,this),this.entity=Ne(),this.model=void 0,this.dirty=!0,this.compiledBundle=void 0,this.initPromise=void 0}var e,n,r;return Ee(t,[{key:"init",value:function(){var t=this.configService.get(),e=t.canvas,n=t.engineOptions;this.initPromise=this.engine.init(Va({canvas:e||Ca(),swapChainFormat:Da.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=ra(e)||Ba(e)||(n=e,Array.isArray?Array.isArray(n):function(t,e){return Na.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===ta.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=De(Te().mark((function t(){var e,n,r=this,i=arguments;return Te().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=De(Te().mark((function t(){return Te().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=De(Te().mark((function t(){var e,n,r;return Te().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.initPromise;case 2:return e=Va({},this.compiledBundle.context),n=this.engine.supportWebGPU?this.engine.useWGSL?ea.WGSL:ea.GLSL450:ea.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===ta.StorageBuffer){var n=1;t.type===Qo.FloatArray?n=1:t.type===Qo.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}(),La=Se((Ga=ja).prototype,"engine",[Oa],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ua=Se(Ga.prototype,"configService",[Pa],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ma=Ga))||Ma),Tu=(Wa=(0,Ge.b2)(),Xa=(0,Ge.f3)(Le.MaterialComponentManager),Wa((Za=Ka=function(){function t(){xe(this,t),this.config=void 0,_e(this,"material",Ya,this),this.entity=void 0,this.component=void 0}return Ee(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}(),Ka.BASIC="basic",Ya=Se((qa=Za).prototype,"material",[Xa],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ha=qa))||Ha),Iu=($a=(0,Ge.b2)(),Qa=(0,Ge.f3)(Le.MeshComponentManager),Ja=(0,Ge.f3)(Le.CullableComponentManager),tu=(0,Ge.f3)(Le.TransformComponentManager),eu=(0,Ge.f3)(Le.Systems),nu=(0,Ge.t6)(Le.SceneGraphSystem),$a((fu=cu=function(){function t(){xe(this,t),this.attributes={},this.config=void 0,_e(this,"mesh",ou,this),_e(this,"cullable",au,this),_e(this,"transform",uu,this),_e(this,"sceneGraphSystem",su,this),this.meshComponent=void 0,this.transformComponent=void 0,this.entity=void 0}return Ee(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}(),cu.POINT="point",cu.LINE="line",cu.GRID="grid",ou=Se((iu=fu).prototype,"mesh",[Qa],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),au=Se(iu.prototype,"cullable",[Ja],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),uu=Se(iu.prototype,"transform",[tu],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),su=Se(iu.prototype,"sceneGraphSystem",[eu,nu],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ru=iu))||ru),Du=n(96377),Cu=n.n(Du),Nu=function(){function t(e,n){xe(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 Ee(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}(),ku=(on(lu={},Mn.POINTS,"points"),on(lu,Mn.LINES,"lines"),on(lu,Mn.LINE_LOOP,"line loop"),on(lu,Mn.LINE_STRIP,"line strip"),on(lu,Mn.TRIANGLES,"triangles"),on(lu,Mn.TRIANGLE_FAN,"triangle fan"),on(lu,Mn.TRIANGLE_STRIP,"triangle strip"),lu),Ru=(on(hu={},Mn.STATIC_DRAW,"static"),on(hu,Mn.DYNAMIC_DRAW,"dynamic"),on(hu,Mn.STREAM_DRAW,"stream"),hu),Ou=(on(du={},Mn.BYTE,"int8"),on(du,Mn.UNSIGNED_INT,"int16"),on(du,Mn.INT,"int32"),on(du,Mn.UNSIGNED_BYTE,"uint8"),on(du,Mn.UNSIGNED_SHORT,"uint16"),on(du,Mn.UNSIGNED_INT,"uint32"),on(du,Mn.FLOAT,"float"),du),Pu=(on(pu={},Mn.ALPHA,"alpha"),on(pu,Mn.LUMINANCE,"luminance"),on(pu,Mn.LUMINANCE_ALPHA,"luminance alpha"),on(pu,Mn.RGB,"rgb"),on(pu,Mn.RGBA,"rgba"),on(pu,Mn.RGBA4,"rgba4"),on(pu,Mn.RGB5_A1,"rgb5 a1"),on(pu,Mn.RGB565,"rgb565"),on(pu,Mn.DEPTH_COMPONENT,"depth"),on(pu,Mn.DEPTH_STENCIL,"depth stencil"),pu),Mu=(on(vu={},Mn.DONT_CARE,"dont care"),on(vu,Mn.NICEST,"nice"),on(vu,Mn.FASTEST,"fast"),vu),Gu=(on(gu={},Mn.NEAREST,"nearest"),on(gu,Mn.LINEAR,"linear"),on(gu,Mn.LINEAR_MIPMAP_LINEAR,"mipmap"),on(gu,Mn.NEAREST_MIPMAP_LINEAR,"nearest mipmap linear"),on(gu,Mn.LINEAR_MIPMAP_NEAREST,"linear mipmap nearest"),on(gu,Mn.NEAREST_MIPMAP_NEAREST,"nearest mipmap nearest"),gu),Lu=(on(yu={},Mn.REPEAT,"repeat"),on(yu,Mn.CLAMP_TO_EDGE,"clamp"),on(yu,Mn.MIRRORED_REPEAT,"mirror"),yu),Uu=(on(mu={},Mn.NONE,"none"),on(mu,Mn.BROWSER_DEFAULT_WEBGL,"browser"),mu),ju=(on(bu={},Mn.NEVER,"never"),on(bu,Mn.ALWAYS,"always"),on(bu,Mn.LESS,"less"),on(bu,Mn.LEQUAL,"lequal"),on(bu,Mn.GREATER,"greater"),on(bu,Mn.GEQUAL,"gequal"),on(bu,Mn.EQUAL,"equal"),on(bu,Mn.NOTEQUAL,"notequal"),bu),Fu=(on(_u={},Mn.FUNC_ADD,"add"),on(_u,Mn.MIN_EXT,"min"),on(_u,Mn.MAX_EXT,"max"),on(_u,Mn.FUNC_SUBTRACT,"subtract"),on(_u,Mn.FUNC_REVERSE_SUBTRACT,"reverse subtract"),_u),Bu=(on(xu={},Mn.ZERO,"zero"),on(xu,Mn.ONE,"one"),on(xu,Mn.SRC_COLOR,"src color"),on(xu,Mn.ONE_MINUS_SRC_COLOR,"one minus src color"),on(xu,Mn.SRC_ALPHA,"src alpha"),on(xu,Mn.ONE_MINUS_SRC_ALPHA,"one minus src alpha"),on(xu,Mn.DST_COLOR,"dst color"),on(xu,Mn.ONE_MINUS_DST_COLOR,"one minus dst color"),on(xu,Mn.DST_ALPHA,"dst alpha"),on(xu,Mn.ONE_MINUS_DST_ALPHA,"one minus dst alpha"),on(xu,Mn.CONSTANT_COLOR,"constant color"),on(xu,Mn.ONE_MINUS_CONSTANT_COLOR,"one minus constant color"),on(xu,Mn.CONSTANT_ALPHA,"constant alpha"),on(xu,Mn.ONE_MINUS_CONSTANT_ALPHA,"one minus constant alpha"),on(xu,Mn.SRC_ALPHA_SATURATE,"src alpha saturate"),xu),zu=(on(wu={},Mn.NEVER,"never"),on(wu,Mn.ALWAYS,"always"),on(wu,Mn.LESS,"less"),on(wu,Mn.LEQUAL,"lequal"),on(wu,Mn.GREATER,"greater"),on(wu,Mn.GEQUAL,"gequal"),on(wu,Mn.EQUAL,"equal"),on(wu,Mn.NOTEQUAL,"notequal"),wu),Vu=(on(Eu={},Mn.ZERO,"zero"),on(Eu,Mn.KEEP,"keep"),on(Eu,Mn.REPLACE,"replace"),on(Eu,Mn.INVERT,"invert"),on(Eu,Mn.INCR,"increment"),on(Eu,Mn.DECR,"decrement"),on(Eu,Mn.INCR_WRAP,"increment wrap"),on(Eu,Mn.DECR_WRAP,"decrement wrap"),Eu),Wu=(on(Su={},Mn.FRONT,"front"),on(Su,Mn.BACK,"back"),Su),Xu=function(){function t(e,n){xe(this,t),this.buffer=void 0;var r=n.data,i=n.usage,o=n.type;this.buffer=e.buffer({data:r,usage:Ru[i||Mn.STATIC_DRAW],type:Ou[o||Mn.UNSIGNED_BYTE]})}return Ee(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 Hu(t){return function(t){if(Array.isArray(t))return Oe(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Pe(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 qu={};qu["[object Float32Array]"]=qu["[object Float64Array]"]=qu["[object Int8Array]"]=qu["[object Int16Array]"]=qu["[object Int32Array]"]=qu["[object Uint8Array]"]=qu["[object Uint8ClampedArray]"]=qu["[object Uint16Array]"]=qu["[object Uint32Array]"]=!0,qu["[object Arguments]"]=qu["[object Array]"]=qu["[object ArrayBuffer]"]=qu["[object Boolean]"]=qu["[object DataView]"]=qu["[object Date]"]=qu["[object Error]"]=qu["[object Function]"]=qu["[object Map]"]=qu["[object Number]"]=qu["[object Object]"]=qu["[object RegExp]"]=qu["[object Set]"]=qu["[object String]"]=qu["[object WeakMap]"]=!1;var Yu=Object.prototype.toString,Ku=function(t){return function(t){return!!t&&"object"===Ve(t)}(t)&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}(t.length)&&!!qu[Yu.call(t)]};function Zu(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 $u(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Zu(Object(n),!0).forEach((function(e){on(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Zu(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Qu=0,Ju=function(){function t(e,n){var r=this;xe(this,t),this.reGl=e,this.context=n,this.entity=Ne(),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===ta.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===ta.Uniform){if(o&&(Array.isArray(o)||Ku(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 Ee(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=De(Te().mark((function t(){var e,n,r,i,o,a,u,s,c=this;return Te().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 $u($u({},t),{},{id:Qu++,texture:this.reGl.texture({width:n,height:n,data:e,type:"float"})})}},{key:"calcDataTexture",value:function(t,e,n){var r=1;e===Qo.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,Hu(new Array(4*(c-u)).fill(0)));var f=this.reGl.texture({width:s,height:s,data:i,type:"float"});return{id:Qu++,data:i,originalDataLength:a,typedArrayConstructor:Ku(n)?n.constructor:void 0,textureWidth:s,texture:f,texelCount:u,elementsPerTexel:r,isOutput:t===this.context.output.name}}}]),t}(),ts=function(){function t(e,n){xe(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:Ru[i||Mn.STATIC_DRAW],type:Ou[o||Mn.UNSIGNED_BYTE],count:a})}return Ee(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}(),es=function(){function t(e,n){xe(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 Ee(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 ns(t){var e={};return Object.keys(t).forEach((function(n){rs(n,t[n],e,"")})),e}function rs(t,e,n,r){var i,o;null===e||"number"==typeof e||"boolean"==typeof e||Array.isArray(e)&&"number"==typeof e[0]||Ku(e)||""===e||void 0!==e.resize?n["".concat(r&&r+".").concat(t)]=e:(o=Ve(i=e),null==i||"object"!==o&&"function"!==o||Object.keys(e).forEach((function(i){rs(i,e[i],n,"".concat(r&&r+".").concat(t))})),Array.isArray(e)&&e.forEach((function(e,i){Object.keys(e).forEach((function(o){rs(o,e[o],n,"".concat(r&&r+".").concat(t,"[").concat(i,"]"))}))})))}function is(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 os(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?is(Object(n),!0).forEach((function(e){on(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):is(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var as,us,ss,cs=function(){function t(e,n){xe(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=ns(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:ku[void 0===s?Mn.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 Ee(t,[{key:"addUniforms",value:function(t){this.uniforms=os(os({},this.uniforms),ns(t))}},{key:"draw",value:function(t){var e=os(os({},this.uniforms),ns(t.uniforms||{})),n={};Object.keys(e).forEach((function(t){var r=Ve(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:ju[n.func||Mn.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:Bu[i&&i.srcRGB||Mn.SRC_ALPHA],srcAlpha:Bu[i&&i.srcAlpha||Mn.SRC_ALPHA],dstRGB:Bu[i&&i.dstRGB||Mn.ONE_MINUS_SRC_ALPHA],dstAlpha:Bu[i&&i.dstAlpha||Mn.ONE_MINUS_SRC_ALPHA]},equation:{rgb:Fu[o&&o.rgb||Mn.FUNC_ADD],alpha:Fu[o&&o.alpha||Mn.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:Mn.ALWAYS,ref:0,mask:-1}:a,s=n.opFront,c=void 0===s?{fail:Mn.KEEP,zfail:Mn.KEEP,zpass:Mn.KEEP}:s,f=n.opBack,l=void 0===f?{fail:Mn.KEEP,zfail:Mn.KEEP,zpass:Mn.KEEP}:f;e.stencil={enable:!!r,mask:o,func:os(os({},u),{},{cmp:zu[u.cmp]}),opFront:{fail:Vu[c.fail],zfail:Vu[c.zfail],zpass:Vu[c.zpass]},opBack:{fail:Vu[l.fail],zfail:Vu[l.zfail],zpass:Vu[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?Mn.BACK:i;e.cull={enable:!!r,face:Wu[o]}}}},{key:"generateDefines",value:function(t){return Object.keys(t).map((function(e){return"#define ".concat(e," ").concat(Number(t[e]))})).join("\n")}}]),t}(),fs=function(){function t(e,n){xe(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?Mn.UNSIGNED_BYTE:i,a=n.width,u=n.height,s=n.flipY,c=void 0!==s&&s,f=n.format,l=void 0===f?Mn.RGBA:f,h=n.mipmap,d=void 0!==h&&h,p=n.wrapS,v=void 0===p?Mn.CLAMP_TO_EDGE:p,g=n.wrapT,y=void 0===g?Mn.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?Mn.NEAREST:S,T=n.min,I=void 0===T?Mn.NEAREST:T,D=n.colorSpace,C=void 0===D?Mn.BROWSER_DEFAULT_WEBGL:D;this.width=a,this.height=u;var N={width:a,height:u,type:Ou[o],format:Pu[l],wrapS:Lu[v],wrapT:Lu[y],mag:Gu[A],min:Gu[I],alignment:x,flipY:c,colorSpace:Uu[C],premultiplyAlpha:E,aniso:b};r&&(N.data=r),"number"==typeof d?N.mipmap=Mu[d]:"boolean"==typeof d&&(N.mipmap=d),this.texture=e.texture(N)}return Ee(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}(),ls=(0,Ge.b2)()((us=function(){function t(){var e=this;xe(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=De(Te().mark((function t(n){return Te().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=De(Te().mark((function t(e){var r;return Te().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 cs(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 Nu(e.gl,t)},this.createBuffer=function(t){return new Xu(e.gl,t)},this.createElements=function(t){return new ts(e.gl,t)},this.createTexture2D=function(t){return new fs(e.gl,t)},this.createFramebuffer=function(t){return new es(e.gl,t)},this.useFramebuffer=function(t,n){e.gl({framebuffer:t?t.get():null})(n)},this.createComputeModel=function(){var t=De(Te().mark((function t(n){return Te().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Ju(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(Mn.SCISSOR_TEST),e.gl._gl.scissor(t.box.x,t.box.y,t.box.width,t.box.height)):e.gl._gl.disable(Mn.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 Ee(t,[{key:"init",value:(e=De(Te().mark((function t(e){return Te().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){Cu()({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}(),as=us))||as;function hs(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 ds(){return ps.apply(this,arguments)}function ps(){return(ps=De(Te().mark((function t(){return Te().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!ss){t.next=2;break}return t.abrupt("return",ss);case 2:return t.next=4,hs("https://preview.babylonjs.com/glslang/glslang.js");case 4:return ss=window.glslang("https://preview.babylonjs.com/glslang/glslang.wasm"),t.abrupt("return",ss);case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var vs,gs,ys,ms,bs,_s,xs,ws=function(){function t(e,n){xe(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 Ee(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}(),Es=function(){function t(e,n){xe(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||Da.FB.Vertex|Da.FB.CopyDst)}return Ee(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){(na?this.engine.device.getQueue():this.engine.device.defaultQueue).writeBuffer(t,e,n)}}]),t}(),Ss=function(){function t(e,n){xe(this,t),this.engine=e,this.context=n,this.entity=Ne(),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 Ee(t,[{key:"init",value:(r=De(Te().mark((function t(){var e,n,r,i,o,a,u,s=this;return Te().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===ta.StorageBuffer})),i=this.context.uniforms.filter((function(t){return t.storageClass===ta.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,Hu(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,Hu(t.data)),s.uniformGPUBufferLayout.push({name:t.name,offset:a})}}a+=4*n}})),this.uniformBuffer=new Es(this.engine,{data:u instanceof Array?new Float32Array(u):u,usage:Da.FB.Uniform|Da.FB.CopyDst}),this.bindGroupEntries.push({binding:0,resource:{buffer:this.uniformBuffer.get()}})),r.forEach((function(t){var e;null!==t.data&&(t.type!==Qo.Vector4FloatArray&&t.type!==Qo.FloatArray||(t.name===s.context.output.name?(e=new Es(s.engine,{data:isFinite(Number(t.data))?[t.data]:t.data,usage:Da.FB.Storage|Da.FB.CopyDst|Da.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 Es(s.engine,{data:isFinite(Number(t.data))?[t.data]:t.data,usage:Da.FB.Storage|Da.FB.CopyDst|Da.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=De(Te().mark((function t(){var e,n,r,i,o,a,u,s,c;return Te().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),(na?this.engine.device.getQueue():this.engine.device.defaultQueue).submit([u.finish()]),t.next=12,a.mapAsync(Da.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,Hu(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),(na?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=De(Te().mark((function t(e){var n;return Te().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:na}),entryPoint:"main"}});case 7:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})}]),t}(),As=function(){function t(e,n){xe(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 Es(e,{data:i instanceof Array?new Uint16Array(i):i,usage:Da.FB.Index|Da.FB.CopyDst})}return Ee(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}(),Ts=function(){function t(e,n){xe(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 Ee(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}(),Is=(on(vs={},Mn.POINTS,Da.YV.PointList),on(vs,Mn.LINES,Da.YV.LineList),on(vs,Mn.LINE_LOOP,Da.YV.LineList),on(vs,Mn.LINE_STRIP,Da.YV.LineStrip),on(vs,Mn.TRIANGLES,Da.YV.TriangleList),on(vs,Mn.TRIANGLE_FAN,Da.YV.TriangleList),on(vs,Mn.TRIANGLE_STRIP,Da.YV.TriangleStrip),vs),Ds=(on(gs={},Mn.NEVER,Da.wb.Never),on(gs,Mn.ALWAYS,Da.wb.Always),on(gs,Mn.LESS,Da.wb.Less),on(gs,Mn.LEQUAL,Da.wb.LessEqual),on(gs,Mn.GREATER,Da.wb.Greater),on(gs,Mn.GEQUAL,Da.wb.GreaterEqual),on(gs,Mn.EQUAL,Da.wb.Equal),on(gs,Mn.NOTEQUAL,Da.wb.NotEqual),gs),Cs=(on(ys={},Mn.FUNC_ADD,Da.db.Add),on(ys,Mn.MIN_EXT,Da.db.Min),on(ys,Mn.MAX_EXT,Da.db.Max),on(ys,Mn.FUNC_SUBTRACT,Da.db.Subtract),on(ys,Mn.FUNC_REVERSE_SUBTRACT,Da.db.ReverseSubtract),ys),Ns=(on(ms={},Mn.ZERO,Da.zi.Zero),on(ms,Mn.ONE,Da.zi.One),on(ms,Mn.SRC_COLOR,Da.zi.SrcColor),on(ms,Mn.ONE_MINUS_SRC_COLOR,Da.zi.OneMinusSrcColor),on(ms,Mn.SRC_ALPHA,Da.zi.SrcAlpha),on(ms,Mn.ONE_MINUS_SRC_ALPHA,Da.zi.OneMinusSrcAlpha),on(ms,Mn.DST_COLOR,Da.zi.DstColor),on(ms,Mn.ONE_MINUS_DST_COLOR,Da.zi.OneMinusDstColor),on(ms,Mn.DST_ALPHA,Da.zi.DstAlpha),on(ms,Mn.ONE_MINUS_DST_ALPHA,Da.zi.OneMinusDstAlpha),on(ms,Mn.CONSTANT_COLOR,Da.zi.BlendColor),on(ms,Mn.ONE_MINUS_CONSTANT_COLOR,Da.zi.OneMinusBlendColor),on(ms,Mn.SRC_ALPHA_SATURATE,Da.zi.SrcAlphaSaturated),ms),ks=(on(bs={},Mn.ALPHA,"r8unorm"),on(bs,Mn.RGBA,"rgba8unorm"),on(bs,Mn.DEPTH_COMPONENT,"depth32float"),on(bs,Mn.DEPTH_STENCIL,"depth24plus-stencil8"),bs),Rs=(on(_s={},Mn.NEAREST,"nearest"),on(_s,Mn.LINEAR,"linear"),_s),Os=(on(xs={},Mn.REPEAT,"repeat"),on(xs,Mn.CLAMP_TO_EDGE,"clamp-to-edge"),on(xs,Mn.MIRRORED_REPEAT,"mirror-repeat"),xs);function Ps(t){var e=t.cull;return e&&e.enable?e.face?e.face===Mn.FRONT?Da.Wf.Front:Da.Wf.Back:void 0:Da.Wf.None}function Ms(t){var e=t.depth,n=(t.stencil,{compare:Da.wb.Always,depthFailOp:Da.xS.Keep,failOp:Da.xS.Keep,passOp:Da.xS.Keep});return{depthWriteEnabled:e&&e.enable,depthCompare:Ds[(null==e?void 0:e.func)||Mn.ALWAYS],format:Da.EV.Depth24PlusStencil8,stencilFront:n,stencilBack:n,stencilReadMask:4294967295,stencilWriteMask:4294967295}}function Gs(t,e){var n=t.blend;return[{format:e,alphaBlend:{srcFactor:Ns[n&&n.func&&n.func.srcAlpha||Mn.ONE],dstFactor:Ns[n&&n.func&&n.func.dstAlpha||Mn.ZERO],operation:Cs[n&&n.equation&&n.equation.alpha||Mn.FUNC_ADD]},colorBlend:{srcFactor:Ns[n&&n.func&&n.func.srcRGB||Mn.ONE],dstFactor:Ns[n&&n.func&&n.func.dstRGB||Mn.ZERO],operation:Cs[n&&n.equation&&n.equation.rgb||Mn.FUNC_ADD]},writeMask:Da.Yw.All}]}function Ls(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 Us(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ls(Object(n),!0).forEach((function(e){on(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ls(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function js(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 Fs,Bs,zs,Vs=function(){function t(e,n){xe(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 Ee(t,[{key:"init",value:(n=De(Te().mark((function t(){var e,n,r,i,o,a,u,s,c,f,l,h,d,p,v,g,y=this;return Te().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:Is[a||Mn.TRIANGLES],rasterizationState:Us(Us({},this.getDefaultRasterizationStateDescriptor()),{},{cullMode:Ps({cull:l})}),depthStencilState:Ms({depth:s,stencil:f}),colorStates:Gs({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=Us(Us({},this.uniforms),ns(t))}},{key:"draw",value:function(t){var e=this,n=this.engine.getCurrentRenderPass(),r=Us(Us({},this.uniforms),ns(t.uniforms||{})),i=[];Object.keys(r).forEach((function(t){var n=Ve(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(),Da.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=De(Te().mark((function t(e,n,r){var i,o,a;return Te().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:na}),entryPoint:"main"},fragmentStage:{module:this.engine.device.createShaderModule({code:e,isWHLSL:na}),entryPoint:"main"}}}},{key:"getDefaultRasterizationStateDescriptor",value:function(){return{frontFace:Da.zX.CCW,cullMode:Da.Wf.None,depthBias:0,depthBiasSlopeScale:0,depthBiasClamp:0}}},{key:"buildUniformBindGroup",value:function(t){var e=this,n=0,r=js.apply(void 0,[Float32Array].concat(Hu(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:Da.$X.Fragment|Da.$X.Vertex,type:Da.$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:Da.$X.Fragment,type:Da.$l.Sampler},{binding:2*n+(o?1:0)+1,visibility:Da.$X.Fragment,type:Da.$l.SampledTexture})})),this.uniformsBindGroupLayout=this.engine.device.createBindGroupLayout({entries:i}),this.pipelineLayout=this.engine.device.createPipelineLayout({bindGroupLayouts:[this.uniformsBindGroupLayout]}),o&&(this.uniformBuffer=new Es(this.engine,{data:r instanceof Array?new Float32Array(r):r,usage:Da.FB.Uniform|Da.FB.CopyDst}))}}]),t}(),Ws=function(){function t(e,n){xe(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 Ee(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)&&Mn.UNSIGNED_BYTE,t.width),n=t.height,r=(t.flipY,t.format),i=void 0===r?Mn.RGBA:r,o=(t.mipmap,t.wrapS),a=void 0===o?Mn.CLAMP_TO_EDGE:o,u=t.wrapT,s=void 0===u?Mn.CLAMP_TO_EDGE:u,c=t.aniso,f=void 0===c?0:c,l=(t.alignment,t.premultiplyAlpha,t.mag),h=void 0===l?Mn.NEAREST:l,d=t.min,p=void 0===d?Mn.NEAREST:d,v=(void 0===t.colorSpace&&Mn.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:Da.kd.E2d,format:ks[i],usage:v||Da.v2.Sampled|Da.v2.CopyDst}),(!v||v&Da.v2.Sampled)&&(this.sampler=this.engine.device.createSampler({addressModeU:Os[a],addressModeV:Os[s],addressModeW:Os[a],magFilter:Rs[h],minFilter:Rs[p],maxAnisotropy:f}))}}]),t}(),Xs=(0,Ge.b2)()((Bs=function(){function t(){var e=this;xe(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||Da.Ws.Load,e.mainDepthAttachment.depthLoadValue=r||Da.Ws.Load,e.mainDepthAttachment.stencilLoadValue=i?e.clearStencilValue:Da.Ws.Load,e.mainRenderPass&&e.endMainRenderPass(),e.startMainRenderPass())},this.createModel=function(){var t=De(Te().mark((function t(n){var r;return Te().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new Vs(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 ws(e,t)},this.createBuffer=function(t){return new Es(e,t)},this.createElements=function(t){return new As(e,t)},this.createTexture2D=function(t){return new Ws(e,t)},this.createFramebuffer=function(t){return new Ts(e,t)},this.useFramebuffer=function(t,n){e.currentRenderTarget&&e.unbindFramebuffer(e.currentRenderTarget),e.currentRenderTarget=t,e.currentRenderTargetViewDescriptor={dimension:Da.p_.E2d,arrayLayerCount:1,aspect:Da.H7.All},e.currentRenderPass=null,n()},this.createComputeModel=function(){var t=De(Te().mark((function t(n){var r;return Te().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new Ss(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 Ee(t,[{key:"isFloatSupported",value:function(){return!0}},{key:"init",value:(n=De(Te().mark((function t(e){return Te().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(),na?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=De(Te().mark((function t(){var e,n;return Te().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,ds();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(na?"gpu":"gpupresent"),this.swapChain=this.context.configureSwapChain({device:this.device,format:this.options.swapChainFormat,usage:Da.v2.OutputAttachment|Da.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:Da.kd.E2d,format:Da.EV.BGRA8Unorm,usage:Da.v2.OutputAttachment};this.mainTexture&&this.mainTexture.destroy(),this.mainTexture=this.device.createTexture(t),this.mainColorAttachments=[{attachment:na?this.mainTexture.createDefaultView():this.mainTexture.createView(),loadValue:[0,0,0,1],storeOp:Da.EG.Store}]}else this.mainColorAttachments=[{attachment:na?this.swapChain.getCurrentTexture().createDefaultView():this.swapChain.getCurrentTexture().createView(),loadValue:[0,0,0,1],storeOp:Da.EG.Store}];var e={size:this.mainTextureExtends,mipLevelCount:1,sampleCount:this.mainPassSampleCount,dimension:Da.kd.E2d,format:na?"depth32float-stencil8":Da.EV.Depth24PlusStencil8,usage:Da.v2.OutputAttachment};this.depthTexture&&this.depthTexture.destroy(),this.depthTexture=this.device.createTexture(e),this.mainDepthAttachment={attachment:na?this.depthTexture.createDefaultView():this.depthTexture.createView(),depthLoadValue:this.clearDepthValue,depthStoreOp:Da.EG.Store,stencilLoadValue:this.clearStencilValue,stencilStoreOp:Da.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=na?this.swapChain.getCurrentTexture().createDefaultView():this.swapChain.getCurrentTexture().createView():this.mainColorAttachments[0].attachment=na?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:Da.Ws.Load,storeOp:Da.EG.Store}],depthStencilAttachment:c&&s?{attachment:s,depthLoadValue:n?this.clearDepthValue:Da.Ws.Load,depthStoreOp:Da.EG.Store,stencilLoadValue:a?this.clearStencilValue:Da.Ws.Load,stencilStoreOp:Da.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}(),Fs=Bs))||Fs;var Hs,qs=4/64,Ys=(0,Ge.b2)()(zs=function(t){ze(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=He(e);if(n){var i=He(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Xe(this,t)});function i(){return xe(this,i),r.apply(this,arguments)}return Ee(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=Me(void 0===u?vn(.5,.5,.5):u,3),h=l[0],d=l[1],p=l[2],v=[vn(-h,-d,p),vn(h,-d,p),vn(h,d,p),vn(-h,d,p),vn(h,-d,-p),vn(-h,-d,-p),vn(-h,d,-p),vn(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=hn(),s=hn(),c=hn(),f=hn();En(u,v[g[t][0]],v[g[t][1]],o/e),En(s,v[g[t][0]],v[g[t][2]],a/n),Tn(c,s,v[g[t][0]]),mn(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)+qs,i=.875*(i/=3)+qs,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=Zo(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}(Ia))||zs;var Ks,Zs=(0,Ge.b2)()(Hs=function(t){ze(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=He(e);if(n){var i=He(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Xe(this,t)});function i(){return xe(this,i),r.apply(this,arguments)}return Ee(i,[{key:"onEntityCreated",value:function(){var t=this.config.geometries,e=void 0===t?[]:t,n=this.getComponent();n.aabb=new fr;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,Hu(a.map((function(t){return t+o})))),o+=u,s.forEach((function(t,e){r[e]?t.data&&(ra(t.data)?r[e].push(t.data):Ba(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}(Ia))||Hs;var $s,Qs=(0,Ge.b2)()(Ks=function(t){ze(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=He(e);if(n){var i=He(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Xe(this,t)});function i(){return xe(this,i),r.apply(this,arguments)}return Ee(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=Zo(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}(Ia))||Ks;var Js,tc,ec,nc,rc,ic,oc,ac,uc=(0,Ge.b2)()($s=function(t){ze(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=He(e);if(n){var i=He(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Xe(this,t)});function i(){return xe(this,i),r.apply(this,arguments)}return Ee(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=Zo(u),D=this.getComponent();D.indices=Uint32Array.from(f),D.aabb=I,D.vertexCount=u.length/3,D.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}(Ia))||$s;var sc,cc,fc,lc,hc,dc,pc,vc,gc,yc,mc,bc,_c=(Js=(0,Ge.b2)(),tc=(0,Ge.f3)(Le.RenderEngine),ec=(0,Ge.f3)(Le.ShaderModuleService),Js((ac=function(t){ze(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=He(e);if(n){var i=He(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Xe(this,t)});function i(){var t;xe(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return _e(t=r.call.apply(r,[this].concat(n)),"engine",ic,We(t)),_e(t,"shaderModuleService",oc,We(t)),t}return Ee(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:ln()}))}}]),i}(Tu),ic=Se((rc=ac).prototype,"engine",[tc],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),oc=Se(rc.prototype,"shaderModuleService",[ec],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),nc=rc))||nc);var xc,wc,Ec,Sc,Ac,Tc,Ic,Dc,Cc,Nc,kc,Rc,Oc=(sc=(0,Ge.b2)(),cc=(0,Ge.f3)(Le.Systems),fc=(0,Ge.t6)(Le.MaterialSystem),lc=(0,Ge.f3)(Le.Systems),hc=(0,Ge.t6)(Le.GeometrySystem),dc=(0,Ge.f3)(Le.ShaderModuleService),sc((bc=function(t){ze(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=He(e);if(n){var i=He(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Xe(this,t)});function i(){var t;xe(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return _e(t=r.call.apply(r,[this].concat(n)),"materialSystem",gc,We(t)),_e(t,"geometrySystem",yc,We(t)),_e(t,"shaderModuleService",mc,We(t)),t}return Ee(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:Mn.BACK}).setDepth({enable:!0,func:Mn.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}(Iu),gc=Se((vc=bc).prototype,"materialSystem",[cc,fc],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),yc=Se(vc.prototype,"geometrySystem",[lc,hc],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),mc=Se(vc.prototype,"shaderModuleService",[dc],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),pc=vc))||pc),Pc=n(81602),Mc=n(91739);function Gc(t,e,n,r,i){Lc(e,r,-i),Lc(e,r,i),t.push(n),t.push(n)}function Lc(t,e,n){t.push([[e[0],e[1]],n])}var Uc,jc,Fc,Bc,zc,Vc,Wc,Xc,Hc,qc,Yc,Kc,Zc=(xc=(0,Ge.b2)(),wc=(0,Ge.f3)(Le.Systems),Ec=(0,Ge.t6)(Le.MaterialSystem),Sc=(0,Ge.f3)(Le.Systems),Ac=(0,Ge.t6)(Le.GeometrySystem),Tc=(0,Ge.f3)(Le.ShaderModuleService),xc((Rc=function(t){ze(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=He(e);if(n){var i=He(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Xe(this,t)});function i(){var t;xe(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return _e(t=r.call.apply(r,[this].concat(n)),"materialSystem",Cc,We(t)),_e(t,"geometrySystem",Nc,We(t)),_e(t,"shaderModuleService",kc,We(t)),t.vertexCount=void 0,t}return Ee(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(Hu(t),Hu(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,Pc.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,Mc.o7)(r,_,b),c||(c=[0,0],(0,Mc.mJ)(c,r)),s||(s=!0,Gc(d,h,b,c,1)),p.push([m+0,m+1,m+2]),x){(0,Mc.o7)(i,x,_);var w=(0,Mc.x7)(o,a,r,i,1),E=(0,Pc.dot)(o,c)<0?-1:1,S=w>3;if(!isFinite(w)){(0,Mc.mJ)(c,r),Gc(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),Lc(h,c,-E),d.push(_),Lc(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,Mc.mJ)(f,i),(0,Pc.copy)(c,f),Lc(h,c,-E),d.push(_),l+=3):(Gc(d,h,_,a,w),p.push(1===u?[m,m+2,m+3]:[m+2,m+1,m+3]),E=-1,(0,Pc.copy)(c,a),l+=2),u=E}else(0,Mc.mJ)(c,r),Gc(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:Mn.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(Hu(t),Hu(e))}),[])),h.setAttribute("a_pos",Float32Array.from(c.reduce((function(t,e){return[].concat(Hu(t),Hu(e))}),[])),{arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float2"}]});var v=new Array(l).fill(void 0).map((function(){return Hu(t.config.color)})).reduce((function(t,e){return[].concat(Hu(t),Hu(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(Hu(t),Hu(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}(Iu),Cc=Se((Dc=Rc).prototype,"materialSystem",[wc,Ec],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Nc=Se(Dc.prototype,"geometrySystem",[Sc,Ac],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),kc=Se(Dc.prototype,"shaderModuleService",[Tc],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ic=Dc))||Ic);function $c(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 Qc,Jc,tf,ef,nf,rf,of,af,uf,sf,cf=["circle","triangle","square","pentagon","hexagon","octogon","hexagram","rhombus","vesica"],ff=(Uc=(0,Ge.b2)(),jc=(0,Ge.f3)(Le.Systems),Fc=(0,Ge.t6)(Le.MaterialSystem),Bc=(0,Ge.f3)(Le.Systems),zc=(0,Ge.t6)(Le.GeometrySystem),Vc=(0,Ge.f3)(Le.ShaderModuleService),Uc((Kc=function(t){ze(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=He(e);if(n){var i=He(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Xe(this,t)});function i(){var t;xe(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return _e(t=r.call.apply(r,[this].concat(n)),"materialSystem",Hc,We(t)),_e(t,"geometrySystem",qc,We(t)),_e(t,"shaderModuleService",Yc,We(t)),t}return Ee(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:Mn.SRC_ALPHA,dstRGB:Mn.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?$c(Object(n),!0).forEach((function(e){on(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$c(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,Hu([(u=t.id||n)+1&255,u+1>>8&255,u+1>>8>>8&255])),e.instancedShapes.push(cf.indexOf(t.shape||"circle")),(i=e.instancedColors).push.apply(i,Hu(t.color||[1,0,0,1])),(o=e.instancedOffsets).push.apply(o,Hu(t.position||[0,0])),(a=e.instancedSizes).push.apply(a,Hu(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}(Iu),Hc=Se((Xc=Kc).prototype,"materialSystem",[jc,Fc],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),qc=Se(Xc.prototype,"geometrySystem",[Bc,zc],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Yc=Se(Xc.prototype,"shaderModuleService",[Vc],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Wc=Xc))||Wc);function lf(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 hf(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)?hf(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 hf(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 df,pf,vf,gf,yf,mf,bf,_f,xf,wf,Ef,Sf,Af=(Qc=(0,Ge.b2)(),Jc=(0,Ge.f3)(Le.RenderEngine),tf=(0,Ge.f3)(Le.ShaderModuleService),ef=(0,Ge.f3)(Le.ConfigService),Qc((sf=function(){function t(){xe(this,t),this.container=void 0,_e(this,"engine",of,this),_e(this,"shaderModule",af,this),_e(this,"configService",uf,this),this.inited=!1,this.rendering=!1,this.pendings=[],this.views=[],this.size=void 0}var e,n;return Ee(t,[{key:"init",value:(n=De(Te().mark((function t(){var e,n,r,i,o;return Te().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(Le.Systems),!(n=this.configService.get()).canvas){t.next=30;break}return t.next=11,this.engine.init({canvas:n.canvas,swapChainFormat:Da.EV.BGRA8Unorm,antialiasing:!1});case 11:r=lf(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=De(Te().mark((function t(){var e,n,r,i,o,a,u,s=arguments;return Te().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(Le.Systems),n=s.length,r=new Array(n),i=0;i<n;i++)r[i]=s[i];o=lf(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}(),of=Se((rf=sf).prototype,"engine",[Jc],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),af=Se(rf.prototype,"shaderModule",[tf],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),uf=Se(rf.prototype,"configService",[ef],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),nf=rf))||nf),Tf=(0,Ge.b2)()((pf=function(){function t(){xe(this,t),this.entities=[]}return Ee(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}(),df=pf))||df,If=(0,Ge.b2)()((gf=function(){function t(){xe(this,t),this.cache={}}return Ee(t,[{key:"get",value:function(t){return this.cache[t]}},{key:"set",value:function(t,e){this.cache[t]=e}}]),t}(),vf=gf))||vf;function Df(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 Cf(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Df(Object(n),!0).forEach((function(e){on(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Df(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Nf,kf,Rf,Of,Pf,Mf,Gf,Lf,Uf,jf,Ff,Bf,zf,Vf=(yf=(0,Ge.b2)(),mf=(0,Ge.f3)(If),bf=(0,Ge.f3)(Le.RenderEngine),yf((Sf=function(){function t(){xe(this,t),_e(this,"textureCache",wf,this),_e(this,"engine",Ef,this),this.config=void 0,this.loaded=!1,this.texture=void 0}var e;return Ee(t,[{key:"setConfig",value:function(t){this.config=t}},{key:"isLoaded",value:function(){return this.loaded}},{key:"load",value:(e=De(Te().mark((function t(){var e=this;return Te().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(Cf(Cf({},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}(),wf=Se((xf=Sf).prototype,"textureCache",[mf],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ef=Se(xf.prototype,"engine",[bf],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),_f=xf))||_f),Wf=(Nf=(0,Ge.b2)(),kf=(0,Ge.f3)(Le.Systems),Rf=(0,Ge.t6)(Le.RendererSystem),Nf((Gf=function(){function t(){xe(this,t),_e(this,"rendererSystem",Mf,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 Ee(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}(),Mf=Se((Pf=Gf).prototype,"rendererSystem",[kf,Rf],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Of=Pf))||Of);function Xf(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 Hf(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Xf(Object(n),!0).forEach((function(e){on(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Xf(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var qf=(Lf=(0,Ge.b2)(),Uf=(0,Ge.f3)(Le.ConfigService),Lf((zf=function(){function t(){xe(this,t),_e(this,"configService",Bf,this),this.container=void 0}var e;return Ee(t,[{key:"getEngine",value:(e=De(Te().mark((function t(){var e,n,r,i;return Te().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.container.get(Le.RenderEngine),n=this.configService.get(),r=n.canvas,i=n.engineOptions,t.next=4,e.init(Hf({canvas:r||Ca(),swapChainFormat:Da.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(Le.TransformComponentManager).getComponentByEntity(t)}},{key:"getMeshComponent",value:function(t){return this.container.get(Le.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 Ne()}},{key:"createScene",value:function(){return this.container.get(Tf)}},{key:"createCamera",value:function(){return this.container.get(Ta)}},{key:"createView",value:function(){return this.container.get(Wf)}},{key:"createRenderable",value:function(t,e){var n=t?this.container.getNamed(Le.Renderable,t):this.container.get(Iu),r=Ne();return n.setConfig(e||{}),n.setEntity(r),n}},{key:"createGeometry",value:function(t,e){var n=this.container.getNamed(Le.Geometry,t),r=Ne();return n.setConfig(e||{}),n.setEntity(r),n.getComponent()}},{key:"createMaterial",value:function(t,e){var n=this.container.getNamed(Le.Material,t),r=Ne();return n.setConfig(e||{}),n.setEntity(r,t),n.getComponent()}},{key:"createTexture2D",value:function(t){var e=this.container.get(Vf);return e.setConfig(t),e}},{key:"createBufferGeometry",value:function(t){return this.container.getNamed(Le.Systems,Le.GeometrySystem).createBufferGeometry(t)}},{key:"createInstancedBufferGeometry",value:function(t){return this.container.getNamed(Le.Systems,Le.GeometrySystem).createInstancedBufferGeometry(t)}},{key:"createShaderMaterial",value:function(t){return this.container.getNamed(Le.Systems,Le.MaterialSystem).createShaderMaterial(t)}},{key:"createKernel",value:function(t){var e=this.container.get(Au);return"string"==typeof t?e.setBundle(JSON.parse(t)):e.setBundle(t),e.init(),e}},{key:"createRenderer",value:function(){var t=this.container.get(Af);return t.container=this.container,t.init(),t}},{key:"destroy",value:function(){this.container.getAll(Le.Systems).forEach((function(t){t.tearDown&&t.tearDown()})),this.container.get(Le.RenderEngine).destroy(),this.container.get(Le.InteractorService).destroy()}}],[{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=Ko(),r=navigator.gpu?Xs:ls;n.isBound(Le.RenderEngine)||n.bind(Le.RenderEngine).to(r).inSingletonScope(),n.bind(Af).toSelf(),n.bind(Au).toSelf(),n.bind(Iu).toSelf(),n.bind(Wf).toSelf(),n.bind(Ta).toSelf(),n.bind(Tf).toSelf(),n.bind(t).toSelf(),n.bind(If).toSelf(),n.bind(Vf).toSelf(),n.bind(Le.Geometry).to(Ys).whenTargetNamed(Ia.BOX),n.bind(Le.Geometry).to(uc).whenTargetNamed(Ia.SPHERE),n.bind(Le.Geometry).to(Qs).whenTargetNamed(Ia.PLANE),n.bind(Le.Geometry).to(Zs).whenTargetNamed(Ia.MERGED),n.bind(Le.Material).to(_c).whenTargetNamed(Tu.BASIC),n.bind(Le.Renderable).to(ff).whenTargetNamed(Iu.POINT),n.bind(Le.Renderable).to(Zc).whenTargetNamed(Iu.LINE),n.bind(Le.Renderable).to(Oc).whenTargetNamed(Iu.GRID);var i=n.get(t);return i.setContainer(n),i.setConfig(e),i}}]),t}(),Bf=Se((Ff=zf).prototype,"configService",[Uf],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),jf=Ff))||jf),Yf=function(t,e){return t?a(t)?function(){return t}:t:function(){return e||1}},Kf=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)},Zf=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)}}(),$f=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())}))},Qf=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])}}},Jf=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 Zf(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:1e3,gravity:10,speed:1,clustering:!1,clusterGravity:10}},e.prototype.execute=function(){return $f(this,void 0,void 0,(function(){var t,e,n,r,i,o=this;return Qf(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 $f(this,void 0,void 0,(function(){var n,r,i,o,u,s=this;return Qf(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 $f(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,D,C,N=this;return Qf(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,P=[],M=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),P.push(G[t[e]]),n===M-1)for(;P.length%4!=0;)P.push(0)}))})),v={array:new Float32Array(P),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?qf.create({canvas:t,engineOptions:{supportCompute:!0}}):qf.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&&(D=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})),C=function(){return $f(N,void 0,void 0,(function(){var n,i;return Qf(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?(D.setBinding({u_Data:I}),[4,D.execute()]):[3,4];case 3:a.sent(),I.setBinding({u_ClusterCenters:D}),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:Tt,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,C()];case 1:return k.sent(),[2]}var R,O,P,M,G}))}))},e.prototype.getType=function(){return"fruchterman-gpu"},e}(t),tl=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)}}(),el=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())}))},nl=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])}}},rl=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 tl(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:2e3,gravity:10,clustering:!1,clusterGravity:10}},e.prototype.execute=function(){return el(this,void 0,void 0,(function(){var t,e,n,r,i;return nl(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=Yf(t.nodeStrength,1),t.edgeStrength=Yf(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=Yf(n.nodeStrength,1),n.edgeStrength=Yf(n.edgeStrength,1),n.run(t,e)}},e.prototype.run=function(t,e){return el(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,D,C,N,k,R=this;return nl(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=Yf(n.linkDistance),n.edgeStrength=Yf(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=Kf([l,n.degrees,h,m]),E=Kf([v,g,y,b]),S=n.workerEnabled,A=S?qf.create({canvas:t,engineOptions:{supportCompute:!0}}):qf.create({engineOptions:{supportCompute:!0}}),T=n.onLayoutEnd,I=[],f.forEach((function(t){I.push(t)})),D=0;D<4;D++)I.push(0);return C=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 el(R,void 0,void 0,(function(){var i,a,u;return nl(this,(function(s){switch(s.label){case 0:i=0,s.label=1;case 1:return i<o?[4,C.execute()]:[3,5];case 2:return s.sent(),N.setBinding({u_Data:C}),[4,N.execute()];case 3:s.sent(),a=Math.max(.02,n.interval-.002*i),C.setBinding({u_interval:a,u_AveMovement:N}),s.label=4;case 4:return i++,[3,1];case 5:return[4,C.getOutput()];case 6:return u=s.sent(),t?e.postMessage({type:Tt,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),il=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)}}(),ol=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 il(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,D=t.comboPadding;I=a(D)?function(){return D}:o(D)?function(){return Math.max.apply(null,D)}:b(D)?D:function(){return 0},this.comboPadding=I;var C,N=this.linkDistance;N||(N=10),C=a(N)?function(t){return N}:N,this.linkDistance=C;var k,R=this.edgeStrength;R||(R=1),k=a(R)?function(t){return R}:R,this.edgeStrength=k;var O,P=this.nodeStrength;P||(P=30),O=a(P)?function(t){return P}:P,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.indexMap,r=t.comboTrees,i=t.oriComboMap,o={};return(r||[]).forEach((function(r){var u=[];m(r,(function(r){if("node"===r.itemType)return!0;if(!i[r.id])return!0;if(void 0===o[r.id]){var s={id:r.id,name:r.id,cx:0,cy:0,count:0,depth:t.oriComboMap[r.id].depth||0,children:[]};o[r.id]=s}var c=r.children;c&&c.forEach((function(t){if(!o[t.id]&&!e[t.id])return!0;u.push(t)}));var f=o[r.id];if(f.cx=0,f.cy=0,0===u.length){f.empty=!0;var l=i[r.id],h=Object.keys(e).length,d=r.id+"-visual-child-"+h,p={id:d,x:l.x,y:l.y,depth:f.depth+1,itemType:"node"};t.nodes.push(p),e[d]=p,n[d]=h,f.cx=l.x,f.cy=l.y,u.push(p)}return u.forEach((function(t){if(f.count++,"node"!==t.itemType){var n=o[t.id];return a(n.cx)&&(f.cx+=n.cx),void(a(n.cy)&&(f.cy+=n.cy))}var r=e[t.id];r&&(a(r.x)&&(f.cx+=r.x),a(r.y)&&(f.cy+=r.y))})),f.cx/=f.count,f.cy/=f.count,f.children=u,!0}))})),o},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,n.cy/=n.count,!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,D=I/(E*E+I),C=m*T,N=b*T;t[p].x+=C*D,t[p].y+=N*D,D=1-D,t[r].x-=C*D,t[r].y-=N*D}}}}}))}}))},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),al=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 ul=al;const sl=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}(),cl=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 fl=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)}}(),ll=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 fl(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 ul(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 sl({xmid:(f+c)/2,ymid:(h+l)/2,length:p,massCenter:a,mass:s}),g=new cl(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),hl=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}(),dl=new Proxy({},{get:function(t,e){return S(e)},set:function(t,e,n){return w(e,n),!0}})})(),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={27294:()=>{},89586:()=>{},62697:()=>{},71894:()=>{},71186:()=>{},25275:()=>{},72862:()=>{},49633:()=>{},17222:()=>{},25965:()=>{},32391:()=>{},13945:()=>{},49216:(t,e,n)=>{"use strict";n(59504),n(43982),n(90721),n(25778),n(63898),n(67536),n(85834),n(96945),n(20547),n(55967),n(13515),n(13042),n(34962),n(10405)},90122:(t,e,n)=>{t.exports=n(10405)},98344:(t,e)=>{"use strict";var n,r,i,o,a,s,u,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",(u=e.H7||(e.H7={})).All="all",u.StencilOnly="stencil-only",u.DepthOnly="depth-only",(s=e.mj||(e.mj={})).Error="error",s.Warning="warning",s.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"},59504:(t,e,n)=>{n(82825),n(76051),n(72640),n(29518),n(8201),n(40470),n(15723),n(7525),n(39788),n(61498),n(7577),n(16129),n(52802),n(57940),n(25261),n(59340),n(1584),n(47298),n(71765),n(15747),n(67451),n(82784),n(62809),n(67454),n(23053),n(88032),n(17551),n(62929),n(20215),n(96183),n(48190),n(30473),n(60948),n(50942),n(82870),n(32212),n(54230),n(69754),n(12811),n(73998),n(41769),n(68789),n(12848),n(1762),n(41323),n(96063),n(33282),n(76816),n(51854),n(63303),n(14421),n(12203),n(1028),n(96818),n(85557),n(27938),n(88316),n(7937),n(80637),n(8219),n(99029),n(93157),n(79791),n(92296),n(14555),n(66505),n(4722),n(59713),n(47392),n(64687),n(43684),n(33339),n(44148),n(77754),n(44094),n(78781),n(85013),n(3735),n(88723),n(2247),n(39689),n(29003),n(29026),n(54088),n(30535),n(85788),n(67878),n(85119),n(83135),n(95015),n(78059),n(10646),n(25377),n(59879),n(15305),n(36341),n(95915),n(44488),n(9281),n(40163),n(86668),n(87139),n(96408),n(28686),n(65480),n(19121),n(90914),n(37742),n(47843),n(96441),n(10429),n(52214),n(498),n(96349),n(83742),n(59604),n(72592),n(79290),n(69363),n(16907),n(78632),n(1838),n(73421),n(56144),n(28275),n(92552),n(83077),n(31838),n(18916),n(18978),n(98531),n(57323),n(3704),n(45305),n(28812),n(82636),n(51602),n(83871),t.exports=n(52845)},90721:(t,e,n)=>{n(67744),t.exports=n(52845).Array.flatMap},43982:(t,e,n)=>{n(75448),t.exports=n(52845).Array.includes},13515:(t,e,n)=>{n(8938),t.exports=n(52845).Object.entries},20547:(t,e,n)=>{n(67819),t.exports=n(52845).Object.getOwnPropertyDescriptors},55967:(t,e,n)=>{n(26572),t.exports=n(52845).Object.values},13042:(t,e,n)=>{"use strict";n(47843),n(78228),t.exports=n(52845).Promise.finally},63898:(t,e,n)=>{n(13336),t.exports=n(52845).String.padEnd},25778:(t,e,n)=>{n(3718),t.exports=n(52845).String.padStart},85834:(t,e,n)=>{n(46642),t.exports=n(52845).String.trimRight},67536:(t,e,n)=>{n(47831),t.exports=n(52845).String.trimLeft},96945:(t,e,n)=>{n(79956),t.exports=n(57686).f("asyncIterator")},72680:(t,e,n)=>{n(98358),t.exports=n(23142).global},23749:t=>{t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},98891:(t,e,n)=>{var r=n(92799);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},23142:t=>{var e=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=e)},85526:(t,e,n)=>{var r=n(23749);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(49880)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},22004:(t,e,n)=>{var r=n(92799),i=n(55505).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},52069:(t,e,n)=>{var r=n(55505),i=n(23142),o=n(85526),a=n(95954),s=n(99761),u=function(t,e,n){var c,f,l,h=t&u.F,d=t&u.G,p=t&u.S,v=t&u.P,g=t&u.B,y=t&u.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])&&s(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&u.R&&b&&!b[c]&&a(b,c,l)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},49880:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},55505: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)},99761:t=>{var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},95954:(t,e,n)=>{var r=n(45584),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}},44053:(t,e,n)=>{t.exports=!n(7498)&&!n(49880)((function(){return 7!=Object.defineProperty(n(22004)("div"),"a",{get:function(){return 7}}).a}))},92799:t=>{t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},45584:(t,e,n)=>{var r=n(98891),i=n(44053),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(92799);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")}},98358:(t,e,n)=>{var r=n(52069);r(r.G,{global:n(55505)})},51464:t=>{t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},88347:(t,e,n)=>{var r=n(91669);t.exports=function(t,e){if("number"!=typeof t&&"Number"!=r(t))throw TypeError(e);return+t}},24691:(t,e,n)=>{var r=n(10341)("unscopables"),i=Array.prototype;null==i[r]&&n(90913)(i,r,{}),t.exports=function(t){i[r][t]=!0}},40178:(t,e,n)=>{"use strict";var r=n(58016)(!0);t.exports=function(t,e,n){return e+(n?r(t,e).length:1)}},36903: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}},50486:(t,e,n)=>{var r=n(91255);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},61064:(t,e,n)=>{"use strict";var r=n(17583),i=n(59260),o=n(88087);t.exports=[].copyWithin||function(t,e){var n=r(this),a=o(n.length),s=i(t,a),u=i(e,a),c=arguments.length>2?arguments[2]:void 0,f=Math.min((void 0===c?a:i(c,a))-u,a-s),l=1;for(u<s&&s<u+f&&(l=-1,u+=f-1,s+=f-1);f-- >0;)u in n?n[s]=n[u]:delete n[s],s+=l,u+=l;return n}},8676:(t,e,n)=>{"use strict";var r=n(17583),i=n(59260),o=n(88087);t.exports=function(t){for(var e=r(this),n=o(e.length),a=arguments.length,s=i(a>1?arguments[1]:void 0,n),u=a>2?arguments[2]:void 0,c=void 0===u?n:i(u,n);c>s;)e[s++]=t;return e}},4538:(t,e,n)=>{var r=n(28182),i=n(88087),o=n(59260);t.exports=function(t){return function(e,n,a){var s,u=r(e),c=i(u.length),f=o(a,c);if(t&&n!=n){for(;c>f;)if((s=u[f++])!=s)return!0}else for(;c>f;f++)if((t||f in u)&&u[f]===n)return t||f||0;return!t&&-1}}},97622:(t,e,n)=>{var r=n(50994),i=n(58579),o=n(17583),a=n(88087),s=n(56699);t.exports=function(t,e){var n=1==t,u=2==t,c=3==t,f=4==t,l=6==t,h=5==t||l,d=e||s;return function(e,s,p){for(var v,g,y=o(e),m=i(y),b=r(s,p,3),_=a(m.length),x=0,w=n?d(e,_):u?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}}},85336:(t,e,n)=>{var r=n(51464),i=n(17583),o=n(58579),a=n(88087);t.exports=function(t,e,n,s,u){r(e);var c=i(t),f=o(c),l=a(c.length),h=u?l-1:0,d=u?-1:1;if(n<2)for(;;){if(h in f){s=f[h],h+=d;break}if(h+=d,u?h<0:l<=h)throw TypeError("Reduce of empty array with no initial value")}for(;u?h>=0:l>h;h+=d)h in f&&(s=e(s,f[h],h,c));return s}},77600:(t,e,n)=>{var r=n(91255),i=n(77183),o=n(10341)("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}},56699:(t,e,n)=>{var r=n(77600);t.exports=function(t,e){return new(r(t))(e)}},78366:(t,e,n)=>{"use strict";var r=n(51464),i=n(91255),o=n(18262),a=[].slice,s={},u=function(t,e,n){if(!(e in s)){for(var r=[],i=0;i<e;i++)r[i]="a["+i+"]";s[e]=Function("F,a","return new F("+r.join(",")+")")}return s[e](t,n)};t.exports=Function.bind||function(t){var e=r(this),n=a.call(arguments,1),s=function(){var r=n.concat(a.call(arguments));return this instanceof s?u(e,r.length,r):o(e,r,t)};return i(e.prototype)&&(s.prototype=e.prototype),s}},54939:(t,e,n)=>{var r=n(91669),i=n(10341)("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}},91669:t=>{var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},53050:(t,e,n)=>{"use strict";var r=n(83886).f,i=n(49055),o=n(88565),a=n(50994),s=n(36903),u=n(39822),c=n(10966),f=n(38782),l=n(24412),h=n(1216),d=n(94278).fastKey,p=n(44664),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){s(t,f,e,"_i"),t._t=e,t._i=i(null),t._f=void 0,t._l=void 0,t[v]=0,null!=r&&u(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)}}},81990:(t,e,n)=>{"use strict";var r=n(88565),i=n(94278).getWeak,o=n(50486),a=n(91255),s=n(36903),u=n(39822),c=n(97622),f=n(67384),l=n(44664),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){s(t,c,e,"_i"),t._t=e,t._i=p++,t._l=void 0,null!=r&&u(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}},30859:(t,e,n)=>{"use strict";var r=n(57571),i=n(97044),o=n(46476),a=n(88565),s=n(94278),u=n(39822),c=n(36903),f=n(91255),l=n(75338),h=n(62803),d=n(25837),p=n(70116);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&&u(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),s.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}},52845:t=>{var e=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=e)},51395:(t,e,n)=>{"use strict";var r=n(83886),i=n(48328);t.exports=function(t,e,n){e in t?r.f(t,e,i(0,n)):t[e]=n}},50994:(t,e,n)=>{var r=n(51464);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)}}},44506:(t,e,n)=>{"use strict";var r=n(75338),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},59514:(t,e,n)=>{"use strict";var r=n(50486),i=n(34467),o="number";t.exports=function(t){if("string"!==t&&t!==o&&"default"!==t)throw TypeError("Incorrect hint");return i(r(this),t!=o)}},65091: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(75338)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},3438:(t,e,n)=>{var r=n(91255),i=n(57571).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},39824:t=>{t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},66397:(t,e,n)=>{var r=n(39804),i=n(53844),o=n(14179);t.exports=function(t){var e=r(t),n=i.f;if(n)for(var a,s=n(t),u=o.f,c=0;s.length>c;)u.call(t,a=s[c++])&&e.push(a);return e}},97044:(t,e,n)=>{var r=n(57571),i=n(52845),o=n(90913),a=n(46476),s=n(50994),u=function(t,e,n){var c,f,l,h,d=t&u.F,p=t&u.G,v=t&u.S,g=t&u.P,y=t&u.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?s(l,r):g&&"function"==typeof l?s(Function.call,l):l,m&&a(m,c,l,t&u.U),b[c]!=l&&o(b,c,h),g&&_[c]!=l&&(_[c]=l)};r.core=i,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},32910:(t,e,n)=>{var r=n(10341)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,!"/./"[t](e)}catch(t){}}return!0}},75338:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},6719:(t,e,n)=>{"use strict";n(87139);var r=n(46476),i=n(90913),o=n(75338),a=n(65091),s=n(10341),u=n(69020),c=s("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=s(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===u?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)})}}},33649:(t,e,n)=>{"use strict";var r=n(50486);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(77183),i=n(91255),o=n(88087),a=n(50994),s=n(10341)("isConcatSpreadable");t.exports=function t(e,n,u,c,f,l,h,d){for(var p,v,g=f,y=0,m=!!h&&a(h,d,3);y<c;){if(y in u){if(p=m?m(u[y],y,n):u[y],v=!1,i(p)&&(v=void 0!==(v=p[s])?!!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}},39822:(t,e,n)=>{var r=n(50994),i=n(24902),o=n(39981),a=n(50486),s=n(88087),u=n(99685),c={},f={},l=t.exports=function(t,e,n,l,h){var d,p,v,g,y=h?function(){return t}:u(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=s(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},98454:(t,e,n)=>{t.exports=n(45570)("native-function-to-string",Function.toString)},57571: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)},67384:t=>{var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},90913:(t,e,n)=>{var r=n(83886),i=n(48328);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}},87680:(t,e,n)=>{var r=n(57571).document;t.exports=r&&r.documentElement},26252:(t,e,n)=>{t.exports=!n(1216)&&!n(75338)((function(){return 7!=Object.defineProperty(n(3438)("div"),"a",{get:function(){return 7}}).a}))},70116:(t,e,n)=>{var r=n(91255),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}},18262: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)}},58579:(t,e,n)=>{var r=n(91669);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},39981:(t,e,n)=>{var r=n(89740),i=n(10341)("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||o[i]===t)}},77183:(t,e,n)=>{var r=n(91669);t.exports=Array.isArray||function(t){return"Array"==r(t)}},91272:(t,e,n)=>{var r=n(91255),i=Math.floor;t.exports=function(t){return!r(t)&&isFinite(t)&&i(t)===t}},91255:t=>{t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},58990:(t,e,n)=>{var r=n(91255),i=n(91669),o=n(10341)("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[o])?!!e:"RegExp"==i(t))}},24902:(t,e,n)=>{var r=n(50486);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}}},64529:(t,e,n)=>{"use strict";var r=n(49055),i=n(48328),o=n(25837),a={};n(90913)(a,n(10341)("iterator"),(function(){return this})),t.exports=function(t,e,n){t.prototype=r(a,{next:i(1,n)}),o(t,e+" Iterator")}},10966:(t,e,n)=>{"use strict";var r=n(62725),i=n(97044),o=n(46476),a=n(90913),s=n(89740),u=n(64529),c=n(25837),f=n(69881),l=n(10341)("iterator"),h=!([].keys&&"next"in[].keys()),d="keys",p="values",v=function(){return this};t.exports=function(t,e,n,g,y,m,b){u(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),s[e]=D,s[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 _}},62803:(t,e,n)=>{var r=n(10341)("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}},38782:t=>{t.exports=function(t,e){return{value:e,done:!!t}}},89740:t=>{t.exports={}},62725:t=>{t.exports=!1},10959: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(72987),i=Math.pow,o=i(2,-52),a=i(2,-23),s=i(2,127)*(2-a),u=i(2,-126);t.exports=Math.fround||function(t){var e,n,i=Math.abs(t),c=r(t);return i<u?c*(i/u/a+1/o-1/o)*u*a:(n=(e=(1+a/o)*i)-(e-i))>s||n!=n?c*(1/0):c*n}},61618:t=>{t.exports=Math.log1p||function(t){return(t=+t)>-1e-8&&t<1e-8?t-t*t/2:Math.log(1+t)}},72987:t=>{t.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},94278:(t,e,n)=>{var r=n(24316)("meta"),i=n(91255),o=n(67384),a=n(83886).f,s=0,u=Object.isExtensible||function(){return!0},c=!n(75338)((function(){return u(Object.preventExtensions({}))})),f=function(t){a(t,r,{value:{i:"O"+ ++s,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(!u(t))return"F";if(!e)return"E";f(t)}return t[r].i},getWeak:function(t,e){if(!o(t,r)){if(!u(t))return!0;if(!e)return!1;f(t)}return t[r].w},onFreeze:function(t){return c&&l.NEED&&u(t)&&!o(t,r)&&f(t),t}}},57485:(t,e,n)=>{var r=n(57571),i=n(17225).set,o=r.MutationObserver||r.WebKitMutationObserver,a=r.process,s=r.Promise,u="process"==n(91669)(a);t.exports=function(){var t,e,n,c=function(){var r,i;for(u&&(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(u)n=function(){a.nextTick(c)};else if(!o||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var f=s.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}}},10449:(t,e,n)=>{"use strict";var r=n(51464);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(39804),o=n(53844),a=n(14179),s=n(17583),u=n(58579),c=Object.assign;t.exports=!c||n(75338)((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=s(t),c=arguments.length,f=1,l=o.f,h=a.f;c>f;)for(var d,p=u(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},49055:(t,e,n)=>{var r=n(50486),i=n(16283),o=n(39824),a=n(93574)("IE_PROTO"),s=function(){},u=function(){var t,e=n(3438)("iframe"),r=o.length;for(e.style.display="none",n(87680).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),u=t.F;r--;)delete u.prototype[o[r]];return u()};t.exports=Object.create||function(t,e){var n;return null!==t?(s.prototype=r(t),n=new s,s.prototype=null,n[a]=t):n=u(),void 0===e?n:i(n,e)}},83886:(t,e,n)=>{var r=n(50486),i=n(26252),o=n(34467),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}},16283:(t,e,n)=>{var r=n(83886),i=n(50486),o=n(39804);t.exports=n(1216)?Object.defineProperties:function(t,e){i(t);for(var n,a=o(e),s=a.length,u=0;s>u;)r.f(t,n=a[u++],e[n]);return t}},55385:(t,e,n)=>{var r=n(14179),i=n(48328),o=n(28182),a=n(34467),s=n(67384),u=n(26252),c=Object.getOwnPropertyDescriptor;e.f=n(1216)?c:function(t,e){if(t=o(t),e=a(e,!0),u)try{return c(t,e)}catch(t){}if(s(t,e))return i(!r.f.call(t,e),t[e])}},43473:(t,e,n)=>{var r=n(28182),i=n(36907).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))}},36907:(t,e,n)=>{var r=n(60946),i=n(39824).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},53844:(t,e)=>{e.f=Object.getOwnPropertySymbols},69881:(t,e,n)=>{var r=n(67384),i=n(17583),o=n(93574)("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}},60946:(t,e,n)=>{var r=n(67384),i=n(28182),o=n(4538)(!1),a=n(93574)("IE_PROTO");t.exports=function(t,e){var n,s=i(t),u=0,c=[];for(n in s)n!=a&&r(s,n)&&c.push(n);for(;e.length>u;)r(s,n=e[u++])&&(~o(c,n)||c.push(n));return c}},39804:(t,e,n)=>{var r=n(60946),i=n(39824);t.exports=Object.keys||function(t){return r(t,i)}},14179:(t,e)=>{e.f={}.propertyIsEnumerable},10381:(t,e,n)=>{var r=n(97044),i=n(52845),o=n(75338);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)}},46460:(t,e,n)=>{var r=n(1216),i=n(39804),o=n(28182),a=n(14179).f;t.exports=function(t){return function(e){for(var n,s=o(e),u=i(s),c=u.length,f=0,l=[];c>f;)n=u[f++],r&&!a.call(s,n)||l.push(t?[n,s[n]]:s[n]);return l}}},18125:(t,e,n)=>{var r=n(36907),i=n(53844),o=n(50486),a=n(57571).Reflect;t.exports=a&&a.ownKeys||function(t){var e=r.f(o(t)),n=i.f;return n?e.concat(n(t)):e}},51885:(t,e,n)=>{var r=n(57571).parseFloat,i=n(24961).trim;t.exports=1/r(n(71644)+"-0")!=-1/0?function(t){var e=i(String(t),3),n=r(e);return 0===n&&"-"==e.charAt(0)?-0:n}:r},90343:(t,e,n)=>{var r=n(57571).parseInt,i=n(24961).trim,o=n(71644),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},79696:t=>{t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},80909:(t,e,n)=>{var r=n(50486),i=n(91255),o=n(10449);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}},48328:t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},88565:(t,e,n)=>{var r=n(46476);t.exports=function(t,e,n){for(var i in e)r(t,i,e[i],n);return t}},46476:(t,e,n)=>{var r=n(57571),i=n(90913),o=n(67384),a=n(24316)("src"),s=n(98454),u="toString",c=(""+s).split(u);n(52845).inspectSource=function(t){return s.call(t)},(t.exports=function(t,e,n,s){var u="function"==typeof n;u&&(o(n,"name")||i(n,"name",e)),t[e]!==n&&(u&&(o(n,a)||i(n,a,t[e]?""+t[e]:c.join(String(e)))),t===r?t[e]=n:s?t[e]?t[e]=n:i(t,e,n):(delete t[e],i(t,e,n)))})(Function.prototype,u,(function(){return"function"==typeof this&&this[a]||s.call(this)}))},12968:(t,e,n)=>{"use strict";var r=n(54939),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)}},69020:(t,e,n)=>{"use strict";var r,i,o=n(33649),a=RegExp.prototype.exec,s=String.prototype.replace,u=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)&&(u=function(t){var e,n,r,i,u=this;return f&&(n=new RegExp("^"+u.source+"$(?!\\s)",o.call(u))),c&&(e=u.lastIndex),r=a.call(u,t),c&&r&&(u.lastIndex=u.global?r.index+r[0].length:e),f&&r&&r.length>1&&s.call(r[0],n,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(r[i]=void 0)})),r}),t.exports=u},76962: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(91255),i=n(50486),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(50994)(Function.call,n(55385).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}},24412:(t,e,n)=>{"use strict";var r=n(57571),i=n(83886),o=n(1216),a=n(10341)("species");t.exports=function(t){var e=r[t];o&&e&&!e[a]&&i.f(e,a,{configurable:!0,get:function(){return this}})}},25837:(t,e,n)=>{var r=n(83886).f,i=n(67384),o=n(10341)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},93574:(t,e,n)=>{var r=n(45570)("keys"),i=n(24316);t.exports=function(t){return r[t]||(r[t]=i(t))}},45570:(t,e,n)=>{var r=n(52845),i=n(57571),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(62725)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},78713:(t,e,n)=>{var r=n(50486),i=n(51464),o=n(10341)("species");t.exports=function(t,e){var n,a=r(t).constructor;return void 0===a||null==(n=r(a)[o])?e:i(n)}},25296:(t,e,n)=>{"use strict";var r=n(75338);t.exports=function(t,e){return!!t&&r((function(){e?t.call(null,(function(){}),1):t.call(null)}))}},58016:(t,e,n)=>{var r=n(95845),i=n(65091);t.exports=function(t){return function(e,n){var o,a,s=String(i(e)),u=r(n),c=s.length;return u<0||u>=c?t?"":void 0:(o=s.charCodeAt(u))<55296||o>56319||u+1===c||(a=s.charCodeAt(u+1))<56320||a>57343?t?s.charAt(u):o:t?s.slice(u,u+2):a-56320+(o-55296<<10)+65536}}},25692:(t,e,n)=>{var r=n(58990),i=n(65091);t.exports=function(t,e,n){if(r(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(t))}},75264:(t,e,n)=>{var r=n(97044),i=n(75338),o=n(65091),a=/"/g,s=function(t,e,n,r){var i=String(o(t)),s="<"+e;return""!==n&&(s+=" "+n+'="'+String(r).replace(a,"&quot;")+'"'),s+">"+i+"</"+e+">"};t.exports=function(t,e){var n={};n[t]=e(s),r(r.P+r.F*i((function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3})),"String",n)}},38261:(t,e,n)=>{var r=n(88087),i=n(65458),o=n(65091);t.exports=function(t,e,n,a){var s=String(o(t)),u=s.length,c=void 0===n?" ":String(n),f=r(e);if(f<=u||""==c)return s;var l=f-u,h=i.call(c,Math.ceil(l/c.length));return h.length>l&&(h=h.slice(0,l)),a?h+s:s+h}},65458:(t,e,n)=>{"use strict";var r=n(95845),i=n(65091);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}},24961:(t,e,n)=>{var r=n(97044),i=n(65091),o=n(75338),a=n(71644),s="["+a+"]",u=RegExp("^"+s+s+"*"),c=RegExp(s+s+"*$"),f=function(t,e,n){var i={},s=o((function(){return!!a[t]()||"​…"!="​…"[t]()})),u=i[t]=s?e(l):a[t];n&&(i[n]=u),r(r.P+r.F*s,"String",i)},l=f.trim=function(t,e){return t=String(i(t)),1&e&&(t=t.replace(u,"")),2&e&&(t=t.replace(c,"")),t};t.exports=f},71644:t=>{t.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},17225:(t,e,n)=>{var r,i,o,a=n(50994),s=n(18262),u=n(87680),c=n(3438),f=n(57571),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(){s("function"==typeof t?t:Function(t),e)},r(g),g},d=function(t){delete y[t]},"process"==n(91669)(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){u.appendChild(c("script")).onreadystatechange=function(){u.removeChild(this),m.call(t)}}:function(t){setTimeout(a(m,t,1),0)}),t.exports={set:h,clear:d}},59260:(t,e,n)=>{var r=n(95845),i=Math.max,o=Math.min;t.exports=function(t,e){return(t=r(t))<0?i(t+e,0):o(t,e)}},15e3:(t,e,n)=>{var r=n(95845),i=n(88087);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}},95845:t=>{var e=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:e)(t)}},28182:(t,e,n)=>{var r=n(58579),i=n(65091);t.exports=function(t){return r(i(t))}},88087:(t,e,n)=>{var r=n(95845),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},17583:(t,e,n)=>{var r=n(65091);t.exports=function(t){return Object(r(t))}},34467:(t,e,n)=>{var r=n(91255);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")}},61063:(t,e,n)=>{"use strict";if(n(1216)){var r=n(62725),i=n(57571),o=n(75338),a=n(97044),s=n(40604),u=n(61541),c=n(50994),f=n(36903),l=n(48328),h=n(90913),d=n(88565),p=n(95845),v=n(88087),g=n(15e3),y=n(59260),m=n(34467),b=n(67384),_=n(54939),x=n(91255),w=n(17583),E=n(39981),S=n(49055),A=n(69881),T=n(36907).f,I=n(99685),C=n(24316),D=n(10341),N=n(97622),k=n(4538),R=n(78713),O=n(40163),M=n(89740),P=n(62803),G=n(24412),L=n(8676),U=n(61064),F=n(83886),j=n(55385),B=F.f,z=j.f,V=i.RangeError,W=i.TypeError,X=i.Uint8Array,H="ArrayBuffer",q="SharedArrayBuffer",Y="BYTES_PER_ELEMENT",K=Array.prototype,Z=u.ArrayBuffer,$=u.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,st=O.keys,ut=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=s.CONSTR,wt=s.TYPED,Et=s.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 V("Wrong offset!");return n},Dt=function(t){if(x(t)&&wt in t)return t;throw W(t+" is not a typed array!")},Nt=function(t,e){if(!x(t)||!(bt in t))throw W("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){B(t,e,{get:function(){return this._d[n]}})},Mt=function(t){var e,n,r,i,o,a,s=w(t),u=arguments.length,f=u>1?arguments[1]:void 0,l=void 0!==f,h=I(s);if(null!=h&&!E(h)){for(a=h.call(s),r=[],e=0;!(o=a.next()).done;e++)r.push(o.value);s=r}for(l&&u>2&&(f=c(f,arguments[2],2)),e=0,n=v(s.length),i=Nt(this,n);n>e;e++)i[e]=l?f(s[e],e):s[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))},jt=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 V(St);for(;o<i;)this[e+o]=r[o++]},Bt={entries:function(){return ut.call(Dt(this))},keys:function(){return st.call(Dt(this))},values:function(){return at.call(Dt(this))}},zt=function(t,e){return x(t)&&t[wt]&&"symbol"!=typeof e&&e in t&&String(+e)==String(e)},Vt=function(t,e){return zt(t,e=m(e,!0))?l(2,t[e]):z(t,e)},Wt=function(t,e,n){return!(zt(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?B(t,e,n):(t[e]=n.value,t)};xt||(j.f=Vt,F.f=Wt),a(a.S+a.F*!xt,"Object",{getOwnPropertyDescriptor:Vt,defineProperty:Wt}),o((function(){vt.call({})}))&&(vt=gt=function(){return ht.call(this)});var Xt=d({},Ut);d(Xt,Bt),h(Xt,yt,Bt.values),d(Xt,{slice:Ft,set:jt,constructor:function(){},toString:vt,toLocaleString:Lt}),Ot(Xt,"buffer","b"),Ot(Xt,"byteOffset","o"),Ot(Xt,"byteLength","l"),Ot(Xt,"length","e"),B(Xt,mt,{get:function(){return this[wt]}}),t.exports=function(t,e,n,u){var c=t+((u=!!u)?"Clamped":"")+"Array",l="get"+t,d="set"+t,p=i[c],y=p||{},m=p&&A(p),b=!p||!s.ABV,w={},E=p&&p.prototype,I=function(t,n){B(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;u&&(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,s,u,l=0,d=0;if(x(n)){if(!(n instanceof Z||(u=_(n))==H||u==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 V(St);if((a=y-d)<0)throw V(St)}else if((a=v(i)*e)+d>y)throw V(St);s=a/e}else s=g(n),o=new Z(a=s*e);for(h(t,"_d",{b:o,o:d,l:a,e:s,v:new $(o)});l<s;)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=Bt.values;h(p,bt,!0),h(E,wt,c),h(E,Et,!0),h(E,_t,p),(u?new p(1)[mt]==c:mt in E)||B(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:jt}),a(a.P+a.F*!D,c,Bt),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(){}},61541:(t,e,n)=>{"use strict";var r=n(57571),i=n(1216),o=n(62725),a=n(40604),s=n(90913),u=n(88565),c=n(75338),f=n(36903),l=n(95845),h=n(88087),d=n(15e3),p=n(36907).f,v=n(83886).f,g=n(8676),y=n(25837),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),s=8*n-e-1,u=(1<<s)-1,c=u>>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=u):(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>=u?(i=0,r=u):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,s+=e;s>0;a[l++]=255&r,r/=256,s-=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,s=i-7,u=n-1,c=t[u--],f=127&c;for(c>>=7;s>0;f=256*f+t[u],u--,s-=8);for(r=f&(1<<-s)-1,f>>=-s,s+=e;s>0;r=256*r+t[u],u--,s-=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 j(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]}function B(t){return[255&t]}function z(t){return[255&t,t>>8&255]}function V(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function W(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],s=o.slice(a,a+e);return r?s:s.reverse()}function Y(t,e,n,r,i,o){var a=d(+n);if(a+e>t[G])throw S(_);for(var s=t[P]._b,u=a+t[L],c=r(+i),f=0;f<e;f++)s[u+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||s(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)||u(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")),u(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 j(q(this,4,t,arguments[1]))},getUint32:function(t){return j(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,B,e)},setUint8:function(t,e){Y(this,1,t,B,e)},setInt16:function(t,e){Y(this,2,t,z,e,arguments[2])},setUint16:function(t,e){Y(this,2,t,z,e,arguments[2])},setInt32:function(t,e){Y(this,4,t,V,e,arguments[2])},setUint32:function(t,e){Y(this,4,t,V,e,arguments[2])},setFloat32:function(t,e){Y(this,4,t,X,e,arguments[2])},setFloat64:function(t,e){Y(this,8,t,W,e,arguments[2])}});y(x,m),y(w,b),s(w.prototype,a.VIEW,!0),e.ArrayBuffer=x,e.DataView=w},40604:(t,e,n)=>{for(var r,i=n(57571),o=n(90913),a=n(24316),s=a("typed_array"),u=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,s,!0),o(r.prototype,u,!0)):f=!1;t.exports={ABV:c,CONSTR:f,TYPED:s,VIEW:u}},24316:t=>{var e=0,n=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++e+n).toString(36))}},82541:(t,e,n)=>{var r=n(57571).navigator;t.exports=r&&r.userAgent||""},44664:(t,e,n)=>{var r=n(91255);t.exports=function(t,e){if(!r(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t}},66262:(t,e,n)=>{var r=n(57571),i=n(52845),o=n(62725),a=n(57686),s=n(83886).f;t.exports=function(t){var e=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||s(e,t,{value:a.f(t)})}},57686:(t,e,n)=>{e.f=n(10341)},10341:(t,e,n)=>{var r=n(45570)("wks"),i=n(24316),o=n(57571).Symbol,a="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=a&&o[t]||(a?o:i)("Symbol."+t))}).store=r},99685:(t,e,n)=>{var r=n(54939),i=n(10341)("iterator"),o=n(89740);t.exports=n(52845).getIteratorMethod=function(t){if(null!=t)return t[i]||t["@@iterator"]||o[r(t)]}},15305:(t,e,n)=>{var r=n(97044);r(r.P,"Array",{copyWithin:n(61064)}),n(24691)("copyWithin")},95015:(t,e,n)=>{"use strict";var r=n(97044),i=n(97622)(4);r(r.P+r.F*!n(25296)([].every,!0),"Array",{every:function(t){return i(this,t,arguments[1])}})},36341:(t,e,n)=>{var r=n(97044);r(r.P,"Array",{fill:n(8676)}),n(24691)("fill")},85119:(t,e,n)=>{"use strict";var r=n(97044),i=n(97622)(2);r(r.P+r.F*!n(25296)([].filter,!0),"Array",{filter:function(t){return i(this,t,arguments[1])}})},44488:(t,e,n)=>{"use strict";var r=n(97044),i=n(97622)(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(24691)(o)},95915:(t,e,n)=>{"use strict";var r=n(97044),i=n(97622)(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(24691)(o)},85788:(t,e,n)=>{"use strict";var r=n(97044),i=n(97622)(0),o=n(25296)([].forEach,!0);r(r.P+r.F*!o,"Array",{forEach:function(t){return i(this,t,arguments[1])}})},39689:(t,e,n)=>{"use strict";var r=n(50994),i=n(97044),o=n(17583),a=n(24902),s=n(39981),u=n(88087),c=n(51395),f=n(99685);i(i.S+i.F*!n(62803)((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&&s(m))for(n=new d(e=u(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}})},25377:(t,e,n)=>{"use strict";var r=n(97044),i=n(4538)(!1),o=[].indexOf,a=!!o&&1/[1].indexOf(1,-0)<0;r(r.P+r.F*(a||!n(25296)(o)),"Array",{indexOf:function(t){return a?o.apply(this,arguments)||0:i(this,t,arguments[1])}})},2247:(t,e,n)=>{var r=n(97044);r(r.S,"Array",{isArray:n(77183)})},40163:(t,e,n)=>{"use strict";var r=n(24691),i=n(38782),o=n(89740),a=n(28182);t.exports=n(10966)(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")},29026:(t,e,n)=>{"use strict";var r=n(97044),i=n(28182),o=[].join;r(r.P+r.F*(n(58579)!=Object||!n(25296)(o)),"Array",{join:function(t){return o.call(i(this),void 0===t?",":t)}})},59879:(t,e,n)=>{"use strict";var r=n(97044),i=n(28182),o=n(95845),a=n(88087),s=[].lastIndexOf,u=!!s&&1/[1].lastIndexOf(1,-0)<0;r(r.P+r.F*(u||!n(25296)(s)),"Array",{lastIndexOf:function(t){if(u)return s.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}})},67878:(t,e,n)=>{"use strict";var r=n(97044),i=n(97622)(1);r(r.P+r.F*!n(25296)([].map,!0),"Array",{map:function(t){return i(this,t,arguments[1])}})},29003:(t,e,n)=>{"use strict";var r=n(97044),i=n(51395);r(r.S+r.F*n(75338)((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}})},10646:(t,e,n)=>{"use strict";var r=n(97044),i=n(85336);r(r.P+r.F*!n(25296)([].reduceRight,!0),"Array",{reduceRight:function(t){return i(this,t,arguments.length,arguments[1],!0)}})},78059:(t,e,n)=>{"use strict";var r=n(97044),i=n(85336);r(r.P+r.F*!n(25296)([].reduce,!0),"Array",{reduce:function(t){return i(this,t,arguments.length,arguments[1],!1)}})},54088:(t,e,n)=>{"use strict";var r=n(97044),i=n(87680),o=n(91669),a=n(59260),s=n(88087),u=[].slice;r(r.P+r.F*n(75338)((function(){i&&u.call(i)})),"Array",{slice:function(t,e){var n=s(this.length),r=o(this);if(e=void 0===e?n:e,"Array"==r)return u.call(this,t,e);for(var i=a(t,n),c=a(e,n),f=s(c-i),l=new Array(f),h=0;h<f;h++)l[h]="String"==r?this.charAt(i+h):this[i+h];return l}})},83135:(t,e,n)=>{"use strict";var r=n(97044),i=n(97622)(3);r(r.P+r.F*!n(25296)([].some,!0),"Array",{some:function(t){return i(this,t,arguments[1])}})},30535:(t,e,n)=>{"use strict";var r=n(97044),i=n(51464),o=n(17583),a=n(75338),s=[].sort,u=[1,2,3];r(r.P+r.F*(a((function(){u.sort(void 0)}))||!a((function(){u.sort(null)}))||!n(25296)(s)),"Array",{sort:function(t){return void 0===t?s.call(o(this)):s.call(o(this),i(t))}})},9281:(t,e,n)=>{n(24412)("Array")},44094:(t,e,n)=>{var r=n(97044);r(r.S,"Date",{now:function(){return(new Date).getTime()}})},85013:(t,e,n)=>{var r=n(97044),i=n(44506);r(r.P+r.F*(Date.prototype.toISOString!==i),"Date",{toISOString:i})},78781:(t,e,n)=>{"use strict";var r=n(97044),i=n(17583),o=n(34467);r(r.P+r.F*n(75338)((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}})},88723:(t,e,n)=>{var r=n(10341)("toPrimitive"),i=Date.prototype;r in i||n(90913)(i,r,n(59514))},3735:(t,e,n)=>{var r=Date.prototype,i="Invalid Date",o=r.toString,a=r.getTime;new Date(NaN)+""!=i&&n(46476)(r,"toString",(function(){var t=a.call(this);return t==t?o.call(this):i}))},71765:(t,e,n)=>{var r=n(97044);r(r.P,"Function",{bind:n(78366)})},67451:(t,e,n)=>{"use strict";var r=n(91255),i=n(69881),o=n(10341)("hasInstance"),a=Function.prototype;o in a||n(83886).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}})},15747:(t,e,n)=>{var r=n(83886).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""}}})},96441:(t,e,n)=>{"use strict";var r=n(53050),i=n(44664),o="Map";t.exports=n(30859)(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)},32212:(t,e,n)=>{var r=n(97044),i=n(61618),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))}})},54230:(t,e,n)=>{var r=n(97044),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}})},69754:(t,e,n)=>{var r=n(97044),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}})},12811:(t,e,n)=>{var r=n(97044),i=n(72987);r(r.S,"Math",{cbrt:function(t){return i(t=+t)*Math.pow(Math.abs(t),1/3)}})},73998:(t,e,n)=>{var r=n(97044);r(r.S,"Math",{clz32:function(t){return(t>>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},41769:(t,e,n)=>{var r=n(97044),i=Math.exp;r(r.S,"Math",{cosh:function(t){return(i(t=+t)+i(-t))/2}})},68789:(t,e,n)=>{var r=n(97044),i=n(10959);r(r.S+r.F*(i!=Math.expm1),"Math",{expm1:i})},12848:(t,e,n)=>{var r=n(97044);r(r.S,"Math",{fround:n(7682)})},1762:(t,e,n)=>{var r=n(97044),i=Math.abs;r(r.S,"Math",{hypot:function(t,e){for(var n,r,o=0,a=0,s=arguments.length,u=0;a<s;)u<(n=i(arguments[a++]))?(o=o*(r=u/n)*r+1,u=n):o+=n>0?(r=n/u)*r:n;return u===1/0?1/0:u*Math.sqrt(o)}})},41323:(t,e,n)=>{var r=n(97044),i=Math.imul;r(r.S+r.F*n(75338)((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)}})},96063:(t,e,n)=>{var r=n(97044);r(r.S,"Math",{log10:function(t){return Math.log(t)*Math.LOG10E}})},33282:(t,e,n)=>{var r=n(97044);r(r.S,"Math",{log1p:n(61618)})},76816:(t,e,n)=>{var r=n(97044);r(r.S,"Math",{log2:function(t){return Math.log(t)/Math.LN2}})},51854:(t,e,n)=>{var r=n(97044);r(r.S,"Math",{sign:n(72987)})},63303:(t,e,n)=>{var r=n(97044),i=n(10959),o=Math.exp;r(r.S+r.F*n(75338)((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)}})},14421:(t,e,n)=>{var r=n(97044),i=n(10959),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))}})},12203:(t,e,n)=>{var r=n(97044);r(r.S,"Math",{trunc:function(t){return(t>0?Math.floor:Math.ceil)(t)}})},67454:(t,e,n)=>{"use strict";var r=n(57571),i=n(67384),o=n(91669),a=n(70116),s=n(34467),u=n(75338),c=n(36907).f,f=n(55385).f,l=n(83886).f,h=n(24961).trim,d="Number",p=r.Number,v=p,g=p.prototype,y=o(n(49055)(g))==d,m="trim"in String.prototype,b=function(t){var e=s(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,u=e.slice(2),c=0,f=u.length;c<f;c++)if((a=u.charCodeAt(c))<48||a>i)return NaN;return parseInt(u,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?u((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(46476)(r,d,p)}},17551:(t,e,n)=>{var r=n(97044);r(r.S,"Number",{EPSILON:Math.pow(2,-52)})},62929:(t,e,n)=>{var r=n(97044),i=n(57571).isFinite;r(r.S,"Number",{isFinite:function(t){return"number"==typeof t&&i(t)}})},20215:(t,e,n)=>{var r=n(97044);r(r.S,"Number",{isInteger:n(91272)})},96183:(t,e,n)=>{var r=n(97044);r(r.S,"Number",{isNaN:function(t){return t!=t}})},48190:(t,e,n)=>{var r=n(97044),i=n(91272),o=Math.abs;r(r.S,"Number",{isSafeInteger:function(t){return i(t)&&o(t)<=9007199254740991}})},30473:(t,e,n)=>{var r=n(97044);r(r.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},60948:(t,e,n)=>{var r=n(97044);r(r.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},50942:(t,e,n)=>{var r=n(97044),i=n(51885);r(r.S+r.F*(Number.parseFloat!=i),"Number",{parseFloat:i})},82870:(t,e,n)=>{var r=n(97044),i=n(90343);r(r.S+r.F*(Number.parseInt!=i),"Number",{parseInt:i})},23053:(t,e,n)=>{"use strict";var r=n(97044),i=n(95845),o=n(88347),a=n(65458),s=1..toFixed,u=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=u(r/1e7)},d=function(t){for(var e=6,n=0;--e>=0;)n+=c[e],c[e]=u(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*(!!s&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!n(75338)((function(){s.call({})}))),"Number",{toFixed:function(t){var e,n,r,s,u=o(this,f),c=i(t),g="",y=l;if(c<0||c>20)throw RangeError(f);if(u!=u)return"NaN";if(u<=-1e21||u>=1e21)return String(u);if(u<0&&(g="-",u=-u),u>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}(u*v(2,69,1))-69,n=e<0?u*v(2,-e,1):u/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+((s=y.length)<=c?"0."+a.call(l,c-s)+y:y.slice(0,s-c)+"."+y.slice(s-c)):g+y}})},88032:(t,e,n)=>{"use strict";var r=n(97044),i=n(75338),o=n(88347),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)}})},25261:(t,e,n)=>{var r=n(97044);r(r.S+r.F,"Object",{assign:n(4643)})},76051:(t,e,n)=>{var r=n(97044);r(r.S,"Object",{create:n(49055)})},29518:(t,e,n)=>{var r=n(97044);r(r.S+r.F*!n(1216),"Object",{defineProperties:n(16283)})},72640:(t,e,n)=>{var r=n(97044);r(r.S+r.F*!n(1216),"Object",{defineProperty:n(83886).f})},39788:(t,e,n)=>{var r=n(91255),i=n(94278).onFreeze;n(10381)("freeze",(function(t){return function(e){return t&&r(e)?t(i(e)):e}}))},8201:(t,e,n)=>{var r=n(28182),i=n(55385).f;n(10381)("getOwnPropertyDescriptor",(function(){return function(t,e){return i(r(t),e)}}))},7525:(t,e,n)=>{n(10381)("getOwnPropertyNames",(function(){return n(43473).f}))},40470:(t,e,n)=>{var r=n(17583),i=n(69881);n(10381)("getPrototypeOf",(function(){return function(t){return i(r(t))}}))},57940:(t,e,n)=>{var r=n(91255);n(10381)("isExtensible",(function(t){return function(e){return!!r(e)&&(!t||t(e))}}))},16129:(t,e,n)=>{var r=n(91255);n(10381)("isFrozen",(function(t){return function(e){return!r(e)||!!t&&t(e)}}))},52802:(t,e,n)=>{var r=n(91255);n(10381)("isSealed",(function(t){return function(e){return!r(e)||!!t&&t(e)}}))},59340:(t,e,n)=>{var r=n(97044);r(r.S,"Object",{is:n(76962)})},15723:(t,e,n)=>{var r=n(17583),i=n(39804);n(10381)("keys",(function(){return function(t){return i(r(t))}}))},7577:(t,e,n)=>{var r=n(91255),i=n(94278).onFreeze;n(10381)("preventExtensions",(function(t){return function(e){return t&&r(e)?t(i(e)):e}}))},61498:(t,e,n)=>{var r=n(91255),i=n(94278).onFreeze;n(10381)("seal",(function(t){return function(e){return t&&r(e)?t(i(e)):e}}))},1584:(t,e,n)=>{var r=n(97044);r(r.S,"Object",{setPrototypeOf:n(473).set})},47298:(t,e,n)=>{"use strict";var r=n(54939),i={};i[n(10341)("toStringTag")]="z",i+""!="[object z]"&&n(46476)(Object.prototype,"toString",(function(){return"[object "+r(this)+"]"}),!0)},62809:(t,e,n)=>{var r=n(97044),i=n(51885);r(r.G+r.F*(parseFloat!=i),{parseFloat:i})},82784:(t,e,n)=>{var r=n(97044),i=n(90343);r(r.G+r.F*(parseInt!=i),{parseInt:i})},47843:(t,e,n)=>{"use strict";var r,i,o,a,s=n(62725),u=n(57571),c=n(50994),f=n(54939),l=n(97044),h=n(91255),d=n(51464),p=n(36903),v=n(39822),g=n(78713),y=n(17225).set,m=n(57485)(),b=n(10449),_=n(79696),x=n(82541),w=n(80909),E="Promise",S=u.TypeError,A=u.process,T=A&&A.versions,I=T&&T.v8||"",C=u.Promise,D="process"==f(A),N=function(){},k=i=b.f,R=!!function(){try{var t=C.resolve(1),e=(t.constructor={})[n(10341)("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,s=i?e.ok:e.fail,u=e.resolve,c=e.reject,f=e.domain;try{s?(i||(2==t._h&&L(t),t._h=1),!0===s?n=r:(f&&f.enter(),n=s(r),f&&(f.exit(),a=!0)),n===e.promise?c(S("Promise-chain cycle")):(o=O(n))?o.call(n,u,c):u(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(u,(function(){var e,n,r,i=t._v,o=G(t);if(o&&(e=_((function(){D?A.emit("unhandledRejection",i,t):(n=u.onunhandledrejection)?n({promise:t,reason:i}):(r=u.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(u,(function(){var e;D?A.emit("rejectionHandled",t):(e=u.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(88565)(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(25837)(C,E),n(24412)(E),a=n(52845).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*(s||!R),E,{resolve:function(t){return w(s&&this===a?C:this,t)}}),l(l.S+l.F*!(R&&n(62803)((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 s=o++,u=!1;n.push(void 0),a++,e.resolve(t).then((function(t){u||(u=!0,n[s]=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}})},28275:(t,e,n)=>{var r=n(97044),i=n(51464),o=n(50486),a=(n(57571).Reflect||{}).apply,s=Function.apply;r(r.S+r.F*!n(75338)((function(){a((function(){}))})),"Reflect",{apply:function(t,e,n){var r=i(t),u=o(n);return a?a(r,e,u):s.call(r,e,u)}})},92552:(t,e,n)=>{var r=n(97044),i=n(49055),o=n(51464),a=n(50486),s=n(91255),u=n(75338),c=n(78366),f=(n(57571).Reflect||{}).construct,l=u((function(){function t(){}return!(f((function(){}),[],t)instanceof t)})),h=!u((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 u=n.prototype,d=i(s(u)?u:Object.prototype),p=Function.apply.call(t,d,e);return s(p)?p:d}})},83077:(t,e,n)=>{var r=n(83886),i=n(97044),o=n(50486),a=n(34467);i(i.S+i.F*n(75338)((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}}})},31838:(t,e,n)=>{var r=n(97044),i=n(55385).f,o=n(50486);r(r.S,"Reflect",{deleteProperty:function(t,e){var n=i(o(t),e);return!(n&&!n.configurable)&&delete t[e]}})},18916:(t,e,n)=>{"use strict";var r=n(97044),i=n(50486),o=function(t){this._t=i(t),this._i=0;var e,n=this._k=[];for(e in t)n.push(e)};n(64529)(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)}})},98531:(t,e,n)=>{var r=n(55385),i=n(97044),o=n(50486);i(i.S,"Reflect",{getOwnPropertyDescriptor:function(t,e){return r.f(o(t),e)}})},57323:(t,e,n)=>{var r=n(97044),i=n(69881),o=n(50486);r(r.S,"Reflect",{getPrototypeOf:function(t){return i(o(t))}})},18978:(t,e,n)=>{var r=n(55385),i=n(69881),o=n(67384),a=n(97044),s=n(91255),u=n(50486);a(a.S,"Reflect",{get:function t(e,n){var a,c,f=arguments.length<3?e:arguments[2];return u(e)===f?e[n]:(a=r.f(e,n))?o(a,"value")?a.value:void 0!==a.get?a.get.call(f):void 0:s(c=i(e))?t(c,n,f):void 0}})},3704:(t,e,n)=>{var r=n(97044);r(r.S,"Reflect",{has:function(t,e){return e in t}})},45305:(t,e,n)=>{var r=n(97044),i=n(50486),o=Object.isExtensible;r(r.S,"Reflect",{isExtensible:function(t){return i(t),!o||o(t)}})},28812:(t,e,n)=>{var r=n(97044);r(r.S,"Reflect",{ownKeys:n(18125)})},82636:(t,e,n)=>{var r=n(97044),i=n(50486),o=Object.preventExtensions;r(r.S,"Reflect",{preventExtensions:function(t){i(t);try{return o&&o(t),!0}catch(t){return!1}}})},83871:(t,e,n)=>{var r=n(97044),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}}})},51602:(t,e,n)=>{var r=n(83886),i=n(55385),o=n(69881),a=n(67384),s=n(97044),u=n(48328),c=n(50486),f=n(91255);s(s.S,"Reflect",{set:function t(e,n,s){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,s,d);p=u(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=s,r.f(d,n,l)}else r.f(d,n,u(0,s));return!0}return void 0!==p.set&&(p.set.call(d,s),!0)}})},86668:(t,e,n)=>{var r=n(57571),i=n(70116),o=n(83886).f,a=n(36907).f,s=n(58990),u=n(33649),c=r.RegExp,f=c,l=c.prototype,h=/a/g,d=/a/g,p=new c(h)!==h;if(n(1216)&&(!p||n(75338)((function(){return d[n(10341)("match")]=!1,c(h)!=h||c(d)==d||"/a/i"!=c(h,"i")})))){c=function(t,e){var n=this instanceof c,r=s(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?u.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(46476)(r,"RegExp",c)}n(24412)("RegExp")},87139:(t,e,n)=>{"use strict";var r=n(69020);n(97044)({target:"RegExp",proto:!0,forced:r!==/./.exec},{exec:r})},28686:(t,e,n)=>{n(1216)&&"g"!=/./g.flags&&n(83886).f(RegExp.prototype,"flags",{configurable:!0,get:n(33649)})},65480:(t,e,n)=>{"use strict";var r=n(50486),i=n(88087),o=n(40178),a=n(12968);n(6719)("match",1,(function(t,e,n,s){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=s(n,t,this);if(e.done)return e.value;var u=r(t),c=String(this);if(!u.global)return a(u,c);var f=u.unicode;u.lastIndex=0;for(var l,h=[],d=0;null!==(l=a(u,c));){var p=String(l[0]);h[d]=p,""===p&&(u.lastIndex=o(c,i(u.lastIndex),f)),d++}return 0===d?null:h}]}))},19121:(t,e,n)=>{"use strict";var r=n(50486),i=n(17583),o=n(88087),a=n(95845),s=n(40178),u=n(12968),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=u(l,h);if(null===b)break;if(m.push(b),!g)break;""===String(b[0])&&(l.lastIndex=s(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,s){var u=r+t.length,c=o.length,f=d;return void 0!==a&&(a=i(a),f=h),n.call(s,f,(function(n,i){var s;switch(i.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,r);case"'":return e.slice(u);case"<":s=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}s=o[f-1]}return void 0===s?"":s}))}}))},90914:(t,e,n)=>{"use strict";var r=n(50486),i=n(76962),o=n(12968);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 s=r(t),u=String(this),c=s.lastIndex;i(c,0)||(s.lastIndex=0);var f=o(s,u);return i(s.lastIndex,c)||(s.lastIndex=c),null===f?-1:f.index}]}))},37742:(t,e,n)=>{"use strict";var r=n(58990),i=n(50486),o=n(78713),a=n(40178),s=n(88087),u=n(12968),c=n(69020),f=n(75338),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,s,u=[],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&&(u.push(i.slice(l,o.index)),o.length>1&&o.index<i.length&&h.apply(u,o.slice(1)),s=o[0].length,l=a,u.length>=p));)v.lastIndex===o.index&&v.lastIndex++;return l===i.length?!s&&v.test("")||u.push(""):u.push(i.slice(l)),u.length>p?u.slice(0,p):u}:"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===u(b,h)?[h]:[];for(var x=0,w=0,E=[];w<h.length;){b.lastIndex=p?w:0;var S,A=u(b,p?h:h.slice(w));if(null===A||(S=l(s(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}]}))},96408:(t,e,n)=>{"use strict";n(28686);var r=n(50486),i=n(33649),o=n(1216),a="toString",s=/./.toString,u=function(t){n(46476)(RegExp.prototype,a,t,!0)};n(75338)((function(){return"/a/b"!=s.call({source:"a",flags:"b"})}))?u((function(){var t=r(this);return"/".concat(t.source,"/","flags"in t?t.flags:!o&&t instanceof RegExp?i.call(t):void 0)})):s.name!=a&&u((function(){return s.call(this)}))},10429:(t,e,n)=>{"use strict";var r=n(53050),i=n(44664);t.exports=n(30859)("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)},93157:(t,e,n)=>{"use strict";n(75264)("anchor",(function(t){return function(e){return t(this,"a","name",e)}}))},79791:(t,e,n)=>{"use strict";n(75264)("big",(function(t){return function(){return t(this,"big","","")}}))},92296:(t,e,n)=>{"use strict";n(75264)("blink",(function(t){return function(){return t(this,"blink","","")}}))},14555:(t,e,n)=>{"use strict";n(75264)("bold",(function(t){return function(){return t(this,"b","","")}}))},88316:(t,e,n)=>{"use strict";var r=n(97044),i=n(58016)(!1);r(r.P,"String",{codePointAt:function(t){return i(this,t)}})},7937:(t,e,n)=>{"use strict";var r=n(97044),i=n(88087),o=n(25692),a="endsWith",s="".endsWith;r(r.P+r.F*n(32910)(a),"String",{endsWith:function(t){var e=o(this,t,a),n=arguments.length>1?arguments[1]:void 0,r=i(e.length),u=void 0===n?r:Math.min(i(n),r),c=String(t);return s?s.call(e,c,u):e.slice(u-c.length,u)===c}})},66505:(t,e,n)=>{"use strict";n(75264)("fixed",(function(t){return function(){return t(this,"tt","","")}}))},4722:(t,e,n)=>{"use strict";n(75264)("fontcolor",(function(t){return function(e){return t(this,"font","color",e)}}))},59713:(t,e,n)=>{"use strict";n(75264)("fontsize",(function(t){return function(e){return t(this,"font","size",e)}}))},1028:(t,e,n)=>{var r=n(97044),i=n(59260),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("")}})},80637:(t,e,n)=>{"use strict";var r=n(97044),i=n(25692),o="includes";r(r.P+r.F*n(32910)(o),"String",{includes:function(t){return!!~i(this,t,o).indexOf(t,arguments.length>1?arguments[1]:void 0)}})},47392:(t,e,n)=>{"use strict";n(75264)("italics",(function(t){return function(){return t(this,"i","","")}}))},27938:(t,e,n)=>{"use strict";var r=n(58016)(!0);n(10966)(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})}))},64687:(t,e,n)=>{"use strict";n(75264)("link",(function(t){return function(e){return t(this,"a","href",e)}}))},96818:(t,e,n)=>{var r=n(97044),i=n(28182),o=n(88087);r(r.S,"String",{raw:function(t){for(var e=i(t.raw),n=o(e.length),r=arguments.length,a=[],s=0;n>s;)a.push(String(e[s++])),s<r&&a.push(String(arguments[s]));return a.join("")}})},8219:(t,e,n)=>{var r=n(97044);r(r.P,"String",{repeat:n(65458)})},43684:(t,e,n)=>{"use strict";n(75264)("small",(function(t){return function(){return t(this,"small","","")}}))},99029:(t,e,n)=>{"use strict";var r=n(97044),i=n(88087),o=n(25692),a="startsWith",s="".startsWith;r(r.P+r.F*n(32910)(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 s?s.call(e,r,n):e.slice(n,n+r.length)===r}})},33339:(t,e,n)=>{"use strict";n(75264)("strike",(function(t){return function(){return t(this,"strike","","")}}))},44148:(t,e,n)=>{"use strict";n(75264)("sub",(function(t){return function(){return t(this,"sub","","")}}))},77754:(t,e,n)=>{"use strict";n(75264)("sup",(function(t){return function(){return t(this,"sup","","")}}))},85557:(t,e,n)=>{"use strict";n(24961)("trim",(function(t){return function(){return t(this,3)}}))},82825:(t,e,n)=>{"use strict";var r=n(57571),i=n(67384),o=n(1216),a=n(97044),s=n(46476),u=n(94278).KEY,c=n(75338),f=n(45570),l=n(25837),h=n(24316),d=n(10341),p=n(57686),v=n(66262),g=n(66397),y=n(77183),m=n(50486),b=n(91255),_=n(17583),x=n(28182),w=n(34467),E=n(48328),S=n(49055),A=n(43473),T=n(55385),I=n(53844),C=n(83886),D=n(39804),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"),j=f("symbols"),B=f("op-symbols"),z=Object.prototype,V="function"==typeof O&&!!I.f,W=r.QObject,X=!W||!W.prototype||!W.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(z,e);r&&delete z[e],k(t,e,n),r&&t!==z&&k(z,e,r)}:k,q=function(t){var e=j[t]=S(O.prototype);return e._k=t,e},Y=V&&"symbol"==typeof O.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof O},K=function(t,e,n){return t===z&&K(B,e,n),m(t),e=w(e,!0),m(n),i(j,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===z&&i(j,t)&&!i(B,t))&&(!(e||!i(this,t)||!i(j,t)||i(this,G)&&this[G][t])||e)},J=function(t,e){if(t=x(t),e=w(e,!0),t!==z||!i(j,e)||i(B,e)){var n=N(t,e);return!n||!i(j,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(j,e=n[o++])||e==G||e==u||r.push(e);return r},tt=function(t){for(var e,n=t===z,r=R(n?B:x(t)),o=[],a=0;r.length>a;)!i(j,e=r[a++])||n&&!i(z,e)||o.push(j[e]);return o};V||(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===z&&e.call(B,n),i(this,G)&&i(this[G],t)&&(this[G][t]=!1),H(this,t,E(1,n))};return o&&X&&H(z,t,{configurable:!0,set:e}),q(t)},s(O.prototype,"toString",(function(){return this._k})),T.f=J,C.f=K,n(36907).f=A.f=Q,n(14179).f=$,I.f=tt,o&&!n(62725)&&s(z,"propertyIsEnumerable",$,!0),p.f=function(t){return q(d(t))}),a(a.G+a.W+a.F*!V,{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*!V,"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*!V,"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*(!V||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(90913)(O.prototype,L,O.prototype.valueOf),l(O,"Symbol"),l(Math,"Math",!0),l(r.JSON,"JSON",!0)},96349:(t,e,n)=>{"use strict";var r=n(97044),i=n(40604),o=n(61541),a=n(50486),s=n(59260),u=n(88087),c=n(91255),f=n(57571).ArrayBuffer,l=n(78713),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(75338)((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=s(t,n),i=s(void 0===e?n:e,n),o=new(l(this,h))(u(i-r)),c=new d(this),f=new d(o),p=0;r<i;)f.setUint8(p++,c.getUint8(r++));return o}}),n(24412)(y)},83742:(t,e,n)=>{var r=n(97044);r(r.G+r.W+r.F*!n(40604).ABV,{DataView:n(61541).DataView})},73421:(t,e,n)=>{n(61063)("Float32",4,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},56144:(t,e,n)=>{n(61063)("Float64",8,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},69363:(t,e,n)=>{n(61063)("Int16",2,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},78632:(t,e,n)=>{n(61063)("Int32",4,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},59604:(t,e,n)=>{n(61063)("Int8",1,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},16907:(t,e,n)=>{n(61063)("Uint16",2,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},1838:(t,e,n)=>{n(61063)("Uint32",4,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},72592:(t,e,n)=>{n(61063)("Uint8",1,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},79290:(t,e,n)=>{n(61063)("Uint8",1,(function(t){return function(e,n,r){return t(this,e,n,r)}}),!0)},52214:(t,e,n)=>{"use strict";var r,i=n(57571),o=n(97622)(0),a=n(46476),s=n(94278),u=n(4643),c=n(81990),f=n(91255),l=n(44664),h=n(44664),d=!i.ActiveXObject&&"ActiveXObject"in i,p="WeakMap",v=s.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(30859)(p,m,b,c,!0,!0);h&&d&&(u((r=c.getConstructor(m,p)).prototype,b),s.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(81990),i=n(44664),o="WeakSet";n(30859)(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)},67744:(t,e,n)=>{"use strict";var r=n(97044),i=n(6806),o=n(17583),a=n(88087),s=n(51464),u=n(56699);r(r.P,"Array",{flatMap:function(t){var e,n,r=o(this);return s(t),e=a(r.length),n=u(r,0),i(n,r,r,e,0,1,t,arguments[1]),n}}),n(24691)("flatMap")},75448:(t,e,n)=>{"use strict";var r=n(97044),i=n(4538)(!0);r(r.P,"Array",{includes:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),n(24691)("includes")},8938:(t,e,n)=>{var r=n(97044),i=n(46460)(!0);r(r.S,"Object",{entries:function(t){return i(t)}})},67819:(t,e,n)=>{var r=n(97044),i=n(18125),o=n(28182),a=n(55385),s=n(51395);r(r.S,"Object",{getOwnPropertyDescriptors:function(t){for(var e,n,r=o(t),u=a.f,c=i(r),f={},l=0;c.length>l;)void 0!==(n=u(r,e=c[l++]))&&s(f,e,n);return f}})},26572:(t,e,n)=>{var r=n(97044),i=n(46460)(!1);r(r.S,"Object",{values:function(t){return i(t)}})},78228:(t,e,n)=>{"use strict";var r=n(97044),i=n(52845),o=n(57571),a=n(78713),s=n(80909);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 s(e,t()).then((function(){return n}))}:t,n?function(n){return s(e,t()).then((function(){throw n}))}:t)}})},13336:(t,e,n)=>{"use strict";var r=n(97044),i=n(38261),o=n(82541),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(97044),i=n(38261),o=n(82541),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)}})},47831:(t,e,n)=>{"use strict";n(24961)("trimLeft",(function(t){return function(){return t(this,1)}}),"trimStart")},46642:(t,e,n)=>{"use strict";n(24961)("trimRight",(function(t){return function(){return t(this,2)}}),"trimEnd")},79956:(t,e,n)=>{n(66262)("asyncIterator")},44367:(t,e,n)=>{for(var r=n(40163),i=n(39804),o=n(46476),a=n(57571),s=n(90913),u=n(89740),c=n(10341),f=c("iterator"),l=c("toStringTag"),h=u.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]||s(_,f,h),_[l]||s(_,l,y),u[y]=h,m))for(g in r)_[g]||o(_,g,r[g],!0)}},21602:(t,e,n)=>{var r=n(97044),i=n(17225);r(r.G+r.B,{setImmediate:i.set,clearImmediate:i.clear})},70110:(t,e,n)=>{var r=n(57571),i=n(97044),o=n(82541),a=[].slice,s=/MSIE .\./.test(o),u=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*s,{setTimeout:u(r.setTimeout),setInterval:u(r.setInterval)})},34962:(t,e,n)=>{n(70110),n(21602),n(44367),t.exports=n(52845)},79012:(t,e,n)=>{t.exports={graphlib:n(94248),layout:n(85895),debug:n(8046),util:{time:n(91127).time,notime:n(91127).notime},version:n(62213)}},88496:(t,e,n)=>{"use strict";var r=n(66020),i=n(18946);t.exports={run:function(t){var e="greedy"===t.graph().acyclicer?i(t,function(t){return function(e){return t.edge(e).weight}}(t)):function(t){var e=[],n={},i={};return r.forEach(t.nodes(),(function o(a){r.has(i,a)||(i[a]=!0,n[a]=!0,r.forEach(t.outEdges(a),(function(t){r.has(n,t.w)?e.push(t):o(t.w)})),delete n[a])})),e}(t);r.forEach(e,(function(e){var n=t.edge(e);t.removeEdge(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,r.uniqueId("rev"))}))},undo:function(t){r.forEach(t.edges(),(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)}}))}}},93188:(t,e,n)=>{var r=n(66020),i=n(91127);function o(t,e,n,r,o,a){var s={width:0,height:0,rank:a,borderType:e},u=o[e][a-1],c=i.addDummyNode(t,"border",s,n);o[e][a]=c,t.setParent(c,r),u&&t.setEdge(u,c,{weight:1})}t.exports=function(t){r.forEach(t.children(),(function e(n){var i=t.children(n),a=t.node(n);if(i.length&&r.forEach(i,e),r.has(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var s=a.minRank,u=a.maxRank+1;s<u;++s)o(t,"borderLeft","_bl",n,a,s),o(t,"borderRight","_br",n,a,s)}}))}},26184:(t,e,n)=>{"use strict";var r=n(66020);function i(t){r.forEach(t.nodes(),(function(e){o(t.node(e))})),r.forEach(t.edges(),(function(e){o(t.edge(e))}))}function o(t){var e=t.width;t.width=t.height,t.height=e}function a(t){t.y=-t.y}function s(t){var e=t.x;t.x=t.y,t.y=e}t.exports={adjust:function(t){var e=t.graph().rankdir.toLowerCase();"lr"!==e&&"rl"!==e||i(t)},undo:function(t){var e=t.graph().rankdir.toLowerCase();"bt"!==e&&"rl"!==e||function(t){r.forEach(t.nodes(),(function(e){a(t.node(e))})),r.forEach(t.edges(),(function(e){var n=t.edge(e);r.forEach(n.points,a),r.has(n,"y")&&a(n)}))}(t),"lr"!==e&&"rl"!==e||(function(t){r.forEach(t.nodes(),(function(e){s(t.node(e))})),r.forEach(t.edges(),(function(e){var n=t.edge(e);r.forEach(n.points,s),r.has(n,"x")&&s(n)}))}(t),i(t))}}},78912:t=>{function e(){var t={};t._next=t._prev=t,this._sentinel=t}function n(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function r(t,e){if("_next"!==t&&"_prev"!==t)return e}t.exports=e,e.prototype.dequeue=function(){var t=this._sentinel,e=t._prev;if(e!==t)return n(e),e},e.prototype.enqueue=function(t){var e=this._sentinel;t._prev&&t._next&&n(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e},e.prototype.toString=function(){for(var t=[],e=this._sentinel,n=e._prev;n!==e;)t.push(JSON.stringify(n,r)),n=n._prev;return"["+t.join(", ")+"]"}},8046:(t,e,n)=>{var r=n(66020),i=n(91127),o=n(94248).Graph;t.exports={debugOrdering:function(t){var e=i.buildLayerMatrix(t),n=new o({compound:!0,multigraph:!0}).setGraph({});return r.forEach(t.nodes(),(function(e){n.setNode(e,{label:e}),n.setParent(e,"layer"+t.node(e).rank)})),r.forEach(t.edges(),(function(t){n.setEdge(t.v,t.w,{},t.name)})),r.forEach(e,(function(t,e){var i="layer"+e;n.setNode(i,{rank:"same"}),r.reduce(t,(function(t,e){return n.setEdge(t,e,{style:"invis"}),e}))})),n}}},94248:(t,e,n)=>{var r;try{r=n(75172)}catch(t){}r||(r=window.graphlib),t.exports=r},18946:(t,e,n)=>{var r=n(66020),i=n(94248).Graph,o=n(78912);t.exports=function(t,e){if(t.nodeCount()<=1)return[];var n=function(t,e){var n=new i,a=0,s=0;r.forEach(t.nodes(),(function(t){n.setNode(t,{v:t,in:0,out:0})})),r.forEach(t.edges(),(function(t){var r=n.edge(t.v,t.w)||0,i=e(t),o=r+i;n.setEdge(t.v,t.w,o),s=Math.max(s,n.node(t.v).out+=i),a=Math.max(a,n.node(t.w).in+=i)}));var c=r.range(s+a+3).map((function(){return new o})),f=a+1;return r.forEach(n.nodes(),(function(t){u(c,f,n.node(t))})),{graph:n,buckets:c,zeroIdx:f}}(t,e||a),c=function(t,e,n){for(var r,i=[],o=e[e.length-1],a=e[0];t.nodeCount();){for(;r=a.dequeue();)s(t,e,n,r);for(;r=o.dequeue();)s(t,e,n,r);if(t.nodeCount())for(var u=e.length-2;u>0;--u)if(r=e[u].dequeue()){i=i.concat(s(t,e,n,r,!0));break}}return i}(n.graph,n.buckets,n.zeroIdx);return r.flatten(r.map(c,(function(e){return t.outEdges(e.v,e.w)})),!0)};var a=r.constant(1);function s(t,e,n,i,o){var a=o?[]:void 0;return r.forEach(t.inEdges(i.v),(function(r){var i=t.edge(r),s=t.node(r.v);o&&a.push({v:r.v,w:r.w}),s.out-=i,u(e,n,s)})),r.forEach(t.outEdges(i.v),(function(r){var i=t.edge(r),o=r.w,a=t.node(o);a.in-=i,u(e,n,a)})),t.removeNode(i.v),a}function u(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)}},85895:(t,e,n)=>{"use strict";var r=n(66020),i=n(88496),o=n(72100),a=n(57055),s=n(91127).normalizeRanks,u=n(53916),c=n(91127).removeEmptyRanks,f=n(13223),l=n(93188),h=n(26184),d=n(39907),p=n(68838),v=n(91127),g=n(94248).Graph,y=n(21783);t.exports=function(t,e){var n=e&&e.debugTiming?v.time:v.notime;n("layout",(function(){e&&!e.keepNodeOrder&&e.prevGraph&&n(" inheritOrder",(function(){var n,i,o;n=t,i=e.prevGraph,o=i._nodes,r.forEach(n.nodes(),(function(t){var e=n.node(t);void 0!==o[t]?(e.fixorder=o[t]._order,delete o[t]._order):delete e.fixorder}))}));var C=n(" buildLayoutGraph",(function(){return function(t){var e=new g({multigraph:!0,compound:!0}),n=I(t.graph());return e.setGraph(r.merge({},b,T(n,m),r.pick(n,_))),r.forEach(t.nodes(),(function(n){var i=I(t.node(n));e.setNode(n,r.defaults(T(i,x),w)),e.setParent(n,t.parent(n))})),r.forEach(t.edges(),(function(n){var i=I(t.edge(n));e.setEdge(n,r.merge({},S,T(i,E),r.pick(i,A)))})),e}(t)}));e&&!1===e.edgeLabelSpace||n(" makeSpaceForEdgeLabels",(function(){!function(t){var e=t.graph();e.ranksep/=2,r.forEach(t.nodes(),(function(e){var n=t.node(e);isNaN(n.layer)||(n.layer*=2)})),r.forEach(t.edges(),(function(n){var r=t.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(C)}));try{n(" runLayout",(function(){!function(t,e,n){e(" removeSelfEdges",(function(){!function(t){r.forEach(t.edges(),(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)}}))}(t)})),e(" acyclic",(function(){i.run(t)})),e(" nestingGraph.run",(function(){f.run(t)})),e(" rank",(function(){a(v.asNonCompoundGraph(t))})),e(" injectEdgeLabelProxies",(function(){!function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);if(n.width&&n.height){var r=t.node(e.v),i={rank:(t.node(e.w).rank-r.rank)/2+r.rank,e};v.addDummyNode(t,"edge-proxy",i,"_ep")}}))}(t)})),e(" removeEmptyRanks",(function(){c(t)})),e(" nestingGraph.cleanup",(function(){f.cleanup(t)})),e(" normalizeRanks",(function(){s(t)})),e(" assignRankMinMax",(function(){!function(t){var e=0;r.forEach(t.nodes(),(function(n){var i=t.node(n);i.borderTop&&(i.minRank=t.node(i.borderTop).rank,i.maxRank=t.node(i.borderBottom).rank,e=r.max(e,i.maxRank))})),t.graph().maxRank=e}(t)})),e(" removeEdgeLabelProxies",(function(){!function(t){r.forEach(t.nodes(),(function(e){var n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))}))}(t)})),e(" normalize.run",(function(){o.run(t)})),e(" parentDummyChains",(function(){u(t)})),e(" addBorderSegments",(function(){l(t)})),n&&n.keepNodeOrder&&e(" initDataOrder",(function(){y(t,n.nodeOrder)})),e(" order",(function(){d(t)})),e(" insertSelfEdges",(function(){!function(t){var e=v.buildLayerMatrix(t);r.forEach(e,(function(e){var n=0;r.forEach(e,(function(e,i){var o=t.node(e);o.order=i+n,r.forEach(o.selfEdges,(function(e){v.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:o.rank,order:i+ ++n,e:e.e,label:e.label},"_se")})),delete o.selfEdges}))}))}(t)})),e(" adjustCoordinateSystem",(function(){h.adjust(t)})),e(" position",(function(){p(t)})),e(" positionSelfEdges",(function(){!function(t){r.forEach(t.nodes(),(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,s=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:i+2*a/3,y:o-s},{x:i+5*a/6,y:o-s},{x:i+a,y:o},{x:i+5*a/6,y:o+s},{x:i+2*a/3,y:o+s}],n.label.x=n.x,n.label.y=n.y}}))}(t)})),e(" removeBorderNodes",(function(){!function(t){r.forEach(t.nodes(),(function(e){if(t.children(e).length){var n=t.node(e),i=t.node(n.borderTop),o=t.node(n.borderBottom),a=t.node(r.last(n.borderLeft)),s=t.node(r.last(n.borderRight));n.width=Math.abs(s.x-a.x),n.height=Math.abs(o.y-i.y),n.x=a.x+n.width/2,n.y=i.y+n.height/2}})),r.forEach(t.nodes(),(function(e){"border"===t.node(e).dummy&&t.removeNode(e)}))}(t)})),e(" normalize.undo",(function(){o.undo(t)})),e(" fixupEdgeLabelCoords",(function(){!function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);if(r.has(n,"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}}))}(t)})),e(" undoCoordinateSystem",(function(){h.undo(t)})),e(" translateGraph",(function(){!function(t){var e=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,o=0,a=t.graph(),s=a.marginx||0,u=a.marginy||0;function c(t){var r=t.x,a=t.y,s=t.width,u=t.height;e=Math.min(e,r-s/2),n=Math.max(n,r+s/2),i=Math.min(i,a-u/2),o=Math.max(o,a+u/2)}r.forEach(t.nodes(),(function(e){c(t.node(e))})),r.forEach(t.edges(),(function(e){var n=t.edge(e);r.has(n,"x")&&c(n)})),e-=s,i-=u,r.forEach(t.nodes(),(function(n){var r=t.node(n);r.x-=e,r.y-=i})),r.forEach(t.edges(),(function(n){var o=t.edge(n);r.forEach(o.points,(function(t){t.x-=e,t.y-=i})),r.has(o,"x")&&(o.x-=e),r.has(o,"y")&&(o.y-=i)})),a.width=n-e+s,a.height=o-i+u}(t)})),e(" assignNodeIntersects",(function(){!function(t){r.forEach(t.edges(),(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(v.intersectRect(o,n)),i.points.push(v.intersectRect(a,r))}))}(t)})),e(" reversePoints",(function(){!function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);n.reversed&&n.points.reverse()}))}(t)})),e(" acyclic.undo",(function(){i.undo(t)}))}(C,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){r.forEach(t.nodes(),(function(n){var r=t.node(n),i=e.node(n);r&&(r.x=i.x,r.y=i.y,r._order=i.order,r._rank=i.rank,e.children(n).length&&(r.width=i.width,r.height=i.height))})),r.forEach(t.edges(),(function(n){var i=t.edge(n),o=e.edge(n);i.points=o.points,r.has(o,"x")&&(i.x=o.x,i.y=o.y)})),t.graph().width=e.graph().width,t.graph().height=e.graph().height}(t,C)}))}))};var m=["nodesep","edgesep","ranksep","marginx","marginy"],b={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},_=["acyclicer","ranker","rankdir","align"],x=["width","height","layer","fixorder"],w={width:0,height:0},E=["minlen","weight","width","height","labeloffset"],S={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},A=["labelpos"];function T(t,e){return r.mapValues(r.pick(t,e),Number)}function I(t){var e={};return r.forEach(t,(function(t,n){e[n.toLowerCase()]=t})),e}},66020:(t,e,n)=>{var r;try{r={cloneDeep:n(20250),constant:n(13503),defaults:n(28548),each:n(76934),filter:n(64725),find:n(79785),flatten:n(40151),forEach:n(99204),forIn:n(23190),has:n(99946),isUndefined:n(16513),last:n(10611),map:n(9924),mapValues:n(70642),max:n(95987),merge:n(28440),min:n(73376),minBy:n(83296),now:n(5795),pick:n(89409),range:n(60859),reduce:n(16473),sortBy:n(351),uniqueId:n(95708),values:n(81229),zipObject:n(65441)}}catch(t){}r||(r=window._),t.exports=r},13223:(t,e,n)=>{var r=n(66020),i=n(91127);function o(t,e,n,a,s,u,c){var f=t.children(c);if(f.length){var l=i.addBorderNode(t,"_bt"),h=i.addBorderNode(t,"_bb"),d=t.node(c);t.setParent(l,c),d.borderTop=l,t.setParent(h,c),d.borderBottom=h,r.forEach(f,(function(r){o(t,e,n,a,s,u,r);var i=t.node(r),f=i.borderTop?i.borderTop:r,d=i.borderBottom?i.borderBottom:r,p=i.borderTop?a:2*a,v=f!==d?1:s-u[c]+1;t.setEdge(l,f,{weight:p,minlen:v,nestingEdge:!0}),t.setEdge(d,h,{weight:p,minlen:v,nestingEdge:!0})})),t.parent(c)||t.setEdge(e,l,{weight:0,minlen:s+u[c]})}else c!==e&&t.setEdge(e,c,{weight:0,minlen:n})}t.exports={run:function(t){var e=i.addDummyNode(t,"root",{},"_root"),n=function(t){var e={};function n(i,o){var a=t.children(i);a&&a.length&&r.forEach(a,(function(t){n(t,o+1)})),e[i]=o}return r.forEach(t.children(),(function(t){n(t,1)})),e}(t),a=r.max(r.values(n))-1,s=2*a+1;t.graph().nestingRoot=e,r.forEach(t.edges(),(function(e){t.edge(e).minlen*=s}));var u=function(t){return r.reduce(t.edges(),(function(e,n){return e+t.edge(n).weight}),0)}(t)+1;r.forEach(t.children(),(function(r){o(t,e,s,u,a,n,r)})),t.graph().nodeRankFactor=s},cleanup:function(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,r.forEach(t.edges(),(function(e){t.edge(e).nestingEdge&&t.removeEdge(e)}))}}},72100:(t,e,n)=>{"use strict";var r=n(66020),i=n(91127);t.exports={run:function(t){t.graph().dummyChains=[],r.forEach(t.edges(),(function(e){!function(t,e){var n,r,o,a=e.v,s=t.node(a).rank,u=e.w,c=t.node(u).rank,f=e.name,l=t.edge(e),h=l.labelRank;if(c!==s+1){for(t.removeEdge(e),o=0,++s;s<c;++o,++s)l.points=[],r={width:0,height:0,edgeLabel:l,edgeObj:e,rank:s},n=i.addDummyNode(t,"edge",r,"_d"),s===h&&(r.width=l.width,r.height=l.height,r.dummy="edge-label",r.labelpos=l.labelpos),t.setEdge(a,n,{weight:l.weight},f),0===o&&t.graph().dummyChains.push(n),a=n;t.setEdge(a,u,{weight:l.weight},f)}}(t,e)}))},undo:function(t){r.forEach(t.graph().dummyChains,(function(e){var n,r=t.node(e),i=r.edgeLabel;for(t.setEdge(r.edgeObj,i);r.dummy;)n=t.successors(e)[0],t.removeNode(e),i.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),e=n,r=t.node(e)}))}}},28750:(t,e,n)=>{var r=n(66020);t.exports=function(t,e,n){var i,o={};r.forEach(n,(function(n){for(var r,a,s=t.parent(n);s;){if((r=t.parent(s))?(a=o[r],o[r]=s):(a=i,i=s),a&&a!==s)return void e.setEdge(a,s);s=r}}))}},48366:(t,e,n)=>{var r=n(66020);t.exports=function(t,e){return r.map(e,(function(e){var n=t.inEdges(e);if(n.length){var i=r.reduce(n,(function(e,n){var r=t.edge(n),i=t.node(n.v);return{sum:e.sum+r.weight*i.order,weight:e.weight+r.weight}}),{sum:0,weight:0});return{v:e,barycenter:i.sum/i.weight,weight:i.weight}}return{v:e}}))}},15434:(t,e,n)=>{var r=n(66020),i=n(94248).Graph;t.exports=function(t,e,n){var o=function(t){for(var e;t.hasNode(e=r.uniqueId("_root")););return e}(t),a=new i({compound:!0}).setGraph({root:o}).setDefaultNodeLabel((function(e){return t.node(e)}));return r.forEach(t.nodes(),(function(i){var s=t.node(i),u=t.parent(i);(s.rank===e||s.minRank<=e&&e<=s.maxRank)&&(a.setNode(i),a.setParent(i,u||o),r.forEach(t[n](i),(function(e){var n=e.v===i?e.w:e.v,o=a.edge(n,i),s=r.isUndefined(o)?0:o.weight;a.setEdge(n,i,{weight:t.edge(e).weight+s})})),r.has(s,"minRank")&&a.setNode(i,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]}))})),a}},9326:(t,e,n)=>{"use strict";var r=n(66020);function i(t,e,n){for(var i=r.zipObject(n,r.map(n,(function(t,e){return e}))),o=r.flatten(r.map(e,(function(e){return r.sortBy(r.map(t.outEdges(e),(function(e){return{pos:i[e.w],weight:t.edge(e).weight}})),"pos")})),!0),a=1;a<n.length;)a<<=1;var s=2*a-1;a-=1;var u=r.map(new Array(s),(function(){return 0})),c=0;return r.forEach(o.forEach((function(t){var e=t.pos+a;u[e]+=t.weight;for(var n=0;e>0;)e%2&&(n+=u[e+1]),u[e=e-1>>1]+=t.weight;c+=t.weight*n}))),c}t.exports=function(t,e){for(var n=0,r=1;r<e.length;++r)n+=i(t,e[r-1],e[r]);return n}},39907:(t,e,n)=>{"use strict";var r=n(66020),i=n(76849),o=n(9326),a=n(98144),s=n(15434),u=n(28750),c=n(94248).Graph,f=n(91127);function l(t,e,n){return r.map(e,(function(e){return s(t,e,n)}))}function h(t,e,n){var i=new c;r.forEach(t,(function(t){var o=t.graph().root,s=a(t,o,i,e,n);r.forEach(s.vs,(function(e,n){t.node(e).order=n})),u(t,i,s.vs)}))}function d(t,e){r.forEach(e,(function(e){r.forEach(e,(function(e,n){t.node(e).order=n}))}))}t.exports=function(t){var e=f.maxRank(t),n=l(t,r.range(1,e+1),"inEdges"),a=l(t,r.range(e-1,-1,-1),"outEdges"),s=i(t);d(t,s);for(var u,c=Number.POSITIVE_INFINITY,p=0,v=0;v<4;++p,++v){h(p%2?n:a,p%4>=2),s=f.buildLayerMatrix(t);var g=o(t,s);g<c&&(v=0,u=r.cloneDeep(s),c=g)}for(d(t,s=i(t)),p=0,v=0;v<4;++p,++v)h(p%2?n:a,p%4>=2,!0),s=f.buildLayerMatrix(t),(g=o(t,s))<c&&(v=0,u=r.cloneDeep(s),c=g);d(t,u)}},21783:(t,e,n)=>{"use strict";var r=n(66020);t.exports=function(t,e){var n=r.filter(t.nodes(),(function(e){return!t.children(e).length})),i=r.max(r.map(n,(function(e){return t.node(e).rank}))),o=r.map(r.range(i+1),(function(){return[]}));r.forEach(e,(function(e){var n=t.node(e);n.dummy||(n.fixorder=o[n.rank].length,o[n.rank].push(e))}))}},76849:(t,e,n)=>{"use strict";var r=n(66020);t.exports=function(t){var e={},n=r.filter(t.nodes(),(function(e){return!t.children(e).length})),i=r.max(r.map(n,(function(e){return t.node(e).rank}))),o=r.map(r.range(i+1),(function(){return[]})),a=r.sortBy(n,(function(e){return t.node(e).rank})),s=r.sortBy(r.filter(a,(function(e){return void 0!==t.node(e).fixorder})),(function(e){return t.node(e).fixorder}));return r.forEach(s,(function(n){o[t.node(n).rank].push(n),e[n]=!0})),r.forEach(a,(function n(i){if(!r.has(e,i)){e[i]=!0;var a=t.node(i);o[a.rank].push(i),r.forEach(t.successors(i),n)}})),o}},51910:(t,e,n)=>{"use strict";var r=n(66020);t.exports=function(t,e){var n={};return r.forEach(t,(function(t,e){var i=n[t.v]={indegree:0,in:[],out:[],vs:[t.v],i:e};r.isUndefined(t.barycenter)||(i.barycenter=t.barycenter,i.weight=t.weight)})),r.forEach(e.edges(),(function(t){var e=n[t.v],i=n[t.w];r.isUndefined(e)||r.isUndefined(i)||(i.indegree++,e.out.push(n[t.w]))})),function(t){var e=[];function n(t){return function(e){var n,i,o,a;e.merged||(r.isUndefined(e.barycenter)||r.isUndefined(t.barycenter)||e.barycenter>=t.barycenter)&&(i=e,o=0,a=0,(n=t).weight&&(o+=n.barycenter*n.weight,a+=n.weight),i.weight&&(o+=i.barycenter*i.weight,a+=i.weight),n.vs=i.vs.concat(n.vs),n.barycenter=o/a,n.weight=a,n.i=Math.min(i.i,n.i),i.merged=!0)}}function i(e){return function(n){n.in.push(e),0==--n.indegree&&t.push(n)}}for(;t.length;){var o=t.pop();e.push(o),r.forEach(o.in.reverse(),n(o)),r.forEach(o.out,i(o))}return r.map(r.filter(e,(function(t){return!t.merged})),(function(t){return r.pick(t,["vs","i","barycenter","weight"])}))}(r.filter(n,(function(t){return!t.indegree})))}},98144:(t,e,n)=>{var r=n(66020),i=n(48366),o=n(51910),a=n(22988);t.exports=function t(e,n,s,u,c){var f=e.children(n),l=e.node(n),h=l?l.borderLeft:void 0,d=l?l.borderRight:void 0,p={};h&&(f=r.filter(f,(function(t){return t!==h&&t!==d})));var v=i(e,f);r.forEach(v,(function(n){if(e.children(n.v).length){var i=t(e,n.v,s,u);p[n.v]=i,r.has(i,"barycenter")&&(o=n,a=i,r.isUndefined(o.barycenter)?(o.barycenter=a.barycenter,o.weight=a.weight):(o.barycenter=(o.barycenter*o.weight+a.barycenter*a.weight)/(o.weight+a.weight),o.weight+=a.weight))}var o,a}));var g=o(v,s);(function(t,e){r.forEach(t,(function(t){t.vs=r.flatten(t.vs.map((function(t){return e[t]?e[t].vs:t})),!0)}))})(g,p),r.forEach(g,(function(t){var n=e.node(t.vs[0]);t.fixorder=n.fixorder,t.order=n.order}));var y=a(g,u,c);if(h&&(y.vs=r.flatten([h,y.vs,d],!0),e.predecessors(h).length)){var m=e.node(e.predecessors(h)[0]),b=e.node(e.predecessors(d)[0]);r.has(y,"barycenter")||(y.barycenter=0,y.weight=0),y.barycenter=(y.barycenter*y.weight+m.order+b.order)/(y.weight+2),y.weight+=2}return y}},22988:(t,e,n)=>{var r=n(66020),i=n(91127);function o(t,e,n){for(var i;e.length&&(i=r.last(e)).i<=n;)e.pop(),t.push(i.vs),n++;return n}t.exports=function(t,e,n){var a=i.partition(t,(function(t){return r.has(t,"fixorder")&&!isNaN(t.fixorder)||r.has(t,"barycenter")})),s=a.lhs,u=r.sortBy(a.rhs,(function(t){return-t.i})),c=[],f=0,l=0,h=0;s.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)),h=o(c,u,h),r.forEach(s,(function(t){h+=t.vs.length,c.push(t.vs),f+=t.barycenter*t.weight,l+=t.weight,h=o(c,u,h)}));var d={vs:r.flatten(c,!0)};return l&&(d.barycenter=f/l,d.weight=l),d}},53916:(t,e,n)=>{var r=n(66020);t.exports=function(t){var e=function(t){var e={},n=0;return r.forEach(t.children(),(function i(o){var a=n;r.forEach(t.children(o),i),e[o]={low:a,lim:n++}})),e}(t);r.forEach(t.graph().dummyChains,(function(n){for(var r=t.node(n),i=r.edgeObj,o=function(t,e,n,r){var i,o,a=[],s=[],u=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>u||c>e[i].lim));for(o=i,i=r;(i=t.parent(i))!==o;)s.push(i);return{path:a.concat(s.reverse()),lca:o}}(t,e,i.v,i.w),a=o.path,s=o.lca,u=0,c=a[u],f=!0;n!==i.w;){if(r=t.node(n),f){for(;(c=a[u])!==s&&t.node(c).maxRank<r.rank;)u++;c===s&&(f=!1)}if(!f){for(;u<a.length-1&&t.node(c=a[u+1]).minRank<=r.rank;)u++;c=a[u]}t.setParent(n,c),n=t.successors(n)[0]}}))}},37643:(t,e,n)=>{"use strict";var r=n(66020),i=n(94248).Graph,o=n(91127);function a(t,e){var n={};return r.reduce(e,(function(e,i){var o=0,a=0,s=e.length,c=r.last(i);return r.forEach(i,(function(e,f){var l=function(t,e){if(t.node(e).dummy)return r.find(t.predecessors(e),(function(e){return t.node(e).dummy}))}(t,e),h=l?t.node(l).order:s;(l||e===c)&&(r.forEach(i.slice(a,f+1),(function(e){r.forEach(t.predecessors(e),(function(r){var i=t.node(r),a=i.order;!(a<o||h<a)||i.dummy&&t.node(e).dummy||u(n,r,e)}))})),a=f+1,o=h)})),i})),n}function s(t,e){var n={};function i(e,i,o,a,s){var c;r.forEach(r.range(i,o),(function(i){c=e[i],t.node(c).dummy&&r.forEach(t.predecessors(c),(function(e){var r=t.node(e);r.dummy&&(r.order<a||r.order>s)&&u(n,e,c)}))}))}return r.reduce(e,(function(e,n){var o,a=-1,s=0;return r.forEach(n,(function(r,u){if("border"===t.node(r).dummy){var c=t.predecessors(r);c.length&&(o=t.node(c[0]).order,i(n,s,u,a,o),s=u,a=o)}i(n,s,n.length,o,e.length)})),n})),n}function u(t,e,n){if(e>n){var r=e;e=n,n=r}var i=t[e];i||(t[e]=i={}),i[n]=!0}function c(t,e,n){if(e>n){var i=e;e=n,n=i}return r.has(t[e],n)}function f(t,e,n,i){var o={},a={},s={};return r.forEach(e,(function(t){r.forEach(t,(function(t,e){o[t]=t,a[t]=t,s[t]=e}))})),r.forEach(e,(function(t){var e=-1;r.forEach(t,(function(t){var u=i(t);if(u.length){u=r.sortBy(u,(function(t){return s[t]}));for(var f=(u.length-1)/2,l=Math.floor(f),h=Math.ceil(f);l<=h;++l){var d=u[l];a[t]===t&&e<s[d]&&!c(n,t,d)&&(a[d]=t,a[t]=o[t]=o[d],e=s[d])}}}))})),{root:o,align:a}}function l(t,e,n,o,a){var s={},u=function(t,e,n,o){var a=new i,s=t.graph(),u=function(t,e,n){return function(i,o,a){var s,u=i.node(o),c=i.node(a),f=0;if(f+=u.width/2,r.has(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":s=-u.width/2;break;case"r":s=u.width/2}if(s&&(f+=n?s:-s),s=0,f+=(u.dummy?e:t)/2,f+=(c.dummy?e:t)/2,f+=c.width/2,r.has(c,"labelpos"))switch(c.labelpos.toLowerCase()){case"l":s=c.width/2;break;case"r":s=-c.width/2}return s&&(f+=n?s:-s),s=0,f}}(s.nodesep,s.edgesep,o);return r.forEach(e,(function(e){var i;r.forEach(e,(function(e){var r=n[e];if(a.setNode(r),i){var o=n[i],s=a.edge(o,r);a.setEdge(o,r,Math.max(u(t,e,i),s||0))}i=e}))})),a}(t,e,n,a),c=a?"borderLeft":"borderRight";function f(t,e){for(var n=u.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 f((function(t){s[t]=u.inEdges(t).reduce((function(t,e){return Math.max(t,s[e.v]+u.edge(e))}),0)}),u.predecessors.bind(u)),f((function(e){var n=u.outEdges(e).reduce((function(t,e){return Math.min(t,s[e.w]-u.edge(e))}),Number.POSITIVE_INFINITY),r=t.node(e);n!==Number.POSITIVE_INFINITY&&r.borderType!==c&&(s[e]=Math.max(s[e],n))}),u.successors.bind(u)),r.forEach(o,(function(t){s[t]=s[n[t]]})),s}function h(t,e){return r.minBy(r.values(e),(function(e){var n=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return r.forIn(e,(function(e,r){var o=function(t,e){return t.node(e).width}(t,r)/2;n=Math.max(e+o,n),i=Math.min(e-o,i)})),n-i}))}function d(t,e){var n=r.values(e),i=r.min(n),o=r.max(n);r.forEach(["u","d"],(function(n){r.forEach(["l","r"],(function(a){var s,u=n+a,c=t[u];if(c!==e){var f=r.values(c);(s="l"===a?i-r.min(f):o-r.max(f))&&(t[u]=r.mapValues(c,(function(t){return t+s})))}}))}))}function p(t,e){return r.mapValues(t.ul,(function(n,i){if(e)return t[e.toLowerCase()][i];var o=r.sortBy(r.map(t,i));return(o[1]+o[2])/2}))}t.exports={positionX:function(t){var e,n=o.buildLayerMatrix(t),i=r.merge(a(t,n),s(t,n)),u={};r.forEach(["u","d"],(function(o){e="u"===o?n:r.values(n).reverse(),r.forEach(["l","r"],(function(n){"r"===n&&(e=r.map(e,(function(t){return r.values(t).reverse()})));var a=("u"===o?t.predecessors:t.successors).bind(t),s=f(0,e,i,a),c=l(t,e,s.root,s.align,"r"===n);"r"===n&&(c=r.mapValues(c,(function(t){return-t}))),u[o+n]=c}))}));var c=h(t,u);return d(u,c),p(u,t.graph().align)},findType1Conflicts:a,findType2Conflicts:s,addConflict:u,hasConflict:c,verticalAlignment:f,horizontalCompaction:l,alignCoordinates:d,findSmallestWidthAlignment:h,balance:p}},68838:(t,e,n)=>{"use strict";var r=n(66020),i=n(91127),o=n(37643).positionX;t.exports=function(t){(function(t){var e=i.buildLayerMatrix(t),n=t.graph().ranksep,o=0;r.forEach(e,(function(e){var i=r.max(r.map(e,(function(e){return t.node(e).height})));r.forEach(e,(function(e){t.node(e).y=o+i/2})),o+=i+n}))})(t=i.asNonCompoundGraph(t)),r.forEach(o(t),(function(e,n){t.node(n).x=e}))}},36795:(t,e,n)=>{"use strict";var r=n(66020),i=n(94248).Graph,o=n(44939).slack;function a(t,e){return r.forEach(t.nodes(),(function n(i){r.forEach(e.nodeEdges(i),(function(r){var a=r.v,s=i===a?r.w:a;t.hasNode(s)||o(e,r)||(t.setNode(s,{}),t.setEdge(i,s,{}),n(s))}))})),t.nodeCount()}function s(t,e){return r.forEach(t.nodes(),(function n(i){r.forEach(e.nodeEdges(i),(function(r){var a=r.v,s=i===a?r.w:a;t.hasNode(s)||void 0===e.node(s).layer&&o(e,r)||(t.setNode(s,{}),t.setEdge(i,s,{}),n(s))}))})),t.nodeCount()}function u(t,e){return r.minBy(e.edges(),(function(n){if(t.hasNode(n.v)!==t.hasNode(n.w))return o(e,n)}))}function c(t,e,n){r.forEach(t.nodes(),(function(t){e.node(t).rank+=n}))}t.exports={feasibleTree:function(t){var e,n,r=new i({directed:!1}),s=t.nodes()[0],f=t.nodeCount();for(r.setNode(s,{});a(r,t)<f;)e=u(r,t),n=r.hasNode(e.v)?o(t,e):-o(t,e),c(r,t,n);return r},feasibleTreeWithLayer:function(t){var e,n,r=new i({directed:!1}),a=t.nodes()[0],f=t.nodeCount();for(r.setNode(a,{});s(r,t)<f;)e=u(r,t),n=r.hasNode(e.v)?o(t,e):-o(t,e),c(r,t,n);return r}}},57055:(t,e,n)=>{"use strict";var r=n(44939).longestPathWithLayer,i=n(36795).feasibleTreeWithLayer,o=n(10893);t.exports=function(t){switch(t.graph().ranker){case"network-simplex":!function(t){o(t)}(t);break;default:!function(t){r(t),i(t)}(t);break;case"longest-path":a(t)}};var a=r},10893:(t,e,n)=>{"use strict";var r=n(66020),i=n(36795).feasibleTree,o=n(44939).slack,a=n(44939).longestPath,s=n(94248).alg.preorder,u=n(94248).alg.postorder,c=n(91127).simplify;function f(t){t=c(t),a(t);var e,n=i(t);for(d(n),l(n,t);e=v(n);)y(n,t,e,g(n,t,e))}function l(t,e){var n=u(t,t.nodes());n=n.slice(0,n.length-1),r.forEach(n,(function(n){!function(t,e,n){var r=t.node(n).parent;t.edge(n,r).cutvalue=h(t,e,n)}(t,e,n)}))}function h(t,e,n){var i=t.node(n).parent,o=!0,a=e.edge(n,i),s=0;return a||(o=!1,a=e.edge(i,n)),s=a.weight,r.forEach(e.nodeEdges(n),(function(r){var a,u,c=r.v===n,f=c?r.w:r.v;if(f!==i){var l=c===o,h=e.edge(r).weight;if(s+=l?h:-h,a=n,u=f,t.hasEdge(a,u)){var d=t.edge(n,f).cutvalue;s+=l?-d:d}}})),s}function d(t,e){arguments.length<2&&(e=t.nodes()[0]),p(t,{},1,e)}function p(t,e,n,i,o){var a=n,s=t.node(i);return e[i]=!0,r.forEach(t.neighbors(i),(function(o){r.has(e,o)||(n=p(t,e,n,o,i))})),s.low=a,s.lim=n++,o?s.parent=o:delete s.parent,n}function v(t){return r.find(t.edges(),(function(e){return t.edge(e).cutvalue<0}))}function g(t,e,n){var i=n.v,a=n.w;e.hasEdge(i,a)||(i=n.w,a=n.v);var s=t.node(i),u=t.node(a),c=s,f=!1;s.lim>u.lim&&(c=u,f=!0);var l=r.filter(e.edges(),(function(e){return f===m(0,t.node(e.v),c)&&f!==m(0,t.node(e.w),c)}));return r.minBy(l,(function(t){return o(e,t)}))}function y(t,e,n,i){var o=n.v,a=n.w;t.removeEdge(o,a),t.setEdge(i.v,i.w,{}),d(t),l(t,e),function(t,e){var n=r.find(t.nodes(),(function(t){return!e.node(t).parent})),i=s(t,n);i=i.slice(1),r.forEach(i,(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)}))}(t,e)}function m(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}t.exports=f,f.initLowLimValues=d,f.initCutValues=l,f.calcCutValue=h,f.leaveEdge=v,f.enterEdge=g,f.exchangeEdges=y},44939:(t,e,n)=>{"use strict";var r=n(66020);t.exports={longestPath:function(t){var e={};r.forEach(t.sources(),(function n(i){var o=t.node(i);if(r.has(e,i))return o.rank;e[i]=!0;var a=r.min(r.map(t.outEdges(i),(function(e){return n(e.w)-t.edge(e).minlen})));return a!==Number.POSITIVE_INFINITY&&null!=a||(a=0),o.rank=a}))},longestPathWithLayer:function(t){var e={},n=0;function i(e,n){var o=t.node(e),a=isNaN(o.layer)?n:o.layer;(void 0===o.rank||o.rank<a)&&(o.rank=a),r.map(t.outEdges(e),(function(e){i(e.w,a+t.edge(e).minlen)}))}r.forEach(t.sources(),(function i(o){var a=t.node(o);if(r.has(e,o))return a.rank;e[o]=!0;var s=r.min(r.map(t.outEdges(o),(function(e){return i(e.w)-t.edge(e).minlen})));return s!==Number.POSITIVE_INFINITY&&null!=s||(s=0),a.rank=s,n=Math.min(a.rank,n),a.rank})),n+=1,t.nodes().forEach((function(e){var r=t.node(e);isNaN(r.layer)?r.rank-=n:i(e,r.layer)}))},slack:function(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}}},91127:(t,e,n)=>{"use strict";var r=n(66020),i=n(94248).Graph;function o(t,e,n,i){var o;do{o=r.uniqueId(i)}while(t.hasNode(o));return n.dummy=e,t.setNode(o,n),o}function a(t){return r.max(r.map(t.nodes(),(function(e){var n=t.node(e).rank;if(!r.isUndefined(n))return n})))}t.exports={addDummyNode:o,simplify:function(t){var e=(new i).setGraph(t.graph());return r.forEach(t.nodes(),(function(n){e.setNode(n,t.node(n))})),r.forEach(t.edges(),(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},asNonCompoundGraph:function(t){var e=new i({multigraph:t.isMultigraph()}).setGraph(t.graph());return r.forEach(t.nodes(),(function(n){t.children(n).length||e.setNode(n,t.node(n))})),r.forEach(t.edges(),(function(n){e.setEdge(n,t.edge(n))})),e},successorWeights:function(t){var e=r.map(t.nodes(),(function(e){var n={};return r.forEach(t.outEdges(e),(function(e){n[e.w]=(n[e.w]||0)+t.edge(e).weight})),n}));return r.zipObject(t.nodes(),e)},predecessorWeights:function(t){var e=r.map(t.nodes(),(function(e){var n={};return r.forEach(t.inEdges(e),(function(e){n[e.v]=(n[e.v]||0)+t.edge(e).weight})),n}));return r.zipObject(t.nodes(),e)},intersectRect:function(t,e){var n,r,i=t.x,o=t.y,a=e.x-i,s=e.y-o,u=t.width/2,c=t.height/2;if(!a&&!s)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(s)*u>Math.abs(a)*c?(s<0&&(c=-c),n=c*a/s,r=c):(a<0&&(u=-u),n=u,r=u*s/a),{x:i+n,y:o+r}},buildLayerMatrix:function(t){var e=r.map(r.range(a(t)+1),(function(){return[]}));return r.forEach(t.nodes(),(function(n){var i=t.node(n),o=i.rank;r.isUndefined(o)||(e[o][i.order]=n)})),e},normalizeRanks:function(t){var e=r.min(r.map(t.nodes(),(function(e){return t.node(e).rank})));r.forEach(t.nodes(),(function(n){var i=t.node(n);r.has(i,"rank")&&(i.rank-=e)}))},removeEmptyRanks:function(t){var e=r.min(r.map(t.nodes(),(function(e){return t.node(e).rank}))),n=[];r.forEach(t.nodes(),(function(r){var i=t.node(r).rank-e;n[i]||(n[i]=[]),n[i].push(r)}));var i=0,o=t.graph().nodeRankFactor;r.forEach(n,(function(e,n){r.isUndefined(e)&&n%o!=0?--i:i&&r.forEach(e,(function(e){t.node(e).rank+=i}))}))},addBorderNode:function(t,e,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),o(t,"border",i,e)},maxRank:a,partition:function(t,e){var n={lhs:[],rhs:[]};return r.forEach(t,(function(t){e(t)?n.lhs.push(t):n.rhs.push(t)})),n},time:function(t,e){var n=r.now();try{return e()}finally{console.log(t+" time: "+(r.now()-n)+"ms")}},notime:function(t,e){return e()}}},62213:t=>{t.exports="0.1.1"},45229: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}},65375:t=>{t.exports=function(t){var e=new Float32Array(2);return e[0]=t[0],e[1]=t[1],e}},63422:t=>{t.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t}},25128:t=>{t.exports=function(){var t=new Float32Array(2);return t[0]=0,t[1]=0,t}},80134: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}},87878:(t,e,n)=>{t.exports=n(42274)},42274:t=>{t.exports=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)}},26770:(t,e,n)=>{t.exports=n(87622)},87622: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)},26066:t=>{t.exports=function(t,e){return t[0]===e[0]&&t[1]===e[1]}},74860:t=>{t.exports=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}},88926:(t,e,n)=>{t.exports=function(t,e,n,i,o,a){var s,u;for(e||(e=2),n||(n=0),u=i?Math.min(i*e+n,t.length):t.length,s=n;s<u;s+=e)r[0]=t[s],r[1]=t[s+1],o(r,r,a),t[s]=r[0],t[s+1]=r[1];return t};var r=n(25128)()},24697:t=>{t.exports=function(t,e){var n=new Float32Array(2);return n[0]=t,n[1]=e,n}},81602:(t,e,n)=>{t.exports={EPSILON:n(2157),create:n(25128),clone:n(65375),fromValues:n(24697),copy:n(63422),set:n(96765),equals:n(6922),exactEquals:n(26066),add:n(45229),subtract:n(24186),sub:n(5302),multiply:n(3848),mul:n(31665),divide:n(87622),div:n(26770),inverse:n(81873),min:n(56780),max:n(39564),rotate:n(68615),floor:n(74860),ceil:n(8356),round:n(87313),scale:n(91838),scaleAndAdd:n(77781),distance:n(42274),dist:n(87878),squaredDistance:n(76534),sqrDist:n(34969),length:n(80360),len:n(92256),squaredLength:n(95476),sqrLen:n(15375),negate:n(80388),normalize:n(95927),dot:n(6064),cross:n(80134),lerp:n(91099),random:n(60679),transformMat2:n(30367),transformMat2d:n(50655),transformMat3:n(32730),transformMat4:n(54020),forEach:n(88926),limit:n(48709)}},81873:t=>{t.exports=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}},92256:(t,e,n)=>{t.exports=n(80360)},80360:t=>{t.exports=function(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)}},91099: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}},48709: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}},39564: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}},56780: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}},31665:(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}},80388:t=>{t.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t}},95927: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}},60679: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}},68615: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}},87313:t=>{t.exports=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}},91838:t=>{t.exports=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}},77781:t=>{t.exports=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t}},96765:t=>{t.exports=function(t,e,n){return t[0]=e,t[1]=n,t}},34969:(t,e,n)=>{t.exports=n(76534)},15375:(t,e,n)=>{t.exports=n(95476)},76534:t=>{t.exports=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}},95476:t=>{t.exports=function(t){var e=t[0],n=t[1];return e*e+n*n}},5302:(t,e,n)=>{t.exports=n(24186)},24186:t=>{t.exports=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}},30367: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}},50655: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}},32730: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}},54020: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}},75172:(t,e,n)=>{var r=n(89224);t.exports={Graph:r.Graph,json:n(17401),alg:n(54613),version:r.version}},91606:(t,e,n)=>{var r=n(95329);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}},21482:(t,e,n)=>{var r=n(95329);function i(t,e,n,o,a,s){r.has(o,e)||(o[e]=!0,n||s.push(e),r.each(a(e),(function(e){i(t,e,n,o,a,s)})),n&&s.push(e))}t.exports=function(t,e,n){r.isArray(e)||(e=[e]);var o=(t.isDirected()?t.successors:t.neighbors).bind(t),a=[],s={};return r.each(e,(function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);i(t,e,"post"===n,s,o,a)})),a}},40845:(t,e,n)=>{var r=n(13746),i=n(95329);t.exports=function(t,e,n){return i.transform(t.nodes(),(function(i,o){i[o]=r(t,o,e,n)}),{})}},13746:(t,e,n)=>{var r=n(95329),i=n(36614);t.exports=function(t,e,n,r){return function(t,e,n,r){var o,a,s={},u=new i,c=function(t){var e=t.v!==o?t.v:t.w,r=s[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,u.decrease(e,c))};for(t.nodes().forEach((function(t){var n=t===e?0:Number.POSITIVE_INFINITY;s[t]={distance:n},u.add(t,n)}));u.size()>0&&(o=u.removeMin(),(a=s[o]).distance!==Number.POSITIVE_INFINITY);)r(o).forEach(c);return s}(t,String(e),n||o,r||function(e){return t.outEdges(e)})};var o=r.constant(1)},59324:(t,e,n)=>{var r=n(95329),i=n(94558);t.exports=function(t){return r.filter(i(t),(function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])}))}},22893:(t,e,n)=>{var r=n(95329);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],s=r.distance+i.distance;s<a.distance&&(a.distance=s,a.predecessor=i.predecessor)}))}))})),r}(t,e||i,n||function(e){return t.outEdges(e)})};var i=r.constant(1)},54613:(t,e,n)=>{t.exports={components:n(91606),dijkstra:n(13746),dijkstraAll:n(40845),findCycles:n(59324),floydWarshall:n(22893),isAcyclic:n(588),postorder:n(98049),preorder:n(67158),prim:n(66058),tarjan:n(94558),topsort:n(7793)}},588:(t,e,n)=>{var r=n(7793);t.exports=function(t){try{r(t)}catch(t){if(t instanceof r.CycleException)return!1;throw t}return!0}},98049:(t,e,n)=>{var r=n(21482);t.exports=function(t,e){return r(t,e,"post")}},67158:(t,e,n)=>{var r=n(21482);t.exports=function(t,e){return r(t,e,"pre")}},66058:(t,e,n)=>{var r=n(95329),i=n(6349),o=n(36614);t.exports=function(t,e){var n,a=new i,s={},u=new o;function c(t){var r=t.v===n?t.w:t.v,i=u.priority(r);if(void 0!==i){var o=e(t);o<i&&(s[r]=n,u.decrease(r,o))}}if(0===t.nodeCount())return a;r.each(t.nodes(),(function(t){u.add(t,Number.POSITIVE_INFINITY),a.setNode(t)})),u.decrease(t.nodes()[0],0);for(var f=!1;u.size()>0;){if(n=u.removeMin(),r.has(s,n))a.setEdge(n,s[n]);else{if(f)throw new Error("Input graph is not connected: "+t);f=!0}t.nodeEdges(n).forEach(c)}return a}},94558:(t,e,n)=>{var r=n(95329);t.exports=function(t){var e=0,n=[],i={},o=[];function a(s){var u=i[s]={onStack:!0,lowlink:e,index:e++};if(n.push(s),t.successors(s).forEach((function(t){r.has(i,t)?i[t].onStack&&(u.lowlink=Math.min(u.lowlink,i[t].index)):(a(t),u.lowlink=Math.min(u.lowlink,i[t].lowlink))})),u.lowlink===u.index){var c,f=[];do{c=n.pop(),i[c].onStack=!1,f.push(c)}while(s!==c);o.push(f)}}return t.nodes().forEach((function(t){r.has(i,t)||a(t)})),o}},7793:(t,e,n)=>{var r=n(95329);function i(t){var e={},n={},i=[];if(r.each(t.sinks(),(function a(s){if(r.has(n,s))throw new o;r.has(e,s)||(n[s]=!0,e[s]=!0,r.each(t.predecessors(s),a),delete n[s],i.push(s))})),r.size(e)!==t.nodeCount())throw new o;return i}function o(){}t.exports=i,i.CycleException=o,o.prototype=new Error},36614:(t,e,n)=>{var r=n(95329);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}},6349:(t,e,n)=>{"use strict";var r=n(95329);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 s(t,e){--t[e]||delete t[e]}function u(t,e,n,i){var o=""+e,a=""+n;if(!t&&o>a){var s=o;o=a,a=s}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 s={v:i,w:o};return r&&(s.name=r),s}function f(t,e){return u(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(){var t=this;return r.filter(this.nodes(),(function(e){return r.isEmpty(t._in[e])}))},o.prototype.sinks=function(){var t=this;return r.filter(this.nodes(),(function(e){return r.isEmpty(t._out[e])}))},o.prototype.setNodes=function(t,e){var n=arguments,i=this;return r.each(t,(function(t){n.length>1?i.setNode(t,e):i.setNode(t)})),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),(function(t){e.setParent(t)})),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 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());var n=this;r.each(this._nodes,(function(n,r){t(r)&&e.setNode(r,n)})),r.each(this._edgeObjs,(function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,n.edge(t))}));var 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,s=arguments[0];"object"==typeof s&&null!==s&&"v"in s?(t=s.v,e=s.w,n=s.name,2===arguments.length&&(i=arguments[1],o=!0)):(t=s,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=u(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]):u(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]):u(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]):u(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],s(this._preds[e],t),s(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))}},89224:(t,e,n)=>{t.exports={Graph:n(6349),version:n(16544)}},17401:(t,e,n)=>{var r=n(95329),i=n(6349);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}}},95329:(t,e,n)=>{var r;try{r={clone:n(76833),constant:n(13503),each:n(76934),filter:n(64725),has:n(99946),isArray:n(80744),isEmpty:n(61627),isFunction:n(9363),isUndefined:n(16513),keys:n(55451),map:n(9924),reduce:n(16473),size:n(40617),transform:n(91116),union:n(44065),values:n(81229)}}catch(t){}r||(r=window._),t.exports=r},16544:t=>{t.exports="2.1.8"},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,s){r(a,s,(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)}}}},11922:(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)}}},80626:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tagProperty=e.tagParameter=e.decorate=void 0;var r=n(36078),i=n(50295);function o(t,e,n,i,o){var a={},s="number"==typeof o,u=void 0!==o&&s?o.toString():n;if(s&&void 0!==n)throw new Error(r.INVALID_DECORATOR_OPERATION);Reflect.hasOwnMetadata(t,e)&&(a=Reflect.getMetadata(t,e));var c=a[u];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[u]=c,Reflect.defineMetadata(t,a,e)}function a(t,e){Reflect.decorate(t,e)}function s(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([s(n,t)],e):"string"==typeof n?Reflect.decorate([t],e,n):a([t],e)}},76213:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.inject=e.LazyServiceIdentifer=void 0;var r=n(36078),i=n(50295),o=n(25092),a=n(80626),s=function(){function t(t){this._cb=t}return t.prototype.unwrap=function(){return this._cb()},t}();e.LazyServiceIdentifer=s,e.inject=function(t){return function(e,n,s){if(void 0===t)throw new Error(r.UNDEFINED_INJECT_ANNOTATION(e.name));var u=new o.Metadata(i.INJECT_TAG,t);"number"==typeof s?a.tagParameter(e,n,s,u):a.tagProperty(e,n,u)}}},91773:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.injectable=void 0;var r=n(36078),i=n(50295);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}}},41528:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.multiInject=void 0;var r=n(50295),i=n(25092),o=n(80626);e.multiInject=function(t){return function(e,n,a){var s=new i.Metadata(r.MULTI_INJECT_TAG,t);"number"==typeof a?o.tagParameter(e,n,a,s):o.tagProperty(e,n,s)}}},79817:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.named=void 0;var r=n(50295),i=n(25092),o=n(80626);e.named=function(t){return function(e,n,a){var s=new i.Metadata(r.NAMED_TAG,t);"number"==typeof a?o.tagParameter(e,n,a,s):o.tagProperty(e,n,s)}}},71316:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.optional=void 0;var r=n(50295),i=n(25092),o=n(80626);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)}}},71971:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.postConstruct=void 0;var r=n(36078),i=n(50295),o=n(25092);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)}}},79189:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tagged=void 0;var r=n(25092),i=n(80626);e.tagged=function(t,e){return function(n,o,a){var s=new r.Metadata(t,e);"number"==typeof a?i.tagParameter(n,o,a,s):i.tagProperty(n,o,s)}}},8245:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.targetName=void 0;var r=n(50295),i=n(25092),o=n(80626);e.targetName=function(t){return function(e,n,a){var s=new i.Metadata(r.NAME_TAG,t);o.tagParameter(e,n,a,s)}}},19235:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.unmanaged=void 0;var r=n(50295),i=n(25092),o=n(80626);e.unmanaged=function(){return function(t,e,n){var a=new i.Metadata(r.UNMANAGED_TAG,!0);o.tagParameter(t,e,n,a)}}},30683:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Binding=void 0;var r=n(77690),i=n(70023),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},13497:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingCount=void 0,e.BindingCount={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1}},36078:(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"},77690:(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"}},50295:(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]},70596: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{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((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:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){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,s])}}},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(30683),s=n(36078),u=n(77690),c=n(50295),f=n(43870),l=n(54142),h=n(9386),d=n(43313),p=n(70023),v=n(29552),g=n(71878),y=n(82543),m=function(){function t(t){this._appliedMiddleware=[];var e=t||{};if("object"!=typeof e)throw new Error(""+s.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT);if(void 0===e.defaultScope)e.defaultScope=u.BindingScopeEnum.Transient;else if(e.defaultScope!==u.BindingScopeEnum.Singleton&&e.defaultScope!==u.BindingScopeEnum.Transient&&e.defaultScope!==u.BindingScopeEnum.Request)throw new Error(""+s.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE);if(void 0===e.autoBindInjectable)e.autoBindInjectable=!1;else if("boolean"!=typeof e.autoBindInjectable)throw new Error(""+s.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE);if(void 0===e.skipBaseClassChecks)e.skipBaseClassChecks=!1;else if("boolean"!=typeof e.skipBaseClassChecks)throw new Error(""+s.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,s=o([e,n],r).map((function(t){return l.getBindingDictionary(t)})),u=l.getBindingDictionary(a);function c(t,e){t.traverse((function(t,n){n.forEach((function(t){e.add(t.serviceIdentifier,t.clone())}))}))}return s.forEach((function(t){c(t,u)})),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||u.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(s.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(s.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,u.TargetTypeEnum.Variable,t)},t.prototype.getTagged=function(t,e,n){return this._get(!1,!1,u.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,u.TargetTypeEnum.Variable,t)},t.prototype.getAllTagged=function(t,e,n){return this._get(!1,!0,u.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,u={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(u)))throw new Error(s.INVALID_MIDDLEWARE_RETURN)}else a=this._planAndResolve()(u);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},42913:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AsyncContainerModule=e.ContainerModule=void 0;var r=n(70023);e.ContainerModule=function(t){this.id=r.id(),this.registry=t};e.AsyncContainerModule=function(t){this.id=r.id(),this.registry=t}},71878:(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},82543:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Lookup=void 0;var r=n(36078),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},99311:(t,e,n)=>{"use strict";e.f3=e.t6=e.b2=e.W2=void 0,n(50295);var r=n(70596);Object.defineProperty(e,"W2",{enumerable:!0,get:function(){return r.Container}});n(77690),n(42913);var i=n(91773);Object.defineProperty(e,"b2",{enumerable:!0,get:function(){return i.injectable}});n(79189);var o=n(79817);Object.defineProperty(e,"t6",{enumerable:!0,get:function(){return o.named}});var a=n(76213);Object.defineProperty(e,"f3",{enumerable:!0,get:function(){return a.inject}});n(71316),n(19235),n(41528),n(8245),n(71971),n(43870),n(70023),n(80626),n(83140),n(29552),n(34384)},91519:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Context=void 0;var r=n(70023),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},25092:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;var r=n(50295),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},43870:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MetadataReader=void 0;var r=n(50295),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}},54142:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getBindingDictionary=e.createMockRequest=e.plan=void 0;var r=n(13497),i=n(36078),o=n(77690),a=n(50295),s=n(92542),u=n(29552),c=n(91519),f=n(25092),l=n(6335),h=n(16664),d=n(14810),p=n(69660);function v(t){return t._bindingDictionary}function g(t,e,n,o,a){var s,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)),s=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=u.getServiceIdentifierAsString(t),s=i.NOT_REGISTERED;throw s+=u.listMetadataForTarget(a,n),s+=u.listRegisteredBindingsForServiceIdentifier(o,a,m),new Error(s);case r.BindingCount.OnlyOneBindingAvailable:if(!n.isArray())return e;case r.BindingCount.MultipleBindingsAvailable:default:if(n.isArray())return e;throw a=u.getServiceIdentifierAsString(t),s=i.AMBIGUOUS_MATCH+" "+a,s+=u.listRegisteredBindingsForServiceIdentifier(o,a,m),new Error(s)}}(a.serviceIdentifier,s,a,n.container),s}function y(t,e,n,r,a,s){var u,c;if(null===a){u=g(t,e,r,null,s),c=new d.Request(n,r,null,u,s);var f=new l.Plan(r,c);r.addPlan(f)}else u=g(t,e,r,a,s),c=a.addChildRequest(s.serviceIdentifier,u,s);u.forEach((function(e){var n=null;if(s.isArray())n=c.addChildRequest(e.serviceIdentifier,e,s);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 u=h.getBaseClassDependencyCount(t,e.implementationType);if(a.length<u){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 s=t?a.MULTI_INJECT_TAG:a.INJECT_TAG,u=new f.Metadata(s,n),c=new p.Target(e,"",n,u);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 s.isStackOverflowExeption(t)&&d.plan&&u.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)}},68634:(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},16664: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(76213),o=n(36078),a=n(77690),s=n(50295),u=n(29552);Object.defineProperty(e,"getFunctionName",{enumerable:!0,get:function(){return u.getFunctionName}});var c=n(69660);function f(t,e,n,i){var a=t.getConstructorMetadata(n),s=a.compilerGeneratedMetadata;if(void 0===s){var u=o.MISSING_INJECTABLE_ANNOTATION+" "+e+".";throw new Error(u)}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 s=l(a,t,e,n,r);null!==s&&o.push(s)}return o}(i,e,s,c,d||p?f.length:n.length),g=h(t,n);return r(r([],v),g)}function l(t,e,n,r,s){var u=s[t.toString()]||[],f=d(u),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=u,v}return null}function h(t,e){for(var n=t.getPropertiesMetadata(e),i=[],o=0,s=Object.keys(n);o<s.length;o++){var u=s[o],f=n[u],l=d(n[u]),p=l.targetName||u,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[s.INJECT_TAG],multiInject:e[s.MULTI_INJECT_TAG],targetName:e[s.NAME_TAG],unmanaged:e[s.UNMANAGED_TAG]}}e.getDependencies=function(t,e){return f(t,u.getFunctionName(e),e,!1)},e.getBaseClassDependencyCount=function t(e,n){var r=Object.getPrototypeOf(n.prototype).constructor;if(r!==Object){var i=f(e,u.getFunctionName(r),r,!0),o=i.map((function(t){return t.metadata.filter((function(t){return t.key===s.UNMANAGED_TAG}))})),a=[].concat.apply([],o).length,c=i.length-a;return c>0?c:t(e,r)}return 0}},14810:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Request=void 0;var r=n(70023),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},69660:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Target=void 0;var r=n(50295),i=n(70023),o=n(25092),a=n(68634),s=function(){function t(t,e,n,s){this.id=i.id(),this.type=t,this.serviceIdentifier=n,this.name=new a.QueryableString(e||""),this.metadata=new Array;var u=null;"string"==typeof s?u=new o.Metadata(r.NAMED_TAG,s):s instanceof o.Metadata&&(u=s),null!==u&&this.metadata.push(u)}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=s},74962: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(36078),o=n(77690),a=n(50295);e.resolveInstance=function(t,e,n){var s,u,c=null;e.length>0?(u=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((s=t).bind.apply(s,r([void 0],u))),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(36078),i=n(77690),o=n(92542),a=n(29552),s=n(74962),u=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=u("toDynamicValue",d.serviceIdentifier,(function(){return d.dynamicValue(e.parentContext)}));else if(d.type===i.BindingTypeEnum.Factory&&null!==d.factory)h=u("toFactory",d.serviceIdentifier,(function(){return d.factory(e.parentContext)}));else if(d.type===i.BindingTypeEnum.Provider&&null!==d.provider)h=u("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=s.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)}},91640:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInSyntax=void 0;var r=n(77690),i=n(46890),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},82386:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInWhenOnSyntax=void 0;var r=n(91640),i=n(8926),o=n(36890),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(36890),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},43313:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingToSyntax=void 0;var r=n(36078),i=n(77690),o=n(82386),a=n(46890),s=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=s},46890:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenOnSyntax=void 0;var r=n(8926),i=n(36890),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},36890:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenSyntax=void 0;var r=n(8926),i=n(83140),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},83140:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.typeConstraint=e.namedConstraint=e.taggedConstraint=e.traverseAncerstors=void 0;var r=n(50295),i=n(25092),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 s=a(r.NAMED_TAG);e.namedConstraint=s,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}}},34384:(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)}))}}}},92542:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isStackOverflowExeption=void 0;var r=n(36078);e.isStackOverflowExeption=function(t){return t instanceof RangeError||t.message===r.STACK_OVERFLOW}},70023:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.id=void 0;var n=0;e.id=function(){return n++}},29552:(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(36078);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},15584:(t,e,n)=>{var r=n(73893)(n(33152),"DataView");t.exports=r},76414:(t,e,n)=>{var r=n(64696),i=n(16824),o=n(23476),a=n(63122),s=n(37279);function u(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])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,t.exports=u},99746:(t,e,n)=>{var r=n(34251),i=n(24968),o=n(28290),a=n(88068),s=n(54238);function u(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])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,t.exports=u},40164:(t,e,n)=>{var r=n(73893)(n(33152),"Map");t.exports=r},52166:(t,e,n)=>{var r=n(35365),i=n(63765),o=n(12608),a=n(10203),s=n(11298);function u(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])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,t.exports=u},97288:(t,e,n)=>{var r=n(73893)(n(33152),"Promise");t.exports=r},23599:(t,e,n)=>{var r=n(73893)(n(33152),"Set");t.exports=r},98924:(t,e,n)=>{var r=n(52166),i=n(34776),o=n(40393);function a(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new r;++e<n;)this.add(t[e])}a.prototype.add=a.prototype.push=i,a.prototype.has=o,t.exports=a},91866:(t,e,n)=>{var r=n(99746),i=n(31119),o=n(64399),a=n(81897),s=n(90558),u=n(64841);function c(t){var e=this.__data__=new r(t);this.size=e.size}c.prototype.clear=i,c.prototype.delete=o,c.prototype.get=a,c.prototype.has=s,c.prototype.set=u,t.exports=c},91869:(t,e,n)=>{var r=n(33152).Symbol;t.exports=r},77945:(t,e,n)=>{var r=n(33152).Uint8Array;t.exports=r},26873:(t,e,n)=>{var r=n(73893)(n(33152),"WeakMap");t.exports=r},79628:t=>{t.exports=function(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)}},74809:t=>{t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}},86952:t=>{t.exports=function(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}},84271:(t,e,n)=>{var r=n(17424);t.exports=function(t,e){return!(null==t||!t.length)&&r(t,e,0)>-1}},94874:t=>{t.exports=function(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}},63333:(t,e,n)=>{var r=n(67943),i=n(13053),o=n(80744),a=n(57835),s=n(70213),u=n(18397),c=Object.prototype.hasOwnProperty;t.exports=function(t,e){var n=o(t),f=!n&&i(t),l=!n&&!f&&a(t),h=!n&&!f&&!l&&u(t),d=n||f||l||h,p=d?r(t.length,String):[],v=p.length;for(var g in t)!e&&!c.call(t,g)||d&&("length"==g||l&&("offset"==g||"parent"==g)||h&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||s(g,v))||p.push(g);return p}},75010:t=>{t.exports=function(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}},57095:t=>{t.exports=function(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}},99861:t=>{t.exports=function(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}},64045:t=>{t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}},26539:(t,e,n)=>{var r=n(22310)("length");t.exports=r},89135:(t,e,n)=>{var r=n(42813),i=n(43607);t.exports=function(t,e,n){(void 0!==n&&!i(t[e],n)||void 0===n&&!(e in t))&&r(t,e,n)}},60348:(t,e,n)=>{var r=n(42813),i=n(43607),o=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var a=t[e];o.call(t,e)&&i(a,n)&&(void 0!==n||e in t)||r(t,e,n)}},67971:(t,e,n)=>{var r=n(43607);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return-1}},91937:(t,e,n)=>{var r=n(95378),i=n(55451);t.exports=function(t,e){return t&&r(e,i(e),t)}},26680:(t,e,n)=>{var r=n(95378),i=n(56730);t.exports=function(t,e){return t&&r(e,i(e),t)}},42813:(t,e,n)=>{var r=n(35234);t.exports=function(t,e,n){"__proto__"==e&&r?r(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}},99045:(t,e,n)=>{var r=n(91866),i=n(74809),o=n(60348),a=n(91937),s=n(26680),u=n(32315),c=n(47760),f=n(15168),l=n(71678),h=n(12076),d=n(22675),p=n(66139),v=n(79264),g=n(97541),y=n(4084),m=n(80744),b=n(57835),_=n(41626),x=n(20816),w=n(65226),E=n(55451),S=n(56730),A="[object Arguments]",T="[object Function]",I="[object Object]",C={};C[A]=C["[object Array]"]=C["[object ArrayBuffer]"]=C["[object DataView]"]=C["[object Boolean]"]=C["[object Date]"]=C["[object Float32Array]"]=C["[object Float64Array]"]=C["[object Int8Array]"]=C["[object Int16Array]"]=C["[object Int32Array]"]=C["[object Map]"]=C["[object Number]"]=C[I]=C["[object RegExp]"]=C["[object Set]"]=C["[object String]"]=C["[object Symbol]"]=C["[object Uint8Array]"]=C["[object Uint8ClampedArray]"]=C["[object Uint16Array]"]=C["[object Uint32Array]"]=!0,C["[object Error]"]=C[T]=C["[object WeakMap]"]=!1,t.exports=function t(e,n,D,N,k,R){var O,M=1&n,P=2&n,G=4&n;if(D&&(O=k?D(e,N,k,R):D(e)),void 0!==O)return O;if(!x(e))return e;var L=m(e);if(L){if(O=v(e),!M)return c(e,O)}else{var U=p(e),F=U==T||"[object GeneratorFunction]"==U;if(b(e))return u(e,M);if(U==I||U==A||F&&!k){if(O=P||F?{}:y(e),!M)return P?l(e,s(O,e)):f(e,a(O,e))}else{if(!C[U])return k?e:{};O=g(e,U,M)}}R||(R=new r);var j=R.get(e);if(j)return j;R.set(e,O),w(e)?e.forEach((function(r){O.add(t(r,n,D,r,e,R))})):_(e)&&e.forEach((function(r,i){O.set(i,t(r,n,D,i,e,R))}));var B=L?void 0:(G?P?d:h:P?S:E)(e);return i(B||e,(function(r,i){B&&(r=e[i=r]),o(O,i,t(r,n,D,i,e,R))})),O}},35024:(t,e,n)=>{var r=n(20816),i=Object.create,o=function(){function t(){}return function(e){if(!r(e))return{};if(i)return i(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();t.exports=o},44107:(t,e,n)=>{var r=n(1585),i=n(49164)(r);t.exports=i},2659:(t,e,n)=>{var r=n(45029);t.exports=function(t,e,n){for(var i=-1,o=t.length;++i<o;){var a=t[i],s=e(a);if(null!=s&&(void 0===u?s==s&&!r(s):n(s,u)))var u=s,c=a}return c}},32872:(t,e,n)=>{var r=n(44107);t.exports=function(t,e){var n=[];return r(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}},51533:t=>{t.exports=function(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}},9256:(t,e,n)=>{var r=n(57095),i=n(88133);t.exports=function t(e,n,o,a,s){var u=-1,c=e.length;for(o||(o=i),s||(s=[]);++u<c;){var f=e[u];n>0&&o(f)?n>1?t(f,n-1,o,a,s):r(s,f):a||(s[s.length]=f)}return s}},14018:(t,e,n)=>{var r=n(78010)();t.exports=r},1585:(t,e,n)=>{var r=n(14018),i=n(55451);t.exports=function(t,e){return t&&r(t,e,i)}},89147:(t,e,n)=>{var r=n(1186),i=n(9171);t.exports=function(t,e){for(var n=0,o=(e=r(e,t)).length;null!=t&&n<o;)t=t[i(e[n++])];return n&&n==o?t:void 0}},75635:(t,e,n)=>{var r=n(57095),i=n(80744);t.exports=function(t,e,n){var o=e(t);return i(t)?o:r(o,n(t))}},86756:(t,e,n)=>{var r=n(91869),i=n(72533),o=n(74702),a=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?i(t):o(t)}},40302:t=>{t.exports=function(t,e){return t>e}},3251:t=>{var e=Object.prototype.hasOwnProperty;t.exports=function(t,n){return null!=t&&e.call(t,n)}},62348:t=>{t.exports=function(t,e){return null!=t&&e in Object(t)}},17424:(t,e,n)=>{var r=n(51533),i=n(8373),o=n(49237);t.exports=function(t,e,n){return e==e?o(t,e,n):r(t,i,n)}},4977:(t,e,n)=>{var r=n(86756),i=n(93913);t.exports=function(t){return i(t)&&"[object Arguments]"==r(t)}},77295:(t,e,n)=>{var r=n(84412),i=n(93913);t.exports=function t(e,n,o,a,s){return e===n||(null==e||null==n||!i(e)&&!i(n)?e!=e&&n!=n:r(e,n,o,a,t,s))}},84412:(t,e,n)=>{var r=n(91866),i=n(50401),o=n(57710),a=n(4983),s=n(66139),u=n(80744),c=n(57835),f=n(18397),l="[object Arguments]",h="[object Array]",d="[object Object]",p=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,v,g,y){var m=u(t),b=u(e),_=m?h:s(t),x=b?h:s(e),w=(_=_==l?d:_)==d,E=(x=x==l?d:x)==d,S=_==x;if(S&&c(t)){if(!c(e))return!1;m=!0,w=!1}if(S&&!w)return y||(y=new r),m||f(t)?i(t,e,n,v,g,y):o(t,e,_,n,v,g,y);if(!(1&n)){var A=w&&p.call(t,"__wrapped__"),T=E&&p.call(e,"__wrapped__");if(A||T){var I=A?t.value():t,C=T?e.value():e;return y||(y=new r),g(I,C,n,v,y)}}return!!S&&(y||(y=new r),a(t,e,n,v,g,y))}},55005:(t,e,n)=>{var r=n(66139),i=n(93913);t.exports=function(t){return i(t)&&"[object Map]"==r(t)}},51524:(t,e,n)=>{var r=n(91866),i=n(77295);t.exports=function(t,e,n,o){var a=n.length,s=a,u=!o;if(null==t)return!s;for(t=Object(t);a--;){var c=n[a];if(u&&c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++a<s;){var f=(c=n[a])[0],l=t[f],h=c[1];if(u&&c[2]){if(void 0===l&&!(f in t))return!1}else{var d=new r;if(o)var p=o(l,h,f,t,e,d);if(!(void 0===p?i(h,l,3,o,d):p))return!1}}return!0}},8373:t=>{t.exports=function(t){return t!=t}},6367:(t,e,n)=>{var r=n(9363),i=n(89379),o=n(20816),a=n(63256),s=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,f=u.toString,l=c.hasOwnProperty,h=RegExp("^"+f.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!o(t)||i(t))&&(r(t)?h:s).test(a(t))}},38652:(t,e,n)=>{var r=n(66139),i=n(93913);t.exports=function(t){return i(t)&&"[object Set]"==r(t)}},10766:(t,e,n)=>{var r=n(86756),i=n(11156),o=n(93913),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,t.exports=function(t){return o(t)&&i(t.length)&&!!a[r(t)]}},95979:(t,e,n)=>{var r=n(17632),i=n(38933),o=n(46962),a=n(80744),s=n(35769);t.exports=function(t){return"function"==typeof t?t:null==t?o:"object"==typeof t?a(t)?i(t[0],t[1]):r(t):s(t)}},6019:(t,e,n)=>{var r=n(7975),i=n(23730),o=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return i(t);var e=[];for(var n in Object(t))o.call(t,n)&&"constructor"!=n&&e.push(n);return e}},33988:(t,e,n)=>{var r=n(20816),i=n(7975),o=n(97817),a=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return o(t);var e=i(t),n=[];for(var s in t)("constructor"!=s||!e&&a.call(t,s))&&n.push(s);return n}},93757:t=>{t.exports=function(t,e){return t<e}},65487:(t,e,n)=>{var r=n(44107),i=n(24665);t.exports=function(t,e){var n=-1,o=i(t)?Array(t.length):[];return r(t,(function(t,r,i){o[++n]=e(t,r,i)})),o}},17632:(t,e,n)=>{var r=n(51524),i=n(10261),o=n(24122);t.exports=function(t){var e=i(t);return 1==e.length&&e[0][2]?o(e[0][0],e[0][1]):function(n){return n===t||r(n,t,e)}}},38933:(t,e,n)=>{var r=n(77295),i=n(44231),o=n(37879),a=n(86773),s=n(88411),u=n(24122),c=n(9171);t.exports=function(t,e){return a(t)&&s(e)?u(c(t),e):function(n){var a=i(n,t);return void 0===a&&a===e?o(n,t):r(e,a,3)}}},50097:(t,e,n)=>{var r=n(91866),i=n(89135),o=n(14018),a=n(23585),s=n(20816),u=n(56730),c=n(47052);t.exports=function t(e,n,f,l,h){e!==n&&o(n,(function(o,u){if(h||(h=new r),s(o))a(e,n,u,f,t,l,h);else{var d=l?l(c(e,u),o,u+"",e,n,h):void 0;void 0===d&&(d=o),i(e,u,d)}}),u)}},23585:(t,e,n)=>{var r=n(89135),i=n(32315),o=n(78358),a=n(47760),s=n(4084),u=n(13053),c=n(80744),f=n(41590),l=n(57835),h=n(9363),d=n(20816),p=n(19308),v=n(18397),g=n(47052),y=n(20480);t.exports=function(t,e,n,m,b,_,x){var w=g(t,n),E=g(e,n),S=x.get(E);if(S)r(t,n,S);else{var A=_?_(w,E,n+"",t,e,x):void 0,T=void 0===A;if(T){var I=c(E),C=!I&&l(E),D=!I&&!C&&v(E);A=E,I||C||D?c(w)?A=w:f(w)?A=a(w):C?(T=!1,A=i(E,!0)):D?(T=!1,A=o(E,!0)):A=[]:p(E)||u(E)?(A=w,u(w)?A=y(w):d(w)&&!h(w)||(A=s(E))):T=!1}T&&(x.set(E,A),b(A,E,m,_,x),x.delete(E)),r(t,n,A)}}},58506:(t,e,n)=>{var r=n(75010),i=n(89147),o=n(95979),a=n(65487),s=n(33065),u=n(38342),c=n(11249),f=n(46962),l=n(80744);t.exports=function(t,e,n){e=e.length?r(e,(function(t){return l(t)?function(e){return i(e,1===t.length?t[0]:t)}:t})):[f];var h=-1;e=r(e,u(o));var d=a(t,(function(t,n,i){return{criteria:r(e,(function(e){return e(t)})),index:++h,value:t}}));return s(d,(function(t,e){return c(t,e,n)}))}},88832:(t,e,n)=>{var r=n(10867),i=n(37879);t.exports=function(t,e){return r(t,e,(function(e,n){return i(t,n)}))}},10867:(t,e,n)=>{var r=n(89147),i=n(36897),o=n(1186);t.exports=function(t,e,n){for(var a=-1,s=e.length,u={};++a<s;){var c=e[a],f=r(t,c);n(f,c)&&i(u,o(c,t),f)}return u}},22310:t=>{t.exports=function(t){return function(e){return null==e?void 0:e[t]}}},96916:(t,e,n)=>{var r=n(89147);t.exports=function(t){return function(e){return r(e,t)}}},36121:t=>{var e=Math.ceil,n=Math.max;t.exports=function(t,r,i,o){for(var a=-1,s=n(e((r-t)/(i||1)),0),u=Array(s);s--;)u[o?s:++a]=t,t+=i;return u}},30739:t=>{t.exports=function(t,e,n,r,i){return i(t,(function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)})),n}},92918:(t,e,n)=>{var r=n(46962),i=n(19652),o=n(71152);t.exports=function(t,e){return o(i(t,e,r),t+"")}},36897:(t,e,n)=>{var r=n(60348),i=n(1186),o=n(70213),a=n(20816),s=n(9171);t.exports=function(t,e,n,u){if(!a(t))return t;for(var c=-1,f=(e=i(e,t)).length,l=f-1,h=t;null!=h&&++c<f;){var d=s(e[c]),p=n;if("__proto__"===d||"constructor"===d||"prototype"===d)return t;if(c!=l){var v=h[d];void 0===(p=u?u(v,d,h):void 0)&&(p=a(v)?v:o(e[c+1])?[]:{})}r(h,d,p),h=h[d]}return t}},63989:(t,e,n)=>{var r=n(13503),i=n(35234),o=n(46962),a=i?function(t,e){return i(t,"toString",{configurable:!0,enumerable:!1,value:r(e),writable:!0})}:o;t.exports=a},33065:t=>{t.exports=function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}},67943:t=>{t.exports=function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}},50230:(t,e,n)=>{var r=n(91869),i=n(75010),o=n(80744),a=n(45029),s=r?r.prototype:void 0,u=s?s.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(o(e))return i(e,t)+"";if(a(e))return u?u.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n}},13927:(t,e,n)=>{var r=n(15333),i=/^\s+/;t.exports=function(t){return t?t.slice(0,r(t)+1).replace(i,""):t}},38342:t=>{t.exports=function(t){return function(e){return t(e)}}},29098:(t,e,n)=>{var r=n(98924),i=n(84271),o=n(94874),a=n(1931),s=n(47506),u=n(79679);t.exports=function(t,e,n){var c=-1,f=i,l=t.length,h=!0,d=[],p=d;if(n)h=!1,f=o;else if(l>=200){var v=e?null:s(t);if(v)return u(v);h=!1,f=a,p=new r}else p=e?[]:d;t:for(;++c<l;){var g=t[c],y=e?e(g):g;if(g=n||0!==g?g:0,h&&y==y){for(var m=p.length;m--;)if(p[m]===y)continue t;e&&p.push(y),d.push(g)}else f(p,y,n)||(p!==d&&p.push(y),d.push(g))}return d}},20720:(t,e,n)=>{var r=n(75010);t.exports=function(t,e){return r(e,(function(e){return t[e]}))}},94484:t=>{t.exports=function(t,e,n){for(var r=-1,i=t.length,o=e.length,a={};++r<i;){var s=r<o?e[r]:void 0;n(a,t[r],s)}return a}},1931:t=>{t.exports=function(t,e){return t.has(e)}},11756:(t,e,n)=>{var r=n(46962);t.exports=function(t){return"function"==typeof t?t:r}},1186:(t,e,n)=>{var r=n(80744),i=n(86773),o=n(40493),a=n(44140);t.exports=function(t,e){return r(t)?t:i(t,e)?[t]:o(a(t))}},20188:(t,e,n)=>{var r=n(77945);t.exports=function(t){var e=new t.constructor(t.byteLength);return new r(e).set(new r(t)),e}},32315:(t,e,n)=>{t=n.nmd(t);var r=n(33152),i=e&&!e.nodeType&&e,o=i&&t&&!t.nodeType&&t,a=o&&o.exports===i?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var n=t.length,r=s?s(n):new t.constructor(n);return t.copy(r),r}},27984:(t,e,n)=>{var r=n(20188);t.exports=function(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}},78583:t=>{var e=/\w*$/;t.exports=function(t){var n=new t.constructor(t.source,e.exec(t));return n.lastIndex=t.lastIndex,n}},28757:(t,e,n)=>{var r=n(91869),i=r?r.prototype:void 0,o=i?i.valueOf:void 0;t.exports=function(t){return o?Object(o.call(t)):{}}},78358:(t,e,n)=>{var r=n(20188);t.exports=function(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}},83018:(t,e,n)=>{var r=n(45029);t.exports=function(t,e){if(t!==e){var n=void 0!==t,i=null===t,o=t==t,a=r(t),s=void 0!==e,u=null===e,c=e==e,f=r(e);if(!u&&!f&&!a&&t>e||a&&s&&c&&!u&&!f||i&&s&&c||!n&&c||!o)return 1;if(!i&&!a&&!f&&t<e||f&&n&&o&&!i&&!a||u&&n&&o||!s&&o||!c)return-1}return 0}},11249:(t,e,n)=>{var r=n(83018);t.exports=function(t,e,n){for(var i=-1,o=t.criteria,a=e.criteria,s=o.length,u=n.length;++i<s;){var c=r(o[i],a[i]);if(c)return i>=u?c:c*("desc"==n[i]?-1:1)}return t.index-e.index}},47760:t=>{t.exports=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}},95378:(t,e,n)=>{var r=n(60348),i=n(42813);t.exports=function(t,e,n,o){var a=!n;n||(n={});for(var s=-1,u=e.length;++s<u;){var c=e[s],f=o?o(n[c],t[c],c,n,t):void 0;void 0===f&&(f=t[c]),a?i(n,c,f):r(n,c,f)}return n}},15168:(t,e,n)=>{var r=n(95378),i=n(58966);t.exports=function(t,e){return r(t,i(t),e)}},71678:(t,e,n)=>{var r=n(95378),i=n(66817);t.exports=function(t,e){return r(t,i(t),e)}},64218:(t,e,n)=>{var r=n(33152)["__core-js_shared__"];t.exports=r},63323:(t,e,n)=>{var r=n(92918),i=n(8138);t.exports=function(t){return r((function(e,n){var r=-1,o=n.length,a=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(a=t.length>3&&"function"==typeof a?(o--,a):void 0,s&&i(n[0],n[1],s)&&(a=o<3?void 0:a,o=1),e=Object(e);++r<o;){var u=n[r];u&&t(e,u,r,a)}return e}))}},49164:(t,e,n)=>{var r=n(24665);t.exports=function(t,e){return function(n,i){if(null==n)return n;if(!r(n))return t(n,i);for(var o=n.length,a=e?o:-1,s=Object(n);(e?a--:++a<o)&&!1!==i(s[a],a,s););return n}}},78010:t=>{t.exports=function(t){return function(e,n,r){for(var i=-1,o=Object(e),a=r(e),s=a.length;s--;){var u=a[t?s:++i];if(!1===n(o[u],u,o))break}return e}}},19554:(t,e,n)=>{var r=n(95979),i=n(24665),o=n(55451);t.exports=function(t){return function(e,n,a){var s=Object(e);if(!i(e)){var u=r(n,3);e=o(e),n=function(t){return u(s[t],t,s)}}var c=t(e,n,a);return c>-1?s[u?e[c]:c]:void 0}}},76106:(t,e,n)=>{var r=n(36121),i=n(8138),o=n(97341);t.exports=function(t){return function(e,n,a){return a&&"number"!=typeof a&&i(e,n,a)&&(n=a=void 0),e=o(e),void 0===n?(n=e,e=0):n=o(n),a=void 0===a?e<n?1:-1:o(a),r(e,n,a,t)}}},47506:(t,e,n)=>{var r=n(23599),i=n(9958),o=n(79679),a=r&&1/o(new r([,-0]))[1]==1/0?function(t){return new r(t)}:i;t.exports=a},35234:(t,e,n)=>{var r=n(73893),i=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=i},50401:(t,e,n)=>{var r=n(98924),i=n(64045),o=n(1931);t.exports=function(t,e,n,a,s,u){var c=1&n,f=t.length,l=e.length;if(f!=l&&!(c&&l>f))return!1;var h=u.get(t),d=u.get(e);if(h&&d)return h==e&&d==t;var p=-1,v=!0,g=2&n?new r:void 0;for(u.set(t,e),u.set(e,t);++p<f;){var y=t[p],m=e[p];if(a)var b=c?a(m,y,p,e,t,u):a(y,m,p,t,e,u);if(void 0!==b){if(b)continue;v=!1;break}if(g){if(!i(e,(function(t,e){if(!o(g,e)&&(y===t||s(y,t,n,a,u)))return g.push(e)}))){v=!1;break}}else if(y!==m&&!s(y,m,n,a,u)){v=!1;break}}return u.delete(t),u.delete(e),v}},57710:(t,e,n)=>{var r=n(91869),i=n(77945),o=n(43607),a=n(50401),s=n(83383),u=n(79679),c=r?r.prototype:void 0,f=c?c.valueOf:void 0;t.exports=function(t,e,n,r,c,l,h){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!l(new i(t),new i(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var d=s;case"[object Set]":var p=1&r;if(d||(d=u),t.size!=e.size&&!p)return!1;var v=h.get(t);if(v)return v==e;r|=2,h.set(t,e);var g=a(d(t),d(e),r,c,l,h);return h.delete(t),g;case"[object Symbol]":if(f)return f.call(t)==f.call(e)}return!1}},4983:(t,e,n)=>{var r=n(12076),i=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,o,a,s){var u=1&n,c=r(t),f=c.length;if(f!=r(e).length&&!u)return!1;for(var l=f;l--;){var h=c[l];if(!(u?h in e:i.call(e,h)))return!1}var d=s.get(t),p=s.get(e);if(d&&p)return d==e&&p==t;var v=!0;s.set(t,e),s.set(e,t);for(var g=u;++l<f;){var y=t[h=c[l]],m=e[h];if(o)var b=u?o(m,y,h,e,t,s):o(y,m,h,t,e,s);if(!(void 0===b?y===m||a(y,m,n,o,s):b)){v=!1;break}g||(g="constructor"==h)}if(v&&!g){var _=t.constructor,x=e.constructor;_==x||!("constructor"in t)||!("constructor"in e)||"function"==typeof _&&_ instanceof _&&"function"==typeof x&&x instanceof x||(v=!1)}return s.delete(t),s.delete(e),v}},522:(t,e,n)=>{var r=n(40151),i=n(19652),o=n(71152);t.exports=function(t){return o(i(t,void 0,r),t+"")}},37675:(t,e,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;t.exports=r},12076:(t,e,n)=>{var r=n(75635),i=n(58966),o=n(55451);t.exports=function(t){return r(t,o,i)}},22675:(t,e,n)=>{var r=n(75635),i=n(66817),o=n(56730);t.exports=function(t){return r(t,o,i)}},89819:(t,e,n)=>{var r=n(94358);t.exports=function(t,e){var n=t.__data__;return r(e)?n["string"==typeof e?"string":"hash"]:n.map}},10261:(t,e,n)=>{var r=n(88411),i=n(55451);t.exports=function(t){for(var e=i(t),n=e.length;n--;){var o=e[n],a=t[o];e[n]=[o,a,r(a)]}return e}},73893:(t,e,n)=>{var r=n(6367),i=n(49966);t.exports=function(t,e){var n=i(t,e);return r(n)?n:void 0}},49217:(t,e,n)=>{var r=n(31030)(Object.getPrototypeOf,Object);t.exports=r},72533:(t,e,n)=>{var r=n(91869),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;t.exports=function(t){var e=o.call(t,s),n=t[s];try{t[s]=void 0;var r=!0}catch(t){}var i=a.call(t);return r&&(e?t[s]=n:delete t[s]),i}},58966:(t,e,n)=>{var r=n(86952),i=n(4134),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(t){return null==t?[]:(t=Object(t),r(a(t),(function(e){return o.call(t,e)})))}:i;t.exports=s},66817:(t,e,n)=>{var r=n(57095),i=n(49217),o=n(58966),a=n(4134),s=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)r(e,o(t)),t=i(t);return e}:a;t.exports=s},66139:(t,e,n)=>{var r=n(15584),i=n(40164),o=n(97288),a=n(23599),s=n(26873),u=n(86756),c=n(63256),f="[object Map]",l="[object Promise]",h="[object Set]",d="[object WeakMap]",p="[object DataView]",v=c(r),g=c(i),y=c(o),m=c(a),b=c(s),_=u;(r&&_(new r(new ArrayBuffer(1)))!=p||i&&_(new i)!=f||o&&_(o.resolve())!=l||a&&_(new a)!=h||s&&_(new s)!=d)&&(_=function(t){var e=u(t),n="[object Object]"==e?t.constructor:void 0,r=n?c(n):"";if(r)switch(r){case v:return p;case g:return f;case y:return l;case m:return h;case b:return d}return e}),t.exports=_},49966:t=>{t.exports=function(t,e){return null==t?void 0:t[e]}},63100:(t,e,n)=>{var r=n(1186),i=n(13053),o=n(80744),a=n(70213),s=n(11156),u=n(9171);t.exports=function(t,e,n){for(var c=-1,f=(e=r(e,t)).length,l=!1;++c<f;){var h=u(e[c]);if(!(l=null!=t&&n(t,h)))break;t=t[h]}return l||++c!=f?l:!!(f=null==t?0:t.length)&&s(f)&&a(h,f)&&(o(t)||i(t))}},55015:t=>{var e=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");t.exports=function(t){return e.test(t)}},64696:(t,e,n)=>{var r=n(65294);t.exports=function(){this.__data__=r?r(null):{},this.size=0}},16824:t=>{t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},23476:(t,e,n)=>{var r=n(65294),i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(r){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(e,t)?e[t]:void 0}},63122:(t,e,n)=>{var r=n(65294),i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return r?void 0!==e[t]:i.call(e,t)}},37279:(t,e,n)=>{var r=n(65294);t.exports=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=r&&void 0===e?"__lodash_hash_undefined__":e,this}},79264:t=>{var e=Object.prototype.hasOwnProperty;t.exports=function(t){var n=t.length,r=new t.constructor(n);return n&&"string"==typeof t[0]&&e.call(t,"index")&&(r.index=t.index,r.input=t.input),r}},97541:(t,e,n)=>{var r=n(20188),i=n(27984),o=n(78583),a=n(28757),s=n(78358);t.exports=function(t,e,n){var u=t.constructor;switch(e){case"[object ArrayBuffer]":return r(t);case"[object Boolean]":case"[object Date]":return new u(+t);case"[object DataView]":return i(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(t,n);case"[object Map]":case"[object Set]":return new u;case"[object Number]":case"[object String]":return new u(t);case"[object RegExp]":return o(t);case"[object Symbol]":return a(t)}}},4084:(t,e,n)=>{var r=n(35024),i=n(49217),o=n(7975);t.exports=function(t){return"function"!=typeof t.constructor||o(t)?{}:r(i(t))}},88133:(t,e,n)=>{var r=n(91869),i=n(13053),o=n(80744),a=r?r.isConcatSpreadable:void 0;t.exports=function(t){return o(t)||i(t)||!!(a&&t&&t[a])}},70213:t=>{var e=/^(?:0|[1-9]\d*)$/;t.exports=function(t,n){var r=typeof t;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&e.test(t))&&t>-1&&t%1==0&&t<n}},8138:(t,e,n)=>{var r=n(43607),i=n(24665),o=n(70213),a=n(20816);t.exports=function(t,e,n){if(!a(n))return!1;var s=typeof e;return!!("number"==s?i(n)&&o(e,n.length):"string"==s&&e in n)&&r(n[e],t)}},86773:(t,e,n)=>{var r=n(80744),i=n(45029),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;t.exports=function(t,e){if(r(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!i(t))||a.test(t)||!o.test(t)||null!=e&&t in Object(e)}},94358:t=>{t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},89379:(t,e,n)=>{var r,i=n(64218),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(t){return!!o&&o in t}},7975:t=>{var e=Object.prototype;t.exports=function(t){var n=t&&t.constructor;return t===("function"==typeof n&&n.prototype||e)}},88411:(t,e,n)=>{var r=n(20816);t.exports=function(t){return t==t&&!r(t)}},34251:t=>{t.exports=function(){this.__data__=[],this.size=0}},24968:(t,e,n)=>{var r=n(67971),i=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=r(e,t);return!(n<0||(n==e.length-1?e.pop():i.call(e,n,1),--this.size,0))}},28290:(t,e,n)=>{var r=n(67971);t.exports=function(t){var e=this.__data__,n=r(e,t);return n<0?void 0:e[n][1]}},88068:(t,e,n)=>{var r=n(67971);t.exports=function(t){return r(this.__data__,t)>-1}},54238:(t,e,n)=>{var r=n(67971);t.exports=function(t,e){var n=this.__data__,i=r(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}},35365:(t,e,n)=>{var r=n(76414),i=n(99746),o=n(40164);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},63765:(t,e,n)=>{var r=n(89819);t.exports=function(t){var e=r(this,t).delete(t);return this.size-=e?1:0,e}},12608:(t,e,n)=>{var r=n(89819);t.exports=function(t){return r(this,t).get(t)}},10203:(t,e,n)=>{var r=n(89819);t.exports=function(t){return r(this,t).has(t)}},11298:(t,e,n)=>{var r=n(89819);t.exports=function(t,e){var n=r(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}},83383:t=>{t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}},24122:t=>{t.exports=function(t,e){return function(n){return null!=n&&n[t]===e&&(void 0!==e||t in Object(n))}}},26332:(t,e,n)=>{var r=n(52858);t.exports=function(t){var e=r(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}},65294:(t,e,n)=>{var r=n(73893)(Object,"create");t.exports=r},23730:(t,e,n)=>{var r=n(31030)(Object.keys,Object);t.exports=r},97817:t=>{t.exports=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}},52495:(t,e,n)=>{t=n.nmd(t);var r=n(37675),i=e&&!e.nodeType&&e,o=i&&t&&!t.nodeType&&t,a=o&&o.exports===i&&r.process,s=function(){try{return o&&o.require&&o.require("util").types||a&&a.binding&&a.binding("util")}catch(t){}}();t.exports=s},74702:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},31030:t=>{t.exports=function(t,e){return function(n){return t(e(n))}}},19652:(t,e,n)=>{var r=n(79628),i=Math.max;t.exports=function(t,e,n){return e=i(void 0===e?t.length-1:e,0),function(){for(var o=arguments,a=-1,s=i(o.length-e,0),u=Array(s);++a<s;)u[a]=o[e+a];a=-1;for(var c=Array(e+1);++a<e;)c[a]=o[a];return c[e]=n(u),r(t,this,c)}}},33152:(t,e,n)=>{var r=n(37675),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();t.exports=o},47052:t=>{t.exports=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}},34776:t=>{t.exports=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this}},40393:t=>{t.exports=function(t){return this.__data__.has(t)}},79679:t=>{t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}},71152:(t,e,n)=>{var r=n(63989),i=n(78437)(r);t.exports=i},78437:t=>{var e=Date.now;t.exports=function(t){var n=0,r=0;return function(){var i=e(),o=16-(i-r);if(r=i,o>0){if(++n>=800)return arguments[0]}else n=0;return t.apply(void 0,arguments)}}},31119:(t,e,n)=>{var r=n(99746);t.exports=function(){this.__data__=new r,this.size=0}},64399:t=>{t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},81897:t=>{t.exports=function(t){return this.__data__.get(t)}},90558:t=>{t.exports=function(t){return this.__data__.has(t)}},64841:(t,e,n)=>{var r=n(99746),i=n(40164),o=n(52166);t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([t,e]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(t,e),this.size=n.size,this}},49237:t=>{t.exports=function(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}},29405:(t,e,n)=>{var r=n(26539),i=n(55015),o=n(60844);t.exports=function(t){return i(t)?o(t):r(t)}},40493:(t,e,n)=>{var r=n(26332),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,a=r((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(i,(function(t,n,r,i){e.push(r?i.replace(o,"$1"):n||t)})),e}));t.exports=a},9171:(t,e,n)=>{var r=n(45029);t.exports=function(t){if("string"==typeof t||r(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}},63256:t=>{var e=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return e.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},15333:t=>{var e=/\s/;t.exports=function(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n}},60844:t=>{var e="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",n="\\ud83c[\\udffb-\\udfff]",r="[^\\ud800-\\udfff]",i="(?:\\ud83c[\\udde6-\\uddff]){2}",o="[\\ud800-\\udbff][\\udc00-\\udfff]",a="(?:"+e+"|"+n+")?",s="[\\ufe0e\\ufe0f]?",u=s+a+"(?:\\u200d(?:"+[r,i,o].join("|")+")"+s+a+")*",c="(?:"+[r+e+"?",e,i,o,"[\\ud800-\\udfff]"].join("|")+")",f=RegExp(n+"(?="+n+")|"+c+u,"g");t.exports=function(t){for(var e=f.lastIndex=0;f.test(t);)++e;return e}},76833:(t,e,n)=>{var r=n(99045);t.exports=function(t){return r(t,4)}},20250:(t,e,n)=>{var r=n(99045);t.exports=function(t){return r(t,5)}},13503:t=>{t.exports=function(t){return function(){return t}}},28548:(t,e,n)=>{var r=n(92918),i=n(43607),o=n(8138),a=n(56730),s=Object.prototype,u=s.hasOwnProperty,c=r((function(t,e){t=Object(t);var n=-1,r=e.length,c=r>2?e[2]:void 0;for(c&&o(e[0],e[1],c)&&(r=1);++n<r;)for(var f=e[n],l=a(f),h=-1,d=l.length;++h<d;){var p=l[h],v=t[p];(void 0===v||i(v,s[p])&&!u.call(t,p))&&(t[p]=f[p])}return t}));t.exports=c},76934:(t,e,n)=>{t.exports=n(99204)},43607:t=>{t.exports=function(t,e){return t===e||t!=t&&e!=e}},64725:(t,e,n)=>{var r=n(86952),i=n(32872),o=n(95979),a=n(80744);t.exports=function(t,e){return(a(t)?r:i)(t,o(e,3))}},79785:(t,e,n)=>{var r=n(19554)(n(9991));t.exports=r},9991:(t,e,n)=>{var r=n(51533),i=n(95979),o=n(12824),a=Math.max;t.exports=function(t,e,n){var s=null==t?0:t.length;if(!s)return-1;var u=null==n?0:o(n);return u<0&&(u=a(s+u,0)),r(t,i(e,3),u)}},40151:(t,e,n)=>{var r=n(9256);t.exports=function(t){return null!=t&&t.length?r(t,1):[]}},99204:(t,e,n)=>{var r=n(74809),i=n(44107),o=n(11756),a=n(80744);t.exports=function(t,e){return(a(t)?r:i)(t,o(e))}},23190:(t,e,n)=>{var r=n(14018),i=n(11756),o=n(56730);t.exports=function(t,e){return null==t?t:r(t,i(e),o)}},44231:(t,e,n)=>{var r=n(89147);t.exports=function(t,e,n){var i=null==t?void 0:r(t,e);return void 0===i?n:i}},99946:(t,e,n)=>{var r=n(3251),i=n(63100);t.exports=function(t,e){return null!=t&&i(t,e,r)}},37879:(t,e,n)=>{var r=n(62348),i=n(63100);t.exports=function(t,e){return null!=t&&i(t,e,r)}},46962:t=>{t.exports=function(t){return t}},13053:(t,e,n)=>{var r=n(4977),i=n(93913),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(t){return i(t)&&a.call(t,"callee")&&!s.call(t,"callee")};t.exports=u},80744:t=>{var e=Array.isArray;t.exports=e},24665:(t,e,n)=>{var r=n(9363),i=n(11156);t.exports=function(t){return null!=t&&i(t.length)&&!r(t)}},41590:(t,e,n)=>{var r=n(24665),i=n(93913);t.exports=function(t){return i(t)&&r(t)}},57835:(t,e,n)=>{t=n.nmd(t);var r=n(33152),i=n(55950),o=e&&!e.nodeType&&e,a=o&&t&&!t.nodeType&&t,s=a&&a.exports===o?r.Buffer:void 0,u=(s?s.isBuffer:void 0)||i;t.exports=u},61627:(t,e,n)=>{var r=n(6019),i=n(66139),o=n(13053),a=n(80744),s=n(24665),u=n(57835),c=n(7975),f=n(18397),l=Object.prototype.hasOwnProperty;t.exports=function(t){if(null==t)return!0;if(s(t)&&(a(t)||"string"==typeof t||"function"==typeof t.splice||u(t)||f(t)||o(t)))return!t.length;var e=i(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(c(t))return!r(t).length;for(var n in t)if(l.call(t,n))return!1;return!0}},9363:(t,e,n)=>{var r=n(86756),i=n(20816);t.exports=function(t){if(!i(t))return!1;var e=r(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},11156:t=>{t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},41626:(t,e,n)=>{var r=n(55005),i=n(38342),o=n(52495),a=o&&o.isMap,s=a?i(a):r;t.exports=s},20816:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},93913:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},19308:(t,e,n)=>{var r=n(86756),i=n(49217),o=n(93913),a=Function.prototype,s=Object.prototype,u=a.toString,c=s.hasOwnProperty,f=u.call(Object);t.exports=function(t){if(!o(t)||"[object Object]"!=r(t))return!1;var e=i(t);if(null===e)return!0;var n=c.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&u.call(n)==f}},65226:(t,e,n)=>{var r=n(38652),i=n(38342),o=n(52495),a=o&&o.isSet,s=a?i(a):r;t.exports=s},7941:(t,e,n)=>{var r=n(86756),i=n(80744),o=n(93913);t.exports=function(t){return"string"==typeof t||!i(t)&&o(t)&&"[object String]"==r(t)}},45029:(t,e,n)=>{var r=n(86756),i=n(93913);t.exports=function(t){return"symbol"==typeof t||i(t)&&"[object Symbol]"==r(t)}},18397:(t,e,n)=>{var r=n(10766),i=n(38342),o=n(52495),a=o&&o.isTypedArray,s=a?i(a):r;t.exports=s},16513:t=>{t.exports=function(t){return void 0===t}},55451:(t,e,n)=>{var r=n(63333),i=n(6019),o=n(24665);t.exports=function(t){return o(t)?r(t):i(t)}},56730:(t,e,n)=>{var r=n(63333),i=n(33988),o=n(24665);t.exports=function(t){return o(t)?r(t,!0):i(t)}},10611:t=>{t.exports=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}},9924:(t,e,n)=>{var r=n(75010),i=n(95979),o=n(65487),a=n(80744);t.exports=function(t,e){return(a(t)?r:o)(t,i(e,3))}},70642:(t,e,n)=>{var r=n(42813),i=n(1585),o=n(95979);t.exports=function(t,e){var n={};return e=o(e,3),i(t,(function(t,i,o){r(n,i,e(t,i,o))})),n}},95987:(t,e,n)=>{var r=n(2659),i=n(40302),o=n(46962);t.exports=function(t){return t&&t.length?r(t,o,i):void 0}},52858:(t,e,n)=>{var r=n(52166);function i(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");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(i.Cache||r),n}i.Cache=r,t.exports=i},28440:(t,e,n)=>{var r=n(50097),i=n(63323)((function(t,e,n){r(t,e,n)}));t.exports=i},73376:(t,e,n)=>{var r=n(2659),i=n(93757),o=n(46962);t.exports=function(t){return t&&t.length?r(t,o,i):void 0}},83296:(t,e,n)=>{var r=n(2659),i=n(95979),o=n(93757);t.exports=function(t,e){return t&&t.length?r(t,i(e,2),o):void 0}},9958:t=>{t.exports=function(){}},5795:(t,e,n)=>{var r=n(33152);t.exports=function(){return r.Date.now()}},89409:(t,e,n)=>{var r=n(88832),i=n(522)((function(t,e){return null==t?{}:r(t,e)}));t.exports=i},35769:(t,e,n)=>{var r=n(22310),i=n(96916),o=n(86773),a=n(9171);t.exports=function(t){return o(t)?r(a(t)):i(t)}},60859:(t,e,n)=>{var r=n(76106)();t.exports=r},16473:(t,e,n)=>{var r=n(99861),i=n(44107),o=n(95979),a=n(30739),s=n(80744);t.exports=function(t,e,n){var u=s(t)?r:a,c=arguments.length<3;return u(t,o(e,4),n,c,i)}},40617:(t,e,n)=>{var r=n(6019),i=n(66139),o=n(24665),a=n(7941),s=n(29405);t.exports=function(t){if(null==t)return 0;if(o(t))return a(t)?s(t):t.length;var e=i(t);return"[object Map]"==e||"[object Set]"==e?t.size:r(t).length}},351:(t,e,n)=>{var r=n(9256),i=n(58506),o=n(92918),a=n(8138),s=o((function(t,e){if(null==t)return[];var n=e.length;return n>1&&a(t,e[0],e[1])?e=[]:n>2&&a(e[0],e[1],e[2])&&(e=[e[0]]),i(t,r(e,1),[])}));t.exports=s},4134:t=>{t.exports=function(){return[]}},55950:t=>{t.exports=function(){return!1}},97341:(t,e,n)=>{var r=n(20168);t.exports=function(t){return t?Infinity===(t=r(t))||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}},12824:(t,e,n)=>{var r=n(97341);t.exports=function(t){var e=r(t),n=e%1;return e==e?n?e-n:e:0}},20168:(t,e,n)=>{var r=n(13927),i=n(20816),o=n(45029),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(o(t))return NaN;if(i(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=r(t);var n=s.test(t);return n||u.test(t)?c(t.slice(2),n?2:8):a.test(t)?NaN:+t}},20480:(t,e,n)=>{var r=n(95378),i=n(56730);t.exports=function(t){return r(t,i(t))}},44140:(t,e,n)=>{var r=n(50230);t.exports=function(t){return null==t?"":r(t)}},91116:(t,e,n)=>{var r=n(74809),i=n(35024),o=n(1585),a=n(95979),s=n(49217),u=n(80744),c=n(57835),f=n(9363),l=n(20816),h=n(18397);t.exports=function(t,e,n){var d=u(t),p=d||c(t)||h(t);if(e=a(e,4),null==n){var v=t&&t.constructor;n=p?d?new v:[]:l(t)&&f(v)?i(s(t)):{}}return(p?r:o)(t,(function(t,r,i){return e(n,t,r,i)})),n}},44065:(t,e,n)=>{var r=n(9256),i=n(92918),o=n(29098),a=n(41590),s=i((function(t){return o(r(t,1,a,!0))}));t.exports=s},95708:(t,e,n)=>{var r=n(44140),i=0;t.exports=function(t){var e=++i;return r(t)+e}},81229:(t,e,n)=>{var r=n(20720),i=n(55451);t.exports=function(t){return null==t?[]:r(t,i(t))}},65441:(t,e,n)=>{var r=n(60348),i=n(94484);t.exports=function(t,e){return i(t||[],e||[],r)}},91739:(t,e,n)=>{var r=n(45229),i=n(96765),o=n(95927),a=n(24186),s=n(6064),u=[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(u,-n[1],n[0]),c/s(e,u)},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}},78892:(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,s=!o&&!a,u={create:o?function(){return P(Object.create(null))}:a?function(){return P({__proto__:null})}:function(){return P({})},has:s?function(t,n){return e.call(t,n)}:function(t,e){return e in t},get:s?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=u.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&&u.has(e,this._key)},t.prototype.get=function(t){var e=i(t,!1);return void 0!==e?u.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(u.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:u.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=[],s=0,u=n;s<u.length;s++){var c=u[s];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 s=R(o);if(!s)return n.length=a,n;var u=s.value;try{n[a]=u}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={}))},10405: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",s=i.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=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 s=A(a,n);if(s){if(s===v)continue;return s}}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 u=f(t,e,n);if("normal"===u.type){if(r=n.done?p:h,u.arg===v)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=p,n.method="throw",n.arg=u.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={};u(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){u(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function n(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,s)}))}s(u.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,u(w,"constructor",m),u(m,"constructor",y),y.displayName=u(m,s,"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,u(t,s,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},E(S.prototype),u(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),u(w,s,"Generator"),u(w,o,(function(){return this})),u(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 s.type="throw",s.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],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){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)}},96377: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 s(t,e,n){e.indexOf(t)<0&&r("invalid value"+o(n)+". must be one of: "+e)}var u=["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 s=0;s<r.length;++s){var u=r[s],c=/^\s*#\s*(\w+)\s+(.+)\s*$/.exec(u);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++,u))}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){u.indexOf(t)<0&&r('invalid regl constructor argument "'+t+'". must be one of '+u)}))},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:s,shaderError:function(t,e,r,o,a){if(!t.getShaderParameter(e,t.COMPILE_STATUS)){var s=t.getShaderInfoLog(e),u=o===t.FRAGMENT_SHADER?"fragment":"vertex";m(r,"string",u+" 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}(s);(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 s=a[1];i=a[2],"assign"===s&&(s="="),e=Math.max(t.line.indexOf(s,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 "+u+" shader, "+f[0].name)}},linkError:function(t,e,r,o,a){if(!t.getProgramParameter(e,t.LINK_STATUS)){var s=t.getProgramInfoLog(e),u=v(r,a),c='Error linking program with vertex shader, "'+v(o,a)[0].name+'", and fragment shader "'+u[0].name+'"';"undefined"!=typeof document?console.log("%c"+c+"\n%c"+s,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(c+n+s),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 s=t._attributeSet={};o(s,n.static),o(s,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?s(t.texture._texture.internalformat,e,"unsupported texture format for attachment"):s(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,s=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 u=e.images;for(r=0;r<16;++r)if(u[r]){var c=o>>r,f=a>>r;i(e.mipmask&1<<r,"missing mipmap data");var l=u[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,s)*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,s=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 u=0;u<n.length;++u){var c=n[u];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,s),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,s=t||{},u={},c=[],f=[],l="undefined"==typeof window?1:window.devicePixelRatio,h=!1,d=function(t){t&&E.raise(t)},p=function(){};if("string"==typeof s?(E("undefined"!=typeof document,"selector queries only supported in DOM enviroments"),n=document.querySelector(s),E(n,"invalid query string for element")):"object"==typeof s?"string"==typeof(a=s).nodeName&&"function"==typeof a.appendChild&&"function"==typeof a.getBoundingClientRect?n=s:function(t){return"function"==typeof t.drawArrays||"function"==typeof t.drawElements}(s)?i=(o=s).canvas:(E.constructor(s),"gl"in s?o=s.gl:"canvas"in s?i=O(s.canvas):"container"in s&&(r=O(s.container)),"attributes"in s&&(u=s.attributes,E.type(u,"object","invalid context attributes")),"extensions"in s&&(c=R(s.extensions)),"optionalExtensions"in s&&(f=R(s.optionalExtensions)),"onDone"in s&&(E.type(s.onDone,"function","invalid or missing onDone callback"),d=s.onDone),"profile"in s&&(h=!!s.profile),"pixelRatio"in s&&(l=+s.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===u.premultipliedAlpha&&(u.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,u)}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,j=6408,B=5126,z=36160;function V(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 W=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],s=0;s<n;++s)r[i++]=a[s]}(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,s=0;s<e;++s)for(var u=t[s],c=0;c<n;++c)for(var f=u[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 s=e[n];if(e.length-n==4){var u=e[n+1],c=e[n+2],f=e[n+3];for(a=0;a<s;++a)H(t[a],u,c,f,r,i),i+=o}else for(a=0;a<s;++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 s=0,u=0;u<n;++u)for(var c=0;c<r;++c)t[s++]=e[i*u+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,st=5123,ut=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 s=-14-o;e[n]=i+(a+1024>>s)}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,jt=9987,Bt=4352,zt=33984,Vt=[Ft,9986,9985,jt],Wt=[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 se(t){if(!t)return!1;var e=ie(t);return Qt.indexOf(e)>=0||ne(t)||re(t)||V(t)}function ue(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 s=0,u=n;u>=1;)s+=a*u*u,u/=2;return s}return a*n*r}function he(n,r,i,o,a,s,u){var c={"don't care":Bt,"dont care":Bt,nice:4354,fast:4353},f={repeat:10497,clamp:Lt,mirror:33648},l={nearest:Ut,linear:9729},h=e({mipmap:jt,"nearest mipmap nearest":Ft,"linear mipmap nearest":9985,"nearest mipmap linear":9986,"linear mipmap linear":jt},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,s=t.channels,u=!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&&(s=e.shape[2],E(s>0&&s<=4,"invalid number of channels"),u=!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&&(s=e.channels,E(s>0&&s<=4,"invalid number of channels"),u=!0)),t.width=0|o,t.height=0|a,t.channels=0|s;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}!u&&c?t.channels=Xt[t.format]:u&&!c?t.channels!==Wt[t.format]&&(t.format=t.internalformat=Wt[t.channels]):c&&u&&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(se(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),se(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,s=a.viewportHeight;e.width=e.width||o-e.xOffset,e.height=e.height||s-e.yOffset,e.needsCopy=!0,E(e.xOffset>=0&&e.xOffset<o&&e.yOffset>=0&&e.yOffset<s&&e.width>0&&e.width<=o&&e.height>0&&e.height<=s,"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=ue(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(V(r)){var u=r.data;Array.isArray(u)||e.type!==Ot||(e.type=ue(u));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=Wt[l],e.needsFree=!0,function(t,e,n,r,i,o){for(var a=t.width,s=t.height,u=t.channels,c=ce(t,a*s*u),f=0,l=0;l<s;++l)for(var h=0;h<a;++h)for(var d=0;d<u;++d)c[f++]=e[n*h+r*l+i*d+o];fe(t,c)}(e,u,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=Wt[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,s=t.internalformat,u=t.format,c=t.type,f=t.width,l=t.height;D(t),i?n.texImage2D(e,r,u,u,c,i):t.compressed?n.compressedTexImage2D(e,r,s,f,l,0,a):t.needsCopy?(o(),n.copyTexImage2D(e,r,u,t.xOffset,t.yOffset,f,l,0)):n.texImage2D(e,r,u,f,l,0,u,c,a||null)}function O(t,e,r,i,a){var s=t.element,u=t.data,c=t.internalformat,f=t.format,l=t.type,h=t.width,d=t.height;D(t),s?n.texSubImage2D(e,a,r,i,f,l,s):t.compressed?n.compressedTexSubImage2D(e,a,r,i,c,h,d,u):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,u)}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=Bt,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 j(t,e){var n=null;if(se(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 B(t,e){for(var n=t.images,r=0;r<n.length;++r){if(!n[r])return;R(n[r],e,r)}}var z=[];function H(){var t=z.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;z.push(t)}function Y(){this.minFilter=Ut,this.magFilter=Ut,this.wrapS=Lt,this.wrapT=Lt,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=Bt}function K(t,e){if("min"in e){var n=e.min;E.parameter(n,h),t.minFilter=h[n],Vt.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 s=e.wrap;"string"==typeof s?(E.parameter(s,f),o=a=f[s]):Array.isArray(s)&&(E.parameter(s[0],f),E.parameter(s[1],f),o=f[s[0]],a=f[s[1]])}else{if("wrapS"in e){var u=e.wrapS;E.parameter(u,f),o=f[u]}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,u.profile&&(this.stats={size:0})}function nt(t){n.activeTexture(zt),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(zt+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],s.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"),u.profile&&s.maxTextureUnits<e+1&&(s.maxTextureUnits=e+1),t.unit=e,n.activeTexture(zt+e),n.bindTexture(t.target,t.texture)}return e},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&it(this)}}),u.profile&&(s.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),j(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),B(a,vt),Z(n,vt),rt(),q(a),u.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,s.textureCount++,o(t,e),o.subimage=function(t,e,n,i){E(!!t,"must specify image data");var a=0|e,s=0|n,u=0|i,c=P();return I(c,r),c.width=0,c.height=0,k(c,t),c.width=c.width||(r.width>>u)-a,c.height=c.height||(r.height>>u)-s,E(r.type===c.type&&r.format===c.format&&r.internalformat===c.internalformat,"incompatible format for texture.subimage"),E(a>=0&&s>=0&&a+c.width<=r.width&&s+c.height<=r.height,"texture.subimage write out of bounds"),E(r.mipmask&1<<u,"missing mipmap data"),E(c.data||c.element||c.needsCopy,"missing image data"),nt(r),O(c,vt,a,s,u),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 s=0;r.mipmask>>s;++s){var c=i>>s,f=a>>s;if(!c||!f)break;n.texImage2D(vt,s,r.format,c,f,0,r.format,r.type,null)}return rt(),u.profile&&(r.stats.size=le(r.internalformat,r.type,i,a,!1,!1)),o},o._reglType="texture2d",o._texture=r,u.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,s.cubeCount++;var l=new Array(6);function h(t,e,n,r,o,a){var s,c=f.texInfo;for(Y.call(c),s=0;s<6;++s)l[s]=H();if("number"!=typeof t&&t)if("object"==typeof t)if(e)j(l[0],t),j(l[1],e),j(l[2],n),j(l[3],r),j(l[4],o),j(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"),s=0;s<6;++s)E("object"==typeof d[s]&&!!d[s],"invalid input for cube map face"),I(l[s],f),j(l[s],d[s])}else for(s=0;s<6;++s)j(l[s],t);else E.raise("invalid arguments to cube map");else{var p=0|t||1;for(s=0;s<6;++s)F(l[s],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),s=0;s<6;++s)B(l[s],yt+s);for(Z(c,gt),rt(),u.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],s=0;s<6;++s)q(l[s]);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,s=0|i,u=P();return I(u,f),u.width=0,u.height=0,k(u,e),u.width=u.width||(f.width>>s)-o,u.height=u.height||(f.height>>s)-a,E(f.type===u.type&&f.format===u.format&&f.internalformat===u.internalformat,"incompatible format for texture.subimage"),E(o>=0&&a>=0&&o+u.width<=f.width&&a+u.height<=f.height,"texture.subimage write out of bounds"),E(f.mipmask&1<<s,"missing mipmap data"),E(u.data||u.element||u.needsCopy,"missing image data"),nt(f),O(u,yt+t,o,a,s),rt(),G(u),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(),u.profile&&(f.stats.size=le(f.internalformat,f.type,h.width,h.height,!1,!0)),h}},h._reglType="textureCube",h._texture=f,u.profile&&(h.stats=f.stats),h.destroy=function(){f.decRef()},h},clear:function(){for(var t=0;t<Q;++t)n.activeTexture(zt+t),n.bindTexture(vt,null),tt[t]=null;W(J).forEach(it),s.cubeCount=0,s.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)}W(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(zt+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,s){function u(u){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(s.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(u)?p=u:u&&(E.type(u,"object","invalid arguments to regl.read()"),f=0|u.x,l=0|u.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|(u.width||i.framebufferWidth-f),d=0|(u.height||i.framebufferHeight-l),p=u.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=u(t)})),e}(t):u(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",je="depth.range",Be="depth.mask",ze="colorMask",Ve="cull.enable",We="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",sn="profile",un="framebuffer",cn="vert",fn="frag",ln="elements",hn="primitive",dn="count",pn="offset",vn="instances",gn="vao",yn="Width",mn="Height",bn=un+yn,_n=un+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,jn=35678,Bn=35680,zn=1028,Vn=1029,Wn=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:Wn};function Jn(e){return Array.isArray(e)||t(e)||V(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,s=!1,u=0;u<t.data.length;++u){var c=t.data[u];if(1===c.type)s=!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&&(s=!0)}else 4===c.type&&(o=o||c.data.thisDep,a=a||c.data.contextDep,s=s||c.data.propDep)}return new tr(o,a,s,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,s,u,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(je,"depthRange",[0,1]),C(Be,"depthMask",!0),C(ze,ze,[!0,!0,!0,!0]),I(Ve,2884),C(We,"cullFace",Vn),C(Xe,Xe,Wn),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",[zn,Xn,Xn,Xn]),C(nn,"stencilOpSeparate",[Vn,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:u,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=[Vn],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(),s={};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 u=o(),c=u.toString;return s[t]=e(u,{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(s).forEach((function(e){t.push('"',e,'":',s[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 s=t.next={},u=t.current={};Object.keys(A).forEach((function(t){Array.isArray(_[t])&&(s[t]=i.def(a.next,".",t),u[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,s,c,h){var d=t.static,p=t.dynamic;E.optional((function(){var t=[un,cn,fn,ln,hn,pn,dn,vn,sn,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(un in n){var i=n[un];return i?(i=u.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(un in r){var o=r[un];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 s=r.context;return e.set(s,"."+bn,a+"?"+a+".width:"+s+"."+xn),e.set(s,"."+_n,a+"?"+a+".height:"+s+"."+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,s,u=!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)):u=!1,"height"in o?(s=0|o.height,E.command(s>=0,"invalid "+t,n.commandStr)):u=!1,new tr(!u&&e&&e.thisDep,!u&&e&&e.contextDep,!u&&e&&e.propDep,(function(t,e){var n=t.shared.context,r=a;"width"in o||(r=e.def(n,".",bn,"-",c));var i=s;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"),s=n.def('"width" in ',r,"?",r,".width|0:","(",i,".",bn,"-",o,")"),u=n.def('"height" in ',r,"?",r,".height|0:","(",i,".",_n,"-",a,")");return E.optional((function(){e.assert(n,s+">=0&&"+u+">=0","invalid "+t)})),[o,a,s,u]}));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 s=a;a=new tr(a.thisDep,a.contextDep,a.propDep,(function(t,e){var n=s.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),s=e.def("null"),u=e.def(r,"(",a,")"),c=t.cond(u).then(s,"=",i,".createStream(",a,");").else(s,"=",i,".getElements(",a,");");return E.optional((function(){t.assert(c.else,"!"+a+"||"+s,"invalid elements")})),e.entry(c),e.exit(t.cond(u).then(i,".destroyStream(",s,");")),t.ELEMENTS=s,s}))}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 s=r[t];return rr(s,(function(e,n){var r=e.invoke(n,s);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 s=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 s?new tr(s.thisDep,s.contextDep,s.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 u=new tr(i.thisDep||s.thisDep,i.contextDep||s.contextDep,i.propDep||s.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(){u.DYNAMIC=!0})),u}return null}(),instances:o(vn,!1),offset:s}}(t,h),S=function(t,e){var n=t.static,r=t.dynamic,o={};return w.forEach((function(t){var a=T(t);function s(e,i){if(t in n){var s=e(n[t]);o[a]=nr((function(){return s}))}else if(t in r){var u=r[t];o[a]=rr(u,(function(t,e){return i(t,e,t.invoke(e,u))}))}}switch(t){case Ve:case Me:case Oe:case Je:case Ue:case rn:case qe:case Ke:case Ze:case Be:return s((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 s((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 je:return s((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 s((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 s=n.def('"',o,a,'" in ',r,"?",r,".",o,a,":",r,".",o);return E.optional((function(){e.assert(n,s+" in "+i,"invalid "+t+"."+o+a+", must be one of "+Object.keys(Hn))})),s}E.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid blend func, must be an object")}));var a=o("src","RGB"),s=o("dst","RGB");E.optional((function(){var t=e.constants.invalidBlendCombinations;e.assert(n,t+".indexOf("+a+'+", "+'+s+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")}));var u=n.def(i,"[",a,"]"),c=n.def(i,"[",o("src","Alpha"),"]");return[u,n.def(i,"[",s,"]"),c,n.def(i,"[",o("dst","Alpha"),"]")]}));case Ge:return s((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(),s=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(s.then,t,r),e.assert(s.else,r+"&&typeof "+r+'==="object"',"invalid "+t),n(s.else,t+".rgb",r+".rgb"),n(s.else,t+".alpha",r+".alpha")})),s.then(o,"=",a,"=",i,"[",r,"];"),s.else(o,"=",i,"[",r,".rgb];",a,"=",i,"[",r,".alpha];"),n(s),[o,a]}));case Pe:return s((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 s((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 s((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 s((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?Vn:zn,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?Vn:zn,o("fail"),o("zfail"),o("zpass")]}));case Ye:return s((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 We:return s((function(t){var n=0;return"front"===t?n=zn:"back"===t&&(n=Vn),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"?',zn,":",Vn)}));case He:return s((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 s((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:'+Wn)}));case ze:return s((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 s((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 s,u=a(fn),c=a(cn),f=null;return er(u)&&er(c)?(f=l.program(c.id,u.id,null,r),s=nr((function(t,e){return t.link(f)}))):s=new tr(u&&u.thisDep||c&&c.thisDep,u&&u.contextDep||c&&c.contextDep,u&&u.propDep||c&&c.propDep,(function(t,e){var n,r=t.shared.shader;n=u?u.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:u,vert:c,progVar:s,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(sn in n){var i=!!n[sn];(e=nr((function(t,e){return i}))).enable=i}else if(sn in r){var o=r[sn];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}(s,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],s=n.id(t),u=new g;if(Jn(i))u.state=1,u.buffer=o.getBuffer(o.create(i,Sn,!1,!0)),u.type=0;else{var c=o.getBuffer(i);if(c)u.state=1,u.buffer=c,u.type=0;else if(E.command("object"==typeof i&&i,"invalid data for attribute "+t,e.commandStr),"constant"in i){var f=i.constant;u.buffer="null",u.state=2,"number"==typeof f?u.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&&(u[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)}))})),u.buffer=c,u.state=1,u.size=d,u.normalized=p,u.type=v||c.dtype,u.offset=l,u.stride=h,u.divisor=y}}a[t]=nr((function(t,e){var n=t.attribCache;if(s in n)return n[s];var r={isStream:!1};return Object.keys(u).forEach((function(t){r[t]=u[t]})),u.buffer&&(r.buffer=t.link(u.buffer),r.type=r.type||r.buffer+".dtype"),n[s]=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,s=o.isBufferArgs,u=o.buffer;E.optional((function(){n.assert(r,i+"&&(typeof "+i+'==="object"||typeof '+i+'==="function")&&('+s+"("+i+")||"+u+".getBuffer("+i+")||"+u+".getBuffer("+i+".buffer)||"+s+"("+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(",s,"(",i,")){",c.isStream,"=true;",l,"=",u,".createStream(",Sn,",",i,");",h,"=",l,".dtype;","}else{",l,"=",u,".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(",s,"(",i,".buffer)){",l,"=",u,".createStream(",Sn,",",i,".buffer);","}else{",l,"=",u,".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,"){",u,".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,s=o.framebuffer;b&&(i=e.def(o.extensions,".webgl_draw_buffers"));var u,c=t.constants,f=c.drawBuffer,l=c.backBuffer;u=n?n.append(t,e):e.def(s,".next"),r||e("if(",u,"!==",s,".cur){"),e("if(",u,"){",a,".bindFramebuffer(",36160,",",u,".framebuffer);"),b&&e(i,".drawBuffersWEBGL(",f,"[",u,".colorAttachments.length]);"),e("}else{",a,".bindFramebuffer(",36160,",null);"),b&&e(i,".drawBuffersWEBGL(",l,");"),e("}",s,".cur=",u,";"),r||e("}")}function U(t,e,n){var r=t.shared,i=r.gl,o=t.current,a=t.next,s=r.current,u=r.next,c=t.cond(s,".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(u,".",l);var d=t.cond(r,"!==",s,".",l);c(d),l in S?d(t.cond(r).then(i,".enable(",S[l],");").else(i,".disable(",S[l],");"),s,".",l,"=",r,";"):d(i,".",A[l],"(",r,");",s,".",l,"=",r,";")}})),0===Object.keys(n.state).length&&c(s,".dirty=false;"),e(c)}function F(t,e,n,r){var i=t.shared,o=t.current,a=i.current,s=i.gl;Qn(Object.keys(n)).forEach((function(i){var u=n[i];if(!r||r(u)){var c=u.append(t,e);if(S[i]){var f=S[i];er(u)?e(s,c?".enable(":".disable(",f,");"):e(t.cond(c).then(s,".enable(",f,");").else(s,".disable(",f,");")),e(a,".",i,"=",c,";")}else if(dt(c)){var l=o[i];e(s,".",A[i],"(",c,");",c.map((function(t,e){return l+"["+e+"]="+t})).join(";"),";")}else e(s,".",A[i],"(",c,");",a,".",i,"=",c,";")}}))}function j(t,e){m&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function B(t,e,n,r,i){var o,a,s,u=t.shared,c=t.stats,f=u.current,l=u.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(s=h.append(t,e))}else s=e.def(f,".profile");var m=t.block();v(m),e("if(",s,"){",m,"}");var b=t.block();g(b),e.exit("if(",s,"){",b,"}")}function z(t,e,n,r,i){var o=t.shared;r.forEach((function(r){var a,s=r.name,u=n.attributes[s];if(u){if(!i(u))return;a=u.append(t,e)}else{if(!i(ir))return;var c=t.scopeAttrib(s);E.optional((function(){t.assert(e,c+".state","missing attribute "+s)})),a={},Object.keys(new g).forEach((function(t){a[t]=e.def(c,".",t)}))}!function(n,r,i){var a=o.gl,s=e.def(n,".location"),u=e.def(o.attributes,"[",s,"]"),c=i.state,f=i.buffer,l=[i.x,i.y,i.z,i.w],h=["buffer","normalized","offset","stride"];function d(){e("if(!",u,".buffer){",a,".enableVertexAttribArray(",s,");}");var n,o=i.type;if(n=i.size?e.def(i.size,"||",r):r,e("if(",u,".type!==",o,"||",u,".size!==",n,"||",h.map((function(t){return u+"."+t+"!=="+i[t]})).join("||"),"){",a,".bindBuffer(",Sn,",",f,".buffer);",a,".vertexAttribPointer(",[s,n,o,i.normalized,i.stride,i.offset],");",u,".type=",o,";",u,".size=",n,";",h.map((function(t){return u+"."+t+"="+i[t]+";"})).join(""),"}"),m){var c=i.divisor;e("if(",u,".divisor!==",c,"){",t.instancing,".vertexAttribDivisorANGLE(",[s,c],");",u,".divisor=",c,";}")}}function p(){e("if(",u,".buffer){",a,".disableVertexAttribArray(",s,");",u,".buffer=null;","}if(",Re.map((function(t,e){return u+"."+t+"!=="+l[e]})).join("||"),"){",a,".vertexAttrib4f(",s,",",l,");",Re.map((function(t,e){return u+"."+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 V(t,e,r,i,o){for(var a,s=t.shared,u=s.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===jn||d===Bn){E.command("function"==typeof g&&(d===jn&&("texture2d"===g._reglType||"framebuffer"===g._reglType)||d===Bn&&("textureCube"===g._reglType||"framebufferCube"===g._reglType)),"invalid texture for uniform "+h,t.commandStr);var y=t.link(g._texture||g.color[0]._texture);e(u,".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(u,".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(u,".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(s.uniforms,"[",n.id(h),"]")}d===jn?(E(!Array.isArray(f),"must specify a scalar prop for textures"),e("if(",f,"&&",f,'._reglType==="framebuffer"){',f,"=",f,".color[0];","}")):d===Bn&&(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(s.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 jn:o(3553);break;case Bn:o(34067)}}));var _=1;switch(d){case jn:case Bn:var x=e.def(f,"._texture");e(u,".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(u,".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 W(t,e,n,r){var i=t.shared,o=i.gl,a=i.draw,s=r.draw;var u=function(){var i,u=s.elements,c=e;return u?((u.contextDep&&r.contextDynamic||u.propDep)&&(c=n),i=u.append(t,c)):i=c.def(a,".",ln),i&&c("if("+i+")"+o+".bindBuffer(34963,"+i+".buffer.buffer);"),i}();function c(i){var o=s[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=s.count,u=e;return o?((o.contextDep&&r.contextDynamic||o.propDep)&&(u=n),i=o.append(t,u),E.optional((function(){o.MISSING&&t.assert(e,"false","missing vertex count"),o.DYNAMIC&&t.assert(u,i+">=0","missing vertex count")}))):(i=u.def(a,".",dn),E.optional((function(){t.assert(u,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=u+".type",g=s.elements&&er(s.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],");")}u?g?t():(n("if(",u,"){"),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]+");")}u?g?t():(n("if(",u,"){"),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){j(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);"),z(t,e,n,r.attributes,(function(){return!0}))),V(t,e,n,r.uniforms,(function(){return!0})),W(t,e,e,n)}function q(t,e,n,r){function i(){return!0}t.batchId="a1",j(t,e),z(t,e,n,r.attributes,i),V(t,e,n,r.uniforms,i),W(t,e,e,n)}function Y(t,e,n,r){j(t,e);var i=n.contextDep,o=e.def(),a=e.def();t.shared.props=a,t.batchId=o;var s=t.scope(),u=t.scope();function c(t){return t.contextDep&&i||t.propDep}function f(t){return!c(t)}if(e(s.entry,"for(",o,"=0;",o,"<","a1",";++",o,"){",a,"=","a0","[",o,"];",u,"}",s.exit),n.needsContext&&G(t,u,n.context),n.needsFramebuffer&&L(t,u,n.framebuffer),F(t,u,n.state,c),n.profile&&c(n.profile)&&B(t,u,n,!1,!0),r)n.useVAO?n.drawVAO?c(n.drawVAO)?u(t.shared.vao,".setVAO(",n.drawVAO.append(t,u),");"):s(t.shared.vao,".setVAO(",n.drawVAO.append(t,s),");"):s(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(s(t.shared.vao,".setVAO(null);"),z(t,s,n,r.attributes,f),z(t,u,n,r.attributes,c)),V(t,s,n,r.uniforms,f),V(t,u,n,r.uniforms,c),W(t,s,u,n);else{var l=t.global.def("{}"),h=n.shader.progVar.append(t,u),d=u.def(h,".id"),p=u.def(l,"[",d,"]");u(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,s=!1,u=!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,u=u||o.propDep,s=s||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:s,propDep:u,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,s=t.shared,u=s.gl,c=s.next,f=s.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(s.attributes,"[",l,"]"),d=t.cond(h,".buffer");d.then(u,".enableVertexAttribArray(",l,");",u,".bindBuffer(",Sn,",",h,".buffer.buffer);",u,".vertexAttribPointer(",l,",",h,".size,",h,".type,",h,".normalized,",h,".stride,",h,".offset);").else(u,".disableVertexAttribArray(",l,");",u,".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),s=t.block();s("if(",a,"){",u,".enable(",i,")}else{",u,".disable(",i,")}",f,".",r,"=",a,";"),n(s),e("if(",a,"!==",f,".",r,"){",s,"}")})),Object.keys(A).forEach((function(r){var i,a,s=A[r],l=_[r],h=t.block();if(h(u,".",s,"("),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 s=O();s.stats=s.link(a),Object.keys(r.static).forEach((function(t){Z(s,r,t)})),En.forEach((function(e){Z(s,t,e)}));var u=M(t,r,i,o,s);return function(t,e){var n=t.proc("draw",1);j(t,n),G(t,n,e.context),L(t,n,e.framebuffer),U(t,n,e),F(t,n,e.state),B(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;")}(s,u),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)})),B(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,");")}(s,u),function(t,e){var n=t.proc("batch",2);t.batchId="0",j(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 s(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!s(t)})),e.profile&&s(e.profile)||B(t,n,e,!1,"a1"),e.contextDep=r,e.needsContext=i,e.needsFramebuffer=a;var u=e.shader.progVar;if(u.contextDep&&r||u.propDep)Y(t,n,e,null);else{var c=u.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;")}(s,u),e(s.compile(),{destroy:function(){u.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 s(t){a.push(t)}var u=[];function c(t,e,n){var r=a.pop()||new o;r.startQueryIndex=t,r.endQueryIndex=e,r.sum=0,r.stats=n,u.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<u.length;++n){var h=u[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,s(h)):(h.startQueryIndex=v,h.endQueryIndex=g,u[t++]=h)}u.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}}},sr="webglcontextlost",ur="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(),s=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(!s)return null;var u,c,f=(u={"":0},c=[""],{id:function(t){var e=u[t];return e||(e=u[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=s.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,j,1,1,0,j,B,null);var s=t.createFramebuffer();if(t.bindFramebuffer(z,s),t.framebufferTexture2D(z,36064,F,a,0),t.bindTexture(F,null),36053!==t.checkFramebufferStatus(z))o=!1;else{t.viewport(0,0,1,1),t.clearColor(1,0,0,1),t.clear(16384);var u=U.allocType(B,4);t.readPixels(0,0,1,1,j,B,u),t.getError()?o=!1:(t.deleteFramebuffer(s),t.deleteTexture(a),o=1===u[0]),U.freeType(u)}}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,j,3,3,0,j,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 s(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})}s.prototype.bind=function(){e.bindBuffer(this.type,this.buffer)},s.prototype.destroy=function(){l(this)};var u=[];function c(t,n,r){t.byteLength=n.byteLength,e.bufferData(t.type,n,r)}function f(e,n,r,i,o,a){var s,u;if(e.usage=r,Array.isArray(n)){if(e.dtype=i||tt,n.length>0)if(Array.isArray(n[0])){s=J(n);for(var f=1,l=1;l<s.length;++l)f*=s[l];e.dimension=f,c(e,u=$(n,s,e.dtype),r),a?e.persistentData=u:U.freeType(u)}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,u=$(n,[n.length,n[0].length],e.dtype),r),a?e.persistentData=u:U.freeType(u)):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(V(n)){s=n.shape;var d=n.stride,p=n.offset,v=0,g=0,y=0,m=0;1===s.length?(v=s[0],g=1,y=d[0],m=0):2===s.length?(v=s[0],g=s[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,u,c){n.bufferCount++;var h=new s(o);function d(n){var i=35044,o=null,a=0,s=0,u=1;return Array.isArray(n)||t(n)||V(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)||V(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"),s=K[n.type]),"dimension"in n&&(E.type(n.dimension,"number","invalid dimension"),u=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,s,u,c):(a&&e.bufferData(h.type,a,i),h.dtype=s||Q,h.usage=i,h.dimension=u,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,u||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(V(e)){r=e.shape;var s=e.stride,u=0,c=0,f=0,l=0;1===r.length?(u=r[0],c=1,f=s[0],l=0):2===r.length?(u=r[0],c=r[1],f=s[0],l=s[1]):E.raise("invalid shape");var v=Array.isArray(e.data)?h.dtype:nt(e.data),g=U.allocType(v,u*c);it(g,e.data,u,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=u.pop();return n||(n=new s(t)),n.bind(),f(n,e,35040,0,1,!1),n},destroyStream:function(t){u.push(t)},clear:function(){W(a).forEach(l),u.forEach(l)},getBuffer:function(t){return t&&t._buffer instanceof s?t._buffer:null},restore:function(){W(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,s=new Array(a),u=0;u<a;++u)s[u]=new Te;var c=0,f={},l={Record:Te,scope:{},state:s,currentVAO:null,targetVAO:null,restore:h()?function(){h()&&W(f).forEach((function(t){t.refresh()}))}:function(){},createVAO:function(e){var r=new p;function s(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={},u=r.attributes;u.length=e.length;for(var c=0;c<e.length;++c){var f,l=e[c],h=u[c]=new Te,d=l.data||l;Array.isArray(d)||t(d)||V(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(),s}return i.vaoCount+=1,s.destroy=function(){for(var t=0;t<r.buffers.length;++t)r.buffers[t]&&r.buffers[t].destroy();r.buffers.length=0,r.destroy()},s._vao=r,s._reglType="vao",s(e)},getVAO:function(t){return"function"==typeof t&&t._vao?t._vao:null},destroyBuffer:function(t){for(var n=0;n<s.length;++n){var r=s[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<s.length;++r){var i=s[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(){W(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,s={uint8:at,uint16:st};function u(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&&(s.uint32=ut),u.prototype.bind=function(){this.buffer.bind()};var c=[];function f(i,o,a,s,u,c,f){var l;if(i.buffer.bind(),o){var h=f;f||t(o)&&(!V(o)||t(o.data))||(h=n.oes_element_index_uint?ut:st),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 st:case 5122:l=st;break;case ut:case 5124:l=ut;break;default:E.raise("unsupported type for element array")}i.buffer.dtype=l}i.type=l,E(l!==ut||!!n.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var d=u;d<0&&(d=i.buffer.byteLength,l===st?d>>=1:l===ut&&(d>>=2)),i.vertCount=d;var p=s;if(s<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 u(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,u=-1,l=0,h=0;Array.isArray(e)||t(e)||V(e)?n=e:(E.type(e,"object","invalid arguments for elements"),"data"in e&&(n=e.data,E(Array.isArray(n)||t(n)||V(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"),u=0|e.count),"type"in e&&(E.parameter(e.type,s,"invalid buffer type"),h=s[e.type]),"length"in e?l=0|e.length:(l=u,h===st||5122===h?l*=2:h!==ut&&5124!==h||(l*=4))),f(a,n,r,i,u,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 u(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 u?t._elements:null},clear:function(){W(o).forEach(l)}}}(i,h,b,l),w=function(t,n,r,i){var o={},a={};function s(t,e,n,r){this.name=t,this.id=e,this.location=n,this.info=r}function u(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 s=35632===e?o:a,u=s[r];if(!u){var c=n.str(r);u=t.createShader(e),t.shaderSource(u,c),t.compileShader(u),E.shaderError(t,u,c,e,i),s[r]=u}return u}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+"]");u(g,new s(m,n.id(m),t.getUniformLocation(d,m),f))}else u(g,new s(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))&&u(_,new s(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);W(o).forEach(e),o={},W(a).forEach(e),a={},l.forEach((function(e){t.deleteProgram(e.program)})),l.length=0,f={},r.shaderCount=0},program:function(n,i,s,u){E.command(n>=0,"missing vertex shader",s),E.command(i>=0,"missing fragment shader",s);var c=f[i];c||(c=f[i]={});var h=c[n];if(h&&(h.refCount++,!u))return h;var v=new d(i,n);return r.shaderCount++,p(v,s,u),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 s=0,u={};function c(t){this.id=s++,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 u[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(u).forEach((function(e){t+=u[e].stats.size})),t}),{create:function(e,s){var f=new c(t.createRenderbuffer());function l(e,r){var s=0,u=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"),s=0|d[0],u=0|d[1]}else"radius"in h&&(s=u=0|h.radius),"width"in h&&(s=0|h.width),"height"in h&&(u=0|h.height);"format"in h&&(E.parameter(h.format,o,"invalid renderbuffer format"),c=o[h.format])}else"number"==typeof e?(s=0|e,u="number"==typeof r?0|r:s):e?E.raise("invalid arguments to renderbuffer constructor"):s=u=1;if(E(s>0&&u>0&&s<=n.maxRenderbufferSize&&u<=n.maxRenderbufferSize,"invalid renderbuffer size"),s!==f.width||u!==f.height||c!==f.format)return l.width=f.width=s,l.height=f.height=u,f.format=c,t.bindRenderbuffer(de,f.renderbuffer),t.renderbufferStorage(de,c,s,u),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 u[f.id]=f,r.renderbufferCount++,l(e,s),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(){W(u).forEach(f)},restore:function(){W(u).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 s={cur:null,next:null,dirty:!1,setFBO:null},u=["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 s=i.create2D({width:t,height:e,format:r,type:a});return s._texture.refCount=0,new l(be,s,null)}var u=o.create({width:t,height:e,format:r});return u._renderbuffer.refCount=0,new l(me,null,u)}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,s.next?s.next.framebuffer:null),s.cur=s.next,t.getError()}function T(t,i){var o=new x;function l(t,e){var i;E(s.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,u.indexOf(x)>=0?_=!0:c.indexOf(x)>=0?_=!1:_?E.oneOf(k.colorFormat,u,"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(s.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){s.setFBO({framebuffer:l},t)}})}return e(s,{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(s.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,u,"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(){W(_).forEach(S)},restore:function(){s.cur=null,s.next=null,s.dirty=!0,W(_).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,s.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),s=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),u={gpuTime:0,cpuTime:0,count:0},c=I.compile(s,o,i,r,u),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:u,destroy:function(){c.destroy()}})}O&&(O.addEventListener(sr,lt,!1),O.addEventListener(ur,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(sr,lt),O.removeEventListener(ur,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(49216);var t,e=(t=n(72680))&&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:()=>al,ConcentricLayout:()=>ge,DagreLayout:()=>Lt,ERLayout:()=>Cl,ForceAtlas2Layout:()=>hl,ForceLayout:()=>Dt,FruchtermanGPULayout:()=>tl,FruchtermanLayout:()=>_e,GForceGPULayout:()=>il,GForceLayout:()=>k,GridLayout:()=>T,Layout:()=>Dl,Layouts:()=>Nl,MDSLayout:()=>me,RadialLayout:()=>pe,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},s=function(t){return Number.isNaN(Number(t))};function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}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"===u(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"===u(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],s=o[r];i[a][s]=1,e||(i[s][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,u=t.begin;if(0===i)return t.onLayoutEnd&&t.onLayoutEnd(),{nodes:n,edges:r};if(1===i)return n[0].x=u[0],n[0].y=u[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",s(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,s=n+i,u=r+i;t.cellWidth=Math.max(t.cellWidth,s),t.cellHeight=Math.max(t.cellHeight,u)})),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,s=r.id2manPos[t.id];if(s)e=s.col*o+o/2+i[0],n=s.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 s={},u={};r.forEach((function(t,e){a(t.x)||(t.x=Math.random()*n.width),a(t.y)||(t.y=Math.random()*n.height),s[t.id]=t,u[t.id]=e})),n.nodeMap=s,n.nodeIdxMap=u,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 s=e.runOneStep(a);if(e.reachMoveThreshold(r,s,o))break}null===(t=e.onLayoutEnd)||void 0===t||t.call(e)}else{if("undefined"==typeof window)return;var u=0;this.timeInterval=window.setInterval((function(){var t,i;if(r){var a=e.runOneStep(u)||[];e.reachMoveThreshold(r,a,o)&&(null===(t=e.onLayoutEnd)||void 0===t||t.call(e),window.clearInterval(e.timeInterval)),++u>=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 s=Math.max(.02,n.interval-.002*t);n.updateVelocity(o,a,s,r);var u=[];return r.forEach((function(t){u.push({x:t.x,y:t.y})})),n.updatePosition(a,s,r),null===(e=n.tick)||void 0===e||e.call(n),u}},e.prototype.calRepulsive=function(t,e){var n=this,r=n.getMass,i=n.nodeStrength,o=n.factor,a=n.coulombDisScale,s=n.preventOverlap,u=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,s&&p<(u(n)+u(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,s=n.getMass;e.forEach((function(e,n){var u=d(e,"source"),c=d(e,"target"),f=r[u],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[u],_=i[c],x=s?s(f):1,w=s?s(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,s=e.length,u=0;u<s;u++){var c=e[u],f=c.x-r[0],l=c.y-r[1],h=i;if(n.getCenter){var d=n.getCenter(c,o[u]);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*u]-=h*f,t[2*u+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,s=t[2*r+1]*o||.01,u=Math.sqrt(a*a+s*s);if(u>i.maxSpeed){var c=i.maxSpeed/u;a*=c,s*=c}e[2*r]=a,e[2*r+1]=s}))},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,s,u,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(s=+t._x.call(null,d.data),u=+t._y.call(null,d.data),e===s&&n===u)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=(u>=a)<<1|s>=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 j(t){return function(){return t}}function B(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),s=new Array(o),u=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,s[n]=i,r<u&&(u=r),r>f&&(f=r),i<c&&(c=i),i>l&&(l=i));if(u>f||c>l)return this;for(this.cover(u,c).cover(f,l),n=0;n<o;++n)R(this,a[n],s[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,s,u=i-n||1,c=this._root;n>t||t>=i||r>e||e>=o;)switch(s=(e<r)<<1|t<n,(a=new Array(4))[s]=c,c=a,u*=2,s){case 0:i=n+u,o=r+u;break;case 1:n=i-u,o=r+u;break;case 2:i=n+u,r=o-u;break;case 3:n=i-u,r=o-u}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,s,u,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);u=p.pop();)if(!(!(v=u.node)||(i=u.x0)>h||(o=u.y0)>d||(a=u.x1)<f||(s=u.y1)<l))if(v.length){var g=(i+a)/2,y=(o+s)/2;p.push(new O(v[3],g,y,a,s),new O(v[2],i,y,g,s),new O(v[1],g,o,a,y),new O(v[0],i,o,g,y)),(c=(e>=y)<<1|t>=g)&&(u=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=u)}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,s,u,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>=(s=(p+g)/2))?p=s:g=s,(f=a>=(u=(v+y)/2))?v=u:y=u,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,s=[],u=this._root;for(u&&s.push(new O(u,this._x0,this._y0,this._x1,this._y1));e=s.pop();)if(!t(u=e.node,r=e.x0,i=e.y0,o=e.x1,a=e.y1)&&u.length){var c=(r+o)/2,f=(i+a)/2;(n=u[3])&&s.push(new O(n,c,f,o,a)),(n=u[2])&&s.push(new O(n,r,f,c,a)),(n=u[1])&&s.push(new O(n,c,i,o,f)),(n=u[0])&&s.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,s=e.y0,u=e.x1,c=e.y1,f=(a+u)/2,l=(s+c)/2;(o=i[0])&&n.push(new O(o,a,s,f,l)),(o=i[1])&&n.push(new O(o,f,s,u,l)),(o=i[2])&&n.push(new O(o,a,l,f,c)),(o=i[3])&&n.push(new O(o,f,l,u,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 z={value:()=>{}};function V(){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 W(r)}function W(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]=z,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}W.prototype=V.prototype={constructor:W,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 W(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=V;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 st(){this._call=this._time=this._next=null}function ut(t,e,n){var r=new st;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)))}st.prototype=ut.prototype={constructor:st,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,s=new Map,u=ut(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&&(u.stop(),c.call("end",e))}function h(r){var u,c,f=t.length;void 0===r&&(r=1);for(var l=0;l<r;++l)for(n+=(o-n)*i,s.forEach((function(t){t(n)})),u=0;u<f;++u)null==(c=t[u]).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 u.restart(l),e},stop:function(){return u.stop(),e},nodes:function(n){return arguments.length?(t=n,d(),s.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,s.forEach(p),e):f},force:function(t,n){return arguments.length>1?(null==n?s.delete(t):s.set(t,p(n)),e):s.get(t)},find:function(e,n,r){var i,o,a,s,u,c=0,f=t.length;for(null==r?r=1/0:r*=r,c=0;c<f;++c)(a=(i=e-(s=t[c]).x)*i+(o=n-s.y)*o)<r&&(u=s,r=a);return u},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=j(-30),a=1,s=1/0,u=.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,s=0,u=0;if(t.length){for(r=o=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(s+=e.value,u+=n,r+=n*e.x,o+=n*e.y);t.x=r/u,t.y=o/u}else{(e=t).x=e.data.x,e.y=e.data.y;do{s+=i[e.data.index]}while(e=e.next)}t.value=s}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/u<p)return p<s&&(0===l&&(p+=(l=B(n))*l),0===h&&(p+=(h=B(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>=s)){(t.data!==e||t.next)&&(0===l&&(p+=(l=B(n))*l),0===h&&(p+=(h=B(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:j(+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?(s=t*t,c):Math.sqrt(s)},c.theta=function(t){return arguments.length?(u=t*t,c):Math.sqrt(u)},c}function mt(t,e){var n,r=1;function i(){var i,o,a=n.length,s=0,u=0;for(i=0;i<a;++i)s+=(o=n[i]).x,u+=o.y;for(s=(s/a-t)*r,u=(u/a-e)*r,i=0;i<a;++i)(o=n[i]).x-=s,o.y-=u}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,s=bt,u=function(t){return 1/Math.min(i[t.source.index],i[t.target.index])},c=j(30),f=1;function l(r){for(var i=0,s=t.length;i<f;++i)for(var u,c,l,h,d,p,v,g=0;g<s;++g)c=(u=t[g]).source,h=(l=u.target).x+l.vx-c.x-c.vx||B(a),d=l.y+l.vy-c.y-c.vy||B(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,u,c=r.length,f=t.length,l=new Map(r.map(((t,e)=>[s(t,e,r),t])));for(a=0,i=new Array(c);a<f;++a)(u=t[a]).index=a,"object"!=typeof u.source&&(u.source=_t(l,u.source)),"object"!=typeof u.target&&(u.target=_t(l,u.target)),i[u.source.index]=(i[u.source.index]||0)+1,i[u.target.index]=(i[u.target.index]||0)+1;for(a=0,o=new Array(f);a<f;++a)u=t[a],o[a]=i[u.source.index]/(i[u.source.index]+i[u.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]=+u(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?(s=t,l):s},l.iterations=function(t){return arguments.length?(f=+t,l):f},l.strength=function(t){return arguments.length?(u="function"==typeof t?t:j(+t),d(),l):u},l.distance=function(t){return arguments.length?(c="function"==typeof t?t:j(+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,u,c,f,l,h,d=e.length,p=0;p<o;++p)for(a=G(e,wt,Et).visitAfter(s),t=0;t<d;++t)u=e[t],l=n[u.index],h=l*l,c=u.x+u.vx,f=u.y+u.vy,a.visit(v);function v(t,e,n,o,a){var s=t.data,d=t.r,p=l+d;if(!s)return e>c+p||o<c-p||n>f+p||a<f-p;if(s.index>u.index){var v=c-s.x-s.vx,g=f-s.y-s.vy,y=v*v+g*g;y<p*p&&(0===v&&(y+=(v=B(r))*v),0===g&&(y+=(g=B(r))*g),y=(p-(y=Math.sqrt(y)))/y*i,u.vx+=(v*=y)*(p=(d*=d)/(h+d)),u.vy+=(g*=y)*p,s.vx-=v*(p=1-p),s.vy-=g*p)}}}function s(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 u(){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=j(null==t?1:+t)),a.initialize=function(t,n){e=t,r=n,u()},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:j(+e),u(),a):t},a}function At(t){var e,n,r,i=j(.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=j(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:j(+t),a(),o):i},o.x=function(e){return arguments.length?(t="function"==typeof e?e:j(+e),a(),o):t},o}function Tt(t){var e,n,r,i=j(.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=j(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:j(+t),a(),o):i},o.y=function(e){return arguments.length?(t="function"==typeof e?e:j(+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,s=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(s).restart(),this.ticking=!0;else try{var u=yt();if(e.nodeStrength&&u.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),s=[0,0],u=[],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=u.length,o=void 0,a=t*m;r<i;++r)(o=u[r]).vx+=(p[n(o)].x-o.x)*a,o.vy+=(p[n(o)].y-o.y)*a}function _(){u&&function(){if(u&&u.length){if(void 0===n(u[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,s,p,g,y,m=(t=[],s=[],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}(u),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&&s.push({source:r,target:i,count:t.count})})),{nodes:t,links:s});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-s[0],y:t.y-s[1]}})),p}function w(t){c={},t.forEach((function(t){c[t.id]=t}))}return b.initialize=function(t){u=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||[]),u=t||[],b):u},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?(s=t,b):s},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",u).alpha(s).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,s=r.nodeSpacing,u=r.collideStrength;if(n=a(s)?function(){return s}:b(s)?s: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(u))},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,s=t.endRadius,u=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||s?!a&&s?a=s:a&&!s&&(s=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/u),_=0;_<r;++_){var x=o;x||null===a||null===s||(x=a+_*(s-a)/(r-1)),x||(x=10+100*_/(r-1));var w=c+_%b*v+2*Math.PI/u*Math.floor(_/b);m||(w=f-_%b*v-2*Math.PI/u*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,s=[o[0]],u=[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 s=t[o].children,u=t[a].parent;s.push(t[a].id),u.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 s=t[o].children,u=t[a].children;s.push(t[a].id),u.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}(s[l],t,r)||c[e]){for(var h=s[l].children,p=!1,v=0;v<h.length;v++){var g=a[h[v]];if(n[g]===n[e]&&!c[g]){s.push(o[g]),u.push(i[a[o[g].id]]),c[g]=!0,p=!0;break}}for(var y=0;!p&&(c[y]||(s.push(o[y]),u.push(i[a[o[y].id]]),c[y]=!0,p=!0),++y!==f););}else s.push(t),u.push(i[a[t.id]]),c[e]=!0,l++})),u},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(79012),Pt=n.n(Mt),Gt=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)}}(),Lt=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.keepNodeOrder=!1,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 Gt(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,s=e.combos;if(n){var u,c=e.edges||[],f=new(Pt().graphlib.Graph)({multigraph:!0,compound:!0});u=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 h=Ut(e.nodesepFunc,e.nodesep,50),p=Ut(e.ranksepFunc,e.ranksep,50);"LR"!==i&&"RL"!==i||(h=Ut(e.ranksepFunc,e.ranksep,50),p=Ut(e.nodesepFunc,e.nodesep,50)),f.setDefaultEdgeLabel((function(){return{}})),f.setGraph(e);var v={};n.filter((function(t){return!1!==t.layout})).forEach((function(e){var n=u(e),r=p(e),i=h(e),o=n[0]+2*i,s=n[1]+2*r,c=e.layer;a(c)?f.setNode(e.id,{width:o,height:s,layer:c}):f.setNode(e.id,{width:o,height:s}),t.sortByCombo&&e.comboId&&(v[e.comboId]||(v[e.comboId]=!0,f.setNode(e.comboId,{})),f.setParent(e.id,e.comboId))})),this.sortByCombo&&s&&s.forEach((function(t){t.parentId&&(v[t.parentId]||(v[t.parentId]=!0,f.setNode(t.parentId,{})),f.setParent(t.id,t.parentId))})),c.forEach((function(e){var n=d(e,"source"),r=d(e,"target");t.layoutNode(n)&&t.layoutNode(r)&&f.setEdge(n,r,{weight:e.weight||1})}));var g,y=void 0;return e.preset&&(y=new(Pt().graphlib.Graph)({multigraph:!0,compound:!0}),e.preset.nodes.forEach((function(t){null==y||y.setNode(t.id,t)}))),Pt().layout(f,{prevGraph:y,edgeLabelSpace:e.edgeLabelSpace,keepNodeOrder:e.keepNodeOrder,nodeOrder:e.nodeOrder}),f.nodes().forEach((function(t){g=f.node(t);var e=n.findIndex((function(e){return e.id===t}));n[e]&&(n[e].x=g.x,n[e].y=g.y,n[e]._order=g._order)})),f.edges().forEach((function(t){g=f.edge(t);var n=c.findIndex((function(e){var n=d(e,"source"),r=d(e,"target");return n===t.v&&r===t.w}));e.edgeLabelSpace&&e.controlPoints&&"loop"!==c[n].type&&(c[n].controlPoints=g.points.slice(1,g.points.length-1))})),e.onLayoutEnd&&e.onLayoutEnd(),{nodes:n,edges:c}}},e.prototype.getType=function(){return"dagre"},e}(t);function Ut(t,e,n){return t||(a(e)?function(){return e}:function(){return n})}const Ft=Object.prototype.toString;function jt(t){return Ft.call(t).endsWith("Array]")}const Bt=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!jt(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],s=r+1;s<o;s++)t[s]>a&&(a=t[s]);return a},zt=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!jt(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],s=r+1;s<o;s++)t[s]<a&&(a=t[s]);return a};function Vt(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!jt(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(!jt(n.output))throw new TypeError("output option must be an array if specified");e=n.output}else e=new Array(t.length);var r=zt(t),i=Bt(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,s=n.max,u=void 0===s?n.autoMinMax?i:1:s;if(a>=u)throw new RangeError("min option must be smaller than max option");for(var c=(u-a)/(i-r),f=0;f<t.length;f++)e[f]=(t[f]-r)*c+a;return e}const Wt=" ".repeat(2),Xt=" ".repeat(4);function Ht(t,e={}){const{maxRows:n=15,maxColumns:r=10,maxNumSize:i=8}=e;return`${t.constructor.name} {\n${Wt}[\n${Xt}${function(t,e,n,r){const{rows:i,columns:o}=t,a=Math.min(i,e),s=Math.min(o,n),u=[];for(let e=0;e<a;e++){let n=[];for(let i=0;i<s;i++)n.push(qt(t.get(e,i),r));u.push(`${n.join(" ")}`)}return s!==o&&(u[u.length-1]+=` ... ${o-n} more columns`),a!==i&&u.push(`... ${i-e} more rows`),u.join(`\n${Xt}`)}(t,n,r,i)}\n${Wt}]\n${Wt}rows: ${t.rows}\n${Wt}columns: ${t.columns}\n}`}function qt(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 Yt(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 Kt(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 Zt(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 $t(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 Jt(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 Qt(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 te(t,e,n,r,i){if(5!==arguments.length)throw new RangeError("expected 4 arguments");if(ne("startRow",e),ne("endRow",n),ne("startColumn",r),ne("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 ee(t,e=0){let n=[];for(let r=0;r<t;r++)n.push(e);return n}function ne(t,e){if("number"!=typeof e)throw new TypeError(`${t} must be a number`)}function re(t){if(t.isEmpty())throw new Error("Empty matrix has no elements to index")}class ie{static from1DArray(t,e,n){if(t*e!==n.length)throw new RangeError("data length does not match given dimensions");let r=new ae(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 ae(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 ae(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 ae(t,e)}static ones(t,e){return new ae(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 ae(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,s=new ae(t,e);for(let n=0;n<t;n++)for(let t=0;t<e;t++){let e=r+Math.round(o()*a);s.set(n,t,e)}return s}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 ae(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 ie.isMatrix(t)?t:new ae(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 ae(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){Yt(this,t);let e=[];for(let n=0;n<this.columns;n++)e.push(this.get(t,n));return e}getRowVector(t){return ae.rowVector(this.getRow(t))}setRow(t,e){Yt(this,t),e=Zt(this,e);for(let n=0;n<this.columns;n++)this.set(t,n,e[n]);return this}swapRows(t,e){Yt(this,t),Yt(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){Kt(this,t);let e=[];for(let n=0;n<this.rows;n++)e.push(this.get(n,t));return e}getColumnVector(t){return ae.columnVector(this.getColumn(t))}setColumn(t,e){Kt(this,t),e=$t(this,e);for(let n=0;n<this.rows;n++)this.set(n,t,e[n]);return this}swapColumns(t,e){Kt(this,t),Kt(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=Zt(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=Zt(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=Zt(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=Zt(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=$t(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=$t(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=$t(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=$t(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){Yt(this,t);for(let n=0;n<this.columns;n++)this.set(t,n,this.get(t,n)*e);return this}mulColumn(t,e){Kt(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(){re(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(){re(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(Yt(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){Yt(this,t),re(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(Yt(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){Yt(this,t),re(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(Kt(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){Kt(this,t),re(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(Kt(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){Kt(this,t),re(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){ie.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=ae.checkMatrix(t);let e=this.rows,n=this.columns,r=t.columns,i=new ae(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=ae.checkMatrix(t);let e=new ae(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),s=t.get(1,0),u=this.get(1,1),c=t.get(1,1),f=(n+u)*(r+c),l=(a+u)*r,h=n*(o-c),d=u*(s-r),p=(n+i)*c,v=f+d-p+(i-u)*(s+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=ae.checkMatrix(t);let e=new ae(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),s=this.get(1,2),u=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+u+c)*(l-d+g),A=(-n+u)*(d-g),T=(u+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+s)*(g+y-b),R=(i-s)*(g-b),O=(a+s)*(-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-s-u-c)*g+D+k+O,L=_+a*(-l+h+p-v-g-y+b)+x+E+D+k+R,U=_+x+w+E+s*m,F=D+k+R+O+o*d,j=E+S+A+c*(-l+d+p-v-g-y+m)+I+C+D,B=I+C+D+N+u*h,z=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,j),e.set(2,1,B),e.set(2,2,z),e}mmulStrassen(t){t=ae.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=ie.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 s=Math.max(n,i),u=Math.max(r,o);return e=a(e,s,u),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),s=parseInt(e.columns/2,10),u=e.subMatrix(0,o-1,0,s-1),c=n.subMatrix(0,o-1,0,s-1),f=e.subMatrix(0,o-1,s,e.columns-1),l=n.subMatrix(0,o-1,s,n.columns-1),h=e.subMatrix(o,e.rows-1,0,s-1),d=n.subMatrix(o,n.rows-1,0,s-1),p=e.subMatrix(o,e.rows-1,s,e.columns-1),v=n.subMatrix(o,n.rows-1,s,n.columns-1),g=t(ie.add(u,p),ie.add(c,v),o,s),y=t(ie.add(h,p),c,o,s),m=t(u,ie.sub(l,v),o,s),b=t(p,ie.sub(d,c),o,s),_=t(ie.add(u,f),v,o,s),x=t(ie.sub(h,u),ie.add(c,l),o,s),w=t(ie.sub(f,p),ie.add(d,v),o,s),E=ie.add(g,b);E.sub(_),E.add(w);let S=ie.add(m,_),A=ie.add(y,b),T=ie.sub(g,y);T.add(m),T.add(x);let I=ie.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,s,u),s,u)}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 ae(this.rows,this.columns);for(let t=0;t<this.rows;t++){const i=this.getRow(t);i.length>0&&Vt(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 ae(this.rows,this.columns);for(let t=0;t<this.columns;t++){const i=this.getColumn(t);i.length&&Vt(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=ae.checkMatrix(t);let e=this.rows,n=this.columns,r=t.rows,i=t.columns,o=new ae(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 s=0;s<i;s++)o.set(r*a+n,i*e+s,this.get(a,e)*t.get(n,s));return o}kroneckerSum(t){if(t=ae.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(ae.eye(n,n)),i=ae.eye(e,e).kroneckerProduct(t);return r.add(i)}transpose(){let t=new ae(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=oe){for(let e=0;e<this.rows;e++)this.setRow(e,this.getRow(e).sort(t));return this}sortColumns(t=oe){for(let e=0;e<this.columns;e++)this.setColumn(e,this.getColumn(e).sort(t));return this}subMatrix(t,e,n,r){te(this,t,e,n,r);let i=new ae(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 ae(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 ae(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=ae.checkMatrix(t)).isEmpty())return this;te(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:Jt(t,e),column:Qt(t,n)}}(this,t,e),r=new ae(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 ae(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=ee(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=ee(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=ee(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=ee(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,s=0,u=0;for(let e=0;e<i;e++)u=t.get(a,e)-n[a],r+=u,s+=u*u;e?o.push((s-r*r/i)/(i-1)):o.push((s-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,s=0,u=0;for(let e=0;e<r;e++)u=t.get(e,a)-n[a],i+=u,s+=u*u;e?o.push((s-i*i/r)/(r-1)):o.push((s-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,s=0,u=0;for(let e=0;e<r;e++)for(let r=0;r<i;r++)u=t.get(e,r)-n,a+=u,s+=u*u;return e?(s-a*a/o)/(o-1):(s-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 Ht(this,t)}}function oe(t,e){return t-e}ie.prototype.klass="Matrix","undefined"!=typeof Symbol&&(ie.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return Ht(this)}),ie.random=ie.rand,ie.randomInt=ie.randInt,ie.diagonal=ie.diag,ie.prototype.diagonal=ie.prototype.diag,ie.identity=ie.eye,ie.prototype.negate=ie.prototype.neg,ie.prototype.tensorProduct=ie.prototype.kroneckerProduct;class ae extends ie{constructor(t,e){if(super(),ae.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 Yt(this,t),this.data.splice(t,1),this.rows-=1,this}addRow(t,e){return void 0===e&&(e=t,t=this.rows),Yt(this,t,!0),e=Float64Array.from(Zt(this,e)),this.data.splice(t,0,e),this.rows+=1,this}removeColumn(t){Kt(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),Kt(this,t,!0),e=$t(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}}(ie,ae);class se extends ie{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 ue(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 ce{constructor(t,e={}){if((t=se.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 s,u=Boolean(i),c=Boolean(o),f=!1;if(n<r)if(a){s=t.transpose(),n=s.rows,r=s.columns,f=!0;let e=u;u=c,c=e}else s=t.clone(),console.warn("Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose");else s=t.clone();let l=Math.min(n,r),h=Math.min(n+1,r),d=new Float64Array(h),p=new ae(n,l),v=new ae(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]=ue(d[t],s.get(e,t));if(0!==d[t]){s.get(t,t)<0&&(d[t]=-d[t]);for(let e=t;e<n;e++)s.set(e,t,s.get(e,t)/d[t]);s.set(t,t,s.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+=s.get(i,t)*s.get(i,e);r=-r/s.get(t,t);for(let i=t;i<n;i++)s.set(i,e,s.get(i,e)+r*s.get(i,t))}g[e]=s.get(t,e)}if(u&&t<b)for(let e=t;e<n;e++)p.set(e,t,s.get(e,t));if(t<_){g[t]=0;for(let e=t+1;e<r;e++)g[t]=ue(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]*s.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++)s.set(i,e,s.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]=s.get(b,b)),n<w&&(d[w-1]=0),_+1<w&&(g[_]=s.get(_,w-1)),g[w-1]=0,u){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=ue(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=ue(d[r],e),o=d[r]/i,a=e/i;if(d[r]=i,e=-a*g[r],g[r]=o*g[r],u)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,s=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=(s+i)*(s-i)+y,b=s*f;for(let e=t;e<w-1;e++){let i=ue(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=ue(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],u&&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(u&&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=ae.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,s=a.mmul(i),u=a.rows,c=o.rows,f=ae.zeros(u,c);for(let t=0;t<u;t++)for(let e=0;e<c;e++){let n=0;for(let i=0;i<r;i++)n+=s.get(t,i)*o.get(e,i);f.set(t,e,n)}return f.mmul(e)}solveForDiagonal(t){return this.solve(ae.diag(t))}inverse(){let t=this.V,e=this.threshold,n=t.rows,r=t.columns,i=new ae(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,s=o.columns,u=new ae(n,a);for(let t=0;t<n;t++)for(let e=0;e<a;e++){let n=0;for(let r=0;r<s;r++)n+=i.get(t,r)*o.get(e,r);u.set(t,e,n)}return u}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 ae.diag(this.s)}}const fe=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=ae.mul(ae.pow(n,2),-.5),o=i.mean("row"),a=i.mean("column"),s=i.mean();i.add(s).subRowVector(o).subColumnVector(a);var u=new ce(i),c=ae.sqrt(u.diagonalMatrix).diagonal();return u.leftSingularVectors.toJSON().map((function(t){return ae.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}(),le=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,s){r[s]={x:0,y:0},e.forEach((function(e,u){if(s!==u&&o[s]===o[u]){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=s>u?1:-1;c=.01*h,f=.01*h}if(l<t.nodeSizeFunc(n[s])/2+t.nodeSizeFunc(n[u])/2){var d=i*i/l;r[s].x+=c/l*d,r[s].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),s=i/a,u=-r/a,c=Math.sqrt(t.x*t.x+t.y*t.y),f=Math.acos((s*t.x+u*t.y)/c);f>Math.PI/2&&(f-=Math.PI/2,s*=-1,u*=-1);var l=Math.cos(f)*c;t.x=s*l,t.y=u*l}));var s=t.radii;e.forEach((function(t,u){if(u!==o){var c=Math.sqrt(n[u].x*n[u].x+n[u].y*n[u].y);if(c>0&&u!==o){var f=Math.min(a*(r/800),c);if(t[0]+=n[u].x/c*f,t[1]+=n[u].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*s[u],h=h/d*s[u],t[0]=e[o][0]+l,t[1]=e[o][1]+h}}}}))},t}();var he=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 de(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var pe=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 he(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 u=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 fe({linkDistance:u,distances:C}).layout();N.forEach((function(t){s(t[0])&&(t[0]=Math.random()*u),s(t[1])&&(t[1]=Math.random()*u)})),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 le(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 s=a/e;t.oneIteration(s,n,o,i,r)}},n.prototype.oneIteration=function(t,e,n,r,i){var o=1-t,a=this.focusIndex;e.forEach((function(s,u){var c=de(s,[0,0]),f=0===c?0:1/c;if(u!==a){var l=0,h=0,d=0;e.forEach((function(t,e){if(u!==e){var n=de(s,t),o=0===n?0:1/n,a=r[e][u];d+=i[u][e],l+=i[u][e]*(t[0]+a*(s[0]-t[0])*o),h+=i[u][e]*(t[1]+a*(s[1]-t[1])*o)}}));var p=0===n[u]?0:1/n[u];d*=o,d+=t*p*p,l*=o,l+=t*p*s[0]*f,s[0]=l/d,h*=o,h+=t*p*s[1]*f,s[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,s=[];return r&&r.forEach((function(r,u){var c=[];r.forEach((function(r,s){if(u===s)c.push(0);else if(o[u]===o[s])if("data"===t.sortBy)c.push(r*(Math.abs(u-s)*t.sortStrength)/(o[u]/a));else if(t.sortBy){var f=n[u][t.sortBy]||0,l=n[s][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[u]/a))}else c.push(r*i/(o[u]/a));else{var h=(i+a)/2;c.push(r*h)}})),s.push(c)})),s},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),ve=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)}}(),ge=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 ve(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 s=t.center;if(1===i)return n[0].x=s[0],n[0].y=s[1],void(t.onLayoutEnd&&t.onLayoutEnd());var u,c=[];u=o(t.nodeSize)?Math.max(t.nodeSize[0],t.nodeSize[1]):t.nodeSize,n.forEach((function(t){c.push(t);var e=u;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)),u=Math.max(u,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=u+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=s[0]+r*Math.cos(o),e.y=s[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),ye=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)}}(),me=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 ye(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),s=v(a);t.handleInfinity(s);var u,c,f=(u=o,c=[],s.forEach((function(t){var e=[];t.forEach((function(t){e.push(t*u)})),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=ae.mul(ae.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 ce(e),a=ae.sqrt(o.diagonalMatrix).diagonal();return o.leftSingularVectors.toJSON().map((function(t){return ae.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),be=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)}}(),_e=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 be(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 s={},u={};return i.forEach((function(t,e){a(t.x)||(t.x=Math.random()*n.width),a(t.y)||(t.y=Math.random()*n.height),s[t.id]=t,u[t.id]=e})),r.nodeMap=s,r.nodeIdxMap=u,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,s=e.clustering,u={};if(s)for(var c in n.forEach((function(t){if(void 0===u[t.cluster]){var e={name:t.cluster,cx:0,cy:0,count:0};u[t.cluster]=e}var n=u[t.cluster];a(t.x)&&(n.cx+=t.x),a(t.y)&&(n.cy+=t.y),n.count++})),u)u[c].cx/=u[c].count,u[c].cy/=u[c].count;if(o){for(var f=0;f<i;f++)e.runOneStep(u);null===(t=e.onLayoutEnd)||void 0===t||t.call(e)}else{if("undefined"==typeof window)return;var l=0;this.timeInterval=window.setInterval((function(){var t;e.runOneStep(u),++l>=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,s=n.gravity,u=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){var v=n.clusterGravity||s;for(var g in 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*v;p[n].x-=o*(e.x-r.cx)/i,p[n].y-=o*(e.y-r.cy)/i}})),t)t[g].cx=0,t[g].cy=0,t[g].count=0;for(var g 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[g].cx/=t[g].count,t[g].cy/=t[g].count}r.forEach((function(t,e){if(a(t.x)&&a(t.y)){var n=.01*d*s;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*(u/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 s=r.x-t.x,u=r.y-t.y,c=s*s+u*u;if(0===c){c=1;var f=i>o?1:-1;s=.01*f,u=.01*f}var l=n/c;e[i].x+=s*l,e[i].y+=u*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 s=r.nodeIdxMap[i],u=r.nodeIdxMap[o];if(s!==u){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[u].x-=l/p*v,e[u].y-=h/p*v,e[s].x+=l/p*v,e[s].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 xe(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 we(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ee(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 Se(t,e,n){return e&&Ee(t.prototype,e),n&&Ee(t,n),t}function Ae(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(78892);var Te=n(90122),Ie=n.n(Te);function Ce(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function De(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){Ce(o,r,i,a,s,"next",t)}function s(t){Ce(o,r,i,a,s,"throw",t)}a(void 0)}))}}var Ne=1;function ke(){return Ne++}var Re=function t(e){we(this,t)},Oe=function(){function t(e){we(this,t),this.clazz=void 0,this.components=[],this.entities=[],this.lookup={},this.clazz=e}var e;return Se(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=De(Ie().mark((function t(e){var n,r,i,o,a;return Ie().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 Me(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 Pe(t,e){if(t){if("string"==typeof t)return Me(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)?Me(t,e):void 0}}function Ge(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,s=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){s=!0,i=t}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}}(t,e)||Pe(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 Le=n(99311),Ue={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")},Fe=function t(){we(this,t),this.index=void 0},je=function t(){we(this,t),this.name=void 0,this.data=void 0,this.execute=void 0,this.tearDown=void 0},Be=function(){function t(){we(this,t),this.name=void 0,this.refCount=0,this.hasSideEffect=!1,this.devirtualize=[],this.destroy=[],this.reads=[],this.writes=[]}return Se(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 ze(t,e){return ze=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},ze(t,e)}function Ve(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&&ze(t,e)}function We(t){return We="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},We(t)}function Xe(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function He(t,e){if(e&&("object"===We(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Xe(t)}function qe(t){return qe=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},qe(t)}var Ye,Ke,Ze,$e,Je,Qe,tn=function(t){Ve(i,(function t(){we(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=qe(e);if(n){var i=qe(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return He(this,t)});function i(){var t;we(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 Se(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}(),en=function t(){we(this,t),this.resource=void 0,this.writer=void 0,this.readerCount=0,this.version=void 0};function nn(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 rn(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)?rn(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,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function rn(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 on=(Ye=(0,Le.b2)(),Ke=(0,Le.f3)(Ue.RenderEngine),Ye((Qe=function(){function t(){we(this,t),this.passNodes=[],this.resourceNodes=[],this.frameGraphPasses=[],xe(this,"engine",Je,this)}var e,n;return Se(t,[{key:"execute",value:(n=De(Ie().mark((function t(e){return Ie().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 je;i.execute=n,r&&(i.tearDown=r),i.name=t;var o=new Be;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=nn(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=nn(this.resourceNodes);try{for(a.s();!(i=a.n()).done;){var s=i.value;0===s.readerCount&&o.push(s)}}catch(t){a.e(t)}finally{a.f()}for(;o.length;){var u=o.pop(),c=u&&u.writer;if(c&&0==--c.refCount){var f,l=nn(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=nn(this.passNodes);try{for(v.s();!(p=v.n()).done;){var g=p.value;if(g.refCount){var y,m=nn(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=nn(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=nn(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=De(Ie().mark((function t(e){var n,r,i,o,a,s,u,c,f,l,h,d,p;return Ie().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=nn(this.passNodes.entries()),t.prev=1,n.s();case 3:if((r=n.n()).done){t.next=18;break}if(i=Ge(r.value,2),o=i[0],!(a=i[1]).refCount){t.next=16;break}s=nn(a.devirtualize);try{for(s.s();!(u=s.n()).done;)u.value.preExecuteDevirtualize(this.engine)}catch(t){s.e(t)}finally{s.f()}c=nn(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=nn(a.devirtualize);try{for(l.s();!(h=l.n()).done;)h.value.postExecuteDevirtualize(this.engine)}catch(t){l.e(t)}finally{l.f()}d=nn(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 en;e.resource=t,e.version=t.version,this.resourceNodes.push(e);var n=new Fe;return n.index=this.resourceNodes.length-1,n}},{key:"createTexture",value:function(t,e,n){var r=new tn;return r.name=e,r.descriptor=n,this.createResourceNode(r)}},{key:"createRenderTarget",value:function(t,e,n){var r=new tn;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}),De(Ie().mark((function t(){return Ie().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)}))))}}]),t}(),Je=Ae(($e=Qe).prototype,"engine",[Ke],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ze=$e))||Ze);function an(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var sn=1e-6,un="undefined"!=typeof Float32Array?Float32Array:Array;function cn(){var t=new un(4);return un!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function fn(t,e,n,r){var i=new un(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i}function ln(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 hn(){var t=new un(9);return un!=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 dn(){var t=new un(3);return un!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function pn(t){var e=new un(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function vn(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)}function gn(t,e,n){var r=new un(3);return r[0]=t,r[1]=e,r[2]=n,r}function yn(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function mn(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function bn(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function _n(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function xn(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function wn(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 En(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Sn(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 An(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 Tn(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)}),cn();var In=_n,Cn=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)},Dn=vn,Nn=(dn(),9007199254740991),kn={};kn["[object Float32Array]"]=kn["[object Float64Array]"]=kn["[object Int8Array]"]=kn["[object Int16Array]"]=kn["[object Int32Array]"]=kn["[object Uint8Array]"]=kn["[object Uint8ClampedArray]"]=kn["[object Uint16Array]"]=kn["[object Uint32Array]"]=!0,kn["[object Arguments]"]=kn["[object Array]"]=kn["[object ArrayBuffer]"]=kn["[object Boolean]"]=kn["[object DataView]"]=kn["[object Date]"]=kn["[object Error]"]=kn["[object Function]"]=kn["[object Map]"]=kn["[object Number]"]=kn["[object Object]"]=kn["[object RegExp]"]=kn["[object Set]"]=kn["[object String]"]=kn["[object WeakMap]"]=!1;var Rn=Object.prototype.toString,On=function(t){return function(t){return!!t&&"object"===We(t)}(t)&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=Nn}(t.length)&&!!kn[Rn.call(t)]};function Mn(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 Pn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Mn(Object(n),!0).forEach((function(e){an(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Mn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Gn,Ln,Un,Fn,jn,Bn,zn,Vn,Wn,Xn=function(t){Ve(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=qe(e);if(n){var i=qe(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return He(this,t)});function i(t){var e;return we(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(Xe(e),t),e}return Se(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(Pn(Pn({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,s,u,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=fn(R.data[M],R.data[M+1],R.data[M+2],1);ln(P,P,t),On(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=hn(),r=(n=t)[0],i=n[1],o=n[2],a=n[3],s=n[4],u=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*u-i*s)*(N=d*m-p*y)-(_=r*c-o*s)*(D=h*m-p*g)+(x=r*f-a*s)*(C=h*y-d*g)+(w=i*c-o*u)*(I=l*m-p*v)-(E=i*f-a*u)*(T=l*y-d*v)+(S=o*f-a*c)*(A=l*g-h*v))?(k=1/k,e[0]=(u*N-c*D+f*C)*k,e[1]=(c*I-s*N-f*T)*k,e[2]=(s*D-u*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=gn(O.data[L],O.data[L+1],O.data[L+2]);Tn(U,U,G),wn(U,U),On(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}(Re);!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"}(Gn||(Gn={}));var Hn=(Ln=(0,Le.b2)(),Un=(0,Le.f3)(Ue.GeometryComponentManager),Fn=(0,Le.f3)(Ue.RenderEngine),Ln((Wn=function(){function t(){we(this,t),xe(this,"geometry",zn,this),xe(this,"engine",Vn,this)}var e;return Se(t,[{key:"execute",value:(e=De(Ie().mark((function t(){var e=this;return Ie().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:Gn.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:Gn.UNSIGNED_INT,usage:Gn.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=ke();return this.geometry.create(n,{vertexCount:e})}},{key:"createInstancedBufferGeometry",value:function(t){var e=t.maxInstancedCount,n=t.vertexCount,r=ke();return this.geometry.create(r,{maxInstancedCount:e,vertexCount:n})}}]),t}(),zn=Ae((Bn=Wn).prototype,"geometry",[Un],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Vn=Ae(Bn.prototype,"engine",[Fn],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),jn=Bn))||jn);function qn(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 Yn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?qn(Object(n),!0).forEach((function(e){an(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):qn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Kn,Zn,$n,Jn,Qn,tr,er,nr,rr,ir,or=function(t){Ve(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=qe(e);if(n){var i=qe(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return He(this,t)});function i(t){var e;return we(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:Gn.BACK},e.depth={enable:!0},e.blend=void 0,e.entity=void 0,e.type=void 0,Object.assign(Xe(e),t),e}return Se(i,[{key:"setDefines",value:function(t){return this.defines=Yn(Yn({},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}(Re);function ar(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 sr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ar(Object(n),!0).forEach((function(e){an(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ar(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var ur,cr=(Kn=(0,Le.b2)(),Zn=(0,Le.f3)(Ue.MaterialComponentManager),$n=(0,Le.f3)(Ue.RenderEngine),Jn=(0,Le.f3)(Ue.ShaderModuleService),Kn((ir=function(){function t(){we(this,t),xe(this,"material",er,this),xe(this,"engine",nr,this),xe(this,"shaderModule",rr,this)}var e;return Se(t,[{key:"execute",value:(e=De(Ie().mark((function t(){return Ie().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=ke(),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,sr(sr({vertexShaderGLSL:n,fragmentShaderGLSL:r},t),{},{uniforms:i}))}}]),t}(),er=Ae((tr=ir).prototype,"material",[Zn],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),nr=Ae(tr.prototype,"engine",[$n],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),rr=Ae(tr.prototype,"shaderModule",[Jn],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Qn=tr))||Qn);!function(t){t[t.Standard=0]="Standard"}(ur||(ur={}));var fr=function(t){Ve(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=qe(e);if(n){var i=qe(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return He(this,t)});function i(t){var e;return we(this,i),(e=r.call(this,t)).strategy=ur.Standard,e.visibilityPlaneMask=0,e.visible=!1,Object.assign(Xe(e),t),e}return i}(Re),lr=function(){function t(e,n){we(this,t),this.center=void 0,this.halfExtents=void 0,this.min=dn(),this.max=dn(),this.update(e,n)}return Se(t,[{key:"update",value:function(t,e){this.center=t||dn(),this.halfExtents=e||gn(.5,.5,.5),this.min=In(this.min,this.center,this.halfExtents),this.max=bn(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(t,e){bn(this.center,e,t),xn(this.center,this.center,.5),In(this.halfExtents,e,t),xn(this.halfExtents,this.halfExtents,.5),yn(this.min,t),yn(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],s=o[1],u=o[2],c=n-a,f=n+a,l=r-s,h=r+s,d=i-u,p=i+u,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?yn(dn(),this.min):272===t.pnVertexFlag?gn(this.min[0],this.min[1],this.max[2]):257===t.pnVertexFlag?gn(this.min[0],this.max[1],this.min[2]):256===t.pnVertexFlag?gn(this.min[0],this.max[1],this.max[2]):17===t.pnVertexFlag?gn(this.max[0],this.min[1],this.min[2]):16===t.pnVertexFlag?gn(this.max[0],this.min[1],this.max[2]):1===t.pnVertexFlag?gn(this.max[0],this.max[1],this.min[2]):gn(this.max[0],this.max[1],this.max[2])}},{key:"getPositiveFarPoint",value:function(t){return 273===t.pnVertexFlag?yn(dn(),this.max):272===t.pnVertexFlag?gn(this.max[0],this.max[1],this.min[2]):257===t.pnVertexFlag?gn(this.max[0],this.min[1],this.max[2]):256===t.pnVertexFlag?gn(this.max[0],this.min[1],this.min[2]):17===t.pnVertexFlag?gn(this.min[0],this.max[1],this.max[2]):16===t.pnVertexFlag?gn(this.min[0],this.max[1],this.min[2]):1===t.pnVertexFlag?gn(this.min[0],this.min[1],this.max[2]):gn(this.min[0],this.min[1],this.min[2])}}]),t}();var hr,dr=function(t){Ve(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=qe(e);if(n){var i=qe(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return He(this,t)});function i(t){var e;return we(this,i),(e=r.call(this,t)).material=void 0,e.geometry=void 0,e.aabb=new lr,e.aabbDirty=!0,e.model=void 0,e.visible=!0,e.children=[],Object.assign(Xe(e),t),e}return i}(Re),pr=function(){function t(e,n){we(this,t),this.distance=void 0,this.normal=void 0,this.pnVertexFlag=void 0,this.distance=e||0,this.normal=n||gn(0,1,0),this.updatePNVertexFlag()}return Se(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 En(t,this.normal)-this.distance}},{key:"normalize",value:function(){var t=1/Dn(this.normal);xn(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&&Sn(n,t,e,i),o}}]),t}();!function(t){t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE"}(hr||(hr={}));var vr,gr,yr,mr,br,_r,xr,wr,Er,Sr,Ar,Tr,Ir,Cr,Dr=function(){function t(e){if(we(this,t),this.planes=[],e)this.planes=e;else for(var n=0;n<6;n++)this.planes.push(new pr)}return Se(t,[{key:"extractFromVPMatrix",value:function(t){var e=Ge(t,16),n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=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];mn(this.planes[0].normal,o-n,c-a,d-f),this.planes[0].distance=-(y-p),mn(this.planes[1].normal,o+n,c+a,d+f),this.planes[1].distance=-(y+p),mn(this.planes[2].normal,o+r,c+s,d+l),this.planes[2].distance=-(y+v),mn(this.planes[3].normal,o-r,c-s,d-l),this.planes[3].distance=-(y-v),mn(this.planes[4].normal,o-i,c-u,d-h),this.planes[4].distance=-(y-g),mn(this.planes[5].normal,o+i,c+u,d+h),this.planes[5].distance=-(y+g),this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))}}]),t}();function Nr(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 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}}(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,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}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}var Rr=(vr=(0,Le.b2)(),gr=(0,Le.f3)(Ue.MeshComponentManager),yr=(0,Le.f3)(Ue.CullableComponentManager),mr=(0,Le.f3)(Ue.GeometryComponentManager),br=(0,Le.f3)(Ue.HierarchyComponentManager),_r=(0,Le.f3)(Ue.TransformComponentManager),vr((Cr=function(){function t(){we(this,t),xe(this,"mesh",Er,this),xe(this,"cullable",Sr,this),xe(this,"geometry",Ar,this),xe(this,"hierarchy",Tr,this),xe(this,"transform",Ir,this),this.planes=void 0}var e;return Se(t,[{key:"setFrustumPlanes",value:function(t){this.planes=t}},{key:"execute",value:(e=De(Ie().mark((function t(e){var n,r,i,o,a,s,u,c,f,l,h,d,p,v,g,y,m,b,_,x,w;return Ie().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=Nr(e);try{for(n.s();!(r=n.n()).done;){i=r.value,o=i.getScene(),a=i.getCamera(),s=Nr(o.getEntities());try{for(s.s();!(u=s.n()).done;)c=u.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=An(dn(),y,v),E=v,(S=hn())[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=Tn(dn(),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)||hr.INDETERMINATE,this.planes||a.getFrustum().planes),h.visible=h.visibilityPlaneMask!==hr.OUTSIDE))}catch(t){s.e(t)}finally{s.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===hr.OUTSIDE||e===hr.INSIDE)return e;for(var r=hr.INSIDE,i=0,o=n.length;i<o;++i){var a=i<31?1<<i:0;if(!(i<31&&0==(e&a))){var s=n[i],u=s.normal,c=s.distance;if(En(u,t.getNegativeFarPoint(n[i]))+c>0)return hr.OUTSIDE;En(u,t.getPositiveFarPoint(n[i]))+c>0&&(r|=a)}}return r}}]),t}(),Er=Ae((wr=Cr).prototype,"mesh",[gr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Sr=Ae(wr.prototype,"cullable",[yr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ar=Ae(wr.prototype,"geometry",[mr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Tr=Ae(wr.prototype,"hierarchy",[br],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ir=Ae(wr.prototype,"transform",[_r],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),xr=wr))||xr);function Or(){var t=new un(16);return un!=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 Mr(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 Pr(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 Gr(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=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*s-r*a,b=n*u-i*a,_=n*c-o*a,x=r*u-i*s,w=r*c-o*s,E=i*c-o*u,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]=(s*D-u*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]=(u*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-s*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]=(s*A-a*I-u*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 Lr(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=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+_*s+x*l+w*v,t[1]=b*i+_*u+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+_*s+x*l+w*v,t[5]=b*i+_*u+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+_*s+x*l+w*v,t[9]=b*i+_*u+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+_*s+x*l+w*v,t[13]=b*i+_*u+x*h+w*g,t[14]=b*o+_*c+x*d+w*y,t[15]=b*a+_*f+x*p+w*m,t}function Ur(t,e,n){var r,i,o,a,s,u,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],s=e[4],u=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]=s,t[5]=u,t[6]=c,t[7]=f,t[8]=l,t[9]=h,t[10]=d,t[11]=p,t[12]=r*v+s*g+l*y+e[12],t[13]=i*v+u*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 Fr(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function jr(t,e){var n=e[0],r=e[1],i=e[2],o=e[4],a=e[5],s=e[6],u=e[8],c=e[9],f=e[10];return t[0]=Math.hypot(n,r,i),t[1]=Math.hypot(o,a,s),t[2]=Math.hypot(u,c,f),t}function Br(t,e){var n=new un(3);jr(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],a=e[0]*r,s=e[1]*i,u=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-u)/g,t[2]=(s-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]=(s+c)/g,t[2]=(h+u)/g):f>p?(g=2*Math.sqrt(1+f-a-p),t[3]=(h-u)/g,t[0]=(s+c)/g,t[1]=.25*g,t[2]=(l+d)/g):(g=2*Math.sqrt(1+p-a-f),t[3]=(s-c)/g,t[0]=(h+u)/g,t[1]=(l+d)/g,t[2]=.25*g),t}function zr(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,u=i+i,c=n*a,f=r*a,l=r*s,h=i*a,d=i*s,p=i*u,v=o*a,g=o*s,y=o*u;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 Vr,Wr,Xr,Hr,qr,Yr,Kr,Zr,$r,Jr,Qr,ti,ei,ni,ri,ii,oi,ai,si,ui,ci,fi,li,hi;function di(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 pi(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)?pi(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,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function pi(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 vi,gi,yi,mi,bi,_i,xi,wi,Ei,Si,Ai,Ti,Ii,Ci=(Vr=(0,Le.b2)(),Wr=(0,Le.f3)(Ue.MeshComponentManager),Xr=(0,Le.f3)(Ue.GeometryComponentManager),Hr=(0,Le.f3)(Ue.MaterialComponentManager),qr=(0,Le.f3)(Ue.CullableComponentManager),Yr=(0,Le.f3)(Ue.TransformComponentManager),Kr=(0,Le.f3)(Ue.HierarchyComponentManager),Zr=(0,Le.f3)(Ue.Systems),$r=(0,Le.t6)(Ue.FrameGraphSystem),Jr=(0,Le.f3)(Ue.RenderEngine),Qr=(0,Le.f3)(Ue.ResourcePool),Vr((hi=li=function(){function t(){var e=this;we(this,t),xe(this,"mesh",ni,this),xe(this,"geometry",ri,this),xe(this,"material",ii,this),xe(this,"cullable",oi,this),xe(this,"transform",ai,this),xe(this,"hierarchy",si,this),xe(this,"frameGraphSystem",ui,this),xe(this,"engine",ci,this),xe(this,"resourcePool",fi,this),this.modelCache={},this.setup=function(t,e,n){var r=t.createRenderTarget(e,"color buffer",{width:1,height:1,usage:Gn.RENDER_ATTACHMENT|Gn.SAMPLED|Gn.COPY_SRC});n.data={output:e.write(t,r)}},this.execute=function(){var t=De(Ie().mark((function t(n,r,i){var o,a,s,u,c,f;return Ie().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=n.getResourceNode(r.data.output),a=e.resourcePool.getOrCreateResource(o.resource),s=di(i),t.prev=3,s.s();case 5:if((u=s.n()).done){t.next=11;break}return c=u.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),s.e(t.t0);case 16:return t.prev=16,s.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=di(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 Se(t,[{key:"renderView",value:function(t){var e=t.getScene(),n=t.getCamera(),r=n.getViewTransform(),i=Lr(Or(),n.getPerspective(),r);n.getFrustum().extractFromVPMatrix(i);var o=t.getViewport(),a=o.x,s=o.y,u=o.width,c=o.height;this.engine.viewport({x:a,y:s,width:u,height:c});var f,l=di(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,s=o.geometry;if(s&&!s.dirty&&a){var u=this.transform.getComponentByEntity(t),c=Lr(Or(),i,u.worldTransform),f=r.getViewport(),l=f.width,h=f.height;a.setUniform({projectionMatrix:n.getPerspective(),modelViewMatrix:c,modelMatrix:u.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=De(Ie().mark((function t(e,n){var r,i,o,a,s,u,c,f;return Ie().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}),s=this.engine,u=s.createModel,c=s.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,u(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=De(Ie().mark((function t(e){var n,r,i,o;return Ie().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.getScene(),r=di(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}(),li.IDENTIFIER="Render Pass",ni=Ae((ei=hi).prototype,"mesh",[Wr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ri=Ae(ei.prototype,"geometry",[Xr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ii=Ae(ei.prototype,"material",[Hr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),oi=Ae(ei.prototype,"cullable",[qr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ai=Ae(ei.prototype,"transform",[Yr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),si=Ae(ei.prototype,"hierarchy",[Kr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ui=Ae(ei.prototype,"frameGraphSystem",[Zr,$r],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ci=Ae(ei.prototype,"engine",[Jr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),fi=Ae(ei.prototype,"resourcePool",[Qr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ti=ei))||ti);function Di(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 Ni(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)?Ni(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,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Ni(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 ki,Ri,Oi,Mi,Pi,Gi,Li,Ui,Fi,ji,Bi,zi,Vi,Wi,Xi,Hi,qi,Yi,Ki,Zi,$i,Ji,Qi=(vi=(0,Le.b2)(),gi=(0,Le.f3)(Ue.RenderEngine),yi=(0,Le.f3)(Ue.ResourcePool),mi=(0,Le.f3)(Ue.RenderPassFactory),bi=(0,Le.f3)(Ue.MeshComponentManager),vi((Ii=Ti=function(){function t(){var e=this;we(this,t),xe(this,"engine",wi,this),xe(this,"resourcePool",Ei,this),xe(this,"renderPassFactory",Si,this),xe(this,"mesh",Ai,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=De(Ie().mark((function t(n,r,i){var o,a,s;return Ie().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=Di(i);try{for(s=function(){var t=a.value,i=t.getViewport(),o=i.width,s=i.height;e.alreadyInRendering=!0;var u=n.getResourceNode(r.data.output);e.pickingFBO=e.resourcePool.getOrCreateResource(u.resource),e.pickingFBO.resize({width:o,height:s}),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(Ci.IDENTIFIER),i=[],o=Di(t.getScene().getEntities());try{for(o.s();!(n=o.n()).done;){var a=n.value,s=e.mesh.getComponentByEntity(a);s.material.setUniform("u_PickingStage",1),i.push(s)}}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;)s()}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,s=e.engine,u=s.readPixels,c=s.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=u({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=Ge(r,3),i=t[0]+256*t[1]+65536*t[2]-1,e.highlightEnabled&&e.highlightPickedFeature(r,n))})),i}}return Se(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=Di(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}(),Ti.IDENTIFIER="PixelPicking Pass",wi=Ae((xi=Ii).prototype,"engine",[gi],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ei=Ae(xi.prototype,"resourcePool",[yi],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Si=Ae(xi.prototype,"renderPassFactory",[mi],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ai=Ae(xi.prototype,"mesh",[bi],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),_i=xi))||_i),to=(ki=(0,Le.b2)(),Ri=(0,Le.f3)(Ue.RenderEngine),Oi=(0,Le.f3)(Ue.ResourcePool),ki((Fi=Ui=function t(){var e=this;we(this,t),xe(this,"engine",Gi,this),xe(this,"resourcePool",Li,this),this.model=void 0,this.setup=function(t,e,n){var r=t.getPass(Ci.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=De(Ie().mark((function t(n,r){var i,o,a,s,u,c,f;return Ie().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=e.engine,o=i.createModel,a=i.createAttribute,s=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:s({data:[-4,-4,4,-4,0,4],type:Gn.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:u=t.sent,e.model=u;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}},Ui.IDENTIFIER="Copy Pass",Gi=Ae((Pi=Fi).prototype,"engine",[Ri],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Li=Ae(Pi.prototype,"resourcePool",[Oi],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Mi=Pi))||Mi),eo=(ji=(0,Le.b2)(),Bi=(0,Le.f3)(Ue.Systems),zi=(0,Le.t6)(Ue.FrameGraphSystem),Vi=(0,Le.f3)(Ue.RenderPassFactory),Wi=(0,Le.f3)(Ue.ConfigService),Xi=(0,Le.f3)(Ue.ResourcePool),ji((Ji=function(){function t(){we(this,t),xe(this,"frameGraphSystem",Yi,this),xe(this,"renderPassFactory",Ki,this),xe(this,"configService",Zi,this),xe(this,"resourcePool",$i,this)}var e;return Se(t,[{key:"execute",value:(e=De(Ie().mark((function t(e){var n,r,i,o,a,s,u,c;return Ie().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=this.renderPassFactory(Ci.IDENTIFIER),r=n.setup,i=n.execute,this.frameGraphSystem.addPass(Ci.IDENTIFIER,r,i),o=this.renderPassFactory(to.IDENTIFIER),a=o.setup,s=o.execute,u=o.tearDown,c=this.frameGraphSystem.addPass(to.IDENTIFIER,a,s,u),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(Qi.IDENTIFIER).pick(t,e)}}]),t}(),Yi=Ae((qi=Ji).prototype,"frameGraphSystem",[Bi,zi],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ki=Ae(qi.prototype,"renderPassFactory",[Vi],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Zi=Ae(qi.prototype,"configService",[Wi],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),$i=Ae(qi.prototype,"resourcePool",[Xi],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Hi=qi))||Hi);var no,ro,io,oo,ao,so,uo,co,fo,lo,ho=function(t){Ve(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=qe(e);if(n){var i=qe(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return He(this,t)});function i(t){var e;return we(this,i),(e=r.call(this,t)).parentID=void 0,Object.assign(Xe(e),t),e}return i}(Re),po=(no=(0,Le.b2)(),ro=(0,Le.f3)(Ue.HierarchyComponentManager),io=(0,Le.f3)(Ue.TransformComponentManager),oo=(0,Le.f3)(Ue.MeshComponentManager),no((lo=function(){function t(){we(this,t),xe(this,"hierarchy",uo,this),xe(this,"transform",co,this),xe(this,"mesh",fo,this)}var e;return Se(t,[{key:"execute",value:(e=De(Ie().mark((function t(){return Ie().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 s=this.transform.getComponentByEntity(e);null===s&&(s=this.transform.create(e));var u=this.transform.getComponentByEntity(t);null===u&&(u=this.transform.create(t),s=this.transform.getComponentByEntity(e)),u.parent=s,!n&&s&&(u.matrixTransform(Gr(Or(),s.worldTransform)),u.updateTransform()),s&&u.updateTransformWithParent(s)}},{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}(),uo=Ae((so=lo).prototype,"hierarchy",[ro],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),co=Ae(so.prototype,"transform",[io],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),fo=Ae(so.prototype,"mesh",[oo],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ao=so))||ao);function vo(){var t=new un(4);return un!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function go(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 yo(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],u=n[1],c=n[2],f=n[3];return t[0]=r*f+a*s+i*c-o*u,t[1]=i*f+a*u+o*s-r*c,t[2]=o*f+a*c+r*u-i*s,t[3]=a*f-r*s-i*u-o*c,t}function mo(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=o*s,t}function bo(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),s=Math.sin(n),u=Math.cos(n),c=Math.sin(r),f=Math.cos(r);return t[0]=o*u*f-a*s*c,t[1]=a*s*f+o*u*c,t[2]=a*u*c-o*s*f,t[3]=a*u*f+o*s*c,t}var _o=fn,xo=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},wo=yo,Eo=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};dn(),gn(1,0,0),gn(0,1,0),vo(),vo(),hn();var So=function(t){Ve(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=qe(e);if(n){var i=qe(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return He(this,t)});function i(t){var e,n,o,a,s,u,c,f,l,h,d,p,v,g,y;return we(this,i),(e=r.call(this,t)).dirtyFlag=void 0,e.localDirtyFlag=void 0,e.parent=null,e.localPosition=gn(0,0,0),e.localRotation=_o(0,0,0,1),e.localScale=gn(1,1,1),e.localTransform=Or(),e.position=gn(0,0,0),e.rotation=_o(0,0,0,1),e.scaling=gn(1,1,1),e.worldTransform=Or(),e.matrixTransform=(n=Or(),function(t){Lr(n,e.getLocalTransform(),t),jr(e.localScale,n),Fr(e.localPosition,n),Br(e.localRotation,n)}),e.rotateRollPitchYaw=(o=vo(),a=vo(),s=vo(),function(t,n,r){e.setDirty(),bo(o,t,0,0),bo(a,0,n,0),bo(s,0,0,r),yo(e.localRotation,o,e.localRotation),yo(e.localRotation,e.localRotation,a),yo(e.localRotation,s,e.localRotation),Eo(e.localRotation,e.localRotation)}),e.lerp=(u=dn(),c=vo(),f=dn(),l=dn(),h=vo(),d=dn(),function(t,n,r){e.setDirty(),jr(u,t.worldTransform),Fr(f,t.worldTransform),Br(c,t.worldTransform),jr(l,n.worldTransform),Fr(d,n.worldTransform),Br(h,n.worldTransform),Sn(e.localScale,u,l,r),function(t,e,n,r){var i,o,a,s,u,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>sn?(i=Math.acos(o),a=Math.sin(i),s=Math.sin((1-r)*i)/a,u=Math.sin(r*i)/a):(s=1-r,u=r),t[0]=s*c+u*d,t[1]=s*f+u*p,t[2]=s*l+u*v,t[3]=s*h+u*g}(e.localRotation,c,h,r),Sn(e.localPosition,f,d,r)}),e.translate=(p=dn(),function(t){return bn(p,e.getPosition(),t),e.setPosition(p),e.setDirty(!0),Xe(e)}),e.translateLocal=function(t){return n=t,r=t,i=e.localRotation,o=i[0],a=i[1],s=i[2],u=i[3],c=r[0],f=r[1],l=r[2],v=a*(p=o*f-a*c)-s*(d=s*c-o*l),g=s*(h=a*l-s*f)-o*p,y=o*d-a*h,h*=m=2*u,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,bn(e.localPosition,e.localPosition,t),e.setLocalDirty(!0),Xe(e);var n,r,i,o,a,s,u,c,f,l,h,d,p,v,g,y,m},e.setPosition=(v=Or(),function(t){return e.position=t,e.setLocalDirty(!0),null===e.parent?yn(e.localPosition,t):(Mr(v,e.parent.worldTransform),Gr(v,v),An(e.localPosition,t,v)),Xe(e)}),e.rotate=(g=vo(),function(t){if(null===e.parent)yo(e.localRotation,e.localRotation,t),Eo(e.localRotation,e.localRotation);else{var n=e.getRotation(),r=e.parent.getRotation();xo(g,r),mo(g,g),yo(g,g,t),yo(e.localRotation,t,n),Eo(e.localRotation,e.localRotation)}return e.setLocalDirty(),Xe(e)}),e.rotateLocal=function(t){return yo(e.localRotation,e.localRotation,t),Eo(e.localRotation,e.localRotation),e.setLocalDirty(!0),Xe(e)},e.setRotation=(y=vo(),function(t){return null===e.parent?xo(e.localRotation,t):(xo(y,e.parent.getRotation()),mo(y,y),xo(e.localRotation,y),wo(e.localRotation,e.localRotation,t)),e.setLocalDirty(!0),Xe(e)}),e}return Se(i,[{key:"setLocalPosition",value:function(t){yn(this.localPosition,t),this.setLocalDirty(!0)}},{key:"setLocalScale",value:function(t){yn(this.localScale,t),this.setLocalDirty(!0)}},{key:"setLocalRotation",value:function(t){return xo(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&&(Mr(this.worldTransform,this.getLocalTransform()),this.setDirty(!1))}},{key:"updateTransformWithParent",value:function(t){Lr(this.worldTransform,t.worldTransform,this.getLocalTransform())}},{key:"applyTransform",value:function(){this.setDirty(),jr(this.localScale,this.worldTransform),Fr(this.localPosition,this.worldTransform),Br(this.localRotation,this.worldTransform)}},{key:"clearTransform",value:function(){this.setDirty(),this.localPosition=gn(0,0,0),this.localRotation=_o(0,0,0,1),this.localScale=gn(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],s=e[3],l=i*(u=i+i),h=i*(c=o+o),d=i*(f=a+a),p=o*c,v=o*f,g=a*f,y=s*u,m=s*c,b=s*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,s,u,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 Fr(this.position,this.worldTransform),this.position}},{key:"getRotation",value:function(){return Br(this.rotation,this.worldTransform),this.rotation}},{key:"getScale",value:function(){return jr(this.scaling,this.worldTransform),this.scaling}}]),i}(Re);So.DIRTY=1;var Ao,To,Io,Co,Do,No,ko=n(11922),Ro=(Ao=(0,Le.b2)(),To=(0,Le.f3)(Ue.RenderEngine),Ao((No=function(){function t(){we(this,t),xe(this,"engine",Do,this),this.resourcePool={}}return Se(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:Gn.CLAMP_TO_EDGE,wrapT:Gn.CLAMP_TO_EDGE,usage:i})})}return this.resourcePool[t.name]}},{key:"clean",value:function(){this.resourcePool={}}}]),t}(),Do=Ae((Co=No).prototype,"engine",[To],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Io=Co))||Io);var Oo,Mo,Po,Go,Lo=function(t){Ve(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=qe(e);if(n){var i=qe(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return He(this,t)});function i(t){var e;return we(this,i),(e=r.call(this,t)).name=void 0,e.name=t.name||"",e}return i}(Re),Uo=(0,Le.b2)()((Mo=function(){function t(){we(this,t),this.config=void 0}return Se(t,[{key:"get",value:function(){return this.config}},{key:"set",value:function(t){this.config=t}}]),t}(),Oo=Mo))||Oo;!function(t){t.PANSTART="PANSTART",t.PANEND="PANEND",t.PANMOVE="PANMOVE",t.PINCH="PINCH",t.KEYDOWN="KEYDOWN",t.KEYUP="KEYUP",t.HOVER="HOVER"}(Go||(Go={}));var Fo,jo,Bo=(0,Le.b2)()(Po=function(){function t(){we(this,t)}return Se(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}())||Po,zo=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\s\S]*?);/g;function Vo(t){var e={};return{content:t=t.replace(zo,(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 Wo(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 Xo(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Wo(Object(n),!0).forEach((function(e){an(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Wo(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Ho=/precision\s+(high|low|medium)p\s+float/,qo=/#pragma include (["^+"]?["\ "[a-zA-Z_0-9](.*)"]*?)/g,Yo=(0,Le.b2)()((jo=function(){function t(){we(this,t),this.moduleCache={},this.rawContentCache={}}return Se(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,s=Vo(r),u=s.content,c=s.uniforms,f=Vo(o),l=f.content,h=f.uniforms;this.rawContentCache[t]={fs:l,uniforms:Xo(Xo(Xo({},c),h),a),vs:u}}}},{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,s=o.includeList,u=this.processModule(i,[],"fs"),c=u.content,f=u.includeList,l=c,h=(n=s.concat(f).concat(t),n.filter((function(t,e,n){return n.indexOf(t)===e}))).reduce((function(t,n){return Xo(Xo({},t),e.rawContentCache[n].uniforms)}),{});return Ho.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(qo,(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}(),Fo=jo))||Fo,Ko=new Le.W2;function Zo(){var t=new Le.W2;return t.parent=Ko,t.bind(Ue.Systems).to(po).inSingletonScope().whenTargetNamed(Ue.SceneGraphSystem),t.bind(Ue.Systems).to(on).inSingletonScope().whenTargetNamed(Ue.FrameGraphSystem),t.bind(Ue.Systems).to(Rr).inSingletonScope().whenTargetNamed(Ue.MeshSystem),t.bind(Ue.Systems).to(Hn).inSingletonScope().whenTargetNamed(Ue.GeometrySystem),t.bind(Ue.Systems).to(cr).inSingletonScope().whenTargetNamed(Ue.MaterialSystem),t.bind(Ue.Systems).to(eo).inSingletonScope().whenTargetNamed(Ue.RendererSystem),t.bind(Ue.ResourcePool).to(Ro).inSingletonScope(),t.bind(Ue.ConfigService).to(Uo).inSingletonScope(),t.bind(Ue.InteractorService).to(Bo).inSingletonScope(),t.bind(Ue.RenderPass).to(Ci).inSingletonScope().whenTargetNamed(Ci.IDENTIFIER),t.bind(Ue.RenderPass).to(to).inSingletonScope().whenTargetNamed(to.IDENTIFIER),t.bind(Ue.RenderPass).to(Qi).inSingletonScope().whenTargetNamed(Qi.IDENTIFIER),t.bind(Ue.RenderPassFactory).toFactory((function(t){return function(e){return t.container.getNamed(Ue.RenderPass,e)}})),t}function $o(t){for(var e=new lr,n=gn(t[0],t[1],t[2]),r=gn(t[0],t[1],t[2]),i=3;i<t.length;){var o=t[i++],a=t[i++],s=t[i++];o<n[0]&&(n[0]=o),a<n[1]&&(n[1]=a),s<n[2]&&(n[2]=s),o>r[0]&&(r[0]=o),a>r[1]&&(r[1]=a),s>r[2]&&(r[2]=s)}return e.setMinMax(n,r),e}(0,ko.Z)(Ko,!1),Ko.bind(Ue.ShaderModuleService).to(Yo).inSingletonScope(),Ko.bind(Ue.NameComponentManager).toConstantValue(new Oe(Lo)),Ko.bind(Ue.HierarchyComponentManager).toConstantValue(new Oe(ho)),Ko.bind(Ue.TransformComponentManager).toConstantValue(new Oe(So)),Ko.bind(Ue.MeshComponentManager).toConstantValue(new Oe(dr)),Ko.bind(Ue.CullableComponentManager).toConstantValue(new Oe(fr)),Ko.bind(Ue.GeometryComponentManager).toConstantValue(new Oe(Xn)),Ko.bind(Ue.MaterialComponentManager).toConstantValue(new Oe(or));var Jo,Qo,ta,ea,na,ra="undefined"!=typeof navigator&&/Version\/[\d\.]+.*Safari/.test(navigator.userAgent);function ia(t){return"number"==typeof t}function oa(t){return void 0===t?0:t>360||t<-360?t%360:t}function aa(t,e,n){return ia(t)?gn(t,e,n):3===t.length?pn(t):gn(t[0],t[1],t[2])}dn(),dn(),dn(),dn(),dn(),dn(),n(62697),n(71894),n(71186),n(25275),n(72862),n(49633),function(t){t.Normal="normal",t.PostProcessing="post-processing"}(Jo||(Jo={})),n(17222),n(25965),n(32391),n(13945),n(27294),n(89586),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>[]"}(Qo||(Qo={})),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"}(ta||(ta={})),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"}(ea||(ea={})),function(t){t.GLSL100="GLSL100",t.GLSL450="GLSL450",t.WGSL="WGSL"}(na||(na={}));var sa,ua,ca,fa,la,ha,da,pa,va,ga,ya=function(){function t(e,n){var r,i;we(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 un(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=pn(n.right),this.up=pn(n.up),this.forward=pn(n.forward),this.position=pn(n.position),this.focalPoint=pn(n.focalPoint),this.distanceVector=pn(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 Se(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=Mr(t.matrix,this.matrix),t.right=yn(t.right,this.right),t.up=yn(t.up,this.up),t.forward=yn(t.forward,this.forward),t.position=yn(t.position,this.position),t.focalPoint=yn(t.focalPoint,this.focalPoint),t.distanceVector=yn(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"}(pa||(pa={})),function(t){t.DEFAULT="DEFAULT",t.ROTATIONAL="ROTATIONAL",t.TRANSLATIONAL="TRANSLATIONAL",t.CINEMATIC="CINEMATIC"}(va||(va={})),function(t){t.ORTHOGRAPHIC="ORTHOGRAPHIC",t.PERSPECTIVE="PERSPECTIVE"}(ga||(ga={}));var ma,ba,_a,xa,wa,Ea,Sa,Aa=Math.PI/180,Ta=180/Math.PI,Ia=(sa=(0,Le.b2)(),ua=(0,Le.f3)(Ue.InteractorService),sa((da=ha=function(){function t(){we(this,t),this.matrix=Or(),this.right=gn(1,0,0),this.up=gn(0,1,0),this.forward=gn(0,0,1),this.position=gn(0,0,1),this.focalPoint=gn(0,0,0),this.distanceVector=gn(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,xe(this,"interactor",la,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=Or(),this.view=void 0,this.following=void 0,this.type=pa.EXPLORING,this.trackingMode=va.DEFAULT,this.projectionMode=ga.PERSPECTIVE,this.frustum=new Dr,this.landmarks=[],this.landmarkAnimationID=void 0}return Se(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===pa.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===pa.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!==pa.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 Gr(Or(),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===ga.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===ga.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=ga.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*Aa,this.aspect,this.near,this.far),this}},{key:"setOrthographic",value:function(t,e,n,r,i,o){this.projectionMode=ga.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),s=(this.top-this.bottom)/(2*this.zoom),u=(this.rright+this.left)/2,c=(this.top+this.bottom)/2,f=u-a,l=u+a,h=c+s,d=c-s;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 s=1/(e-n),u=1/(r-i),c=1/(o-a);t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,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,s,u,c,f,l,h,d,p,v,g=gn(0,1,0);if(this.focalPoint=aa(t,e,n),this.trackingMode===va.CINEMATIC){var y=_n(dn(),this.focalPoint,this.position);t=y[0],e=y[1],n=y[2];var m=vn(y),b=Math.asin(e/m)*Ta,_=90+Math.atan2(n,t)*Ta,x=Or();r=x,i=x,o=_*Aa,a=Math.sin(o),s=Math.cos(o),u=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]=u*s-h*a,r[1]=c*s-d*a,r[2]=f*s-p*a,r[3]=l*s-v*a,r[8]=u*a+h*s,r[9]=c*a+d*s,r[10]=f*a+p*s,r[11]=l*a+v*s,function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],u=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]=s*i+l*r,t[7]=u*i+h*r,t[8]=c*i-o*r,t[9]=f*i-a*r,t[10]=l*i-s*r,t[11]=h*i-u*r}(x,x,b*Aa),g=An(dn(),[0,1,0],x)}return Gr(this.matrix,function(t,e,n,r){var i,o,a,s,u,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-_)<sn&&Math.abs(v-x)<sn&&Math.abs(g-w)<sn?Pr(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),s=l*a-h*o,u=h*i-f*a,c=f*o-l*i,(d=Math.hypot(s,u,c))?(s*=d=1/d,u*=d,c*=d):(s=0,u=0,c=0),t[0]=i,t[1]=s,t[2]=f,t[3]=0,t[4]=o,t[5]=u,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]=-(s*p+u*v+c*g),t[14]=-(f*p+l*v+h*g),t[15]=1,t)}(Or(),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=dn();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=oa(t),this.computeMatrix(),this._getAxes(),this.type===pa.ORBITING||this.type===pa.EXPLORING?this._getPosition():this.type===pa.TRACKING&&this._getFocalPoint(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(t){return this.elevation=oa(t),this.computeMatrix(),this._getAxes(),this.type===pa.ORBITING||this.type===pa.EXPLORING?this._getPosition():this.type===pa.TRACKING&&this._getFocalPoint(),this}},{key:"setRoll",value:function(t){return this.roll=oa(t),this.computeMatrix(),this._getAxes(),this.type===pa.ORBITING||this.type===pa.EXPLORING?this._getPosition():this.type===pa.TRACKING&&this._getFocalPoint(),this}},{key:"rotate",value:function(t,e,n){if(this.type===pa.EXPLORING){t=oa(t),e=oa(e),n=oa(n);var r=go(vo(),[1,0,0],(this.rotateWorld?1:-1)*e*Aa),i=go(vo(),[0,1,0],(this.rotateWorld?1:-1)*t*Aa),o=go(vo(),[0,0,1],n*Aa),a=yo(vo(),i,r);a=yo(vo(),a,o);var s=zr(Or(),a);Ur(this.matrix,this.matrix,[0,0,-this.distance]),Lr(this.matrix,this.matrix,s),Ur(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation+e)>90)return;this.relElevation=oa(e),this.relAzimuth=oa(t),this.relRoll=oa(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.computeMatrix()}return this._getAxes(),this.type===pa.ORBITING||this.type===pa.EXPLORING?this._getPosition():this.type===pa.TRACKING&&this._getFocalPoint(),this._update(),this}},{key:"pan",value:function(t,e){var n=aa(t,e,0),r=pn(this.position);return bn(r,r,xn(dn(),this.right,n[0])),bn(r,r,xn(dn(),this.up,n[1])),this._setPosition(r),this}},{key:"dolly",value:function(t){var e=this.forward,n=pn(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===pa.ORBITING||this.type===pa.EXPLORING?this._getDistance():this.type===pa.TRACKING&&bn(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 ya(t,n);return this.landmarks.push(r),r}},{key:"setLandmark",value:function(t){var e=new ya(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(),s=r.getRoll(),u=function t(r){void 0===i&&(i=r);var u,c=r-i,f=(1-Math.cos(c/n*Math.PI))/2,l=dn(),h=dn();if(Sn(l,e.focalPoint,a,f),Sn(h,e.position,o,f),u=e.roll*(1-f)+s*f,e.setFocalPoint(l),e.setPosition(h),e.setRoll(u),e.computeMatrix(),!(Cn(l,a)+Cn(h,o)>.01))return e.setFocalPoint(l),e.setPosition(h),e.setRoll(u),e.computeMatrix(),void e.interactor.connect();c<n&&(e.landmarkAnimationID=window.requestAnimationFrame(t))};window.requestAnimationFrame(u)}}},{key:"_update",value:function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles()}},{key:"computeMatrix",value:function(){var t,e,n=go(vo(),[0,0,1],this.roll*Aa);Pr(this.matrix),t=go(vo(),[1,0,0],(this.rotateWorld&&this.type!==pa.TRACKING||this.type===pa.TRACKING?1:-1)*this.elevation*Aa),e=go(vo(),[0,1,0],(this.rotateWorld&&this.type!==pa.TRACKING||this.type===pa.TRACKING?1:-1)*this.azimuth*Aa);var r=yo(vo(),e,t);r=yo(vo(),r,n);var i=zr(Or(),r);this.type===pa.ORBITING||this.type===pa.EXPLORING?(Ur(this.matrix,this.matrix,this.focalPoint),Lr(this.matrix,this.matrix,i),Ur(this.matrix,this.matrix,[0,0,this.distance])):this.type===pa.TRACKING&&(Ur(this.matrix,this.matrix,this.position),Lr(this.matrix,this.matrix,i))}},{key:"_setPosition",value:function(t,e,n){this.position=aa(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(){yn(this.right,aa(ln(cn(),[1,0,0,0],this.matrix))),yn(this.up,aa(ln(cn(),[0,1,0,0],this.matrix))),yn(this.forward,aa(ln(cn(),[0,0,1,0],this.matrix))),wn(this.right,this.right),wn(this.up,this.up),wn(this.forward,this.forward)}},{key:"_getAngles",value:function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=vn(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===pa.TRACKING||this.rotateWorld?(this.elevation=Math.asin(e/r)*Ta,this.azimuth=Math.atan2(-t,-n)*Ta):(this.elevation=-Math.asin(e/r)*Ta,this.azimuth=-Math.atan2(-t,-n)*Ta)}},{key:"_getPosition",value:function(){yn(this.position,aa(ln(cn(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){var t,e;Tn(this.distanceVector,[0,0,-this.distance],(t=hn(),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)),bn(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=_n(dn(),this.focalPoint,this.position),this.distance=vn(this.distanceVector),this.dollyingStep=this.distance/100}}]),t}(),ha.ProjectionMode={ORTHOGRAPHIC:"ORTHOGRAPHIC",PERSPECTIVE:"PERSPECTIVE"},la=Ae((fa=da).prototype,"interactor",[ua],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ca=fa))||ca),Ca=(ma=(0,Le.b2)(),ba=(0,Le.f3)(Ue.GeometryComponentManager),ma((Sa=Ea=function(){function t(){we(this,t),this.config=void 0,xe(this,"geometry",wa,this),this.entity=void 0,this.component=void 0}return Se(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}(),Ea.BOX="box",Ea.SPHERE="sphere",Ea.PLANE="plane",Ea.MERGED="merged",wa=Ae((xa=Sa).prototype,"geometry",[ba],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),_a=xa))||_a),Da=n(98344);function Na(){if("undefined"!=typeof document)return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}var ka={}.toString;var Ra={};Ra["[object Float32Array]"]=Ra["[object Float64Array]"]=Ra["[object Int8Array]"]=Ra["[object Int16Array]"]=Ra["[object Int32Array]"]=Ra["[object Uint8Array]"]=Ra["[object Uint8ClampedArray]"]=Ra["[object Uint16Array]"]=Ra["[object Uint32Array]"]=!0,Ra["[object Arguments]"]=Ra["[object Array]"]=Ra["[object ArrayBuffer]"]=Ra["[object Boolean]"]=Ra["[object DataView]"]=Ra["[object Date]"]=Ra["[object Error]"]=Ra["[object Function]"]=Ra["[object Map]"]=Ra["[object Number]"]=Ra["[object Object]"]=Ra["[object RegExp]"]=Ra["[object Set]"]=Ra["[object String]"]=Ra["[object WeakMap]"]=!1;var Oa,Ma,Pa,Ga,La,Ua,Fa,ja,Ba=Object.prototype.toString,za=function(t){return function(t){return!!t&&"object"===We(t)}(t)&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}(t.length)&&!!Ra[Ba.call(t)]};function Va(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 Wa(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Va(Object(n),!0).forEach((function(e){an(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Va(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Xa,Ha,qa,Ya,Ka,Za,$a,Ja,Qa,ts,es,ns,rs,is,os,as,ss,us,cs,fs,ls,hs,ds,ps,vs,gs,ys,ms,bs,_s,xs,ws,Es,Ss,As,Ts=(Oa=(0,Le.b2)(),Ma=(0,Le.f3)(Ue.RenderEngine),Pa=(0,Le.f3)(Ue.ConfigService),Oa((ja=function(){function t(){we(this,t),xe(this,"engine",Ua,this),xe(this,"configService",Fa,this),this.entity=ke(),this.model=void 0,this.dirty=!0,this.compiledBundle=void 0,this.initPromise=void 0}var e,n,r;return Se(t,[{key:"init",value:function(){var t=this.configService.get(),e=t.canvas,n=t.engineOptions;this.initPromise=this.engine.init(Wa({canvas:e||Na(),swapChainFormat:Da.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=ia(e)||za(e)||(n=e,Array.isArray?Array.isArray(n):function(t,e){return ka.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===ea.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=De(Ie().mark((function t(){var e,n,r=this,i=arguments;return Ie().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=De(Ie().mark((function t(){return Ie().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=De(Ie().mark((function t(){var e,n,r;return Ie().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.initPromise;case 2:return e=Wa({},this.compiledBundle.context),n=this.engine.supportWebGPU?this.engine.useWGSL?na.WGSL:na.GLSL450:na.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===ea.StorageBuffer){var n=1;t.type===Qo.FloatArray?n=1:t.type===Qo.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}(),Ua=Ae((La=ja).prototype,"engine",[Ma],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Fa=Ae(La.prototype,"configService",[Pa],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ga=La))||Ga),Is=(Xa=(0,Le.b2)(),Ha=(0,Le.f3)(Ue.MaterialComponentManager),Xa(($a=Za=function(){function t(){we(this,t),this.config=void 0,xe(this,"material",Ka,this),this.entity=void 0,this.component=void 0}return Se(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}(),Za.BASIC="basic",Ka=Ae((Ya=$a).prototype,"material",[Ha],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),qa=Ya))||qa),Cs=(Ja=(0,Le.b2)(),Qa=(0,Le.f3)(Ue.MeshComponentManager),ts=(0,Le.f3)(Ue.CullableComponentManager),es=(0,Le.f3)(Ue.TransformComponentManager),ns=(0,Le.f3)(Ue.Systems),rs=(0,Le.t6)(Ue.SceneGraphSystem),Ja((ls=fs=function(){function t(){we(this,t),this.attributes={},this.config=void 0,xe(this,"mesh",as,this),xe(this,"cullable",ss,this),xe(this,"transform",us,this),xe(this,"sceneGraphSystem",cs,this),this.meshComponent=void 0,this.transformComponent=void 0,this.entity=void 0}return Se(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}(),fs.POINT="point",fs.LINE="line",fs.GRID="grid",as=Ae((os=ls).prototype,"mesh",[Qa],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ss=Ae(os.prototype,"cullable",[ts],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),us=Ae(os.prototype,"transform",[es],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),cs=Ae(os.prototype,"sceneGraphSystem",[ns,rs],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),is=os))||is),Ds=n(96377),Ns=n.n(Ds),ks=function(){function t(e,n){we(this,t),this.attribute=void 0,this.buffer=void 0;var r=n.buffer,i=n.offset,o=n.stride,a=n.normalized,s=n.size,u=n.divisor;this.buffer=r,this.attribute={buffer:r.get(),offset:i||0,stride:o||0,normalized:a||!1,divisor:u||0},s&&(this.attribute.size=s)}return Se(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}(),Rs=(an(hs={},Gn.POINTS,"points"),an(hs,Gn.LINES,"lines"),an(hs,Gn.LINE_LOOP,"line loop"),an(hs,Gn.LINE_STRIP,"line strip"),an(hs,Gn.TRIANGLES,"triangles"),an(hs,Gn.TRIANGLE_FAN,"triangle fan"),an(hs,Gn.TRIANGLE_STRIP,"triangle strip"),hs),Os=(an(ds={},Gn.STATIC_DRAW,"static"),an(ds,Gn.DYNAMIC_DRAW,"dynamic"),an(ds,Gn.STREAM_DRAW,"stream"),ds),Ms=(an(ps={},Gn.BYTE,"int8"),an(ps,Gn.UNSIGNED_INT,"int16"),an(ps,Gn.INT,"int32"),an(ps,Gn.UNSIGNED_BYTE,"uint8"),an(ps,Gn.UNSIGNED_SHORT,"uint16"),an(ps,Gn.UNSIGNED_INT,"uint32"),an(ps,Gn.FLOAT,"float"),ps),Ps=(an(vs={},Gn.ALPHA,"alpha"),an(vs,Gn.LUMINANCE,"luminance"),an(vs,Gn.LUMINANCE_ALPHA,"luminance alpha"),an(vs,Gn.RGB,"rgb"),an(vs,Gn.RGBA,"rgba"),an(vs,Gn.RGBA4,"rgba4"),an(vs,Gn.RGB5_A1,"rgb5 a1"),an(vs,Gn.RGB565,"rgb565"),an(vs,Gn.DEPTH_COMPONENT,"depth"),an(vs,Gn.DEPTH_STENCIL,"depth stencil"),vs),Gs=(an(gs={},Gn.DONT_CARE,"dont care"),an(gs,Gn.NICEST,"nice"),an(gs,Gn.FASTEST,"fast"),gs),Ls=(an(ys={},Gn.NEAREST,"nearest"),an(ys,Gn.LINEAR,"linear"),an(ys,Gn.LINEAR_MIPMAP_LINEAR,"mipmap"),an(ys,Gn.NEAREST_MIPMAP_LINEAR,"nearest mipmap linear"),an(ys,Gn.LINEAR_MIPMAP_NEAREST,"linear mipmap nearest"),an(ys,Gn.NEAREST_MIPMAP_NEAREST,"nearest mipmap nearest"),ys),Us=(an(ms={},Gn.REPEAT,"repeat"),an(ms,Gn.CLAMP_TO_EDGE,"clamp"),an(ms,Gn.MIRRORED_REPEAT,"mirror"),ms),Fs=(an(bs={},Gn.NONE,"none"),an(bs,Gn.BROWSER_DEFAULT_WEBGL,"browser"),bs),js=(an(_s={},Gn.NEVER,"never"),an(_s,Gn.ALWAYS,"always"),an(_s,Gn.LESS,"less"),an(_s,Gn.LEQUAL,"lequal"),an(_s,Gn.GREATER,"greater"),an(_s,Gn.GEQUAL,"gequal"),an(_s,Gn.EQUAL,"equal"),an(_s,Gn.NOTEQUAL,"notequal"),_s),Bs=(an(xs={},Gn.FUNC_ADD,"add"),an(xs,Gn.MIN_EXT,"min"),an(xs,Gn.MAX_EXT,"max"),an(xs,Gn.FUNC_SUBTRACT,"subtract"),an(xs,Gn.FUNC_REVERSE_SUBTRACT,"reverse subtract"),xs),zs=(an(ws={},Gn.ZERO,"zero"),an(ws,Gn.ONE,"one"),an(ws,Gn.SRC_COLOR,"src color"),an(ws,Gn.ONE_MINUS_SRC_COLOR,"one minus src color"),an(ws,Gn.SRC_ALPHA,"src alpha"),an(ws,Gn.ONE_MINUS_SRC_ALPHA,"one minus src alpha"),an(ws,Gn.DST_COLOR,"dst color"),an(ws,Gn.ONE_MINUS_DST_COLOR,"one minus dst color"),an(ws,Gn.DST_ALPHA,"dst alpha"),an(ws,Gn.ONE_MINUS_DST_ALPHA,"one minus dst alpha"),an(ws,Gn.CONSTANT_COLOR,"constant color"),an(ws,Gn.ONE_MINUS_CONSTANT_COLOR,"one minus constant color"),an(ws,Gn.CONSTANT_ALPHA,"constant alpha"),an(ws,Gn.ONE_MINUS_CONSTANT_ALPHA,"one minus constant alpha"),an(ws,Gn.SRC_ALPHA_SATURATE,"src alpha saturate"),ws),Vs=(an(Es={},Gn.NEVER,"never"),an(Es,Gn.ALWAYS,"always"),an(Es,Gn.LESS,"less"),an(Es,Gn.LEQUAL,"lequal"),an(Es,Gn.GREATER,"greater"),an(Es,Gn.GEQUAL,"gequal"),an(Es,Gn.EQUAL,"equal"),an(Es,Gn.NOTEQUAL,"notequal"),Es),Ws=(an(Ss={},Gn.ZERO,"zero"),an(Ss,Gn.KEEP,"keep"),an(Ss,Gn.REPLACE,"replace"),an(Ss,Gn.INVERT,"invert"),an(Ss,Gn.INCR,"increment"),an(Ss,Gn.DECR,"decrement"),an(Ss,Gn.INCR_WRAP,"increment wrap"),an(Ss,Gn.DECR_WRAP,"decrement wrap"),Ss),Xs=(an(As={},Gn.FRONT,"front"),an(As,Gn.BACK,"back"),As),Hs=function(){function t(e,n){we(this,t),this.buffer=void 0;var r=n.data,i=n.usage,o=n.type;this.buffer=e.buffer({data:r,usage:Os[i||Gn.STATIC_DRAW],type:Ms[o||Gn.UNSIGNED_BYTE]})}return Se(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 qs(t){return function(t){if(Array.isArray(t))return Me(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Pe(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 Ys={};Ys["[object Float32Array]"]=Ys["[object Float64Array]"]=Ys["[object Int8Array]"]=Ys["[object Int16Array]"]=Ys["[object Int32Array]"]=Ys["[object Uint8Array]"]=Ys["[object Uint8ClampedArray]"]=Ys["[object Uint16Array]"]=Ys["[object Uint32Array]"]=!0,Ys["[object Arguments]"]=Ys["[object Array]"]=Ys["[object ArrayBuffer]"]=Ys["[object Boolean]"]=Ys["[object DataView]"]=Ys["[object Date]"]=Ys["[object Error]"]=Ys["[object Function]"]=Ys["[object Map]"]=Ys["[object Number]"]=Ys["[object Object]"]=Ys["[object RegExp]"]=Ys["[object Set]"]=Ys["[object String]"]=Ys["[object WeakMap]"]=!1;var Ks=Object.prototype.toString,Zs=function(t){return function(t){return!!t&&"object"===We(t)}(t)&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}(t.length)&&!!Ys[Ks.call(t)]};function $s(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 Js(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?$s(Object(n),!0).forEach((function(e){an(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$s(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Qs=0,tu=function(){function t(e,n){var r=this;we(this,t),this.reGl=e,this.context=n,this.entity=ke(),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,s=t.storageClass;if(s===ea.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 u=r.textureCache[e],c=u.textureWidth,f=u.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(s===ea.Uniform){if(o&&(Array.isArray(o)||Zs(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,s=o.texelCount;i.u_OutputTextureSize=[a,a],i.u_OutputTexelCount=s,this.context.output.textureSize=[a,a];var u={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(u)}var e;return Se(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=De(Ie().mark((function t(){var e,n,r,i,o,a,s,u,c=this;return Ie().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,s=[],4!==i)for(u=0;u<e.length;u+=4)1===i?s.push(e[u]):2===i?s.push(e[u],e[u+1]):s.push(e[u],e[u+1],e[u+2]);else s=e;return t.abrupt("return",new a(s.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 Js(Js({},t),{},{id:Qs++,texture:this.reGl.texture({width:n,height:n,data:e,type:"float"})})}},{key:"calcDataTexture",value:function(t,e,n){var r=1;e===Qo.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,s=Math.ceil(a/r),u=Math.ceil(Math.sqrt(s)),c=u*u;s<c&&i.push.apply(i,qs(new Array(4*(c-s)).fill(0)));var f=this.reGl.texture({width:u,height:u,data:i,type:"float"});return{id:Qs++,data:i,originalDataLength:a,typedArrayConstructor:Zs(n)?n.constructor:void 0,textureWidth:u,texture:f,texelCount:s,elementsPerTexel:r,isOutput:t===this.context.output.name}}}]),t}(),eu=function(){function t(e,n){we(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:Os[i||Gn.STATIC_DRAW],type:Ms[o||Gn.UNSIGNED_BYTE],count:a})}return Se(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}(),nu=function(){function t(e,n){we(this,t),this.framebuffer=void 0;var r=n.width,i=n.height,o=n.color,a=n.colors,s=(n.depth,n.stencil,{width:r,height:i});Array.isArray(a)&&(s.colors=a.map((function(t){return t.get()}))),o&&"boolean"!=typeof o&&(s.color=o.get()),this.framebuffer=e.framebuffer(s)}return Se(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 ru(t){var e={};return Object.keys(t).forEach((function(n){iu(n,t[n],e,"")})),e}function iu(t,e,n,r){var i,o;null===e||"number"==typeof e||"boolean"==typeof e||Array.isArray(e)&&"number"==typeof e[0]||Zs(e)||""===e||void 0!==e.resize?n["".concat(r&&r+".").concat(t)]=e:(o=We(i=e),null==i||"object"!==o&&"function"!==o||Object.keys(e).forEach((function(i){iu(i,e[i],n,"".concat(r&&r+".").concat(t))})),Array.isArray(e)&&e.forEach((function(e,i){Object.keys(e).forEach((function(o){iu(o,e[o],n,"".concat(r&&r+".").concat(t,"[").concat(i,"]"))}))})))}function ou(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 au(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ou(Object(n),!0).forEach((function(e){an(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ou(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var su,uu,cu,fu=function(){function t(e,n){we(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,s=n.uniforms,u=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={};s&&(this.uniforms=ru(s),Object.keys(s).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:Rs[void 0===u?Gn.TRIANGLES:u]};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 Se(t,[{key:"addUniforms",value:function(t){this.uniforms=au(au({},this.uniforms),ru(t))}},{key:"draw",value:function(t){var e=au(au({},this.uniforms),ru(t.uniforms||{})),n={};Object.keys(e).forEach((function(t){var r=We(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:js[n.func||Gn.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,s=void 0===a?[0,0,0,0]:a;e.blend={enable:!!r,func:{srcRGB:zs[i&&i.srcRGB||Gn.SRC_ALPHA],srcAlpha:zs[i&&i.srcAlpha||Gn.SRC_ALPHA],dstRGB:zs[i&&i.dstRGB||Gn.ONE_MINUS_SRC_ALPHA],dstAlpha:zs[i&&i.dstAlpha||Gn.ONE_MINUS_SRC_ALPHA]},equation:{rgb:Bs[o&&o.rgb||Gn.FUNC_ADD],alpha:Bs[o&&o.alpha||Gn.FUNC_ADD]},color:s}}}},{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,s=void 0===a?{cmp:Gn.ALWAYS,ref:0,mask:-1}:a,u=n.opFront,c=void 0===u?{fail:Gn.KEEP,zfail:Gn.KEEP,zpass:Gn.KEEP}:u,f=n.opBack,l=void 0===f?{fail:Gn.KEEP,zfail:Gn.KEEP,zpass:Gn.KEEP}:f;e.stencil={enable:!!r,mask:o,func:au(au({},s),{},{cmp:Vs[s.cmp]}),opFront:{fail:Ws[c.fail],zfail:Ws[c.zfail],zpass:Ws[c.zpass]},opBack:{fail:Ws[l.fail],zfail:Ws[l.zfail],zpass:Ws[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?Gn.BACK:i;e.cull={enable:!!r,face:Xs[o]}}}},{key:"generateDefines",value:function(t){return Object.keys(t).map((function(e){return"#define ".concat(e," ").concat(Number(t[e]))})).join("\n")}}]),t}(),lu=function(){function t(e,n){we(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?Gn.UNSIGNED_BYTE:i,a=n.width,s=n.height,u=n.flipY,c=void 0!==u&&u,f=n.format,l=void 0===f?Gn.RGBA:f,h=n.mipmap,d=void 0!==h&&h,p=n.wrapS,v=void 0===p?Gn.CLAMP_TO_EDGE:p,g=n.wrapT,y=void 0===g?Gn.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?Gn.NEAREST:S,T=n.min,I=void 0===T?Gn.NEAREST:T,C=n.colorSpace,D=void 0===C?Gn.BROWSER_DEFAULT_WEBGL:C;this.width=a,this.height=s;var N={width:a,height:s,type:Ms[o],format:Ps[l],wrapS:Us[v],wrapT:Us[y],mag:Ls[A],min:Ls[I],alignment:x,flipY:c,colorSpace:Fs[D],premultiplyAlpha:E,aniso:b};r&&(N.data=r),"number"==typeof d?N.mipmap=Gs[d]:"boolean"==typeof d&&(N.mipmap=d),this.texture=e.texture(N)}return Se(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}(),hu=(0,Le.b2)()((uu=function(){function t(){var e=this;we(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=De(Ie().mark((function t(n){return Ie().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=De(Ie().mark((function t(e){var r;return Ie().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 fu(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 ks(e.gl,t)},this.createBuffer=function(t){return new Hs(e.gl,t)},this.createElements=function(t){return new eu(e.gl,t)},this.createTexture2D=function(t){return new lu(e.gl,t)},this.createFramebuffer=function(t){return new nu(e.gl,t)},this.useFramebuffer=function(t,n){e.gl({framebuffer:t?t.get():null})(n)},this.createComputeModel=function(){var t=De(Ie().mark((function t(n){return Ie().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new tu(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,s={color:n,depth:r,stencil:i};s.framebuffer=null===a?a:a.get(),e.gl.clear(s)},this.setScissor=function(t){e.gl&&e.gl._gl&&(t.enable&&t.box?(e.gl._gl.enable(Gn.SCISSOR_TEST),e.gl._gl.scissor(t.box.x,t.box.y,t.box.width,t.box.height)):e.gl._gl.disable(Gn.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 Se(t,[{key:"init",value:(e=De(Ie().mark((function t(e){return Ie().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){Ns()({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}(),su=uu))||su;function du(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 pu(){return vu.apply(this,arguments)}function vu(){return(vu=De(Ie().mark((function t(){return Ie().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!cu){t.next=2;break}return t.abrupt("return",cu);case 2:return t.next=4,du("https://preview.babylonjs.com/glslang/glslang.js");case 4:return cu=window.glslang("https://preview.babylonjs.com/glslang/glslang.wasm"),t.abrupt("return",cu);case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var gu,yu,mu,bu,_u,xu,wu,Eu=function(){function t(e,n){we(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,s=r.normalized,u=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:s||!1,divisor:c||0,arrayStride:f||0,attributes:l,stepMode:h||"vertex"},u&&(this.attribute.size=u)}return Se(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}(),Su=function(){function t(e,n){we(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||Da.FB.Vertex|Da.FB.CopyDst)}return Se(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){(ra?this.engine.device.getQueue():this.engine.device.defaultQueue).writeBuffer(t,e,n)}}]),t}(),Au=function(){function t(e,n){we(this,t),this.engine=e,this.context=n,this.entity=ke(),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 Se(t,[{key:"init",value:(r=De(Ie().mark((function t(){var e,n,r,i,o,a,s,u=this;return Ie().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===ea.StorageBuffer})),i=this.context.uniforms.filter((function(t){return t.storageClass===ea.Uniform})),o=i.length?1:0,this.bindGroupEntries=[],o&&(a=0,s=[],i.forEach((function(t){if("number"==typeof t.data)u.uniformGPUBufferLayout.push({name:t.name,offset:a}),a+=4,s.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,s.push(0)),s.push.apply(s,qs(t.data)),u.uniformGPUBufferLayout.push({name:t.name,offset:a}));else{for(var o=0;o<i;o++)a+=4,s.push(0);s.push.apply(s,qs(t.data)),u.uniformGPUBufferLayout.push({name:t.name,offset:a})}}a+=4*n}})),this.uniformBuffer=new Su(this.engine,{data:s instanceof Array?new Float32Array(s):s,usage:Da.FB.Uniform|Da.FB.CopyDst}),this.bindGroupEntries.push({binding:0,resource:{buffer:this.uniformBuffer.get()}})),r.forEach((function(t){var e;null!==t.data&&(t.type!==Qo.Vector4FloatArray&&t.type!==Qo.FloatArray||(t.name===u.context.output.name?(e=new Su(u.engine,{data:isFinite(Number(t.data))?[t.data]:t.data,usage:Da.FB.Storage|Da.FB.CopyDst|Da.FB.CopySrc}),u.outputBuffer=e,u.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 Su(u.engine,{data:isFinite(Number(t.data))?[t.data]:t.data,usage:Da.FB.Storage|Da.FB.CopyDst|Da.FB.CopySrc}),u.vertexBuffers[t.name]=e,u.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=De(Ie().mark((function t(){var e,n,r,i,o,a,s,u,c;return Ie().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}),(s=this.engine.device.createCommandEncoder()).copyBufferToBuffer(i,0,a,0,o),(ra?this.engine.device.getQueue():this.engine.device.defaultQueue).submit([s.finish()]),t.next=12,a.mapAsync(Da.gc.Read);case 12:return u=a.getMappedRange(),c=new r(u.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,qs(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),(ra?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=De(Ie().mark((function t(e){var n;return Ie().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:ra}),entryPoint:"main"}});case 7:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})}]),t}(),Tu=function(){function t(e,n){we(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 Su(e,{data:i instanceof Array?new Uint16Array(i):i,usage:Da.FB.Index|Da.FB.CopyDst})}return Se(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}(),Iu=function(){function t(e,n){we(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 Se(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}(),Cu=(an(gu={},Gn.POINTS,Da.YV.PointList),an(gu,Gn.LINES,Da.YV.LineList),an(gu,Gn.LINE_LOOP,Da.YV.LineList),an(gu,Gn.LINE_STRIP,Da.YV.LineStrip),an(gu,Gn.TRIANGLES,Da.YV.TriangleList),an(gu,Gn.TRIANGLE_FAN,Da.YV.TriangleList),an(gu,Gn.TRIANGLE_STRIP,Da.YV.TriangleStrip),gu),Du=(an(yu={},Gn.NEVER,Da.wb.Never),an(yu,Gn.ALWAYS,Da.wb.Always),an(yu,Gn.LESS,Da.wb.Less),an(yu,Gn.LEQUAL,Da.wb.LessEqual),an(yu,Gn.GREATER,Da.wb.Greater),an(yu,Gn.GEQUAL,Da.wb.GreaterEqual),an(yu,Gn.EQUAL,Da.wb.Equal),an(yu,Gn.NOTEQUAL,Da.wb.NotEqual),yu),Nu=(an(mu={},Gn.FUNC_ADD,Da.db.Add),an(mu,Gn.MIN_EXT,Da.db.Min),an(mu,Gn.MAX_EXT,Da.db.Max),an(mu,Gn.FUNC_SUBTRACT,Da.db.Subtract),an(mu,Gn.FUNC_REVERSE_SUBTRACT,Da.db.ReverseSubtract),mu),ku=(an(bu={},Gn.ZERO,Da.zi.Zero),an(bu,Gn.ONE,Da.zi.One),an(bu,Gn.SRC_COLOR,Da.zi.SrcColor),an(bu,Gn.ONE_MINUS_SRC_COLOR,Da.zi.OneMinusSrcColor),an(bu,Gn.SRC_ALPHA,Da.zi.SrcAlpha),an(bu,Gn.ONE_MINUS_SRC_ALPHA,Da.zi.OneMinusSrcAlpha),an(bu,Gn.DST_COLOR,Da.zi.DstColor),an(bu,Gn.ONE_MINUS_DST_COLOR,Da.zi.OneMinusDstColor),an(bu,Gn.DST_ALPHA,Da.zi.DstAlpha),an(bu,Gn.ONE_MINUS_DST_ALPHA,Da.zi.OneMinusDstAlpha),an(bu,Gn.CONSTANT_COLOR,Da.zi.BlendColor),an(bu,Gn.ONE_MINUS_CONSTANT_COLOR,Da.zi.OneMinusBlendColor),an(bu,Gn.SRC_ALPHA_SATURATE,Da.zi.SrcAlphaSaturated),bu),Ru=(an(_u={},Gn.ALPHA,"r8unorm"),an(_u,Gn.RGBA,"rgba8unorm"),an(_u,Gn.DEPTH_COMPONENT,"depth32float"),an(_u,Gn.DEPTH_STENCIL,"depth24plus-stencil8"),_u),Ou=(an(xu={},Gn.NEAREST,"nearest"),an(xu,Gn.LINEAR,"linear"),xu),Mu=(an(wu={},Gn.REPEAT,"repeat"),an(wu,Gn.CLAMP_TO_EDGE,"clamp-to-edge"),an(wu,Gn.MIRRORED_REPEAT,"mirror-repeat"),wu);function Pu(t){var e=t.cull;return e&&e.enable?e.face?e.face===Gn.FRONT?Da.Wf.Front:Da.Wf.Back:void 0:Da.Wf.None}function Gu(t){var e=t.depth,n=(t.stencil,{compare:Da.wb.Always,depthFailOp:Da.xS.Keep,failOp:Da.xS.Keep,passOp:Da.xS.Keep});return{depthWriteEnabled:e&&e.enable,depthCompare:Du[(null==e?void 0:e.func)||Gn.ALWAYS],format:Da.EV.Depth24PlusStencil8,stencilFront:n,stencilBack:n,stencilReadMask:4294967295,stencilWriteMask:4294967295}}function Lu(t,e){var n=t.blend;return[{format:e,alphaBlend:{srcFactor:ku[n&&n.func&&n.func.srcAlpha||Gn.ONE],dstFactor:ku[n&&n.func&&n.func.dstAlpha||Gn.ZERO],operation:Nu[n&&n.equation&&n.equation.alpha||Gn.FUNC_ADD]},colorBlend:{srcFactor:ku[n&&n.func&&n.func.srcRGB||Gn.ONE],dstFactor:ku[n&&n.func&&n.func.dstRGB||Gn.ZERO],operation:Nu[n&&n.equation&&n.equation.rgb||Gn.FUNC_ADD]},writeMask:Da.Yw.All}]}function Uu(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 Fu(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Uu(Object(n),!0).forEach((function(e){an(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Uu(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ju(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 s=a[o];e+=s.length}for(var u=new t(e),c=0,f=0,l=r;f<l.length;f++){var h=l[f];u.set(h,c),c+=h.length}return u}var Bu,zu,Vu,Wu=function(){function t(e,n){we(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 Se(t,[{key:"init",value:(n=De(Ie().mark((function t(){var e,n,r,i,o,a,s,u,c,f,l,h,d,p,v,g,y=this;return Ie().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,s=e.elements,u=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),s&&(this.indexBuffer=s.get(),this.indexCount=s.indexCount),v={vertexBuffers:Object.keys(i).map((function(t,e){var n=i[t],r=n.get(),o=r.arrayStride,a=r.stepMode,s=r.attributes;return y.attributeCache[t]=n,{arrayStride:o,stepMode:a,attributes:s}}))},g={sampleCount:this.engine.mainPassSampleCount,primitiveTopology:Cu[a||Gn.TRIANGLES],rasterizationState:Fu(Fu({},this.getDefaultRasterizationStateDescriptor()),{},{cullMode:Pu({cull:l})}),depthStencilState:Gu({depth:u,stencil:f}),colorStates:Lu({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=Fu(Fu({},this.uniforms),ru(t))}},{key:"draw",value:function(t){var e=this,n=this.engine.getCurrentRenderPass(),r=Fu(Fu({},this.uniforms),ru(t.uniforms||{})),i=[];Object.keys(r).forEach((function(t){var n=We(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 s,u=null===(s=e.uniformGPUBufferLayout.find((function(e){return e.name===t})))||void 0===s?void 0:s.offset;if(null!==u){var c=r[t].get(),f=c.color||c,l=f.texture,h=f.sampler;h&&(i.push({binding:u,resource:h}),u++),i.push({binding:u,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(),Da.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=De(Ie().mark((function t(e,n,r){var i,o,a;return Ie().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:ra}),entryPoint:"main"},fragmentStage:{module:this.engine.device.createShaderModule({code:e,isWHLSL:ra}),entryPoint:"main"}}}},{key:"getDefaultRasterizationStateDescriptor",value:function(){return{frontFace:Da.zX.CCW,cullMode:Da.Wf.None,depthBias:0,depthBiasSlopeScale:0,depthBiasClamp:0}}},{key:"buildUniformBindGroup",value:function(t){var e=this,n=0,r=ju.apply(void 0,[Float32Array].concat(qs(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:Da.$X.Fragment|Da.$X.Vertex,type:Da.$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:Da.$X.Fragment,type:Da.$l.Sampler},{binding:2*n+(o?1:0)+1,visibility:Da.$X.Fragment,type:Da.$l.SampledTexture})})),this.uniformsBindGroupLayout=this.engine.device.createBindGroupLayout({entries:i}),this.pipelineLayout=this.engine.device.createPipelineLayout({bindGroupLayouts:[this.uniformsBindGroupLayout]}),o&&(this.uniformBuffer=new Su(this.engine,{data:r instanceof Array?new Float32Array(r):r,usage:Da.FB.Uniform|Da.FB.CopyDst}))}}]),t}(),Xu=function(){function t(e,n){we(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 Se(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)&&Gn.UNSIGNED_BYTE,t.width),n=t.height,r=(t.flipY,t.format),i=void 0===r?Gn.RGBA:r,o=(t.mipmap,t.wrapS),a=void 0===o?Gn.CLAMP_TO_EDGE:o,s=t.wrapT,u=void 0===s?Gn.CLAMP_TO_EDGE:s,c=t.aniso,f=void 0===c?0:c,l=(t.alignment,t.premultiplyAlpha,t.mag),h=void 0===l?Gn.NEAREST:l,d=t.min,p=void 0===d?Gn.NEAREST:d,v=(void 0===t.colorSpace&&Gn.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:Da.kd.E2d,format:Ru[i],usage:v||Da.v2.Sampled|Da.v2.CopyDst}),(!v||v&Da.v2.Sampled)&&(this.sampler=this.engine.device.createSampler({addressModeU:Mu[a],addressModeV:Mu[u],addressModeW:Mu[a],magFilter:Ou[h],minFilter:Ou[p],maxAnisotropy:f}))}}]),t}(),Hu=(0,Le.b2)()((zu=function(){function t(){var e=this;we(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||Da.Ws.Load,e.mainDepthAttachment.depthLoadValue=r||Da.Ws.Load,e.mainDepthAttachment.stencilLoadValue=i?e.clearStencilValue:Da.Ws.Load,e.mainRenderPass&&e.endMainRenderPass(),e.startMainRenderPass())},this.createModel=function(){var t=De(Ie().mark((function t(n){var r;return Ie().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new Wu(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 Eu(e,t)},this.createBuffer=function(t){return new Su(e,t)},this.createElements=function(t){return new Tu(e,t)},this.createTexture2D=function(t){return new Xu(e,t)},this.createFramebuffer=function(t){return new Iu(e,t)},this.useFramebuffer=function(t,n){e.currentRenderTarget&&e.unbindFramebuffer(e.currentRenderTarget),e.currentRenderTarget=t,e.currentRenderTargetViewDescriptor={dimension:Da.p_.E2d,arrayLayerCount:1,aspect:Da.H7.All},e.currentRenderPass=null,n()},this.createComputeModel=function(){var t=De(Ie().mark((function t(n){var r;return Ie().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new Au(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 Se(t,[{key:"isFloatSupported",value:function(){return!0}},{key:"init",value:(n=De(Ie().mark((function t(e){return Ie().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(),ra?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=De(Ie().mark((function t(){var e,n;return Ie().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,pu();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(ra?"gpu":"gpupresent"),this.swapChain=this.context.configureSwapChain({device:this.device,format:this.options.swapChainFormat,usage:Da.v2.OutputAttachment|Da.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:Da.kd.E2d,format:Da.EV.BGRA8Unorm,usage:Da.v2.OutputAttachment};this.mainTexture&&this.mainTexture.destroy(),this.mainTexture=this.device.createTexture(t),this.mainColorAttachments=[{attachment:ra?this.mainTexture.createDefaultView():this.mainTexture.createView(),loadValue:[0,0,0,1],storeOp:Da.EG.Store}]}else this.mainColorAttachments=[{attachment:ra?this.swapChain.getCurrentTexture().createDefaultView():this.swapChain.getCurrentTexture().createView(),loadValue:[0,0,0,1],storeOp:Da.EG.Store}];var e={size:this.mainTextureExtends,mipLevelCount:1,sampleCount:this.mainPassSampleCount,dimension:Da.kd.E2d,format:ra?"depth32float-stencil8":Da.EV.Depth24PlusStencil8,usage:Da.v2.OutputAttachment};this.depthTexture&&this.depthTexture.destroy(),this.depthTexture=this.device.createTexture(e),this.mainDepthAttachment={attachment:ra?this.depthTexture.createDefaultView():this.depthTexture.createView(),depthLoadValue:this.clearDepthValue,depthStoreOp:Da.EG.Store,stencilLoadValue:this.clearStencilValue,stencilStoreOp:Da.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=ra?this.swapChain.getCurrentTexture().createDefaultView():this.swapChain.getCurrentTexture().createView():this.mainColorAttachments[0].attachment=ra?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],s=null===(r=t.get().color)||void 0===r?void 0:r.texture;s&&(o=s.createView(this.currentRenderTargetViewDescriptor));var u,c=null===(i=t.get().depth)||void 0===i?void 0:i.texture;c&&(u=c.createView());var f=this.renderTargetEncoder.beginRenderPass({colorAttachments:[{attachment:o,loadValue:null!==e?e:Da.Ws.Load,storeOp:Da.EG.Store}],depthStencilAttachment:c&&u?{attachment:u,depthLoadValue:n?this.clearDepthValue:Da.Ws.Load,depthStoreOp:Da.EG.Store,stencilLoadValue:a?this.clearStencilValue:Da.Ws.Load,stencilStoreOp:Da.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}(),Bu=zu))||Bu;var qu,Yu=4/64,Ku=(0,Le.b2)()(Vu=function(t){Ve(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=qe(e);if(n){var i=qe(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return He(this,t)});function i(){return we(this,i),r.apply(this,arguments)}return Se(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,s=t.halfExtents,u=n,c=i,f=a,l=Ge(void 0===s?gn(.5,.5,.5):s,3),h=l[0],d=l[1],p=l[2],v=[gn(-h,-d,p),gn(h,-d,p),gn(h,d,p),gn(-h,d,p),gn(h,-d,-p),gn(-h,-d,-p),gn(-h,d,-p),gn(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 s=dn(),u=dn(),c=dn(),f=dn();Sn(s,v[g[t][0]],v[g[t][1]],o/e),Sn(u,v[g[t][0]],v[g[t][2]],a/n),In(c,u,v[g[t][0]]),bn(f,s,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)+Yu,i=.875*(i/=3)+Yu,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,u,c),S(1,u,c),S(2,u,f),S(3,u,f),S(4,f,c),S(5,f,c);var A=$o(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}(Ca))||Vu;var Zu,$u=(0,Le.b2)()(qu=function(t){Ve(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=qe(e);if(n){var i=qe(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return He(this,t)});function i(){return we(this,i),r.apply(this,arguments)}return Se(i,[{key:"onEntityCreated",value:function(){var t=this.config.geometries,e=void 0===t?[]:t,n=this.getComponent();n.aabb=new lr;var r=[],i=[],o=0;e.forEach((function(t){var e=t.aabb,a=t.indices,s=t.vertexCount,u=t.attributes;n.aabb.add(e),n.vertexCount+=s,a&&i.push.apply(i,qs(a.map((function(t){return t+o})))),o+=s,u.forEach((function(t,e){r[e]?t.data&&(ia(t.data)?r[e].push(t.data):za(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}(Ca))||qu;var Ju,Qu=(0,Le.b2)()(Zu=function(t){Ve(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=qe(e);if(n){var i=qe(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return He(this,t)});function i(){return we(this,i),r.apply(this,arguments)}return Se(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,s=[],u=[],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;s.push(p,0,v),u.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=$o(s),b=this.getComponent();b.indices=Uint32Array.from(f),b.aabb=m,b.vertexCount=l,b.attributes=[{dirty:!0,name:"position",data:Float32Array.from(s),arrayStride:12,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float3"}]},{dirty:!0,name:"normal",data:Float32Array.from(u),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}(Ca))||Zu;var tc,ec,nc,rc,ic,oc,ac,sc,uc=(0,Le.b2)()(Ju=function(t){Ve(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=qe(e);if(n){var i=qe(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return He(this,t)});function i(){return we(this,i),r.apply(this,arguments)}return Se(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,s=[],u=[],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;s.push(m*n,b*n,_*n),u.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=$o(s),C=this.getComponent();C.indices=Uint32Array.from(f),C.aabb=I,C.vertexCount=s.length/3,C.attributes=[{dirty:!0,name:"position",data:Float32Array.from(s),arrayStride:12,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float3"}]},{dirty:!0,name:"normal",data:Float32Array.from(u),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}(Ca))||Ju;var cc,fc,lc,hc,dc,pc,vc,gc,yc,mc,bc,_c,xc=(tc=(0,Le.b2)(),ec=(0,Le.f3)(Ue.RenderEngine),nc=(0,Le.f3)(Ue.ShaderModuleService),tc((sc=function(t){Ve(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=qe(e);if(n){var i=qe(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return He(this,t)});function i(){var t;we(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return xe(t=r.call.apply(r,[this].concat(n)),"engine",oc,Xe(t)),xe(t,"shaderModuleService",ac,Xe(t)),t}return Se(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:hn()}))}}]),i}(Is),oc=Ae((ic=sc).prototype,"engine",[ec],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ac=Ae(ic.prototype,"shaderModuleService",[nc],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),rc=ic))||rc);var wc,Ec,Sc,Ac,Tc,Ic,Cc,Dc,Nc,kc,Rc,Oc,Mc=(cc=(0,Le.b2)(),fc=(0,Le.f3)(Ue.Systems),lc=(0,Le.t6)(Ue.MaterialSystem),hc=(0,Le.f3)(Ue.Systems),dc=(0,Le.t6)(Ue.GeometrySystem),pc=(0,Le.f3)(Ue.ShaderModuleService),cc((_c=function(t){Ve(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=qe(e);if(n){var i=qe(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return He(this,t)});function i(){var t;we(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return xe(t=r.call.apply(r,[this].concat(n)),"materialSystem",yc,Xe(t)),xe(t,"geometrySystem",mc,Xe(t)),xe(t,"shaderModuleService",bc,Xe(t)),t}return Se(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:Gn.BACK}).setDepth({enable:!0,func:Gn.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}(Cs),yc=Ae((gc=_c).prototype,"materialSystem",[fc,lc],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),mc=Ae(gc.prototype,"geometrySystem",[hc,dc],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),bc=Ae(gc.prototype,"shaderModuleService",[pc],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),vc=gc))||vc),Pc=n(81602),Gc=n(91739);function Lc(t,e,n,r,i){Uc(e,r,-i),Uc(e,r,i),t.push(n),t.push(n)}function Uc(t,e,n){t.push([[e[0],e[1]],n])}var Fc,jc,Bc,zc,Vc,Wc,Xc,Hc,qc,Yc,Kc,Zc,$c=(wc=(0,Le.b2)(),Ec=(0,Le.f3)(Ue.Systems),Sc=(0,Le.t6)(Ue.MaterialSystem),Ac=(0,Le.f3)(Ue.Systems),Tc=(0,Le.t6)(Ue.GeometrySystem),Ic=(0,Le.f3)(Ue.ShaderModuleService),wc((Oc=function(t){Ve(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=qe(e);if(n){var i=qe(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return He(this,t)});function i(){var t;we(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return xe(t=r.call.apply(r,[this].concat(n)),"materialSystem",Nc,Xe(t)),xe(t,"geometrySystem",kc,Xe(t)),xe(t,"shaderModuleService",Rc,Xe(t)),t.vertexCount=void 0,t}return Se(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(qs(t),qs(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],s=-1,u=!1,c=null,f=(0,Pc.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,Gc.o7)(r,_,b),c||(c=[0,0],(0,Gc.mJ)(c,r)),u||(u=!0,Lc(d,h,b,c,1)),p.push([m+0,m+1,m+2]),x){(0,Gc.o7)(i,x,_);var w=(0,Gc.x7)(o,a,r,i,1),E=(0,Pc.dot)(o,c)<0?-1:1,S=w>3;if(!isFinite(w)){(0,Gc.mJ)(c,r),Lc(d,h,_,c,1),p.push(1===s?[m,m+2,m+3]:[m+2,m+1,m+3]),l+=2,s=E;continue}S?(w=3,v.push(y/g),Uc(h,c,-E),d.push(_),Uc(h,a,w*E),d.push(_),p.push(s!==-E?[m,m+2,m+3]:[m+2,m+1,m+3]),p.push([m+2,m+3,m+4]),(0,Gc.mJ)(f,i),(0,Pc.copy)(c,f),Uc(h,c,-E),d.push(_),l+=3):(Lc(d,h,_,a,w),p.push(1===s?[m,m+2,m+3]:[m+2,m+1,m+3]),E=-1,(0,Pc.copy)(c,a),l+=2),s=E}else(0,Gc.mJ)(c,r),Lc(d,h,_,c,1),p.push(1===s?[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),s=a.normals,u=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:Gn.BACK}).setUniform(i),this.setAttributes({dashArray:this.config.dashArray,dashOffset:this.config.dashOffset,dashRatio:this.config.dashRatio,thickness:this.config.thickness});var d=[],p=[];s.forEach((function(t){var e=t[0],n=t[1];d.push([e[0],e[1]]),p.push(n)})),h.setIndex(u.reduce((function(t,e){return[].concat(qs(t),qs(e))}),[])),h.setAttribute("a_pos",Float32Array.from(c.reduce((function(t,e){return[].concat(qs(t),qs(e))}),[])),{arrayStride:8,stepMode:"vertex",attributes:[{shaderLocation:0,offset:0,format:"float2"}]});var v=new Array(l).fill(void 0).map((function(){return qs(t.config.color)})).reduce((function(t,e){return[].concat(qs(t),qs(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(qs(t),qs(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}(Cs),Nc=Ae((Dc=Oc).prototype,"materialSystem",[Ec,Sc],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),kc=Ae(Dc.prototype,"geometrySystem",[Ac,Tc],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Rc=Ae(Dc.prototype,"shaderModuleService",[Ic],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Cc=Dc))||Cc);function Jc(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 Qc,tf,ef,nf,rf,of,af,sf,uf,cf,ff=["circle","triangle","square","pentagon","hexagon","octogon","hexagram","rhombus","vesica"],lf=(Fc=(0,Le.b2)(),jc=(0,Le.f3)(Ue.Systems),Bc=(0,Le.t6)(Ue.MaterialSystem),zc=(0,Le.f3)(Ue.Systems),Vc=(0,Le.t6)(Ue.GeometrySystem),Wc=(0,Le.f3)(Ue.ShaderModuleService),Fc((Zc=function(t){Ve(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=qe(e);if(n){var i=qe(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return He(this,t)});function i(){var t;we(this,i);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return xe(t=r.call.apply(r,[this].concat(n)),"materialSystem",qc,Xe(t)),xe(t,"geometrySystem",Yc,Xe(t)),xe(t,"shaderModuleService",Kc,Xe(t)),t}return Se(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:Gn.SRC_ALPHA,dstRGB:Gn.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?Jc(Object(n),!0).forEach((function(e){an(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Jc(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,s;(r=e.instancedPickingColors).push.apply(r,qs([(s=t.id||n)+1&255,s+1>>8&255,s+1>>8>>8&255])),e.instancedShapes.push(ff.indexOf(t.shape||"circle")),(i=e.instancedColors).push.apply(i,qs(t.color||[1,0,0,1])),(o=e.instancedOffsets).push.apply(o,qs(t.position||[0,0])),(a=e.instancedSizes).push.apply(a,qs(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}(Cs),qc=Ae((Hc=Zc).prototype,"materialSystem",[jc,Bc],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Yc=Ae(Hc.prototype,"geometrySystem",[zc,Vc],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Kc=Ae(Hc.prototype,"shaderModuleService",[Wc],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Xc=Hc))||Xc);function hf(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 df(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)?df(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,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function df(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 pf,vf,gf,yf,mf,bf,_f,xf,wf,Ef,Sf,Af,Tf=(Qc=(0,Le.b2)(),tf=(0,Le.f3)(Ue.RenderEngine),ef=(0,Le.f3)(Ue.ShaderModuleService),nf=(0,Le.f3)(Ue.ConfigService),Qc((cf=function(){function t(){we(this,t),this.container=void 0,xe(this,"engine",af,this),xe(this,"shaderModule",sf,this),xe(this,"configService",uf,this),this.inited=!1,this.rendering=!1,this.pendings=[],this.views=[],this.size=void 0}var e,n;return Se(t,[{key:"init",value:(n=De(Ie().mark((function t(){var e,n,r,i,o;return Ie().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(Ue.Systems),!(n=this.configService.get()).canvas){t.next=30;break}return t.next=11,this.engine.init({canvas:n.canvas,swapChainFormat:Da.EV.BGRA8Unorm,antialiasing:!1});case 11:r=hf(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=De(Ie().mark((function t(){var e,n,r,i,o,a,s,u=arguments;return Ie().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(Ue.Systems),n=u.length,r=new Array(n),i=0;i<n;i++)r[i]=u[i];o=hf(e),t.prev=8,o.s();case 10:if((a=o.n()).done){t.next=17;break}if(!(s=a.value).execute){t.next=15;break}return t.next=15,s.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}(),af=Ae((of=cf).prototype,"engine",[tf],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),sf=Ae(of.prototype,"shaderModule",[ef],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),uf=Ae(of.prototype,"configService",[nf],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),rf=of))||rf),If=(0,Le.b2)()((vf=function(){function t(){we(this,t),this.entities=[]}return Se(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}(),pf=vf))||pf,Cf=(0,Le.b2)()((yf=function(){function t(){we(this,t),this.cache={}}return Se(t,[{key:"get",value:function(t){return this.cache[t]}},{key:"set",value:function(t,e){this.cache[t]=e}}]),t}(),gf=yf))||gf;function Df(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?Df(Object(n),!0).forEach((function(e){an(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Df(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var kf,Rf,Of,Mf,Pf,Gf,Lf,Uf,Ff,jf,Bf,zf,Vf,Wf=(mf=(0,Le.b2)(),bf=(0,Le.f3)(Cf),_f=(0,Le.f3)(Ue.RenderEngine),mf((Af=function(){function t(){we(this,t),xe(this,"textureCache",Ef,this),xe(this,"engine",Sf,this),this.config=void 0,this.loaded=!1,this.texture=void 0}var e;return Se(t,[{key:"setConfig",value:function(t){this.config=t}},{key:"isLoaded",value:function(){return this.loaded}},{key:"load",value:(e=De(Ie().mark((function t(){var e=this;return Ie().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(Nf(Nf({},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}(),Ef=Ae((wf=Af).prototype,"textureCache",[bf],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Sf=Ae(wf.prototype,"engine",[_f],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),xf=wf))||xf),Xf=(kf=(0,Le.b2)(),Rf=(0,Le.f3)(Ue.Systems),Of=(0,Le.t6)(Ue.RendererSystem),kf((Lf=function(){function t(){we(this,t),xe(this,"rendererSystem",Gf,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 Se(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}(),Gf=Ae((Pf=Lf).prototype,"rendererSystem",[Rf,Of],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Mf=Pf))||Mf);function Hf(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 qf(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Hf(Object(n),!0).forEach((function(e){an(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Hf(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Yf=(Uf=(0,Le.b2)(),Ff=(0,Le.f3)(Ue.ConfigService),Uf((Vf=function(){function t(){we(this,t),xe(this,"configService",zf,this),this.container=void 0}var e;return Se(t,[{key:"getEngine",value:(e=De(Ie().mark((function t(){var e,n,r,i;return Ie().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.container.get(Ue.RenderEngine),n=this.configService.get(),r=n.canvas,i=n.engineOptions,t.next=4,e.init(qf({canvas:r||Na(),swapChainFormat:Da.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(Ue.TransformComponentManager).getComponentByEntity(t)}},{key:"getMeshComponent",value:function(t){return this.container.get(Ue.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 ke()}},{key:"createScene",value:function(){return this.container.get(If)}},{key:"createCamera",value:function(){return this.container.get(Ia)}},{key:"createView",value:function(){return this.container.get(Xf)}},{key:"createRenderable",value:function(t,e){var n=t?this.container.getNamed(Ue.Renderable,t):this.container.get(Cs),r=ke();return n.setConfig(e||{}),n.setEntity(r),n}},{key:"createGeometry",value:function(t,e){var n=this.container.getNamed(Ue.Geometry,t),r=ke();return n.setConfig(e||{}),n.setEntity(r),n.getComponent()}},{key:"createMaterial",value:function(t,e){var n=this.container.getNamed(Ue.Material,t),r=ke();return n.setConfig(e||{}),n.setEntity(r,t),n.getComponent()}},{key:"createTexture2D",value:function(t){var e=this.container.get(Wf);return e.setConfig(t),e}},{key:"createBufferGeometry",value:function(t){return this.container.getNamed(Ue.Systems,Ue.GeometrySystem).createBufferGeometry(t)}},{key:"createInstancedBufferGeometry",value:function(t){return this.container.getNamed(Ue.Systems,Ue.GeometrySystem).createInstancedBufferGeometry(t)}},{key:"createShaderMaterial",value:function(t){return this.container.getNamed(Ue.Systems,Ue.MaterialSystem).createShaderMaterial(t)}},{key:"createKernel",value:function(t){var e=this.container.get(Ts);return"string"==typeof t?e.setBundle(JSON.parse(t)):e.setBundle(t),e.init(),e}},{key:"createRenderer",value:function(){var t=this.container.get(Tf);return t.container=this.container,t.init(),t}},{key:"destroy",value:function(){this.container.getAll(Ue.Systems).forEach((function(t){t.tearDown&&t.tearDown()})),this.container.get(Ue.RenderEngine).destroy(),this.container.get(Ue.InteractorService).destroy()}}],[{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=Zo(),r=navigator.gpu?Hu:hu;n.isBound(Ue.RenderEngine)||n.bind(Ue.RenderEngine).to(r).inSingletonScope(),n.bind(Tf).toSelf(),n.bind(Ts).toSelf(),n.bind(Cs).toSelf(),n.bind(Xf).toSelf(),n.bind(Ia).toSelf(),n.bind(If).toSelf(),n.bind(t).toSelf(),n.bind(Cf).toSelf(),n.bind(Wf).toSelf(),n.bind(Ue.Geometry).to(Ku).whenTargetNamed(Ca.BOX),n.bind(Ue.Geometry).to(uc).whenTargetNamed(Ca.SPHERE),n.bind(Ue.Geometry).to(Qu).whenTargetNamed(Ca.PLANE),n.bind(Ue.Geometry).to($u).whenTargetNamed(Ca.MERGED),n.bind(Ue.Material).to(xc).whenTargetNamed(Is.BASIC),n.bind(Ue.Renderable).to(lf).whenTargetNamed(Cs.POINT),n.bind(Ue.Renderable).to($c).whenTargetNamed(Cs.LINE),n.bind(Ue.Renderable).to(Mc).whenTargetNamed(Cs.GRID);var i=n.get(t);return i.setContainer(n),i.setConfig(e),i}}]),t}(),zf=Ae((Bf=Vf).prototype,"configService",[Ff],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),jf=Bf))||jf),Kf=function(t,e){return t?a(t)?function(){return t}:t:function(){return e||1}},Zf=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)},$f=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)}}(),Jf=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},Qf=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:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){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,s])}}},tl=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 $f(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:1e3,gravity:10,speed:1,clustering:!1,clusterGravity:10}},e.prototype.execute=function(){return Jf(this,void 0,void 0,(function(){var t,e,n,r,i,o=this;return Qf(this,(function(s){switch(s.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 s.sent(),[2]}}))}))},e.prototype.executeWithWorker=function(t,e){return Jf(this,void 0,void 0,(function(){var n,r,i,o,s,u=this;return Qf(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={},s={},r.forEach((function(t,e){a(t.x)||(t.x=Math.random()*u.width),a(t.y)||(t.y=Math.random()*u.height),o[t.id]=t,s[t.id]=e})),n.nodeMap=o,n.nodeIdxMap=s,[4,n.run(t,e)]):[2];case 1:return c.sent(),[2]}}))}))},e.prototype.run=function(t,e){return Jf(this,void 0,void 0,(function(){var n,r,i,o,s,u,c,f,l,h,p,v,g,y,m,b,_,x,w,E,S,A,T,I,C,D,N=this;return Qf(this,(function(k){switch(k.label){case 0:for(r=(n=this).nodes,i=n.edges,o=n.maxIteration,s=n.center,u=n.height*n.width,c=Math.sqrt(u)/10,f=u/(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 s=e[o],u=d(s,"source"),c=d(s,"target");r[i[u]].push(i[c]),r[i[c]].push(i[u])}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?Yf.create({canvas:t,engineOptions:{supportCompute:!0}}):Yf.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:s,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 Jf(N,void 0,void 0,(function(){var n,i;return Qf(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),el=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)}}(),nl=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},rl=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:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){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,s])}}},il=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 el(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:2e3,gravity:10,clustering:!1,clusterGravity:10}},e.prototype.execute=function(){return nl(this,void 0,void 0,(function(){var t,e,n,r,i;return rl(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=Kf(t.nodeStrength,1),t.edgeStrength=Kf(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={},s={};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,s[t.id]=e})),n.nodeMap=o,n.nodeIdxMap=s,n.nodeStrength=Kf(n.nodeStrength,1),n.edgeStrength=Kf(n.edgeStrength,1),n.run(t,e)}},e.prototype.run=function(t,e){return nl(this,void 0,void 0,(function(){var n,r,i,o,s,u,c,f,l,h,v,g,y,m,b,_,x,w,E,S,A,T,I,C,D,N,k,R=this;return rl(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),s=r.length,n.linkDistance=Kf(n.linkDistance),n.edgeStrength=Kf(n.edgeStrength),u=function(t,e,n,r){var i=[],o=[],a={},s=0;for(s=0;s<t.length;s++){var u=t[s];a[u.id]=s,i.push(u.x),i.push(u.y),i.push(0),i.push(0),o.push([])}for(s=0;s<e.length;s++){var c=e[s],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(s=0;s<t.length;s++){var p=i.length,v=o[s],g=v.length;i[4*s+2]=p+1048576*g/4,i[4*s+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=u.maxEdgePerVetex,f=u.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=Zf([l,n.degrees,h,m]),E=Zf([v,g,y,b]),S=n.workerEnabled,A=S?Yf.create({canvas:t,engineOptions:{supportCompute:!0}}):Yf.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([s,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:s,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:s,u_AveMovement:[0,0,0,0]}),k=function(){return nl(R,void 0,void 0,(function(){var i,a,s;return rl(this,(function(u){switch(u.label){case 0:i=0,u.label=1;case 1:return i<o?[4,D.execute()]:[3,5];case 2:return u.sent(),N.setBinding({u_Data:D}),[4,N.execute()];case 3:u.sent(),a=Math.max(.02,n.interval-.002*i),D.setBinding({u_interval:a,u_AveMovement:N}),u.label=4;case 4:return i++,[3,1];case 5:return[4,D.getOutput()];case 6:return s=u.sent(),t?e.postMessage({type:It,vertexEdgeData:s}):r.forEach((function(t,e){var n=s[4*e],r=s[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),ol=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)}}(),al=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 ol(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 s=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()},u=0;u<n;u++)s();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={},s={},u={};n.forEach((function(t,e){s[t.id]=t,u[t.id]=e})),t.nodeMap=s,t.indexMap=u;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.indexMap,r=t.comboTrees,i=t.oriComboMap,o={};return(r||[]).forEach((function(r){var s=[];m(r,(function(r){if("node"===r.itemType)return!0;if(!i[r.id])return!0;if(void 0===o[r.id]){var u={id:r.id,name:r.id,cx:0,cy:0,count:0,depth:t.oriComboMap[r.id].depth||0,children:[]};o[r.id]=u}var c=r.children;c&&c.forEach((function(t){if(!o[t.id]&&!e[t.id])return!0;s.push(t)}));var f=o[r.id];if(f.cx=0,f.cy=0,0===s.length){f.empty=!0;var l=i[r.id],h=Object.keys(e).length,d=r.id+"-visual-child-"+h,p={id:d,x:l.x,y:l.y,depth:f.depth+1,itemType:"node"};t.nodes.push(p),e[d]=p,n[d]=h,f.cx=l.x,f.cy=l.y,s.push(p)}return s.forEach((function(t){if(f.count++,"node"!==t.itemType){var n=o[t.id];return a(n.cx)&&(f.cx+=n.cx),void(a(n.cy)&&(f.cy+=n.cy))}var r=e[t.id];r&&(a(r.x)&&(f.cx+=r.x),a(r.y)&&(f.cy+=r.y))})),f.cx/=f.count,f.cy/=f.count,f.children=s,!0}))})),o},e.prototype.applyComboCenterForce=function(t){var e=this,n=e.gravity,r=e.comboGravity||n,i=this.alpha,o=e.comboTrees,s=e.indexMap,u=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=u[e.id],p=d.x-f||.005,v=d.y-l||.005,g=Math.sqrt(p*p+v*v),y=s[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,n.cy/=n.count,!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,s=o*o+a*a,u=Math.sqrt(s);s<1&&(s=u),i[t.id+"-"+n.id]={vx:o,vy:a,vl2:s,vl:u},i[n.id+"-"+t.id]={vl2:s,vl:u,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,s=e.comboPadding;(n||[]).forEach((function(n){var u=[];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])&&u.push(e)})),c.minX=1/0,c.minY=1/0,c.maxX=-1/0,c.maxY=-1/0,u.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,s=e.x+n,u=e.y+n;c.minX>o&&(c.minX=o),c.minY>a&&(c.minY=a),c.maxX<s&&(c.maxX=s),c.maxY<u&&(c.maxY=u)}));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+s(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,s){if("node"===n.itemType)return!1;var u=e[n.id];u&&r.forEach((function(r,c){if(s<=c)return!1;if("node"===r.itemType)return!1;var f=e[r.id];if(!f)return!1;var l=u.cx-f.cx||.005,h=u.cy-f.cy||.005,d=l*l+h*h,p=u.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,s=n.nodeCollideStrength,u=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&&u){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*s,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,s=n.edgeStrength,u=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*s(r)*b,A=w*S,T=E*S,I=u[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),sl=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 ul=sl;const cl=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}(),fl=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 ll=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)}}(),hl=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 ll(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 s=[],u=e.length,c=0;c<u;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);s.push(p)}void 0===t.barnesHut&&u>250&&(t.barnesHut=!0),void 0===t.prune&&u>100&&(t.prune=!0),0!==this.maxIteration||t.prune?0===this.maxIteration&&r&&(i=100,u<=200&&u>100?i=500:u>200&&(i=950),this.maxIteration=i):(i=250,u<=200&&u>100?i=1e3:u>200&&(i=1200),this.maxIteration=i),t.kr||(t.kr=50,u>100&&u<=500?t.kr=20:u>500&&(t.kr=1)),t.kg||(t.kg=20,u>100&&u<=500?t.kg=10:u>500&&(t.kg=1)),this.nodes=t.updateNodesByForces(s),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,s=o.length,u=[],c={},f={},l=[],h=0;h<a;h+=1)c[i[h].id]=h,u[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<s;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&&(u[c[p.id]]+=1),v&&(u[c[v.id]]+=1)}var x=r;if(i=this.iterate(x,c,f,s,u,t),e.prune){for(m=0;m<s;m+=1)u[f[m].sourceIdx]<=1?(i[f[m].sourceIdx].x=i[f[m].targetIdx].x,i[f[m].sourceIdx].y=i[f[m].targetIdx].y):u[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,s,u,t)}return i},e.prototype.iterate=function(t,e,n,r,i,o){for(var a=this,s=a.nodes,u=a.kr,c=a.preventOverlap,f=a.barnesHut,l=s.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:s[y].x,ry:s[y].y,mass:1,g:u,degree:i[y]};g[y]=new ul(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);s=b.nodes,h=b.sg,d--,a.tick&&a.tick()}return s},e.prototype.getAttrForces=function(t,e,n,r,i,o,a,s){for(var u=this,c=u.nodes,f=u.preventOverlap,l=u.dissuadeHubs,h=u.mode,d=u.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=_),s[2*r[v.id]]+=x*b[0],s[2*r[y.id]]-=w*b[0],s[2*r[v.id]+1]+=x*b[1],s[2*r[y.id]+1]-=w*b[1]}}return s},e.prototype.getRepGraForces=function(t,e,n,r,i,o){for(var a=this,s=a.nodes,u=a.preventOverlap,c=a.kr,f=a.kg,l=a.center,h=a.prune,d=s.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=[s[v].x-s[p].x,s[v].y-s[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,u&&t<e&&(y=y-i[p]-i[v]);var m=c*(o[p]+1)*(o[v]+1)/y;u&&t<e&&y<0?m=r*(o[p]+1)*(o[v]+1):u&&t<e&&0===y?m=0:u&&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=[s[p].x-l[0],s[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,s=r.prune,u=i.length,c=9e10,f=-9e10,l=9e10,h=-9e10,d=0;d<u;d+=1)s&&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 cl({xmid:(f+c)/2,ymid:(h+l)/2,length:p,massCenter:a,mass:u}),g=new fl(v);for(d=0;d<u;d+=1)s&&n[d]<=1||e[d].in(v)&&g.insert(e[d]);for(d=0;d<u;d+=1)if(!(s&&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,s=i.tao,u=i.prune,c=i.ksmax,f=o.length,l=[],h=[],d=0,p=0,v=0;v<f;v+=1)if(!(u&&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=s*p/d,0!==_&&(n=n>1.5*_?1.5*_:n),v=0;v<f;v+=1)if(!(u&&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),dl=function(){return dl=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},dl.apply(this,arguments)},pl=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 s={dx:i,dy:a,x:i*this.CELL_W,y:a*this.CELL_H,occupied:!1};o.push(s)}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]=dl(dl({},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]=dl(dl({},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 vl=pl;var gl=1e7,yl=1.5707963267948966,ml=new Map,bl=.8;function _l(t,e){var n=(ml.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,s=o.x-o.size[0]/2,u=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>=s&&f>=h&&p>=u)0===(_=Math.sqrt(Math.pow(y-v,2)+Math.pow(m-g,2)))&&(_=1e-7),b=10/_*100+((c<d?c:d)-(s>l?s:l))*((f<p?f:p)-(u>h?u:h)),b*=gl;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,s=e.x-e.size[0]/2,u=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>yl?(m=i-f,y=s-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<=yl?(m=u-a)>(y=s-o)?parseFloat(m?(m/Math.cos(g)).toFixed(2):y.toFixed(2)):parseFloat(y?(y/Math.sin(g)).toFixed(2):m.toFixed(2)):g<-yl?(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=u-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/_:gl:(b+=_,n&&(b+=_*_))}return b}function xl(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+=_l(r,t[i])}return e}function wl(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 s=!0,u=0;u<a.length;u++){var c=a[u],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){s=!1;break}if(h&&!d||f*l<0){s=!1;break}if((c.x-t.x)*(c.x-e.x)<0){s=!1;break}if((c.y-t.y)*(c.y-e.y)<0){s=!1;break}}return s}function El(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],s=Sl(a,t),u=0;u<r.length;u++)if(wl(a,{x:a.x+r[u],y:a.y+i[u]},t,e)){a.x+=r[u],a.y+=i[u];var c=Sl(a,t),f=Math.random();c<s||f<bl&&f>.1?(s=c,n=!0):(a.x-=r[u],a.y-=i[u])}return bl>.1&&(bl*=.5),n?xl(t):0}function Sl(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+=_l(t,e[r]));return n}var Al=function(){return Al=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},Al.apply(this,arguments)};function Tl(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=Al({},t);delete e.size,a.push(e)}}));var s=[];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&&s.push(t)}));var u=new Lt({type:"dagre",ranksep:e.nodeMinGap,nodesep:e.nodeMinGap}).layout({nodes:a,edges:s}).nodes;n.forEach((function(t){var e=(u||[]).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 s.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}))),s=Math.max.apply(Math,n.map((function(t){return t.x}))),u=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/(s-a),h=o/(f-u);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-u)*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}));ml.set(t,n)})),t.sort((function(t,e){var n,r;return(null===(n=ml.get(t.id))||void 0===n?void 0:n.length)-(null===(r=ml.get(e.id))||void 0===r?void 0:r.length)}));for(var n=xl(t),r=20,i=1,o=0,a=0;r>0&&!(++a>=50);){var s=El(t,e);0!==s&&(o=s),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 s=new vl;s.init(n,r,{CELL_H:a,CELL_W:o}),t.nodes.forEach((function(t){var e=s.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 u=0;u<t.nodes.length;u++){var c=t.nodes[u],f=s.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&&s.additionColumn.indexOf(l+p+1)>-1&&!s.cells[l+p+1][h].node;p++)d--;s.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&&s.additionRow.indexOf(h+p+1)>-1&&!s.cells[l][h+p+1].node;p++)d--;s.insertRow(h,d)}}for(u=0;u<s.columnNum;u++){var g=function(e){var n=s.cells[u][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<s.rowNum;p++)g(p)}}({nodes:n,edges:r},e),t()}))}));return h}var Il=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)}}(),Cl=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 Il(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])})),Tl({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),Dl=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}(),Nl={force:Dt,fruchterman:_e,forceAtlas2:hl,gForce:k,dagre:Lt,circular:Ot,radial:pe,concentric:ge,grid:T,mds:me,comboForce:al,random:C,"gForce-gpu":il,"fruchterman-gpu":tl,er:Cl}})(),r})()}));
3
3
  //# sourceMappingURL=layout.min.js.map