@antv/g 1.0.0-alpha.33 → 1.0.0-alpha.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.umd.js +2 -17
- package/es/Canvas.d.ts +2 -1
- package/es/Canvas.js +8 -3
- package/es/DisplayObjectPool.d.ts +3 -3
- package/es/DisplayObjectPool.js +6 -6
- package/es/camera/Camera.js +28 -16
- package/es/components/Cullable.d.ts +1 -2
- package/es/components/Cullable.js +6 -14
- package/es/components/Geometry.d.ts +1 -2
- package/es/components/Geometry.js +3 -10
- package/es/components/Renderable.d.ts +1 -2
- package/es/components/Renderable.js +5 -13
- package/es/components/Sortable.d.ts +1 -2
- package/es/components/Sortable.js +3 -12
- package/es/components/Transform.d.ts +1 -2
- package/es/components/Transform.js +15 -22
- package/es/display-objects/DisplayObject.js +6 -9
- package/es/display-objects/HTML.js +1 -4
- package/es/display-objects/Polyline.d.ts +2 -0
- package/es/display-objects/Polyline.js +1 -1
- package/es/dom/Element.d.ts +7 -0
- package/es/dom/Element.js +10 -12
- package/es/dom/EventTarget.d.ts +0 -3
- package/es/dom/EventTarget.js +0 -6
- package/es/dom/KeyframeEffect.d.ts +0 -1
- package/es/dom/Node.js +1 -0
- package/es/dom/interfaces.d.ts +0 -2
- package/es/global-module.js +8 -6
- package/es/index.d.ts +1 -4
- package/es/index.js +2 -9
- package/es/plugins/CullingPlugin.js +2 -3
- package/es/plugins/DirtyCheckPlugin.js +1 -2
- package/es/plugins/FrustumCullingStrategy.js +2 -3
- package/es/plugins/PrepareRendererPlugin.js +13 -15
- package/es/property-handlers/aabb.js +4 -4
- package/es/property-handlers/anchor.js +3 -4
- package/es/property-handlers/clipPath.js +2 -2
- package/es/property-handlers/color.d.ts +3 -0
- package/es/property-handlers/color.js +6 -3
- package/es/property-handlers/index.d.ts +1 -0
- package/es/property-handlers/index.js +2 -1
- package/es/property-handlers/lineDash.d.ts +2 -0
- package/es/property-handlers/lineDash.js +8 -0
- package/es/property-handlers/zIndex.js +3 -4
- package/es/services/RenderingService.d.ts +15 -15
- package/es/services/RenderingService.js +5 -7
- package/es/services/SceneGraphService.d.ts +0 -2
- package/es/services/SceneGraphService.js +53 -89
- package/es/types.d.ts +1 -0
- package/es/utils/math.d.ts +1 -0
- package/es/utils/math.js +25 -0
- package/lib/Canvas.d.ts +2 -1
- package/lib/Canvas.js +8 -4
- package/lib/DisplayObjectPool.d.ts +3 -3
- package/lib/DisplayObjectPool.js +6 -6
- package/lib/camera/Camera.js +27 -15
- package/lib/components/Cullable.d.ts +1 -2
- package/lib/components/Cullable.js +6 -15
- package/lib/components/Geometry.d.ts +1 -2
- package/lib/components/Geometry.js +3 -11
- package/lib/components/Renderable.d.ts +1 -2
- package/lib/components/Renderable.js +5 -14
- package/lib/components/Sortable.d.ts +1 -2
- package/lib/components/Sortable.js +3 -13
- package/lib/components/Transform.d.ts +1 -2
- package/lib/components/Transform.js +15 -24
- package/lib/display-objects/DisplayObject.js +6 -11
- package/lib/display-objects/HTML.js +1 -5
- package/lib/display-objects/Polyline.d.ts +2 -0
- package/lib/display-objects/Polyline.js +2 -2
- package/lib/dom/Element.d.ts +7 -0
- package/lib/dom/Element.js +11 -12
- package/lib/dom/EventTarget.d.ts +0 -3
- package/lib/dom/EventTarget.js +0 -10
- package/lib/dom/KeyframeEffect.d.ts +0 -1
- package/lib/dom/Node.js +1 -0
- package/lib/dom/interfaces.d.ts +0 -2
- package/lib/global-module.js +7 -4
- package/lib/index.d.ts +1 -4
- package/lib/index.js +10 -28
- package/lib/plugins/CullingPlugin.js +2 -4
- package/lib/plugins/DirtyCheckPlugin.js +1 -3
- package/lib/plugins/FrustumCullingStrategy.js +2 -4
- package/lib/plugins/PrepareRendererPlugin.js +12 -14
- package/lib/property-handlers/aabb.js +4 -4
- package/lib/property-handlers/anchor.js +3 -5
- package/lib/property-handlers/clipPath.js +2 -2
- package/lib/property-handlers/color.d.ts +3 -0
- package/lib/property-handlers/color.js +6 -3
- package/lib/property-handlers/index.d.ts +1 -0
- package/lib/property-handlers/index.js +13 -0
- package/lib/property-handlers/lineDash.d.ts +2 -0
- package/lib/property-handlers/lineDash.js +15 -0
- package/lib/property-handlers/zIndex.js +3 -5
- package/lib/services/RenderingService.d.ts +15 -15
- package/lib/services/RenderingService.js +5 -8
- package/lib/services/SceneGraphService.d.ts +0 -2
- package/lib/services/SceneGraphService.js +53 -92
- package/lib/types.d.ts +1 -0
- package/lib/utils/math.d.ts +1 -0
- package/lib/utils/math.js +27 -0
- package/package.json +5 -7
package/dist/index.umd.js
CHANGED
|
@@ -1,19 +1,4 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.G=e():t.G=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=87)}([function(t,e,n){"use strict";n.r(e),n.d(e,"glMatrix",(function(){return r})),n.d(e,"mat2",(function(){return i})),n.d(e,"mat2d",(function(){return o})),n.d(e,"mat3",(function(){return a})),n.d(e,"mat4",(function(){return u})),n.d(e,"quat",(function(){return f})),n.d(e,"quat2",(function(){return l})),n.d(e,"vec2",(function(){return h})),n.d(e,"vec3",(function(){return s})),n.d(e,"vec4",(function(){return c}));var r={};n.r(r),n.d(r,"EPSILON",(function(){return d})),n.d(r,"ARRAY_TYPE",(function(){return p})),n.d(r,"RANDOM",(function(){return y})),n.d(r,"setMatrixArrayType",(function(){return v})),n.d(r,"toRadian",(function(){return m})),n.d(r,"equals",(function(){return b}));var i={};n.r(i),n.d(i,"create",(function(){return _})),n.d(i,"clone",(function(){return M})),n.d(i,"copy",(function(){return E})),n.d(i,"identity",(function(){return T})),n.d(i,"fromValues",(function(){return O})),n.d(i,"set",(function(){return w})),n.d(i,"transpose",(function(){return x})),n.d(i,"invert",(function(){return A})),n.d(i,"adjoint",(function(){return P})),n.d(i,"determinant",(function(){return C})),n.d(i,"multiply",(function(){return S})),n.d(i,"rotate",(function(){return N})),n.d(i,"scale",(function(){return j})),n.d(i,"fromRotation",(function(){return I})),n.d(i,"fromScaling",(function(){return R})),n.d(i,"str",(function(){return k})),n.d(i,"frob",(function(){return D})),n.d(i,"LDU",(function(){return B})),n.d(i,"add",(function(){return L})),n.d(i,"subtract",(function(){return F})),n.d(i,"exactEquals",(function(){return V})),n.d(i,"equals",(function(){return G})),n.d(i,"multiplyScalar",(function(){return q})),n.d(i,"multiplyScalarAndAdd",(function(){return U})),n.d(i,"mul",(function(){return W})),n.d(i,"sub",(function(){return z}));var o={};n.r(o),n.d(o,"create",(function(){return H})),n.d(o,"clone",(function(){return Y})),n.d(o,"copy",(function(){return $})),n.d(o,"identity",(function(){return X})),n.d(o,"fromValues",(function(){return K})),n.d(o,"set",(function(){return J})),n.d(o,"invert",(function(){return Z})),n.d(o,"determinant",(function(){return Q})),n.d(o,"multiply",(function(){return tt})),n.d(o,"rotate",(function(){return et})),n.d(o,"scale",(function(){return nt})),n.d(o,"translate",(function(){return rt})),n.d(o,"fromRotation",(function(){return it})),n.d(o,"fromScaling",(function(){return ot})),n.d(o,"fromTranslation",(function(){return at})),n.d(o,"str",(function(){return ut})),n.d(o,"frob",(function(){return st})),n.d(o,"add",(function(){return ct})),n.d(o,"subtract",(function(){return ft})),n.d(o,"multiplyScalar",(function(){return lt})),n.d(o,"multiplyScalarAndAdd",(function(){return ht})),n.d(o,"exactEquals",(function(){return dt})),n.d(o,"equals",(function(){return pt})),n.d(o,"mul",(function(){return yt})),n.d(o,"sub",(function(){return vt}));var a={};n.r(a),n.d(a,"create",(function(){return gt})),n.d(a,"fromMat4",(function(){return mt})),n.d(a,"clone",(function(){return bt})),n.d(a,"copy",(function(){return _t})),n.d(a,"fromValues",(function(){return Mt})),n.d(a,"set",(function(){return Et})),n.d(a,"identity",(function(){return Tt})),n.d(a,"transpose",(function(){return Ot})),n.d(a,"invert",(function(){return wt})),n.d(a,"adjoint",(function(){return xt})),n.d(a,"determinant",(function(){return At})),n.d(a,"multiply",(function(){return Pt})),n.d(a,"translate",(function(){return Ct})),n.d(a,"rotate",(function(){return St})),n.d(a,"scale",(function(){return Nt})),n.d(a,"fromTranslation",(function(){return jt})),n.d(a,"fromRotation",(function(){return It})),n.d(a,"fromScaling",(function(){return Rt})),n.d(a,"fromMat2d",(function(){return kt})),n.d(a,"fromQuat",(function(){return Dt})),n.d(a,"normalFromMat4",(function(){return Bt})),n.d(a,"projection",(function(){return Lt})),n.d(a,"str",(function(){return Ft})),n.d(a,"frob",(function(){return Vt})),n.d(a,"add",(function(){return Gt})),n.d(a,"subtract",(function(){return qt})),n.d(a,"multiplyScalar",(function(){return Ut})),n.d(a,"multiplyScalarAndAdd",(function(){return Wt})),n.d(a,"exactEquals",(function(){return zt})),n.d(a,"equals",(function(){return Ht})),n.d(a,"mul",(function(){return Yt})),n.d(a,"sub",(function(){return $t}));var u={};n.r(u),n.d(u,"create",(function(){return Xt})),n.d(u,"clone",(function(){return Kt})),n.d(u,"copy",(function(){return Jt})),n.d(u,"fromValues",(function(){return Zt})),n.d(u,"set",(function(){return Qt})),n.d(u,"identity",(function(){return te})),n.d(u,"transpose",(function(){return ee})),n.d(u,"invert",(function(){return ne})),n.d(u,"adjoint",(function(){return re})),n.d(u,"determinant",(function(){return ie})),n.d(u,"multiply",(function(){return oe})),n.d(u,"translate",(function(){return ae})),n.d(u,"scale",(function(){return ue})),n.d(u,"rotate",(function(){return se})),n.d(u,"rotateX",(function(){return ce})),n.d(u,"rotateY",(function(){return fe})),n.d(u,"rotateZ",(function(){return le})),n.d(u,"fromTranslation",(function(){return he})),n.d(u,"fromScaling",(function(){return de})),n.d(u,"fromRotation",(function(){return pe})),n.d(u,"fromXRotation",(function(){return ye})),n.d(u,"fromYRotation",(function(){return ve})),n.d(u,"fromZRotation",(function(){return ge})),n.d(u,"fromRotationTranslation",(function(){return me})),n.d(u,"fromQuat2",(function(){return be})),n.d(u,"getTranslation",(function(){return _e})),n.d(u,"getScaling",(function(){return Me})),n.d(u,"getRotation",(function(){return Ee})),n.d(u,"fromRotationTranslationScale",(function(){return Te})),n.d(u,"fromRotationTranslationScaleOrigin",(function(){return Oe})),n.d(u,"fromQuat",(function(){return we})),n.d(u,"frustum",(function(){return xe})),n.d(u,"perspectiveNO",(function(){return Ae})),n.d(u,"perspective",(function(){return Pe})),n.d(u,"perspectiveZO",(function(){return Ce})),n.d(u,"perspectiveFromFieldOfView",(function(){return Se})),n.d(u,"orthoNO",(function(){return Ne})),n.d(u,"ortho",(function(){return je})),n.d(u,"orthoZO",(function(){return Ie})),n.d(u,"lookAt",(function(){return Re})),n.d(u,"targetTo",(function(){return ke})),n.d(u,"str",(function(){return De})),n.d(u,"frob",(function(){return Be})),n.d(u,"add",(function(){return Le})),n.d(u,"subtract",(function(){return Fe})),n.d(u,"multiplyScalar",(function(){return Ve})),n.d(u,"multiplyScalarAndAdd",(function(){return Ge})),n.d(u,"exactEquals",(function(){return qe})),n.d(u,"equals",(function(){return Ue})),n.d(u,"mul",(function(){return We})),n.d(u,"sub",(function(){return ze}));var s={};n.r(s),n.d(s,"create",(function(){return He})),n.d(s,"clone",(function(){return Ye})),n.d(s,"length",(function(){return $e})),n.d(s,"fromValues",(function(){return Xe})),n.d(s,"copy",(function(){return Ke})),n.d(s,"set",(function(){return Je})),n.d(s,"add",(function(){return Ze})),n.d(s,"subtract",(function(){return Qe})),n.d(s,"multiply",(function(){return tn})),n.d(s,"divide",(function(){return en})),n.d(s,"ceil",(function(){return nn})),n.d(s,"floor",(function(){return rn})),n.d(s,"min",(function(){return on})),n.d(s,"max",(function(){return an})),n.d(s,"round",(function(){return un})),n.d(s,"scale",(function(){return sn})),n.d(s,"scaleAndAdd",(function(){return cn})),n.d(s,"distance",(function(){return fn})),n.d(s,"squaredDistance",(function(){return ln})),n.d(s,"squaredLength",(function(){return hn})),n.d(s,"negate",(function(){return dn})),n.d(s,"inverse",(function(){return pn})),n.d(s,"normalize",(function(){return yn})),n.d(s,"dot",(function(){return vn})),n.d(s,"cross",(function(){return gn})),n.d(s,"lerp",(function(){return mn})),n.d(s,"hermite",(function(){return bn})),n.d(s,"bezier",(function(){return _n})),n.d(s,"random",(function(){return Mn})),n.d(s,"transformMat4",(function(){return En})),n.d(s,"transformMat3",(function(){return Tn})),n.d(s,"transformQuat",(function(){return On})),n.d(s,"rotateX",(function(){return wn})),n.d(s,"rotateY",(function(){return xn})),n.d(s,"rotateZ",(function(){return An})),n.d(s,"angle",(function(){return Pn})),n.d(s,"zero",(function(){return Cn})),n.d(s,"str",(function(){return Sn})),n.d(s,"exactEquals",(function(){return Nn})),n.d(s,"equals",(function(){return jn})),n.d(s,"sub",(function(){return Rn})),n.d(s,"mul",(function(){return kn})),n.d(s,"div",(function(){return Dn})),n.d(s,"dist",(function(){return Bn})),n.d(s,"sqrDist",(function(){return Ln})),n.d(s,"len",(function(){return Fn})),n.d(s,"sqrLen",(function(){return Vn})),n.d(s,"forEach",(function(){return Gn}));var c={};n.r(c),n.d(c,"create",(function(){return qn})),n.d(c,"clone",(function(){return Un})),n.d(c,"fromValues",(function(){return Wn})),n.d(c,"copy",(function(){return zn})),n.d(c,"set",(function(){return Hn})),n.d(c,"add",(function(){return Yn})),n.d(c,"subtract",(function(){return $n})),n.d(c,"multiply",(function(){return Xn})),n.d(c,"divide",(function(){return Kn})),n.d(c,"ceil",(function(){return Jn})),n.d(c,"floor",(function(){return Zn})),n.d(c,"min",(function(){return Qn})),n.d(c,"max",(function(){return tr})),n.d(c,"round",(function(){return er})),n.d(c,"scale",(function(){return nr})),n.d(c,"scaleAndAdd",(function(){return rr})),n.d(c,"distance",(function(){return ir})),n.d(c,"squaredDistance",(function(){return or})),n.d(c,"length",(function(){return ar})),n.d(c,"squaredLength",(function(){return ur})),n.d(c,"negate",(function(){return sr})),n.d(c,"inverse",(function(){return cr})),n.d(c,"normalize",(function(){return fr})),n.d(c,"dot",(function(){return lr})),n.d(c,"cross",(function(){return hr})),n.d(c,"lerp",(function(){return dr})),n.d(c,"random",(function(){return pr})),n.d(c,"transformMat4",(function(){return yr})),n.d(c,"transformQuat",(function(){return vr})),n.d(c,"zero",(function(){return gr})),n.d(c,"str",(function(){return mr})),n.d(c,"exactEquals",(function(){return br})),n.d(c,"equals",(function(){return _r})),n.d(c,"sub",(function(){return Mr})),n.d(c,"mul",(function(){return Er})),n.d(c,"div",(function(){return Tr})),n.d(c,"dist",(function(){return Or})),n.d(c,"sqrDist",(function(){return wr})),n.d(c,"len",(function(){return xr})),n.d(c,"sqrLen",(function(){return Ar})),n.d(c,"forEach",(function(){return Pr}));var f={};n.r(f),n.d(f,"create",(function(){return Cr})),n.d(f,"identity",(function(){return Sr})),n.d(f,"setAxisAngle",(function(){return Nr})),n.d(f,"getAxisAngle",(function(){return jr})),n.d(f,"getAngle",(function(){return Ir})),n.d(f,"multiply",(function(){return Rr})),n.d(f,"rotateX",(function(){return kr})),n.d(f,"rotateY",(function(){return Dr})),n.d(f,"rotateZ",(function(){return Br})),n.d(f,"calculateW",(function(){return Lr})),n.d(f,"exp",(function(){return Fr})),n.d(f,"ln",(function(){return Vr})),n.d(f,"pow",(function(){return Gr})),n.d(f,"slerp",(function(){return qr})),n.d(f,"random",(function(){return Ur})),n.d(f,"invert",(function(){return Wr})),n.d(f,"conjugate",(function(){return zr})),n.d(f,"fromMat3",(function(){return Hr})),n.d(f,"fromEuler",(function(){return Yr})),n.d(f,"str",(function(){return $r})),n.d(f,"clone",(function(){return ei})),n.d(f,"fromValues",(function(){return ni})),n.d(f,"copy",(function(){return ri})),n.d(f,"set",(function(){return ii})),n.d(f,"add",(function(){return oi})),n.d(f,"mul",(function(){return ai})),n.d(f,"scale",(function(){return ui})),n.d(f,"dot",(function(){return si})),n.d(f,"lerp",(function(){return ci})),n.d(f,"length",(function(){return fi})),n.d(f,"len",(function(){return li})),n.d(f,"squaredLength",(function(){return hi})),n.d(f,"sqrLen",(function(){return di})),n.d(f,"normalize",(function(){return pi})),n.d(f,"exactEquals",(function(){return yi})),n.d(f,"equals",(function(){return vi})),n.d(f,"rotationTo",(function(){return gi})),n.d(f,"sqlerp",(function(){return mi})),n.d(f,"setAxes",(function(){return bi}));var l={};n.r(l),n.d(l,"create",(function(){return _i})),n.d(l,"clone",(function(){return Mi})),n.d(l,"fromValues",(function(){return Ei})),n.d(l,"fromRotationTranslationValues",(function(){return Ti})),n.d(l,"fromRotationTranslation",(function(){return Oi})),n.d(l,"fromTranslation",(function(){return wi})),n.d(l,"fromRotation",(function(){return xi})),n.d(l,"fromMat4",(function(){return Ai})),n.d(l,"copy",(function(){return Pi})),n.d(l,"identity",(function(){return Ci})),n.d(l,"set",(function(){return Si})),n.d(l,"getReal",(function(){return Ni})),n.d(l,"getDual",(function(){return ji})),n.d(l,"setReal",(function(){return Ii})),n.d(l,"setDual",(function(){return Ri})),n.d(l,"getTranslation",(function(){return ki})),n.d(l,"translate",(function(){return Di})),n.d(l,"rotateX",(function(){return Bi})),n.d(l,"rotateY",(function(){return Li})),n.d(l,"rotateZ",(function(){return Fi})),n.d(l,"rotateByQuatAppend",(function(){return Vi})),n.d(l,"rotateByQuatPrepend",(function(){return Gi})),n.d(l,"rotateAroundAxis",(function(){return qi})),n.d(l,"add",(function(){return Ui})),n.d(l,"multiply",(function(){return Wi})),n.d(l,"mul",(function(){return zi})),n.d(l,"scale",(function(){return Hi})),n.d(l,"dot",(function(){return Yi})),n.d(l,"lerp",(function(){return $i})),n.d(l,"invert",(function(){return Xi})),n.d(l,"conjugate",(function(){return Ki})),n.d(l,"length",(function(){return Ji})),n.d(l,"len",(function(){return Zi})),n.d(l,"squaredLength",(function(){return Qi})),n.d(l,"sqrLen",(function(){return to})),n.d(l,"normalize",(function(){return eo})),n.d(l,"str",(function(){return no})),n.d(l,"exactEquals",(function(){return ro})),n.d(l,"equals",(function(){return io}));var h={};n.r(h),n.d(h,"create",(function(){return oo})),n.d(h,"clone",(function(){return ao})),n.d(h,"fromValues",(function(){return uo})),n.d(h,"copy",(function(){return so})),n.d(h,"set",(function(){return co})),n.d(h,"add",(function(){return fo})),n.d(h,"subtract",(function(){return lo})),n.d(h,"multiply",(function(){return ho})),n.d(h,"divide",(function(){return po})),n.d(h,"ceil",(function(){return yo})),n.d(h,"floor",(function(){return vo})),n.d(h,"min",(function(){return go})),n.d(h,"max",(function(){return mo})),n.d(h,"round",(function(){return bo})),n.d(h,"scale",(function(){return _o})),n.d(h,"scaleAndAdd",(function(){return Mo})),n.d(h,"distance",(function(){return Eo})),n.d(h,"squaredDistance",(function(){return To})),n.d(h,"length",(function(){return Oo})),n.d(h,"squaredLength",(function(){return wo})),n.d(h,"negate",(function(){return xo})),n.d(h,"inverse",(function(){return Ao})),n.d(h,"normalize",(function(){return Po})),n.d(h,"dot",(function(){return Co})),n.d(h,"cross",(function(){return So})),n.d(h,"lerp",(function(){return No})),n.d(h,"random",(function(){return jo})),n.d(h,"transformMat2",(function(){return Io})),n.d(h,"transformMat2d",(function(){return Ro})),n.d(h,"transformMat3",(function(){return ko})),n.d(h,"transformMat4",(function(){return Do})),n.d(h,"rotate",(function(){return Bo})),n.d(h,"angle",(function(){return Lo})),n.d(h,"zero",(function(){return Fo})),n.d(h,"str",(function(){return Vo})),n.d(h,"exactEquals",(function(){return Go})),n.d(h,"equals",(function(){return qo})),n.d(h,"len",(function(){return Uo})),n.d(h,"sub",(function(){return Wo})),n.d(h,"mul",(function(){return zo})),n.d(h,"div",(function(){return Ho})),n.d(h,"dist",(function(){return Yo})),n.d(h,"sqrDist",(function(){return $o})),n.d(h,"sqrLen",(function(){return Xo})),n.d(h,"forEach",(function(){return Ko}));var d=1e-6,p="undefined"!=typeof Float32Array?Float32Array:Array,y=Math.random;function v(t){p=t}var g=Math.PI/180;function m(t){return t*g}function b(t,e){return Math.abs(t-e)<=d*Math.max(1,Math.abs(t),Math.abs(e))}function _(){var t=new p(4);return p!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}function M(t){var e=new p(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function E(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function T(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function O(t,e,n,r){var i=new p(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i}function w(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t}function x(t,e){if(t===e){var n=e[1];t[1]=e[2],t[2]=n}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t}function A(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*o-i*r;return a?(a=1/a,t[0]=o*a,t[1]=-r*a,t[2]=-i*a,t[3]=n*a,t):null}function P(t,e){var n=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=n,t}function C(t){return t[0]*t[3]-t[2]*t[1]}function S(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*u+o*s,t[1]=i*u+a*s,t[2]=r*c+o*f,t[3]=i*c+a*f,t}function N(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],u=Math.sin(n),s=Math.cos(n);return t[0]=r*s+o*u,t[1]=i*s+a*u,t[2]=r*-u+o*s,t[3]=i*-u+a*s,t}function j(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],u=n[0],s=n[1];return t[0]=r*u,t[1]=i*u,t[2]=o*s,t[3]=a*s,t}function I(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=-n,t[3]=r,t}function R(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t}function k(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function D(t){return Math.hypot(t[0],t[1],t[2],t[3])}function B(t,e,n,r){return t[2]=r[2]/r[0],n[0]=r[0],n[1]=r[1],n[3]=r[3]-t[2]*n[1],[t,e,n]}function L(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t}function F(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}function V(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function G(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=e[0],u=e[1],s=e[2],c=e[3];return Math.abs(n-a)<=d*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-u)<=d*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(i-s)<=d*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(o-c)<=d*Math.max(1,Math.abs(o),Math.abs(c))}function q(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t}function U(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var W=S,z=F;function H(){var t=new p(6);return p!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t}function Y(t){var e=new p(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function $(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}function X(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function K(t,e,n,r,i,o){var a=new p(6);return a[0]=t,a[1]=e,a[2]=n,a[3]=r,a[4]=i,a[5]=o,a}function J(t,e,n,r,i,o,a){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t}function Z(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],u=e[5],s=n*o-r*i;return s?(s=1/s,t[0]=o*s,t[1]=-r*s,t[2]=-i*s,t[3]=n*s,t[4]=(i*u-o*a)*s,t[5]=(r*a-n*u)*s,t):null}function Q(t){return t[0]*t[3]-t[1]*t[2]}function tt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],u=e[4],s=e[5],c=n[0],f=n[1],l=n[2],h=n[3],d=n[4],p=n[5];return t[0]=r*c+o*f,t[1]=i*c+a*f,t[2]=r*l+o*h,t[3]=i*l+a*h,t[4]=r*d+o*p+u,t[5]=i*d+a*p+s,t}function et(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],u=e[4],s=e[5],c=Math.sin(n),f=Math.cos(n);return t[0]=r*f+o*c,t[1]=i*f+a*c,t[2]=r*-c+o*f,t[3]=i*-c+a*f,t[4]=u,t[5]=s,t}function nt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],u=e[4],s=e[5],c=n[0],f=n[1];return t[0]=r*c,t[1]=i*c,t[2]=o*f,t[3]=a*f,t[4]=u,t[5]=s,t}function rt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],u=e[4],s=e[5],c=n[0],f=n[1];return t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=r*c+o*f+u,t[5]=i*c+a*f+s,t}function it(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=-n,t[3]=r,t[4]=0,t[5]=0,t}function ot(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t}function at(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function ut(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"}function st(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],1)}function ct(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t}function ft(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t}function lt(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t}function ht(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t}function dt(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]}function pt(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],u=t[5],s=e[0],c=e[1],f=e[2],l=e[3],h=e[4],p=e[5];return Math.abs(n-s)<=d*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(r-c)<=d*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(i-f)<=d*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(o-l)<=d*Math.max(1,Math.abs(o),Math.abs(l))&&Math.abs(a-h)<=d*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(u-p)<=d*Math.max(1,Math.abs(u),Math.abs(p))}var yt=tt,vt=ft;function gt(){var t=new p(9);return p!=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 mt(t,e){return 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}function bt(t){var e=new p(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function _t(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}function Mt(t,e,n,r,i,o,a,u,s){var c=new p(9);return c[0]=t,c[1]=e,c[2]=n,c[3]=r,c[4]=i,c[5]=o,c[6]=a,c[7]=u,c[8]=s,c}function Et(t,e,n,r,i,o,a,u,s,c){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=u,t[7]=s,t[8]=c,t}function Tt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Ot(t,e){if(t===e){var n=e[1],r=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function wt(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=f*a-u*c,h=-f*o+u*s,d=c*o-a*s,p=n*l+r*h+i*d;return p?(p=1/p,t[0]=l*p,t[1]=(-f*r+i*c)*p,t[2]=(u*r-i*a)*p,t[3]=h*p,t[4]=(f*n-i*s)*p,t[5]=(-u*n+i*o)*p,t[6]=d*p,t[7]=(-c*n+r*s)*p,t[8]=(a*n-r*o)*p,t):null}function xt(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];return t[0]=a*f-u*c,t[1]=i*c-r*f,t[2]=r*u-i*a,t[3]=u*s-o*f,t[4]=n*f-i*s,t[5]=i*o-n*u,t[6]=o*c-a*s,t[7]=r*s-n*c,t[8]=n*a-r*o,t}function At(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],u=t[6],s=t[7],c=t[8];return e*(c*o-a*s)+n*(-c*i+a*u)+r*(s*i-o*u)}function Pt(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=n[0],d=n[1],p=n[2],y=n[3],v=n[4],g=n[5],m=n[6],b=n[7],_=n[8];return t[0]=h*r+d*a+p*c,t[1]=h*i+d*u+p*f,t[2]=h*o+d*s+p*l,t[3]=y*r+v*a+g*c,t[4]=y*i+v*u+g*f,t[5]=y*o+v*s+g*l,t[6]=m*r+b*a+_*c,t[7]=m*i+b*u+_*f,t[8]=m*o+b*s+_*l,t}function Ct(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=n[0],d=n[1];return t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=u,t[5]=s,t[6]=h*r+d*a+c,t[7]=h*i+d*u+f,t[8]=h*o+d*s+l,t}function St(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=Math.sin(n),d=Math.cos(n);return t[0]=d*r+h*a,t[1]=d*i+h*u,t[2]=d*o+h*s,t[3]=d*a-h*r,t[4]=d*u-h*i,t[5]=d*s-h*o,t[6]=c,t[7]=f,t[8]=l,t}function Nt(t,e,n){var r=n[0],i=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function jt(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function It(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Rt(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function kt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function Dt(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,y=o*a,v=o*u,g=o*s;return t[0]=1-l-p,t[3]=f-g,t[6]=h+v,t[1]=f+g,t[4]=1-c-p,t[7]=d-y,t[2]=h-v,t[5]=d+y,t[8]=1-c-l,t}function Bt(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],y=e[13],v=e[14],g=e[15],m=n*u-r*a,b=n*s-i*a,_=n*c-o*a,M=r*s-i*u,E=r*c-o*u,T=i*c-o*s,O=f*y-l*p,w=f*v-h*p,x=f*g-d*p,A=l*v-h*y,P=l*g-d*y,C=h*g-d*v,S=m*C-b*P+_*A+M*x-E*w+T*O;return S?(S=1/S,t[0]=(u*C-s*P+c*A)*S,t[1]=(s*x-a*C-c*w)*S,t[2]=(a*P-u*x+c*O)*S,t[3]=(i*P-r*C-o*A)*S,t[4]=(n*C-i*x+o*w)*S,t[5]=(r*x-n*P-o*O)*S,t[6]=(y*T-v*E+g*M)*S,t[7]=(v*_-p*T-g*b)*S,t[8]=(p*E-y*_+g*m)*S,t):null}function Lt(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function Ft(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function Vt(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function Gt(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t}function qt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t}function Ut(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t}function Wt(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t}function zt(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]}function Ht(t,e){var n=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=e[0],h=e[1],p=e[2],y=e[3],v=e[4],g=e[5],m=e[6],b=e[7],_=e[8];return Math.abs(n-l)<=d*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(r-h)<=d*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(i-p)<=d*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(o-y)<=d*Math.max(1,Math.abs(o),Math.abs(y))&&Math.abs(a-v)<=d*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(u-g)<=d*Math.max(1,Math.abs(u),Math.abs(g))&&Math.abs(s-m)<=d*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(c-b)<=d*Math.max(1,Math.abs(c),Math.abs(b))&&Math.abs(f-_)<=d*Math.max(1,Math.abs(f),Math.abs(_))}var Yt=Pt,$t=qt;function Xt(){var t=new p(16);return p!=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 Kt(t){var e=new p(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Jt(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 Zt(t,e,n,r,i,o,a,u,s,c,f,l,h,d,y,v){var g=new p(16);return g[0]=t,g[1]=e,g[2]=n,g[3]=r,g[4]=i,g[5]=o,g[6]=a,g[7]=u,g[8]=s,g[9]=c,g[10]=f,g[11]=l,g[12]=h,g[13]=d,g[14]=y,g[15]=v,g}function Qt(t,e,n,r,i,o,a,u,s,c,f,l,h,d,p,y,v){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=u,t[7]=s,t[8]=c,t[9]=f,t[10]=l,t[11]=h,t[12]=d,t[13]=p,t[14]=y,t[15]=v,t}function te(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 ee(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],a=e[7],u=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=u}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function ne(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],y=e[13],v=e[14],g=e[15],m=n*u-r*a,b=n*s-i*a,_=n*c-o*a,M=r*s-i*u,E=r*c-o*u,T=i*c-o*s,O=f*y-l*p,w=f*v-h*p,x=f*g-d*p,A=l*v-h*y,P=l*g-d*y,C=h*g-d*v,S=m*C-b*P+_*A+M*x-E*w+T*O;return S?(S=1/S,t[0]=(u*C-s*P+c*A)*S,t[1]=(i*P-r*C-o*A)*S,t[2]=(y*T-v*E+g*M)*S,t[3]=(h*E-l*T-d*M)*S,t[4]=(s*x-a*C-c*w)*S,t[5]=(n*C-i*x+o*w)*S,t[6]=(v*_-p*T-g*b)*S,t[7]=(f*T-h*_+d*b)*S,t[8]=(a*P-u*x+c*O)*S,t[9]=(r*x-n*P-o*O)*S,t[10]=(p*E-y*_+g*m)*S,t[11]=(l*_-f*E-d*m)*S,t[12]=(u*w-a*A-s*O)*S,t[13]=(n*A-r*w+i*O)*S,t[14]=(y*b-p*M-v*m)*S,t[15]=(f*M-l*b+h*m)*S,t):null}function re(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],y=e[13],v=e[14],g=e[15];return t[0]=u*(h*g-d*v)-l*(s*g-c*v)+y*(s*d-c*h),t[1]=-(r*(h*g-d*v)-l*(i*g-o*v)+y*(i*d-o*h)),t[2]=r*(s*g-c*v)-u*(i*g-o*v)+y*(i*c-o*s),t[3]=-(r*(s*d-c*h)-u*(i*d-o*h)+l*(i*c-o*s)),t[4]=-(a*(h*g-d*v)-f*(s*g-c*v)+p*(s*d-c*h)),t[5]=n*(h*g-d*v)-f*(i*g-o*v)+p*(i*d-o*h),t[6]=-(n*(s*g-c*v)-a*(i*g-o*v)+p*(i*c-o*s)),t[7]=n*(s*d-c*h)-a*(i*d-o*h)+f*(i*c-o*s),t[8]=a*(l*g-d*y)-f*(u*g-c*y)+p*(u*d-c*l),t[9]=-(n*(l*g-d*y)-f*(r*g-o*y)+p*(r*d-o*l)),t[10]=n*(u*g-c*y)-a*(r*g-o*y)+p*(r*c-o*u),t[11]=-(n*(u*d-c*l)-a*(r*d-o*l)+f*(r*c-o*u)),t[12]=-(a*(l*v-h*y)-f*(u*v-s*y)+p*(u*h-s*l)),t[13]=n*(l*v-h*y)-f*(r*v-i*y)+p*(r*h-i*l),t[14]=-(n*(u*v-s*y)-a*(r*v-i*y)+p*(r*s-i*u)),t[15]=n*(u*h-s*l)-a*(r*h-i*l)+f*(r*s-i*u),t}function ie(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],u=t[6],s=t[7],c=t[8],f=t[9],l=t[10],h=t[11],d=t[12],p=t[13],y=t[14],v=t[15];return(e*a-n*o)*(l*v-h*y)-(e*u-r*o)*(f*v-h*p)+(e*s-i*o)*(f*y-l*p)+(n*u-r*a)*(c*v-h*d)-(n*s-i*a)*(c*y-l*d)+(r*s-i*u)*(c*p-f*d)}function oe(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],y=e[12],v=e[13],g=e[14],m=e[15],b=n[0],_=n[1],M=n[2],E=n[3];return t[0]=b*r+_*u+M*l+E*y,t[1]=b*i+_*s+M*h+E*v,t[2]=b*o+_*c+M*d+E*g,t[3]=b*a+_*f+M*p+E*m,b=n[4],_=n[5],M=n[6],E=n[7],t[4]=b*r+_*u+M*l+E*y,t[5]=b*i+_*s+M*h+E*v,t[6]=b*o+_*c+M*d+E*g,t[7]=b*a+_*f+M*p+E*m,b=n[8],_=n[9],M=n[10],E=n[11],t[8]=b*r+_*u+M*l+E*y,t[9]=b*i+_*s+M*h+E*v,t[10]=b*o+_*c+M*d+E*g,t[11]=b*a+_*f+M*p+E*m,b=n[12],_=n[13],M=n[14],E=n[15],t[12]=b*r+_*u+M*l+E*y,t[13]=b*i+_*s+M*h+E*v,t[14]=b*o+_*c+M*d+E*g,t[15]=b*a+_*f+M*p+E*m,t}function ae(t,e,n){var r,i,o,a,u,s,c,f,l,h,d,p,y=n[0],v=n[1],g=n[2];return e===t?(t[12]=e[0]*y+e[4]*v+e[8]*g+e[12],t[13]=e[1]*y+e[5]*v+e[9]*g+e[13],t[14]=e[2]*y+e[6]*v+e[10]*g+e[14],t[15]=e[3]*y+e[7]*v+e[11]*g+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*y+u*v+l*g+e[12],t[13]=i*y+s*v+h*g+e[13],t[14]=o*y+c*v+d*g+e[14],t[15]=a*y+f*v+p*g+e[15]),t}function ue(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function se(t,e,n,r){var i,o,a,u,s,c,f,l,h,p,y,v,g,m,b,_,M,E,T,O,w,x,A,P,C=r[0],S=r[1],N=r[2],j=Math.hypot(C,S,N);return j<d?null:(C*=j=1/j,S*=j,N*=j,i=Math.sin(n),a=1-(o=Math.cos(n)),u=e[0],s=e[1],c=e[2],f=e[3],l=e[4],h=e[5],p=e[6],y=e[7],v=e[8],g=e[9],m=e[10],b=e[11],_=C*C*a+o,M=S*C*a+N*i,E=N*C*a-S*i,T=C*S*a-N*i,O=S*S*a+o,w=N*S*a+C*i,x=C*N*a+S*i,A=S*N*a-C*i,P=N*N*a+o,t[0]=u*_+l*M+v*E,t[1]=s*_+h*M+g*E,t[2]=c*_+p*M+m*E,t[3]=f*_+y*M+b*E,t[4]=u*T+l*O+v*w,t[5]=s*T+h*O+g*w,t[6]=c*T+p*O+m*w,t[7]=f*T+y*O+b*w,t[8]=u*x+l*A+v*P,t[9]=s*x+h*A+g*P,t[10]=c*x+p*A+m*P,t[11]=f*x+y*A+b*P,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function ce(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];return 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,t}function fe(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],u=e[2],s=e[3],c=e[8],f=e[9],l=e[10],h=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-c*r,t[1]=a*i-f*r,t[2]=u*i-l*r,t[3]=s*i-h*r,t[8]=o*r+c*i,t[9]=a*r+f*i,t[10]=u*r+l*i,t[11]=s*r+h*i,t}function le(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],u=e[2],s=e[3],c=e[4],f=e[5],l=e[6],h=e[7];return e!==t&&(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[0]=o*i+c*r,t[1]=a*i+f*r,t[2]=u*i+l*r,t[3]=s*i+h*r,t[4]=c*i-o*r,t[5]=f*i-a*r,t[6]=l*i-u*r,t[7]=h*i-s*r,t}function he(t,e){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]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function de(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function pe(t,e,n){var r,i,o,a=n[0],u=n[1],s=n[2],c=Math.hypot(a,u,s);return c<d?null:(a*=c=1/c,u*=c,s*=c,r=Math.sin(e),o=1-(i=Math.cos(e)),t[0]=a*a*o+i,t[1]=u*a*o+s*r,t[2]=s*a*o-u*r,t[3]=0,t[4]=a*u*o-s*r,t[5]=u*u*o+i,t[6]=s*u*o+a*r,t[7]=0,t[8]=a*s*o+u*r,t[9]=u*s*o-a*r,t[10]=s*s*o+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function ye(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ve(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ge(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,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 me(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],u=r+r,s=i+i,c=o+o,f=r*u,l=r*s,h=r*c,d=i*s,p=i*c,y=o*c,v=a*u,g=a*s,m=a*c;return t[0]=1-(d+y),t[1]=l+m,t[2]=h-g,t[3]=0,t[4]=l-m,t[5]=1-(f+y),t[6]=p+v,t[7]=0,t[8]=h+g,t[9]=p-v,t[10]=1-(f+d),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function be(t,e){var n=new p(3),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=r*r+i*i+o*o+a*a;return l>0?(n[0]=2*(u*a+f*r+s*o-c*i)/l,n[1]=2*(s*a+f*i+c*r-u*o)/l,n[2]=2*(c*a+f*o+u*i-s*r)/l):(n[0]=2*(u*a+f*r+s*o-c*i),n[1]=2*(s*a+f*i+c*r-u*o),n[2]=2*(c*a+f*o+u*i-s*r)),me(t,e,n),t}function _e(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Me(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 Ee(t,e){var n=new p(3);Me(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,y=e[10]*o,v=a+f+y,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>y?(g=2*Math.sqrt(1+a-f-y),t[3]=(l-d)/g,t[0]=.25*g,t[1]=(u+c)/g,t[2]=(h+s)/g):f>y?(g=2*Math.sqrt(1+f-a-y),t[3]=(h-s)/g,t[0]=(u+c)/g,t[1]=.25*g,t[2]=(l+d)/g):(g=2*Math.sqrt(1+y-a-f),t[3]=(u-c)/g,t[0]=(h+s)/g,t[1]=(l+d)/g,t[2]=.25*g),t}function Te(t,e,n,r){var i=e[0],o=e[1],a=e[2],u=e[3],s=i+i,c=o+o,f=a+a,l=i*s,h=i*c,d=i*f,p=o*c,y=o*f,v=a*f,g=u*s,m=u*c,b=u*f,_=r[0],M=r[1],E=r[2];return t[0]=(1-(p+v))*_,t[1]=(h+b)*_,t[2]=(d-m)*_,t[3]=0,t[4]=(h-b)*M,t[5]=(1-(l+v))*M,t[6]=(y+g)*M,t[7]=0,t[8]=(d+m)*E,t[9]=(y-g)*E,t[10]=(1-(l+p))*E,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function Oe(t,e,n,r,i){var o=e[0],a=e[1],u=e[2],s=e[3],c=o+o,f=a+a,l=u+u,h=o*c,d=o*f,p=o*l,y=a*f,v=a*l,g=u*l,m=s*c,b=s*f,_=s*l,M=r[0],E=r[1],T=r[2],O=i[0],w=i[1],x=i[2],A=(1-(y+g))*M,P=(d+_)*M,C=(p-b)*M,S=(d-_)*E,N=(1-(h+g))*E,j=(v+m)*E,I=(p+b)*T,R=(v-m)*T,k=(1-(h+y))*T;return t[0]=A,t[1]=P,t[2]=C,t[3]=0,t[4]=S,t[5]=N,t[6]=j,t[7]=0,t[8]=I,t[9]=R,t[10]=k,t[11]=0,t[12]=n[0]+O-(A*O+S*w+I*x),t[13]=n[1]+w-(P*O+N*w+R*x),t[14]=n[2]+x-(C*O+j*w+k*x),t[15]=1,t}function we(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,y=o*a,v=o*u,g=o*s;return t[0]=1-l-p,t[1]=f+g,t[2]=h-v,t[3]=0,t[4]=f-g,t[5]=1-c-p,t[6]=d+y,t[7]=0,t[8]=h+v,t[9]=d-y,t[10]=1-c-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function xe(t,e,n,r,i,o,a){var u=1/(n-e),s=1/(i-r),c=1/(o-a);return t[0]=2*o*u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*s,t[6]=0,t[7]=0,t[8]=(n+e)*u,t[9]=(i+r)*s,t[10]=(a+o)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*c,t[15]=0,t}function Ae(t,e,n,r,i){var o,a=1/Math.tan(e/2);return 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),t}var Pe=Ae;function Ce(t,e,n,r,i){var o,a=1/Math.tan(e/2);return 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*o,t[14]=i*r*o):(t[10]=-1,t[14]=-r),t}function Se(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),u=Math.tan(e.rightDegrees*Math.PI/180),s=2/(a+u),c=2/(i+o);return t[0]=s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(a-u)*s*.5,t[9]=(i-o)*c*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t}function Ne(t,e,n,r,i,o,a){var u=1/(e-n),s=1/(r-i),c=1/(o-a);return 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,t}var je=Ne;function Ie(t,e,n,r,i,o,a){var u=1/(e-n),s=1/(r-i),c=1/(o-a);return 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]=c,t[11]=0,t[12]=(e+n)*u,t[13]=(i+r)*s,t[14]=o*c,t[15]=1,t}function Re(t,e,n,r){var i,o,a,u,s,c,f,l,h,p,y=e[0],v=e[1],g=e[2],m=r[0],b=r[1],_=r[2],M=n[0],E=n[1],T=n[2];return Math.abs(y-M)<d&&Math.abs(v-E)<d&&Math.abs(g-T)<d?te(t):(f=y-M,l=v-E,h=g-T,i=b*(h*=p=1/Math.hypot(f,l,h))-_*(l*=p),o=_*(f*=p)-m*h,a=m*l-b*f,(p=Math.hypot(i,o,a))?(i*=p=1/p,o*=p,a*=p):(i=0,o=0,a=0),u=l*a-h*o,s=h*i-f*a,c=f*o-l*i,(p=Math.hypot(u,s,c))?(u*=p=1/p,s*=p,c*=p):(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*y+o*v+a*g),t[13]=-(u*y+s*v+c*g),t[14]=-(f*y+l*v+h*g),t[15]=1,t)}function ke(t,e,n,r){var i=e[0],o=e[1],a=e[2],u=r[0],s=r[1],c=r[2],f=i-n[0],l=o-n[1],h=a-n[2],d=f*f+l*l+h*h;d>0&&(f*=d=1/Math.sqrt(d),l*=d,h*=d);var p=s*h-c*l,y=c*f-u*h,v=u*l-s*f;return(d=p*p+y*y+v*v)>0&&(p*=d=1/Math.sqrt(d),y*=d,v*=d),t[0]=p,t[1]=y,t[2]=v,t[3]=0,t[4]=l*v-h*y,t[5]=h*p-f*v,t[6]=f*y-l*p,t[7]=0,t[8]=f,t[9]=l,t[10]=h,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t}function De(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function Be(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function Le(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t}function Fe(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}function Ve(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t}function Ge(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t}function qe(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]}function Ue(t,e){var n=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],p=t[11],y=t[12],v=t[13],g=t[14],m=t[15],b=e[0],_=e[1],M=e[2],E=e[3],T=e[4],O=e[5],w=e[6],x=e[7],A=e[8],P=e[9],C=e[10],S=e[11],N=e[12],j=e[13],I=e[14],R=e[15];return Math.abs(n-b)<=d*Math.max(1,Math.abs(n),Math.abs(b))&&Math.abs(r-_)<=d*Math.max(1,Math.abs(r),Math.abs(_))&&Math.abs(i-M)<=d*Math.max(1,Math.abs(i),Math.abs(M))&&Math.abs(o-E)<=d*Math.max(1,Math.abs(o),Math.abs(E))&&Math.abs(a-T)<=d*Math.max(1,Math.abs(a),Math.abs(T))&&Math.abs(u-O)<=d*Math.max(1,Math.abs(u),Math.abs(O))&&Math.abs(s-w)<=d*Math.max(1,Math.abs(s),Math.abs(w))&&Math.abs(c-x)<=d*Math.max(1,Math.abs(c),Math.abs(x))&&Math.abs(f-A)<=d*Math.max(1,Math.abs(f),Math.abs(A))&&Math.abs(l-P)<=d*Math.max(1,Math.abs(l),Math.abs(P))&&Math.abs(h-C)<=d*Math.max(1,Math.abs(h),Math.abs(C))&&Math.abs(p-S)<=d*Math.max(1,Math.abs(p),Math.abs(S))&&Math.abs(y-N)<=d*Math.max(1,Math.abs(y),Math.abs(N))&&Math.abs(v-j)<=d*Math.max(1,Math.abs(v),Math.abs(j))&&Math.abs(g-I)<=d*Math.max(1,Math.abs(g),Math.abs(I))&&Math.abs(m-R)<=d*Math.max(1,Math.abs(m),Math.abs(R))}var We=oe,ze=Fe;function He(){var t=new p(3);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Ye(t){var e=new p(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function $e(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)}function Xe(t,e,n){var r=new p(3);return r[0]=t,r[1]=e,r[2]=n,r}function Ke(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Je(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function Ze(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function Qe(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function tn(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function en(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t}function nn(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function rn(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function on(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t}function an(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t}function un(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function sn(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function cn(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t}function fn(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.hypot(n,r,i)}function ln(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return n*n+r*r+i*i}function hn(t){var e=t[0],n=t[1],r=t[2];return e*e+n*n+r*r}function dn(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function pn(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function yn(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 vn(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function gn(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],u=n[1],s=n[2];return t[0]=i*s-o*u,t[1]=o*a-r*s,t[2]=r*u-i*a,t}function mn(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 bn(t,e,n,r,i,o){var a=o*o,u=a*(2*o-3)+1,s=a*(o-2)+o,c=a*(o-1),f=a*(3-2*o);return t[0]=e[0]*u+n[0]*s+r[0]*c+i[0]*f,t[1]=e[1]*u+n[1]*s+r[1]*c+i[1]*f,t[2]=e[2]*u+n[2]*s+r[2]*c+i[2]*f,t}function _n(t,e,n,r,i,o){var a=1-o,u=a*a,s=o*o,c=u*a,f=3*o*u,l=3*s*a,h=s*o;return t[0]=e[0]*c+n[0]*f+r[0]*l+i[0]*h,t[1]=e[1]*c+n[1]*f+r[1]*l+i[1]*h,t[2]=e[2]*c+n[2]*f+r[2]*l+i[2]*h,t}function Mn(t,e){e=e||1;var n=2*y()*Math.PI,r=2*y()-1,i=Math.sqrt(1-r*r)*e;return t[0]=Math.cos(n)*i,t[1]=Math.sin(n)*i,t[2]=r*e,t}function En(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}function On(t,e,n){var r=n[0],i=n[1],o=n[2],a=n[3],u=e[0],s=e[1],c=e[2],f=i*c-o*s,l=o*u-r*c,h=r*s-i*u,d=i*h-o*l,p=o*f-r*h,y=r*l-i*f,v=2*a;return f*=v,l*=v,h*=v,d*=2,p*=2,y*=2,t[0]=u+f+d,t[1]=s+l+p,t[2]=c+h+y,t}function wn(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0],o[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),o[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function xn(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),o[1]=i[1],o[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function An(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),o[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),o[2]=i[2],t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function Pn(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],u=e[2],s=Math.sqrt(n*n+r*r+i*i)*Math.sqrt(o*o+a*a+u*u),c=s&&vn(t,e)/s;return Math.acos(Math.min(Math.max(c,-1),1))}function Cn(t){return t[0]=0,t[1]=0,t[2]=0,t}function Sn(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function Nn(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function jn(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],u=e[2];return Math.abs(n-o)<=d*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=d*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-u)<=d*Math.max(1,Math.abs(i),Math.abs(u))}var In,Rn=Qe,kn=tn,Dn=en,Bn=fn,Ln=ln,Fn=$e,Vn=hn,Gn=(In=He(),function(t,e,n,r,i,o){var a,u;for(e||(e=3),n||(n=0),u=r?Math.min(r*e+n,t.length):t.length,a=n;a<u;a+=e)In[0]=t[a],In[1]=t[a+1],In[2]=t[a+2],i(In,In,o),t[a]=In[0],t[a+1]=In[1],t[a+2]=In[2];return t});function qn(){var t=new p(4);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function Un(t){var e=new p(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function Wn(t,e,n,r){var i=new p(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i}function zn(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function Hn(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t}function Yn(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],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[3]=e[3]-n[3],t}function Xn(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t[3]=e[3]*n[3],t}function Kn(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t[3]=e[3]/n[3],t}function Jn(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t}function Zn(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t}function Qn(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t[3]=Math.min(e[3],n[3]),t}function tr(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t[3]=Math.max(e[3],n[3]),t}function er(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t}function nr(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t}function rr(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t}function ir(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return Math.hypot(n,r,i,o)}function or(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return n*n+r*r+i*i+o*o}function ar(t){var e=t[0],n=t[1],r=t[2],i=t[3];return Math.hypot(e,n,r,i)}function ur(t){var e=t[0],n=t[1],r=t[2],i=t[3];return e*e+n*n+r*r+i*i}function sr(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}function cr(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}function fr(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}function lr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function hr(t,e,n,r){var i=n[0]*r[1]-n[1]*r[0],o=n[0]*r[2]-n[2]*r[0],a=n[0]*r[3]-n[3]*r[0],u=n[1]*r[2]-n[2]*r[1],s=n[1]*r[3]-n[3]*r[1],c=n[2]*r[3]-n[3]*r[2],f=e[0],l=e[1],h=e[2],d=e[3];return t[0]=l*c-h*s+d*u,t[1]=-f*c+h*a-d*o,t[2]=f*s-l*a+d*i,t[3]=-f*u+l*o-h*i,t}function dr(t,e,n,r){var i=e[0],o=e[1],a=e[2],u=e[3];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t[3]=u+r*(n[3]-u),t}function pr(t,e){var n,r,i,o,a,u;e=e||1;do{a=(n=2*y()-1)*n+(r=2*y()-1)*r}while(a>=1);do{u=(i=2*y()-1)*i+(o=2*y()-1)*o}while(u>=1);var s=Math.sqrt((1-a)/u);return t[0]=e*n,t[1]=e*r,t[2]=e*i*s,t[3]=e*o*s,t}function yr(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 vr(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],u=n[1],s=n[2],c=n[3],f=c*r+u*o-s*i,l=c*i+s*r-a*o,h=c*o+a*i-u*r,d=-a*r-u*i-s*o;return t[0]=f*c+d*-a+l*-s-h*-u,t[1]=l*c+d*-u+h*-a-f*-s,t[2]=h*c+d*-s+f*-u-l*-a,t[3]=e[3],t}function gr(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function mr(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function br(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function _r(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=e[0],u=e[1],s=e[2],c=e[3];return Math.abs(n-a)<=d*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-u)<=d*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(i-s)<=d*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(o-c)<=d*Math.max(1,Math.abs(o),Math.abs(c))}var Mr=$n,Er=Xn,Tr=Kn,Or=ir,wr=or,xr=ar,Ar=ur,Pr=function(){var t=qn();return function(e,n,r,i,o,a){var u,s;for(n||(n=4),r||(r=0),s=i?Math.min(i*n+r,e.length):e.length,u=r;u<s;u+=n)t[0]=e[u],t[1]=e[u+1],t[2]=e[u+2],t[3]=e[u+3],o(t,t,a),e[u]=t[0],e[u+1]=t[1],e[u+2]=t[2],e[u+3]=t[3];return e}}();function Cr(){var t=new p(4);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Sr(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function Nr(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 jr(t,e){var n=2*Math.acos(e[3]),r=Math.sin(n/2);return r>d?(t[0]=e[0]/r,t[1]=e[1]/r,t[2]=e[2]/r):(t[0]=1,t[1]=0,t[2]=0),n}function Ir(t,e){var n=si(t,e);return Math.acos(2*n*n-1)}function Rr(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 kr(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],u=Math.sin(n),s=Math.cos(n);return t[0]=r*s+a*u,t[1]=i*s+o*u,t[2]=o*s-i*u,t[3]=a*s-r*u,t}function Dr(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],u=Math.sin(n),s=Math.cos(n);return t[0]=r*s-o*u,t[1]=i*s+a*u,t[2]=o*s+r*u,t[3]=a*s-i*u,t}function Br(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],u=Math.sin(n),s=Math.cos(n);return t[0]=r*s+i*u,t[1]=i*s-r*u,t[2]=o*s+a*u,t[3]=a*s-o*u,t}function Lr(t,e){var n=e[0],r=e[1],i=e[2];return t[0]=n,t[1]=r,t[2]=i,t[3]=Math.sqrt(Math.abs(1-n*n-r*r-i*i)),t}function Fr(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=Math.sqrt(n*n+r*r+i*i),u=Math.exp(o),s=a>0?u*Math.sin(a)/a:0;return t[0]=n*s,t[1]=r*s,t[2]=i*s,t[3]=u*Math.cos(a),t}function Vr(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=Math.sqrt(n*n+r*r+i*i),u=a>0?Math.atan2(a,o)/a:0;return t[0]=n*u,t[1]=r*u,t[2]=i*u,t[3]=.5*Math.log(n*n+r*r+i*i+o*o),t}function Gr(t,e,n){return Vr(t,e),ui(t,t,n),Fr(t,t),t}function qr(t,e,n,r){var i,o,a,u,s,c=e[0],f=e[1],l=e[2],h=e[3],p=n[0],y=n[1],v=n[2],g=n[3];return(o=c*p+f*y+l*v+h*g)<0&&(o=-o,p=-p,y=-y,v=-v,g=-g),1-o>d?(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*p,t[1]=u*f+s*y,t[2]=u*l+s*v,t[3]=u*h+s*g,t}function Ur(t){var e=y(),n=y(),r=y(),i=Math.sqrt(1-e),o=Math.sqrt(e);return t[0]=i*Math.sin(2*Math.PI*n),t[1]=i*Math.cos(2*Math.PI*n),t[2]=o*Math.sin(2*Math.PI*r),t[3]=o*Math.cos(2*Math.PI*r),t}function Wr(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 zr(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function Hr(t,e){var n,r=e[0]+e[4]+e[8];if(r>0)n=Math.sqrt(r+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;n=Math.sqrt(e[3*i+i]-e[3*o+o]-e[3*a+a]+1),t[i]=.5*n,n=.5/n,t[3]=(e[3*o+a]-e[3*a+o])*n,t[o]=(e[3*o+i]+e[3*i+o])*n,t[a]=(e[3*a+i]+e[3*i+a])*n}return t}function Yr(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}function $r(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var Xr,Kr,Jr,Zr,Qr,ti,ei=Un,ni=Wn,ri=zn,ii=Hn,oi=Yn,ai=Rr,ui=nr,si=lr,ci=dr,fi=ar,li=fi,hi=ur,di=hi,pi=fr,yi=br,vi=_r,gi=(Xr=He(),Kr=Xe(1,0,0),Jr=Xe(0,1,0),function(t,e,n){var r=vn(e,n);return r<-.999999?(gn(Xr,Kr,e),Fn(Xr)<1e-6&&gn(Xr,Jr,e),yn(Xr,Xr),Nr(t,Xr,Math.PI),t):r>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(gn(Xr,e,n),t[0]=Xr[0],t[1]=Xr[1],t[2]=Xr[2],t[3]=1+r,pi(t,t))}),mi=(Zr=Cr(),Qr=Cr(),function(t,e,n,r,i,o){return qr(Zr,e,i,o),qr(Qr,n,r,o),qr(t,Zr,Qr,2*o*(1-o)),t}),bi=(ti=gt(),function(t,e,n,r){return ti[0]=n[0],ti[3]=n[1],ti[6]=n[2],ti[1]=r[0],ti[4]=r[1],ti[7]=r[2],ti[2]=-e[0],ti[5]=-e[1],ti[8]=-e[2],pi(t,Hr(t,ti))});function _i(){var t=new p(8);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t}function Mi(t){var e=new p(8);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function Ei(t,e,n,r,i,o,a,u){var s=new p(8);return s[0]=t,s[1]=e,s[2]=n,s[3]=r,s[4]=i,s[5]=o,s[6]=a,s[7]=u,s}function Ti(t,e,n,r,i,o,a){var u=new p(8);u[0]=t,u[1]=e,u[2]=n,u[3]=r;var s=.5*i,c=.5*o,f=.5*a;return u[4]=s*r+c*n-f*e,u[5]=c*r+f*t-s*n,u[6]=f*r+s*e-c*t,u[7]=-s*t-c*e-f*n,u}function Oi(t,e,n){var r=.5*n[0],i=.5*n[1],o=.5*n[2],a=e[0],u=e[1],s=e[2],c=e[3];return t[0]=a,t[1]=u,t[2]=s,t[3]=c,t[4]=r*c+i*s-o*u,t[5]=i*c+o*a-r*s,t[6]=o*c+r*u-i*a,t[7]=-r*a-i*u-o*s,t}function wi(t,e){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=.5*e[0],t[5]=.5*e[1],t[6]=.5*e[2],t[7]=0,t}function xi(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function Ai(t,e){var n=Cr();Ee(n,e);var r=new p(3);return _e(r,e),Oi(t,n,r),t}function Pi(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}function Ci(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function Si(t,e,n,r,i,o,a,u,s){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=u,t[7]=s,t}var Ni=ri;function ji(t,e){return t[0]=e[4],t[1]=e[5],t[2]=e[6],t[3]=e[7],t}var Ii=ri;function Ri(t,e){return t[4]=e[0],t[5]=e[1],t[6]=e[2],t[7]=e[3],t}function ki(t,e){var n=e[4],r=e[5],i=e[6],o=e[7],a=-e[0],u=-e[1],s=-e[2],c=e[3];return t[0]=2*(n*c+o*a+r*s-i*u),t[1]=2*(r*c+o*u+i*a-n*s),t[2]=2*(i*c+o*s+n*u-r*a),t}function Di(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],u=.5*n[0],s=.5*n[1],c=.5*n[2],f=e[4],l=e[5],h=e[6],d=e[7];return t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=a*u+i*c-o*s+f,t[5]=a*s+o*u-r*c+l,t[6]=a*c+r*s-i*u+h,t[7]=-r*u-i*s-o*c+d,t}function Bi(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=u*a+f*r+s*o-c*i,h=s*a+f*i+c*r-u*o,d=c*a+f*o+u*i-s*r,p=f*a-u*r-s*i-c*o;return kr(t,e,n),r=t[0],i=t[1],o=t[2],a=t[3],t[4]=l*a+p*r+h*o-d*i,t[5]=h*a+p*i+d*r-l*o,t[6]=d*a+p*o+l*i-h*r,t[7]=p*a-l*r-h*i-d*o,t}function Li(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=u*a+f*r+s*o-c*i,h=s*a+f*i+c*r-u*o,d=c*a+f*o+u*i-s*r,p=f*a-u*r-s*i-c*o;return Dr(t,e,n),r=t[0],i=t[1],o=t[2],a=t[3],t[4]=l*a+p*r+h*o-d*i,t[5]=h*a+p*i+d*r-l*o,t[6]=d*a+p*o+l*i-h*r,t[7]=p*a-l*r-h*i-d*o,t}function Fi(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=u*a+f*r+s*o-c*i,h=s*a+f*i+c*r-u*o,d=c*a+f*o+u*i-s*r,p=f*a-u*r-s*i-c*o;return Br(t,e,n),r=t[0],i=t[1],o=t[2],a=t[3],t[4]=l*a+p*r+h*o-d*i,t[5]=h*a+p*i+d*r-l*o,t[6]=d*a+p*o+l*i-h*r,t[7]=p*a-l*r-h*i-d*o,t}function Vi(t,e,n){var r=n[0],i=n[1],o=n[2],a=n[3],u=e[0],s=e[1],c=e[2],f=e[3];return t[0]=u*a+f*r+s*o-c*i,t[1]=s*a+f*i+c*r-u*o,t[2]=c*a+f*o+u*i-s*r,t[3]=f*a-u*r-s*i-c*o,u=e[4],s=e[5],c=e[6],f=e[7],t[4]=u*a+f*r+s*o-c*i,t[5]=s*a+f*i+c*r-u*o,t[6]=c*a+f*o+u*i-s*r,t[7]=f*a-u*r-s*i-c*o,t}function Gi(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,u=n[4],s=n[5],c=n[6],f=n[7],t[4]=r*f+a*u+i*c-o*s,t[5]=i*f+a*s+o*u-r*c,t[6]=o*f+a*c+r*s-i*u,t[7]=a*f-r*u-i*s-o*c,t}function qi(t,e,n,r){if(Math.abs(r)<d)return Pi(t,e);var i=Math.hypot(n[0],n[1],n[2]);r*=.5;var o=Math.sin(r),a=o*n[0]/i,u=o*n[1]/i,s=o*n[2]/i,c=Math.cos(r),f=e[0],l=e[1],h=e[2],p=e[3];t[0]=f*c+p*a+l*s-h*u,t[1]=l*c+p*u+h*a-f*s,t[2]=h*c+p*s+f*u-l*a,t[3]=p*c-f*a-l*u-h*s;var y=e[4],v=e[5],g=e[6],m=e[7];return t[4]=y*c+m*a+v*s-g*u,t[5]=v*c+m*u+g*a-y*s,t[6]=g*c+m*s+y*u-v*a,t[7]=m*c-y*a-v*u-g*s,t}function Ui(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t}function Wi(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],u=n[4],s=n[5],c=n[6],f=n[7],l=e[4],h=e[5],d=e[6],p=e[7],y=n[0],v=n[1],g=n[2],m=n[3];return t[0]=r*m+a*y+i*g-o*v,t[1]=i*m+a*v+o*y-r*g,t[2]=o*m+a*g+r*v-i*y,t[3]=a*m-r*y-i*v-o*g,t[4]=r*f+a*u+i*c-o*s+l*m+p*y+h*g-d*v,t[5]=i*f+a*s+o*u-r*c+h*m+p*v+d*y-l*g,t[6]=o*f+a*c+r*s-i*u+d*m+p*g+l*v-h*y,t[7]=a*f-r*u-i*s-o*c+p*m-l*y-h*v-d*g,t}var zi=Wi;function Hi(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t}var Yi=si;function $i(t,e,n,r){var i=1-r;return Yi(e,n)<0&&(r=-r),t[0]=e[0]*i+n[0]*r,t[1]=e[1]*i+n[1]*r,t[2]=e[2]*i+n[2]*r,t[3]=e[3]*i+n[3]*r,t[4]=e[4]*i+n[4]*r,t[5]=e[5]*i+n[5]*r,t[6]=e[6]*i+n[6]*r,t[7]=e[7]*i+n[7]*r,t}function Xi(t,e){var n=Qi(e);return t[0]=-e[0]/n,t[1]=-e[1]/n,t[2]=-e[2]/n,t[3]=e[3]/n,t[4]=-e[4]/n,t[5]=-e[5]/n,t[6]=-e[6]/n,t[7]=e[7]/n,t}function Ki(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}var Ji=fi,Zi=Ji,Qi=hi,to=Qi;function eo(t,e){var n=Qi(e);if(n>0){n=Math.sqrt(n);var r=e[0]/n,i=e[1]/n,o=e[2]/n,a=e[3]/n,u=e[4],s=e[5],c=e[6],f=e[7],l=r*u+i*s+o*c+a*f;t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=(u-r*l)/n,t[5]=(s-i*l)/n,t[6]=(c-o*l)/n,t[7]=(f-a*l)/n}return t}function no(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"}function ro(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]}function io(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],u=t[5],s=t[6],c=t[7],f=e[0],l=e[1],h=e[2],p=e[3],y=e[4],v=e[5],g=e[6],m=e[7];return Math.abs(n-f)<=d*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(r-l)<=d*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(i-h)<=d*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(o-p)<=d*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(a-y)<=d*Math.max(1,Math.abs(a),Math.abs(y))&&Math.abs(u-v)<=d*Math.max(1,Math.abs(u),Math.abs(v))&&Math.abs(s-g)<=d*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(c-m)<=d*Math.max(1,Math.abs(c),Math.abs(m))}function oo(){var t=new p(2);return p!=Float32Array&&(t[0]=0,t[1]=0),t}function ao(t){var e=new p(2);return e[0]=t[0],e[1]=t[1],e}function uo(t,e){var n=new p(2);return n[0]=t,n[1]=e,n}function so(t,e){return t[0]=e[0],t[1]=e[1],t}function co(t,e,n){return t[0]=e,t[1]=n,t}function fo(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function lo(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function ho(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function po(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function yo(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function vo(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function go(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t}function mo(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}function bo(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function _o(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}function Mo(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t}function Eo(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.hypot(n,r)}function To(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function Oo(t){var e=t[0],n=t[1];return Math.hypot(e,n)}function wo(t){var e=t[0],n=t[1];return e*e+n*n}function xo(t,e){return t[0]=-e[0],t[1]=-e[1],t}function Ao(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function Po(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}function Co(t,e){return t[0]*e[0]+t[1]*e[1]}function So(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t}function No(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}function jo(t,e){e=e||1;var n=2*y()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t}function Io(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}function Ro(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}function ko(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}function Do(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}function Bo(t,e,n,r){var i=e[0]-n[0],o=e[1]-n[1],a=Math.sin(r),u=Math.cos(r);return t[0]=i*u-o*a+n[0],t[1]=i*a+o*u+n[1],t}function Lo(t,e){var n=t[0],r=t[1],i=e[0],o=e[1],a=Math.sqrt(n*n+r*r)*Math.sqrt(i*i+o*o),u=a&&(n*i+r*o)/a;return Math.acos(Math.min(Math.max(u,-1),1))}function Fo(t){return t[0]=0,t[1]=0,t}function Vo(t){return"vec2("+t[0]+", "+t[1]+")"}function Go(t,e){return t[0]===e[0]&&t[1]===e[1]}function qo(t,e){var n=t[0],r=t[1],i=e[0],o=e[1];return Math.abs(n-i)<=d*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(r-o)<=d*Math.max(1,Math.abs(r),Math.abs(o))}var Uo=Oo,Wo=lo,zo=ho,Ho=po,Yo=Eo,$o=To,Xo=wo,Ko=function(){var t=oo();return function(e,n,r,i,o,a){var u,s;for(n||(n=2),r||(r=0),s=i?Math.min(i*n+r,e.length):e.length,u=r;u<s;u+=n)t[0]=e[u],t[1]=e[u+1],o(t,t,a),e[u]=t[0],e[u+1]=t[1];return e}}()},function(t,e,n){"use strict";n.r(e),n.d(e,"__extends",(function(){return i})),n.d(e,"__assign",(function(){return o})),n.d(e,"__rest",(function(){return a})),n.d(e,"__decorate",(function(){return u})),n.d(e,"__param",(function(){return s})),n.d(e,"__metadata",(function(){return c})),n.d(e,"__awaiter",(function(){return f})),n.d(e,"__generator",(function(){return l})),n.d(e,"__createBinding",(function(){return h})),n.d(e,"__exportStar",(function(){return d})),n.d(e,"__values",(function(){return p})),n.d(e,"__read",(function(){return y})),n.d(e,"__spread",(function(){return v})),n.d(e,"__spreadArrays",(function(){return g})),n.d(e,"__spreadArray",(function(){return m})),n.d(e,"__await",(function(){return b})),n.d(e,"__asyncGenerator",(function(){return _})),n.d(e,"__asyncDelegator",(function(){return M})),n.d(e,"__asyncValues",(function(){return E})),n.d(e,"__makeTemplateObject",(function(){return T})),n.d(e,"__importStar",(function(){return w})),n.d(e,"__importDefault",(function(){return x})),n.d(e,"__classPrivateFieldGet",(function(){return A})),n.d(e,"__classPrivateFieldSet",(function(){return P}));
|
|
2
|
-
/*! *****************************************************************************
|
|
3
|
-
Copyright (c) Microsoft Corporation.
|
|
4
|
-
|
|
5
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
purpose with or without fee is hereby granted.
|
|
7
|
-
|
|
8
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */
|
|
16
|
-
var r=function(t,e){return(r=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)};function i(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}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return(o=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}).apply(this,arguments)};function a(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function u(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var u=t.length-1;u>=0;u--)(i=t[u])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function s(t,e){return function(n,r){e(n,r,t)}}function c(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function f(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())}))}function l(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=a.trys,(i=i.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])}}}var h=Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]};function d(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||h(e,t,n)}function p(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function y(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function v(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(y(arguments[e]));return t}function g(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,u=o.length;a<u;a++,i++)r[i]=o[a];return r}function m(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function b(t){return this instanceof b?(this.v=t,this):new b(t)}function _(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(t){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||u(t,e)}))})}function u(t,e){try{(n=i[t](e)).value instanceof b?Promise.resolve(n.value.v).then(s,c):f(o[0][2],n)}catch(t){f(o[0][3],t)}var n}function s(t){u("next",t)}function c(t){u("throw",t)}function f(t,e){t(e),o.shift(),o.length&&u(o[0][0],o[0][1])}}function M(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,i){e[r]=t[r]?function(e){return(n=!n)?{value:b(t[r](e)),done:"return"===r}:i?i(e):e}:i}}function E(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=p(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,i,(e=t[n](e)).done,e.value)}))}}}function T(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var O=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function w(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&h(e,t,n);return O(e,t),e}function x(t){return t&&t.__esModule?t:{default:t}}function A(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function P(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n}},function(t,e,n){"use strict";n.r(e),n.d(e,"contains",(function(){return i})),n.d(e,"includes",(function(){return i})),n.d(e,"difference",(function(){return a})),n.d(e,"find",(function(){return m})),n.d(e,"findIndex",(function(){return b})),n.d(e,"firstValue",(function(){return _})),n.d(e,"flatten",(function(){return M})),n.d(e,"flattenDeep",(function(){return T})),n.d(e,"getRange",(function(){return x})),n.d(e,"pull",(function(){return S})),n.d(e,"pullAt",(function(){return j})),n.d(e,"reduce",(function(){return I})),n.d(e,"remove",(function(){return R})),n.d(e,"sortBy",(function(){return D})),n.d(e,"union",(function(){return L})),n.d(e,"uniq",(function(){return B})),n.d(e,"valuesOfKey",(function(){return F})),n.d(e,"head",(function(){return V})),n.d(e,"last",(function(){return G})),n.d(e,"startsWith",(function(){return q})),n.d(e,"endsWith",(function(){return U})),n.d(e,"filter",(function(){return o})),n.d(e,"every",(function(){return W})),n.d(e,"some",(function(){return z})),n.d(e,"group",(function(){return X})),n.d(e,"groupBy",(function(){return Y})),n.d(e,"groupToMap",(function(){return $})),n.d(e,"getWrapBehavior",(function(){return K})),n.d(e,"wrapBehavior",(function(){return J})),n.d(e,"number2color",(function(){return Q})),n.d(e,"parseRadius",(function(){return tt})),n.d(e,"clamp",(function(){return et})),n.d(e,"fixedBase",(function(){return nt})),n.d(e,"isDecimal",(function(){return it})),n.d(e,"isEven",(function(){return ot})),n.d(e,"isInteger",(function(){return at})),n.d(e,"isNegative",(function(){return ut})),n.d(e,"isNumberEqual",(function(){return st})),n.d(e,"isOdd",(function(){return ct})),n.d(e,"isPositive",(function(){return ft})),n.d(e,"max",(function(){return O})),n.d(e,"maxBy",(function(){return lt})),n.d(e,"min",(function(){return w})),n.d(e,"minBy",(function(){return ht})),n.d(e,"mod",(function(){return dt})),n.d(e,"toDegree",(function(){return yt})),n.d(e,"toInteger",(function(){return vt})),n.d(e,"toRadian",(function(){return mt})),n.d(e,"forIn",(function(){return bt})),n.d(e,"has",(function(){return _t})),n.d(e,"hasKey",(function(){return Mt})),n.d(e,"hasValue",(function(){return Tt})),n.d(e,"keys",(function(){return p})),n.d(e,"isMatch",(function(){return y})),n.d(e,"values",(function(){return Et})),n.d(e,"lowerCase",(function(){return wt})),n.d(e,"lowerFirst",(function(){return xt})),n.d(e,"substitute",(function(){return At})),n.d(e,"upperCase",(function(){return Pt})),n.d(e,"upperFirst",(function(){return Ct})),n.d(e,"getType",(function(){return Nt})),n.d(e,"isArguments",(function(){return jt})),n.d(e,"isArray",(function(){return l})),n.d(e,"isArrayLike",(function(){return r})),n.d(e,"isBoolean",(function(){return It})),n.d(e,"isDate",(function(){return Rt})),n.d(e,"isError",(function(){return kt})),n.d(e,"isFunction",(function(){return c})),n.d(e,"isFinite",(function(){return Dt})),n.d(e,"isNil",(function(){return f})),n.d(e,"isNull",(function(){return Bt})),n.d(e,"isNumber",(function(){return rt})),n.d(e,"isObject",(function(){return h})),n.d(e,"isObjectLike",(function(){return v})),n.d(e,"isPlainObject",(function(){return g})),n.d(e,"isPrototype",(function(){return Ft})),n.d(e,"isRegExp",(function(){return Vt})),n.d(e,"isString",(function(){return k})),n.d(e,"isType",(function(){return s})),n.d(e,"isUndefined",(function(){return Gt})),n.d(e,"isElement",(function(){return qt})),n.d(e,"requestAnimationFrame",(function(){return Ut})),n.d(e,"clearAnimationFrame",(function(){return Wt})),n.d(e,"augment",(function(){return Yt})),n.d(e,"clone",(function(){return Xt})),n.d(e,"debounce",(function(){return Kt})),n.d(e,"memoize",(function(){return Jt})),n.d(e,"deepMix",(function(){return Qt})),n.d(e,"each",(function(){return d})),n.d(e,"extend",(function(){return te})),n.d(e,"indexOf",(function(){return ee})),n.d(e,"isEmpty",(function(){return re})),n.d(e,"isEqual",(function(){return oe})),n.d(e,"isEqualWith",(function(){return ae})),n.d(e,"map",(function(){return ue})),n.d(e,"mapValues",(function(){return ce})),n.d(e,"mix",(function(){return Ht})),n.d(e,"assign",(function(){return Ht})),n.d(e,"get",(function(){return fe})),n.d(e,"set",(function(){return le})),n.d(e,"pick",(function(){return de})),n.d(e,"omit",(function(){return pe})),n.d(e,"throttle",(function(){return ye})),n.d(e,"toArray",(function(){return ve})),n.d(e,"toString",(function(){return Ot})),n.d(e,"uniqueId",(function(){return me})),n.d(e,"noop",(function(){return be})),n.d(e,"identity",(function(){return _e})),n.d(e,"size",(function(){return Me})),n.d(e,"measureTextWidth",(function(){return Oe})),n.d(e,"getEllipsisText",(function(){return we})),n.d(e,"Cache",(function(){return xe}));var r=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},i=function(t,e){return!!r(t)&&t.indexOf(e)>-1},o=function(t,e){if(!r(t))return t;for(var n=[],i=0;i<t.length;i++){var o=t[i];e(o,i)&&n.push(o)}return n},a=function(t,e){return void 0===e&&(e=[]),o(t,(function(t){return!i(e,t)}))},u={}.toString,s=function(t,e){return u.call(t)==="[object "+e+"]"},c=function(t){return s(t,"Function")},f=function(t){return null==t},l=function(t){return Array.isArray?Array.isArray(t):s(t,"Array")},h=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e};var d=function(t,e){if(t)if(l(t))for(var n=0,r=t.length;n<r&&!1!==e(t[n],n);n++);else if(h(t))for(var i in t)if(t.hasOwnProperty(i)&&!1===e(t[i],i))break},p=Object.keys?function(t){return Object.keys(t)}:function(t){var e=[];return d(t,(function(n,r){c(t)&&"prototype"===r||e.push(r)})),e};var y=function(t,e){var n=p(e),r=n.length;if(f(t))return!r;for(var i=0;i<r;i+=1){var o=n[i];if(e[o]!==t[o]||!(o in t))return!1}return!0},v=function(t){return"object"==typeof t&&null!==t},g=function(t){if(!v(t)||!s(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};var m=function(t,e){if(!l(t))return null;var n;if(c(e)&&(n=e),g(e)&&(n=function(t){return y(t,e)}),n)for(var r=0;r<t.length;r+=1)if(n(t[r]))return t[r];return null};var b=function(t,e,n){void 0===n&&(n=0);for(var r=n;r<t.length;r++)if(e(t[r],r))return r;return-1},_=function(t,e){for(var n=null,r=0;r<t.length;r++){var i=t[r][e];if(!f(i)){n=l(i)?i[0]:i;break}}return n},M=function(t){if(!l(t))return[];for(var e=[],n=0;n<t.length;n++)e=e.concat(t[n]);return e},E=function(t,e){if(void 0===e&&(e=[]),l(t))for(var n=0;n<t.length;n+=1)E(t[n],e);else e.push(t);return e},T=E,O=function(t){if(l(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])},w=function(t){if(l(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},x=function(t){var e=t.filter((function(t){return!isNaN(t)}));if(!e.length)return{min:0,max:0};if(l(t[0])){for(var n=[],r=0;r<t.length;r++)n=n.concat(t[r]);e=n}var i=O(e);return{min:w(e),max:i}},A=Array.prototype,P=A.splice,C=A.indexOf,S=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r++)for(var i=e[r],o=-1;(o=C.call(t,i))>-1;)P.call(t,o,1);return t},N=Array.prototype.splice,j=function(t,e){if(!r(t))return[];for(var n=t?e.length:0,i=n-1;n--;){var o=void 0,a=e[n];n!==i&&a===o||(o=a,N.call(t,a,1))}return t},I=function(t,e,n){if(!l(t)&&!g(t))return t;var r=n;return d(t,(function(t,n){r=e(r,t,n)})),r},R=function(t,e){var n=[];if(!r(t))return n;for(var i=-1,o=[],a=t.length;++i<a;){var u=t[i];e(u,i,t)&&(n.push(u),o.push(i))}return j(t,o),n},k=function(t){return s(t,"String")};var D=function(t,e){var n;if(c(e))n=function(t,n){return e(t)-e(n)};else{var r=[];k(e)?r.push(e):l(e)&&(r=e),n=function(t,e){for(var n=0;n<r.length;n+=1){var i=r[n];if(t[i]>e[i])return 1;if(t[i]<e[i])return-1}return 0}}return t.sort(n),t};function B(t,e){void 0===e&&(e=new Map);var n=[];if(Array.isArray(t))for(var r=0,i=t.length;r<i;r++){var o=t[r];e.has(o)||(n.push(o),e.set(o,!0))}return n}var L=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return B([].concat.apply([],t))},F=function(t,e){for(var n=[],r={},i=0;i<t.length;i++){var o=t[i][e];if(!f(o)){l(o)||(o=[o]);for(var a=0;a<o.length;a++){var u=o[a];r[u]||(n.push(u),r[u]=!0)}}}return n};function V(t){if(r(t))return t[0]}function G(t){if(r(t)){return t[t.length-1]}}var q=function(t,e){return!(!l(t)&&!k(t))&&t[0]===e};var U=function(t,e){return!(!l(t)&&!k(t))&&t[t.length-1]===e},W=function(t,e){for(var n=0;n<t.length;n++)if(!e(t[n],n))return!1;return!0},z=function(t,e){for(var n=0;n<t.length;n++)if(e(t[n],n))return!0;return!1},H=Object.prototype.hasOwnProperty;var Y=function(t,e){if(!e||!l(t))return{};for(var n,r={},i=c(e)?e:function(t){return t[e]},o=0;o<t.length;o++){var a=t[o];n=i(a),H.call(r,n)?r[n].push(a):r[n]=[a]}return r};function $(t,e){if(!e)return{0:t};if(!c(e)){var n=l(e)?e:e.replace(/\s+/g,"").split("*");e=function(t){for(var e="_",r=0,i=n.length;r<i;r++)e+=t[n[r]]&&t[n[r]].toString();return e}}return Y(t,e)}var X=function(t,e){if(!e)return[t];var n=$(t,e),r=[];for(var i in n)r.push(n[i]);return r};var K=function(t,e){return t["_wrap_"+e]};var J=function(t,e){if(t["_wrap_"+e])return t["_wrap_"+e];var n=function(n){t[e](n)};return t["_wrap_"+e]=n,n},Z={};var Q=function(t){var e=Z[t];if(!e){for(var n=t.toString(16),r=n.length;r<6;r++)n="0"+n;e="#"+n,Z[t]=e}return e};var tt=function(t){var e=0,n=0,r=0,i=0;return l(t)?1===t.length?e=n=r=i=t[0]:2===t.length?(e=r=t[0],n=i=t[1]):3===t.length?(e=t[0],n=i=t[1],r=t[2]):(e=t[0],n=t[1],r=t[2],i=t[3]):e=n=r=i=t,{r1:e,r2:n,r3:r,r4:i}},et=function(t,e,n){return t<e?e:t>n?n:t},nt=function(t,e){var n=e.toString(),r=n.indexOf(".");if(-1===r)return Math.round(t);var i=n.substr(r+1).length;return i>20&&(i=20),parseFloat(t.toFixed(i))},rt=function(t){return s(t,"Number")},it=function(t){return rt(t)&&t%1!=0},ot=function(t){return rt(t)&&t%2==0},at=Number.isInteger?Number.isInteger:function(t){return rt(t)&&t%1==0},ut=function(t){return rt(t)&&t<0};function st(t,e,n){return void 0===n&&(n=1e-5),Math.abs(t-e)<n}var ct=function(t){return rt(t)&&t%2!=0},ft=function(t){return rt(t)&&t>0},lt=function(t,e){if(l(t)){for(var n,r=-1/0,i=0;i<t.length;i++){var o=t[i],a=c(e)?e(o):o[e];a>r&&(n=o,r=a)}return n}},ht=function(t,e){if(l(t)){for(var n,r=1/0,i=0;i<t.length;i++){var o=t[i],a=c(e)?e(o):o[e];a<r&&(n=o,r=a)}return n}},dt=function(t,e){return(t%e+e)%e},pt=180/Math.PI,yt=function(t){return pt*t},vt=parseInt,gt=Math.PI/180,mt=function(t){return gt*t},bt=d,_t=function(t,e){return t.hasOwnProperty(e)},Mt=_t,Et=Object.values?function(t){return Object.values(t)}:function(t){var e=[];return d(t,(function(n,r){c(t)&&"prototype"===r||e.push(n)})),e},Tt=function(t,e){return i(Et(t),e)},Ot=function(t){return f(t)?"":t.toString()},wt=function(t){return Ot(t).toLowerCase()},xt=function(t){var e=Ot(t);return e.charAt(0).toLowerCase()+e.substring(1)};var At=function(t,e){return t&&e?t.replace(/\\?\{([^{}]+)\}/g,(function(t,n){return"\\"===t.charAt(0)?t.slice(1):void 0===e[n]?"":e[n]})):t},Pt=function(t){return Ot(t).toUpperCase()},Ct=function(t){var e=Ot(t);return e.charAt(0).toUpperCase()+e.substring(1)},St={}.toString,Nt=function(t){return St.call(t).replace(/^\[object /,"").replace(/]$/,"")},jt=function(t){return s(t,"Arguments")},It=function(t){return s(t,"Boolean")},Rt=function(t){return s(t,"Date")},kt=function(t){return s(t,"Error")},Dt=function(t){return rt(t)&&isFinite(t)},Bt=function(t){return null===t},Lt=Object.prototype,Ft=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Lt)},Vt=function(t){return s(t,"RegExp")},Gt=function(t){return void 0===t},qt=function(t){return t instanceof Element||t instanceof HTMLDocument};function Ut(t){return(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return setTimeout(t,16)})(t)}function Wt(t){(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame||clearTimeout)(t)}function zt(t,e){for(var n in e)e.hasOwnProperty(n)&&"constructor"!==n&&void 0!==e[n]&&(t[n]=e[n])}function Ht(t,e,n,r){return e&&zt(t,e),n&&zt(t,n),r&&zt(t,r),t}var Yt=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=t[0],r=1;r<t.length;r++){var i=t[r];c(i)&&(i=i.prototype),Ht(n.prototype,i)}},$t=function(t){if("object"!=typeof t||null===t)return t;var e;if(l(t)){e=[];for(var n=0,r=t.length;n<r;n++)"object"==typeof t[n]&&null!=t[n]?e[n]=$t(t[n]):e[n]=t[n]}else for(var i in e={},t)"object"==typeof t[i]&&null!=t[i]?e[i]=$t(t[i]):e[i]=t[i];return e},Xt=$t;var Kt=function(t,e,n){var r;return function(){var i=this,o=arguments,a=function(){r=null,n||t.apply(i,o)},u=n&&!r;clearTimeout(r),r=setTimeout(a,e),u&&t.apply(i,o)}},Jt=function(t,e){if(!c(t))throw new TypeError("Expected a function");var n=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var u=t.apply(this,r);return a.set(o,u),u};return n.cache=new Map,n};function Zt(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(e.hasOwnProperty(i)){var o=e[i];null!==o&&g(o)?(g(t[i])||(t[i]={}),n<r?Zt(t[i],o,n+1,r):t[i]=e[i]):l(o)?(t[i]=[],t[i]=t[i].concat(o)):void 0!==o&&(t[i]=o)}}var Qt=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)Zt(t,e[r]);return t},te=function(t,e,n,r){c(e)||(n=e,e=t,t=function(){});var i=Object.create?function(t,e){return Object.create(t,{constructor:{value:e}})}:function(t,e){function n(){}n.prototype=t;var r=new n;return r.constructor=e,r},o=i(e.prototype,t);return t.prototype=Ht(o,t.prototype),t.superclass=i(e.prototype,e),Ht(o,n),Ht(t,r),t},ee=function(t,e){if(!r(t))return-1;var n=Array.prototype.indexOf;if(n)return n.call(t,e);for(var i=-1,o=0;o<t.length;o++)if(t[o]===e){i=o;break}return i},ne=Object.prototype.hasOwnProperty;var re=function(t){if(f(t))return!0;if(r(t))return!t.length;var e=Nt(t);if("Map"===e||"Set"===e)return!t.size;if(Ft(t))return!Object.keys(t).length;for(var n in t)if(ne.call(t,n))return!1;return!0},ie=function(t,e){if(t===e)return!0;if(!t||!e)return!1;if(k(t)||k(e))return!1;if(r(t)||r(e)){if(t.length!==e.length)return!1;for(var n=!0,i=0;i<t.length&&(n=ie(t[i],e[i]));i++);return n}if(v(t)||v(e)){var o=Object.keys(t),a=Object.keys(e);if(o.length!==a.length)return!1;for(n=!0,i=0;i<o.length&&(n=ie(t[o[i]],e[o[i]]));i++);return n}return!1},oe=ie,ae=function(t,e,n){return c(n)?!!n(t,e):oe(t,e)},ue=function(t,e){if(!r(t))return t;for(var n=[],i=0;i<t.length;i++){var o=t[i];n.push(e(o,i))}return n},se=function(t){return t},ce=function(t,e){void 0===e&&(e=se);var n={};return h(t)&&!f(t)&&Object.keys(t).forEach((function(r){n[r]=e(t[r],r)})),n},fe=function(t,e,n){for(var r=0,i=k(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return void 0===t||r<i.length?n:t},le=function(t,e,n){var r=t,i=k(e)?e.split("."):e;return i.forEach((function(t,e){e<i.length-1?(h(r[t])||(r[t]=rt(i[e+1])?[]:{}),r=r[t]):r[t]=n})),t},he=Object.prototype.hasOwnProperty,de=function(t,e){if(null===t||!g(t))return{};var n={};return d(e,(function(e){he.call(t,e)&&(n[e]=t[e])})),n},pe=function(t,e){return I(t,(function(t,n,r){return e.includes(r)||(t[r]=n),t}),{})},ye=function(t,e,n){var r,i,o,a,u=0;n||(n={});var s=function(){u=!1===n.leading?0:Date.now(),r=null,a=t.apply(i,o),r||(i=o=null)},c=function(){var c=Date.now();u||!1!==n.leading||(u=c);var f=e-(c-u);return i=this,o=arguments,f<=0||f>e?(r&&(clearTimeout(r),r=null),u=c,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(s,f)),a};return c.cancel=function(){clearTimeout(r),u=0,r=i=o=null},c},ve=function(t){return r(t)?Array.prototype.slice.call(t):[]},ge={},me=function(t){return ge[t=t||"g"]?ge[t]+=1:ge[t]=1,t+ge[t]},be=function(){},_e=function(t){return t};function Me(t){return f(t)?0:r(t)?t.length:Object.keys(t).length}var Ee,Te=n(1),Oe=Jt((function(t,e){void 0===e&&(e={});var n=e.fontSize,r=e.fontFamily,i=e.fontWeight,o=e.fontStyle,a=e.fontVariant;return Ee||(Ee=document.createElement("canvas").getContext("2d")),Ee.font=[o,a,i,n+"px",r].join(" "),Ee.measureText(k(t)?t:"").width}),(function(t,e){return void 0===e&&(e={}),Object(Te.__spreadArrays)([t],Et(e)).join("")})),we=function(t,e,n,r){void 0===r&&(r="...");var i,o,a=Oe(r,n),u=k(t)?t:Ot(t),s=e,c=[];if(Oe(t,n)<=e)return t;for(;i=u.substr(0,16),!((o=Oe(i,n))+a>s&&o>s);)if(c.push(i),s-=o,!(u=u.substr(16)))return c.join("");for(;i=u.substr(0,1),!((o=Oe(i,n))+a>s);)if(c.push(i),s-=o,!(u=u.substr(1)))return c.join("");return""+c.join("")+r},xe=function(){function t(){this.map={}}return t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var n=this.map[t];return void 0===n?e:n},t.prototype.set=function(t,e){this.map[t]=e},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length},t}()},function(t,e,n){"use strict";n.r(e),function(t,r){n.d(e,"Container",(function(){return j})),n.d(e,"Contribution",(function(){return G})),n.d(e,"DefaultContributionProvider",(function(){return D})),n.d(e,"GlobalContainer",(function(){return I})),n.d(e,"Module",(function(){return V})),n.d(e,"OptionSymbol",(function(){return C})),n.d(e,"Provider",(function(){return k})),n.d(e,"Syringe",(function(){return o})),n.d(e,"SyringeModule",(function(){return F})),n.d(e,"Utils",(function(){return a})),n.d(e,"contrib",(function(){return q})),n.d(e,"inject",(function(){return A})),n.d(e,"injectable",(function(){return O})),n.d(e,"named",(function(){return P})),n.d(e,"register",(function(){return R})),n.d(e,"registerSideOption",(function(){return S})),n.d(e,"singleton",(function(){return w})),n.d(e,"transient",(function(){return x}));var i,o,a,u=n(11);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 c(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){p(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}function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function h(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 d(t,e,n){return e&&h(t.prototype,e),n&&h(t,n),t}function p(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function y(t){return function(t){if(Array.isArray(t))return v(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return v(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v(t,e)}(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.")}
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.G=e():t.G=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=67)}([function(t,e,n){"use strict";n.r(e),function(t,r){n.d(e,"Container",(function(){return I})),n.d(e,"Contribution",(function(){return V})),n.d(e,"DefaultContributionProvider",(function(){return j})),n.d(e,"GlobalContainer",(function(){return R})),n.d(e,"Module",(function(){return G})),n.d(e,"OptionSymbol",(function(){return O})),n.d(e,"Provider",(function(){return D})),n.d(e,"Syringe",(function(){return o})),n.d(e,"SyringeModule",(function(){return F})),n.d(e,"Utils",(function(){return a})),n.d(e,"contrib",(function(){return U})),n.d(e,"inject",(function(){return P})),n.d(e,"injectable",(function(){return _})),n.d(e,"named",(function(){return S})),n.d(e,"register",(function(){return k})),n.d(e,"registerSideOption",(function(){return N})),n.d(e,"singleton",(function(){return x})),n.d(e,"transient",(function(){return A}));var i,o,a,s=n(5);function u(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 c(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?u(Object(n),!0).forEach((function(e){d(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function l(t){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function h(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f(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 p(t,e,n){return e&&f(t.prototype,e),n&&f(t,n),t}function d(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function y(t){return function(t){if(Array.isArray(t))return g(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return g(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return g(t,e)}(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.")}
|
|
17
2
|
/*! *****************************************************************************
|
|
18
3
|
Copyright (C) Microsoft. All rights reserved.
|
|
19
4
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
@@ -27,4 +12,4 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
|
27
12
|
|
|
28
13
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
29
14
|
and limitations under the License.
|
|
30
|
-
***************************************************************************** */()}function v(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 g(t,e){return e.lifecycle===o.Lifecycle.singleton?function(t){return t.inSingletonScope()}(t):function(t){return t.inTransientScope()}(t)}function m(t,e){t.whenTargetNamed(M(e))}function b(t,e){return e.container.bind(E(t))}function _(t,e){var n=e.container.parent,r=n&&n.isBound(E(t));return e.container.isBound(E(t))&&!r?e.container.rebind(E(t)):e.container.bind(E(t))}function M(t){return a.isDefinedToken(t)?t.symbol:t}function E(t){return a.isDefinedToken(t)?t.symbol:t}n.d(e,"decorate",(function(){return u.decorate})),n.d(e,"optional",(function(){return u.optional})),n.d(e,"postConstruct",(function(){return u.postConstruct})),n.d(e,"unmanaged",(function(){return u.unmanaged})),function(e){!function(n){var i="object"==typeof r?r:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),o=a(e);function a(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===i.Reflect?i.Reflect=e:o=a(i.Reflect,o),function(e){var n=Object.prototype.hasOwnProperty,r="function"==typeof Symbol,i=r&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",o=r&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",a="function"==typeof Object.create,u={__proto__:[]}instanceof Array,s=!a&&!u,c={create:a?function(){return I(Object.create(null))}:u?function(){return I({__proto__:null})}:function(){return I({})},has:s?function(t,e){return n.call(t,e)}:function(t,e){return e in t},get:s?function(t,e){return n.call(t,e)?t[e]:void 0}:function(t,e){return t[e]}},f=Object.getPrototypeOf(Function),l="object"==typeof t&&t.env&&"true"===t.env.REFLECT_METADATA_USE_MAP_POLYFILL,h=l||"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[o]=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,i)},e.prototype.entries=function(){return new n(this._keys,this._values,a)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[o]=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 i(t,e){return e}function a(t,e){return[t,e]}}():Map,d=l||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?function(){function t(){this._map=new h}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[o]=function(){return this.keys()},t}():Set,p=new(l||"function"!=typeof WeakMap?function(){var t=c.create(),e=r();return function(){function t(){this._key=r()}return t.prototype.has=function(t){var e=i(t,!1);return void 0!==e&&c.has(e,this._key)},t.prototype.get=function(t){var e=i(t,!1);return void 0!==e?c.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(c.has(t,e));return t[e]=!0,e}function i(t,r){if(!n.call(t,e)){if(!r)return;Object.defineProperty(t,e,{value:c.create()})}return t[e]}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 y(t,e,n){var r=p.get(t);if(M(r)){if(!n)return;r=new h,p.set(t,r)}var i=r.get(e);if(M(i)){if(!n)return;i=new h,r.set(e,i)}return i}function v(t,e,n){var r=y(e,n,!1);return!M(r)&&!!r.has(t)}function g(t,e,n){var r=y(e,n,!1);if(!M(r))return r.get(t)}function m(t,e,n,r){y(n,r,!0).set(t,e)}function b(t,e){var n=[],r=y(t,e,!1);if(M(r))return n;for(var i=function(t){var e=C(t,o);if(!A(e))throw new TypeError;var n=e.call(t);if(!T(n))throw new TypeError;return n}(r.keys()),a=0;;){var u=S(i);if(!u)return n.length=a,n;var s=u.value;try{n[a]=s}catch(t){try{N(i)}finally{throw t}}a++}}function _(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 M(t){return void 0===t}function E(t){return null===t}function T(t){return"object"==typeof t?null!==t:"function"==typeof t}function O(t,e){switch(_(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var n=3===e?"string":5===e?"number":"default",r=C(t,i);if(void 0!==r){var o=r.call(t,n);if(T(o))throw new TypeError;return o}return function(t,e){if("string"===e){var n=t.toString;if(A(n))if(!T(i=n.call(t)))return i;if(A(r=t.valueOf))if(!T(i=r.call(t)))return i}else{var r;if(A(r=t.valueOf))if(!T(i=r.call(t)))return i;var i,o=t.toString;if(A(o))if(!T(i=o.call(t)))return i}throw new TypeError}(t,"default"===n?"number":n)}function w(t){var e=O(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function x(t){return Array.isArray?Array.isArray(t):t instanceof Object?t instanceof Array:"[object Array]"===Object.prototype.toString.call(t)}function A(t){return"function"==typeof t}function P(t){return"function"==typeof t}function C(t,e){var n=t[e];if(null!=n){if(!A(n))throw new TypeError;return n}}function S(t){var e=t.next();return!e.done&&e}function N(t){var e=t.return;e&&e.call(t)}function j(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===f)return e;if(e!==f)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 I(t){return t.__=void 0,delete t.__,t}e("decorate",(function(t,e,n,r){if(M(n)){if(!x(t))throw new TypeError;if(!P(e))throw new TypeError;return function(t,e){for(var n=t.length-1;n>=0;--n){var r=(0,t[n])(e);if(!M(r)&&!E(r)){if(!P(r))throw new TypeError;e=r}}return e}(t,e)}if(!x(t))throw new TypeError;if(!T(e))throw new TypeError;if(!T(r)&&!M(r)&&!E(r))throw new TypeError;return E(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(!M(o)&&!E(o)){if(!T(o))throw new TypeError;r=o}}return r}(t,e,n=w(n),r)})),e("metadata",(function(t,e){return function(n,r){if(!T(n))throw new TypeError;if(!M(r)&&!function(t){switch(_(t)){case 3:case 4:return!0;default:return!1}}(r))throw new TypeError;m(t,e,n,r)}})),e("defineMetadata",(function(t,e,n,r){if(!T(n))throw new TypeError;return M(r)||(r=w(r)),m(t,e,n,r)})),e("hasMetadata",(function(t,e,n){if(!T(e))throw new TypeError;return M(n)||(n=w(n)),function t(e,n,r){if(v(e,n,r))return!0;var i=j(n);return!E(i)&&t(e,i,r)}(t,e,n)})),e("hasOwnMetadata",(function(t,e,n){if(!T(e))throw new TypeError;return M(n)||(n=w(n)),v(t,e,n)})),e("getMetadata",(function(t,e,n){if(!T(e))throw new TypeError;return M(n)||(n=w(n)),function t(e,n,r){if(v(e,n,r))return g(e,n,r);var i=j(n);return E(i)?void 0:t(e,i,r)}(t,e,n)})),e("getOwnMetadata",(function(t,e,n){if(!T(e))throw new TypeError;return M(n)||(n=w(n)),g(t,e,n)})),e("getMetadataKeys",(function(t,e){if(!T(t))throw new TypeError;return M(e)||(e=w(e)),function t(e,n){var r=b(e,n),i=j(e);if(null===i)return r;var o=t(i,n);if(o.length<=0)return r;if(r.length<=0)return o;for(var a=new d,u=[],s=0,c=r;s<c.length;s++){var f=c[s];a.has(f)||(a.add(f),u.push(f))}for(var l=0,h=o;l<h.length;l++){f=h[l];a.has(f)||(a.add(f),u.push(f))}return u}(t,e)})),e("getOwnMetadataKeys",(function(t,e){if(!T(t))throw new TypeError;return M(e)||(e=w(e)),b(t,e)})),e("deleteMetadata",(function(t,e,n){if(!T(e))throw new TypeError;M(n)||(n=w(n));var r=y(e,n,!1);if(M(r))return!1;if(!r.delete(t))return!1;if(r.size>0)return!0;var i=p.get(e);return i.delete(n),i.size>0||p.delete(e),!0}))}(o)}()}(i||(i={})),function(t){t.defineToken=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{multiple:!0};return new t.DefinedToken(e,n)};var e;t.DefinedToken=function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};l(this,t),this.prototype={},this.name=void 0,this.multiple=void 0,this.symbol=void 0;var r=n.multiple,i=void 0!==r&&r;this.name=e,this.symbol=Symbol(this.name),this.multiple=i},t.isModule=function(t){return!!t&&"object"===f(t)&&"id"in t&&"registry"in t},function(t){t.singleton="singleton",t.transient="transient"}(e=t.Lifecycle||(t.Lifecycle={})),t.ClassOptionSymbol=Symbol("SyringeClassOptionSymbol"),t.DefaultOption={lifecycle:e.transient}}(o||(o={})),function(t){t.maybeArrayToArray=function(t){return t instanceof Array?t:void 0!==t?[t]:[]},t.isClass=function(t){return!(!t||"function"!=typeof t||!("prototype"in t))},t.isDefinedToken=function(t){return!!(t&&"object"===f(t)&&"symbol"in t&&"multiple"in t)},t.isInjectOption=function(t){return!(!t||"object"!==f(t)||!("token"in t))},t.isNamedToken=function(t){return!!(t&&"object"===f(t)&&"token"in t&&"named"in t)},t.isMultipleEnabled=function(e){return t.isDefinedToken(e)&&e.multiple}}(a||(a={}));var T=new u.Container;function O(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=Object(u.injectable)();return function(n){Reflect.defineMetadata(o.ClassOptionSymbol,c(c({},t),{},{target:n}),n),e(n)}}function w(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return O(c(c({},t),{},{lifecycle:o.Lifecycle.singleton}))}function x(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return O(c(c({},t),{},{lifecycle:o.Lifecycle.transient}))}function A(t){return Object(u.inject)(E(t))}function P(t){return Object(u.named)(M(t))}var C=Symbol("SyringeOptionSymbol"),S=function(t,e){Reflect.defineMetadata(C,t,e)};var N=function(){function t(e,n,r){l(this,t),this.token=void 0,this.rawToken=void 0,this.named=void 0,this.generalToken=void 0,this.option=void 0,this.context=void 0,this.mutiple=void 0,this.context=e,this.token=n,this.option=r,this.rawToken=a.isNamedToken(n)?n.token:n,this.named=a.isNamedToken(n)?n.named:void 0,this.mutiple=!!this.named||a.isMultipleEnabled(this.rawToken),this.generalToken=this.rawToken}return d(t,[{key:"resolve",value:function(){var t,e=this,n=this.context;(t=n)&&"object"===f(t)&&"container"in t&&"inversify"in t&&(this.mutiple?this.resolveMutilple(n):(this.resolveMono(n),!this.named&&this.option.contrib.length>0&&this.option.contrib.forEach((function(t){a.isMultipleEnabled(t)?b(t,n).toService(e.generalToken):_(t,n).toService(e.generalToken)}))))}},{key:"resolveMono",value:function(t){var e=this;if("useValue"in this.option)return _(this.generalToken,t).toConstantValue(this.option.useValue);if(this.option.useDynamic.length>0){var n=this.option.useDynamic[this.option.useDynamic.length-1];return g(_(this.generalToken,t).toDynamicValue((function(){return n({container:e.context})})),this.option)}if(this.option.useFactory.length>0){var r=this.option.useFactory[this.option.useFactory.length-1];return _(this.generalToken,t).toFactory((function(){return r({container:e.context})}))}if(this.option.useClass.length>0){var i=this.option.useClass[this.option.useClass.length-1];return g(_(this.generalToken,t).to(i),this.option)}}},{key:"resolveMutilple",value:function(t){var e=this,n=this.option.useClass.map((function(n){return g(b(e.generalToken,t).to(n),e.option)})),r=this.option.useDynamic.map((function(n){return g(b(e.generalToken,t).toDynamicValue((function(){return n({container:e.context})})),e.option)})),i=this.option.useFactory.map((function(n){return b(e.generalToken,t).toFactory((function(){return n({container:e.context})}))})),o="useValue"in this.option?b(this.generalToken,t).toConstantValue(this.option.useValue):void 0;this.named&&(n.forEach((function(t){return e.named&&m(t,e.named)})),r.forEach((function(t){return e.named&&m(t,e.named)})),i.forEach((function(t){return e.named&&m(t,e.named)})),o&&m(o,this.named))}}],[{key:"resolveTarget",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{try{var i=Reflect.getMetadata(C,n);i&&t.resolveOption(e,i)}catch(t){}if(a.isClass(n))if(r.useClass){var u=a.maybeArrayToArray(r.useClass);u.unshift(n),r.useClass=u}else r.useClass=[n];var s;try{s=Reflect.getMetadata(o.ClassOptionSymbol,n)}catch(t){}if((s=c(c({},s||{}),r)).token){var f=a.maybeArrayToArray(s.token);f.unshift(n),s.token=f}else s.token=[n];t.resolveOption(e,s)}catch(t){}}},{key:"resolveOption",value:function(e,n){var r=function(t){var e=a.maybeArrayToArray(t.token),n=a.maybeArrayToArray(t.useClass),r=a.maybeArrayToArray(t.useDynamic),i=a.maybeArrayToArray(t.useFactory),u=a.maybeArrayToArray(t.contrib),s=t.lifecycle||o.Lifecycle.transient,c={token:e,useClass:n,lifecycle:u.length>0?o.Lifecycle.singleton:s,contrib:u,useDynamic:r,useFactory:i};return"useValue"in t&&(c.useValue=t.useValue),c}(c(c({},t.globalConfig),n));(0!==r.useClass.length||0!==r.useDynamic.length||0!==r.useFactory.length||"useValue"in r)&&r.token.forEach((function(n){new t(e,n,c({},r)).resolve()}))}}]),t}();N.globalConfig=o.DefaultOption;var j=function(){function t(e){l(this,t),this.loadedModules=[],this.container=void 0,this.inversify=!0,this.parent=void 0,this.container=e||new u.Container}return d(t,[{key:"load",value:function(t,e){!e&&this.loadedModules.includes(t.id)||(t.registry(this.register.bind(this),this.resolveContext()),this.loadedModules.push(t.id))}},{key:"remove",value:function(t){return this.container.unbind(E(t))}},{key:"get",value:function(t){return this.container.get(E(t))}},{key:"getNamed",value:function(t,e){return this.container.getNamed(E(t),M(e))}},{key:"getAll",value:function(t){return this.container.getAll(E(t))}},{key:"getAllNamed",value:function(t,e){return this.container.getAllNamed(E(t),M(e))}},{key:"isBound",value:function(t){return this.container.isBound(E(t))}},{key:"isBoundNamed",value:function(t,e){return this.container.isBoundNamed(E(t),M(e))}},{key:"createChild",value:function(){var e=new t(this.container.createChild());return e.parent=this,e}},{key:"register",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};a.isInjectOption(t)?N.resolveOption(this,t):N.resolveTarget(this,t,e)}},{key:"resolveContext",value:function(){return{container:this}}}],[{key:"config",value:function(t){N.globalConfig=t}}]),t}(),I=new j(T),R=I.register.bind(I),k=o.defineToken("ContributionProvider"),D=function(){function t(e,n,r){l(this,t),this.option={recursive:!1,cache:!0},this.services=void 0,this.serviceIdentifier=void 0,this.container=void 0,this.container=n,this.serviceIdentifier=e,r&&(this.option=c(c({},this.option),r))}return d(t,[{key:"setServices",value:function(t){for(var e=[],n=this.container;n;){if(n.isBound(this.serviceIdentifier)){var r=n.getAll(this.serviceIdentifier);e.push.apply(e,y(r))}n=t?n.parent:void 0}return e}},{key:"getContributions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=c(c({},this.option),t),n=e.cache,r=e.recursive;return n&&void 0!==this.services||(this.services=this.setServices(!!r)),this.services}}]),t}();function B(t,e){return{token:{token:k,named:t},useDynamic:function(n){return new D(t,n.container,e)},lifecycle:o.Lifecycle.singleton}}function L(t,e,n){t({token:{token:k,named:e},useDynamic:function(t){return new D(e,t.container,n)},lifecycle:o.Lifecycle.singleton})}var F=function(){function t(e){l(this,t),this.id=void 0,this.baseRegistry=void 0,this.optionCollection=void 0,t.moduleId+=1,this.id=t.moduleId,this.baseRegistry=e}return d(t,[{key:"registry",get:function(){var t=this;return function(e,n){t.baseRegistry&&t.baseRegistry(e,n),t.optionCollection&&t.optionCollection.forEach((function(t){return e(t)}))}}},{key:"options",get:function(){return this.optionCollection||(this.optionCollection=[]),this.optionCollection}},{key:"register",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.forEach((function(e){return t.options.push(e)})),this}},{key:"contribution",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.forEach((function(e){return t.options.push(B(e))})),this}}]),t}();function V(t){return new F(t)}F.moduleId=0;var G,q=function(t){return function(e,n,r){P(t)(e,n,r),A(k)(e,n,r)}};!function(t){t.Provider=k,t.register=L}(G||(G={}))}.call(this,n(36),n(37))},function(t,e,n){"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]},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Arc",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"Cubic",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"Line",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"Polygon",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"Polyline",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"Quad",{enumerable:!0,get:function(){return i.default}}),e.Util=void 0;var i=h(n(82)),o=h(n(83)),a=h(n(84)),u=h(n(21)),s=h(n(86)),c=h(n(35)),f=function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!==r(t)&&"function"!=typeof t)return{default:t};var n=l(e);if(n&&n.has(t))return n.get(t);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&Object.prototype.hasOwnProperty.call(t,a)){var u=o?Object.getOwnPropertyDescriptor(t,a):null;u&&(u.get||u.set)?Object.defineProperty(i,a,u):i[a]=t[a]}i.default=t,n&&n.set(t,i);return i}(n(14));function l(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(l=function(t){return t?n:e})(t)}function h(t){return t&&t.__esModule?t:{default:t}}e.Util=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={containerModule:!0,Component:!0,EntityManager:!0,Entity:!0,World:!0,Matcher:!0};Object.defineProperty(e,"Component",{enumerable:!0,get:function(){return u.Component}}),Object.defineProperty(e,"Entity",{enumerable:!0,get:function(){return f.Entity}}),Object.defineProperty(e,"EntityManager",{enumerable:!0,get:function(){return c.EntityManager}}),Object.defineProperty(e,"Matcher",{enumerable:!0,get:function(){return p.Matcher}}),Object.defineProperty(e,"World",{enumerable:!0,get:function(){return l.World}}),e.containerModule=void 0;var i=n(3),o=n(16),a=n(64),u=n(65),s=n(19),c=n(20),f=n(66),l=n(67),h=n(30),d=n(31),p=n(68),y=n(69);Object.keys(y).forEach((function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(r,t)||t in e&&e[t]===y[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return y[t]}}))}));var v=(0,i.Module)((function(t){(0,i.decorate)((0,i.injectable)(),o.EventEmitter),t({token:s.IDENTIFIER.ComponentRegistry,useFactory:function(t){return function(e){t.container.register(e)}}}),t({token:s.IDENTIFIER.SystemRegistry,useDynamic:function(t){return{register:function(e){t.container.register(e)},get:function(e){return t.container.get(e)},has:function(e){return t.container.isBound(e)}}}}),t({token:s.IDENTIFIER.ComponentPoolFactory,useFactory:function(t){var e={};return function(n){var r=e[n.tag];return r||((r=t.container.get(a.ObjectPool)).init((function(){if(!t.container.isBound(n))throw new Error('Component "'+n.tag+'" is not registered, please call registerComponent() first.');return t.container.get(n)}),10),e[n.tag]=r),r}}}),t({token:s.IDENTIFIER.EntityPoolFactory,useFactory:function(t){var e;return function(){return e||(e=t.container.get(a.ObjectPool)).init((function(){return t.container.get(f.Entity)}),10),e}}}),t(c.EntityManager),t(h.ComponentManager),t(d.SystemManager),t(f.Entity),t(a.ObjectPool),t(l.World)}));e.containerModule=v},function(t,e,n){"use strict";e.__esModule=!0,e.SyncHook=n(70),e.SyncBailHook=n(71),e.SyncWaterfallHook=n(72),e.SyncLoopHook=n(73),e.AsyncParallelHook=n(74),e.AsyncParallelBailHook=n(75),e.AsyncSeriesHook=n(76),e.AsyncSeriesBailHook=n(77),e.AsyncSeriesLoopHook=n(78),e.AsyncSeriesWaterfallHook=n(79),e.HookMap=n(80),e.MultiHook=n(81)},function(t,e,n){"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"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;var r=n(4),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},function(t,e,n){"use strict";const r=n(32).deprecate(()=>{},"Hook.context is deprecated and will be removed"),i=function(...t){return this.call=this._createCall("sync"),this.call(...t)},o=function(...t){return this.callAsync=this._createCall("async"),this.callAsync(...t)},a=function(...t){return this.promise=this._createCall("promise"),this.promise(...t)};class u{constructor(t=[],e){this._args=t,this.name=e,this.taps=[],this.interceptors=[],this._call=i,this.call=i,this._callAsync=o,this.callAsync=o,this._promise=a,this.promise=a,this._x=void 0,this.compile=this.compile,this.tap=this.tap,this.tapAsync=this.tapAsync,this.tapPromise=this.tapPromise}compile(t){throw new Error("Abstract: should be overridden")}_createCall(t){return this.compile({taps:this.taps,interceptors:this.interceptors,args:this._args,type:t})}_tap(t,e,n){if("string"==typeof e)e={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof e.name||""===e.name)throw new Error("Missing name for tap");void 0!==e.context&&r(),e=Object.assign({type:t,fn:n},e),e=this._runRegisterInterceptors(e),this._insert(e)}tap(t,e){this._tap("sync",t,e)}tapAsync(t,e){this._tap("async",t,e)}tapPromise(t,e){this._tap("promise",t,e)}_runRegisterInterceptors(t){for(const e of this.interceptors)if(e.register){const n=e.register(t);void 0!==n&&(t=n)}return t}withOptions(t){const e=e=>Object.assign({},t,"string"==typeof e?{name:e}:e);return{name:this.name,tap:(t,n)=>this.tap(e(t),n),tapAsync:(t,n)=>this.tapAsync(e(t),n),tapPromise:(t,n)=>this.tapPromise(e(t),n),intercept:t=>this.intercept(t),isUsed:()=>this.isUsed(),withOptions:t=>this.withOptions(e(t))}}isUsed(){return this.taps.length>0||this.interceptors.length>0}intercept(t){if(this._resetCompilation(),this.interceptors.push(Object.assign({},t)),t.register)for(let e=0;e<this.taps.length;e++)this.taps[e]=t.register(this.taps[e])}_resetCompilation(){this.call=this._call,this.callAsync=this._callAsync,this.promise=this._promise}_insert(t){let e;this._resetCompilation(),"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let n=0;"number"==typeof t.stage&&(n=t.stage);let r=this.taps.length;for(;r>0;){r--;const t=this.taps[r];this.taps[r+1]=t;const i=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(i>n)){r++;break}}this.taps[r]=t}}Object.setPrototypeOf(u.prototype,null),t.exports=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.multiBindToService=e.getServiceIdentifierAsString=e.typeConstraint=e.namedConstraint=e.taggedConstraint=e.traverseAncerstors=e.decorate=e.id=e.MetadataReader=e.postConstruct=e.targetName=e.multiInject=e.unmanaged=e.optional=e.LazyServiceIdentifer=e.inject=e.named=e.tagged=e.injectable=e.ContainerModule=e.AsyncContainerModule=e.TargetTypeEnum=e.BindingTypeEnum=e.BindingScopeEnum=e.Container=e.METADATA_KEY=void 0;var r=n(4);e.METADATA_KEY=r;var i=n(38);Object.defineProperty(e,"Container",{enumerable:!0,get:function(){return i.Container}});var o=n(13);Object.defineProperty(e,"BindingScopeEnum",{enumerable:!0,get:function(){return o.BindingScopeEnum}}),Object.defineProperty(e,"BindingTypeEnum",{enumerable:!0,get:function(){return o.BindingTypeEnum}}),Object.defineProperty(e,"TargetTypeEnum",{enumerable:!0,get:function(){return o.TargetTypeEnum}});var a=n(54);Object.defineProperty(e,"AsyncContainerModule",{enumerable:!0,get:function(){return a.AsyncContainerModule}}),Object.defineProperty(e,"ContainerModule",{enumerable:!0,get:function(){return a.ContainerModule}});var u=n(55);Object.defineProperty(e,"injectable",{enumerable:!0,get:function(){return u.injectable}});var s=n(56);Object.defineProperty(e,"tagged",{enumerable:!0,get:function(){return s.tagged}});var c=n(57);Object.defineProperty(e,"named",{enumerable:!0,get:function(){return c.named}});var f=n(26);Object.defineProperty(e,"inject",{enumerable:!0,get:function(){return f.inject}}),Object.defineProperty(e,"LazyServiceIdentifer",{enumerable:!0,get:function(){return f.LazyServiceIdentifer}});var l=n(58);Object.defineProperty(e,"optional",{enumerable:!0,get:function(){return l.optional}});var h=n(59);Object.defineProperty(e,"unmanaged",{enumerable:!0,get:function(){return h.unmanaged}});var d=n(60);Object.defineProperty(e,"multiInject",{enumerable:!0,get:function(){return d.multiInject}});var p=n(61);Object.defineProperty(e,"targetName",{enumerable:!0,get:function(){return p.targetName}});var y=n(62);Object.defineProperty(e,"postConstruct",{enumerable:!0,get:function(){return y.postConstruct}});var v=n(24);Object.defineProperty(e,"MetadataReader",{enumerable:!0,get:function(){return v.MetadataReader}});var g=n(17);Object.defineProperty(e,"id",{enumerable:!0,get:function(){return g.id}});var m=n(15);Object.defineProperty(e,"decorate",{enumerable:!0,get:function(){return m.decorate}});var b=n(29);Object.defineProperty(e,"traverseAncerstors",{enumerable:!0,get:function(){return b.traverseAncerstors}}),Object.defineProperty(e,"taggedConstraint",{enumerable:!0,get:function(){return b.taggedConstraint}}),Object.defineProperty(e,"namedConstraint",{enumerable:!0,get:function(){return b.namedConstraint}}),Object.defineProperty(e,"typeConstraint",{enumerable:!0,get:function(){return b.typeConstraint}});var _=n(18);Object.defineProperty(e,"getServiceIdentifierAsString",{enumerable:!0,get:function(){return _.getServiceIdentifierAsString}});var M=n(63);Object.defineProperty(e,"multiBindToService",{enumerable:!0,get:function(){return M.multiBindToService}})},function(t,e,n){"use strict";t.exports=class{constructor(t){this.config=t,this.options=void 0,this._args=void 0}create(t){let e;switch(this.init(t),this.options.type){case"sync":e=new Function(this.args(),'"use strict";\n'+this.header()+this.contentWithInterceptors({onError:t=>`throw ${t};\n`,onResult:t=>`return ${t};\n`,resultReturns:!0,onDone:()=>"",rethrowIfPossible:!0}));break;case"async":e=new Function(this.args({after:"_callback"}),'"use strict";\n'+this.header()+this.contentWithInterceptors({onError:t=>`_callback(${t});\n`,onResult:t=>`_callback(null, ${t});\n`,onDone:()=>"_callback();\n"}));break;case"promise":let t=!1;const n=this.contentWithInterceptors({onError:e=>(t=!0,`_error(${e});\n`),onResult:t=>`_resolve(${t});\n`,onDone:()=>"_resolve();\n"});let r="";r+='"use strict";\n',r+=this.header(),r+="return new Promise((function(_resolve, _reject) {\n",t&&(r+="var _sync = true;\n",r+="function _error(_err) {\n",r+="if(_sync)\n",r+="_resolve(Promise.resolve().then((function() { throw _err; })));\n",r+="else\n",r+="_reject(_err);\n",r+="};\n"),r+=n,t&&(r+="_sync = false;\n"),r+="}));\n",e=new Function(this.args(),r)}return this.deinit(),e}setup(t,e){t._x=e.taps.map(t=>t.fn)}init(t){this.options=t,this._args=t.args.slice()}deinit(){this.options=void 0,this._args=void 0}contentWithInterceptors(t){if(this.options.interceptors.length>0){const e=t.onError,n=t.onResult,r=t.onDone;let i="";for(let t=0;t<this.options.interceptors.length;t++){const e=this.options.interceptors[t];e.call&&(i+=`${this.getInterceptor(t)}.call(${this.args({before:e.context?"_context":void 0})});\n`)}return i+=this.content(Object.assign(t,{onError:e&&(t=>{let n="";for(let e=0;e<this.options.interceptors.length;e++){this.options.interceptors[e].error&&(n+=`${this.getInterceptor(e)}.error(${t});\n`)}return n+=e(t),n}),onResult:n&&(t=>{let e="";for(let n=0;n<this.options.interceptors.length;n++){this.options.interceptors[n].result&&(e+=`${this.getInterceptor(n)}.result(${t});\n`)}return e+=n(t),e}),onDone:r&&(()=>{let t="";for(let e=0;e<this.options.interceptors.length;e++){this.options.interceptors[e].done&&(t+=this.getInterceptor(e)+".done();\n")}return t+=r(),t})})),i}return this.content(t)}header(){let t="";return this.needContext()?t+="var _context = {};\n":t+="var _context;\n",t+="var _x = this._x;\n",this.options.interceptors.length>0&&(t+="var _taps = this.taps;\n",t+="var _interceptors = this.interceptors;\n"),t}needContext(){for(const t of this.options.taps)if(t.context)return!0;return!1}callTap(t,{onError:e,onResult:n,onDone:r,rethrowIfPossible:i}){let o="",a=!1;for(let e=0;e<this.options.interceptors.length;e++){const n=this.options.interceptors[e];n.tap&&(a||(o+=`var _tap${t} = ${this.getTap(t)};\n`,a=!0),o+=`${this.getInterceptor(e)}.tap(${n.context?"_context, ":""}_tap${t});\n`)}o+=`var _fn${t} = ${this.getTapFn(t)};\n`;const u=this.options.taps[t];switch(u.type){case"sync":i||(o+=`var _hasError${t} = false;\n`,o+="try {\n"),o+=n?`var _result${t} = _fn${t}(${this.args({before:u.context?"_context":void 0})});\n`:`_fn${t}(${this.args({before:u.context?"_context":void 0})});\n`,i||(o+="} catch(_err) {\n",o+=`_hasError${t} = true;\n`,o+=e("_err"),o+="}\n",o+=`if(!_hasError${t}) {\n`),n&&(o+=n("_result"+t)),r&&(o+=r()),i||(o+="}\n");break;case"async":let a="";a+=n?`(function(_err${t}, _result${t}) {\n`:`(function(_err${t}) {\n`,a+=`if(_err${t}) {\n`,a+=e("_err"+t),a+="} else {\n",n&&(a+=n("_result"+t)),r&&(a+=r()),a+="}\n",a+="})",o+=`_fn${t}(${this.args({before:u.context?"_context":void 0,after:a})});\n`;break;case"promise":o+=`var _hasResult${t} = false;\n`,o+=`var _promise${t} = _fn${t}(${this.args({before:u.context?"_context":void 0})});\n`,o+=`if (!_promise${t} || !_promise${t}.then)\n`,o+=` throw new Error('Tap function (tapPromise) did not return promise (returned ' + _promise${t} + ')');\n`,o+=`_promise${t}.then((function(_result${t}) {\n`,o+=`_hasResult${t} = true;\n`,n&&(o+=n("_result"+t)),r&&(o+=r()),o+=`}), function(_err${t}) {\n`,o+=`if(_hasResult${t}) throw _err${t};\n`,o+=e("_err"+t),o+="});\n"}return o}callTapsSeries({onError:t,onResult:e,resultReturns:n,onDone:r,doneReturns:i,rethrowIfPossible:o}){if(0===this.options.taps.length)return r();const a=this.options.taps.findIndex(t=>"sync"!==t.type),u=n||i;let s="",c=r,f=0;for(let n=this.options.taps.length-1;n>=0;n--){const i=n;c!==r&&("sync"!==this.options.taps[i].type||f++>20)&&(f=0,s+=`function _next${i}() {\n`,s+=c(),s+="}\n",c=()=>`${u?"return ":""}_next${i}();\n`);const l=c,h=t=>t?"":r(),d=this.callTap(i,{onError:e=>t(i,e,l,h),onResult:e&&(t=>e(i,t,l,h)),onDone:!e&&l,rethrowIfPossible:o&&(a<0||i<a)});c=()=>d}return s+=c(),s}callTapsLooping({onError:t,onDone:e,rethrowIfPossible:n}){if(0===this.options.taps.length)return e();const r=this.options.taps.every(t=>"sync"===t.type);let i="";r||(i+="var _looper = (function() {\n",i+="var _loopAsync = false;\n"),i+="var _loop;\n",i+="do {\n",i+="_loop = false;\n";for(let t=0;t<this.options.interceptors.length;t++){const e=this.options.interceptors[t];e.loop&&(i+=`${this.getInterceptor(t)}.loop(${this.args({before:e.context?"_context":void 0})});\n`)}return i+=this.callTapsSeries({onError:t,onResult:(t,e,n,i)=>{let o="";return o+=`if(${e} !== undefined) {\n`,o+="_loop = true;\n",r||(o+="if(_loopAsync) _looper();\n"),o+=i(!0),o+="} else {\n",o+=n(),o+="}\n",o},onDone:e&&(()=>{let t="";return t+="if(!_loop) {\n",t+=e(),t+="}\n",t}),rethrowIfPossible:n&&r}),i+="} while(_loop);\n",r||(i+="_loopAsync = true;\n",i+="});\n",i+="_looper();\n"),i}callTapsParallel({onError:t,onResult:e,onDone:n,rethrowIfPossible:r,onTap:i=((t,e)=>e())}){if(this.options.taps.length<=1)return this.callTapsSeries({onError:t,onResult:e,onDone:n,rethrowIfPossible:r});let o="";o+="do {\n",o+=`var _counter = ${this.options.taps.length};\n`,n&&(o+="var _done = (function() {\n",o+=n(),o+="});\n");for(let a=0;a<this.options.taps.length;a++){const u=()=>n?"if(--_counter === 0) _done();\n":"--_counter;",s=t=>t||!n?"_counter = 0;\n":"_counter = 0;\n_done();\n";o+="if(_counter <= 0) break;\n",o+=i(a,()=>this.callTap(a,{onError:e=>{let n="";return n+="if(_counter > 0) {\n",n+=t(a,e,u,s),n+="}\n",n},onResult:e&&(t=>{let n="";return n+="if(_counter > 0) {\n",n+=e(a,t,u,s),n+="}\n",n}),onDone:!e&&(()=>u()),rethrowIfPossible:r}),u,s)}return o+="} while(false);\n",o}args({before:t,after:e}={}){let n=this._args;return t&&(n=[t].concat(n)),e&&(n=n.concat(e)),0===n.length?"":n.join(", ")}getTapFn(t){return`_x[${t}]`}getTap(t){return`_taps[${t}]`}getInterceptor(t){return`_interceptors[${t}]`}}},function(t,e,n){"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"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.distance=function(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)},e.getBBoxByArray=function(t,e){var n=(0,r.min)(t),i=(0,r.min)(e),o=(0,r.max)(t),a=(0,r.max)(e);return{x:n,y:i,width:o-n,height:a-i}},e.getBBoxRange=function(t,e,n,i){return{minX:(0,r.min)([t,n]),maxX:(0,r.max)([t,n]),minY:(0,r.min)([e,i]),maxY:(0,r.max)([e,i])}},e.isNumberEqual=function(t,e){return Math.abs(t-e)<.001},e.piMod=function(t){return(t+2*Math.PI)%(2*Math.PI)};var r=n(2)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tagProperty=e.tagParameter=e.decorate=void 0;var r=n(8),i=n(4);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)}},function(t,e,n){"use strict";var r=Object.prototype.hasOwnProperty,i="~";function o(){}function a(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function u(t,e,n,r,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var u=new a(n,r||t,o),s=i?i+e:e;return t._events[s]?t._events[s].fn?t._events[s]=[t._events[s],u]:t._events[s].push(u):(t._events[s]=u,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new o:delete t._events[e]}function c(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(i=!1)),c.prototype.eventNames=function(){var t,e,n=[];if(0===this._eventsCount)return n;for(e in t=this._events)r.call(t,e)&&n.push(i?e.slice(1):e);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},c.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,o=n.length,a=new Array(o);r<o;r++)a[r]=n[r].fn;return a},c.prototype.listenerCount=function(t){var e=i?i+t:t,n=this._events[e];return n?n.fn?1:n.length:0},c.prototype.emit=function(t,e,n,r,o,a){var u=i?i+t:t;if(!this._events[u])return!1;var s,c,f=this._events[u],l=arguments.length;if(f.fn){switch(f.once&&this.removeListener(t,f.fn,void 0,!0),l){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,e),!0;case 3:return f.fn.call(f.context,e,n),!0;case 4:return f.fn.call(f.context,e,n,r),!0;case 5:return f.fn.call(f.context,e,n,r,o),!0;case 6:return f.fn.call(f.context,e,n,r,o,a),!0}for(c=1,s=new Array(l-1);c<l;c++)s[c-1]=arguments[c];f.fn.apply(f.context,s)}else{var h,d=f.length;for(c=0;c<d;c++)switch(f[c].once&&this.removeListener(t,f[c].fn,void 0,!0),l){case 1:f[c].fn.call(f[c].context);break;case 2:f[c].fn.call(f[c].context,e);break;case 3:f[c].fn.call(f[c].context,e,n);break;case 4:f[c].fn.call(f[c].context,e,n,r);break;default:if(!s)for(h=1,s=new Array(l-1);h<l;h++)s[h-1]=arguments[h];f[c].fn.apply(f[c].context,s)}}return!0},c.prototype.on=function(t,e,n){return u(this,t,e,n,!1)},c.prototype.once=function(t,e,n){return u(this,t,e,n,!0)},c.prototype.removeListener=function(t,e,n,r){var o=i?i+t:t;if(!this._events[o])return this;if(!e)return s(this,o),this;var a=this._events[o];if(a.fn)a.fn!==e||r&&!a.once||n&&a.context!==n||s(this,o);else{for(var u=0,c=[],f=a.length;u<f;u++)(a[u].fn!==e||r&&!a[u].once||n&&a[u].context!==n)&&c.push(a[u]);c.length?this._events[o]=1===c.length?c[0]:c:s(this,o)}return this},c.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&s(this,e)):(this._events=new o,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=i,c.EventEmitter=c,t.exports=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.id=void 0;var r=0;e.id=function(){return r++}},function(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(8);function i(t){return"function"==typeof t?t.name:"symbol"==typeof t?t.toString():t}function o(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=o(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(function t(e,n){return null!==e.parentRequest&&(e.parentRequest.serviceIdentifier===n||t(e.parentRequest,n))}(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=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IDENTIFIER=void 0;e.IDENTIFIER={EventEmitter:"EventEmitter",ComponentRegistry:"ComponentRegistry",ComponentManager:"ComponentManager",ComponentPoolFactory:"ComponentPoolFactory",ComponentPool:"ComponentPool",ObjectFactory:"ObjectFactory",EntityPoolFactory:"EntityPoolFactory",System:"System",SystemRegistry:"SystemRegistry"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EntityManager=e.ENTITY_EVENT=e.COMPONENT_EVENT=void 0;var r=n(1),i=n(16),o=n(3),a=n(19),u={Created:"Created"};e.ENTITY_EVENT=u;var s={Added:"Added",Remove:"Remove"};e.COMPONENT_EVENT=s;var c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.entities=[],e.entitiesByNames={},e.matcherCache={},e}return(0,r.__extends)(e,t),e.prototype.getEntityByName=function(t){return this.entitiesByNames[t]},e.prototype.getAllEntities=function(){return this.entities},e.prototype.queryByMatcher=function(t){var e=t.hash();return this.matcherCache[e]||(this.matcherCache[e]=this.entities.filter((function(e){return t.matches(e)}))),this.matcherCache[e]},e.prototype.createEntity=function(t){var e=t.getName();if(e){if(this.entitiesByNames[e])throw new Error("Entity name '"+e+"' already exist");this.entitiesByNames[e]=t}return this.entities.push(t),this.emit(u.Created,t),t},e.prototype.destroyEntity=function(t){t.getName()&&delete this.entitiesByNames[t.getName()];var e=this.entities.indexOf(t);e>-1&&this.entities.splice(e,1),this.matcherCache={}},e.prototype.addComponentToEntity=function(t,e,n){var r=e.tag,i=t.getComponents(),o=i[r];if(o){if(!t.cast(o,e))throw new Error('There are multiple classes with the same tag or name "'+r+'".\nAdd a different property "tag" to one of them.');delete i[r]}return o=this.componentPoolFactory(e).acquire(),n&&o.copy(n),i[r]=o,this.emit(s.Added,t,o),this.matcherCache={},o},e.prototype.removeComponentFromEntity=function(t,e,n){void 0===n&&(n=!1),t.hasComponent(e)&&(this.emit(s.Remove,t,e),n&&this.removeComponentFromEntitySync(t,e),this.matcherCache={})},e.prototype.destroy=function(){this.entities=[],this.entitiesByNames={}},e.prototype.removeComponentFromEntitySync=function(t,e){var n=t.getComponent(e);delete t.getComponents()[e.tag],n.destroy()},(0,r.__decorate)([(0,o.inject)(a.IDENTIFIER.ComponentPoolFactory),(0,r.__metadata)("design:type",Function)],e.prototype,"componentPoolFactory",void 0),e=(0,r.__decorate)([(0,o.singleton)()],e)}(i.EventEmitter);e.EntityManager=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n(14),i=n(0),o={box:function(t,e,n,i){return(0,r.getBBoxByArray)([t,n],[e,i])},length:function(t,e,n,i){return(0,r.distance)(t,e,n,i)},pointAt:function(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}},pointDistance:function(t,e,n,i,o,a){var u=(n-t)*(o-t)+(i-e)*(a-e);return u<0?(0,r.distance)(t,e,o,a):u>(n-t)*(n-t)+(i-e)*(i-e)?(0,r.distance)(n,i,o,a):this.pointToLine(t,e,n,i,o,a)},pointToLine:function(t,e,n,r,o,a){var u=[n-t,r-e];if(i.vec2.exactEquals(u,[0,0]))return Math.sqrt((o-t)*(o-t)+(a-e)*(a-e));var s=[-u[1],u[0]];i.vec2.normalize(s,s);var c=[o-t,a-e];return Math.abs(i.vec2.dot(c,s))},tangentAngle:function(t,e,n,r){return Math.atan2(r-e,n-t)}};e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingOnSyntax=void 0;var r=n(23),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},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenSyntax=void 0;var r=n(22),i=n(29),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},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MetadataReader=void 0;var r=n(4),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},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isStackOverflowExeption=void 0;var r=n(8);e.isStackOverflowExeption=function(t){return t instanceof RangeError||t.message===r.STACK_OVERFLOW}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.inject=e.LazyServiceIdentifer=void 0;var r=n(8),i=n(4),o=n(9),a=n(15),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)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Target=void 0;var r=n(4),i=n(17),o=n(9),a=n(45),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},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenOnSyntax=void 0;var r=n(22),i=n(23),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},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.typeConstraint=e.namedConstraint=e.taggedConstraint=e.traverseAncerstors=void 0;var r=n(4),i=n(9),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}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ComponentManager=void 0;var r=n(1),i=n(3),o=n(19),a=function(){function t(){}return t.prototype.registerComponent=function(t){this.registry(t)},(0,r.__decorate)([(0,i.inject)(o.IDENTIFIER.ComponentRegistry),(0,r.__metadata)("design:type",Function)],t.prototype,"registry",void 0),t=(0,r.__decorate)([(0,i.singleton)()],t)}();e.ComponentManager=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SystemManager=void 0;var r=n(1),i=n(3),o=n(20),a=n(19),u=function(){function t(){this.systems=[]}return t.prototype.registerSystem=function(t){if(!this.registry.has(t)){this.registry.register(t);var e=this.registry.get(t),n=e.constructor;e.initialize?e.initialize():e.initialized=!0,this.entityManager.on(o.COMPONENT_EVENT.Added,(function(t){e.onEntityAdded&&n.trigger&&n.trigger.matches(t)&&e.onEntityAdded(t)})),this.entityManager.on(o.COMPONENT_EVENT.Remove,(function(t){e.onEntityRemoved&&n.trigger&&n.trigger.matches(t)&&e.onEntityRemoved(t)})),this.systems.push(e),this.systems.sort((function(t,e){return(t.constructor.priority||0)-(e.constructor.priority||0)}))}},t.prototype.execute=function(t,e){var n,i;try{for(var o=(0,r.__values)(this.systems),a=o.next();!a.done;a=o.next()){var u=a.value;u.initialized&&u.execute&&u.execute(this.getEntities(u),t,e)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}},t.prototype.destroy=function(){var t=this;this.systems.forEach((function(e){e.initialized&&e.tearDown&&e.tearDown(t.getEntities(e))}))},t.prototype.getEntities=function(t){var e=t.constructor;return e.trigger?this.entityManager.queryByMatcher(e.trigger):this.entityManager.getAllEntities()},(0,r.__decorate)([(0,i.inject)(a.IDENTIFIER.SystemRegistry),(0,r.__metadata)("design:type",Object)],t.prototype,"registry",void 0),(0,r.__decorate)([(0,i.inject)(o.EntityManager),(0,r.__metadata)("design:type",o.EntityManager)],t.prototype,"entityManager",void 0),t=(0,r.__decorate)([(0,i.singleton)()],t)}();e.SystemManager=u},function(t,e,n){"use strict";e.deprecate=(t,e)=>{let n=!0;return function(){return n&&(console.warn("DeprecationWarning: "+e),n=!1),t.apply(this,arguments)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.nearestPoint=function(t,e,n,i,o,a){var u=-1,s=1/0,c=[n,i],f=20;a&&a>200&&(f=a/10);for(var l=1/f,h=l/10,d=0;d<=f;d++){var p=d*l,y=[o.apply(null,t.concat([p])),o.apply(null,e.concat([p]))];(b=(0,r.distance)(c[0],c[1],y[0],y[1]))<s&&(u=p,s=b)}if(0===u)return{x:t[0],y:e[0]};if(1===u){var v=t.length;return{x:t[v-1],y:e[v-1]}}s=1/0;for(d=0;d<32&&!(h<1e-4);d++){var g=u-h,m=u+h,b=(y=[o.apply(null,t.concat([g])),o.apply(null,e.concat([g]))],(0,r.distance)(c[0],c[1],y[0],y[1]));if(g>=0&&b<s)u=g,s=b;else{var _=[o.apply(null,t.concat([m])),o.apply(null,e.concat([m]))],M=(0,r.distance)(c[0],c[1],_[0],_[1]);m<=1&&M<s?(u=m,s=M):h*=.5}}return{x:o.apply(null,t.concat([u])),y:o.apply(null,e.concat([u]))}},e.snapLength=function(t,e){for(var n=0,i=t.length,o=0;o<i;o++){var a=t[o],u=e[o],s=t[(o+1)%i],c=e[(o+1)%i];n+=(0,r.distance)(a,u,s,c)}return n/2};var r=n(14)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.angleAtSegments=function(t,e){if(e>1||e<0||t.length<2)return 0;for(var n=a(t),r=n.segments,i=n.totalLength,o=0,u=0,s=0;s<r.length;s++){var c=r[s],f=c.from,l=c.to,h=c.length/i;if(e>=o&&e<=o+h){u=Math.atan2(l[1]-f[1],l[0]-f[0]);break}o+=h}return u},e.distanceAtSegment=function(t,e,n){for(var r=1/0,o=0;o<t.length-1;o++){var a=t[o],u=t[o+1],s=i.default.pointDistance(a[0],a[1],u[0],u[1],e,n);s<r&&(r=s)}return r},e.lengthOfSegment=function(t){if(t.length<2)return 0;for(var e=0,n=0;n<t.length-1;n++){var r=t[n],i=t[n+1];e+=(0,o.distance)(r[0],r[1],i[0],i[1])}return e},e.pointAtSegments=function(t,e){if(e>1||e<0||t.length<2)return null;var n=a(t),r=n.segments,o=n.totalLength;if(0===o)return{x:t[0][0],y:t[0][1]};for(var u=0,s=null,c=0;c<r.length;c++){var f=r[c],l=f.from,h=f.to,d=f.length/o;if(e>=u&&e<=u+d){var p=(e-u)/d;s=i.default.pointAt(l[0],l[1],h[0],h[1],p);break}u+=d}return s};var r,i=(r=n(21))&&r.__esModule?r:{default:r},o=n(14);function a(t){for(var e=0,n=[],r=0;r<t.length-1;r++){var i=t[r],a=t[r+1],u=(0,o.distance)(i[0],i[1],a[0],a[1]),s={from:i,to:a,length:u};n.push(s),e+=u}return{segments:n,totalLength:e}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n(34),i=n(14),o={box:function(t){for(var e=[],n=[],r=0;r<t.length;r++){var o=t[r];e.push(o[0]),n.push(o[1])}return(0,i.getBBoxByArray)(e,n)},length:function(t){return(0,r.lengthOfSegment)(t)},pointAt:function(t,e){return(0,r.pointAtSegments)(t,e)},pointDistance:function(t,e,n){return(0,r.distanceAtSegment)(t,e,n)},tangentAngle:function(t,e){return(0,r.angleAtSegments)(t,e)}};e.default=o},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var s,c=[],f=!1,l=-1;function h(){f&&s&&(f=!1,s.length?c=s.concat(c):l=-1,c.length&&d())}function d(){if(!f){var t=u(h);f=!0;for(var e=c.length;e;){for(s=c,c=[];++l<e;)s&&s[l].run();l=-1,e=c.length}s=null,f=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function y(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new p(t,e)),1!==c.length||f||u(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=y,i.addListener=y,i.once=y,i.off=y,i.removeListener=y,i.removeAllListeners=y,i.emit=y,i.prependListener=y,i.prependOnceListener=y,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},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=a.trys,(i=i.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(39),u=n(8),s=n(13),c=n(4),f=n(24),l=n(40),h=n(47),d=n(49),p=n(17),y=n(18),v=n(52),g=n(53),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 g.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+" "+y.getServiceIdentifierAsString(t))}},t.prototype.unbindAll=function(){this._bindingDictionary=new g.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(v.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},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Binding=void 0;var r=n(13),i=n(17),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},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getBindingDictionary=e.createMockRequest=e.plan=void 0;var r=n(41),i=n(8),o=n(13),a=n(4),u=n(25),s=n(18),c=n(42),f=n(9),l=n(43),h=n(44),d=n(46),p=n(27);function y(t){return t._bindingDictionary}function v(t,e,n,o,a){var u=g(n.container,a.serviceIdentifier),c=[];return u.length===r.BindingCount.NoBindingsAvailable&&n.container.options.autoBindInjectable&&"function"==typeof a.serviceIdentifier&&t.getConstructorMetadata(a.serviceIdentifier).compilerGeneratedMetadata&&(n.container.bind(a.serviceIdentifier).toSelf(),u=g(n.container,a.serviceIdentifier)),c=e?u:u.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,g),new Error(u);case r.BindingCount.OnlyOneBindingAvailable:if(!n.isArray())return e;case r.BindingCount.MultipleBindingsAvailable:default:if(n.isArray())return e;a=s.getServiceIdentifierAsString(t),u=i.AMBIGUOUS_MATCH+" "+a;throw u+=s.listRegisteredBindingsForServiceIdentifier(o,a,g),new Error(u)}}(a.serviceIdentifier,c,a,n.container),c}function g(t,e){var n=[],r=y(t);return r.hasKey(e)?n=r.get(e):null!==t.parent&&(n=g(t.parent,e)),n}e.getBindingDictionary=y,e.plan=function(t,e,n,r,y,g,m,b){void 0===b&&(b=!1);var _=new c.Context(e),M=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,r,n,s);if(void 0!==i){var l=new f.Metadata(i,o);c.metadata.push(l)}return c}(n,r,y,"",g,m);try{return function t(e,n,r,a,u,s){var c,f;if(null===u){c=v(e,n,a,null,s),f=new d.Request(r,a,null,c,s);var p=new l.Plan(a,f);a.addPlan(p)}else c=v(e,n,a,u,s),f=u.addChildRequest(s.serviceIdentifier,c,s);c.forEach((function(n){var r=null;if(s.isArray())r=f.addChildRequest(n.serviceIdentifier,n,s);else{if(n.cache)return;r=f}if(n.type===o.BindingTypeEnum.Instance&&null!==n.implementationType){var u=h.getDependencies(e,n.implementationType);if(!a.container.options.skipBaseClassChecks){var c=h.getBaseClassDependencyCount(e,n.implementationType);if(u.length<c){var l=i.ARGUMENTS_LENGTH_MISMATCH(h.getFunctionName(n.implementationType));throw new Error(l)}}u.forEach((function(n){t(e,!1,n.serviceIdentifier,a,r,n)}))}}))}(t,b,y,_,null,M),_}catch(t){throw u.isStackOverflowExeption(t)&&_.plan&&s.circularDependencyToException(_.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)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingCount=void 0;e.BindingCount={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Context=void 0;var r=n(17),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},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Plan=void 0;var r=function(t,e){this.parentContext=t,this.rootRequest=e};e.Plan=r},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(26),o=n(8),a=n(13),u=n(4),s=n(18);Object.defineProperty(e,"getFunctionName",{enumerable:!0,get:function(){return s.getFunctionName}});var c=n(27);function f(t,e,n,i){var u=t.getConstructorMetadata(n),s=u.compilerGeneratedMetadata;if(void 0===s){var f=o.MISSING_INJECTABLE_ANNOTATION+" "+e+".";throw new Error(f)}var d=u.userGeneratedMetadata,p=Object.keys(d),y=0===n.length&&p.length>0,v=p.length>n.length,g=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,s,d,y||v?p.length:n.length),m=function t(e,n){for(var i=e.getPropertiesMetadata(n),o=[],u=Object.keys(i),s=0,f=u;s<f.length;s++){var l=f[s],d=i[l],p=h(i[l]),y=p.targetName||l,v=p.inject||p.multiInject,g=new c.Target(a.TargetTypeEnum.ClassProperty,y,v);g.metadata=d,o.push(g)}var m=Object.getPrototypeOf(n.prototype).constructor;if(m!==Object){var b=t(e,m);o=r(r([],o),b)}return o}(t,n);return r(r([],g),m)}function l(t,e,n,r,u){var s=u[t.toString()]||[],f=h(s),l=!0!==f.unmanaged,d=r[t],p=f.inject||f.multiInject;if((d=p||d)instanceof i.LazyServiceIdentifer&&(d=d.unwrap()),l){if(!e&&(d===Object||d===Function||void 0===d)){var y=o.MISSING_INJECT_ANNOTATION+" argument "+t+" in class "+n+".";throw new Error(y)}var v=new c.Target(a.TargetTypeEnum.ConstructorArgument,f.targetName,d);return v.metadata=s,v}return null}function h(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}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QueryableString=void 0;var r=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=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Request=void 0;var r=n(17),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},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.resolve=void 0;var r=n(8),i=n(13),o=n(25),a=n(18),u=n(48),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,y=d.scope===i.BindingScopeEnum.Request;if(p&&d.activated)return d.cache;if(y&&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 v=a.getServiceIdentifierAsString(e.serviceIdentifier);throw new Error(r.INVALID_BINDING_TYPE+" "+v)}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),y&&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)}},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(8),o=n(13),a=n(4);e.resolveInstance=function(t,e,n){var u,s,c=null;if(e.length>0){var f=e.filter((function(t){return null!==t.target&&t.target.type===o.TargetTypeEnum.ConstructorArgument})).map(n);s=f,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)}else 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}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingToSyntax=void 0;var r=n(8),i=n(13),o=n(50),a=n(28),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},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInWhenOnSyntax=void 0;var r=n(51),i=n(22),o=n(23),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},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInSyntax=void 0;var r=n(13),i=n(28),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},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContainerSnapshot=void 0;var r=function(){function t(){}return t.of=function(e,n){var r=new t;return r.bindings=e,r.middleware=n,r},t}();e.ContainerSnapshot=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Lookup=void 0;var r=n(8),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},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AsyncContainerModule=e.ContainerModule=void 0;var r=n(17),i=function(t){this.id=r.id(),this.registry=t};e.ContainerModule=i;var o=function(t){this.id=r.id(),this.registry=t};e.AsyncContainerModule=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.injectable=void 0;var r=n(8),i=n(4);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}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tagged=void 0;var r=n(9),i=n(15);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)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.named=void 0;var r=n(4),i=n(9),o=n(15);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)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.optional=void 0;var r=n(4),i=n(9),o=n(15);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)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.unmanaged=void 0;var r=n(4),i=n(9),o=n(15);e.unmanaged=function(){return function(t,e,n){var a=new i.Metadata(r.UNMANAGED_TAG,!0);o.tagParameter(t,e,n,a)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.multiInject=void 0;var r=n(4),i=n(9),o=n(15);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)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.targetName=void 0;var r=n(4),i=n(9),o=n(15);e.targetName=function(t){return function(e,n,a){var u=new i.Metadata(r.NAME_TAG,t);o.tagParameter(e,n,a,u)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.postConstruct=void 0;var r=n(8),i=n(4),o=n(9);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)}}},function(t,e,n){"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)}))}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ObjectPool=void 0;var r=n(1),i=n(3),o=function(){function t(){this.count=0,this.freeList=[]}return t.prototype.init=function(t,e){this.objectFactory=t,void 0!==e&&this.expand(e)},t.prototype.acquire=function(){return this.freeList.length<=0&&this.expand(Math.round(.2*this.count)+1),this.freeList.pop()},t.prototype.release=function(t){t.reset(),this.freeList.push(t)},t.prototype.expand=function(t){for(var e=0;e<t;e++){var n=this.objectFactory();this.freeList.push(n)}this.count+=t},t=(0,r.__decorate)([(0,i.injectable)()],t)}();e.ObjectPool=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Component=void 0;var r=n(1),i=n(3),o=0,a=function(){function t(){this.pid=o++}var e;return e=t,t.prototype.getId=function(){return this.pid},t.prototype.copy=function(t){return Object.assign(this,t),this},t.prototype.clone=function(){return(new e).copy(this)},t.prototype.reset=function(){},t.prototype.destroy=function(){},t=e=(0,r.__decorate)([(0,i.transient)()],t)}();e.Component=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Entity=void 0;var r=n(1),i=n(3),o=n(20),a=0,u=function(){function t(){this.id=a++,this.components={}}return t.prototype.getId=function(){return this.id},t.prototype.getComponents=function(){return this.components},t.prototype.setName=function(t){this.name=t},t.prototype.getName=function(){return this.name||""+this.id},t.prototype.getComponent=function(t){return this.components[t.tag]},t.prototype.hasComponent=function(t){return!!~Object.keys(this.components).indexOf(t.tag)},t.prototype.hasAllComponents=function(t){var e=this;return t.every((function(t){return e.hasComponent(t)}))},t.prototype.hasAnyComponents=function(t){var e=this;return t.some((function(t){return e.hasComponent(t)}))},t.prototype.addComponent=function(t,e){return this.entityManager.addComponentToEntity(this,t,e)},t.prototype.removeComponent=function(t,e){return void 0===e&&(e=!1),this.entityManager.removeComponentFromEntity(this,t,e),this},t.prototype.reset=function(){},t.prototype.destroy=function(){this.entityManager.destroyEntity(this)},t.prototype.cast=function(t,e){return!!(t&&t instanceof e)},(0,r.__decorate)([(0,i.inject)(o.EntityManager),(0,r.__metadata)("design:type",o.EntityManager)],t.prototype,"entityManager",void 0),t=(0,r.__decorate)([(0,i.injectable)()],t)}();e.Entity=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.World=void 0;var r=n(1),i=n(3),o=n(30),a=n(20),u=n(19),s=n(31),c=function(){function t(){this.lastMillis=(new Date).getTime(),this.enabled=!0}return t.prototype.createEntity=function(t){void 0===t&&(t="");var e=this.entityPoolFactory().acquire();return e.setName(t),this.entityManager.createEntity(e)},t.prototype.getEntityByName=function(t){return this.entityManager.getEntityByName(t)},t.prototype.registerComponent=function(t){return this.componentManager.registerComponent(t),this},t.prototype.registerSystem=function(t){return this.systemManager.registerSystem(t),this},t.prototype.execute=function(t,e){t||(t=(e=(new Date).getTime())-this.lastMillis,this.lastMillis=e),this.enabled&&this.systemManager.execute(t,e)},t.prototype.stop=function(){this.enabled=!1},t.prototype.resume=function(){this.enabled=!0},t.prototype.destroy=function(){this.systemManager.destroy(),this.entityManager.destroy()},(0,r.__decorate)([(0,i.inject)(u.IDENTIFIER.EntityPoolFactory),(0,r.__metadata)("design:type",Function)],t.prototype,"entityPoolFactory",void 0),(0,r.__decorate)([(0,i.inject)(a.EntityManager),(0,r.__metadata)("design:type",a.EntityManager)],t.prototype,"entityManager",void 0),(0,r.__decorate)([(0,i.inject)(o.ComponentManager),(0,r.__metadata)("design:type",o.ComponentManager)],t.prototype,"componentManager",void 0),(0,r.__decorate)([(0,i.inject)(s.SystemManager),(0,r.__metadata)("design:type",s.SystemManager)],t.prototype,"systemManager",void 0),t=(0,r.__decorate)([(0,i.singleton)()],t)}();e.World=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Matcher=void 0;var r=n(1),i=function(){function t(){this.allOfComponentCtors=[],this.anyOfComponentCtors=[],this.noneOfComponentCtors=[]}return t.prototype.allOf=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this.allOfComponentCtors=t,this},t.prototype.anyOf=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this.anyOfComponentCtors=t,this},t.prototype.noneOf=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this.noneOfComponentCtors=t,this},t.prototype.matches=function(t){var e=!this.allOfComponentCtors.length||t.hasAllComponents(this.allOfComponentCtors),n=!this.anyOfComponentCtors.length||t.hasAnyComponents(this.anyOfComponentCtors),r=!this.noneOfComponentCtors.length||!t.hasAnyComponents(this.noneOfComponentCtors);return e&&n&&r},t.prototype.hash=function(){return(0,r.__spreadArray)((0,r.__spreadArray)((0,r.__spreadArray)([],(0,r.__read)(this.allOfComponentCtors),!1),(0,r.__read)(this.anyOfComponentCtors),!1),(0,r.__read)(this.noneOfComponentCtors),!1).map((function(t){return t.tag})).join()},t}();e.Matcher=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.System=void 0;e.System="System"},function(t,e,n){"use strict";const r=n(10),i=n(12);const o=new class extends i{content({onError:t,onDone:e,rethrowIfPossible:n}){return this.callTapsSeries({onError:(e,n)=>t(n),onDone:e,rethrowIfPossible:n})}},a=()=>{throw new Error("tapAsync is not supported on a SyncHook")},u=()=>{throw new Error("tapPromise is not supported on a SyncHook")},s=function(t){return o.setup(this,t),o.create(t)};function c(t=[],e){const n=new r(t,e);return n.constructor=c,n.tapAsync=a,n.tapPromise=u,n.compile=s,n}c.prototype=null,t.exports=c},function(t,e,n){"use strict";const r=n(10),i=n(12);const o=new class extends i{content({onError:t,onResult:e,resultReturns:n,onDone:r,rethrowIfPossible:i}){return this.callTapsSeries({onError:(e,n)=>t(n),onResult:(t,n,r)=>`if(${n} !== undefined) {\n${e(n)};\n} else {\n${r()}}\n`,resultReturns:n,onDone:r,rethrowIfPossible:i})}},a=()=>{throw new Error("tapAsync is not supported on a SyncBailHook")},u=()=>{throw new Error("tapPromise is not supported on a SyncBailHook")},s=function(t){return o.setup(this,t),o.create(t)};function c(t=[],e){const n=new r(t,e);return n.constructor=c,n.tapAsync=a,n.tapPromise=u,n.compile=s,n}c.prototype=null,t.exports=c},function(t,e,n){"use strict";const r=n(10),i=n(12);const o=new class extends i{content({onError:t,onResult:e,resultReturns:n,rethrowIfPossible:r}){return this.callTapsSeries({onError:(e,n)=>t(n),onResult:(t,e,n)=>{let r="";return r+=`if(${e} !== undefined) {\n`,r+=`${this._args[0]} = ${e};\n`,r+="}\n",r+=n(),r},onDone:()=>e(this._args[0]),doneReturns:n,rethrowIfPossible:r})}},a=()=>{throw new Error("tapAsync is not supported on a SyncWaterfallHook")},u=()=>{throw new Error("tapPromise is not supported on a SyncWaterfallHook")},s=function(t){return o.setup(this,t),o.create(t)};function c(t=[],e){if(t.length<1)throw new Error("Waterfall hooks must have at least one argument");const n=new r(t,e);return n.constructor=c,n.tapAsync=a,n.tapPromise=u,n.compile=s,n}c.prototype=null,t.exports=c},function(t,e,n){"use strict";const r=n(10),i=n(12);const o=new class extends i{content({onError:t,onDone:e,rethrowIfPossible:n}){return this.callTapsLooping({onError:(e,n)=>t(n),onDone:e,rethrowIfPossible:n})}},a=()=>{throw new Error("tapAsync is not supported on a SyncLoopHook")},u=()=>{throw new Error("tapPromise is not supported on a SyncLoopHook")},s=function(t){return o.setup(this,t),o.create(t)};function c(t=[],e){const n=new r(t,e);return n.constructor=c,n.tapAsync=a,n.tapPromise=u,n.compile=s,n}c.prototype=null,t.exports=c},function(t,e,n){"use strict";const r=n(10),i=n(12);const o=new class extends i{content({onError:t,onDone:e}){return this.callTapsParallel({onError:(e,n,r,i)=>t(n)+i(!0),onDone:e})}},a=function(t){return o.setup(this,t),o.create(t)};function u(t=[],e){const n=new r(t,e);return n.constructor=u,n.compile=a,n._call=void 0,n.call=void 0,n}u.prototype=null,t.exports=u},function(t,e,n){"use strict";const r=n(10),i=n(12);const o=new class extends i{content({onError:t,onResult:e,onDone:n}){let r="";return r+=`var _results = new Array(${this.options.taps.length});\n`,r+="var _checkDone = function() {\n",r+="for(var i = 0; i < _results.length; i++) {\n",r+="var item = _results[i];\n",r+="if(item === undefined) return false;\n",r+="if(item.result !== undefined) {\n",r+=e("item.result"),r+="return true;\n",r+="}\n",r+="if(item.error) {\n",r+=t("item.error"),r+="return true;\n",r+="}\n",r+="}\n",r+="return false;\n",r+="}\n",r+=this.callTapsParallel({onError:(t,e,n,r)=>{let i="";return i+=`if(${t} < _results.length && ((_results.length = ${t+1}), (_results[${t}] = { error: ${e} }), _checkDone())) {\n`,i+=r(!0),i+="} else {\n",i+=n(),i+="}\n",i},onResult:(t,e,n,r)=>{let i="";return i+=`if(${t} < _results.length && (${e} !== undefined && (_results.length = ${t+1}), (_results[${t}] = { result: ${e} }), _checkDone())) {\n`,i+=r(!0),i+="} else {\n",i+=n(),i+="}\n",i},onTap:(t,e,n,r)=>{let i="";return t>0&&(i+=`if(${t} >= _results.length) {\n`,i+=n(),i+="} else {\n"),i+=e(),t>0&&(i+="}\n"),i},onDone:n}),r}},a=function(t){return o.setup(this,t),o.create(t)};function u(t=[],e){const n=new r(t,e);return n.constructor=u,n.compile=a,n._call=void 0,n.call=void 0,n}u.prototype=null,t.exports=u},function(t,e,n){"use strict";const r=n(10),i=n(12);const o=new class extends i{content({onError:t,onDone:e}){return this.callTapsSeries({onError:(e,n,r,i)=>t(n)+i(!0),onDone:e})}},a=function(t){return o.setup(this,t),o.create(t)};function u(t=[],e){const n=new r(t,e);return n.constructor=u,n.compile=a,n._call=void 0,n.call=void 0,n}u.prototype=null,t.exports=u},function(t,e,n){"use strict";const r=n(10),i=n(12);const o=new class extends i{content({onError:t,onResult:e,resultReturns:n,onDone:r}){return this.callTapsSeries({onError:(e,n,r,i)=>t(n)+i(!0),onResult:(t,n,r)=>`if(${n} !== undefined) {\n${e(n)}\n} else {\n${r()}}\n`,resultReturns:n,onDone:r})}},a=function(t){return o.setup(this,t),o.create(t)};function u(t=[],e){const n=new r(t,e);return n.constructor=u,n.compile=a,n._call=void 0,n.call=void 0,n}u.prototype=null,t.exports=u},function(t,e,n){"use strict";const r=n(10),i=n(12);const o=new class extends i{content({onError:t,onDone:e}){return this.callTapsLooping({onError:(e,n,r,i)=>t(n)+i(!0),onDone:e})}},a=function(t){return o.setup(this,t),o.create(t)};function u(t=[],e){const n=new r(t,e);return n.constructor=u,n.compile=a,n._call=void 0,n.call=void 0,n}u.prototype=null,t.exports=u},function(t,e,n){"use strict";const r=n(10),i=n(12);const o=new class extends i{content({onError:t,onResult:e,onDone:n}){return this.callTapsSeries({onError:(e,n,r,i)=>t(n)+i(!0),onResult:(t,e,n)=>{let r="";return r+=`if(${e} !== undefined) {\n`,r+=`${this._args[0]} = ${e};\n`,r+="}\n",r+=n(),r},onDone:()=>e(this._args[0])})}},a=function(t){return o.setup(this,t),o.create(t)};function u(t=[],e){if(t.length<1)throw new Error("Waterfall hooks must have at least one argument");const n=new r(t,e);return n.constructor=u,n.compile=a,n._call=void 0,n.call=void 0,n}u.prototype=null,t.exports=u},function(t,e,n){"use strict";const r=n(32),i=(t,e)=>e;class o{constructor(t,e){this._map=new Map,this.name=e,this._factory=t,this._interceptors=[]}get(t){return this._map.get(t)}for(t){const e=this.get(t);if(void 0!==e)return e;let n=this._factory(t);const r=this._interceptors;for(let e=0;e<r.length;e++)n=r[e].factory(t,n);return this._map.set(t,n),n}intercept(t){this._interceptors.push(Object.assign({factory:i},t))}}o.prototype.tap=r.deprecate((function(t,e,n){return this.for(t).tap(e,n)}),"HookMap#tap(key,…) is deprecated. Use HookMap#for(key).tap(…) instead."),o.prototype.tapAsync=r.deprecate((function(t,e,n){return this.for(t).tapAsync(e,n)}),"HookMap#tapAsync(key,…) is deprecated. Use HookMap#for(key).tapAsync(…) instead."),o.prototype.tapPromise=r.deprecate((function(t,e,n){return this.for(t).tapPromise(e,n)}),"HookMap#tapPromise(key,…) is deprecated. Use HookMap#for(key).tapPromise(…) instead."),t.exports=o},function(t,e,n){"use strict";n(10);class r{constructor(t,e){this.hooks=t,this.name=e}tap(t,e){for(const n of this.hooks)n.tap(t,e)}tapAsync(t,e){for(const n of this.hooks)n.tapAsync(t,e)}tapPromise(t,e){for(const n of this.hooks)n.tapPromise(t,e)}isUsed(){for(const t of this.hooks)if(t.isUsed())return!0;return!1}intercept(t){for(const e of this.hooks)e.intercept(t)}withOptions(t){return new r(this.hooks.map(e=>e.withOptions(t)),this.name)}}t.exports=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=(r=n(21))&&r.__esModule?r:{default:r},o=n(14),a=n(33);function u(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function s(t,e,n){var r=t+n-2*e;if((0,o.isNumberEqual)(r,0))return[.5];var i=(t-e)/r;return i<=1&&i>=0?[i]:[]}function c(t,e,n,r){return 2*(1-r)*(e-t)+2*r*(n-e)}function f(t,e,n,r,o,a,s){var c=u(t,n,o,s),f=u(e,r,a,s),l=i.default.pointAt(t,e,n,r,s),h=i.default.pointAt(n,r,o,a,s);return[[t,e,l.x,l.y,c,f],[c,f,h.x,h.y,o,a]]}var l={box:function(t,e,n,r,i,a){var c=s(t,n,i)[0],f=s(e,r,a)[0],l=[t,i],h=[e,a];return void 0!==c&&l.push(u(t,n,i,c)),void 0!==f&&h.push(u(e,r,a,f)),(0,o.getBBoxByArray)(l,h)},length:function(t,e,n,r,i,a){return function t(e,n,r,i,a,u,s){if(0===s)return((0,o.distance)(e,n,r,i)+(0,o.distance)(r,i,a,u)+(0,o.distance)(e,n,a,u))/2;var c=f(e,n,r,i,a,u,.5),l=c[0],h=c[1];return l.push(s-1),h.push(s-1),t.apply(null,l)+t.apply(null,h)}(t,e,n,r,i,a,3)},nearestPoint:function(t,e,n,r,i,o,s,c){return(0,a.nearestPoint)([t,n,i],[e,r,o],s,c,u)},pointDistance:function(t,e,n,r,i,a,u,s){var c=this.nearestPoint(t,e,n,r,i,a,u,s);return(0,o.distance)(c.x,c.y,u,s)},interpolationAt:u,pointAt:function(t,e,n,r,i,o,a){return{x:u(t,n,i,a),y:u(e,r,o,a)}},divide:function(t,e,n,r,i,o,a){return f(t,e,n,r,i,o,a)},tangentAngle:function(t,e,n,r,i,a,u){var s=c(t,n,i,u),f=c(e,r,a,u),l=Math.atan2(f,s);return(0,o.piMod)(l)}};e.default=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=n(1),o=n(14),a=(r=n(21))&&r.__esModule?r:{default:r},u=n(33);function s(t,e,n,r,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*n*i*i*o+r*i*i*i}function c(t,e,n,r,i){var o=1-i;return 3*(o*o*(e-t)+2*o*i*(n-e)+i*i*(r-n))}function f(t,e,n,r){var i,a,u,s=-3*t+9*e-9*n+3*r,c=6*t-12*e+6*n,f=3*e-3*t,l=[];if((0,o.isNumberEqual)(s,0))(0,o.isNumberEqual)(c,0)||(i=-f/c)>=0&&i<=1&&l.push(i);else{var h=c*c-4*s*f;(0,o.isNumberEqual)(h,0)?l.push(-c/(2*s)):h>0&&(a=(-c-(u=Math.sqrt(h)))/(2*s),(i=(-c+u)/(2*s))>=0&&i<=1&&l.push(i),a>=0&&a<=1&&l.push(a))}return l}function l(t,e,n,r,i,o,u,c,f){var l=s(t,n,i,u,f),h=s(e,r,o,c,f),d=a.default.pointAt(t,e,n,r,f),p=a.default.pointAt(n,r,i,o,f),y=a.default.pointAt(i,o,u,c,f),v=a.default.pointAt(d.x,d.y,p.x,p.y,f),g=a.default.pointAt(p.x,p.y,y.x,y.y,f);return[[t,e,d.x,d.y,v.x,v.y,l,h],[l,h,g.x,g.y,y.x,y.y,u,c]]}var h={extrema:f,box:function(t,e,n,r,i,a,u,c){for(var l=[t,u],h=[e,c],d=f(t,n,i,u),p=f(e,r,a,c),y=0;y<d.length;y++)l.push(s(t,n,i,u,d[y]));for(y=0;y<p.length;y++)h.push(s(e,r,a,c,p[y]));return(0,o.getBBoxByArray)(l,h)},length:function(t,e,n,r,o,a,s,c){return function t(e,n,r,o,a,s,c,f,h){if(0===h)return(0,u.snapLength)([e,r,a,c],[n,o,s,f]);var d=l(e,n,r,o,a,s,c,f,.5),p=(0,i.__spreadArray)((0,i.__spreadArray)([],(0,i.__read)(d[0]),!1),[h-1],!1),y=(0,i.__spreadArray)((0,i.__spreadArray)([],(0,i.__read)(d[1]),!1),[h-1],!1);return t.apply(null,p)+t.apply(null,y)}(t,e,n,r,o,a,s,c,3)},nearestPoint:function(t,e,n,r,i,o,a,c,f,l,h){return(0,u.nearestPoint)([t,n,i,a],[e,r,o,c],f,l,s,h)},pointDistance:function(t,e,n,r,i,a,u,s,c,f,l){var h=this.nearestPoint(t,e,n,r,i,a,u,s,c,f,l);return(0,o.distance)(h.x,h.y,c,f)},interpolationAt:s,pointAt:function(t,e,n,r,i,o,a,u,c){return{x:s(t,n,i,a,c),y:s(e,r,o,u,c)}},divide:function(t,e,n,r,i,o,a,u,s){return l(t,e,n,r,i,o,a,u,s)},tangentAngle:function(t,e,n,r,i,a,u,s,f){var l=c(t,n,i,u,f),h=c(e,r,a,s,f);return(0,o.piMod)(Math.atan2(h,l))}};e.default=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=n(1),o=n(14),a=(r=n(85))&&r.__esModule?r:{default:r};function u(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function s(t,e,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+e}function c(t,e,n){return{x:t*Math.cos(n),y:e*Math.sin(n)}}function f(t,e,n){var r=Math.cos(n),i=Math.sin(n);return[t*r-e*i,t*i+e*r]}var l={box:function(t,e,n,r,i,o,a){for(var c=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,r,i),f=1/0,l=-1/0,h=[o,a],d=2*-Math.PI;d<=2*Math.PI;d+=Math.PI){var p=c+d;o<a?o<p&&p<a&&h.push(p):a<p&&p<o&&h.push(p)}for(d=0;d<h.length;d++){var y=u(t,0,n,r,i,h[d]);y<f&&(f=y),y>l&&(l=y)}var v=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),g=1/0,m=-1/0,b=[o,a];for(d=2*-Math.PI;d<=2*Math.PI;d+=Math.PI){var _=v+d;o<a?o<_&&_<a&&b.push(_):a<_&&_<o&&b.push(_)}for(d=0;d<b.length;d++){var M=s(0,e,n,r,i,b[d]);M<g&&(g=M),M>m&&(m=M)}return{x:f,y:g,width:l-f,height:m-g}},length:function(t,e,n,r,i,o,a){},nearestPoint:function(t,e,n,r,o,u,s,l,h){var d=f(l-t,h-e,-o),p=(0,i.__read)(d,2),y=p[0],v=p[1],g=a.default.nearestPoint(0,0,n,r,y,v),m=function(t,e,n,r){return(Math.atan2(r*t,n*e)+2*Math.PI)%(2*Math.PI)}(n,r,g.x,g.y);m<u?g=c(n,r,u):m>s&&(g=c(n,r,s));var b=f(g.x,g.y,o);return{x:b[0]+t,y:b[1]+e}},pointDistance:function(t,e,n,r,i,a,u,s,c){var f=this.nearestPoint(t,e,n,r,i,a,u,s,c);return(0,o.distance)(f.x,f.y,s,c)},pointAt:function(t,e,n,r,i,o,a,c){var f=(a-o)*c+o;return{x:u(t,0,n,r,i,f),y:s(0,e,n,r,i,f)}},tangentAngle:function(t,e,n,r,i,a,u,s){var c=(u-a)*s+a,f=function(t,e,n,r,i,o,a,u){return-1*n*Math.cos(i)*Math.sin(u)-r*Math.sin(i)*Math.cos(u)}(0,0,n,r,i,0,0,c),l=function(t,e,n,r,i,o,a,u){return-1*n*Math.sin(i)*Math.sin(u)+r*Math.cos(i)*Math.cos(u)}(0,0,n,r,i,0,0,c);return(0,o.piMod)(Math.atan2(l,f))}};e.default=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n(14);function i(t,e){var n=Math.abs(t);return e>0?n:-1*n}var o={box:function(t,e,n,r){return{x:t-n,y:e-r,width:2*n,height:2*r}},length:function(t,e,n,r){return Math.PI*(3*(n+r)-Math.sqrt((3*n+r)*(n+3*r)))},nearestPoint:function(t,e,n,r,o,a){var u=n,s=r;if(0===u||0===s)return{x:t,y:e};for(var c=o-t,f=a-e,l=Math.abs(c),h=Math.abs(f),d=u*u,p=s*s,y=Math.PI/4,v=0,g=0,m=0;m<4;m++){v=u*Math.cos(y),g=s*Math.sin(y);var b=(d-p)*Math.pow(Math.cos(y),3)/u,_=(p-d)*Math.pow(Math.sin(y),3)/s,M=v-b,E=g-_,T=l-b,O=h-_,w=Math.hypot(E,M),x=Math.hypot(O,T);y+=w*Math.asin((M*O-E*T)/(w*x))/Math.sqrt(d+p-v*v-g*g),y=Math.min(Math.PI/2,Math.max(0,y))}return{x:t+i(v,c),y:e+i(g,f)}},pointDistance:function(t,e,n,i,o,a){var u=this.nearestPoint(t,e,n,i,o,a);return(0,r.distance)(u.x,u.y,o,a)},pointAt:function(t,e,n,r,i){var o=2*Math.PI*i;return{x:t+n*Math.cos(o),y:e+r*Math.sin(o)}},tangentAngle:function(t,e,n,i,o){var a=2*Math.PI*o,u=Math.atan2(i*Math.cos(a),-n*Math.sin(a));return(0,r.piMod)(u)}};e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=n(34),o=(r=n(35))&&r.__esModule?r:{default:r};function a(t){var e=t.slice(0);return t.length&&e.push(t[0]),e}var u={box:function(t){return o.default.box(t)},length:function(t){return(0,i.lengthOfSegment)(a(t))},pointAt:function(t,e){return(0,i.pointAtSegments)(a(t),e)},pointDistance:function(t,e,n){return(0,i.distanceAtSegment)(a(t),e,n)},tangentAngle:function(t,e){return(0,i.angleAtSegments)(a(t),e)}};e.default=u},function(t,e,n){"use strict";n.r(e),n.d(e,"ManaSyringe",(function(){return o})),n.d(e,"Component",(function(){return i.Component})),n.d(e,"world",(function(){return Di})),n.d(e,"SHAPE",(function(){return D})),n.d(e,"CanvasConfig",(function(){return G})),n.d(e,"Geometry",(function(){return c})),n.d(e,"Renderable",(function(){return f})),n.d(e,"Transform",(function(){return h})),n.d(e,"Strategy",(function(){return r})),n.d(e,"Cullable",(function(){return p})),n.d(e,"Sortable",(function(){return y})),n.d(e,"ElementEvent",(function(){return _})),n.d(e,"DELEGATION_SPLITTER",(function(){return mt})),n.d(e,"EventTarget",(function(){return bt})),n.d(e,"Node",(function(){return _t})),n.d(e,"Element",(function(){return Mt})),n.d(e,"Document",(function(){return Zr})),n.d(e,"FederatedEvent",(function(){return vt})),n.d(e,"FederatedMouseEvent",(function(){return Et})),n.d(e,"FederatedPointerEvent",(function(){return Tt})),n.d(e,"FederatedWheelEvent",(function(){return Ot})),n.d(e,"Animation",(function(){return Lr})),n.d(e,"AnimationEvent",(function(){return Dr})),n.d(e,"AnimationEffectTiming",(function(){return Gr})),n.d(e,"CustomEvent",(function(){return gt})),n.d(e,"makeTiming",(function(){return zr})),n.d(e,"normalizeTimingInput",(function(){return Hr})),n.d(e,"numericTimingToObject",(function(){return Yr})),n.d(e,"KeyframeEffect",(function(){return $r})),n.d(e,"normalizeKeyframes",(function(){return qr})),n.d(e,"compareAnimations",(function(){return Fr})),n.d(e,"AnimationTimeline",(function(){return Vr})),n.d(e,"CustomElementRegistry",(function(){return fi})),n.d(e,"AbstractRenderer",(function(){return li})),n.d(e,"CanvasEvent",(function(){return ji})),n.d(e,"Canvas",(function(){return ki})),n.d(e,"DisplayObjectPool",(function(){return u})),n.d(e,"DefaultCamera",(function(){return mi})),n.d(e,"CAMERA_TYPE",(function(){return pi})),n.d(e,"CAMERA_TRACKING_MODE",(function(){return yi})),n.d(e,"CAMERA_PROJECTION_MODE",(function(){return vi})),n.d(e,"CAMERA_EVENT",(function(){return bi})),n.d(e,"Camera",(function(){return Ei})),n.d(e,"Landmark",(function(){return gi})),n.d(e,"sortByZIndex",(function(){return R})),n.d(e,"dirtifyRenderable",(function(){return k})),n.d(e,"SceneGraphService",(function(){return B})),n.d(e,"DefaultSceneGraphService",(function(){return L})),n.d(e,"ContextService",(function(){return ft})),n.d(e,"RENDER_REASON",(function(){return Y})),n.d(e,"RenderingContext",(function(){return lt})),n.d(e,"RenderingPluginContribution",(function(){return dt})),n.d(e,"RenderingService",(function(){return pt})),n.d(e,"EventService",(function(){return wt})),n.d(e,"SceneGraphSelectorFactory",(function(){return N})),n.d(e,"SceneGraphSelector",(function(){return j})),n.d(e,"DefaultSceneGraphSelector",(function(){return I})),n.d(e,"OffscreenCanvasCreator",(function(){return $})),n.d(e,"TextService",(function(){return Q})),n.d(e,"GeometryUpdaterFactory",(function(){return F})),n.d(e,"GeometryAABBUpdater",(function(){return V})),n.d(e,"CircleUpdater",(function(){return q})),n.d(e,"EllipseUpdater",(function(){return U})),n.d(e,"RectUpdater",(function(){return W})),n.d(e,"TextUpdater",(function(){return tt})),n.d(e,"LineUpdater",(function(){return et})),n.d(e,"PolylineUpdater",(function(){return nt})),n.d(e,"PathUpdater",(function(){return rt})),n.d(e,"AABB",(function(){return v})),n.d(e,"BoundingSphere",(function(){return m})),n.d(e,"Mask",(function(){return d})),n.d(e,"Frustum",(function(){return M})),n.d(e,"Plane",(function(){return b})),n.d(e,"Ray",(function(){return A})),n.d(e,"Point",(function(){return P})),n.d(e,"Rectangle",(function(){return C})),n.d(e,"PolygonShape",(function(){return S})),n.d(e,"getAngle",(function(){return xt})),n.d(e,"createVec3",(function(){return At})),n.d(e,"deg2rad",(function(){return Pt})),n.d(e,"rad2deg",(function(){return Ct})),n.d(e,"getScaling",(function(){return St})),n.d(e,"getTranslation",(function(){return Nt})),n.d(e,"getRotationInRadians",(function(){return jt})),n.d(e,"getEuler",(function(){return It})),n.d(e,"fromRotationTranslationScale",(function(){return Rt})),n.d(e,"convertEffectInput",(function(){return be})),n.d(e,"equalizeSegments",(function(){return xe})),n.d(e,"getDrawDirection",(function(){return Ae})),n.d(e,"getPathArea",(function(){return Ce})),n.d(e,"reverseCurve",(function(){return Se})),n.d(e,"clonePath",(function(){return Ne})),n.d(e,"getRotatedCurve",(function(){return je})),n.d(e,"convertToPath",(function(){return Re})),n.d(e,"requestAnimationFrame",(function(){return ke})),n.d(e,"cancelAnimationFrame",(function(){return De})),n.d(e,"toFontString",(function(){return H})),n.d(e,"StylePropertyParser",(function(){return it})),n.d(e,"StylePropertyParserFactory",(function(){return ot})),n.d(e,"StylePropertyUpdater",(function(){return at})),n.d(e,"StylePropertyUpdaterFactory",(function(){return ut})),n.d(e,"StylePropertyMerger",(function(){return st})),n.d(e,"StylePropertyMergerFactory",(function(){return ct})),n.d(e,"updateAnchor",(function(){return Be})),n.d(e,"updateGeometry",(function(){return _n})),n.d(e,"updateLocalPosition",(function(){return Mn})),n.d(e,"numberToString",(function(){return En})),n.d(e,"parseNumber",(function(){return Tn})),n.d(e,"mergeNumbers",(function(){return On})),n.d(e,"clampedMergeNumbers",(function(){return wn})),n.d(e,"mergeNumberLists",(function(){return xn})),n.d(e,"PARSED_COLOR_TYPE",(function(){return Ge})),n.d(e,"parseColor",(function(){return mn})),n.d(e,"mergeColors",(function(){return bn})),n.d(e,"updateOffsetPath",(function(){return An})),n.d(e,"updateOffsetDistance",(function(){return Pn})),n.d(e,"updateClipPath",(function(){return Cn})),n.d(e,"updateZIndex",(function(){return Sn})),n.d(e,"updateOrigin",(function(){return Vn})),n.d(e,"updateTransformOrigin",(function(){return Gn})),n.d(e,"parseTransform",(function(){return Xn})),n.d(e,"mergeTransforms",(function(){return Zn})),n.d(e,"updateTransform",(function(){return Qn})),n.d(e,"parseDimension",(function(){return In})),n.d(e,"mergeDimensions",(function(){return Rn})),n.d(e,"parseLength",(function(){return kn})),n.d(e,"parseLengthOrPercent",(function(){return Dn})),n.d(e,"parseAngle",(function(){return Bn})),n.d(e,"convertPercentUnit",(function(){return Ln})),n.d(e,"convertAngleUnit",(function(){return Fn})),n.d(e,"parsePath",(function(){return Ar})),n.d(e,"mergePaths",(function(){return Cr})),n.d(e,"parsePoints",(function(){return Sr})),n.d(e,"parseParam",(function(){return Nr})),n.d(e,"parseFilter",(function(){return Ir})),n.d(e,"DisplayObject",(function(){return Kr})),n.d(e,"CustomElement",(function(){return Qr})),n.d(e,"Circle",(function(){return ti})),n.d(e,"Ellipse",(function(){return ei})),n.d(e,"Group",(function(){return Jr})),n.d(e,"Image",(function(){return ni})),n.d(e,"Line",(function(){return ri})),n.d(e,"Path",(function(){return ii})),n.d(e,"Polygon",(function(){return oi})),n.d(e,"Polyline",(function(){return ai})),n.d(e,"Rect",(function(){return ui})),n.d(e,"Text",(function(){return si})),n.d(e,"HTML",(function(){return ci})),n.d(e,"globalContainer",(function(){return Rr})),n.d(e,"containerModule",(function(){return kr}));var r,i=n(6),o=n(3),a=n(1),u=function(){function t(){this.pool={}}return t.prototype.getByName=function(t){return this.pool[t]},t.prototype.add=function(t,e){this.pool[t]=e},t.prototype.remove=function(t){delete this.pool[t]},t=Object(a.__decorate)([Object(o.singleton)()],t)}(),s=n(2),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.__extends)(e,t),e.tag="c-geometry",e}(i.Component),f=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.boundsDirty=!0,e.renderBoundsDirty=!0,e.dirty=!1,e}return Object(a.__extends)(e,t),e.tag="c-renderable",e}(i.Component),l=n(0),h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.dirtyFlag=!1,e.localDirtyFlag=!1,e.frozen=!1,e.graphDepth=0,e.localPosition=l.vec3.fromValues(0,0,0),e.localRotation=l.quat.fromValues(0,0,0,1),e.localScale=l.vec3.fromValues(1,1,1),e.localTransform=l.mat4.create(),e.position=l.vec3.fromValues(0,0,0),e.rotation=l.quat.fromValues(0,0,0,1),e.scaling=l.vec3.fromValues(1,1,1),e.worldTransform=l.mat4.create(),e.origin=l.vec3.fromValues(0,0,0),e}return Object(a.__extends)(e,t),e.tag="c-transform",e}(i.Component);!function(t){t[t.Standard=0]="Standard"}(r||(r={}));var d,p=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.strategy=r.Standard,e.visibilityPlaneMask=-1,e.visible=!0,e.enable=!0,e}return Object(a.__extends)(e,t),e.prototype.isCulled=function(){return this.enable&&!this.visible},e.tag="c-cullable",e}(i.Component),y=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.dirty=!1,e}return Object(a.__extends)(e,t),e.tag="c-sortable",e}(i.Component),v=function(){function t(t,e){this.min=l.vec3.create(),this.max=l.vec3.create(),this.update(t,e)}return t.prototype.update=function(t,e){this.center=l.vec3.copy(l.vec3.create(),t||l.vec3.create()),this.halfExtents=l.vec3.copy(l.vec3.create(),e||l.vec3.fromValues(0,0,0)),this.min=l.vec3.sub(this.min,this.center,this.halfExtents),this.max=l.vec3.add(this.max,this.center,this.halfExtents)},t.prototype.setMinMax=function(t,e){l.vec3.add(this.center,e,t),l.vec3.scale(this.center,this.center,.5),l.vec3.sub(this.halfExtents,e,t),l.vec3.scale(this.halfExtents,this.halfExtents,.5),l.vec3.copy(this.min,t),l.vec3.copy(this.max,e)},t.prototype.getMin=function(){return this.min},t.prototype.getMax=function(){return this.max},t.prototype.add=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,y=t.center,v=y[0],g=y[1],m=y[2],b=t.halfExtents,_=b[0],M=b[1],E=b[2],T=v-_,O=v+_,w=g-M,x=g+M,A=m-E,P=m+E;T<c&&(c=T),O>f&&(f=O),w<l&&(l=w),x>h&&(h=x),A<d&&(d=A),P>p&&(p=P),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},t.prototype.setFromTransformedAABB=function(t,e){var n=this.center,r=this.halfExtents,i=t.center,o=t.halfExtents,a=e[0],u=e[4],s=e[8],c=e[1],f=e[5],h=e[9],d=e[2],p=e[6],y=e[10],v=Math.abs(a),g=Math.abs(u),m=Math.abs(s),b=Math.abs(c),_=Math.abs(f),M=Math.abs(h),E=Math.abs(d),T=Math.abs(p),O=Math.abs(y);l.vec3.set(n,e[12]+a*i[0]+u*i[1]+s*i[2],e[13]+c*i[0]+f*i[1]+h*i[2],e[14]+d*i[0]+p*i[1]+y*i[2]),l.vec3.set(r,v*o[0]+g*o[1]+m*o[2],b*o[0]+_*o[1]+M*o[2],E*o[0]+T*o[1]+O*o[2]),this.min=l.vec3.sub(this.min,n,r),this.max=l.vec3.add(this.max,n,r)},t.prototype.intersects=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]},t.prototype.intersection=function(e){if(!this.intersects(e))return null;var n=new t,r=l.vec3.max(l.vec3.create(),this.getMin(),e.getMin()),i=l.vec3.min(l.vec3.create(),this.getMax(),e.getMax());return n.setMinMax(r,i),n},t.prototype.containsPoint=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])},t.prototype.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?l.vec3.copy(l.vec3.create(),this.min):272===t.pnVertexFlag?l.vec3.fromValues(this.min[0],this.min[1],this.max[2]):257===t.pnVertexFlag?l.vec3.fromValues(this.min[0],this.max[1],this.min[2]):256===t.pnVertexFlag?l.vec3.fromValues(this.min[0],this.max[1],this.max[2]):17===t.pnVertexFlag?l.vec3.fromValues(this.max[0],this.min[1],this.min[2]):16===t.pnVertexFlag?l.vec3.fromValues(this.max[0],this.min[1],this.max[2]):1===t.pnVertexFlag?l.vec3.fromValues(this.max[0],this.max[1],this.min[2]):l.vec3.fromValues(this.max[0],this.max[1],this.max[2])},t.prototype.getPositiveFarPoint=function(t){return 273===t.pnVertexFlag?l.vec3.copy(l.vec3.create(),this.max):272===t.pnVertexFlag?l.vec3.fromValues(this.max[0],this.max[1],this.min[2]):257===t.pnVertexFlag?l.vec3.fromValues(this.max[0],this.min[1],this.max[2]):256===t.pnVertexFlag?l.vec3.fromValues(this.max[0],this.min[1],this.min[2]):17===t.pnVertexFlag?l.vec3.fromValues(this.min[0],this.max[1],this.max[2]):16===t.pnVertexFlag?l.vec3.fromValues(this.min[0],this.max[1],this.min[2]):1===t.pnVertexFlag?l.vec3.fromValues(this.min[0],this.min[1],this.max[2]):l.vec3.fromValues(this.min[0],this.min[1],this.min[2])},t}(),g=l.vec3.create(),m=function(){function t(t,e){this.center=t||l.vec3.create(),this.radius=e||.5}return t.prototype.containsPoint=function(t){return l.vec3.sub(g,t,this.center),l.vec3.length(g)<this.radius*this.radius},t.prototype.intersects=function(t){l.vec3.sub(g,t.center,this.center);var e=t.radius+this.radius;return l.vec3.length(g)<=e*e},t}(),b=function(){function t(t,e){this.distance=t||0,this.normal=e||l.vec3.fromValues(0,1,0),this.updatePNVertexFlag()}return t.prototype.updatePNVertexFlag=function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)},t.prototype.distanceToPoint=function(t){return l.vec3.dot(t,this.normal)-this.distance},t.prototype.normalize=function(){var t=1/l.vec3.len(this.normal);l.vec3.scale(this.normal,this.normal,t),this.distance*=t},t.prototype.intersectsLine=function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),o=i>=0&&i<=1;return o&&n&&l.vec3.lerp(n,t,e,i),o},t}();!function(t){t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE"}(d||(d={}));var _,M=function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;e<6;e++)this.planes.push(new b)}return t.prototype.extractFromVPMatrix=function(t){var e=Object(a.__read)(t,16),n=e[0],r=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],f=e[7],h=e[8],d=e[9],p=e[10],y=e[11],v=e[12],g=e[13],m=e[14],b=e[15];l.vec3.set(this.planes[0].normal,o-n,f-u,y-h),this.planes[0].distance=b-v,l.vec3.set(this.planes[1].normal,o+n,f+u,y+h),this.planes[1].distance=b+v,l.vec3.set(this.planes[2].normal,o+r,f+s,y+d),this.planes[2].distance=b+g,l.vec3.set(this.planes[3].normal,o-r,f-s,y-d),this.planes[3].distance=b-g,l.vec3.set(this.planes[4].normal,o-i,f-c,y-p),this.planes[4].distance=b-m,l.vec3.set(this.planes[5].normal,o+i,f+c,y+p),this.planes[5].distance=b+m,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))},t}(),E=l.vec3.create(),T=l.vec3.create(),O=l.vec3.create(),w=l.vec3.create(),x=l.vec3.create(),A=function(){function t(t,e){this.origin=t||l.vec3.create(),this.direction=e||l.vec3.fromValues(0,0,-1)}return t.prototype.intersectsAABB=function(t,e){return e?this.intersectAABBWithIntersection(t,e):this.intersectsAABBWithoutIntersection(t)},t.prototype.intersectsSphere=function(t,e){var n=l.vec3.sub(E,this.origin,t.center);l.vec3.normalize(T,l.vec3.copy(T,this.direction));var r=l.vec3.dot(n,T),i=l.vec3.dot(n,n)-t.radius*t.radius;if(i>0&&r>0)return null;var o=r*r-i;if(o<0)return!1;var a=Math.abs(-r-Math.sqrt(o));return e&&(l.vec3.copy(e,this.direction),l.vec3.scaleAndAdd(e,this.origin,e,a)),!0},t.prototype.intersectsPlane=function(t,e){var n=(t.distance-l.vec3.dot(t.normal,this.origin))/l.vec3.dot(t.normal,this.direction),r=n>=0;return r&&e&&l.vec3.scaleAndAdd(e,this.origin,this.direction,n),r},t.prototype.intersectsAABBWithoutIntersection=function(t){var e=E,n=T,r=O,i=w,o=x,a=this.direction;return l.vec3.sub(e,this.origin,t.center),l.vec3.set(i,Math.abs(e[0]),Math.abs(e[1]),Math.abs(e[2])),l.vec3.mul(r,e,a),!(i[0]>t.halfExtents[0]&&r[0]>=0||i[1]>t.halfExtents[1]&&r[1]>=0||i[2]>t.halfExtents[2]&&r[2]>=0)&&(l.vec3.set(o,Math.abs(a[0]),Math.abs(a[1]),Math.abs(a[2])),l.vec3.cross(n,a,e),l.vec3.set(n,Math.abs(n[0]),Math.abs(n[1]),Math.abs(n[2])),!(n[0]>t.halfExtents[1]*o[2]+t.halfExtents[2]*o[1]||n[1]>t.halfExtents[0]*o[2]+t.halfExtents[2]*o[0]||n[2]>t.halfExtents[0]*o[1]+t.halfExtents[1]*o[0]))},t.prototype.intersectAABBWithIntersection=function(t,e){var n=l.vec3.copy(l.vec3.create(),t.getMin());l.vec3.sub(n,n,this.origin);var r=l.vec3.copy(l.vec3.create(),t.getMax());l.vec3.sub(r,r,this.origin);var i=this.direction;0===i[0]?(n[0]=n[0]<0?-Number.MAX_VALUE:Number.MAX_VALUE,r[0]=r[0]<0?-Number.MAX_VALUE:Number.MAX_VALUE):(n[0]/=i[0],r[0]/=i[0]),0===i[1]?(n[1]=n[1]<0?-Number.MAX_VALUE:Number.MAX_VALUE,r[1]=r[1]<0?-Number.MAX_VALUE:Number.MAX_VALUE):(n[1]/=i[1],r[1]/=i[1]),0===i[2]?(n[2]=n[2]<0?-Number.MAX_VALUE:Number.MAX_VALUE,r[2]=r[2]<0?-Number.MAX_VALUE:Number.MAX_VALUE):(n[2]/=i[2],r[2]/=i[2]);var o=l.vec3.set(O,Math.min(n[0],r[0]),Math.min(n[1],r[1]),Math.min(n[2],r[2])),a=l.vec3.set(w,Math.max(n[0],r[0]),Math.max(n[1],r[1]),Math.max(n[2],r[2])),u=Math.min(Math.min(a[0],a[1]),a[2]),s=Math.max(Math.max(o[0],o[1]),o[2]),c=u>=s&&s>=0;return c&&(l.vec3.copy(e,this.direction),l.vec3.scaleAndAdd(e,this.origin,e,s)),c},t}(),P=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y},t}(),C=function(){function t(t,e,n,r){this.x=t,this.y=e,this.width=n,this.height=r,this.left=t,this.right=t+n,this.top=e,this.bottom=e+r}return t.prototype.toJSON=function(){},t}(),S=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Array.isArray(t[0])?t[0]:t;if("number"!=typeof n[0]){for(var r=[],i=0,o=n.length;i<o;i++)r.push(n[i].x,n[i].y);n=r}this.points=n,this.closeStroke=!0}return t.prototype.clone=function(){var e=new t(this.points.slice());return e.closeStroke=this.closeStroke,e},t.prototype.contains=function(t,e){for(var n=!1,r=this.points.length/2,i=0,o=r-1;i<r;o=i++){var a=this.points[2*i],u=this.points[2*i+1],s=this.points[2*o],c=this.points[2*o+1];u>e!=c>e&&t<(e-u)/(c-u)*(s-a)+a&&(n=!n)}return n},t}(),N="SceneGraphSelectorFactory",j="SceneGraphSelector",I=function(){function t(){}return t.prototype.selectOne=function(t,e){return t.startsWith("#")?e.find((function(e){return e.id===t.substring(1)})):null},t.prototype.selectAll=function(t,e){return t.startsWith(".")?e.findAll((function(e){return e.className===t.substring(1)})):t.startsWith("#")?e.findAll((function(e){return e.id===t.substring(1)})):t.startsWith("[name=")?e.findAll((function(e){return e.name===t.substring(7,t.length-2)})):e.findAll((function(e){return e.nodeName===t}))},t.prototype.is=function(t,e){return!0},t=Object(a.__decorate)([Object(o.singleton)()],t)}();function R(t,e){var n=Number(t.style.zIndex),r=Number(e.style.zIndex);if(n===r){var i=t.parentNode;if(i){var o=i.childNodes||[];return o.indexOf(t)-o.indexOf(e)}}return n-r}function k(t,e){void 0===e&&(e=!1);for(var n=t;n;){var r=n.entity.getComponent(f);r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0,r.dirty=!0),n=n.parentElement}e||t.emit(_.BOUNDS_CHANGED,{})}!function(t){t.DESTROY="destroy",t.ATTRIBUTE_CHANGED="attribute-changed",t.INSERTED="inserted",t.CHILD_INSERTED="child-inserted",t.REMOVED="removed",t.CHILD_REMOVED="child-removed",t.MOUNTED="mounted",t.UNMOUNTED="unmounted",t.BOUNDS_CHANGED="bounds-changed"}(_||(_={}));var D,B="SceneGraphService",L=function(){function t(){var t,e,n,r,i,o=this;this.sort=function(t,e){if(!t.parentNode)return-1;if(!e.parentNode)return 1;var n=o.getDepth(t)-o.getDepth(e),r=t,i=e;if(n<0){if((i=e.getAncestor(-n))===r)return-1}else if(n>0&&i===(r=t.getAncestor(n)))return 1;for(;r&&i&&r.parentNode!==i.parentNode;)r=r.parentNode,i=i.parentNode;var a=r.parentNode;if(a){var u=a.entity.getComponent(y);if(u)return u.sorted||(u.sorted=a.childNodes.slice()),u.dirty&&(u.sorted=a.childNodes.slice().sort(R),u.dirty=!1),u.sorted.indexOf(r)-u.sorted.indexOf(i)}return-1},this.rotate=(t=l.quat.create(),function(e,n,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof n&&(n=l.vec3.fromValues(n,r,i));var a=e.entity.getComponent(h);if(null===e.parentNode)o.rotateLocal(e,n);else{var u=l.quat.create();l.quat.fromEuler(u,n[0],n[1],n[2]);var s=o.getRotation(e),c=o.getRotation(e.parentNode);l.quat.copy(t,c),l.quat.invert(t,t),l.quat.multiply(t,t,u),l.quat.multiply(a.localRotation,u,s),l.quat.normalize(a.localRotation,a.localRotation),o.dirtifyLocal(e,a)}}),this.rotateLocal=(e=l.quat.create(),function(t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof n&&(n=l.vec3.fromValues(n,r,i));var a=t.entity.getComponent(h);l.quat.fromEuler(e,n[0],n[1],n[2]),l.quat.mul(a.localRotation,a.localRotation,e),o.dirtifyLocal(t,a)}),this.setEulerAngles=(n=l.quat.create(),function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof e&&(e=l.vec3.fromValues(e,r,i));var a=t.entity.getComponent(h);if(null===t.parentNode)o.setLocalEulerAngles(t,e);else{l.quat.fromEuler(a.localRotation,e[0],e[1],e[2]);var u=o.getRotation(t.parentNode);l.quat.copy(n,l.quat.invert(l.quat.create(),u)),l.quat.mul(a.localRotation,a.localRotation,n),o.dirtifyLocal(t,a)}}),this.translateLocal=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=l.vec3.fromValues(e,n,r));var i=t.entity.getComponent(h);l.vec3.equals(e,l.vec3.create())||(l.vec3.transformQuat(e,e,i.localRotation),l.vec3.add(i.localPosition,i.localPosition,e),o.dirtifyLocal(t,i))},this.setPosition=(r=l.mat4.create(),function(t,e){var n=t.entity.getComponent(h);if(e=l.vec3.fromValues(e[0],e[1],e[2]||n.position[2]),!l.vec3.equals(o.getPosition(t),e)){if(n.position=e,null===t.parentNode)l.vec3.copy(n.localPosition,e);else{var i=t.parentNode.entity.getComponent(h);l.mat4.copy(r,i.worldTransform),l.mat4.invert(r,r),l.vec3.transformMat4(n.localPosition,e,r)}o.dirtifyLocal(t,n)}}),this.translate=(i=l.vec3.create(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=l.vec3.fromValues(e,n,r)),l.vec3.equals(e,l.vec3.create())||(l.vec3.add(i,o.getPosition(t),e),o.setPosition(t,i))})}return t.prototype.matches=function(t,e){return this.sceneGraphSelectorFactory().is(t,e)},t.prototype.querySelector=function(t,e){return this.sceneGraphSelectorFactory().selectOne(t,e)},t.prototype.querySelectorAll=function(t,e){return this.sceneGraphSelectorFactory().selectAll(t,e)},t.prototype.attach=function(t,e,n){t.parentNode&&this.detach(t);var r=t.entity;t.parentNode=e,Object(s.isNil)(n)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(n,0,t);var i=e.entity.getComponent(y);i&&(i.dirty=!0),this.updateGraphDepth(t);var o=r.getComponent(h);o&&this.dirtifyWorld(t,o),o.frozen&&this.unfreezeParentToRoot(t)},t.prototype.detach=function(t){if(t.parentNode){var e=t.entity.getComponent(h);if(e){var n=this.getWorldTransform(t,e);l.mat4.getScaling(e.localScale,n),l.mat4.getTranslation(e.localPosition,n),l.mat4.getRotation(e.localRotation,n),e.localDirtyFlag=!0}var r=t.parentNode.entity.getComponent(y);r&&(r.dirty=!0);var i=t.parentNode.childNodes.indexOf(t);i>-1&&t.parentNode.childNodes.splice(i,1),e&&this.dirtifyWorld(t,e),t.parentNode=null}},t.prototype.getDepth=function(t){for(var e=t,n=0;e;)e=e.parentNode,n++;return n},t.prototype.getOrigin=function(t){return t.entity.getComponent(h).origin},t.prototype.setOrigin=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=l.vec3.fromValues(e,n,r));var i=t.entity.getComponent(h);if(!l.vec3.equals(e,i.origin)){var o=i.origin;o[0]=e[0],o[1]=e[1],o[2]=e[2]||0,this.dirtifyLocal(t,i)}},t.prototype.setLocalEulerAngles=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=l.vec3.fromValues(e,n,r));var i=t.entity.getComponent(h);l.quat.fromEuler(i.localRotation,e[0],e[1],e[2]),this.dirtifyLocal(t,i)},t.prototype.setLocalPosition=function(t,e){var n=t.entity.getComponent(h);e=l.vec3.fromValues(e[0],e[1],e[2]||n.localPosition[2]),l.vec3.equals(n.localPosition,e)||(l.vec3.copy(n.localPosition,e),this.dirtifyLocal(t,n))},t.prototype.scaleLocal=function(t,e){var n=t.entity.getComponent(h);l.vec3.multiply(n.localScale,n.localScale,l.vec3.fromValues(e[0],e[1],e[2]||1)),this.dirtifyLocal(t,n)},t.prototype.setLocalScale=function(t,e){var n=t.entity.getComponent(h),r=l.vec3.fromValues(e[0],e[1],e[2]||n.localScale[2]);l.vec3.equals(r,n.localScale)||(l.vec3.copy(n.localScale,r),this.dirtifyLocal(t,n))},t.prototype.dirtifyLocal=function(t,e){e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e)),t.emit(_.ATTRIBUTE_CHANGED,{attributeName:"modelMatrix",oldValue:null,newValue:null})},t.prototype.dirtifyWorld=function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e)},t.prototype.getPosition=function(t){var e=t.entity.getComponent(h);return l.mat4.getTranslation(e.position,this.getWorldTransform(t,e))},t.prototype.getRotation=function(t){var e=t.entity.getComponent(h);return l.mat4.getRotation(e.rotation,this.getWorldTransform(t,e))},t.prototype.getScale=function(t){var e=t.entity.getComponent(h);return l.mat4.getScaling(e.scaling,this.getWorldTransform(t,e))},t.prototype.getWorldTransform=function(t,e){return void 0===e&&(e=t.entity.getComponent(h)),e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&this.getWorldTransform(t.parentNode),this.sync(t,e),e.worldTransform):e.worldTransform},t.prototype.getLocalPosition=function(t){return t.entity.getComponent(h).localPosition},t.prototype.getLocalRotation=function(t){return t.entity.getComponent(h).localRotation},t.prototype.getLocalScale=function(t){return t.entity.getComponent(h).localScale},t.prototype.getLocalTransform=function(t){var e=t.entity.getComponent(h);return e.localDirtyFlag&&(l.mat4.fromRotationTranslationScaleOrigin(e.localTransform,e.localRotation,e.localPosition,e.localScale,e.origin),e.localDirtyFlag=!1),e.localTransform},t.prototype.resetLocalTransform=function(t){this.setLocalScale(t,[1,1,1]),this.setLocalPosition(t,[0,0,0]),this.setLocalEulerAngles(t,[0,0,0])},t.prototype.getTransformedGeometryBounds=function(t,e){void 0===e&&(e=!1);var n=this.getGeometryBounds(t,e);if(n){var r=new v;return r.setFromTransformedAABB(n,this.getWorldTransform(t)),r}return null},t.prototype.getGeometryBounds=function(t,e){void 0===e&&(e=!1);var n=t.entity.getComponent(c),r=e?n.renderBounds:n.contentBounds||null;return r&&new v(r.center,r.halfExtents)||null},t.prototype.getBounds=function(t,e){var n=this;void 0===e&&(e=!1);var r=t.entity.getComponent(f);if(!r.boundsDirty&&!e&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&e&&r.renderBounds)return r.renderBounds;var i=this.getTransformedGeometryBounds(t,e);t.childNodes.forEach((function(t){var r=n.getBounds(t,e);r&&(i?i.add(r):(i=new v).update(r.center,r.halfExtents))}));var o=t.style.clipPath;if(o){var a=this.getTransformedGeometryBounds(o,!0),u=void 0;a&&(u=new v).setFromTransformedAABB(a,this.getWorldTransform(t)),i?u&&(i=u.intersection(i)):i=u}return i&&(e?r.renderBounds=i:r.bounds=i),e?r.renderBoundsDirty=!1:r.boundsDirty=!1,i||null},t.prototype.getLocalBounds=function(t){if(t.parentNode){var e=l.mat4.create();t.parentNode.entity.hasComponent(h)&&(e=l.mat4.invert(l.mat4.create(),this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(n){var r=new v;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)},t.prototype.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t);i&&(r=new v).setFromTransformedAABB(i,this.getWorldTransform(t));var o=null===(n=null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)||void 0===n?void 0:n.getContextService().getBoundingClientRect();if(r){var u=Object(a.__read)(r.getMin(),2),s=u[0],c=u[1],f=Object(a.__read)(r.getMax(),2),l=f[0],h=f[1];return new C(s+((null==o?void 0:o.left)||0),c+((null==o?void 0:o.top)||0),l-s,h-c)}return new C((null==o?void 0:o.left)||0,(null==o?void 0:o.top)||0,0,0)},t.prototype.dirtifyWorldInternal=function(t,e){var n=this;e.dirtyFlag||(e.dirtyFlag=!0,e.frozen=!1,t.childNodes.forEach((function(t){var e=t.entity.getComponent(h);e.dirtyFlag||n.dirtifyWorldInternal(t,e)})),0===t.childNodes.length&&k(t))},t.prototype.syncHierarchy=function(t){var e=t.entity.getComponent(h);if(!e.frozen){e.frozen=!0,(e.localDirtyFlag||e.dirtyFlag)&&this.sync(t,e);for(var n=t.childNodes,r=0;r<n.length;r++)this.syncHierarchy(n[r])}},t.prototype.sync=function(t,e){if(e.localDirtyFlag&&(l.mat4.fromRotationTranslationScaleOrigin(e.localTransform,e.localRotation,e.localPosition,e.localScale,e.origin),e.localDirtyFlag=!1),e.dirtyFlag){var n=t.parentNode,r=n&&n.entity.getComponent(h);null!==n&&r?l.mat4.multiply(e.worldTransform,r.worldTransform,e.localTransform):l.mat4.copy(e.worldTransform,e.localTransform)}},t.prototype.updateGraphDepth=function(t){var e=t.entity.getComponent(h);t.parentNode?e.graphDepth=t.parentNode.entity.getComponent(h).graphDepth+1:e.graphDepth=0;for(var n=t.childNodes,r=0;r<n.length;r++)this.updateGraphDepth(n[r])},t.prototype.unfreezeParentToRoot=function(t){for(var e=t.parentNode;e;){var n=e.entity.getComponent(h);n&&(n.frozen=!1),e=e.parentNode}},Object(a.__decorate)([Object(o.inject)(N),Object(a.__metadata)("design:type",Function)],t.prototype,"sceneGraphSelectorFactory",void 0),t=Object(a.__decorate)([Object(o.singleton)()],t)}(),F="GeometryUpdaterFactory",V="GeometryAABBGenerator";!function(t){t.Group="group",t.Circle="circle",t.Ellipse="ellipse",t.Image="image",t.Rect="rect",t.Line="line",t.Polyline="polyline",t.Polygon="polygon",t.Text="text",t.Path="path",t.HTML="html"}(D||(D={}));var G="CanvasConfig",q=function(){function t(){}return t.prototype.update=function(t){var e=t.r,n=void 0===e?0:e,r=t.x,i=void 0===r?0:r,o=t.y;return{width:2*n,height:2*n,x:i,y:void 0===o?0:o}},t=Object(a.__decorate)([Object(o.singleton)({token:{token:V,named:D.Circle}})],t)}(),U=function(){function t(){}return t.prototype.update=function(t){var e=t.rx,n=void 0===e?0:e,r=t.ry,i=void 0===r?0:r,o=t.x,a=void 0===o?0:o,u=t.y;return{width:2*n,height:2*i,x:a,y:void 0===u?0:u}},t=Object(a.__decorate)([Object(o.singleton)({token:{token:V,named:D.Ellipse}})],t)}(),W=function(){function t(){}return t.prototype.update=function(t){var e,n,r=t.img,i=t.x,o=void 0===i?0:i,a=t.y,u=void 0===a?0:a,c=t.width,f=void 0===c?0:c,l=t.height,h=void 0===l?0:l;return r&&!Object(s.isString)(r)&&(t.width||(e=r.width),t.height||(n=r.height)),{width:e||f,height:n||h,x:o,y:u}},t=Object(a.__decorate)([Object(o.singleton)({token:[{token:V,named:D.Rect},{token:V,named:D.Image}]})],t)}(),z=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];function H(t){var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,o=t.fontWeight,a=Object(s.isNumber)(e)?e+"px":e,u=n;Array.isArray(n)||(u=n.split(","));for(var c=u.length-1;c>=0;c--){var f=u[c].trim();!/([\"\'])[^\'\"]+\1/.test(f)&&z.indexOf(f)<0&&(f='"'+f+'"'),u[c]=f}return r+" "+i+" "+o+" "+a+" "+u.join(",")}var Y,$=function(){function t(){}return t.prototype.getOrCreateCanvas=function(){if(this.canvas)return this.canvas;try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d"),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d")}return this.canvas.width=10,this.canvas.height=10,this.canvas},t.prototype.getOrCreateContext=function(){return this.context||this.getOrCreateCanvas(),this.context},t=Object(a.__decorate)([Object(o.singleton)()],t)}(),X={MetricsString:"|ÉqÅ",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},K=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,J=new RegExp(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source+"|"+/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source+"|"+/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source+"|"+/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source),Z=new RegExp(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source+"|"+/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source+"|"+/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source+"|"+/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source),Q=function(){function t(){var t=this;this.cache={},this.shouldBreakByKinsokuShorui=function(e,n){return!t.isBreakingSpace(n)&&!(!e||!Z.exec(n)&&!J.exec(e))},this.trimByKinsokuShorui=function(t){var e=Object(a.__spreadArray)([],Object(a.__read)(t),!1),n=e[e.length-2];if(!n)return t;var r=n[n.length-1];return e[e.length-2]=n.slice(0,-1),e[e.length-1]=r+e[e.length-1],e}}return t.prototype.measureFont=function(t){if(this.cache[t])return this.cache[t];var e={ascent:0,descent:0,fontSize:0},n=this.offscreenCanvas.getOrCreateCanvas(),r=this.offscreenCanvas.getOrCreateContext();r.font=t;var i=X.MetricsString+X.BaselineSymbol,o=Math.ceil(r.measureText(i).width),a=Math.ceil(r.measureText(X.BaselineSymbol).width),u=X.HeightMultiplier*a;a=a*X.BaselineMultiplier|0,n.width=o,n.height=u,r.fillStyle="#f00",r.fillRect(0,0,o,u),r.font=t,r.textBaseline="alphabetic",r.fillStyle="#000",r.fillText(i,0,a);var s=r.getImageData(0,0,o,u).data,c=s.length,f=4*o,l=0,h=0,d=!1;for(l=0;l<a;++l){for(var p=0;p<f;p+=4)if(255!==s[h+p]){d=!0;break}if(d)break;h+=f}for(e.ascent=a-l,h=c-f,d=!1,l=u;l>a;--l){for(p=0;p<f;p+=4)if(255!==s[h+p]){d=!0;break}if(d)break;h-=f}return e.descent=l-a,e.fontSize=e.ascent+e.descent,this.cache[t]=e,e},t.prototype.measureText=function(t,e){var n=e.fontSize,r=void 0===n?0:n,i=e.wordWrap,o=e.lineHeight,a=void 0===o?0:o,u=e.lineWidth,s=void 0===u?0:u,c=e.textBaseline,f=e.textAlign,l=e.letterSpacing,h=void 0===l?0:l,d=e.dropShadow,p=e.dropShadowDistance,y=void 0===p?0:p,v=e.leading,g=void 0===v?0:v,m=H(e),b=this.measureFont(m);0===b.fontSize&&(b.fontSize=r,b.ascent=r);var _=this.offscreenCanvas.getOrCreateContext();_.font=m;for(var M=(i?this.wordWrap(t,e):t).split(/(?:\r\n|\r|\n)/),E=new Array(M.length),T=0,O=0;O<M.length;O++){var w=_.measureText(M[O]).width+(M[O].length-1)*h;E[O]=w,T=Math.max(T,w)}var x=T+s;d&&(x+=y);var A=a||b.fontSize+s,P=Math.max(A,b.fontSize+s)+(M.length-1)*(A+g);d&&(P+=y);var S=0;return"middle"===c?S=-P/2:"bottom"===c||"alphabetic"===c||"ideographic"===c?S=-P:"top"!==c&&"hanging"!==c||(S=0),{font:m,width:x,height:P,lines:M,lineWidths:E,lineHeight:A+=g,maxLineWidth:T,fontProperties:b,lineMetrics:E.map((function(t,e){var n=0;return"center"===f?n-=t/2:"right"!==f&&"end"!==f||(n-=t),new C(n-s/2,S+e*A,t+s,A)}))}},t.prototype.wordWrap=function(t,e){var n=this,r=e.wordWrapWidth,i=void 0===r?0:r,o=e.letterSpacing,a=void 0===o?0:o,u=this.offscreenCanvas.getOrCreateContext(),s=i+a,c=[],f=0,l=0,h={},d=function(t){return n.getFromCache(t,a,h,u)};return Array.from(t).forEach((function(e,r){var i=t[r-1],o=t[r+1],a=d(e);if(n.isNewline(e))return f++,l=0,void(c[f]="");if(l>0&&l+a>s){if(f++,l=0,c[f]="",n.isBreakingSpace(e))return;n.canBreakInLastChar(e)||(c=n.trimToBreakable(c),l=n.sumTextWidthByCache(c[f]||"",h)),n.shouldBreakByKinsokuShorui(e,o)&&(c=n.trimByKinsokuShorui(c),l+=d(i||""))}l+=a,c[f]=(c[f]||"")+e})),c.join("\n")},t.prototype.isBreakingSpace=function(t,e){return"string"==typeof t&&X.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},t.prototype.isNewline=function(t){return"string"==typeof t&&X.Newlines.indexOf(t.charCodeAt(0))>=0},t.prototype.trimToBreakable=function(t){var e=Object(a.__spreadArray)([],Object(a.__read)(t),!1),n=e[e.length-2],r=this.findBreakableIndex(n);if(-1===r||!n)return e;var i=n.slice(r,r+1),o=r+1,u=r+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=n.slice(o,n.length),e[e.length-2]=n.slice(0,u),e},t.prototype.canBreakInLastChar=function(t){return!t||!K.test(t)},t.prototype.sumTextWidthByCache=function(t,e){return t.split("").reduce((function(t,n){if(!e[n])throw Error("cannot count the word without cache");return t+e[n]}),0)},t.prototype.findBreakableIndex=function(t){for(var e=t.length-1;e>=0;e--)if(!K.test(t[e]))return e;return-1},t.prototype.getFromCache=function(t,e,n,r){var i=n[t];if("number"!=typeof i){var o=t.length*e;i=r.measureText(t).width+o,n[t]=i}return i},Object(a.__decorate)([Object(o.inject)($),Object(a.__metadata)("design:type",$)],t.prototype,"offscreenCanvas",void 0),t=Object(a.__decorate)([Object(o.singleton)()],t)}(),tt=function(){function t(){}return t.prototype.update=function(t){var e=t.text,n=void 0===e?"":e,r=t.textAlign,i=t.lineWidth,o=void 0===i?0:i,a=t.textBaseline,u=t.x,s=void 0===u?0:u,c=t.y,f=void 0===c?0:c,h=this.textService.measureText(n,t);t.metrics=h;var d=h.width,p=h.height,y=h.lineHeight,v=h.fontProperties,g=l.vec3.fromValues(d/2,p/2,0),m=[0,1],b=0;"center"===r?(b=o/2,m=[.5,1]):"right"!==r&&"end"!==r||(b=o,m=[1,1]),t.anchor=m;var _=0;return"middle"===a?_=g[1]:"top"===a||"hanging"===a?_=2*g[1]:"alphabetic"===a?_=y-v.ascent:"bottom"!==a&&"ideographic"!==a||(_=0),{width:2*g[0],height:2*g[1],x:s,y:f,offsetX:b,offsetY:_}},Object(a.__decorate)([Object(o.inject)(Q),Object(a.__metadata)("design:type",Q)],t.prototype,"textService",void 0),t=Object(a.__decorate)([Object(o.singleton)({token:{token:V,named:D.Text}})],t)}(),et=function(){function t(){}return t.prototype.update=function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2,o=Math.min(e,r),a=Math.max(e,r),u=Math.min(n,i);return{width:a-o,height:Math.max(n,i)-u,x:o,y:u}},t=Object(a.__decorate)([Object(o.singleton)({token:{token:V,named:D.Line}})],t)}(),nt=function(){function t(){}return t.prototype.update=function(t){var e=t.points.points,n=Math.min.apply(Math,Object(a.__spreadArray)([],Object(a.__read)(e.map((function(t){return t[0]}))),!1)),r=Math.max.apply(Math,Object(a.__spreadArray)([],Object(a.__read)(e.map((function(t){return t[0]}))),!1)),i=Math.min.apply(Math,Object(a.__spreadArray)([],Object(a.__read)(e.map((function(t){return t[1]}))),!1));return{width:r-n,height:Math.max.apply(Math,Object(a.__spreadArray)([],Object(a.__read)(e.map((function(t){return t[1]}))),!1))-i,x:n,y:i}},t=Object(a.__decorate)([Object(o.singleton)({token:[{token:V,named:D.Polyline},{token:V,named:D.Polygon}]})],t)}(),rt=function(){function t(){}return t.prototype.update=function(t,e){var n=t.path.rect,r=n.x,i=n.y;return{width:n.width,height:n.height,x:r,y:i}},t=Object(a.__decorate)([Object(o.singleton)({token:{token:V,named:D.Path}})],t)}(),it="StylePropertyParser",ot="StylePropertyParserFactory",at="StylePropertyUpdater",ut="StylePropertyUpdaterFactory",st="StylePropertyMerger",ct="StylePropertyMergerFactory",ft=o.Syringe.defineToken("ContextService",{multiple:!1});!function(t){t[t.CameraChanged=0]="CameraChanged",t[t.DisplayObjectChanged=1]="DisplayObjectChanged",t[t.DisplayObjectRemoved=2]="DisplayObjectRemoved",t[t.None=3]="None"}(Y||(Y={}));var lt="RenderingContext",ht=n(7),dt=o.Syringe.defineToken("RenderingPluginContribution"),pt=function(){function t(){this.inited=!1,this.hooks={init:new ht.AsyncSeriesHook,prepare:new ht.SyncWaterfallHook(["object"]),beginFrame:new ht.SyncHook([]),beforeRender:new ht.SyncHook(["objectToRender"]),render:new ht.SyncHook(["objectToRender"]),afterRender:new ht.SyncHook(["objectToRender"]),endFrame:new ht.SyncHook([]),destroy:new ht.SyncHook,pick:new ht.AsyncSeriesWaterfallHook(["result"]),pointerDown:new ht.SyncHook(["event"]),pointerUp:new ht.SyncHook(["event"]),pointerMove:new ht.SyncHook(["event"]),pointerOut:new ht.SyncHook(["event"]),pointerOver:new ht.SyncHook(["event"]),pointerWheel:new ht.SyncHook(["event"])}}return t.prototype.init=function(){return Object(a.__awaiter)(this,void 0,void 0,(function(){var t=this;return Object(a.__generator)(this,(function(e){switch(e.label){case 0:return this.renderingPluginProvider.getContributions({cache:!1}).forEach((function(e){e.apply(t)})),[4,this.hooks.init.promise()];case 1:return e.sent(),this.inited=!0,[2]}}))}))},t.prototype.render=function(){this.sceneGraphService.syncHierarchy(this.renderingContext.root),this.renderingContext.renderReasons.size&&this.inited&&(this.renderDisplayObject(this.renderingContext.root),this.renderingContext.dirty?(this.hooks.endFrame.call(),this.renderingContext.dirty=!1):this.renderingContext.renderReasons.has(Y.DisplayObjectRemoved)&&(this.hooks.beginFrame.call(),this.hooks.endFrame.call()),this.renderingContext.renderReasons.clear())},t.prototype.renderDisplayObject=function(t){var e=this,n=t.entity,r=this.hooks.prepare.call(t);r&&(this.renderingContext.dirty||(this.renderingContext.dirty=!0,this.hooks.beginFrame.call()),this.hooks.beforeRender.call(r),this.hooks.render.call(r),this.hooks.afterRender.call(r),n.getComponent(f).dirty=!1);var i=n.getComponent(y);i.dirty&&(i.sorted=t.childNodes.slice().sort(R),i.dirty=!1),(i.sorted||t.childNodes).forEach((function(t){e.renderDisplayObject(t)}))},t.prototype.destroy=function(){this.inited=!1,this.hooks.destroy.call()},t.prototype.dirtify=function(){this.renderingContext.renderReasons.add(Y.DisplayObjectChanged)},Object(a.__decorate)([Object(o.contrib)(dt),Object(a.__metadata)("design:type",Object)],t.prototype,"renderingPluginProvider",void 0),Object(a.__decorate)([Object(o.inject)(lt),Object(a.__metadata)("design:type",Object)],t.prototype,"renderingContext",void 0),Object(a.__decorate)([Object(o.inject)(B),Object(a.__metadata)("design:type",Object)],t.prototype,"sceneGraphService",void 0),t=Object(a.__decorate)([Object(o.singleton)()],t)}(),yt=n(16),vt=function(){function t(e){this.eventPhase=t.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new P,this.page=new P,this.canvas=new P,this.viewport=new P,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}return Object.defineProperty(t.prototype,"name",{get:function(){return this.type},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"originalEvent",{get:function(){return this.nativeEvent},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layerX",{get:function(){return this.layer.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layerY",{get:function(){return this.layer.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageX",{get:function(){return this.page.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageY",{get:function(){return this.page.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvasX",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvasY",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewportX",{get:function(){return this.viewport.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewportY",{get:function(){return this.viewport.y},enumerable:!1,configurable:!0}),t.prototype.composedPath=function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path},Object.defineProperty(t.prototype,"propagationPath",{get:function(){return this.composedPath()},enumerable:!1,configurable:!0}),t.prototype.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},t.prototype.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t.prototype.initEvent=function(){},t.prototype.initUIEvent=function(){},t}(),gt=function(t){function e(e,n){var r=t.call(this,null)||this;return r.type=e,r.detail=n,Object.assign(r,n),r}return Object(a.__extends)(e,t),e}(vt),mt=":",bt=function(){function t(){this.emitter=new yt.EventEmitter;var t=Rr.get(i.World).createEntity();this.entity=t}return t.prototype.on=function(t,e,n){return this.addEventListener(t,e,n),this},t.prototype.addEventListener=function(t,e,n){var r=Object(s.isBoolean)(n)&&n||Object(s.isObject)(n)&&n.capture,i=Object(s.isObject)(n)&&n.once,o=Object(s.isFunction)(e)?void 0:e,u=!1,c="";if(t.indexOf(mt)>-1){var f=Object(a.__read)(t.split(mt),2),l=f[0];t=f[1],c=l,u=!0}if(t=r?t+"capture":t,e=Object(s.isFunction)(e)?e:e.handleEvent,u){var h=e;e=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];(null===(t=e[0].target)||void 0===t?void 0:t.name)===c&&h.apply(void 0,Object(a.__spreadArray)([],Object(a.__read)(e),!1))}}return i?this.emitter.once(t,e,o):this.emitter.on(t,e,o),this},t.prototype.off=function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this},t.prototype.removeAllEventListeners=function(){this.emitter.removeAllListeners()},t.prototype.removeEventListener=function(t,e,n){var r=Object(s.isBoolean)(n)&&n||Object(s.isObject)(n)&&n.capture,i=Object(s.isFunction)(e)?void 0:e;return t=r?t+"capture":t,e=Object(s.isFunction)(e)?e:e.handleEvent,this.emitter.off(t,e,i),this},t.prototype.emit=function(t,e){this.dispatchEvent(new gt(t,e))},t.prototype.dispatchEvent=function(t){var e,n;if(!(t instanceof vt))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");var r=this.ownerDocument||this.document;return r&&(t.manager=(null===(e=r.defaultView)||void 0===e?void 0:e.getEventService())||null,t.defaultPrevented=!1,t.path=[],t.target=this,null===(n=t.manager)||void 0===n||n.dispatchEvent(t)),!t.defaultPrevented},t}(),_t=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.shadow=!1,e.ownerDocument=null,e.isConnected=!1,e.baseURI="",e.childNodes=[],e.nodeType=0,e.nodeName="",e.nodeValue=null,e.textContent=null,e.parentNode=null,e}return Object(a.__extends)(e,t),e.isNode=function(t){return!!t.childNodes},e.prototype.getRootNode=function(t){for(var e=this;e.parentNode;)e=e.parentNode;return e},e.prototype.hasChildNodes=function(){return this.childNodes.length>0},e.prototype.isDefaultNamespace=function(t){throw new Error("Method not implemented.")},e.prototype.compareDocumentPosition=function(t){throw new Error("Method not implemented.")},e.prototype.lookupNamespaceURI=function(t){throw new Error("Method not implemented.")},e.prototype.lookupPrefix=function(t){throw new Error("Method not implemented.")},e.prototype.normalize=function(){throw new Error("Method not implemented.")},e.prototype.isEqualNode=function(t){return this===t},e.prototype.isSameNode=function(t){return this.isEqualNode(t)},Object.defineProperty(e.prototype,"parent",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentElement",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstChild",{get:function(){return this.childNodes.length>0?this.childNodes[0]:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastChild",{get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null},enumerable:!1,configurable:!0}),e.prototype.contain=function(t){return this.contains(t)},e.prototype.contains=function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e},e.prototype.getAncestor=function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e},e.prototype.forEach=function(t){t(this)||this.childNodes.forEach((function(e){e.forEach(t)}))},e}(bt),Mt=function(t){function e(e){var n=t.call(this)||this;n.sceneGraphService=Rr.get(B),n.scrollLeft=0,n.scrollTop=0,n.destroyed=!1,n.style={},n.parsedStyle={},n.attributes={};var r=n.entity;return r.addComponent(f),r.addComponent(p),r.addComponent(h),r.addComponent(y),r.addComponent(c),n}return Object(a.__extends)(e,t),e.isElement=function(t){return!!t.getAttribute},Object.defineProperty(e.prototype,"classList",{get:function(){return this.className.split(" ")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tagName",{get:function(){return this.nodeName},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentElement",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]||null}return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t-1]||null}return null},enumerable:!1,configurable:!0}),e.prototype.cloneNode=function(t){throw new Error("Method not implemented.")},e.prototype.appendChild=function(t,e){return this.sceneGraphService.attach(t,this,e),this.emit(_.CHILD_INSERTED,{child:t}),t.emit(_.INSERTED,{parent:this}),t},e.prototype.insertBefore=function(t,e){if(e){var n=this.childNodes.indexOf(e);this.appendChild(t,n-1)}else this.appendChild(t);return t},e.prototype.replaceChild=function(t,e,n){var r=this.childNodes.indexOf(e);return this.removeChild(e,n),this.appendChild(t,r),e},e.prototype.removeChild=function(t,e){return void 0===e&&(e=!0),t.emit(_.REMOVED,{parent:this}),e&&(t.emit(_.DESTROY,{}),t.destroyed=!0),this.emit(_.CHILD_REMOVED,{child:t}),this.sceneGraphService.detach(t),e&&(t.entity.destroy(),t.emitter.removeAllListeners()),t},e.prototype.removeChildren=function(t){var e=this;void 0===t&&(t=!0),this.childNodes.slice().forEach((function(n){e.removeChild(n,t)}))},e.prototype.matches=function(t){return this.sceneGraphService.matches(t,this)},e.prototype.getElementById=function(t){return this.sceneGraphService.querySelector("#"+t,this)},e.prototype.getElementsByName=function(t){return this.sceneGraphService.querySelectorAll('[name="'+t+'"]',this)},e.prototype.getElementsByClassName=function(t){return this.sceneGraphService.querySelectorAll("."+t,this)},e.prototype.getElementsByTagName=function(t){return this.sceneGraphService.querySelectorAll(t,this)},e.prototype.querySelector=function(t){return this.sceneGraphService.querySelector(t,this)},e.prototype.querySelectorAll=function(t){return this.sceneGraphService.querySelectorAll(t,this)},e.prototype.find=function(t){var e=this,n=null;return this.forEach((function(r){return!(r===e||!t(r))&&(n=r,!0)})),n},e.prototype.findAll=function(t){var e=this,n=[];return this.forEach((function(r){r!==e&&t(r)&&n.push(r)})),n},e.prototype.after=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(this.parentNode){var r=this.parentNode.childNodes.indexOf(this);e.forEach((function(e,n){var i;return null===(i=t.parentNode)||void 0===i?void 0:i.appendChild(e,r+n+1)}))}},e.prototype.before=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(this.parentNode){var n=this.parentNode.childNodes.indexOf(this),r=Object(a.__read)(t),i=r[0],o=r.slice(1);this.parentNode.appendChild(i,n),i.after.apply(i,Object(a.__spreadArray)([],Object(a.__read)(o),!1))}},e.prototype.replaceWith=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.after.apply(this,Object(a.__spreadArray)([],Object(a.__read)(t),!1)),this.remove()},e.prototype.append=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];e.forEach((function(e){return t.appendChild(e)}))},e.prototype.prepend=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];e.forEach((function(e,n){return t.appendChild(e,n)}))},e.prototype.replaceChildren=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,Object(a.__spreadArray)([],Object(a.__read)(t),!1))},e.prototype.remove=function(t){return void 0===t&&(t=!0),this.parentNode?this.parentNode.removeChild(this,t):this},e.prototype.destroy=function(){this.emit(_.DESTROY,{}),this.remove(!1),this.entity.destroy(),this.emitter.removeAllListeners(),this.destroyed=!0},e.prototype.getGeometryBounds=function(){return this.sceneGraphService.getGeometryBounds(this)},e.prototype.getRenderBounds=function(){return this.sceneGraphService.getBounds(this,!0)},e.prototype.getBounds=function(){return this.sceneGraphService.getBounds(this)},e.prototype.getLocalBounds=function(){return this.sceneGraphService.getLocalBounds(this)},e.prototype.getBoundingClientRect=function(){return this.sceneGraphService.getBoundingClientRect(this)},e.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},e.prototype.getAttribute=function(t){var e=this.attributes[t];return Object(s.isNil)(e)?void 0:e},e.prototype.removeAttribute=function(t){delete this.attributes[t]},e.prototype.setAttribute=function(t,e,n){void 0===n&&(n=!1),this.attributes[t]=e},e}(_t),Et=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.client=new P,e.movement=new P,e.offset=new P,e.global=new P,e.screen=new P,e}return Object(a.__extends)(e,t),Object.defineProperty(e.prototype,"clientX",{get:function(){return this.client.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"clientY",{get:function(){return this.client.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"movementX",{get:function(){return this.movement.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"movementY",{get:function(){return this.movement.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsetX",{get:function(){return this.offset.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsetY",{get:function(){return this.offset.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalX",{get:function(){return this.global.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalY",{get:function(){return this.global.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"screenX",{get:function(){return this.screen.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"screenY",{get:function(){return this.screen.y},enumerable:!1,configurable:!0}),e.prototype.getModifierState=function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)},e.prototype.initMouseEvent=function(){throw new Error("Method not implemented.")},e}(vt),Tt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.width=0,e.height=0,e.isPrimary=!1,e}return Object(a.__extends)(e,t),e.prototype.getCoalescedEvents=function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]},e.prototype.getPredictedEvents=function(){throw new Error("getPredictedEvents is not supported!")},e}(Et),Ot=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.DOM_DELTA_LINE=0,e.DOM_DELTA_PAGE=1,e.DOM_DELTA_PIXEL=2,e}return Object(a.__extends)(e,t),e}(Et),wt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.cursor="default",e.mappingTable={},e.mappingState={trackingData:{}},e.eventPool=new Map,e.onPointerDown=function(t){return Object(a.__awaiter)(e,void 0,void 0,(function(){var e,n;return Object(a.__generator)(this,(function(r){switch(r.label){case 0:return t instanceof Tt?[4,this.createPointerEvent(t)]:[2];case 1:return e=r.sent(),this.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType?this.dispatchEvent(e,"touchstart"):"mouse"!==e.pointerType&&"pen"!==e.pointerType||(n=2===e.button,this.dispatchEvent(e,n?"rightdown":"mousedown")),this.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),this.freeEvent(e),[2]}}))}))},e.onPointerUp=function(t){return Object(a.__awaiter)(e,void 0,void 0,(function(){var e,n,r,i,o,u,s,c,f;return Object(a.__generator)(this,(function(a){switch(a.label){case 0:return t instanceof Tt?(e=performance.now(),[4,this.createPointerEvent(t)]):[2];case 1:if(n=a.sent(),this.dispatchEvent(n,"pointerup"),"touch"===n.pointerType?this.dispatchEvent(n,"touchend"):"mouse"!==n.pointerType&&"pen"!==n.pointerType||(s=2===n.button,this.dispatchEvent(n,s?"rightup":"mouseup")),r=this.trackingData(t.pointerId),i=this.findMountedTarget(r.pressTargetsByButton[t.button]),o=i,i&&!n.composedPath().includes(i)){for(u=i;u&&!n.composedPath().includes(u);)n.currentTarget=u,this.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType?this.notifyTarget(n,"touchendoutside"):"mouse"!==n.pointerType&&"pen"!==n.pointerType||(s=2===n.button,this.notifyTarget(n,s?"rightupoutside":"mouseupoutside")),_t.isNode(u)&&(u=u.parentNode);delete r.pressTargetsByButton[t.button],o=u}return o&&((c=this.clonePointerEvent(n,"click")).target=o,c.path=[],r.clicksByButton[t.button]||(r.clicksByButton[t.button]={clickCount:0,target:c.target,timeStamp:e}),(f=r.clicksByButton[t.button]).target===c.target&&e-f.timeStamp<200?++f.clickCount:f.clickCount=1,f.target=c.target,f.timeStamp=e,c.detail=f.clickCount,"mouse"===c.pointerType?this.dispatchEvent(c,"click"):"touch"===c.pointerType?this.dispatchEvent(c,"tap"):this.dispatchEvent(c,"pointertap"),this.freeEvent(c)),this.freeEvent(n),[2]}}))}))},e.onPointerMove=function(t){return Object(a.__awaiter)(e,void 0,void 0,(function(){var e,n,r,i,o,u,s,c,f,l,h;return Object(a.__generator)(this,(function(a){switch(a.label){case 0:return t instanceof Tt?[4,this.createPointerEvent(t)]:[2];case 1:return e=a.sent(),n="mouse"===e.pointerType||"pen"===e.pointerType,r=this.trackingData(t.pointerId),i=this.findMountedTarget(r.overTargets),r.overTargets&&i!==e.target?(o="mousemove"===t.type?"mouseout":"pointerout",[4,this.createPointerEvent(t,o,i||void 0)]):[3,5];case 2:return u=a.sent(),this.dispatchEvent(u,"pointerout"),n&&this.dispatchEvent(u,"mouseout"),e.composedPath().includes(i)?[3,4]:[4,this.createPointerEvent(t,"pointerleave",i||void 0)];case 3:for((s=a.sent()).eventPhase=s.AT_TARGET;s.target&&!e.composedPath().includes(s.target);)s.currentTarget=s.target,this.notifyTarget(s),n&&this.notifyTarget(s,"mouseleave"),_t.isNode(s.target)&&(s.target=s.target.parentNode);this.freeEvent(s),a.label=4;case 4:this.freeEvent(u),a.label=5;case 5:if(i!==e.target){for(c="mousemove"===t.type?"mouseover":"pointerover",f=this.clonePointerEvent(e,c),this.dispatchEvent(f,"pointerover"),n&&this.dispatchEvent(f,"mouseover"),l=i&&_t.isNode(i)&&i.parentNode;l&&l!==(_t.isNode(this.rootTarget)&&this.rootTarget.parentNode)&&l!==e.target;)l=l.parentNode;if(!l||l===(_t.isNode(this.rootTarget)&&this.rootTarget.parentNode)){for((h=this.clonePointerEvent(e,"pointerenter")).eventPhase=h.AT_TARGET;h.target&&h.target!==i&&h.target!==(_t.isNode(this.rootTarget)&&this.rootTarget.parentNode);)h.currentTarget=h.target,this.notifyTarget(h),n&&this.notifyTarget(h,"mouseenter"),_t.isNode(h.target)&&(h.target=h.target.parentNode);this.freeEvent(h)}this.freeEvent(f)}return this.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&this.dispatchEvent(e,"touchmove"),n&&(this.dispatchEvent(e,"mousemove"),this.cursor=this.getCursor(e.target)),r.overTargets=e.composedPath(),this.freeEvent(e),[2]}}))}))},e.onPointerOut=function(t){return Object(a.__awaiter)(e,void 0,void 0,(function(){var e,n,r,i,o;return Object(a.__generator)(this,(function(a){switch(a.label){case 0:return t instanceof Tt?(e=this.trackingData(t.pointerId)).overTargets?(n="mouse"===t.pointerType||"pen"===t.pointerType,r=this.findMountedTarget(e.overTargets),[4,this.createPointerEvent(t,"pointerout",r||void 0)]):[3,3]:[2];case 1:return i=a.sent(),this.dispatchEvent(i),n&&this.dispatchEvent(i,"mouseout"),[4,this.createPointerEvent(t,"pointerleave",r||void 0)];case 2:for((o=a.sent()).eventPhase=o.AT_TARGET;o.target&&o.target!==(_t.isNode(this.rootTarget)&&this.rootTarget.parentNode);)o.currentTarget=o.target,this.notifyTarget(o),n&&this.notifyTarget(o,"mouseleave"),_t.isNode(o.target)&&(o.target=o.target.parentNode);e.overTargets=null,this.freeEvent(i),this.freeEvent(o),a.label=3;case 3:return this.cursor=null,[2]}}))}))},e.onPointerOver=function(t){return Object(a.__awaiter)(e,void 0,void 0,(function(){var e,n,r,i;return Object(a.__generator)(this,(function(o){switch(o.label){case 0:return t instanceof Tt?(e=this.trackingData(t.pointerId),[4,this.createPointerEvent(t)]):[2];case 1:for(n=o.sent(),r="mouse"===n.pointerType||"pen"===n.pointerType,this.dispatchEvent(n,"pointerover"),r&&this.dispatchEvent(n,"mouseover"),"mouse"===n.pointerType&&(this.cursor=this.getCursor(n.target)),(i=this.clonePointerEvent(n,"pointerenter")).eventPhase=i.AT_TARGET;i.target&&i.target!==(_t.isNode(this.rootTarget)&&this.rootTarget.parentNode);)i.currentTarget=i.target,this.notifyTarget(i),r&&this.notifyTarget(i,"mouseenter"),_t.isNode(i.target)&&(i.target=i.target.parentNode);return e.overTargets=n.composedPath(),this.freeEvent(n),this.freeEvent(i),[2]}}))}))},e.onPointerUpOutside=function(t){return Object(a.__awaiter)(e,void 0,void 0,(function(){var e,n,r,i;return Object(a.__generator)(this,(function(o){switch(o.label){case 0:return t instanceof Tt?(e=this.trackingData(t.pointerId),n=this.findMountedTarget(e.pressTargetsByButton[t.button]),[4,this.createPointerEvent(t)]):[2];case 1:if(r=o.sent(),n){for(i=n;i;)r.currentTarget=i,this.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType?this.notifyTarget(r,"touchendoutside"):"mouse"!==r.pointerType&&"pen"!==r.pointerType||this.notifyTarget(r,2===r.button?"rightupoutside":"mouseupoutside"),_t.isNode(i)&&(i=i.parentNode);delete e.pressTargetsByButton[t.button]}return this.freeEvent(r),[2]}}))}))},e.onWheel=function(t){return Object(a.__awaiter)(e,void 0,void 0,(function(){var e;return Object(a.__generator)(this,(function(n){switch(n.label){case 0:return t instanceof Ot?[4,this.createWheelEvent(t)]:[2];case 1:return e=n.sent(),this.dispatchEvent(e),this.freeEvent(e),[2]}}))}))},e}return Object(a.__extends)(e,t),e.prototype.init=function(){this.rootTarget=this.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)},e.prototype.client2Viewport=function(t){var e=this.contextService.getBoundingClientRect();return new P(t.x-((null==e?void 0:e.left)||0),t.y-((null==e?void 0:e.top)||0))},e.prototype.viewport2Client=function(t){var e=this.contextService.getBoundingClientRect();return new P(t.x+((null==e?void 0:e.left)||0),t.y+((null==e?void 0:e.top)||0))},e.prototype.viewport2Canvas=function(t){var e=t.x,n=t.y,r=this.rootTarget.defaultView.getCamera(),i=this.canvasConfig,o=i.width,a=i.height,u=r.getPerspectiveInverse(),s=r.getWorldTransform(),c=l.mat4.multiply(l.mat4.create(),s,u),f=l.vec3.fromValues(e/o*2-1,2*(1-n/a)-1,0);return l.vec3.transformMat4(f,f,c),new P(f[0],f[1])},e.prototype.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=l.mat4.multiply(l.mat4.create(),n,r),o=l.vec3.fromValues(t.x,t.y,0);l.vec3.transformMat4(o,o,i);var a=this.canvasConfig,u=a.width,s=a.height;return new P((o[0]+1)/2*u,(1-(o[1]+1)/2)*s)},e.prototype.setPickHandler=function(t){this.pickHandler=t},e.prototype.addEventMapping=function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((function(t,e){return t.priority-e.priority}))},e.prototype.mapEvent=function(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var n=0,r=e.length;n<r;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for "+t.type)}},e.prototype.dispatchEvent=function(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.emit(e||t.type,t)},e.prototype.propagate=function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;r>=1;r--)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){t.eventPhase=t.BUBBLING_PHASE;for(r=1;r<n.length;r++)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}},e.prototype.propagationPath=function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)return e.unshift(n.document),e;for(var r=0;r<2048&&t!==this.rootTarget;r++)_t.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e},e.prototype.hitTest=function(t){return Object(a.__awaiter)(this,void 0,void 0,(function(){var e,n,r,i,o;return Object(a.__generator)(this,(function(a){switch(a.label){case 0:return e=t.viewportX,n=t.viewportY,r=this.canvasConfig,i=r.width,o=r.height,e<0||n<0||e>i||n>o?[2,null]:[4,this.pickHandler(t)];case 1:return[2,a.sent()||this.rootTarget||null]}}))}))},e.prototype.createPointerEvent=function(t,e,n){return Object(a.__awaiter)(this,void 0,void 0,(function(){var r,i,o;return Object(a.__generator)(this,(function(a){switch(a.label){case 0:return r=this.allocateEvent(Tt),this.copyPointerData(t,r),this.copyMouseData(t,r),this.copyData(t,r),r.nativeEvent=t.nativeEvent,r._originalEvent=t,i=r,null==n?[3,1]:(o=n,[3,3]);case 1:return[4,this.hitTest({clientX:r.clientX,clientY:r.clientY,viewportX:r.viewportX,viewportY:r.viewportY,x:r.global.x,y:r.global.y})];case 2:o=a.sent(),a.label=3;case 3:return i.target=o,"string"==typeof e&&(r.type=e),[2,r]}}))}))},e.prototype.createWheelEvent=function(t){return Object(a.__awaiter)(this,void 0,void 0,(function(){var e,n;return Object(a.__generator)(this,(function(r){switch(r.label){case 0:return e=this.allocateEvent(Ot),this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e._originalEvent=t,n=e,[4,this.hitTest({clientX:e.clientX,clientY:e.clientY,viewportX:e.viewportX,viewportY:e.viewportY,x:e.global.x,y:e.global.y})];case 1:return n.target=r.sent(),[2,e]}}))}))},e.prototype.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},e.prototype.clonePointerEvent=function(t,e){var n=this.allocateEvent(Tt);return n.nativeEvent=t.nativeEvent,n._originalEvent=t._originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n},e.prototype.copyPointerData=function(t,e){t instanceof Tt&&e instanceof Tt&&(e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist)},e.prototype.copyMouseData=function(t,e){t instanceof Et&&e instanceof Et&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.client.copyFrom(t.client),e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset))},e.prototype.copyWheelData=function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ},e.prototype.copyData=function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=performance.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)},e.prototype.allocateEvent=function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e},e.prototype.freeEvent=function(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)},e.prototype.notifyTarget=function(t,e){e=null!=e?e:t.type;var n=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?e+"capture":e;this.notifyListeners(t,n),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)},e.prototype.notifyListeners=function(t,e){var n=t.currentTarget.emitter,r=n._events[e];if(r)if("fn"in r)r.once&&n.removeListener(e,r.fn,void 0,!0),r.fn.call(r.context,t);else for(var i=0;i<r.length&&!t.propagationImmediatelyStopped;i++)r[i].once&&n.removeListener(e,r[i].fn,void 0,!0),r[i].fn.call(r[i].context,t)},e.prototype.findMountedTarget=function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;n>=0;n--){var r=t[n];if(!(r===this.rootTarget||_t.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},e.prototype.getCursor=function(t){for(var e=t;e;){var n=Mt.isElement(e)&&e.getAttribute("cursor");if(n)return n;e=_t.isNode(e)&&e.parentNode}},Object(a.__decorate)([Object(o.inject)(lt),Object(a.__metadata)("design:type",Object)],e.prototype,"renderingContext",void 0),Object(a.__decorate)([Object(o.inject)(ft),Object(a.__metadata)("design:type",Object)],e.prototype,"contextService",void 0),Object(a.__decorate)([Object(o.inject)(G),Object(a.__metadata)("design:type",Object)],e.prototype,"canvasConfig",void 0),Object(a.__decorate)([Object(o.postConstruct)(),Object(a.__metadata)("design:type",Function),Object(a.__metadata)("design:paramtypes",[]),Object(a.__metadata)("design:returntype",void 0)],e.prototype,"init",null),e=Object(a.__decorate)([Object(o.singleton)()],e)}(yt.EventEmitter);function xt(t){return void 0===t?0:t>360||t<-360?t%360:t}function At(t,e,n){return Object(s.isNumber)(t)?l.vec3.fromValues(t,e,n):3===t.length?l.vec3.clone(t):l.vec3.fromValues(t[0],t[1],t[2]||0)}function Pt(t){return t*(Math.PI/180)}function Ct(t){return t*(180/Math.PI)}function St(t,e){var n=e[0],r=e[1],i=e[3],o=e[4];return t[0]=Math.hypot(n,r),t[1]=Math.hypot(i,o),t}function Nt(t,e){return t[0]=e[6],t[1]=e[7],t}function jt(t){return Math.atan2(t[1],t[4])}function It(t,e){return 16===e.length?function(t,e){var n,r,i,o=.5*Math.PI,u=Object(a.__read)(l.mat4.getScaling(l.vec3.create(),e),3),s=u[0],c=u[1],f=u[2];return(r=Math.asin(-e[2]/s))<o?r>-o?(n=Math.atan2(e[6]/c,e[10]/f),i=Math.atan2(e[1]/s,e[0]/s)):(i=0,n=-Math.atan2(e[4]/c,e[5]/c)):(i=0,n=Math.atan2(e[4]/c,e[5]/c)),t[0]=n,t[1]=r,t[2]=i,t}(t,e):function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=r*r,u=i*i,s=o*o,c=n*n+a+u+s,f=n*o-r*i;return f>.499995*c?(t[0]=Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):f<-.499995*c?(t[0]=-Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-o*r)),t[1]=Math.atan2(2*(n*o+r*i),1-2*(u+s)),t[2]=Math.atan2(2*(n*r+i*o),1-2*(a+u))),t}(t,e)}function Rt(t,e,n,r,i){var o=Math.cos(t),a=Math.sin(t);return l.mat3.fromValues(r*o,i*a,0,-r*a,i*o,0,e,n,1)}var kt="function"==typeof Float32Array,Dt=function(t,e){return 1-3*e+3*t},Bt=function(t,e){return 3*e-6*t},Lt=function(t){return 3*t},Ft=function(t,e,n){return((Dt(e,n)*t+Bt(e,n))*t+Lt(e))*t},Vt=function(t,e,n){return 3*Dt(e,n)*t*t+2*Bt(e,n)*t+Lt(e)},Gt=function(t,e,n,r){if(!(0<=t&&t<=1&&0<=n&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(t===e&&n===r)return function(t){return t};for(var i=kt?new Float32Array(11):new Array(11),o=0;o<11;++o)i[o]=Ft(.1*o,t,n);var a=function(e){for(var r=0,o=1;10!==o&&i[o]<=e;++o)r+=.1;--o;var a=r+.1*((e-i[o])/(i[o+1]-i[o])),u=Vt(a,t,n);return u>=.001?function(t,e,n,r){for(var i=0;i<4;++i){var o=Vt(e,n,r);if(0===o)return e;e-=(Ft(e,n,r)-t)/o}return e}(e,a,t,n):0===u?a:function(t,e,n,r,i){var o,a,u=0;do{(o=Ft(a=e+(n-e)/2,r,i)-t)>0?n=a:e=a}while(Math.abs(o)>1e-7&&++u<10);return a}(e,r,r+.1,t,n)};return function(t){return 0===t||1===t?t:Ft(a(t),e,r)}},qt=function(t){return"-"===(t=t.replace(/([A-Z])/g,(function(t){return"-"+t.toLowerCase()}))).charAt(0)?t.substr(1):t},Ut=function(t,e,n){return Math.min(Math.max(t,e),n)},Wt=function(t){return Math.pow(t,2)},zt=function(t){return Math.pow(t,3)},Ht=function(t){return Math.pow(t,4)},Yt=function(t){return Math.pow(t,5)},$t=function(t){return Math.pow(t,6)},Xt=function(t){return 1-Math.cos(t*Math.PI/2)},Kt=function(t){return 1-Math.sqrt(1-t*t)},Jt=function(t){return t*t*(3*t-2)},Zt=function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)},Qt=function(t,e){void 0===e&&(e=[]);var n=Object(a.__read)(e,2),r=n[0],i=void 0===r?1:r,o=n[1],u=void 0===o?.5:o,s=Ut(Number(i),1,10),c=Ut(Number(u),.1,2);return 0===t||1===t?t:-s*Math.pow(2,10*(t-1))*Math.sin((t-1-c/(2*Math.PI)*Math.asin(1/s))*(2*Math.PI)/c)},te=function(t,e,n){void 0===e&&(e=[]);var r=Object(a.__read)(e,4),i=r[0],o=void 0===i?1:i,u=r[1],s=void 0===u?100:u,c=r[2],f=void 0===c?10:c,l=r[3],h=void 0===l?0:l;o=Ut(o,.1,1e3),s=Ut(s,.1,1e3),f=Ut(f,.1,1e3),h=Ut(h,.1,1e3);var d=Math.sqrt(s/o),p=f/(2*Math.sqrt(s*o)),y=p<1?d*Math.sqrt(1-p*p):0,v=p<1?(p*d-h)/y:-h+d,g=n?n*t/1e3:t;return g=p<1?Math.exp(-g*p*d)*(1*Math.cos(y*g)+v*Math.sin(y*g)):(1+v*g)*Math.exp(-g*d),0===t||1===t?t:1-g},ee=(new Map,function(t,e){void 0===e&&(e=[]);var n=Object(a.__read)(e,2),r=n[0],i=void 0===r?10:r;return("start"==n[1]?Math.ceil:Math.floor)(Ut(t,0,1)*i)/i}),ne=function(t,e){void 0===e&&(e=[]);var n=Object(a.__read)(e,4),r=n[0],i=n[1],o=n[2],u=n[3];return Gt(r,i,o,u)(t)},re=Gt(.42,0,1,1),ie=function(t){return function(e,n,r){return void 0===n&&(n=[]),1-t(1-e,n,r)}},oe=function(t){return function(e,n,r){return void 0===n&&(n=[]),e<.5?t(2*e,n,r)/2:1-t(-2*e+2,n,r)/2}},ae=function(t){return function(e,n,r){return void 0===n&&(n=[]),e<.5?(1-t(1-2*e,n,r))/2:(t(2*e-1,n,r)+1)/2}},ue={steps:ee,"step-start":function(t){return ee(t,[1,"start"])},"step-end":function(t){return ee(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":ne,ease:function(t){return ne(t,[.25,.1,.25,1])},in:re,out:ie(re),"in-out":oe(re),"out-in":ae(re),"in-quad":Wt,"out-quad":ie(Wt),"in-out-quad":oe(Wt),"out-in-quad":ae(Wt),"in-cubic":zt,"out-cubic":ie(zt),"in-out-cubic":oe(zt),"out-in-cubic":ae(zt),"in-quart":Ht,"out-quart":ie(Ht),"in-out-quart":oe(Ht),"out-in-quart":ae(Ht),"in-quint":Yt,"out-quint":ie(Yt),"in-out-quint":oe(Yt),"out-in-quint":ae(Yt),"in-expo":$t,"out-expo":ie($t),"in-out-expo":oe($t),"out-in-expo":ae($t),"in-sine":Xt,"out-sine":ie(Xt),"in-out-sine":oe(Xt),"out-in-sine":ae(Xt),"in-circ":Kt,"out-circ":ie(Kt),"in-out-circ":oe(Kt),"out-in-circ":ae(Kt),"in-back":Jt,"out-back":ie(Jt),"in-out-back":oe(Jt),"out-in-back":ae(Jt),"in-bounce":Zt,"out-bounce":ie(Zt),"in-out-bounce":oe(Zt),"out-in-bounce":ae(Zt),"in-elastic":Qt,"out-elastic":ie(Qt),"in-out-elastic":oe(Qt),"out-in-elastic":ae(Qt),spring:te,"spring-in":te,"spring-out":ie(te),"spring-in-out":oe(te),"spring-out-in":ae(te)},se=function(t){return ue[function(t){return qt(t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()}(t)]||ue.linear},ce=function(t){return t};function fe(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var le="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",he=new RegExp("cubic-bezier\\("+le+","+le+","+le+","+le+"\\)"),de=/steps\(\s*(\d+)\s*\)/,pe=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function ye(t){var e=he.exec(t);if(e)return Gt.apply(void 0,Object(a.__spreadArray)([],Object(a.__read)(e.slice(1).map(Number)),!1));var n=de.exec(t);if(n)return fe(Number(n[1]),0);var r=pe.exec(t);return r?fe(Number(r[1]),{start:1,middle:.5,end:0}[r[2]]):se(t)}function ve(t){return Math.abs(function(t){var e;if(0===t.duration||0===t.iterations)return 0;return("auto"===t.duration?0:Number(t.duration))*(null!==(e=t.iterations)&&void 0!==e?e:1)}(t)/(t.playbackRate||1))}function ge(t,e,n){var r=function(t,e,n){if(null===e)return 0;var r=n.delay+t+n.endDelay;return e<Math.min(n.delay,r)?1:e>=Math.min(n.delay+t,r)?2:3}(t,e,n),i=function(t,e,n,r,i){switch(r){case 1:return"backwards"===e||"both"===e?0:null;case 3:return n-i;case 2:return"forwards"===e||"both"===e?t:null;case 0:return null}}(t,n.fill,e,r,n.delay);if(null===i)return null;var o="auto"===n.duration?0:n.duration,a=function(t,e,n,r,i){var o=i;return 0===t?1!==e&&(o+=n):o+=r/t,o}(o,r,n.iterations,i,n.iterationStart),u=function(t,e,n,r,i,o){var a=t===1/0?e%1:t%1;return 0!==a||2!==n||0===r||0===i&&0!==o||(a=1),a}(a,n.iterationStart,r,n.iterations,i,o),s=function(t,e,n,r){return 2===t&&e===1/0?1/0:1===n?Math.floor(r)-1:Math.floor(r)}(r,n.iterations,u,a),c=function(t,e,n){var r=t;if("normal"!==t&&"reverse"!==t){var i=e;"alternate-reverse"===t&&(i+=1),r="normal",i!==1/0&&i%2!=0&&(r="reverse")}return"normal"===r?n:1-n}(n.direction,s,u);return n.currentIteration=s,n.progress=c,n.easingFunction(c)}var me={in:"ease-in",out:"ease-out","in-out":"ease-in-out","in-sine":"cubic-bezier(0.47, 0, 0.745, 0.715)","out-sine":"cubic-bezier(0.39, 0.575, 0.565, 1)","in-out-sine":"cubic-bezier(0.445, 0.05, 0.55, 0.95)","in-quad":"cubic-bezier(0.55, 0.085, 0.68, 0.53)","out-quad":"cubic-bezier(0.25, 0.46, 0.45, 0.94)","in-out-quad":"cubic-bezier(0.455, 0.03, 0.515, 0.955)","in-cubic":"cubic-bezier(0.55, 0.055, 0.675, 0.19)","out-cubic":"cubic-bezier(0.215, 0.61, 0.355, 1)","in-out-cubic":"cubic-bezier(0.645, 0.045, 0.355, 1)","in-quart":"cubic-bezier(0.895, 0.03, 0.685, 0.22)","out-quart":"cubic-bezier(0.165, 0.84, 0.44, 1)","in-out-quart":"cubic-bezier(0.77, 0, 0.175, 1)","in-quint":"cubic-bezier(0.755, 0.05, 0.855, 0.06)","out-quint":"cubic-bezier(0.23, 1, 0.32, 1)","in-out-quint":"cubic-bezier(0.86, 0, 0.07, 1)","in-expo":"cubic-bezier(0.95, 0.05, 0.795, 0.035)","out-expo":"cubic-bezier(0.19, 1, 0.22, 1)","in-out-expo":"cubic-bezier(1, 0, 0, 1)","in-circ":"cubic-bezier(0.6, 0.04, 0.98, 0.335)","out-circ":"cubic-bezier(0.075, 0.82, 0.165, 1)","in-out-circ":"cubic-bezier(0.785, 0.135, 0.15, 0.86)","in-back":"cubic-bezier(0.6, -0.28, 0.735, 0.045)","out-back":"cubic-bezier(0.175, 0.885, 0.32, 1.275)","in-out-back":"cubic-bezier(0.68, -0.55, 0.265, 1.55)"};Object.keys(me);function be(t,e,n){var r=function(t,e){for(var n={},r=0;r<t.length;r++)for(var i in t[r])if(_e(i)){var o={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:ye(t[r].easing)||e.easingFunction,value:t[r][i]};n[i]=n[i]||[],n[i].push(o)}return n}(t,e),i=function(t,e){var n=[];for(var r in t)for(var i=t[r],o=0;o<i.length-1;o++){var a=o,u=o+1,s=i[a].computedOffset,c=i[u].computedOffset,f=s,l=c;0===o&&(f=-1/0,0===c&&(u=a)),o===i.length-2&&(l=1/0,1===s&&(a=u)),n.push({applyFrom:f,applyTo:l,startOffset:i[a].computedOffset,endOffset:i[u].computedOffset,easingFunction:i[a].easingFunction,property:r,interpolation:Me(r,i[a].value,i[u].value,e)})}return n.sort((function(t,e){return t.startOffset-e.startOffset})),n}(r,n);return function(t,e){if(null!==e)i.filter((function(t){return e>=t.applyFrom&&e<t.applyTo})).forEach((function(n){var r=e-n.startOffset,i=n.endOffset-n.startOffset,o=0===i?0:n.easingFunction(r/i);t.style[n.property]=n.interpolation(o)}));else for(var n in r)_e(n)&&(t.style[n]=null)}}function _e(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}function Me(t,e,n,r){var i=e,o=n,u=Rr.get(ot)(t),s=Rr.get(ct)(t);u&&(i=u(e,r),o=u(n,r));var c=s&&s(i,o,r);if(c){var f=Ee.apply(void 0,Object(a.__spreadArray)([],Object(a.__read)(c),!1));return function(t){return 0===t?e:1===t?n:f(t)}}return Ee(!1,!0,(function(t){return t?n:e}))}var Ee=function(t,e,n){return function(r){return n(function t(e,n,r){if("number"==typeof e&&"number"==typeof n)return e*(1-r)+n*r;if("boolean"==typeof e&&"boolean"==typeof n||"string"==typeof e&&"string"==typeof n)return r<.5?e:n;if(Array.isArray(e)&&Array.isArray(n)&&e.length===n.length){for(var i=[],o=0;o<e.length;o++)i.push(t(e[o],n[o],r));return i}throw"Mismatched interpolation arguments "+e+":"+n}(t,e,r))}},Te=n(5);function Oe(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}function we(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?Te.Cubic.length.apply(Te.Cubic,Object(a.__spreadArray)([],Object(a.__read)(r),!1)):0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),o=t.slice(6,8),a=Oe(n,r,e),u=Oe(r,i,e),s=Oe(i,o,e),c=Oe(a,u,e),f=Oe(u,s,e),l=Oe(c,f,e);return[["C"].concat(a,c,l),["C"].concat(f,s,o)]}(r):[t,t]:[t],l:i}}))}function xe(t,e,n){var r=we(t),i=we(e),o=r.length,a=i.length,u=r.filter((function(t){return t.l})).length,s=i.filter((function(t){return t.l})).length,c=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/u||0,f=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,l=n||Math.max(o,a),h=[c,f],d=[l-o,l-a],p=0,y=[r,i].map((function(t,e){return t.l===l?t.map((function(t){return t.s})):t.map((function(t,n){return p=n&&d[e]&&t.l>=h[e],d[e]-=p?1:0,p?t.ss:[t.s]})).flat()}));return y[0].length===y[1].length?y:xe(y[0],y[1],l)}function Ae(t){return Ce(t)>=0}function Pe(t,e,n,r,i,o,a,u){return 3*((u-e)*(n+i)-(a-t)*(r+o)+r*(t-i)-n*(e-o)+u*(i+t/3)-a*(o+e/3))/20}function Ce(t){var e=0,n=0,r=0,i=0,o=0;return t.map((function(t){var u;switch(t[0]){case"M":case"Z":return r="M"===t[0]?t[1]:r,i="M"===t[0]?t[2]:i,e=r,n=i,0;default:return o=Pe.apply(0,[e,n].concat(t.slice(1))),u=Object(a.__read)(t.slice(-2),2),e=u[0],n=u[1],o}})).reduce((function(t,e){return t+e}),0)}function Se(t){var e=t.slice(1).map((function(e,n,r){return n?r[n-1].slice(-2).concat(e.slice(1)):t[0].slice(1).concat(e.slice(1))})).map((function(t){return t.map((function(e,n){return t[t.length-n-2*(1-n%2)]}))})).reverse();return[["M"].concat(e[0].slice(0,2))].concat(e.map((function(t){return["C"].concat(t.slice(2))})))}function Ne(t){return t.map((function(t){return Array.isArray(t)?Ne(t):Number.isNaN(+t)?t:+t}))}function je(t,e){var n=t.length-1,r=[],i=0,o=function(t){var e=t.length,n=e-1;return t.map((function(r,i){return t.map((function(r,o){var a,u=i+o;return 0===o||t[u]&&"M"===t[u][0]?(a=t[u],["M"].concat(a.slice(-2))):(u>=e&&(u-=n),t[u])}))}))}(t);return o.forEach((function(o,a){t.slice(1).forEach((function(r,o){i+=function(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}(t[(a+o)%n].slice(-2),e[o%n].slice(-2))})),r[a]=i,i=0})),o[r.indexOf(Math.min.apply(null,r))]}function Ie(t,e,n,r){var i=(-1+Math.sqrt(2))/3*4,o=t*i,a=e*i,u=n-t,s=n+t,c=r-e,f=r+e;return[["M",u,r],["C",u,r-a,n-o,c,n,c],["C",n+o,c,s,r-a,s,r],["C",s,r+a,n+o,f,n,f],["C",n-o,f,u,r+a,u,r],["Z"]]}function Re(t){var e=t.getLocalTransform(),n=(t.style.anchor,[]);switch(t.nodeName){case D.Line:var r=t.parsedStyle;n=function(t,e,n,r){return[["M",t,e],["L",n,r]]}(r.x1,r.y1,r.x2,r.y2);break;case D.Circle:var i=t.parsedStyle,o=i.r,a=i.x,u=void 0===a?0:a,s=i.y;n=Ie(o,o,u,void 0===s?0:s);break;case D.Ellipse:var c=t.parsedStyle,f=c.rx,h=c.ry,d=c.x,p=void 0===d?0:d,y=c.y;n=Ie(f,h,p,void 0===y?0:y);break;case D.Polyline:case D.Polygon:n=function(t){return t.map((function(t,e){return[0===e?"M":"L",t[0],t[1]]}))}(t.parsedStyle.points.points);break;case D.Rect:var v=t.parsedStyle,g=v.width,m=v.height,b=v.x,_=v.y;v.radius;n=function(t,e,n,r,i){return[["M",n,r],["L",n+t,r],["L",n+t,r+e],["L",n,r+e],["Z"]]}(g,m,b,_);break;case D.Path:n=t.parsedStyle.path.curve}if(n.length)return function(t,e,n,r){var i=r.x,o=r.y;return r.width,r.height,t.reduce((function(t,n){var r="";if("M"===n[0]||"L"===n[0]){var a=l.vec3.fromValues(n[1]-i,n[2]-o,0);l.vec3.transformMat4(a,a,e),r=""+n[0]+a[0]+","+a[1]}else if("Z"===n[0])r=n[0];else if("C"===n[0]){var u=l.vec3.fromValues(n[1]-i,n[2]-o,0),s=l.vec3.fromValues(n[3]-i,n[4]-o,0),c=l.vec3.fromValues(n[5]-i,n[6]-o,0);l.vec3.transformMat4(u,u,e),l.vec3.transformMat4(s,s,e),l.vec3.transformMat4(c,c,e),r=""+n[0]+u[0]+","+u[1]+","+s[0]+","+s[1]+","+c[0]+","+c[1]}return t+r}),"")}(n,e,0,t.parsedStyle)}function ke(t){return("object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:function(t){return setTimeout(t,16)})(t)}function De(t){return("object"==typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame:clearTimeout)(t)}function Be(t,e,n){var r=n.getGeometryBounds();if(r){var i=n.entity.getComponent(c);if(i&&i.contentBounds){var o=l.vec3.multiply(l.vec3.create(),l.vec3.fromValues.apply(l.vec3,Object(a.__spreadArray)([],Object(a.__read)(r.halfExtents.map((function(t){return 2*t}))),!1)),l.vec3.subtract(l.vec3.create(),At(e||l.vec3.create()),At(t||l.vec3.create())));i.contentBounds.update(l.vec3.subtract(i.contentBounds.center,i.contentBounds.center,o),i.contentBounds.halfExtents),i.renderBounds.update(l.vec3.subtract(i.renderBounds.center,i.renderBounds.center,o),i.renderBounds.halfExtents),k(n)}}}var Le=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t};function Fe(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Ve(){}var Ge,qe="\\s*([+-]?\\d+)\\s*",Ue="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",We="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ze=/^#([0-9a-f]{3,8})$/,He=new RegExp("^rgb\\("+[qe,qe,qe]+"\\)$"),Ye=new RegExp("^rgb\\("+[We,We,We]+"\\)$"),$e=new RegExp("^rgba\\("+[qe,qe,qe,Ue]+"\\)$"),Xe=new RegExp("^rgba\\("+[We,We,We,Ue]+"\\)$"),Ke=new RegExp("^hsl\\("+[Ue,We,We]+"\\)$"),Je=new RegExp("^hsla\\("+[Ue,We,We,Ue]+"\\)$"),Ze={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Qe(){return this.rgb().formatHex()}function tn(){return this.rgb().formatRgb()}function en(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=ze.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?nn(e):3===n?new an(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?rn(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?rn(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=He.exec(t))?new an(e[1],e[2],e[3],1):(e=Ye.exec(t))?new an(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=$e.exec(t))?rn(e[1],e[2],e[3],e[4]):(e=Xe.exec(t))?rn(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Ke.exec(t))?fn(e[1],e[2]/100,e[3]/100,1):(e=Je.exec(t))?fn(e[1],e[2]/100,e[3]/100,e[4]):Ze.hasOwnProperty(t)?nn(Ze[t]):"transparent"===t?new an(NaN,NaN,NaN,0):null}function nn(t){return new an(t>>16&255,t>>8&255,255&t,1)}function rn(t,e,n,r){return r<=0&&(t=e=n=NaN),new an(t,e,n,r)}function on(t){return t instanceof Ve||(t=en(t)),t?new an((t=t.rgb()).r,t.g,t.b,t.opacity):new an}function an(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function un(){return"#"+cn(this.r)+cn(this.g)+cn(this.b)}function sn(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function cn(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function fn(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new hn(t,e,n,r)}function ln(t){if(t instanceof hn)return new hn(t.h,t.s,t.l,t.opacity);if(t instanceof Ve||(t=en(t)),!t)return new hn;if(t instanceof hn)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,u=o-i,s=(o+i)/2;return u?(a=e===o?(n-r)/u+6*(n<r):n===o?(r-e)/u+2:(e-n)/u+4,u/=s<.5?o+i:2-o-i,a*=60):u=s>0&&s<1?0:a,new hn(a,u,s,t.opacity)}function hn(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function dn(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}Le(Ve,en,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Qe,formatHex:Qe,formatHsl:function(){return ln(this).formatHsl()},formatRgb:tn,toString:tn}),Le(an,(function(t,e,n,r){return 1===arguments.length?on(t):new an(t,e,n,null==r?1:r)}),Fe(Ve,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new an(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new an(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:un,formatHex:un,formatRgb:sn,toString:sn})),Le(hn,(function(t,e,n,r){return 1===arguments.length?ln(t):new hn(t,e,n,null==r?1:r)}),Fe(Ve,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new hn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new hn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new an(dn(t>=240?t-240:t+120,i,r),dn(t,i,r),dn(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}})),function(t){t[t.Constant=0]="Constant",t[t.LinearGradient=1]="LinearGradient",t[t.RadialGradient=2]="RadialGradient",t[t.Pattern=3]="Pattern"}(Ge||(Ge={}));var pn=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,yn=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,vn=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,gn=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;function mn(t,e){if(void 0===t&&(t=""),"transparent"===t)return{type:Ge.Constant,value:[0,0,0,0],formatted:"rgba(0,0,0,0)"};var n=t[0];if("("===t[1]||"("===t[2])if("l"===n){var r=function(t){var e,n=pn.exec(t);if(n){var r=parseFloat(n[1])%360*(Math.PI/180),i=(null===(e=n[2].match(gn))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[],o=Object(a.__read)([1,1],2),u=o[0],s=o[1],c=Object(a.__read)([0,0],2),f=c[0],l=c[1],h=void 0,d=void 0;r>=0&&r<.5*Math.PI?(h={x:f,y:l},d={x:u,y:s}):.5*Math.PI<=r&&r<Math.PI?(h={x:u,y:l},d={x:f,y:s}):Math.PI<=r&&r<1.5*Math.PI?(h={x:u,y:s},d={x:f,y:l}):(h={x:f,y:s},d={x:u,y:l});var p=Math.tan(r),y=p*p,v=(d.x-h.x+p*(d.y-h.y))/(y+1)+h.x,g=p*(d.x-h.x+p*(d.y-h.y))/(y+1)+h.y;return{x0:h.x,y0:h.y,x1:v,y1:g,steps:i}}return null}(t);if(r)return{type:Ge.LinearGradient,value:r,formatted:""}}else if("r"===n){var i=function(t){var e,n=yn.exec(t);if(n){var r=parseFloat(n[1]),i=parseFloat(n[2]),o=parseFloat(n[3]),a=(null===(e=n[4].match(gn))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[];if(0===o){var u=n[4].match(gn);return u[u.length-1].split(":")[1]}return{x0:r,y0:i,r0:0,x1:.5,y1:.5,r1:o,steps:a}}return null}(t);if(i){if(!Object(s.isString)(i))return{type:Ge.RadialGradient,value:i,formatted:""};t=i}}else if("p"===n){var o=function(t){var e=vn.exec(t);if(e){var n=e[1],r=e[2];switch(n){case"a":n="repeat";break;case"x":n="repeat-x";break;case"y":n="repeat-y";break;case"n":n="no-repeat";break;default:n="no-repeat"}return{src:r,repetition:n}}return null}(t);if(o)return{type:Ge.Pattern,value:o,formatted:""}}var u=en(t),c=[0,0,0,0];return null!==u&&(c[0]=u.r/255,c[1]=u.g/255,c[2]=u.b/255,c[3]=u.opacity),{type:Ge.Constant,value:c,formatted:u&&"rgba("+u.r+","+u.g+","+u.b+","+u.opacity+")"||"rgba(0,0,0,0)"}}function bn(t,e,n){if(t.type===Ge.Constant&&e.type===Ge.Constant)return[t.value,e.value,function(t){var e=t.slice();if(e[3])for(var n=0;n<3;n++)e[n]=Math.round(Object(s.clamp)(255*e[n],0,255));return e[3]=Object(s.clamp)(e[3],0,1),"rgba("+e.join(",")+")"}]}function _n(t,e,n){var r=Rr.get(F)(n.nodeName);if(r){var i=n.entity.getComponent(c);i.contentBounds||(i.contentBounds=new v),i.renderBounds||(i.renderBounds=new v);var o=r.update(n.parsedStyle,n),a=o.width,u=o.height,s=o.depth,f=void 0===s?0:s,h=o.x,d=void 0===h?0:h,p=o.y,y=void 0===p?0:p,g=o.offsetX,m=void 0===g?0:g,b=o.offsetY,_=void 0===b?0:b,M=o.offsetZ,E=void 0===M?0:M;n.parsedStyle.width=a,n.parsedStyle.height=u,n.parsedStyle.depth=f,n.nodeName===D.Line||n.nodeName===D.Polyline||n.nodeName===D.Polygon||n.nodeName===D.Path?(n.parsedStyle.offsetX=d-(n.parsedStyle.defX||0),n.parsedStyle.offsetY=y-(n.parsedStyle.defY||0),n.parsedStyle.defX=d,n.parsedStyle.defY=y,n.translateLocal(n.parsedStyle.offsetX,n.parsedStyle.offsetY),n.parsedStyle.x=n.style.x,n.parsedStyle.y=n.style.y):(n.parsedStyle.x=d,n.parsedStyle.y=y);var T=l.vec3.fromValues(a/2,u/2,f/2),O=n.parsedStyle,w=O.lineWidth,x=void 0===w?0:w,A=(O.padding,O.anchor),P=void 0===A?[0,0]:A,C=O.shadowColor,S=O.filter,N=void 0===S?[]:S;n.nodeName===D.Text&&delete n.parsedStyle.anchor;var j=l.vec3.fromValues((1-2*P[0])*T[0]+m,(1-2*P[1])*T[1]+_,(1-2*(P[2]||0))*T[2]+E);if(i.contentBounds.update(j,T),x&&l.vec3.add(T,T,l.vec3.fromValues(x/2,x/2,0)),i.renderBounds.update(j,T),C&&C.type===Ge.Constant){var I=i.renderBounds,R=I.min,B=I.max,L=n.parsedStyle,V=L.shadowBlur,G=void 0===V?0:V,q=L.shadowOffsetX,U=void 0===q?0:q,W=L.shadowOffsetY,z=void 0===W?0:W,H=R[0]-G+U,Y=B[0]+G+U,$=R[1]-G+z,X=B[1]+G+z;R[0]=Math.min(R[0],H),B[0]=Math.max(B[0],Y),R[1]=Math.min(R[1],$),B[1]=Math.max(B[1],X),i.renderBounds.setMinMax(R,B)}N.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var r=n[0].value;i.renderBounds.update(i.renderBounds.center,l.vec3.add(i.renderBounds.halfExtents,i.renderBounds.halfExtents,l.vec3.fromValues(r,r,0)))}else if("drop-shadow"===e){var o=n[0].value,a=n[1].value,u=n[2].value,s=i.renderBounds,c=s.min,f=s.max,h=c[0]-u+o,d=f[0]+u+o,p=c[1]-u+a,y=f[1]+u+a;c[0]=Math.min(c[0],h),f[0]=Math.max(f[0],d),c[1]=Math.min(c[1],p),f[1]=Math.max(f[1],y),i.renderBounds.setMinMax(c,f)}})),k(n)}}function Mn(t,e,n){var r=n.parsedStyle,i=r.x,o=void 0===i?0:i,a=r.y,u=void 0===a?0:a;n.setLocalPosition(o,u)}function En(t){return t.toFixed(3).replace(/0+$/,"").replace(/\.$/,"")}function Tn(t){return"number"==typeof t?t:/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Number(t):0}function On(t,e){return[t,e,En]}function wn(t,e){return function(n,r){return[n,r,function(n){return En(Object(s.clamp)(n,t,e))}]}}function xn(t,e){if(t.length==e.length)return[t,e,function(t){return t}]}function An(t,e,n){if(t&&t!==e&&t.style.offsetPathTargets){var r=t.style.offsetPathTargets.indexOf(n);t.style.offsetPathTargets.splice(r,1)}e&&(e.style.offsetPathTargets||(e.style.offsetPathTargets=[]),e.style.offsetPathTargets.push(n))}function Pn(t,e,n){if(n.attributes.offsetPath){var r=n.attributes.offsetPath.nodeName;if(r===D.Line||r===D.Path||r===D.Polyline){var i=n.attributes.offsetPath.getPoint(e);i&&n.setLocalPosition(i.x,i.y)}}}function Cn(t,e,n){if(t&&t!==e&&t.style.clipPathTargets){var r=t.style.clipPathTargets.indexOf(n);t.style.clipPathTargets.splice(r,1)}e&&(e.style.clipPathTargets||(e.style.clipPathTargets=[]),e.style.clipPathTargets.push(n)),k(n)}function Sn(t,e,n){if(n.parentNode){var r=n.parentNode.entity,i=r.getComponent(f),o=r.getComponent(y);i&&(i.dirty=!0),o&&(o.dirty=!0)}}function Nn(t){return"px"===t||"%"===t}function jn(t){return"deg"===t||"rad"===t||"turn"===t}function In(t,e){if("0"===(e=e.trim().toLowerCase())){if("px".search(t)>=0)return{unit:"px",value:0};if("%".search(t)>=0)return{unit:"%",value:0}}if(Object(s.isFinite)(Number(e)))return{unit:"",value:Number(e)};var n=[];e=e.replace(t,(function(t){return n.push(t),"U"+t}));var r="U("+t.source+")";return n.map((function(t){return{unit:t,value:Number(e.replace(new RegExp("U"+t,"g"),"").replace(new RegExp(r,"g"),"*0"))}}))[0]}function Rn(t,e,n,r,i){void 0===r&&(r=null),void 0===i&&(i=0);var o=t.unit,a=t.value||0,u=e.value||0;return(Nn(t.unit)||Nn(e.unit))&&(a=Ln(t,i,r),u=Ln(e,i,r),o="px"),(jn(t.unit)||jn(e.unit))&&(a=Fn(t),u=Fn(e),o="deg"),[a,u,function(t){return n&&(t=Math.max(t,0)),En(t)+o}]}var kn=In.bind(null,new RegExp("px","g")),Dn=In.bind(null,new RegExp("px|%","g")),Bn=In.bind(null,/deg|rad|grad|turn/g);function Ln(t,e,n){if("px"===t.unit)return Number(t.value);if("%"===t.unit&&n){var r=n.getBounds(),i=0;return r&&(i=2*r.halfExtents[e]),Number(t.value)/100*i}return 0}function Fn(t){var e=0;return"deg"===t.unit?e=Number(t.value):"rad"===t.unit?e=Ct(Number(t.value)):"turn"===t.unit&&(e=360*Number(t.value)),e}function Vn(t,e,n){n.setOrigin(e[0],e[1],e[2])}function Gn(t,e,n){var r,i,o=e.split(" ");if(1===o.length&&("top"===o[0]||"bottom"===o[0]?(o[1]=o[0],o[0]="center"):o[1]="center"),2===o.length){var a=Dn(qn(o[0])),u=Dn(qn(o[1]));a&&(r=Ln(a,0,n)),u&&(i=Ln(u,1,n))}Object(s.isNil)(r)||Object(s.isNil)(i)||n.setOrigin([r,i])}function qn(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var Un=null,Wn={unit:"px",value:0},zn={unit:"deg",value:0};function Hn(t){return function(e){var n=0;return t.map((function(t){return t===Un?e[n++]:t}))}}function Yn(t){return t}var $n={rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],scale:["Nn",Hn([Un,Un,1]),Yn],scalex:["N",Hn([Un,1,1]),Hn([Un,1])],scaley:["N",Hn([1,Un,1]),Hn([1,Un])],scalez:["N",Hn([1,1,Un])],scale3d:["NNN",Yn],translate:["Tt",Hn([Un,Un,Wn]),Yn],translatex:["T",Hn([Un,Wn,Wn]),Hn([Un,Wn])],translatey:["T",Hn([Wn,Un,Wn]),Hn([Wn,Un])],translatez:["L",Hn([Wn,Wn,Un])],translate3d:["TTL",Yn]};function Xn(t){if("none"===(t=t.toLowerCase().trim()))return[];for(var e,n=/\s*(\w+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];i=e.index+e[0].length;var o=e[1],a=$n[o];if(!a)return[];var u=e[2].split(","),s=a[0];if(s.length<u.length)return[];for(var c=[],f=0;f<s.length;f++){var l=u[f],h=s[f],d=void 0;if(void 0===(d=l?{A:function(t){return"0"===t.trim()?zn:Bn(t)},N:Tn,T:Dn,L:kn}[h.toUpperCase()](l):{a:zn,n:c[0],t:Wn}[h]))return[];c.push(d)}if(r.push({t:o,d:c}),n.lastIndex===t.length)return r}return[]}function Kn(t){return t.replace(/[xy]/,"")}function Jn(t){return t.replace(/(x|y|z|3d)?$/,"3d")}function Zn(t,e,n){var r=!1;if(!t.length||!e.length){t.length||(r=!0,t=e,e=[]);for(var i=function(n){var r=t[n],i=r.t,o=r.d,a="scale"===i.substr(0,5)?1:0;e.push({t:i,d:o.map((function(t){return"number"==typeof t?a:{unit:t.unit,value:a}}))})},o=0;o<t.length;o++)i(o)}var a,u,s=[],c=[],f=[];if(t.length!==e.length);else for(o=0;o<t.length;o++){var l=t[o].t,h=e[o].t,d=t[o].d,p=e[o].d,y=$n[l],v=$n[h],g=void 0;if(u=h,("perspective"!==(a=l)||"perspective"!==u)&&("matrix"!==a&&"matrix3d"!==a||"matrix"!==u&&"matrix3d"!==u)){if(l===h)g=l;else if(y[2]&&v[2]&&Kn(l)===Kn(h))g=Kn(l),d=y[2](d),p=v[2](p);else{if(!y[1]||!v[1]||Jn(l)!==Jn(h))break;g=Jn(l),d=y[1](d),p=v[1](p)}for(var m=[],b=[],_=[],M=0;M<d.length;M++){var E=("number"==typeof d[M]?On:Rn)(d[M],p[M],!1,n,M);m[M]=E[0],b[M]=E[1],_.push(E[2])}s.push(m),c.push(b),f.push([g,_])}}if(r){var T=s;s=c,c=T}return[s,c,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return f[e][1][n](t)})).join(",");return"matrix"===f[e][0]&&16===n.split(",").length&&(f[e][0]="matrix3d"),f[e][0]+"("+n+")"})).join(" ")}]}function Qn(t,e,n){Object(s.uniq)(Object(a.__spreadArray)(Object(a.__spreadArray)([],Object(a.__read)((t||[]).map((function(t){return t.t}))),!1),Object(a.__read)((e||[]).map((function(t){return t.t}))),!1)).forEach((function(r){var i=(e||[]).find((function(t){return t.t===r})),o=(t||[]).find((function(t){return t.t===r}));if("scale"===r){var a=i&&i.d||[1,1],u=o&&o.d||[1,1];n.scaleLocal(a[0]/u[0],a[1]/u[1],1)}else if("scalex"===r){a=i&&i.d||[1],u=o&&o.d||[1];n.scaleLocal(a[0]/u[0],1,1)}else if("scaley"===r){a=i&&i.d||[1],u=o&&o.d||[1];n.scaleLocal(1,a[0]/u[0],1)}else if("scalez"===r){a=i&&i.d||[1],u=o&&o.d||[1];n.scaleLocal(1,1,a[0]/u[0])}else if("scale3d"===r){a=i&&i.d||[1,1,1],u=o&&o.d||[1,1,1];n.scaleLocal(a[0]/u[0],a[1]/u[1],a[2]/u[2])}else if("translate"===r){var s=i&&i.d||[Wn,Wn],c=o&&o.d||[Wn,Wn];n.translateLocal(s[0].value-c[0].value,s[1].value-c[1].value,0)}else if("translatex"===r){s=i&&i.d||[Wn],c=o&&o.d||[Wn];n.translateLocal(s[0].value-c[0].value,0,0)}else if("translatey"===r){s=i&&i.d||[Wn],c=o&&o.d||[Wn];n.translateLocal(0,s[0].value-c[0].value,0)}else if("translatez"===r){s=i&&i.d||[Wn],c=o&&o.d||[Wn];n.translateLocal(0,0,s[0].value-c[0].value)}else if("translate3d"===r){s=i&&i.d||[Wn,Wn,Wn],c=o&&o.d||[Wn,Wn,Wn];n.translateLocal(s[0].value-c[0].value,s[1].value-c[1].value,s[2].value-c[2].value)}else if("rotate"===r){var f=i&&i.d||[zn],l=o&&o.d||[zn];n.rotateLocal(0,0,f[0].value-l[0].value)}else if("rotatex"===r){f=i&&i.d||[zn],l=o&&o.d||[zn];n.rotateLocal(f[0].value-l[0].value,0,0)}else if("rotatey"===r){f=i&&i.d||[zn],l=o&&o.d||[zn];n.rotateLocal(0,f[0].value-l[0].value,0)}else if("rotatez"===r){f=i&&i.d||[zn],l=o&&o.d||[zn];n.rotateLocal(0,0,f[0].value-l[0].value)}}))}var tr=/[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/gi,er=/[^\s\,]+/gi;var nr=function(t){var e=t||[];return Object(s.isArray)(e)?e:Object(s.isString)(e)?(e=e.match(tr),Object(s.each)(e,(function(t,n){if((t=t.match(er))[0].length>1){var r=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=r}Object(s.each)(t,(function(e,n){isNaN(e)||(t[n]=+e)})),e[n]=t})),e):void 0};var rr="\t\n\v\f\r \u2028\u2029",ir=new RegExp("([a-z])["+rr+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+rr+"]*,?["+rr+"]*)+)","ig"),or=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+rr+"]*,?["+rr+"]*","ig");var ar=/[a-z]/;function ur(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}function sr(t){var e=function(t){if(!t)return null;if(Object(s.isArray)(t))return t;var e={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},n=[];return String(t).replace(ir,(function(t,r,i){var o=[],a=r.toLowerCase();if(i.replace(or,(function(t,e){e&&o.push(+e)})),"m"===a&&o.length>2&&(n.push([r].concat(o.splice(0,2))),a="l",r="m"===r?"l":"L"),"o"===a&&1===o.length&&n.push([r,o[0]]),"r"===a)n.push([r].concat(o));else for(;o.length>=e[a]&&(n.push([r].concat(o.splice(0,e[a]))),e[a]););return""})),n}(t);if(!e||!e.length)return[["M",0,0]];for(var n=!1,r=0;r<e.length;r++){var i=e[r][0];if(ar.test(i)||["V","H","T","S"].indexOf(i)>=0){n=!0;break}}if(!n)return e;var o=[],a=0,u=0,c=0,f=0,l=0,h=e[0];"M"!==h[0]&&"m"!==h[0]||(c=a=+h[1],f=u=+h[2],l++,o[0]=["M",a,u]);r=l;for(var d=e.length;r<d;r++){var p=e[r],y=o[r-1],v=[],g=(i=p[0]).toUpperCase();if(i!==g)switch(v[0]=g,g){case"A":v[1]=p[1],v[2]=p[2],v[3]=p[3],v[4]=p[4],v[5]=p[5],v[6]=+p[6]+a,v[7]=+p[7]+u;break;case"V":v[1]=+p[1]+u;break;case"H":v[1]=+p[1]+a;break;case"M":c=+p[1]+a,f=+p[2]+u,v[1]=c,v[2]=f;break;default:for(var m=1,b=p.length;m<b;m++)v[m]=+p[m]+(m%2?a:u)}else v=e[r];switch(g){case"Z":a=+c,u=+f;break;case"H":v=["L",a=v[1],u];break;case"V":v=["L",a,u=v[1]];break;case"T":a=v[1],u=v[2];var _=ur([y[1],y[2]],[y[3],y[4]]);v=["Q",_[0],_[1],a,u];break;case"S":a=v[v.length-2],u=v[v.length-1];var M=y.length,E=ur([y[M-4],y[M-3]],[y[M-2],y[M-1]]);v=["C",E[0],E[1],v[1],v[2],a,u];break;case"M":c=v[v.length-2],f=v[v.length-1];break;default:a=v[v.length-2],u=v[v.length-1]}o.push(v)}return o}var cr=2*Math.PI,fr=function(t,e,n,r,i,o,a){var u=t.x,s=t.y;return{x:r*(u*=e)-i*(s*=n)+o,y:i*u+r*s+a}},lr=function(t,e){var n=1.5707963267948966===e?.551915024494:-1.5707963267948966===e?-.551915024494:4/3*Math.tan(e/4),r=Math.cos(t),i=Math.sin(t),o=Math.cos(t+e),a=Math.sin(t+e);return[{x:r-i*n,y:i+r*n},{x:o+a*n,y:a-o*n},{x:o,y:a}]},hr=function(t,e,n,r){var i=t*n+e*r;return i>1&&(i=1),i<-1&&(i=-1),(t*r-e*n<0?-1:1)*Math.acos(i)},dr=function(t){var e=t.px,n=t.py,r=t.cx,i=t.cy,o=t.rx,a=t.ry,u=t.xAxisRotation,s=void 0===u?0:u,c=t.largeArcFlag,f=void 0===c?0:c,l=t.sweepFlag,h=void 0===l?0:l,d=[];if(0===o||0===a)return[{x1:0,y1:0,x2:0,y2:0,x:r,y:i}];var p=Math.sin(s*cr/360),y=Math.cos(s*cr/360),v=y*(e-r)/2+p*(n-i)/2,g=-p*(e-r)/2+y*(n-i)/2;if(0===v&&0===g)return[{x1:0,y1:0,x2:0,y2:0,x:r,y:i}];o=Math.abs(o),a=Math.abs(a);var m=Math.pow(v,2)/Math.pow(o,2)+Math.pow(g,2)/Math.pow(a,2);m>1&&(o*=Math.sqrt(m),a*=Math.sqrt(m));var b=function(t,e,n,r,i,o,a,u,s,c,f,l){var h=Math.pow(i,2),d=Math.pow(o,2),p=Math.pow(f,2),y=Math.pow(l,2),v=h*d-h*y-d*p;v<0&&(v=0),v/=h*y+d*p;var g=(v=Math.sqrt(v)*(a===u?-1:1))*i/o*l,m=v*-o/i*f,b=c*g-s*m+(t+n)/2,_=s*g+c*m+(e+r)/2,M=(f-g)/i,E=(l-m)/o,T=(-f-g)/i,O=(-l-m)/o,w=hr(1,0,M,E),x=hr(M,E,T,O);return 0===u&&x>0&&(x-=cr),1===u&&x<0&&(x+=cr),[b,_,w,x]}(e,n,r,i,o,a,f,h,p,y,v,g),_=b[0],M=b[1],E=b[2],T=b[3],O=Math.abs(T)/(cr/4);Math.abs(1-O)<1e-7&&(O=1);var w=Math.max(Math.ceil(O),1);T/=w;for(var x=0;x<w;x++)d.push(lr(E,T)),E+=T;return d.map((function(t){var e=fr(t[0],o,a,y,p,_,M),n=e.x,r=e.y,i=fr(t[1],o,a,y,p,_,M),u=i.x,s=i.y,c=fr(t[2],o,a,y,p,_,M);return{x1:n,y1:r,x2:u,y2:s,x:c.x,y:c.y}}))};function pr(t,e,n,r,i,o,a,u,s){return dr({px:t,py:e,cx:u,cy:s,rx:n,ry:r,xAxisRotation:i,largeArcFlag:o,sweepFlag:a}).reduce((function(t,e){var n=e.x1,r=e.y1,i=e.x2,o=e.y2,a=e.x,u=e.y;return t.push(n,r,i,o,a,u),t}),[])}function yr(t,e,n,r,i,o){return[1/3*t+2/3*n,1/3*e+2/3*r,1/3*i+2/3*n,1/3*o+2/3*r,i,o]}function vr(t,e,n,r){return[t,e,n,r,n,r]}function gr(t,e){"TQ".indexOf(t[0])<0&&(e.qx=null,e.qy=null);var n=t.slice(1),r=n[0],i=n[1];switch(t[0]){case"M":return e.x=r,e.y=i,t;case"A":return["C"].concat(pr.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"Q":return e.qx=r,e.qy=i,["C"].concat(yr.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"L":return["C"].concat(vr(e.x1,e.y1,t[1],t[2]));case"H":return["C"].concat(vr(e.x1,e.y1,t[1],e.y1));case"V":return["C"].concat(vr(e.x1,e.y1,e.x1,t[1]));case"Z":return["C"].concat(vr(e.x1,e.y1,e.x,e.y))}return t}function mr(t,e){void 0===e&&(e=!1);for(var n,r,i=sr(t),o={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},a=[],u="",s=i.length,c=[],f=0;f<s;f+=1)i[f]&&(u=i[f][0]),a[f]=u,i[f]=gr(i[f],o),br(i,a,f),s=i.length,"Z"===u&&c.push(f),r=(n=i[f]).length,o.x1=+n[r-2],o.y1=+n[r-1],o.x2=+n[r-4]||o.x1,o.y2=+n[r-3]||o.y1;return e?[i,c]:i}function br(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],i=n;r.length;)e[n]="A",t.splice(i+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}function _r(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Mr(t,e){return _r(t)*_r(e)?(t[0]*e[0]+t[1]*e[1])/(_r(t)*_r(e)):1}function Er(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(Mr(t,e))}function Tr(t,e){return t[0]===e[0]&&t[1]===e[1]}function Or(t,e){var n=e[1],r=e[2],i=Object(s.mod)(Object(s.toRadian)(e[3]),2*Math.PI),o=e[4],a=e[5],u=t[0],c=t[1],f=e[6],l=e[7],h=Math.cos(i)*(u-f)/2+Math.sin(i)*(c-l)/2,d=-1*Math.sin(i)*(u-f)/2+Math.cos(i)*(c-l)/2,p=h*h/(n*n)+d*d/(r*r);p>1&&(n*=Math.sqrt(p),r*=Math.sqrt(p));var y=n*n*(d*d)+r*r*(h*h),v=y?Math.sqrt((n*n*(r*r)-y)/y):1;o===a&&(v*=-1),isNaN(v)&&(v=0);var g=r?v*n*d/r:0,m=n?v*-r*h/n:0,b=(u+f)/2+Math.cos(i)*g-Math.sin(i)*m,_=(c+l)/2+Math.sin(i)*g+Math.cos(i)*m,M=[(h-g)/n,(d-m)/r],E=[(-1*h-g)/n,(-1*d-m)/r],T=Er([1,0],M),O=Er(M,E);return Mr(M,E)<=-1&&(O=Math.PI),Mr(M,E)>=1&&(O=0),0===a&&O>0&&(O-=2*Math.PI),1===a&&O<0&&(O+=2*Math.PI),{cx:b,cy:_,rx:Tr(t,[f,l])?0:n,ry:Tr(t,[f,l])?0:r,startAngle:T,endAngle:T+O,xRotation:i,arcFlag:o,sweepFlag:a}}function wr(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}var xr=function(){function t(t,e,n,r){this.x=t,this.y=e,this.width=n,this.height=r,this.left=t,this.right=t+n,this.top=e,this.bottom=e+r,this.width=n,this.height=r,this.x=t,this.y=e}return t.prototype.toJSON=function(){},t}();function Ar(t,e){var n=sr(t),r=function(t){for(var e=!1,n=t.length,r=0;r<n;r++){var i=t[r][0];if("C"===i||"A"===i||"Q"===i){e=!0;break}}return e}(n),i=n.slice(),o=function(t){for(var e=[],n=[],r=[],i=0;i<t.length;i++){var o=t[i],a=o[0];"M"===a?(r.length&&(n.push(r),r=[]),r.push([o[1],o[2]])):"Z"===a?r.length&&(e.push(r),r=[]):r.push([o[1],o[2]])}r.length>0&&n.push(r);return{polygons:e,polylines:n}}(i),u=o.polygons,s=o.polylines,c=Object(a.__read)(mr(i,!0),2),f=c[0],l=c[1],h=function(t){for(var e=[],n=null,r=null,i=null,o=0,a=(t=nr(t)).length,u=0;u<a;u++){var s=t[u];r=t[u+1];var c=s[0],f={command:c,prePoint:n,params:s,startTangent:null,endTangent:null};switch(c){case"M":i=[s[1],s[2]],o=u;break;case"A":var l=Or(n,s);f.arcParams=l}if("Z"===c)n=i,r=t[o+1];else{var h=s.length;n=[s[h-2],s[h-1]]}r&&"Z"===r[0]&&(r=t[o],e[o]&&(e[o].prePoint=n)),f.currentPoint=n,e[o]&&Tr(n,e[o].currentPoint)&&(e[o].prePoint=f.prePoint);var d=r?[r[r.length-2],r[r.length-1]]:null;f.nextPoint=d;var p=f.prePoint;if(["L","H","V"].includes(c))f.startTangent=[p[0]-n[0],p[1]-n[1]],f.endTangent=[n[0]-p[0],n[1]-p[1]];else if("Q"===c){var y=[s[1],s[2]];f.startTangent=[p[0]-y[0],p[1]-y[1]],f.endTangent=[n[0]-y[0],n[1]-y[1]]}else if("T"===c){y=wr((m=e[u-1]).currentPoint,p);"Q"===m.command?(f.command="Q",f.startTangent=[p[0]-y[0],p[1]-y[1]],f.endTangent=[n[0]-y[0],n[1]-y[1]]):(f.command="TL",f.startTangent=[p[0]-n[0],p[1]-n[1]],f.endTangent=[n[0]-p[0],n[1]-p[1]])}else if("C"===c){var v=[s[1],s[2]],g=[s[3],s[4]];f.startTangent=[p[0]-v[0],p[1]-v[1]],f.endTangent=[n[0]-g[0],n[1]-g[1]],0===f.startTangent[0]&&0===f.startTangent[1]&&(f.startTangent=[v[0]-g[0],v[1]-g[1]]),0===f.endTangent[0]&&0===f.endTangent[1]&&(f.endTangent=[g[0]-v[0],g[1]-v[1]])}else if("S"===c){var m;v=wr((m=e[u-1]).currentPoint,p),g=[s[1],s[2]];"C"===m.command?(f.command="C",f.startTangent=[p[0]-v[0],p[1]-v[1]],f.endTangent=[n[0]-g[0],n[1]-g[1]]):(f.command="SQ",f.startTangent=[p[0]-g[0],p[1]-g[1]],f.endTangent=[n[0]-g[0],n[1]-g[1]])}else if("A"===c){var b=.001,_=f.arcParams||{},M=_.cx,E=void 0===M?0:M,T=_.cy,O=void 0===T?0:T,w=_.rx,x=void 0===w?0:w,A=_.ry,P=void 0===A?0:A,C=_.sweepFlag,S=void 0===C?0:C,N=_.startAngle,j=void 0===N?0:N,I=_.endAngle,R=void 0===I?0:I;0===S&&(b*=-1);var k=x*Math.cos(j-b)+E,D=P*Math.sin(j-b)+O;f.startTangent=[k-i[0],D-i[1]];var B=x*Math.cos(j+R+b)+E,L=P*Math.sin(j+R-b)+O;f.endTangent=[p[0]-B,p[1]-L]}e.push(f)}return e}(i),d=function(t){var e,n,r,i,o=0,a=0,u=[];if(!t)return{curveSegments:[],totalLength:o};if(t.forEach((function(e,n){r=t[n+1],i=e.length,r&&(o+=Te.Cubic.length(e[i-2],e[i-1],r[1],r[2],r[3],r[4],r[5],r[6])||0)})),0===o)return{curveSegments:[],totalLength:o};return t.forEach((function(s,c){r=t[c+1],i=s.length,r&&((e=[])[0]=a/o,n=Te.Cubic.length(s[i-2],s[i-1],r[1],r[2],r[3],r[4],r[5],r[6]),a+=n||0,e[1]=a/o,u.push(e))})),{curveSegments:u,totalLength:o}}(f);return{absolutePath:n,hasArc:r,segments:h,polygons:u,polylines:s,curve:f,totalLength:d.totalLength,curveSegments:d.curveSegments,zCommandIndexes:l,rect:Pr(f)}}function Pr(t){var e=0,n=0,r=[],i=[];t.forEach((function(t){var o=Object(a.__read)(t.slice(-2),2),u=o[0],s=o[1];if("M"===t[0])e=u,n=s,r.push(u),i.push(s);else if("C"===t[0]){var c=Te.Cubic.box.apply(Te.Cubic,Object(a.__spreadArray)([],Object(a.__read)([e,n].concat(t.slice(1))),!1));r=r.concat(c.x,c.x+c.width),i=i.concat(c.y,c.y+c.height),e=u,n=s}}));var o=Math.min.apply(0,r),u=Math.min.apply(0,i),s=Math.max.apply(0,r),c=Math.max.apply(0,i);return new xr(o,u,s-o,c-u)}function Cr(t,e,n){var r=t.curve,i=e.curve,o=[r,i];r.length!==i.length&&(o=xe(r,i));var a=Ae(o[0])!==Ae(o[1])?Se(o[0]):Ne(o[0]);return[a,je(o[1],a),function(t){return t}]}function Sr(t,e){var n,r,i=[],o=0,a=Te.Polyline.length(t);return t.forEach((function(e,u){t[u+1]&&((n=[0,0])[0]=o/a,r=Te.Line.length(e[0],e[1],t[u+1][0],t[u+1][1]),o+=r,n[1]=o/a,i.push(n))})),{points:t,totalLength:a,segments:i}}var Nr=In.bind(null,/deg|rad|grad|turn|px|%/g),jr=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Ir(t,e){if(void 0===t&&(t=""),"none"===(t=t.toLowerCase().trim()))return[];for(var n,r=/\s*([\w-]+)\(([^)]*)\)/g,i=[],o=0;n=r.exec(t);){if(n.index!==o)return[];if(o=n.index+n[0].length,jr.indexOf(n[1])>-1&&i.push({name:n[1],params:n[2].split(" ").map((function(t){return Nr(t)||mn(t)}))}),r.lastIndex===t.length)return i}return[]}var Rr=o.GlobalContainer,kr=Object(o.Module)((function(t){function e(e,n,r,i){n&&t({token:{token:it,named:e},useValue:n}),r&&t({token:{token:st,named:e},useValue:r}),i&&t({token:{token:at,named:e},useValue:i})}function n(t,n,r,i){for(var o=0;o<t.length;o++)e(t[o],n,r,i)}t(u),t({token:j,useClass:I}),t({token:N,useFactory:function(t){return function(){return t.container.get(j)}}}),t({token:B,useClass:L}),t($),t(Q),t(q),t(U),t(W),t(tt),t(et),t(nt),t(rt),t({token:F,useFactory:function(t){var e={};return function(n){return e[n]||t.container.isBoundNamed(V,n)&&(e[n]=t.container.getNamed(V,n)),e[n]}}}),t({token:ot,useFactory:function(t){var e={};return function(n){return e[n]||t.container.isBoundNamed(it,n)&&(e[n]=t.container.getNamed(it,n)),e[n]}}}),t({token:ut,useFactory:function(t){var e={};return function(n){return e[n]||t.container.isBoundNamed(at,n)&&(e[n]=t.container.getAllNamed(at,n)),e[n]}}}),t({token:ct,useFactory:function(t){var e={};return function(n){return e[n]||t.container.isBoundNamed(st,n)&&(e[n]=t.container.getNamed(st,n)),e[n]}}}),n(["opacity","fillOpacity","strokeOpacity","offsetDistance"],Tn,wn(0,1),void 0),n(["r","rx","ry","lineWidth","width","height","shadowBlur"],Tn,wn(0,1/0),void 0),n(["lineDash"],void 0,xn,void 0),n(["x1","x2","y1","y2","lineDashOffset","shadowOffsetX","shadowOffsetY"],Tn,On,void 0),n(["x1","x2","y1","y2","r","rx","ry","width","height","path","points","text","shadowBlur","shadowOffsetX","shadowOffsetY","lineWidth","filter","font","fontSize","fontFamily","fontStyle","fontWeight","fontVariant","lineHeight","letterSpacing","padding","wordWrap","wordWrapWidth","leading","textBaseline","textAlign","whiteSpace"],void 0,void 0,_n),n(["fill","stroke","shadowColor"],mn,bn,void 0),e("clipPath",void 0,void 0,Cn),e("zIndex",void 0,void 0,Sn),e("offsetPath",void 0,void 0,An),e("offsetDistance",void 0,void 0,Pn),e("origin",void 0,void 0,Vn),e("transformOrigin",void 0,void 0,Gn),e("transform",Xn,Zn,Qn),e("path",Ar,Cr,void 0),e("points",Sr,void 0,void 0),n(["x","y","points","path","x1","x2","y1","y2"],void 0,void 0,Mn),e("filter",Ir,void 0,void 0),e("anchor",void 0,void 0,Be)})),Dr=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o.currentTime=r,o.timelineTime=i,o.target=n,o.type="finish",o.bubbles=!1,o.currentTarget=n,o.defaultPrevented=!1,o.eventPhase=o.AT_TARGET,o.timeStamp=Date.now(),o.currentTime=r,o.timelineTime=i,o}return Object(a.__extends)(e,t),e}(vt),Br=0,Lr=function(){function t(t,e){this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,this.effect=t,t.animation=this,this.timeline=e,this.id=""+Br++,this._inEffect=!!this.effect.update(0),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}return Object.defineProperty(t.prototype,"pending",{get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playState",{get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ready",{get:function(){var t=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise((function(e,n){t.resolveReadyPromise=function(){e(t)},t.rejectReadyPromise=function(){n(new Error)}})),this.pending||this.resolveReadyPromise()),this.readyPromise},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"finished",{get:function(){var t=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise((function(e,n){t.resolveFinishedPromise=function(){e(t)},t.rejectFinishedPromise=function(){n(new Error)}})),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentTime",{get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){var e;t=Number(t),isNaN(t)||(this.timeline.restart(),this._paused||null===this._startTime||(this._startTime=Number(null===(e=this.timeline)||void 0===e?void 0:e.currentTime)-t/this.playbackRate),this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this)))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"startTime",{get:function(){return this._startTime},set:function(t){if(null!==t){if(this.updatePromises(),t=Number(t),isNaN(t))return;if(this._paused||this._idle)return;this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playbackRate",{get:function(){return this._playbackRate},set:function(t){if(t!==this._playbackRate){this.updatePromises();var e=this.currentTime;this._playbackRate=t,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==e&&(this.currentTime=e),this.updatePromises()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_isFinished",{get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this.totalDuration||this._playbackRate<0&&Number(this._currentTime)<=0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"totalDuration",{get:function(){var t;return Number(null===(t=this.effect)||void 0===t?void 0:t.getComputedTiming().activeDuration)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_needsTick",{get:function(){return this.pending||"running"===this.playState||!this._finishedFlag},enumerable:!1,configurable:!0}),t.prototype.updatePromises=function(){var t=this.oldPlayState,e=this.pending?"pending":this.playState;return this.readyPromise&&e!==t&&("idle"===e?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===t?this.resolveReadyPromise():"pending"===e&&(this.readyPromise=void 0)),this.finishedPromise&&e!==t&&("idle"===e?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===e?this.resolveFinishedPromise():"finished"===t&&(this.finishedPromise=void 0)),this.oldPlayState=e,this.readyPromise||this.finishedPromise},t.prototype.play=function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),-1===this.timeline.animations.indexOf(this)&&this.timeline.animations.push(this),this.updatePromises()},t.prototype.pause=function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._isFinished||this._paused||this._idle?this._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,this._startTime=null,this._paused=!0,this.updatePromises()},t.prototype.finish=function(){this.updatePromises(),this._idle||(this.currentTime=this._playbackRate>0?this.totalDuration:0,this._startTime=this.totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())},t.prototype.cancel=function(){this.updatePromises(),this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises())},t.prototype.reverse=function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()},t.prototype.updatePlaybackRate=function(t){this.playbackRate=t},t.prototype.targetAnimations=function(){var t;return(null===(t=this.effect)||void 0===t?void 0:t.target).getAnimations()},t.prototype.markTarget=function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)},t.prototype.unmarkTarget=function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)},t.prototype.tick=function(t,e){this._idle||this._paused||(null===this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this.currentTimePending=!1,this.fireEvents(t))},t.prototype.rewind=function(){if(this.playbackRate>=0)this.currentTime=0;else{if(!(this.totalDuration<1/0))throw new Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this.totalDuration}},t.prototype.persist=function(){throw new Error("Method not implemented.")},t.prototype.addEventListener=function(t,e,n){throw new Error("Method not implemented.")},t.prototype.removeEventListener=function(t,e,n){throw new Error("Method not implemented.")},t.prototype.dispatchEvent=function(t){throw new Error("Method not implemented.")},t.prototype.commitStyles=function(){throw new Error("Method not implemented.")},t.prototype.ensureAlive=function(){var t,e;this.playbackRate<0&&0===this.currentTime?this._inEffect=!!(null===(t=this.effect)||void 0===t?void 0:t.update(-1)):this._inEffect=!!(null===(e=this.effect)||void 0===e?void 0:e.update(this.currentTime)),this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))},t.prototype.tickCurrentTime=function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this.totalDuration:0),this.ensureAlive())},t.prototype.fireEvents=function(t){var e=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var n=new Dr(null,this,this.currentTime,t);setTimeout((function(){e.onfinish&&e.onfinish(n)}))}this._finishedFlag=!0}}else{if(this.onframe&&"running"===this.playState){var r=new Dr(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}},t}();function Fr(t,e){return Number(t.id)-Number(e.id)}var Vr=function(){function t(){var t=this;this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.webAnimationsNextTick=function(e){t.currentTime=e,t.discardAnimations(),0===t.animations.length?t.timelineTicking=!1:t.requestAnimationFrame(t.webAnimationsNextTick)},this.processRafCallbacks=function(e){var n=t.rafCallbacks;t.rafCallbacks=[],e<Number(t.currentTime)&&(e=Number(t.currentTime)),t.animations.sort(Fr),t.animations=t.tick(e,!0,t.animations)[0],n.forEach((function(t){t[1](e)})),t.applyPendingEffects()}}return t.prototype.getAnimations=function(){return this.discardAnimations(),this.animations.slice()},t.prototype.isTicking=function(){return this.inTick},t.prototype.play=function(t){var e=new Lr(t,this);return this.animations.push(e),this.restartWebAnimationsNextTick(),e.updatePromises(),e.play(),e.updatePromises(),e},t.prototype.applyDirtiedAnimation=function(t){var e=this;if(!this.inTick){t.markTarget();var n=t.targetAnimations();n.sort(Fr),this.tick(Number(this.currentTime),!1,n.slice())[1].forEach((function(t){var n=e.animations.indexOf(t);-1!==n&&e.animations.splice(n,1)})),this.applyPendingEffects()}},t.prototype.restart=function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame((function(){})),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame},t.prototype.destroy=function(){De(this.frameId)},t.prototype.applyPendingEffects=function(){this.pendingEffects.forEach((function(t){null==t||t.applyInterpolations()})),this.pendingEffects=[]},t.prototype.updateAnimationsPromises=function(){this.animationsWithPromises=this.animationsWithPromises.filter((function(t){return t.updatePromises()}))},t.prototype.discardAnimations=function(){this.updateAnimationsPromises(),this.animations=this.animations.filter((function(t){return"finished"!==t.playState&&"idle"!==t.playState}))},t.prototype.restartWebAnimationsNextTick=function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))},t.prototype.rAF=function(t){var e=this.rafId++;return 0===this.rafCallbacks.length&&(this.frameId=ke(this.processRafCallbacks)),this.rafCallbacks.push([e,t]),e},t.prototype.requestAnimationFrame=function(t){var e=this;return this.rAF((function(n){e.updateAnimationsPromises(),t(n),e.updateAnimationsPromises()}))},t.prototype.tick=function(t,e,n){var r,i,o=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var u=[],s=[],c=[],f=[];return n.forEach((function(n){n.tick(t,e),n._inEffect?(s.push(n.effect),n.markTarget()):(u.push(n.effect),n.unmarkTarget()),n._needsTick&&(o.ticking=!0);var r=n._inEffect||n._needsTick;n._inTimeline=r,r?c.push(n):f.push(n)})),(r=this.pendingEffects).push.apply(r,Object(a.__spreadArray)([],Object(a.__read)(u),!1)),(i=this.pendingEffects).push.apply(i,Object(a.__spreadArray)([],Object(a.__read)(s),!1)),this.ticking&&this.requestAnimationFrame((function(){})),this.inTick=!1,[c,f]},t}(),Gr=function(){function t(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=ce,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null}return Object.defineProperty(t.prototype,"easing",{get:function(){return this._easing},set:function(t){this.easingFunction=ye(t),this._easing=t},enumerable:!1,configurable:!0}),t}();function qr(t,e){if(null===t)return[];Array.isArray(t)||(t=function(t){var e=[];for(var n in t)if(!(n in["easing","offset","composite"])){var r=t[n];Array.isArray(r)||(r=[r]);for(var i=r.length,o=0;o<i;o++){if(!e[o]){var a={};"offset"in t&&(a.offset=Number(t.offset)),"easing"in t&&(a.easing=t.easing),"composite"in t&&(a.composite=t.composite),e[o]=a}void 0!==r[o]&&null!==r[o]&&(e[o][n]=r[o])}}return e.sort((function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)})),e}(t));for(var n=t.map((function(t){var n={};for(var r in(null==e?void 0:e.composite)&&(n.composite="auto"),t){var i=t[r];if("offset"===r){if(null!==i){if(i=Number(i),!isFinite(i))throw new Error("Keyframe offsets must be numbers.");if(i<0||i>1)throw new Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=i}}else if("composite"===r&&-1===["replace","add","accumulate","auto"].indexOf(i))throw new Error(i+" compositing is not supported");n[r]=i}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==e?void 0:e.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n})),r=!0,i=-1/0,o=0;o<n.length;o++){var a=n[o].offset;if(null!=a){if(a<i)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");i=a}else r=!1}return n=n.filter((function(t){return Number(t.offset)>=0&&Number(t.offset)<=1})),r||function(){var t,e,r=n.length;n[r-1].computedOffset=Number(null!==(t=n[r-1].offset)&&void 0!==t?t:1),r>1&&(n[0].computedOffset=Number(null!==(e=n[0].offset)&&void 0!==e?e:0));for(var i=0,o=Number(n[0].computedOffset),a=1;a<r;a++){var u=Number(n[a].computedOffset);if(null!=u&&null!=o){for(var s=1;s<a-i;s++)n[i+s].computedOffset=o+(u-o)*s/(a-i);i=a,o=u}}}(),n}var Ur="backwards|forwards|both|none".split("|"),Wr="reverse|alternate|alternate-reverse".split("|");function zr(t,e){var n=new Gr;return e&&(n.fill="both",n.duration="auto"),"number"!=typeof t||isNaN(t)?void 0!==t&&Object.keys(t).forEach((function(e){if(void 0!==t[e]&&null!==t[e]&&"auto"!==t[e]){if(("number"==typeof n[e]||"duration"===e)&&("number"!=typeof t[e]||isNaN(t[e])))return;if("fill"===e&&-1===Ur.indexOf(t[e]))return;if("direction"===e&&-1===Wr.indexOf(t[e]))return;n[e]=t[e]}})):n.duration=t,n}function Hr(t,e){return zr(t=Yr(null!=t?t:{duration:"auto"}),e)}function Yr(t){return"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t}),t}var $r=function(){function t(t,e,n){var r=this;this.composite="replace",this.iterationComposite="replace",this.target=t,this.timing=Hr(n,!1),this.timing.effect=this,this.timing.activeDuration=ve(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=qr(e,this.timing),this.interpolations=be(this.normalizedKeyframes,this.timing,this.target),this.computedTiming=new Proxy(this.timing,{get:function(t,e){return"duration"===e?"auto"===t.duration?0:t.duration:"fill"===e?"auto"===t.fill?"none":t.fill:"localTime"===e?r.animation&&r.animation.currentTime||null:"currentIteration"===e?r.animation&&"running"===r.animation.playState?t.currentIteration||0:null:"progress"===e?r.animation&&"running"===r.animation.playState?t.progress||0:null:t[e]},set:function(t,e,n){return!0}})}return t.prototype.applyInterpolations=function(){this.interpolations(this.target,Number(this.timeFraction))},t.prototype.update=function(t){return null!==t&&(this.timeFraction=ge(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)},t.prototype.getKeyframes=function(){return this.normalizedKeyframes},t.prototype.setKeyframes=function(t){this.normalizedKeyframes=qr(t)},t.prototype.getComputedTiming=function(){return this.computedTiming},t.prototype.getTiming=function(){return this.timing},t.prototype.updateTiming=function(t){var e=this;Object.keys(t||{}).forEach((function(n){e.timing=t[n]}))},t}(),Xr={anchor:[0,0,0],origin:[0,0,0],opacity:1,fillOpacity:1,strokeOpacity:1},Kr=function(t){function e(e){var n,r,i,o=t.call(this,e)||this;return o.activeAnimations=[],o.stylePropertyUpdaterFactory=Rr.get(ut),o.stylePropertyParserFactory=Rr.get(ot),o.config=e,o.config.interactive=null!==(n=o.config.capture)&&void 0!==n?n:o.config.interactive,o.id=o.config.id||"",o.name=o.config.name||"",o.className=o.config.className||"",o.interactive=null===(r=o.config.interactive)||void 0===r||r,o.nodeName=o.config.type||D.Group,o.config.style=Object(a.__assign)(Object(a.__assign)(Object(a.__assign)(Object(a.__assign)({},Xr),{zIndex:null!==(i=o.config.zIndex)&&void 0!==i?i:0,visibility:!1===o.config.visible?"hidden":"visible"}),o.config.style),o.config.attrs),o.style=new Proxy(o.attributes,{get:function(t,e){return o.getAttribute(e)},set:function(t,e,n){return o.setAttribute(e,n),!0}}),o.initAttributes(o.config.style),Rr.get(u).add(o.entity.getName(),o),o}return Object(a.__extends)(e,t),e.prototype.destroy=function(){t.prototype.destroy.call(this),Rr.get(u).remove(this.entity.getName()),this.getAnimations().forEach((function(t){t.cancel()}))},e.prototype.cloneNode=function(t){var e=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:Object(a.__assign)({},this.style)});return t&&this.children.forEach((function(n){var r=n.cloneNode(t);e.appendChild(r)})),e},e.prototype.initAttributes=function(t){var e=this;void 0===t&&(t={});var n=this.entity.getComponent(f);for(var r in t){var i=t[r];this.attributes[r]=i,this.parseStyleProperty(r,i)}var o={x:1e3,y:1e3};Object.keys(t).sort((function(t,e){return(o[t]||0)-(o[e]||0)})).forEach((function(t){e.updateStyleProperty(t,void 0,e.parsedStyle[t])})),n.dirty=!0},e.prototype.setAttribute=function(e,n,r){void 0===r&&(r=!1),!r&&Object(s.isEqual)(n,this.attributes[e])&&"transformOrigin"!==e&&"visibility"!==e||("visibility"===e?this.forEach((function(t){t.changeAttribute(e,n)})):this.changeAttribute(e,n),t.prototype.setAttribute.call(this,e,n))},e.prototype.parseStyleProperty=function(t,e){var n=this.stylePropertyParserFactory(t);this.parsedStyle[t]=n?n(e,this):e},e.prototype.updateStyleProperty=function(t,e,n){var r=this,i=this.stylePropertyUpdaterFactory(t);i&&i.forEach((function(t){t(e,n,r,r.sceneGraphService)}))},e.prototype.changeAttribute=function(t,e){var n=this,r=this.entity.getComponent(f),i=this.attributes[t],o=this.parsedStyle[t];this.attributes[t]=e,this.parseStyleProperty(t,e),this.updateStyleProperty(t,o,this.parsedStyle[t]),this.attributes.clipPathTargets&&this.attributes.clipPathTargets.length&&this.attributes.clipPathTargets.forEach((function(t){k(t),t.emit(_.ATTRIBUTE_CHANGED,{attributeName:"clipPath",oldValue:n,newValue:n})})),r.dirty=!0,this.emit(_.ATTRIBUTE_CHANGED,{attributeName:t,oldValue:i,newValue:e})},e.prototype.setOrigin=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.sceneGraphService.setOrigin(this,At(t,e,n)),this.attributes.origin=this.getOrigin(),this},e.prototype.getOrigin=function(){return this.sceneGraphService.getOrigin(this)},e.prototype.setPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.sceneGraphService.setPosition(this,At(t,e,n)),this.syncLocalPosition(),this},e.prototype.setLocalPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.sceneGraphService.setLocalPosition(this,At(t,e,n)),this.syncLocalPosition(),this},e.prototype.translate=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.sceneGraphService.translate(this,At(t,e,n)),this.syncLocalPosition(),this},e.prototype.translateLocal=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.sceneGraphService.translateLocal(this,At(t,e,n)),this.syncLocalPosition(),this},e.prototype.getPosition=function(){return this.sceneGraphService.getPosition(this)},e.prototype.getLocalPosition=function(){return this.sceneGraphService.getLocalPosition(this)},e.prototype.scale=function(t,e,n){return this.scaleLocal(t,e,n)},e.prototype.scaleLocal=function(t,e,n){return"number"==typeof t&&(t=At(t,e=e||t,n=n||t)),this.sceneGraphService.scaleLocal(this,t),this},e.prototype.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=At(t,e=e||t,n=n||t)),this.sceneGraphService.setLocalScale(this,t),this},e.prototype.getLocalScale=function(){return this.sceneGraphService.getLocalScale(this)},e.prototype.getScale=function(){return this.sceneGraphService.getScale(this)},e.prototype.getEulerAngles=function(){var t=Object(a.__read)(It(l.vec3.create(),this.sceneGraphService.getWorldTransform(this)),3);t[0],t[1];return Ct(t[2])},e.prototype.getLocalEulerAngles=function(){var t=Object(a.__read)(It(l.vec3.create(),this.sceneGraphService.getLocalRotation(this)),3);t[0],t[1];return Ct(t[2])},e.prototype.setEulerAngles=function(t){return this.sceneGraphService.setEulerAngles(this,0,0,t),this},e.prototype.setLocalEulerAngles=function(t){return this.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},e.prototype.rotateLocal=function(t,e,n){return Object(s.isNil)(e)&&Object(s.isNil)(n)?this.sceneGraphService.rotateLocal(this,0,0,t):this.sceneGraphService.rotateLocal(this,t,e,n),this},e.prototype.rotate=function(t,e,n){return Object(s.isNil)(e)&&Object(s.isNil)(n)?this.sceneGraphService.rotate(this,0,0,t):this.sceneGraphService.rotate(this,t,e,n),this},e.prototype.getRotation=function(){return this.sceneGraphService.getRotation(this)},e.prototype.getLocalRotation=function(){return this.sceneGraphService.getLocalRotation(this)},e.prototype.getLocalTransform=function(){return this.sceneGraphService.getLocalTransform(this)},e.prototype.getWorldTransform=function(){return this.sceneGraphService.getWorldTransform(this)},e.prototype.resetLocalTransform=function(){this.sceneGraphService.resetLocalTransform(this)},e.prototype.syncLocalPosition=function(){var t=this.getLocalPosition();this.attributes.x=t[0],this.attributes.y=t[1]},e.prototype.getAnimations=function(){return this.activeAnimations},e.prototype.animate=function(t,e){var n,r,i=null===(n=this.ownerDocument)||void 0===n?void 0:n.timeline;this.attributes.clipPathTargets&&this.attributes.clipPathTargets.length&&(i=null===(r=this.attributes.clipPathTargets[0].ownerDocument)||void 0===r?void 0:r.timeline);return this.parsedStyle.transform=void 0,i?i.play(new $r(this,t,e)):null},e.prototype.show=function(){this.style.visibility="visible"},e.prototype.hide=function(){this.style.visibility="hidden"},e.prototype.isVisible=function(){var t=this.entity.getComponent(p);return"visible"===this.style.visibility&&(!t||t&&!t.isCulled())},e.prototype.toFront=function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,Object(a.__spreadArray)([],Object(a.__read)(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))),!1))+1),this},e.prototype.toBack=function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,Object(a.__spreadArray)([],Object(a.__read)(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))),!1))-1),this},e.prototype.getCount=function(){return this.childElementCount},e.prototype.getParent=function(){return this.parentElement},e.prototype.getChildren=function(){return this.children},e.prototype.getFirst=function(){return this.firstElementChild},e.prototype.getLast=function(){return this.lastElementChild},e.prototype.getChildByIndex=function(t){return this.children[t]||null},e.prototype.add=function(t,e){return this.appendChild(t,e)},e.prototype.setClip=function(t){this.style.clipPath=t},e.prototype.getClip=function(){return this.style.clipPath||null},e.prototype.set=function(t,e){this.config[t]=e},e.prototype.get=function(t){return this.config[t]},e.prototype.getConfig=function(){return this.config},e.prototype.attr=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=Object(a.__read)(e,2),i=r[0],o=r[1];return i?Object(s.isObject)(i)?(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),this):2===e.length?(this.setAttribute(i,o),this):this.attributes[i]:this.attributes},e.prototype.moveTo=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},e.prototype.move=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},e.prototype.setZIndex=function(t){return this.style.zIndex=t,this},e.prototype.getMatrix=function(){var t=this.getWorldTransform(),e=Object(a.__read)(l.mat4.getTranslation(l.vec3.create(),t),2),n=e[0],r=e[1],i=Object(a.__read)(l.mat4.getScaling(l.vec3.create(),t),2),o=i[0],u=i[1],s=l.mat4.getRotation(l.quat.create(),t),c=Object(a.__read)(It(l.vec3.create(),s),3),f=c[0],h=(c[1],c[2]);return Rt(f||h,n,r,o,u)},e.prototype.setMatrix=function(t){var e=t[0],n=t[3],r=t[1],i=t[4],o=Math.sqrt(e*e+n*n),a=Math.sqrt(r*r+i*i);e*i-n*r<0&&(e<i?o=-o:a=-a),o&&(e*=1/o,n*=1/o),a&&(r*=1/a,i*=1/a);var u=Math.atan2(n,e);this.setEulerAngles(u).setPosition(t[6],t[7]).setLocalScale(o,a)},e}(Mt),Jr=function(t){function e(e){var n=e||{},r=n.style,i=Object(a.__rest)(n,["style"]);return t.call(this,Object(a.__assign)({type:D.Group,style:Object(a.__assign)({},r)},i))||this}return Object(a.__extends)(e,t),e}(Kr),Zr=function(t){function e(){var e=t.call(this)||this;return e.defaultView=null,e.ownerDocument=null,e.nodeName="document",e.timeline=new Vr,e.documentElement=new Jr({id:"g-root"}),e.documentElement.ownerDocument=e,e.documentElement.parentNode=e,e.childNodes=[e.documentElement],e}return Object(a.__extends)(e,t),Object.defineProperty(e.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),e.prototype.createElement=function(t,e){return new(this.defaultView.customElements.get(t))(e)},e.prototype.cloneNode=function(t){throw new Error("Method not implemented.")},e.prototype.destroy=function(){try{this.documentElement.destroy()}catch(t){}this.timeline.destroy()},e.prototype.appendChild=function(t,e){throw new Error("Use document.documentElement instead.")},e.prototype.insertBefore=function(t,e){throw new Error("Use document.documentElement instead.")},e.prototype.removeChild=function(t,e){throw new Error("Use document.documentElement instead.")},e.prototype.replaceChild=function(t,e,n){throw new Error("Use document.documentElement instead.")},e.prototype.append=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];throw new Error("Use document.documentElement instead.")},e.prototype.prepend=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];throw new Error("Use document.documentElement instead.")},e.prototype.getElementById=function(t){return this.documentElement.getElementById(t)},e.prototype.getElementsByName=function(t){return this.documentElement.getElementsByName(t)},e.prototype.getElementsByTagName=function(t){return this.documentElement.getElementsByTagName(t)},e.prototype.getElementsByClassName=function(t){return this.documentElement.getElementsByClassName(t)},e.prototype.querySelector=function(t){return this.documentElement.querySelector(t)},e.prototype.querySelectorAll=function(t){return this.documentElement.querySelectorAll(t)},e.prototype.find=function(t){return this.documentElement.find(t)},e.prototype.findAll=function(t){return this.documentElement.findAll(t)},e}(_t),Qr=function(t){function e(e){var n=t.call(this,e)||this;return n.handleMounted=function(){n.connectedCallback&&n.connectedCallback()},n.handleAttributeChanged=function(t){if(t.target===n){var e=t.detail,r=e.attributeName,i=e.oldValue,o=e.newValue;n.attributeChangedCallback&&n.attributeChangedCallback(r,i,o)}},n.attributeChangedCallback&&n.addEventListener(_.ATTRIBUTE_CHANGED,n.handleAttributeChanged),n.connectedCallback&&n.addEventListener(_.INSERTED,n.handleMounted),n.disconnectedCallback&&n.addEventListener(_.REMOVED,n.disconnectedCallback.bind(n)),n}return Object(a.__extends)(e,t),e}(Kr),ti=function(t){function e(e){var n=e.style,r=Object(a.__rest)(e,["style"]);return t.call(this,Object(a.__assign)({type:D.Circle,style:Object(a.__assign)({r:0,anchor:[.5,.5]},n)},r))||this}return Object(a.__extends)(e,t),e}(Kr),ei=function(t){function e(e){var n=e.style,r=Object(a.__rest)(e,["style"]);return t.call(this,Object(a.__assign)({type:D.Ellipse,style:Object(a.__assign)({rx:0,ry:0,anchor:[.5,.5]},n)},r))||this}return Object(a.__extends)(e,t),e}(Kr),ni=function(t){function e(e){var n=e.style,r=Object(a.__rest)(e,["style"]);return t.call(this,Object(a.__assign)({type:D.Image,style:Object(a.__assign)({img:""},n)},r))||this}return Object(a.__extends)(e,t),e}(Kr),ri=function(t){function e(e){var n=e.style,r=Object(a.__rest)(e,["style"]);return t.call(this,Object(a.__assign)({type:D.Line,style:Object(a.__assign)({x1:0,y1:0,x2:0,y2:0,lineJoin:"miter",lineCap:"butt",lineWidth:1},n)},r))||this}return Object(a.__extends)(e,t),e.prototype.getPoint=function(t){var e=this.parsedStyle,n=e.x1,r=e.y1,i=e.x2,o=e.y2,a=Te.Line.pointAt(n,r,i,o,t);return new P(a.x,a.y)},e.prototype.getTotalLength=function(){var t=this.parsedStyle,e=t.x1,n=t.y1,r=t.x2,i=t.y2;return Te.Line.length(e,n,r,i)},e}(Kr),ii=function(t){function e(e){var n=e.style,r=Object(a.__rest)(e,["style"]);return t.call(this,Object(a.__assign)({type:D.Path,style:Object(a.__assign)({path:"",lineJoin:"miter",lineCap:"butt",lineWidth:1},n)},r))||this}return Object(a.__extends)(e,t),e.prototype.getTotalLength=function(){return this.parsedStyle.path.totalLength},e.prototype.getPoint=function(t){var e=0,n=0,r=this.parsedStyle.path.curve;if(!this.parsedStyle.path.curveSegments.length)return r?new P(r[0][1],r[0][2]):null;this.parsedStyle.path.curveSegments.forEach((function(r,i){t>=r[0]&&t<=r[1]&&(e=(t-r[0])/(r[1]-r[0]),n=i)}));var i=r[n];if(Object(s.isNil)(i)||Object(s.isNil)(n))return null;var o=i.length,a=r[n+1],u=Te.Cubic.pointAt(i[o-2],i[o-1],a[1],a[2],a[3],a[4],a[5],a[6],e),c=u.x,f=u.y;return new P(c,f)},e.prototype.getStartTangent=function(){var t=this.parsedStyle.path.segments,e=[];if(t.length>1){var n=t[0].currentPoint,r=t[1].currentPoint,i=t[1].startTangent;e=[],i?(e.push([n[0]-i[0],n[1]-i[1]]),e.push([n[0],n[1]])):(e.push([r[0],r[1]]),e.push([n[0],n[1]]))}return e},e.prototype.getEndTangent=function(){var t=this.parsedStyle.path.segments,e=t.length,n=[];if(e>1){var r=t[e-2].currentPoint,i=t[e-1].currentPoint,o=t[e-1].endTangent;n=[],o?(n.push([i[0]-o[0],i[1]-o[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n},e}(Kr),oi=function(t){function e(e){var n=e.style,r=Object(a.__rest)(e,["style"]);return t.call(this,Object(a.__assign)({type:D.Polygon,style:Object(a.__assign)({points:[]},n)},r))||this}return Object(a.__extends)(e,t),e}(Kr),ai=function(t){function e(e){var n=e.style,r=Object(a.__rest)(e,["style"]);return t.call(this,Object(a.__assign)({type:D.Polyline,style:Object(a.__assign)({points:[],lineJoin:"miter",lineCap:"butt",lineWidth:1},n)},r))||this}return Object(a.__extends)(e,t),e.prototype.getTotalLength=function(){return this.parsedStyle.points.totalLength},e.prototype.getPoint=function(t){var e=this.parsedStyle.points,n=e.points,r=e.segments,i=0,o=0;r.forEach((function(e,n){t>=e[0]&&t<=e[1]&&(i=(t-e[0])/(e[1]-e[0]),o=n)}));var a=Te.Line.pointAt(n[o][0],n[o][1],n[o+1][0],n[o+1][1],i),u=a.x,s=a.y;return new P(u,s)},e.prototype.getStartTangent=function(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},e.prototype.getEndTangent=function(){var t=this.parsedStyle.points.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},e}(Kr),ui=function(t){function e(e){var n=e.style,r=Object(a.__rest)(e,["style"]);return t.call(this,Object(a.__assign)({type:D.Rect,style:Object(a.__assign)({width:0,height:0},n)},r))||this}return Object(a.__extends)(e,t),e}(Kr),si=function(t){function e(e){var n=e.style,r=Object(a.__rest)(e,["style"]);return t.call(this,Object(a.__assign)({type:D.Text,style:Object(a.__assign)({text:"",fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"alphabetic",dropShadow:!1,dropShadowDistance:5,fill:"#000",letterSpacing:0,lineHeight:0,lineJoin:"miter",lineCap:"butt",lineWidth:0,miterLimit:10,padding:0,stroke:"#000",whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},n)},r))||this}return Object(a.__extends)(e,t),e.prototype.getLineBoundingRects=function(){var t;return null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics},e}(Kr),ci=function(t){function e(e){var n=e.style,r=Object(a.__rest)(e,["style"]),i=t.call(this,Object(a.__assign)({type:D.HTML,style:Object(a.__assign)({innerHTML:"",className:"",style:""},n)},r))||this;return i.entity.getComponent(p).enable=!1,i}return Object(a.__extends)(e,t),e.prototype.getDomElement=function(){return this.parsedStyle.$el},e.prototype.getBoundingClientRect=function(){return this.parsedStyle.$el.getBoundingClientRect()},e.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},e.prototype.getBounds=function(){var t,e,n=this.getBoundingClientRect(),r=null===(e=null===(t=this.ownerDocument)||void 0===t?void 0:t.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect();if(r){var i=n.left-r.left,o=n.top-r.top,a=new v;return a.setMinMax(l.vec3.fromValues(i,o,0),l.vec3.fromValues(i+n.width,o+n.height,0)),a}return null},e.prototype.getLocalBounds=function(){if(this.parentNode){var t=l.mat4.invert(l.mat4.create(),this.parentNode.getWorldTransform()),e=this.getBounds();if(e){var n=new v;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()},e}(Kr),fi=function(){function t(){this.registry={},this.define(D.Circle,ti),this.define(D.Ellipse,ei),this.define(D.Rect,ui),this.define(D.Image,ni),this.define(D.Line,ri),this.define(D.Group,Jr),this.define(D.Path,ii),this.define(D.Polygon,oi),this.define(D.Polyline,ai),this.define(D.Text,si),this.define(D.HTML,ci)}return t.prototype.define=function(t,e){this.registry[t]=e},t.prototype.get=function(t){return this.registry[t]},t}(),li=function(){function t(t){this.plugins=[],this.config=Object(a.__assign)({enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1,enableTAA:!1},t)}return t.prototype.registerPlugin=function(t){this.plugins.push(t)},t.prototype.getPlugins=function(){return this.plugins},t.prototype.getConfig=function(){return this.config},t.prototype.setConfig=function(t){Object.assign(this.config,t)},t}(),hi={},di=0;var pi,yi,vi,gi=function(){function t(t,e){this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.name=t,this.matrix=l.mat4.clone(e.matrix),this.right=l.vec3.clone(e.right),this.up=l.vec3.clone(e.up),this.forward=l.vec3.clone(e.forward),this.position=l.vec3.clone(e.position),this.focalPoint=l.vec3.clone(e.focalPoint),this.distanceVector=l.vec3.clone(e.distanceVector),this.azimuth=e.azimuth,this.elevation=e.elevation,this.roll=e.roll,this.relAzimuth=e.relAzimuth,this.relElevation=e.relElevation,this.relRoll=e.relRoll,this.dollyingStep=e.dollyingStep,this.distance=e.distance}return t.prototype.getPosition=function(){return this.position},t.prototype.getFocalPoint=function(){return this.focalPoint},t.prototype.getRoll=function(){return this.roll},t.prototype.retrieve=function(t){t.matrix=l.mat4.copy(t.matrix,this.matrix),t.right=l.vec3.copy(t.right,this.right),t.up=l.vec3.copy(t.up,this.up),t.forward=l.vec3.copy(t.forward,this.forward),t.position=l.vec3.copy(t.position,this.position),t.focalPoint=l.vec3.copy(t.focalPoint,this.focalPoint),t.distanceVector=l.vec3.copy(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}(),mi="DefaultCamera";!function(t){t.ORBITING="ORBITING",t.EXPLORING="EXPLORING",t.TRACKING="TRACKING"}(pi||(pi={})),function(t){t.DEFAULT="DEFAULT",t.ROTATIONAL="ROTATIONAL",t.TRANSLATIONAL="TRANSLATIONAL",t.CINEMATIC="CINEMATIC"}(yi||(yi={})),function(t){t.ORTHOGRAPHIC="ORTHOGRAPHIC",t.PERSPECTIVE="PERSPECTIVE"}(vi||(vi={}));var bi={Updated:"updated"},_i=Math.PI/180,Mi=180/Math.PI,Ei=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.matrix=l.mat4.create(),e.right=l.vec3.fromValues(1,0,0),e.up=l.vec3.fromValues(0,1,0),e.forward=l.vec3.fromValues(0,0,1),e.position=l.vec3.fromValues(0,0,1),e.focalPoint=l.vec3.fromValues(0,0,0),e.distanceVector=l.vec3.fromValues(0,0,0),e.distance=1,e.azimuth=0,e.elevation=0,e.roll=0,e.relAzimuth=0,e.relElevation=0,e.relRoll=0,e.dollyingStep=0,e.maxDistance=1/0,e.minDistance=-1/0,e.zoom=1,e.rotateWorld=!1,e.fov=30,e.near=.1,e.far=1e4,e.aspect=1,e.projectionMatrix=l.mat4.create(),e.projectionMatrixInverse=l.mat4.create(),e.jitteredProjectionMatrix=void 0,e.following=void 0,e.type=pi.EXPLORING,e.trackingMode=yi.DEFAULT,e.projectionMode=vi.PERSPECTIVE,e.frustum=new M,e.landmarks=[],e.orthoMatrix=l.mat4.create(),e}return Object(a.__extends)(e,t),e.prototype.clone=function(){var t=new e;return t.setType(this.type,void 0),t},e.prototype.getProjectionMode=function(){return this.projectionMode},e.prototype.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},e.prototype.getPerspectiveInverse=function(){return this.projectionMatrixInverse},e.prototype.getFrustum=function(){return this.frustum},e.prototype.getPosition=function(){return this.position},e.prototype.getFocalPoint=function(){return this.focalPoint},e.prototype.getNear=function(){return this.near},e.prototype.getFar=function(){return this.far},e.prototype.getZoom=function(){return this.zoom},e.prototype.getOrthoMatrix=function(){return this.orthoMatrix},e.prototype.setType=function(t,e){return this.type=t,this.type===pi.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===pi.TRACKING&&void 0!==e&&this.setTrackingMode(e),this},e.prototype.setProjectionMode=function(t){return this.projectionMode=t,this},e.prototype.setTrackingMode=function(t){if(this.type!==pi.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this},e.prototype.setWorldRotation=function(t){this.rotateWorld=t,this._getAngles()},e.prototype.getViewTransform=function(){return l.mat4.invert(l.mat4.create(),this.matrix)},e.prototype.getWorldTransform=function(){return this.matrix},e.prototype.jitterProjectionMatrix=function(t,e){var n=l.mat4.fromTranslation(l.mat4.create(),[t,e,0]);this.jitteredProjectionMatrix=l.mat4.multiply(l.mat4.create(),n,this.projectionMatrix)},e.prototype.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},e.prototype.setMatrix=function(t){return this.matrix=t,this._update(),this},e.prototype.setFov=function(t){this.setPerspective(this.near,this.far,t,this.aspect)},e.prototype.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},e.prototype.setNear=function(t){return this.projectionMode===vi.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this},e.prototype.setFar=function(t){return this.projectionMode===vi.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this},e.prototype.setViewOffset=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===vi.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},e.prototype.clearViewOffset=function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===vi.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},e.prototype.setZoom=function(t){return this.zoom=t,this.projectionMode===vi.ORTHOGRAPHIC&&this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},e.prototype.setPerspective=function(t,e,n,r){return this.projectionMode=vi.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r,l.mat4.perspective(this.projectionMatrix,-this.fov*_i,-this.aspect,this.near,this.far),l.mat4.invert(this.projectionMatrixInverse,this.projectionMatrix),this.emit(bi.Updated),this},e.prototype.setOrthographic=function(t,e,n,r,i,o){this.projectionMode=vi.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,h=s+a,d=c+u,p=c-u;if(void 0!==this.view&&this.view.enabled){var y=(this.rright-this.left)/this.view.fullWidth/this.zoom,v=(this.top-this.bottom)/this.view.fullHeight/this.zoom;h=(f+=y*this.view.offsetX)+y*this.view.width,p=(d-=v*this.view.offsetY)-v*this.view.height}return l.mat4.ortho(this.projectionMatrix,f,h,p,d,i,o),l.mat4.invert(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.emit(bi.Updated),this},e.prototype.setPosition=function(t,e,n){return this._setPosition(t,e,n),this.setFocalPoint(this.focalPoint),this},e.prototype.setFocalPoint=function(t,e,n){var r=l.vec3.fromValues(0,1,0);if(this.focalPoint=At(t,e,n),this.trackingMode===yi.CINEMATIC){var i=l.vec3.subtract(l.vec3.create(),this.focalPoint,this.position);t=i[0],e=i[1],n=i[2];var o=l.vec3.length(i),a=Math.asin(e/o)*Mi,u=90+Math.atan2(n,t)*Mi,s=l.mat4.create();l.mat4.rotateY(s,s,u*_i),l.mat4.rotateX(s,s,a*_i),r=l.vec3.transformMat4(l.vec3.create(),[0,1,0],s)}return l.mat4.invert(this.matrix,l.mat4.lookAt(l.mat4.create(),this.position,this.focalPoint,r)),this._getAxes(),this._getDistance(),this._getAngles(),this},e.prototype.setDistance=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=l.vec3.create();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}},e.prototype.setMaxDistance=function(t){return this.maxDistance=t,this},e.prototype.setMinDistance=function(t){return this.minDistance=t,this},e.prototype.changeAzimuth=function(t){return this.setAzimuth(this.azimuth+t),this},e.prototype.changeElevation=function(t){return this.setElevation(this.elevation+t),this},e.prototype.changeRoll=function(t){return this.setRoll(this.roll+t),this},e.prototype.setAzimuth=function(t){return this.azimuth=xt(t),this.computeMatrix(),this._getAxes(),this.type===pi.ORBITING||this.type===pi.EXPLORING?this._getPosition():this.type===pi.TRACKING&&this._getFocalPoint(),this},e.prototype.getAzimuth=function(){return this.azimuth},e.prototype.setElevation=function(t){return this.elevation=xt(t),this.computeMatrix(),this._getAxes(),this.type===pi.ORBITING||this.type===pi.EXPLORING?this._getPosition():this.type===pi.TRACKING&&this._getFocalPoint(),this},e.prototype.setRoll=function(t){return this.roll=xt(t),this.computeMatrix(),this._getAxes(),this.type===pi.ORBITING||this.type===pi.EXPLORING?this._getPosition():this.type===pi.TRACKING&&this._getFocalPoint(),this},e.prototype.rotate=function(t,e,n){if(this.relElevation=xt(e),this.relAzimuth=xt(t),this.relRoll=xt(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===pi.EXPLORING){var r=l.quat.setAxisAngle(l.quat.create(),[1,0,0],(this.rotateWorld?1:-1)*this.relElevation*_i),i=l.quat.setAxisAngle(l.quat.create(),[0,1,0],(this.rotateWorld?1:-1)*this.relAzimuth*_i),o=l.quat.setAxisAngle(l.quat.create(),[0,0,1],this.relRoll*_i),a=l.quat.multiply(l.quat.create(),i,r);a=l.quat.multiply(l.quat.create(),a,o);var u=l.mat4.fromQuat(l.mat4.create(),a);l.mat4.translate(this.matrix,this.matrix,[0,0,-this.distance]),l.mat4.multiply(this.matrix,this.matrix,u),l.mat4.translate(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return;this.computeMatrix()}return this._getAxes(),this.type===pi.ORBITING||this.type===pi.EXPLORING?this._getPosition():this.type===pi.TRACKING&&this._getFocalPoint(),this._update(),this},e.prototype.pan=function(t,e){var n=At(t,e,0),r=l.vec3.clone(this.position);return l.vec3.add(r,r,l.vec3.scale(l.vec3.create(),this.right,n[0])),l.vec3.add(r,r,l.vec3.scale(l.vec3.create(),this.up,n[1])),this._setPosition(r),this.emit(bi.Updated),this},e.prototype.dolly=function(t){var e=this.forward,n=l.vec3.clone(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===pi.ORBITING||this.type===pi.EXPLORING?this._getDistance():this.type===pi.TRACKING&&l.vec3.add(this.focalPoint,n,this.distanceVector),this.emit(bi.Updated),this},e.prototype.createLandmark=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 gi(t,n);return this.landmarks.push(r),r},e.prototype.setLandmark=function(t){var e=new gi(t,this);return this.landmarks.push(e),this},e.prototype.gotoLandmark=function(t,e){var n=this;void 0===e&&(e=1e3);var r=this.landmarks.find((function(e){return e.name===t}));if(r){if(0===e)return void r.retrieve(this);void 0!==this.landmarkAnimationID&&De(this.landmarkAnimationID);var i,o=r.getPosition(),a=r.getFocalPoint(),u=r.getRoll(),s=function(t){void 0===i&&(i=t);var r,c=t-i,f=(1-Math.cos(c/e*Math.PI))/2,h=l.vec3.create(),d=l.vec3.create();if(l.vec3.lerp(h,n.focalPoint,a,f),l.vec3.lerp(d,n.position,o,f),r=n.roll*(1-f)+u*f,n.setFocalPoint(h),n.setPosition(d),n.setRoll(r),n.computeMatrix(),n.emit(bi.Updated),!(l.vec3.dist(h,a)+l.vec3.dist(d,o)>.01))return n.setFocalPoint(h),n.setPosition(d),n.setRoll(r),void n.computeMatrix();c<e&&(n.landmarkAnimationID=ke(s))};ke(s)}},e.prototype._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.emit(bi.Updated)},e.prototype.computeMatrix=function(){var t,e,n=l.quat.setAxisAngle(l.quat.create(),[0,0,1],this.roll*_i);l.mat4.identity(this.matrix),t=l.quat.setAxisAngle(l.quat.create(),[1,0,0],(this.rotateWorld&&this.type!==pi.TRACKING||this.type===pi.TRACKING?1:-1)*this.elevation*_i),e=l.quat.setAxisAngle(l.quat.create(),[0,1,0],(this.rotateWorld&&this.type!==pi.TRACKING||this.type===pi.TRACKING?1:-1)*this.azimuth*_i);var r=l.quat.multiply(l.quat.create(),e,t);r=l.quat.multiply(l.quat.create(),r,n);var i=l.mat4.fromQuat(l.mat4.create(),r);this.type===pi.ORBITING||this.type===pi.EXPLORING?(l.mat4.translate(this.matrix,this.matrix,this.focalPoint),l.mat4.multiply(this.matrix,this.matrix,i),l.mat4.translate(this.matrix,this.matrix,[0,0,this.distance])):this.type===pi.TRACKING&&(l.mat4.translate(this.matrix,this.matrix,this.position),l.mat4.multiply(this.matrix,this.matrix,i))},e.prototype._setPosition=function(t,e,n){this.position=At(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,this._getOrthoMatrix()},e.prototype._getAxes=function(){l.vec3.copy(this.right,At(l.vec4.transformMat4(l.vec4.create(),[1,0,0,0],this.matrix))),l.vec3.copy(this.up,At(l.vec4.transformMat4(l.vec4.create(),[0,1,0,0],this.matrix))),l.vec3.copy(this.forward,At(l.vec4.transformMat4(l.vec4.create(),[0,0,1,0],this.matrix))),l.vec3.normalize(this.right,this.right),l.vec3.normalize(this.up,this.up),l.vec3.normalize(this.forward,this.forward)},e.prototype._getAngles=function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=l.vec3.length(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===pi.TRACKING||this.rotateWorld?(this.elevation=Math.asin(e/r)*Mi,this.azimuth=Math.atan2(-t,-n)*Mi):(this.elevation=-Math.asin(e/r)*Mi,this.azimuth=-Math.atan2(-t,-n)*Mi)},e.prototype._getPosition=function(){l.vec3.copy(this.position,At(l.vec4.transformMat4(l.vec4.create(),[0,0,0,1],this.matrix))),this._getDistance()},e.prototype._getFocalPoint=function(){l.vec3.transformMat3(this.distanceVector,[0,0,-this.distance],l.mat3.fromMat4(l.mat3.create(),this.matrix)),l.vec3.add(this.focalPoint,this.position,this.distanceVector),this._getDistance()},e.prototype._getDistance=function(){this.distanceVector=l.vec3.subtract(l.vec3.create(),this.focalPoint,this.position),this.distance=l.vec3.length(this.distanceVector),this.dollyingStep=this.distance/100},e.prototype._getOrthoMatrix=function(){if(this.projectionMode===vi.ORTHOGRAPHIC){var t=this.position,e=l.quat.setAxisAngle(l.quat.create(),[0,0,1],-this.roll*Math.PI/180);l.mat4.fromRotationTranslationScaleOrigin(this.orthoMatrix,e,l.vec3.fromValues((this.rright-this.left)/2-t[0],(this.bottom-this.top)/2-t[1],0),l.vec3.fromValues(this.zoom,this.zoom,1),t)}},e.ProjectionMode={ORTHOGRAPHIC:"ORTHOGRAPHIC",PERSPECTIVE:"PERSPECTIVE"},e}(yt.EventEmitter),Ti=function(){function t(){}var e;return e=t,t.prototype.apply=function(t){var n=this;t.hooks.prepare.tap(e.tag,(function(t){if(t){var e=n.canvasConfig.renderer.getConfig().enableDirtyRectangleRendering;return t.entity.getComponent(f).dirty||n.renderingContext.renderReasons.has(Y.CameraChanged)||!e?t:null}return t}))},t.tag="DirtyCheckPlugin",Object(a.__decorate)([Object(o.inject)(G),Object(a.__metadata)("design:type",Object)],t.prototype,"canvasConfig",void 0),Object(a.__decorate)([Object(o.inject)(lt),Object(a.__metadata)("design:type",Object)],t.prototype,"renderingContext",void 0),t=e=Object(a.__decorate)([Object(o.singleton)({contrib:dt})],t)}(),Oi=o.Syringe.defineToken("CullingStrategyContribution"),wi=function(){function t(){}var e;return e=t,t.prototype.apply=function(t){var n=this,r=this.strategyProvider.getContributions();t.hooks.prepare.tap(e.tag,(function(t){if(t){var e=t.entity.getComponent(p);if(0===r.length?e.visible=!0:e.visible=r.every((function(e){return e.isVisible(t)})),t.isVisible())return t;if(n.canvasConfig.renderer.getConfig().enableDirtyRectangleRendering){var i=t.getRenderBounds();i&&(n.renderingContext.removedRenderBoundsList.push(i),n.renderingContext.renderReasons.add(Y.DisplayObjectRemoved))}return null}return t})),t.hooks.afterRender.tap(e.tag,(function(t){t.entity.getComponent(p).visibilityPlaneMask=-1}))},t.tag="CullingPlugin",Object(a.__decorate)([Object(o.inject)(G),Object(a.__metadata)("design:type",Object)],t.prototype,"canvasConfig",void 0),Object(a.__decorate)([Object(o.contrib)(Oi),Object(a.__metadata)("design:type",Object)],t.prototype,"strategyProvider",void 0),Object(a.__decorate)([Object(o.inject)(lt),Object(a.__metadata)("design:type",Object)],t.prototype,"renderingContext",void 0),t=e=Object(a.__decorate)([Object(o.singleton)({contrib:dt})],t)}(),xi=function(){function t(){}var e;return e=t,t.prototype.apply=function(t){var n=this,r=function(t){n.renderingContext.renderReasons.add(Y.DisplayObjectChanged)},i=function(e){k(e.target,!0),t.dirtify()},o=function(e){t.dirtify()},a=function(t){i(t)},u=function(t){i(t)};t.hooks.init.tap(e.tag,(function(){n.renderingContext.root.addEventListener(_.MOUNTED,a),n.renderingContext.root.addEventListener(_.UNMOUNTED,u),n.renderingContext.root.addEventListener(_.ATTRIBUTE_CHANGED,r),n.renderingContext.root.addEventListener(_.BOUNDS_CHANGED,o)})),t.hooks.destroy.tap(e.tag,(function(){n.renderingContext.root.removeEventListener(_.MOUNTED,a),n.renderingContext.root.removeEventListener(_.UNMOUNTED,u),n.renderingContext.root.removeEventListener(_.ATTRIBUTE_CHANGED,r),n.renderingContext.root.removeEventListener(_.BOUNDS_CHANGED,o)}))},t.tag="PrepareRendererPlugin",Object(a.__decorate)([Object(o.inject)(lt),Object(a.__metadata)("design:type",Object)],t.prototype,"renderingContext",void 0),t=e=Object(a.__decorate)([Object(o.singleton)({contrib:dt})],t)}(),Ai=function(){function t(){}return t.prototype.isVisible=function(t){t.entity.getComponent(p);return!0},t.prototype.computeVisibilityWithPlaneMask=function(t,e,n){if(e===d.OUTSIDE||e===d.INSIDE)return e;for(var r=d.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(l.vec3.dot(s,t.getPositiveFarPoint(n[i]))+c<0)return d.OUTSIDE;l.vec3.dot(s,t.getNegativeFarPoint(n[i]))+c<0&&(r|=a)}}return r},Object(a.__decorate)([Object(o.inject)(mi),Object(a.__metadata)("design:type",Ei)],t.prototype,"camera",void 0),t=Object(a.__decorate)([Object(o.singleton)({contrib:Oi})],t)}(),Pi=!!self.TouchEvent,Ci=!!self.PointerEvent,Si={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};function Ni(t){var e=[];if(function(t){return Pi&&t instanceof TouchEvent}(t))for(var n=0;n<t.changedTouches.length;n++){var r=t.changedTouches[n];Object(s.isUndefined)(r.button)&&(r.button=t.touches.length?1:0),Object(s.isUndefined)(r.buttons)&&(r.buttons=t.touches.length?1:0),Object(s.isUndefined)(r.isPrimary)&&(r.isPrimary=1===t.touches.length&&"touchstart"===t.type),Object(s.isUndefined)(r.width)&&(r.width=r.radiusX||1),Object(s.isUndefined)(r.height)&&(r.height=r.radiusY||1),Object(s.isUndefined)(r.tiltX)&&(r.tiltX=0),Object(s.isUndefined)(r.tiltY)&&(r.tiltY=0),Object(s.isUndefined)(r.pointerType)&&(r.pointerType="touch"),Object(s.isUndefined)(r.pointerId)&&(r.pointerId=r.identifier||0),Object(s.isUndefined)(r.pressure)&&(r.pressure=r.force||.5),Object(s.isUndefined)(r.twist)&&(r.twist=0),Object(s.isUndefined)(r.tangentialPressure)&&(r.tangentialPressure=0),r.isNormalized=!0,r.type=t.type,e.push(r)}else if(function(t){return!self.MouseEvent||t instanceof MouseEvent&&(!Ci||!(t instanceof self.PointerEvent))}(t)){var i=t;Object(s.isUndefined)(i.isPrimary)&&(i.isPrimary=!0),Object(s.isUndefined)(i.width)&&(i.width=1),Object(s.isUndefined)(i.height)&&(i.height=1),Object(s.isUndefined)(i.tiltX)&&(i.tiltX=0),Object(s.isUndefined)(i.tiltY)&&(i.tiltY=0),Object(s.isUndefined)(i.pointerType)&&(i.pointerType="mouse"),Object(s.isUndefined)(i.pointerId)&&(i.pointerId=1),Object(s.isUndefined)(i.pressure)&&(i.pressure=.5),Object(s.isUndefined)(i.twist)&&(i.twist=0),Object(s.isUndefined)(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,e.push(i)}else e.push(t);return e}var ji,Ii=function(){function t(){var t=this;this.autoPreventDefault=!0,this.rootPointerEvent=new Tt(null),this.rootWheelEvent=new Ot(null),this.onPointerMove=function(e){var n,r;if(!Pi||"touch"!==e.pointerType){var i=Ni(e);try{for(var o=Object(a.__values)(i),u=o.next();!u.done;u=o.next()){var s=u.value,c=t.bootstrapEvent(t.rootPointerEvent,s);t.eventService.mapEvent(c)}}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}t.setCursor(t.eventService.cursor)}}}var e;return e=t,t.prototype.apply=function(t){var n=this;this.eventService.setPickHandler((function(t){return Object(a.__awaiter)(n,void 0,void 0,(function(){return Object(a.__generator)(this,(function(e){switch(e.label){case 0:return[4,this.renderingService.hooks.pick.promise({position:t,picked:null})];case 1:return[2,e.sent().picked]}}))}))})),t.hooks.pointerWheel.tap(e.tag,(function(t){var e=n.normalizeWheelEvent(t);n.eventService.mapEvent(e)})),t.hooks.pointerDown.tap(e.tag,(function(t){var e,r;if(!Pi||"touch"!==t.pointerType){var i=Ni(t);if(n.autoPreventDefault&&i[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();try{for(var o=Object(a.__values)(i),u=o.next();!u.done;u=o.next()){var s=u.value,c=n.bootstrapEvent(n.rootPointerEvent,s);n.eventService.mapEvent(c)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}n.setCursor(n.eventService.cursor)}})),t.hooks.pointerUp.tap(e.tag,(function(t){var e,r;if(!Pi||"touch"!==t.pointerType){var i=n.contextService.getDomElement(),o=i&&t.target&&t.target!==i&&i.contains&&!i.contains(t.target)?"outside":"",u=Ni(t);try{for(var s=Object(a.__values)(u),c=s.next();!c.done;c=s.next()){var f=c.value,l=n.bootstrapEvent(n.rootPointerEvent,f);l.type+=o,n.eventService.mapEvent(l)}}catch(t){e={error:t}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}n.setCursor(n.eventService.cursor)}})),t.hooks.pointerMove.tap(e.tag,this.onPointerMove),t.hooks.pointerOver.tap(e.tag,this.onPointerMove),t.hooks.pointerOut.tap(e.tag,this.onPointerMove)},t.prototype.bootstrapEvent=function(t,e){t._originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var n=this.eventService.client2Viewport(new P(e.clientX,e.clientY)),r=n.x,i=n.y;t.viewport.x=r,t.viewport.y=i;var o=this.eventService.viewport2Canvas(t.viewport),a=o.x,u=o.y;return t.canvas.x=a,t.canvas.y=u,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=Si[t.type]||t.type),t},t.prototype.normalizeWheelEvent=function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.eventService.client2Viewport(new P(t.clientX,t.clientY)),r=n.x,i=n.y;e.viewport.x=r,e.viewport.y=i;var o=this.eventService.viewport2Canvas(e.viewport),a=o.x,u=o.y;return e.canvas.x=a,e.canvas.y=u,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e},t.prototype.transferMouseData=function(t,e){t.isTrusted=e.isTrusted,t.timeStamp=performance.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null},t.prototype.setCursor=function(t){this.contextService.applyCursorStyle(t||this.canvasConfig.cursor||"default")},t.tag="EventPlugin",Object(a.__decorate)([Object(o.inject)(G),Object(a.__metadata)("design:type",Object)],t.prototype,"canvasConfig",void 0),Object(a.__decorate)([Object(o.inject)(ft),Object(a.__metadata)("design:type",Object)],t.prototype,"contextService",void 0),Object(a.__decorate)([Object(o.inject)(pt),Object(a.__metadata)("design:type",pt)],t.prototype,"renderingService",void 0),Object(a.__decorate)([Object(o.inject)(wt),Object(a.__metadata)("design:type",wt)],t.prototype,"eventService",void 0),t=e=Object(a.__decorate)([Object(o.singleton)({contrib:dt})],t)}(),Ri=Object(o.Module)((function(t,e){e.container.isBound(pt)?(e.container.remove(dt),e.container.remove(pt),e.container.remove(Ai)):(o.Contribution.register(t,dt,{cache:!1}),o.Contribution.register(t,Oi,{cache:!1})),t(pt),t(wt),t(Ii),t(xi),t(Ti),t(wi),t(Ai)}));!function(t){t.READY="ready",t.BEFORE_RENDER="beforerender",t.AFTER_RENDER="afterrender",t.BEFORE_DESTROY="beforedestroy",t.AFTER_DESTROY="afterdestroy"}(ji||(ji={}));var ki=function(t){function e(e){var n,r,i,o=t.call(this)||this;o.container=Rr.createChild(),o.Element=Kr,o.document=new Zr,o.document.defaultView=o,o.customElements=new fi,n=e.container,r=o,i="string"==typeof n?n:n.id||di++,hi[i]&&hi[i].destroy(),hi[i]=r;var u=Object(a.__assign)(Object(a.__assign)({},e),{cursor:"default"});return o.initRenderingContext(u),o.initDefaultCamera(u.width,u.height),o.initRenderer(u.renderer),o}return Object(a.__extends)(e,t),e.prototype.initRenderingContext=function(t){var e=this;this.container.register({token:G,useValue:t}),this.container.register({token:lt,useValue:{root:this.document.documentElement,removedRenderBoundsList:[],renderReasons:new Set,force:!1,dirty:!1}}),this.document.documentElement.addEventListener(_.CHILD_INSERTED,(function(t){e.mountChildren(t.detail.child)})),this.document.documentElement.addEventListener(_.CHILD_REMOVED,(function(t){e.unmountChildren(t.detail.child)}))},e.prototype.initDefaultCamera=function(t,e){var n=(new Ei).setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0).setOrthographic(t/-2,t/2,e/-2,e/2,.1,1e3),r=this.container.get(lt);n.on(bi.Updated,(function(){r.renderReasons.add(Y.CameraChanged)})),this.container.register({token:mi,useValue:n})},e.prototype.getConfig=function(){return this.container.get(G)},e.prototype.getContainer=function(){return this.container},e.prototype.getRoot=function(){return this.document.documentElement},e.prototype.getCamera=function(){return this.container.get(mi)},e.prototype.getContextService=function(){return this.container.get(ft)},e.prototype.getEventService=function(){return this.container.get(wt)},e.prototype.getRenderingService=function(){return this.container.get(pt)},e.prototype.getRenderingContext=function(){return this.container.get(lt)},e.prototype.getComputedStyle=function(t){return t.parsedStyle},e.prototype.destroy=function(t){void 0===t&&(t=!0),this.emit(ji.BEFORE_DESTROY,(function(){})),this.frameId&&De(this.frameId);var e=this.getRoot();this.unmountChildren(e),t&&this.document.destroy(),this.getContextService().destroy(),this.getRenderingService().destroy(),this.emit(ji.AFTER_DESTROY,{})},e.prototype.changeSize=function(t,e){this.resize(t,e)},e.prototype.resize=function(t,e){var n=this.container.get(G);n.width=t,n.height=e,this.getContextService().resize(t,e);var r=this.container.get(mi);r.getProjectionMode()===vi.ORTHOGRAPHIC?r.setOrthographic(t/-2,t/2,e/-2,e/2,r.getNear(),r.getFar()):r.setAspect(t/e)},e.prototype.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},e.prototype.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},e.prototype.removeChild=function(t,e){return void 0===e&&(e=!0),this.document.documentElement.removeChild(t,e)},e.prototype.removeChildren=function(t){void 0===t&&(t=!0),this.document.documentElement.removeChildren(t)},e.prototype.render=function(){(this.emit(ji.BEFORE_RENDER,{}),this.container.isBound(pt))&&this.container.get(pt).render();this.emit(ji.AFTER_RENDER,{})},e.prototype.run=function(){var t=this,e=function(){t.render(),t.frameId=requestAnimationFrame(e)};e()},e.prototype.initRenderer=function(t){var e=this;if(!t)throw new Error("Renderer is required.");this.loadCommonContainerModule(),this.loadRendererContainerModule(t);var n=this.container.get(ft),r=this.container.get(pt);n.init(),r.init().then((function(){e.emit(ji.READY,{})})),t.getConfig().enableAutoRendering&&this.run(),this.getRoot().forEach((function(t){var e=t.entity.getComponent(f);e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),this.mountChildren(this.getRoot())},e.prototype.loadCommonContainerModule=function(){this.container.load(Ri,!0)},e.prototype.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach((function(t){t.init(e.container)}))},e.prototype.setRenderer=function(t){var e=this,n=this.getConfig();if(n.renderer!==t){var r=n.renderer;n.renderer=t,this.destroy(!1),null==r||r.getPlugins().reverse().forEach((function(t){t.destroy(e.container)})),this.initRenderer(t)}},e.prototype.unmountChildren=function(t){var e=[];t.forEach((function(t){t.isConnected&&e.push(t)})),e.reverse().forEach((function(t){t.emit(_.UNMOUNTED,{}),t.ownerDocument=null,t.isConnected=!1}))},e.prototype.mountChildren=function(t){var e=this;t.forEach((function(t){t.isConnected||(t.ownerDocument=e.document,t.isConnected=!0,t.emit(_.MOUNTED,{}))}))},e.prototype.client2Viewport=function(t){return this.getEventService().client2Viewport(t)},e.prototype.viewport2Client=function(t){return this.getEventService().viewport2Client(t)},e.prototype.viewport2Canvas=function(t){return this.getEventService().viewport2Canvas(t)},e.prototype.canvas2Viewport=function(t){return this.getEventService().canvas2Viewport(t)},e.prototype.getPointByClient=function(t,e){return this.client2Viewport({x:t,y:e})},e.prototype.getClientByPoint=function(t,e){return this.viewport2Client({x:t,y:e})},e}(bt);Rr.load(i.containerModule),Rr.load(kr);var Di=Rr.get(i.World);Di.registerComponent(h).registerComponent(y).registerComponent(p).registerComponent(c).registerComponent(f)}])}));
|
|
15
|
+
***************************************************************************** */()}function g(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 v(t,e){return e.lifecycle===o.Lifecycle.singleton?function(t){return t.inSingletonScope()}(t):function(t){return t.inTransientScope()}(t)}function m(t,e){t.whenTargetNamed(E(e))}function b(t,e){return e.container.bind(M(t))}function T(t,e){var n=e.container.parent,r=n&&n.isBound(M(t));return e.container.isBound(M(t))&&!r?e.container.rebind(M(t)):e.container.bind(M(t))}function E(t){return a.isDefinedToken(t)?t.symbol:t}function M(t){return a.isDefinedToken(t)?t.symbol:t}n.d(e,"decorate",(function(){return s.decorate})),n.d(e,"optional",(function(){return s.optional})),n.d(e,"postConstruct",(function(){return s.postConstruct})),n.d(e,"unmanaged",(function(){return s.unmanaged})),function(e){!function(n){var i="object"==typeof r?r:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),o=a(e);function a(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===i.Reflect?i.Reflect=e:o=a(i.Reflect,o),function(e){var n=Object.prototype.hasOwnProperty,r="function"==typeof Symbol,i=r&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",o=r&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",a="function"==typeof Object.create,s={__proto__:[]}instanceof Array,u=!a&&!s,c={create:a?function(){return R(Object.create(null))}:s?function(){return R({__proto__:null})}:function(){return R({})},has:u?function(t,e){return n.call(t,e)}:function(t,e){return e in t},get:u?function(t,e){return n.call(t,e)?t[e]:void 0}:function(t,e){return t[e]}},l=Object.getPrototypeOf(Function),h="object"==typeof t&&t.env&&"true"===t.env.REFLECT_METADATA_USE_MAP_POLYFILL,f=h||"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[o]=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,i)},e.prototype.entries=function(){return new n(this._keys,this._values,a)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[o]=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 i(t,e){return e}function a(t,e){return[t,e]}}():Map,p=h||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?function(){function t(){this._map=new f}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[o]=function(){return this.keys()},t}():Set,d=new(h||"function"!=typeof WeakMap?function(){var t=c.create(),e=r();return function(){function t(){this._key=r()}return t.prototype.has=function(t){var e=i(t,!1);return void 0!==e&&c.has(e,this._key)},t.prototype.get=function(t){var e=i(t,!1);return void 0!==e?c.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(c.has(t,e));return t[e]=!0,e}function i(t,r){if(!n.call(t,e)){if(!r)return;Object.defineProperty(t,e,{value:c.create()})}return t[e]}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 y(t,e,n){var r=d.get(t);if(E(r)){if(!n)return;r=new f,d.set(t,r)}var i=r.get(e);if(E(i)){if(!n)return;i=new f,r.set(e,i)}return i}function g(t,e,n){var r=y(e,n,!1);return!E(r)&&!!r.has(t)}function v(t,e,n){var r=y(e,n,!1);if(!E(r))return r.get(t)}function m(t,e,n,r){y(n,r,!0).set(t,e)}function b(t,e){var n=[],r=y(t,e,!1);if(E(r))return n;for(var i=function(t){var e=O(t,o);if(!P(e))throw new TypeError;var n=e.call(t);if(!w(n))throw new TypeError;return n}(r.keys()),a=0;;){var s=N(i);if(!s)return n.length=a,n;var u=s.value;try{n[a]=u}catch(t){try{C(i)}finally{throw t}}a++}}function T(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 M(t){return null===t}function w(t){return"object"==typeof t?null!==t:"function"==typeof t}function _(t,e){switch(T(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var n=3===e?"string":5===e?"number":"default",r=O(t,i);if(void 0!==r){var o=r.call(t,n);if(w(o))throw new TypeError;return o}return function(t,e){if("string"===e){var n=t.toString;if(P(n))if(!w(i=n.call(t)))return i;if(P(r=t.valueOf))if(!w(i=r.call(t)))return i}else{var r;if(P(r=t.valueOf))if(!w(i=r.call(t)))return i;var i,o=t.toString;if(P(o))if(!w(i=o.call(t)))return i}throw new TypeError}(t,"default"===n?"number":n)}function x(t){var e=_(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function A(t){return Array.isArray?Array.isArray(t):t instanceof Object?t instanceof Array:"[object Array]"===Object.prototype.toString.call(t)}function P(t){return"function"==typeof t}function S(t){return"function"==typeof t}function O(t,e){var n=t[e];if(null!=n){if(!P(n))throw new TypeError;return n}}function N(t){var e=t.next();return!e.done&&e}function C(t){var e=t.return;e&&e.call(t)}function I(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===l)return e;if(e!==l)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 R(t){return t.__=void 0,delete t.__,t}e("decorate",(function(t,e,n,r){if(E(n)){if(!A(t))throw new TypeError;if(!S(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)&&!M(r)){if(!S(r))throw new TypeError;e=r}}return e}(t,e)}if(!A(t))throw new TypeError;if(!w(e))throw new TypeError;if(!w(r)&&!E(r)&&!M(r))throw new TypeError;return M(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)&&!M(o)){if(!w(o))throw new TypeError;r=o}}return r}(t,e,n=x(n),r)})),e("metadata",(function(t,e){return function(n,r){if(!w(n))throw new TypeError;if(!E(r)&&!function(t){switch(T(t)){case 3:case 4:return!0;default:return!1}}(r))throw new TypeError;m(t,e,n,r)}})),e("defineMetadata",(function(t,e,n,r){if(!w(n))throw new TypeError;return E(r)||(r=x(r)),m(t,e,n,r)})),e("hasMetadata",(function(t,e,n){if(!w(e))throw new TypeError;return E(n)||(n=x(n)),function t(e,n,r){if(g(e,n,r))return!0;var i=I(n);return!M(i)&&t(e,i,r)}(t,e,n)})),e("hasOwnMetadata",(function(t,e,n){if(!w(e))throw new TypeError;return E(n)||(n=x(n)),g(t,e,n)})),e("getMetadata",(function(t,e,n){if(!w(e))throw new TypeError;return E(n)||(n=x(n)),function t(e,n,r){if(g(e,n,r))return v(e,n,r);var i=I(n);return M(i)?void 0:t(e,i,r)}(t,e,n)})),e("getOwnMetadata",(function(t,e,n){if(!w(e))throw new TypeError;return E(n)||(n=x(n)),v(t,e,n)})),e("getMetadataKeys",(function(t,e){if(!w(t))throw new TypeError;return E(e)||(e=x(e)),function t(e,n){var r=b(e,n),i=I(e);if(null===i)return r;var o=t(i,n);if(o.length<=0)return r;if(r.length<=0)return o;for(var a=new p,s=[],u=0,c=r;u<c.length;u++){var l=c[u];a.has(l)||(a.add(l),s.push(l))}for(var h=0,f=o;h<f.length;h++){l=f[h];a.has(l)||(a.add(l),s.push(l))}return s}(t,e)})),e("getOwnMetadataKeys",(function(t,e){if(!w(t))throw new TypeError;return E(e)||(e=x(e)),b(t,e)})),e("deleteMetadata",(function(t,e,n){if(!w(e))throw new TypeError;E(n)||(n=x(n));var r=y(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}))}(o)}()}(i||(i={})),function(t){t.defineToken=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{multiple:!0};return new t.DefinedToken(e,n)};var e;t.DefinedToken=function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};h(this,t),this.prototype={},this.name=void 0,this.multiple=void 0,this.symbol=void 0;var r=n.multiple,i=void 0!==r&&r;this.name=e,this.symbol=Symbol(this.name),this.multiple=i},t.isModule=function(t){return!!t&&"object"===l(t)&&"id"in t&&"registry"in t},function(t){t.singleton="singleton",t.transient="transient"}(e=t.Lifecycle||(t.Lifecycle={})),t.ClassOptionSymbol=Symbol("SyringeClassOptionSymbol"),t.DefaultOption={lifecycle:e.transient}}(o||(o={})),function(t){t.maybeArrayToArray=function(t){return t instanceof Array?t:void 0!==t?[t]:[]},t.isClass=function(t){return!(!t||"function"!=typeof t||!("prototype"in t))},t.isDefinedToken=function(t){return!!(t&&"object"===l(t)&&"symbol"in t&&"multiple"in t)},t.isInjectOption=function(t){return!(!t||"object"!==l(t)||!("token"in t))},t.isNamedToken=function(t){return!!(t&&"object"===l(t)&&"token"in t&&"named"in t)},t.isMultipleEnabled=function(e){return t.isDefinedToken(e)&&e.multiple}}(a||(a={}));var w=new s.Container;function _(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=Object(s.injectable)();return function(n){Reflect.defineMetadata(o.ClassOptionSymbol,c(c({},t),{},{target:n}),n),e(n)}}function x(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return _(c(c({},t),{},{lifecycle:o.Lifecycle.singleton}))}function A(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return _(c(c({},t),{},{lifecycle:o.Lifecycle.transient}))}function P(t){return Object(s.inject)(M(t))}function S(t){return Object(s.named)(E(t))}var O=Symbol("SyringeOptionSymbol"),N=function(t,e){Reflect.defineMetadata(O,t,e)};var C=function(){function t(e,n,r){h(this,t),this.token=void 0,this.rawToken=void 0,this.named=void 0,this.generalToken=void 0,this.option=void 0,this.context=void 0,this.mutiple=void 0,this.context=e,this.token=n,this.option=r,this.rawToken=a.isNamedToken(n)?n.token:n,this.named=a.isNamedToken(n)?n.named:void 0,this.mutiple=!!this.named||a.isMultipleEnabled(this.rawToken),this.generalToken=this.rawToken}return p(t,[{key:"resolve",value:function(){var t,e=this,n=this.context;(t=n)&&"object"===l(t)&&"container"in t&&"inversify"in t&&(this.mutiple?this.resolveMutilple(n):(this.resolveMono(n),!this.named&&this.option.contrib.length>0&&this.option.contrib.forEach((function(t){a.isMultipleEnabled(t)?b(t,n).toService(e.generalToken):T(t,n).toService(e.generalToken)}))))}},{key:"resolveMono",value:function(t){var e=this;if("useValue"in this.option)return T(this.generalToken,t).toConstantValue(this.option.useValue);if(this.option.useDynamic.length>0){var n=this.option.useDynamic[this.option.useDynamic.length-1];return v(T(this.generalToken,t).toDynamicValue((function(){return n({container:e.context})})),this.option)}if(this.option.useFactory.length>0){var r=this.option.useFactory[this.option.useFactory.length-1];return T(this.generalToken,t).toFactory((function(){return r({container:e.context})}))}if(this.option.useClass.length>0){var i=this.option.useClass[this.option.useClass.length-1];return v(T(this.generalToken,t).to(i),this.option)}}},{key:"resolveMutilple",value:function(t){var e=this,n=this.option.useClass.map((function(n){return v(b(e.generalToken,t).to(n),e.option)})),r=this.option.useDynamic.map((function(n){return v(b(e.generalToken,t).toDynamicValue((function(){return n({container:e.context})})),e.option)})),i=this.option.useFactory.map((function(n){return b(e.generalToken,t).toFactory((function(){return n({container:e.context})}))})),o="useValue"in this.option?b(this.generalToken,t).toConstantValue(this.option.useValue):void 0;this.named&&(n.forEach((function(t){return e.named&&m(t,e.named)})),r.forEach((function(t){return e.named&&m(t,e.named)})),i.forEach((function(t){return e.named&&m(t,e.named)})),o&&m(o,this.named))}}],[{key:"resolveTarget",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{try{var i=Reflect.getMetadata(O,n);i&&t.resolveOption(e,i)}catch(t){}if(a.isClass(n))if(r.useClass){var s=a.maybeArrayToArray(r.useClass);s.unshift(n),r.useClass=s}else r.useClass=[n];var u;try{u=Reflect.getMetadata(o.ClassOptionSymbol,n)}catch(t){}if((u=c(c({},u||{}),r)).token){var l=a.maybeArrayToArray(u.token);l.unshift(n),u.token=l}else u.token=[n];t.resolveOption(e,u)}catch(t){}}},{key:"resolveOption",value:function(e,n){var r=function(t){var e=a.maybeArrayToArray(t.token),n=a.maybeArrayToArray(t.useClass),r=a.maybeArrayToArray(t.useDynamic),i=a.maybeArrayToArray(t.useFactory),s=a.maybeArrayToArray(t.contrib),u=t.lifecycle||o.Lifecycle.transient,c={token:e,useClass:n,lifecycle:s.length>0?o.Lifecycle.singleton:u,contrib:s,useDynamic:r,useFactory:i};return"useValue"in t&&(c.useValue=t.useValue),c}(c(c({},t.globalConfig),n));(0!==r.useClass.length||0!==r.useDynamic.length||0!==r.useFactory.length||"useValue"in r)&&r.token.forEach((function(n){new t(e,n,c({},r)).resolve()}))}}]),t}();C.globalConfig=o.DefaultOption;var I=function(){function t(e){h(this,t),this.loadedModules=[],this.container=void 0,this.inversify=!0,this.parent=void 0,this.container=e||new s.Container}return p(t,[{key:"load",value:function(t,e){!e&&this.loadedModules.includes(t.id)||(t.registry(this.register.bind(this),this.resolveContext()),this.loadedModules.push(t.id))}},{key:"remove",value:function(t){return this.container.unbind(M(t))}},{key:"get",value:function(t){return this.container.get(M(t))}},{key:"getNamed",value:function(t,e){return this.container.getNamed(M(t),E(e))}},{key:"getAll",value:function(t){return this.container.getAll(M(t))}},{key:"getAllNamed",value:function(t,e){return this.container.getAllNamed(M(t),E(e))}},{key:"isBound",value:function(t){return this.container.isBound(M(t))}},{key:"isBoundNamed",value:function(t,e){return this.container.isBoundNamed(M(t),E(e))}},{key:"createChild",value:function(){var e=new t(this.container.createChild());return e.parent=this,e}},{key:"register",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};a.isInjectOption(t)?C.resolveOption(this,t):C.resolveTarget(this,t,e)}},{key:"resolveContext",value:function(){return{container:this}}}],[{key:"config",value:function(t){C.globalConfig=t}}]),t}(),R=new I(w),k=R.register.bind(R),D=o.defineToken("ContributionProvider"),j=function(){function t(e,n,r){h(this,t),this.option={recursive:!1,cache:!0},this.services=void 0,this.serviceIdentifier=void 0,this.container=void 0,this.container=n,this.serviceIdentifier=e,r&&(this.option=c(c({},this.option),r))}return p(t,[{key:"setServices",value:function(t){for(var e=[],n=this.container;n;){if(n.isBound(this.serviceIdentifier)){var r=n.getAll(this.serviceIdentifier);e.push.apply(e,y(r))}n=t?n.parent:void 0}return e}},{key:"getContributions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=c(c({},this.option),t),n=e.cache,r=e.recursive;return n&&void 0!==this.services||(this.services=this.setServices(!!r)),this.services}}]),t}();function B(t,e){return{token:{token:D,named:t},useDynamic:function(n){return new j(t,n.container,e)},lifecycle:o.Lifecycle.singleton}}function L(t,e,n){t({token:{token:D,named:e},useDynamic:function(t){return new j(e,t.container,n)},lifecycle:o.Lifecycle.singleton})}var F=function(){function t(e){h(this,t),this.id=void 0,this.baseRegistry=void 0,this.optionCollection=void 0,t.moduleId+=1,this.id=t.moduleId,this.baseRegistry=e}return p(t,[{key:"registry",get:function(){var t=this;return function(e,n){t.baseRegistry&&t.baseRegistry(e,n),t.optionCollection&&t.optionCollection.forEach((function(t){return e(t)}))}}},{key:"options",get:function(){return this.optionCollection||(this.optionCollection=[]),this.optionCollection}},{key:"register",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.forEach((function(e){return t.options.push(e)})),this}},{key:"contribution",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.forEach((function(e){return t.options.push(B(e))})),this}}]),t}();function G(t){return new F(t)}F.moduleId=0;var V,U=function(t){return function(e,n,r){S(t)(e,n,r),P(D)(e,n,r)}};!function(t){t.Provider=D,t.register=L}(V||(V={}))}.call(this,n(15),n(26))},function(t,e,n){"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]},function(t,e,n){"use strict";e.__esModule=!0,e.Tapable=n(53),e.SyncHook=n(57),e.SyncBailHook=n(22),e.SyncWaterfallHook=n(58),e.SyncLoopHook=n(59),e.AsyncParallelHook=n(60),e.AsyncParallelBailHook=n(61),e.AsyncSeriesHook=n(62),e.AsyncSeriesBailHook=n(63),e.AsyncSeriesWaterfallHook=n(64),e.HookMap=n(65),e.MultiHook=n(66)},function(t,e,n){"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"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;var r=n(1),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},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.multiBindToService=e.getServiceIdentifierAsString=e.typeConstraint=e.namedConstraint=e.taggedConstraint=e.traverseAncerstors=e.decorate=e.id=e.MetadataReader=e.postConstruct=e.targetName=e.multiInject=e.unmanaged=e.optional=e.LazyServiceIdentifer=e.inject=e.named=e.tagged=e.injectable=e.ContainerModule=e.AsyncContainerModule=e.TargetTypeEnum=e.BindingTypeEnum=e.BindingScopeEnum=e.Container=e.METADATA_KEY=void 0;var r=n(1);e.METADATA_KEY=r;var i=n(27);Object.defineProperty(e,"Container",{enumerable:!0,get:function(){return i.Container}});var o=n(7);Object.defineProperty(e,"BindingScopeEnum",{enumerable:!0,get:function(){return o.BindingScopeEnum}}),Object.defineProperty(e,"BindingTypeEnum",{enumerable:!0,get:function(){return o.BindingTypeEnum}}),Object.defineProperty(e,"TargetTypeEnum",{enumerable:!0,get:function(){return o.TargetTypeEnum}});var a=n(43);Object.defineProperty(e,"AsyncContainerModule",{enumerable:!0,get:function(){return a.AsyncContainerModule}}),Object.defineProperty(e,"ContainerModule",{enumerable:!0,get:function(){return a.ContainerModule}});var s=n(44);Object.defineProperty(e,"injectable",{enumerable:!0,get:function(){return s.injectable}});var u=n(45);Object.defineProperty(e,"tagged",{enumerable:!0,get:function(){return u.tagged}});var c=n(46);Object.defineProperty(e,"named",{enumerable:!0,get:function(){return c.named}});var l=n(18);Object.defineProperty(e,"inject",{enumerable:!0,get:function(){return l.inject}}),Object.defineProperty(e,"LazyServiceIdentifer",{enumerable:!0,get:function(){return l.LazyServiceIdentifer}});var h=n(47);Object.defineProperty(e,"optional",{enumerable:!0,get:function(){return h.optional}});var f=n(48);Object.defineProperty(e,"unmanaged",{enumerable:!0,get:function(){return f.unmanaged}});var p=n(49);Object.defineProperty(e,"multiInject",{enumerable:!0,get:function(){return p.multiInject}});var d=n(50);Object.defineProperty(e,"targetName",{enumerable:!0,get:function(){return d.targetName}});var y=n(51);Object.defineProperty(e,"postConstruct",{enumerable:!0,get:function(){return y.postConstruct}});var g=n(16);Object.defineProperty(e,"MetadataReader",{enumerable:!0,get:function(){return g.MetadataReader}});var v=n(11);Object.defineProperty(e,"id",{enumerable:!0,get:function(){return v.id}});var m=n(9);Object.defineProperty(e,"decorate",{enumerable:!0,get:function(){return m.decorate}});var b=n(21);Object.defineProperty(e,"traverseAncerstors",{enumerable:!0,get:function(){return b.traverseAncerstors}}),Object.defineProperty(e,"taggedConstraint",{enumerable:!0,get:function(){return b.taggedConstraint}}),Object.defineProperty(e,"namedConstraint",{enumerable:!0,get:function(){return b.namedConstraint}}),Object.defineProperty(e,"typeConstraint",{enumerable:!0,get:function(){return b.typeConstraint}});var T=n(12);Object.defineProperty(e,"getServiceIdentifierAsString",{enumerable:!0,get:function(){return T.getServiceIdentifierAsString}});var E=n(52);Object.defineProperty(e,"multiBindToService",{enumerable:!0,get:function(){return E.multiBindToService}})},function(t,e,n){"use strict";class r{constructor(t){Array.isArray(t)||(t=[]),this._args=t,this.taps=[],this.interceptors=[],this.call=this._call,this.promise=this._promise,this.callAsync=this._callAsync,this._x=void 0}compile(t){throw new Error("Abstract: should be overriden")}_createCall(t){return this.compile({taps:this.taps,interceptors:this.interceptors,args:this._args,type:t})}tap(t,e){if("string"==typeof t&&(t={name:t}),"object"!=typeof t||null===t)throw new Error("Invalid arguments to tap(options: Object, fn: function)");if("string"!=typeof(t=Object.assign({type:"sync",fn:e},t)).name||""===t.name)throw new Error("Missing name for tap");t=this._runRegisterInterceptors(t),this._insert(t)}tapAsync(t,e){if("string"==typeof t&&(t={name:t}),"object"!=typeof t||null===t)throw new Error("Invalid arguments to tapAsync(options: Object, fn: function)");if("string"!=typeof(t=Object.assign({type:"async",fn:e},t)).name||""===t.name)throw new Error("Missing name for tapAsync");t=this._runRegisterInterceptors(t),this._insert(t)}tapPromise(t,e){if("string"==typeof t&&(t={name:t}),"object"!=typeof t||null===t)throw new Error("Invalid arguments to tapPromise(options: Object, fn: function)");if("string"!=typeof(t=Object.assign({type:"promise",fn:e},t)).name||""===t.name)throw new Error("Missing name for tapPromise");t=this._runRegisterInterceptors(t),this._insert(t)}_runRegisterInterceptors(t){for(const e of this.interceptors)if(e.register){const n=e.register(t);void 0!==n&&(t=n)}return t}withOptions(t){const e=e=>Object.assign({},t,"string"==typeof e?{name:e}:e);t=Object.assign({},t,this._withOptions);const n=this._withOptionsBase||this,r=Object.create(n);return r.tapAsync=(t,r)=>n.tapAsync(e(t),r),r.tap=(t,r)=>n.tap(e(t),r),r.tapPromise=(t,r)=>n.tapPromise(e(t),r),r._withOptions=t,r._withOptionsBase=n,r}isUsed(){return this.taps.length>0||this.interceptors.length>0}intercept(t){if(this._resetCompilation(),this.interceptors.push(Object.assign({},t)),t.register)for(let e=0;e<this.taps.length;e++)this.taps[e]=t.register(this.taps[e])}_resetCompilation(){this.call=this._call,this.callAsync=this._callAsync,this.promise=this._promise}_insert(t){let e;this._resetCompilation(),"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let n=0;"number"==typeof t.stage&&(n=t.stage);let r=this.taps.length;for(;r>0;){r--;const t=this.taps[r];this.taps[r+1]=t;const i=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(i>n)){r++;break}}this.taps[r]=t}}function i(t,e){return function(...n){return this[t]=this._createCall(e),this[t](...n)}}Object.defineProperties(r.prototype,{_call:{value:i("call","sync"),configurable:!0,writable:!0},_promise:{value:i("promise","promise"),configurable:!0,writable:!0},_callAsync:{value:i("callAsync","async"),configurable:!0,writable:!0}}),t.exports=r},function(t,e,n){"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"}},function(t,e,n){"use strict";t.exports=class{constructor(t){this.config=t,this.options=void 0,this._args=void 0}create(t){let e;switch(this.init(t),this.options.type){case"sync":e=new Function(this.args(),'"use strict";\n'+this.header()+this.content({onError:t=>`throw ${t};\n`,onResult:t=>`return ${t};\n`,resultReturns:!0,onDone:()=>"",rethrowIfPossible:!0}));break;case"async":e=new Function(this.args({after:"_callback"}),'"use strict";\n'+this.header()+this.content({onError:t=>`_callback(${t});\n`,onResult:t=>`_callback(null, ${t});\n`,onDone:()=>"_callback();\n"}));break;case"promise":let t=!1;const n=this.content({onError:e=>(t=!0,`_error(${e});\n`),onResult:t=>`_resolve(${t});\n`,onDone:()=>"_resolve();\n"});let r="";r+='"use strict";\n',r+="return new Promise((_resolve, _reject) => {\n",t&&(r+="var _sync = true;\n",r+="function _error(_err) {\n",r+="if(_sync)\n",r+="_resolve(Promise.resolve().then(() => { throw _err; }));\n",r+="else\n",r+="_reject(_err);\n",r+="};\n"),r+=this.header(),r+=n,t&&(r+="_sync = false;\n"),r+="});\n",e=new Function(this.args(),r)}return this.deinit(),e}setup(t,e){t._x=e.taps.map(t=>t.fn)}init(t){this.options=t,this._args=t.args.slice()}deinit(){this.options=void 0,this._args=void 0}header(){let t="";this.needContext()?t+="var _context = {};\n":t+="var _context;\n",t+="var _x = this._x;\n",this.options.interceptors.length>0&&(t+="var _taps = this.taps;\n",t+="var _interceptors = this.interceptors;\n");for(let e=0;e<this.options.interceptors.length;e++){const n=this.options.interceptors[e];n.call&&(t+=`${this.getInterceptor(e)}.call(${this.args({before:n.context?"_context":void 0})});\n`)}return t}needContext(){for(const t of this.options.taps)if(t.context)return!0;return!1}callTap(t,{onError:e,onResult:n,onDone:r,rethrowIfPossible:i}){let o="",a=!1;for(let e=0;e<this.options.interceptors.length;e++){const n=this.options.interceptors[e];n.tap&&(a||(o+=`var _tap${t} = ${this.getTap(t)};\n`,a=!0),o+=`${this.getInterceptor(e)}.tap(${n.context?"_context, ":""}_tap${t});\n`)}o+=`var _fn${t} = ${this.getTapFn(t)};\n`;const s=this.options.taps[t];switch(s.type){case"sync":i||(o+=`var _hasError${t} = false;\n`,o+="try {\n"),o+=n?`var _result${t} = _fn${t}(${this.args({before:s.context?"_context":void 0})});\n`:`_fn${t}(${this.args({before:s.context?"_context":void 0})});\n`,i||(o+="} catch(_err) {\n",o+=`_hasError${t} = true;\n`,o+=e("_err"),o+="}\n",o+=`if(!_hasError${t}) {\n`),n&&(o+=n("_result"+t)),r&&(o+=r()),i||(o+="}\n");break;case"async":let a="";a+=n?`(_err${t}, _result${t}) => {\n`:`_err${t} => {\n`,a+=`if(_err${t}) {\n`,a+=e("_err"+t),a+="} else {\n",n&&(a+=n("_result"+t)),r&&(a+=r()),a+="}\n",a+="}",o+=`_fn${t}(${this.args({before:s.context?"_context":void 0,after:a})});\n`;break;case"promise":o+=`var _hasResult${t} = false;\n`,o+=`var _promise${t} = _fn${t}(${this.args({before:s.context?"_context":void 0})});\n`,o+=`if (!_promise${t} || !_promise${t}.then)\n`,o+=` throw new Error('Tap function (tapPromise) did not return promise (returned ' + _promise${t} + ')');\n`,o+=`_promise${t}.then(_result${t} => {\n`,o+=`_hasResult${t} = true;\n`,n&&(o+=n("_result"+t)),r&&(o+=r()),o+=`}, _err${t} => {\n`,o+=`if(_hasResult${t}) throw _err${t};\n`,o+=e("_err"+t),o+="});\n"}return o}callTapsSeries({onError:t,onResult:e,resultReturns:n,onDone:r,doneReturns:i,rethrowIfPossible:o}){if(0===this.options.taps.length)return r();const a=this.options.taps.findIndex(t=>"sync"!==t.type),s=n||i||!1;let u="",c=r;for(let n=this.options.taps.length-1;n>=0;n--){const i=n;c!==r&&"sync"!==this.options.taps[i].type&&(u+=`function _next${i}() {\n`,u+=c(),u+="}\n",c=()=>`${s?"return ":""}_next${i}();\n`);const l=c,h=t=>t?"":r(),f=this.callTap(i,{onError:e=>t(i,e,l,h),onResult:e&&(t=>e(i,t,l,h)),onDone:!e&&l,rethrowIfPossible:o&&(a<0||i<a)});c=()=>f}return u+=c(),u}callTapsLooping({onError:t,onDone:e,rethrowIfPossible:n}){if(0===this.options.taps.length)return e();const r=this.options.taps.every(t=>"sync"===t.type);let i="";r||(i+="var _looper = () => {\n",i+="var _loopAsync = false;\n"),i+="var _loop;\n",i+="do {\n",i+="_loop = false;\n";for(let t=0;t<this.options.interceptors.length;t++){const e=this.options.interceptors[t];e.loop&&(i+=`${this.getInterceptor(t)}.loop(${this.args({before:e.context?"_context":void 0})});\n`)}return i+=this.callTapsSeries({onError:t,onResult:(t,e,n,i)=>{let o="";return o+=`if(${e} !== undefined) {\n`,o+="_loop = true;\n",r||(o+="if(_loopAsync) _looper();\n"),o+=i(!0),o+="} else {\n",o+=n(),o+="}\n",o},onDone:e&&(()=>{let t="";return t+="if(!_loop) {\n",t+=e(),t+="}\n",t}),rethrowIfPossible:n&&r}),i+="} while(_loop);\n",r||(i+="_loopAsync = true;\n",i+="};\n",i+="_looper();\n"),i}callTapsParallel({onError:t,onResult:e,onDone:n,rethrowIfPossible:r,onTap:i=((t,e)=>e())}){if(this.options.taps.length<=1)return this.callTapsSeries({onError:t,onResult:e,onDone:n,rethrowIfPossible:r});let o="";o+="do {\n",o+=`var _counter = ${this.options.taps.length};\n`,n&&(o+="var _done = () => {\n",o+=n(),o+="};\n");for(let a=0;a<this.options.taps.length;a++){const s=()=>n?"if(--_counter === 0) _done();\n":"--_counter;",u=t=>t||!n?"_counter = 0;\n":"_counter = 0;\n_done();\n";o+="if(_counter <= 0) break;\n",o+=i(a,()=>this.callTap(a,{onError:e=>{let n="";return n+="if(_counter > 0) {\n",n+=t(a,e,s,u),n+="}\n",n},onResult:e&&(t=>{let n="";return n+="if(_counter > 0) {\n",n+=e(a,t,s,u),n+="}\n",n}),onDone:!e&&(()=>s()),rethrowIfPossible:r}),s,u)}return o+="} while(false);\n",o}args({before:t,after:e}={}){let n=this._args;return t&&(n=[t].concat(n)),e&&(n=n.concat(e)),0===n.length?"":n.join(", ")}getTapFn(t){return`_x[${t}]`}getTap(t){return`_taps[${t}]`}getInterceptor(t){return`_interceptors[${t}]`}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tagProperty=e.tagParameter=e.decorate=void 0;var r=n(3),i=n(1);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 l=0,h=c;l<h.length;l++){var f=h[l];if(f.key===i.key)throw new Error(r.DUPLICATED_METADATA+" "+f.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)}},function(t,e,n){"use strict";var r=Object.prototype.hasOwnProperty,i="~";function o(){}function a(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function s(t,e,n,r,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new a(n,r||t,o),u=i?i+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],s]:t._events[u].push(s):(t._events[u]=s,t._eventsCount++),t}function u(t,e){0==--t._eventsCount?t._events=new o:delete t._events[e]}function c(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(i=!1)),c.prototype.eventNames=function(){var t,e,n=[];if(0===this._eventsCount)return n;for(e in t=this._events)r.call(t,e)&&n.push(i?e.slice(1):e);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},c.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,o=n.length,a=new Array(o);r<o;r++)a[r]=n[r].fn;return a},c.prototype.listenerCount=function(t){var e=i?i+t:t,n=this._events[e];return n?n.fn?1:n.length:0},c.prototype.emit=function(t,e,n,r,o,a){var s=i?i+t:t;if(!this._events[s])return!1;var u,c,l=this._events[s],h=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),h){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,n),!0;case 4:return l.fn.call(l.context,e,n,r),!0;case 5:return l.fn.call(l.context,e,n,r,o),!0;case 6:return l.fn.call(l.context,e,n,r,o,a),!0}for(c=1,u=new Array(h-1);c<h;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var f,p=l.length;for(c=0;c<p;c++)switch(l[c].once&&this.removeListener(t,l[c].fn,void 0,!0),h){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,e);break;case 3:l[c].fn.call(l[c].context,e,n);break;case 4:l[c].fn.call(l[c].context,e,n,r);break;default:if(!u)for(f=1,u=new Array(h-1);f<h;f++)u[f-1]=arguments[f];l[c].fn.apply(l[c].context,u)}}return!0},c.prototype.on=function(t,e,n){return s(this,t,e,n,!1)},c.prototype.once=function(t,e,n){return s(this,t,e,n,!0)},c.prototype.removeListener=function(t,e,n,r){var o=i?i+t:t;if(!this._events[o])return this;if(!e)return u(this,o),this;var a=this._events[o];if(a.fn)a.fn!==e||r&&!a.once||n&&a.context!==n||u(this,o);else{for(var s=0,c=[],l=a.length;s<l;s++)(a[s].fn!==e||r&&!a[s].once||n&&a[s].context!==n)&&c.push(a[s]);c.length?this._events[o]=1===c.length?c[0]:c:u(this,o)}return this},c.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&u(this,e)):(this._events=new o,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=i,c.EventEmitter=c,t.exports=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.id=void 0;var r=0;e.id=function(){return r++}},function(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(3);function i(t){return"function"==typeof t?t.name:"symbol"==typeof t?t.toString():t}function o(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=o(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(function t(e,n){return null!==e.parentRequest&&(e.parentRequest.serviceIdentifier===n||t(e.parentRequest,n))}(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=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingOnSyntax=void 0;var r=n(14),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},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenSyntax=void 0;var r=n(13),i=n(21),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},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var u,c=[],l=!1,h=-1;function f(){l&&u&&(l=!1,u.length?c=u.concat(c):h=-1,c.length&&p())}function p(){if(!l){var t=s(f);l=!0;for(var e=c.length;e;){for(u=c,c=[];++h<e;)u&&u[h].run();h=-1,e=c.length}u=null,l=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function y(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new d(t,e)),1!==c.length||l||s(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=y,i.addListener=y,i.once=y,i.off=y,i.removeListener=y,i.removeAllListeners=y,i.emit=y,i.prependListener=y,i.prependOnceListener=y,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MetadataReader=void 0;var r=n(1),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},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isStackOverflowExeption=void 0;var r=n(3);e.isStackOverflowExeption=function(t){return t instanceof RangeError||t.message===r.STACK_OVERFLOW}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.inject=e.LazyServiceIdentifer=void 0;var r=n(3),i=n(1),o=n(4),a=n(9),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)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Target=void 0;var r=n(1),i=n(11),o=n(4),a=n(34),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},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenOnSyntax=void 0;var r=n(13),i=n(14),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},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.typeConstraint=e.namedConstraint=e.taggedConstraint=e.traverseAncerstors=void 0;var r=n(1),i=n(4),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}}},function(t,e,n){"use strict";const r=n(6),i=n(8);const o=new class extends i{content({onError:t,onResult:e,resultReturns:n,onDone:r,rethrowIfPossible:i}){return this.callTapsSeries({onError:(e,n)=>t(n),onResult:(t,n,r)=>`if(${n} !== undefined) {\n${e(n)};\n} else {\n${r()}}\n`,resultReturns:n,onDone:r,rethrowIfPossible:i})}};t.exports=class extends r{tapAsync(){throw new Error("tapAsync is not supported on a SyncBailHook")}tapPromise(){throw new Error("tapPromise is not supported on a SyncBailHook")}compile(t){return o.setup(this,t),o.create(t)}}},,,,function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},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=a.trys,(i=i.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(28),s=n(3),u=n(7),c=n(1),l=n(16),h=n(29),f=n(36),p=n(38),d=n(11),y=n(12),g=n(41),v=n(42),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=d.id(),this._bindingDictionary=new v.Lookup,this._snapshots=[],this._middleware=null,this.parent=null,this._metadataReader=new l.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 h.getBindingDictionary(t)})),u=h.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 p.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+" "+y.getServiceIdentifierAsString(t))}},t.prototype.unbindAll=function(){this._bindingDictionary=new v.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=h.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=h.plan(t._metadataReader,t,e.isMultiInject,e.targetType,e.serviceIdentifier,e.key,e.value,e.avoidConstraints);return n=e.contextInterceptor(n),f.resolve(n)}},t}();e.Container=m},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Binding=void 0;var r=n(7),i=n(11),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},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getBindingDictionary=e.createMockRequest=e.plan=void 0;var r=n(30),i=n(3),o=n(7),a=n(1),s=n(17),u=n(12),c=n(31),l=n(4),h=n(32),f=n(33),p=n(35),d=n(19);function y(t){return t._bindingDictionary}function g(t,e,n,o,a){var s=v(n.container,a.serviceIdentifier),c=[];return s.length===r.BindingCount.NoBindingsAvailable&&n.container.options.autoBindInjectable&&"function"==typeof a.serviceIdentifier&&t.getConstructorMetadata(a.serviceIdentifier).compilerGeneratedMetadata&&(n.container.bind(a.serviceIdentifier).toSelf(),s=v(n.container,a.serviceIdentifier)),c=e?s:s.filter((function(t){var e=new p.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,v),new Error(s);case r.BindingCount.OnlyOneBindingAvailable:if(!n.isArray())return e;case r.BindingCount.MultipleBindingsAvailable:default:if(n.isArray())return e;a=u.getServiceIdentifierAsString(t),s=i.AMBIGUOUS_MATCH+" "+a;throw s+=u.listRegisteredBindingsForServiceIdentifier(o,a,v),new Error(s)}}(a.serviceIdentifier,c,a,n.container),c}function v(t,e){var n=[],r=y(t);return r.hasKey(e)?n=r.get(e):null!==t.parent&&(n=v(t.parent,e)),n}e.getBindingDictionary=y,e.plan=function(t,e,n,r,y,v,m,b){void 0===b&&(b=!1);var T=new c.Context(e),E=function(t,e,n,r,i,o){var s=t?a.MULTI_INJECT_TAG:a.INJECT_TAG,u=new l.Metadata(s,n),c=new d.Target(e,r,n,u);if(void 0!==i){var h=new l.Metadata(i,o);c.metadata.push(h)}return c}(n,r,y,"",v,m);try{return function t(e,n,r,a,s,u){var c,l;if(null===s){c=g(e,n,a,null,u),l=new p.Request(r,a,null,c,u);var d=new h.Plan(a,l);a.addPlan(d)}else c=g(e,n,a,s,u),l=s.addChildRequest(u.serviceIdentifier,c,u);c.forEach((function(n){var r=null;if(u.isArray())r=l.addChildRequest(n.serviceIdentifier,n,u);else{if(n.cache)return;r=l}if(n.type===o.BindingTypeEnum.Instance&&null!==n.implementationType){var s=f.getDependencies(e,n.implementationType);if(!a.container.options.skipBaseClassChecks){var c=f.getBaseClassDependencyCount(e,n.implementationType);if(s.length<c){var h=i.ARGUMENTS_LENGTH_MISMATCH(f.getFunctionName(n.implementationType));throw new Error(h)}}s.forEach((function(n){t(e,!1,n.serviceIdentifier,a,r,n)}))}}))}(t,b,y,T,null,E),T}catch(t){throw s.isStackOverflowExeption(t)&&T.plan&&u.circularDependencyToException(T.plan.rootRequest),t}},e.createMockRequest=function(t,e,n,r){var i=new d.Target(o.TargetTypeEnum.Variable,"",e,new l.Metadata(n,r)),a=new c.Context(t);return new p.Request(e,a,null,[],i)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingCount=void 0;e.BindingCount={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Context=void 0;var r=n(11),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},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Plan=void 0;var r=function(t,e){this.parentContext=t,this.rootRequest=e};e.Plan=r},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(18),o=n(3),a=n(7),s=n(1),u=n(12);Object.defineProperty(e,"getFunctionName",{enumerable:!0,get:function(){return u.getFunctionName}});var c=n(19);function l(t,e,n,i){var s=t.getConstructorMetadata(n),u=s.compilerGeneratedMetadata;if(void 0===u){var l=o.MISSING_INJECTABLE_ANNOTATION+" "+e+".";throw new Error(l)}var p=s.userGeneratedMetadata,d=Object.keys(p),y=0===n.length&&d.length>0,g=d.length>n.length,v=function(t,e,n,r,i){for(var o=[],a=0;a<i;a++){var s=h(a,t,e,n,r);null!==s&&o.push(s)}return o}(i,e,u,p,y||g?d.length:n.length),m=function t(e,n){for(var i=e.getPropertiesMetadata(n),o=[],s=Object.keys(i),u=0,l=s;u<l.length;u++){var h=l[u],p=i[h],d=f(i[h]),y=d.targetName||h,g=d.inject||d.multiInject,v=new c.Target(a.TargetTypeEnum.ClassProperty,y,g);v.metadata=p,o.push(v)}var m=Object.getPrototypeOf(n.prototype).constructor;if(m!==Object){var b=t(e,m);o=r(r([],o),b)}return o}(t,n);return r(r([],v),m)}function h(t,e,n,r,s){var u=s[t.toString()]||[],l=f(u),h=!0!==l.unmanaged,p=r[t],d=l.inject||l.multiInject;if((p=d||p)instanceof i.LazyServiceIdentifer&&(p=p.unwrap()),h){if(!e&&(p===Object||p===Function||void 0===p)){var y=o.MISSING_INJECT_ANNOTATION+" argument "+t+" in class "+n+".";throw new Error(y)}var g=new c.Target(a.TargetTypeEnum.ConstructorArgument,l.targetName,p);return g.metadata=u,g}return null}function f(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 l(t,u.getFunctionName(e),e,!1)},e.getBaseClassDependencyCount=function t(e,n){var r=Object.getPrototypeOf(n.prototype).constructor;if(r!==Object){var i=l(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}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QueryableString=void 0;var r=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=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Request=void 0;var r=n(11),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},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.resolve=void 0;var r=n(3),i=n(7),o=n(17),a=n(12),s=n(37),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,l=e.target&&e.target.isArray(),h=!(e.parentRequest&&e.parentRequest.target&&e.target&&e.parentRequest.target.matchesArray(e.target.serviceIdentifier));if(l&&h)return o.map((function(e){return c(t)(e)}));var f=null;if(!e.target.isOptional()||0!==n.length){var p=n[0],d=p.scope===i.BindingScopeEnum.Singleton,y=p.scope===i.BindingScopeEnum.Request;if(d&&p.activated)return p.cache;if(y&&null!==t&&t.has(p.id))return t.get(p.id);if(p.type===i.BindingTypeEnum.ConstantValue)f=p.cache,p.activated=!0;else if(p.type===i.BindingTypeEnum.Function)f=p.cache,p.activated=!0;else if(p.type===i.BindingTypeEnum.Constructor)f=p.implementationType;else if(p.type===i.BindingTypeEnum.DynamicValue&&null!==p.dynamicValue)f=u("toDynamicValue",p.serviceIdentifier,(function(){return p.dynamicValue(e.parentContext)}));else if(p.type===i.BindingTypeEnum.Factory&&null!==p.factory)f=u("toFactory",p.serviceIdentifier,(function(){return p.factory(e.parentContext)}));else if(p.type===i.BindingTypeEnum.Provider&&null!==p.provider)f=u("toProvider",p.serviceIdentifier,(function(){return p.provider(e.parentContext)}));else{if(p.type!==i.BindingTypeEnum.Instance||null===p.implementationType){var g=a.getServiceIdentifierAsString(e.serviceIdentifier);throw new Error(r.INVALID_BINDING_TYPE+" "+g)}f=s.resolveInstance(p.implementationType,o,c(t))}return"function"==typeof p.onActivation&&(f=p.onActivation(e.parentContext,f)),d&&(p.cache=f,p.activated=!0),y&&null!==t&&!t.has(p.id)&&t.set(p.id,f),f}}};e.resolve=function(t){return c(t.plan.rootRequest.requestScope)(t.plan.rootRequest)}},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(3),o=n(7),a=n(1);e.resolveInstance=function(t,e,n){var s,u,c=null;if(e.length>0){var l=e.filter((function(t){return null!==t.target&&t.target.type===o.TargetTypeEnum.ConstructorArgument})).map(n);u=l,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)}else 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}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingToSyntax=void 0;var r=n(3),i=n(7),o=n(39),a=n(20),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},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInWhenOnSyntax=void 0;var r=n(40),i=n(13),o=n(14),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},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInSyntax=void 0;var r=n(7),i=n(20),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},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContainerSnapshot=void 0;var r=function(){function t(){}return t.of=function(e,n){var r=new t;return r.bindings=e,r.middleware=n,r},t}();e.ContainerSnapshot=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Lookup=void 0;var r=n(3),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},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AsyncContainerModule=e.ContainerModule=void 0;var r=n(11),i=function(t){this.id=r.id(),this.registry=t};e.ContainerModule=i;var o=function(t){this.id=r.id(),this.registry=t};e.AsyncContainerModule=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.injectable=void 0;var r=n(3),i=n(1);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}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tagged=void 0;var r=n(4),i=n(9);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)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.named=void 0;var r=n(1),i=n(4),o=n(9);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)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.optional=void 0;var r=n(1),i=n(4),o=n(9);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)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.unmanaged=void 0;var r=n(1),i=n(4),o=n(9);e.unmanaged=function(){return function(t,e,n){var a=new i.Metadata(r.UNMANAGED_TAG,!0);o.tagParameter(t,e,n,a)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.multiInject=void 0;var r=n(1),i=n(4),o=n(9);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)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.targetName=void 0;var r=n(1),i=n(4),o=n(9);e.targetName=function(t){return function(e,n,a){var s=new i.Metadata(r.NAME_TAG,t);o.tagParameter(e,n,a,s)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.postConstruct=void 0;var r=n(3),i=n(1),o=n(4);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)}}},function(t,e,n){"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)}))}}}},function(t,e,n){"use strict";const r=n(54),i=n(22);function o(){this._pluginCompat=new i(["options"]),this._pluginCompat.tap({name:"Tapable camelCase",stage:100},t=>{t.names.add(t.name.replace(/[- ]([a-z])/g,(t,e)=>e.toUpperCase()))}),this._pluginCompat.tap({name:"Tapable this.hooks",stage:200},t=>{let e;for(const n of t.names)if(e=this.hooks[n],void 0!==e)break;if(void 0!==e){const n={name:t.fn.name||"unnamed compat plugin",stage:t.stage||0};return t.async?e.tapAsync(n,t.fn):e.tap(n,t.fn),!0}})}t.exports=o,o.addCompatLayer=function(t){o.call(t),t.plugin=o.prototype.plugin,t.apply=o.prototype.apply},o.prototype.plugin=r.deprecate((function(t,e){if(Array.isArray(t))return void t.forEach((function(t){this.plugin(t,e)}),this);if(!this._pluginCompat.call({name:t,fn:e,names:new Set([t])}))throw new Error(`Plugin could not be registered at '${t}'. Hook was not found.\nBREAKING CHANGE: There need to exist a hook at 'this.hooks'. To create a compatibility layer for this hook, hook into 'this._pluginCompat'.`)}),"Tapable.plugin is deprecated. Use new API on `.hooks` instead"),o.prototype.apply=r.deprecate((function(){for(var t=0;t<arguments.length;t++)arguments[t].apply(this)}),"Tapable.apply is deprecated. Call apply on the plugin directly instead")},function(t,e,n){(function(t){var r=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),n={},r=0;r<e.length;r++)n[e[r]]=Object.getOwnPropertyDescriptor(t,e[r]);return n},i=/%[sdj%]/g;e.format=function(t){if(!v(t)){for(var e=[],n=0;n<arguments.length;n++)e.push(s(arguments[n]));return e.join(" ")}n=1;for(var r=arguments,o=r.length,a=String(t).replace(i,(function(t){if("%%"===t)return"%";if(n>=o)return t;switch(t){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return t}})),u=r[n];n<o;u=r[++n])y(u)||!T(u)?a+=" "+u:a+=" "+s(u);return a},e.deprecate=function(n,r){if(void 0!==t&&!0===t.noDeprecation)return n;if(void 0===t)return function(){return e.deprecate(n,r).apply(this,arguments)};var i=!1;return function(){if(!i){if(t.throwDeprecation)throw new Error(r);t.traceDeprecation?console.trace(r):console.error(r),i=!0}return n.apply(this,arguments)}};var o,a={};function s(t,n){var r={seen:[],stylize:c};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),d(n)?r.showHidden=n:n&&e._extend(r,n),m(r.showHidden)&&(r.showHidden=!1),m(r.depth)&&(r.depth=2),m(r.colors)&&(r.colors=!1),m(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=u),l(r,t,r.depth)}function u(t,e){var n=s.styles[e];return n?"["+s.colors[n][0]+"m"+t+"["+s.colors[n][1]+"m":t}function c(t,e){return t}function l(t,n,r){if(t.customInspect&&n&&w(n.inspect)&&n.inspect!==e.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,t);return v(i)||(i=l(t,i,r)),i}var o=function(t,e){if(m(e))return t.stylize("undefined","undefined");if(v(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}if(g(e))return t.stylize(""+e,"number");if(d(e))return t.stylize(""+e,"boolean");if(y(e))return t.stylize("null","null")}(t,n);if(o)return o;var a=Object.keys(n),s=function(t){var e={};return t.forEach((function(t,n){e[t]=!0})),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(n)),M(n)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return h(n);if(0===a.length){if(w(n)){var u=n.name?": "+n.name:"";return t.stylize("[Function"+u+"]","special")}if(b(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(E(n))return t.stylize(Date.prototype.toString.call(n),"date");if(M(n))return h(n)}var c,T="",_=!1,x=["{","}"];(p(n)&&(_=!0,x=["[","]"]),w(n))&&(T=" [Function"+(n.name?": "+n.name:"")+"]");return b(n)&&(T=" "+RegExp.prototype.toString.call(n)),E(n)&&(T=" "+Date.prototype.toUTCString.call(n)),M(n)&&(T=" "+h(n)),0!==a.length||_&&0!=n.length?r<0?b(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special"):(t.seen.push(n),c=_?function(t,e,n,r,i){for(var o=[],a=0,s=e.length;a<s;++a)S(e,String(a))?o.push(f(t,e,n,r,String(a),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(f(t,e,n,r,i,!0))})),o}(t,n,r,s,a):a.map((function(e){return f(t,n,r,s,e,_)})),t.seen.pop(),function(t,e,n){if(t.reduce((function(t,e){return e.indexOf("\n")>=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1];return n[0]+e+" "+t.join(", ")+" "+n[1]}(c,T,x)):x[0]+T+x[1]}function h(t){return"["+Error.prototype.toString.call(t)+"]"}function f(t,e,n,r,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(s=t.stylize("[Setter]","special")),S(r,i)||(a="["+i+"]"),s||(t.seen.indexOf(u.value)<0?(s=y(n)?l(t,u.value,null):l(t,u.value,n-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+s.split("\n").map((function(t){return" "+t})).join("\n")):s=t.stylize("[Circular]","special")),m(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function p(t){return Array.isArray(t)}function d(t){return"boolean"==typeof t}function y(t){return null===t}function g(t){return"number"==typeof t}function v(t){return"string"==typeof t}function m(t){return void 0===t}function b(t){return T(t)&&"[object RegExp]"===_(t)}function T(t){return"object"==typeof t&&null!==t}function E(t){return T(t)&&"[object Date]"===_(t)}function M(t){return T(t)&&("[object Error]"===_(t)||t instanceof Error)}function w(t){return"function"==typeof t}function _(t){return Object.prototype.toString.call(t)}function x(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(n){if(m(o)&&(o=t.env.NODE_DEBUG||""),n=n.toUpperCase(),!a[n])if(new RegExp("\\b"+n+"\\b","i").test(o)){var r=t.pid;a[n]=function(){var t=e.format.apply(e,arguments);console.error("%s %d: %s",n,r,t)}}else a[n]=function(){};return a[n]},e.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=p,e.isBoolean=d,e.isNull=y,e.isNullOrUndefined=function(t){return null==t},e.isNumber=g,e.isString=v,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=m,e.isRegExp=b,e.isObject=T,e.isDate=E,e.isError=M,e.isFunction=w,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=n(55);var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function P(){var t=new Date,e=[x(t.getHours()),x(t.getMinutes()),x(t.getSeconds())].join(":");return[t.getDate(),A[t.getMonth()],e].join(" ")}function S(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",P(),e.format.apply(e,arguments))},e.inherits=n(56),e._extend=function(t,e){if(!e||!T(e))return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t};var O="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function N(t,e){if(!t){var n=new Error("Promise was rejected with a falsy value");n.reason=t,t=n}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(O&&t[O]){var e;if("function"!=typeof(e=t[O]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,O,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,n,r=new Promise((function(t,r){e=t,n=r})),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push((function(t,r){t?n(t):e(r)}));try{t.apply(this,i)}catch(t){n(t)}return r}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),O&&Object.defineProperty(e,O,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,r(t))},e.promisify.custom=O,e.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function n(){for(var n=[],r=0;r<arguments.length;r++)n.push(arguments[r]);var i=n.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var o=this,a=function(){return i.apply(o,arguments)};e.apply(this,n).then((function(e){t.nextTick(a,null,e)}),(function(e){t.nextTick(N,e,a)}))}return Object.setPrototypeOf(n,Object.getPrototypeOf(e)),Object.defineProperties(n,r(e)),n}}).call(this,n(15))},function(t,e){t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},function(t,e,n){"use strict";const r=n(6),i=n(8);const o=new class extends i{content({onError:t,onDone:e,rethrowIfPossible:n}){return this.callTapsSeries({onError:(e,n)=>t(n),onDone:e,rethrowIfPossible:n})}};t.exports=class extends r{tapAsync(){throw new Error("tapAsync is not supported on a SyncHook")}tapPromise(){throw new Error("tapPromise is not supported on a SyncHook")}compile(t){return o.setup(this,t),o.create(t)}}},function(t,e,n){"use strict";const r=n(6),i=n(8);const o=new class extends i{content({onError:t,onResult:e,resultReturns:n,rethrowIfPossible:r}){return this.callTapsSeries({onError:(e,n)=>t(n),onResult:(t,e,n)=>{let r="";return r+=`if(${e} !== undefined) {\n`,r+=`${this._args[0]} = ${e};\n`,r+="}\n",r+=n(),r},onDone:()=>e(this._args[0]),doneReturns:n,rethrowIfPossible:r})}};t.exports=class extends r{constructor(t){if(super(t),t.length<1)throw new Error("Waterfall hooks must have at least one argument")}tapAsync(){throw new Error("tapAsync is not supported on a SyncWaterfallHook")}tapPromise(){throw new Error("tapPromise is not supported on a SyncWaterfallHook")}compile(t){return o.setup(this,t),o.create(t)}}},function(t,e,n){"use strict";const r=n(6),i=n(8);const o=new class extends i{content({onError:t,onDone:e,rethrowIfPossible:n}){return this.callTapsLooping({onError:(e,n)=>t(n),onDone:e,rethrowIfPossible:n})}};t.exports=class extends r{tapAsync(){throw new Error("tapAsync is not supported on a SyncLoopHook")}tapPromise(){throw new Error("tapPromise is not supported on a SyncLoopHook")}compile(t){return o.setup(this,t),o.create(t)}}},function(t,e,n){"use strict";const r=n(6),i=n(8);const o=new class extends i{content({onError:t,onDone:e}){return this.callTapsParallel({onError:(e,n,r,i)=>t(n)+i(!0),onDone:e})}};class a extends r{compile(t){return o.setup(this,t),o.create(t)}}Object.defineProperties(a.prototype,{_call:{value:void 0,configurable:!0,writable:!0}}),t.exports=a},function(t,e,n){"use strict";const r=n(6),i=n(8);const o=new class extends i{content({onError:t,onResult:e,onDone:n}){let r="";return r+=`var _results = new Array(${this.options.taps.length});\n`,r+="var _checkDone = () => {\n",r+="for(var i = 0; i < _results.length; i++) {\n",r+="var item = _results[i];\n",r+="if(item === undefined) return false;\n",r+="if(item.result !== undefined) {\n",r+=e("item.result"),r+="return true;\n",r+="}\n",r+="if(item.error) {\n",r+=t("item.error"),r+="return true;\n",r+="}\n",r+="}\n",r+="return false;\n",r+="}\n",r+=this.callTapsParallel({onError:(t,e,n,r)=>{let i="";return i+=`if(${t} < _results.length && ((_results.length = ${t+1}), (_results[${t}] = { error: ${e} }), _checkDone())) {\n`,i+=r(!0),i+="} else {\n",i+=n(),i+="}\n",i},onResult:(t,e,n,r)=>{let i="";return i+=`if(${t} < _results.length && (${e} !== undefined && (_results.length = ${t+1}), (_results[${t}] = { result: ${e} }), _checkDone())) {\n`,i+=r(!0),i+="} else {\n",i+=n(),i+="}\n",i},onTap:(t,e,n,r)=>{let i="";return t>0&&(i+=`if(${t} >= _results.length) {\n`,i+=n(),i+="} else {\n"),i+=e(),t>0&&(i+="}\n"),i},onDone:n}),r}};class a extends r{compile(t){return o.setup(this,t),o.create(t)}}Object.defineProperties(a.prototype,{_call:{value:void 0,configurable:!0,writable:!0}}),t.exports=a},function(t,e,n){"use strict";const r=n(6),i=n(8);const o=new class extends i{content({onError:t,onDone:e}){return this.callTapsSeries({onError:(e,n,r,i)=>t(n)+i(!0),onDone:e})}};class a extends r{compile(t){return o.setup(this,t),o.create(t)}}Object.defineProperties(a.prototype,{_call:{value:void 0,configurable:!0,writable:!0}}),t.exports=a},function(t,e,n){"use strict";const r=n(6),i=n(8);const o=new class extends i{content({onError:t,onResult:e,resultReturns:n,onDone:r}){return this.callTapsSeries({onError:(e,n,r,i)=>t(n)+i(!0),onResult:(t,n,r)=>`if(${n} !== undefined) {\n${e(n)};\n} else {\n${r()}}\n`,resultReturns:n,onDone:r})}};class a extends r{compile(t){return o.setup(this,t),o.create(t)}}Object.defineProperties(a.prototype,{_call:{value:void 0,configurable:!0,writable:!0}}),t.exports=a},function(t,e,n){"use strict";const r=n(6),i=n(8);const o=new class extends i{content({onError:t,onResult:e,onDone:n}){return this.callTapsSeries({onError:(e,n,r,i)=>t(n)+i(!0),onResult:(t,e,n)=>{let r="";return r+=`if(${e} !== undefined) {\n`,r+=`${this._args[0]} = ${e};\n`,r+="}\n",r+=n(),r},onDone:()=>e(this._args[0])})}};class a extends r{constructor(t){if(super(t),t.length<1)throw new Error("Waterfall hooks must have at least one argument")}compile(t){return o.setup(this,t),o.create(t)}}Object.defineProperties(a.prototype,{_call:{value:void 0,configurable:!0,writable:!0}}),t.exports=a},function(t,e,n){"use strict";t.exports=class{constructor(t){this._map=new Map,this._factory=t,this._interceptors=[]}get(t){return this._map.get(t)}for(t){const e=this.get(t);if(void 0!==e)return e;let n=this._factory(t);const r=this._interceptors;for(let e=0;e<r.length;e++)n=r[e].factory(t,n);return this._map.set(t,n),n}intercept(t){this._interceptors.push(Object.assign({factory:(t,e)=>e},t))}tap(t,e,n){return this.for(t).tap(e,n)}tapAsync(t,e,n){return this.for(t).tapAsync(e,n)}tapPromise(t,e,n){return this.for(t).tapPromise(e,n)}}},function(t,e,n){"use strict";n(6);class r{constructor(t){this.hooks=t}tap(t,e){for(const n of this.hooks)n.tap(t,e)}tapAsync(t,e){for(const n of this.hooks)n.tapAsync(t,e)}tapPromise(t,e){for(const n of this.hooks)n.tapPromise(t,e)}isUsed(){for(const t of this.hooks)if(t.isUsed())return!0;return!1}intercept(t){for(const e of this.hooks)e.intercept(t)}withOptions(t){return new r(this.hooks.map(e=>e.withOptions(t)))}}t.exports=r},function(t,e,n){"use strict";n.r(e),n.d(e,"ManaSyringe",(function(){return c})),n.d(e,"SHAPE",(function(){return ho})),n.d(e,"CanvasConfig",(function(){return vo})),n.d(e,"Geometry",(function(){return Wo})),n.d(e,"Renderable",(function(){return Ho})),n.d(e,"Transform",(function(){return Yo})),n.d(e,"Strategy",(function(){return wo})),n.d(e,"Cullable",(function(){return $o})),n.d(e,"Sortable",(function(){return Xo})),n.d(e,"ElementEvent",(function(){return Ki})),n.d(e,"DELEGATION_SPLITTER",(function(){return Uo})),n.d(e,"EventTarget",(function(){return qo})),n.d(e,"Node",(function(){return zo})),n.d(e,"Element",(function(){return Jo})),n.d(e,"Document",(function(){return Fs})),n.d(e,"FederatedEvent",(function(){return Go})),n.d(e,"FederatedMouseEvent",(function(){return Gs})),n.d(e,"FederatedPointerEvent",(function(){return Vs})),n.d(e,"FederatedWheelEvent",(function(){return Us})),n.d(e,"Animation",(function(){return ta})),n.d(e,"AnimationEvent",(function(){return Zo})),n.d(e,"AnimationEffectTiming",(function(){return qa})),n.d(e,"CustomEvent",(function(){return Vo})),n.d(e,"makeTiming",(function(){return Ja})),n.d(e,"normalizeTimingInput",(function(){return Za})),n.d(e,"numericTimingToObject",(function(){return Qa})),n.d(e,"KeyframeEffect",(function(){return ts})),n.d(e,"normalizeKeyframes",(function(){return za})),n.d(e,"compareAnimations",(function(){return ra})),n.d(e,"AnimationTimeline",(function(){return ia})),n.d(e,"CustomElementRegistry",(function(){return tu})),n.d(e,"AbstractRenderer",(function(){return sl})),n.d(e,"CanvasEvent",(function(){return Sl})),n.d(e,"Canvas",(function(){return Cl})),n.d(e,"DisplayObjectPool",(function(){return M})),n.d(e,"DefaultCamera",(function(){return dl})),n.d(e,"CAMERA_TYPE",(function(){return ll})),n.d(e,"CAMERA_TRACKING_MODE",(function(){return hl})),n.d(e,"CAMERA_PROJECTION_MODE",(function(){return fl})),n.d(e,"CAMERA_EVENT",(function(){return yl})),n.d(e,"Camera",(function(){return ml})),n.d(e,"Landmark",(function(){return pl})),n.d(e,"sortByZIndex",(function(){return lo})),n.d(e,"SceneGraphService",(function(){return fo})),n.d(e,"DefaultSceneGraphService",(function(){return po})),n.d(e,"ContextService",(function(){return ru})),n.d(e,"RENDER_REASON",(function(){return nu})),n.d(e,"RenderingContext",(function(){return iu})),n.d(e,"RenderingPluginContribution",(function(){return au})),n.d(e,"RenderingService",(function(){return su})),n.d(e,"EventService",(function(){return uu})),n.d(e,"SceneGraphSelectorFactory",(function(){return so})),n.d(e,"SceneGraphSelector",(function(){return uo})),n.d(e,"DefaultSceneGraphSelector",(function(){return co})),n.d(e,"OffscreenCanvasCreator",(function(){return _o})),n.d(e,"TextService",(function(){return Oo})),n.d(e,"GeometryUpdaterFactory",(function(){return yo})),n.d(e,"GeometryAABBUpdater",(function(){return go})),n.d(e,"CircleUpdater",(function(){return mo})),n.d(e,"EllipseUpdater",(function(){return bo})),n.d(e,"RectUpdater",(function(){return To})),n.d(e,"TextUpdater",(function(){return No})),n.d(e,"LineUpdater",(function(){return Co})),n.d(e,"PolylineUpdater",(function(){return Io})),n.d(e,"PathUpdater",(function(){return Ro})),n.d(e,"AABB",(function(){return Hi})),n.d(e,"BoundingSphere",(function(){return $i})),n.d(e,"Mask",(function(){return Bi})),n.d(e,"Frustum",(function(){return Ji})),n.d(e,"Plane",(function(){return Xi})),n.d(e,"Ray",(function(){return ro})),n.d(e,"Point",(function(){return io})),n.d(e,"Rectangle",(function(){return oo})),n.d(e,"PolygonShape",(function(){return ao})),n.d(e,"getAngle",(function(){return es})),n.d(e,"createVec3",(function(){return ns})),n.d(e,"deg2rad",(function(){return rs})),n.d(e,"rad2deg",(function(){return is})),n.d(e,"getScaling",(function(){return os})),n.d(e,"getTranslation",(function(){return as})),n.d(e,"getRotationInRadians",(function(){return ss})),n.d(e,"getEuler",(function(){return us})),n.d(e,"fromRotationTranslationScale",(function(){return cs})),n.d(e,"makePerspective",(function(){return ls})),n.d(e,"convertEffectInput",(function(){return Wa})),n.d(e,"equalizeSegments",(function(){return Ps})),n.d(e,"getDrawDirection",(function(){return Ss})),n.d(e,"getPathArea",(function(){return Ns})),n.d(e,"reverseCurve",(function(){return Cs})),n.d(e,"clonePath",(function(){return Is})),n.d(e,"getRotatedCurve",(function(){return Rs})),n.d(e,"convertToPath",(function(){return Ds})),n.d(e,"requestAnimationFrame",(function(){return ea})),n.d(e,"cancelAnimationFrame",(function(){return na})),n.d(e,"toFontString",(function(){return Mo})),n.d(e,"StylePropertyParser",(function(){return ko})),n.d(e,"StylePropertyParserFactory",(function(){return Do})),n.d(e,"StylePropertyUpdater",(function(){return jo})),n.d(e,"StylePropertyUpdaterFactory",(function(){return Bo})),n.d(e,"StylePropertyMerger",(function(){return Lo})),n.d(e,"StylePropertyMergerFactory",(function(){return Fo})),n.d(e,"updateAnchor",(function(){return eu})),n.d(e,"updateGeometry",(function(){return zu})),n.d(e,"updateLocalPosition",(function(){return Wu})),n.d(e,"numberToString",(function(){return Hu})),n.d(e,"parseNumber",(function(){return Yu})),n.d(e,"mergeNumbers",(function(){return $u})),n.d(e,"clampedMergeNumbers",(function(){return Xu})),n.d(e,"mergeNumberLists",(function(){return Ku})),n.d(e,"PARSED_COLOR_TYPE",(function(){return fu})),n.d(e,"parseColor",(function(){return Uu})),n.d(e,"mergeColors",(function(){return qu})),n.d(e,"updateOffsetPath",(function(){return Ju})),n.d(e,"updateOffsetDistance",(function(){return Zu})),n.d(e,"updateClipPath",(function(){return Qu})),n.d(e,"updateZIndex",(function(){return tc})),n.d(e,"updateOrigin",(function(){return lc})),n.d(e,"updateTransformOrigin",(function(){return hc})),n.d(e,"parseTransform",(function(){return bc})),n.d(e,"mergeTransforms",(function(){return Mc})),n.d(e,"updateTransform",(function(){return wc})),n.d(e,"parseDimension",(function(){return rc})),n.d(e,"mergeDimensions",(function(){return ic})),n.d(e,"parseLength",(function(){return oc})),n.d(e,"parseLengthOrPercent",(function(){return ac})),n.d(e,"parseAngle",(function(){return sc})),n.d(e,"convertPercentUnit",(function(){return uc})),n.d(e,"convertAngleUnit",(function(){return cc})),n.d(e,"parsePath",(function(){return Jc})),n.d(e,"mergePaths",(function(){return Qc})),n.d(e,"parsePoints",(function(){return tl})),n.d(e,"parseParam",(function(){return el})),n.d(e,"parseFilter",(function(){return rl})),n.d(e,"parseLineDash",(function(){return il})),n.d(e,"DisplayObject",(function(){return Bs})),n.d(e,"CustomElement",(function(){return qs})),n.d(e,"Circle",(function(){return zs})),n.d(e,"Ellipse",(function(){return Ws})),n.d(e,"Group",(function(){return Ls})),n.d(e,"Image",(function(){return Hs})),n.d(e,"Line",(function(){return Ys})),n.d(e,"Path",(function(){return $s})),n.d(e,"Polygon",(function(){return Xs})),n.d(e,"Polyline",(function(){return Ks})),n.d(e,"Rect",(function(){return Js})),n.d(e,"Text",(function(){return Zs})),n.d(e,"HTML",(function(){return Qs})),n.d(e,"globalContainer",(function(){return ol})),n.d(e,"containerModule",(function(){return al}));var r={};n.r(r),n.d(r,"create",(function(){return J})),n.d(r,"fromMat4",(function(){return Z})),n.d(r,"clone",(function(){return Q})),n.d(r,"copy",(function(){return tt})),n.d(r,"fromValues",(function(){return et})),n.d(r,"set",(function(){return nt})),n.d(r,"identity",(function(){return rt})),n.d(r,"transpose",(function(){return it})),n.d(r,"invert",(function(){return ot})),n.d(r,"adjoint",(function(){return at})),n.d(r,"determinant",(function(){return st})),n.d(r,"multiply",(function(){return ut})),n.d(r,"translate",(function(){return ct})),n.d(r,"rotate",(function(){return lt})),n.d(r,"scale",(function(){return ht})),n.d(r,"fromTranslation",(function(){return ft})),n.d(r,"fromRotation",(function(){return pt})),n.d(r,"fromScaling",(function(){return dt})),n.d(r,"fromMat2d",(function(){return yt})),n.d(r,"fromQuat",(function(){return gt})),n.d(r,"normalFromMat4",(function(){return vt})),n.d(r,"projection",(function(){return mt})),n.d(r,"str",(function(){return bt})),n.d(r,"frob",(function(){return Tt})),n.d(r,"add",(function(){return Et})),n.d(r,"subtract",(function(){return Mt})),n.d(r,"multiplyScalar",(function(){return wt})),n.d(r,"multiplyScalarAndAdd",(function(){return _t})),n.d(r,"exactEquals",(function(){return xt})),n.d(r,"equals",(function(){return At})),n.d(r,"mul",(function(){return Pt})),n.d(r,"sub",(function(){return St}));var i={};n.r(i),n.d(i,"create",(function(){return Ot})),n.d(i,"clone",(function(){return Nt})),n.d(i,"copy",(function(){return Ct})),n.d(i,"fromValues",(function(){return It})),n.d(i,"set",(function(){return Rt})),n.d(i,"identity",(function(){return kt})),n.d(i,"transpose",(function(){return Dt})),n.d(i,"invert",(function(){return jt})),n.d(i,"adjoint",(function(){return Bt})),n.d(i,"determinant",(function(){return Lt})),n.d(i,"multiply",(function(){return Ft})),n.d(i,"translate",(function(){return Gt})),n.d(i,"scale",(function(){return Vt})),n.d(i,"rotate",(function(){return Ut})),n.d(i,"rotateX",(function(){return qt})),n.d(i,"rotateY",(function(){return zt})),n.d(i,"rotateZ",(function(){return Wt})),n.d(i,"fromTranslation",(function(){return Ht})),n.d(i,"fromScaling",(function(){return Yt})),n.d(i,"fromRotation",(function(){return $t})),n.d(i,"fromXRotation",(function(){return Xt})),n.d(i,"fromYRotation",(function(){return Kt})),n.d(i,"fromZRotation",(function(){return Jt})),n.d(i,"fromRotationTranslation",(function(){return Zt})),n.d(i,"fromQuat2",(function(){return Qt})),n.d(i,"getTranslation",(function(){return te})),n.d(i,"getScaling",(function(){return ee})),n.d(i,"getRotation",(function(){return ne})),n.d(i,"fromRotationTranslationScale",(function(){return re})),n.d(i,"fromRotationTranslationScaleOrigin",(function(){return ie})),n.d(i,"fromQuat",(function(){return oe})),n.d(i,"frustum",(function(){return ae})),n.d(i,"perspectiveNO",(function(){return se})),n.d(i,"perspective",(function(){return ue})),n.d(i,"perspectiveZO",(function(){return ce})),n.d(i,"perspectiveFromFieldOfView",(function(){return le})),n.d(i,"orthoNO",(function(){return he})),n.d(i,"ortho",(function(){return fe})),n.d(i,"orthoZO",(function(){return pe})),n.d(i,"lookAt",(function(){return de})),n.d(i,"targetTo",(function(){return ye})),n.d(i,"str",(function(){return ge})),n.d(i,"frob",(function(){return ve})),n.d(i,"add",(function(){return me})),n.d(i,"subtract",(function(){return be})),n.d(i,"multiplyScalar",(function(){return Te})),n.d(i,"multiplyScalarAndAdd",(function(){return Ee})),n.d(i,"exactEquals",(function(){return Me})),n.d(i,"equals",(function(){return we})),n.d(i,"mul",(function(){return _e})),n.d(i,"sub",(function(){return xe}));var o={};n.r(o),n.d(o,"create",(function(){return Ae})),n.d(o,"clone",(function(){return Pe})),n.d(o,"length",(function(){return Se})),n.d(o,"fromValues",(function(){return Oe})),n.d(o,"copy",(function(){return Ne})),n.d(o,"set",(function(){return Ce})),n.d(o,"add",(function(){return Ie})),n.d(o,"subtract",(function(){return Re})),n.d(o,"multiply",(function(){return ke})),n.d(o,"divide",(function(){return De})),n.d(o,"ceil",(function(){return je})),n.d(o,"floor",(function(){return Be})),n.d(o,"min",(function(){return Le})),n.d(o,"max",(function(){return Fe})),n.d(o,"round",(function(){return Ge})),n.d(o,"scale",(function(){return Ve})),n.d(o,"scaleAndAdd",(function(){return Ue})),n.d(o,"distance",(function(){return qe})),n.d(o,"squaredDistance",(function(){return ze})),n.d(o,"squaredLength",(function(){return We})),n.d(o,"negate",(function(){return He})),n.d(o,"inverse",(function(){return Ye})),n.d(o,"normalize",(function(){return $e})),n.d(o,"dot",(function(){return Xe})),n.d(o,"cross",(function(){return Ke})),n.d(o,"lerp",(function(){return Je})),n.d(o,"hermite",(function(){return Ze})),n.d(o,"bezier",(function(){return Qe})),n.d(o,"random",(function(){return tn})),n.d(o,"transformMat4",(function(){return en})),n.d(o,"transformMat3",(function(){return nn})),n.d(o,"transformQuat",(function(){return rn})),n.d(o,"rotateX",(function(){return on})),n.d(o,"rotateY",(function(){return an})),n.d(o,"rotateZ",(function(){return sn})),n.d(o,"angle",(function(){return un})),n.d(o,"zero",(function(){return cn})),n.d(o,"str",(function(){return ln})),n.d(o,"exactEquals",(function(){return hn})),n.d(o,"equals",(function(){return fn})),n.d(o,"sub",(function(){return dn})),n.d(o,"mul",(function(){return yn})),n.d(o,"div",(function(){return gn})),n.d(o,"dist",(function(){return vn})),n.d(o,"sqrDist",(function(){return mn})),n.d(o,"len",(function(){return bn})),n.d(o,"sqrLen",(function(){return Tn})),n.d(o,"forEach",(function(){return En}));var a={};n.r(a),n.d(a,"create",(function(){return Mn})),n.d(a,"clone",(function(){return wn})),n.d(a,"fromValues",(function(){return _n})),n.d(a,"copy",(function(){return xn})),n.d(a,"set",(function(){return An})),n.d(a,"add",(function(){return Pn})),n.d(a,"subtract",(function(){return Sn})),n.d(a,"multiply",(function(){return On})),n.d(a,"divide",(function(){return Nn})),n.d(a,"ceil",(function(){return Cn})),n.d(a,"floor",(function(){return In})),n.d(a,"min",(function(){return Rn})),n.d(a,"max",(function(){return kn})),n.d(a,"round",(function(){return Dn})),n.d(a,"scale",(function(){return jn})),n.d(a,"scaleAndAdd",(function(){return Bn})),n.d(a,"distance",(function(){return Ln})),n.d(a,"squaredDistance",(function(){return Fn})),n.d(a,"length",(function(){return Gn})),n.d(a,"squaredLength",(function(){return Vn})),n.d(a,"negate",(function(){return Un})),n.d(a,"inverse",(function(){return qn})),n.d(a,"normalize",(function(){return zn})),n.d(a,"dot",(function(){return Wn})),n.d(a,"cross",(function(){return Hn})),n.d(a,"lerp",(function(){return Yn})),n.d(a,"random",(function(){return $n})),n.d(a,"transformMat4",(function(){return Xn})),n.d(a,"transformQuat",(function(){return Kn})),n.d(a,"zero",(function(){return Jn})),n.d(a,"str",(function(){return Zn})),n.d(a,"exactEquals",(function(){return Qn})),n.d(a,"equals",(function(){return tr})),n.d(a,"sub",(function(){return er})),n.d(a,"mul",(function(){return nr})),n.d(a,"div",(function(){return rr})),n.d(a,"dist",(function(){return ir})),n.d(a,"sqrDist",(function(){return or})),n.d(a,"len",(function(){return ar})),n.d(a,"sqrLen",(function(){return sr})),n.d(a,"forEach",(function(){return ur}));var s={};n.r(s),n.d(s,"create",(function(){return cr})),n.d(s,"identity",(function(){return lr})),n.d(s,"setAxisAngle",(function(){return hr})),n.d(s,"getAxisAngle",(function(){return fr})),n.d(s,"getAngle",(function(){return pr})),n.d(s,"multiply",(function(){return dr})),n.d(s,"rotateX",(function(){return yr})),n.d(s,"rotateY",(function(){return gr})),n.d(s,"rotateZ",(function(){return vr})),n.d(s,"calculateW",(function(){return mr})),n.d(s,"exp",(function(){return br})),n.d(s,"ln",(function(){return Tr})),n.d(s,"pow",(function(){return Er})),n.d(s,"slerp",(function(){return Mr})),n.d(s,"random",(function(){return wr})),n.d(s,"invert",(function(){return _r})),n.d(s,"conjugate",(function(){return xr})),n.d(s,"fromMat3",(function(){return Ar})),n.d(s,"fromEuler",(function(){return Pr})),n.d(s,"str",(function(){return Sr})),n.d(s,"clone",(function(){return Dr})),n.d(s,"fromValues",(function(){return jr})),n.d(s,"copy",(function(){return Br})),n.d(s,"set",(function(){return Lr})),n.d(s,"add",(function(){return Fr})),n.d(s,"mul",(function(){return Gr})),n.d(s,"scale",(function(){return Vr})),n.d(s,"dot",(function(){return Ur})),n.d(s,"lerp",(function(){return qr})),n.d(s,"length",(function(){return zr})),n.d(s,"len",(function(){return Wr})),n.d(s,"squaredLength",(function(){return Hr})),n.d(s,"sqrLen",(function(){return Yr})),n.d(s,"normalize",(function(){return $r})),n.d(s,"exactEquals",(function(){return Xr})),n.d(s,"equals",(function(){return Kr})),n.d(s,"rotationTo",(function(){return Jr})),n.d(s,"sqlerp",(function(){return Zr})),n.d(s,"setAxes",(function(){return Qr}));var u={};n.r(u),n.d(u,"create",(function(){return ti})),n.d(u,"clone",(function(){return ei})),n.d(u,"fromValues",(function(){return ni})),n.d(u,"copy",(function(){return ri})),n.d(u,"set",(function(){return ii})),n.d(u,"add",(function(){return oi})),n.d(u,"subtract",(function(){return ai})),n.d(u,"multiply",(function(){return si})),n.d(u,"divide",(function(){return ui})),n.d(u,"ceil",(function(){return ci})),n.d(u,"floor",(function(){return li})),n.d(u,"min",(function(){return hi})),n.d(u,"max",(function(){return fi})),n.d(u,"round",(function(){return pi})),n.d(u,"scale",(function(){return di})),n.d(u,"scaleAndAdd",(function(){return yi})),n.d(u,"distance",(function(){return gi})),n.d(u,"squaredDistance",(function(){return vi})),n.d(u,"length",(function(){return mi})),n.d(u,"squaredLength",(function(){return bi})),n.d(u,"negate",(function(){return Ti})),n.d(u,"inverse",(function(){return Ei})),n.d(u,"normalize",(function(){return Mi})),n.d(u,"dot",(function(){return wi})),n.d(u,"cross",(function(){return _i})),n.d(u,"lerp",(function(){return xi})),n.d(u,"random",(function(){return Ai})),n.d(u,"transformMat2",(function(){return Pi})),n.d(u,"transformMat2d",(function(){return Si})),n.d(u,"transformMat3",(function(){return Oi})),n.d(u,"transformMat4",(function(){return Ni})),n.d(u,"rotate",(function(){return Ci})),n.d(u,"angle",(function(){return Ii})),n.d(u,"zero",(function(){return Ri})),n.d(u,"str",(function(){return ki})),n.d(u,"exactEquals",(function(){return Di})),n.d(u,"equals",(function(){return ji})),n.d(u,"len",(function(){return Li})),n.d(u,"sub",(function(){return Fi})),n.d(u,"mul",(function(){return Gi})),n.d(u,"div",(function(){return Vi})),n.d(u,"dist",(function(){return Ui})),n.d(u,"sqrDist",(function(){return qi})),n.d(u,"sqrLen",(function(){return zi})),n.d(u,"forEach",(function(){return Wi}));var c=n(0),l=n(10),h=function(t,e){return(h=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)};function f(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}h(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var p=function(){return(p=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}).apply(this,arguments)};function d(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function y(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function g(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function v(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())}))}function m(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=a.trys,(i=i.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])}}}Object.create;function b(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function T(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function E(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}Object.create;var M=function(){function t(){this.pool={}}return t.prototype.getByEntity=function(t){return this.pool[t]},t.prototype.add=function(t,e){this.pool[t]=e},t.prototype.remove=function(t){delete this.pool[t]},t=y([Object(c.singleton)()],t)}(),w=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},_={}.toString,x=function(t,e){return _.call(t)==="[object "+e+"]"},A=function(t){return x(t,"Function")},P=function(t){return null==t},S=function(t){return Array.isArray?Array.isArray(t):x(t,"Array")},O=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e};var N=function(t,e){if(t)if(S(t))for(var n=0,r=t.length;n<r&&!1!==e(t[n],n);n++);else if(O(t))for(var i in t)if(t.hasOwnProperty(i)&&!1===e(t[i],i))break};Object.keys;var C=function(t){return"object"==typeof t&&null!==t};var I=function(t){if(S(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])},R=function(t){if(S(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},k=Array.prototype,D=(k.splice,k.indexOf,Array.prototype.splice,function(t){return x(t,"String")});function j(t,e){void 0===e&&(e=new Map);var n=[];if(Array.isArray(t))for(var r=0,i=t.length;r<i;r++){var o=t[r];e.has(o)||(n.push(o),e.set(o,!0))}return n}Object.prototype.hasOwnProperty;var B=function(t,e,n){return t<e?e:t>n?n:t},L=function(t){return x(t,"Number")};Number.isInteger&&Number.isInteger;var F=function(t,e){return(t%e+e)%e},G=(Math.PI,parseInt,Math.PI/180),V=function(t){return G*t},U=Object.values?function(t){return Object.values(t)}:function(t){var e=[];return N(t,(function(n,r){A(t)&&"prototype"===r||e.push(n)})),e};var q=function(t){return x(t,"Boolean")},z=(Object.prototype,function(t){return void 0===t});Object.prototype.hasOwnProperty;var W,H=function(t,e){if(t===e)return!0;if(!t||!e)return!1;if(D(t)||D(e))return!1;if(w(t)||w(e)){if(t.length!==e.length)return!1;for(var n=!0,r=0;r<t.length&&(n=H(t[r],e[r]));r++);return n}if(C(t)||C(e)){var i=Object.keys(t),o=Object.keys(e);if(i.length!==o.length)return!1;for(n=!0,r=0;r<i.length&&(n=H(t[i[r]],e[i[r]]));r++);return n}return!1},Y=H;Object.prototype.hasOwnProperty;(function(t,e){if(!A(t))throw new TypeError("Expected a function");var n=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var s=t.apply(this,r);return a.set(o,s),s};n.cache=new Map})((function(t,e){void 0===e&&(e={});var n=e.fontSize,r=e.fontFamily,i=e.fontWeight,o=e.fontStyle,a=e.fontVariant;return W||(W=document.createElement("canvas").getContext("2d")),W.font=[o,a,i,n+"px",r].join(" "),W.measureText(D(t)?t:"").width}),(function(t,e){return void 0===e&&(e={}),function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}([t],U(e)).join("")})),function(){function t(){this.map={}}t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var n=this.map[t];return void 0===n?e:n},t.prototype.set=function(t,e){this.map[t]=e},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length}}();var $=1e-6,X="undefined"!=typeof Float32Array?Float32Array:Array,K=Math.random;Math.PI;function J(){var t=new X(9);return X!=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 Z(t,e){return 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}function Q(t){var e=new X(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function tt(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}function et(t,e,n,r,i,o,a,s,u){var c=new X(9);return c[0]=t,c[1]=e,c[2]=n,c[3]=r,c[4]=i,c[5]=o,c[6]=a,c[7]=s,c[8]=u,c}function nt(t,e,n,r,i,o,a,s,u,c){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=c,t}function rt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function it(t,e){if(t===e){var n=e[1],r=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function ot(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],l=e[8],h=l*a-s*c,f=-l*o+s*u,p=c*o-a*u,d=n*h+r*f+i*p;return d?(d=1/d,t[0]=h*d,t[1]=(-l*r+i*c)*d,t[2]=(s*r-i*a)*d,t[3]=f*d,t[4]=(l*n-i*u)*d,t[5]=(-s*n+i*o)*d,t[6]=p*d,t[7]=(-c*n+r*u)*d,t[8]=(a*n-r*o)*d,t):null}function at(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],l=e[8];return t[0]=a*l-s*c,t[1]=i*c-r*l,t[2]=r*s-i*a,t[3]=s*u-o*l,t[4]=n*l-i*u,t[5]=i*o-n*s,t[6]=o*c-a*u,t[7]=r*u-n*c,t[8]=n*a-r*o,t}function st(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8];return e*(c*o-a*u)+n*(-c*i+a*s)+r*(u*i-o*s)}function ut(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],l=e[7],h=e[8],f=n[0],p=n[1],d=n[2],y=n[3],g=n[4],v=n[5],m=n[6],b=n[7],T=n[8];return t[0]=f*r+p*a+d*c,t[1]=f*i+p*s+d*l,t[2]=f*o+p*u+d*h,t[3]=y*r+g*a+v*c,t[4]=y*i+g*s+v*l,t[5]=y*o+g*u+v*h,t[6]=m*r+b*a+T*c,t[7]=m*i+b*s+T*l,t[8]=m*o+b*u+T*h,t}function ct(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],l=e[7],h=e[8],f=n[0],p=n[1];return t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=f*r+p*a+c,t[7]=f*i+p*s+l,t[8]=f*o+p*u+h,t}function lt(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],l=e[7],h=e[8],f=Math.sin(n),p=Math.cos(n);return t[0]=p*r+f*a,t[1]=p*i+f*s,t[2]=p*o+f*u,t[3]=p*a-f*r,t[4]=p*s-f*i,t[5]=p*u-f*o,t[6]=c,t[7]=l,t[8]=h,t}function ht(t,e,n){var r=n[0],i=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function ft(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function pt(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function dt(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function yt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function gt(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,l=r*a,h=r*s,f=i*a,p=i*s,d=i*u,y=o*a,g=o*s,v=o*u;return t[0]=1-h-d,t[3]=l-v,t[6]=f+g,t[1]=l+v,t[4]=1-c-d,t[7]=p-y,t[2]=f-g,t[5]=p+y,t[8]=1-c-h,t}function vt(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],l=e[8],h=e[9],f=e[10],p=e[11],d=e[12],y=e[13],g=e[14],v=e[15],m=n*s-r*a,b=n*u-i*a,T=n*c-o*a,E=r*u-i*s,M=r*c-o*s,w=i*c-o*u,_=l*y-h*d,x=l*g-f*d,A=l*v-p*d,P=h*g-f*y,S=h*v-p*y,O=f*v-p*g,N=m*O-b*S+T*P+E*A-M*x+w*_;return N?(N=1/N,t[0]=(s*O-u*S+c*P)*N,t[1]=(u*A-a*O-c*x)*N,t[2]=(a*S-s*A+c*_)*N,t[3]=(i*S-r*O-o*P)*N,t[4]=(n*O-i*A+o*x)*N,t[5]=(r*A-n*S-o*_)*N,t[6]=(y*w-g*M+v*E)*N,t[7]=(g*T-d*w-v*b)*N,t[8]=(d*M-y*T+v*m)*N,t):null}function mt(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function bt(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function Tt(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function Et(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t}function Mt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t}function wt(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t}function _t(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t}function xt(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]}function At(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],l=t[8],h=e[0],f=e[1],p=e[2],d=e[3],y=e[4],g=e[5],v=e[6],m=e[7],b=e[8];return Math.abs(n-h)<=$*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(r-f)<=$*Math.max(1,Math.abs(r),Math.abs(f))&&Math.abs(i-p)<=$*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(o-d)<=$*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(a-y)<=$*Math.max(1,Math.abs(a),Math.abs(y))&&Math.abs(s-g)<=$*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(u-v)<=$*Math.max(1,Math.abs(u),Math.abs(v))&&Math.abs(c-m)<=$*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(l-b)<=$*Math.max(1,Math.abs(l),Math.abs(b))}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var Pt=ut,St=Mt;function Ot(){var t=new X(16);return X!=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 Nt(t){var e=new X(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Ct(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 It(t,e,n,r,i,o,a,s,u,c,l,h,f,p,d,y){var g=new X(16);return g[0]=t,g[1]=e,g[2]=n,g[3]=r,g[4]=i,g[5]=o,g[6]=a,g[7]=s,g[8]=u,g[9]=c,g[10]=l,g[11]=h,g[12]=f,g[13]=p,g[14]=d,g[15]=y,g}function Rt(t,e,n,r,i,o,a,s,u,c,l,h,f,p,d,y,g){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=c,t[9]=l,t[10]=h,t[11]=f,t[12]=p,t[13]=d,t[14]=y,t[15]=g,t}function kt(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 Dt(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function jt(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],l=e[8],h=e[9],f=e[10],p=e[11],d=e[12],y=e[13],g=e[14],v=e[15],m=n*s-r*a,b=n*u-i*a,T=n*c-o*a,E=r*u-i*s,M=r*c-o*s,w=i*c-o*u,_=l*y-h*d,x=l*g-f*d,A=l*v-p*d,P=h*g-f*y,S=h*v-p*y,O=f*v-p*g,N=m*O-b*S+T*P+E*A-M*x+w*_;return N?(N=1/N,t[0]=(s*O-u*S+c*P)*N,t[1]=(i*S-r*O-o*P)*N,t[2]=(y*w-g*M+v*E)*N,t[3]=(f*M-h*w-p*E)*N,t[4]=(u*A-a*O-c*x)*N,t[5]=(n*O-i*A+o*x)*N,t[6]=(g*T-d*w-v*b)*N,t[7]=(l*w-f*T+p*b)*N,t[8]=(a*S-s*A+c*_)*N,t[9]=(r*A-n*S-o*_)*N,t[10]=(d*M-y*T+v*m)*N,t[11]=(h*T-l*M-p*m)*N,t[12]=(s*x-a*P-u*_)*N,t[13]=(n*P-r*x+i*_)*N,t[14]=(y*b-d*E-g*m)*N,t[15]=(l*E-h*b+f*m)*N,t):null}function Bt(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],l=e[8],h=e[9],f=e[10],p=e[11],d=e[12],y=e[13],g=e[14],v=e[15];return t[0]=s*(f*v-p*g)-h*(u*v-c*g)+y*(u*p-c*f),t[1]=-(r*(f*v-p*g)-h*(i*v-o*g)+y*(i*p-o*f)),t[2]=r*(u*v-c*g)-s*(i*v-o*g)+y*(i*c-o*u),t[3]=-(r*(u*p-c*f)-s*(i*p-o*f)+h*(i*c-o*u)),t[4]=-(a*(f*v-p*g)-l*(u*v-c*g)+d*(u*p-c*f)),t[5]=n*(f*v-p*g)-l*(i*v-o*g)+d*(i*p-o*f),t[6]=-(n*(u*v-c*g)-a*(i*v-o*g)+d*(i*c-o*u)),t[7]=n*(u*p-c*f)-a*(i*p-o*f)+l*(i*c-o*u),t[8]=a*(h*v-p*y)-l*(s*v-c*y)+d*(s*p-c*h),t[9]=-(n*(h*v-p*y)-l*(r*v-o*y)+d*(r*p-o*h)),t[10]=n*(s*v-c*y)-a*(r*v-o*y)+d*(r*c-o*s),t[11]=-(n*(s*p-c*h)-a*(r*p-o*h)+l*(r*c-o*s)),t[12]=-(a*(h*g-f*y)-l*(s*g-u*y)+d*(s*f-u*h)),t[13]=n*(h*g-f*y)-l*(r*g-i*y)+d*(r*f-i*h),t[14]=-(n*(s*g-u*y)-a*(r*g-i*y)+d*(r*u-i*s)),t[15]=n*(s*f-u*h)-a*(r*f-i*h)+l*(r*u-i*s),t}function Lt(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],l=t[9],h=t[10],f=t[11],p=t[12],d=t[13],y=t[14],g=t[15];return(e*a-n*o)*(h*g-f*y)-(e*s-r*o)*(l*g-f*d)+(e*u-i*o)*(l*y-h*d)+(n*s-r*a)*(c*g-f*p)-(n*u-i*a)*(c*y-h*p)+(r*u-i*s)*(c*d-l*p)}function Ft(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],l=e[7],h=e[8],f=e[9],p=e[10],d=e[11],y=e[12],g=e[13],v=e[14],m=e[15],b=n[0],T=n[1],E=n[2],M=n[3];return t[0]=b*r+T*s+E*h+M*y,t[1]=b*i+T*u+E*f+M*g,t[2]=b*o+T*c+E*p+M*v,t[3]=b*a+T*l+E*d+M*m,b=n[4],T=n[5],E=n[6],M=n[7],t[4]=b*r+T*s+E*h+M*y,t[5]=b*i+T*u+E*f+M*g,t[6]=b*o+T*c+E*p+M*v,t[7]=b*a+T*l+E*d+M*m,b=n[8],T=n[9],E=n[10],M=n[11],t[8]=b*r+T*s+E*h+M*y,t[9]=b*i+T*u+E*f+M*g,t[10]=b*o+T*c+E*p+M*v,t[11]=b*a+T*l+E*d+M*m,b=n[12],T=n[13],E=n[14],M=n[15],t[12]=b*r+T*s+E*h+M*y,t[13]=b*i+T*u+E*f+M*g,t[14]=b*o+T*c+E*p+M*v,t[15]=b*a+T*l+E*d+M*m,t}function Gt(t,e,n){var r,i,o,a,s,u,c,l,h,f,p,d,y=n[0],g=n[1],v=n[2];return e===t?(t[12]=e[0]*y+e[4]*g+e[8]*v+e[12],t[13]=e[1]*y+e[5]*g+e[9]*v+e[13],t[14]=e[2]*y+e[6]*g+e[10]*v+e[14],t[15]=e[3]*y+e[7]*g+e[11]*v+e[15]):(r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=e[9],p=e[10],d=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]=l,t[8]=h,t[9]=f,t[10]=p,t[11]=d,t[12]=r*y+s*g+h*v+e[12],t[13]=i*y+u*g+f*v+e[13],t[14]=o*y+c*g+p*v+e[14],t[15]=a*y+l*g+d*v+e[15]),t}function Vt(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Ut(t,e,n,r){var i,o,a,s,u,c,l,h,f,p,d,y,g,v,m,b,T,E,M,w,_,x,A,P,S=r[0],O=r[1],N=r[2],C=Math.hypot(S,O,N);return C<$?null:(S*=C=1/C,O*=C,N*=C,i=Math.sin(n),a=1-(o=Math.cos(n)),s=e[0],u=e[1],c=e[2],l=e[3],h=e[4],f=e[5],p=e[6],d=e[7],y=e[8],g=e[9],v=e[10],m=e[11],b=S*S*a+o,T=O*S*a+N*i,E=N*S*a-O*i,M=S*O*a-N*i,w=O*O*a+o,_=N*O*a+S*i,x=S*N*a+O*i,A=O*N*a-S*i,P=N*N*a+o,t[0]=s*b+h*T+y*E,t[1]=u*b+f*T+g*E,t[2]=c*b+p*T+v*E,t[3]=l*b+d*T+m*E,t[4]=s*M+h*w+y*_,t[5]=u*M+f*w+g*_,t[6]=c*M+p*w+v*_,t[7]=l*M+d*w+m*_,t[8]=s*x+h*A+y*P,t[9]=u*x+f*A+g*P,t[10]=c*x+p*A+v*P,t[11]=l*x+d*A+m*P,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function qt(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],l=e[9],h=e[10],f=e[11];return 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+l*r,t[6]=s*i+h*r,t[7]=u*i+f*r,t[8]=c*i-o*r,t[9]=l*i-a*r,t[10]=h*i-s*r,t[11]=f*i-u*r,t}function zt(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],c=e[8],l=e[9],h=e[10],f=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-c*r,t[1]=a*i-l*r,t[2]=s*i-h*r,t[3]=u*i-f*r,t[8]=o*r+c*i,t[9]=a*r+l*i,t[10]=s*r+h*i,t[11]=u*r+f*i,t}function Wt(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],c=e[4],l=e[5],h=e[6],f=e[7];return e!==t&&(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[0]=o*i+c*r,t[1]=a*i+l*r,t[2]=s*i+h*r,t[3]=u*i+f*r,t[4]=c*i-o*r,t[5]=l*i-a*r,t[6]=h*i-s*r,t[7]=f*i-u*r,t}function Ht(t,e){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]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function Yt(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function $t(t,e,n){var r,i,o,a=n[0],s=n[1],u=n[2],c=Math.hypot(a,s,u);return c<$?null:(a*=c=1/c,s*=c,u*=c,r=Math.sin(e),o=1-(i=Math.cos(e)),t[0]=a*a*o+i,t[1]=s*a*o+u*r,t[2]=u*a*o-s*r,t[3]=0,t[4]=a*s*o-u*r,t[5]=s*s*o+i,t[6]=u*s*o+a*r,t[7]=0,t[8]=a*u*o+s*r,t[9]=s*u*o-a*r,t[10]=u*u*o+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function Xt(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Kt(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Jt(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,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 Zt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=r+r,u=i+i,c=o+o,l=r*s,h=r*u,f=r*c,p=i*u,d=i*c,y=o*c,g=a*s,v=a*u,m=a*c;return t[0]=1-(p+y),t[1]=h+m,t[2]=f-v,t[3]=0,t[4]=h-m,t[5]=1-(l+y),t[6]=d+g,t[7]=0,t[8]=f+v,t[9]=d-g,t[10]=1-(l+p),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function Qt(t,e){var n=new X(3),r=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=r*r+i*i+o*o+a*a;return h>0?(n[0]=2*(s*a+l*r+u*o-c*i)/h,n[1]=2*(u*a+l*i+c*r-s*o)/h,n[2]=2*(c*a+l*o+s*i-u*r)/h):(n[0]=2*(s*a+l*r+u*o-c*i),n[1]=2*(u*a+l*i+c*r-s*o),n[2]=2*(c*a+l*o+s*i-u*r)),Zt(t,e,n),t}function te(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function ee(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],l=e[10];return t[0]=Math.hypot(n,r,i),t[1]=Math.hypot(o,a,s),t[2]=Math.hypot(u,c,l),t}function ne(t,e){var n=new X(3);ee(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,l=e[5]*i,h=e[6]*o,f=e[8]*r,p=e[9]*i,d=e[10]*o,y=a+l+d,g=0;return y>0?(g=2*Math.sqrt(y+1),t[3]=.25*g,t[0]=(h-p)/g,t[1]=(f-u)/g,t[2]=(s-c)/g):a>l&&a>d?(g=2*Math.sqrt(1+a-l-d),t[3]=(h-p)/g,t[0]=.25*g,t[1]=(s+c)/g,t[2]=(f+u)/g):l>d?(g=2*Math.sqrt(1+l-a-d),t[3]=(f-u)/g,t[0]=(s+c)/g,t[1]=.25*g,t[2]=(h+p)/g):(g=2*Math.sqrt(1+d-a-l),t[3]=(s-c)/g,t[0]=(f+u)/g,t[1]=(h+p)/g,t[2]=.25*g),t}function re(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3],u=i+i,c=o+o,l=a+a,h=i*u,f=i*c,p=i*l,d=o*c,y=o*l,g=a*l,v=s*u,m=s*c,b=s*l,T=r[0],E=r[1],M=r[2];return t[0]=(1-(d+g))*T,t[1]=(f+b)*T,t[2]=(p-m)*T,t[3]=0,t[4]=(f-b)*E,t[5]=(1-(h+g))*E,t[6]=(y+v)*E,t[7]=0,t[8]=(p+m)*M,t[9]=(y-v)*M,t[10]=(1-(h+d))*M,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function ie(t,e,n,r,i){var o=e[0],a=e[1],s=e[2],u=e[3],c=o+o,l=a+a,h=s+s,f=o*c,p=o*l,d=o*h,y=a*l,g=a*h,v=s*h,m=u*c,b=u*l,T=u*h,E=r[0],M=r[1],w=r[2],_=i[0],x=i[1],A=i[2],P=(1-(y+v))*E,S=(p+T)*E,O=(d-b)*E,N=(p-T)*M,C=(1-(f+v))*M,I=(g+m)*M,R=(d+b)*w,k=(g-m)*w,D=(1-(f+y))*w;return t[0]=P,t[1]=S,t[2]=O,t[3]=0,t[4]=N,t[5]=C,t[6]=I,t[7]=0,t[8]=R,t[9]=k,t[10]=D,t[11]=0,t[12]=n[0]+_-(P*_+N*x+R*A),t[13]=n[1]+x-(S*_+C*x+k*A),t[14]=n[2]+A-(O*_+I*x+D*A),t[15]=1,t}function oe(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,l=r*a,h=r*s,f=i*a,p=i*s,d=i*u,y=o*a,g=o*s,v=o*u;return t[0]=1-h-d,t[1]=l+v,t[2]=f-g,t[3]=0,t[4]=l-v,t[5]=1-c-d,t[6]=p+y,t[7]=0,t[8]=f+g,t[9]=p-y,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ae(t,e,n,r,i,o,a){var s=1/(n-e),u=1/(i-r),c=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*u,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*u,t[10]=(a+o)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*c,t[15]=0,t}function se(t,e,n,r,i){var o,a=1/Math.tan(e/2);return 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),t}var ue=se;function ce(t,e,n,r,i){var o,a=1/Math.tan(e/2);return 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*o,t[14]=i*r*o):(t[10]=-1,t[14]=-r),t}function le(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(a+s),c=2/(i+o);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(a-s)*u*.5,t[9]=(i-o)*c*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t}function he(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),c=1/(o-a);return 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,t}var fe=he;function pe(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),c=1/(o-a);return 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]=c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=o*c,t[15]=1,t}function de(t,e,n,r){var i,o,a,s,u,c,l,h,f,p,d=e[0],y=e[1],g=e[2],v=r[0],m=r[1],b=r[2],T=n[0],E=n[1],M=n[2];return Math.abs(d-T)<$&&Math.abs(y-E)<$&&Math.abs(g-M)<$?kt(t):(l=d-T,h=y-E,f=g-M,i=m*(f*=p=1/Math.hypot(l,h,f))-b*(h*=p),o=b*(l*=p)-v*f,a=v*h-m*l,(p=Math.hypot(i,o,a))?(i*=p=1/p,o*=p,a*=p):(i=0,o=0,a=0),s=h*a-f*o,u=f*i-l*a,c=l*o-h*i,(p=Math.hypot(s,u,c))?(s*=p=1/p,u*=p,c*=p):(s=0,u=0,c=0),t[0]=i,t[1]=s,t[2]=l,t[3]=0,t[4]=o,t[5]=u,t[6]=h,t[7]=0,t[8]=a,t[9]=c,t[10]=f,t[11]=0,t[12]=-(i*d+o*y+a*g),t[13]=-(s*d+u*y+c*g),t[14]=-(l*d+h*y+f*g),t[15]=1,t)}function ye(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=r[0],u=r[1],c=r[2],l=i-n[0],h=o-n[1],f=a-n[2],p=l*l+h*h+f*f;p>0&&(l*=p=1/Math.sqrt(p),h*=p,f*=p);var d=u*f-c*h,y=c*l-s*f,g=s*h-u*l;return(p=d*d+y*y+g*g)>0&&(d*=p=1/Math.sqrt(p),y*=p,g*=p),t[0]=d,t[1]=y,t[2]=g,t[3]=0,t[4]=h*g-f*y,t[5]=f*d-l*g,t[6]=l*y-h*d,t[7]=0,t[8]=l,t[9]=h,t[10]=f,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t}function ge(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function ve(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function me(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t}function be(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}function Te(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t}function Ee(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t}function Me(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]}function we(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],l=t[8],h=t[9],f=t[10],p=t[11],d=t[12],y=t[13],g=t[14],v=t[15],m=e[0],b=e[1],T=e[2],E=e[3],M=e[4],w=e[5],_=e[6],x=e[7],A=e[8],P=e[9],S=e[10],O=e[11],N=e[12],C=e[13],I=e[14],R=e[15];return Math.abs(n-m)<=$*Math.max(1,Math.abs(n),Math.abs(m))&&Math.abs(r-b)<=$*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-T)<=$*Math.max(1,Math.abs(i),Math.abs(T))&&Math.abs(o-E)<=$*Math.max(1,Math.abs(o),Math.abs(E))&&Math.abs(a-M)<=$*Math.max(1,Math.abs(a),Math.abs(M))&&Math.abs(s-w)<=$*Math.max(1,Math.abs(s),Math.abs(w))&&Math.abs(u-_)<=$*Math.max(1,Math.abs(u),Math.abs(_))&&Math.abs(c-x)<=$*Math.max(1,Math.abs(c),Math.abs(x))&&Math.abs(l-A)<=$*Math.max(1,Math.abs(l),Math.abs(A))&&Math.abs(h-P)<=$*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(f-S)<=$*Math.max(1,Math.abs(f),Math.abs(S))&&Math.abs(p-O)<=$*Math.max(1,Math.abs(p),Math.abs(O))&&Math.abs(d-N)<=$*Math.max(1,Math.abs(d),Math.abs(N))&&Math.abs(y-C)<=$*Math.max(1,Math.abs(y),Math.abs(C))&&Math.abs(g-I)<=$*Math.max(1,Math.abs(g),Math.abs(I))&&Math.abs(v-R)<=$*Math.max(1,Math.abs(v),Math.abs(R))}var _e=Ft,xe=be;function Ae(){var t=new X(3);return X!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Pe(t){var e=new X(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Se(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)}function Oe(t,e,n){var r=new X(3);return r[0]=t,r[1]=e,r[2]=n,r}function Ne(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Ce(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function Ie(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function Re(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function ke(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function De(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t}function je(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function Be(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function Le(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t}function Fe(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t}function Ge(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function Ve(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function Ue(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t}function qe(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.hypot(n,r,i)}function ze(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return n*n+r*r+i*i}function We(t){var e=t[0],n=t[1],r=t[2];return e*e+n*n+r*r}function He(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function Ye(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function $e(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 Xe(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Ke(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2];return t[0]=i*u-o*s,t[1]=o*a-r*u,t[2]=r*s-i*a,t}function Je(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 Ze(t,e,n,r,i,o){var a=o*o,s=a*(2*o-3)+1,u=a*(o-2)+o,c=a*(o-1),l=a*(3-2*o);return t[0]=e[0]*s+n[0]*u+r[0]*c+i[0]*l,t[1]=e[1]*s+n[1]*u+r[1]*c+i[1]*l,t[2]=e[2]*s+n[2]*u+r[2]*c+i[2]*l,t}function Qe(t,e,n,r,i,o){var a=1-o,s=a*a,u=o*o,c=s*a,l=3*o*s,h=3*u*a,f=u*o;return t[0]=e[0]*c+n[0]*l+r[0]*h+i[0]*f,t[1]=e[1]*c+n[1]*l+r[1]*h+i[1]*f,t[2]=e[2]*c+n[2]*l+r[2]*h+i[2]*f,t}function tn(t,e){e=e||1;var n=2*K()*Math.PI,r=2*K()-1,i=Math.sqrt(1-r*r)*e;return t[0]=Math.cos(n)*i,t[1]=Math.sin(n)*i,t[2]=r*e,t}function en(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 nn(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}function rn(t,e,n){var r=n[0],i=n[1],o=n[2],a=n[3],s=e[0],u=e[1],c=e[2],l=i*c-o*u,h=o*s-r*c,f=r*u-i*s,p=i*f-o*h,d=o*l-r*f,y=r*h-i*l,g=2*a;return l*=g,h*=g,f*=g,p*=2,d*=2,y*=2,t[0]=s+l+p,t[1]=u+h+d,t[2]=c+f+y,t}function on(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0],o[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),o[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function an(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),o[1]=i[1],o[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function sn(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),o[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),o[2]=i[2],t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function un(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2],u=Math.sqrt(n*n+r*r+i*i)*Math.sqrt(o*o+a*a+s*s),c=u&&Xe(t,e)/u;return Math.acos(Math.min(Math.max(c,-1),1))}function cn(t){return t[0]=0,t[1]=0,t[2]=0,t}function ln(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function hn(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function fn(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2];return Math.abs(n-o)<=$*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=$*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=$*Math.max(1,Math.abs(i),Math.abs(s))}var pn,dn=Re,yn=ke,gn=De,vn=qe,mn=ze,bn=Se,Tn=We,En=(pn=Ae(),function(t,e,n,r,i,o){var a,s;for(e||(e=3),n||(n=0),s=r?Math.min(r*e+n,t.length):t.length,a=n;a<s;a+=e)pn[0]=t[a],pn[1]=t[a+1],pn[2]=t[a+2],i(pn,pn,o),t[a]=pn[0],t[a+1]=pn[1],t[a+2]=pn[2];return t});function Mn(){var t=new X(4);return X!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function wn(t){var e=new X(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function _n(t,e,n,r){var i=new X(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i}function xn(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function An(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t}function Pn(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t}function Sn(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}function On(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t[3]=e[3]*n[3],t}function Nn(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t[3]=e[3]/n[3],t}function Cn(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t}function In(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t}function Rn(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t[3]=Math.min(e[3],n[3]),t}function kn(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t[3]=Math.max(e[3],n[3]),t}function Dn(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t}function jn(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t}function Bn(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t}function Ln(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return Math.hypot(n,r,i,o)}function Fn(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return n*n+r*r+i*i+o*o}function Gn(t){var e=t[0],n=t[1],r=t[2],i=t[3];return Math.hypot(e,n,r,i)}function Vn(t){var e=t[0],n=t[1],r=t[2],i=t[3];return e*e+n*n+r*r+i*i}function Un(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}function qn(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}function zn(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}function Wn(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function Hn(t,e,n,r){var i=n[0]*r[1]-n[1]*r[0],o=n[0]*r[2]-n[2]*r[0],a=n[0]*r[3]-n[3]*r[0],s=n[1]*r[2]-n[2]*r[1],u=n[1]*r[3]-n[3]*r[1],c=n[2]*r[3]-n[3]*r[2],l=e[0],h=e[1],f=e[2],p=e[3];return t[0]=h*c-f*u+p*s,t[1]=-l*c+f*a-p*o,t[2]=l*u-h*a+p*i,t[3]=-l*s+h*o-f*i,t}function Yn(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t[3]=s+r*(n[3]-s),t}function $n(t,e){var n,r,i,o,a,s;e=e||1;do{a=(n=2*K()-1)*n+(r=2*K()-1)*r}while(a>=1);do{s=(i=2*K()-1)*i+(o=2*K()-1)*o}while(s>=1);var u=Math.sqrt((1-a)/s);return t[0]=e*n,t[1]=e*r,t[2]=e*i*u,t[3]=e*o*u,t}function Xn(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 Kn(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2],c=n[3],l=c*r+s*o-u*i,h=c*i+u*r-a*o,f=c*o+a*i-s*r,p=-a*r-s*i-u*o;return t[0]=l*c+p*-a+h*-u-f*-s,t[1]=h*c+p*-s+f*-a-l*-u,t[2]=f*c+p*-u+l*-s-h*-a,t[3]=e[3],t}function Jn(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function Zn(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function Qn(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function tr(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=e[0],s=e[1],u=e[2],c=e[3];return Math.abs(n-a)<=$*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-s)<=$*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-u)<=$*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(o-c)<=$*Math.max(1,Math.abs(o),Math.abs(c))}var er=Sn,nr=On,rr=Nn,ir=Ln,or=Fn,ar=Gn,sr=Vn,ur=function(){var t=Mn();return function(e,n,r,i,o,a){var s,u;for(n||(n=4),r||(r=0),u=i?Math.min(i*n+r,e.length):e.length,s=r;s<u;s+=n)t[0]=e[s],t[1]=e[s+1],t[2]=e[s+2],t[3]=e[s+3],o(t,t,a),e[s]=t[0],e[s+1]=t[1],e[s+2]=t[2],e[s+3]=t[3];return e}}();function cr(){var t=new X(4);return X!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function lr(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function hr(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 fr(t,e){var n=2*Math.acos(e[3]),r=Math.sin(n/2);return r>$?(t[0]=e[0]/r,t[1]=e[1]/r,t[2]=e[2]/r):(t[0]=1,t[1]=0,t[2]=0),n}function pr(t,e){var n=Ur(t,e);return Math.acos(2*n*n-1)}function dr(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],l=n[3];return t[0]=r*l+a*s+i*c-o*u,t[1]=i*l+a*u+o*s-r*c,t[2]=o*l+a*c+r*u-i*s,t[3]=a*l-r*s-i*u-o*c,t}function yr(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),u=Math.cos(n);return t[0]=r*u+a*s,t[1]=i*u+o*s,t[2]=o*u-i*s,t[3]=a*u-r*s,t}function gr(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),u=Math.cos(n);return t[0]=r*u-o*s,t[1]=i*u+a*s,t[2]=o*u+r*s,t[3]=a*u-i*s,t}function vr(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),u=Math.cos(n);return t[0]=r*u+i*s,t[1]=i*u-r*s,t[2]=o*u+a*s,t[3]=a*u-o*s,t}function mr(t,e){var n=e[0],r=e[1],i=e[2];return t[0]=n,t[1]=r,t[2]=i,t[3]=Math.sqrt(Math.abs(1-n*n-r*r-i*i)),t}function br(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=Math.sqrt(n*n+r*r+i*i),s=Math.exp(o),u=a>0?s*Math.sin(a)/a:0;return t[0]=n*u,t[1]=r*u,t[2]=i*u,t[3]=s*Math.cos(a),t}function Tr(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=Math.sqrt(n*n+r*r+i*i),s=a>0?Math.atan2(a,o)/a:0;return t[0]=n*s,t[1]=r*s,t[2]=i*s,t[3]=.5*Math.log(n*n+r*r+i*i+o*o),t}function Er(t,e,n){return Tr(t,e),Vr(t,t,n),br(t,t),t}function Mr(t,e,n,r){var i,o,a,s,u,c=e[0],l=e[1],h=e[2],f=e[3],p=n[0],d=n[1],y=n[2],g=n[3];return(o=c*p+l*d+h*y+f*g)<0&&(o=-o,p=-p,d=-d,y=-y,g=-g),1-o>$?(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*p,t[1]=s*l+u*d,t[2]=s*h+u*y,t[3]=s*f+u*g,t}function wr(t){var e=K(),n=K(),r=K(),i=Math.sqrt(1-e),o=Math.sqrt(e);return t[0]=i*Math.sin(2*Math.PI*n),t[1]=i*Math.cos(2*Math.PI*n),t[2]=o*Math.sin(2*Math.PI*r),t[3]=o*Math.cos(2*Math.PI*r),t}function _r(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 xr(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function Ar(t,e){var n,r=e[0]+e[4]+e[8];if(r>0)n=Math.sqrt(r+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;n=Math.sqrt(e[3*i+i]-e[3*o+o]-e[3*a+a]+1),t[i]=.5*n,n=.5/n,t[3]=(e[3*o+a]-e[3*a+o])*n,t[o]=(e[3*o+i]+e[3*i+o])*n,t[a]=(e[3*a+i]+e[3*i+a])*n}return t}function Pr(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),l=Math.cos(r);return t[0]=o*u*l-a*s*c,t[1]=a*s*l+o*u*c,t[2]=a*u*c-o*s*l,t[3]=a*u*l+o*s*c,t}function Sr(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var Or,Nr,Cr,Ir,Rr,kr,Dr=wn,jr=_n,Br=xn,Lr=An,Fr=Pn,Gr=dr,Vr=jn,Ur=Wn,qr=Yn,zr=Gn,Wr=zr,Hr=Vn,Yr=Hr,$r=zn,Xr=Qn,Kr=tr,Jr=(Or=Ae(),Nr=Oe(1,0,0),Cr=Oe(0,1,0),function(t,e,n){var r=Xe(e,n);return r<-.999999?(Ke(Or,Nr,e),bn(Or)<1e-6&&Ke(Or,Cr,e),$e(Or,Or),hr(t,Or,Math.PI),t):r>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(Ke(Or,e,n),t[0]=Or[0],t[1]=Or[1],t[2]=Or[2],t[3]=1+r,$r(t,t))}),Zr=(Ir=cr(),Rr=cr(),function(t,e,n,r,i,o){return Mr(Ir,e,i,o),Mr(Rr,n,r,o),Mr(t,Ir,Rr,2*o*(1-o)),t}),Qr=(kr=J(),function(t,e,n,r){return kr[0]=n[0],kr[3]=n[1],kr[6]=n[2],kr[1]=r[0],kr[4]=r[1],kr[7]=r[2],kr[2]=-e[0],kr[5]=-e[1],kr[8]=-e[2],$r(t,Ar(t,kr))});function ti(){var t=new X(2);return X!=Float32Array&&(t[0]=0,t[1]=0),t}function ei(t){var e=new X(2);return e[0]=t[0],e[1]=t[1],e}function ni(t,e){var n=new X(2);return n[0]=t,n[1]=e,n}function ri(t,e){return t[0]=e[0],t[1]=e[1],t}function ii(t,e,n){return t[0]=e,t[1]=n,t}function oi(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function ai(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function si(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function ui(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function ci(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function li(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function hi(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t}function fi(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}function pi(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function di(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}function yi(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t}function gi(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.hypot(n,r)}function vi(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function mi(t){var e=t[0],n=t[1];return Math.hypot(e,n)}function bi(t){var e=t[0],n=t[1];return e*e+n*n}function Ti(t,e){return t[0]=-e[0],t[1]=-e[1],t}function Ei(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function Mi(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}function wi(t,e){return t[0]*e[0]+t[1]*e[1]}function _i(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t}function xi(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}function Ai(t,e){e=e||1;var n=2*K()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t}function Pi(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}function Si(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}function Oi(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}function Ni(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}function Ci(t,e,n,r){var i=e[0]-n[0],o=e[1]-n[1],a=Math.sin(r),s=Math.cos(r);return t[0]=i*s-o*a+n[0],t[1]=i*a+o*s+n[1],t}function Ii(t,e){var n=t[0],r=t[1],i=e[0],o=e[1],a=Math.sqrt(n*n+r*r)*Math.sqrt(i*i+o*o),s=a&&(n*i+r*o)/a;return Math.acos(Math.min(Math.max(s,-1),1))}function Ri(t){return t[0]=0,t[1]=0,t}function ki(t){return"vec2("+t[0]+", "+t[1]+")"}function Di(t,e){return t[0]===e[0]&&t[1]===e[1]}function ji(t,e){var n=t[0],r=t[1],i=e[0],o=e[1];return Math.abs(n-i)<=$*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(r-o)<=$*Math.max(1,Math.abs(r),Math.abs(o))}var Bi,Li=mi,Fi=ai,Gi=si,Vi=ui,Ui=gi,qi=vi,zi=bi,Wi=function(){var t=ti();return function(e,n,r,i,o,a){var s,u;for(n||(n=2),r||(r=0),u=i?Math.min(i*n+r,e.length):e.length,s=r;s<u;s+=n)t[0]=e[s],t[1]=e[s+1],o(t,t,a),e[s]=t[0],e[s+1]=t[1];return e}}(),Hi=function(){function t(t,e){this.min=o.create(),this.max=o.create(),this.update(t,e)}return t.prototype.update=function(t,e){this.center=o.copy(o.create(),t||o.create()),this.halfExtents=o.copy(o.create(),e||o.fromValues(0,0,0)),this.min=o.sub(this.min,this.center,this.halfExtents),this.max=o.add(this.max,this.center,this.halfExtents)},t.prototype.setMinMax=function(t,e){o.add(this.center,e,t),o.scale(this.center,this.center,.5),o.sub(this.halfExtents,e,t),o.scale(this.halfExtents,this.halfExtents,.5),o.copy(this.min,t),o.copy(this.max,e)},t.prototype.getMin=function(){return this.min},t.prototype.getMax=function(){return this.max},t.prototype.add=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,l=n+a,h=r-s,f=r+s,p=i-u,d=i+u,y=t.center,g=y[0],v=y[1],m=y[2],b=t.halfExtents,T=b[0],E=b[1],M=b[2],w=g-T,_=g+T,x=v-E,A=v+E,P=m-M,S=m+M;w<c&&(c=w),_>l&&(l=_),x<h&&(h=x),A>f&&(f=A),P<p&&(p=P),S>d&&(d=S),e[0]=.5*(c+l),e[1]=.5*(h+f),e[2]=.5*(p+d),o[0]=.5*(l-c),o[1]=.5*(f-h),o[2]=.5*(d-p),this.min[0]=c,this.min[1]=h,this.min[2]=p,this.max[0]=l,this.max[1]=f,this.max[2]=d},t.prototype.setFromTransformedAABB=function(t,e){var n=this.center,r=this.halfExtents,i=t.center,a=t.halfExtents,s=e[0],u=e[4],c=e[8],l=e[1],h=e[5],f=e[9],p=e[2],d=e[6],y=e[10],g=Math.abs(s),v=Math.abs(u),m=Math.abs(c),b=Math.abs(l),T=Math.abs(h),E=Math.abs(f),M=Math.abs(p),w=Math.abs(d),_=Math.abs(y);o.set(n,e[12]+s*i[0]+u*i[1]+c*i[2],e[13]+l*i[0]+h*i[1]+f*i[2],e[14]+p*i[0]+d*i[1]+y*i[2]),o.set(r,g*a[0]+v*a[1]+m*a[2],b*a[0]+T*a[1]+E*a[2],M*a[0]+w*a[1]+_*a[2]),this.min=o.sub(this.min,n,r),this.max=o.add(this.max,n,r)},t.prototype.intersects=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]},t.prototype.intersection=function(e){if(!this.intersects(e))return null;var n=new t,r=o.max(o.create(),this.getMin(),e.getMin()),i=o.min(o.create(),this.getMax(),e.getMax());return n.setMinMax(r,i),n},t.prototype.containsPoint=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])},t.prototype.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?o.copy(o.create(),this.min):272===t.pnVertexFlag?o.fromValues(this.min[0],this.min[1],this.max[2]):257===t.pnVertexFlag?o.fromValues(this.min[0],this.max[1],this.min[2]):256===t.pnVertexFlag?o.fromValues(this.min[0],this.max[1],this.max[2]):17===t.pnVertexFlag?o.fromValues(this.max[0],this.min[1],this.min[2]):16===t.pnVertexFlag?o.fromValues(this.max[0],this.min[1],this.max[2]):1===t.pnVertexFlag?o.fromValues(this.max[0],this.max[1],this.min[2]):o.fromValues(this.max[0],this.max[1],this.max[2])},t.prototype.getPositiveFarPoint=function(t){return 273===t.pnVertexFlag?o.copy(o.create(),this.max):272===t.pnVertexFlag?o.fromValues(this.max[0],this.max[1],this.min[2]):257===t.pnVertexFlag?o.fromValues(this.max[0],this.min[1],this.max[2]):256===t.pnVertexFlag?o.fromValues(this.max[0],this.min[1],this.min[2]):17===t.pnVertexFlag?o.fromValues(this.min[0],this.max[1],this.max[2]):16===t.pnVertexFlag?o.fromValues(this.min[0],this.max[1],this.min[2]):1===t.pnVertexFlag?o.fromValues(this.min[0],this.min[1],this.max[2]):o.fromValues(this.min[0],this.min[1],this.min[2])},t}(),Yi=o.create(),$i=function(){function t(t,e){this.center=t||o.create(),this.radius=e||.5}return t.prototype.containsPoint=function(t){return o.sub(Yi,t,this.center),o.length(Yi)<this.radius*this.radius},t.prototype.intersects=function(t){o.sub(Yi,t.center,this.center);var e=t.radius+this.radius;return o.length(Yi)<=e*e},t}(),Xi=function(){function t(t,e){this.distance=t||0,this.normal=e||o.fromValues(0,1,0),this.updatePNVertexFlag()}return t.prototype.updatePNVertexFlag=function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)},t.prototype.distanceToPoint=function(t){return o.dot(t,this.normal)-this.distance},t.prototype.normalize=function(){var t=1/o.len(this.normal);o.scale(this.normal,this.normal,t),this.distance*=t},t.prototype.intersectsLine=function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),a=i>=0&&i<=1;return a&&n&&o.lerp(n,t,e,i),a},t}();!function(t){t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE"}(Bi||(Bi={}));var Ki,Ji=function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;e<6;e++)this.planes.push(new Xi)}return t.prototype.extractFromVPMatrix=function(t){var e=T(t,16),n=e[0],r=e[1],i=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=e[9],p=e[10],d=e[11],y=e[12],g=e[13],v=e[14],m=e[15];o.set(this.planes[0].normal,a-n,l-s,d-h),this.planes[0].distance=m-y,o.set(this.planes[1].normal,a+n,l+s,d+h),this.planes[1].distance=m+y,o.set(this.planes[2].normal,a+r,l+u,d+f),this.planes[2].distance=m+g,o.set(this.planes[3].normal,a-r,l-u,d-f),this.planes[3].distance=m-g,o.set(this.planes[4].normal,a-i,l-c,d-p),this.planes[4].distance=m-v,o.set(this.planes[5].normal,a+i,l+c,d+p),this.planes[5].distance=m+v,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))},t}(),Zi=o.create(),Qi=o.create(),to=o.create(),eo=o.create(),no=o.create(),ro=function(){function t(t,e){this.origin=t||o.create(),this.direction=e||o.fromValues(0,0,-1)}return t.prototype.intersectsAABB=function(t,e){return e?this.intersectAABBWithIntersection(t,e):this.intersectsAABBWithoutIntersection(t)},t.prototype.intersectsSphere=function(t,e){var n=o.sub(Zi,this.origin,t.center);o.normalize(Qi,o.copy(Qi,this.direction));var r=o.dot(n,Qi),i=o.dot(n,n)-t.radius*t.radius;if(i>0&&r>0)return null;var a=r*r-i;if(a<0)return!1;var s=Math.abs(-r-Math.sqrt(a));return e&&(o.copy(e,this.direction),o.scaleAndAdd(e,this.origin,e,s)),!0},t.prototype.intersectsPlane=function(t,e){var n=(t.distance-o.dot(t.normal,this.origin))/o.dot(t.normal,this.direction),r=n>=0;return r&&e&&o.scaleAndAdd(e,this.origin,this.direction,n),r},t.prototype.intersectsAABBWithoutIntersection=function(t){var e=Zi,n=Qi,r=to,i=eo,a=no,s=this.direction;return o.sub(e,this.origin,t.center),o.set(i,Math.abs(e[0]),Math.abs(e[1]),Math.abs(e[2])),o.mul(r,e,s),!(i[0]>t.halfExtents[0]&&r[0]>=0||i[1]>t.halfExtents[1]&&r[1]>=0||i[2]>t.halfExtents[2]&&r[2]>=0)&&(o.set(a,Math.abs(s[0]),Math.abs(s[1]),Math.abs(s[2])),o.cross(n,s,e),o.set(n,Math.abs(n[0]),Math.abs(n[1]),Math.abs(n[2])),!(n[0]>t.halfExtents[1]*a[2]+t.halfExtents[2]*a[1]||n[1]>t.halfExtents[0]*a[2]+t.halfExtents[2]*a[0]||n[2]>t.halfExtents[0]*a[1]+t.halfExtents[1]*a[0]))},t.prototype.intersectAABBWithIntersection=function(t,e){var n=o.copy(o.create(),t.getMin());o.sub(n,n,this.origin);var r=o.copy(o.create(),t.getMax());o.sub(r,r,this.origin);var i=this.direction;0===i[0]?(n[0]=n[0]<0?-Number.MAX_VALUE:Number.MAX_VALUE,r[0]=r[0]<0?-Number.MAX_VALUE:Number.MAX_VALUE):(n[0]/=i[0],r[0]/=i[0]),0===i[1]?(n[1]=n[1]<0?-Number.MAX_VALUE:Number.MAX_VALUE,r[1]=r[1]<0?-Number.MAX_VALUE:Number.MAX_VALUE):(n[1]/=i[1],r[1]/=i[1]),0===i[2]?(n[2]=n[2]<0?-Number.MAX_VALUE:Number.MAX_VALUE,r[2]=r[2]<0?-Number.MAX_VALUE:Number.MAX_VALUE):(n[2]/=i[2],r[2]/=i[2]);var a=o.set(to,Math.min(n[0],r[0]),Math.min(n[1],r[1]),Math.min(n[2],r[2])),s=o.set(eo,Math.max(n[0],r[0]),Math.max(n[1],r[1]),Math.max(n[2],r[2])),u=Math.min(Math.min(s[0],s[1]),s[2]),c=Math.max(Math.max(a[0],a[1]),a[2]),l=u>=c&&c>=0;return l&&(o.copy(e,this.direction),o.scaleAndAdd(e,this.origin,e,c)),l},t}(),io=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y},t}(),oo=function(){function t(t,e,n,r){this.x=t,this.y=e,this.width=n,this.height=r,this.left=t,this.right=t+n,this.top=e,this.bottom=e+r}return t.prototype.toJSON=function(){},t}(),ao=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Array.isArray(t[0])?t[0]:t;if("number"!=typeof n[0]){for(var r=[],i=0,o=n.length;i<o;i++)r.push(n[i].x,n[i].y);n=r}this.points=n,this.closeStroke=!0}return t.prototype.clone=function(){var e=new t(this.points.slice());return e.closeStroke=this.closeStroke,e},t.prototype.contains=function(t,e){for(var n=!1,r=this.points.length/2,i=0,o=r-1;i<r;o=i++){var a=this.points[2*i],s=this.points[2*i+1],u=this.points[2*o],c=this.points[2*o+1];s>e!=c>e&&t<(e-s)/(c-s)*(u-a)+a&&(n=!n)}return n},t}(),so="SceneGraphSelectorFactory",uo="SceneGraphSelector",co=function(){function t(){}return t.prototype.selectOne=function(t,e){return t.startsWith("#")?e.find((function(e){return e.id===t.substring(1)})):null},t.prototype.selectAll=function(t,e){return t.startsWith(".")?e.findAll((function(e){return e.className===t.substring(1)})):t.startsWith("#")?e.findAll((function(e){return e.id===t.substring(1)})):t.startsWith("[name=")?e.findAll((function(e){return e.name===t.substring(7,t.length-2)})):e.findAll((function(e){return e.nodeName===t}))},t.prototype.is=function(t,e){return!0},t=y([Object(c.singleton)()],t)}();function lo(t,e){var n=Number(t.style.zIndex),r=Number(e.style.zIndex);if(n===r){var i=t.parentNode;if(i){var o=i.childNodes||[];return o.indexOf(t)-o.indexOf(e)}}return n-r}!function(t){t.DESTROY="destroy",t.ATTRIBUTE_CHANGED="attribute-changed",t.INSERTED="inserted",t.CHILD_INSERTED="child-inserted",t.REMOVED="removed",t.CHILD_REMOVED="child-removed",t.MOUNTED="mounted",t.UNMOUNTED="unmounted",t.BOUNDS_CHANGED="bounds-changed"}(Ki||(Ki={}));var ho,fo="SceneGraphService",po=function(){function t(){var t,e,n,r,a,u=this;this.sort=function(t,e){if(!t.parentNode)return-1;if(!e.parentNode)return 1;var n=t.transformable.graphDepth-e.transformable.graphDepth,r=t,i=e;if(n<0){if((i=e.getAncestor(-n))===r)return-1}else if(n>0&&i===(r=t.getAncestor(n)))return 1;for(;r&&i&&r.parentNode!==i.parentNode;)r=r.parentNode,i=i.parentNode;var o=r.parentNode;if(o){var a=o.sortable;if(a)return a.sorted||(a.sorted=o.childNodes.slice()),a.dirty&&(a.sorted=o.childNodes.slice().sort(lo),a.dirty=!1),a.sorted.indexOf(r)-a.sorted.indexOf(i)}return-1},this.rotate=(t=s.create(),function(e,n,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof n&&(n=o.fromValues(n,r,i));var a=e.transformable;if(null===e.parentNode)u.rotateLocal(e,n);else{var c=s.create();s.fromEuler(c,n[0],n[1],n[2]);var l=u.getRotation(e),h=u.getRotation(e.parentNode);s.copy(t,h),s.invert(t,t),s.multiply(t,t,c),s.multiply(a.localRotation,c,l),s.normalize(a.localRotation,a.localRotation),u.dirtifyLocal(e,a)}}),this.rotateLocal=(e=s.create(),function(t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof n&&(n=o.fromValues(n,r,i));var a=t.transformable;s.fromEuler(e,n[0],n[1],n[2]),s.mul(a.localRotation,a.localRotation,e),u.dirtifyLocal(t,a)}),this.setEulerAngles=(n=s.create(),function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof e&&(e=o.fromValues(e,r,i));var a=t.transformable;if(null===t.parentNode)u.setLocalEulerAngles(t,e);else{s.fromEuler(a.localRotation,e[0],e[1],e[2]);var c=u.getRotation(t.parentNode);s.copy(n,s.invert(s.create(),c)),s.mul(a.localRotation,a.localRotation,n),u.dirtifyLocal(t,a)}}),this.translateLocal=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=o.fromValues(e,n,r));var i=t.transformable;o.equals(e,o.create())||(o.transformQuat(e,e,i.localRotation),o.add(i.localPosition,i.localPosition,e),u.dirtifyLocal(t,i))},this.setPosition=(r=i.create(),function(t,e){var n=t.transformable;if(e=o.fromValues(e[0],e[1],e[2]||n.position[2]),!o.equals(u.getPosition(t),e)){if(n.position=e,null===t.parentNode)o.copy(n.localPosition,e);else{var a=t.parentNode.transformable;i.copy(r,a.worldTransform),i.invert(r,r),o.transformMat4(n.localPosition,e,r)}u.dirtifyLocal(t,n)}}),this.translate=(a=o.create(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=o.fromValues(e,n,r)),o.equals(e,o.create())||(o.add(a,u.getPosition(t),e),u.setPosition(t,a))})}return t.prototype.matches=function(t,e){return this.sceneGraphSelectorFactory().is(t,e)},t.prototype.querySelector=function(t,e){return this.sceneGraphSelectorFactory().selectOne(t,e)},t.prototype.querySelectorAll=function(t,e){return this.sceneGraphSelectorFactory().selectAll(t,e)},t.prototype.attach=function(t,e,n){t.parentNode&&this.detach(t),t.parentNode=e,P(n)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(n,0,t);var r=e.sortable;r&&(r.dirty=!0),this.updateGraphDepth(t);var i=t.transformable;i&&this.dirtifyWorld(t,i),i.frozen&&this.unfreezeParentToRoot(t)},t.prototype.detach=function(t){if(t.parentNode){var e=t.transformable;if(e){var n=this.getWorldTransform(t,e);i.getScaling(e.localScale,n),i.getTranslation(e.localPosition,n),i.getRotation(e.localRotation,n),e.localDirtyFlag=!0}var r=t.parentNode.sortable;r&&(r.dirty=!0);var o=t.parentNode.childNodes.indexOf(t);o>-1&&t.parentNode.childNodes.splice(o,1),e&&this.dirtifyWorld(t,e),t.parentNode=null}},t.prototype.getOrigin=function(t){return t.transformable.origin},t.prototype.setOrigin=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=o.fromValues(e,n,r));var i=t.transformable;if(!o.equals(e,i.origin)){var a=i.origin;a[0]=e[0],a[1]=e[1],a[2]=e[2]||0,this.dirtifyLocal(t,i)}},t.prototype.setLocalEulerAngles=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=o.fromValues(e,n,r));var i=t.transformable;s.fromEuler(i.localRotation,e[0],e[1],e[2]),this.dirtifyLocal(t,i)},t.prototype.setLocalPosition=function(t,e){var n=t.transformable;e=o.fromValues(e[0],e[1],e[2]||n.localPosition[2]),o.equals(n.localPosition,e)||(o.copy(n.localPosition,e),this.dirtifyLocal(t,n))},t.prototype.scaleLocal=function(t,e){var n=t.transformable;o.multiply(n.localScale,n.localScale,o.fromValues(e[0],e[1],e[2]||1)),this.dirtifyLocal(t,n)},t.prototype.setLocalScale=function(t,e){var n=t.transformable,r=o.fromValues(e[0],e[1],e[2]||n.localScale[2]);o.equals(r,n.localScale)||(o.copy(n.localScale,r),this.dirtifyLocal(t,n))},t.prototype.dirtifyLocal=function(t,e){e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))},t.prototype.dirtifyWorld=function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),t.emit(Ki.BOUNDS_CHANGED,{affectChildren:!0})},t.prototype.getPosition=function(t){var e=t.transformable;return i.getTranslation(e.position,this.getWorldTransform(t,e))},t.prototype.getRotation=function(t){var e=t.transformable;return i.getRotation(e.rotation,this.getWorldTransform(t,e))},t.prototype.getScale=function(t){var e=t.transformable;return i.getScaling(e.scaling,this.getWorldTransform(t,e))},t.prototype.getWorldTransform=function(t,e){return void 0===e&&(e=t.transformable),e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&this.getWorldTransform(t.parentNode),this.sync(t,e),e.worldTransform):e.worldTransform},t.prototype.getLocalPosition=function(t){return t.transformable.localPosition},t.prototype.getLocalRotation=function(t){return t.transformable.localRotation},t.prototype.getLocalScale=function(t){return t.transformable.localScale},t.prototype.getLocalTransform=function(t){var e=t.transformable;return e.localDirtyFlag&&(i.fromRotationTranslationScaleOrigin(e.localTransform,e.localRotation,e.localPosition,e.localScale,e.origin),e.localDirtyFlag=!1),e.localTransform},t.prototype.resetLocalTransform=function(t){this.setLocalScale(t,[1,1,1]),this.setLocalPosition(t,[0,0,0]),this.setLocalEulerAngles(t,[0,0,0])},t.prototype.getTransformedGeometryBounds=function(t,e){void 0===e&&(e=!1);var n=this.getGeometryBounds(t,e);if(n){var r=new Hi;return r.setFromTransformedAABB(n,this.getWorldTransform(t)),r}return null},t.prototype.getGeometryBounds=function(t,e){void 0===e&&(e=!1);var n=t.geometry,r=e?n.renderBounds:n.contentBounds||null;return r&&new Hi(r.center,r.halfExtents)||null},t.prototype.getBounds=function(t,e){var n=this;void 0===e&&(e=!1);var r=t.renderable;if(!r.boundsDirty&&!e&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&e&&r.renderBounds)return r.renderBounds;var i=this.getTransformedGeometryBounds(t,e);t.childNodes.forEach((function(t){var r=n.getBounds(t,e);r&&(i?i.add(r):(i=new Hi).update(r.center,r.halfExtents))}));var o=t.style.clipPath;if(o){var a=this.getTransformedGeometryBounds(o,!0),s=void 0;a&&(s=new Hi).setFromTransformedAABB(a,this.getWorldTransform(t)),i?s&&(i=s.intersection(i)):i=s}return i&&(e?r.renderBounds=i:r.bounds=i),e?r.renderBoundsDirty=!1:r.boundsDirty=!1,i||null},t.prototype.getLocalBounds=function(t){if(t.parentNode){var e=i.create();t.parentNode.transformable&&(e=i.invert(i.create(),this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(n){var r=new Hi;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)},t.prototype.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t);i&&(r=new Hi).setFromTransformedAABB(i,this.getWorldTransform(t));var o=null===(n=null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)||void 0===n?void 0:n.getContextService().getBoundingClientRect();if(r){var a=T(r.getMin(),2),s=a[0],u=a[1],c=T(r.getMax(),2),l=c[0],h=c[1];return new oo(s+((null==o?void 0:o.left)||0),u+((null==o?void 0:o.top)||0),l-s,h-u)}return new oo((null==o?void 0:o.left)||0,(null==o?void 0:o.top)||0,0,0)},t.prototype.dirtifyWorldInternal=function(t,e){var n=this;e.dirtyFlag||(e.dirtyFlag=!0,e.frozen=!1,t.childNodes.forEach((function(t){var e=t.transformable;e.dirtyFlag||n.dirtifyWorldInternal(t,e)})),t.emit(Ki.ATTRIBUTE_CHANGED,{attributeName:"modelMatrix",oldValue:null,newValue:null}))},t.prototype.syncHierarchy=function(t){var e=t.transformable;if(!e.frozen){e.frozen=!0,(e.localDirtyFlag||e.dirtyFlag)&&this.sync(t,e);for(var n=t.childNodes,r=0;r<n.length;r++)this.syncHierarchy(n[r])}},t.prototype.sync=function(t,e){if(e.localDirtyFlag&&(i.fromRotationTranslationScaleOrigin(e.localTransform,e.localRotation,e.localPosition,e.localScale,e.origin),e.localDirtyFlag=!1),e.dirtyFlag){var n=t.parentNode,r=n&&n.transformable;null!==n&&r?i.multiply(e.worldTransform,r.worldTransform,e.localTransform):i.copy(e.worldTransform,e.localTransform),e.dirtyFlag=!1}},t.prototype.updateGraphDepth=function(t){var e=t.transformable;t.parentNode?e.graphDepth=t.parentNode.transformable.graphDepth+1:e.graphDepth=0;for(var n=t.childNodes,r=0;r<n.length;r++)this.updateGraphDepth(n[r])},t.prototype.unfreezeParentToRoot=function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}},y([Object(c.inject)(so),g("design:type",Function)],t.prototype,"sceneGraphSelectorFactory",void 0),t=y([Object(c.singleton)()],t)}(),yo="GeometryUpdaterFactory",go="GeometryAABBGenerator";!function(t){t.Group="group",t.Circle="circle",t.Ellipse="ellipse",t.Image="image",t.Rect="rect",t.Line="line",t.Polyline="polyline",t.Polygon="polygon",t.Text="text",t.Path="path",t.HTML="html"}(ho||(ho={}));var vo="CanvasConfig",mo=function(){function t(){}return t.prototype.update=function(t){var e=t.r,n=void 0===e?0:e,r=t.x,i=void 0===r?0:r,o=t.y;return{width:2*n,height:2*n,x:i,y:void 0===o?0:o}},t=y([Object(c.singleton)({token:{token:go,named:ho.Circle}})],t)}(),bo=function(){function t(){}return t.prototype.update=function(t){var e=t.rx,n=void 0===e?0:e,r=t.ry,i=void 0===r?0:r,o=t.x,a=void 0===o?0:o,s=t.y;return{width:2*n,height:2*i,x:a,y:void 0===s?0:s}},t=y([Object(c.singleton)({token:{token:go,named:ho.Ellipse}})],t)}(),To=function(){function t(){}return t.prototype.update=function(t){var e,n,r=t.img,i=t.x,o=void 0===i?0:i,a=t.y,s=void 0===a?0:a,u=t.width,c=void 0===u?0:u,l=t.height,h=void 0===l?0:l;return r&&!D(r)&&(t.width||(e=r.width),t.height||(n=r.height)),{width:e||c,height:n||h,x:o,y:s}},t=y([Object(c.singleton)({token:[{token:go,named:ho.Rect},{token:go,named:ho.Image}]})],t)}(),Eo=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];function Mo(t){var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,o=t.fontWeight,a=L(e)?e+"px":e,s=n;Array.isArray(n)||(s=n.split(","));for(var u=s.length-1;u>=0;u--){var c=s[u].trim();!/([\"\'])[^\'\"]+\1/.test(c)&&Eo.indexOf(c)<0&&(c='"'+c+'"'),s[u]=c}return r+" "+i+" "+o+" "+a+" "+s.join(",")}var wo,_o=function(){function t(){}return t.prototype.getOrCreateCanvas=function(){if(this.canvas)return this.canvas;try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d"),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d")}return this.canvas.width=10,this.canvas.height=10,this.canvas},t.prototype.getOrCreateContext=function(){return this.context||this.getOrCreateCanvas(),this.context},t=y([Object(c.singleton)()],t)}(),xo={MetricsString:"|ÉqÅ",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},Ao=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,Po=new RegExp(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source+"|"+/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source+"|"+/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source+"|"+/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source),So=new RegExp(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source+"|"+/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source+"|"+/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source+"|"+/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source),Oo=function(){function t(){var t=this;this.cache={},this.shouldBreakByKinsokuShorui=function(e,n){return!t.isBreakingSpace(n)&&!(!e||!So.exec(n)&&!Po.exec(e))},this.trimByKinsokuShorui=function(t){var e=E([],T(t),!1),n=e[e.length-2];if(!n)return t;var r=n[n.length-1];return e[e.length-2]=n.slice(0,-1),e[e.length-1]=r+e[e.length-1],e}}return t.prototype.measureFont=function(t){if(this.cache[t])return this.cache[t];var e={ascent:0,descent:0,fontSize:0},n=this.offscreenCanvas.getOrCreateCanvas(),r=this.offscreenCanvas.getOrCreateContext();r.font=t;var i=xo.MetricsString+xo.BaselineSymbol,o=Math.ceil(r.measureText(i).width),a=Math.ceil(r.measureText(xo.BaselineSymbol).width),s=xo.HeightMultiplier*a;a=a*xo.BaselineMultiplier|0,n.width=o,n.height=s,r.fillStyle="#f00",r.fillRect(0,0,o,s),r.font=t,r.textBaseline="alphabetic",r.fillStyle="#000",r.fillText(i,0,a);var u=r.getImageData(0,0,o,s).data,c=u.length,l=4*o,h=0,f=0,p=!1;for(h=0;h<a;++h){for(var d=0;d<l;d+=4)if(255!==u[f+d]){p=!0;break}if(p)break;f+=l}for(e.ascent=a-h,f=c-l,p=!1,h=s;h>a;--h){for(d=0;d<l;d+=4)if(255!==u[f+d]){p=!0;break}if(p)break;f-=l}return e.descent=h-a,e.fontSize=e.ascent+e.descent,this.cache[t]=e,e},t.prototype.measureText=function(t,e){var n=e.fontSize,r=void 0===n?0:n,i=e.wordWrap,o=e.lineHeight,a=void 0===o?0:o,s=e.lineWidth,u=void 0===s?0:s,c=e.textBaseline,l=e.textAlign,h=e.letterSpacing,f=void 0===h?0:h,p=e.dropShadow,d=e.dropShadowDistance,y=void 0===d?0:d,g=e.leading,v=void 0===g?0:g,m=Mo(e),b=this.measureFont(m);0===b.fontSize&&(b.fontSize=r,b.ascent=r);var T=this.offscreenCanvas.getOrCreateContext();T.font=m;for(var E=(i?this.wordWrap(t,e):t).split(/(?:\r\n|\r|\n)/),M=new Array(E.length),w=0,_=0;_<E.length;_++){var x=T.measureText(E[_]).width+(E[_].length-1)*f;M[_]=x,w=Math.max(w,x)}var A=w+u;p&&(A+=y);var P=a||b.fontSize+u,S=Math.max(P,b.fontSize+u)+(E.length-1)*(P+v);p&&(S+=y);var O=0;return"middle"===c?O=-S/2:"bottom"===c||"alphabetic"===c||"ideographic"===c?O=-S:"top"!==c&&"hanging"!==c||(O=0),{font:m,width:A,height:S,lines:E,lineWidths:M,lineHeight:P+=v,maxLineWidth:w,fontProperties:b,lineMetrics:M.map((function(t,e){var n=0;return"center"===l?n-=t/2:"right"!==l&&"end"!==l||(n-=t),new oo(n-u/2,O+e*P,t+u,P)}))}},t.prototype.wordWrap=function(t,e){var n=this,r=e.wordWrapWidth,i=void 0===r?0:r,o=e.letterSpacing,a=void 0===o?0:o,s=this.offscreenCanvas.getOrCreateContext(),u=i+a,c=[],l=0,h=0,f={},p=function(t){return n.getFromCache(t,a,f,s)};return Array.from(t).forEach((function(e,r){var i=t[r-1],o=t[r+1],a=p(e);if(n.isNewline(e))return l++,h=0,void(c[l]="");if(h>0&&h+a>u){if(l++,h=0,c[l]="",n.isBreakingSpace(e))return;n.canBreakInLastChar(e)||(c=n.trimToBreakable(c),h=n.sumTextWidthByCache(c[l]||"",f)),n.shouldBreakByKinsokuShorui(e,o)&&(c=n.trimByKinsokuShorui(c),h+=p(i||""))}h+=a,c[l]=(c[l]||"")+e})),c.join("\n")},t.prototype.isBreakingSpace=function(t,e){return"string"==typeof t&&xo.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},t.prototype.isNewline=function(t){return"string"==typeof t&&xo.Newlines.indexOf(t.charCodeAt(0))>=0},t.prototype.trimToBreakable=function(t){var e=E([],T(t),!1),n=e[e.length-2],r=this.findBreakableIndex(n);if(-1===r||!n)return e;var i=n.slice(r,r+1),o=r+1,a=r+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=n.slice(o,n.length),e[e.length-2]=n.slice(0,a),e},t.prototype.canBreakInLastChar=function(t){return!t||!Ao.test(t)},t.prototype.sumTextWidthByCache=function(t,e){return t.split("").reduce((function(t,n){if(!e[n])throw Error("cannot count the word without cache");return t+e[n]}),0)},t.prototype.findBreakableIndex=function(t){for(var e=t.length-1;e>=0;e--)if(!Ao.test(t[e]))return e;return-1},t.prototype.getFromCache=function(t,e,n,r){var i=n[t];if("number"!=typeof i){var o=t.length*e;i=r.measureText(t).width+o,n[t]=i}return i},y([Object(c.inject)(_o),g("design:type",_o)],t.prototype,"offscreenCanvas",void 0),t=y([Object(c.singleton)()],t)}(),No=function(){function t(){}return t.prototype.update=function(t){var e=t.text,n=void 0===e?"":e,r=t.textAlign,i=t.lineWidth,a=void 0===i?0:i,s=t.textBaseline,u=t.x,c=void 0===u?0:u,l=t.y,h=void 0===l?0:l,f=this.textService.measureText(n,t);t.metrics=f;var p=f.width,d=f.height,y=f.lineHeight,g=f.fontProperties,v=o.fromValues(p/2,d/2,0),m=[0,1],b=0;"center"===r?(b=a/2,m=[.5,1]):"right"!==r&&"end"!==r||(b=a,m=[1,1]),t.anchor=m;var T=0;return"middle"===s?T=v[1]:"top"===s||"hanging"===s?T=2*v[1]:"alphabetic"===s?T=y-g.ascent:"bottom"!==s&&"ideographic"!==s||(T=0),{width:2*v[0],height:2*v[1],x:c,y:h,offsetX:b,offsetY:T}},y([Object(c.inject)(Oo),g("design:type",Oo)],t.prototype,"textService",void 0),t=y([Object(c.singleton)({token:{token:go,named:ho.Text}})],t)}(),Co=function(){function t(){}return t.prototype.update=function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2,o=Math.min(e,r),a=Math.max(e,r),s=Math.min(n,i);return{width:a-o,height:Math.max(n,i)-s,x:o,y:s}},t=y([Object(c.singleton)({token:{token:go,named:ho.Line}})],t)}(),Io=function(){function t(){}return t.prototype.update=function(t){var e=t.points.points,n=Math.min.apply(Math,E([],T(e.map((function(t){return t[0]}))),!1)),r=Math.max.apply(Math,E([],T(e.map((function(t){return t[0]}))),!1)),i=Math.min.apply(Math,E([],T(e.map((function(t){return t[1]}))),!1));return{width:r-n,height:Math.max.apply(Math,E([],T(e.map((function(t){return t[1]}))),!1))-i,x:n,y:i}},t=y([Object(c.singleton)({token:[{token:go,named:ho.Polyline},{token:go,named:ho.Polygon}]})],t)}(),Ro=function(){function t(){}return t.prototype.update=function(t,e){var n=t.path.rect,r=n.x,i=n.y;return{width:n.width,height:n.height,x:r,y:i}},t=y([Object(c.singleton)({token:{token:go,named:ho.Path}})],t)}(),ko="StylePropertyParser",Do="StylePropertyParserFactory",jo="StylePropertyUpdater",Bo="StylePropertyUpdaterFactory",Lo="StylePropertyMerger",Fo="StylePropertyMergerFactory",Go=function(){function t(e){this.eventPhase=t.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new io,this.page=new io,this.canvas=new io,this.viewport=new io,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}return Object.defineProperty(t.prototype,"name",{get:function(){return this.type},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"originalEvent",{get:function(){return this.nativeEvent},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layerX",{get:function(){return this.layer.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layerY",{get:function(){return this.layer.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageX",{get:function(){return this.page.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageY",{get:function(){return this.page.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvasX",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvasY",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewportX",{get:function(){return this.viewport.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewportY",{get:function(){return this.viewport.y},enumerable:!1,configurable:!0}),t.prototype.composedPath=function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path},Object.defineProperty(t.prototype,"propagationPath",{get:function(){return this.composedPath()},enumerable:!1,configurable:!0}),t.prototype.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},t.prototype.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t.prototype.initEvent=function(){},t.prototype.initUIEvent=function(){},t}(),Vo=function(t){function e(e,n){var r=t.call(this,null)||this;return r.type=e,r.detail=n,Object.assign(r,n),r}return f(e,t),e}(Go),Uo=":",qo=function(){function t(){this.emitter=new l.EventEmitter}return t.prototype.on=function(t,e,n){return this.addEventListener(t,e,n),this},t.prototype.addEventListener=function(t,e,n){var r=q(n)&&n||O(n)&&n.capture,i=O(n)&&n.once,o=A(e)?void 0:e,a=!1,s="";if(t.indexOf(Uo)>-1){var u=T(t.split(Uo),2),c=u[0];t=u[1],s=c,a=!0}if(t=r?t+"capture":t,e=A(e)?e:e.handleEvent,a){var l=e;e=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];(null===(t=e[0].target)||void 0===t?void 0:t.name)===s&&l.apply(void 0,E([],T(e),!1))}}return i?this.emitter.once(t,e,o):this.emitter.on(t,e,o),this},t.prototype.off=function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this},t.prototype.removeAllEventListeners=function(){this.emitter.removeAllListeners()},t.prototype.removeEventListener=function(t,e,n){var r=q(n)&&n||O(n)&&n.capture,i=A(e)?void 0:e;return t=r?t+"capture":t,e=A(e)?e:e.handleEvent,this.emitter.off(t,e,i),this},t.prototype.emit=function(t,e){this.dispatchEvent(new Vo(t,e))},t.prototype.dispatchEvent=function(t){var e,n;if(!(t instanceof Go))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");var r=this.ownerDocument||this.document;return r&&(t.manager=(null===(e=r.defaultView)||void 0===e?void 0:e.getEventService())||null,t.defaultPrevented=!1,t.path=[],t.target=this,null===(n=t.manager)||void 0===n||n.dispatchEvent(t)),!t.defaultPrevented},t}(),zo=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.shadow=!1,e.ownerDocument=null,e.isConnected=!1,e.baseURI="",e.childNodes=[],e.nodeType=0,e.nodeName="",e.nodeValue=null,e.textContent=null,e.parentNode=null,e}return f(e,t),e.isNode=function(t){return!!t.childNodes},e.prototype.getRootNode=function(t){for(var e=this;e.parentNode;)e=e.parentNode;return e},e.prototype.hasChildNodes=function(){return this.childNodes.length>0},e.prototype.isDefaultNamespace=function(t){throw new Error("Method not implemented.")},e.prototype.compareDocumentPosition=function(t){throw new Error("Method not implemented.")},e.prototype.lookupNamespaceURI=function(t){throw new Error("Method not implemented.")},e.prototype.lookupPrefix=function(t){throw new Error("Method not implemented.")},e.prototype.normalize=function(){throw new Error("Method not implemented.")},e.prototype.isEqualNode=function(t){return this===t},e.prototype.isSameNode=function(t){return this.isEqualNode(t)},Object.defineProperty(e.prototype,"parent",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentElement",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstChild",{get:function(){return this.childNodes.length>0?this.childNodes[0]:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastChild",{get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null},enumerable:!1,configurable:!0}),e.prototype.contain=function(t){return this.contains(t)},e.prototype.contains=function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e},e.prototype.getAncestor=function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e},e.prototype.forEach=function(t){t(this)||this.childNodes.forEach((function(e){e.forEach(t)}))},e}(qo),Wo=function(){function t(){}return t.tag="c-geometry",t}(),Ho=function(){function t(){this.boundsDirty=!0,this.renderBoundsDirty=!0,this.dirty=!1}return t.tag="c-renderable",t}(),Yo=function(){function t(){this.dirtyFlag=!1,this.localDirtyFlag=!1,this.frozen=!1,this.graphDepth=0,this.localPosition=o.fromValues(0,0,0),this.localRotation=s.fromValues(0,0,0,1),this.localScale=o.fromValues(1,1,1),this.localTransform=i.create(),this.position=o.fromValues(0,0,0),this.rotation=s.fromValues(0,0,0,1),this.scaling=o.fromValues(1,1,1),this.worldTransform=i.create(),this.origin=o.fromValues(0,0,0)}return t.tag="c-transform",t}();!function(t){t[t.Standard=0]="Standard"}(wo||(wo={}));var $o=function(){function t(){this.strategy=wo.Standard,this.visibilityPlaneMask=-1,this.visible=!0,this.enable=!0}return t.prototype.isCulled=function(){return this.enable&&!this.visible},t.tag="c-cullable",t}(),Xo=function(){function t(){this.dirty=!1}return t.tag="c-sortable",t}(),Ko=0,Jo=function(t){function e(e){var n=t.call(this)||this;return n.sceneGraphService=ol.get(fo),n.entity=Ko++,n.renderable=new Ho,n.cullable=new $o,n.transformable=new Yo,n.sortable=new Xo,n.geometry=new Wo,n.scrollLeft=0,n.scrollTop=0,n.destroyed=!1,n.style={},n.parsedStyle={},n.attributes={},n}return f(e,t),e.isElement=function(t){return!!t.getAttribute},Object.defineProperty(e.prototype,"classList",{get:function(){return this.className.split(" ")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tagName",{get:function(){return this.nodeName},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentElement",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]||null}return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t-1]||null}return null},enumerable:!1,configurable:!0}),e.prototype.cloneNode=function(t){throw new Error("Method not implemented.")},e.prototype.appendChild=function(t,e){return this.sceneGraphService.attach(t,this,e),this.emit(Ki.CHILD_INSERTED,{child:t}),t.emit(Ki.INSERTED,{parent:this}),t},e.prototype.insertBefore=function(t,e){if(e){var n=this.childNodes.indexOf(e);this.appendChild(t,n-1)}else this.appendChild(t);return t},e.prototype.replaceChild=function(t,e,n){var r=this.childNodes.indexOf(e);return this.removeChild(e,n),this.appendChild(t,r),e},e.prototype.removeChild=function(t,e){return void 0===e&&(e=!0),t.emit(Ki.REMOVED,{parent:this}),e&&(t.emit(Ki.DESTROY,{}),t.destroyed=!0),this.emit(Ki.CHILD_REMOVED,{child:t}),this.sceneGraphService.detach(t),e&&t.emitter.removeAllListeners(),t},e.prototype.removeChildren=function(t){var e=this;void 0===t&&(t=!0),this.childNodes.slice().forEach((function(n){e.removeChild(n,t)}))},e.prototype.matches=function(t){return this.sceneGraphService.matches(t,this)},e.prototype.getElementById=function(t){return this.sceneGraphService.querySelector("#"+t,this)},e.prototype.getElementsByName=function(t){return this.sceneGraphService.querySelectorAll('[name="'+t+'"]',this)},e.prototype.getElementsByClassName=function(t){return this.sceneGraphService.querySelectorAll("."+t,this)},e.prototype.getElementsByTagName=function(t){return this.sceneGraphService.querySelectorAll(t,this)},e.prototype.querySelector=function(t){return this.sceneGraphService.querySelector(t,this)},e.prototype.querySelectorAll=function(t){return this.sceneGraphService.querySelectorAll(t,this)},e.prototype.find=function(t){var e=this,n=null;return this.forEach((function(r){return!(r===e||!t(r))&&(n=r,!0)})),n},e.prototype.findAll=function(t){var e=this,n=[];return this.forEach((function(r){r!==e&&t(r)&&n.push(r)})),n},e.prototype.after=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(this.parentNode){var r=this.parentNode.childNodes.indexOf(this);e.forEach((function(e,n){var i;return null===(i=t.parentNode)||void 0===i?void 0:i.appendChild(e,r+n+1)}))}},e.prototype.before=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(this.parentNode){var n=this.parentNode.childNodes.indexOf(this),r=T(t),i=r[0],o=r.slice(1);this.parentNode.appendChild(i,n),i.after.apply(i,E([],T(o),!1))}},e.prototype.replaceWith=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.after.apply(this,E([],T(t),!1)),this.remove()},e.prototype.append=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];e.forEach((function(e){return t.appendChild(e)}))},e.prototype.prepend=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];e.forEach((function(e,n){return t.appendChild(e,n)}))},e.prototype.replaceChildren=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,E([],T(t),!1))},e.prototype.remove=function(t){return void 0===t&&(t=!0),this.parentNode?this.parentNode.removeChild(this,t):this},e.prototype.destroy=function(){this.emit(Ki.DESTROY,{}),this.remove(!1),this.emitter.removeAllListeners(),this.destroyed=!0},e.prototype.getGeometryBounds=function(){return this.sceneGraphService.getGeometryBounds(this)},e.prototype.getRenderBounds=function(){return this.sceneGraphService.getBounds(this,!0)},e.prototype.getBounds=function(){return this.sceneGraphService.getBounds(this)},e.prototype.getLocalBounds=function(){return this.sceneGraphService.getLocalBounds(this)},e.prototype.getBoundingClientRect=function(){return this.sceneGraphService.getBoundingClientRect(this)},e.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},e.prototype.getAttribute=function(t){var e=this.attributes[t];return P(e)?void 0:e},e.prototype.removeAttribute=function(t){delete this.attributes[t]},e.prototype.setAttribute=function(t,e,n){void 0===n&&(n=!1),this.attributes[t]=e},e}(zo),Zo=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o.currentTime=r,o.timelineTime=i,o.target=n,o.type="finish",o.bubbles=!1,o.currentTarget=n,o.defaultPrevented=!1,o.eventPhase=o.AT_TARGET,o.timeStamp=Date.now(),o.currentTime=r,o.timelineTime=i,o}return f(e,t),e}(Go),Qo=0,ta=function(){function t(t,e){this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,this.effect=t,t.animation=this,this.timeline=e,this.id=""+Qo++,this._inEffect=!!this.effect.update(0),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}return Object.defineProperty(t.prototype,"pending",{get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playState",{get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ready",{get:function(){var t=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise((function(e,n){t.resolveReadyPromise=function(){e(t)},t.rejectReadyPromise=function(){n(new Error)}})),this.pending||this.resolveReadyPromise()),this.readyPromise},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"finished",{get:function(){var t=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise((function(e,n){t.resolveFinishedPromise=function(){e(t)},t.rejectFinishedPromise=function(){n(new Error)}})),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentTime",{get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){var e;t=Number(t),isNaN(t)||(this.timeline.restart(),this._paused||null===this._startTime||(this._startTime=Number(null===(e=this.timeline)||void 0===e?void 0:e.currentTime)-t/this.playbackRate),this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this)))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"startTime",{get:function(){return this._startTime},set:function(t){if(null!==t){if(this.updatePromises(),t=Number(t),isNaN(t))return;if(this._paused||this._idle)return;this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playbackRate",{get:function(){return this._playbackRate},set:function(t){if(t!==this._playbackRate){this.updatePromises();var e=this.currentTime;this._playbackRate=t,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==e&&(this.currentTime=e),this.updatePromises()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_isFinished",{get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this.totalDuration||this._playbackRate<0&&Number(this._currentTime)<=0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"totalDuration",{get:function(){var t;return Number(null===(t=this.effect)||void 0===t?void 0:t.getComputedTiming().activeDuration)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_needsTick",{get:function(){return this.pending||"running"===this.playState||!this._finishedFlag},enumerable:!1,configurable:!0}),t.prototype.updatePromises=function(){var t=this.oldPlayState,e=this.pending?"pending":this.playState;return this.readyPromise&&e!==t&&("idle"===e?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===t?this.resolveReadyPromise():"pending"===e&&(this.readyPromise=void 0)),this.finishedPromise&&e!==t&&("idle"===e?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===e?this.resolveFinishedPromise():"finished"===t&&(this.finishedPromise=void 0)),this.oldPlayState=e,this.readyPromise||this.finishedPromise},t.prototype.play=function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),-1===this.timeline.animations.indexOf(this)&&this.timeline.animations.push(this),this.updatePromises()},t.prototype.pause=function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._isFinished||this._paused||this._idle?this._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,this._startTime=null,this._paused=!0,this.updatePromises()},t.prototype.finish=function(){this.updatePromises(),this._idle||(this.currentTime=this._playbackRate>0?this.totalDuration:0,this._startTime=this.totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())},t.prototype.cancel=function(){this.updatePromises(),this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises())},t.prototype.reverse=function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()},t.prototype.updatePlaybackRate=function(t){this.playbackRate=t},t.prototype.targetAnimations=function(){var t;return(null===(t=this.effect)||void 0===t?void 0:t.target).getAnimations()},t.prototype.markTarget=function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)},t.prototype.unmarkTarget=function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)},t.prototype.tick=function(t,e){this._idle||this._paused||(null===this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this.currentTimePending=!1,this.fireEvents(t))},t.prototype.rewind=function(){if(this.playbackRate>=0)this.currentTime=0;else{if(!(this.totalDuration<1/0))throw new Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this.totalDuration}},t.prototype.persist=function(){throw new Error("Method not implemented.")},t.prototype.addEventListener=function(t,e,n){throw new Error("Method not implemented.")},t.prototype.removeEventListener=function(t,e,n){throw new Error("Method not implemented.")},t.prototype.dispatchEvent=function(t){throw new Error("Method not implemented.")},t.prototype.commitStyles=function(){throw new Error("Method not implemented.")},t.prototype.ensureAlive=function(){var t,e;this.playbackRate<0&&0===this.currentTime?this._inEffect=!!(null===(t=this.effect)||void 0===t?void 0:t.update(-1)):this._inEffect=!!(null===(e=this.effect)||void 0===e?void 0:e.update(this.currentTime)),this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))},t.prototype.tickCurrentTime=function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this.totalDuration:0),this.ensureAlive())},t.prototype.fireEvents=function(t){var e=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var n=new Zo(null,this,this.currentTime,t);setTimeout((function(){e.onfinish&&e.onfinish(n)}))}this._finishedFlag=!0}}else{if(this.onframe&&"running"===this.playState){var r=new Zo(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}},t}();function ea(t){return("object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:function(t){return setTimeout(t,16)})(t)}function na(t){return("object"==typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame:clearTimeout)(t)}function ra(t,e){return Number(t.id)-Number(e.id)}var ia=function(){function t(){var t=this;this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.webAnimationsNextTick=function(e){t.currentTime=e,t.discardAnimations(),0===t.animations.length?t.timelineTicking=!1:t.requestAnimationFrame(t.webAnimationsNextTick)},this.processRafCallbacks=function(e){var n=t.rafCallbacks;t.rafCallbacks=[],e<Number(t.currentTime)&&(e=Number(t.currentTime)),t.animations.sort(ra),t.animations=t.tick(e,!0,t.animations)[0],n.forEach((function(t){t[1](e)})),t.applyPendingEffects()}}return t.prototype.getAnimations=function(){return this.discardAnimations(),this.animations.slice()},t.prototype.isTicking=function(){return this.inTick},t.prototype.play=function(t){var e=new ta(t,this);return this.animations.push(e),this.restartWebAnimationsNextTick(),e.updatePromises(),e.play(),e.updatePromises(),e},t.prototype.applyDirtiedAnimation=function(t){var e=this;if(!this.inTick){t.markTarget();var n=t.targetAnimations();n.sort(ra),this.tick(Number(this.currentTime),!1,n.slice())[1].forEach((function(t){var n=e.animations.indexOf(t);-1!==n&&e.animations.splice(n,1)})),this.applyPendingEffects()}},t.prototype.restart=function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame((function(){})),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame},t.prototype.destroy=function(){na(this.frameId)},t.prototype.applyPendingEffects=function(){this.pendingEffects.forEach((function(t){null==t||t.applyInterpolations()})),this.pendingEffects=[]},t.prototype.updateAnimationsPromises=function(){this.animationsWithPromises=this.animationsWithPromises.filter((function(t){return t.updatePromises()}))},t.prototype.discardAnimations=function(){this.updateAnimationsPromises(),this.animations=this.animations.filter((function(t){return"finished"!==t.playState&&"idle"!==t.playState}))},t.prototype.restartWebAnimationsNextTick=function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))},t.prototype.rAF=function(t){var e=this.rafId++;return 0===this.rafCallbacks.length&&(this.frameId=ea(this.processRafCallbacks)),this.rafCallbacks.push([e,t]),e},t.prototype.requestAnimationFrame=function(t){var e=this;return this.rAF((function(n){e.updateAnimationsPromises(),t(n),e.updateAnimationsPromises()}))},t.prototype.tick=function(t,e,n){var r,i,o=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var a=[],s=[],u=[],c=[];return n.forEach((function(n){n.tick(t,e),n._inEffect?(s.push(n.effect),n.markTarget()):(a.push(n.effect),n.unmarkTarget()),n._needsTick&&(o.ticking=!0);var r=n._inEffect||n._needsTick;n._inTimeline=r,r?u.push(n):c.push(n)})),(r=this.pendingEffects).push.apply(r,E([],T(a),!1)),(i=this.pendingEffects).push.apply(i,E([],T(s),!1)),this.ticking&&this.requestAnimationFrame((function(){})),this.inTick=!1,[u,c]},t}(),oa="function"==typeof Float32Array,aa=function(t,e){return 1-3*e+3*t},sa=function(t,e){return 3*e-6*t},ua=function(t){return 3*t},ca=function(t,e,n){return((aa(e,n)*t+sa(e,n))*t+ua(e))*t},la=function(t,e,n){return 3*aa(e,n)*t*t+2*sa(e,n)*t+ua(e)},ha=function(t,e,n,r){if(!(0<=t&&t<=1&&0<=n&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(t===e&&n===r)return function(t){return t};for(var i=oa?new Float32Array(11):new Array(11),o=0;o<11;++o)i[o]=ca(.1*o,t,n);var a=function(e){for(var r=0,o=1;10!==o&&i[o]<=e;++o)r+=.1;--o;var a=r+.1*((e-i[o])/(i[o+1]-i[o])),s=la(a,t,n);return s>=.001?function(t,e,n,r){for(var i=0;i<4;++i){var o=la(e,n,r);if(0===o)return e;e-=(ca(e,n,r)-t)/o}return e}(e,a,t,n):0===s?a:function(t,e,n,r,i){var o,a,s=0;do{(o=ca(a=e+(n-e)/2,r,i)-t)>0?n=a:e=a}while(Math.abs(o)>1e-7&&++s<10);return a}(e,r,r+.1,t,n)};return function(t){return 0===t||1===t?t:ca(a(t),e,r)}},fa=function(t){return"-"===(t=t.replace(/([A-Z])/g,(function(t){return"-"+t.toLowerCase()}))).charAt(0)?t.substr(1):t},pa=function(t,e,n){return Math.min(Math.max(t,e),n)},da=function(t){return Math.pow(t,2)},ya=function(t){return Math.pow(t,3)},ga=function(t){return Math.pow(t,4)},va=function(t){return Math.pow(t,5)},ma=function(t){return Math.pow(t,6)},ba=function(t){return 1-Math.cos(t*Math.PI/2)},Ta=function(t){return 1-Math.sqrt(1-t*t)},Ea=function(t){return t*t*(3*t-2)},Ma=function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)},wa=function(t,e){void 0===e&&(e=[]);var n=T(e,2),r=n[0],i=void 0===r?1:r,o=n[1],a=void 0===o?.5:o,s=pa(Number(i),1,10),u=pa(Number(a),.1,2);return 0===t||1===t?t:-s*Math.pow(2,10*(t-1))*Math.sin((t-1-u/(2*Math.PI)*Math.asin(1/s))*(2*Math.PI)/u)},_a=function(t,e,n){void 0===e&&(e=[]);var r=T(e,4),i=r[0],o=void 0===i?1:i,a=r[1],s=void 0===a?100:a,u=r[2],c=void 0===u?10:u,l=r[3],h=void 0===l?0:l;o=pa(o,.1,1e3),s=pa(s,.1,1e3),c=pa(c,.1,1e3),h=pa(h,.1,1e3);var f=Math.sqrt(s/o),p=c/(2*Math.sqrt(s*o)),d=p<1?f*Math.sqrt(1-p*p):0,y=p<1?(p*f-h)/d:-h+f,g=n?n*t/1e3:t;return g=p<1?Math.exp(-g*p*f)*(1*Math.cos(d*g)+y*Math.sin(d*g)):(1+y*g)*Math.exp(-g*f),0===t||1===t?t:1-g},xa=(new Map,function(t,e){void 0===e&&(e=[]);var n=T(e,2),r=n[0],i=void 0===r?10:r;return("start"==n[1]?Math.ceil:Math.floor)(pa(t,0,1)*i)/i}),Aa=function(t,e){void 0===e&&(e=[]);var n=T(e,4),r=n[0],i=n[1],o=n[2],a=n[3];return ha(r,i,o,a)(t)},Pa=ha(.42,0,1,1),Sa=function(t){return function(e,n,r){return void 0===n&&(n=[]),1-t(1-e,n,r)}},Oa=function(t){return function(e,n,r){return void 0===n&&(n=[]),e<.5?t(2*e,n,r)/2:1-t(-2*e+2,n,r)/2}},Na=function(t){return function(e,n,r){return void 0===n&&(n=[]),e<.5?(1-t(1-2*e,n,r))/2:(t(2*e-1,n,r)+1)/2}},Ca={steps:xa,"step-start":function(t){return xa(t,[1,"start"])},"step-end":function(t){return xa(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":Aa,ease:function(t){return Aa(t,[.25,.1,.25,1])},in:Pa,out:Sa(Pa),"in-out":Oa(Pa),"out-in":Na(Pa),"in-quad":da,"out-quad":Sa(da),"in-out-quad":Oa(da),"out-in-quad":Na(da),"in-cubic":ya,"out-cubic":Sa(ya),"in-out-cubic":Oa(ya),"out-in-cubic":Na(ya),"in-quart":ga,"out-quart":Sa(ga),"in-out-quart":Oa(ga),"out-in-quart":Na(ga),"in-quint":va,"out-quint":Sa(va),"in-out-quint":Oa(va),"out-in-quint":Na(va),"in-expo":ma,"out-expo":Sa(ma),"in-out-expo":Oa(ma),"out-in-expo":Na(ma),"in-sine":ba,"out-sine":Sa(ba),"in-out-sine":Oa(ba),"out-in-sine":Na(ba),"in-circ":Ta,"out-circ":Sa(Ta),"in-out-circ":Oa(Ta),"out-in-circ":Na(Ta),"in-back":Ea,"out-back":Sa(Ea),"in-out-back":Oa(Ea),"out-in-back":Na(Ea),"in-bounce":Ma,"out-bounce":Sa(Ma),"in-out-bounce":Oa(Ma),"out-in-bounce":Na(Ma),"in-elastic":wa,"out-elastic":Sa(wa),"in-out-elastic":Oa(wa),"out-in-elastic":Na(wa),spring:_a,"spring-in":_a,"spring-out":Sa(_a),"spring-in-out":Oa(_a),"spring-out-in":Na(_a)},Ia=function(t){return Ca[function(t){return fa(t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()}(t)]||Ca.linear},Ra=function(t){return t};function ka(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var Da="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",ja=new RegExp("cubic-bezier\\("+Da+","+Da+","+Da+","+Da+"\\)"),Ba=/steps\(\s*(\d+)\s*\)/,La=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function Fa(t){var e=ja.exec(t);if(e)return ha.apply(void 0,E([],T(e.slice(1).map(Number)),!1));var n=Ba.exec(t);if(n)return ka(Number(n[1]),0);var r=La.exec(t);return r?ka(Number(r[1]),{start:1,middle:.5,end:0}[r[2]]):Ia(t)}function Ga(t){return Math.abs(function(t){var e;if(0===t.duration||0===t.iterations)return 0;return("auto"===t.duration?0:Number(t.duration))*(null!==(e=t.iterations)&&void 0!==e?e:1)}(t)/(t.playbackRate||1))}function Va(t,e,n){var r=function(t,e,n){if(null===e)return 0;var r=n.delay+t+n.endDelay;return e<Math.min(n.delay,r)?1:e>=Math.min(n.delay+t,r)?2:3}(t,e,n),i=function(t,e,n,r,i){switch(r){case 1:return"backwards"===e||"both"===e?0:null;case 3:return n-i;case 2:return"forwards"===e||"both"===e?t:null;case 0:return null}}(t,n.fill,e,r,n.delay);if(null===i)return null;var o="auto"===n.duration?0:n.duration,a=function(t,e,n,r,i){var o=i;return 0===t?1!==e&&(o+=n):o+=r/t,o}(o,r,n.iterations,i,n.iterationStart),s=function(t,e,n,r,i,o){var a=t===1/0?e%1:t%1;return 0!==a||2!==n||0===r||0===i&&0!==o||(a=1),a}(a,n.iterationStart,r,n.iterations,i,o),u=function(t,e,n,r){return 2===t&&e===1/0?1/0:1===n?Math.floor(r)-1:Math.floor(r)}(r,n.iterations,s,a),c=function(t,e,n){var r=t;if("normal"!==t&&"reverse"!==t){var i=e;"alternate-reverse"===t&&(i+=1),r="normal",i!==1/0&&i%2!=0&&(r="reverse")}return"normal"===r?n:1-n}(n.direction,u,s);return n.currentIteration=u,n.progress=c,n.easingFunction(c)}var Ua={in:"ease-in",out:"ease-out","in-out":"ease-in-out","in-sine":"cubic-bezier(0.47, 0, 0.745, 0.715)","out-sine":"cubic-bezier(0.39, 0.575, 0.565, 1)","in-out-sine":"cubic-bezier(0.445, 0.05, 0.55, 0.95)","in-quad":"cubic-bezier(0.55, 0.085, 0.68, 0.53)","out-quad":"cubic-bezier(0.25, 0.46, 0.45, 0.94)","in-out-quad":"cubic-bezier(0.455, 0.03, 0.515, 0.955)","in-cubic":"cubic-bezier(0.55, 0.055, 0.675, 0.19)","out-cubic":"cubic-bezier(0.215, 0.61, 0.355, 1)","in-out-cubic":"cubic-bezier(0.645, 0.045, 0.355, 1)","in-quart":"cubic-bezier(0.895, 0.03, 0.685, 0.22)","out-quart":"cubic-bezier(0.165, 0.84, 0.44, 1)","in-out-quart":"cubic-bezier(0.77, 0, 0.175, 1)","in-quint":"cubic-bezier(0.755, 0.05, 0.855, 0.06)","out-quint":"cubic-bezier(0.23, 1, 0.32, 1)","in-out-quint":"cubic-bezier(0.86, 0, 0.07, 1)","in-expo":"cubic-bezier(0.95, 0.05, 0.795, 0.035)","out-expo":"cubic-bezier(0.19, 1, 0.22, 1)","in-out-expo":"cubic-bezier(1, 0, 0, 1)","in-circ":"cubic-bezier(0.6, 0.04, 0.98, 0.335)","out-circ":"cubic-bezier(0.075, 0.82, 0.165, 1)","in-out-circ":"cubic-bezier(0.785, 0.135, 0.15, 0.86)","in-back":"cubic-bezier(0.6, -0.28, 0.735, 0.045)","out-back":"cubic-bezier(0.175, 0.885, 0.32, 1.275)","in-out-back":"cubic-bezier(0.68, -0.55, 0.265, 1.55)"},qa=(Object.keys(Ua),function(){function t(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=Ra,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null}return Object.defineProperty(t.prototype,"easing",{get:function(){return this._easing},set:function(t){this.easingFunction=Fa(t),this._easing=t},enumerable:!1,configurable:!0}),t}());function za(t,e){if(null===t)return[];Array.isArray(t)||(t=function(t){var e=[];for(var n in t)if(!(n in["easing","offset","composite"])){var r=t[n];Array.isArray(r)||(r=[r]);for(var i=r.length,o=0;o<i;o++){if(!e[o]){var a={};"offset"in t&&(a.offset=Number(t.offset)),"easing"in t&&(a.easing=t.easing),"composite"in t&&(a.composite=t.composite),e[o]=a}void 0!==r[o]&&null!==r[o]&&(e[o][n]=r[o])}}return e.sort((function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)})),e}(t));for(var n=t.map((function(t){var n={};for(var r in(null==e?void 0:e.composite)&&(n.composite="auto"),t){var i=t[r];if("offset"===r){if(null!==i){if(i=Number(i),!isFinite(i))throw new Error("Keyframe offsets must be numbers.");if(i<0||i>1)throw new Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=i}}else if("composite"===r&&-1===["replace","add","accumulate","auto"].indexOf(i))throw new Error(i+" compositing is not supported");n[r]=i}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==e?void 0:e.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n})),r=!0,i=-1/0,o=0;o<n.length;o++){var a=n[o].offset;if(null!=a){if(a<i)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");i=a}else r=!1}return n=n.filter((function(t){return Number(t.offset)>=0&&Number(t.offset)<=1})),r||function(){var t,e,r=n.length;n[r-1].computedOffset=Number(null!==(t=n[r-1].offset)&&void 0!==t?t:1),r>1&&(n[0].computedOffset=Number(null!==(e=n[0].offset)&&void 0!==e?e:0));for(var i=0,o=Number(n[0].computedOffset),a=1;a<r;a++){var s=Number(n[a].computedOffset);if(null!=s&&null!=o){for(var u=1;u<a-i;u++)n[i+u].computedOffset=o+(s-o)*u/(a-i);i=a,o=s}}}(),n}function Wa(t,e,n){var r=function(t,e){for(var n={},r=0;r<t.length;r++)for(var i in t[r])if(Ha(i)){var o={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:Fa(t[r].easing)||e.easingFunction,value:t[r][i]};n[i]=n[i]||[],n[i].push(o)}return n}(t,e),i=function(t,e){var n=[];for(var r in t)for(var i=t[r],o=0;o<i.length-1;o++){var a=o,s=o+1,u=i[a].computedOffset,c=i[s].computedOffset,l=u,h=c;0===o&&(l=-1/0,0===c&&(s=a)),o===i.length-2&&(h=1/0,1===u&&(a=s)),n.push({applyFrom:l,applyTo:h,startOffset:i[a].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[a].easingFunction,property:r,interpolation:Ya(r,i[a].value,i[s].value,e)})}return n.sort((function(t,e){return t.startOffset-e.startOffset})),n}(r,n);return function(t,e){if(null!==e)i.filter((function(t){return e>=t.applyFrom&&e<t.applyTo})).forEach((function(n){var r=e-n.startOffset,i=n.endOffset-n.startOffset,o=0===i?0:n.easingFunction(r/i);t.style[n.property]=n.interpolation(o)}));else for(var n in r)Ha(n)&&(t.style[n]=null)}}function Ha(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}function Ya(t,e,n,r){var i=e,o=n,a=ol.get(Do)(t),s=ol.get(Fo)(t);a&&(i=a(e,r),o=a(n,r));var u=s&&s(i,o,r);if(u){var c=$a.apply(void 0,E([],T(u),!1));return function(t){return 0===t?e:1===t?n:c(t)}}return $a(!1,!0,(function(t){return t?n:e}))}var $a=function(t,e,n){return function(r){return n(function t(e,n,r){if("number"==typeof e&&"number"==typeof n)return e*(1-r)+n*r;if("boolean"==typeof e&&"boolean"==typeof n||"string"==typeof e&&"string"==typeof n)return r<.5?e:n;if(Array.isArray(e)&&Array.isArray(n)&&e.length===n.length){for(var i=[],o=0;o<e.length;o++)i.push(t(e[o],n[o],r));return i}throw"Mismatched interpolation arguments "+e+":"+n}(t,e,r))}},Xa="backwards|forwards|both|none".split("|"),Ka="reverse|alternate|alternate-reverse".split("|");function Ja(t,e){var n=new qa;return e&&(n.fill="both",n.duration="auto"),"number"!=typeof t||isNaN(t)?void 0!==t&&Object.keys(t).forEach((function(e){if(void 0!==t[e]&&null!==t[e]&&"auto"!==t[e]){if(("number"==typeof n[e]||"duration"===e)&&("number"!=typeof t[e]||isNaN(t[e])))return;if("fill"===e&&-1===Xa.indexOf(t[e]))return;if("direction"===e&&-1===Ka.indexOf(t[e]))return;n[e]=t[e]}})):n.duration=t,n}function Za(t,e){return Ja(t=Qa(null!=t?t:{duration:"auto"}),e)}function Qa(t){return"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t}),t}var ts=function(){function t(t,e,n){var r=this;this.composite="replace",this.iterationComposite="replace",this.target=t,this.timing=Za(n,!1),this.timing.effect=this,this.timing.activeDuration=Ga(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=za(e,this.timing),this.interpolations=Wa(this.normalizedKeyframes,this.timing,this.target),this.computedTiming=new Proxy(this.timing,{get:function(t,e){return"duration"===e?"auto"===t.duration?0:t.duration:"fill"===e?"auto"===t.fill?"none":t.fill:"localTime"===e?r.animation&&r.animation.currentTime||null:"currentIteration"===e?r.animation&&"running"===r.animation.playState?t.currentIteration||0:null:"progress"===e?r.animation&&"running"===r.animation.playState?t.progress||0:null:t[e]},set:function(t,e,n){return!0}})}return t.prototype.applyInterpolations=function(){this.interpolations(this.target,Number(this.timeFraction))},t.prototype.update=function(t){return null!==t&&(this.timeFraction=Va(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)},t.prototype.getKeyframes=function(){return this.normalizedKeyframes},t.prototype.setKeyframes=function(t){this.normalizedKeyframes=za(t)},t.prototype.getComputedTiming=function(){return this.computedTiming},t.prototype.getTiming=function(){return this.timing},t.prototype.updateTiming=function(t){var e=this;Object.keys(t||{}).forEach((function(n){e.timing=t[n]}))},t}();function es(t){return void 0===t?0:t>360||t<-360?t%360:t}function ns(t,e,n){return L(t)?o.fromValues(t,e,n):3===t.length?o.clone(t):o.fromValues(t[0],t[1],t[2]||0)}function rs(t){return t*(Math.PI/180)}function is(t){return t*(180/Math.PI)}function os(t,e){var n=e[0],r=e[1],i=e[3],o=e[4];return t[0]=Math.hypot(n,r),t[1]=Math.hypot(i,o),t}function as(t,e){return t[0]=e[6],t[1]=e[7],t}function ss(t){return Math.atan2(t[1],t[4])}function us(t,e){return 16===e.length?function(t,e){var n,r,a,s=.5*Math.PI,u=T(i.getScaling(o.create(),e),3),c=u[0],l=u[1],h=u[2];return(r=Math.asin(-e[2]/c))<s?r>-s?(n=Math.atan2(e[6]/l,e[10]/h),a=Math.atan2(e[1]/c,e[0]/c)):(a=0,n=-Math.atan2(e[4]/l,e[5]/l)):(a=0,n=Math.atan2(e[4]/l,e[5]/l)),t[0]=n,t[1]=r,t[2]=a,t}(t,e):function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=r*r,s=i*i,u=o*o,c=n*n+a+s+u,l=n*o-r*i;return l>.499995*c?(t[0]=Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):l<-.499995*c?(t[0]=-Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-o*r)),t[1]=Math.atan2(2*(n*o+r*i),1-2*(s+u)),t[2]=Math.atan2(2*(n*r+i*o),1-2*(a+s))),t}(t,e)}function cs(t,e,n,i,o){var a=Math.cos(t),s=Math.sin(t);return r.fromValues(i*a,o*s,0,-i*s,o*a,0,e,n,1)}function ls(t,e,n,r,i,o,a){var s=2*o/(n-e),u=2*o/(r-i),c=(n+e)/(n-e),l=(r+i)/(r-i),h=-(a+o)/(a-o),f=-2*a*o/(a-o);return t[0]=s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=c,t[9]=l,t[10]=h,t[11]=-1,t[12]=0,t[13]=0,t[14]=f,t[15]=0,t}function hs(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function fs(t,e){return Math.abs(t-e)<.001}function ps(t,e){var n=R(t),r=R(e);return{x:n,y:r,width:I(t)-n,height:I(e)-r}}function ds(t){return(t+2*Math.PI)%(2*Math.PI)}var ys={box:function(t,e,n,r){return ps([t,n],[e,r])},length:function(t,e,n,r){return hs(t,e,n,r)},pointAt:function(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}},pointDistance:function(t,e,n,r,i,o){var a=(n-t)*(i-t)+(r-e)*(o-e);return a<0?hs(t,e,i,o):a>(n-t)*(n-t)+(r-e)*(r-e)?hs(n,r,i,o):this.pointToLine(t,e,n,r,i,o)},pointToLine:function(t,e,n,r,i,o){var a=[n-t,r-e];if(u.exactEquals(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-e)*(o-e));var s=[-a[1],a[0]];u.normalize(s,s);var c=[i-t,o-e];return Math.abs(u.dot(c,s))},tangentAngle:function(t,e,n,r){return Math.atan2(r-e,n-t)}};function gs(t,e,n,r,i,o){var a=-1,s=1/0,u=[n,r],c=20;o&&o>200&&(c=o/10);for(var l=1/c,h=l/10,f=0;f<=c;f++){var p=f*l,d=[i.apply(null,t.concat([p])),i.apply(null,e.concat([p]))];(m=hs(u[0],u[1],d[0],d[1]))<s&&(a=p,s=m)}if(0===a)return{x:t[0],y:e[0]};if(1===a){var y=t.length;return{x:t[y-1],y:e[y-1]}}s=1/0;for(f=0;f<32&&!(h<1e-4);f++){var g=a-h,v=a+h,m=(d=[i.apply(null,t.concat([g])),i.apply(null,e.concat([g]))],hs(u[0],u[1],d[0],d[1]));if(g>=0&&m<s)a=g,s=m;else{var b=[i.apply(null,t.concat([v])),i.apply(null,e.concat([v]))],T=hs(u[0],u[1],b[0],b[1]);v<=1&&T<s?(a=v,s=T):h*=.5}}return{x:i.apply(null,t.concat([a])),y:i.apply(null,e.concat([a]))}}function vs(t,e,n,r,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*n*i*i*o+r*i*i*i}function ms(t,e,n,r,i){var o=1-i;return 3*(o*o*(e-t)+2*o*i*(n-e)+i*i*(r-n))}function bs(t,e,n,r){var i,o,a,s=-3*t+9*e-9*n+3*r,u=6*t-12*e+6*n,c=3*e-3*t,l=[];if(fs(s,0))fs(u,0)||(i=-c/u)>=0&&i<=1&&l.push(i);else{var h=u*u-4*s*c;fs(h,0)?l.push(-u/(2*s)):h>0&&(o=(-u-(a=Math.sqrt(h)))/(2*s),(i=(-u+a)/(2*s))>=0&&i<=1&&l.push(i),o>=0&&o<=1&&l.push(o))}return l}function Ts(t,e,n,r,i,o,a,s,u){var c=vs(t,n,i,a,u),l=vs(e,r,o,s,u),h=ys.pointAt(t,e,n,r,u),f=ys.pointAt(n,r,i,o,u),p=ys.pointAt(i,o,a,s,u),d=ys.pointAt(h.x,h.y,f.x,f.y,u),y=ys.pointAt(f.x,f.y,p.x,p.y,u);return[[t,e,h.x,h.y,d.x,d.y,c,l],[c,l,y.x,y.y,p.x,p.y,a,s]]}function Es(t,e,n,r,i,o,a,s,u){if(0===u)return function(t,e){for(var n=0,r=t.length,i=0;i<r;i++){n+=hs(t[i],e[i],t[(i+1)%r],e[(i+1)%r])}return n/2}([t,n,i,a],[e,r,o,s]);var c=Ts(t,e,n,r,i,o,a,s,.5),l=E(E([],T(c[0]),!1),[u-1],!1),h=E(E([],T(c[1]),!1),[u-1],!1);return Es.apply(null,l)+Es.apply(null,h)}var Ms={extrema:bs,box:function(t,e,n,r,i,o,a,s){for(var u=[t,a],c=[e,s],l=bs(t,n,i,a),h=bs(e,r,o,s),f=0;f<l.length;f++)u.push(vs(t,n,i,a,l[f]));for(f=0;f<h.length;f++)c.push(vs(e,r,o,s,h[f]));return ps(u,c)},length:function(t,e,n,r,i,o,a,s){return Es(t,e,n,r,i,o,a,s,3)},nearestPoint:function(t,e,n,r,i,o,a,s,u,c,l){return gs([t,n,i,a],[e,r,o,s],u,c,vs,l)},pointDistance:function(t,e,n,r,i,o,a,s,u,c,l){var h=this.nearestPoint(t,e,n,r,i,o,a,s,u,c,l);return hs(h.x,h.y,u,c)},interpolationAt:vs,pointAt:function(t,e,n,r,i,o,a,s,u){return{x:vs(t,n,i,a,u),y:vs(e,r,o,s,u)}},divide:function(t,e,n,r,i,o,a,s,u){return Ts(t,e,n,r,i,o,a,s,u)},tangentAngle:function(t,e,n,r,i,o,a,s,u){var c=ms(t,n,i,a,u),l=ms(e,r,o,s,u);return ds(Math.atan2(l,c))}};function ws(t){if(t.length<2)return 0;for(var e=0,n=0;n<t.length-1;n++){var r=t[n],i=t[n+1];e+=hs(r[0],r[1],i[0],i[1])}return e}var _s=function(t){return ws(t)};function xs(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}function As(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?Ms.length.apply(Ms,E([],T(r),!1)):0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),o=t.slice(6,8),a=xs(n,r,e),s=xs(r,i,e),u=xs(i,o,e),c=xs(a,s,e),l=xs(s,u,e),h=xs(c,l,e);return[["C"].concat(a,c,h),["C"].concat(l,u,o)]}(r):[t,t]:[t],l:i}}))}function Ps(t,e,n){var r=As(t),i=As(e),o=r.length,a=i.length,s=r.filter((function(t){return t.l})).length,u=i.filter((function(t){return t.l})).length,c=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,l=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/u||0,h=n||Math.max(o,a),f=[c,l],p=[h-o,h-a],d=0,y=[r,i].map((function(t,e){return t.l===h?t.map((function(t){return t.s})):t.map((function(t,n){return d=n&&p[e]&&t.l>=f[e],p[e]-=d?1:0,d?t.ss:[t.s]})).flat()}));return y[0].length===y[1].length?y:Ps(y[0],y[1],h)}function Ss(t){return Ns(t)>=0}function Os(t,e,n,r,i,o,a,s){return 3*((s-e)*(n+i)-(a-t)*(r+o)+r*(t-i)-n*(e-o)+s*(i+t/3)-a*(o+e/3))/20}function Ns(t){var e=0,n=0,r=0,i=0,o=0;return t.map((function(t){var a;switch(t[0]){case"M":case"Z":return r="M"===t[0]?t[1]:r,i="M"===t[0]?t[2]:i,e=r,n=i,0;default:return o=Os.apply(0,[e,n].concat(t.slice(1))),a=T(t.slice(-2),2),e=a[0],n=a[1],o}})).reduce((function(t,e){return t+e}),0)}function Cs(t){var e=t.slice(1).map((function(e,n,r){return n?r[n-1].slice(-2).concat(e.slice(1)):t[0].slice(1).concat(e.slice(1))})).map((function(t){return t.map((function(e,n){return t[t.length-n-2*(1-n%2)]}))})).reverse();return[["M"].concat(e[0].slice(0,2))].concat(e.map((function(t){return["C"].concat(t.slice(2))})))}function Is(t){return t.map((function(t){return Array.isArray(t)?Is(t):Number.isNaN(+t)?t:+t}))}function Rs(t,e){var n=t.length-1,r=[],i=0,o=function(t){var e=t.length,n=e-1;return t.map((function(r,i){return t.map((function(r,o){var a,s=i+o;return 0===o||t[s]&&"M"===t[s][0]?(a=t[s],["M"].concat(a.slice(-2))):(s>=e&&(s-=n),t[s])}))}))}(t);return o.forEach((function(o,a){t.slice(1).forEach((function(r,o){i+=function(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}(t[(a+o)%n].slice(-2),e[o%n].slice(-2))})),r[a]=i,i=0})),o[r.indexOf(Math.min.apply(null,r))]}function ks(t,e,n,r){var i=(-1+Math.sqrt(2))/3*4,o=t*i,a=e*i,s=n-t,u=n+t,c=r-e,l=r+e;return[["M",s,r],["C",s,r-a,n-o,c,n,c],["C",n+o,c,u,r-a,u,r],["C",u,r+a,n+o,l,n,l],["C",n-o,l,s,r+a,s,r],["Z"]]}function Ds(t){var e=t.getLocalTransform(),n=(t.style.anchor,[]);switch(t.nodeName){case ho.Line:var r=t.parsedStyle;n=function(t,e,n,r){return[["M",t,e],["L",n,r]]}(r.x1,r.y1,r.x2,r.y2);break;case ho.Circle:var i=t.parsedStyle,a=i.r,s=i.x,u=void 0===s?0:s,c=i.y;n=ks(a,a,u,void 0===c?0:c);break;case ho.Ellipse:var l=t.parsedStyle,h=l.rx,f=l.ry,p=l.x,d=void 0===p?0:p,y=l.y;n=ks(h,f,d,void 0===y?0:y);break;case ho.Polyline:case ho.Polygon:n=function(t){return t.map((function(t,e){return[0===e?"M":"L",t[0],t[1]]}))}(t.parsedStyle.points.points);break;case ho.Rect:var g=t.parsedStyle,v=g.width,m=g.height,b=g.x,T=g.y;g.radius;n=function(t,e,n,r,i){return[["M",n,r],["L",n+t,r],["L",n+t,r+e],["L",n,r+e],["Z"]]}(v,m,b,T);break;case ho.Path:n=t.parsedStyle.path.curve}if(n.length)return function(t,e,n,r){var i=r.x,a=r.y;return r.width,r.height,t.reduce((function(t,n){var r="";if("M"===n[0]||"L"===n[0]){var s=o.fromValues(n[1]-i,n[2]-a,0);o.transformMat4(s,s,e),r=""+n[0]+s[0]+","+s[1]}else if("Z"===n[0])r=n[0];else if("C"===n[0]){var u=o.fromValues(n[1]-i,n[2]-a,0),c=o.fromValues(n[3]-i,n[4]-a,0),l=o.fromValues(n[5]-i,n[6]-a,0);o.transformMat4(u,u,e),o.transformMat4(c,c,e),o.transformMat4(l,l,e),r=""+n[0]+u[0]+","+u[1]+","+c[0]+","+c[1]+","+l[0]+","+l[1]}return t+r}),"")}(n,e,0,t.parsedStyle)}var js={anchor:[0,0,0],origin:[0,0,0],opacity:1,fillOpacity:1,strokeOpacity:1},Bs=function(t){function e(e){var n,r,i,o=t.call(this,e)||this;return o.activeAnimations=[],o.stylePropertyUpdaterFactory=ol.get(Bo),o.stylePropertyParserFactory=ol.get(Do),o.config=e,o.config.interactive=null!==(n=o.config.capture)&&void 0!==n?n:o.config.interactive,o.id=o.config.id||"",o.name=o.config.name||"",o.className=o.config.className||"",o.interactive=null===(r=o.config.interactive)||void 0===r||r,o.nodeName=o.config.type||ho.Group,o.config.style=p(p(p(p({},js),{zIndex:null!==(i=o.config.zIndex)&&void 0!==i?i:0,visibility:!1===o.config.visible?"hidden":"visible"}),o.config.style),o.config.attrs),o.style=new Proxy(o.attributes,{get:function(t,e){return o.getAttribute(e)},set:function(t,e,n){return o.setAttribute(e,n),!0}}),o.initAttributes(o.config.style),ol.get(M).add(o.entity,o),o}return f(e,t),e.prototype.destroy=function(){t.prototype.destroy.call(this),ol.get(M).remove(this.entity),this.getAnimations().forEach((function(t){t.cancel()}))},e.prototype.cloneNode=function(t){var e=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:p({},this.style)});return t&&this.children.forEach((function(n){var r=n.cloneNode(t);e.appendChild(r)})),e},e.prototype.initAttributes=function(t){var e=this;void 0===t&&(t={});var n=this.renderable;for(var r in t){var i=t[r];this.attributes[r]=i,this.parseStyleProperty(r,i)}var o={x:1e3,y:1e3};Object.keys(t).sort((function(t,e){return(o[t]||0)-(o[e]||0)})).forEach((function(t){e.updateStyleProperty(t,void 0,e.parsedStyle[t])})),n.dirty=!0},e.prototype.setAttribute=function(e,n,r){void 0===r&&(r=!1),!r&&Y(n,this.attributes[e])&&"transformOrigin"!==e&&"visibility"!==e||("visibility"===e?this.forEach((function(t){t.changeAttribute(e,n)})):this.changeAttribute(e,n),t.prototype.setAttribute.call(this,e,n))},e.prototype.parseStyleProperty=function(t,e){var n=this.stylePropertyParserFactory(t);this.parsedStyle[t]=n?n(e,this):e},e.prototype.updateStyleProperty=function(t,e,n){var r=this,i=this.stylePropertyUpdaterFactory(t);i&&i.forEach((function(t){t(e,n,r,r.sceneGraphService)}))},e.prototype.changeAttribute=function(t,e){var n=this,r=this.renderable,i=this.attributes[t],o=this.parsedStyle[t];this.attributes[t]=e,this.parseStyleProperty(t,e),this.updateStyleProperty(t,o,this.parsedStyle[t]),this.attributes.clipPathTargets&&this.attributes.clipPathTargets.length&&this.attributes.clipPathTargets.forEach((function(t){t.emit(Ki.BOUNDS_CHANGED,{}),t.emit(Ki.ATTRIBUTE_CHANGED,{attributeName:"clipPath",oldValue:n,newValue:n})})),r.dirty=!0,this.emit(Ki.ATTRIBUTE_CHANGED,{attributeName:t,oldValue:i,newValue:e})},e.prototype.setOrigin=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.sceneGraphService.setOrigin(this,ns(t,e,n)),this.attributes.origin=this.getOrigin(),this},e.prototype.getOrigin=function(){return this.sceneGraphService.getOrigin(this)},e.prototype.setPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.sceneGraphService.setPosition(this,ns(t,e,n)),this.syncLocalPosition(),this},e.prototype.setLocalPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.sceneGraphService.setLocalPosition(this,ns(t,e,n)),this.syncLocalPosition(),this},e.prototype.translate=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.sceneGraphService.translate(this,ns(t,e,n)),this.syncLocalPosition(),this},e.prototype.translateLocal=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.sceneGraphService.translateLocal(this,ns(t,e,n)),this.syncLocalPosition(),this},e.prototype.getPosition=function(){return this.sceneGraphService.getPosition(this)},e.prototype.getLocalPosition=function(){return this.sceneGraphService.getLocalPosition(this)},e.prototype.scale=function(t,e,n){return this.scaleLocal(t,e,n)},e.prototype.scaleLocal=function(t,e,n){return"number"==typeof t&&(t=ns(t,e=e||t,n=n||t)),this.sceneGraphService.scaleLocal(this,t),this},e.prototype.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=ns(t,e=e||t,n=n||t)),this.sceneGraphService.setLocalScale(this,t),this},e.prototype.getLocalScale=function(){return this.sceneGraphService.getLocalScale(this)},e.prototype.getScale=function(){return this.sceneGraphService.getScale(this)},e.prototype.getEulerAngles=function(){var t=T(us(o.create(),this.sceneGraphService.getWorldTransform(this)),3);t[0],t[1];return is(t[2])},e.prototype.getLocalEulerAngles=function(){var t=T(us(o.create(),this.sceneGraphService.getLocalRotation(this)),3);t[0],t[1];return is(t[2])},e.prototype.setEulerAngles=function(t){return this.sceneGraphService.setEulerAngles(this,0,0,t),this},e.prototype.setLocalEulerAngles=function(t){return this.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},e.prototype.rotateLocal=function(t,e,n){return P(e)&&P(n)?this.sceneGraphService.rotateLocal(this,0,0,t):this.sceneGraphService.rotateLocal(this,t,e,n),this},e.prototype.rotate=function(t,e,n){return P(e)&&P(n)?this.sceneGraphService.rotate(this,0,0,t):this.sceneGraphService.rotate(this,t,e,n),this},e.prototype.getRotation=function(){return this.sceneGraphService.getRotation(this)},e.prototype.getLocalRotation=function(){return this.sceneGraphService.getLocalRotation(this)},e.prototype.getLocalTransform=function(){return this.sceneGraphService.getLocalTransform(this)},e.prototype.getWorldTransform=function(){return this.sceneGraphService.getWorldTransform(this)},e.prototype.resetLocalTransform=function(){this.sceneGraphService.resetLocalTransform(this)},e.prototype.syncLocalPosition=function(){var t=this.getLocalPosition();this.attributes.x=t[0],this.attributes.y=t[1]},e.prototype.getAnimations=function(){return this.activeAnimations},e.prototype.animate=function(t,e){var n,r,i=null===(n=this.ownerDocument)||void 0===n?void 0:n.timeline;this.attributes.clipPathTargets&&this.attributes.clipPathTargets.length&&(i=null===(r=this.attributes.clipPathTargets[0].ownerDocument)||void 0===r?void 0:r.timeline);return this.parsedStyle.transform=void 0,i?i.play(new ts(this,t,e)):null},e.prototype.show=function(){this.style.visibility="visible"},e.prototype.hide=function(){this.style.visibility="hidden"},e.prototype.isVisible=function(){var t=this.cullable;return"visible"===this.style.visibility&&(!t||t&&!t.isCulled())},e.prototype.toFront=function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,E([],T(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))),!1))+1),this},e.prototype.toBack=function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,E([],T(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))),!1))-1),this},e.prototype.getCount=function(){return this.childElementCount},e.prototype.getParent=function(){return this.parentElement},e.prototype.getChildren=function(){return this.children},e.prototype.getFirst=function(){return this.firstElementChild},e.prototype.getLast=function(){return this.lastElementChild},e.prototype.getChildByIndex=function(t){return this.children[t]||null},e.prototype.add=function(t,e){return this.appendChild(t,e)},e.prototype.setClip=function(t){this.style.clipPath=t},e.prototype.getClip=function(){return this.style.clipPath||null},e.prototype.set=function(t,e){this.config[t]=e},e.prototype.get=function(t){return this.config[t]},e.prototype.getConfig=function(){return this.config},e.prototype.attr=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=T(e,2),i=r[0],o=r[1];return i?O(i)?(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),this):2===e.length?(this.setAttribute(i,o),this):this.attributes[i]:this.attributes},e.prototype.moveTo=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},e.prototype.move=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},e.prototype.setZIndex=function(t){return this.style.zIndex=t,this},e.prototype.getMatrix=function(){var t=this.getWorldTransform(),e=T(i.getTranslation(o.create(),t),2),n=e[0],r=e[1],a=T(i.getScaling(o.create(),t),2),u=a[0],c=a[1],l=i.getRotation(s.create(),t),h=T(us(o.create(),l),3),f=h[0],p=(h[1],h[2]);return cs(f||p,n,r,u,c)},e.prototype.setMatrix=function(t){var e=t[0],n=t[3],r=t[1],i=t[4],o=Math.sqrt(e*e+n*n),a=Math.sqrt(r*r+i*i);e*i-n*r<0&&(e<i?o=-o:a=-a),o&&(e*=1/o,n*=1/o),a&&(r*=1/a,i*=1/a);var s=Math.atan2(n,e);this.setEulerAngles(s).setPosition(t[6],t[7]).setLocalScale(o,a)},e}(Jo),Ls=function(t){function e(e){var n=e||{},r=n.style,i=d(n,["style"]);return t.call(this,p({type:ho.Group,style:p({},r)},i))||this}return f(e,t),e}(Bs),Fs=function(t){function e(){var e=t.call(this)||this;return e.defaultView=null,e.ownerDocument=null,e.nodeName="document",e.timeline=new ia,e.documentElement=new Ls({id:"g-root"}),e.documentElement.ownerDocument=e,e.documentElement.parentNode=e,e.childNodes=[e.documentElement],e}return f(e,t),Object.defineProperty(e.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),e.prototype.createElement=function(t,e){return new(this.defaultView.customElements.get(t))(e)},e.prototype.cloneNode=function(t){throw new Error("Method not implemented.")},e.prototype.destroy=function(){try{this.documentElement.destroy()}catch(t){}this.timeline.destroy()},e.prototype.appendChild=function(t,e){throw new Error("Use document.documentElement instead.")},e.prototype.insertBefore=function(t,e){throw new Error("Use document.documentElement instead.")},e.prototype.removeChild=function(t,e){throw new Error("Use document.documentElement instead.")},e.prototype.replaceChild=function(t,e,n){throw new Error("Use document.documentElement instead.")},e.prototype.append=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];throw new Error("Use document.documentElement instead.")},e.prototype.prepend=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];throw new Error("Use document.documentElement instead.")},e.prototype.getElementById=function(t){return this.documentElement.getElementById(t)},e.prototype.getElementsByName=function(t){return this.documentElement.getElementsByName(t)},e.prototype.getElementsByTagName=function(t){return this.documentElement.getElementsByTagName(t)},e.prototype.getElementsByClassName=function(t){return this.documentElement.getElementsByClassName(t)},e.prototype.querySelector=function(t){return this.documentElement.querySelector(t)},e.prototype.querySelectorAll=function(t){return this.documentElement.querySelectorAll(t)},e.prototype.find=function(t){return this.documentElement.find(t)},e.prototype.findAll=function(t){return this.documentElement.findAll(t)},e}(zo),Gs=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.client=new io,e.movement=new io,e.offset=new io,e.global=new io,e.screen=new io,e}return f(e,t),Object.defineProperty(e.prototype,"clientX",{get:function(){return this.client.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"clientY",{get:function(){return this.client.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"movementX",{get:function(){return this.movement.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"movementY",{get:function(){return this.movement.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsetX",{get:function(){return this.offset.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsetY",{get:function(){return this.offset.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalX",{get:function(){return this.global.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalY",{get:function(){return this.global.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"screenX",{get:function(){return this.screen.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"screenY",{get:function(){return this.screen.y},enumerable:!1,configurable:!0}),e.prototype.getModifierState=function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)},e.prototype.initMouseEvent=function(){throw new Error("Method not implemented.")},e}(Go),Vs=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.width=0,e.height=0,e.isPrimary=!1,e}return f(e,t),e.prototype.getCoalescedEvents=function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]},e.prototype.getPredictedEvents=function(){throw new Error("getPredictedEvents is not supported!")},e}(Gs),Us=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.DOM_DELTA_LINE=0,e.DOM_DELTA_PAGE=1,e.DOM_DELTA_PIXEL=2,e}return f(e,t),e}(Gs),qs=function(t){function e(e){var n=t.call(this,e)||this;return n.handleMounted=function(){n.connectedCallback&&n.connectedCallback()},n.handleAttributeChanged=function(t){if(t.target===n){var e=t.detail,r=e.attributeName,i=e.oldValue,o=e.newValue;n.attributeChangedCallback&&n.attributeChangedCallback(r,i,o)}},n.attributeChangedCallback&&n.addEventListener(Ki.ATTRIBUTE_CHANGED,n.handleAttributeChanged),n.connectedCallback&&n.addEventListener(Ki.INSERTED,n.handleMounted),n.disconnectedCallback&&n.addEventListener(Ki.REMOVED,n.disconnectedCallback.bind(n)),n}return f(e,t),e}(Bs),zs=function(t){function e(e){var n=e.style,r=d(e,["style"]);return t.call(this,p({type:ho.Circle,style:p({r:0,anchor:[.5,.5]},n)},r))||this}return f(e,t),e}(Bs),Ws=function(t){function e(e){var n=e.style,r=d(e,["style"]);return t.call(this,p({type:ho.Ellipse,style:p({rx:0,ry:0,anchor:[.5,.5]},n)},r))||this}return f(e,t),e}(Bs),Hs=function(t){function e(e){var n=e.style,r=d(e,["style"]);return t.call(this,p({type:ho.Image,style:p({img:""},n)},r))||this}return f(e,t),e}(Bs),Ys=function(t){function e(e){var n=e.style,r=d(e,["style"]);return t.call(this,p({type:ho.Line,style:p({x1:0,y1:0,x2:0,y2:0,lineJoin:"miter",lineCap:"butt",lineWidth:1},n)},r))||this}return f(e,t),e.prototype.getPoint=function(t){var e=this.parsedStyle,n=e.x1,r=e.y1,i=e.x2,o=e.y2,a=ys.pointAt(n,r,i,o,t);return new io(a.x,a.y)},e.prototype.getTotalLength=function(){var t=this.parsedStyle,e=t.x1,n=t.y1,r=t.x2,i=t.y2;return ys.length(e,n,r,i)},e}(Bs),$s=function(t){function e(e){var n=e.style,r=d(e,["style"]);return t.call(this,p({type:ho.Path,style:p({path:"",lineJoin:"miter",lineCap:"butt",lineWidth:1},n)},r))||this}return f(e,t),e.prototype.getTotalLength=function(){return this.parsedStyle.path.totalLength},e.prototype.getPoint=function(t){var e=0,n=0,r=this.parsedStyle.path.curve;if(!this.parsedStyle.path.curveSegments.length)return r?new io(r[0][1],r[0][2]):null;this.parsedStyle.path.curveSegments.forEach((function(r,i){t>=r[0]&&t<=r[1]&&(e=(t-r[0])/(r[1]-r[0]),n=i)}));var i=r[n];if(P(i)||P(n))return null;var o=i.length,a=r[n+1],s=Ms.pointAt(i[o-2],i[o-1],a[1],a[2],a[3],a[4],a[5],a[6],e),u=s.x,c=s.y;return new io(u,c)},e.prototype.getStartTangent=function(){var t=this.parsedStyle.path.segments,e=[];if(t.length>1){var n=t[0].currentPoint,r=t[1].currentPoint,i=t[1].startTangent;e=[],i?(e.push([n[0]-i[0],n[1]-i[1]]),e.push([n[0],n[1]])):(e.push([r[0],r[1]]),e.push([n[0],n[1]]))}return e},e.prototype.getEndTangent=function(){var t=this.parsedStyle.path.segments,e=t.length,n=[];if(e>1){var r=t[e-2].currentPoint,i=t[e-1].currentPoint,o=t[e-1].endTangent;n=[],o?(n.push([i[0]-o[0],i[1]-o[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n},e}(Bs),Xs=function(t){function e(e){var n=e.style,r=d(e,["style"]);return t.call(this,p({type:ho.Polygon,style:p({points:[]},n)},r))||this}return f(e,t),e}(Bs),Ks=function(t){function e(e){var n=e.style,r=d(e,["style"]);return t.call(this,p({type:ho.Polyline,style:p({points:[],lineJoin:"miter",lineCap:"butt",lineWidth:1},n)},r))||this}return f(e,t),e.prototype.getTotalLength=function(){return this.parsedStyle.points.totalLength},e.prototype.getPoint=function(t){var e=this.parsedStyle.points,n=e.points,r=e.segments,i=0,o=0;r.forEach((function(e,n){t>=e[0]&&t<=e[1]&&(i=(t-e[0])/(e[1]-e[0]),o=n)}));var a=ys.pointAt(n[o][0],n[o][1],n[o+1][0],n[o+1][1],i),s=a.x,u=a.y;return new io(s,u)},e.prototype.getStartTangent=function(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},e.prototype.getEndTangent=function(){var t=this.parsedStyle.points.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},e}(Bs),Js=function(t){function e(e){var n=e.style,r=d(e,["style"]);return t.call(this,p({type:ho.Rect,style:p({width:0,height:0},n)},r))||this}return f(e,t),e}(Bs),Zs=function(t){function e(e){var n=e.style,r=d(e,["style"]);return t.call(this,p({type:ho.Text,style:p({text:"",fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"alphabetic",dropShadow:!1,dropShadowDistance:5,fill:"#000",letterSpacing:0,lineHeight:0,lineJoin:"miter",lineCap:"butt",lineWidth:0,miterLimit:10,padding:0,stroke:"#000",whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},n)},r))||this}return f(e,t),e.prototype.getLineBoundingRects=function(){var t;return null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics},e}(Bs),Qs=function(t){function e(e){var n=e.style,r=d(e,["style"]),i=t.call(this,p({type:ho.HTML,style:p({innerHTML:"",className:"",style:""},n)},r))||this;return i.cullable.enable=!1,i}return f(e,t),e.prototype.getDomElement=function(){return this.parsedStyle.$el},e.prototype.getBoundingClientRect=function(){return this.parsedStyle.$el.getBoundingClientRect()},e.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},e.prototype.getBounds=function(){var t,e,n=this.getBoundingClientRect(),r=null===(e=null===(t=this.ownerDocument)||void 0===t?void 0:t.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect();if(r){var i=n.left-r.left,a=n.top-r.top,s=new Hi;return s.setMinMax(o.fromValues(i,a,0),o.fromValues(i+n.width,a+n.height,0)),s}return null},e.prototype.getLocalBounds=function(){if(this.parentNode){var t=i.invert(i.create(),this.parentNode.getWorldTransform()),e=this.getBounds();if(e){var n=new Hi;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()},e}(Bs),tu=function(){function t(){this.registry={},this.define(ho.Circle,zs),this.define(ho.Ellipse,Ws),this.define(ho.Rect,Js),this.define(ho.Image,Hs),this.define(ho.Line,Ys),this.define(ho.Group,Ls),this.define(ho.Path,$s),this.define(ho.Polygon,Xs),this.define(ho.Polyline,Ks),this.define(ho.Text,Zs),this.define(ho.HTML,Qs)}return t.prototype.define=function(t,e){this.registry[t]=e},t.prototype.get=function(t){return this.registry[t]},t}();function eu(t,e,n){var r=n.getGeometryBounds();if(r){var i=n.geometry;if(i&&i.contentBounds){var a=o.multiply(o.create(),o.fromValues.apply(o,E([],T(r.halfExtents.map((function(t){return 2*t}))),!1)),o.subtract(o.create(),ns(e||o.create()),ns(t||o.create())));i.contentBounds.update(o.subtract(i.contentBounds.center,i.contentBounds.center,a),i.contentBounds.halfExtents),i.renderBounds.update(o.subtract(i.renderBounds.center,i.renderBounds.center,a),i.renderBounds.halfExtents),n.emit(Ki.BOUNDS_CHANGED,{})}}}var nu,ru=c.Syringe.defineToken("ContextService",{multiple:!1});!function(t){t[t.CameraChanged=0]="CameraChanged",t[t.DisplayObjectChanged=1]="DisplayObjectChanged",t[t.DisplayObjectRemoved=2]="DisplayObjectRemoved",t[t.None=3]="None"}(nu||(nu={}));var iu="RenderingContext",ou=n(2),au=c.Syringe.defineToken("RenderingPluginContribution"),su=function(){function t(){this.inited=!1,this.hooks={init:new ou.AsyncSeriesHook,prepare:new ou.SyncWaterfallHook(["object"]),beginFrame:new ou.SyncHook,beforeRender:new ou.SyncHook(["objectToRender"]),render:new ou.SyncHook(["objectToRender"]),afterRender:new ou.SyncHook(["objectToRender"]),endFrame:new ou.SyncHook,destroy:new ou.SyncHook,pick:new ou.AsyncSeriesWaterfallHook(["result"]),pointerDown:new ou.SyncHook(["event"]),pointerUp:new ou.SyncHook(["event"]),pointerMove:new ou.SyncHook(["event"]),pointerOut:new ou.SyncHook(["event"]),pointerOver:new ou.SyncHook(["event"]),pointerWheel:new ou.SyncHook(["event"])}}return t.prototype.init=function(){return v(this,void 0,void 0,(function(){var t=this;return m(this,(function(e){switch(e.label){case 0:return this.renderingPluginProvider.getContributions({cache:!1}).forEach((function(e){e.apply(t)})),[4,this.hooks.init.promise()];case 1:return e.sent(),this.inited=!0,[2]}}))}))},t.prototype.render=function(){this.sceneGraphService.syncHierarchy(this.renderingContext.root),this.renderingContext.renderReasons.size&&this.inited&&(this.renderDisplayObject(this.renderingContext.root),this.renderingContext.dirty?(this.hooks.endFrame.call(),this.renderingContext.dirty=!1):this.renderingContext.renderReasons.has(nu.DisplayObjectRemoved)&&(this.hooks.beginFrame.call(),this.hooks.endFrame.call()),this.renderingContext.renderReasons.clear())},t.prototype.renderDisplayObject=function(t){var e=this,n=this.hooks.prepare.call(t);n&&(this.renderingContext.dirty||(this.renderingContext.dirty=!0,this.hooks.beginFrame.call()),this.hooks.beforeRender.call(n),this.hooks.render.call(n),this.hooks.afterRender.call(n),t.renderable.dirty=!1);var r=t.sortable;r.dirty&&(r.sorted=t.childNodes.slice().sort(lo),r.dirty=!1),(r.sorted||t.childNodes).forEach((function(t){e.renderDisplayObject(t)}))},t.prototype.destroy=function(){this.inited=!1,this.hooks.destroy.call()},t.prototype.dirtify=function(){this.renderingContext.renderReasons.add(nu.DisplayObjectChanged)},y([Object(c.contrib)(au),g("design:type",Object)],t.prototype,"renderingPluginProvider",void 0),y([Object(c.inject)(iu),g("design:type",Object)],t.prototype,"renderingContext",void 0),y([Object(c.inject)(fo),g("design:type",Object)],t.prototype,"sceneGraphService",void 0),t=y([Object(c.singleton)()],t)}(),uu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.cursor="default",e.mappingTable={},e.mappingState={trackingData:{}},e.eventPool=new Map,e.onPointerDown=function(t){return v(e,void 0,void 0,(function(){var e,n;return m(this,(function(r){switch(r.label){case 0:return t instanceof Vs?[4,this.createPointerEvent(t)]:[2];case 1:return e=r.sent(),this.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType?this.dispatchEvent(e,"touchstart"):"mouse"!==e.pointerType&&"pen"!==e.pointerType||(n=2===e.button,this.dispatchEvent(e,n?"rightdown":"mousedown")),this.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),this.freeEvent(e),[2]}}))}))},e.onPointerUp=function(t){return v(e,void 0,void 0,(function(){var e,n,r,i,o,a,s,u,c;return m(this,(function(l){switch(l.label){case 0:return t instanceof Vs?(e=performance.now(),[4,this.createPointerEvent(t)]):[2];case 1:if(n=l.sent(),this.dispatchEvent(n,"pointerup"),"touch"===n.pointerType?this.dispatchEvent(n,"touchend"):"mouse"!==n.pointerType&&"pen"!==n.pointerType||(s=2===n.button,this.dispatchEvent(n,s?"rightup":"mouseup")),r=this.trackingData(t.pointerId),i=this.findMountedTarget(r.pressTargetsByButton[t.button]),o=i,i&&!n.composedPath().includes(i)){for(a=i;a&&!n.composedPath().includes(a);)n.currentTarget=a,this.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType?this.notifyTarget(n,"touchendoutside"):"mouse"!==n.pointerType&&"pen"!==n.pointerType||(s=2===n.button,this.notifyTarget(n,s?"rightupoutside":"mouseupoutside")),zo.isNode(a)&&(a=a.parentNode);delete r.pressTargetsByButton[t.button],o=a}return o&&((u=this.clonePointerEvent(n,"click")).target=o,u.path=[],r.clicksByButton[t.button]||(r.clicksByButton[t.button]={clickCount:0,target:u.target,timeStamp:e}),(c=r.clicksByButton[t.button]).target===u.target&&e-c.timeStamp<200?++c.clickCount:c.clickCount=1,c.target=u.target,c.timeStamp=e,u.detail=c.clickCount,"mouse"===u.pointerType?this.dispatchEvent(u,"click"):"touch"===u.pointerType?this.dispatchEvent(u,"tap"):this.dispatchEvent(u,"pointertap"),this.freeEvent(u)),this.freeEvent(n),[2]}}))}))},e.onPointerMove=function(t){return v(e,void 0,void 0,(function(){var e,n,r,i,o,a,s,u,c,l,h;return m(this,(function(f){switch(f.label){case 0:return t instanceof Vs?[4,this.createPointerEvent(t)]:[2];case 1:return e=f.sent(),n="mouse"===e.pointerType||"pen"===e.pointerType,r=this.trackingData(t.pointerId),i=this.findMountedTarget(r.overTargets),r.overTargets&&i!==e.target?(o="mousemove"===t.type?"mouseout":"pointerout",[4,this.createPointerEvent(t,o,i||void 0)]):[3,5];case 2:return a=f.sent(),this.dispatchEvent(a,"pointerout"),n&&this.dispatchEvent(a,"mouseout"),e.composedPath().includes(i)?[3,4]:[4,this.createPointerEvent(t,"pointerleave",i||void 0)];case 3:for((s=f.sent()).eventPhase=s.AT_TARGET;s.target&&!e.composedPath().includes(s.target);)s.currentTarget=s.target,this.notifyTarget(s),n&&this.notifyTarget(s,"mouseleave"),zo.isNode(s.target)&&(s.target=s.target.parentNode);this.freeEvent(s),f.label=4;case 4:this.freeEvent(a),f.label=5;case 5:if(i!==e.target){for(u="mousemove"===t.type?"mouseover":"pointerover",c=this.clonePointerEvent(e,u),this.dispatchEvent(c,"pointerover"),n&&this.dispatchEvent(c,"mouseover"),l=i&&zo.isNode(i)&&i.parentNode;l&&l!==(zo.isNode(this.rootTarget)&&this.rootTarget.parentNode)&&l!==e.target;)l=l.parentNode;if(!l||l===(zo.isNode(this.rootTarget)&&this.rootTarget.parentNode)){for((h=this.clonePointerEvent(e,"pointerenter")).eventPhase=h.AT_TARGET;h.target&&h.target!==i&&h.target!==(zo.isNode(this.rootTarget)&&this.rootTarget.parentNode);)h.currentTarget=h.target,this.notifyTarget(h),n&&this.notifyTarget(h,"mouseenter"),zo.isNode(h.target)&&(h.target=h.target.parentNode);this.freeEvent(h)}this.freeEvent(c)}return this.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&this.dispatchEvent(e,"touchmove"),n&&(this.dispatchEvent(e,"mousemove"),this.cursor=this.getCursor(e.target)),r.overTargets=e.composedPath(),this.freeEvent(e),[2]}}))}))},e.onPointerOut=function(t){return v(e,void 0,void 0,(function(){var e,n,r,i,o;return m(this,(function(a){switch(a.label){case 0:return t instanceof Vs?(e=this.trackingData(t.pointerId)).overTargets?(n="mouse"===t.pointerType||"pen"===t.pointerType,r=this.findMountedTarget(e.overTargets),[4,this.createPointerEvent(t,"pointerout",r||void 0)]):[3,3]:[2];case 1:return i=a.sent(),this.dispatchEvent(i),n&&this.dispatchEvent(i,"mouseout"),[4,this.createPointerEvent(t,"pointerleave",r||void 0)];case 2:for((o=a.sent()).eventPhase=o.AT_TARGET;o.target&&o.target!==(zo.isNode(this.rootTarget)&&this.rootTarget.parentNode);)o.currentTarget=o.target,this.notifyTarget(o),n&&this.notifyTarget(o,"mouseleave"),zo.isNode(o.target)&&(o.target=o.target.parentNode);e.overTargets=null,this.freeEvent(i),this.freeEvent(o),a.label=3;case 3:return this.cursor=null,[2]}}))}))},e.onPointerOver=function(t){return v(e,void 0,void 0,(function(){var e,n,r,i;return m(this,(function(o){switch(o.label){case 0:return t instanceof Vs?(e=this.trackingData(t.pointerId),[4,this.createPointerEvent(t)]):[2];case 1:for(n=o.sent(),r="mouse"===n.pointerType||"pen"===n.pointerType,this.dispatchEvent(n,"pointerover"),r&&this.dispatchEvent(n,"mouseover"),"mouse"===n.pointerType&&(this.cursor=this.getCursor(n.target)),(i=this.clonePointerEvent(n,"pointerenter")).eventPhase=i.AT_TARGET;i.target&&i.target!==(zo.isNode(this.rootTarget)&&this.rootTarget.parentNode);)i.currentTarget=i.target,this.notifyTarget(i),r&&this.notifyTarget(i,"mouseenter"),zo.isNode(i.target)&&(i.target=i.target.parentNode);return e.overTargets=n.composedPath(),this.freeEvent(n),this.freeEvent(i),[2]}}))}))},e.onPointerUpOutside=function(t){return v(e,void 0,void 0,(function(){var e,n,r,i;return m(this,(function(o){switch(o.label){case 0:return t instanceof Vs?(e=this.trackingData(t.pointerId),n=this.findMountedTarget(e.pressTargetsByButton[t.button]),[4,this.createPointerEvent(t)]):[2];case 1:if(r=o.sent(),n){for(i=n;i;)r.currentTarget=i,this.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType?this.notifyTarget(r,"touchendoutside"):"mouse"!==r.pointerType&&"pen"!==r.pointerType||this.notifyTarget(r,2===r.button?"rightupoutside":"mouseupoutside"),zo.isNode(i)&&(i=i.parentNode);delete e.pressTargetsByButton[t.button]}return this.freeEvent(r),[2]}}))}))},e.onWheel=function(t){return v(e,void 0,void 0,(function(){var e;return m(this,(function(n){switch(n.label){case 0:return t instanceof Us?[4,this.createWheelEvent(t)]:[2];case 1:return e=n.sent(),this.dispatchEvent(e),this.freeEvent(e),[2]}}))}))},e}return f(e,t),e.prototype.init=function(){this.rootTarget=this.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)},e.prototype.client2Viewport=function(t){var e=this.contextService.getBoundingClientRect();return new io(t.x-((null==e?void 0:e.left)||0),t.y-((null==e?void 0:e.top)||0))},e.prototype.viewport2Client=function(t){var e=this.contextService.getBoundingClientRect();return new io(t.x+((null==e?void 0:e.left)||0),t.y+((null==e?void 0:e.top)||0))},e.prototype.viewport2Canvas=function(t){var e=t.x,n=t.y,r=this.rootTarget.defaultView.getCamera(),a=this.canvasConfig,s=a.width,u=a.height,c=r.getPerspectiveInverse(),l=r.getWorldTransform(),h=i.multiply(i.create(),l,c),f=o.fromValues(e/s*2-1,2*(1-n/u)-1,0);return o.transformMat4(f,f,h),new io(f[0],f[1])},e.prototype.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),a=i.multiply(i.create(),n,r),s=o.fromValues(t.x,t.y,0);o.transformMat4(s,s,a);var u=this.canvasConfig,c=u.width,l=u.height;return new io((s[0]+1)/2*c,(1-(s[1]+1)/2)*l)},e.prototype.setPickHandler=function(t){this.pickHandler=t},e.prototype.addEventMapping=function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((function(t,e){return t.priority-e.priority}))},e.prototype.mapEvent=function(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var n=0,r=e.length;n<r;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for "+t.type)}},e.prototype.dispatchEvent=function(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.emit(e||t.type,t)},e.prototype.propagate=function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;r>=1;r--)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){t.eventPhase=t.BUBBLING_PHASE;for(r=1;r<n.length;r++)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}},e.prototype.propagationPath=function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)return e.unshift(n.document),e;for(var r=0;r<2048&&t!==this.rootTarget;r++)zo.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e},e.prototype.hitTest=function(t){return v(this,void 0,void 0,(function(){var e,n,r,i,o;return m(this,(function(a){switch(a.label){case 0:return e=t.viewportX,n=t.viewportY,r=this.canvasConfig,i=r.width,o=r.height,e<0||n<0||e>i||n>o?[2,null]:[4,this.pickHandler(t)];case 1:return[2,a.sent()||this.rootTarget||null]}}))}))},e.prototype.createPointerEvent=function(t,e,n){return v(this,void 0,void 0,(function(){var r,i,o;return m(this,(function(a){switch(a.label){case 0:return r=this.allocateEvent(Vs),this.copyPointerData(t,r),this.copyMouseData(t,r),this.copyData(t,r),r.nativeEvent=t.nativeEvent,r._originalEvent=t,i=r,null==n?[3,1]:(o=n,[3,3]);case 1:return[4,this.hitTest({clientX:r.clientX,clientY:r.clientY,viewportX:r.viewportX,viewportY:r.viewportY,x:r.global.x,y:r.global.y})];case 2:o=a.sent(),a.label=3;case 3:return i.target=o,"string"==typeof e&&(r.type=e),[2,r]}}))}))},e.prototype.createWheelEvent=function(t){return v(this,void 0,void 0,(function(){var e,n;return m(this,(function(r){switch(r.label){case 0:return e=this.allocateEvent(Us),this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e._originalEvent=t,n=e,[4,this.hitTest({clientX:e.clientX,clientY:e.clientY,viewportX:e.viewportX,viewportY:e.viewportY,x:e.global.x,y:e.global.y})];case 1:return n.target=r.sent(),[2,e]}}))}))},e.prototype.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},e.prototype.clonePointerEvent=function(t,e){var n=this.allocateEvent(Vs);return n.nativeEvent=t.nativeEvent,n._originalEvent=t._originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n},e.prototype.copyPointerData=function(t,e){t instanceof Vs&&e instanceof Vs&&(e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist)},e.prototype.copyMouseData=function(t,e){t instanceof Gs&&e instanceof Gs&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.client.copyFrom(t.client),e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset))},e.prototype.copyWheelData=function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ},e.prototype.copyData=function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=performance.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)},e.prototype.allocateEvent=function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e},e.prototype.freeEvent=function(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)},e.prototype.notifyTarget=function(t,e){e=null!=e?e:t.type;var n=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?e+"capture":e;this.notifyListeners(t,n),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)},e.prototype.notifyListeners=function(t,e){var n=t.currentTarget.emitter,r=n._events[e];if(r)if("fn"in r)r.once&&n.removeListener(e,r.fn,void 0,!0),r.fn.call(r.context,t);else for(var i=0;i<r.length&&!t.propagationImmediatelyStopped;i++)r[i].once&&n.removeListener(e,r[i].fn,void 0,!0),r[i].fn.call(r[i].context,t)},e.prototype.findMountedTarget=function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;n>=0;n--){var r=t[n];if(!(r===this.rootTarget||zo.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},e.prototype.getCursor=function(t){for(var e=t;e;){var n=Jo.isElement(e)&&e.getAttribute("cursor");if(n)return n;e=zo.isNode(e)&&e.parentNode}},y([Object(c.inject)(iu),g("design:type",Object)],e.prototype,"renderingContext",void 0),y([Object(c.inject)(ru),g("design:type",Object)],e.prototype,"contextService",void 0),y([Object(c.inject)(vo),g("design:type",Object)],e.prototype,"canvasConfig",void 0),y([Object(c.postConstruct)(),g("design:type",Function),g("design:paramtypes",[]),g("design:returntype",void 0)],e.prototype,"init",null),e=y([Object(c.singleton)()],e)}(l.EventEmitter),cu=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t};function lu(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function hu(){}var fu,pu="\\s*([+-]?\\d+)\\s*",du="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",yu="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",gu=/^#([0-9a-f]{3,8})$/,vu=new RegExp("^rgb\\("+[pu,pu,pu]+"\\)$"),mu=new RegExp("^rgb\\("+[yu,yu,yu]+"\\)$"),bu=new RegExp("^rgba\\("+[pu,pu,pu,du]+"\\)$"),Tu=new RegExp("^rgba\\("+[yu,yu,yu,du]+"\\)$"),Eu=new RegExp("^hsl\\("+[du,yu,yu]+"\\)$"),Mu=new RegExp("^hsla\\("+[du,yu,yu,du]+"\\)$"),wu={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function _u(){return this.rgb().formatHex()}function xu(){return this.rgb().formatRgb()}function Au(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=gu.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Pu(e):3===n?new Nu(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Su(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Su(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=vu.exec(t))?new Nu(e[1],e[2],e[3],1):(e=mu.exec(t))?new Nu(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=bu.exec(t))?Su(e[1],e[2],e[3],e[4]):(e=Tu.exec(t))?Su(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Eu.exec(t))?ku(e[1],e[2]/100,e[3]/100,1):(e=Mu.exec(t))?ku(e[1],e[2]/100,e[3]/100,e[4]):wu.hasOwnProperty(t)?Pu(wu[t]):"transparent"===t?new Nu(NaN,NaN,NaN,0):null}function Pu(t){return new Nu(t>>16&255,t>>8&255,255&t,1)}function Su(t,e,n,r){return r<=0&&(t=e=n=NaN),new Nu(t,e,n,r)}function Ou(t){return t instanceof hu||(t=Au(t)),t?new Nu((t=t.rgb()).r,t.g,t.b,t.opacity):new Nu}function Nu(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Cu(){return"#"+Ru(this.r)+Ru(this.g)+Ru(this.b)}function Iu(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Ru(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function ku(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new ju(t,e,n,r)}function Du(t){if(t instanceof ju)return new ju(t.h,t.s,t.l,t.opacity);if(t instanceof hu||(t=Au(t)),!t)return new ju;if(t instanceof ju)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n<r):n===o?(r-e)/s+2:(e-n)/s+4,s/=u<.5?o+i:2-o-i,a*=60):s=u>0&&u<1?0:a,new ju(a,s,u,t.opacity)}function ju(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Bu(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}cu(hu,Au,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:_u,formatHex:_u,formatHsl:function(){return Du(this).formatHsl()},formatRgb:xu,toString:xu}),cu(Nu,(function(t,e,n,r){return 1===arguments.length?Ou(t):new Nu(t,e,n,null==r?1:r)}),lu(hu,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Nu(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Nu(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Cu,formatHex:Cu,formatRgb:Iu,toString:Iu})),cu(ju,(function(t,e,n,r){return 1===arguments.length?Du(t):new ju(t,e,n,null==r?1:r)}),lu(hu,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new ju(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new ju(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Nu(Bu(t>=240?t-240:t+120,i,r),Bu(t,i,r),Bu(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}})),function(t){t[t.Constant=0]="Constant",t[t.LinearGradient=1]="LinearGradient",t[t.RadialGradient=2]="RadialGradient",t[t.Pattern=3]="Pattern"}(fu||(fu={}));var Lu=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,Fu=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,Gu=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,Vu=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;function Uu(t,e){if(void 0===t&&(t=""),"transparent"===t)return{type:fu.Constant,value:[0,0,0,0],formatted:"rgba(0,0,0,0)"};var n=t[0];if("("===t[1]||"("===t[2])if("l"===n){var r=function(t){var e,n=Lu.exec(t);if(n){var r=parseFloat(n[1])%360*(Math.PI/180),i=(null===(e=n[2].match(Vu))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[],o=T([1,1],2),a=o[0],s=o[1],u=T([0,0],2),c=u[0],l=u[1],h=void 0,f=void 0;r>=0&&r<.5*Math.PI?(h={x:c,y:l},f={x:a,y:s}):.5*Math.PI<=r&&r<Math.PI?(h={x:a,y:l},f={x:c,y:s}):Math.PI<=r&&r<1.5*Math.PI?(h={x:a,y:s},f={x:c,y:l}):(h={x:c,y:s},f={x:a,y:l});var p=Math.tan(r),d=p*p,y=(f.x-h.x+p*(f.y-h.y))/(d+1)+h.x,g=p*(f.x-h.x+p*(f.y-h.y))/(d+1)+h.y;return{x0:h.x,y0:h.y,x1:y,y1:g,steps:i,hash:t}}return null}(t);if(r)return{type:fu.LinearGradient,value:r,formatted:""}}else if("r"===n){var i=function(t){var e,n=Fu.exec(t);if(n){var r=parseFloat(n[1]),i=parseFloat(n[2]),o=parseFloat(n[3]),a=(null===(e=n[4].match(Vu))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[];if(0===o){var s=n[4].match(Vu);return s[s.length-1].split(":")[1]}return{x0:r,y0:i,r0:0,x1:.5,y1:.5,r1:o,steps:a,hash:t}}return null}(t);if(i){if(!D(i))return{type:fu.RadialGradient,value:i,formatted:""};t=i}}else if("p"===n){var o=function(t){var e=Gu.exec(t);if(e){var n=e[1],r=e[2];switch(n){case"a":n="repeat";break;case"x":n="repeat-x";break;case"y":n="repeat-y";break;case"n":n="no-repeat";break;default:n="no-repeat"}return{src:r,repetition:n,hash:t}}return null}(t);if(o)return{type:fu.Pattern,value:o,formatted:""}}var a=Au(t),s=[0,0,0,0];return null!==a&&(s[0]=a.r/255,s[1]=a.g/255,s[2]=a.b/255,s[3]=a.opacity),{type:fu.Constant,value:s,formatted:a&&"rgba("+a.r+","+a.g+","+a.b+","+a.opacity+")"||"rgba(0,0,0,0)"}}function qu(t,e,n){if(t.type===fu.Constant&&e.type===fu.Constant)return[t.value,e.value,function(t){var e=t.slice();if(e[3])for(var n=0;n<3;n++)e[n]=Math.round(B(255*e[n],0,255));return e[3]=B(e[3],0,1),"rgba("+e.join(",")+")"}]}function zu(t,e,n){var r=ol.get(yo)(n.nodeName);if(r){var i=n.geometry;i.contentBounds||(i.contentBounds=new Hi),i.renderBounds||(i.renderBounds=new Hi);var a=r.update(n.parsedStyle,n),s=a.width,u=a.height,c=a.depth,l=void 0===c?0:c,h=a.x,f=void 0===h?0:h,p=a.y,d=void 0===p?0:p,y=a.offsetX,g=void 0===y?0:y,v=a.offsetY,m=void 0===v?0:v,b=a.offsetZ,T=void 0===b?0:b;n.parsedStyle.width=s,n.parsedStyle.height=u,n.parsedStyle.depth=l,n.nodeName===ho.Line||n.nodeName===ho.Polyline||n.nodeName===ho.Polygon||n.nodeName===ho.Path?(n.parsedStyle.offsetX=f-(n.parsedStyle.defX||0),n.parsedStyle.offsetY=d-(n.parsedStyle.defY||0),n.parsedStyle.defX=f,n.parsedStyle.defY=d,n.translateLocal(n.parsedStyle.offsetX,n.parsedStyle.offsetY),n.parsedStyle.x=n.style.x,n.parsedStyle.y=n.style.y):(n.parsedStyle.x=f,n.parsedStyle.y=d);var E=o.fromValues(s/2,u/2,l/2),M=n.parsedStyle,w=M.lineWidth,_=void 0===w?0:w,x=(M.padding,M.anchor),A=void 0===x?[0,0]:x,P=M.shadowColor,S=M.filter,O=void 0===S?[]:S;n.nodeName===ho.Text&&delete n.parsedStyle.anchor;var N=o.fromValues((1-2*A[0])*E[0]+g,(1-2*A[1])*E[1]+m,(1-2*(A[2]||0))*E[2]+T);if(i.contentBounds.update(N,E),_&&o.add(E,E,o.fromValues(_/2,_/2,0)),i.renderBounds.update(N,E),P&&P.type===fu.Constant){var C=i.renderBounds,I=C.min,R=C.max,k=n.parsedStyle,D=k.shadowBlur,j=void 0===D?0:D,B=k.shadowOffsetX,L=void 0===B?0:B,F=k.shadowOffsetY,G=void 0===F?0:F,V=I[0]-j+L,U=R[0]+j+L,q=I[1]-j+G,z=R[1]+j+G;I[0]=Math.min(I[0],V),R[0]=Math.max(R[0],U),I[1]=Math.min(I[1],q),R[1]=Math.max(R[1],z),i.renderBounds.setMinMax(I,R)}O.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var r=n[0].value;i.renderBounds.update(i.renderBounds.center,o.add(i.renderBounds.halfExtents,i.renderBounds.halfExtents,o.fromValues(r,r,0)))}else if("drop-shadow"===e){var a=n[0].value,s=n[1].value,u=n[2].value,c=i.renderBounds,l=c.min,h=c.max,f=l[0]-u+a,p=h[0]+u+a,d=l[1]-u+s,y=h[1]+u+s;l[0]=Math.min(l[0],f),h[0]=Math.max(h[0],p),l[1]=Math.min(l[1],d),h[1]=Math.max(h[1],y),i.renderBounds.setMinMax(l,h)}})),n.emit(Ki.BOUNDS_CHANGED,{})}}function Wu(t,e,n){var r=n.parsedStyle,i=r.x,o=void 0===i?0:i,a=r.y,s=void 0===a?0:a;n.setLocalPosition(o,s)}function Hu(t){return t.toFixed(3).replace(/0+$/,"").replace(/\.$/,"")}function Yu(t){return"number"==typeof t?t:/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Number(t):0}function $u(t,e){return[t,e,Hu]}function Xu(t,e){return function(n,r){return[n,r,function(n){return Hu(B(n,t,e))}]}}function Ku(t,e){if(t.length==e.length)return[t,e,function(t){return t}]}function Ju(t,e,n){if(t&&t!==e&&t.style.offsetPathTargets){var r=t.style.offsetPathTargets.indexOf(n);t.style.offsetPathTargets.splice(r,1)}e&&(e.style.offsetPathTargets||(e.style.offsetPathTargets=[]),e.style.offsetPathTargets.push(n))}function Zu(t,e,n){if(n.attributes.offsetPath){var r=n.attributes.offsetPath.nodeName;if(r===ho.Line||r===ho.Path||r===ho.Polyline){var i=n.attributes.offsetPath.getPoint(e);i&&n.setLocalPosition(i.x,i.y)}}}function Qu(t,e,n){if(t&&t!==e&&t.style.clipPathTargets){var r=t.style.clipPathTargets.indexOf(n);t.style.clipPathTargets.splice(r,1)}e&&(e.style.clipPathTargets||(e.style.clipPathTargets=[]),e.style.clipPathTargets.push(n)),n.emit(Ki.BOUNDS_CHANGED,{})}function tc(t,e,n){if(n.parentNode){var r=n.parentNode,i=r.renderable,o=r.sortable;i&&(i.dirty=!0),o&&(o.dirty=!0)}}function ec(t){return"px"===t||"%"===t}function nc(t){return"deg"===t||"rad"===t||"turn"===t}function rc(t,e){if("0"===(e=e.trim().toLowerCase())){if("px".search(t)>=0)return{unit:"px",value:0};if("%".search(t)>=0)return{unit:"%",value:0}}if(n=Number(e),L(n)&&isFinite(n))return{unit:"",value:Number(e)};var n,r=[];e=e.replace(t,(function(t){return r.push(t),"U"+t}));var i="U("+t.source+")";return r.map((function(t){return{unit:t,value:Number(e.replace(new RegExp("U"+t,"g"),"").replace(new RegExp(i,"g"),"*0"))}}))[0]}function ic(t,e,n,r,i){void 0===r&&(r=null),void 0===i&&(i=0);var o=t.unit,a=t.value||0,s=e.value||0;return(ec(t.unit)||ec(e.unit))&&(a=uc(t,i,r),s=uc(e,i,r),o="px"),(nc(t.unit)||nc(e.unit))&&(a=cc(t),s=cc(e),o="deg"),[a,s,function(t){return n&&(t=Math.max(t,0)),Hu(t)+o}]}var oc=rc.bind(null,new RegExp("px","g")),ac=rc.bind(null,new RegExp("px|%","g")),sc=rc.bind(null,/deg|rad|grad|turn/g);function uc(t,e,n){if("px"===t.unit)return Number(t.value);if("%"===t.unit&&n){var r=n.getBounds(),i=0;return r&&(i=2*r.halfExtents[e]),Number(t.value)/100*i}return 0}function cc(t){var e=0;return"deg"===t.unit?e=Number(t.value):"rad"===t.unit?e=is(Number(t.value)):"turn"===t.unit&&(e=360*Number(t.value)),e}function lc(t,e,n){n.setOrigin(e[0],e[1],e[2])}function hc(t,e,n){var r,i,o=e.split(" ");if(1===o.length&&("top"===o[0]||"bottom"===o[0]?(o[1]=o[0],o[0]="center"):o[1]="center"),2===o.length){var a=ac(fc(o[0])),s=ac(fc(o[1]));a&&(r=uc(a,0,n)),s&&(i=uc(s,1,n))}P(r)||P(i)||n.setOrigin([r,i])}function fc(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var pc=null,dc={unit:"px",value:0},yc={unit:"deg",value:0};function gc(t){return function(e){var n=0;return t.map((function(t){return t===pc?e[n++]:t}))}}function vc(t){return t}var mc={rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],scale:["Nn",gc([pc,pc,1]),vc],scalex:["N",gc([pc,1,1]),gc([pc,1])],scaley:["N",gc([1,pc,1]),gc([1,pc])],scalez:["N",gc([1,1,pc])],scale3d:["NNN",vc],translate:["Tt",gc([pc,pc,dc]),vc],translatex:["T",gc([pc,dc,dc]),gc([pc,dc])],translatey:["T",gc([dc,pc,dc]),gc([dc,pc])],translatez:["L",gc([dc,dc,pc])],translate3d:["TTL",vc]};function bc(t){if("none"===(t=t.toLowerCase().trim()))return[];for(var e,n=/\s*(\w+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];i=e.index+e[0].length;var o=e[1],a=mc[o];if(!a)return[];var s=e[2].split(","),u=a[0];if(u.length<s.length)return[];for(var c=[],l=0;l<u.length;l++){var h=s[l],f=u[l],p=void 0;if(void 0===(p=h?{A:function(t){return"0"===t.trim()?yc:sc(t)},N:Yu,T:ac,L:oc}[f.toUpperCase()](h):{a:yc,n:c[0],t:dc}[f]))return[];c.push(p)}if(r.push({t:o,d:c}),n.lastIndex===t.length)return r}return[]}function Tc(t){return t.replace(/[xy]/,"")}function Ec(t){return t.replace(/(x|y|z|3d)?$/,"3d")}function Mc(t,e,n){var r=!1;if(!t.length||!e.length){t.length||(r=!0,t=e,e=[]);for(var i=function(n){var r=t[n],i=r.t,o=r.d,a="scale"===i.substr(0,5)?1:0;e.push({t:i,d:o.map((function(t){return"number"==typeof t?a:{unit:t.unit,value:a}}))})},o=0;o<t.length;o++)i(o)}var a,s,u=[],c=[],l=[];if(t.length!==e.length);else for(o=0;o<t.length;o++){var h=t[o].t,f=e[o].t,p=t[o].d,d=e[o].d,y=mc[h],g=mc[f],v=void 0;if(s=f,("perspective"!==(a=h)||"perspective"!==s)&&("matrix"!==a&&"matrix3d"!==a||"matrix"!==s&&"matrix3d"!==s)){if(h===f)v=h;else if(y[2]&&g[2]&&Tc(h)===Tc(f))v=Tc(h),p=y[2](p),d=g[2](d);else{if(!y[1]||!g[1]||Ec(h)!==Ec(f))break;v=Ec(h),p=y[1](p),d=g[1](d)}for(var m=[],b=[],T=[],E=0;E<p.length;E++){var M=("number"==typeof p[E]?$u:ic)(p[E],d[E],!1,n,E);m[E]=M[0],b[E]=M[1],T.push(M[2])}u.push(m),c.push(b),l.push([v,T])}}if(r){var w=u;u=c,c=w}return[u,c,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return l[e][1][n](t)})).join(",");return"matrix"===l[e][0]&&16===n.split(",").length&&(l[e][0]="matrix3d"),l[e][0]+"("+n+")"})).join(" ")}]}function wc(t,e,n){j(E(E([],T((t||[]).map((function(t){return t.t}))),!1),T((e||[]).map((function(t){return t.t}))),!1)).forEach((function(r){var i=(e||[]).find((function(t){return t.t===r})),o=(t||[]).find((function(t){return t.t===r}));if("scale"===r){var a=i&&i.d||[1,1],s=o&&o.d||[1,1];n.scaleLocal(a[0]/s[0],a[1]/s[1],1)}else if("scalex"===r){a=i&&i.d||[1],s=o&&o.d||[1];n.scaleLocal(a[0]/s[0],1,1)}else if("scaley"===r){a=i&&i.d||[1],s=o&&o.d||[1];n.scaleLocal(1,a[0]/s[0],1)}else if("scalez"===r){a=i&&i.d||[1],s=o&&o.d||[1];n.scaleLocal(1,1,a[0]/s[0])}else if("scale3d"===r){a=i&&i.d||[1,1,1],s=o&&o.d||[1,1,1];n.scaleLocal(a[0]/s[0],a[1]/s[1],a[2]/s[2])}else if("translate"===r){var u=i&&i.d||[dc,dc],c=o&&o.d||[dc,dc];n.translateLocal(u[0].value-c[0].value,u[1].value-c[1].value,0)}else if("translatex"===r){u=i&&i.d||[dc],c=o&&o.d||[dc];n.translateLocal(u[0].value-c[0].value,0,0)}else if("translatey"===r){u=i&&i.d||[dc],c=o&&o.d||[dc];n.translateLocal(0,u[0].value-c[0].value,0)}else if("translatez"===r){u=i&&i.d||[dc],c=o&&o.d||[dc];n.translateLocal(0,0,u[0].value-c[0].value)}else if("translate3d"===r){u=i&&i.d||[dc,dc,dc],c=o&&o.d||[dc,dc,dc];n.translateLocal(u[0].value-c[0].value,u[1].value-c[1].value,u[2].value-c[2].value)}else if("rotate"===r){var l=i&&i.d||[yc],h=o&&o.d||[yc];n.rotateLocal(0,0,l[0].value-h[0].value)}else if("rotatex"===r){l=i&&i.d||[yc],h=o&&o.d||[yc];n.rotateLocal(l[0].value-h[0].value,0,0)}else if("rotatey"===r){l=i&&i.d||[yc],h=o&&o.d||[yc];n.rotateLocal(0,l[0].value-h[0].value,0)}else if("rotatez"===r){l=i&&i.d||[yc],h=o&&o.d||[yc];n.rotateLocal(0,0,l[0].value-h[0].value)}}))}var _c=/[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/gi,xc=/[^\s\,]+/gi;var Ac=function(t){var e=t||[];return S(e)?e:D(e)?(e=e.match(_c),N(e,(function(t,n){if((t=t.match(xc))[0].length>1){var r=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=r}N(t,(function(e,n){isNaN(e)||(t[n]=+e)})),e[n]=t})),e):void 0};var Pc="\t\n\v\f\r \u2028\u2029",Sc=new RegExp("([a-z])["+Pc+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+Pc+"]*,?["+Pc+"]*)+)","ig"),Oc=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+Pc+"]*,?["+Pc+"]*","ig");var Nc=/[a-z]/;function Cc(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}function Ic(t){var e=function(t){if(!t)return null;if(S(t))return t;var e={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},n=[];return String(t).replace(Sc,(function(t,r,i){var o=[],a=r.toLowerCase();if(i.replace(Oc,(function(t,e){e&&o.push(+e)})),"m"===a&&o.length>2&&(n.push([r].concat(o.splice(0,2))),a="l",r="m"===r?"l":"L"),"o"===a&&1===o.length&&n.push([r,o[0]]),"r"===a)n.push([r].concat(o));else for(;o.length>=e[a]&&(n.push([r].concat(o.splice(0,e[a]))),e[a]););return""})),n}(t);if(!e||!e.length)return[["M",0,0]];for(var n=!1,r=0;r<e.length;r++){var i=e[r][0];if(Nc.test(i)||["V","H","T","S"].indexOf(i)>=0){n=!0;break}}if(!n)return e;var o=[],a=0,s=0,u=0,c=0,l=0,h=e[0];"M"!==h[0]&&"m"!==h[0]||(u=a=+h[1],c=s=+h[2],l++,o[0]=["M",a,s]);r=l;for(var f=e.length;r<f;r++){var p=e[r],d=o[r-1],y=[],g=(i=p[0]).toUpperCase();if(i!==g)switch(y[0]=g,g){case"A":y[1]=p[1],y[2]=p[2],y[3]=p[3],y[4]=p[4],y[5]=p[5],y[6]=+p[6]+a,y[7]=+p[7]+s;break;case"V":y[1]=+p[1]+s;break;case"H":y[1]=+p[1]+a;break;case"M":u=+p[1]+a,c=+p[2]+s,y[1]=u,y[2]=c;break;default:for(var v=1,m=p.length;v<m;v++)y[v]=+p[v]+(v%2?a:s)}else y=e[r];switch(g){case"Z":a=+u,s=+c;break;case"H":y=["L",a=y[1],s];break;case"V":y=["L",a,s=y[1]];break;case"T":a=y[1],s=y[2];var b=Cc([d[1],d[2]],[d[3],d[4]]);y=["Q",b[0],b[1],a,s];break;case"S":a=y[y.length-2],s=y[y.length-1];var T=d.length,E=Cc([d[T-4],d[T-3]],[d[T-2],d[T-1]]);y=["C",E[0],E[1],y[1],y[2],a,s];break;case"M":u=y[y.length-2],c=y[y.length-1];break;default:a=y[y.length-2],s=y[y.length-1]}o.push(y)}return o}var Rc=2*Math.PI,kc=function(t,e,n,r,i,o,a){var s=t.x,u=t.y;return{x:r*(s*=e)-i*(u*=n)+o,y:i*s+r*u+a}},Dc=function(t,e){var n=1.5707963267948966===e?.551915024494:-1.5707963267948966===e?-.551915024494:4/3*Math.tan(e/4),r=Math.cos(t),i=Math.sin(t),o=Math.cos(t+e),a=Math.sin(t+e);return[{x:r-i*n,y:i+r*n},{x:o+a*n,y:a-o*n},{x:o,y:a}]},jc=function(t,e,n,r){var i=t*n+e*r;return i>1&&(i=1),i<-1&&(i=-1),(t*r-e*n<0?-1:1)*Math.acos(i)},Bc=function(t){var e=t.px,n=t.py,r=t.cx,i=t.cy,o=t.rx,a=t.ry,s=t.xAxisRotation,u=void 0===s?0:s,c=t.largeArcFlag,l=void 0===c?0:c,h=t.sweepFlag,f=void 0===h?0:h,p=[];if(0===o||0===a)return[{x1:0,y1:0,x2:0,y2:0,x:r,y:i}];var d=Math.sin(u*Rc/360),y=Math.cos(u*Rc/360),g=y*(e-r)/2+d*(n-i)/2,v=-d*(e-r)/2+y*(n-i)/2;if(0===g&&0===v)return[{x1:0,y1:0,x2:0,y2:0,x:r,y:i}];o=Math.abs(o),a=Math.abs(a);var m=Math.pow(g,2)/Math.pow(o,2)+Math.pow(v,2)/Math.pow(a,2);m>1&&(o*=Math.sqrt(m),a*=Math.sqrt(m));var b=function(t,e,n,r,i,o,a,s,u,c,l,h){var f=Math.pow(i,2),p=Math.pow(o,2),d=Math.pow(l,2),y=Math.pow(h,2),g=f*p-f*y-p*d;g<0&&(g=0),g/=f*y+p*d;var v=(g=Math.sqrt(g)*(a===s?-1:1))*i/o*h,m=g*-o/i*l,b=c*v-u*m+(t+n)/2,T=u*v+c*m+(e+r)/2,E=(l-v)/i,M=(h-m)/o,w=(-l-v)/i,_=(-h-m)/o,x=jc(1,0,E,M),A=jc(E,M,w,_);return 0===s&&A>0&&(A-=Rc),1===s&&A<0&&(A+=Rc),[b,T,x,A]}(e,n,r,i,o,a,l,f,d,y,g,v),T=b[0],E=b[1],M=b[2],w=b[3],_=Math.abs(w)/(Rc/4);Math.abs(1-_)<1e-7&&(_=1);var x=Math.max(Math.ceil(_),1);w/=x;for(var A=0;A<x;A++)p.push(Dc(M,w)),M+=w;return p.map((function(t){var e=kc(t[0],o,a,y,d,T,E),n=e.x,r=e.y,i=kc(t[1],o,a,y,d,T,E),s=i.x,u=i.y,c=kc(t[2],o,a,y,d,T,E);return{x1:n,y1:r,x2:s,y2:u,x:c.x,y:c.y}}))};function Lc(t,e,n,r,i,o,a,s,u){return Bc({px:t,py:e,cx:s,cy:u,rx:n,ry:r,xAxisRotation:i,largeArcFlag:o,sweepFlag:a}).reduce((function(t,e){var n=e.x1,r=e.y1,i=e.x2,o=e.y2,a=e.x,s=e.y;return t.push(n,r,i,o,a,s),t}),[])}function Fc(t,e,n,r,i,o){return[1/3*t+2/3*n,1/3*e+2/3*r,1/3*i+2/3*n,1/3*o+2/3*r,i,o]}function Gc(t,e,n,r){return[t,e,n,r,n,r]}function Vc(t,e){"TQ".indexOf(t[0])<0&&(e.qx=null,e.qy=null);var n=t.slice(1),r=n[0],i=n[1];switch(t[0]){case"M":return e.x=r,e.y=i,t;case"A":return["C"].concat(Lc.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"Q":return e.qx=r,e.qy=i,["C"].concat(Fc.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"L":return["C"].concat(Gc(e.x1,e.y1,t[1],t[2]));case"H":return["C"].concat(Gc(e.x1,e.y1,t[1],e.y1));case"V":return["C"].concat(Gc(e.x1,e.y1,e.x1,t[1]));case"Z":return["C"].concat(Gc(e.x1,e.y1,e.x,e.y))}return t}function Uc(t,e){void 0===e&&(e=!1);for(var n,r,i=Ic(t),o={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},a=[],s="",u=i.length,c=[],l=0;l<u;l+=1)i[l]&&(s=i[l][0]),a[l]=s,i[l]=Vc(i[l],o),qc(i,a,l),u=i.length,"Z"===s&&c.push(l),r=(n=i[l]).length,o.x1=+n[r-2],o.y1=+n[r-1],o.x2=+n[r-4]||o.x1,o.y2=+n[r-3]||o.y1;return e?[i,c]:i}function qc(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],i=n;r.length;)e[n]="A",t.splice(i+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}function zc(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Wc(t,e){return zc(t)*zc(e)?(t[0]*e[0]+t[1]*e[1])/(zc(t)*zc(e)):1}function Hc(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(Wc(t,e))}function Yc(t,e){return t[0]===e[0]&&t[1]===e[1]}function $c(t,e){var n=e[1],r=e[2],i=F(V(e[3]),2*Math.PI),o=e[4],a=e[5],s=t[0],u=t[1],c=e[6],l=e[7],h=Math.cos(i)*(s-c)/2+Math.sin(i)*(u-l)/2,f=-1*Math.sin(i)*(s-c)/2+Math.cos(i)*(u-l)/2,p=h*h/(n*n)+f*f/(r*r);p>1&&(n*=Math.sqrt(p),r*=Math.sqrt(p));var d=n*n*(f*f)+r*r*(h*h),y=d?Math.sqrt((n*n*(r*r)-d)/d):1;o===a&&(y*=-1),isNaN(y)&&(y=0);var g=r?y*n*f/r:0,v=n?y*-r*h/n:0,m=(s+c)/2+Math.cos(i)*g-Math.sin(i)*v,b=(u+l)/2+Math.sin(i)*g+Math.cos(i)*v,T=[(h-g)/n,(f-v)/r],E=[(-1*h-g)/n,(-1*f-v)/r],M=Hc([1,0],T),w=Hc(T,E);return Wc(T,E)<=-1&&(w=Math.PI),Wc(T,E)>=1&&(w=0),0===a&&w>0&&(w-=2*Math.PI),1===a&&w<0&&(w+=2*Math.PI),{cx:m,cy:b,rx:Yc(t,[c,l])?0:n,ry:Yc(t,[c,l])?0:r,startAngle:M,endAngle:M+w,xRotation:i,arcFlag:o,sweepFlag:a}}function Xc(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}var Kc=function(){function t(t,e,n,r){this.x=t,this.y=e,this.width=n,this.height=r,this.left=t,this.right=t+n,this.top=e,this.bottom=e+r,this.width=n,this.height=r,this.x=t,this.y=e}return t.prototype.toJSON=function(){},t}();function Jc(t,e){var n=Ic(t),r=function(t){for(var e=!1,n=t.length,r=0;r<n;r++){var i=t[r][0];if("C"===i||"A"===i||"Q"===i){e=!0;break}}return e}(n),i=n.slice(),o=function(t){for(var e=[],n=[],r=[],i=0;i<t.length;i++){var o=t[i],a=o[0];"M"===a?(r.length&&(n.push(r),r=[]),r.push([o[1],o[2]])):"Z"===a?r.length&&(e.push(r),r=[]):r.push([o[1],o[2]])}r.length>0&&n.push(r);return{polygons:e,polylines:n}}(i),a=o.polygons,s=o.polylines,u=T(Uc(i,!0),2),c=u[0],l=u[1],h=function(t){for(var e=[],n=null,r=null,i=null,o=0,a=(t=Ac(t)).length,s=0;s<a;s++){var u=t[s];r=t[s+1];var c=u[0],l={command:c,prePoint:n,params:u,startTangent:null,endTangent:null};switch(c){case"M":i=[u[1],u[2]],o=s;break;case"A":var h=$c(n,u);l.arcParams=h}if("Z"===c)n=i,r=t[o+1];else{var f=u.length;n=[u[f-2],u[f-1]]}r&&"Z"===r[0]&&(r=t[o],e[o]&&(e[o].prePoint=n)),l.currentPoint=n,e[o]&&Yc(n,e[o].currentPoint)&&(e[o].prePoint=l.prePoint);var p=r?[r[r.length-2],r[r.length-1]]:null;l.nextPoint=p;var d=l.prePoint;if(["L","H","V"].includes(c))l.startTangent=[d[0]-n[0],d[1]-n[1]],l.endTangent=[n[0]-d[0],n[1]-d[1]];else if("Q"===c){var y=[u[1],u[2]];l.startTangent=[d[0]-y[0],d[1]-y[1]],l.endTangent=[n[0]-y[0],n[1]-y[1]]}else if("T"===c){y=Xc((m=e[s-1]).currentPoint,d);"Q"===m.command?(l.command="Q",l.startTangent=[d[0]-y[0],d[1]-y[1]],l.endTangent=[n[0]-y[0],n[1]-y[1]]):(l.command="TL",l.startTangent=[d[0]-n[0],d[1]-n[1]],l.endTangent=[n[0]-d[0],n[1]-d[1]])}else if("C"===c){var g=[u[1],u[2]],v=[u[3],u[4]];l.startTangent=[d[0]-g[0],d[1]-g[1]],l.endTangent=[n[0]-v[0],n[1]-v[1]],0===l.startTangent[0]&&0===l.startTangent[1]&&(l.startTangent=[g[0]-v[0],g[1]-v[1]]),0===l.endTangent[0]&&0===l.endTangent[1]&&(l.endTangent=[v[0]-g[0],v[1]-g[1]])}else if("S"===c){var m;g=Xc((m=e[s-1]).currentPoint,d),v=[u[1],u[2]];"C"===m.command?(l.command="C",l.startTangent=[d[0]-g[0],d[1]-g[1]],l.endTangent=[n[0]-v[0],n[1]-v[1]]):(l.command="SQ",l.startTangent=[d[0]-v[0],d[1]-v[1]],l.endTangent=[n[0]-v[0],n[1]-v[1]])}else if("A"===c){var b=.001,T=l.arcParams||{},E=T.cx,M=void 0===E?0:E,w=T.cy,_=void 0===w?0:w,x=T.rx,A=void 0===x?0:x,P=T.ry,S=void 0===P?0:P,O=T.sweepFlag,N=void 0===O?0:O,C=T.startAngle,I=void 0===C?0:C,R=T.endAngle,k=void 0===R?0:R;0===N&&(b*=-1);var D=A*Math.cos(I-b)+M,j=S*Math.sin(I-b)+_;l.startTangent=[D-i[0],j-i[1]];var B=A*Math.cos(I+k+b)+M,L=S*Math.sin(I+k-b)+_;l.endTangent=[d[0]-B,d[1]-L]}e.push(l)}return e}(i),f=function(t){var e,n,r,i,o=0,a=0,s=[];if(!t)return{curveSegments:[],totalLength:o};if(t.forEach((function(e,n){r=t[n+1],i=e.length,r&&(o+=Ms.length(e[i-2],e[i-1],r[1],r[2],r[3],r[4],r[5],r[6])||0)})),0===o)return{curveSegments:[],totalLength:o};return t.forEach((function(u,c){r=t[c+1],i=u.length,r&&((e=[])[0]=a/o,n=Ms.length(u[i-2],u[i-1],r[1],r[2],r[3],r[4],r[5],r[6]),a+=n||0,e[1]=a/o,s.push(e))})),{curveSegments:s,totalLength:o}}(c);return{absolutePath:n,hasArc:r,segments:h,polygons:a,polylines:s,curve:c,totalLength:f.totalLength,curveSegments:f.curveSegments,zCommandIndexes:l,rect:Zc(c)}}function Zc(t){var e=0,n=0,r=[],i=[];t.forEach((function(t){var o=T(t.slice(-2),2),a=o[0],s=o[1];if("M"===t[0])e=a,n=s,r.push(a),i.push(s);else if("C"===t[0]){var u=Ms.box.apply(Ms,E([],T([e,n].concat(t.slice(1))),!1));r=r.concat(u.x,u.x+u.width),i=i.concat(u.y,u.y+u.height),e=a,n=s}}));var o=Math.min.apply(0,r),a=Math.min.apply(0,i),s=Math.max.apply(0,r),u=Math.max.apply(0,i);return new Kc(o,a,s-o,u-a)}function Qc(t,e,n){var r=t.curve,i=e.curve,o=[r,i];r.length!==i.length&&(o=Ps(r,i));var a=Ss(o[0])!==Ss(o[1])?Cs(o[0]):Is(o[0]);return[a,Rs(o[1],a),function(t){return t}]}function tl(t,e){var n,r,i=[],o=0,a=_s(t);return t.forEach((function(e,s){t[s+1]&&((n=[0,0])[0]=o/a,r=ys.length(e[0],e[1],t[s+1][0],t[s+1][1]),o+=r,n[1]=o/a,i.push(n))})),{points:t,totalLength:a,segments:i}}var el=rc.bind(null,/deg|rad|grad|turn|px|%/g),nl=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function rl(t,e){if(void 0===t&&(t=""),"none"===(t=t.toLowerCase().trim()))return[];for(var n,r=/\s*([\w-]+)\(([^)]*)\)/g,i=[],o=0;n=r.exec(t);){if(n.index!==o)return[];if(o=n.index+n[0].length,nl.indexOf(n[1])>-1&&i.push({name:n[1],params:n[2].split(" ").map((function(t){return el(t)||Uu(t)}))}),r.lastIndex===t.length)return i}return[]}function il(t,e){return t&&1===t.length?[t[0],t[0]]:[t[0],t[1]]}var ol=c.GlobalContainer,al=Object(c.Module)((function(t){function e(e,n,r,i){n&&t({token:{token:ko,named:e},useValue:n}),r&&t({token:{token:Lo,named:e},useValue:r}),i&&t({token:{token:jo,named:e},useValue:i})}function n(t,n,r,i){for(var o=0;o<t.length;o++)e(t[o],n,r,i)}Object(c.decorate)(Object(c.injectable)(),l.EventEmitter),t(M),t({token:uo,useClass:co}),t({token:so,useFactory:function(t){return function(){return t.container.get(uo)}}}),t({token:fo,useClass:po}),t(_o),t(Oo),t(mo),t(bo),t(To),t(No),t(Co),t(Io),t(Ro),t({token:yo,useFactory:function(t){var e={};return function(n){return e[n]||t.container.isBoundNamed(go,n)&&(e[n]=t.container.getNamed(go,n)),e[n]}}}),t({token:Do,useFactory:function(t){var e={};return function(n){return e[n]||t.container.isBoundNamed(ko,n)&&(e[n]=t.container.getNamed(ko,n)),e[n]}}}),t({token:Bo,useFactory:function(t){var e={};return function(n){return e[n]||t.container.isBoundNamed(jo,n)&&(e[n]=t.container.getAllNamed(jo,n)),e[n]}}}),t({token:Fo,useFactory:function(t){var e={};return function(n){return e[n]||t.container.isBoundNamed(Lo,n)&&(e[n]=t.container.getNamed(Lo,n)),e[n]}}}),n(["opacity","fillOpacity","strokeOpacity","offsetDistance"],Yu,Xu(0,1),void 0),n(["r","rx","ry","lineWidth","width","height","shadowBlur"],Yu,Xu(0,1/0),void 0),n(["lineDash"],il,Ku,void 0),n(["x1","x2","y1","y2","lineDashOffset","shadowOffsetX","shadowOffsetY"],Yu,$u,void 0),n(["x1","x2","y1","y2","r","rx","ry","width","height","path","points","text","shadowBlur","shadowOffsetX","shadowOffsetY","lineWidth","filter","font","fontSize","fontFamily","fontStyle","fontWeight","fontVariant","lineHeight","letterSpacing","padding","wordWrap","wordWrapWidth","leading","textBaseline","textAlign","whiteSpace"],void 0,void 0,zu),n(["fill","stroke","shadowColor"],Uu,qu,void 0),e("clipPath",void 0,void 0,Qu),e("zIndex",void 0,void 0,tc),e("offsetPath",void 0,void 0,Ju),e("offsetDistance",void 0,void 0,Zu),e("origin",void 0,void 0,lc),e("transformOrigin",void 0,void 0,hc),e("transform",bc,Mc,wc),e("path",Jc,Qc,void 0),e("points",tl,void 0,void 0),n(["x","y","points","path","x1","x2","y1","y2"],void 0,void 0,Wu),e("filter",rl,void 0,void 0),e("anchor",void 0,void 0,eu)})),sl=function(){function t(t){this.plugins=[],this.config=p({enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1,enableTAA:!1},t)}return t.prototype.registerPlugin=function(t){this.plugins.push(t)},t.prototype.getPlugins=function(){return this.plugins},t.prototype.getConfig=function(){return this.config},t.prototype.setConfig=function(t){Object.assign(this.config,t)},t}(),ul={},cl=0;var ll,hl,fl,pl=function(){function t(t,e){this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.name=t,this.matrix=i.clone(e.matrix),this.right=o.clone(e.right),this.up=o.clone(e.up),this.forward=o.clone(e.forward),this.position=o.clone(e.position),this.focalPoint=o.clone(e.focalPoint),this.distanceVector=o.clone(e.distanceVector),this.azimuth=e.azimuth,this.elevation=e.elevation,this.roll=e.roll,this.relAzimuth=e.relAzimuth,this.relElevation=e.relElevation,this.relRoll=e.relRoll,this.dollyingStep=e.dollyingStep,this.distance=e.distance}return t.prototype.getPosition=function(){return this.position},t.prototype.getFocalPoint=function(){return this.focalPoint},t.prototype.getRoll=function(){return this.roll},t.prototype.retrieve=function(t){t.matrix=i.copy(t.matrix,this.matrix),t.right=o.copy(t.right,this.right),t.up=o.copy(t.up,this.up),t.forward=o.copy(t.forward,this.forward),t.position=o.copy(t.position,this.position),t.focalPoint=o.copy(t.focalPoint,this.focalPoint),t.distanceVector=o.copy(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}(),dl="DefaultCamera";!function(t){t.ORBITING="ORBITING",t.EXPLORING="EXPLORING",t.TRACKING="TRACKING"}(ll||(ll={})),function(t){t.DEFAULT="DEFAULT",t.ROTATIONAL="ROTATIONAL",t.TRANSLATIONAL="TRANSLATIONAL",t.CINEMATIC="CINEMATIC"}(hl||(hl={})),function(t){t.ORTHOGRAPHIC="ORTHOGRAPHIC",t.PERSPECTIVE="PERSPECTIVE"}(fl||(fl={}));var yl={Updated:"updated"},gl=Math.PI/180,vl=180/Math.PI,ml=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.matrix=i.create(),e.right=o.fromValues(1,0,0),e.up=o.fromValues(0,1,0),e.forward=o.fromValues(0,0,1),e.position=o.fromValues(0,0,1),e.focalPoint=o.fromValues(0,0,0),e.distanceVector=o.fromValues(0,0,0),e.distance=1,e.azimuth=0,e.elevation=0,e.roll=0,e.relAzimuth=0,e.relElevation=0,e.relRoll=0,e.dollyingStep=0,e.maxDistance=1/0,e.minDistance=-1/0,e.zoom=1,e.rotateWorld=!1,e.fov=30,e.near=.1,e.far=1e4,e.aspect=1,e.projectionMatrix=i.create(),e.projectionMatrixInverse=i.create(),e.jitteredProjectionMatrix=void 0,e.following=void 0,e.type=ll.EXPLORING,e.trackingMode=hl.DEFAULT,e.projectionMode=fl.PERSPECTIVE,e.frustum=new Ji,e.landmarks=[],e.orthoMatrix=i.create(),e}return f(e,t),e.prototype.clone=function(){var t=new e;return t.setType(this.type,void 0),t},e.prototype.getProjectionMode=function(){return this.projectionMode},e.prototype.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},e.prototype.getPerspectiveInverse=function(){return this.projectionMatrixInverse},e.prototype.getFrustum=function(){return this.frustum},e.prototype.getPosition=function(){return this.position},e.prototype.getFocalPoint=function(){return this.focalPoint},e.prototype.getNear=function(){return this.near},e.prototype.getFar=function(){return this.far},e.prototype.getZoom=function(){return this.zoom},e.prototype.getOrthoMatrix=function(){return this.orthoMatrix},e.prototype.setType=function(t,e){return this.type=t,this.type===ll.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===ll.TRACKING&&void 0!==e&&this.setTrackingMode(e),this},e.prototype.setProjectionMode=function(t){return this.projectionMode=t,this},e.prototype.setTrackingMode=function(t){if(this.type!==ll.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this},e.prototype.setWorldRotation=function(t){this.rotateWorld=t,this._getAngles()},e.prototype.getViewTransform=function(){return i.invert(i.create(),this.matrix)},e.prototype.getWorldTransform=function(){return this.matrix},e.prototype.jitterProjectionMatrix=function(t,e){var n=i.fromTranslation(i.create(),[t,e,0]);this.jitteredProjectionMatrix=i.multiply(i.create(),n,this.projectionMatrix)},e.prototype.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},e.prototype.setMatrix=function(t){return this.matrix=t,this._update(),this},e.prototype.setFov=function(t){this.setPerspective(this.near,this.far,t,this.aspect)},e.prototype.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},e.prototype.setNear=function(t){return this.projectionMode===fl.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this},e.prototype.setFar=function(t){return this.projectionMode===fl.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this},e.prototype.setViewOffset=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===fl.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},e.prototype.clearViewOffset=function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===fl.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},e.prototype.setZoom=function(t){return this.zoom=t,this.projectionMode===fl.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===fl.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},e.prototype.setPerspective=function(t,e,n,r){this.projectionMode=fl.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r;var o=this.near*Math.tan(.5*gl*this.fov)/this.zoom,a=2*o,s=this.aspect*a,u=-.5*s;if(void 0!==this.view&&this.view.enabled){var c=this.view.fullWidth,l=this.view.fullHeight;u+=this.view.offsetX*s/c,o-=this.view.offsetY*a/l,s*=this.view.width/c,a*=this.view.height/l}return ls(this.projectionMatrix,u,u+s,o-a,o,t,this.far),i.invert(this.projectionMatrixInverse,this.projectionMatrix),this.emit(yl.Updated),this},e.prototype.setOrthographic=function(t,e,n,r,o,a){this.projectionMode=fl.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=r,this.near=o,this.far=a;var s=(this.rright-this.left)/(2*this.zoom),u=(this.top-this.bottom)/(2*this.zoom),c=(this.rright+this.left)/2,l=(this.top+this.bottom)/2,h=c-s,f=c+s,p=l+u,d=l-u;if(void 0!==this.view&&this.view.enabled){var y=(this.rright-this.left)/this.view.fullWidth/this.zoom,g=(this.top-this.bottom)/this.view.fullHeight/this.zoom;f=(h+=y*this.view.offsetX)+y*this.view.width,d=(p-=g*this.view.offsetY)-g*this.view.height}return i.ortho(this.projectionMatrix,h,f,d,p,o,a),i.invert(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.emit(yl.Updated),this},e.prototype.setPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this._setPosition(t,e,n),this.setFocalPoint(this.focalPoint),this},e.prototype.setFocalPoint=function(t,e,n){var r=o.fromValues(0,1,0);if(this.focalPoint=ns(t,e,n),this.trackingMode===hl.CINEMATIC){var a=o.subtract(o.create(),this.focalPoint,this.position);t=a[0],e=a[1],n=a[2];var s=o.length(a),u=Math.asin(e/s)*vl,c=90+Math.atan2(n,t)*vl,l=i.create();i.rotateY(l,l,c*gl),i.rotateX(l,l,u*gl),r=o.transformMat4(o.create(),[0,1,0],l)}return i.invert(this.matrix,i.lookAt(i.create(),this.position,this.focalPoint,r)),this._getAxes(),this._getDistance(),this._getAngles(),this},e.prototype.setDistance=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=o.create();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}},e.prototype.setMaxDistance=function(t){return this.maxDistance=t,this},e.prototype.setMinDistance=function(t){return this.minDistance=t,this},e.prototype.changeAzimuth=function(t){return this.setAzimuth(this.azimuth+t),this},e.prototype.changeElevation=function(t){return this.setElevation(this.elevation+t),this},e.prototype.changeRoll=function(t){return this.setRoll(this.roll+t),this},e.prototype.setAzimuth=function(t){return this.azimuth=es(t),this.computeMatrix(),this._getAxes(),this.type===ll.ORBITING||this.type===ll.EXPLORING?this._getPosition():this.type===ll.TRACKING&&this._getFocalPoint(),this},e.prototype.getAzimuth=function(){return this.azimuth},e.prototype.setElevation=function(t){return this.elevation=es(t),this.computeMatrix(),this._getAxes(),this.type===ll.ORBITING||this.type===ll.EXPLORING?this._getPosition():this.type===ll.TRACKING&&this._getFocalPoint(),this},e.prototype.setRoll=function(t){return this.roll=es(t),this.computeMatrix(),this._getAxes(),this.type===ll.ORBITING||this.type===ll.EXPLORING?this._getPosition():this.type===ll.TRACKING&&this._getFocalPoint(),this},e.prototype.rotate=function(t,e,n){if(this.relElevation=es(e),this.relAzimuth=es(t),this.relRoll=es(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===ll.EXPLORING){var r=s.setAxisAngle(s.create(),[1,0,0],(this.rotateWorld?1:-1)*this.relElevation*gl),o=s.setAxisAngle(s.create(),[0,1,0],(this.rotateWorld?1:-1)*this.relAzimuth*gl),a=s.setAxisAngle(s.create(),[0,0,1],this.relRoll*gl),u=s.multiply(s.create(),o,r);u=s.multiply(s.create(),u,a);var c=i.fromQuat(i.create(),u);i.translate(this.matrix,this.matrix,[0,0,-this.distance]),i.multiply(this.matrix,this.matrix,c),i.translate(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return;this.computeMatrix()}return this._getAxes(),this.type===ll.ORBITING||this.type===ll.EXPLORING?this._getPosition():this.type===ll.TRACKING&&this._getFocalPoint(),this._update(),this},e.prototype.pan=function(t,e){var n=ns(t,e,0),r=o.clone(this.position);return o.add(r,r,o.scale(o.create(),this.right,n[0])),o.add(r,r,o.scale(o.create(),this.up,n[1])),this._setPosition(r),this.emit(yl.Updated),this},e.prototype.dolly=function(t){var e=this.forward,n=o.clone(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===ll.ORBITING||this.type===ll.EXPLORING?this._getDistance():this.type===ll.TRACKING&&o.add(this.focalPoint,n,this.distanceVector),this.emit(yl.Updated),this},e.prototype.createLandmark=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 pl(t,n);return this.landmarks.push(r),r},e.prototype.setLandmark=function(t){var e=new pl(t,this);return this.landmarks.push(e),this},e.prototype.gotoLandmark=function(t,e){var n=this;void 0===e&&(e=1e3);var r=this.landmarks.find((function(e){return e.name===t}));if(r){if(0===e)return void r.retrieve(this);void 0!==this.landmarkAnimationID&&na(this.landmarkAnimationID);var i,a=r.getPosition(),s=r.getFocalPoint(),u=r.getRoll(),c=function(t){void 0===i&&(i=t);var r,l=t-i,h=(1-Math.cos(l/e*Math.PI))/2,f=o.create(),p=o.create();if(o.lerp(f,n.focalPoint,s,h),o.lerp(p,n.position,a,h),r=n.roll*(1-h)+u*h,n.setFocalPoint(f),n.setPosition(p),n.setRoll(r),n.computeMatrix(),n.emit(yl.Updated),!(o.dist(f,s)+o.dist(p,a)>.01))return n.setFocalPoint(f),n.setPosition(p),n.setRoll(r),void n.computeMatrix();l<e&&(n.landmarkAnimationID=ea(c))};ea(c)}},e.prototype._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.emit(yl.Updated)},e.prototype.computeMatrix=function(){var t,e,n=s.setAxisAngle(s.create(),[0,0,1],this.roll*gl);i.identity(this.matrix),t=s.setAxisAngle(s.create(),[1,0,0],(this.rotateWorld&&this.type!==ll.TRACKING||this.type===ll.TRACKING?1:-1)*this.elevation*gl),e=s.setAxisAngle(s.create(),[0,1,0],(this.rotateWorld&&this.type!==ll.TRACKING||this.type===ll.TRACKING?1:-1)*this.azimuth*gl);var r=s.multiply(s.create(),e,t);r=s.multiply(s.create(),r,n);var o=i.fromQuat(i.create(),r);this.type===ll.ORBITING||this.type===ll.EXPLORING?(i.translate(this.matrix,this.matrix,this.focalPoint),i.multiply(this.matrix,this.matrix,o),i.translate(this.matrix,this.matrix,[0,0,this.distance])):this.type===ll.TRACKING&&(i.translate(this.matrix,this.matrix,this.position),i.multiply(this.matrix,this.matrix,o))},e.prototype._setPosition=function(t,e,n){this.position=ns(t,e,n);var r=this.matrix;r[12]=this.position[0],r[13]=this.position[1],r[14]=this.position[2],r[15]=1,this._getOrthoMatrix()},e.prototype._getAxes=function(){o.copy(this.right,ns(a.transformMat4(a.create(),[1,0,0,0],this.matrix))),o.copy(this.up,ns(a.transformMat4(a.create(),[0,1,0,0],this.matrix))),o.copy(this.forward,ns(a.transformMat4(a.create(),[0,0,1,0],this.matrix))),o.normalize(this.right,this.right),o.normalize(this.up,this.up),o.normalize(this.forward,this.forward)},e.prototype._getAngles=function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=o.length(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===ll.TRACKING||this.rotateWorld?(this.elevation=Math.asin(e/r)*vl,this.azimuth=Math.atan2(-t,-n)*vl):(this.elevation=-Math.asin(e/r)*vl,this.azimuth=-Math.atan2(-t,-n)*vl)},e.prototype._getPosition=function(){o.copy(this.position,ns(a.transformMat4(a.create(),[0,0,0,1],this.matrix))),this._getDistance()},e.prototype._getFocalPoint=function(){o.transformMat3(this.distanceVector,[0,0,-this.distance],r.fromMat4(r.create(),this.matrix)),o.add(this.focalPoint,this.position,this.distanceVector),this._getDistance()},e.prototype._getDistance=function(){this.distanceVector=o.subtract(o.create(),this.focalPoint,this.position),this.distance=o.length(this.distanceVector),this.dollyingStep=this.distance/100},e.prototype._getOrthoMatrix=function(){if(this.projectionMode===fl.ORTHOGRAPHIC){var t=this.position,e=s.setAxisAngle(s.create(),[0,0,1],-this.roll*Math.PI/180);i.fromRotationTranslationScaleOrigin(this.orthoMatrix,e,o.fromValues((this.rright-this.left)/2-t[0],(this.bottom-this.top)/2-t[1],0),o.fromValues(this.zoom,this.zoom,1),t)}},e.ProjectionMode={ORTHOGRAPHIC:"ORTHOGRAPHIC",PERSPECTIVE:"PERSPECTIVE"},e}(l.EventEmitter),bl=function(){function t(){}var e;return e=t,t.prototype.apply=function(t){var n=this;t.hooks.prepare.tap(e.tag,(function(t){if(t){var e=n.canvasConfig.renderer.getConfig().enableDirtyRectangleRendering;return t.renderable.dirty||n.renderingContext.renderReasons.has(nu.CameraChanged)||!e?t:null}return t}))},t.tag="DirtyCheckPlugin",y([Object(c.inject)(vo),g("design:type",Object)],t.prototype,"canvasConfig",void 0),y([Object(c.inject)(iu),g("design:type",Object)],t.prototype,"renderingContext",void 0),t=e=y([Object(c.singleton)({contrib:au})],t)}(),Tl=c.Syringe.defineToken("CullingStrategyContribution"),El=function(){function t(){}var e;return e=t,t.prototype.apply=function(t){var n=this,r=this.strategyProvider.getContributions();t.hooks.prepare.tap(e.tag,(function(t){if(t){var e=t.cullable;if(0===r.length?e.visible=!0:e.visible=r.every((function(e){return e.isVisible(t)})),t.isVisible())return t;if(n.canvasConfig.renderer.getConfig().enableDirtyRectangleRendering){var i=t.getRenderBounds();i&&(n.renderingContext.removedRenderBoundsList.push(i),n.renderingContext.renderReasons.add(nu.DisplayObjectRemoved))}return null}return t})),t.hooks.afterRender.tap(e.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))},t.tag="CullingPlugin",y([Object(c.inject)(vo),g("design:type",Object)],t.prototype,"canvasConfig",void 0),y([Object(c.contrib)(Tl),g("design:type",Object)],t.prototype,"strategyProvider",void 0),y([Object(c.inject)(iu),g("design:type",Object)],t.prototype,"renderingContext",void 0),t=e=y([Object(c.singleton)({contrib:au})],t)}(),Ml=function(){function t(){}var e;return e=t,t.prototype.apply=function(t){var n=this,r=function(t){n.renderingContext.renderReasons.add(nu.DisplayObjectChanged)},i=function(e){e.composedPath().slice(0,-2).forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),t.dirtify()},o=function(t){i(t)},a=function(t){i(t)},s=function(t){i(t)};t.hooks.init.tap(e.tag,(function(){n.renderingContext.root.addEventListener(Ki.MOUNTED,a),n.renderingContext.root.addEventListener(Ki.UNMOUNTED,s),n.renderingContext.root.addEventListener(Ki.ATTRIBUTE_CHANGED,r),n.renderingContext.root.addEventListener(Ki.BOUNDS_CHANGED,o)})),t.hooks.destroy.tap(e.tag,(function(){n.renderingContext.root.removeEventListener(Ki.MOUNTED,a),n.renderingContext.root.removeEventListener(Ki.UNMOUNTED,s),n.renderingContext.root.removeEventListener(Ki.ATTRIBUTE_CHANGED,r),n.renderingContext.root.removeEventListener(Ki.BOUNDS_CHANGED,o)}))},t.tag="PrepareRendererPlugin",y([Object(c.inject)(iu),g("design:type",Object)],t.prototype,"renderingContext",void 0),t=e=y([Object(c.singleton)({contrib:au})],t)}(),wl=function(){function t(){}return t.prototype.isVisible=function(t){t.entity,t.cullable;return!0},t.prototype.computeVisibilityWithPlaneMask=function(t,e,n){if(e===Bi.OUTSIDE||e===Bi.INSIDE)return e;for(var r=Bi.INSIDE,i=0,a=n.length;i<a;++i){var s=i<31?1<<i:0;if(!(i<31&&0==(e&s))){var u=n[i],c=u.normal,l=u.distance;if(o.dot(c,t.getPositiveFarPoint(n[i]))+l<0)return Bi.OUTSIDE;o.dot(c,t.getNegativeFarPoint(n[i]))+l<0&&(r|=s)}}return r},y([Object(c.inject)(dl),g("design:type",ml)],t.prototype,"camera",void 0),t=y([Object(c.singleton)({contrib:Tl})],t)}(),_l=!!self.TouchEvent,xl=!!self.PointerEvent,Al={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};function Pl(t){var e=[];if(function(t){return _l&&t instanceof TouchEvent}(t))for(var n=0;n<t.changedTouches.length;n++){var r=t.changedTouches[n];z(r.button)&&(r.button=t.touches.length?1:0),z(r.buttons)&&(r.buttons=t.touches.length?1:0),z(r.isPrimary)&&(r.isPrimary=1===t.touches.length&&"touchstart"===t.type),z(r.width)&&(r.width=r.radiusX||1),z(r.height)&&(r.height=r.radiusY||1),z(r.tiltX)&&(r.tiltX=0),z(r.tiltY)&&(r.tiltY=0),z(r.pointerType)&&(r.pointerType="touch"),z(r.pointerId)&&(r.pointerId=r.identifier||0),z(r.pressure)&&(r.pressure=r.force||.5),z(r.twist)&&(r.twist=0),z(r.tangentialPressure)&&(r.tangentialPressure=0),r.isNormalized=!0,r.type=t.type,e.push(r)}else if(function(t){return!self.MouseEvent||t instanceof MouseEvent&&(!xl||!(t instanceof self.PointerEvent))}(t)){var i=t;z(i.isPrimary)&&(i.isPrimary=!0),z(i.width)&&(i.width=1),z(i.height)&&(i.height=1),z(i.tiltX)&&(i.tiltX=0),z(i.tiltY)&&(i.tiltY=0),z(i.pointerType)&&(i.pointerType="mouse"),z(i.pointerId)&&(i.pointerId=1),z(i.pressure)&&(i.pressure=.5),z(i.twist)&&(i.twist=0),z(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,e.push(i)}else e.push(t);return e}var Sl,Ol=function(){function t(){var t=this;this.autoPreventDefault=!0,this.rootPointerEvent=new Vs(null),this.rootWheelEvent=new Us(null),this.onPointerMove=function(e){var n,r;if(!_l||"touch"!==e.pointerType){var i=Pl(e);try{for(var o=b(i),a=o.next();!a.done;a=o.next()){var s=a.value,u=t.bootstrapEvent(t.rootPointerEvent,s);t.eventService.mapEvent(u)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}t.setCursor(t.eventService.cursor)}}}var e;return e=t,t.prototype.apply=function(t){var n=this;this.eventService.setPickHandler((function(t){return v(n,void 0,void 0,(function(){return m(this,(function(e){switch(e.label){case 0:return[4,this.renderingService.hooks.pick.promise({position:t,picked:null})];case 1:return[2,e.sent().picked]}}))}))})),t.hooks.pointerWheel.tap(e.tag,(function(t){var e=n.normalizeWheelEvent(t);n.eventService.mapEvent(e)})),t.hooks.pointerDown.tap(e.tag,(function(t){var e,r;if(!_l||"touch"!==t.pointerType){var i=Pl(t);if(n.autoPreventDefault&&i[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();try{for(var o=b(i),a=o.next();!a.done;a=o.next()){var s=a.value,u=n.bootstrapEvent(n.rootPointerEvent,s);n.eventService.mapEvent(u)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}n.setCursor(n.eventService.cursor)}})),t.hooks.pointerUp.tap(e.tag,(function(t){var e,r;if(!_l||"touch"!==t.pointerType){var i=n.contextService.getDomElement(),o=i&&t.target&&t.target!==i&&i.contains&&!i.contains(t.target)?"outside":"",a=Pl(t);try{for(var s=b(a),u=s.next();!u.done;u=s.next()){var c=u.value,l=n.bootstrapEvent(n.rootPointerEvent,c);l.type+=o,n.eventService.mapEvent(l)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}n.setCursor(n.eventService.cursor)}})),t.hooks.pointerMove.tap(e.tag,this.onPointerMove),t.hooks.pointerOver.tap(e.tag,this.onPointerMove),t.hooks.pointerOut.tap(e.tag,this.onPointerMove)},t.prototype.bootstrapEvent=function(t,e){t._originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var n=this.eventService.client2Viewport(new io(e.clientX,e.clientY)),r=n.x,i=n.y;t.viewport.x=r,t.viewport.y=i;var o=this.eventService.viewport2Canvas(t.viewport),a=o.x,s=o.y;return t.canvas.x=a,t.canvas.y=s,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=Al[t.type]||t.type),t},t.prototype.normalizeWheelEvent=function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.eventService.client2Viewport(new io(t.clientX,t.clientY)),r=n.x,i=n.y;e.viewport.x=r,e.viewport.y=i;var o=this.eventService.viewport2Canvas(e.viewport),a=o.x,s=o.y;return e.canvas.x=a,e.canvas.y=s,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e},t.prototype.transferMouseData=function(t,e){t.isTrusted=e.isTrusted,t.timeStamp=performance.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null},t.prototype.setCursor=function(t){this.contextService.applyCursorStyle(t||this.canvasConfig.cursor||"default")},t.tag="EventPlugin",y([Object(c.inject)(vo),g("design:type",Object)],t.prototype,"canvasConfig",void 0),y([Object(c.inject)(ru),g("design:type",Object)],t.prototype,"contextService",void 0),y([Object(c.inject)(su),g("design:type",su)],t.prototype,"renderingService",void 0),y([Object(c.inject)(uu),g("design:type",uu)],t.prototype,"eventService",void 0),t=e=y([Object(c.singleton)({contrib:au})],t)}(),Nl=Object(c.Module)((function(t,e){e.container.isBound(su)?(e.container.remove(au),e.container.remove(su),e.container.remove(wl)):(c.Contribution.register(t,au,{cache:!1}),c.Contribution.register(t,Tl,{cache:!1})),t(su),t(uu),t(Ol),t(Ml),t(bl),t(El),t(wl)}));!function(t){t.READY="ready",t.BEFORE_RENDER="beforerender",t.AFTER_RENDER="afterrender",t.BEFORE_DESTROY="beforedestroy",t.AFTER_DESTROY="afterdestroy",t.RESIZE="resize"}(Sl||(Sl={}));var Cl=function(t){function e(e){var n,r,i,o=t.call(this)||this;o.container=ol.createChild(),o.Element=Bs,o.document=new Fs,o.document.defaultView=o,o.customElements=new tu,n=e.container,r=o,i="string"==typeof n?n:n.id||cl++,ul[i]&&ul[i].destroy(),ul[i]=r;var a=p(p({},e),{cursor:"default"});return o.initRenderingContext(a),o.initDefaultCamera(a.width,a.height),o.initRenderer(a.renderer),o}return f(e,t),e.prototype.initRenderingContext=function(t){var e=this;this.container.register({token:vo,useValue:t}),this.container.register({token:iu,useValue:{root:this.document.documentElement,removedRenderBoundsList:[],renderReasons:new Set,force:!1,dirty:!1}}),this.document.documentElement.addEventListener(Ki.CHILD_INSERTED,(function(t){e.mountChildren(t.detail.child)})),this.document.documentElement.addEventListener(Ki.CHILD_REMOVED,(function(t){e.unmountChildren(t.detail.child)}))},e.prototype.initDefaultCamera=function(t,e){var n=(new ml).setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0).setOrthographic(t/-2,t/2,e/-2,e/2,.1,1e3),r=this.container.get(iu);n.on(yl.Updated,(function(){r.renderReasons.add(nu.CameraChanged)})),this.container.register({token:dl,useValue:n})},e.prototype.getConfig=function(){return this.container.get(vo)},e.prototype.getContainer=function(){return this.container},e.prototype.getRoot=function(){return this.document.documentElement},e.prototype.getCamera=function(){return this.container.get(dl)},e.prototype.getContextService=function(){return this.container.get(ru)},e.prototype.getEventService=function(){return this.container.get(uu)},e.prototype.getRenderingService=function(){return this.container.get(su)},e.prototype.getRenderingContext=function(){return this.container.get(iu)},e.prototype.getComputedStyle=function(t){return t.parsedStyle},e.prototype.destroy=function(t){void 0===t&&(t=!0),this.emit(Sl.BEFORE_DESTROY,(function(){})),this.frameId&&na(this.frameId);var e=this.getRoot();this.unmountChildren(e),t&&this.document.destroy(),this.getContextService().destroy(),this.getRenderingService().destroy(),this.emit(Sl.AFTER_DESTROY,{})},e.prototype.changeSize=function(t,e){this.resize(t,e)},e.prototype.resize=function(t,e){var n=this.container.get(vo);n.width=t,n.height=e,this.getContextService().resize(t,e);var r=this.container.get(dl);r.getProjectionMode()===fl.ORTHOGRAPHIC?r.setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0).setOrthographic(t/-2,t/2,e/-2,e/2,r.getNear(),r.getFar()):r.setAspect(t/e),this.emit(Sl.RESIZE,{width:t,height:e})},e.prototype.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},e.prototype.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},e.prototype.removeChild=function(t,e){return void 0===e&&(e=!0),this.document.documentElement.removeChild(t,e)},e.prototype.removeChildren=function(t){void 0===t&&(t=!0),this.document.documentElement.removeChildren(t)},e.prototype.render=function(){(this.emit(Sl.BEFORE_RENDER,{}),this.container.isBound(su))&&this.container.get(su).render();this.emit(Sl.AFTER_RENDER,{})},e.prototype.run=function(){var t=this,e=function(){t.render(),t.frameId=requestAnimationFrame(e)};e()},e.prototype.initRenderer=function(t){var e=this;if(!t)throw new Error("Renderer is required.");this.loadCommonContainerModule(),this.loadRendererContainerModule(t);var n=this.container.get(ru),r=this.container.get(su);n.init(),r.init().then((function(){e.emit(Sl.READY,{})})),t.getConfig().enableAutoRendering&&this.run(),this.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),this.mountChildren(this.getRoot())},e.prototype.loadCommonContainerModule=function(){this.container.load(Nl,!0)},e.prototype.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach((function(t){t.init(e.container)}))},e.prototype.setRenderer=function(t){var e=this,n=this.getConfig();if(n.renderer!==t){var r=n.renderer;n.renderer=t,this.destroy(!1),null==r||r.getPlugins().reverse().forEach((function(t){t.destroy(e.container)})),this.initRenderer(t)}},e.prototype.unmountChildren=function(t){var e=[];t.forEach((function(t){t.isConnected&&e.push(t)})),e.reverse().forEach((function(t){t.emit(Ki.UNMOUNTED,{}),t.ownerDocument=null,t.isConnected=!1}))},e.prototype.mountChildren=function(t){var e=this;t.forEach((function(t){t.isConnected||(t.ownerDocument=e.document,t.isConnected=!0,t.emit(Ki.MOUNTED,{}))}))},e.prototype.client2Viewport=function(t){return this.getEventService().client2Viewport(t)},e.prototype.viewport2Client=function(t){return this.getEventService().viewport2Client(t)},e.prototype.viewport2Canvas=function(t){return this.getEventService().viewport2Canvas(t)},e.prototype.canvas2Viewport=function(t){return this.getEventService().canvas2Viewport(t)},e.prototype.getPointByClient=function(t,e){return this.client2Viewport({x:t,y:e})},e.prototype.getClientByPoint=function(t,e){return this.viewport2Client({x:t,y:e})},e}(qo);ol.load(al)}])}));
|