archgine 1.0.80 → 2.0.2
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/lib/animations/animation-action.d.ts +1 -0
- package/lib/animations/animation-action.d.ts.map +1 -0
- package/lib/animations/animation-clip.d.ts +1 -0
- package/lib/animations/animation-clip.d.ts.map +1 -0
- package/lib/animations/animation-mixer.d.ts +3 -1
- package/lib/animations/animation-mixer.d.ts.map +1 -0
- package/lib/animations/animation-utils.d.ts +1 -0
- package/lib/animations/animation-utils.d.ts.map +1 -0
- package/lib/animations/keyframe-track.d.ts +1 -0
- package/lib/animations/keyframe-track.d.ts.map +1 -0
- package/lib/animations/property-binding.d.ts +1 -0
- package/lib/animations/property-binding.d.ts.map +1 -0
- package/lib/animations/property-mixer.d.ts +1 -0
- package/lib/animations/property-mixer.d.ts.map +1 -0
- package/lib/animations/tracks/boolean-keyframe-track.d.ts +1 -0
- package/lib/animations/tracks/boolean-keyframe-track.d.ts.map +1 -0
- package/lib/animations/tracks/color-keyframe-track.d.ts +1 -0
- package/lib/animations/tracks/color-keyframe-track.d.ts.map +1 -0
- package/lib/animations/tracks/number-keyframe-track.d.ts +1 -0
- package/lib/animations/tracks/number-keyframe-track.d.ts.map +1 -0
- package/lib/animations/tracks/string-keyframe-track.d.ts +1 -0
- package/lib/animations/tracks/string-keyframe-track.d.ts.map +1 -0
- package/lib/animations/tracks/vector1-keyframe-track.d.ts +1 -0
- package/lib/animations/tracks/vector1-keyframe-track.d.ts.map +1 -0
- package/lib/animations/tracks/vector2-keyframe-track.d.ts +1 -0
- package/lib/animations/tracks/vector2-keyframe-track.d.ts.map +1 -0
- package/lib/applications/app2-offscreen.d.ts +92 -0
- package/lib/applications/app2-offscreen.d.ts.map +1 -0
- package/lib/applications/app2.d.ts +111 -0
- package/lib/applications/app2.d.ts.map +1 -0
- package/lib/applications/app3-director.d.ts +18 -0
- package/lib/applications/app3-director.d.ts.map +1 -0
- package/lib/applications/app3-offscreen.d.ts +27 -0
- package/lib/applications/app3-offscreen.d.ts.map +1 -0
- package/lib/applications/app3.d.ts +59 -0
- package/lib/applications/app3.d.ts.map +1 -0
- package/lib/controls/drag-controller.d.ts +1 -0
- package/lib/controls/drag-controller.d.ts.map +1 -0
- package/lib/controls/el-proxy-hammer.d.ts +32 -0
- package/lib/controls/el-proxy-hammer.d.ts.map +1 -0
- package/lib/controls/el-proxy.d.ts +54 -0
- package/lib/controls/el-proxy.d.ts.map +1 -0
- package/lib/controls/handler.d.ts +63 -0
- package/lib/controls/handler.d.ts.map +1 -0
- package/lib/controls/orbit-controller.d.ts +2 -0
- package/lib/controls/orbit-controller.d.ts.map +1 -0
- package/lib/controls/orbit-controls.d.ts +3 -2
- package/lib/controls/orbit-controls.d.ts.map +1 -0
- package/lib/controls/orbit-controls2.d.ts +162 -0
- package/lib/controls/orbit-controls2.d.ts.map +1 -0
- package/lib/core/camera2.d.ts +3 -2
- package/lib/core/camera2.d.ts.map +1 -0
- package/lib/core/clock.d.ts +1 -0
- package/lib/core/clock.d.ts.map +1 -0
- package/lib/core/event-dispatcher.d.ts +1 -0
- package/lib/core/event-dispatcher.d.ts.map +1 -0
- package/lib/core/global.d.ts +92 -1
- package/lib/core/global.d.ts.map +1 -0
- package/lib/{objects → core}/group2.d.ts +2 -1
- package/lib/core/group2.d.ts.map +1 -0
- package/lib/core/lights3.d.ts +11 -0
- package/lib/core/lights3.d.ts.map +1 -0
- package/lib/core/monitor.d.ts +1 -0
- package/lib/core/monitor.d.ts.map +1 -0
- package/lib/core/object2.d.ts +6 -3
- package/lib/core/object2.d.ts.map +1 -0
- package/lib/core/queue.d.ts +1 -0
- package/lib/core/queue.d.ts.map +1 -0
- package/lib/core/ray-caster.d.ts +7 -1
- package/lib/core/ray-caster.d.ts.map +1 -0
- package/lib/core/texture.d.ts +20 -0
- package/lib/core/texture.d.ts.map +1 -0
- package/lib/core/tic.d.ts +3 -1
- package/lib/core/tic.d.ts.map +1 -0
- package/lib/core/transformable2.d.ts +27 -0
- package/lib/core/transformable2.d.ts.map +1 -0
- package/lib/core/{view.d.ts → view2.d.ts} +20 -12
- package/lib/core/view2.d.ts.map +1 -0
- package/lib/core/view3.d.ts +70 -0
- package/lib/core/view3.d.ts.map +1 -0
- package/lib/dummies/dummy2-point.d.ts +9 -0
- package/lib/dummies/dummy2-point.d.ts.map +1 -0
- package/lib/dummies/dummy2-rect.d.ts +9 -0
- package/lib/dummies/dummy2-rect.d.ts.map +1 -0
- package/lib/dummies/dummy2.d.ts +21 -0
- package/lib/dummies/dummy2.d.ts.map +1 -0
- package/lib/editor/editor.d.ts +67 -0
- package/lib/editor/editor.d.ts.map +1 -0
- package/lib/editor/interfaces.d.ts +61 -0
- package/lib/editor/interfaces.d.ts.map +1 -0
- package/lib/editor/tool-manager.d.ts +45 -0
- package/lib/editor/tool-manager.d.ts.map +1 -0
- package/lib/editor/tools/base-tool.d.ts +20 -0
- package/lib/editor/tools/base-tool.d.ts.map +1 -0
- package/lib/editor/tools/distribution-tool.d.ts +20 -0
- package/lib/editor/tools/distribution-tool.d.ts.map +1 -0
- package/lib/editor/tools/drag-tool.d.ts +27 -0
- package/lib/editor/tools/drag-tool.d.ts.map +1 -0
- package/lib/editor/tools/draw-point-tool.d.ts +10 -0
- package/lib/editor/tools/draw-point-tool.d.ts.map +1 -0
- package/lib/editor/tools/dummy-tool.d.ts +57 -0
- package/lib/editor/tools/dummy-tool.d.ts.map +1 -0
- package/lib/editor/tools/hover-tool.d.ts +20 -0
- package/lib/editor/tools/hover-tool.d.ts.map +1 -0
- package/lib/editor/tools/index.d.ts +3 -0
- package/lib/editor/tools/index.d.ts.map +1 -0
- package/lib/editor/tools/linker-tool.d.ts +19 -0
- package/lib/editor/tools/linker-tool.d.ts.map +1 -0
- package/lib/editor/tools/select-tool.d.ts +32 -0
- package/lib/editor/tools/select-tool.d.ts.map +1 -0
- package/lib/editor/tools/selector-rect-tool.d.ts +21 -0
- package/lib/editor/tools/selector-rect-tool.d.ts.map +1 -0
- package/lib/editor/tools/tips-tool.d.ts +13 -0
- package/lib/editor/tools/tips-tool.d.ts.map +1 -0
- package/lib/effects/clear-pass.d.ts +1 -0
- package/lib/effects/clear-pass.d.ts.map +1 -0
- package/lib/effects/debounce-pass.d.ts +2 -0
- package/lib/effects/debounce-pass.d.ts.map +1 -0
- package/lib/effects/debounce-pass2.d.ts +29 -0
- package/lib/effects/debounce-pass2.d.ts.map +1 -0
- package/lib/effects/debounce-pass3.d.ts +38 -0
- package/lib/effects/debounce-pass3.d.ts.map +1 -0
- package/lib/effects/dynamic-pass3.d.ts +11 -0
- package/lib/effects/dynamic-pass3.d.ts.map +1 -0
- package/lib/effects/effect-composer.d.ts +2 -1
- package/lib/effects/effect-composer.d.ts.map +1 -0
- package/lib/effects/effect-director.d.ts +7 -3
- package/lib/effects/effect-director.d.ts.map +1 -0
- package/lib/effects/final-pass.d.ts +3 -2
- package/lib/effects/final-pass.d.ts.map +1 -0
- package/lib/effects/final-pass3.d.ts +6 -0
- package/lib/effects/final-pass3.d.ts.map +1 -0
- package/lib/effects/output-pass.d.ts +1 -0
- package/lib/effects/output-pass.d.ts.map +1 -0
- package/lib/effects/paper-pass.d.ts +5 -0
- package/lib/effects/paper-pass.d.ts.map +1 -0
- package/lib/effects/pass.d.ts +1 -0
- package/lib/effects/pass.d.ts.map +1 -0
- package/lib/effects/render-cached-pass.d.ts +1 -0
- package/lib/effects/render-cached-pass.d.ts.map +1 -0
- package/lib/effects/render-pass.d.ts +1 -0
- package/lib/effects/render-pass.d.ts.map +1 -0
- package/lib/effects/save-pass.d.ts +1 -0
- package/lib/effects/save-pass.d.ts.map +1 -0
- package/lib/effects/shadow-pass3.d.ts +16 -0
- package/lib/effects/shadow-pass3.d.ts.map +1 -0
- package/lib/effects/texture-pass.d.ts +3 -2
- package/lib/effects/texture-pass.d.ts.map +1 -0
- package/lib/env/conf.zh.d.ts +1 -0
- package/lib/env/conf.zh.d.ts.map +1 -0
- package/lib/env/constants.d.ts +1 -0
- package/lib/env/constants.d.ts.map +1 -0
- package/lib/env/default-config.d.ts +99 -0
- package/lib/env/default-config.d.ts.map +1 -0
- package/lib/env/enums.d.ts +3 -0
- package/lib/env/enums.d.ts.map +1 -0
- package/lib/env/index.d.ts +1 -0
- package/lib/env/index.d.ts.map +1 -0
- package/lib/environment.worker.js +1 -0
- package/lib/environment.worker.js.map +1 -0
- package/lib/extras/adapter2.d.ts +44 -0
- package/lib/extras/adapter2.d.ts.map +1 -0
- package/lib/extras/adapter3.d.ts +28 -0
- package/lib/extras/adapter3.d.ts.map +1 -0
- package/lib/extras/drag.d.ts +1 -0
- package/lib/extras/drag.d.ts.map +1 -0
- package/lib/extras/dummy-point.d.ts +2 -1
- package/lib/extras/dummy-point.d.ts.map +1 -0
- package/lib/extras/dummy-rect.d.ts +2 -1
- package/lib/extras/dummy-rect.d.ts.map +1 -0
- package/lib/extras/dynamic-draw-rect.d.ts +2 -1
- package/lib/extras/dynamic-draw-rect.d.ts.map +1 -0
- package/lib/extras/interfaces.d.ts +3 -2
- package/lib/extras/interfaces.d.ts.map +1 -0
- package/lib/extras/label.d.ts +2 -1
- package/lib/extras/label.d.ts.map +1 -0
- package/lib/extras/svg-app.d.ts +52 -6
- package/lib/extras/svg-app.d.ts.map +1 -0
- package/lib/extras/svg-chef.d.ts +3 -4
- package/lib/extras/svg-chef.d.ts.map +1 -0
- package/lib/extras/svg-dummies.d.ts +1 -0
- package/lib/extras/svg-dummies.d.ts.map +1 -0
- package/lib/extras/svg-multi-selector.d.ts +2 -1
- package/lib/extras/svg-multi-selector.d.ts.map +1 -0
- package/lib/extras/svg-painter.d.ts +1 -0
- package/lib/extras/svg-painter.d.ts.map +1 -0
- package/lib/extras/svg-view.d.ts +6 -5
- package/lib/extras/svg-view.d.ts.map +1 -0
- package/lib/extras/tooltip.d.ts +1 -0
- package/lib/extras/tooltip.d.ts.map +1 -0
- package/lib/helpers/axes-helper3.d.ts +20 -0
- package/lib/helpers/axes-helper3.d.ts.map +1 -0
- package/lib/helpers/cache.d.ts +1 -0
- package/lib/helpers/cache.d.ts.map +1 -0
- package/lib/helpers/canvas-helper.d.ts +7 -14
- package/lib/helpers/canvas-helper.d.ts.map +1 -0
- package/lib/helpers/geo-helper.d.ts +15 -11
- package/lib/helpers/geo-helper.d.ts.map +1 -0
- package/lib/helpers/geo3-helper.d.ts +5 -0
- package/lib/helpers/geo3-helper.d.ts.map +1 -0
- package/lib/helpers/loading-manager.d.ts +1 -0
- package/lib/helpers/loading-manager.d.ts.map +1 -0
- package/lib/helpers/mtl-helper.d.ts +11 -0
- package/lib/helpers/mtl-helper.d.ts.map +1 -0
- package/lib/helpers/obj3-helper.d.ts +4 -0
- package/lib/helpers/obj3-helper.d.ts.map +1 -0
- package/lib/helpers/sax-helper.d.ts +1 -0
- package/lib/helpers/sax-helper.d.ts.map +1 -0
- package/lib/helpers/shape2-helper.d.ts +27 -0
- package/lib/helpers/shape2-helper.d.ts.map +1 -0
- package/lib/helpers/shape3-helper.d.ts +11 -0
- package/lib/helpers/shape3-helper.d.ts.map +1 -0
- package/lib/helpers/sprite-helper.d.ts +10 -0
- package/lib/helpers/sprite-helper.d.ts.map +1 -0
- package/lib/helpers/svg-helper.d.ts +69 -51
- package/lib/helpers/svg-helper.d.ts.map +1 -0
- package/lib/helpers/texture-helper.d.ts +26 -27
- package/lib/helpers/texture-helper.d.ts.map +1 -0
- package/lib/helpers/texture3-helper.d.ts +15 -0
- package/lib/helpers/texture3-helper.d.ts.map +1 -0
- package/lib/index.d.ts +14 -7
- package/lib/index.d.ts.map +1 -0
- package/lib/index.mjs +8 -3
- package/lib/index.mjs.map +1 -0
- package/lib/index.umd.js +1 -1
- package/lib/index.umd.js.map +1 -0
- package/lib/interfaces.d.ts +385 -129
- package/lib/interfaces.d.ts.map +1 -0
- package/lib/loaders/file-loader.d.ts +1 -0
- package/lib/loaders/file-loader.d.ts.map +1 -0
- package/lib/loaders/image-loader.d.ts +1 -0
- package/lib/loaders/image-loader.d.ts.map +1 -0
- package/lib/loaders/loader.d.ts +1 -0
- package/lib/loaders/loader.d.ts.map +1 -0
- package/lib/loaders/svg-loader.d.ts +1 -0
- package/lib/loaders/svg-loader.d.ts.map +1 -0
- package/lib/loaders/svg-loader3.d.ts +15 -0
- package/lib/loaders/svg-loader3.d.ts.map +1 -0
- package/lib/main.d.ts +1 -0
- package/lib/main.d.ts.map +1 -0
- package/lib/math/box2.d.ts +13 -13
- package/lib/math/box2.d.ts.map +1 -0
- package/lib/math/box3.d.ts +13 -0
- package/lib/math/box3.d.ts.map +1 -0
- package/lib/math/color.d.ts +4 -2
- package/lib/math/color.d.ts.map +1 -0
- package/lib/math/cubic-interpolant.d.ts +1 -0
- package/lib/math/cubic-interpolant.d.ts.map +1 -0
- package/lib/math/curve.d.ts +16 -0
- package/lib/math/curve.d.ts.map +1 -0
- package/lib/math/discrete-interpolant.d.ts +1 -0
- package/lib/math/discrete-interpolant.d.ts.map +1 -0
- package/lib/math/improved-noise.d.ts +1 -0
- package/lib/math/improved-noise.d.ts.map +1 -0
- package/lib/math/interpolant.d.ts +1 -0
- package/lib/math/interpolant.d.ts.map +1 -0
- package/lib/math/linear-interpolant.d.ts +1 -0
- package/lib/math/linear-interpolant.d.ts.map +1 -0
- package/lib/math/matrix3.d.ts +12 -2
- package/lib/math/matrix3.d.ts.map +1 -0
- package/lib/math/matrix4.d.ts +8 -0
- package/lib/math/matrix4.d.ts.map +1 -0
- package/lib/math/utils.d.ts +1 -0
- package/lib/math/utils.d.ts.map +1 -0
- package/lib/math/vector2.d.ts +11 -2
- package/lib/math/vector2.d.ts.map +1 -0
- package/lib/math/vector3.d.ts +10 -5
- package/lib/math/vector3.d.ts.map +1 -0
- package/lib/math/vector4.d.ts +1 -0
- package/lib/math/vector4.d.ts.map +1 -0
- package/lib/renderer2.worker.js +16 -0
- package/lib/renderer2.worker.js.map +1 -0
- package/lib/renderer3.worker.js +22 -0
- package/lib/renderer3.worker.js.map +1 -0
- package/lib/renderers/binding-states.d.ts +8 -10
- package/lib/renderers/binding-states.d.ts.map +1 -0
- package/lib/renderers/buffer-renderer.d.ts +18 -20
- package/lib/renderers/buffer-renderer.d.ts.map +1 -0
- package/lib/renderers/cvs-renderer.d.ts +34 -16
- package/lib/renderers/cvs-renderer.d.ts.map +1 -0
- package/lib/renderers/render-lists.d.ts +3 -2
- package/lib/renderers/render-lists.d.ts.map +1 -0
- package/lib/renderers/render-states.d.ts +1 -0
- package/lib/renderers/render-states.d.ts.map +1 -0
- package/lib/renderers/render-target.d.ts +1 -0
- package/lib/renderers/render-target.d.ts.map +1 -0
- package/lib/{renders → renderers}/svg-renderer.d.ts +1 -0
- package/lib/renderers/svg-renderer.d.ts.map +1 -0
- package/lib/renderers/web-g-l-renderer3.d.ts +1 -0
- package/lib/renderers/web-g-l-renderer3.d.ts.map +1 -0
- package/lib/routes.d.ts +1 -0
- package/lib/routes.d.ts.map +1 -0
- package/lib/scenes/animate-scene2.d.ts +27 -0
- package/lib/scenes/animate-scene2.d.ts.map +1 -0
- package/lib/scenes/animate-scene3.d.ts +15 -0
- package/lib/scenes/animate-scene3.d.ts.map +1 -0
- package/lib/scenes/drawing-scene2.d.ts +43 -0
- package/lib/scenes/drawing-scene2.d.ts.map +1 -0
- package/lib/scenes/drawing-scene3.d.ts +20 -0
- package/lib/scenes/drawing-scene3.d.ts.map +1 -0
- package/lib/scenes/dynamic-scene.d.ts +1 -0
- package/lib/scenes/dynamic-scene.d.ts.map +1 -0
- package/lib/scenes/empty-scene2.d.ts +27 -0
- package/lib/scenes/empty-scene2.d.ts.map +1 -0
- package/lib/scenes/empty-scene3.d.ts +16 -0
- package/lib/scenes/empty-scene3.d.ts.map +1 -0
- package/lib/scenes/{loading-scene.d.ts → loading-scene2.d.ts} +9 -8
- package/lib/scenes/loading-scene2.d.ts.map +1 -0
- package/lib/scenes/loading-scene3.d.ts +17 -0
- package/lib/scenes/loading-scene3.d.ts.map +1 -0
- package/lib/scenes/scene.d.ts +4 -2
- package/lib/scenes/scene.d.ts.map +1 -0
- package/lib/scenes/shadow-scene3.d.ts +15 -0
- package/lib/scenes/shadow-scene3.d.ts.map +1 -0
- package/lib/scenes/static-scene.d.ts +1 -0
- package/lib/scenes/static-scene.d.ts.map +1 -0
- package/lib/scenes/svg-empty-scene.d.ts +1 -0
- package/lib/scenes/svg-empty-scene.d.ts.map +1 -0
- package/lib/scenes/svg-loading-scene.d.ts +1 -0
- package/lib/scenes/svg-loading-scene.d.ts.map +1 -0
- package/lib/scenes/svg-scene.d.ts +2 -1
- package/lib/scenes/svg-scene.d.ts.map +1 -0
- package/lib/shaders/final.shader.d.ts +13 -0
- package/lib/shaders/final.shader.d.ts.map +1 -0
- package/lib/shaders/loading-circles.shader.d.ts +14 -0
- package/lib/shaders/loading-circles.shader.d.ts.map +1 -0
- package/lib/shaders/projection.shader.d.ts +33 -0
- package/lib/shaders/projection.shader.d.ts.map +1 -0
- package/lib/shaders/shadow.shader.d.ts +16 -0
- package/lib/shaders/shadow.shader.d.ts.map +1 -0
- package/lib/shaders/smoke.shader.d.ts +12 -0
- package/lib/shaders/smoke.shader.d.ts.map +1 -0
- package/lib/shaders/textures-box.shader.d.ts +12 -0
- package/lib/shaders/textures-box.shader.d.ts.map +1 -0
- package/lib/shapes/arrow.d.ts +6 -4
- package/lib/shapes/arrow.d.ts.map +1 -0
- package/lib/shapes/axes.d.ts +14 -16
- package/lib/shapes/axes.d.ts.map +1 -0
- package/lib/shapes/circle.d.ts +5 -4
- package/lib/shapes/circle.d.ts.map +1 -0
- package/lib/shapes/geo/a-geo.d.ts +31 -0
- package/lib/shapes/geo/a-geo.d.ts.map +1 -0
- package/lib/shapes/geo/cmd.d.ts +11 -0
- package/lib/shapes/geo/cmd.d.ts.map +1 -0
- package/lib/shapes/geo/geo-circle.d.ts +14 -0
- package/lib/shapes/geo/geo-circle.d.ts.map +1 -0
- package/lib/shapes/geo/geo-line.d.ts +13 -0
- package/lib/shapes/geo/geo-line.d.ts.map +1 -0
- package/lib/shapes/geo/geo-polygon.d.ts +9 -0
- package/lib/shapes/geo/geo-polygon.d.ts.map +1 -0
- package/lib/shapes/geo/geo-polyline.d.ts +22 -0
- package/lib/shapes/geo/geo-polyline.d.ts.map +1 -0
- package/lib/shapes/geo/geo-rect.d.ts +14 -0
- package/lib/shapes/geo/geo-rect.d.ts.map +1 -0
- package/lib/shapes/geo/geo-shape.d.ts +22 -0
- package/lib/shapes/geo/geo-shape.d.ts.map +1 -0
- package/lib/{geometries → shapes/geo}/path-polyfill.d.ts +2 -1
- package/lib/shapes/geo/path-polyfill.d.ts.map +1 -0
- package/lib/shapes/geo/path-proxy.d.ts +74 -0
- package/lib/shapes/geo/path-proxy.d.ts.map +1 -0
- package/lib/shapes/line.d.ts +10 -0
- package/lib/shapes/line.d.ts.map +1 -0
- package/lib/{materials/text-material2.d.ts → shapes/mtl/mtl-text.d.ts} +8 -9
- package/lib/shapes/mtl/mtl-text.d.ts.map +1 -0
- package/lib/shapes/mtl/mtl.d.ts +30 -0
- package/lib/shapes/mtl/mtl.d.ts.map +1 -0
- package/lib/shapes/mtl/utils.d.ts +3 -0
- package/lib/shapes/mtl/utils.d.ts.map +1 -0
- package/lib/shapes/polygon.d.ts +2 -3
- package/lib/shapes/polygon.d.ts.map +1 -0
- package/lib/shapes/polyline.d.ts +9 -0
- package/lib/shapes/polyline.d.ts.map +1 -0
- package/lib/shapes/rect.d.ts +14 -0
- package/lib/shapes/rect.d.ts.map +1 -0
- package/lib/shapes/shape.d.ts +27 -0
- package/lib/shapes/shape.d.ts.map +1 -0
- package/lib/shapes/skinned-shape.d.ts +10 -0
- package/lib/shapes/skinned-shape.d.ts.map +1 -0
- package/lib/shapes/sprite.d.ts +9 -0
- package/lib/shapes/sprite.d.ts.map +1 -0
- package/lib/shapes/svg.d.ts +10 -0
- package/lib/shapes/svg.d.ts.map +1 -0
- package/lib/shapes/text.d.ts +10 -12
- package/lib/shapes/text.d.ts.map +1 -0
- package/lib/svg/editor/svg-editor.d.ts +60 -0
- package/lib/svg/editor/svg-editor.d.ts.map +1 -0
- package/lib/svg/editor/tools/svg-base-tool.d.ts +29 -0
- package/lib/svg/editor/tools/svg-base-tool.d.ts.map +1 -0
- package/lib/svg/editor/tools/svg-drag-tool.d.ts +26 -0
- package/lib/svg/editor/tools/svg-drag-tool.d.ts.map +1 -0
- package/lib/svg/editor/tools/svg-draw-base-tool.d.ts +59 -0
- package/lib/svg/editor/tools/svg-draw-base-tool.d.ts.map +1 -0
- package/lib/svg/editor/tools/svg-draw-point-tool.d.ts +16 -0
- package/lib/svg/editor/tools/svg-draw-point-tool.d.ts.map +1 -0
- package/lib/svg/editor/tools/svg-draw-polylgon-tool.d.ts +20 -0
- package/lib/svg/editor/tools/svg-draw-polylgon-tool.d.ts.map +1 -0
- package/lib/svg/editor/tools/svg-draw-polyline-tool.d.ts +29 -0
- package/lib/svg/editor/tools/svg-draw-polyline-tool.d.ts.map +1 -0
- package/lib/svg/editor/tools/svg-draw-text-tool.d.ts +21 -0
- package/lib/svg/editor/tools/svg-draw-text-tool.d.ts.map +1 -0
- package/lib/svg/editor/tools/svg-hover-tool.d.ts +17 -0
- package/lib/svg/editor/tools/svg-hover-tool.d.ts.map +1 -0
- package/lib/svg/utils.d.ts +10 -1
- package/lib/svg/utils.d.ts.map +1 -0
- package/lib/utils/coords.d.ts +4 -0
- package/lib/utils/coords.d.ts.map +1 -0
- package/lib/utils/dom-utils.d.ts +1 -0
- package/lib/utils/dom-utils.d.ts.map +1 -0
- package/lib/utils/md5.d.ts +1 -0
- package/lib/utils/md5.d.ts.map +1 -0
- package/lib/utils/request-anim-frame.d.ts +1 -0
- package/lib/utils/request-anim-frame.d.ts.map +1 -0
- package/lib/utils/svg.d.ts +5 -2
- package/lib/utils/svg.d.ts.map +1 -0
- package/lib/utils/three-utils.d.ts +4 -0
- package/lib/utils/three-utils.d.ts.map +1 -0
- package/lib/utils/utils.d.ts +1 -0
- package/lib/utils/utils.d.ts.map +1 -0
- package/lib/utils/uuid.d.ts +1 -0
- package/lib/utils/uuid.d.ts.map +1 -0
- package/lib/utils/validates.d.ts +1 -0
- package/lib/utils/validates.d.ts.map +1 -0
- package/lib/workers/environment.worker.d.ts +1 -0
- package/lib/workers/environment.worker.d.ts.map +1 -0
- package/lib/workers/renderer2.worker.d.ts +2 -0
- package/lib/workers/renderer2.worker.d.ts.map +1 -0
- package/lib/workers/renderer3.worker.d.ts +2 -0
- package/lib/workers/renderer3.worker.d.ts.map +1 -0
- package/package.json +4 -1
- package/lib/applications/app-cvs.d.ts +0 -61
- package/lib/applications/app-director.d.ts +0 -22
- package/lib/applications/app-offscreen.d.ts +0 -58
- package/lib/applications/application.d.ts +0 -71
- package/lib/controls/interactive-controls.d.ts +0 -12
- package/lib/core/ope-view.d.ts +0 -45
- package/lib/extras/adapter.d.ts +0 -46
- package/lib/extras/app.d.ts +0 -0
- package/lib/extras/chef.d.ts +0 -23
- package/lib/geometries/circle-geo2.d.ts +0 -15
- package/lib/geometries/circle-geometry2.d.ts +0 -22
- package/lib/geometries/geo2.d.ts +0 -33
- package/lib/geometries/geometry2.d.ts +0 -50
- package/lib/geometries/line-geometry2.d.ts +0 -29
- package/lib/geometries/path.d.ts +0 -40
- package/lib/geometries/polygon-geo2.d.ts +0 -5
- package/lib/geometries/polygon-geometry2.d.ts +0 -13
- package/lib/geometries/polyline-geo2.d.ts +0 -21
- package/lib/geometries/rect-geometry2.d.ts +0 -18
- package/lib/geometries/text-geometry2.d.ts +0 -13
- package/lib/helpers/axes-helper.d.ts +0 -18
- package/lib/helpers/axes-helper2.d.ts +0 -21
- package/lib/helpers/dummy-helper.d.ts +0 -4
- package/lib/helpers/dxf-helper.d.ts +0 -2
- package/lib/helpers/mat-helper.d.ts +0 -11
- package/lib/helpers/merge-helper.d.ts +0 -11
- package/lib/materials/line-material2.d.ts +0 -8
- package/lib/materials/mat2.d.ts +0 -35
- package/lib/materials/material2.d.ts +0 -38
- package/lib/materials/text-mat2.d.ts +0 -53
- package/lib/objects/mesh2.d.ts +0 -18
- package/lib/objects/node2.d.ts +0 -24
- package/lib/objects/shape.d.ts +0 -57
- package/lib/objects/shape2.d.ts +0 -32
- package/lib/renderer.worker.js +0 -11
- package/lib/renderers/renderer.d.ts +0 -26
- package/lib/renders/binding-states.d.ts +0 -35
- package/lib/renders/buffer-renderer.d.ts +0 -19
- package/lib/renders/render-lists.d.ts +0 -29
- package/lib/renders/render-states.d.ts +0 -18
- package/lib/renders/render-target.d.ts +0 -26
- package/lib/renders/renderer2.d.ts +0 -52
- package/lib/renders/t-svg-renderer.d.ts +0 -35
- package/lib/scenes/animate-scene.d.ts +0 -17
- package/lib/scenes/loading-text-scene.d.ts +0 -19
- package/lib/scenes/main-scene.d.ts +0 -34
- package/lib/shapes2/actor.d.ts +0 -24
- package/lib/shapes2/arrow.d.ts +0 -6
- package/lib/shapes2/axes.d.ts +0 -35
- package/lib/shapes2/circle.d.ts +0 -10
- package/lib/shapes2/dummy.d.ts +0 -19
- package/lib/shapes2/polygon.d.ts +0 -9
- package/lib/shapes2/svg.d.ts +0 -18
- package/lib/shapes2/text.d.ts +0 -21
- package/lib/svg/circle-element.d.ts +0 -9
- package/lib/svg/defs-element.d.ts +0 -6
- package/lib/svg/element.d.ts +0 -32
- package/lib/svg/elements.d.ts +0 -25
- package/lib/svg/g-element.d.ts +0 -6
- package/lib/svg/interfaces.d.ts +0 -46
- package/lib/svg/path-element.d.ts +0 -33
- package/lib/svg/property.d.ts +0 -25
- package/lib/svg/style-element.d.ts +0 -6
- package/lib/svg/svg-element.d.ts +0 -10
- package/lib/svg/symbol-element.d.ts +0 -6
- package/lib/svg/text-element.d.ts +0 -10
- package/lib/svg/unknown-element.d.ts +0 -6
- package/lib/svg/use-element.d.ts +0 -8
- package/lib/svg/view-element.d.ts +0 -6
- package/lib/textures/texture.d.ts +0 -45
- package/lib/workers/app-offscreen.worker.d.ts +0 -0
- package/lib/workers/renderer.worker.d.ts +0 -1
package/lib/renderer.worker.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
var t,e,r=Object.defineProperty,i=Object.defineProperties,n=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols,o=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,c=Reflect.get,l=(t,e,i)=>e in t?r(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,d=(t,e)=>{for(var r in e||(e={}))h.call(e,r)&&l(t,r,e[r]);if(a)for(var r of a(e))u.call(e,r)&&l(t,r,e[r]);return t},p=(t,e)=>i(t,n(e)),f=(t,e,r)=>l(t,"symbol"!=typeof e?e+"":e,r),m=(t,e,r)=>c(o(t),r,e),g=(t,e,r)=>new Promise(((i,n)=>{var s=t=>{try{o(r.next(t))}catch(t){n(t)}},a=t=>{try{o(r.throw(t))}catch(t){n(t)}},o=t=>t.done?i(t.value):Promise.resolve(t.value).then(s,a);o((r=r.apply(t,e)).next())})),y=(t={"renderer.worker.js"(t){var e,r=(t=>(t.INIT="init",t.LOAD="load",t.LOADED="loaded",t.GET_LAYERS="getLayers",t.GET_ASSET_IDS_BY_TYPE="getAssetIdsByType",t.SET_FILL_BY_IDS="setFillByIds",t.CLEAR_FILL="clearFill",t.SET_STROKE_BY_IDS="setStrokeByIds",t.CLEAR_STROKE="clearStroke",t.TERMINATE="terminate",t.CAMERA_SYNC="cameraSync",t.ASSET_TYPE_CHANGED="assetTypeChanged",t.SVG_LOADING_TYPE_CHANGED="svgLoadingTypeChanged",t.USED_CACHE_CHANGED="usedCacheChanged",t.DEBOUNCE_CACHE_CHANGED="debounceCacheChanged",t.WIREFRAME_CHANGED="wireframeChanged",t.BG_PASS_CHANGED="bgPass",t.SELECT_ENABLE_CHANGED="selectEnableChanged",t.MULTI_SELECT_ENABLE_CHANGED="multiSelectEnableChanged",t.MULTI_SELECT_BY_RANGE="multiSelectByRange",t.ZOOM_TO_SELECT_ENABLE_CHANGED="zoomToSelectEnableChanged",t.FONT_ZOOM_IN="fontZoomIn",t.FONT_ZOOM_OUT="fontZoomOut",t.STROKE_MORE="strokeMore",t.STROKE_LESS="strokeLess",t.CAMERA_CHANGED="cameraChanged",t.SCENES_CHANGED="scenesChanged",t.UPDATE_LAYERS_VISIBILITY="updateLayersVisibility",t.DYNAMIC_LOADED="dynamicLoaded",t.SYNC_TEXTURE_HELPER_CACHED="syncTextureHelperCached",t.INITIALIZATION_START="INITIALIZATION_START",t.INITIALIZATION_COMPLETE="INITIALIZATION_COMPLETE",t.SELECTED="selected",t.SELECT_BY_IDS="selectByIds",t.CLEAR_SELECTED="clearSelected",t.TARGET_BY_IDS="targetByIds",t.TAP="tap",t.SINGLE_TAP="singletap",t.DOUBLE_TAP="doubletap",t.PRESS="press",t.PAN="pan",t.PAN_START="panstart",t.PAN_MOVE="panmove",t.PAN_END="panend",t.ROTATE="rotate",t.ROTATE_START="rotatestart",t.ROTATE_MOVE="rotatemove",t.ROTATE_END="rotateend",t.PINCH="pinch",t.PINCH_START="pinchstart",t.PINCH_MOVE="pinchmove",t.PINCH_END="pinchend",t.PINCH_IN="pinchin",t.PINCH_OUT="pinchout",t.SWIPE="swipe",t))(r||{});function i(t,e){const r=t.x*Math.cos(e)-t.y*Math.sin(e),i=t.y*Math.cos(e)+t.x*Math.sin(e);t.x=r,t.y=i}function n(t,e){t.x*=e,t.y*=e}let s=class t{constructor(e){f(this,"commands"),this.commands=[],e&&e instanceof t?this.commands.push(...e.commands):e&&(this.commands=function(t){const e=[],r=String(t).trim();return"M"!==r[0]&&"m"!==r[0]||r.replace(h,((t,r,i)=>{const n=function(t){const e=t.match(u);return e?e.map(Number):[]}(i);let s=r.toLowerCase(),a=r;if("m"===s&&n.length>2&&(e.push([a,...n.splice(0,2)]),s="l",a="m"===a?"l":"L"),n.length<o[s])return"";for(e.push([a,...n.splice(0,o[s])]);n.length>=o[s]&&n.length&&o[s];)e.push([a,...n.splice(0,o[s])]);return""})),e}(e))}addPath(e){e&&e instanceof t&&this.commands.push(...e.commands)}moveTo(t,e){this.commands.push(["M",t,e])}lineTo(t,e){this.commands.push(["L",t,e])}arc(t,e,r,i,n,s){this.commands.push(["AC",t,e,r,i,n,!!s])}arcTo(t,e,r,i,n){this.commands.push(["AT",t,e,r,i,n])}ellipse(t,e,r,i,n,s,a,o){this.commands.push(["E",t,e,r,i,n,s,a,!!o])}closePath(){this.commands.push(["Z"])}bezierCurveTo(t,e,r,i,n,s){this.commands.push(["C",t,e,r,i,n,s])}quadraticCurveTo(t,e,r,i){this.commands.push(["Q",t,e,r,i])}rect(t,e,r,i){this.commands.push(["R",t,e,r,i])}roundRect(t,e,r,i,n){void 0===n?this.commands.push(["RR",t,e,r,i,0]):this.commands.push(["RR",t,e,r,i,n])}};function a(t,e){let r,s,a,o,h,u,c,l,d,p,f,m,g,y,v,x,_,b,w,E,T,S=0,A=0,N=null,C=null,M=null,O=null,I=null,R=null;t.beginPath();for(let k=0;k<e.length;++k){let P;switch(b=e[k][0],"S"!==b&&"s"!==b&&"C"!==b&&"c"!==b&&(N=null,C=null),"T"!==b&&"t"!==b&&"Q"!==b&&"q"!==b&&(M=null,O=null),b){case"m":case"M":P=e[k],"m"===b?(S+=P[1],A+=P[2]):(S=P[1],A=P[2]),"M"!==b&&I||(I={x:S,y:A}),t.moveTo(S,A);break;case"l":P=e[k],S+=P[1],A+=P[2],t.lineTo(S,A);break;case"L":P=e[k],S=P[1],A=P[2],t.lineTo(S,A);break;case"H":P=e[k],S=P[1],t.lineTo(S,A);break;case"h":P=e[k],S+=P[1],t.lineTo(S,A);break;case"V":P=e[k],A=P[1],t.lineTo(S,A);break;case"v":P=e[k],A+=P[1],t.lineTo(S,A);break;case"a":case"A":if(P=e[k],null===R)throw new Error("This should never happen");"a"===b?(S+=P[6],A+=P[7]):(S=P[6],A=P[7]),y=P[1],v=P[2],c=P[3]*Math.PI/180,a=!!P[4],o=!!P[5],h={x:S,y:A},u={x:(R.x-h.x)/2,y:(R.y-h.y)/2},i(u,-c),l=u.x*u.x/(y*y)+u.y*u.y/(v*v),l>1&&(l=Math.sqrt(l),y*=l,v*=l),w={x:y*u.y/v,y:-v*u.x/y},d=y*y*v*v,p=y*y*u.y*u.y+v*v*u.x*u.x,n(w,o!==a?Math.sqrt((d-p)/p)||0:-Math.sqrt((d-p)/p)||0),s=Math.atan2((u.y-w.y)/v,(u.x-w.x)/y),r=Math.atan2(-(u.y+w.y)/v,-(u.x+w.x)/y),i(w,c),D=w,L=(h.x+R.x)/2,B=(h.y+R.y)/2,D.x+=L,D.y+=B,t.save(),t.translate(w.x,w.y),t.rotate(c),t.scale(y,v),t.arc(0,0,1,s,r,!o),t.restore();break;case"C":P=e[k],N=P[3],C=P[4],S=P[5],A=P[6],t.bezierCurveTo(P[1],P[2],N,C,S,A);break;case"c":P=e[k],t.bezierCurveTo(P[1]+S,P[2]+A,P[3]+S,P[4]+A,P[5]+S,P[6]+A),N=P[3]+S,C=P[4]+A,S+=P[5],A+=P[6];break;case"S":P=e[k],null!==N&&null!==C||(N=S,C=A),t.bezierCurveTo(2*S-N,2*A-C,P[1],P[2],P[3],P[4]),N=P[1],C=P[2],S=P[3],A=P[4];break;case"s":P=e[k],null!==N&&null!==C||(N=S,C=A),t.bezierCurveTo(2*S-N,2*A-C,P[1]+S,P[2]+A,P[3]+S,P[4]+A),N=P[1]+S,C=P[2]+A,S+=P[3],A+=P[4];break;case"Q":P=e[k],M=P[1],O=P[2],S=P[3],A=P[4],t.quadraticCurveTo(M,O,S,A);break;case"q":P=e[k],M=P[1]+S,O=P[2]+A,S+=P[3],A+=P[4],t.quadraticCurveTo(M,O,S,A);break;case"T":P=e[k],null!==M&&null!==O||(M=S,O=A),M=2*S-M,O=2*A-O,S=P[1],A=P[2],t.quadraticCurveTo(M,O,S,A);break;case"t":P=e[k],null!==M&&null!==O||(M=S,O=A),M=2*S-M,O=2*A-O,S+=P[1],A+=P[2],t.quadraticCurveTo(M,O,S,A);break;case"z":case"Z":I&&(S=I.x,A=I.y),I=null,t.closePath();break;case"AC":P=e[k],S=P[1],A=P[2],g=P[3],s=P[4],r=P[5],E=P[6],t.arc(S,A,g,s,r,E);break;case"AT":P=e[k],f=P[1],m=P[2],S=P[3],A=P[4],g=P[5],t.arcTo(f,m,S,A,g);break;case"E":P=e[k],S=P[1],A=P[2],y=P[3],v=P[4],c=P[5],s=P[6],r=P[7],E=P[8],t.save(),t.translate(S,A),t.rotate(c),t.scale(y,v),t.arc(0,0,1,s,r,E),t.restore();break;case"R":P=e[k],S=P[1],A=P[2],x=P[3],_=P[4],I={x:S,y:A},t.rect(S,A,x,_);break;case"RR":P=e[k],S=P[1],A=P[2],x=P[3],_=P[4],T=P[5],I={x:S,y:A},t.roundRect(S,A,x,_,T)}R?(R.x=S,R.y=A):R={x:S,y:A}}var D,L,B}const o={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},h=/([astvzqmhlc])([^astvzqmhlc]*)/gi,u=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;var c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function l(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function y(t){if(t.__esModule)return t;var e=t.default;if("function"==typeof e){var r=function t(){return this instanceof t?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach((function(e){var i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,i.get?i:{enumerable:!0,get:function(){return t[e]}})})),r}var v={},x={};function _(t,e){return void 0===e&&(e=Object),e&&"function"==typeof e.freeze?e.freeze(t):t}var b=_({HTML:"text/html",isHTML:function(t){return t===b.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),w=_({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(t){return t===w.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});x.assign=function(t,e){if(null===t||"object"!=typeof t)throw new TypeError("target is not an object");for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},x.find=function(t,e,r){if(void 0===r&&(r=Array.prototype),t&&"function"==typeof r.find)return r.find.call(t,e);for(var i=0;i<t.length;i++)if(Object.prototype.hasOwnProperty.call(t,i)){var n=t[i];if(e.call(void 0,n,i,t))return n}},x.freeze=_,x.MIME_TYPE=b,x.NAMESPACE=w;var E=x,T=E.find,S=E.NAMESPACE;function A(t){return""!==t}function N(t,e){return t.hasOwnProperty(e)||(t[e]=!0),t}function C(t){if(!t)return[];var e=function(t){return t?t.split(/[\t\n\f\r ]+/).filter(A):[]}(t);return Object.keys(e.reduce(N,{}))}function M(t,e){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}function O(t,e){var r=t.prototype;if(!(r instanceof e)){let i=function(){};i.prototype=e.prototype,i=new i,M(r,i),t.prototype=r=i}r.constructor!=t&&(r.constructor=t)}var I={},R=I.ELEMENT_NODE=1,D=I.ATTRIBUTE_NODE=2,L=I.TEXT_NODE=3,B=I.CDATA_SECTION_NODE=4,k=I.ENTITY_REFERENCE_NODE=5,P=I.ENTITY_NODE=6,U=I.PROCESSING_INSTRUCTION_NODE=7,V=I.COMMENT_NODE=8,F=I.DOCUMENT_NODE=9,q=I.DOCUMENT_TYPE_NODE=10,H=I.DOCUMENT_FRAGMENT_NODE=11,z=I.NOTATION_NODE=12,j={},W={};j.INDEX_SIZE_ERR=(W[1]="Index size error",1),j.DOMSTRING_SIZE_ERR=(W[2]="DOMString size error",2);var Y=j.HIERARCHY_REQUEST_ERR=(W[3]="Hierarchy request error",3);j.WRONG_DOCUMENT_ERR=(W[4]="Wrong document",4),j.INVALID_CHARACTER_ERR=(W[5]="Invalid character",5),j.NO_DATA_ALLOWED_ERR=(W[6]="No data allowed",6),j.NO_MODIFICATION_ALLOWED_ERR=(W[7]="No modification allowed",7);var G=j.NOT_FOUND_ERR=(W[8]="Not found",8);j.NOT_SUPPORTED_ERR=(W[9]="Not supported",9);var X=j.INUSE_ATTRIBUTE_ERR=(W[10]="Attribute in use",10);function Q(t,e){if(e instanceof Error)var r=e;else r=this,Error.call(this,W[t]),this.message=W[t],Error.captureStackTrace&&Error.captureStackTrace(this,Q);return r.code=t,e&&(this.message=this.message+": "+e),r}function Z(){}function $(t,e){this._node=t,this._refresh=e,K(this)}function K(t){var e=t._node._inc||t._node.ownerDocument._inc;if(t._inc!==e){var r=t._refresh(t._node);if(Vt(t,"length",r.length),!t.$$length||r.length<t.$$length)for(var i=r.length;i in t;i++)Object.prototype.hasOwnProperty.call(t,i)&&delete t[i];M(r,t),t._inc=e}}function J(){}function tt(t,e){for(var r=t.length;r--;)if(t[r]===e)return r}function et(t,e,r,i){if(i?e[tt(e,i)]=r:e[e.length++]=r,t){r.ownerElement=t;var n=t.ownerDocument;n&&(i&&ht(n,t,i),function(t,e,r){t&&t._inc++;var i=r.namespaceURI;i===S.XMLNS&&(e._nsMap[r.prefix?r.localName:""]=r.value)}(n,t,r))}}function rt(t,e,r){var i=tt(e,r);if(!(i>=0))throw new Q(G,new Error(t.tagName+"@"+r));for(var n=e.length-1;i<n;)e[i]=e[++i];if(e.length=n,t){var s=t.ownerDocument;s&&(ht(s,t,r),r.ownerElement=null)}}function it(){}function nt(){}function st(t){return("<"==t?"<":">"==t&&">")||"&"==t&&"&"||'"'==t&&"""||"&#"+t.charCodeAt()+";"}function at(t,e){if(e(t))return!0;if(t=t.firstChild)do{if(at(t,e))return!0}while(t=t.nextSibling)}function ot(){this.ownerDocument=this}function ht(t,e,r,i){t&&t._inc++,r.namespaceURI===S.XMLNS&&delete e._nsMap[r.prefix?r.localName:""]}function ut(t,e,r){if(t&&t._inc){t._inc++;var i=e.childNodes;if(r)i[i.length++]=r;else{for(var n=e.firstChild,s=0;n;)i[s++]=n,n=n.nextSibling;i.length=s,delete i[i.length]}}}function ct(t,e){var r=e.previousSibling,i=e.nextSibling;return r?r.nextSibling=i:t.firstChild=i,i?i.previousSibling=r:t.lastChild=r,e.parentNode=null,e.previousSibling=null,e.nextSibling=null,ut(t.ownerDocument,t),e}function lt(t){return t&&t.nodeType===nt.DOCUMENT_TYPE_NODE}function dt(t){return t&&t.nodeType===nt.ELEMENT_NODE}function pt(t){return t&&t.nodeType===nt.TEXT_NODE}function ft(t,e){var r=t.childNodes||[];if(T(r,dt)||lt(e))return!1;var i=T(r,lt);return!(e&&i&&r.indexOf(i)>r.indexOf(e))}function mt(t,e){var r=t.childNodes||[];if(T(r,(function(t){return dt(t)&&t!==e})))return!1;var i=T(r,lt);return!(e&&i&&r.indexOf(i)>r.indexOf(e))}function gt(t,e,r){if(!function(t){return t&&(t.nodeType===nt.DOCUMENT_NODE||t.nodeType===nt.DOCUMENT_FRAGMENT_NODE||t.nodeType===nt.ELEMENT_NODE)}(t))throw new Q(Y,"Unexpected parent node type "+t.nodeType);if(r&&r.parentNode!==t)throw new Q(G,"child not in parent");if(!function(t){return t&&(dt(t)||pt(t)||lt(t)||t.nodeType===nt.DOCUMENT_FRAGMENT_NODE||t.nodeType===nt.COMMENT_NODE||t.nodeType===nt.PROCESSING_INSTRUCTION_NODE)}(e)||lt(e)&&t.nodeType!==nt.DOCUMENT_NODE)throw new Q(Y,"Unexpected node type "+e.nodeType+" for parent node type "+t.nodeType)}function yt(t,e,r){var i=t.childNodes||[],n=e.childNodes||[];if(e.nodeType===nt.DOCUMENT_FRAGMENT_NODE){var s=n.filter(dt);if(s.length>1||T(n,pt))throw new Q(Y,"More than one element or text in fragment");if(1===s.length&&!ft(t,r))throw new Q(Y,"Element in fragment can not be inserted before doctype")}if(dt(e)&&!ft(t,r))throw new Q(Y,"Only one element can be added and only after doctype");if(lt(e)){if(T(i,lt))throw new Q(Y,"Only one doctype is allowed");var a=T(i,dt);if(r&&i.indexOf(a)<i.indexOf(r))throw new Q(Y,"Doctype can only be inserted before an element");if(!r&&a)throw new Q(Y,"Doctype can not be appended since element is present")}}function vt(t,e,r){var i=t.childNodes||[],n=e.childNodes||[];if(e.nodeType===nt.DOCUMENT_FRAGMENT_NODE){var s=n.filter(dt);if(s.length>1||T(n,pt))throw new Q(Y,"More than one element or text in fragment");if(1===s.length&&!mt(t,r))throw new Q(Y,"Element in fragment can not be inserted before doctype")}if(dt(e)&&!mt(t,r))throw new Q(Y,"Only one element can be added and only after doctype");if(lt(e)){let t=function(t){return lt(t)&&t!==r};if(T(i,t))throw new Q(Y,"Only one doctype is allowed");var a=T(i,dt);if(r&&i.indexOf(a)<i.indexOf(r))throw new Q(Y,"Doctype can only be inserted before an element")}}function xt(t,e,r,i){gt(t,e,r),t.nodeType===nt.DOCUMENT_NODE&&(i||yt)(t,e,r);var n=e.parentNode;if(n&&n.removeChild(e),e.nodeType===H){var s=e.firstChild;if(null==s)return e;var a=e.lastChild}else s=a=e;var o=r?r.previousSibling:t.lastChild;s.previousSibling=o,a.nextSibling=r,o?o.nextSibling=s:t.firstChild=s,null==r?t.lastChild=a:r.previousSibling=a;do{s.parentNode=t}while(s!==a&&(s=s.nextSibling));return ut(t.ownerDocument||t,t),e.nodeType==H&&(e.firstChild=e.lastChild=null),e}function _t(){this._nsMap={}}function bt(){}function wt(){}function Et(){}function Tt(){}function St(){}function At(){}function Nt(){}function Ct(){}function Mt(){}function Ot(){}function It(){}function Rt(){}function Dt(t,e){var r=[],i=9==this.nodeType&&this.documentElement||this,n=i.prefix,s=i.namespaceURI;if(s&&null==n&&null==(n=i.lookupPrefix(s)))var a=[{namespace:s,prefix:null}];return kt(this,r,t,e,a),r.join("")}function Lt(t,e,r){var i=t.prefix||"",n=t.namespaceURI;if(!n)return!1;if("xml"===i&&n===S.XML||n===S.XMLNS)return!1;for(var s=r.length;s--;){var a=r[s];if(a.prefix===i)return a.namespace!==n}return!0}function Bt(t,e,r){t.push(" ",e,'="',r.replace(/[<>&"\t\n\r]/g,st),'"')}function kt(t,e,r,i,n){if(n||(n=[]),i){if(!(t=i(t)))return;if("string"==typeof t)return void e.push(t)}switch(t.nodeType){case R:var s=t.attributes,a=s.length,o=t.firstChild,h=t.tagName,u=h;if(!(r=S.isHTML(t.namespaceURI)||r)&&!t.prefix&&t.namespaceURI){for(var c,l=0;l<s.length;l++)if("xmlns"===s.item(l).name){c=s.item(l).value;break}if(!c)for(var d=n.length-1;d>=0;d--)if(""===(p=n[d]).prefix&&p.namespace===t.namespaceURI){c=p.namespace;break}if(c!==t.namespaceURI)for(d=n.length-1;d>=0;d--){var p;if((p=n[d]).namespace===t.namespaceURI){p.prefix&&(u=p.prefix+":"+h);break}}}e.push("<",u);for(var f=0;f<a;f++)"xmlns"==(m=s.item(f)).prefix?n.push({prefix:m.localName,namespace:m.value}):"xmlns"==m.nodeName&&n.push({prefix:"",namespace:m.value});for(f=0;f<a;f++){var m,g,y;Lt(m=s.item(f),0,n)&&(Bt(e,(g=m.prefix||"")?"xmlns:"+g:"xmlns",y=m.namespaceURI),n.push({prefix:g,namespace:y})),kt(m,e,r,i,n)}if(h===u&&Lt(t,0,n)&&(Bt(e,(g=t.prefix||"")?"xmlns:"+g:"xmlns",y=t.namespaceURI),n.push({prefix:g,namespace:y})),o||r&&!/^(?:meta|link|img|br|hr|input)$/i.test(h)){if(e.push(">"),r&&/^script$/i.test(h))for(;o;)o.data?e.push(o.data):kt(o,e,r,i,n.slice()),o=o.nextSibling;else for(;o;)kt(o,e,r,i,n.slice()),o=o.nextSibling;e.push("</",u,">")}else e.push("/>");return;case F:case H:for(o=t.firstChild;o;)kt(o,e,r,i,n.slice()),o=o.nextSibling;return;case D:return Bt(e,t.name,t.value);case L:return e.push(t.data.replace(/[<&>]/g,st));case B:return e.push("<![CDATA[",t.data,"]]>");case V:return e.push("\x3c!--",t.data,"--\x3e");case q:var v=t.publicId,x=t.systemId;if(e.push("<!DOCTYPE ",t.name),v)e.push(" PUBLIC ",v),x&&"."!=x&&e.push(" ",x),e.push(">");else if(x&&"."!=x)e.push(" SYSTEM ",x,">");else{var _=t.internalSubset;_&&e.push(" [",_,"]"),e.push(">")}return;case U:return e.push("<?",t.target," ",t.data,"?>");case k:return e.push("&",t.nodeName,";");default:e.push("??",t.nodeName)}}function Pt(t,e,r){var i;switch(e.nodeType){case R:(i=e.cloneNode(!1)).ownerDocument=t;case H:break;case D:r=!0}if(i||(i=e.cloneNode(!1)),i.ownerDocument=t,i.parentNode=null,r)for(var n=e.firstChild;n;)i.appendChild(Pt(t,n,r)),n=n.nextSibling;return i}function Ut(t,e,r){var i=new e.constructor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var s=e[n];"object"!=typeof s&&s!=i[n]&&(i[n]=s)}switch(e.childNodes&&(i.childNodes=new Z),i.ownerDocument=t,i.nodeType){case R:var a=e.attributes,o=i.attributes=new J,h=a.length;o._ownerElement=i;for(var u=0;u<h;u++)i.setAttributeNode(Ut(t,a.item(u),!0));break;case D:r=!0}if(r)for(var c=e.firstChild;c;)i.appendChild(Ut(t,c,r)),c=c.nextSibling;return i}function Vt(t,e,r){t[e]=r}j.INVALID_STATE_ERR=(W[11]="Invalid state",11),j.SYNTAX_ERR=(W[12]="Syntax error",12),j.INVALID_MODIFICATION_ERR=(W[13]="Invalid modification",13),j.NAMESPACE_ERR=(W[14]="Invalid namespace",14),j.INVALID_ACCESS_ERR=(W[15]="Invalid access",15),Q.prototype=Error.prototype,M(j,Q),Z.prototype={length:0,item:function(t){return t>=0&&t<this.length?this[t]:null},toString:function(t,e){for(var r=[],i=0;i<this.length;i++)kt(this[i],r,t,e);return r.join("")},filter:function(t){return Array.prototype.filter.call(this,t)},indexOf:function(t){return Array.prototype.indexOf.call(this,t)}},$.prototype.item=function(t){return K(this),this[t]||null},O($,Z),J.prototype={length:0,item:Z.prototype.item,getNamedItem:function(t){for(var e=this.length;e--;){var r=this[e];if(r.nodeName==t)return r}},setNamedItem:function(t){var e=t.ownerElement;if(e&&e!=this._ownerElement)throw new Q(X);var r=this.getNamedItem(t.nodeName);return et(this._ownerElement,this,t,r),r},setNamedItemNS:function(t){var e,r=t.ownerElement;if(r&&r!=this._ownerElement)throw new Q(X);return e=this.getNamedItemNS(t.namespaceURI,t.localName),et(this._ownerElement,this,t,e),e},removeNamedItem:function(t){var e=this.getNamedItem(t);return rt(this._ownerElement,this,e),e},removeNamedItemNS:function(t,e){var r=this.getNamedItemNS(t,e);return rt(this._ownerElement,this,r),r},getNamedItemNS:function(t,e){for(var r=this.length;r--;){var i=this[r];if(i.localName==e&&i.namespaceURI==t)return i}return null}},it.prototype={hasFeature:function(t,e){return!0},createDocument:function(t,e,r){var i=new ot;if(i.implementation=this,i.childNodes=new Z,i.doctype=r||null,r&&i.appendChild(r),e){var n=i.createElementNS(t,e);i.appendChild(n)}return i},createDocumentType:function(t,e,r){var i=new At;return i.name=t,i.nodeName=t,i.publicId=e||"",i.systemId=r||"",i}},nt.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(t,e){return xt(this,t,e)},replaceChild:function(t,e){xt(this,t,e,vt),e&&this.removeChild(e)},removeChild:function(t){return ct(this,t)},appendChild:function(t){return this.insertBefore(t,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(t){return Ut(this.ownerDocument||this,this,t)},normalize:function(){for(var t=this.firstChild;t;){var e=t.nextSibling;e&&e.nodeType==L&&t.nodeType==L?(this.removeChild(e),t.appendData(e.data)):(t.normalize(),t=e)}},isSupported:function(t,e){return this.ownerDocument.implementation.hasFeature(t,e)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(t){for(var e=this;e;){var r=e._nsMap;if(r)for(var i in r)if(Object.prototype.hasOwnProperty.call(r,i)&&r[i]===t)return i;e=e.nodeType==D?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(t){for(var e=this;e;){var r=e._nsMap;if(r&&Object.prototype.hasOwnProperty.call(r,t))return r[t];e=e.nodeType==D?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(t){return null==this.lookupPrefix(t)}},M(I,nt),M(I,nt.prototype),ot.prototype={nodeName:"#document",nodeType:F,doctype:null,documentElement:null,_inc:1,insertBefore:function(t,e){if(t.nodeType==H){for(var r=t.firstChild;r;){var i=r.nextSibling;this.insertBefore(r,e),r=i}return t}return xt(this,t,e),t.ownerDocument=this,null===this.documentElement&&t.nodeType===R&&(this.documentElement=t),t},removeChild:function(t){return this.documentElement==t&&(this.documentElement=null),ct(this,t)},replaceChild:function(t,e){xt(this,t,e,vt),t.ownerDocument=this,e&&this.removeChild(e),dt(t)&&(this.documentElement=t)},importNode:function(t,e){return Pt(this,t,e)},getElementById:function(t){var e=null;return at(this.documentElement,(function(r){if(r.nodeType==R&&r.getAttribute("id")==t)return e=r,!0})),e},getElementsByClassName:function(t){var e=C(t);return new $(this,(function(r){var i=[];return e.length>0&&at(r.documentElement,(function(n){if(n!==r&&n.nodeType===R){var s=n.getAttribute("class");if(s){var a=t===s;if(!a){var o=C(s);a=e.every((h=o,function(t){return h&&-1!==h.indexOf(t)}))}a&&i.push(n)}}var h})),i}))},createElement:function(t){var e=new _t;return e.ownerDocument=this,e.nodeName=t,e.tagName=t,e.localName=t,e.childNodes=new Z,(e.attributes=new J)._ownerElement=e,e},createDocumentFragment:function(){var t=new Ot;return t.ownerDocument=this,t.childNodes=new Z,t},createTextNode:function(t){var e=new Et;return e.ownerDocument=this,e.appendData(t),e},createComment:function(t){var e=new Tt;return e.ownerDocument=this,e.appendData(t),e},createCDATASection:function(t){var e=new St;return e.ownerDocument=this,e.appendData(t),e},createProcessingInstruction:function(t,e){var r=new It;return r.ownerDocument=this,r.tagName=r.nodeName=r.target=t,r.nodeValue=r.data=e,r},createAttribute:function(t){var e=new bt;return e.ownerDocument=this,e.name=t,e.nodeName=t,e.localName=t,e.specified=!0,e},createEntityReference:function(t){var e=new Mt;return e.ownerDocument=this,e.nodeName=t,e},createElementNS:function(t,e){var r=new _t,i=e.split(":"),n=r.attributes=new J;return r.childNodes=new Z,r.ownerDocument=this,r.nodeName=e,r.tagName=e,r.namespaceURI=t,2==i.length?(r.prefix=i[0],r.localName=i[1]):r.localName=e,n._ownerElement=r,r},createAttributeNS:function(t,e){var r=new bt,i=e.split(":");return r.ownerDocument=this,r.nodeName=e,r.name=e,r.namespaceURI=t,r.specified=!0,2==i.length?(r.prefix=i[0],r.localName=i[1]):r.localName=e,r}},O(ot,nt),_t.prototype={nodeType:R,hasAttribute:function(t){return null!=this.getAttributeNode(t)},getAttribute:function(t){var e=this.getAttributeNode(t);return e&&e.value||""},getAttributeNode:function(t){return this.attributes.getNamedItem(t)},setAttribute:function(t,e){var r=this.ownerDocument.createAttribute(t);r.value=r.nodeValue=""+e,this.setAttributeNode(r)},removeAttribute:function(t){var e=this.getAttributeNode(t);e&&this.removeAttributeNode(e)},appendChild:function(t){return t.nodeType===H?this.insertBefore(t,null):function(t,e){return e.parentNode&&e.parentNode.removeChild(e),e.parentNode=t,e.previousSibling=t.lastChild,e.nextSibling=null,e.previousSibling?e.previousSibling.nextSibling=e:t.firstChild=e,t.lastChild=e,ut(t.ownerDocument,t,e),e}(this,t)},setAttributeNode:function(t){return this.attributes.setNamedItem(t)},setAttributeNodeNS:function(t){return this.attributes.setNamedItemNS(t)},removeAttributeNode:function(t){return this.attributes.removeNamedItem(t.nodeName)},removeAttributeNS:function(t,e){var r=this.getAttributeNodeNS(t,e);r&&this.removeAttributeNode(r)},hasAttributeNS:function(t,e){return null!=this.getAttributeNodeNS(t,e)},getAttributeNS:function(t,e){var r=this.getAttributeNodeNS(t,e);return r&&r.value||""},setAttributeNS:function(t,e,r){var i=this.ownerDocument.createAttributeNS(t,e);i.value=i.nodeValue=""+r,this.setAttributeNode(i)},getAttributeNodeNS:function(t,e){return this.attributes.getNamedItemNS(t,e)},getElementsByTagName:function(t){return new $(this,(function(e){var r=[];return at(e,(function(i){i===e||i.nodeType!=R||"*"!==t&&i.tagName!=t||r.push(i)})),r}))},getElementsByTagNameNS:function(t,e){return new $(this,(function(r){var i=[];return at(r,(function(n){n===r||n.nodeType!==R||"*"!==t&&n.namespaceURI!==t||"*"!==e&&n.localName!=e||i.push(n)})),i}))}},ot.prototype.getElementsByTagName=_t.prototype.getElementsByTagName,ot.prototype.getElementsByTagNameNS=_t.prototype.getElementsByTagNameNS,O(_t,nt),bt.prototype.nodeType=D,O(bt,nt),wt.prototype={data:"",substringData:function(t,e){return this.data.substring(t,t+e)},appendData:function(t){t=this.data+t,this.nodeValue=this.data=t,this.length=t.length},insertData:function(t,e){this.replaceData(t,0,e)},appendChild:function(t){throw new Error(W[Y])},deleteData:function(t,e){this.replaceData(t,e,"")},replaceData:function(t,e,r){r=this.data.substring(0,t)+r+this.data.substring(t+e),this.nodeValue=this.data=r,this.length=r.length}},O(wt,nt),Et.prototype={nodeName:"#text",nodeType:L,splitText:function(t){var e=this.data,r=e.substring(t);e=e.substring(0,t),this.data=this.nodeValue=e,this.length=e.length;var i=this.ownerDocument.createTextNode(r);return this.parentNode&&this.parentNode.insertBefore(i,this.nextSibling),i}},O(Et,wt),Tt.prototype={nodeName:"#comment",nodeType:V},O(Tt,wt),St.prototype={nodeName:"#cdata-section",nodeType:B},O(St,wt),At.prototype.nodeType=q,O(At,nt),Nt.prototype.nodeType=z,O(Nt,nt),Ct.prototype.nodeType=P,O(Ct,nt),Mt.prototype.nodeType=k,O(Mt,nt),Ot.prototype.nodeName="#document-fragment",Ot.prototype.nodeType=H,O(Ot,nt),It.prototype.nodeType=U,O(It,nt),Rt.prototype.serializeToString=function(t,e,r){return Dt.call(t,e,r)},nt.prototype.toString=Dt;try{if(Object.defineProperty){let t=function(e){switch(e.nodeType){case R:case H:var r=[];for(e=e.firstChild;e;)7!==e.nodeType&&8!==e.nodeType&&r.push(t(e)),e=e.nextSibling;return r.join("");default:return e.nodeValue}};Object.defineProperty($.prototype,"length",{get:function(){return K(this),this.$$length}}),Object.defineProperty(nt.prototype,"textContent",{get:function(){return t(this)},set:function(t){switch(this.nodeType){case R:case H:for(;this.firstChild;)this.removeChild(this.firstChild);(t||String(t))&&this.appendChild(this.ownerDocument.createTextNode(t));break;default:this.data=t,this.value=t,this.nodeValue=t}}}),Vt=function(t,e,r){t["$$"+e]=r}}}catch(t){}v.DocumentType=At,v.DOMException=Q,v.DOMImplementation=it,v.Element=_t,v.Node=nt,v.NodeList=Z,v.XMLSerializer=Rt;var Ft,qt,Ht={},zt={};Ft=zt,qt=x.freeze,Ft.XML_ENTITIES=qt({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),Ft.HTML_ENTITIES=qt({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"",InvisibleTimes:"",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"",NegativeThickSpace:"",NegativeThinSpace:"",NegativeVeryThinSpace:"",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:" ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"",zwnj:""}),Ft.entityMap=Ft.HTML_ENTITIES;var jt={},Wt=x.NAMESPACE,Yt=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,Gt=new RegExp("[\\-\\.0-9"+Yt.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),Xt=new RegExp("^"+Yt.source+Gt.source+"*(?::"+Yt.source+Gt.source+"*)?$");function Qt(t,e){this.message=t,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,Qt)}function Zt(){}function $t(t,e){return e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber,e}function Kt(t,e,r,i,n,s){function a(t,e,i){r.attributeNames.hasOwnProperty(t)&&s.fatalError("Attribute "+t+" redefined"),r.addValue(t,e.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,n),i)}for(var o,h=++e,u=0;;){var c=t.charAt(h);switch(c){case"=":if(1===u)o=t.slice(e,h),u=3;else{if(2!==u)throw new Error("attribute equal must after attrName");u=3}break;case"'":case'"':if(3===u||1===u){if(1===u&&(s.warning('attribute value must after "="'),o=t.slice(e,h)),e=h+1,!((h=t.indexOf(c,e))>0))throw new Error("attribute value no end '"+c+"' match");a(o,l=t.slice(e,h),e-1),u=5}else{if(4!=u)throw new Error('attribute value must after "="');a(o,l=t.slice(e,h),e),s.warning('attribute "'+o+'" missed start quot('+c+")!!"),e=h+1,u=5}break;case"/":switch(u){case 0:r.setTagName(t.slice(e,h));case 5:case 6:case 7:u=7,r.closed=!0;case 4:case 1:break;case 2:r.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return s.error("unexpected end of input"),0==u&&r.setTagName(t.slice(e,h)),h;case">":switch(u){case 0:r.setTagName(t.slice(e,h));case 5:case 6:case 7:break;case 4:case 1:"/"===(l=t.slice(e,h)).slice(-1)&&(r.closed=!0,l=l.slice(0,-1));case 2:2===u&&(l=o),4==u?(s.warning('attribute "'+l+'" missed quot(")!'),a(o,l,e)):(Wt.isHTML(i[""])&&l.match(/^(?:disabled|checked|selected)$/i)||s.warning('attribute "'+l+'" missed value!! "'+l+'" instead!!'),a(l,l,e));break;case 3:throw new Error("attribute value missed!!")}return h;case"":c=" ";default:if(c<=" ")switch(u){case 0:r.setTagName(t.slice(e,h)),u=6;break;case 1:o=t.slice(e,h),u=2;break;case 4:var l=t.slice(e,h);s.warning('attribute "'+l+'" missed quot(")!!'),a(o,l,e);case 5:u=6}else switch(u){case 2:r.tagName,Wt.isHTML(i[""])&&o.match(/^(?:disabled|checked|selected)$/i)||s.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),a(o,o,e),e=h,u=1;break;case 5:s.warning('attribute space is required"'+o+'"!!');case 6:u=1,e=h;break;case 3:u=4,e=h;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}h++}}function Jt(t,e,r){for(var i=t.tagName,n=null,s=t.length;s--;){var a=t[s],o=a.qName,h=a.value;if((d=o.indexOf(":"))>0)var u=a.prefix=o.slice(0,d),c=o.slice(d+1),l="xmlns"===u&&c;else c=o,u=null,l="xmlns"===o&&"";a.localName=c,!1!==l&&(null==n&&(n={},re(r,r={})),r[l]=n[l]=h,a.uri=Wt.XMLNS,e.startPrefixMapping(l,h))}for(s=t.length;s--;)(u=(a=t[s]).prefix)&&("xml"===u&&(a.uri=Wt.XML),"xmlns"!==u&&(a.uri=r[u||""]));var d;(d=i.indexOf(":"))>0?(u=t.prefix=i.slice(0,d),c=t.localName=i.slice(d+1)):(u=null,c=t.localName=i);var p=t.uri=r[u||""];if(e.startElement(p,c,i,t),!t.closed)return t.currentNSMap=r,t.localNSMap=n,!0;if(e.endElement(p,c,i),n)for(u in n)Object.prototype.hasOwnProperty.call(n,u)&&e.endPrefixMapping(u)}function te(t,e,r,i,n){if(/^(?:script|textarea)$/i.test(r)){var s=t.indexOf("</"+r+">",e),a=t.substring(e+1,s);if(/[&<]/.test(a))return/^script$/i.test(r)?(n.characters(a,0,a.length),s):(a=a.replace(/&#?\w+;/g,i),n.characters(a,0,a.length),s)}return e+1}function ee(t,e,r,i){var n=i[r];return null==n&&((n=t.lastIndexOf("</"+r+">"))<e&&(n=t.lastIndexOf("</"+r)),i[r]=n),n<e}function re(t,e){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}function ie(t,e,r,i){if("-"===t.charAt(e+2))return"-"===t.charAt(e+3)?(n=t.indexOf("--\x3e",e+4))>e?(r.comment(t,e+4,n-e-4),n+3):(i.error("Unclosed comment"),-1):-1;if("CDATA["==t.substr(e+3,6)){var n=t.indexOf("]]>",e+9);return r.startCDATA(),r.characters(t,e+9,n-e-9),r.endCDATA(),n+3}var s=function(t,e){var r,i=[],n=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(n.lastIndex=e,n.exec(t);r=n.exec(t);)if(i.push(r),r[1])return i}(t,e),a=s.length;if(a>1&&/!doctype/i.test(s[0][0])){var o=s[1][0],h=!1,u=!1;a>3&&(/^public$/i.test(s[2][0])?(h=s[3][0],u=a>4&&s[4][0]):/^system$/i.test(s[2][0])&&(u=s[3][0]));var c=s[a-1];return r.startDTD(o,h,u),r.endDTD(),c.index+c[0].length}return-1}function ne(t,e,r){var i=t.indexOf("?>",e);if(i){var n=t.substring(e,i).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return n?(n[0].length,r.processingInstruction(n[1],n[2]),i+2):-1}return-1}function se(){this.attributeNames={}}Qt.prototype=new Error,Qt.prototype.name=Qt.name,Zt.prototype={parse:function(t,e,r){var i=this.domBuilder;i.startDocument(),re(e,e={}),function(t,e,r,i,n){function s(t){if(t>65535){var e=55296+((t-=65536)>>10),r=56320+(1023&t);return String.fromCharCode(e,r)}return String.fromCharCode(t)}function a(t){var e=t.slice(1,-1);return Object.hasOwnProperty.call(r,e)?r[e]:"#"===e.charAt(0)?s(parseInt(e.substr(1).replace("x","0x"))):(n.error("entity not found:"+t),t)}function o(e){if(e>m){var r=t.substring(m,e).replace(/&#?\w+;/g,a);d&&h(m),i.characters(r,0,e-m),m=e}}function h(e,r){for(;e>=c&&(r=l.exec(t));)u=r.index,c=u+r[0].length,d.lineNumber++;d.columnNumber=e-u+1}for(var u=0,c=0,l=/.*(?:\r\n?|\n)|.*$/g,d=i.locator,p=[{currentNSMap:e}],f={},m=0;;){try{var g=t.indexOf("<",m);if(g<0){if(!t.substr(m).match(/^\s*$/)){var y=i.doc,v=y.createTextNode(t.substr(m));y.appendChild(v),i.currentElement=v}return}switch(g>m&&o(g),t.charAt(g+1)){case"/":var x=t.indexOf(">",g+3),_=t.substring(g+2,x).replace(/[ \t\n\r]+$/g,""),b=p.pop();x<0?(_=t.substring(g+2).replace(/[\s<].*/,""),n.error("end tag name: "+_+" is not complete:"+b.tagName),x=g+1+_.length):_.match(/\s</)&&(_=_.replace(/[\s<].*/,""),n.error("end tag name: "+_+" maybe not complete"),x=g+1+_.length);var w=b.localNSMap,E=b.tagName==_;if(E||b.tagName&&b.tagName.toLowerCase()==_.toLowerCase()){if(i.endElement(b.uri,b.localName,_),w)for(var T in w)Object.prototype.hasOwnProperty.call(w,T)&&i.endPrefixMapping(T);E||n.fatalError("end tag name: "+_+" is not match the current start tagName:"+b.tagName)}else p.push(b);x++;break;case"?":d&&h(g),x=ne(t,g,i);break;case"!":d&&h(g),x=ie(t,g,i,n);break;default:d&&h(g);var S=new se,A=p[p.length-1].currentNSMap,N=(x=Kt(t,g,S,A,a,n),S.length);if(!S.closed&&ee(t,x,S.tagName,f)&&(S.closed=!0,r.nbsp||n.warning("unclosed xml attribute")),d&&N){for(var C=$t(d,{}),M=0;M<N;M++){var O=S[M];h(O.offset),O.locator=$t(d,{})}i.locator=C,Jt(S,i,A)&&p.push(S),i.locator=d}else Jt(S,i,A)&&p.push(S);Wt.isHTML(S.uri)&&!S.closed?x=te(t,x,S.tagName,a,i):x++}}catch(t){if(t instanceof Qt)throw t;n.error("element parse error: "+t),x=-1}x>m?m=x:o(Math.max(g,m)+1)}}(t,e,r,i,this.errorHandler),i.endDocument()}},se.prototype={setTagName:function(t){if(!Xt.test(t))throw new Error("invalid tagName:"+t);this.tagName=t},addValue:function(t,e,r){if(!Xt.test(t))throw new Error("invalid attribute:"+t);this.attributeNames[t]=this.length,this[this.length++]={qName:t,value:e,offset:r}},length:0,getLocalName:function(t){return this[t].localName},getLocator:function(t){return this[t].locator},getQName:function(t){return this[t].qName},getURI:function(t){return this[t].uri},getValue:function(t){return this[t].value}},jt.XMLReader=Zt,jt.ParseError=Qt;var ae=x,oe=zt,he=jt,ue=v.DOMImplementation,ce=ae.NAMESPACE,le=he.ParseError,de=he.XMLReader;function pe(t){return t.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028]/g,"\n")}function fe(t){this.options=t||{locator:{}}}function me(){this.cdata=!1}function ge(t,e){e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber}function ye(t,e,r){return"string"==typeof t?t.substr(e,r):t.length>=e+r||e?new java.lang.String(t,e,r)+"":t}function ve(t,e){t.currentElement?t.currentElement.appendChild(e):t.doc.appendChild(e)}fe.prototype.parseFromString=function(t,e){var r=this.options,i=new de,n=r.domBuilder||new me,s=r.errorHandler,a=r.locator,o=r.xmlns||{},h=/\/x?html?$/.test(e),u=h?oe.HTML_ENTITIES:oe.XML_ENTITIES;a&&n.setDocumentLocator(a),i.errorHandler=function(t,e,r){if(!t){if(e instanceof me)return e;t=e}var i={},n=t instanceof Function;function s(e){var s=t[e];!s&&n&&(s=2==t.length?function(r){t(e,r)}:t),i[e]=s&&function(t){s("[xmldom "+e+"]\t"+t+function(t){if(t)return"\n@"+(t.systemId||"")+"#[line:"+t.lineNumber+",col:"+t.columnNumber+"]"}(r))}||function(){}}return r=r||{},s("warning"),s("error"),s("fatalError"),i}(s,n,a),i.domBuilder=r.domBuilder||n,h&&(o[""]=ce.HTML),o.xml=o.xml||ce.XML;var c=r.normalizeLineEndings||pe;return t&&"string"==typeof t?i.parse(c(t),o,u):i.errorHandler.error("invalid doc source"),n.doc},me.prototype={startDocument:function(){this.doc=(new ue).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(t,e,r,i){var n=this.doc,s=n.createElementNS(t,r||e),a=i.length;ve(this,s),this.currentElement=s,this.locator&&ge(this.locator,s);for(var o=0;o<a;o++){t=i.getURI(o);var h=i.getValue(o),u=(r=i.getQName(o),n.createAttributeNS(t,r));this.locator&&ge(i.getLocator(o),u),u.value=u.nodeValue=h,s.setAttributeNode(u)}},endElement:function(t,e,r){var i=this.currentElement;i.tagName,this.currentElement=i.parentNode},startPrefixMapping:function(t,e){},endPrefixMapping:function(t){},processingInstruction:function(t,e){var r=this.doc.createProcessingInstruction(t,e);this.locator&&ge(this.locator,r),ve(this,r)},ignorableWhitespace:function(t,e,r){},characters:function(t,e,r){if(t=ye.apply(this,arguments)){if(this.cdata)var i=this.doc.createCDATASection(t);else i=this.doc.createTextNode(t);this.currentElement?this.currentElement.appendChild(i):/^\s*$/.test(t)&&this.doc.appendChild(i),this.locator&&ge(this.locator,i)}},skippedEntity:function(t){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(t){(this.locator=t)&&(t.lineNumber=0)},comment:function(t,e,r){t=ye.apply(this,arguments);var i=this.doc.createComment(t);this.locator&&ge(this.locator,i),ve(this,i)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(t,e,r){var i=this.doc.implementation;if(i&&i.createDocumentType){var n=i.createDocumentType(t,e,r);this.locator&&ge(this.locator,n),ve(this,n),this.doc.doctype=n}},warning:function(t){},error:function(t){},fatalError:function(t){throw new le(t,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,(function(t){me.prototype[t]=function(){return null}})),Ht.__DOMHandler=me,Ht.normalizeLineEndings=pe,Ht.DOMParser=fe;var xe=Ht.DOMParser;const _e="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope?self:{document:void 0,tinyEngine:void 0};_e.Path2D||function(t){if(!t||!t.CanvasRenderingContext2D||t.Path2D)return;const{CanvasRenderingContext2D:e}=t,r=null==e?void 0:e.prototype.fill,i=null==e?void 0:e.prototype.stroke,n=null==e?void 0:e.prototype.isPointInPath;e.prototype.fill=function(...t){if(!(t[0]instanceof s)){const e=t[0]||"nonzero";return r.apply(this,[e])}{const e=t[0],i=t[1]||"nonzero";a(this,e.commands),r.apply(this,[i])}},e.prototype.stroke=function(t){t&&a(this,t.commands),i.apply(this)},e.prototype.isPointInPath=function(...t){if(t[0]instanceof s){const e=t[0],r=t[1],i=t[2],s=t[3]||"nonzero";return a(this,e.commands),n.apply(this,[r,i,s])}return n.apply(this,t)},t.Path2D=s}(_e),_e.DOMParser||(_e.DOMParser=xe);const be={window:_e,isBrowser:"undefined"!=typeof window&&("[object Window]"==={}.toString.call(window)||"[object global]"==={}.toString.call(window)),dpr:"undefined"!=typeof window&&window.devicePixelRatio||1,document:_e.document,config:{width:0,height:0,dpr:1,sliceRendering:!0,sliceDuration:15,usedCache:!1,separateCache:!1,wireframe:!1}},we=be.window.requestAnimationFrame,Ee=be.window.performance?()=>be.window.performance.now():()=>(new Date).getTime(),Te=we;class Se{constructor(){f(this,"_listeners",new Map)}destroy(){this._listeners.clear()}addEventListener(t,e){let r=this._listeners.get(t);r||(r=[],this._listeners.set(t,r)),r.includes(e)||r.push(e)}addEventListeners(t,e){const r=t.split(","),i=r.length;for(let t=0;t<i;t++)this.addEventListener(r[t].trim(),e)}isListening(t){var e;return this._listeners.has(t)&&!!(null==(e=this._listeners.get(t))?void 0:e.length)}hasEventListener(t,e){var r;return 0!==this._listeners.size&&this._listeners.has(t)&&!!(null==(r=this._listeners.get(t))?void 0:r.includes(e))}removeEventListener(t,e){const r=this._listeners.get(t);if(r){const t=r.indexOf(e);t>-1&&r.splice(t,1)}}dispatchEvent(t){const e=this._listeners.get(t.type);if(e){t.target=this;const r=e.slice(0);for(let e=0,i=r.length;e<i;e++)r[e].call(this,t);t.target=void 0}}dispatchEventAsync(t){const e=this._listeners.get(t.type);e&&setTimeout((()=>{for(const r of e)r.call(this,t)}))}}const Ae=(t,e,r)=>Math.max(e,Math.min(r,t)),Ne=(t,e=1e-6)=>Math.abs(t)<e?0:t<0?-1:1,Ce=t=>t*(Math.PI/180),Me=(t,e,r)=>(1-r)*t+r*e;class Oe{constructor(t=0,e=0,r){f(this,"isVector2",!0),f(this,"x",0),f(this,"y",0),f(this,"z"),this.x=t,this.y=e,this.z=r||0}static isZero(t){return 0===t.x&&0===t.y}static isEmpty(t){return!Number.isFinite(t.x)&&!Number.isFinite(t.y)}static equals(t,e,r=!0){return r?t.x===e.x&&t.y===e.y:Math.abs(t.x-e.x)<Number.EPSILON&&Math.abs(t.y-e.y)<Number.EPSILON}static getInt32Array(t,e=2){const r=new ArrayBuffer(t.length*e*4),i=new Int32Array(r);for(let e=0,r=t.length;e<r;e++)i[2*e]=t[e].x,i[2*e+1]=t[e].y;return i}static getFloat64Array(t,e=2){const r=new ArrayBuffer(t.length*e*8),i=new Float64Array(r);for(let e=0,r=t.length;e<r;e++)i[2*e]=t[e].x,i[2*e+1]=t[e].y;return i}static getVectors(t){const e=[];for(let r=0,i=t.length;r<i;r++)e.push(new Oe(t[r].x,t[r].y));return e}static getStrings(t){const e=[];if(!t||!t.length)return"";for(let r=0,i=t.length;r<i;r++)e.push(Oe.getString(t[r]));return e.join(",")}static getString(t){return`${t.x},${t.y}`}static getLength(t){return Math.sqrt(t.x*t.x+t.y*t.y)}static getDistance(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))}static dot(t,e){return t.x*e.x+t.y*e.y}static cross(t,e){return t.x*e.y-t.y*e.x}static sub(t,e){return(new Oe).subVectors(t,e)}static isPointOnSegment(t,e,r){return 0===Ne(this.sub(t,r).cross(this.sub(e,r)))&&Ne(this.sub(t,r).dot(this.sub(e,r)))<=0}static angle(t,e,r){return r?Math.atan2(t.y-e.y,t.x-e.x):(t=>{let e=t*(180/Math.PI);return e<0&&(e+=360),e>360&&(e-=360),e})(Math.atan2(t.y-e.y,t.x-e.x))}static getSamplingPoints(t,e=100){let r=this.getClothoidPoints(t,e),i=0;for(let t=0,e=r.length;t<e;t++){let e=Math.max(0,t-1);t>0?i+=this.getDistance(r[e],r[e+1]):i=0,r[t].l=Math.round(i);let n=this.angle(r[e+1],r[e]);r[t].a=Math.round(100*n)/100}return r}static getClothoidPoints(t,e=100){let r=[],i=t.concat([]);if(!i||i.length<2)return r;2===i.length?(i.push(i[1]),i.unshift(i[0])):3===i.length&&i.splice(2,0,i[1]);for(let t=0;t<i.length-3;t+=3){let n=new Oe(i[t].x,i[t].y),s=new Oe(i[t+1].x,i[t+1].y),a=new Oe(i[t+2].x,i[t+2].y),o=new Oe(i[t+3].x,i[t+3].y),h=0;h+=n.distanceTo(s),h+=s.distanceTo(a),h+=a.distanceTo(o);let u=Math.min(.5,1/(h/e));for(let t=u;t<1;t+=u){let e=3*(s.x-n.x),i=3*(a.x-s.x)-e,h=o.x-n.x-e-i,u=3*(s.y-n.y),c=3*(a.y-s.y)-u,l=o.y-n.y-u-c,d=h*Math.pow(t,3)+i*Math.pow(t,2)+e*t+n.x,p=l*Math.pow(t,3)+c*Math.pow(t,2)+u*t+n.y;r.push({x:Math.round(d),y:Math.round(p),a:0,l:0})}}return r.unshift({x:i[0].x,y:i[0].y,a:0,l:0}),r.push({x:i[i.length-1].x,y:i[i.length-1].y,a:0,l:0}),r}static getClothoidLength(t){let e=0;if(t.length>2)for(let r=0;r<t.length;r++){let i=Math.max(0,r-1);r>0&&(e+=this.getDistance(t[i],t[i+1]))}return e}static getCircleCenterByChord(t,e,r,i=!0,n=new Oe){const s=this.getDistance(t,e);if(0===s)return n.x=1/0,n.y=1/0,n;Ie.set((t.x+e.x)/2,(t.y+e.y)/2);const a=Math.sqrt(r*r-s*s/4),o=i?-1:1;return n.x=Ie.x+o*a*(e.y-t.y)/s,n.y=Ie.y-o*a*(e.x-t.x)/s,n}static isPointInCircle(t,e,r){return this.getDistance(r,t)<e}static isPointInConvexHull(t,e){let r=!1;const i=e.length;for(let n=0,s=i-1;n<i;s=n++){const i=e[n],a=e[s];if(Math.min(i.x,a.x)<=t.x&&t.x<=Math.max(i.x,a.x)&&Math.min(i.y,a.y)<=t.y&&t.y<=Math.max(i.y,a.y)){const e=(a.x-i.x)*(t.y-i.y)-(a.y-i.y)*(t.x-i.x);if(Math.abs(e)<1e-12)return!0}i.y>t.y!=a.y>t.y&&t.x<(a.x-i.x)*(t.y-i.y)/(a.y-i.y)+i.x&&(r=!r)}return r}static isPointInPolygonByRay(t,e){let r=0;const i=(new Oe).copy(t),n=new Oe,s=new Oe;for(let t=0;t<e.length;t++){t===e.length-1?(n.copy(e[t]),s.copy(e[0])):(n.copy(e[t]),s.copy(e[t+1]));let a=[n.y,s.y].sort(((t,e)=>t-e));a[0]<i.y&&a[1]>i.y&&(n.x<i.x||s.x<i.x)&&r++}return r%2==1}static getIntersectionOfSegments(t,e,r,i,n=!1,s=new Oe){const a=(i.y-r.y)*(e.x-t.x)-(i.x-r.x)*(e.y-t.y);if(0===a)return s.makeEmpty();const o=((i.x-r.x)*(t.y-r.y)-(i.y-r.y)*(t.x-r.x))/a,h=((e.x-t.x)*(t.y-r.y)-(e.y-t.y)*(t.x-r.x))/a;return n&&(o<0||o>1||h<0||h>1)?s.makeEmpty():(s.x=t.x+o*(e.x-t.x),s.y=t.y+o*(e.y-t.y),s)}static getConvexHullByGrahamScan(t,e=!1,r=[]){if(!t||!t.length)return r;const i=t.length;let n=0;for(let e=0;e<i;e++)t[e].x<t[n].x&&(n=e);let s,a=n;do{r.push(t[a]),s=(a+1)%i;for(let e=0;e<i;e++)this.whichSideOfSegment(t[a],t[e],t[s])>0&&(s=e);a=s}while(a!==n);return e&&r.push(t[n]),r}static whichSideOfSegment(t,e,r){return(e.x-t.x)*(r.y-t.y)-(r.x-t.x)*(e.y-t.y)}static getPointsWithMatrix3(t,e){const r=[];if(!t)return r;for(let i=0,n=t.length;i<n;i++)r.push({x:e.elements[0]*t[i].x+e.elements[3]*t[i].y+e.elements[6],y:e.elements[1]*t[i].x+e.elements[4]*t[i].y+e.elements[7]});return r}static getPointsApplyMatrix3(t,e=[]){for(let r=0,i=e.length;r<i;r++){const i=t.elements[0]*e[r].x+t.elements[3]*e[r].y+t.elements[6],n=t.elements[1]*e[r].x+t.elements[4]*e[r].y+t.elements[7];e[r].x=i,e[r].y=n}return e}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}applyMatrix3(t){const e=this.x,r=this.y,i=t.elements;return this.x=i[0]*e+i[3]*r+i[6],this.y=i[1]*e+i[4]*r+i[7],this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}ceilToZero(){return this.x=this.x<0?Math.floor(this.x):Math.ceil(this.x),this.y=this.y<0?Math.floor(this.y):Math.ceil(this.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampLength(t,e){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(t,Math.min(e,r)))}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clone(){return new Oe(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}cross(t){return this.x*t.y-this.y*t.x}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,r=this.y-t.y;return e*e+r*r}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}dot(t){return this.x*t.x+this.y*t.y}equals(t,e=!0){return e?t.x===this.x&&t.y===this.y:Math.abs(t.x-this.x)<Number.EPSILON&&Math.abs(t.y-this.y)<Number.EPSILON}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}floorToZero(){return this.roundToZero()}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("out of range: "+t)}}identity(){return this.set(0,0)}isEmpty(){return!Number.isFinite(this.x)&&!Number.isFinite(this.y)}isZero(){return 0===this.x&&0===this.y}length(){return Math.sqrt(this.dot(this))}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,r){return this.x=t.x+(e.x-t.x)*r,this.y=t.y+(e.y-t.y)*r,this}makeEmpty(){return this.x=1/0,this.y=1/0,this}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}maxXY(t,e){return this.x=Math.max(this.x,t),this.y=Math.max(this.y,e),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}minXY(t,e){return this.x=Math.min(this.x,t),this.y=Math.min(this.y,e),this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t,e){return this.x*=t,this.y*=e||t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this}negate(){return this.x=-this.x,this.y=-this.y,this}normalize(){return this.divideScalar(this.length()||1)}project(t){return this.applyMatrix3(t.matrixWorldInverse).applyMatrix3(t.projectionMatrix)}random(){return this.x=Math.random(),this.y=Math.random(),this}rotate(t){const e=Math.cos(t),r=Math.sin(t),i=this.x,n=this.y;return this.x=i*e-n*r,this.y=i*r+n*e,this}rotateAround(t,e){const r=Math.cos(e),i=Math.sin(e),n=this.x-t.x,s=this.y-t.y;return this.x=n*r-s*i+t.x,this.y=n*i+s*r+t.y,this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}set(t,e){return this.x=t,this.y=e,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("out of range: "+t)}return this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,3*e)}setLength(t){return this.normalize().multiplyScalar(t)}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}toString(){return`{"x":${this.x},"y":${this.y}}`}unproject(t,e=!1){return this.applyMatrix3(t.projectionMatrixInverse).applyMatrix3(t.matrixWorld)}validate(){return!(isNaN(this.x)||isNaN(this.y))}*[Symbol.iterator](){yield this.x,yield this.y}}const Ie=new Oe;var Re={exports:{}};
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Lodash <https://lodash.com/>
|
|
5
|
-
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
6
|
-
* Released under MIT license <https://lodash.com/license>
|
|
7
|
-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
8
|
-
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
9
|
-
*/!function(t,e){(function(){var r,i="Expected a function",n="__lodash_hash_undefined__",s="__lodash_placeholder__",a=32,o=128,h=256,u=1/0,l=9007199254740991,d=NaN,p=4294967295,f=[["ary",o],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",a],["partialRight",64],["rearg",h]],m="[object Arguments]",g="[object Array]",y="[object Boolean]",v="[object Date]",x="[object Error]",_="[object Function]",b="[object GeneratorFunction]",w="[object Map]",E="[object Number]",T="[object Object]",S="[object Promise]",A="[object RegExp]",N="[object Set]",C="[object String]",M="[object Symbol]",O="[object WeakMap]",I="[object ArrayBuffer]",R="[object DataView]",D="[object Float32Array]",L="[object Float64Array]",B="[object Int8Array]",k="[object Int16Array]",P="[object Int32Array]",U="[object Uint8Array]",V="[object Uint8ClampedArray]",F="[object Uint16Array]",q="[object Uint32Array]",H=/\b__p \+= '';/g,z=/\b(__p \+=) '' \+/g,j=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,Y=/[&<>"']/g,G=RegExp(W.source),X=RegExp(Y.source),Q=/<%-([\s\S]+?)%>/g,Z=/<%([\s\S]+?)%>/g,$=/<%=([\s\S]+?)%>/g,K=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,J=/^\w*$/,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,et=/[\\^$.*+?()[\]{}|]/g,rt=RegExp(et.source),it=/^\s+/,nt=/\s/,st=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,at=/\{\n\/\* \[wrapped with (.+)\] \*/,ot=/,? & /,ht=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ut=/[()=,{}\[\]\/\s]/,ct=/\\(\\)?/g,lt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,dt=/\w*$/,pt=/^[-+]0x[0-9a-f]+$/i,ft=/^0b[01]+$/i,mt=/^\[object .+?Constructor\]$/,gt=/^0o[0-7]+$/i,yt=/^(?:0|[1-9]\d*)$/,vt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,xt=/($^)/,_t=/['\n\r\u2028\u2029\\]/g,bt="\\ud800-\\udfff",wt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Et="\\u2700-\\u27bf",Tt="a-z\\xdf-\\xf6\\xf8-\\xff",St="A-Z\\xc0-\\xd6\\xd8-\\xde",At="\\ufe0e\\ufe0f",Nt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ct="['’]",Mt="["+bt+"]",Ot="["+Nt+"]",It="["+wt+"]",Rt="\\d+",Dt="["+Et+"]",Lt="["+Tt+"]",Bt="[^"+bt+Nt+Rt+Et+Tt+St+"]",kt="\\ud83c[\\udffb-\\udfff]",Pt="[^"+bt+"]",Ut="(?:\\ud83c[\\udde6-\\uddff]){2}",Vt="[\\ud800-\\udbff][\\udc00-\\udfff]",Ft="["+St+"]",qt="\\u200d",Ht="(?:"+Lt+"|"+Bt+")",zt="(?:"+Ft+"|"+Bt+")",jt="(?:['’](?:d|ll|m|re|s|t|ve))?",Wt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Yt="(?:"+It+"|"+kt+")?",Gt="["+At+"]?",Xt=Gt+Yt+"(?:"+qt+"(?:"+[Pt,Ut,Vt].join("|")+")"+Gt+Yt+")*",Qt="(?:"+[Dt,Ut,Vt].join("|")+")"+Xt,Zt="(?:"+[Pt+It+"?",It,Ut,Vt,Mt].join("|")+")",$t=RegExp(Ct,"g"),Kt=RegExp(It,"g"),Jt=RegExp(kt+"(?="+kt+")|"+Zt+Xt,"g"),te=RegExp([Ft+"?"+Lt+"+"+jt+"(?="+[Ot,Ft,"$"].join("|")+")",zt+"+"+Wt+"(?="+[Ot,Ft+Ht,"$"].join("|")+")",Ft+"?"+Ht+"+"+jt,Ft+"+"+Wt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Rt,Qt].join("|"),"g"),ee=RegExp("["+qt+bt+wt+At+"]"),re=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ie=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ne=-1,se={};se[D]=se[L]=se[B]=se[k]=se[P]=se[U]=se[V]=se[F]=se[q]=!0,se[m]=se[g]=se[I]=se[y]=se[R]=se[v]=se[x]=se[_]=se[w]=se[E]=se[T]=se[A]=se[N]=se[C]=se[O]=!1;var ae={};ae[m]=ae[g]=ae[I]=ae[R]=ae[y]=ae[v]=ae[D]=ae[L]=ae[B]=ae[k]=ae[P]=ae[w]=ae[E]=ae[T]=ae[A]=ae[N]=ae[C]=ae[M]=ae[U]=ae[V]=ae[F]=ae[q]=!0,ae[x]=ae[_]=ae[O]=!1;var oe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},he=parseFloat,ue=parseInt,ce="object"==typeof c&&c&&c.Object===Object&&c,le="object"==typeof self&&self&&self.Object===Object&&self,de=ce||le||Function("return this")(),pe=e&&!e.nodeType&&e,fe=pe&&t&&!t.nodeType&&t,me=fe&&fe.exports===pe,ge=me&&ce.process,ye=function(){try{var t=fe&&fe.require&&fe.require("util").types;return t||ge&&ge.binding&&ge.binding("util")}catch(t){}}(),ve=ye&&ye.isArrayBuffer,xe=ye&&ye.isDate,_e=ye&&ye.isMap,be=ye&&ye.isRegExp,we=ye&&ye.isSet,Ee=ye&&ye.isTypedArray;function Te(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Se(t,e,r,i){for(var n=-1,s=null==t?0:t.length;++n<s;){var a=t[n];e(i,a,r(a),t)}return i}function Ae(t,e){for(var r=-1,i=null==t?0:t.length;++r<i&&!1!==e(t[r],r,t););return t}function Ne(t,e){for(var r=null==t?0:t.length;r--&&!1!==e(t[r],r,t););return t}function Ce(t,e){for(var r=-1,i=null==t?0:t.length;++r<i;)if(!e(t[r],r,t))return!1;return!0}function Me(t,e){for(var r=-1,i=null==t?0:t.length,n=0,s=[];++r<i;){var a=t[r];e(a,r,t)&&(s[n++]=a)}return s}function Oe(t,e){return!(null==t||!t.length)&&Fe(t,e,0)>-1}function Ie(t,e,r){for(var i=-1,n=null==t?0:t.length;++i<n;)if(r(e,t[i]))return!0;return!1}function Re(t,e){for(var r=-1,i=null==t?0:t.length,n=Array(i);++r<i;)n[r]=e(t[r],r,t);return n}function De(t,e){for(var r=-1,i=e.length,n=t.length;++r<i;)t[n+r]=e[r];return t}function Le(t,e,r,i){var n=-1,s=null==t?0:t.length;for(i&&s&&(r=t[++n]);++n<s;)r=e(r,t[n],n,t);return r}function Be(t,e,r,i){var n=null==t?0:t.length;for(i&&n&&(r=t[--n]);n--;)r=e(r,t[n],n,t);return r}function ke(t,e){for(var r=-1,i=null==t?0:t.length;++r<i;)if(e(t[r],r,t))return!0;return!1}var Pe=je("length");function Ue(t,e,r){var i;return r(t,(function(t,r,n){if(e(t,r,n))return i=r,!1})),i}function Ve(t,e,r,i){for(var n=t.length,s=r+(i?1:-1);i?s--:++s<n;)if(e(t[s],s,t))return s;return-1}function Fe(t,e,r){return e==e?function(t,e,r){for(var i=r-1,n=t.length;++i<n;)if(t[i]===e)return i;return-1}(t,e,r):Ve(t,He,r)}function qe(t,e,r,i){for(var n=r-1,s=t.length;++n<s;)if(i(t[n],e))return n;return-1}function He(t){return t!=t}function ze(t,e){var r=null==t?0:t.length;return r?Ge(t,e)/r:d}function je(t){return function(e){return null==e?r:e[t]}}function We(t){return function(e){return null==t?r:t[e]}}function Ye(t,e,r,i,n){return n(t,(function(t,n,s){r=i?(i=!1,t):e(r,t,n,s)})),r}function Ge(t,e){for(var i,n=-1,s=t.length;++n<s;){var a=e(t[n]);a!==r&&(i=i===r?a:i+a)}return i}function Xe(t,e){for(var r=-1,i=Array(t);++r<t;)i[r]=e(r);return i}function Qe(t){return t?t.slice(0,lr(t)+1).replace(it,""):t}function Ze(t){return function(e){return t(e)}}function $e(t,e){return Re(e,(function(e){return t[e]}))}function Ke(t,e){return t.has(e)}function Je(t,e){for(var r=-1,i=t.length;++r<i&&Fe(e,t[r],0)>-1;);return r}function tr(t,e){for(var r=t.length;r--&&Fe(e,t[r],0)>-1;);return r}var er=We({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),rr=We({"&":"&","<":"<",">":">",'"':""","'":"'"});function ir(t){return"\\"+oe[t]}function nr(t){return ee.test(t)}function sr(t){var e=-1,r=Array(t.size);return t.forEach((function(t,i){r[++e]=[i,t]})),r}function ar(t,e){return function(r){return t(e(r))}}function or(t,e){for(var r=-1,i=t.length,n=0,a=[];++r<i;){var o=t[r];o!==e&&o!==s||(t[r]=s,a[n++]=r)}return a}function hr(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}function ur(t){return nr(t)?function(t){for(var e=Jt.lastIndex=0;Jt.test(t);)++e;return e}(t):Pe(t)}function cr(t){return nr(t)?function(t){return t.match(Jt)||[]}(t):function(t){return t.split("")}(t)}function lr(t){for(var e=t.length;e--&&nt.test(t.charAt(e)););return e}var dr=We({"&":"&","<":"<",">":">",""":'"',"'":"'"}),pr=function t(e){var c,nt=(e=null==e?de:pr.defaults(de.Object(),e,pr.pick(de,ie))).Array,bt=e.Date,wt=e.Error,Et=e.Function,Tt=e.Math,St=e.Object,At=e.RegExp,Nt=e.String,Ct=e.TypeError,Mt=nt.prototype,Ot=Et.prototype,It=St.prototype,Rt=e["__core-js_shared__"],Dt=Ot.toString,Lt=It.hasOwnProperty,Bt=0,kt=(c=/[^.]+$/.exec(Rt&&Rt.keys&&Rt.keys.IE_PROTO||""))?"Symbol(src)_1."+c:"",Pt=It.toString,Ut=Dt.call(St),Vt=de._,Ft=At("^"+Dt.call(Lt).replace(et,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qt=me?e.Buffer:r,Ht=e.Symbol,zt=e.Uint8Array,jt=qt?qt.allocUnsafe:r,Wt=ar(St.getPrototypeOf,St),Yt=St.create,Gt=It.propertyIsEnumerable,Xt=Mt.splice,Qt=Ht?Ht.isConcatSpreadable:r,Zt=Ht?Ht.iterator:r,Jt=Ht?Ht.toStringTag:r,ee=function(){try{var t=us(St,"defineProperty");return t({},"",{}),t}catch(t){}}(),oe=e.clearTimeout!==de.clearTimeout&&e.clearTimeout,ce=bt&&bt.now!==de.Date.now&&bt.now,le=e.setTimeout!==de.setTimeout&&e.setTimeout,pe=Tt.ceil,fe=Tt.floor,ge=St.getOwnPropertySymbols,ye=qt?qt.isBuffer:r,Pe=e.isFinite,We=Mt.join,fr=ar(St.keys,St),mr=Tt.max,gr=Tt.min,yr=bt.now,vr=e.parseInt,xr=Tt.random,_r=Mt.reverse,br=us(e,"DataView"),wr=us(e,"Map"),Er=us(e,"Promise"),Tr=us(e,"Set"),Sr=us(e,"WeakMap"),Ar=us(St,"create"),Nr=Sr&&new Sr,Cr={},Mr=Us(br),Or=Us(wr),Ir=Us(Er),Rr=Us(Tr),Dr=Us(Sr),Lr=Ht?Ht.prototype:r,Br=Lr?Lr.valueOf:r,kr=Lr?Lr.toString:r;function Pr(t){if(eo(t)&&!ja(t)&&!(t instanceof qr)){if(t instanceof Fr)return t;if(Lt.call(t,"__wrapped__"))return Vs(t)}return new Fr(t)}var Ur=function(){function t(){}return function(e){if(!to(e))return{};if(Yt)return Yt(e);t.prototype=e;var i=new t;return t.prototype=r,i}}();function Vr(){}function Fr(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=r}function qr(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=p,this.__views__=[]}function Hr(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}function zr(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}function jr(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}function Wr(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new jr;++e<r;)this.add(t[e])}function Yr(t){var e=this.__data__=new zr(t);this.size=e.size}function Gr(t,e){var r=ja(t),i=!r&&za(t),n=!r&&!i&&Xa(t),s=!r&&!i&&!n&&uo(t),a=r||i||n||s,o=a?Xe(t.length,Nt):[],h=o.length;for(var u in t)!e&&!Lt.call(t,u)||a&&("length"==u||n&&("offset"==u||"parent"==u)||s&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||gs(u,h))||o.push(u);return o}function Xr(t){var e=t.length;return e?t[Wi(0,e-1)]:r}function Qr(t,e){return Rs(Nn(t),ni(e,0,t.length))}function Zr(t){return Rs(Nn(t))}function $r(t,e,i){(i!==r&&!Fa(t[e],i)||i===r&&!(e in t))&&ri(t,e,i)}function Kr(t,e,i){var n=t[e];Lt.call(t,e)&&Fa(n,i)&&(i!==r||e in t)||ri(t,e,i)}function Jr(t,e){for(var r=t.length;r--;)if(Fa(t[r][0],e))return r;return-1}function ti(t,e,r,i){return ui(t,(function(t,n,s){e(i,t,r(t),s)})),i}function ei(t,e){return t&&Cn(e,Ro(e),t)}function ri(t,e,r){"__proto__"==e&&ee?ee(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function ii(t,e){for(var i=-1,n=e.length,s=nt(n),a=null==t;++i<n;)s[i]=a?r:No(t,e[i]);return s}function ni(t,e,i){return t==t&&(i!==r&&(t=t<=i?t:i),e!==r&&(t=t>=e?t:e)),t}function si(t,e,i,n,s,a){var o,h=1&e,u=2&e,c=4&e;if(i&&(o=s?i(t,n,s,a):i(t)),o!==r)return o;if(!to(t))return t;var l=ja(t);if(l){if(o=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&Lt.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!h)return Nn(t,o)}else{var d=ds(t),p=d==_||d==b;if(Xa(t))return bn(t,h);if(d==T||d==m||p&&!s){if(o=u||p?{}:fs(t),!h)return u?function(t,e){return Cn(t,ls(t),e)}(t,function(t,e){return t&&Cn(e,Do(e),t)}(o,t)):function(t,e){return Cn(t,cs(t),e)}(t,ei(o,t))}else{if(!ae[d])return s?t:{};o=function(t,e,r){var i,n=t.constructor;switch(e){case I:return wn(t);case y:case v:return new n(+t);case R:return function(t,e){var r=e?wn(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case D:case L:case B:case k:case P:case U:case V:case F:case q:return En(t,r);case w:return new n;case E:case C:return new n(t);case A:return function(t){var e=new t.constructor(t.source,dt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case N:return new n;case M:return i=t,Br?St(Br.call(i)):{}}}(t,d,h)}}a||(a=new Yr);var f=a.get(t);if(f)return f;a.set(t,o),ao(t)?t.forEach((function(r){o.add(si(r,e,i,r,t,a))})):ro(t)&&t.forEach((function(r,n){o.set(n,si(r,e,i,n,t,a))}));var g=l?r:(c?u?rs:es:u?Do:Ro)(t);return Ae(g||t,(function(r,n){g&&(r=t[n=r]),Kr(o,n,si(r,e,i,n,t,a))})),o}function ai(t,e,i){var n=i.length;if(null==t)return!n;for(t=St(t);n--;){var s=i[n],a=e[s],o=t[s];if(o===r&&!(s in t)||!a(o))return!1}return!0}function oi(t,e,n){if("function"!=typeof t)throw new Ct(i);return Cs((function(){t.apply(r,n)}),e)}function hi(t,e,r,i){var n=-1,s=Oe,a=!0,o=t.length,h=[],u=e.length;if(!o)return h;r&&(e=Re(e,Ze(r))),i?(s=Ie,a=!1):e.length>=200&&(s=Ke,a=!1,e=new Wr(e));t:for(;++n<o;){var c=t[n],l=null==r?c:r(c);if(c=i||0!==c?c:0,a&&l==l){for(var d=u;d--;)if(e[d]===l)continue t;h.push(c)}else s(e,l,i)||h.push(c)}return h}Pr.templateSettings={escape:Q,evaluate:Z,interpolate:$,variable:"",imports:{_:Pr}},Pr.prototype=Vr.prototype,Pr.prototype.constructor=Pr,Fr.prototype=Ur(Vr.prototype),Fr.prototype.constructor=Fr,qr.prototype=Ur(Vr.prototype),qr.prototype.constructor=qr,Hr.prototype.clear=function(){this.__data__=Ar?Ar(null):{},this.size=0},Hr.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Hr.prototype.get=function(t){var e=this.__data__;if(Ar){var i=e[t];return i===n?r:i}return Lt.call(e,t)?e[t]:r},Hr.prototype.has=function(t){var e=this.__data__;return Ar?e[t]!==r:Lt.call(e,t)},Hr.prototype.set=function(t,e){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=Ar&&e===r?n:e,this},zr.prototype.clear=function(){this.__data__=[],this.size=0},zr.prototype.delete=function(t){var e=this.__data__,r=Jr(e,t);return!(r<0||(r==e.length-1?e.pop():Xt.call(e,r,1),--this.size,0))},zr.prototype.get=function(t){var e=this.__data__,i=Jr(e,t);return i<0?r:e[i][1]},zr.prototype.has=function(t){return Jr(this.__data__,t)>-1},zr.prototype.set=function(t,e){var r=this.__data__,i=Jr(r,t);return i<0?(++this.size,r.push([t,e])):r[i][1]=e,this},jr.prototype.clear=function(){this.size=0,this.__data__={hash:new Hr,map:new(wr||zr),string:new Hr}},jr.prototype.delete=function(t){var e=os(this,t).delete(t);return this.size-=e?1:0,e},jr.prototype.get=function(t){return os(this,t).get(t)},jr.prototype.has=function(t){return os(this,t).has(t)},jr.prototype.set=function(t,e){var r=os(this,t),i=r.size;return r.set(t,e),this.size+=r.size==i?0:1,this},Wr.prototype.add=Wr.prototype.push=function(t){return this.__data__.set(t,n),this},Wr.prototype.has=function(t){return this.__data__.has(t)},Yr.prototype.clear=function(){this.__data__=new zr,this.size=0},Yr.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Yr.prototype.get=function(t){return this.__data__.get(t)},Yr.prototype.has=function(t){return this.__data__.has(t)},Yr.prototype.set=function(t,e){var r=this.__data__;if(r instanceof zr){var i=r.__data__;if(!wr||i.length<199)return i.push([t,e]),this.size=++r.size,this;r=this.__data__=new jr(i)}return r.set(t,e),this.size=r.size,this};var ui=In(yi),ci=In(vi,!0);function li(t,e){var r=!0;return ui(t,(function(t,i,n){return r=!!e(t,i,n)})),r}function di(t,e,i){for(var n=-1,s=t.length;++n<s;){var a=t[n],o=e(a);if(null!=o&&(h===r?o==o&&!ho(o):i(o,h)))var h=o,u=a}return u}function pi(t,e){var r=[];return ui(t,(function(t,i,n){e(t,i,n)&&r.push(t)})),r}function fi(t,e,r,i,n){var s=-1,a=t.length;for(r||(r=ms),n||(n=[]);++s<a;){var o=t[s];e>0&&r(o)?e>1?fi(o,e-1,r,i,n):De(n,o):i||(n[n.length]=o)}return n}var mi=Rn(),gi=Rn(!0);function yi(t,e){return t&&mi(t,e,Ro)}function vi(t,e){return t&&gi(t,e,Ro)}function xi(t,e){return Me(e,(function(e){return $a(t[e])}))}function _i(t,e){for(var i=0,n=(e=yn(e,t)).length;null!=t&&i<n;)t=t[Ps(e[i++])];return i&&i==n?t:r}function bi(t,e,r){var i=e(t);return ja(t)?i:De(i,r(t))}function wi(t){return null==t?t===r?"[object Undefined]":"[object Null]":Jt&&Jt in St(t)?function(t){var e=Lt.call(t,Jt),i=t[Jt];try{t[Jt]=r;var n=!0}catch(t){}var s=Pt.call(t);return n&&(e?t[Jt]=i:delete t[Jt]),s}(t):function(t){return Pt.call(t)}(t)}function Ei(t,e){return t>e}function Ti(t,e){return null!=t&&Lt.call(t,e)}function Si(t,e){return null!=t&&e in St(t)}function Ai(t,e,i){for(var n=i?Ie:Oe,s=t[0].length,a=t.length,o=a,h=nt(a),u=1/0,c=[];o--;){var l=t[o];o&&e&&(l=Re(l,Ze(e))),u=gr(l.length,u),h[o]=!i&&(e||s>=120&&l.length>=120)?new Wr(o&&l):r}l=t[0];var d=-1,p=h[0];t:for(;++d<s&&c.length<u;){var f=l[d],m=e?e(f):f;if(f=i||0!==f?f:0,!(p?Ke(p,m):n(c,m,i))){for(o=a;--o;){var g=h[o];if(!(g?Ke(g,m):n(t[o],m,i)))continue t}p&&p.push(m),c.push(f)}}return c}function Ni(t,e,i){var n=null==(t=Ss(t,e=yn(e,t)))?t:t[Ps(Zs(e))];return null==n?r:Te(n,t,i)}function Ci(t){return eo(t)&&wi(t)==m}function Mi(t,e,i,n,s){return t===e||(null==t||null==e||!eo(t)&&!eo(e)?t!=t&&e!=e:function(t,e,i,n,s,a){var o=ja(t),h=ja(e),u=o?g:ds(t),c=h?g:ds(e),l=(u=u==m?T:u)==T,d=(c=c==m?T:c)==T,p=u==c;if(p&&Xa(t)){if(!Xa(e))return!1;o=!0,l=!1}if(p&&!l)return a||(a=new Yr),o||uo(t)?Jn(t,e,i,n,s,a):function(t,e,r,i,n,s,a){switch(r){case R:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case I:return!(t.byteLength!=e.byteLength||!s(new zt(t),new zt(e)));case y:case v:case E:return Fa(+t,+e);case x:return t.name==e.name&&t.message==e.message;case A:case C:return t==e+"";case w:var o=sr;case N:var h=1&i;if(o||(o=hr),t.size!=e.size&&!h)return!1;var u=a.get(t);if(u)return u==e;i|=2,a.set(t,e);var c=Jn(o(t),o(e),i,n,s,a);return a.delete(t),c;case M:if(Br)return Br.call(t)==Br.call(e)}return!1}(t,e,u,i,n,s,a);if(!(1&i)){var f=l&&Lt.call(t,"__wrapped__"),_=d&&Lt.call(e,"__wrapped__");if(f||_){var b=f?t.value():t,S=_?e.value():e;return a||(a=new Yr),s(b,S,i,n,a)}}return!!p&&(a||(a=new Yr),function(t,e,i,n,s,a){var o=1&i,h=es(t),u=h.length,c=es(e),l=c.length;if(u!=l&&!o)return!1;for(var d=u;d--;){var p=h[d];if(!(o?p in e:Lt.call(e,p)))return!1}var f=a.get(t),m=a.get(e);if(f&&m)return f==e&&m==t;var g=!0;a.set(t,e),a.set(e,t);for(var y=o;++d<u;){var v=t[p=h[d]],x=e[p];if(n)var _=o?n(x,v,p,e,t,a):n(v,x,p,t,e,a);if(!(_===r?v===x||s(v,x,i,n,a):_)){g=!1;break}y||(y="constructor"==p)}if(g&&!y){var b=t.constructor,w=e.constructor;b==w||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w||(g=!1)}return a.delete(t),a.delete(e),g}(t,e,i,n,s,a))}(t,e,i,n,Mi,s))}function Oi(t,e,i,n){var s=i.length,a=s,o=!n;if(null==t)return!a;for(t=St(t);s--;){var h=i[s];if(o&&h[2]?h[1]!==t[h[0]]:!(h[0]in t))return!1}for(;++s<a;){var u=(h=i[s])[0],c=t[u],l=h[1];if(o&&h[2]){if(c===r&&!(u in t))return!1}else{var d=new Yr;if(n)var p=n(c,l,u,t,e,d);if(!(p===r?Mi(l,c,3,n,d):p))return!1}}return!0}function Ii(t){return!(!to(t)||(e=t,kt&&kt in e))&&($a(t)?Ft:mt).test(Us(t));var e}function Ri(t){return"function"==typeof t?t:null==t?nh:"object"==typeof t?ja(t)?Ui(t[0],t[1]):Pi(t):ph(t)}function Di(t){if(!bs(t))return fr(t);var e=[];for(var r in St(t))Lt.call(t,r)&&"constructor"!=r&&e.push(r);return e}function Li(t){if(!to(t))return function(t){var e=[];if(null!=t)for(var r in St(t))e.push(r);return e}(t);var e=bs(t),r=[];for(var i in t)("constructor"!=i||!e&&Lt.call(t,i))&&r.push(i);return r}function Bi(t,e){return t<e}function ki(t,e){var r=-1,i=Ya(t)?nt(t.length):[];return ui(t,(function(t,n,s){i[++r]=e(t,n,s)})),i}function Pi(t){var e=hs(t);return 1==e.length&&e[0][2]?Es(e[0][0],e[0][1]):function(r){return r===t||Oi(r,t,e)}}function Ui(t,e){return vs(t)&&ws(e)?Es(Ps(t),e):function(i){var n=No(i,t);return n===r&&n===e?Co(i,t):Mi(e,n,3)}}function Vi(t,e,i,n,s){t!==e&&mi(e,(function(a,o){if(s||(s=new Yr),to(a))!function(t,e,i,n,s,a,o){var h=As(t,i),u=As(e,i),c=o.get(u);if(c)$r(t,i,c);else{var l=a?a(h,u,i+"",t,e,o):r,d=l===r;if(d){var p=ja(u),f=!p&&Xa(u),m=!p&&!f&&uo(u);l=u,p||f||m?ja(h)?l=h:Ga(h)?l=Nn(h):f?(d=!1,l=bn(u,!0)):m?(d=!1,l=En(u,!0)):l=[]:no(u)||za(u)?(l=h,za(h)?l=vo(h):to(h)&&!$a(h)||(l=fs(u))):d=!1}d&&(o.set(u,l),s(l,u,n,a,o),o.delete(u)),$r(t,i,l)}}(t,e,o,i,Vi,n,s);else{var h=n?n(As(t,o),a,o+"",t,e,s):r;h===r&&(h=a),$r(t,o,h)}}),Do)}function Fi(t,e){var i=t.length;if(i)return gs(e+=e<0?i:0,i)?t[e]:r}function qi(t,e,r){e=e.length?Re(e,(function(t){return ja(t)?function(e){return _i(e,1===t.length?t[0]:t)}:t})):[nh];var i=-1;return e=Re(e,Ze(as())),function(t,e){var r=t.length;for(t.sort(e);r--;)t[r]=t[r].value;return t}(ki(t,(function(t,r,n){return{criteria:Re(e,(function(e){return e(t)})),index:++i,value:t}})),(function(t,e){return function(t,e,r){for(var i=-1,n=t.criteria,s=e.criteria,a=n.length,o=r.length;++i<a;){var h=Tn(n[i],s[i]);if(h)return i>=o?h:h*("desc"==r[i]?-1:1)}return t.index-e.index}(t,e,r)}))}function Hi(t,e,r){for(var i=-1,n=e.length,s={};++i<n;){var a=e[i],o=_i(t,a);r(o,a)&&Zi(s,yn(a,t),o)}return s}function zi(t,e,r,i){var n=i?qe:Fe,s=-1,a=e.length,o=t;for(t===e&&(e=Nn(e)),r&&(o=Re(t,Ze(r)));++s<a;)for(var h=0,u=e[s],c=r?r(u):u;(h=n(o,c,h,i))>-1;)o!==t&&Xt.call(o,h,1),Xt.call(t,h,1);return t}function ji(t,e){for(var r=t?e.length:0,i=r-1;r--;){var n=e[r];if(r==i||n!==s){var s=n;gs(n)?Xt.call(t,n,1):un(t,n)}}return t}function Wi(t,e){return t+fe(xr()*(e-t+1))}function Yi(t,e){var r="";if(!t||e<1||e>l)return r;do{e%2&&(r+=t),(e=fe(e/2))&&(t+=t)}while(e);return r}function Gi(t,e){return Ms(Ts(t,e,nh),t+"")}function Xi(t){return Xr(qo(t))}function Qi(t,e){var r=qo(t);return Rs(r,ni(e,0,r.length))}function Zi(t,e,i,n){if(!to(t))return t;for(var s=-1,a=(e=yn(e,t)).length,o=a-1,h=t;null!=h&&++s<a;){var u=Ps(e[s]),c=i;if("__proto__"===u||"constructor"===u||"prototype"===u)return t;if(s!=o){var l=h[u];(c=n?n(l,u,h):r)===r&&(c=to(l)?l:gs(e[s+1])?[]:{})}Kr(h,u,c),h=h[u]}return t}var $i=Nr?function(t,e){return Nr.set(t,e),t}:nh,Ki=ee?function(t,e){return ee(t,"toString",{configurable:!0,enumerable:!1,value:eh(e),writable:!0})}:nh;function Ji(t){return Rs(qo(t))}function tn(t,e,r){var i=-1,n=t.length;e<0&&(e=-e>n?0:n+e),(r=r>n?n:r)<0&&(r+=n),n=e>r?0:r-e>>>0,e>>>=0;for(var s=nt(n);++i<n;)s[i]=t[i+e];return s}function en(t,e){var r;return ui(t,(function(t,i,n){return!(r=e(t,i,n))})),!!r}function rn(t,e,r){var i=0,n=null==t?i:t.length;if("number"==typeof e&&e==e&&n<=2147483647){for(;i<n;){var s=i+n>>>1,a=t[s];null!==a&&!ho(a)&&(r?a<=e:a<e)?i=s+1:n=s}return n}return nn(t,e,nh,r)}function nn(t,e,i,n){var s=0,a=null==t?0:t.length;if(0===a)return 0;for(var o=(e=i(e))!=e,h=null===e,u=ho(e),c=e===r;s<a;){var l=fe((s+a)/2),d=i(t[l]),p=d!==r,f=null===d,m=d==d,g=ho(d);if(o)var y=n||m;else y=c?m&&(n||p):h?m&&p&&(n||!f):u?m&&p&&!f&&(n||!g):!f&&!g&&(n?d<=e:d<e);y?s=l+1:a=l}return gr(a,4294967294)}function sn(t,e){for(var r=-1,i=t.length,n=0,s=[];++r<i;){var a=t[r],o=e?e(a):a;if(!r||!Fa(o,h)){var h=o;s[n++]=0===a?0:a}}return s}function an(t){return"number"==typeof t?t:ho(t)?d:+t}function on(t){if("string"==typeof t)return t;if(ja(t))return Re(t,on)+"";if(ho(t))return kr?kr.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function hn(t,e,r){var i=-1,n=Oe,s=t.length,a=!0,o=[],h=o;if(r)a=!1,n=Ie;else if(s>=200){var u=e?null:Gn(t);if(u)return hr(u);a=!1,n=Ke,h=new Wr}else h=e?[]:o;t:for(;++i<s;){var c=t[i],l=e?e(c):c;if(c=r||0!==c?c:0,a&&l==l){for(var d=h.length;d--;)if(h[d]===l)continue t;e&&h.push(l),o.push(c)}else n(h,l,r)||(h!==o&&h.push(l),o.push(c))}return o}function un(t,e){return null==(t=Ss(t,e=yn(e,t)))||delete t[Ps(Zs(e))]}function cn(t,e,r,i){return Zi(t,e,r(_i(t,e)),i)}function ln(t,e,r,i){for(var n=t.length,s=i?n:-1;(i?s--:++s<n)&&e(t[s],s,t););return r?tn(t,i?0:s,i?s+1:n):tn(t,i?s+1:0,i?n:s)}function dn(t,e){var r=t;return r instanceof qr&&(r=r.value()),Le(e,(function(t,e){return e.func.apply(e.thisArg,De([t],e.args))}),r)}function pn(t,e,r){var i=t.length;if(i<2)return i?hn(t[0]):[];for(var n=-1,s=nt(i);++n<i;)for(var a=t[n],o=-1;++o<i;)o!=n&&(s[n]=hi(s[n]||a,t[o],e,r));return hn(fi(s,1),e,r)}function fn(t,e,i){for(var n=-1,s=t.length,a=e.length,o={};++n<s;){var h=n<a?e[n]:r;i(o,t[n],h)}return o}function mn(t){return Ga(t)?t:[]}function gn(t){return"function"==typeof t?t:nh}function yn(t,e){return ja(t)?t:vs(t,e)?[t]:ks(xo(t))}var vn=Gi;function xn(t,e,i){var n=t.length;return i=i===r?n:i,!e&&i>=n?t:tn(t,e,i)}var _n=oe||function(t){return de.clearTimeout(t)};function bn(t,e){if(e)return t.slice();var r=t.length,i=jt?jt(r):new t.constructor(r);return t.copy(i),i}function wn(t){var e=new t.constructor(t.byteLength);return new zt(e).set(new zt(t)),e}function En(t,e){var r=e?wn(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function Tn(t,e){if(t!==e){var i=t!==r,n=null===t,s=t==t,a=ho(t),o=e!==r,h=null===e,u=e==e,c=ho(e);if(!h&&!c&&!a&&t>e||a&&o&&u&&!h&&!c||n&&o&&u||!i&&u||!s)return 1;if(!n&&!a&&!c&&t<e||c&&i&&s&&!n&&!a||h&&i&&s||!o&&s||!u)return-1}return 0}function Sn(t,e,r,i){for(var n=-1,s=t.length,a=r.length,o=-1,h=e.length,u=mr(s-a,0),c=nt(h+u),l=!i;++o<h;)c[o]=e[o];for(;++n<a;)(l||n<s)&&(c[r[n]]=t[n]);for(;u--;)c[o++]=t[n++];return c}function An(t,e,r,i){for(var n=-1,s=t.length,a=-1,o=r.length,h=-1,u=e.length,c=mr(s-o,0),l=nt(c+u),d=!i;++n<c;)l[n]=t[n];for(var p=n;++h<u;)l[p+h]=e[h];for(;++a<o;)(d||n<s)&&(l[p+r[a]]=t[n++]);return l}function Nn(t,e){var r=-1,i=t.length;for(e||(e=nt(i));++r<i;)e[r]=t[r];return e}function Cn(t,e,i,n){var s=!i;i||(i={});for(var a=-1,o=e.length;++a<o;){var h=e[a],u=n?n(i[h],t[h],h,i,t):r;u===r&&(u=t[h]),s?ri(i,h,u):Kr(i,h,u)}return i}function Mn(t,e){return function(r,i){var n=ja(r)?Se:ti,s=e?e():{};return n(r,t,as(i,2),s)}}function On(t){return Gi((function(e,i){var n=-1,s=i.length,a=s>1?i[s-1]:r,o=s>2?i[2]:r;for(a=t.length>3&&"function"==typeof a?(s--,a):r,o&&ys(i[0],i[1],o)&&(a=s<3?r:a,s=1),e=St(e);++n<s;){var h=i[n];h&&t(e,h,n,a)}return e}))}function In(t,e){return function(r,i){if(null==r)return r;if(!Ya(r))return t(r,i);for(var n=r.length,s=e?n:-1,a=St(r);(e?s--:++s<n)&&!1!==i(a[s],s,a););return r}}function Rn(t){return function(e,r,i){for(var n=-1,s=St(e),a=i(e),o=a.length;o--;){var h=a[t?o:++n];if(!1===r(s[h],h,s))break}return e}}function Dn(t){return function(e){var i=nr(e=xo(e))?cr(e):r,n=i?i[0]:e.charAt(0),s=i?xn(i,1).join(""):e.slice(1);return n[t]()+s}}function Ln(t){return function(e){return Le(Ko(jo(e).replace($t,"")),t,"")}}function Bn(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var r=Ur(t.prototype),i=t.apply(r,e);return to(i)?i:r}}function kn(t){return function(e,i,n){var s=St(e);if(!Ya(e)){var a=as(i,3);e=Ro(e),i=function(t){return a(s[t],t,s)}}var o=t(e,i,n);return o>-1?s[a?e[o]:o]:r}}function Pn(t){return ts((function(e){var n=e.length,s=n,a=Fr.prototype.thru;for(t&&e.reverse();s--;){var o=e[s];if("function"!=typeof o)throw new Ct(i);if(a&&!h&&"wrapper"==ns(o))var h=new Fr([],!0)}for(s=h?s:n;++s<n;){var u=ns(o=e[s]),c="wrapper"==u?is(o):r;h=c&&xs(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?h[ns(c[0])].apply(h,c[3]):1==o.length&&xs(o)?h[u]():h.thru(o)}return function(){var t=arguments,r=t[0];if(h&&1==t.length&&ja(r))return h.plant(r).value();for(var i=0,s=n?e[i].apply(this,t):r;++i<n;)s=e[i].call(this,s);return s}}))}function Un(t,e,i,n,s,a,h,u,c,l){var d=e&o,p=1&e,f=2&e,m=24&e,g=512&e,y=f?r:Bn(t);return function o(){for(var v=arguments.length,x=nt(v),_=v;_--;)x[_]=arguments[_];if(m)var b=ss(o),w=function(t,e){for(var r=t.length,i=0;r--;)t[r]===e&&++i;return i}(x,b);if(n&&(x=Sn(x,n,s,m)),a&&(x=An(x,a,h,m)),v-=w,m&&v<l){var E=or(x,b);return Wn(t,e,Un,o.placeholder,i,x,E,u,c,l-v)}var T=p?i:this,S=f?T[t]:t;return v=x.length,u?x=function(t,e){for(var i=t.length,n=gr(e.length,i),s=Nn(t);n--;){var a=e[n];t[n]=gs(a,i)?s[a]:r}return t}(x,u):g&&v>1&&x.reverse(),d&&c<v&&(x.length=c),this&&this!==de&&this instanceof o&&(S=y||Bn(S)),S.apply(T,x)}}function Vn(t,e){return function(r,i){return function(t,e,r,i){return yi(t,(function(t,n,s){e(i,r(t),n,s)})),i}(r,t,e(i),{})}}function Fn(t,e){return function(i,n){var s;if(i===r&&n===r)return e;if(i!==r&&(s=i),n!==r){if(s===r)return n;"string"==typeof i||"string"==typeof n?(i=on(i),n=on(n)):(i=an(i),n=an(n)),s=t(i,n)}return s}}function qn(t){return ts((function(e){return e=Re(e,Ze(as())),Gi((function(r){var i=this;return t(e,(function(t){return Te(t,i,r)}))}))}))}function Hn(t,e){var i=(e=e===r?" ":on(e)).length;if(i<2)return i?Yi(e,t):e;var n=Yi(e,pe(t/ur(e)));return nr(e)?xn(cr(n),0,t).join(""):n.slice(0,t)}function zn(t){return function(e,i,n){return n&&"number"!=typeof n&&ys(e,i,n)&&(i=n=r),e=fo(e),i===r?(i=e,e=0):i=fo(i),function(t,e,r,i){for(var n=-1,s=mr(pe((e-t)/(r||1)),0),a=nt(s);s--;)a[i?s:++n]=t,t+=r;return a}(e,i,n=n===r?e<i?1:-1:fo(n),t)}}function jn(t){return function(e,r){return"string"==typeof e&&"string"==typeof r||(e=yo(e),r=yo(r)),t(e,r)}}function Wn(t,e,i,n,s,o,h,u,c,l){var d=8&e;e|=d?a:64,4&(e&=~(d?64:a))||(e&=-4);var p=[t,e,s,d?o:r,d?h:r,d?r:o,d?r:h,u,c,l],f=i.apply(r,p);return xs(t)&&Ns(f,p),f.placeholder=n,Os(f,t,e)}function Yn(t){var e=Tt[t];return function(t,r){if(t=yo(t),(r=null==r?0:gr(mo(r),292))&&Pe(t)){var i=(xo(t)+"e").split("e");return+((i=(xo(e(i[0]+"e"+(+i[1]+r)))+"e").split("e"))[0]+"e"+(+i[1]-r))}return e(t)}}var Gn=Tr&&1/hr(new Tr([,-0]))[1]==u?function(t){return new Tr(t)}:uh;function Xn(t){return function(e){var r=ds(e);return r==w?sr(e):r==N?function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=[t,t]})),r}(e):function(t,e){return Re(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Qn(t,e,n,u,c,l,d,p){var f=2&e;if(!f&&"function"!=typeof t)throw new Ct(i);var m=u?u.length:0;if(m||(e&=-97,u=c=r),d=d===r?d:mr(mo(d),0),p=p===r?p:mo(p),m-=c?c.length:0,64&e){var g=u,y=c;u=c=r}var v=f?r:is(t),x=[t,e,n,u,c,g,y,l,d,p];if(v&&function(t,e){var r=t[1],i=e[1],n=r|i,a=n<131,u=i==o&&8==r||i==o&&r==h&&t[7].length<=e[8]||384==i&&e[7].length<=e[8]&&8==r;if(!a&&!u)return t;1&i&&(t[2]=e[2],n|=1&r?0:4);var c=e[3];if(c){var l=t[3];t[3]=l?Sn(l,c,e[4]):c,t[4]=l?or(t[3],s):e[4]}(c=e[5])&&(l=t[5],t[5]=l?An(l,c,e[6]):c,t[6]=l?or(t[5],s):e[6]),(c=e[7])&&(t[7]=c),i&o&&(t[8]=null==t[8]?e[8]:gr(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=n}(x,v),t=x[0],e=x[1],n=x[2],u=x[3],c=x[4],!(p=x[9]=x[9]===r?f?0:t.length:mr(x[9]-m,0))&&24&e&&(e&=-25),e&&1!=e)_=8==e||16==e?function(t,e,i){var n=Bn(t);return function s(){for(var a=arguments.length,o=nt(a),h=a,u=ss(s);h--;)o[h]=arguments[h];var c=a<3&&o[0]!==u&&o[a-1]!==u?[]:or(o,u);return(a-=c.length)<i?Wn(t,e,Un,s.placeholder,r,o,c,r,r,i-a):Te(this&&this!==de&&this instanceof s?n:t,this,o)}}(t,e,p):e!=a&&33!=e||c.length?Un.apply(r,x):function(t,e,r,i){var n=1&e,s=Bn(t);return function e(){for(var a=-1,o=arguments.length,h=-1,u=i.length,c=nt(u+o),l=this&&this!==de&&this instanceof e?s:t;++h<u;)c[h]=i[h];for(;o--;)c[h++]=arguments[++a];return Te(l,n?r:this,c)}}(t,e,n,u);else var _=function(t,e,r){var i=1&e,n=Bn(t);return function e(){return(this&&this!==de&&this instanceof e?n:t).apply(i?r:this,arguments)}}(t,e,n);return Os((v?$i:Ns)(_,x),t,e)}function Zn(t,e,i,n){return t===r||Fa(t,It[i])&&!Lt.call(n,i)?e:t}function $n(t,e,i,n,s,a){return to(t)&&to(e)&&(a.set(e,t),Vi(t,e,r,$n,a),a.delete(e)),t}function Kn(t){return no(t)?r:t}function Jn(t,e,i,n,s,a){var o=1&i,h=t.length,u=e.length;if(h!=u&&!(o&&u>h))return!1;var c=a.get(t),l=a.get(e);if(c&&l)return c==e&&l==t;var d=-1,p=!0,f=2&i?new Wr:r;for(a.set(t,e),a.set(e,t);++d<h;){var m=t[d],g=e[d];if(n)var y=o?n(g,m,d,e,t,a):n(m,g,d,t,e,a);if(y!==r){if(y)continue;p=!1;break}if(f){if(!ke(e,(function(t,e){if(!Ke(f,e)&&(m===t||s(m,t,i,n,a)))return f.push(e)}))){p=!1;break}}else if(m!==g&&!s(m,g,i,n,a)){p=!1;break}}return a.delete(t),a.delete(e),p}function ts(t){return Ms(Ts(t,r,Ws),t+"")}function es(t){return bi(t,Ro,cs)}function rs(t){return bi(t,Do,ls)}var is=Nr?function(t){return Nr.get(t)}:uh;function ns(t){for(var e=t.name+"",r=Cr[e],i=Lt.call(Cr,e)?r.length:0;i--;){var n=r[i],s=n.func;if(null==s||s==t)return n.name}return e}function ss(t){return(Lt.call(Pr,"placeholder")?Pr:t).placeholder}function as(){var t=Pr.iteratee||sh;return t=t===sh?Ri:t,arguments.length?t(arguments[0],arguments[1]):t}function os(t,e){var r,i,n=t.__data__;return("string"==(i=typeof(r=e))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==r:null===r)?n["string"==typeof e?"string":"hash"]:n.map}function hs(t){for(var e=Ro(t),r=e.length;r--;){var i=e[r],n=t[i];e[r]=[i,n,ws(n)]}return e}function us(t,e){var i=function(t,e){return null==t?r:t[e]}(t,e);return Ii(i)?i:r}var cs=ge?function(t){return null==t?[]:(t=St(t),Me(ge(t),(function(e){return Gt.call(t,e)})))}:gh,ls=ge?function(t){for(var e=[];t;)De(e,cs(t)),t=Wt(t);return e}:gh,ds=wi;function ps(t,e,r){for(var i=-1,n=(e=yn(e,t)).length,s=!1;++i<n;){var a=Ps(e[i]);if(!(s=null!=t&&r(t,a)))break;t=t[a]}return s||++i!=n?s:!!(n=null==t?0:t.length)&&Ja(n)&&gs(a,n)&&(ja(t)||za(t))}function fs(t){return"function"!=typeof t.constructor||bs(t)?{}:Ur(Wt(t))}function ms(t){return ja(t)||za(t)||!!(Qt&&t&&t[Qt])}function gs(t,e){var r=typeof t;return!!(e=null==e?l:e)&&("number"==r||"symbol"!=r&&yt.test(t))&&t>-1&&t%1==0&&t<e}function ys(t,e,r){if(!to(r))return!1;var i=typeof e;return!!("number"==i?Ya(r)&&gs(e,r.length):"string"==i&&e in r)&&Fa(r[e],t)}function vs(t,e){if(ja(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!ho(t))||J.test(t)||!K.test(t)||null!=e&&t in St(e)}function xs(t){var e=ns(t),r=Pr[e];if("function"!=typeof r||!(e in qr.prototype))return!1;if(t===r)return!0;var i=is(r);return!!i&&t===i[0]}(br&&ds(new br(new ArrayBuffer(1)))!=R||wr&&ds(new wr)!=w||Er&&ds(Er.resolve())!=S||Tr&&ds(new Tr)!=N||Sr&&ds(new Sr)!=O)&&(ds=function(t){var e=wi(t),i=e==T?t.constructor:r,n=i?Us(i):"";if(n)switch(n){case Mr:return R;case Or:return w;case Ir:return S;case Rr:return N;case Dr:return O}return e});var _s=Rt?$a:yh;function bs(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||It)}function ws(t){return t==t&&!to(t)}function Es(t,e){return function(i){return null!=i&&i[t]===e&&(e!==r||t in St(i))}}function Ts(t,e,i){return e=mr(e===r?t.length-1:e,0),function(){for(var r=arguments,n=-1,s=mr(r.length-e,0),a=nt(s);++n<s;)a[n]=r[e+n];n=-1;for(var o=nt(e+1);++n<e;)o[n]=r[n];return o[e]=i(a),Te(t,this,o)}}function Ss(t,e){return e.length<2?t:_i(t,tn(e,0,-1))}function As(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Ns=Is($i),Cs=le||function(t,e){return de.setTimeout(t,e)},Ms=Is(Ki);function Os(t,e,r){var i=e+"";return Ms(t,function(t,e){var r=e.length;if(!r)return t;var i=r-1;return e[i]=(r>1?"& ":"")+e[i],e=e.join(r>2?", ":" "),t.replace(st,"{\n/* [wrapped with "+e+"] */\n")}(i,function(t,e){return Ae(f,(function(r){var i="_."+r[0];e&r[1]&&!Oe(t,i)&&t.push(i)})),t.sort()}(function(t){var e=t.match(at);return e?e[1].split(ot):[]}(i),r)))}function Is(t){var e=0,i=0;return function(){var n=yr(),s=16-(n-i);if(i=n,s>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(r,arguments)}}function Rs(t,e){var i=-1,n=t.length,s=n-1;for(e=e===r?n:e;++i<e;){var a=Wi(i,s),o=t[a];t[a]=t[i],t[i]=o}return t.length=e,t}var Ds,Ls,Bs,ks=(Ds=function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(tt,(function(t,r,i,n){e.push(i?n.replace(ct,"$1"):r||t)})),e},Ls=La(Ds,(function(t){return 500===Bs.size&&Bs.clear(),t})),Bs=Ls.cache,Ls);function Ps(t){if("string"==typeof t||ho(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Us(t){if(null!=t){try{return Dt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Vs(t){if(t instanceof qr)return t.clone();var e=new Fr(t.__wrapped__,t.__chain__);return e.__actions__=Nn(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Fs=Gi((function(t,e){return Ga(t)?hi(t,fi(e,1,Ga,!0)):[]})),qs=Gi((function(t,e){var i=Zs(e);return Ga(i)&&(i=r),Ga(t)?hi(t,fi(e,1,Ga,!0),as(i,2)):[]})),Hs=Gi((function(t,e){var i=Zs(e);return Ga(i)&&(i=r),Ga(t)?hi(t,fi(e,1,Ga,!0),r,i):[]}));function zs(t,e,r){var i=null==t?0:t.length;if(!i)return-1;var n=null==r?0:mo(r);return n<0&&(n=mr(i+n,0)),Ve(t,as(e,3),n)}function js(t,e,i){var n=null==t?0:t.length;if(!n)return-1;var s=n-1;return i!==r&&(s=mo(i),s=i<0?mr(n+s,0):gr(s,n-1)),Ve(t,as(e,3),s,!0)}function Ws(t){return null!=t&&t.length?fi(t,1):[]}function Ys(t){return t&&t.length?t[0]:r}var Gs=Gi((function(t){var e=Re(t,mn);return e.length&&e[0]===t[0]?Ai(e):[]})),Xs=Gi((function(t){var e=Zs(t),i=Re(t,mn);return e===Zs(i)?e=r:i.pop(),i.length&&i[0]===t[0]?Ai(i,as(e,2)):[]})),Qs=Gi((function(t){var e=Zs(t),i=Re(t,mn);return(e="function"==typeof e?e:r)&&i.pop(),i.length&&i[0]===t[0]?Ai(i,r,e):[]}));function Zs(t){var e=null==t?0:t.length;return e?t[e-1]:r}var $s=Gi(Ks);function Ks(t,e){return t&&t.length&&e&&e.length?zi(t,e):t}var Js=ts((function(t,e){var r=null==t?0:t.length,i=ii(t,e);return ji(t,Re(e,(function(t){return gs(t,r)?+t:t})).sort(Tn)),i}));function ta(t){return null==t?t:_r.call(t)}var ea=Gi((function(t){return hn(fi(t,1,Ga,!0))})),ra=Gi((function(t){var e=Zs(t);return Ga(e)&&(e=r),hn(fi(t,1,Ga,!0),as(e,2))})),ia=Gi((function(t){var e=Zs(t);return e="function"==typeof e?e:r,hn(fi(t,1,Ga,!0),r,e)}));function na(t){if(!t||!t.length)return[];var e=0;return t=Me(t,(function(t){if(Ga(t))return e=mr(t.length,e),!0})),Xe(e,(function(e){return Re(t,je(e))}))}function sa(t,e){if(!t||!t.length)return[];var i=na(t);return null==e?i:Re(i,(function(t){return Te(e,r,t)}))}var aa=Gi((function(t,e){return Ga(t)?hi(t,e):[]})),oa=Gi((function(t){return pn(Me(t,Ga))})),ha=Gi((function(t){var e=Zs(t);return Ga(e)&&(e=r),pn(Me(t,Ga),as(e,2))})),ua=Gi((function(t){var e=Zs(t);return e="function"==typeof e?e:r,pn(Me(t,Ga),r,e)})),ca=Gi(na),la=Gi((function(t){var e=t.length,i=e>1?t[e-1]:r;return i="function"==typeof i?(t.pop(),i):r,sa(t,i)}));function da(t){var e=Pr(t);return e.__chain__=!0,e}function pa(t,e){return e(t)}var fa=ts((function(t){var e=t.length,i=e?t[0]:0,n=this.__wrapped__,s=function(e){return ii(e,t)};return!(e>1||this.__actions__.length)&&n instanceof qr&&gs(i)?((n=n.slice(i,+i+(e?1:0))).__actions__.push({func:pa,args:[s],thisArg:r}),new Fr(n,this.__chain__).thru((function(t){return e&&!t.length&&t.push(r),t}))):this.thru(s)})),ma=Mn((function(t,e,r){Lt.call(t,r)?++t[r]:ri(t,r,1)})),ga=kn(zs),ya=kn(js);function va(t,e){return(ja(t)?Ae:ui)(t,as(e,3))}function xa(t,e){return(ja(t)?Ne:ci)(t,as(e,3))}var _a=Mn((function(t,e,r){Lt.call(t,r)?t[r].push(e):ri(t,r,[e])})),ba=Gi((function(t,e,r){var i=-1,n="function"==typeof e,s=Ya(t)?nt(t.length):[];return ui(t,(function(t){s[++i]=n?Te(e,t,r):Ni(t,e,r)})),s})),wa=Mn((function(t,e,r){ri(t,r,e)}));function Ea(t,e){return(ja(t)?Re:ki)(t,as(e,3))}var Ta=Mn((function(t,e,r){t[r?0:1].push(e)}),(function(){return[[],[]]})),Sa=Gi((function(t,e){if(null==t)return[];var r=e.length;return r>1&&ys(t,e[0],e[1])?e=[]:r>2&&ys(e[0],e[1],e[2])&&(e=[e[0]]),qi(t,fi(e,1),[])})),Aa=ce||function(){return de.Date.now()};function Na(t,e,i){return e=i?r:e,e=t&&null==e?t.length:e,Qn(t,o,r,r,r,r,e)}function Ca(t,e){var n;if("function"!=typeof e)throw new Ct(i);return t=mo(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=r),n}}var Ma=Gi((function(t,e,r){var i=1;if(r.length){var n=or(r,ss(Ma));i|=a}return Qn(t,i,e,r,n)})),Oa=Gi((function(t,e,r){var i=3;if(r.length){var n=or(r,ss(Oa));i|=a}return Qn(e,i,t,r,n)}));function Ia(t,e,n){var s,a,o,h,u,c,l=0,d=!1,p=!1,f=!0;if("function"!=typeof t)throw new Ct(i);function m(e){var i=s,n=a;return s=a=r,l=e,h=t.apply(n,i)}function g(t){var i=t-c;return c===r||i>=e||i<0||p&&t-l>=o}function y(){var t=Aa();if(g(t))return v(t);u=Cs(y,function(t){var r=e-(t-c);return p?gr(r,o-(t-l)):r}(t))}function v(t){return u=r,f&&s?m(t):(s=a=r,h)}function x(){var t=Aa(),i=g(t);if(s=arguments,a=this,c=t,i){if(u===r)return function(t){return l=t,u=Cs(y,e),d?m(t):h}(c);if(p)return _n(u),u=Cs(y,e),m(c)}return u===r&&(u=Cs(y,e)),h}return e=yo(e)||0,to(n)&&(d=!!n.leading,o=(p="maxWait"in n)?mr(yo(n.maxWait)||0,e):o,f="trailing"in n?!!n.trailing:f),x.cancel=function(){u!==r&&_n(u),l=0,s=c=a=u=r},x.flush=function(){return u===r?h:v(Aa())},x}var Ra=Gi((function(t,e){return oi(t,1,e)})),Da=Gi((function(t,e,r){return oi(t,yo(e)||0,r)}));function La(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new Ct(i);var r=function(){var i=arguments,n=e?e.apply(this,i):i[0],s=r.cache;if(s.has(n))return s.get(n);var a=t.apply(this,i);return r.cache=s.set(n,a)||s,a};return r.cache=new(La.Cache||jr),r}function Ba(t){if("function"!=typeof t)throw new Ct(i);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}La.Cache=jr;var ka=vn((function(t,e){var r=(e=1==e.length&&ja(e[0])?Re(e[0],Ze(as())):Re(fi(e,1),Ze(as()))).length;return Gi((function(i){for(var n=-1,s=gr(i.length,r);++n<s;)i[n]=e[n].call(this,i[n]);return Te(t,this,i)}))})),Pa=Gi((function(t,e){var i=or(e,ss(Pa));return Qn(t,a,r,e,i)})),Ua=Gi((function(t,e){var i=or(e,ss(Ua));return Qn(t,64,r,e,i)})),Va=ts((function(t,e){return Qn(t,h,r,r,r,e)}));function Fa(t,e){return t===e||t!=t&&e!=e}var qa=jn(Ei),Ha=jn((function(t,e){return t>=e})),za=Ci(function(){return arguments}())?Ci:function(t){return eo(t)&&Lt.call(t,"callee")&&!Gt.call(t,"callee")},ja=nt.isArray,Wa=ve?Ze(ve):function(t){return eo(t)&&wi(t)==I};function Ya(t){return null!=t&&Ja(t.length)&&!$a(t)}function Ga(t){return eo(t)&&Ya(t)}var Xa=ye||yh,Qa=xe?Ze(xe):function(t){return eo(t)&&wi(t)==v};function Za(t){if(!eo(t))return!1;var e=wi(t);return e==x||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!no(t)}function $a(t){if(!to(t))return!1;var e=wi(t);return e==_||e==b||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Ka(t){return"number"==typeof t&&t==mo(t)}function Ja(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=l}function to(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function eo(t){return null!=t&&"object"==typeof t}var ro=_e?Ze(_e):function(t){return eo(t)&&ds(t)==w};function io(t){return"number"==typeof t||eo(t)&&wi(t)==E}function no(t){if(!eo(t)||wi(t)!=T)return!1;var e=Wt(t);if(null===e)return!0;var r=Lt.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&Dt.call(r)==Ut}var so=be?Ze(be):function(t){return eo(t)&&wi(t)==A},ao=we?Ze(we):function(t){return eo(t)&&ds(t)==N};function oo(t){return"string"==typeof t||!ja(t)&&eo(t)&&wi(t)==C}function ho(t){return"symbol"==typeof t||eo(t)&&wi(t)==M}var uo=Ee?Ze(Ee):function(t){return eo(t)&&Ja(t.length)&&!!se[wi(t)]},co=jn(Bi),lo=jn((function(t,e){return t<=e}));function po(t){if(!t)return[];if(Ya(t))return oo(t)?cr(t):Nn(t);if(Zt&&t[Zt])return function(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}(t[Zt]());var e=ds(t);return(e==w?sr:e==N?hr:qo)(t)}function fo(t){return t?(t=yo(t))===u||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function mo(t){var e=fo(t),r=e%1;return e==e?r?e-r:e:0}function go(t){return t?ni(mo(t),0,p):0}function yo(t){if("number"==typeof t)return t;if(ho(t))return d;if(to(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=to(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Qe(t);var r=ft.test(t);return r||gt.test(t)?ue(t.slice(2),r?2:8):pt.test(t)?d:+t}function vo(t){return Cn(t,Do(t))}function xo(t){return null==t?"":on(t)}var _o=On((function(t,e){if(bs(e)||Ya(e))Cn(e,Ro(e),t);else for(var r in e)Lt.call(e,r)&&Kr(t,r,e[r])})),bo=On((function(t,e){Cn(e,Do(e),t)})),wo=On((function(t,e,r,i){Cn(e,Do(e),t,i)})),Eo=On((function(t,e,r,i){Cn(e,Ro(e),t,i)})),To=ts(ii),So=Gi((function(t,e){t=St(t);var i=-1,n=e.length,s=n>2?e[2]:r;for(s&&ys(e[0],e[1],s)&&(n=1);++i<n;)for(var a=e[i],o=Do(a),h=-1,u=o.length;++h<u;){var c=o[h],l=t[c];(l===r||Fa(l,It[c])&&!Lt.call(t,c))&&(t[c]=a[c])}return t})),Ao=Gi((function(t){return t.push(r,$n),Te(Bo,r,t)}));function No(t,e,i){var n=null==t?r:_i(t,e);return n===r?i:n}function Co(t,e){return null!=t&&ps(t,e,Si)}var Mo=Vn((function(t,e,r){null!=e&&"function"!=typeof e.toString&&(e=Pt.call(e)),t[e]=r}),eh(nh)),Oo=Vn((function(t,e,r){null!=e&&"function"!=typeof e.toString&&(e=Pt.call(e)),Lt.call(t,e)?t[e].push(r):t[e]=[r]}),as),Io=Gi(Ni);function Ro(t){return Ya(t)?Gr(t):Di(t)}function Do(t){return Ya(t)?Gr(t,!0):Li(t)}var Lo=On((function(t,e,r){Vi(t,e,r)})),Bo=On((function(t,e,r,i){Vi(t,e,r,i)})),ko=ts((function(t,e){var r={};if(null==t)return r;var i=!1;e=Re(e,(function(e){return e=yn(e,t),i||(i=e.length>1),e})),Cn(t,rs(t),r),i&&(r=si(r,7,Kn));for(var n=e.length;n--;)un(r,e[n]);return r})),Po=ts((function(t,e){return null==t?{}:function(t,e){return Hi(t,e,(function(e,r){return Co(t,r)}))}(t,e)}));function Uo(t,e){if(null==t)return{};var r=Re(rs(t),(function(t){return[t]}));return e=as(e),Hi(t,r,(function(t,r){return e(t,r[0])}))}var Vo=Xn(Ro),Fo=Xn(Do);function qo(t){return null==t?[]:$e(t,Ro(t))}var Ho=Ln((function(t,e,r){return e=e.toLowerCase(),t+(r?zo(e):e)}));function zo(t){return $o(xo(t).toLowerCase())}function jo(t){return(t=xo(t))&&t.replace(vt,er).replace(Kt,"")}var Wo=Ln((function(t,e,r){return t+(r?"-":"")+e.toLowerCase()})),Yo=Ln((function(t,e,r){return t+(r?" ":"")+e.toLowerCase()})),Go=Dn("toLowerCase"),Xo=Ln((function(t,e,r){return t+(r?"_":"")+e.toLowerCase()})),Qo=Ln((function(t,e,r){return t+(r?" ":"")+$o(e)})),Zo=Ln((function(t,e,r){return t+(r?" ":"")+e.toUpperCase()})),$o=Dn("toUpperCase");function Ko(t,e,i){return t=xo(t),(e=i?r:e)===r?function(t){return re.test(t)}(t)?function(t){return t.match(te)||[]}(t):function(t){return t.match(ht)||[]}(t):t.match(e)||[]}var Jo=Gi((function(t,e){try{return Te(t,r,e)}catch(t){return Za(t)?t:new wt(t)}})),th=ts((function(t,e){return Ae(e,(function(e){e=Ps(e),ri(t,e,Ma(t[e],t))})),t}));function eh(t){return function(){return t}}var rh=Pn(),ih=Pn(!0);function nh(t){return t}function sh(t){return Ri("function"==typeof t?t:si(t,1))}var ah=Gi((function(t,e){return function(r){return Ni(r,t,e)}})),oh=Gi((function(t,e){return function(r){return Ni(t,r,e)}}));function hh(t,e,r){var i=Ro(e),n=xi(e,i);null!=r||to(e)&&(n.length||!i.length)||(r=e,e=t,t=this,n=xi(e,Ro(e)));var s=!(to(r)&&"chain"in r&&!r.chain),a=$a(t);return Ae(n,(function(r){var i=e[r];t[r]=i,a&&(t.prototype[r]=function(){var e=this.__chain__;if(s||e){var r=t(this.__wrapped__);return(r.__actions__=Nn(this.__actions__)).push({func:i,args:arguments,thisArg:t}),r.__chain__=e,r}return i.apply(t,De([this.value()],arguments))})})),t}function uh(){}var ch=qn(Re),lh=qn(Ce),dh=qn(ke);function ph(t){return vs(t)?je(Ps(t)):function(t){return function(e){return _i(e,t)}}(t)}var fh=zn(),mh=zn(!0);function gh(){return[]}function yh(){return!1}var vh,xh=Fn((function(t,e){return t+e}),0),_h=Yn("ceil"),bh=Fn((function(t,e){return t/e}),1),wh=Yn("floor"),Eh=Fn((function(t,e){return t*e}),1),Th=Yn("round"),Sh=Fn((function(t,e){return t-e}),0);return Pr.after=function(t,e){if("function"!=typeof e)throw new Ct(i);return t=mo(t),function(){if(--t<1)return e.apply(this,arguments)}},Pr.ary=Na,Pr.assign=_o,Pr.assignIn=bo,Pr.assignInWith=wo,Pr.assignWith=Eo,Pr.at=To,Pr.before=Ca,Pr.bind=Ma,Pr.bindAll=th,Pr.bindKey=Oa,Pr.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return ja(t)?t:[t]},Pr.chain=da,Pr.chunk=function(t,e,i){e=(i?ys(t,e,i):e===r)?1:mr(mo(e),0);var n=null==t?0:t.length;if(!n||e<1)return[];for(var s=0,a=0,o=nt(pe(n/e));s<n;)o[a++]=tn(t,s,s+=e);return o},Pr.compact=function(t){for(var e=-1,r=null==t?0:t.length,i=0,n=[];++e<r;){var s=t[e];s&&(n[i++]=s)}return n},Pr.concat=function(){var t=arguments.length;if(!t)return[];for(var e=nt(t-1),r=arguments[0],i=t;i--;)e[i-1]=arguments[i];return De(ja(r)?Nn(r):[r],fi(e,1))},Pr.cond=function(t){var e=null==t?0:t.length,r=as();return t=e?Re(t,(function(t){if("function"!=typeof t[1])throw new Ct(i);return[r(t[0]),t[1]]})):[],Gi((function(r){for(var i=-1;++i<e;){var n=t[i];if(Te(n[0],this,r))return Te(n[1],this,r)}}))},Pr.conforms=function(t){return function(t){var e=Ro(t);return function(r){return ai(r,t,e)}}(si(t,1))},Pr.constant=eh,Pr.countBy=ma,Pr.create=function(t,e){var r=Ur(t);return null==e?r:ei(r,e)},Pr.curry=function t(e,i,n){var s=Qn(e,8,r,r,r,r,r,i=n?r:i);return s.placeholder=t.placeholder,s},Pr.curryRight=function t(e,i,n){var s=Qn(e,16,r,r,r,r,r,i=n?r:i);return s.placeholder=t.placeholder,s},Pr.debounce=Ia,Pr.defaults=So,Pr.defaultsDeep=Ao,Pr.defer=Ra,Pr.delay=Da,Pr.difference=Fs,Pr.differenceBy=qs,Pr.differenceWith=Hs,Pr.drop=function(t,e,i){var n=null==t?0:t.length;return n?tn(t,(e=i||e===r?1:mo(e))<0?0:e,n):[]},Pr.dropRight=function(t,e,i){var n=null==t?0:t.length;return n?tn(t,0,(e=n-(e=i||e===r?1:mo(e)))<0?0:e):[]},Pr.dropRightWhile=function(t,e){return t&&t.length?ln(t,as(e,3),!0,!0):[]},Pr.dropWhile=function(t,e){return t&&t.length?ln(t,as(e,3),!0):[]},Pr.fill=function(t,e,i,n){var s=null==t?0:t.length;return s?(i&&"number"!=typeof i&&ys(t,e,i)&&(i=0,n=s),function(t,e,i,n){var s=t.length;for((i=mo(i))<0&&(i=-i>s?0:s+i),(n=n===r||n>s?s:mo(n))<0&&(n+=s),n=i>n?0:go(n);i<n;)t[i++]=e;return t}(t,e,i,n)):[]},Pr.filter=function(t,e){return(ja(t)?Me:pi)(t,as(e,3))},Pr.flatMap=function(t,e){return fi(Ea(t,e),1)},Pr.flatMapDeep=function(t,e){return fi(Ea(t,e),u)},Pr.flatMapDepth=function(t,e,i){return i=i===r?1:mo(i),fi(Ea(t,e),i)},Pr.flatten=Ws,Pr.flattenDeep=function(t){return null!=t&&t.length?fi(t,u):[]},Pr.flattenDepth=function(t,e){return null!=t&&t.length?fi(t,e=e===r?1:mo(e)):[]},Pr.flip=function(t){return Qn(t,512)},Pr.flow=rh,Pr.flowRight=ih,Pr.fromPairs=function(t){for(var e=-1,r=null==t?0:t.length,i={};++e<r;){var n=t[e];i[n[0]]=n[1]}return i},Pr.functions=function(t){return null==t?[]:xi(t,Ro(t))},Pr.functionsIn=function(t){return null==t?[]:xi(t,Do(t))},Pr.groupBy=_a,Pr.initial=function(t){return null!=t&&t.length?tn(t,0,-1):[]},Pr.intersection=Gs,Pr.intersectionBy=Xs,Pr.intersectionWith=Qs,Pr.invert=Mo,Pr.invertBy=Oo,Pr.invokeMap=ba,Pr.iteratee=sh,Pr.keyBy=wa,Pr.keys=Ro,Pr.keysIn=Do,Pr.map=Ea,Pr.mapKeys=function(t,e){var r={};return e=as(e,3),yi(t,(function(t,i,n){ri(r,e(t,i,n),t)})),r},Pr.mapValues=function(t,e){var r={};return e=as(e,3),yi(t,(function(t,i,n){ri(r,i,e(t,i,n))})),r},Pr.matches=function(t){return Pi(si(t,1))},Pr.matchesProperty=function(t,e){return Ui(t,si(e,1))},Pr.memoize=La,Pr.merge=Lo,Pr.mergeWith=Bo,Pr.method=ah,Pr.methodOf=oh,Pr.mixin=hh,Pr.negate=Ba,Pr.nthArg=function(t){return t=mo(t),Gi((function(e){return Fi(e,t)}))},Pr.omit=ko,Pr.omitBy=function(t,e){return Uo(t,Ba(as(e)))},Pr.once=function(t){return Ca(2,t)},Pr.orderBy=function(t,e,i,n){return null==t?[]:(ja(e)||(e=null==e?[]:[e]),ja(i=n?r:i)||(i=null==i?[]:[i]),qi(t,e,i))},Pr.over=ch,Pr.overArgs=ka,Pr.overEvery=lh,Pr.overSome=dh,Pr.partial=Pa,Pr.partialRight=Ua,Pr.partition=Ta,Pr.pick=Po,Pr.pickBy=Uo,Pr.property=ph,Pr.propertyOf=function(t){return function(e){return null==t?r:_i(t,e)}},Pr.pull=$s,Pr.pullAll=Ks,Pr.pullAllBy=function(t,e,r){return t&&t.length&&e&&e.length?zi(t,e,as(r,2)):t},Pr.pullAllWith=function(t,e,i){return t&&t.length&&e&&e.length?zi(t,e,r,i):t},Pr.pullAt=Js,Pr.range=fh,Pr.rangeRight=mh,Pr.rearg=Va,Pr.reject=function(t,e){return(ja(t)?Me:pi)(t,Ba(as(e,3)))},Pr.remove=function(t,e){var r=[];if(!t||!t.length)return r;var i=-1,n=[],s=t.length;for(e=as(e,3);++i<s;){var a=t[i];e(a,i,t)&&(r.push(a),n.push(i))}return ji(t,n),r},Pr.rest=function(t,e){if("function"!=typeof t)throw new Ct(i);return Gi(t,e=e===r?e:mo(e))},Pr.reverse=ta,Pr.sampleSize=function(t,e,i){return e=(i?ys(t,e,i):e===r)?1:mo(e),(ja(t)?Qr:Qi)(t,e)},Pr.set=function(t,e,r){return null==t?t:Zi(t,e,r)},Pr.setWith=function(t,e,i,n){return n="function"==typeof n?n:r,null==t?t:Zi(t,e,i,n)},Pr.shuffle=function(t){return(ja(t)?Zr:Ji)(t)},Pr.slice=function(t,e,i){var n=null==t?0:t.length;return n?(i&&"number"!=typeof i&&ys(t,e,i)?(e=0,i=n):(e=null==e?0:mo(e),i=i===r?n:mo(i)),tn(t,e,i)):[]},Pr.sortBy=Sa,Pr.sortedUniq=function(t){return t&&t.length?sn(t):[]},Pr.sortedUniqBy=function(t,e){return t&&t.length?sn(t,as(e,2)):[]},Pr.split=function(t,e,i){return i&&"number"!=typeof i&&ys(t,e,i)&&(e=i=r),(i=i===r?p:i>>>0)?(t=xo(t))&&("string"==typeof e||null!=e&&!so(e))&&!(e=on(e))&&nr(t)?xn(cr(t),0,i):t.split(e,i):[]},Pr.spread=function(t,e){if("function"!=typeof t)throw new Ct(i);return e=null==e?0:mr(mo(e),0),Gi((function(r){var i=r[e],n=xn(r,0,e);return i&&De(n,i),Te(t,this,n)}))},Pr.tail=function(t){var e=null==t?0:t.length;return e?tn(t,1,e):[]},Pr.take=function(t,e,i){return t&&t.length?tn(t,0,(e=i||e===r?1:mo(e))<0?0:e):[]},Pr.takeRight=function(t,e,i){var n=null==t?0:t.length;return n?tn(t,(e=n-(e=i||e===r?1:mo(e)))<0?0:e,n):[]},Pr.takeRightWhile=function(t,e){return t&&t.length?ln(t,as(e,3),!1,!0):[]},Pr.takeWhile=function(t,e){return t&&t.length?ln(t,as(e,3)):[]},Pr.tap=function(t,e){return e(t),t},Pr.throttle=function(t,e,r){var n=!0,s=!0;if("function"!=typeof t)throw new Ct(i);return to(r)&&(n="leading"in r?!!r.leading:n,s="trailing"in r?!!r.trailing:s),Ia(t,e,{leading:n,maxWait:e,trailing:s})},Pr.thru=pa,Pr.toArray=po,Pr.toPairs=Vo,Pr.toPairsIn=Fo,Pr.toPath=function(t){return ja(t)?Re(t,Ps):ho(t)?[t]:Nn(ks(xo(t)))},Pr.toPlainObject=vo,Pr.transform=function(t,e,r){var i=ja(t),n=i||Xa(t)||uo(t);if(e=as(e,4),null==r){var s=t&&t.constructor;r=n?i?new s:[]:to(t)&&$a(s)?Ur(Wt(t)):{}}return(n?Ae:yi)(t,(function(t,i,n){return e(r,t,i,n)})),r},Pr.unary=function(t){return Na(t,1)},Pr.union=ea,Pr.unionBy=ra,Pr.unionWith=ia,Pr.uniq=function(t){return t&&t.length?hn(t):[]},Pr.uniqBy=function(t,e){return t&&t.length?hn(t,as(e,2)):[]},Pr.uniqWith=function(t,e){return e="function"==typeof e?e:r,t&&t.length?hn(t,r,e):[]},Pr.unset=function(t,e){return null==t||un(t,e)},Pr.unzip=na,Pr.unzipWith=sa,Pr.update=function(t,e,r){return null==t?t:cn(t,e,gn(r))},Pr.updateWith=function(t,e,i,n){return n="function"==typeof n?n:r,null==t?t:cn(t,e,gn(i),n)},Pr.values=qo,Pr.valuesIn=function(t){return null==t?[]:$e(t,Do(t))},Pr.without=aa,Pr.words=Ko,Pr.wrap=function(t,e){return Pa(gn(e),t)},Pr.xor=oa,Pr.xorBy=ha,Pr.xorWith=ua,Pr.zip=ca,Pr.zipObject=function(t,e){return fn(t||[],e||[],Kr)},Pr.zipObjectDeep=function(t,e){return fn(t||[],e||[],Zi)},Pr.zipWith=la,Pr.entries=Vo,Pr.entriesIn=Fo,Pr.extend=bo,Pr.extendWith=wo,hh(Pr,Pr),Pr.add=xh,Pr.attempt=Jo,Pr.camelCase=Ho,Pr.capitalize=zo,Pr.ceil=_h,Pr.clamp=function(t,e,i){return i===r&&(i=e,e=r),i!==r&&(i=(i=yo(i))==i?i:0),e!==r&&(e=(e=yo(e))==e?e:0),ni(yo(t),e,i)},Pr.clone=function(t){return si(t,4)},Pr.cloneDeep=function(t){return si(t,5)},Pr.cloneDeepWith=function(t,e){return si(t,5,e="function"==typeof e?e:r)},Pr.cloneWith=function(t,e){return si(t,4,e="function"==typeof e?e:r)},Pr.conformsTo=function(t,e){return null==e||ai(t,e,Ro(e))},Pr.deburr=jo,Pr.defaultTo=function(t,e){return null==t||t!=t?e:t},Pr.divide=bh,Pr.endsWith=function(t,e,i){t=xo(t),e=on(e);var n=t.length,s=i=i===r?n:ni(mo(i),0,n);return(i-=e.length)>=0&&t.slice(i,s)==e},Pr.eq=Fa,Pr.escape=function(t){return(t=xo(t))&&X.test(t)?t.replace(Y,rr):t},Pr.escapeRegExp=function(t){return(t=xo(t))&&rt.test(t)?t.replace(et,"\\$&"):t},Pr.every=function(t,e,i){var n=ja(t)?Ce:li;return i&&ys(t,e,i)&&(e=r),n(t,as(e,3))},Pr.find=ga,Pr.findIndex=zs,Pr.findKey=function(t,e){return Ue(t,as(e,3),yi)},Pr.findLast=ya,Pr.findLastIndex=js,Pr.findLastKey=function(t,e){return Ue(t,as(e,3),vi)},Pr.floor=wh,Pr.forEach=va,Pr.forEachRight=xa,Pr.forIn=function(t,e){return null==t?t:mi(t,as(e,3),Do)},Pr.forInRight=function(t,e){return null==t?t:gi(t,as(e,3),Do)},Pr.forOwn=function(t,e){return t&&yi(t,as(e,3))},Pr.forOwnRight=function(t,e){return t&&vi(t,as(e,3))},Pr.get=No,Pr.gt=qa,Pr.gte=Ha,Pr.has=function(t,e){return null!=t&&ps(t,e,Ti)},Pr.hasIn=Co,Pr.head=Ys,Pr.identity=nh,Pr.includes=function(t,e,r,i){t=Ya(t)?t:qo(t),r=r&&!i?mo(r):0;var n=t.length;return r<0&&(r=mr(n+r,0)),oo(t)?r<=n&&t.indexOf(e,r)>-1:!!n&&Fe(t,e,r)>-1},Pr.indexOf=function(t,e,r){var i=null==t?0:t.length;if(!i)return-1;var n=null==r?0:mo(r);return n<0&&(n=mr(i+n,0)),Fe(t,e,n)},Pr.inRange=function(t,e,i){return e=fo(e),i===r?(i=e,e=0):i=fo(i),function(t,e,r){return t>=gr(e,r)&&t<mr(e,r)}(t=yo(t),e,i)},Pr.invoke=Io,Pr.isArguments=za,Pr.isArray=ja,Pr.isArrayBuffer=Wa,Pr.isArrayLike=Ya,Pr.isArrayLikeObject=Ga,Pr.isBoolean=function(t){return!0===t||!1===t||eo(t)&&wi(t)==y},Pr.isBuffer=Xa,Pr.isDate=Qa,Pr.isElement=function(t){return eo(t)&&1===t.nodeType&&!no(t)},Pr.isEmpty=function(t){if(null==t)return!0;if(Ya(t)&&(ja(t)||"string"==typeof t||"function"==typeof t.splice||Xa(t)||uo(t)||za(t)))return!t.length;var e=ds(t);if(e==w||e==N)return!t.size;if(bs(t))return!Di(t).length;for(var r in t)if(Lt.call(t,r))return!1;return!0},Pr.isEqual=function(t,e){return Mi(t,e)},Pr.isEqualWith=function(t,e,i){var n=(i="function"==typeof i?i:r)?i(t,e):r;return n===r?Mi(t,e,r,i):!!n},Pr.isError=Za,Pr.isFinite=function(t){return"number"==typeof t&&Pe(t)},Pr.isFunction=$a,Pr.isInteger=Ka,Pr.isLength=Ja,Pr.isMap=ro,Pr.isMatch=function(t,e){return t===e||Oi(t,e,hs(e))},Pr.isMatchWith=function(t,e,i){return i="function"==typeof i?i:r,Oi(t,e,hs(e),i)},Pr.isNaN=function(t){return io(t)&&t!=+t},Pr.isNative=function(t){if(_s(t))throw new wt("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Ii(t)},Pr.isNil=function(t){return null==t},Pr.isNull=function(t){return null===t},Pr.isNumber=io,Pr.isObject=to,Pr.isObjectLike=eo,Pr.isPlainObject=no,Pr.isRegExp=so,Pr.isSafeInteger=function(t){return Ka(t)&&t>=-9007199254740991&&t<=l},Pr.isSet=ao,Pr.isString=oo,Pr.isSymbol=ho,Pr.isTypedArray=uo,Pr.isUndefined=function(t){return t===r},Pr.isWeakMap=function(t){return eo(t)&&ds(t)==O},Pr.isWeakSet=function(t){return eo(t)&&"[object WeakSet]"==wi(t)},Pr.join=function(t,e){return null==t?"":We.call(t,e)},Pr.kebabCase=Wo,Pr.last=Zs,Pr.lastIndexOf=function(t,e,i){var n=null==t?0:t.length;if(!n)return-1;var s=n;return i!==r&&(s=(s=mo(i))<0?mr(n+s,0):gr(s,n-1)),e==e?function(t,e,r){for(var i=r+1;i--;)if(t[i]===e)return i;return i}(t,e,s):Ve(t,He,s,!0)},Pr.lowerCase=Yo,Pr.lowerFirst=Go,Pr.lt=co,Pr.lte=lo,Pr.max=function(t){return t&&t.length?di(t,nh,Ei):r},Pr.maxBy=function(t,e){return t&&t.length?di(t,as(e,2),Ei):r},Pr.mean=function(t){return ze(t,nh)},Pr.meanBy=function(t,e){return ze(t,as(e,2))},Pr.min=function(t){return t&&t.length?di(t,nh,Bi):r},Pr.minBy=function(t,e){return t&&t.length?di(t,as(e,2),Bi):r},Pr.stubArray=gh,Pr.stubFalse=yh,Pr.stubObject=function(){return{}},Pr.stubString=function(){return""},Pr.stubTrue=function(){return!0},Pr.multiply=Eh,Pr.nth=function(t,e){return t&&t.length?Fi(t,mo(e)):r},Pr.noConflict=function(){return de._===this&&(de._=Vt),this},Pr.noop=uh,Pr.now=Aa,Pr.pad=function(t,e,r){t=xo(t);var i=(e=mo(e))?ur(t):0;if(!e||i>=e)return t;var n=(e-i)/2;return Hn(fe(n),r)+t+Hn(pe(n),r)},Pr.padEnd=function(t,e,r){t=xo(t);var i=(e=mo(e))?ur(t):0;return e&&i<e?t+Hn(e-i,r):t},Pr.padStart=function(t,e,r){t=xo(t);var i=(e=mo(e))?ur(t):0;return e&&i<e?Hn(e-i,r)+t:t},Pr.parseInt=function(t,e,r){return r||null==e?e=0:e&&(e=+e),vr(xo(t).replace(it,""),e||0)},Pr.random=function(t,e,i){if(i&&"boolean"!=typeof i&&ys(t,e,i)&&(e=i=r),i===r&&("boolean"==typeof e?(i=e,e=r):"boolean"==typeof t&&(i=t,t=r)),t===r&&e===r?(t=0,e=1):(t=fo(t),e===r?(e=t,t=0):e=fo(e)),t>e){var n=t;t=e,e=n}if(i||t%1||e%1){var s=xr();return gr(t+s*(e-t+he("1e-"+((s+"").length-1))),e)}return Wi(t,e)},Pr.reduce=function(t,e,r){var i=ja(t)?Le:Ye,n=arguments.length<3;return i(t,as(e,4),r,n,ui)},Pr.reduceRight=function(t,e,r){var i=ja(t)?Be:Ye,n=arguments.length<3;return i(t,as(e,4),r,n,ci)},Pr.repeat=function(t,e,i){return e=(i?ys(t,e,i):e===r)?1:mo(e),Yi(xo(t),e)},Pr.replace=function(){var t=arguments,e=xo(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Pr.result=function(t,e,i){var n=-1,s=(e=yn(e,t)).length;for(s||(s=1,t=r);++n<s;){var a=null==t?r:t[Ps(e[n])];a===r&&(n=s,a=i),t=$a(a)?a.call(t):a}return t},Pr.round=Th,Pr.runInContext=t,Pr.sample=function(t){return(ja(t)?Xr:Xi)(t)},Pr.size=function(t){if(null==t)return 0;if(Ya(t))return oo(t)?ur(t):t.length;var e=ds(t);return e==w||e==N?t.size:Di(t).length},Pr.snakeCase=Xo,Pr.some=function(t,e,i){var n=ja(t)?ke:en;return i&&ys(t,e,i)&&(e=r),n(t,as(e,3))},Pr.sortedIndex=function(t,e){return rn(t,e)},Pr.sortedIndexBy=function(t,e,r){return nn(t,e,as(r,2))},Pr.sortedIndexOf=function(t,e){var r=null==t?0:t.length;if(r){var i=rn(t,e);if(i<r&&Fa(t[i],e))return i}return-1},Pr.sortedLastIndex=function(t,e){return rn(t,e,!0)},Pr.sortedLastIndexBy=function(t,e,r){return nn(t,e,as(r,2),!0)},Pr.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var r=rn(t,e,!0)-1;if(Fa(t[r],e))return r}return-1},Pr.startCase=Qo,Pr.startsWith=function(t,e,r){return t=xo(t),r=null==r?0:ni(mo(r),0,t.length),e=on(e),t.slice(r,r+e.length)==e},Pr.subtract=Sh,Pr.sum=function(t){return t&&t.length?Ge(t,nh):0},Pr.sumBy=function(t,e){return t&&t.length?Ge(t,as(e,2)):0},Pr.template=function(t,e,i){var n=Pr.templateSettings;i&&ys(t,e,i)&&(e=r),t=xo(t),e=wo({},e,n,Zn);var s,a,o=wo({},e.imports,n.imports,Zn),h=Ro(o),u=$e(o,h),c=0,l=e.interpolate||xt,d="__p += '",p=At((e.escape||xt).source+"|"+l.source+"|"+(l===$?lt:xt).source+"|"+(e.evaluate||xt).source+"|$","g"),f="//# sourceURL="+(Lt.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ne+"]")+"\n";t.replace(p,(function(e,r,i,n,o,h){return i||(i=n),d+=t.slice(c,h).replace(_t,ir),r&&(s=!0,d+="' +\n__e("+r+") +\n'"),o&&(a=!0,d+="';\n"+o+";\n__p += '"),i&&(d+="' +\n((__t = ("+i+")) == null ? '' : __t) +\n'"),c=h+e.length,e})),d+="';\n";var m=Lt.call(e,"variable")&&e.variable;if(m){if(ut.test(m))throw new wt("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(a?d.replace(H,""):d).replace(z,"$1").replace(j,"$1;"),d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(s?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var g=Jo((function(){return Et(h,f+"return "+d).apply(r,u)}));if(g.source=d,Za(g))throw g;return g},Pr.times=function(t,e){if((t=mo(t))<1||t>l)return[];var r=p,i=gr(t,p);e=as(e),t-=p;for(var n=Xe(i,e);++r<t;)e(r);return n},Pr.toFinite=fo,Pr.toInteger=mo,Pr.toLength=go,Pr.toLower=function(t){return xo(t).toLowerCase()},Pr.toNumber=yo,Pr.toSafeInteger=function(t){return t?ni(mo(t),-9007199254740991,l):0===t?t:0},Pr.toString=xo,Pr.toUpper=function(t){return xo(t).toUpperCase()},Pr.trim=function(t,e,i){if((t=xo(t))&&(i||e===r))return Qe(t);if(!t||!(e=on(e)))return t;var n=cr(t),s=cr(e);return xn(n,Je(n,s),tr(n,s)+1).join("")},Pr.trimEnd=function(t,e,i){if((t=xo(t))&&(i||e===r))return t.slice(0,lr(t)+1);if(!t||!(e=on(e)))return t;var n=cr(t);return xn(n,0,tr(n,cr(e))+1).join("")},Pr.trimStart=function(t,e,i){if((t=xo(t))&&(i||e===r))return t.replace(it,"");if(!t||!(e=on(e)))return t;var n=cr(t);return xn(n,Je(n,cr(e))).join("")},Pr.truncate=function(t,e){var i=30,n="...";if(to(e)){var s="separator"in e?e.separator:s;i="length"in e?mo(e.length):i,n="omission"in e?on(e.omission):n}var a=(t=xo(t)).length;if(nr(t)){var o=cr(t);a=o.length}if(i>=a)return t;var h=i-ur(n);if(h<1)return n;var u=o?xn(o,0,h).join(""):t.slice(0,h);if(s===r)return u+n;if(o&&(h+=u.length-h),so(s)){if(t.slice(h).search(s)){var c,l=u;for(s.global||(s=At(s.source,xo(dt.exec(s))+"g")),s.lastIndex=0;c=s.exec(l);)var d=c.index;u=u.slice(0,d===r?h:d)}}else if(t.indexOf(on(s),h)!=h){var p=u.lastIndexOf(s);p>-1&&(u=u.slice(0,p))}return u+n},Pr.unescape=function(t){return(t=xo(t))&&G.test(t)?t.replace(W,dr):t},Pr.uniqueId=function(t){var e=++Bt;return xo(t)+e},Pr.upperCase=Zo,Pr.upperFirst=$o,Pr.each=va,Pr.eachRight=xa,Pr.first=Ys,hh(Pr,(vh={},yi(Pr,(function(t,e){Lt.call(Pr.prototype,e)||(vh[e]=t)})),vh),{chain:!1}),Pr.VERSION="4.17.21",Ae(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Pr[t].placeholder=Pr})),Ae(["drop","take"],(function(t,e){qr.prototype[t]=function(i){i=i===r?1:mr(mo(i),0);var n=this.__filtered__&&!e?new qr(this):this.clone();return n.__filtered__?n.__takeCount__=gr(i,n.__takeCount__):n.__views__.push({size:gr(i,p),type:t+(n.__dir__<0?"Right":"")}),n},qr.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),Ae(["filter","map","takeWhile"],(function(t,e){var r=e+1,i=1==r||3==r;qr.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:as(t,3),type:r}),e.__filtered__=e.__filtered__||i,e}})),Ae(["head","last"],(function(t,e){var r="take"+(e?"Right":"");qr.prototype[t]=function(){return this[r](1).value()[0]}})),Ae(["initial","tail"],(function(t,e){var r="drop"+(e?"":"Right");qr.prototype[t]=function(){return this.__filtered__?new qr(this):this[r](1)}})),qr.prototype.compact=function(){return this.filter(nh)},qr.prototype.find=function(t){return this.filter(t).head()},qr.prototype.findLast=function(t){return this.reverse().find(t)},qr.prototype.invokeMap=Gi((function(t,e){return"function"==typeof t?new qr(this):this.map((function(r){return Ni(r,t,e)}))})),qr.prototype.reject=function(t){return this.filter(Ba(as(t)))},qr.prototype.slice=function(t,e){t=mo(t);var i=this;return i.__filtered__&&(t>0||e<0)?new qr(i):(t<0?i=i.takeRight(-t):t&&(i=i.drop(t)),e!==r&&(i=(e=mo(e))<0?i.dropRight(-e):i.take(e-t)),i)},qr.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},qr.prototype.toArray=function(){return this.take(p)},yi(qr.prototype,(function(t,e){var i=/^(?:filter|find|map|reject)|While$/.test(e),n=/^(?:head|last)$/.test(e),s=Pr[n?"take"+("last"==e?"Right":""):e],a=n||/^find/.test(e);s&&(Pr.prototype[e]=function(){var e=this.__wrapped__,o=n?[1]:arguments,h=e instanceof qr,u=o[0],c=h||ja(e),l=function(t){var e=s.apply(Pr,De([t],o));return n&&d?e[0]:e};c&&i&&"function"==typeof u&&1!=u.length&&(h=c=!1);var d=this.__chain__,p=!!this.__actions__.length,f=a&&!d,m=h&&!p;if(!a&&c){e=m?e:new qr(this);var g=t.apply(e,o);return g.__actions__.push({func:pa,args:[l],thisArg:r}),new Fr(g,d)}return f&&m?t.apply(this,o):(g=this.thru(l),f?n?g.value()[0]:g.value():g)})})),Ae(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Mt[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",i=/^(?:pop|shift)$/.test(t);Pr.prototype[t]=function(){var t=arguments;if(i&&!this.__chain__){var n=this.value();return e.apply(ja(n)?n:[],t)}return this[r]((function(r){return e.apply(ja(r)?r:[],t)}))}})),yi(qr.prototype,(function(t,e){var r=Pr[e];if(r){var i=r.name+"";Lt.call(Cr,i)||(Cr[i]=[]),Cr[i].push({name:e,func:r})}})),Cr[Un(r,2).name]=[{name:"wrapper",func:r}],qr.prototype.clone=function(){var t=new qr(this.__wrapped__);return t.__actions__=Nn(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Nn(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Nn(this.__views__),t},qr.prototype.reverse=function(){if(this.__filtered__){var t=new qr(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},qr.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,r=ja(t),i=e<0,n=r?t.length:0,s=function(t,e,r){for(var i=-1,n=r.length;++i<n;){var s=r[i],a=s.size;switch(s.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=gr(e,t+a);break;case"takeRight":t=mr(t,e-a)}}return{start:t,end:e}}(0,n,this.__views__),a=s.start,o=s.end,h=o-a,u=i?o:a-1,c=this.__iteratees__,l=c.length,d=0,p=gr(h,this.__takeCount__);if(!r||!i&&n==h&&p==h)return dn(t,this.__actions__);var f=[];t:for(;h--&&d<p;){for(var m=-1,g=t[u+=e];++m<l;){var y=c[m],v=y.iteratee,x=y.type,_=v(g);if(2==x)g=_;else if(!_){if(1==x)continue t;break t}}f[d++]=g}return f},Pr.prototype.at=fa,Pr.prototype.chain=function(){return da(this)},Pr.prototype.commit=function(){return new Fr(this.value(),this.__chain__)},Pr.prototype.next=function(){this.__values__===r&&(this.__values__=po(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?r:this.__values__[this.__index__++]}},Pr.prototype.plant=function(t){for(var e,i=this;i instanceof Vr;){var n=Vs(i);n.__index__=0,n.__values__=r,e?s.__wrapped__=n:e=n;var s=n;i=i.__wrapped__}return s.__wrapped__=t,e},Pr.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof qr){var e=t;return this.__actions__.length&&(e=new qr(this)),(e=e.reverse()).__actions__.push({func:pa,args:[ta],thisArg:r}),new Fr(e,this.__chain__)}return this.thru(ta)},Pr.prototype.toJSON=Pr.prototype.valueOf=Pr.prototype.value=function(){return dn(this.__wrapped__,this.__actions__)},Pr.prototype.first=Pr.prototype.head,Zt&&(Pr.prototype[Zt]=function(){return this}),Pr}();fe?((fe.exports=pr)._=pr,pe._=pr):de._=pr}).call(c)}(Re,Re.exports);var De=l(Re.exports);class Le{constructor(t=new Oe(1/0,1/0),e=new Oe(-1/0,-1/0)){f(this,"isBox2",!0),f(this,"min"),f(this,"max"),this.min=t,this.max=e}applyMatrix3(t){return this.isEmpty()||(ke[0].set(this.min.x,this.min.y).applyMatrix3(t),ke[1].set(this.min.x,this.max.y).applyMatrix3(t),ke[3].set(this.max.x,this.max.y).applyMatrix3(t),ke[2].set(this.max.x,this.min.y).applyMatrix3(t),this.setFromPoints(ke)),this}clone(){return(new Le).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}ceil(){return this.min.ceilToZero(),this.max.ceilToZero(),this}distanceToPoint(t){return Pe.copy(t).clamp(this.min,this.max).sub(t).length()}expandByXY(t,e){return this.min.minXY(t,e),this.max.maxXY(t,e),this}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByPoints(t){if(!t||!t.length)return this;for(let e=0,r=t.length;e<r;e++)this.expandByPoint(t[e]);return this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t){return t.updateWorldMatrix(!1,!1),void 0!==t.geometry.boundingBox?(t.geometry.boundingBox&&!t.geometry.boundingBox.isEmpty()||t.computeBoundingBox(),Be.copy(t.geometry.boundingBox),Be.applyMatrix3(t.matrixWorld),this.union(Be)):t.geometry.points&&t.geometry.points.length&&(Be.setFromPoints(t.geometry.points),Be.applyMatrix3(t.matrixWorld),this.union(Be)),this}expandByBox(t){this.expandByPoint(t.min),this.expandByPoint(t.max)}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}floor(){return this.min.floorToZero(),this.max.floorToZero(),this}getCenter(t=new Oe){return this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t=new Oe){return this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)}getPoints(t=[]){return t.length=0,t[0]={x:this.min.x,y:this.min.y},t[1]={x:this.min.x,y:this.max.y},t[2]={x:this.max.x,y:this.max.y},t[3]={x:this.max.x,y:this.min.y},t}getArea(){return this.getSize(Pe),Pe.x*Pe.y}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}intersectsBox(t){return!!t&&!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)}intersectsObject(t){return!(!t||!t.geometry)&&this.intersectsBox(t.geometry.boundingBox)}intersect(t){return this.min.max(t.min),this.max.min(t.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}round(){return this.min.roundToZero(),this.max.roundToZero(),this}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,r=t.length;e<r;e+=3)this.expandByPoint(Pe.fromArray(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,r=t.length;e<r;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const r=Pe.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(r),this.max.copy(t).add(r),this}setFromProjectionMatrix(t){return this.min.set(t.elements[6],t.elements[7]),this.max.set(t.elements[6],t.elements[7]),this}setFromObject(t){return this.makeEmpty(),this.expandByObject(t)}setFromMinMaxString(t,e=" "){if(this.makeEmpty(),!(null==t?void 0:t.length))return this;let r=t.split(e),i=De.map(r,(t=>parseFloat(t)));for(let t=0,e=i.length;t<e;t+=2)this.expandByPoint(Pe.fromArray(i,t));return this}translate(t){return this.min.add(t),this.max.add(t),this}toString(){return`{"min":${this.min.toString()},"max":${this.max.toString()}}`}fromString(t){return t?(this.copy(JSON.parse(t)),this):this}union(t){return t.validate()?(this.min.min(t.min),this.max.max(t.max),this):this}validate(){return this.min.validate()&&this.max.validate()}unproject(t){return this.applyMatrix3(t.projectionMatrixInverse).applyMatrix3(t.matrixWorld)}centralArrange(t=1,e=20,r=10){const i=e+r;this.getCenter(Pe),this.getSize(Ue),Ue.subScalar(e);const n=Math.floor(Ue.x/i),s=n*i,a=Math.ceil(t/n)*i;if(Ue.x<i||Ue.y<i||s>=Ue.x||a>=Ue.y)return Pe.clone();let o=[],h=0,u=0;for(let e=0;e<t;e++){const e=n>t?t*i:s,r=Pe.x-e/2+u*i+i/2,c=Pe.y-a/2+h*i+i/2;o.push(new Oe(r,c)),u++,u>=n&&(u=0,h++)}return o}flipY(){return Pe.copy(this.min).multiplyScalar(1,-1),Ue.copy(this.max).multiplyScalar(1,-1),this.min.set(Pe.x,Ue.y),this.max.set(Ue.x,Pe.y),this}}const Be=new Le,ke=[new Oe,new Oe,new Oe,new Oe],Pe=new Oe,Ue=new Oe;class Ve{constructor(){f(this,"isMatrix3",!0),f(this,"elements",[1,0,0,0,1,0,0,0,1])}static equals(t,e,r=1e-6){if(t.elements.length!=e.elements.length)return!1;for(let i=0,n=t.elements.length;i<n;i++){const n=t.elements[i]-e.elements[i];if(Math.abs(n)>r)return!1}return!0}copy(t){const e=this.elements,r=t.elements;return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],this}clone(){return(new Ve).fromArray(this.elements)}compose(t,e,r){const i=Math.sin(e.x),n=Math.cos(e.x);return this.set(r.x*n,r.y*i*-1,t.x,r.x*i,r.y*n,t.y,0,0,1)}composeWithCenter(t,e,r,i){return je.identity(),We.makeTranslation(t.x,t.y),Ye.makeRotation(e.x),Ge.makeScale(r.x,r.y),He.copy(i).applyMatrix3(Ge),je.multiply(Xe.makeTranslation(-He.x,-He.y)).multiply(We).multiply(Xe.makeTranslation(He.x,He.y)).multiply(Ye).multiply(Xe.makeTranslation(-He.x,-He.y)).multiply(Ge),this.copy(je)}decompose(t,e,r){const i=je.copy(this).elements,n=Math.sqrt(i[0]*i[0]+i[3]*i[3]),s=Math.sqrt(i[1]*i[1]+i[4]*i[4]),a=i[0]*i[4]-i[3]*i[1];i[0]||i[3]?r.set(n,a/n):i[1]||i[4]?r.set(a/s,s):r.set(0,0);let o=0;o=i[0]||i[3]?i[3]>0?-Math.acos(i[0]/n):Math.acos(i[0]/n):i[1]||i[4]?Math.PI/2-(i[4]>0?Math.acos(-i[1]/s):-Math.acos(i[1]/s)):0,0!==o&&r.y<0&&(o*=-1),e.set(o,o),t.set(i[6],i[7])}compose2(t,e,r){return this.identity().translate(t.x,t.y).rotate(e.x).scale(r.x,r.y),this}decompose2(t,e,r){const i=this.clone();i.scale(-1,1);const n=i.elements[0],s=i.elements[1],a=i.elements[3],o=i.elements[4];let h=0,u=0,c=0;if(0!==n||0!==a){const t=Math.hypot(n,a);h=t,u=(n*o-s*a)/t;const e=Math.acos(n/t);c=a>0?-e:e}else if(0!==s||0!==o){const t=Math.hypot(s,o);h=(n*o-s*a)/t,u=t;const e=Math.acos(s/t);c=Math.PI/2+(o>0?-e:e)}else h=0,u=0,c=0;h=-h,t.x=i.elements[6],t.y=i.elements[7],e.x=e.y=c/Math.PI/180,r.x=h,r.y=u}composeSvgTransform(t=0,e=0,r,i=!1){if(!r&&!t&&!e)return this;this.identity(),je.identity();let n=null==r?void 0:r.split(") ").map((t=>t.trim()+")")).filter((t=>")"!==t));return n||(n=[]),(t||e)&&n.push(`translate(${t},${e})`),n.forEach((t=>{const e=/scale\(\s*([^\s,)]+)[ ,]([^\s,)]+)/.exec(t),r=/rotate\(\s*(-?\d*\.?\d+)(?:[ ,](-?\d*\.?\d+)(?:[ ,](-?\d*\.?\d+))?)?\s*\)/.exec(t),i=/translate\(\s*([^\s,)]+)[ ,]([^\s,)]+)/.exec(t);if(e){const t=Number(e[1])||1,r=Number(e[2])||t;je.multiply(Ge.makeScale(t,r))}else if(r){const t=Ce(Number(r[1])||0);Number(r[2])||Number(r[3])?(qe.set(Number(r[2]||"0"),Number(r[3]||"0")),je.multiply(Ye.makeRotationByPoint(t,qe))):je.multiply(Ye.makeRotation(t))}else i&&je.multiply(We.makeTranslation(Number(i[1])||0,Number(i[2])||0))})),this.copy(je),i&&this.premultiply(Ge.makeScale(1,-1)),this}decomposeSvgMatrix(t,e,r){const i=je.copy(this).elements;qe.set(i[0],i[1]),He.set(i[3],i[4]);let n=qe.length();qe.normalize();let s=qe.dot(He);ze.copy(qe).multiplyScalar(-s),He.add(ze);const a=He.length()||0;He.normalize(),qe.x*He.y<He.x*qe.y&&(qe.x=-qe.x,qe.y=-qe.y,n=-n,s=-s);const o=n?Math.atan2(qe.y,qe.x):Math.atan2(-qe.x,He.y);t.set(i[6],i[7]),e.set(o,o),r.set(n,a)}determinant(){const t=this.elements,e=t[0],r=t[3],i=t[6],n=t[1],s=t[4],a=t[7],o=t[2],h=t[5],u=t[8];return e*s*u-e*h*a-n*r*u+n*h*i+o*r*a-o*s*i}equals(t,e=0){const r=this.elements,i=t.elements;for(let t=0;t<9;t++)if(Math.abs(r[t]-i[t])>e)return!1;return!0}extractBasis2(t,e){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),this}flipY(){return this.multiply(Ge.makeScale(1,-1))}fromArray(t,e=0){for(let r=0;r<9;r++)this.elements[r]=t[r+e];return this}getComponents(t=[1,0,0,1,0,0]){return t[0]=this.elements[0],t[1]=this.elements[1],t[2]=this.elements[3],t[3]=this.elements[4],t[4]=this.elements[6],t[5]=this.elements[7],t}getNormalMatrix(t){return this.setFromMatrix(t).invert().transpose()}getRotation(t){let e=this.elements;const r=Math.sqrt(e[0]*e[0]+e[3]*e[3]),i=Math.sqrt(e[1]*e[1]+e[4]*e[4]);let n=0;n=e[0]||e[3]?e[3]>0?-Math.acos(e[0]/r):Math.acos(e[0]/r):e[1]||e[4]?Math.PI/2-(e[4]>0?Math.acos(-e[1]/i):-Math.acos(e[1]/i)):0,this.getScale(He),0!==n&&He.x<0&&(n*=-1),t.set(n,n)}getScale(t){let e=this.elements,r=Math.sqrt(e[0]*e[0]+e[1]*e[1]),i=Math.sqrt(e[3]*e[3]+e[4]*e[4]),n=e[0]*e[4]-e[3]*e[1];e[0]||e[1]?t.set(n/i,i):e[3]||e[4]?t.set(r,n/r):t.set(0,0)}getTransition(t){t.set(this.elements[6],this.elements[7])}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}hasChange(){for(let t=0,e=this.elements.length;t<e;t++)if(Math.abs(this.elements[t]-Fe[t])>Number.EPSILON)return!0;return!1}invert(){const t=this.elements,e=t[0],r=t[1],i=t[2],n=t[3],s=t[4],a=t[5],o=t[6],h=t[7],u=t[8],c=u*s-a*h,l=a*o-u*n,d=h*n-s*o,p=e*c+r*l+i*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const f=1/p;return t[0]=c*f,t[1]=(i*h-u*r)*f,t[2]=(a*r-i*s)*f,t[3]=l*f,t[4]=(u*e-i*o)*f,t[5]=(i*n-a*e)*f,t[6]=d*f,t[7]=(r*o-h*e)*f,t[8]=(s*e-r*n)*f,this}lookAt(t,e,r){return this.identity().rotate(e.angle()-t.angle()+r.angle())}makeProjection(t,e,r,i,n,s){const a=n/(e-t),o=s/(r-i),h=n/2-(e+t)*a,u=s/2+(r+i)*o;return this.elements[0]=a,this.elements[3]=0,this.elements[6]=h,this.elements[1]=0,this.elements[4]=-o,this.elements[7]=u,this.elements[2]=0,this.elements[5]=0,this.elements[8]=1,this}makeRotation(t){const e=Math.cos(t),r=Math.sin(t);return this.set(e,-r,0,r,e,0,0,0,1),this}makeRotationByPoint(t,e){const r=Math.cos(t),i=Math.sin(t),n=-e.x*r+e.y*i+e.x,s=-e.x*i-e.y*r+e.y;return this.set(r,-i,n,i,r,s,0,0,1),this}makeRotationFromQuaternion(t){return this.compose(Qe,t,Ze)}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}makeTranslation(t,e){return this.set(1,0,t,0,1,e,0,0,1),this}multiply(t){return this.multiplyMatrices(this,t)}multiplyMatrices(t,e){const r=t.elements,i=e.elements,n=this.elements,s=r[0],a=r[3],o=r[6],h=r[1],u=r[4],c=r[7],l=r[2],d=r[5],p=r[8],f=i[0],m=i[3],g=i[6],y=i[1],v=i[4],x=i[7],_=i[2],b=i[5],w=i[8];return n[0]=s*f+a*y+o*_,n[3]=s*m+a*v+o*b,n[6]=s*g+a*x+o*w,n[1]=h*f+u*y+c*_,n[4]=h*m+u*v+c*b,n[7]=h*g+u*x+c*w,n[2]=l*f+d*y+p*_,n[5]=l*m+d*v+p*b,n[8]=l*g+d*x+p*w,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}premultiply(t){return this.multiplyMatrices(t,this)}rotate(t){return this.premultiply(Ye.makeRotation(-t))}scale(t,e){return this.premultiply(Ge.makeScale(t,e))}set(t,e,r,i,n,s,a,o,h){return this.elements[0]=t,this.elements[3]=e,this.elements[6]=r,this.elements[1]=i,this.elements[4]=n,this.elements[7]=s,this.elements[2]=a,this.elements[5]=o,this.elements[8]=h,this}setFromDomMatrix(t){return void 0!==t.m11&&void 0!==t.m21&&void 0!==t.m41&&void 0!==t.m12&&void 0!==t.m22&&void 0!==t.m42&&void 0!==t.m14&&void 0!==t.m24&&void 0!==t.m44?this.set(t.m11,t.m21,t.m41,t.m12,t.m22,t.m42,t.m14,t.m24,t.m44):void 0!==t.a&&void 0!==t.b&&void 0!==t.c&&void 0!==t.d&&void 0!==t.e&&void 0!==t.f&&this.set(t.a,t.c,t.e,t.b,t.d,t.f,0,0,1),this}setFromMatrix(t){const e=t.elements;return this.set(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]),this}setUvTransform(t,e,r,i,n,s,a){const o=Math.cos(n),h=Math.sin(n);return this.set(r*o,r*h,-r*(o*s+h*a)+s+t,-i*h,i*o,-i*(-h*s+o*a)+a+e,0,0,1),this}toArray(t=[],e=0){const r=this.elements;return t[e]=r[0],t[e+1]=r[1],t[e+2]=r[2],t[e+3]=r[3],t[e+4]=r[4],t[e+5]=r[5],t[e+6]=r[6],t[e+7]=r[7],t[e+8]=r[8],t}toString(){return`[${this.elements[0]},${this.elements[1]}, ${this.elements[3]},${this.elements[4]}, ${this.elements[6]},${this.elements[7]}]`}translate(t,e){return this.premultiply(We.makeTranslation(t,e))}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}transposeIntoArray(t){const e=this.elements;return 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],this}}const Fe=[1,0,0,0,1,0,0,0,1],qe=new Oe,He=new Oe,ze=new Oe,je=new Ve,We=new Ve,Ye=new Ve,Ge=new Ve,Xe=new Ve,Qe=new Oe(0,0,0),Ze=new Oe(1,1,1),$e=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],Ke=()=>{const t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,r=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return($e[255&t]+$e[t>>8&255]+$e[t>>16&255]+$e[t>>24&255]+"-"+$e[255&e]+$e[e>>8&255]+"-"+$e[e>>16&15|64]+$e[e>>24&255]+"-"+$e[63&r|128]+$e[r>>8&255]+"-"+$e[r>>16&255]+$e[r>>24&255]+$e[255&i]+$e[i>>8&255]+$e[i>>16&255]+$e[i>>24&255]).toLowerCase()};class Je extends Se{constructor(t={}){super(),f(this,"isObject2",!0),f(this,"id",tr++),f(this,"uuid",Ke()),f(this,"name"),f(this,"type","Object2"),f(this,"featureKey","Object2_"+this.id),f(this,"parent"),f(this,"children",[]),f(this,"up",new Oe(0,1)),f(this,"position",new Oe),f(this,"rotation",new Oe),f(this,"scaled",new Oe(1,1)),f(this,"flipY",!1),f(this,"selectable",!1),f(this,"matrix",new Ve),f(this,"matrixWorld",new Ve),f(this,"matrixWorldInverse",new Ve),f(this,"modelViewMatrix",new Ve),f(this,"normalMatrix",new Ve),f(this,"fixed",!1),f(this,"dynamically",!1),f(this,"matrixAutoUpdate",!1),f(this,"matrixWorldNeedsUpdate",!1),f(this,"matrixWorldAutoUpdate",!1),f(this,"composeNode",!1),f(this,"isInComposeNode",!1),f(this,"alignCenter",!1),f(this,"boundingBox",new Le),f(this,"boundingBoxWorld",new Le),f(this,"boundingBoxNeedsUpdate",!1),f(this,"centerPoint",new Oe),f(this,"visible",!0),f(this,"castShadow",!1),f(this,"receiveShadow",!1),f(this,"renderOrder",0),f(this,"animations",[]),f(this,"finalSize"),f(this,"userData",{}),f(this,"DefaultUp",new Oe(0,1)),f(this,"_autoSort",!0),f(this,"_version",0),void 0!==t.name?this.name=t.name:this.name="Object2",void 0!==t.flipY&&(this.flipY=t.flipY),void 0!==t.selectable&&(this.selectable=t.selectable),void 0!==t.finalSize&&(this.finalSize=t.finalSize),this.setAttrs(t)}get version(){return this._version}set version(t){this._version=t}set needsUpdate(t){t&&this._version++}destroy(){super.destroy(),this.clear(),this.removeFromParent(),this.dispatchEvent(cr)}setPosition(t){return this.position.set(t.x,t.y),this}translate(t,e){this.position.x+=t,this.position.y+=e}setScale(t,e){return this.scaled.set(t,e),this}setRotationFromMatrix(t){t.decompose(sr,this.rotation,ar)}setRotation(t){return this.rotation.set(t,t),this}rotate(t){this.rotation.x+=t}scale(t,e){e?(this.scaled.x*=t,this.scaled.y*=e):this.scaled.multiplyScalar(t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix3(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix3(rr.copy(this.matrixWorld).invert())}lookAt(t){ir.copy(t),this.updateWorldMatrix(!0,!1),this.matrixWorld.getTransition(sr),rr.lookAt(sr,ir,hr),rr.getRotation(or),this.rotation.set(or.x,or.x),this.parent&&(this.parent.matrixWorld.getRotation(or),this.rotate(or.x))}applyMatrix3(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.rotation,this.scaled)}updateMatrix(){er.copy(this.scaled),this.flipY&&(er.y*=-1),this.matrix.compose(this.position,this.rotation,er),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent?this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldInverse.copy(this.matrixWorld).invert(),this.matrixWorldNeedsUpdate=!1,t=!0,this.boundingBoxNeedsUpdate=!0);const e=this.children;for(let r=0,i=e.length;r<i;r++)e[r].updateMatrixWorld(t);this.boundingBoxNeedsUpdate&&(this.updateBoundingBox(),this.boundingBoxNeedsUpdate=!1)}updateWorldMatrix(t=!1,e=!1){const r=this.parent;if(t&&r&&r.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent?this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldInverse.copy(this.matrixWorld).invert(),e){const t=this.children;for(let e=0,r=t.length;e<r;e++)t[e].updateWorldMatrix(!1,!0)}}updateModelViewMatrix(t){rr.copy(this.matrixWorld),t&&this.fixed?this.modelViewMatrix.copy(t.projectionMatrix):t?this.modelViewMatrix.multiplyMatrices(t.viewMatrix,rr):this.modelViewMatrix.copy(rr);for(let e=0,r=this.children.length;e<r;e++)this.children[e].updateModelViewMatrix(t)}computeBoundingBox(){this.boundingBox.makeEmpty(),this.centerPoint.set(0,0);for(let t=0,e=this.children.length;t<e;t++)this.children[t].updateMatrixWorld(),nr.copy(this.children[t].computeBoundingBox()),nr.applyMatrix3(rr.copy(this.children[t].matrixWorld)),this.boundingBox.union(nr);return this.boundingBox.applyMatrix3(this.matrixWorldInverse),this.boundingBox}updateBoundingBox(){this.boundingBox.isEmpty()||this.boundingBoxWorld.copy(this.boundingBox).applyMatrix3(this.matrixWorld)}setAttrs(t){if(!t)return this;for(const e in t)"children"!==e&&void 0!==t[e]&&("userData"===e&&t[e]?Object.keys(t[e]).forEach((r=>this.userData[r]=t[e][r])):this.userData[e]=t[e]);return this}add(t){return t&&t.isObject2&&t!==this?(t.parent&&t.parent.remove(t),t.parent=this,this.children.push(t),t.isInComposeNode=this.composeNode||this.isInComposeNode,t.selectable&&t.parent.setSelectable(t.selectable),this._autoSort&&this.children.sort(((t,e)=>t.renderOrder-e.renderOrder)),t.dispatchEvent(ur),this.matrixAutoUpdate||(this.matrixWorldNeedsUpdate=!0),this):this}adds(t){if(!t||!t.length)return this;this._autoSort=!1;for(let e=0,r=t.length;e<r;e++)e===t.length-1&&(this._autoSort=!0),this.add(t[e]);return this}remove(t){const e=this.children.indexOf(t);return-1!==e&&(t.parent=void 0,this.children.splice(e,1),t.dispatchEvent(cr)),this}removes(t){for(let e=0,r=t.length;e<r;e++)this.remove(t[e]);return this}removeFromParent(){const t=this.parent;return t&&t.remove(this),this.parent=void 0,this}moveToLast(){const t=this.parent;t&&(this.removeFromParent(),t.add(this))}clear(){for(let t=0;t<this.children.length;t++){const e=this.children[t];e.parent=void 0,e.destroy(),e.dispatchEvent(cr)}return this.children.length=0,this}attach(t){return this.updateWorldMatrix(!0,!1),rr.copy(this.matrixWorld).invert(),t.parent&&(t.parent.updateWorldMatrix(!0,!1),rr.multiply(t.parent.matrixWorld)),t.applyMatrix3(rr),this.add(t),t.updateWorldMatrix(!1,!0),this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let r=0,i=this.children.length;r<i;r++){const i=this.children[r].getObjectByProperty(t,e);if(void 0!==i)return i}}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(t,or,ar),t}getWorldRotation(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(sr,t,ar),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(sr,or,t),t}getWorldDirection(t){return this.updateWorldMatrix(!0,!1),t.set(this.matrixWorld.elements[6],this.matrixWorld.elements[7]).normalize()}traverse(t){t(this);const e=this.children;for(let r=0,i=e.length;r<i;r++)e[r].traverse(t)}traverseVisible(t){if(this.visible)return;t(this);const e=this.children;for(let r=0,i=e.length;r<i;r++)e[r].traverseVisible(t)}traverseAncestors(t){const e=this.parent;e&&(t(e),e.traverseAncestors(t))}onBeforeRender(t,e,r,i){}render(t){}onAfterRender(t,e,r){}setSelectable(t){this.selectable=t,this.parent&&this.parent.setSelectable(t)}raycast(t,e=[]){}getByRange(t,e=!1,r=[]){if(nr.copy(t),nr.containsBox(this.boundingBoxWorld)&&r.push(this),!e||this.composeNode)return r;for(let i=0,n=this.children.length;i<n;i++)this.children[i].getByRange(t,e,r);return r}clone(t=!0,e=!1){return new(0,this.constructor)(this.userData).copy(this,t,e)}copy(t,e=!0,r=!1){if(this.name=t.name,this.type=t.type,this.featureKey=t.featureKey,this._version=0,this.parent=t.parent,this.up.copy(t.up),this.position.copy(t.position),this.rotation.copy(t.rotation),this.scaled.copy(t.scaled),this.flipY=t.flipY,this.selectable=t.selectable,this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.modelViewMatrix.copy(t.modelViewMatrix),this.normalMatrix.copy(t.normalMatrix),this.fixed=t.fixed,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.composeNode=t.composeNode,this.alignCenter=t.alignCenter,this.boundingBox.copy(t.boundingBox),this.boundingBoxWorld.copy(t.boundingBoxWorld),this.boundingBoxNeedsUpdate=t.boundingBoxNeedsUpdate,this.centerPoint.copy(t.centerPoint),this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),e)for(let i=0;i<t.children.length;i++){const n=t.children[i];this.add(n.clone(e,r))}return this}}let tr=0;const er=new Oe,rr=new Ve,ir=new Oe,nr=new Le,sr=new Oe,ar=new Oe,or=new Oe,hr=new Oe(0,1),ur={type:"added"},cr={type:"removed"};var lr=(t=>(t.GROS="gros",t.RM="rm",t.WS="ws",t.SU="su",t.EQ="eq",t.FN="fn",t.GL="gl",t.IP="ip",t))(lr||{}),dr=(t=>(t.BACKGROUND="background",t.ASSETS="assets",t.ANNOTATIONS="annotations",t.TEXT="text",t.ASSET_LABELS="asset-labels",t.LABELS="labels",t))(dr||{});class pr extends Je{constructor(){super(),f(this,"name","Scene"),f(this,"type","Scene"),f(this,"isScene",!0),f(this,"view"),f(this,"background"),f(this,"featureKey","Scene_"+this.id),f(this,"matrixAutoUpdate",!1)}destroy(){super.destroy(),this.boundingBox.makeEmpty()}setup(t){this.view=t}render(t){var e;this.visible&&(null==(e=this.children)||e.forEach((function(e){e.isShape&&e.render(t)})))}getIntersectObjects(t,e=lr.RM,r=[]){throw new Error("must be implemented in derived")}}class fr extends pr{constructor(){super(...arguments),f(this,"isDynamic",!0),f(this,"dynamically",!0)}}const mr="#45b787",gr="#314a43",yr="#6e9bc5",vr="#2775b6",xr="#F26666",_r="#D95970",br="#ECD2B9",wr="#BF9D8A",Er="#ECDEC0",Tr="#D0AC57",Sr="#beb6b6",Ar="#918883",Nr="#182327",Cr={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},Mr={h:0,s:0,l:0},Or={h:0,s:0,l:0};function Ir(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+6*(e-t)*(2/3-r):t}const Rr=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$|rgb\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)|rgba\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*[\d.]+\s*\)/;class Dr{constructor(t,e,r,i){return f(this,"isColor",!0),f(this,"r",1),f(this,"g",1),f(this,"b",1),f(this,"a",1),void 0===e&&void 0===r?this.set(t):this.setRGBA(t,e,r,i)}static isColor(t){return"string"==typeof t?Rr.test(t):"number"==typeof t&&t>=0&&t<=16777215}static getRandomStyle(){return Lr.random().getStyle()}static getDarken(t,e=.8){return Lr.set(t).getHSL(Br),Lr.setHSL(Br.h,Br.s,Br.l*e).getStyle()}static getLighten(t,e=1.2){return this.getDarken(t,e)}static getContrast(t){return Lr.set(t),Lr.getContrastString()}static getArray(t){return Lr.set(t).toArray()}static getComplementary(t){return Lr.set(t),Lr.getComplementaryString()}static getMoreTransparent(t,e){return Lr.set(t).setA(e).getStyle()}set(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this}random(){return this.setHex(Math.floor(Math.random()*(1<<24)))}setScalar(t){return this.r=t,this.g=t,this.b=t,this.a=1,this}setHex(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this.a=1,this}setR(t){return this.r=t,this}setG(t){return this.g=t,this}setB(t){return this.b=t,this}setA(t){return this.a=t,this}setRGB(t,e,r){return this.setRGBA(t,e,r,this.a)}setRGBA(t,e,r,i=1){return this.r=t,this.g=e,this.b=r,this.a=i,this}setHSL(t,e,r,i=1){var n;if(t=(t%(n=1)+n)%n,e=Ae(e,0,1),r=Ae(r,0,1),0===e)this.r=this.g=this.b=r;else{const i=r<=.5?r*(1+e):r+e-r*e,n=2*r-i;this.r=Ir(n,i,t+1/3),this.g=Ir(n,i,t),this.b=Ir(n,i,t-1/3)}return this.a=i,this}setStyle(t){let e;if(e=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let t;const r=e[1],i=e[2];switch(r){case"rgb":case"rgba":if(t=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))return this.r=Math.min(255,parseInt(t[1],10))/255,this.g=Math.min(255,parseInt(t[2],10))/255,this.b=Math.min(255,parseInt(t[3],10))/255,this.a=Math.max(Math.min(1,void 0!==t[4]?parseFloat(t[4]):1),0),this;if(t=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))return this.r=Math.min(100,parseInt(t[1],10))/100,this.g=Math.min(100,parseInt(t[2],10))/100,this.b=Math.min(100,parseInt(t[3],10))/100,this.a=Math.max(Math.min(1,void 0!==t[4]?parseFloat(t[4]):1),0),this;break;case"hsl":case"hsla":if(t=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i)){const e=parseFloat(t[1])/360,r=parseInt(t[2],10)/100,i=parseInt(t[3],10)/100,n=Math.max(Math.min(1,void 0!==t[4]?parseFloat(t[4]):1),0);return this.setHSL(e,r,i,n)}}}else if(e=/^\#([A-Fa-f\d]+)$/.exec(t)){const t=e[1],r=t.length;if(3===r)return this.r=parseInt(t.charAt(0)+t.charAt(0),16)/255,this.g=parseInt(t.charAt(1)+t.charAt(1),16)/255,this.b=parseInt(t.charAt(2)+t.charAt(2),16)/255,this.a=1,this;if(6===r)return this.r=parseInt(t.charAt(0)+t.charAt(1),16)/255,this.g=parseInt(t.charAt(2)+t.charAt(3),16)/255,this.b=parseInt(t.charAt(4)+t.charAt(5),16)/255,this.a=1,this}return t&&t.length>0?this.setColorName(t):this}setColorName(t){const e=Cr[t.toLowerCase()];return void 0!==e&&this.setHex(e),this}clone(){return new Dr(this.r,this.g,this.b,this.a)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}getRGB(t=new Dr){return t.setRGB(this.r,this.g,this.b)}getRGBByBg(t=new Dr){const e=this.a,r=e*this.r+(1-e)*t.r,i=e*this.g+(1-e)*t.g,n=e*this.b+(1-e)*t.b;return new Dr(r,i,n)}getHex(){return Ae(255*this.r,0,255)<<16^Ae(255*this.g,0,255)<<8^Ae(255*this.b,0,255)}getHSL(t){const e=this.r,r=this.g,i=this.b,n=Math.max(e,r,i),s=Math.min(e,r,i);let a,o=0;const h=(s+n)/2;if(s===n)o=0,a=0;else{const t=n-s;switch(a=h<=.5?t/(n+s):t/(2-n-s),n){case e:o=(r-i)/t+(r<i?6:0);break;case r:o=(i-e)/t+2;break;case i:o=(e-r)/t+4}o/=6}return t.h=o,t.s=a,t.l=h,t}getStyle(){return 1===this.a?`rgb(${255*this.r|0},${255*this.g|0},${255*this.b|0})`:`rgba(${255*this.r|0},${255*this.g|0},${255*this.b|0},${this.a||1})`}getHexString(){return"#"+("000000"+this.getHex().toString(16)).slice(-6)}getBrightness(){let t=(255*this.r*299+255*this.g*587+255*this.b*144)/1e3;return t+=(255-t)*(255-255*this.a)/255,t}getContrastString(){return this.getBrightness()>125?"#2f2f2f":"#f2f2f2"}getComplementary(t=new Dr){const e=this.toArray(),r=[0,0,0,1];for(let t=0;t<e.length;t++)if(t<3)r[t]=1-e[t];else{if(3!==t)continue;e[t]>1||e[t]<=0?r[t]=1:r[t]=Math.max(Math.min(parseFloat(e[t].toFixed(2)),1),0)}return t.setRGBA(r[0],r[1],r[2],parseFloat(r[3].toFixed(2)))}getComplementaryString(){return this.getComplementary().getStyle()}getLightenOrDarken(t){if(void 0===t||t>=1)return this.getHexString();const e=this.getRGBByBg(),r=e.r*t+(1-t),i=e.g*t+(1-t),n=e.b*t+(1-t);return new Dr(r,i,n).getHexString()}getNormalized(){return[parseFloat(Math.max(Math.min(this.r,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.g,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.b,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.a,1),0).toFixed(2))]}getNormalized3(){return[parseFloat(Math.max(Math.min(this.r,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.g,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.b,1),0).toFixed(2))]}offsetHSL(t,e,r){return this.getHSL(Mr),Mr.h+=t,Mr.s+=e,Mr.l+=r,this.setHSL(Mr.h,Mr.s,Mr.l),this}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,r){return this.r=t.r+(e.r-t.r)*r,this.g=t.g+(e.g-t.g)*r,this.b=t.b+(e.b-t.b)*r,this}lerpHSL(t,e){this.getHSL(Mr),t.getHSL(Or);const r=Me(Mr.h,Or.h,e),i=Me(Mr.s,Or.s,e),n=Me(Mr.l,Or.l,e);return this.setHSL(r,i,n),this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this.a=t[e+3],this}toArray(t=[0,0,0,0],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t[e+3]=this.a,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),!0===t.normalized&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Lr=new Dr,Br={h:0,s:0,l:0},kr=" ";function Pr([t,e],r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function Ur(...t){for(let e=0;e<t.length;e++)if("number"!=typeof t[e])throw new Error(`assertNumbers arguments[${e}] is not a number. ${typeof t[e]} == typeof ${t[e]}`);return!0}const Vr=Math.PI;function Fr(t,e,r){t.lArcFlag=0===t.lArcFlag?0:1,t.sweepFlag=0===t.sweepFlag?0:1;let{rX:i,rY:n}=t;const{x:s,y:a}=t;if(Math.abs(i)<1e-10||Math.abs(n)<1e-10)return t.rX=0,t.rY=0,t.cX=(e+s)/2,t.cY=(r+a)/2,t.phi1=0,void(t.phi2=0);i=Math.abs(t.rX),n=Math.abs(t.rY);const o=t.xRot/180*Vr,[h,u]=Pr([(e-s)/2,(r-a)/2],-o),c=Math.pow(h,2)/Math.pow(i,2)+Math.pow(u,2)/Math.pow(n,2);1<c&&(i*=Math.sqrt(c),n*=Math.sqrt(c)),t.rX=i,t.rY=n;const l=Math.pow(i,2)*Math.pow(u,2)+Math.pow(n,2)*Math.pow(h,2),d=(t.lArcFlag!==t.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(i,2)*Math.pow(n,2)-l)/l)),p=i*u/n*d,f=-n*h/i*d,m=Pr([p,f],o);t.cX=m[0]+(e+s)/2,t.cY=m[1]+(r+a)/2,t.phi1=Math.atan2((u-f)/n,(h-p)/i),t.phi2=Math.atan2((-u-f)/n,(-h-p)/i),0===t.sweepFlag&&t.phi2>t.phi1&&(t.phi2-=2*Vr),1===t.sweepFlag&&t.phi2<t.phi1&&(t.phi2+=2*Vr),t.phi1*=180/Vr,t.phi2*=180/Vr}function qr(t,e,r){Ur(t,e,r);const i=t*t+e*e-r*r;if(0>i)return[];if(0===i)return[[t*r/(t*t+e*e),e*r/(t*t+e*e)]];const n=Math.sqrt(i);return[[(t*r+e*n)/(t*t+e*e),(e*r-t*n)/(t*t+e*e)],[(t*r-e*n)/(t*t+e*e),(e*r+t*n)/(t*t+e*e)]]}const Hr=Math.PI/180;function zr(t,e,r){return(1-r)*t+r*e}function jr(t,e,r,i){return t+Math.cos(i/180*Vr)*e+Math.sin(i/180*Vr)*r}function Wr(t,e,r,i){const n=1e-6,s=e-t,a=r-e,o=3*s+3*(i-r)-6*a,h=6*(a-s),u=3*s;return Math.abs(o)<n?Math.abs(h)<n?[]:[-u/h]:function(t,e,r=1e-6){const i=t*t/4-e;if(i<-r)return[];if(i<=r)return[-t/2];const n=Math.sqrt(i);return[-t/2-n,-t/2+n]}(h/o,u/o,n)}function Yr(t,e,r,i,n){const s=1-n;return t*(s*s*s)+e*(3*s*s*n)+r*(3*s*n*n)+i*(n*n*n)}function Gr(t,e,r){const i=e[0]-t[0],n=e[1]-t[1],s=r[0]-t[0],a=r[1]-t[1],o=i*a-n*s;if(!(Math.abs(o)<1e-10))return!1;const h=i*s+n*a,u=s*s+a*a;return 0<=h&&h<=u&&i*i+n*n<=u}function Xr(t){var e;const r=(null==(e=t[t.length-1])?void 0:e.type)===ai.CLOSE_PATH,i=r?t.length-2:t.length-1,n=[{type:ai.MOVE_TO,relative:!1,x:t[i].x,y:t[i].y}];for(let e=i;e>0;e--){const r=t[e],i=t[e-1];if(r.relative)throw new Error("Relative command are not supported convert first with `toAbs()`");switch(r.type){case ai.HORIZ_LINE_TO:n.push({type:ai.HORIZ_LINE_TO,relative:!1,x:i.x});break;case ai.VERT_LINE_TO:n.push({type:ai.VERT_LINE_TO,relative:!1,y:i.y});break;case ai.LINE_TO:case ai.MOVE_TO:n.push({type:ai.LINE_TO,relative:!1,x:i.x,y:i.y});break;case ai.CURVE_TO:n.push({type:ai.CURVE_TO,relative:!1,x:i.x,y:i.y,x1:r.x2,y1:r.y2,x2:r.x1,y2:r.y1});break;case ai.SMOOTH_CURVE_TO:throw new Error("Unsupported command: S (smooth cubic bezier)");case ai.SMOOTH_QUAD_TO:throw new Error("Unsupported command: T (smooth quadratic bezier)");case ai.ARC:throw new Error("Unsupported command: A (arc)");case ai.QUAD_TO:throw new Error("Unsupported command: Q (quadratic bezier)")}}return r&&n.push({type:ai.CLOSE_PATH}),n}function Qr(){return Kr(((t,e,r)=>(t.relative&&(void 0!==t.x1&&(t.x1+=e),void 0!==t.y1&&(t.y1+=r),void 0!==t.x2&&(t.x2+=e),void 0!==t.y2&&(t.y2+=r),void 0!==t.x&&(t.x+=e),void 0!==t.y&&(t.y+=r),t.relative=!1),t)))}function Zr(){let t=NaN,e=NaN,r=NaN,i=NaN;return Kr(((n,s,a)=>(n.type&ai.SMOOTH_CURVE_TO&&(n.type=ai.CURVE_TO,t=isNaN(t)?s:t,e=isNaN(e)?a:e,n.x1=n.relative?s-t:2*s-t,n.y1=n.relative?a-e:2*a-e),n.type&ai.CURVE_TO?(t=n.relative?s+n.x2:n.x2,e=n.relative?a+n.y2:n.y2):(t=NaN,e=NaN),n.type&ai.SMOOTH_QUAD_TO&&(n.type=ai.QUAD_TO,r=isNaN(r)?s:r,i=isNaN(i)?a:i,n.x1=n.relative?s-r:2*s-r,n.y1=n.relative?a-i:2*a-i),n.type&ai.QUAD_TO?(r=n.relative?s+n.x1:n.x1,i=n.relative?a+n.y1:n.y1):(r=NaN,i=NaN),n)))}function $r(){let t=NaN,e=NaN;return Kr(((r,i,n)=>{if(r.type&ai.SMOOTH_QUAD_TO&&(r.type=ai.QUAD_TO,t=isNaN(t)?i:t,e=isNaN(e)?n:e,r.x1=r.relative?i-t:2*i-t,r.y1=r.relative?n-e:2*n-e),r.type&ai.QUAD_TO){t=r.relative?i+r.x1:r.x1,e=r.relative?n+r.y1:r.y1;const s=r.x1,a=r.y1;r.type=ai.CURVE_TO,r.x1=((r.relative?0:i)+2*s)/3,r.y1=((r.relative?0:n)+2*a)/3,r.x2=(r.x+2*s)/3,r.y2=(r.y+2*a)/3}else t=NaN,e=NaN;return r}))}function Kr(t){let e=0,r=0,i=NaN,n=NaN;return function(s){if(isNaN(i)&&!(s.type&ai.MOVE_TO))throw new Error("path must start with moveto");const a=t(s,e,r,i,n);return s.type&ai.CLOSE_PATH&&(e=i,r=n),"x"in s&&void 0!==s.x&&(e=s.relative?e+s.x:s.x),"y"in s&&void 0!==s.y&&(r=s.relative?r+s.y:s.y),s.type&ai.MOVE_TO&&(i=e,n=r),a}}function Jr(t,e,r,i,n,s){return Ur(t,e,r,i,n,s),Kr(((a,o,h,u)=>{const c=a.x1,l=a.x2,d=a.relative&&!isNaN(u),p=void 0!==a.x?a.x:d?0:o,f=void 0!==a.y?a.y:d?0:h;function m(t){return t*t}a.type&ai.HORIZ_LINE_TO&&0!==e&&(a.type=ai.LINE_TO,a.y=a.relative?0:h),a.type&ai.VERT_LINE_TO&&0!==r&&(a.type=ai.LINE_TO,a.x=a.relative?0:o),void 0!==a.x&&(a.x=a.x*t+f*r+(d?0:n)),void 0!==a.y&&(a.y=p*e+a.y*i+(d?0:s)),void 0!==a.x1&&(a.x1=a.x1*t+a.y1*r+(d?0:n)),void 0!==a.y1&&(a.y1=c*e+a.y1*i+(d?0:s)),void 0!==a.x2&&(a.x2=a.x2*t+a.y2*r+(d?0:n)),void 0!==a.y2&&(a.y2=l*e+a.y2*i+(d?0:s));const g=t*i-e*r;if(void 0!==a.xRot&&(1!==t||0!==e||0!==r||1!==i))if(0===g)delete a.rX,delete a.rY,delete a.xRot,delete a.lArcFlag,delete a.sweepFlag,a.type=ai.LINE_TO;else{const n=a.xRot*Math.PI/180,s=Math.sin(n),o=Math.cos(n),h=1/m(a.rX),u=1/m(a.rY),c=m(o)*h+m(s)*u,l=2*s*o*(h-u),d=m(s)*h+m(o)*u,p=c*i*i-l*e*i+d*e*e,f=l*(t*i+e*r)-2*(c*r*i+d*t*e),y=c*r*r-l*t*r+d*t*t,v=(Math.atan2(f,p-y)+Math.PI)%Math.PI/2,x=Math.sin(v),_=Math.cos(v);a.rX=Math.abs(g)/Math.sqrt(p*m(_)+f*x*_+y*m(x)),a.rY=Math.abs(g)/Math.sqrt(p*m(x)-f*x*_+y*m(_)),a.xRot=180*v/Math.PI}return void 0!==a.sweepFlag&&0>g&&(a.sweepFlag=+!a.sweepFlag),a}))}function ti(){return t=>d({},t)}const ei={ROUND:function(t=1e13){function e(e){return Math.round(e*t)/t}return Ur(t),function(t){return"x1"in t&&void 0!==t.x1&&(t.x1=e(t.x1)),"y1"in t&&void 0!==t.y1&&(t.y1=e(t.y1)),"x2"in t&&void 0!==t.x2&&(t.x2=e(t.x2)),"y2"in t&&void 0!==t.y2&&(t.y2=e(t.y2)),"x"in t&&void 0!==t.x&&(t.x=e(t.x)),"y"in t&&void 0!==t.y&&(t.y=e(t.y)),"rX"in t&&void 0!==t.rX&&(t.rX=e(t.rX)),"rY"in t&&void 0!==t.rY&&(t.rY=e(t.rY)),t}},TO_ABS:Qr,TO_REL:function(){return Kr(((t,e,r)=>(t.relative||(void 0!==t.x1&&(t.x1-=e),void 0!==t.y1&&(t.y1-=r),void 0!==t.x2&&(t.x2-=e),void 0!==t.y2&&(t.y2-=r),void 0!==t.x&&(t.x-=e),void 0!==t.y&&(t.y-=r),t.relative=!0),t)))},NORMALIZE_HVZ:function(t=!0,e=!0,r=!0,i=!0){return Kr(((n,s,a,o,h)=>{if(isNaN(o)&&!(n.type&ai.MOVE_TO))throw new Error("path must start with moveto");if(e&&n.type&ai.HORIZ_LINE_TO&&(n.type=ai.LINE_TO,n.y=n.relative?0:a),r&&n.type&ai.VERT_LINE_TO&&(n.type=ai.LINE_TO,n.x=n.relative?0:s),t&&n.type&ai.CLOSE_PATH&&(n.type=ai.LINE_TO,n.x=n.relative?o-s:o,n.y=n.relative?h-a:h),n.type&ai.ARC&&(0===n.rX||0===n.rY)&&(n.type=ai.LINE_TO,delete n.rX,delete n.rY,delete n.xRot,delete n.lArcFlag,delete n.sweepFlag),i&&n.type&ai.QUAD_TO&&Gr([s,a],n.relative?[s+n.x1,a+n.y1]:[n.x1,n.y1],n.relative?[s+n.x,a+n.y]:[n.x,n.y])&&(n.type=ai.LINE_TO,delete n.x1,delete n.y1),i&&n.type&ai.CURVE_TO){const t=[s,a],e=n.relative?[s+n.x1,a+n.y1]:[n.x1,n.y1],r=n.relative?[s+n.x2,a+n.y2]:[n.x2,n.y2],i=n.relative?[s+n.x,a+n.y]:[n.x,n.y];Gr(t,e,i)&&Gr(t,r,i)&&(n.type=ai.LINE_TO,delete n.x1,delete n.y1,delete n.x2,delete n.y2)}return n}))},NORMALIZE_ST:Zr,QT_TO_C:$r,INFO:Kr,SANITIZE:function(t=0){Ur(t);let e=NaN,r=NaN,i=NaN,n=NaN;return Kr(((s,a,o,h,u)=>{const c=Math.abs;let l=!1,d=0,p=0;if(s.type&ai.SMOOTH_CURVE_TO&&(d=isNaN(e)?0:a-e,p=isNaN(r)?0:o-r),s.type&(ai.CURVE_TO|ai.SMOOTH_CURVE_TO)?(e=s.relative?a+s.x2:s.x2,r=s.relative?o+s.y2:s.y2):(e=NaN,r=NaN),s.type&ai.SMOOTH_QUAD_TO?(i=isNaN(i)?a:2*a-i,n=isNaN(n)?o:2*o-n):s.type&ai.QUAD_TO?(i=s.relative?a+s.x1:s.x1,n=s.relative?o+s.y1:s.y2):(i=NaN,n=NaN),s.type&ai.LINE_COMMANDS||s.type&ai.ARC&&(0===s.rX||0===s.rY||!s.lArcFlag)||s.type&ai.CURVE_TO||s.type&ai.SMOOTH_CURVE_TO||s.type&ai.QUAD_TO||s.type&ai.SMOOTH_QUAD_TO){const e=void 0===s.x?0:s.relative?s.x:s.x-a,r=void 0===s.y?0:s.relative?s.y:s.y-o;d=isNaN(i)?void 0===s.x1?d:s.relative?s.x:s.x1-a:i-a,p=isNaN(n)?void 0===s.y1?p:s.relative?s.y:s.y1-o:n-o;const h=void 0===s.x2?0:s.relative?s.x:s.x2-a,u=void 0===s.y2?0:s.relative?s.y:s.y2-o;c(e)<=t&&c(r)<=t&&c(d)<=t&&c(p)<=t&&c(h)<=t&&c(u)<=t&&(l=!0)}return s.type&ai.CLOSE_PATH&&c(a-h)<=t&&c(o-u)<=t&&(l=!0),l?[]:s}))},MATRIX:Jr,ROTATE:function(t,e=0,r=0){Ur(t,e,r);const i=Math.sin(t),n=Math.cos(t);return Jr(n,i,-i,n,e-e*n+r*i,r-e*i-r*n)},TRANSLATE:function(t,e=0){return Ur(t,e),Jr(1,0,0,1,t,e)},SCALE:function(t,e=t){return Ur(t,e),Jr(t,0,0,e,0,0)},SKEW_X:function(t){return Ur(t),Jr(1,0,Math.tan(t),1,0,0)},SKEW_Y:function(t){return Ur(t),Jr(1,Math.tan(t),0,1,0,0)},X_AXIS_SYMMETRY:function(t=0){return Ur(t),Jr(-1,0,0,1,t,0)},Y_AXIS_SYMMETRY:function(t=0){return Ur(t),Jr(1,0,0,-1,0,t)},A_TO_C:function(){return Kr(((t,e,r)=>ai.ARC===t.type?function(t,e,r){t.cX||Fr(t,e,r);const i=t.xRot/180*Vr;if(Math.abs(t.rX)<1e-10||Math.abs(t.rY)<1e-10)return[{relative:t.relative,type:ai.CURVE_TO,x1:e+(t.x-e)/3,y1:r+(t.y-r)/3,x2:e+2*(t.x-e)/3,y2:r+2*(t.y-r)/3,x:t.x,y:t.y}];const n=Math.min(t.phi1,t.phi2),s=Math.max(t.phi1,t.phi2)-n,a=Math.ceil(s/90),o=new Array(a);let h=e,u=r;const c=(e,r)=>{const[n,s]=Pr([e*t.rX,r*t.rY],i);return[t.cX+n,t.cY+s]};for(let e=0;e<a;e++){const r=zr(t.phi1,t.phi2,e/a),i=zr(t.phi1,t.phi2,(e+1)/a),n=i-r,s=4/3*Math.tan(n*Hr/4),l=Math.cos(r*Hr)-s*Math.sin(r*Hr),d=Math.sin(r*Hr)+s*Math.cos(r*Hr),p=Math.cos(i*Hr),f=Math.sin(i*Hr),m=p+s*f,g=f-s*p,y=c(l,d),v=c(m,g),x=c(p,f),_={relative:t.relative,type:ai.CURVE_TO,x:x[0],y:x[1],x1:y[0],y1:y[1],x2:v[0],y2:v[1]};t.relative&&(_.x1-=h,_.y1-=u,_.x2-=h,_.y2-=u,_.x-=h,_.y-=u),h=x[0],u=x[1],o[e]=_}return o}(t,t.relative?0:e,t.relative?0:r):t))},ANNOTATE_ARCS:function(){return Kr(((t,e,r)=>(t.relative&&(e=0,r=0),ai.ARC===t.type&&Fr(t,e,r),t)))},CLONE:ti,CALCULATE_BOUNDS:function(){const t=ti(),e=Qr(),r=$r(),i=Zr(),n=Kr(((s,a,o)=>{const h=i(r(e(t(s))));function u(t){t>n.maxX&&(n.maxX=t),t<n.minX&&(n.minX=t)}function c(t){t>n.maxY&&(n.maxY=t),t<n.minY&&(n.minY=t)}if(h.type&ai.DRAWING_COMMANDS&&(u(a),c(o)),h.type&ai.HORIZ_LINE_TO&&u(h.x),h.type&ai.VERT_LINE_TO&&c(h.y),h.type&ai.LINE_TO&&(u(h.x),c(h.y)),h.type&ai.CURVE_TO){u(h.x),c(h.y);const t=Wr(a,h.x1,h.x2,h.x);for(const e of t)0<e&&1>e&&u(Yr(a,h.x1,h.x2,h.x,e));const e=Wr(o,h.y1,h.y2,h.y);for(const t of e)0<t&&1>t&&c(Yr(o,h.y1,h.y2,h.y,t))}if(h.type&ai.ARC){u(h.x),c(h.y),Fr(h,a,o);const t=h.xRot/180*Math.PI,e=Math.cos(t)*h.rX,r=Math.sin(t)*h.rX,i=-Math.sin(t)*h.rY,n=Math.cos(t)*h.rY,[s,l]=h.phi1<h.phi2?[h.phi1,h.phi2]:-180>h.phi2?[h.phi2+360,h.phi1+360]:[h.phi2,h.phi1],d=([t,e])=>{const r=180*Math.atan2(e,t)/Math.PI;return r<s?r+360:r},p=qr(i,-e,0).map(d);for(const t of p)t>s&&t<l&&u(jr(h.cX,e,i,t));const f=qr(n,-r,0).map(d);for(const t of f)t>s&&t<l&&c(jr(h.cY,r,n,t))}return s}));return n.minX=1/0,n.maxX=-1/0,n.minY=1/0,n.maxY=-1/0,n},REVERSE_PATH:function(t,e=!0){if(t.length<2)return t;const r=ei.INFO(((t,e,r)=>{var i,n,s;return p(d({},t),{x:null!=(i=t.x)?i:e,y:null!=(n=t.y)?n:r,relative:null!=(s=t.relative)&&s})})),i=[];let n=[];for(const s of t){const t=r(s);t.type===ai.MOVE_TO&&n.length>0&&(e?i.push(...Xr(n)):i.unshift(...Xr(n)),n=[]),n.push(t)}return n.length>0&&(e?i.push(...Xr(n)):i.unshift(...Xr(n))),i}};let ri=class{round(t){return this.transform(ei.ROUND(t))}toAbs(){return this.transform(ei.TO_ABS())}toRel(){return this.transform(ei.TO_REL())}normalizeHVZ(t,e,r){return this.transform(ei.NORMALIZE_HVZ(t,e,r))}normalizeST(){return this.transform(ei.NORMALIZE_ST())}qtToC(){return this.transform(ei.QT_TO_C())}aToC(){return this.transform(ei.A_TO_C())}sanitize(t){return this.transform(ei.SANITIZE(t))}translate(t,e){return this.transform(ei.TRANSLATE(t,e))}scale(t,e){return this.transform(ei.SCALE(t,e))}rotate(t,e,r){return this.transform(ei.ROTATE(t,e,r))}matrix(t,e,r,i,n,s){return this.transform(ei.MATRIX(t,e,r,i,n,s))}skewX(t){return this.transform(ei.SKEW_X(t))}skewY(t){return this.transform(ei.SKEW_Y(t))}xSymmetry(t){return this.transform(ei.X_AXIS_SYMMETRY(t))}ySymmetry(t){return this.transform(ei.Y_AXIS_SYMMETRY(t))}annotateArcs(){return this.transform(ei.ANNOTATE_ARCS())}};const ii=t=>" "===t||"\t"===t||"\r"===t||"\n"===t,ni=t=>"0".charCodeAt(0)<=t.charCodeAt(0)&&t.charCodeAt(0)<="9".charCodeAt(0);let si=class extends ri{constructor(){super(),f(this,"curNumber",""),f(this,"curCommandType",-1),f(this,"curCommandRelative",!1),f(this,"canParseCommandOrComma",!0),f(this,"curNumberHasExp",!1),f(this,"curNumberHasExpDigits",!1),f(this,"curNumberHasDecimal",!1),f(this,"curArgs",[])}finish(t=[]){if(this.parse(" ",t),0!==this.curArgs.length||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return t}parse(t,e=[]){const r=t=>{e.push(t),this.curArgs.length=0,this.canParseCommandOrComma=!0};for(let i=0;i<t.length;i++){const n=t[i],s=!(this.curCommandType!==ai.ARC||3!==this.curArgs.length&&4!==this.curArgs.length||1!==this.curNumber.length||"0"!==this.curNumber&&"1"!==this.curNumber),a=ni(n)&&("0"===this.curNumber&&"0"===n||s);if(!ni(n)||a)if("e"!==n&&"E"!==n)if("-"!==n&&"+"!==n||!this.curNumberHasExp||this.curNumberHasExpDigits)if("."!==n||this.curNumberHasExp||this.curNumberHasDecimal||s){if(this.curNumber&&-1!==this.curCommandType){const t=Number(this.curNumber);if(isNaN(t))throw new SyntaxError(`Invalid number ending at ${i}`);if(this.curCommandType===ai.ARC)if(0===this.curArgs.length||1===this.curArgs.length){if(0>t)throw new SyntaxError(`Expected positive number, got "${t}" at index "${i}"`)}else if((3===this.curArgs.length||4===this.curArgs.length)&&"0"!==this.curNumber&&"1"!==this.curNumber)throw new SyntaxError(`Expected a flag, got "${this.curNumber}" at index "${i}"`);this.curArgs.push(t),this.curArgs.length===oi[this.curCommandType]&&(ai.HORIZ_LINE_TO===this.curCommandType?r({type:ai.HORIZ_LINE_TO,relative:this.curCommandRelative,x:t}):ai.VERT_LINE_TO===this.curCommandType?r({type:ai.VERT_LINE_TO,relative:this.curCommandRelative,y:t}):this.curCommandType===ai.MOVE_TO||this.curCommandType===ai.LINE_TO||this.curCommandType===ai.SMOOTH_QUAD_TO?(r({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),ai.MOVE_TO===this.curCommandType&&(this.curCommandType=ai.LINE_TO)):this.curCommandType===ai.CURVE_TO?r({type:ai.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===ai.SMOOTH_CURVE_TO?r({type:ai.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===ai.QUAD_TO?r({type:ai.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===ai.ARC&&r({type:ai.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!ii(n))if(","===n&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if("+"!==n&&"-"!==n&&"."!==n)if(a)this.curNumber=n,this.curNumberHasDecimal=!1;else{if(0!==this.curArgs.length)throw new SyntaxError(`Unterminated command at index ${i}.`);if(!this.canParseCommandOrComma)throw new SyntaxError(`Unexpected character "${n}" at index ${i}. Command cannot follow comma`);if(this.canParseCommandOrComma=!1,"z"!==n&&"Z"!==n)if("h"===n||"H"===n)this.curCommandType=ai.HORIZ_LINE_TO,this.curCommandRelative="h"===n;else if("v"===n||"V"===n)this.curCommandType=ai.VERT_LINE_TO,this.curCommandRelative="v"===n;else if("m"===n||"M"===n)this.curCommandType=ai.MOVE_TO,this.curCommandRelative="m"===n;else if("l"===n||"L"===n)this.curCommandType=ai.LINE_TO,this.curCommandRelative="l"===n;else if("c"===n||"C"===n)this.curCommandType=ai.CURVE_TO,this.curCommandRelative="c"===n;else if("s"===n||"S"===n)this.curCommandType=ai.SMOOTH_CURVE_TO,this.curCommandRelative="s"===n;else if("q"===n||"Q"===n)this.curCommandType=ai.QUAD_TO,this.curCommandRelative="q"===n;else if("t"===n||"T"===n)this.curCommandType=ai.SMOOTH_QUAD_TO,this.curCommandRelative="t"===n;else{if("a"!==n&&"A"!==n)throw new SyntaxError(`Unexpected character "${n}" at index ${i}.`);this.curCommandType=ai.ARC,this.curCommandRelative="a"===n}else e.push({type:ai.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=n,this.curNumberHasDecimal="."===n}else this.curNumber+=n,this.curNumberHasDecimal=!0;else this.curNumber+=n;else this.curNumber+=n,this.curNumberHasExp=!0;else this.curNumber+=n,this.curNumberHasExpDigits=this.curNumberHasExp}return e}transform(t){return Object.create(this,{parse:{value(e,r=[]){const i=Object.getPrototypeOf(this).parse.call(this,e);for(const e of i){const i=t(e);Array.isArray(i)?r.push(...i):r.push(i)}return r}}})}},ai=(e=class extends ri{constructor(t){super(),f(this,"commands"),this.commands="string"==typeof t?e.parse(t):t}encode(){return e.encode(this.commands)}getBounds(){const t=ei.CALCULATE_BOUNDS();return this.transform(t),t}transform(t){const e=[];for(const r of this.commands){const i=t(r);Array.isArray(i)?e.push(...i):e.push(i)}return this.commands=e,this}reverse(t=!0){return this.commands=ei.REVERSE_PATH(this.commands,t),this}static encode(t){return function(t){let e="";Array.isArray(t)||(t=[t]);for(let r=0;r<t.length;r++){const i=t[r];if(i.type===ai.CLOSE_PATH)e+="z";else if(i.type===ai.HORIZ_LINE_TO)e+=(i.relative?"h":"H")+i.x;else if(i.type===ai.VERT_LINE_TO)e+=(i.relative?"v":"V")+i.y;else if(i.type===ai.MOVE_TO)e+=(i.relative?"m":"M")+i.x+kr+i.y;else if(i.type===ai.LINE_TO)e+=(i.relative?"l":"L")+i.x+kr+i.y;else if(i.type===ai.CURVE_TO)e+=(i.relative?"c":"C")+i.x1+kr+i.y1+kr+i.x2+kr+i.y2+kr+i.x+kr+i.y;else if(i.type===ai.SMOOTH_CURVE_TO)e+=(i.relative?"s":"S")+i.x2+kr+i.y2+kr+i.x+kr+i.y;else if(i.type===ai.QUAD_TO)e+=(i.relative?"q":"Q")+i.x1+kr+i.y1+kr+i.x+kr+i.y;else if(i.type===ai.SMOOTH_QUAD_TO)e+=(i.relative?"t":"T")+i.x+kr+i.y;else{if(i.type!==ai.ARC)throw new Error(`Unexpected command type "${null==i?void 0:i.type}" at index ${r}.`);e+=(i.relative?"a":"A")+i.rX+kr+i.rY+kr+i.xRot+kr+ +i.lArcFlag+kr+ +i.sweepFlag+kr+i.x+kr+i.y}}return e}(t)}static parse(t){const e=new si,r=[];return e.parse(t,r),e.finish(r),r}},f(e,"CLOSE_PATH",1),f(e,"MOVE_TO",2),f(e,"HORIZ_LINE_TO",4),f(e,"VERT_LINE_TO",8),f(e,"LINE_TO",16),f(e,"CURVE_TO",32),f(e,"SMOOTH_CURVE_TO",64),f(e,"QUAD_TO",128),f(e,"SMOOTH_QUAD_TO",256),f(e,"ARC",512),f(e,"LINE_COMMANDS",e.LINE_TO|e.HORIZ_LINE_TO|e.VERT_LINE_TO),f(e,"DRAWING_COMMANDS",e.HORIZ_LINE_TO|e.VERT_LINE_TO|e.LINE_TO|e.CURVE_TO|e.SMOOTH_CURVE_TO|e.QUAD_TO|e.SMOOTH_QUAD_TO|e.ARC),e);const oi={[ai.MOVE_TO]:2,[ai.LINE_TO]:2,[ai.HORIZ_LINE_TO]:1,[ai.VERT_LINE_TO]:1,[ai.CLOSE_PATH]:0,[ai.QUAD_TO]:4,[ai.SMOOTH_QUAD_TO]:2,[ai.CURVE_TO]:6,[ai.SMOOTH_CURVE_TO]:4,[ai.ARC]:7},hi=" ";class ui{round(t){return this.transform(Li.ROUND(t))}toAbs(){return this.transform(Li.TO_ABS())}toRel(){return this.transform(Li.TO_REL())}normalizeHVZ(t,e,r){return this.transform(Li.NORMALIZE_HVZ(t,e,r))}normalizeST(){return this.transform(Li.NORMALIZE_ST())}qtToC(){return this.transform(Li.QT_TO_C())}aToC(){return this.transform(Li.A_TO_C())}sanitize(t){return this.transform(Li.SANITIZE(t))}translate(t,e){return this.transform(Li.TRANSLATE(t,e))}scale(t,e){return this.transform(Li.SCALE(t,e))}rotate(t,e,r){return this.transform(Li.ROTATE(t,e,r))}matrix(t,e,r,i,n,s){return this.transform(Li.MATRIX(t,e,r,i,n,s))}skewX(t){return this.transform(Li.SKEW_X(t))}skewY(t){return this.transform(Li.SKEW_Y(t))}xSymmetry(t){return this.transform(Li.X_AXIS_SYMMETRY(t))}ySymmetry(t){return this.transform(Li.Y_AXIS_SYMMETRY(t))}annotateArcs(){return this.transform(Li.ANNOTATE_ARCS())}}const ci=t=>" "===t||"\t"===t||"\r"===t||"\n"===t,li=t=>"0".charCodeAt(0)<=t.charCodeAt(0)&&t.charCodeAt(0)<="9".charCodeAt(0);class di extends ui{constructor(){super(),this.curNumber="",this.curCommandType=-1,this.curCommandRelative=!1,this.canParseCommandOrComma=!0,this.curNumberHasExp=!1,this.curNumberHasExpDigits=!1,this.curNumberHasDecimal=!1,this.curArgs=[]}finish(t=[]){if(this.parse(" ",t),0!==this.curArgs.length||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return t}parse(t,e=[]){const r=t=>{e.push(t),this.curArgs.length=0,this.canParseCommandOrComma=!0};for(let i=0;i<t.length;i++){const n=t[i],s=!(this.curCommandType!==fi.ARC||3!==this.curArgs.length&&4!==this.curArgs.length||1!==this.curNumber.length||"0"!==this.curNumber&&"1"!==this.curNumber),a=li(n)&&("0"===this.curNumber&&"0"===n||s);if(!li(n)||a)if("e"!==n&&"E"!==n)if("-"!==n&&"+"!==n||!this.curNumberHasExp||this.curNumberHasExpDigits)if("."!==n||this.curNumberHasExp||this.curNumberHasDecimal||s){if(this.curNumber&&-1!==this.curCommandType){const t=Number(this.curNumber);if(isNaN(t))throw new SyntaxError(`Invalid number ending at ${i}`);if(this.curCommandType===fi.ARC)if(0===this.curArgs.length||1===this.curArgs.length){if(0>t)throw new SyntaxError(`Expected positive number, got "${t}" at index "${i}"`)}else if((3===this.curArgs.length||4===this.curArgs.length)&&"0"!==this.curNumber&&"1"!==this.curNumber)throw new SyntaxError(`Expected a flag, got "${this.curNumber}" at index "${i}"`);this.curArgs.push(t),this.curArgs.length===mi[this.curCommandType]&&(fi.HORIZ_LINE_TO===this.curCommandType?r({type:fi.HORIZ_LINE_TO,relative:this.curCommandRelative,x:t}):fi.VERT_LINE_TO===this.curCommandType?r({type:fi.VERT_LINE_TO,relative:this.curCommandRelative,y:t}):this.curCommandType===fi.MOVE_TO||this.curCommandType===fi.LINE_TO||this.curCommandType===fi.SMOOTH_QUAD_TO?(r({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),fi.MOVE_TO===this.curCommandType&&(this.curCommandType=fi.LINE_TO)):this.curCommandType===fi.CURVE_TO?r({type:fi.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===fi.SMOOTH_CURVE_TO?r({type:fi.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===fi.QUAD_TO?r({type:fi.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===fi.ARC&&r({type:fi.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!ci(n))if(","===n&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if("+"!==n&&"-"!==n&&"."!==n)if(a)this.curNumber=n,this.curNumberHasDecimal=!1;else{if(0!==this.curArgs.length)throw new SyntaxError(`Unterminated command at index ${i}.`);if(!this.canParseCommandOrComma)throw new SyntaxError(`Unexpected character "${n}" at index ${i}. Command cannot follow comma`);if(this.canParseCommandOrComma=!1,"z"!==n&&"Z"!==n)if("h"===n||"H"===n)this.curCommandType=fi.HORIZ_LINE_TO,this.curCommandRelative="h"===n;else if("v"===n||"V"===n)this.curCommandType=fi.VERT_LINE_TO,this.curCommandRelative="v"===n;else if("m"===n||"M"===n)this.curCommandType=fi.MOVE_TO,this.curCommandRelative="m"===n;else if("l"===n||"L"===n)this.curCommandType=fi.LINE_TO,this.curCommandRelative="l"===n;else if("c"===n||"C"===n)this.curCommandType=fi.CURVE_TO,this.curCommandRelative="c"===n;else if("s"===n||"S"===n)this.curCommandType=fi.SMOOTH_CURVE_TO,this.curCommandRelative="s"===n;else if("q"===n||"Q"===n)this.curCommandType=fi.QUAD_TO,this.curCommandRelative="q"===n;else if("t"===n||"T"===n)this.curCommandType=fi.SMOOTH_QUAD_TO,this.curCommandRelative="t"===n;else{if("a"!==n&&"A"!==n)throw new SyntaxError(`Unexpected character "${n}" at index ${i}.`);this.curCommandType=fi.ARC,this.curCommandRelative="a"===n}else e.push({type:fi.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=n,this.curNumberHasDecimal="."===n}else this.curNumber+=n,this.curNumberHasDecimal=!0;else this.curNumber+=n;else this.curNumber+=n,this.curNumberHasExp=!0;else this.curNumber+=n,this.curNumberHasExpDigits=this.curNumberHasExp}return e}transform(t){return Object.create(this,{parse:{value(e,r=[]){const i=Object.getPrototypeOf(this).parse.call(this,e);for(const e of i){const i=t(e);Array.isArray(i)?r.push(...i):r.push(i)}return r}}})}}const pi=class t extends ui{constructor(e){super(),this.commands="string"==typeof e?t.parse(e):e}encode(){return t.encode(this.commands)}getBounds(){const t=Li.CALCULATE_BOUNDS();return this.transform(t),t}transform(t){const e=[];for(const r of this.commands){const i=t(r);Array.isArray(i)?e.push(...i):e.push(i)}return this.commands=e,this}reverse(t=!0){return this.commands=Li.REVERSE_PATH(this.commands,t),this}static encode(t){return function(t){let e="";Array.isArray(t)||(t=[t]);for(let r=0;r<t.length;r++){const i=t[r];if(i.type===fi.CLOSE_PATH)e+="z";else if(i.type===fi.HORIZ_LINE_TO)e+=(i.relative?"h":"H")+i.x;else if(i.type===fi.VERT_LINE_TO)e+=(i.relative?"v":"V")+i.y;else if(i.type===fi.MOVE_TO)e+=(i.relative?"m":"M")+i.x+hi+i.y;else if(i.type===fi.LINE_TO)e+=(i.relative?"l":"L")+i.x+hi+i.y;else if(i.type===fi.CURVE_TO)e+=(i.relative?"c":"C")+i.x1+hi+i.y1+hi+i.x2+hi+i.y2+hi+i.x+hi+i.y;else if(i.type===fi.SMOOTH_CURVE_TO)e+=(i.relative?"s":"S")+i.x2+hi+i.y2+hi+i.x+hi+i.y;else if(i.type===fi.QUAD_TO)e+=(i.relative?"q":"Q")+i.x1+hi+i.y1+hi+i.x+hi+i.y;else if(i.type===fi.SMOOTH_QUAD_TO)e+=(i.relative?"t":"T")+i.x+hi+i.y;else{if(i.type!==fi.ARC)throw new Error(`Unexpected command type "${null==i?void 0:i.type}" at index ${r}.`);e+=(i.relative?"a":"A")+i.rX+hi+i.rY+hi+i.xRot+hi+ +i.lArcFlag+hi+ +i.sweepFlag+hi+i.x+hi+i.y}}return e}(t)}static parse(t){const e=new di,r=[];return e.parse(t,r),e.finish(r),r}};pi.CLOSE_PATH=1,pi.MOVE_TO=2,pi.HORIZ_LINE_TO=4,pi.VERT_LINE_TO=8,pi.LINE_TO=16,pi.CURVE_TO=32,pi.SMOOTH_CURVE_TO=64,pi.QUAD_TO=128,pi.SMOOTH_QUAD_TO=256,pi.ARC=512,pi.LINE_COMMANDS=pi.LINE_TO|pi.HORIZ_LINE_TO|pi.VERT_LINE_TO,pi.DRAWING_COMMANDS=pi.HORIZ_LINE_TO|pi.VERT_LINE_TO|pi.LINE_TO|pi.CURVE_TO|pi.SMOOTH_CURVE_TO|pi.QUAD_TO|pi.SMOOTH_QUAD_TO|pi.ARC;let fi=pi;const mi={[fi.MOVE_TO]:2,[fi.LINE_TO]:2,[fi.HORIZ_LINE_TO]:1,[fi.VERT_LINE_TO]:1,[fi.CLOSE_PATH]:0,[fi.QUAD_TO]:4,[fi.SMOOTH_QUAD_TO]:2,[fi.CURVE_TO]:6,[fi.SMOOTH_CURVE_TO]:4,[fi.ARC]:7};function gi([t,e],r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function yi(...t){for(let e=0;e<t.length;e++)if("number"!=typeof t[e])throw new Error(`assertNumbers arguments[${e}] is not a number. ${typeof t[e]} == typeof ${t[e]}`);return!0}const vi=Math.PI;function xi(t,e,r){t.lArcFlag=0===t.lArcFlag?0:1,t.sweepFlag=0===t.sweepFlag?0:1;let{rX:i,rY:n}=t;const{x:s,y:a}=t;if(Math.abs(i)<1e-10||Math.abs(n)<1e-10)return t.rX=0,t.rY=0,t.cX=(e+s)/2,t.cY=(r+a)/2,t.phi1=0,void(t.phi2=0);i=Math.abs(t.rX),n=Math.abs(t.rY);const o=t.xRot/180*vi,[h,u]=gi([(e-s)/2,(r-a)/2],-o),c=Math.pow(h,2)/Math.pow(i,2)+Math.pow(u,2)/Math.pow(n,2);1<c&&(i*=Math.sqrt(c),n*=Math.sqrt(c)),t.rX=i,t.rY=n;const l=Math.pow(i,2)*Math.pow(u,2)+Math.pow(n,2)*Math.pow(h,2),d=(t.lArcFlag!==t.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(i,2)*Math.pow(n,2)-l)/l)),p=i*u/n*d,f=-n*h/i*d,m=gi([p,f],o);t.cX=m[0]+(e+s)/2,t.cY=m[1]+(r+a)/2,t.phi1=Math.atan2((u-f)/n,(h-p)/i),t.phi2=Math.atan2((-u-f)/n,(-h-p)/i),0===t.sweepFlag&&t.phi2>t.phi1&&(t.phi2-=2*vi),1===t.sweepFlag&&t.phi2<t.phi1&&(t.phi2+=2*vi),t.phi1*=180/vi,t.phi2*=180/vi}function _i(t,e,r){yi(t,e,r);const i=t*t+e*e-r*r;if(0>i)return[];if(0===i)return[[t*r/(t*t+e*e),e*r/(t*t+e*e)]];const n=Math.sqrt(i);return[[(t*r+e*n)/(t*t+e*e),(e*r-t*n)/(t*t+e*e)],[(t*r-e*n)/(t*t+e*e),(e*r+t*n)/(t*t+e*e)]]}const bi=Math.PI/180;function wi(t,e,r){return(1-r)*t+r*e}function Ei(t,e,r,i){return t+Math.cos(i/180*vi)*e+Math.sin(i/180*vi)*r}function Ti(t,e,r,i){const n=1e-6,s=e-t,a=r-e,o=3*s+3*(i-r)-6*a,h=6*(a-s),u=3*s;return Math.abs(o)<n?Math.abs(h)<n?[]:[-u/h]:function(t,e,r=1e-6){const i=t*t/4-e;if(i<-r)return[];if(i<=r)return[-t/2];const n=Math.sqrt(i);return[-t/2-n,-t/2+n]}(h/o,u/o,n)}function Si(t,e,r,i,n){const s=1-n;return t*(s*s*s)+e*(3*s*s*n)+r*(3*s*n*n)+i*(n*n*n)}function Ai(t,e,r){const i=e[0]-t[0],n=e[1]-t[1],s=r[0]-t[0],a=r[1]-t[1],o=i*a-n*s;if(!(Math.abs(o)<1e-10))return!1;const h=i*s+n*a,u=s*s+a*a;return 0<=h&&h<=u&&i*i+n*n<=u}function Ni(t){var e;const r=(null==(e=t[t.length-1])?void 0:e.type)===fi.CLOSE_PATH,i=r?t.length-2:t.length-1,n=[{type:fi.MOVE_TO,relative:!1,x:t[i].x,y:t[i].y}];for(let e=i;e>0;e--){const r=t[e],i=t[e-1];if(r.relative)throw new Error("Relative command are not supported convert first with `toAbs()`");switch(r.type){case fi.HORIZ_LINE_TO:n.push({type:fi.HORIZ_LINE_TO,relative:!1,x:i.x});break;case fi.VERT_LINE_TO:n.push({type:fi.VERT_LINE_TO,relative:!1,y:i.y});break;case fi.LINE_TO:case fi.MOVE_TO:n.push({type:fi.LINE_TO,relative:!1,x:i.x,y:i.y});break;case fi.CURVE_TO:n.push({type:fi.CURVE_TO,relative:!1,x:i.x,y:i.y,x1:r.x2,y1:r.y2,x2:r.x1,y2:r.y1});break;case fi.SMOOTH_CURVE_TO:throw new Error("Unsupported command: S (smooth cubic bezier)");case fi.SMOOTH_QUAD_TO:throw new Error("Unsupported command: T (smooth quadratic bezier)");case fi.ARC:throw new Error("Unsupported command: A (arc)");case fi.QUAD_TO:throw new Error("Unsupported command: Q (quadratic bezier)")}}return r&&n.push({type:fi.CLOSE_PATH}),n}function Ci(){return Ii(((t,e,r)=>(t.relative&&(void 0!==t.x1&&(t.x1+=e),void 0!==t.y1&&(t.y1+=r),void 0!==t.x2&&(t.x2+=e),void 0!==t.y2&&(t.y2+=r),void 0!==t.x&&(t.x+=e),void 0!==t.y&&(t.y+=r),t.relative=!1),t)))}function Mi(){let t=NaN,e=NaN,r=NaN,i=NaN;return Ii(((n,s,a)=>(n.type&fi.SMOOTH_CURVE_TO&&(n.type=fi.CURVE_TO,t=isNaN(t)?s:t,e=isNaN(e)?a:e,n.x1=n.relative?s-t:2*s-t,n.y1=n.relative?a-e:2*a-e),n.type&fi.CURVE_TO?(t=n.relative?s+n.x2:n.x2,e=n.relative?a+n.y2:n.y2):(t=NaN,e=NaN),n.type&fi.SMOOTH_QUAD_TO&&(n.type=fi.QUAD_TO,r=isNaN(r)?s:r,i=isNaN(i)?a:i,n.x1=n.relative?s-r:2*s-r,n.y1=n.relative?a-i:2*a-i),n.type&fi.QUAD_TO?(r=n.relative?s+n.x1:n.x1,i=n.relative?a+n.y1:n.y1):(r=NaN,i=NaN),n)))}function Oi(){let t=NaN,e=NaN;return Ii(((r,i,n)=>{if(r.type&fi.SMOOTH_QUAD_TO&&(r.type=fi.QUAD_TO,t=isNaN(t)?i:t,e=isNaN(e)?n:e,r.x1=r.relative?i-t:2*i-t,r.y1=r.relative?n-e:2*n-e),r.type&fi.QUAD_TO){t=r.relative?i+r.x1:r.x1,e=r.relative?n+r.y1:r.y1;const s=r.x1,a=r.y1;r.type=fi.CURVE_TO,r.x1=((r.relative?0:i)+2*s)/3,r.y1=((r.relative?0:n)+2*a)/3,r.x2=(r.x+2*s)/3,r.y2=(r.y+2*a)/3}else t=NaN,e=NaN;return r}))}function Ii(t){let e=0,r=0,i=NaN,n=NaN;return function(s){if(isNaN(i)&&!(s.type&fi.MOVE_TO))throw new Error("path must start with moveto");const a=t(s,e,r,i,n);return s.type&fi.CLOSE_PATH&&(e=i,r=n),"x"in s&&void 0!==s.x&&(e=s.relative?e+s.x:s.x),"y"in s&&void 0!==s.y&&(r=s.relative?r+s.y:s.y),s.type&fi.MOVE_TO&&(i=e,n=r),a}}function Ri(t,e,r,i,n,s){return yi(t,e,r,i,n,s),Ii(((a,o,h,u)=>{const c=a.x1,l=a.x2,d=a.relative&&!isNaN(u),p=void 0!==a.x?a.x:d?0:o,f=void 0!==a.y?a.y:d?0:h;function m(t){return t*t}a.type&fi.HORIZ_LINE_TO&&0!==e&&(a.type=fi.LINE_TO,a.y=a.relative?0:h),a.type&fi.VERT_LINE_TO&&0!==r&&(a.type=fi.LINE_TO,a.x=a.relative?0:o),void 0!==a.x&&(a.x=a.x*t+f*r+(d?0:n)),void 0!==a.y&&(a.y=p*e+a.y*i+(d?0:s)),void 0!==a.x1&&(a.x1=a.x1*t+a.y1*r+(d?0:n)),void 0!==a.y1&&(a.y1=c*e+a.y1*i+(d?0:s)),void 0!==a.x2&&(a.x2=a.x2*t+a.y2*r+(d?0:n)),void 0!==a.y2&&(a.y2=l*e+a.y2*i+(d?0:s));const g=t*i-e*r;if(void 0!==a.xRot&&(1!==t||0!==e||0!==r||1!==i))if(0===g)delete a.rX,delete a.rY,delete a.xRot,delete a.lArcFlag,delete a.sweepFlag,a.type=fi.LINE_TO;else{const n=a.xRot*Math.PI/180,s=Math.sin(n),o=Math.cos(n),h=1/m(a.rX),u=1/m(a.rY),c=m(o)*h+m(s)*u,l=2*s*o*(h-u),d=m(s)*h+m(o)*u,p=c*i*i-l*e*i+d*e*e,f=l*(t*i+e*r)-2*(c*r*i+d*t*e),y=c*r*r-l*t*r+d*t*t,v=(Math.atan2(f,p-y)+Math.PI)%Math.PI/2,x=Math.sin(v),_=Math.cos(v);a.rX=Math.abs(g)/Math.sqrt(p*m(_)+f*x*_+y*m(x)),a.rY=Math.abs(g)/Math.sqrt(p*m(x)-f*x*_+y*m(_)),a.xRot=180*v/Math.PI}return void 0!==a.sweepFlag&&0>g&&(a.sweepFlag=+!a.sweepFlag),a}))}function Di(){return t=>d({},t)}const Li={ROUND:function(t=1e13){function e(e){return Math.round(e*t)/t}return yi(t),function(t){return"x1"in t&&void 0!==t.x1&&(t.x1=e(t.x1)),"y1"in t&&void 0!==t.y1&&(t.y1=e(t.y1)),"x2"in t&&void 0!==t.x2&&(t.x2=e(t.x2)),"y2"in t&&void 0!==t.y2&&(t.y2=e(t.y2)),"x"in t&&void 0!==t.x&&(t.x=e(t.x)),"y"in t&&void 0!==t.y&&(t.y=e(t.y)),"rX"in t&&void 0!==t.rX&&(t.rX=e(t.rX)),"rY"in t&&void 0!==t.rY&&(t.rY=e(t.rY)),t}},TO_ABS:Ci,TO_REL:function(){return Ii(((t,e,r)=>(t.relative||(void 0!==t.x1&&(t.x1-=e),void 0!==t.y1&&(t.y1-=r),void 0!==t.x2&&(t.x2-=e),void 0!==t.y2&&(t.y2-=r),void 0!==t.x&&(t.x-=e),void 0!==t.y&&(t.y-=r),t.relative=!0),t)))},NORMALIZE_HVZ:function(t=!0,e=!0,r=!0,i=!0){return Ii(((n,s,a,o,h)=>{if(isNaN(o)&&!(n.type&fi.MOVE_TO))throw new Error("path must start with moveto");if(e&&n.type&fi.HORIZ_LINE_TO&&(n.type=fi.LINE_TO,n.y=n.relative?0:a),r&&n.type&fi.VERT_LINE_TO&&(n.type=fi.LINE_TO,n.x=n.relative?0:s),t&&n.type&fi.CLOSE_PATH&&(n.type=fi.LINE_TO,n.x=n.relative?o-s:o,n.y=n.relative?h-a:h),n.type&fi.ARC&&(0===n.rX||0===n.rY)&&(n.type=fi.LINE_TO,delete n.rX,delete n.rY,delete n.xRot,delete n.lArcFlag,delete n.sweepFlag),i&&n.type&fi.QUAD_TO&&Ai([s,a],n.relative?[s+n.x1,a+n.y1]:[n.x1,n.y1],n.relative?[s+n.x,a+n.y]:[n.x,n.y])&&(n.type=fi.LINE_TO,delete n.x1,delete n.y1),i&&n.type&fi.CURVE_TO){const t=[s,a],e=n.relative?[s+n.x1,a+n.y1]:[n.x1,n.y1],r=n.relative?[s+n.x2,a+n.y2]:[n.x2,n.y2],i=n.relative?[s+n.x,a+n.y]:[n.x,n.y];Ai(t,e,i)&&Ai(t,r,i)&&(n.type=fi.LINE_TO,delete n.x1,delete n.y1,delete n.x2,delete n.y2)}return n}))},NORMALIZE_ST:Mi,QT_TO_C:Oi,INFO:Ii,SANITIZE:function(t=0){yi(t);let e=NaN,r=NaN,i=NaN,n=NaN;return Ii(((s,a,o,h,u)=>{const c=Math.abs;let l=!1,d=0,p=0;if(s.type&fi.SMOOTH_CURVE_TO&&(d=isNaN(e)?0:a-e,p=isNaN(r)?0:o-r),s.type&(fi.CURVE_TO|fi.SMOOTH_CURVE_TO)?(e=s.relative?a+s.x2:s.x2,r=s.relative?o+s.y2:s.y2):(e=NaN,r=NaN),s.type&fi.SMOOTH_QUAD_TO?(i=isNaN(i)?a:2*a-i,n=isNaN(n)?o:2*o-n):s.type&fi.QUAD_TO?(i=s.relative?a+s.x1:s.x1,n=s.relative?o+s.y1:s.y2):(i=NaN,n=NaN),s.type&fi.LINE_COMMANDS||s.type&fi.ARC&&(0===s.rX||0===s.rY||!s.lArcFlag)||s.type&fi.CURVE_TO||s.type&fi.SMOOTH_CURVE_TO||s.type&fi.QUAD_TO||s.type&fi.SMOOTH_QUAD_TO){const e=void 0===s.x?0:s.relative?s.x:s.x-a,r=void 0===s.y?0:s.relative?s.y:s.y-o;d=isNaN(i)?void 0===s.x1?d:s.relative?s.x:s.x1-a:i-a,p=isNaN(n)?void 0===s.y1?p:s.relative?s.y:s.y1-o:n-o;const h=void 0===s.x2?0:s.relative?s.x:s.x2-a,u=void 0===s.y2?0:s.relative?s.y:s.y2-o;c(e)<=t&&c(r)<=t&&c(d)<=t&&c(p)<=t&&c(h)<=t&&c(u)<=t&&(l=!0)}return s.type&fi.CLOSE_PATH&&c(a-h)<=t&&c(o-u)<=t&&(l=!0),l?[]:s}))},MATRIX:Ri,ROTATE:function(t,e=0,r=0){yi(t,e,r);const i=Math.sin(t),n=Math.cos(t);return Ri(n,i,-i,n,e-e*n+r*i,r-e*i-r*n)},TRANSLATE:function(t,e=0){return yi(t,e),Ri(1,0,0,1,t,e)},SCALE:function(t,e=t){return yi(t,e),Ri(t,0,0,e,0,0)},SKEW_X:function(t){return yi(t),Ri(1,0,Math.tan(t),1,0,0)},SKEW_Y:function(t){return yi(t),Ri(1,Math.tan(t),0,1,0,0)},X_AXIS_SYMMETRY:function(t=0){return yi(t),Ri(-1,0,0,1,t,0)},Y_AXIS_SYMMETRY:function(t=0){return yi(t),Ri(1,0,0,-1,0,t)},A_TO_C:function(){return Ii(((t,e,r)=>fi.ARC===t.type?function(t,e,r){t.cX||xi(t,e,r);const i=t.xRot/180*vi;if(Math.abs(t.rX)<1e-10||Math.abs(t.rY)<1e-10)return[{relative:t.relative,type:fi.CURVE_TO,x1:e+(t.x-e)/3,y1:r+(t.y-r)/3,x2:e+2*(t.x-e)/3,y2:r+2*(t.y-r)/3,x:t.x,y:t.y}];const n=Math.min(t.phi1,t.phi2),s=Math.max(t.phi1,t.phi2)-n,a=Math.ceil(s/90),o=new Array(a);let h=e,u=r;const c=(e,r)=>{const[n,s]=gi([e*t.rX,r*t.rY],i);return[t.cX+n,t.cY+s]};for(let e=0;e<a;e++){const r=wi(t.phi1,t.phi2,e/a),i=wi(t.phi1,t.phi2,(e+1)/a),n=i-r,s=4/3*Math.tan(n*bi/4),l=Math.cos(r*bi)-s*Math.sin(r*bi),d=Math.sin(r*bi)+s*Math.cos(r*bi),p=Math.cos(i*bi),f=Math.sin(i*bi),m=p+s*f,g=f-s*p,y=c(l,d),v=c(m,g),x=c(p,f),_={relative:t.relative,type:fi.CURVE_TO,x:x[0],y:x[1],x1:y[0],y1:y[1],x2:v[0],y2:v[1]};t.relative&&(_.x1-=h,_.y1-=u,_.x2-=h,_.y2-=u,_.x-=h,_.y-=u),h=x[0],u=x[1],o[e]=_}return o}(t,t.relative?0:e,t.relative?0:r):t))},ANNOTATE_ARCS:function(){return Ii(((t,e,r)=>(t.relative&&(e=0,r=0),fi.ARC===t.type&&xi(t,e,r),t)))},CLONE:Di,CALCULATE_BOUNDS:function(){const t=Di(),e=Ci(),r=Oi(),i=Mi(),n=Ii(((s,a,o)=>{const h=i(r(e(t(s))));function u(t){t>n.maxX&&(n.maxX=t),t<n.minX&&(n.minX=t)}function c(t){t>n.maxY&&(n.maxY=t),t<n.minY&&(n.minY=t)}if(h.type&fi.DRAWING_COMMANDS&&(u(a),c(o)),h.type&fi.HORIZ_LINE_TO&&u(h.x),h.type&fi.VERT_LINE_TO&&c(h.y),h.type&fi.LINE_TO&&(u(h.x),c(h.y)),h.type&fi.CURVE_TO){u(h.x),c(h.y);const t=Ti(a,h.x1,h.x2,h.x);for(const e of t)0<e&&1>e&&u(Si(a,h.x1,h.x2,h.x,e));const e=Ti(o,h.y1,h.y2,h.y);for(const t of e)0<t&&1>t&&c(Si(o,h.y1,h.y2,h.y,t))}if(h.type&fi.ARC){u(h.x),c(h.y),xi(h,a,o);const t=h.xRot/180*Math.PI,e=Math.cos(t)*h.rX,r=Math.sin(t)*h.rX,i=-Math.sin(t)*h.rY,n=Math.cos(t)*h.rY,[s,l]=h.phi1<h.phi2?[h.phi1,h.phi2]:-180>h.phi2?[h.phi2+360,h.phi1+360]:[h.phi2,h.phi1],d=([t,e])=>{const r=180*Math.atan2(e,t)/Math.PI;return r<s?r+360:r},p=_i(i,-e,0).map(d);for(const t of p)t>s&&t<l&&u(Ei(h.cX,e,i,t));const f=_i(n,-r,0).map(d);for(const t of f)t>s&&t<l&&c(Ei(h.cY,r,n,t))}return s}));return n.minX=1/0,n.maxX=-1/0,n.minY=1/0,n.maxY=-1/0,n},REVERSE_PATH:function(t,e=!0){if(t.length<2)return t;const r=Li.INFO(((t,e,r)=>{var i,n,s;return p(d({},t),{x:null!=(i=t.x)?i:e,y:null!=(n=t.y)?n:r,relative:null!=(s=t.relative)&&s})})),i=[];let n=[];for(const s of t){const t=r(s);t.type===fi.MOVE_TO&&n.length>0&&(e?i.push(...Ni(n)):i.unshift(...Ni(n)),n=[]),n.push(t)}return n.length>0&&(e?i.push(...Ni(n)):i.unshift(...Ni(n))),i}};function Bi(t,e=new Le){if(!t)return e;let r=t.split(" "),i=De.map(r,(t=>parseFloat(t)));return 4!==(null==i?void 0:i.length)||(e.min.set(i[0],i[1]),e.max.set(i[0]+i[2],i[1]+i[3])),e}function ki(t){var e,r,i,n;if(!(null==(e=null==t?void 0:t.childNodes)?void 0:e.length))return t;for(let e=(null==(r=t.childNodes)?void 0:r.length)-1;e>=0;e--)"#comment"===t.childNodes[e].nodeName?null==(i=t.childNodes[e].parentNode)||i.removeChild(t.childNodes[e]):"#text"!==t.childNodes[e].nodeName||De.trim(t.childNodes[e].textContent||"")?ki(t.childNodes[e]):null==(n=t.childNodes[e].parentNode)||n.removeChild(t.childNodes[e]);return t}const Pi=["view"],Ui=["viewer","mirror"];function Vi(t,e){var r;if(t.tagName&&!Pi.includes(t.tagName)&&("g"!==t.tagName||0!==(null==(r=t.childNodes)?void 0:r.length))){Ui.includes(t.id)||e(t);for(let r=0,i=t.childNodes.length;r<i;r++)Vi(t.childNodes[r],e)}}let Fi=0;function qi(t,e=0,r=0,i=[]){var n,s;if(!t)return i;const a=ji(t,"id","");if(Pi.includes(t.nodeName)||"defs"===t.nodeName)return Fi--,i;if(e&&Fi>e)return i;let o;a&&!Ui.includes(a)&&(o={label:a,value:a,children:[]},i.push(o)),Fi++;for(let r=0,s=null==(n=t.childNodes)?void 0:n.length;r<s;r++)qi(t.childNodes[r],e,Fi,o?o.children:i);return 0===(null==(s=null==o?void 0:o.children)?void 0:s.length)&&delete o.children,Fi=r,i}function Hi(t,e){var r;if(Array.isArray(t))for(let r=0,i=t.length||0;r<i;r++)Hi(t[r],e);else if(e(t),null==(r=t.children)?void 0:r.length)for(let r=0,i=t.children.length;r<i;r++)Hi(t.children[r],e)}function zi(t){var e;if(t&&"use"===t.tagName)return null==(e=ji(t,"xlink:href",""))?void 0:e.substring(1)}function ji(t,e,r){if(!t)return r;let i=r;if("function"==typeof t.getAttribute?i=null==t?void 0:t.getAttribute(e):Object.hasOwnProperty.call(t,"attributes")&&(i=t.attributes[e]),!i)return r;if(void 0!==r){if("string"==typeof r)return i;if("number"==typeof r)return Number(i)}return i}const Wi=new RegExp("l-\\w+-((?<=-).+)");function Yi(t,e=!1,r=new Ve){r.identity();const i=ji(t,"transform","");return Qi.set(ji(t,"x",0),ji(t,"y",0)),i||Qi.x||Qi.y?(r.composeSvgTransform(Qi.x,Qi.y,i,e),r):r}function Gi(t,e,r,i,n,s,a,o,h){let u=h*(Math.PI/180),c=Math.cos(u)*(t-r)/2+Math.sin(u)*(e-i)/2,l=-1*Math.sin(u)*(t-r)/2+Math.cos(u)*(e-i)/2,d=c*c/(a*a)+l*l/(o*o);d>1&&(a*=Math.sqrt(d),o*=Math.sqrt(d));let p=Math.sqrt((a*a*(o*o)-a*a*(l*l)-o*o*(c*c))/(a*a*(l*l)+o*o*(c*c)));n===s&&(p*=-1),isNaN(p)&&(p=0);let f=p*a*l/o,m=p*-o*c/a,g=(t+r)/2+Math.cos(u)*f-Math.sin(u)*m,y=(e+i)/2+Math.sin(u)*f+Math.cos(u)*m,v=function(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])},x=function(t,e){return(t[0]*e[0]+t[1]*e[1])/(v(t)*v(e))},_=function(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(x(t,e))},b=_([1,0],[(c-f)/a,(l-m)/o]),w=[(c-f)/a,(l-m)/o],E=[(-1*c-f)/a,(-1*l-m)/o],T=_(w,E);return x(w,E)<=-1&&(T=Math.PI),x(w,E)>=1&&(T=0),0===s&&T>0&&(T-=2*Math.PI),1===s&&T<0&&(T+=2*Math.PI),[g,y,a,o,b,T,u,s]}function Xi(t,e,r,i,n,s,a){const o=[],h=Math.max(Math.floor(Math.abs(s)/(Math.PI/2)),1),u=s/h;for(let s=0;s<h;s++){const h=n+s*u,c=h+u,l=Math.tan(c/4-h/4),d=Math.sin(h),p=Math.cos(h),f=Math.sin(c),m=Math.cos(c),g=t+r*p*Math.cos(a*Math.PI/180)-i*d*Math.sin(a*Math.PI/180),y=e+r*p*Math.sin(a*Math.PI/180)+i*d*Math.cos(a*Math.PI/180),v=t+r*m*Math.cos(a*Math.PI/180)-i*f*Math.sin(a*Math.PI/180),x=e+r*m*Math.sin(a*Math.PI/180)+i*f*Math.cos(a*Math.PI/180),_=g+l*(-r*d*Math.cos(a*Math.PI/180)-i*p*Math.sin(a*Math.PI/180)),b=y+l*(-r*d*Math.sin(a*Math.PI/180)+i*p*Math.cos(a*Math.PI/180)),w=v+l*(r*f*Math.cos(a*Math.PI/180)+i*m*Math.sin(a*Math.PI/180)),E=x+l*(r*f*Math.sin(a*Math.PI/180)-i*m*Math.cos(a*Math.PI/180));o.push([[g,y],[_,b],[w,E],[v,x]])}return o}const Qi=new Oe;class Zi{static destroy(){this.cached.clear(),this.cachedCanvas.clear()}static createCanvas(t){var e;if(!(null==(e=be.window)?void 0:e.document))throw new Error("environment not support");let r,i;if(t.containerId&&(r=be.window.document.getElementById(t.containerId)),r||(r=be.window.document.getElementsByTagName("body")[0]),t.canvasId&&(i=be.window.document.getElementById(t.canvasId)||void 0),t.width||(t.width=(null==r?void 0:r.offsetWidth)||100),t.height||(t.height=(null==r?void 0:r.offsetHeight)||100),t.dpr||(t.dpr=be.dpr),i)this.resizeCanvas(i,t.width,t.height,t.dpr);else{if(i=this.createHtmlCanvas(t.width,t.height,t.dpr),!i)throw new Error("error environment");t.canvasId&&i.setAttribute("id",t.canvasId),null==r||r.appendChild(i)}return i.style.background=t.background||"transparent",i}static getContext2D(t,e={}){const r={alpha:!0,willReadFrequently:!!e.willReadFrequently},i=t.getContext("2d",r);if(!i)throw new Error("getContext2D error");return i.scale(e.dpr||1,e.dpr||1),i}static resizeCanvas(t,e,r,i=1){t instanceof OffscreenCanvas?(t.width=e,t.height=r):t instanceof HTMLCanvasElement&&(t.setAttribute("width",(e*i).toString()),t.setAttribute("height",(r*i).toString()),t.style.width=e+"px",t.style.height=r+"px",t.style.padding="0",t.style.margin="0",t.style.border="0",t.style.imageRendering="pixelated",t.style.transform="translateZ(0)")}static getImageBitmapByCanvasAsync(t){return g(this,null,(function*(){if(t)return t instanceof OffscreenCanvas?t.transferToImageBitmap():t instanceof HTMLCanvasElement?yield createImageBitmap(t):void 0}))}static get(t,e,r,i=1){let n=this.cached.get(t);return n||(n=this.create(e,r,i),this.set(t,n)),this.resizeCanvas(n,e,r,i),n}static set(t,e){if(!t||!e)throw new Error("error input");return this.cached.set(t,e)}static remove(t){this.cached.has(t)&&this.cached.delete(t)}static create(t,e,r=1){var i;if(null==(i=be.window)?void 0:i.OffscreenCanvas)return new OffscreenCanvas(t,e);throw new Error("environment does not support")}static createHtmlCanvas(t,e,r=1){if(!be.window.document)throw new Error("environment does not support");const i=be.window.document.createElement("canvas");return this.resizeCanvas(i,t,e,r),i}static measureText(t,e,r=new Oe){if(!t)throw new Error("input error");const i=this.get("measureText",1,1).getContext("2d");if(!i)throw new Error("bufferCtx not found");e.render(i);const n=i.measureText(t);if(!n)throw new Error("measureText error");const s=n.actualBoundingBoxRight+n.actualBoundingBoxLeft,a=n.actualBoundingBoxAscent+n.actualBoundingBoxDescent;return r.set(s,a),r}}f(Zi,"cached",new Map),f(Zi,"cachedCanvas",new Map);let $i=0;class Ki extends ai{constructor(t={}){var e;super(t.commands),f(this,"name","Geo2"),f(this,"id",++$i),f(this,"params"),f(this,"viewMatrix",new Ve),f(this,"boundingBox",new Le),f(this,"flipY",!1),f(this,"renderPath"),f(this,"_version",0),void 0!==t.flipY&&(this.flipY=!!t.flipY),this.params=t,(null==(e=this.commands)?void 0:e.length)&&this.toAbs(),t.flipY&&this.scale(1,-1)}get version(){return this._version}set version(t){this._version=t}set needsUpdate(t){t&&this._version++}setFromPoints(t){return(null==t?void 0:t.length)?(this.params.points=t,this.recomputePath(),this):this}recomputePath(){throw new Error("must be implemented in derived")}computeBoundingBox(){var t;this.boundingBox.makeEmpty(),Ji.identity();for(let e=0,r=(null==(t=this.commands)?void 0:t.length)||0;e<r;e++){const t=this.commands[e];switch(t.type){case ai.MOVE_TO:case ai.LINE_TO:this.boundingBox.expandByXY(t.x,t.y),Ji.set(t.x,t.y);break;case ai.ARC:void 0===t.xRot?(this.boundingBox.expandByXY(t.x,t.y),tn.set(t.x,t.y).addScalar(-t.rX),this.boundingBox.expandByPoint(tn),tn.set(t.x,t.y).addScalar(t.rX),this.boundingBox.expandByPoint(tn)):this.boundingBox.expandByXY(t.x,t.y),Ji.set(t.x,t.y);break;case ai.HORIZ_LINE_TO:this.boundingBox.expandByXY(t.x,Ji.y),Ji.set(t.x,Ji.y);break;case ai.VERT_LINE_TO:this.boundingBox.expandByXY(Ji.x,t.y),Ji.set(Ji.x,t.y);break;case ai.QUAD_TO:this.boundingBox.expandByXY(t.x,t.y),Ji.set(t.x,t.y)}}return this.boundingBox}render(t,e){if(this.renderPath=new Path2D,t&&(null==e?void 0:e.length)){Ji.identity();for(let t=0,r=(null==e?void 0:e.length)||0;t<r;t++){const r=e[t];switch(r.type){case ai.MOVE_TO:this.renderPath.moveTo(r.x,r.y),Ji.set(r.x,r.y);break;case ai.LINE_TO:this.renderPath.lineTo(r.x,r.y),Ji.set(r.x,r.y);break;case ai.ARC:this.renderPath.arc(r.x,r.y,r.rX,r.phi1||0,r.phi2||2*Math.PI,1!==r.sweepFlag),Ji.set(r.x,r.y);break;case ai.HORIZ_LINE_TO:this.renderPath.lineTo(r.x,Ji.y),Ji.set(r.x,Ji.y);break;case ai.VERT_LINE_TO:this.renderPath.lineTo(Ji.x,r.y),Ji.set(Ji.x,r.y);break;case ai.CURVE_TO:this.renderPath.bezierCurveTo(r.x1,r.y1,r.x2,r.y2,r.x,r.y),Ji.set(r.x,r.y);break;case ai.SMOOTH_CURVE_TO:case ai.QUAD_TO:case ai.SMOOTH_QUAD_TO:Ji.set(r.x,r.y)}}}}applyMatrix(t){return this.needsUpdate=!0,this.matrix(t.elements[0],t.elements[1],t.elements[3],t.elements[4],t.elements[6],t.elements[7]),this}getRenderCommands(t){var e;const r=[];for(let t=0,i=(null==(e=this.commands)?void 0:e.length)||0;t<i;t++)r.push(Object.assign({},this.commands[t]));if(!t)return r;Ji.identity();const i=Li.MATRIX(t.elements[0],t.elements[1],t.elements[3],t.elements[4],t.elements[6],t.elements[7]),n=[];for(let e=0,s=r.length;e<s;e++){const s=i(r[e]);if(s.type===ai.ARC){let[e,r,i,a,o,h,u,c]=Gi(Ji.x,Ji.y,s.x,s.y,s.lArcFlag,s.sweepFlag,s.rX,s.rY,0);if(Ji.set(s.x,s.y),s.rX===s.rY&&void 0!==s.xRot)s.x=e,s.y=r,s.rx=i>a?i:a,s.phi1=o,s.phi2=o+h;else if(s.rX===s.rY)t.getScale(tn),s.rX=s.rY*Math.abs(tn.x),0===s.phi1&&s.phi2===2*Math.PI||(t.getRotation(tn),s.phi1+=tn.x,s.phi2+=tn.x);else{const t=Xi(e,r,i,a,o,h,u);if(!(null==t?void 0:t.length))break;s.type=ai.MOVE_TO,s.x=e,s.y=r;for(let e=0,r=t.length;e<r;e++)n.push({type:ai.CURVE_TO,x1:t[e][1][0],y1:t[e][1][1],x2:t[e][2][0],y2:t[e][2][1],x:t[e][3][0],y:t[e][3][1]})}}else Ji.set(s.x||Ji.x,s.y||Ji.y);Array.isArray(s)?n.push(...s):n.push(s)}return n}copy(t){return this.commands=De.cloneDeep(t.commands),this.version=0,this}clone(){return new(0,this.constructor)(this.params).copy(this)}getConvexHull(){var t,e;const r=[];if(!(null==(t=this.commands)?void 0:t.length))return r;for(let t=0,i=(null==(e=this.commands)?void 0:e.length)||0;t<i;t++){const e=this.commands[t];switch(e.type){case ai.MOVE_TO:case ai.LINE_TO:case ai.ARC:r.push({x:e.x,y:e.y}),Ji.set(e.x,e.y);break;case ai.HORIZ_LINE_TO:r.push({x:e.x,y:Ji.y}),Ji.set(e.x,Ji.y);break;case ai.VERT_LINE_TO:r.push({x:Ji.x,y:e.y}),Ji.set(Ji.x,e.y);break;case ai.CURVE_TO:case ai.SMOOTH_CURVE_TO:case ai.QUAD_TO:case ai.SMOOTH_QUAD_TO:r.push({x:e.x,y:e.y}),Ji.set(e.x,e.y)}}return r}isPointInBoundingBox(t){return!!this.boundingBox&&this.boundingBox.containsPoint(t)}isPointInPath(t){if(this.renderPath){en.save(),en.beginPath(),en.lineWidth=5,en.stroke(this.renderPath),en.fill(this.renderPath),en.closePath();const e=en.isPointInPath(this.renderPath,t.x,t.y);return en.restore(),e}return!1}}const Ji=new Oe,tn=new Oe,en=Zi.get("RAY_CASTER",10,10).getContext("2d");class rn{constructor(t={}){f(this,"name","Mat2"),f(this,"map"),f(this,"version",0),f(this,"_fill"),f(this,"_stroke"),f(this,"_lineWidth",0),f(this,"_lineDash"),f(this,"_lineDashOffset"),f(this,"_lineCap","round"),t.fill&&(this.fill=t.fill),t.stroke&&(this.stroke=t.stroke),t.lineWidth&&(this.lineWidth=t.lineWidth),t.lineDash&&(this.lineDash=t.lineDash),t.lineDashOffset&&(this.lineDashOffset=t.lineDashOffset),t.lineCap&&(this.lineCap=t.lineCap)}set needsUpdate(t){t&&this.version++}get fill(){return this._fill}set fill(t){this._fill=t,this.needsUpdate=!0}get stroke(){return this._stroke}set stroke(t){this._stroke=t,this._lineWidth||(this._lineWidth=1),this.needsUpdate=!0}get lineWidth(){return this._lineWidth}set lineWidth(t){this._lineWidth=t,this.needsUpdate=!0}get lineDash(){return this._lineDash}set lineDash(t){this._lineDash=t,this.needsUpdate=!0}get lineDashOffset(){return this._lineDashOffset}set lineDashOffset(t){this._lineDashOffset=t,this.needsUpdate=!0}get lineCap(){return this._lineCap}set lineCap(t){this._lineCap=t,this.needsUpdate=!0}}class nn extends Je{constructor(t=new Ki,e=new rn,r){var i,n,s,a,o;super(),f(this,"name","Shape2"),f(this,"isShape",!0),f(this,"params"),f(this,"wireframe",!1),f(this,"selected",!1),f(this,"geo"),f(this,"mat"),this.params=r,this.geo=t,this.mat=e,void 0!==(null==(i=this.params)?void 0:i.name)&&(this.name=this.params.name,this.geo.name=this.name+".geo",this.mat.name=this.name+".mat"),void 0!==(null==(n=this.params)?void 0:n.renderOrder)&&(this.renderOrder=this.params.renderOrder),void 0!==(null==(s=this.params)?void 0:s.dynamically)&&(this.dynamically=this.params.dynamically),void 0!==(null==(a=this.params)?void 0:a.wireframe)&&(this.wireframe=this.params.wireframe),void 0!==(null==(o=this.params)?void 0:o.alignCenter)&&(this.alignCenter=!!this.params.alignCenter)}destroy(){super.destroy()}computeBoundingBox(){this.boundingBox.copy(this.geo.computeBoundingBox());for(let t=0,e=this.children.length;t<e;t++)this.boundingBox.union(this.children[t].computeBoundingBox());return this.boundingBox}render(t,e){var r;this.visible&&(t.beginPath(),(null==e?void 0:e.length)?this.geo.render(t,e):(null==(r=this.geo.commands)?void 0:r.length)&&this.geo.render(t,this.geo.getRenderCommands(this.matrix)),this.renderFill(t),this.renderStroke(t),t.closePath())}renderFill(t){this.mat.fill&&(t.fillStyle=this.mat.fill,this.geo.renderPath&&t.fill(this.geo.renderPath))}renderStroke(t){this.mat.stroke&&(t.strokeStyle=this.mat.stroke,t.lineWidth=this.mat.lineWidth||1,t.setLineDash(this.mat.lineDash||[]),this.mat.lineCap&&(t.lineCap=this.mat.lineCap),this.mat.lineDashOffset&&(t.lineDashOffset=this.mat.lineDashOffset),this.geo.renderPath&&t.stroke(this.geo.renderPath))}raycast(t,e=[]){return super.raycast(t,e),!this.boundingBox||this.boundingBox.isEmpty()||this.boundingBoxWorld.containsPoint(t.worldCoords)&&e.push(this),e}clone(t=!0,e=!1){return new(0,this.constructor)(this.geo,this.mat).copy(this,t,e)}copy(t,e=!0,r=!1){return super.copy(t,e,r),this.params=De.merge(this.params,t),this.renderOrder=t.renderOrder,r?(this.geo=De.cloneDeep(t.geo),this.mat=De.cloneDeep(t.mat)):(this.geo=t.geo,this.mat=t.mat),this}}class sn extends Ki{constructor(t={}){t.commands||(t.commands=[]),super(t),f(this,"isCircle",!0),f(this,"radius",1),f(this,"start",0),f(this,"end",2*Math.PI),void 0!==t.radius&&(this.radius=t.radius),void 0!==t.start&&(this.start=t.start),void 0!==t.end&&(this.end=t.end),this.recomputePath()}recomputePath(){var t,e,r;if(!(null==(e=null==(t=this.params)?void 0:t.points)?void 0:e.length))return this;const i=this.params.points,n=[];for(let t=0,e=i.length;t<e;t++)n.push({type:ai.MOVE_TO,x:i[t].x+this.radius,y:i[t].y*(this.params.flipY?-1:1),relative:!1}),n.push({type:ai.ARC,rX:this.radius,rY:this.radius,xRot:void 0,lArcFlag:0,sweepFlag:(null==(r=this.params)?void 0:r.sweepFlag)||1,phi1:this.start,phi2:this.end,x:i[t].x,y:i[t].y*(this.params.flipY?-1:1),relative:!1});return this.commands=n,this}}class an extends nn{constructor(t={}){t.points||(t.points=[{x:0,y:0}]),super(new sn(t),new rn(t)),f(this,"type","Shape"),f(this,"name","Circle"),f(this,"isCircle",!0),void 0!==t.renderOrder&&(this.renderOrder=t.renderOrder),void 0!==t.dynamically&&(this.dynamically=t.dynamically)}}class on extends Je{constructor(t={}){super(t),f(this,"type","Group2"),f(this,"isGroup",!0),f(this,"versions",[]),f(this,"params"),f(this,"alignCenter",!1),f(this,"dynamically",!1),f(this,"usedCache",!1),f(this,"wireframe",!1),f(this,"showPoints",!1),this.params=t,void 0!==t.usedCache&&(this.usedCache=t.usedCache),void 0!==t.wireframe&&(this.wireframe=t.wireframe),void 0!==t.showPoints&&(this.showPoints=t.showPoints),void 0!==t.alignCenter&&(this.alignCenter=t.alignCenter),void 0!==t.dynamically&&(this.dynamically=t.dynamically)}destroy(){super.destroy(),this.boundingBox.makeEmpty()}clone(t=!0,e=!1){return new(0,this.constructor)(this.params).copy(this,t,e)}copy(t,e=!0,r=!1){return super.copy(t,e,r),this.params=t.params,this.alignCenter=t.alignCenter,this.dynamically=t.dynamically,this.usedCache=t.usedCache,this.wireframe=t.wireframe,this.showPoints=t.showPoints,this}composeWireframeGeometryPath(t){return this.traverse((e=>{e.isShape&&e.geometry&&e.geometry.path&&t.addPath(e.geometry.path)})),t}raycast(t,e=[]){var r;if(!this.boundingBox||this.boundingBox.isEmpty())return e;if(!this.boundingBoxWorld.containsPoint(t.worldCoords))return e;let i=[];for(let e=0,n=null==(r=this.children)?void 0:r.length;e<n;e++)this.children[e].raycast(t,i);return i.length&&e.push(this),e}}class hn{constructor(t={}){f(this,"params"),this.params=t}destroy(){}static getInstanceByElement(t,e=!1){if(!t)return;let r;switch(t.nodeName){case"path":r=this.getInstanceByPath(t,e);break;case"circle":r=this.getInstanceByCircle(t,e)}return r}static getInstanceByPath(t,e=!1){if(!t)return;const r=ji(t,"d");if(!r)return;const i=r.replace(/([+\-.])\s+/gm,"$1").replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g,""),n=i.match(/([Mm][^Mm]*)/g);if(!n||n.length<=this.splitLimit)try{return new Ki({commands:i,flipY:e})}catch(t){return}const s=[];for(let t=0,r=n.length;t<r;t+=this.splitLimit){const r=n.slice(t,t+this.splitLimit).join(" ");try{s.push(new Ki({commands:r,flipY:e}))}catch(t){}}return s}static getInstanceByCircle(t,e=!1){if(!t||"circle"!==t.nodeName)return;un.set(ji(t,"cx",0),ji(t,"cy",0));const r=ji(t,"r",0);return new sn({points:[un.clone()],radius:r,flipY:e})}static getInstance(t,e=!1){if(t)return new Ki({commands:t,flipY:e})}}f(hn,"splitLimit",100);const un=new Oe,cn="normal";class ln extends rn{constructor(t={}){super(t),f(this,"isTextMat",!0),f(this,"name","TextMaterial2"),f(this,"verticalAlign","top"),f(this,"letterSpacing",0),f(this,"wrap","word"),f(this,"ellipsis",!1),f(this,"_text"),f(this,"_textFill",Nr),f(this,"_fontFamily","Arial"),f(this,"_fontSize",12),f(this,"_fontStyle",cn),f(this,"_fontWeight",cn),f(this,"_fontVariant",cn),f(this,"_textDecoration"),f(this,"_textAlign","center"),f(this,"_lineHeight",1),f(this,"_textBaseline","middle"),t.text&&(this.text=t.text),t.textFill&&(this.textFill=t.textFill),t.fontFamily&&(this.fontFamily=t.fontFamily),t.fontSize&&(this.fontSize=t.fontSize),t.fontStyle&&(this.fontStyle=t.fontStyle),t.fontWeight&&(this.fontWeight=t.fontWeight),t.textAlign&&(this.textAlign=t.textAlign),t.textBaseline&&(this.textBaseline=t.textBaseline)}get text(){return this._text}set text(t){this._text=t,this.needsUpdate=!0}get textFill(){return this._textFill}set textFill(t){this._textFill=t,this.needsUpdate=!0}get fontFamily(){return this._fontFamily}set fontFamily(t){this._fontFamily=t,this.needsUpdate=!0}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize=t,this.needsUpdate=!0}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle=t,this.needsUpdate=!0}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight=t,this.needsUpdate=!0}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant=t,this.needsUpdate=!0}get textDecoration(){return this._textDecoration}set textDecoration(t){this._textDecoration=t,this.needsUpdate=!0}get textAlign(){return this._textAlign}set textAlign(t){this._textAlign=t,this.needsUpdate=!0}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight=t,this.needsUpdate=!0}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline=t,this.needsUpdate=!0}}const dn=class t{constructor(){f(this,"_mergeEnable",!0)}static get instance(){return t._instance||(this._instance=new t),this._instance}static setMergeEnable(t){return this.instance._mergeEnable=t,this.instance}getInstance(t){if(!this._mergeEnable){let e;return e=void 0!==t.text?new ln(t):new rn(t),e}const e=fn(t);return mn[e]||(void 0!==t.text?mn[e]=new ln(t):mn[e]=new rn(t)),mn[e]}setCache(t,e){const r=fn(t);mn[r]||(mn[r]=e)}};f(dn,"_instance");let pn=dn;function fn(t){const e=[];return void 0!==t.fill&&e.push(t.fill),void 0!==t.stroke&&e.push(t.stroke),void 0!==t.strokeWidth&&e.push(t.strokeWidth),void 0!==t.lineDash&&t.lineDash.length&&e.push(...t.lineDash),void 0!==t.lineDashOffset&&e.push(t.lineDashOffset),void 0!==t.lineCap&&e.push(t.lineCap),void 0!==t.fontSize&&e.push(t.fontSize),e.join("_")}const mn={};class gn extends Ki{constructor(t={}){t.commands||(t.commands=[]),super(t),this.recomputePath()}recomputePath(){var t,e;if(!(null==(e=null==(t=this.params)?void 0:t.points)?void 0:e.length))return this;const r=this.params.points,i=[];for(let t=0,e=r.length;t<e;t++)t?i.push({type:ai.LINE_TO,x:r[t].x,y:r[t].y,relative:!1}):i.push({type:ai.MOVE_TO,x:r[t].x,y:r[t].y,relative:!1});return i.push({type:ai.CLOSE_PATH}),this.commands=i,this}}class yn extends nn{constructor(t={}){if(void 0===t.fontSize&&(t.fontSize=12),void 0===t.renderOrder&&(t.renderOrder=1),super(new gn(t),new ln(t)),f(this,"isText",!0),f(this,"name","Text"),f(this,"textContent"),f(this,"size",new Oe),this.textContent=t.text,void 0!==t.renderOrder&&(this.renderOrder=t.renderOrder),void 0!==t.dynamically&&(this.dynamically=t.dynamically),t.fixed&&(this.fixed=!0),void 0!==t.rotated){const e=Ce(t.rotated);this.rotation.set(e,e)}this.wireframe=t.wireframe||!1}computeBoundingBox(){var t;if(!(null==(t=this.mat)?void 0:t.text))return this.boundingBox;this.updateMatrixWorld(!0),Zi.measureText(this.mat.text||"",this,this.size);const e=[];return e.push({x:-this.size.x/2,y:-this.size.y/2}),e.push({x:e[0].x,y:e[0].y+this.size.y}),e.push({x:e[1].x+this.size.x,y:e[1].y}),e.push({x:e[2].x,y:e[0].y}),this.geo.setFromPoints(e),super.computeBoundingBox(),this.boundingBox}render(t){if(!this.visible)return;if(!this.textContent)return;this.modelViewMatrix.decompose(vn,_n,xn);const e=this.mat.fontSize*xn.x;t.font=`${this.mat.fontWeight} ${e}px ${this.mat.fontFamily}`,t.fillStyle=this.mat.fill||Nr,t.textAlign=this.mat.textAlign,t.textBaseline=this.mat.textBaseline,t.fillText(this.textContent,vn.x,vn.y)}}const vn=new Oe,xn=new Oe,_n=new Oe,bn=class t{constructor(){f(this,"_mergeEnable",!0)}static get instance(){return t._instance||(this._instance=new t),this._instance}static setMergeEnable(t){return this.instance._mergeEnable=t,this.instance}getShapeByElement(t,e,r){const i=hn.getInstanceByElement(t,r),n=pn.setMergeEnable(this._mergeEnable).getInstance(e);if(Array.isArray(i)){const t=new on;for(let r=0,s=i.length;r<s;r++)t.add(new nn(i[r],n,e));return t}return new nn(i,n,e)}getText(t){const e=new yn(t),r=pn.setMergeEnable(this._mergeEnable).getInstance(t);return r?e.mat=r:pn.setMergeEnable(this._mergeEnable).setCache(t,r),e}};f(bn,"_instance");let wn=bn;function En(t){return!!(t&&t.constructor&&t.call&&t.apply)}const Tn="Changed";class Sn extends Se{constructor(t){super(),f(this,"name","Node2"),f(this,"userData",{}),f(this,"_cache",new Map),f(this,"_attachedDepsListeners",new Map),this.setAttrs(t)}destroy(){super.destroy(),this._clearCache()}setAttrs(t){if(!t)return this;let e;for(const r in t)"children"!==r&&(e="set"+r,En(this[e])?this[e](t[r]):this.setAttr(r,t[r]));return this}setAttr(t,e){Object.hasOwnProperty.call(this,t)&&(this.userData[t]=e,this[t]=e)}getAttrs(){return this.userData||{}}getAttr(t){const e="get"+De.capitalize(t);return En(this[e])?this[e]():this.userData[t]}getAttrKey(){return Object.values(this.userData).filter((t=>!(t instanceof Array||t instanceof Object))).join("_")}_getCache(t,e){let r=this._cache.get(t);return void 0!==r&&!0!==r.dirty||(r=e.call(this),this._cache.set(t,r)),r}_clearCache(t){void 0===t?this._cache.clear():this._cache.has(t)&&this._cache.get(t).isMatrix3?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_setProperty(t){Object.hasOwnProperty.call(this,t)&&delete this[t],Object.defineProperty(this,t,{get(){return this.userData[t]},set(e){const r=this.userData[t];this.userData[t]=e,r!==e&&this.dispatchEvent({type:t+Tn,data:{oldVal:r,newVal:e}})},enumerable:!0,configurable:!0})}computed(t,e,r){if(!this._attachedDepsListeners.get(t)){const r=e.map((t=>t+Tn)).join(",");this.addEventListeners(r,(()=>this._clearCache(t))),e.forEach((t=>this._setProperty(t))),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,r)}watch(t,e){(t||[]).forEach((t=>{this._setProperty(t),this.addEventListener(t+Tn,e)}))}}const An=new Oe;class Nn extends Sn{constructor(t={}){super(t),f(this,"isTexture",!0),f(this,"isRenderTargetTexture",!1),f(this,"type","Texture"),f(this,"name","Texture"),f(this,"uuid",Ke()),f(this,"originSize",new Oe),f(this,"originCenter",new Oe),f(this,"size",new Oe),f(this,"matrix",new Ve),f(this,"matrixAutoUpdate",!0),f(this,"userData",{}),f(this,"version",0),f(this,"_needsUpdate",!1),f(this,"image"),f(this,"offset",new Oe),f(this,"repeat",new Oe(1,1)),f(this,"center",new Oe),f(this,"rotate",0),f(this,"scale",1),f(this,"flipY",!0),this.setAttrs(t)}destroy(){super.destroy()}set needsUpdate(t){t&&(this.version++,this._needsUpdate=!0)}get needsUpdate(){return this._needsUpdate}updateSize(t,e,r,i){return this.originSize.copy(t),this.originCenter.copy(e),this.flipY&&this.originCenter.multiplyScalar(1,-1),this.updateFinalSize(r,i)}updateFinalSize(t,e){!t||Oe.isZero(t)||Oe.isEmpty(t)?An.copy(this.originSize):An.copy(t),An.maxXY(1,1);const r=Math.sqrt(An.x*An.x+An.y*An.y)/Math.sqrt(e.x*e.x+e.y*e.y);return r>1&&An.multiplyScalar(1/r),this.scale=An.length()/this.originSize.length(),this.repeat.multiplyScalar(this.originSize.length()/An.length()),this.size.copy(An),this.offset.copy(this.originSize).multiplyScalar(-.5).add(this.originCenter),this.updateMatrix(),this}reset(t,e){t&&this.originSize.copy(t),e&&this.size.copy(e),this.scale=this.size.x/this.originSize.x,this.repeat.set(1,1),this.center.set(0,0),this.rotate=0,this.offset.copy(this.originSize).multiplyScalar(.5).sub(this.originCenter).multiplyScalar(this.scale),this.updateMatrix()}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotate,this.center.x,this.center.y)}clone(){return new(0,this.constructor)(this.attrs).copy(this)}copy(t){return this.name=t.name,this.originSize.copy(t.originSize),this.originCenter.copy(t.originCenter),this.size.copy(t.size),this.matrix.copy(t.matrix),this.matrixAutoUpdate=t.matrixAutoUpdate,this.userData=JSON.parse(JSON.stringify(t.userData)),this.image=t.image,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotate=t.rotate,this.scale=t.scale,this.flipY=t.flipY,this}}const Cn=class t{static destroy(){Object.values(this.cached).forEach((t=>{t.destroy()})),this.cached=new Map}static has(t){return this.cached.has(t)}static get(t,e){if(t)return this.precisionOptimized&&e?e&&e<this.precisionOptimizeLevels[2]?this.get(t+"_3"):e&&e<this.precisionOptimizeLevels[1]?this.get(t+"_2"):e&&e<this.precisionOptimizeLevels[0]?this.get(t+"_1"):this.get(t):this.cached.get(t)}static set(t,e){if(!t||!e)throw new Error("error input");return this.cached.set(t,e),e}static remove(t){if(!t||!this.cached.has(t))return;const e=this.cached.get(t);if(e&&e.destroy(),this.cached.delete(t),this.precisionOptimized)for(let e=1,r=this.precisionOptimizeLevels.length;e<=r;e++){const r=t+"_"+e;let i;this.cached.has(r)&&(i=this.cached.get(r),i&&i.destroy(),this.cached.delete(r))}}static clear(){this.destroy()}static setTextureMaxSize(){this.initialized||(this.textureMaxSize.set(be.config.width,be.config.height).multiplyScalar(.5).round(),this.initialized=!0)}static getTextureMaxSize(){return this.initialized||this.setTextureMaxSize(),this.textureMaxSize}static getTextureByShape(t,e,r,i){var n;const s=new Nn;if(this.setTextureMaxSize(),s.scale=1,s.repeat.set(1,1),s.rotate=0,s.image=void 0,s.version=0,!e||Oe.isZero(e)||Oe.isEmpty(e)){if(t.isShape&&(null==(n=t.geometry)?void 0:n.boundingBox))Vn.copy(t.geometry.boundingBox);else{if(!t.boundingBox)throw new Error("get boundingBox error");Vn.copy(t.boundingBox)}Vn.getSize(In),t.alignCenter?t.boundingBox.getCenter(Rn):Vn.getCenter(Rn)}else In.copy(e),t.alignCenter?t.boundingBox.getCenter(Rn):Rn.set(0,0);return!r||Oe.isZero(r)||Oe.isEmpty(r)?Dn.copy(In):Dn.copy(r),(Dn.x<On.x||Dn.y<On.y)&&Dn.normalize().multiplyScalar(10).round(),Pn.copy(this.getTextureMaxSize()),i&&(kn.set((null==i?void 0:i.shadowBlur)||0,(null==i?void 0:i.shadowBlur)||0),Dn.add(kn.clone().multiplyScalar(2)),In.multiplyScalar(3),Pn.multiplyScalar(.3)),s.updateSize(In,Rn,Dn,Pn),s}static setPrecisionOptimizeTextures(e,r,i,n,s){if(!this.precisionOptimized)return;let a;for(let o=0,h=this.precisionOptimizeLevels.length;o<h;o++){Pn.copy(i.size).multiplyScalar(this.precisionOptimizeLevels[o]);const h=this.getTextureByShape(r,n,Pn,s);this.renderShapeTexture(r,h,s),a=e+"_"+(o+1),h.userData.textureKey=a,t.set(a,h)}}static renderShapeTexture(t,e,r){r?(kn.set(r.shadowBlur||0,r.shadowBlur||0),Ln.copy(e.originSize).multiplyScalar(-.5).sub(e.originCenter).multiplyScalar(e.scale),t.alignCenter?Bn.copy(e.originSize).multiplyScalar(e.scale):Bn.copy(e.originSize).add(kn.clone().multiplyScalar(1)).multiplyScalar(e.scale)):Ln.copy(e.offset).negate().multiplyScalar(e.scale);const i=Zi.create(e.size.x,e.size.y),n=Zi.getContext2D(i,{alpha:!0});if(t.isText||!t.matrix.hasChange())n.clearRect(0,0,i.width,i.height),n.translate(Ln.x,Ln.y),n.scale(e.scale,-e.scale);else{t.matrix.decompose(Fn,qn,Hn);const e=1/Hn.x;Ln.sub(Fn.multiplyScalar(e,-e)),n.clearRect(0,0,i.width,i.height),n.translate(Ln.x,Ln.y),n.scale(e,-e)}r&&(n.shadowColor=Nr,n.shadowOffsetX=Bn.x,n.shadowOffsetY=Bn.y,n.shadowBlur=kn.x),t.render(n),e.image=i}static setByShape(e,r,i,n){const s=this.getTextureByShape(r,i,n);return s.userData.textureKey=e,this.renderShapeTexture(r,s),t.set(e,s),r.featureKey=e,s}static setShadowByShape(e,r,i){const n=this.getTextureByShape(r,void 0,void 0,i);return n.userData.textureKey=e,this.renderShapeTexture(r,n,i),t.set(e,n),n}static setPointsByShape(e,r){var i,n,s,a,o;const h=[];r.isGroup?r.traverse((t=>t.isShape?h.push(...t.geometry.points):void 0)):r.isShape&&r.geometry.points?h.push(...r.geometry.points):r.boundingBox&&h.push(r.boundingBox.min,r.boundingBox.max);const u=this.getTextureByShape(r),c=2*(null==(i=r.material)?void 0:i.lineWidth)||3;Un.set(1,1).multiplyScalar(c),u.size.copy(Un).multiplyScalar(u.scale).multiplyScalar(2).add(Dn),u.offset.sub(Un),u.updateMatrix();const l=Zi.create(u.size.x,u.size.y),d=Zi.getContext2D(l,{alpha:!0});Ln.subVectors(u.originSize.clone().multiplyScalar(.5),u.originCenter).add(Un),d.clearRect(0,0,l.width,l.height),d.scale(u.scale,u.scale),d.translate(Ln.x,Ln.y);let p=Nr;r.material?p=(null==(n=r.material)?void 0:n.stroke)||(null==(s=r.material)?void 0:s.fill):r.isGroup&&r.children.length&&r.children[0].isShape&&(p=(null==(a=r.children[0].material)?void 0:a.stroke)||(null==(o=r.children[0].material)?void 0:o.fill)),d.fillStyle=Dr.getDarken(p);for(let t=0,e=h.length||0;t<e;t++)Pn.copy(h[t]),d.moveTo(Pn.x,Pn.y),d.arc(Pn.x,Pn.y,Un.x,0,2*Math.PI);return d.fill(),u.image=l,t.set(e,u),u}static setWireframeByShape(e,r){var i;const n=this.getTextureByShape(r);Un.set(1,1).multiplyScalar((null==(i=r.mat)?void 0:i.lineWidth)||1),n.size.copy(Un).multiplyScalar(n.scale).multiplyScalar(2).add(Dn),n.offset.sub(Un),n.updateMatrix();const s=Zi.create(n.size.x,n.size.y),a=Zi.getContext2D(s,{alpha:!0}),o=Un.x*n.scale*5;return a.clearRect(0,0,s.width,s.height),a.strokeStyle=Ar,a.lineWidth=o,a.setLineDash([3*o,o]),a.strokeRect(0,0,n.size.x,n.size.y),n.image=s,t.set(e,n),n}};f(Cn,"cached",new Map),f(Cn,"precisionOptimized",!0),f(Cn,"precisionOptimizeLevels",[.5,.25,1e-4]),f(Cn,"initialized",!1),f(Cn,"textureMaxSize",new Oe),f(Cn,"DEBUG_DisplayCachedTexture",De.throttle(((t=80,e=.8)=>{let r=window.document.getElementById("DEBUG_Displaycached");if(r||(r=function(t=80,e=.8){const r=document.createElement("div");function i(){r.style.opacity="1"}function n(){r.style.opacity=e.toString()}return r.setAttribute("id","DEBUG_Displaycached"),r.style.position="absolute",r.style.width=t+"px",r.style.height="92vh",r.style.background=`rgba(255, 255, 255, ${e})`,r.style.left="20px",r.style.top="20px",r.style.overflow="auto",r.style.padding="6px",r.style.opacity=e.toString(),r.addEventListener("mouseenter",i),r.addEventListener("mouseleave",n),document.body.appendChild(r),r}(t,e)),!r)throw new Error("dom not found");!function(t,e){e.forEach(((e,r)=>{e&&e.image&&function(t,e,r){let i;for(let r=0,n=t.childNodes.length;r<n;r++)if(t.childNodes[r].getAttribute("id")===e){i=t.childNodes[r];break}i?function(t,e){if(!e.image)return;const r=t.querySelector("canvas");if(!r)return;const i=r.getContext("2d",{alpha:!0});if(!i)throw new Error("getContext error");i.clearRect(0,0,r.width,r.height),i.save(),i.scale(window.devicePixelRatio,window.devicePixelRatio),i.drawImage(e.image,0,0),i.restore()}(i,r):function(t,e,r){if(!r.image)return;const i=be.document.createElement("div");i.setAttribute("id",e),i.style.display="flex",i.style.flexDirection="column";const n=Zi.createCanvas({containerId:t.id,width:r.image.width,height:r.image.height,dpr:window.devicePixelRatio});n.style.border=`${Er} 1px solid`,n.style.maxWidth=parseInt(t.style.width)-2+"px",n.style.maxHeight=parseInt(n.style.maxWidth)/(r.image.width/r.image.height)+"px";const s=n.getContext("2d",{alpha:!0});if(!s)throw new Error("getContext error");s.save(),s.scale(window.devicePixelRatio,window.devicePixelRatio),s.drawImage(r.image,0,0),s.restore(),i.appendChild(n);const a=be.document.createElement("p");function o(){const t=n.toDataURL("image/png",.6),e=document.createElement("a"),r=new MouseEvent("click");e.download=`thumb.${Date.now()}.png`,e.href=t,e.dispatchEvent(r)}a.innerHTML=r.image.width+" * "+r.image.height,a.innerHTML+="<br/>"+e,a.style.margin="0",a.style.padding="0",a.style.lineHeight="1.2",a.style.fontSize="10px",a.style.padding="3px 0 6px 0",a.style.color=Nr,i.appendChild(a),t.appendChild(i),i.addEventListener("click",o)}(t,e,r)}(t,r,e)}))}(r,Cn.cached)}),5e3));let Mn=Cn;const On=new Oe(10,10),In=new Oe,Rn=new Oe,Dn=new Oe,Ln=new Oe,Bn=new Oe,kn=new Oe,Pn=new Oe,Un=new Oe,Vn=new Le,Fn=new Oe,qn=new Oe,Hn=new Oe;class zn extends nn{constructor(t){super(),f(this,"name","Dummy"),f(this,"isDummy",!0),f(this,"origin"),f(this,"texture"),this.origin=t,this.texture=Mn.get(this.origin.featureKey)}computeBoundingBox(){return this.origin.boundingBox.isEmpty()&&this.origin.computeBoundingBox(),this.boundingBox=this.origin.boundingBox,this.boundingBox}render(t){var e;this.texture||(this.texture=Mn.get(this.origin.featureKey)),(null==(e=this.texture)?void 0:e.image)&&(this.modelViewMatrix.decompose(jn,Wn,Yn),jn.set(this.boundingBox.min.x,this.boundingBox.max.y).applyMatrix3(this.modelViewMatrix).toString(),t.save(),t.translate(jn.x,jn.y),t.rotate(Wn.x),t.scale(Yn.x,-Yn.y),t.drawImage(this.texture.image,0,0),t.restore())}separateCache(){}}const jn=new Oe,Wn=new Oe,Yn=new Oe,Gn=be.window||window,Xn=Gn.requestAnimationFrame||Gn.webkitRequestAnimationFrame||Gn.mozRequestAnimationFrame||Gn.oRequestAnimationFrame||Gn.msRequestAnimationFrame||function(t){Gn.setTimeout(t,1e3/60)},Qn=Gn.cancelAnimationFrame||Gn.webkitCancelAnimationFrame||Gn.mozCancelAnimationFrame||Gn.oCancelAnimationFrame||Gn.msCancelAnimationFrame||clearTimeout;class Zn{constructor(t,e,r=16.7){if(f(this,"duration",16.7),f(this,"generator"),f(this,"t",null),f(this,"stopped",!1),r&&(this.duration=r),!e||"function"!=typeof e)throw new Error("[task] callback method is null!");let i="number"==typeof t&&t||Array.isArray(t)&&t.length;if(!i)throw new Error("[task] task list is empty ...");if(1===i)return e(0);this.generator=this.queue(i,e),this.t=null,this.stopped=!1,this.next()}next(){if(!this.generator||this.stopped)return;const{generator:t}=this,e=performance.now();let r=null;do{if(r=t.next(),r.done){this.clear();break}}while(!r.done&&performance.now()-e<this.duration);r.done||this.stopped||(this.t=Xn(this.next.bind(this)))}*queue(t,e){let r=performance.now();for(let i=0;i<t;i++)performance.now()-r>=this.duration&&(r=performance.now(),yield),this.stopped||e(i)}clear(){this.stopped=!0,this.t&&(Qn(this.t),this.t=null),this.generator=void 0}}const $n=class t extends Se{constructor(){super(),f(this,"svg"),f(this,"resources",[]),f(this,"resourcesMap",{}),f(this,"boundingBox",new Le),f(this,"_styles",{}),f(this,"_traverseMap",new WeakMap),f(this,"_elementsMap",{}),f(this,"_tic"),f(this,"_mergeEnable",!0),f(this,"_analyzeByID",!0)}static get instance(){return t._instance||(this._instance=new t),this._instance}static parse(t){return this.init(),t?(this.instance.svg=(new be.window.DOMParser).parseFromString(t,"image/svg+xml").documentElement,this.instance):this.instance}static init(t){return this.instance.svg=t,this.instance.resources=[],this.instance.resourcesMap={},this.instance.boundingBox=new Le,this.instance._elementsMap={},this.instance._traverseMap=new WeakMap,this.instance._styles={},this.instance._tic&&(this.instance._tic.clear(),this.instance._tic=void 0),this.instance._mergeEnable=!0,this.instance._analyzeByID=!0,this.instance}getALl(){if(this._mergeEnable=!1,this._analyzeByID=!1,!this.svg)throw"svg not found";return Vi(this.svg,(t=>{this.initResource(t)})),this.getResources()}initResources(){if(!this.svg)throw"svg not found";return Vi(this.svg,(t=>{this.initResource(t)})),this}initResource(t){var e;if(this._traverseMap.has(t))return;if("svg"===t.nodeName||"defs"===t.nodeName)return;if("g"===t.nodeName&&ji(t.childNodes[0],"id"))return;const r=ji(t,"id","");if(this._analyzeByID&&!r)return;let i=this.trans2Shape(t,!0);if(i){if("symbol"===t.nodeName)i.userData.id=r,i.userData.nodeName=t.nodeName;else if("use"===t.nodeName)i.userData.symbolId=i.userData.id,i.userData.id=r,i.userData.nodeName=t.nodeName;else if("text"===i.userData.nodeName){if(be.config.usedCache){const t=new zn(i);t.matrix.copy(i.matrix),i=t}}else i.userData.id||(i.userData.id=r),i.userData.nodeName||(i.userData.nodeName=t.nodeName);return(null==(e=i.userData)?void 0:e.id)&&(i.name=i.userData.id),this.initResourceTypes(t,i),this.resources.push(i),this.resourcesMap[r]=i,i}}initResourceTypes(t,e){const r=this.getAssetType(t),i=this.getLayerType(t);return r&&(e.userData.assetType=r,e.selectable=!0),i&&(e.userData.layerType=i),e}getAssetType(t){let e="";const r=ji(t,"id","");if(!r)return e;const i=r.replace(/-assets/g,"");return Object.values(lr).includes(i)&&(e=i),!e&&t.parentNode&&(e=this.getAssetType(t.parentNode)),e}getLayerType(t){let e="";return ji(t,"id","")?(t.parentNode&&(e=ji(t.parentNode,"id","")),e):e}initResourcesSlice(){return g(this,null,(function*(){if(!this.svg)throw"svg not found";!function(t,e={}){Vi(t,(r=>{const i=ji(r,"id","");r!==t&&i&&(e[i]=r)}))}(this.svg,this._elementsMap),function(t,e={}){var r,i,n;if(!t||!(null==(r=t.childNodes)?void 0:r.length))return e;const s=De.find(t.childNodes,(t=>"defs"===t.nodeName));if(!(null==(i=null==s?void 0:s.childNodes)?void 0:i.length))return e;const a=De.find(s.childNodes,(t=>"style"===t.nodeName));(null==(n=null==a?void 0:a.childNodes)?void 0:n.length)&&function(t,e={}){if(!t)return e;const r=/(.+?)\s*{([^}]+)}/g;let i;for(;null!==(i=r.exec(t));){const t=i[1].trim().replace(/^\./,""),r=i[2].trim(),n={};r.split(";").forEach((t=>{const[e,r]=t.split(":").map((t=>t.trim()));e&&r&&(n[e]=r)})),e[t]=n}}(a.childNodes[0].nodeValue,e)}(this.svg,this._styles);const t=function(t,e=[]){return Vi(t,(r=>{const i=ji(r,"id","");r!==t&&i&&e.push(r)})),e}(this.svg);return new Promise((e=>{this._tic&&this._tic.clear();let i=performance.now();this._tic=new Zn(t,(n=>{const s=this.initResource(t[n]);this.computeBoundingBox(s),this.dispatchEvent({type:r.DYNAMIC_LOADED,data:{o:s,p:Math.round(n/t.length*100)/100}}),performance.now()-i>be.config.sliceDuration&&(i=performance.now()),n==t.length-1&&(this.dispatchEvent({type:r.INITIALIZATION_COMPLETE}),e())}),be.config.sliceDuration)}))}))}computeBoundingBox(t){var e;return t&&"symbol"!==(null==(e=t.userData)?void 0:e.nodeName)?(t.updateMatrixWorld(),rs.copy(t.computeBoundingBox()).applyMatrix3(t.matrixWorld),this.boundingBox.union(rs),this.boundingBox):this.boundingBox}getBoundingBox(){return this.boundingBox}getOffset(){const t=new Oe;if(!this.boundingBox||this.boundingBox.isEmpty())return t;this.boundingBox.getCenter(t),this.boundingBox.getSize(es);const e=t.length();return e<es.x&&e<es.y?new Oe:t.round()}alignCoordinateCenter(){var t;es.copy(this.getOffset());for(let e=0,r=(null==(t=this.resources)?void 0:t.length)||0;e<r;e++){const t=this.resources[e];"symbol"!==t.userData.nodeName&&(t.position.sub(es),t.updateMatrix())}}setTexture(t,e){e.boundingBox.isEmpty()&&e.computeBoundingBox(),Mn.setByShape(e.userData.id,e,e.boundingBox.getSize(es))}getElementsMap(){return this._elementsMap}getResourceById(t){if(t)return this.resourcesMap[t]}getResourcesMap(){return this.resourcesMap}getResources(){return this.resources}trans2Shape(t,e=!1){var r,i;let n;if(t){switch(this._traverseMap.set(t,!0),t.nodeName){case"g":if(!(null==(r=t.childNodes)?void 0:r.length))return;n=this.transG(t,e);break;case"symbol":if(!(null==(i=t.childNodes)?void 0:i.length))return;n=this.transSymbol(t,e);break;case"path":n=this.transPath(t,e);break;case"use":n=this.transUse(t,e);break;case"circle":n=this.transCircle(t,e);break;case"text":n=this.transText(t,e)}return n}}transG(t,e=!1){var r;if(!t)return;let i;i=new on({});for(let n=0,s=(null==(r=null==t?void 0:t.childNodes)?void 0:r.length)||0;n<s;n++){const r=null==t?void 0:t.childNodes[n],s=this.trans2Shape(r,e);s&&i.add(s)}return null==i||i.applyMatrix3(Yi(t,e,ts)),i}transSymbol(t,e=!1){var r;if(!t)return;let i;if(1===(null==(r=t.childNodes)?void 0:r.length))i=this.trans2Shape(t.childNodes[0],!1);else{i=new on({});for(let e=0,r=t.childNodes.length;e<r;e++){const r=t.childNodes[e],n=this.trans2Shape(r,!1);n&&i.add(n)}}return i?(null==i||i.applyMatrix3(Yi(t,e,ts)),(null==i?void 0:i.userData)&&(i.userData.id=ji(t,"id"),i.userData.nodeName="symbol",i.featureKey=i.userData.id,i.name=i.userData.id),i):void 0}transPath(t,e=!1){if(t&&ji(t,"d"))return wn.setMergeEnable(this._mergeEnable).getShapeByElement(t,{alignCenter:!0,stroke:be.config.defaultStroke||Ar,wireframe:be.config.wireframe},e)}transUse(t,e=!1){var r,i;if(!t)return;const n=zi(t);let s=this.getResourceById(n);if(!s)return;Mn.has(s.featureKey)||!(null==(r=be.config)?void 0:r.usedCache)&&!be.config.separateCache||(s.boundingBox.isEmpty()&&s.computeBoundingBox(),s.boundingBox.getSize(es),Mn.setByShape(s.featureKey,s,es));const a=(null==(i=be.config)?void 0:i.usedCache)||be.config.separateCache?new zn(s):s.clone();return Yi(t,e,ts),a.applyMatrix3(ts),be.config.separateCache&&a.separateCache(),a}transCircle(t,e=!1){if(t)return wn.setMergeEnable(this._mergeEnable).getShapeByElement(t,{alignCenter:!0,stroke:be.config.defaultStroke||Ar,wireframe:be.config.wireframe},e)}transText(t,e=!1){if(!t)return;const r=t.textContent;if(!r)return;const i=function(t){if(!t)return;let e=ji(t,"aid"),r=t.parentNode;if(r){if(!e){let t=ji(r,"id");if(t||(t=ji(r.parentNode,"id")),!t)return;const i=t.match(Wi);e=i?i[1]:t}return e}}(t);if(!i)return;const n=this.getElementFontSize(t)||Jn,s=wn.setMergeEnable(this._mergeEnable).getText({text:r,fontSize:n,fill:be.config.defaultStroke||Ar,wireframe:be.config.wireframe,alignCenter:!0,flipY:e});let a=ji(t,"dy");return a||(a=ji(t,"y")),a&&(s.position.y=Math.round(parseFloat(a)*n),s.updateMatrix()),s}getElementFontSize(t){let e=Jn;if(!t||"g"!==t.nodeName&&"text"!==t.nodeName)return e;const r=t.parentNode;if(!r)return e;const i=ji(t,"font-size","");if(i.endsWith("px"))return parseFloat(i);if(i.endsWith("em"))return parseFloat(i)*Jn;if(i===parseFloat(i).toString())return parseFloat(i);const n=ji(t,"class");if(!i&&n)return this.getStyleFontSize(n);const s=this.getElementFontSize(r);return i?e:s}getStyleFontSize(t){if(!t||!this._styles||!this._styles[t])return Jn;const e=De.get(this._styles[t],"font-size",void 0);return e.endsWith("em")?Math.round(parseFloat(e)*Jn):Math.round(parseFloat(e))}};f($n,"_instance");let Kn=$n;const Jn=16,ts=new Ve,es=new Oe,rs=new Le;class is extends nn{constructor(t,e={}){if(super(void 0,void 0,e),f(this,"isSvg",!0),f(this,"name","Svg"),f(this,"matrixAutoUpdate",!1),f(this,"composeNode",!0),f(this,"alignCenter",!0),!t)throw new Error("svg is empty");let r=Kn.parse(t).getALl();if(!r.length)throw new Error("svg is empty");1===r.length&&r[0].isShape?(this.geo=r[0].geo,this.mat=r[0].mat,e.fill&&(this.mat.fill=e.fill),e.stroke&&(this.mat.stroke=e.stroke)):1===r.length&&r[0].isGroup&&r[0].children.forEach((t=>this.add(t)))}destroy(){super.destroy()}render(t,e){super.render(t,e)}}const ns=t=>ArrayBuffer.isView(t)&&!(t instanceof DataView),ss=(t,e=0,r)=>ns(t)?new(0,t.constructor)(t.subarray(e,void 0!==r?r:t.length)):t.slice(e,r),as=(t,e,r)=>t&&t.constructor!==e?"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t):t;class os{constructor(t,e,r,i){f(this,"parameterPositions"),f(this,"resultBuffer"),f(this,"sampleValues"),f(this,"valueSize"),f(this,"settings",null),f(this,"DefaultSettings_",{}),f(this,"__cacheIndex"),f(this,"_cachedIndex",0),this.parameterPositions=t,this.sampleValues=e,this.valueSize=r,this.resultBuffer=i||new Float32Array(r)}evaluate(t){const e=this.parameterPositions;let r=this._cachedIndex,i=e[r],n=e[r-1];t:{e:{let s;r:{i:if(!(t<i)){for(let s=r+2;;){if(void 0===i){if(t<n)break i;return r=e.length,this._cachedIndex=r,this.copySampleValue_(r-1)}if(r===s)break;if(n=i,i=e[++r],t<i)break e}s=e.length;break r}if(t>=n)break t;{const a=e[1];t<a&&(r=2,n=a);for(let s=r-2;;){if(void 0===n)return this._cachedIndex=0,this.copySampleValue_(0);if(r===s)break;if(i=n,n=e[--r-1],t>=n)break e}s=r,r=0}}for(;r<s;){const i=r+s>>>1;t<e[i]?s=i:r=i+1}if(i=e[r],n=e[r-1],void 0===n)return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===i)return r=e.length,this._cachedIndex=r,this.copySampleValue_(r-1)}this._cachedIndex=r,this.intervalChanged_(r,n,i)}return this.interpolate_(r,n,t,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){const e=this.resultBuffer,r=this.sampleValues,i=this.valueSize,n=t*i;for(let t=0;t!==i;++t)e[t]=r[n+t];return e}}class hs extends os{constructor(t,e,r,i){super(t,e,r,i)}interpolate_(t){return this.copySampleValue_(t-1)}intervalChanged_(){}}class us extends os{constructor(t,e,r,i){super(t,e,r,i)}interpolate_(t,e,r,i){const n=this.resultBuffer,s=this.sampleValues,a=this.valueSize,o=t*a,h=o-a,u=(r-e)/(i-e),c=1-u;for(let t=0;t!==a;++t)n[t]=Number(s[h+t])*c+Number(s[o+t])*u;return n}intervalChanged_(){}}class cs extends os{constructor(t,e,r,i){super(t,e,r,i),f(this,"_weightPrev",-0),f(this,"_offsetPrev",-0),f(this,"_weightNext",-0),f(this,"_offsetNext",-0),this.DefaultSettings_={endingStart:2400,endingEnd:2400}}interpolate_(t,e,r,i){const n=this.resultBuffer,s=this.sampleValues,a=this.valueSize,o=t*a,h=o-a,u=this._offsetPrev,c=this._offsetNext,l=this._weightPrev,d=this._weightNext,p=(r-e)/(i-e),f=p*p,m=f*p,g=-l*m+2*l*f-l*p,y=(1+l)*m+(-1.5-2*l)*f+(-.5+l)*p+1,v=(-1-d)*m+(1.5+d)*f+.5*p,x=d*m-d*f;for(let t=0;t!==a;++t)n[t]=g*Number(s[u+t])+y*Number(s[h+t])+v*Number(s[o+t])+x*Number(s[c+t]);return n}intervalChanged_(t,e,r){const i=this.parameterPositions;let n=t-2,s=t+1,a=i[n],o=i[s];if(void 0===a)switch(this.getSettings_().endingStart){case 2401:n=t,a=2*e-r;break;case 2402:n=i.length-2,a=e+i[n]-i[n+1];break;default:n=t,a=r}if(void 0===o)switch(this.getSettings_().endingEnd){case 2401:s=t,o=2*r-e;break;case 2402:s=1,o=r+i[1]-i[0];break;default:s=t-1,o=e}const h=.5*(r-e),u=this.valueSize;this._weightPrev=h/(e-a),this._weightNext=h/(o-r),this._offsetPrev=n*u,this._offsetNext=s*u}}const ls=2300,ds=2301,ps=2302;class fs{constructor(t,e,r,i){if(f(this,"name","KeyframeTrack"),f(this,"times"),f(this,"values"),f(this,"ValueTypeName",""),f(this,"DefaultInterpolation",ds),f(this,"createInterpolant"),f(this,"InterpolantFactoryMethodDiscrete",this._InterpolantFactoryMethodDiscrete),f(this,"InterpolantFactoryMethodLinear",this._InterpolantFactoryMethodLinear),f(this,"InterpolantFactoryMethodSmooth",this._InterpolantFactoryMethodSmooth),!e||!e.length)throw new Error("KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=as(e,Float32Array),this.values=as(r,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(t){const e=t.constructor;let r;if(e.toJSON!==this.toJSON)r=e.toJSON(t);else{r={name:t.name,times:as(t.times,Array),values:as(t.values,Array)};const e=t.getInterpolation();e!==t.DefaultInterpolation&&(r.interpolation=e)}return r.type=t.ValueTypeName,r}_InterpolantFactoryMethodDiscrete(t){return new hs(this.times,this.values,this.getValueSize(),t)}_InterpolantFactoryMethodLinear(t){return new us(this.times,this.values,this.getValueSize(),t)}_InterpolantFactoryMethodSmooth(t){return new cs(this.times,this.values,this.getValueSize(),t)}getValueSize(){return Math.ceil(this.values.length/this.times.length)}setInterpolation(t){let e;switch(t){case ls:e=this.InterpolantFactoryMethodDiscrete;break;case ds:e=this.InterpolantFactoryMethodLinear;break;case ps:e=this.InterpolantFactoryMethodSmooth}if(!e){const e="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(e);this.setInterpolation(this.DefaultInterpolation)}return this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return ls;case this.InterpolantFactoryMethodLinear:return ds;case this.InterpolantFactoryMethodSmooth:return ps}}shift(t){if(0!==t){const e=this.times;for(let r=0,i=e.length;r!==i;++r)e[r]+=t}return this}scale(t){if(1!==t){const e=this.times;for(let r=0,i=e.length;r!==i;++r)e[r]*=t}return this}trim(t,e){const r=this.times,i=r.length;let n=0,s=i-1;for(;n!==i&&r[n]<t;)++n;for(;-1!==s&&r[s]>e;)--s;if(++s,0!==n||s!==i){n>=s&&(s=Math.max(s,1),n=s-1);const t=this.getValueSize();this.times=ss(r,n,s),this.values=ss(this.values,n*t,s*t)}return this}validate(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!=0&&(t=!1);const r=this.times,i=this.values,n=r.length;0===n&&(t=!1);let s=null;for(let e=0;e!==n;e++){const i=r[e];if("number"==typeof i&&isNaN(i)){t=!1;break}if(null!==s&&s>i){t=!1;break}s=i}if(void 0!==i&&ns(i))for(let e=0,r=i.length;e!==r;++e){const r=i[e];if(isNaN(r)){t=!1;break}}return t}optimize(){const t=ss(this.times),e=ss(this.values),r=this.getValueSize(),i=this.getInterpolation()===ps,n=t.length-1;let s=1;for(let a=1;a<n;++a){let n=!1;const o=t[a];if(o!==t[a+1]&&(1!==a||o!==t[0]))if(i)n=!0;else{const t=a*r,i=t-r,s=t+r;for(let a=0;a!==r;++a){const r=e[t+a];if(r!==e[i+a]||r!==e[s+a]){n=!0;break}}}if(n){if(a!==s){t[s]=t[a];const i=a*r,n=s*r;for(let t=0;t!==r;++t)e[n+t]=e[i+t]}++s}}if(n>0){t[s]=t[n];for(let t=n*r,i=s*r,a=0;a!==r;++a)e[i+a]=e[t+a];++s}return s!==t.length?(this.times=ss(t,0,s),this.values=ss(e,0,s*r)):(this.times=t,this.values=e),this}clone(){const t=ss(this.times,0),e=ss(this.values,0),r=new(0,this.constructor)(this.name,t,e);return r.createInterpolant=this.createInterpolant,r}}f(fs,"DefaultInterpolation",ds),fs.prototype.ValueBufferType=Float32Array;class ms extends fs{constructor(){super(...arguments),f(this,"ValueTypeName","vector2")}}class gs extends fs{constructor(){super(...arguments),f(this,"ValueTypeName","number")}}class ys extends fs{constructor(){super(...arguments),f(this,"ValueTypeName","color")}}class vs extends fs{constructor(){super(...arguments),f(this,"ValueTypeName","bool"),f(this,"DefaultInterpolation",ls)}}vs.prototype.ValueBufferType=Array,vs.prototype.InterpolantFactoryMethodLinear=void 0,vs.prototype.InterpolantFactoryMethodSmooth=void 0;class xs extends fs{constructor(){super(...arguments),f(this,"ValueTypeName","string"),f(this,"DefaultInterpolation",ls)}}vs.prototype.ValueBufferType=Array,xs.prototype.InterpolantFactoryMethodLinear=void 0,xs.prototype.InterpolantFactoryMethodSmooth=void 0;class _s{constructor(t,e=-1,r,i=ws){f(this,"name","AnimationClip"),f(this,"duration"),f(this,"tracks"),f(this,"blendMode",ws),f(this,"uuid",Ke()),this.name=t,this.duration=e,this.tracks=r,this.blendMode=i,this.duration<0&&this.resetDuration()}static parse(t){const e=[],r=t.tracks,i=1/(t.fps||1);for(let t=0,n=r.length;t!==n;++t)e.push(bs(r[t]).scale(i));const n=new this(t.name,t.duration,e,t.blendMode);return n.uuid=t.uuid,n}static toJSON(t){const e=[],r=t.tracks,i={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let t=0,i=r.length;t!==i;++t)e.push(fs.toJSON(r[t]));return i}static findByName(t,e){let r;if(t.isShape){const e=t;r=e.geo&&e.geo.animations||e.animations}else r=t;for(let t=0;t<r.length;t++)if(r[t].name===e)return r[t]}resetDuration(){let t=0;for(let e=0,r=this.tracks.length;e!==r;++e){const r=this.tracks[e];t=Math.max(t,r.times[r.times.length-1])}return this.duration=t,this}trim(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this}validate(){let t=!0;for(let e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t}optimize(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}clone(){const t=[];for(let e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new(0,this.constructor)(this.name,this.duration,t,this.blendMode)}toJSON(){return _s.toJSON(this)}}function bs(t){if(void 0===t.type)throw new Error("KeyframeTrack: track type undefined, can not parse");const e=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return gs;case"vector":case"vector2":return ms;case"color":return ys;case"bool":case"boolean":return vs;case"string":return xs}throw new Error("KeyframeTrack: Unsupported typeName: "+t)}(t.type);if(void 0===t.times){const e=[],r=[];((t,e,r,i)=>{let n=1,s=t[0];for(;void 0!==s&&void 0===s[i];)s=t[n++];if(void 0===s)return;let a=s[i];if(void 0!==a)if(Array.isArray(a))do{a=s[i],void 0!==a&&(e.push(s.time),r.push.apply(r,a)),s=t[n++]}while(void 0!==s);else if(void 0!==a.toArray)do{a=s[i],void 0!==a&&(e.push(s.time),a.toArray(r,r.length)),s=t[n++]}while(void 0!==s);else do{a=s[i],void 0!==a&&(e.push(s.time),r.push(a)),s=t[n++]}while(void 0!==s)})(t.keys,e,r,"value"),t.times=e,t.values=r}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}const ws=2500;class Es{constructor(t,e,r){f(this,"path",""),f(this,"parsedPath"),f(this,"_targetGroup"),f(this,"_bindings"),f(this,"rootNode"),this.parsedPath=r||Ts.parseTrackName(e),this._targetGroup=t,this._bindings=t.subscribe_(e,this.parsedPath)}getValue(t,e){this.bind();const r=this._targetGroup.nCachedObjects_,i=this._bindings[r];void 0!==i&&i.getValue(t,e)}setValue(t,e){const r=this._bindings;for(let i=this._targetGroup.nCachedObjects_,n=r.length;i!==n;++i)r[i].setValue(t,e)}bind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,r=t.length;e!==r;++e)t[e].bind()}unbind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,r=t.length;e!==r;++e)t[e].unbind()}}class Ts{constructor(t,e,r){f(this,"path"),f(this,"parsedPath"),f(this,"node"),f(this,"rootNode"),f(this,"getValue",this._getValue_unbound),f(this,"setValue",this._setValue_unbound),f(this,"targetObject"),f(this,"propertyName"),f(this,"resolvedProperty"),f(this,"propertyIndex",-1),f(this,"BindingType",{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3,ColorString:4}),f(this,"Versioning",{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2}),f(this,"GetterByBindingType",[this._getValue_direct,this._getValue_array,this._getValue_arrayElement,this._getValue_toArray,this._getValue_color]),f(this,"SetterByBindingTypeAndVersioning",[[this._setValue_direct,this._setValue_direct_setNeedsUpdate,this._setValue_direct_setMatrixWorldNeedsUpdate],[this._setValue_array,this._setValue_array_setNeedsUpdate,this._setValue_array_setMatrixWorldNeedsUpdate],[this._setValue_arrayElement,this._setValue_arrayElement_setNeedsUpdate,this._setValue_arrayElement_setMatrixWorldNeedsUpdate],[this._setValue_fromArray,this._setValue_fromArray_setNeedsUpdate,this._setValue_fromArray_setMatrixWorldNeedsUpdate],[this._setValue_color,this._setValue_color_setNeedsUpdate,this._setValue_color_setMatrixWorldNeedsUpdate]]),this.path=e,this.parsedPath=r||Ts.parseTrackName(e),this.node=Ts.findNode(t,this.parsedPath.nodeName),this.rootNode=t}static create(t,e,r){return t&&t.isAnimationObjectGroup?new Es(t,e,r):new Ts(t,e,r)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(As,"")}static parseTrackName(t){const e=Ds.exec(t);if(null===e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const r={nodeName:e[2],objectName:e[3],objectIndex:e[4]?parseInt(e[4]):void 0,propertyName:e[5],propertyIndex:e[6]?parseInt(e[6]):void 0},i=r.nodeName&&r.nodeName.lastIndexOf(".")||void 0;if(void 0!==i&&-1!==i){const t=r.nodeName.substring(i+1);-1!==Ls.indexOf(t)&&(r.nodeName=r.nodeName.substring(0,i),r.objectName=t)}if(null===r.propertyName||void 0===r.propertyName||0===r.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return r}static findNode(t,e){if(void 0===e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;const r=t.getObjectByProperty("name",e)||t.getObjectByProperty("uuid",e);return r||void 0}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){this.targetObject&&this.propertyName&&(t[e]=this.targetObject[this.propertyName])}_getValue_array(t,e){const r=this.resolvedProperty;for(let i=0,n=r.length;i!==n;++i)t[e++]=r[i]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_getValue_color(t,e){const r=Dr.getArray(this.resolvedProperty);for(let i=0,n=r.length;i<n;i++)t[e++]=r[i]}_setValue_direct(t,e){this.targetObject&&this.propertyName&&(this.targetObject[this.propertyName]=t[e])}_setValue_direct_setNeedsUpdate(t,e){this.targetObject&&this.propertyName&&(this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0)}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject&&this.propertyName&&(this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0)}_setValue_array(t,e){const r=this.resolvedProperty;for(let i=0,n=r.length;i!==n;++i)r[i]=t[e++]}_setValue_array_setNeedsUpdate(t,e){if(!this.targetObject)return;const r=this.resolvedProperty;for(let i=0,n=r.length;i!==n;++i)r[i]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){if(!this.targetObject)return;const r=this.resolvedProperty;for(let i=0,n=r.length;i!==n;++i)r[i]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.targetObject&&(this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0)}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.targetObject&&(this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0)}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.targetObject&&(this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0)}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.targetObject&&(this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0)}_setValue_color(t,e){this.targetObject&&this.propertyName&&(this.resolvedProperty=this.targetObject[this.propertyName]=Bs.fromArray(t,e).getStyle())}_setValue_color_setNeedsUpdate(t,e){this.targetObject&&(this._setValue_color(t,e),this.targetObject.needsUpdate=!0)}_setValue_color_setMatrixWorldNeedsUpdate(t,e){this.targetObject&&(this._setValue_color(t,e),this.targetObject.matrixWorldNeedsUpdate=!0)}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node;const e=this.parsedPath,r=e.objectName,i=e.propertyName;let n=e.propertyIndex;if(t||(t=Ts.findNode(this.rootNode,e.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t)return;if(r){let i=e.objectIndex;if(void 0===t[r])return;if(t=t[r],void 0!==i){if(void 0===t[i])return;t=t[i]}}if(!t)return;const s=t[i];if(void 0===s)return void e.nodeName;let a=this.Versioning.None;this.targetObject=t,void 0!==t.needsUpdate?a=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(a=this.Versioning.MatrixWorldNeedsUpdate);let o=this.BindingType.Direct;void 0!==n?(o=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=n):void 0!==s.fromArray&&void 0!==s.toArray?(o=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(o=this.BindingType.EntireArray,this.resolvedProperty=s):s&&Dr.isColor(s)?(o=this.BindingType.ColorString,this.resolvedProperty=s,this.propertyName=i):this.propertyName=i,this.getValue=this.GetterByBindingType[o],this.setValue=this.SetterByBindingTypeAndVersioning[o][a]}unbind(){this.node=void 0,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}const Ss="\\[\\]\\.:\\/",As=new RegExp("["+Ss+"]","g"),Ns="[^"+Ss+"]",Cs="[^"+Ss.replace("\\.","")+"]",Ms=/((?:WC+[\/:])*)/.source.replace("WC",Ns),Os=/(WCOD+)?/.source.replace("WCOD",Cs),Is=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Ns),Rs=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Ns),Ds=new RegExp("^"+Ms+Os+Is+Rs+"$"),Ls=["material","materials","bones","map","mat","geo"],Bs=new Dr;class ks{constructor(t,e,r){let i,n,s;switch(f(this,"binding"),f(this,"valueSize"),f(this,"buffer"),f(this,"_workIndex",0),f(this,"_mixBufferRegion"),f(this,"_mixBufferRegionAdditive"),f(this,"_setIdentity"),f(this,"_origIndex",3),f(this,"_addIndex",4),f(this,"_cacheIndex"),f(this,"cumulativeWeight",0),f(this,"cumulativeWeightAdditive",0),f(this,"useCount",0),f(this,"referenceCount",0),this.binding=t,this.valueSize=r,e){case"fill":case"stroke":case"textFill":case"string":case"bool":i=this._select,n=this._select,s=this._setAdditiveIdentityOther,this.buffer=new Array(5*r);break;default:i=this._lerp,n=this._lerpAdditive,s=this._setAdditiveIdentityNumeric,this.buffer=new Float32Array(5*r)}this._mixBufferRegion=i,this._mixBufferRegionAdditive=n,this._setIdentity=s,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(t,e){const r=this.buffer,i=this.valueSize,n=t*i+i;let s=this.cumulativeWeight;if(0===s){for(let t=0;t!==i;++t)r[n+t]=r[t];s=e}else{s+=e;const t=e/s;this._mixBufferRegion(r,n,0,t,i)}this.cumulativeWeight=s}accumulateAdditive(t){const e=this.buffer,r=this.valueSize,i=r*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(e,i,0,t,r),this.cumulativeWeightAdditive+=t}apply(t){const e=this.valueSize,r=this.buffer,i=t*e+e,n=this.cumulativeWeight,s=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,n<1){const t=e*this._origIndex;this._mixBufferRegion(r,i,t,1-n,e)}s>0&&this._mixBufferRegionAdditive(r,i,this._addIndex*e,1,e);for(let t=e,n=e+e;t!==n;++t)if(r[t]!==r[t+e]){a.setValue(r,i);break}}saveOriginalState(){const t=this.binding,e=this.buffer,r=this.valueSize,i=r*this._origIndex;t.getValue(e,i);for(let t=r,n=i;t!==n;++t)e[t]=e[i+t%r];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const t=3*this.valueSize;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){const t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let r=t;r<e;r++)this.buffer[r]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const t=this._origIndex*this.valueSize,e=this._addIndex*this.valueSize;for(let r=0;r<this.valueSize;r++)this.buffer[e+r]=this.buffer[t+r]}_select(t,e,r,i,n){if(i>=.5)for(let i=0;i!==n;++i)t[e+i]=t[r+i]}_lerp(t,e,r,i,n){const s=1-i;for(let a=0;a!==n;++a){const n=e+a;t[n]=t[n]*s+t[r+a]*i}}_lerpAdditive(t,e,r,i,n){for(let s=0;s!==n;++s){const n=e+s;t[n]=t[n]+t[r+s]*i}}}const Ps=2400,Us=2401;class Vs{constructor(t,e,r,i=e.blendMode){f(this,"blendMode"),f(this,"loop",2201),f(this,"time",0),f(this,"timeScale",1),f(this,"weight",1),f(this,"repetitions",1/0),f(this,"paused",!1),f(this,"enabled",!0),f(this,"clampWhenFinished",!1),f(this,"zeroSlopeAtStart",!0),f(this,"zeroSlopeAtEnd",!0),f(this,"_mixer"),f(this,"_clip"),f(this,"_localRoot"),f(this,"_interpolantSettings"),f(this,"_interpolants"),f(this,"_propertyBindings"),f(this,"_cacheIndex"),f(this,"_byClipCacheIndex"),f(this,"_timeScaleInterpolant"),f(this,"_weightInterpolant"),f(this,"_loopCount",-1),f(this,"_startTime"),f(this,"_effectiveTimeScale",1),f(this,"_effectiveWeight",1),this._mixer=t,this._clip=e,this._localRoot=r,this.blendMode=i;const n=e.tracks,s=n.length,a=new Array(s),o={endingStart:Ps,endingEnd:Ps};for(let t=0;t!==s;++t){const e=n[t].createInterpolant();e&&(a[t]=e,e.settings=o)}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(s)}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=void 0,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&void 0===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(t){return this._startTime=t,this}setLoop(t,e){return this.loop=t,this.repetitions=e,this}stopFading(){const t=this._weightInterpolant;return void 0!==t&&(this._weightInterpolant=void 0,this._mixer._takeBackControlInterpolant(t)),this}stopWarping(){const t=this._timeScaleInterpolant;return void 0!==t&&(this._timeScaleInterpolant=void 0,this._mixer._takeBackControlInterpolant(t)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,e,r,i){if(!this.enabled)return void this._updateWeight(t);const n=this._startTime;if(void 0!==n){const i=(t-n)*r;i<0||0===r?e=0:(this._startTime=void 0,e=r*i)}e*=this._updateTimeScale(t);const s=this._updateTime(e),a=this._updateWeight(t);if(a>0){const t=this._interpolants,e=this._propertyBindings;if(2501===this.blendMode)for(let r=0,i=t.length;r!==i;++r)t[r].evaluate(s),e[r].accumulateAdditive(a);else for(let r=0,n=t.length;r!==n;++r)t[r].evaluate(s),e[r].accumulate(i,a)}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const r=this._weightInterpolant;if(void 0!==r){const i=r.evaluate(t)[0];e*=Number(i),t>r.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const r=this._timeScaleInterpolant;if(void 0!==r){const i=r.evaluate(t)[0];e*=Number(i),t>r.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,r=this.loop;let i=this.time+t,n=this._loopCount;const s=2202===r;if(0===t)return-1===n||!s||1&~n?i:e-i;if(2200===r){-1===n&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(i>=e)i=e;else{if(!(i<0)){this.time=i;break t}i=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",data:{action:this,direction:t<0?-1:1}})}}else{if(-1===n&&(t>=0?(n=0,this._setEndings(!0,0===this.repetitions,s)):this._setEndings(0===this.repetitions,!0,s)),i>=e||i<0){const r=Math.floor(i/e);i-=e*r,n+=Math.abs(r);const a=this.repetitions-n;if(a<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=t>0?e:0,this.time=i,this._mixer.dispatchEvent({type:"finished",data:{action:this,direction:t>0?1:-1}});else{if(1===a){const e=t<0;this._setEndings(e,!e,s)}else this._setEndings(!1,!1,s);this._loopCount=n,this.time=i,this._mixer.dispatchEvent({type:"loop",data:{action:this,loopDelta:r}})}}else this.time=i;if(s&&!(1&~n))return e-i}return i}_setEndings(t,e,r){const i=this._interpolantSettings;r?(i.endingStart=Us,i.endingEnd=Us):(i.endingStart=t?this.zeroSlopeAtStart?Us:Ps:2402,i.endingEnd=e?this.zeroSlopeAtEnd?Us:Ps:2402)}}const Fs=new Float32Array(1);class qs extends Se{constructor(t){super(),f(this,"stats"),f(this,"time",0),f(this,"timeScale",1),f(this,"_root"),f(this,"_accuIndex",0),f(this,"_actions",[]),f(this,"_nActiveActions",0),f(this,"_actionsByClip",{}),f(this,"_bindings",[]),f(this,"_nActiveBindings",0),f(this,"_bindingsByRootAndName",{}),f(this,"_controlInterpolants",[]),f(this,"_nActiveControlInterpolants",0),this._root=t,this._initMemoryManager()}destroy(){super.destroy(),this.stopAllAction()}bind(t){t&&(this._root=t)}_bindAction(t,e){if(!this._root)return;const r=t._localRoot||this._root,i=t._clip.tracks,n=i.length,s=t._propertyBindings,a=t._interpolants,o=r.uuid,h=this._bindingsByRootAndName;let u=h[o];void 0===u&&(u={},h[o]=u);for(let t=0;t!==n;++t){const n=i[t],h=n.name;let c=u[h];if(void 0===c){if(c=s[t],void 0!==c){void 0===c._cacheIndex&&(++c.referenceCount,this._addInactiveBinding(c,o,h));continue}const i=e&&e._propertyBindings[t].binding.parsedPath,a=n.getValueSize();c=new ks(Ts.create(r,h,i),n.ValueTypeName,a),++c.referenceCount,this._addInactiveBinding(c,o,h),s[t]=c}else++c.referenceCount,s[t]=c;a[t].resultBuffer=c.buffer}}_activateAction(t){if(this._root&&!this._isActiveAction(t)){if(void 0===t._cacheIndex){const e=(t._localRoot||this._root).uuid,r=t._clip.uuid,i=this._actionsByClip[r];this._bindAction(t,i&&i.knownActions[0]),this._addInactiveAction(t,r,e)}const e=t._propertyBindings;for(let t=0,r=e.length;t!==r;++t){const r=e[t];0==r.useCount++&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(t)}}_deactivateAction(t){if(this._isActiveAction(t)){const e=t._propertyBindings;for(let t=0,r=e.length;t!==r;++t){const r=e[t];0==--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(t)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}}_isActiveAction(t){const e=t._cacheIndex;return void 0!==e&&e<this._nActiveActions}_addInactiveAction(t,e,r){const i=this._actions,n=this._actionsByClip;let s=n[e];if(void 0===s)s={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,n[e]=s;else{const e=s.knownActions;t._byClipCacheIndex=e.length,e.push(t)}t._cacheIndex=i.length,i.push(t),s.actionByRoot[r]=t}_removeInactiveAction(t){if(!this._root)return;const e=this._actions,r=e[e.length-1],i=t._cacheIndex||0;r._cacheIndex=i,e[i]=r,e.pop(),t._cacheIndex=void 0;const n=t._clip.uuid,s=this._actionsByClip,a=s[n],o=a.knownActions,h=o[o.length-1],u=t._byClipCacheIndex||0;h._byClipCacheIndex=u,o[u]=h,o.pop(),t._byClipCacheIndex=void 0,delete a.actionByRoot[(t._localRoot||this._root).uuid],0===o.length&&delete s[n],this._removeInactiveBindingsForAction(t)}_removeInactiveBindingsForAction(t){const e=t._propertyBindings;for(let t=0,r=e.length;t!==r;++t){const r=e[t];0==--r.referenceCount&&this._removeInactiveBinding(r)}}_lendAction(t){if(void 0===t._cacheIndex)return;const e=this._actions,r=t._cacheIndex,i=this._nActiveActions++,n=e[i];t._cacheIndex=i,e[i]=t,n._cacheIndex=r,e[r]=n}_takeBackAction(t){if(void 0===t._cacheIndex)return;const e=this._actions,r=t._cacheIndex,i=--this._nActiveActions,n=e[i];t._cacheIndex=i,e[i]=t,n._cacheIndex=r,e[r]=n}_addInactiveBinding(t,e,r){const i=this._bindingsByRootAndName,n=this._bindings;let s=i[e];void 0===s&&(s={},i[e]=s),s[r]=t,t._cacheIndex=n.length,n.push(t)}_removeInactiveBinding(t){var e;const r=this._bindings,i=t.binding,n=(null==(e=i.rootNode)?void 0:e.uuid)||"",s=i.path,a=this._bindingsByRootAndName,o=a[n],h=r[r.length-1],u=t._cacheIndex||0;h._cacheIndex=u,r[u]=h,r.pop(),delete o[s],0===Object.keys(o).length&&delete a[n]}_lendBinding(t){if(void 0===t._cacheIndex)return;const e=this._bindings,r=t._cacheIndex,i=this._nActiveBindings++,n=e[i];t._cacheIndex=i,e[i]=t,n._cacheIndex=r,e[r]=n}_takeBackBinding(t){if(void 0===t._cacheIndex)return;const e=this._bindings,r=t._cacheIndex,i=--this._nActiveBindings,n=e[i];t._cacheIndex=i,e[i]=t,n._cacheIndex=r,e[r]=n}_lendControlInterpolant(){const t=this._controlInterpolants,e=this._nActiveControlInterpolants++;let r=t[e];return void 0===r&&(r=new us(new Float32Array(2),new Float32Array(2),1,Fs),r.__cacheIndex=e,t[e]=r),r}_takeBackControlInterpolant(t){if(void 0===t.__cacheIndex)return;const e=this._controlInterpolants,r=t.__cacheIndex,i=--this._nActiveControlInterpolants,n=e[i];t.__cacheIndex=i,e[i]=t,n.__cacheIndex=r,e[r]=n}clipAction(t,e,r){if(!this._root)return;const i=e||this._root,n=i.uuid;let s;s="string"==typeof t?_s.findByName(i,t):t;const a=s?s.uuid:"",o=this._actionsByClip[a];let h;if(void 0===r&&(r=s?s.blendMode:ws),void 0!==o){const t=o.actionByRoot[n];if(void 0!==t&&t.blendMode===r)return t;h=o.knownActions[0],void 0===s&&(s=h._clip)}if(void 0===s)return;const u=new Vs(this,s,e,r);return this._bindAction(u,h),this._addInactiveAction(u,a,n),u}existingAction(t,e){if(!this._root)return;const r=e||this._root,i=r.uuid;let n="string"==typeof t?_s.findByName(r,t):t;const s=n?n.uuid:"",a=this._actionsByClip[s];return void 0!==a&&a.actionByRoot[i]||void 0}removeAction(t){t&&this._deactivateAction(t)}stopAllAction(){const t=this._actions;for(let e=this._nActiveActions-1;e>=0;--e)t[e].stop();return this}update(t){t*=this.timeScale;const e=this._actions,r=this._nActiveActions,i=this.time+=t,n=Math.sign(t),s=this._accuIndex^=1;for(let a=0;a!==r;++a)e[a]._update(i,t,n,s);const a=this._bindings,o=this._nActiveBindings;for(let t=0;t!==o;++t)a[t].apply(s);return this}setTime(t){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(t)}getRoot(){return this._root}uncacheClip(t){const e=this._actions,r=t.uuid,i=this._actionsByClip,n=i[r];if(void 0!==n){const t=n.knownActions;for(let r=0,i=t.length;r!==i;++r){const i=t[r];this._deactivateAction(i);const n=i._cacheIndex||0,s=e[e.length-1];i._cacheIndex=void 0,i._byClipCacheIndex=void 0,s._cacheIndex=n,e[n]=s,e.pop(),this._removeInactiveBindingsForAction(i)}delete i[r]}}uncacheRoot(t){const e=t.uuid,r=this._actionsByClip;for(const t in r){const i=r[t].actionByRoot[e];void 0!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}const i=this._bindingsByRootAndName[e];if(void 0!==i)for(const t in i){const e=i[t];e.restoreOriginalState(),this._removeInactiveBinding(e)}}uncacheAction(t,e){const r=this.existingAction(t,e);void 0!==r&&(this._deactivateAction(r),this._removeInactiveAction(r))}}class Hs{constructor(t=!0){f(this,"autoStart"),f(this,"startTime",0),f(this,"oldTime",0),f(this,"elapsedTime",0),f(this,"running",!1),this.autoStart=t}start(){this.startTime=Ee(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const e=Ee();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}const zs=[.15,.125,.05];let js=!0,Ws=0;class Ys extends fr{constructor(t={}){var e,r;super(),f(this,"isLoadingScene",!0),f(this,"name","LoadingScene"),f(this,"params"),f(this,"loadingMesh"),f(this,"circleMesh"),f(this,"circle2Mesh"),f(this,"scales",[.95,1.15,.002]),f(this,"scaleTrend",!1),f(this,"clock",new Hs),f(this,"mixer"),f(this,"_selectedClip"),f(this,"selectedAction"),this.params=t,this.loadingMesh=new is(Gs,{fill:Dr.getRandomStyle()}),this.loadingMesh.name="loading",this.loadingMesh.dynamically=!0,this.add(this.loadingMesh),this.loadingMesh.scale(1.6,1.6),this.loadingMesh.computeBoundingBox(),this.loadingMesh.boundingBox.getSize(Xs),Xs.multiplyScalar(1.6),this.loadingMesh.translate(-Xs.x/2,Xs.y/2),this.circleMesh=new an({dynamically:!0,usedCache:this.params.usedCache,radius:200,lineWidth:1,stroke:yr,start:0,end:1.05*Math.PI,sweepFlag:1}),this.add(this.circleMesh),this.circle2Mesh=new an({dynamically:!0,usedCache:this.params.usedCache,radius:200,lineWidth:2,stroke:mr,end:.95*Math.PI}),this.add(this.circle2Mesh),this.loadingMesh.matrixAutoUpdate=!0,this.circleMesh.matrixAutoUpdate=!0,this.circle2Mesh.matrixAutoUpdate=!0,this.loadingMesh.computeBoundingBox(),this.circleMesh.computeBoundingBox(),this.circle2Mesh.computeBoundingBox(),this.mixer=new qs(this);const i=new ms("loading.mat.fill",[0,1.2,2],[0,0,0,.9,.38,.38,.38,.8,0,0,0,.9]);this._selectedClip=new _s("selected",3,[i]),this.selectedAction=null==(e=this.mixer)?void 0:e.clipAction(this._selectedClip,this.desScene),null==(r=this.selectedAction)||r.play()}destroy(){super.destroy()}onBeforeRender(){js?Ws+=zs[2]:Ws-=zs[2],this.circleMesh.rotate(Ws),this.circle2Mesh.rotate(.5*Ws),Ws<zs[0]?js=!0:Ws>zs[1]&&(js=!1),this.circleMesh.needsUpdate=!0,this.circle2Mesh.needsUpdate=!0}update(){var t;null==(t=this.mixer)||t.update(this.clock.getDelta())}}const Gs='\n<path d="M0 20.7L0 0L7.272 0L7.272 18L20.592 18L19.08 20.7L0 20.7\nM30.78 2.772L30.78 17.928L41.4 17.928L41.4 0L48.708 0L48.708 20.7L23.472 20.7L23.472 0L41.4 0L38.88 2.772L30.78 2.772\nM62.388 12.924L71.028 12.924L68.904 15.768L61.2 15.768L59.292 20.7L51.588 20.7L59.94 0L73.188 0L81.576 20.7L73.944 20.7L71.028 12.924L67.14 2.772L65.988 2.772L62.388 12.924\nM109.728 17.784L106.884 20.7L84.456 20.7L84.456 0L102.528 0L99.972 2.844L91.656 2.844L91.656 17.928L102.528 17.928L102.528 0L107.136 0L109.728 2.7L109.728 17.784\nM119.628 20.7L112.608 20.7L112.608 0L119.628 0L119.628 20.7\nM139.752 20.7L129.78 6.3L129.78 20.7L122.508 20.7L122.508 0L130.644 0L140.58 14.652L140.58 0L147.78 0L147.78 20.7L139.752 20.7\nM168.732 18L168.732 10.728L163.368 10.728L163.368 7.992L175.932 7.992L175.932 20.7L168.732 20.7L168.732 18.504L166.572 20.7L150.66 20.7L150.66 0L176.04 0L174.456 2.7L158.04 2.7L158.04 18L168.732 18\nZ">\n</path>\n',Xs=new Oe,Qs=new Oe;class Zs extends Je{constructor(t){super(),f(this,"isCamera",!0),f(this,"type","Camera2"),f(this,"name","Camera2"),f(this,"params"),f(this,"matrixAutoUpdate",!1),f(this,"matrixWorldAutoUpdate",!1),f(this,"projectionMatrix",new Ve),f(this,"projectionMatrixInverse",new Ve),f(this,"viewMatrix",new Ve),f(this,"viewMatrixNeedsUpdate",!0),f(this,"viewArea",0),f(this,"left",-1),f(this,"right",1),f(this,"top",1),f(this,"bottom",-1),f(this,"width",2),f(this,"height",2),f(this,"aspect",1),f(this,"view"),this.params=t,this.width=void 0!==(null==t?void 0:t.width)?t.width:2,this.height=void 0!==(null==t?void 0:t.height)?t.height:2,this.aspect=void 0!==(null==t?void 0:t.aspect)?t.aspect:1,void 0!==(null==t?void 0:t.left)&&(this.left=t.left),void 0!==(null==t?void 0:t.right)&&(this.right=t.right),void 0!==(null==t?void 0:t.top)&&(this.top=t.top),void 0!==(null==t?void 0:t.bottom)&&(this.bottom=t.bottom);const e=(this.right+this.left)/2,r=(this.top+this.bottom)/2;if(this.aspect>1){const t=Math.round((this.right-this.left)/2/this.aspect);this.top=r+t,this.bottom=r-t}else if(this.aspect<1){const t=Math.round((this.top-this.bottom)/2*this.aspect);this.left=e-t,this.right=e+t}this.flipY=!0===(null==t?void 0:t.flipY),this.updateProjectionMatrix(),(null==t?void 0:t.eye)&&this.position.fromArray(t.eye),(null==t?void 0:t.up)&&this.up.fromArray(t.up),this.computeBoundingBox(),this.update()}destroy(){super.destroy()}get pixelWidth(){return this.scaled.x}set(t=-1,e=1,r=1,i=-1){Qs.set(t+e,i+r).multiplyScalar(.5);const n=Math.max((e-t)/this.width,(r-i)/this.height);this.setTRS(Qs,0,n)}setByBox(t){t&&!t.isEmpty()&&this.set(t.min.x,t.max.x,t.max.y,t.min.y)}setTRS(t={x:0,y:0},e=0,r=0){this.position.set(t.x||0,t.y||0),this.rotation.set(e,e),this.scaled.set(r,r),this.update()}resize(){this.setSize(this.params.width,this.params.height)}setSize(t,e){this.width=t||2,this.height=e||2,this.left=this.params.left||-1,this.right=this.params.right||1,this.top=this.params.top||1,this.bottom=this.params.bottom||-1,this.aspect=t/e;const r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;if(this.aspect>1){const t=Math.round((this.right-this.left)/2/this.aspect);this.top=i+t,this.bottom=i-t}else if(this.aspect<1){const t=Math.round((this.top-this.bottom)/2*this.aspect);this.left=r-t,this.right=r+t}this.updateProjectionMatrix(),this.update(),this.matrix.decompose(this.position,this.rotation,this.scaled)}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(-e[6],-e[7]).normalize()}getCameraPosition(){return{x:this.position.x,y:this.position.y,z:this.position.z,s:this.scaled.x,r:this.rotation.x}}updateMatrixWorld(t=!1){super.updateMatrixWorld(t),this.updateViewMatrix()}updateProjectionMatrix(){void 0===this.parent&&this.matrixWorldAutoUpdate&&this.updateMatrixWorld(),this.projectionMatrix.makeProjection(this.left,this.right,this.top,this.bottom,this.width,this.height),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}updateViewMatrix(){this.matrixWorldInverse.copy(this.matrixWorld).invert(),this.viewMatrix.multiplyMatrices(this.projectionMatrix,this.matrixWorldInverse)}update(t=!0){this.matrixAutoUpdate||this.updateMatrix(),this.updateMatrixWorld(),this.needsUpdate=!0,this.updateBoundingBox(),t&&this.dispatchEvent({type:"update",data:{t:this.position,r:this.rotation.x,s:this.scaled.x}})}computeBoundingBox(){return Qs.set(this.width,this.height).multiplyScalar(.5).multiplyScalar(this.scaled.x),this.boundingBox.min.subVectors(this.position,Qs),this.boundingBox.max.addVectors(this.position,Qs),this.boundingBox}updateBoundingBox(){super.updateBoundingBox(),this.viewArea=this.boundingBoxWorld.getArea()}toJSON(){const t={};return t.left=this.left,t.right=this.right,t.top=this.top,t.bottom=this.bottom,t.width=this.width,t.height=this.height,t.aspect=this.aspect,t.position=this.position.toArray(),t.rotation=this.rotation.toArray(),t.scaled=this.scaled.toArray(),t}fromJSON(t){this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.width=t.width,this.height=t.height,this.aspect=t.aspect,this.position.fromArray(t.position),this.rotation.fromArray(t.rotation),this.scaled.fromArray(t.scaled),this.updateProjectionMatrix(),this.update(!1)}clone(){return(new this.constructor.prototype.constructor).copy(this)}copy(t,e=!0,r=!1){return super.copy(t,e,r),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.width=t.width,this.height=t.height,this.aspect=t.aspect,this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this}}var $s=(t=>(t.UPDATE="update",t))($s||{}),Ks=Object.freeze({Linear:Object.freeze({None:function(t){return t},In:function(t){return t},Out:function(t){return t},InOut:function(t){return t}}),Quadratic:Object.freeze({In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}}),Cubic:Object.freeze({In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}}),Quartic:Object.freeze({In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}}),Quintic:Object.freeze({In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}}),Sinusoidal:Object.freeze({In:function(t){return 1-Math.sin((1-t)*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.sin(Math.PI*(.5-t)))}}),Exponential:Object.freeze({In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}}),Circular:Object.freeze({In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}}),Elastic:Object.freeze({In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}}),Back:Object.freeze({In:function(t){var e=1.70158;return 1===t?1:t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return 0===t?0:--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}}),Bounce:Object.freeze({In:function(t){return 1-Ks.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*Ks.Bounce.In(2*t):.5*Ks.Bounce.Out(2*t-1)+.5}}),generatePow:function(t){return void 0===t&&(t=4),t=(t=t<Number.EPSILON?Number.EPSILON:t)>1e4?1e4:t,{In:function(e){return Math.pow(e,t)},Out:function(e){return 1-Math.pow(1-e,t)},InOut:function(e){return e<.5?Math.pow(2*e,t)/2:(1-Math.pow(2-2*e,t))/2+.5}}}}),Js=function(){return performance.now()},ta=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return t.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map((function(e){return t._tweens[e]}))},t.prototype.removeAll=function(){this._tweens={}},t.prototype.add=function(){for(var t,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];for(var i=0,n=e;i<n.length;i++){var s=n[i];null===(t=s._group)||void 0===t||t.remove(s),s._group=this,this._tweens[s.getId()]=s,this._tweensAddedDuringUpdate[s.getId()]=s}},t.prototype.remove=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r=0,i=t;r<i.length;r++){var n=i[r];n._group=void 0,delete this._tweens[n.getId()],delete this._tweensAddedDuringUpdate[n.getId()]}},t.prototype.allStopped=function(){return this.getAll().every((function(t){return!t.isPlaying()}))},t.prototype.update=function(t,e){void 0===t&&(t=Js()),void 0===e&&(e=!0);var r=Object.keys(this._tweens);if(0!==r.length)for(;r.length>0;){this._tweensAddedDuringUpdate={};for(var i=0;i<r.length;i++){var n=this._tweens[r[i]],s=!e;n&&!1===n.update(t,s)&&!e&&this.remove(n)}r=Object.keys(this._tweensAddedDuringUpdate)}},t}(),ea={Linear:function(t,e){var r=t.length-1,i=r*e,n=Math.floor(i),s=ea.Utils.Linear;return e<0?s(t[0],t[1],i):e>1?s(t[r],t[r-1],r-i):s(t[n],t[n+1>r?r:n+1],i-n)},Utils:{Linear:function(t,e,r){return(e-t)*r+t}}},ra=function(){function t(){}return t.nextId=function(){return t._nextId++},t._nextId=0,t}(),ia=new ta,na=function(){function t(t,e){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Ks.Linear.None,this._interpolationFunction=ea.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=ra.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,"object"==typeof e?(this._group=e,e.add(this)):!0===e&&(this._group=ia,ia.add(this))}return t.prototype.getId=function(){return this._id},t.prototype.isPlaying=function(){return this._isPlaying},t.prototype.isPaused=function(){return this._isPaused},t.prototype.getDuration=function(){return this._duration},t.prototype.to=function(t,e){if(void 0===e&&(e=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=e<0?0:e,this},t.prototype.duration=function(t){return void 0===t&&(t=1e3),this._duration=t<0?0:t,this},t.prototype.dynamic=function(t){return void 0===t&&(t=!1),this._isDynamic=t,this},t.prototype.start=function(t,e){if(void 0===t&&(t=Js()),void 0===e&&(e=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed)for(var r in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||e){if(this._propertiesAreSetUp=!0,!this._isDynamic){var i={};for(var n in this._valuesEnd)i[n]=this._valuesEnd[n];this._valuesEnd=i}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,e)}return this},t.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},t.prototype._setupProperties=function(t,e,r,i,n){for(var s in r){var a=t[s],o=Array.isArray(a),h=o?"array":typeof a,u=!o&&Array.isArray(r[s]);if("undefined"!==h&&"function"!==h){if(u){if(0===(g=r[s]).length)continue;for(var c=[a],l=0,d=g.length;l<d;l+=1){var p=this._handleRelativeValue(a,g[l]);if(isNaN(p)){u=!1;break}c.push(p)}u&&(r[s]=c)}if("object"!==h&&!o||!a||u)(void 0===e[s]||n)&&(e[s]=a),o||(e[s]*=1),i[s]=u?r[s].slice().reverse():e[s]||0;else{e[s]=o?[]:{};var f=a;for(var m in f)e[s][m]=f[m];i[s]=o?[]:{};var g=r[s];if(!this._isDynamic){var y={};for(var m in g)y[m]=g[m];r[s]=g=y}this._setupProperties(f,e[s],g,i[s],n)}}}},t.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},t.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},t.prototype.pause=function(t){return void 0===t&&(t=Js()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=t),this},t.prototype.resume=function(t){return void 0===t&&(t=Js()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this):this},t.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},t.prototype.group=function(t){return t?(t.add(this),this):this},t.prototype.remove=function(){var t;return null===(t=this._group)||void 0===t||t.remove(this),this},t.prototype.delay=function(t){return void 0===t&&(t=0),this._delayTime=t,this},t.prototype.repeat=function(t){return void 0===t&&(t=0),this._initialRepeat=t,this._repeat=t,this},t.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},t.prototype.yoyo=function(t){return void 0===t&&(t=!1),this._yoyo=t,this},t.prototype.easing=function(t){return void 0===t&&(t=Ks.Linear.None),this._easingFunction=t,this},t.prototype.interpolation=function(t){return void 0===t&&(t=ea.Linear),this._interpolationFunction=t,this},t.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},t.prototype.onStart=function(t){return this._onStartCallback=t,this},t.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},t.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},t.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},t.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},t.prototype.onStop=function(t){return this._onStopCallback=t,this},t.prototype.update=function(e,r){var i,n,s=this;if(void 0===e&&(e=Js()),void 0===r&&(r=t.autoStartOnUpdate),this._isPaused)return!0;if(!this._goToEnd&&!this._isPlaying){if(!r)return!1;this.start(e,!0)}if(this._goToEnd=!1,e<this._startTime)return!0;!1===this._onStartCallbackFired&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),!1===this._onEveryStartCallbackFired&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var a=e-this._startTime,o=this._duration+(null!==(i=this._repeatDelayTime)&&void 0!==i?i:this._delayTime),h=this._duration+this._repeat*o,u=function(){if(0===s._duration)return 1;if(a>h)return 1;var t=Math.trunc(a/o),e=a-t*o,r=Math.min(e/s._duration,1);return 0===r&&a===s._duration?1:r}(),c=this._easingFunction(u);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,c),this._onUpdateCallback&&this._onUpdateCallback(this._object,u),0===this._duration||a>=this._duration){if(this._repeat>0){var l=Math.min(Math.trunc((a-this._duration)/o)+1,this._repeat);for(n in isFinite(this._repeat)&&(this._repeat-=l),this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[n]||(this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(this._valuesEnd[n])),this._yoyo&&this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=o*l,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var d=0,p=this._chainedTweens.length;d<p;d++)this._chainedTweens[d].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},t.prototype._updateProperties=function(t,e,r,i){for(var n in r)if(void 0!==e[n]){var s=e[n]||0,a=r[n],o=Array.isArray(t[n]),h=Array.isArray(a);!o&&h?t[n]=this._interpolationFunction(a,i):"object"==typeof a&&a?this._updateProperties(t[n],s,a,i):"number"==typeof(a=this._handleRelativeValue(s,a))&&(t[n]=s+(a-s)*i)}},t.prototype._handleRelativeValue=function(t,e){return"string"!=typeof e?e:"+"===e.charAt(0)||"-"===e.charAt(0)?t+parseFloat(e):parseFloat(e)},t.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],r=this._valuesEnd[t];this._valuesStartRepeat[t]="string"==typeof r?this._valuesStartRepeat[t]+parseFloat(r):this._valuesEnd[t],this._valuesEnd[t]=e},t.autoStartOnUpdate=!1,t}();ra.nextId;var sa=ia;sa.getAll.bind(sa),sa.removeAll.bind(sa),sa.add.bind(sa),sa.remove.bind(sa),sa.update.bind(sa),t={Easing:Ks,Tween:na};class aa extends Se{constructor(t={}){super(),f(this,"name","View"),f(this,"params"),f(this,"visible",!0),f(this,"cvs"),f(this,"scene"),f(this,"scenes",[]),f(this,"camera"),f(this,"controller"),f(this,"tween"),f(this,"animateDuration"),this.params=t,this.animateDuration=this.params.animateDuration||300,this.cvs=t.cvs,this.camera=new Zs(t.camera||{})}destroy(){this.controller&&this.controller.destroy(),this.camera&&this.camera.destroy(),this.scene&&this.scene.destroy(),this.scenes.forEach((t=>t.destroy())),this.scenes.length=0,super.destroy()}bindScene(t){this.scenes.push(t),this.reset(),this.scene=t,t.isStatic}saveCameraPosition(t){ca.copy(this.camera.boundingBoxWorld);const e=t?oa+t:oa;sessionStorage.setItem(e,JSON.stringify(ca))}clearCameraPosition(t){const e=t?oa+t:oa;sessionStorage.setItem(e,"")}restoreCameraPosition(t){const e=t?oa+t:oa,r=sessionStorage.getItem(e);r&&(ca.copy(JSON.parse(r)),this.resetCameraByBoundingBox(ca,!0))}fullscreen(t=10,e=!1){this.scene&&(this.scene.boundingBox.isEmpty()&&this.scene.computeBoundingBox(),ca.copy(this.scene.boundingBox).expandByVector(ha.set(t,t)),this.resetCameraByBoundingBox(ca,e))}handleCameraChanged(t){}reset(){}resetCameraByBoundingBox(t,e=!1){return g(this,null,(function*(){if(!this.camera)return;if(!t||t.isEmpty())throw new Error("BoundingBox empty");if(!e)return this.camera.setByBox(t),Promise.resolve();const r=this.camera.getCameraPosition();t.getCenter(ha),t.getSize(ua);const i=Math.max(ua.x/this.camera.width,ua.y/this.camera.height),n={x:ha.x,y:ha.y,z:0,s:i,r:0};yield this.animateCamera(r,n)}))}animateCamera(e,r){return g(this,null,(function*(){return this.controller&&(this.controller.enabled=!1),this.tween&&this.tween.stop(),new Promise((i=>{this.tween=new t.Tween(e).to(r,this.animateDuration).easing(t.Easing.Exponential.Out).onUpdate((t=>{this.camera.position.set(t.x,t.y),this.camera.scaled.set(t.s,t.s),this.camera.rotation.set(t.r,t.r),this.camera.update()})).onComplete((()=>{this.controller&&(this.controller.enabled=!0),i()})).start()}))}))}computeBoundingBox(t,e=new Le){return t&&t.length?(e.makeEmpty(),t.forEach((t=>e.union(t.computeBoundingBox()))),e):e}expandScenesBoundingBox(t,e=new Le){t.forEach((t=>t.boundingBox.union(e)))}update(t){this.tween&&this.tween.update(t)}}const oa="camera_position_",ha=new Oe,ua=new Oe,ca=new Le;class la{constructor(){f(this,"light"),f(this,"lightsArray",[]),f(this,"shadowsArray",[]),f(this,"lastCameraVersion",-1)}destroy(){var t;this.clear(),null==(t=this.light)||t.destroy()}clear(){this.lightsArray.length=0,this.shadowsArray.length=0}pushLight(t){this.light||(this.light=t),this.lightsArray.push(t)}pushShadow(t){this.shadowsArray.push(t)}}class da{constructor(){f(this,"renderStates",new WeakMap)}destroy(){this.renderStates=new WeakMap}get(t,e=0){const r=this.renderStates.get(t);let i;return void 0===r?(i=new la,this.renderStates.set(t,[i])):e>=r.length?(i=new la,r.push(i)):i=r[e],i}}class pa{constructor(t,e){f(this,"ctx"),f(this,"bindingStates"),f(this,"fill",Sr),f(this,"stroke",Ar),f(this,"lineWidth",1),this.ctx=t,this.bindingStates=e}destroy(){}beforeRender(t){}render(t){var e,r,i;if(t.render(this.ctx,null==(e=this.bindingStates.getBindingState(t))?void 0:e.renderCommands),t.composeNode&&(null==(r=t.children)?void 0:r.length))for(let e=0,r=null==(i=t.children)?void 0:i.length;e<r;e++)this.render(t.children[e])}renderFill(t){var e;(null==(e=t.mat)?void 0:e.fill)&&(this.ctx.fillStyle=t.mat.fill,this.ctx.fill())}renderStroke(t){var e;(null==(e=t.mat)?void 0:e.stroke)&&(this.ctx.strokeStyle=t.mat.stroke,this.ctx.lineWidth=t.mat.lineWidth||1,this.ctx.setLineDash(t.mat.lineDash||[]),t.mat.lineCap&&(this.ctx.lineCap=t.mat.lineCap),t.mat.lineDashOffset&&(this.ctx.lineDashOffset=t.mat.lineDashOffset),this.ctx.stroke())}renderText(t){if(!t.visible)return;const e=t.mat;if(!t.textContent)return;t.modelViewMatrix.decompose(fa,ga,ma);const r=e.fontSize*ma.x;this.ctx.font=`${e.fontWeight} ${r}px ${e.fontFamily}`,this.ctx.fillStyle=e.fill||Nr,this.ctx.textAlign=e.textAlign,this.ctx.textBaseline=e.textBaseline,this.ctx.fillText(t.textContent,fa.x,fa.y)}afterRender(){}renderWireFrame(t){this.bindingStates.currentCamera&&(ya.copy(t.boundingBox).applyMatrix3(t.modelViewMatrix).getSize(xa),va.copy(ya.min),this.ctx.beginPath(),this.ctx.lineWidth=1,this.ctx.strokeStyle=xr,this.ctx.setLineDash([5,10]),this.ctx.strokeRect(va.x,va.y,xa.x,xa.y),this.ctx.stroke())}renderSelected(t){}renderMergedBefore(){this.ctx.beginPath()}renderMergedGeo(t){var e,r,i;const n=this.bindingStates.getBindingState(t);if((null==n?void 0:n.renderCommands)&&(null==(e=t.geo)||e.render(this.ctx,null==n?void 0:n.renderCommands)),t.composeNode&&(null==(r=t.children)?void 0:r.length))for(let e=0,r=null==(i=t.children)?void 0:i.length;e<r;e++)this.renderMergedGeo(t.children[e])}renderMergedMat(t){t&&t.mat&&(this.renderFill(t),this.renderStroke(t))}renderMergedAfter(){this.ctx.closePath()}}const fa=new Oe,ma=new Oe,ga=new Oe,ya=new Le,va=new Oe,xa=new Oe;class _a{constructor(t){f(this,"params"),f(this,"currentCamera"),f(this,"bindingStates",new WeakMap),f(this,"forceUpdate",!1),f(this,"currentState"),f(this,"cameraVersion"),f(this,"currentRenderState"),this.params=t}destroy(){this.bindingStates=new WeakMap,this.currentState=void 0,this.reset()}reset(){this.forceUpdate=!0}setup(t,e,r){this.currentRenderState=e,this.currentCamera=r,this.currentState=this.getBindingState(t);let i=this.needsUpdate(t);return(this.forceUpdate||i)&&this.saveCache(t),this.currentState}getBindingState(t){return this.bindingStates.has(t)||this.bindingStates.set(t,{id:t.id,uuid:t.uuid,needsUpdate:!0,featureKey:t.featureKey,version:-1,cameraVersion:-1,viewPath:void 0}),this.bindingStates.get(t)}clearBindingState(){this.currentState&&(this.currentState.needsUpdate=!1,this.currentState.version=-1,this.currentState.viewPath=void 0,this.currentState.renderCommands=void 0)}needsUpdate(t){return!this.currentState||!!this.currentState.needsUpdate||this.currentState.id!==t.id||this.currentState.version!==t.version}saveCache(t){var e;this.currentState&&(this.clearBindingState(),this.currentState.version=t.version,this.currentState.needsUpdate=!1,t.isText||(this.currentState.renderCommands=null==(e=t.geo)?void 0:e.getRenderCommands(t.modelViewMatrix),t.composeNode&&t.traverse((e=>{e!==t&&e.isShape&&(this.getBindingState(e).renderCommands=e.geo.getRenderCommands(t.modelViewMatrix))}))))}setCachedTexture(t){return g(this,null,(function*(){if(!this.currentState||!t.usedCache||!t.featureKey)return;if(t.boundingBox.isEmpty())throw new Error(`${t.name}'s boundingBox is empty`);let e=Mn.get(t.featureKey);if(e?this.currentState.cachedTexture=e:e=Mn.setByShape(t.featureKey,t,void 0,t.finalSize),!e)throw new Error("compute cache error");this.getBindingState(t).cachedTexture=e}))}setDebounceTexture(t,e){if(!this.currentState||!t.featureKey)return;if(t.boundingBox.isEmpty())throw new Error(`${t.name}'s boundingBox is empty`);this.updateModelViewMatrix(t,this.currentCamera);let r=Mn.get(t.featureKey);r||(r=new Nn({flipY:!0}),r.size.set(this.params.width,this.params.height),r.image=Zi.get(t.featureKey,r.size.x,r.size.y),Mn.set(t.featureKey,r));const i=r.image.getContext("2d");if(i.clearRect(0,0,this.params.width,this.params.height),i.drawImage(e.canvas,0,0),r.matrix.copy(this.currentCamera.viewMatrix),!r)throw new Error("compute cache error");this.getBindingState(t).cachedTexture=r}updateModelViewMatrix(t,e){void 0!==e?(this.currentState=this.getBindingState(t),(this.currentState.cameraVersion!==e.version||t.dynamically)&&(this.currentState.cameraVersion!==e.version&&(this.currentState.needsUpdate=!0),this.currentState.cameraVersion=e.version,t.updateModelViewMatrix(e))):t.updateModelViewMatrix()}}class ba{constructor(t={}){f(this,"name","CvsRenderer"),f(this,"id"),f(this,"params"),f(this,"autoClear",!0),f(this,"cvs"),f(this,"ctx"),f(this,"_currentRenderTarget"),f(this,"_isContextLost",!1),f(this,"contextLostHandler",this.handleContextLost.bind(this)),f(this,"contextRestoreHandler",this.handleContextRestore.bind(this)),this.id="Renderer@"+Date.now().toString(),this.params=t,be.config=t,void 0!==t.autoClear&&(this.autoClear=t.autoClear),this.init(),this.bindEvents()}destroy(){this.unbindEvents()}init(){if(this.params.workerRender){if(!this.params.offscreenCanvas)throw new Error("offscreen canvas not found");this.cvs=this.params.offscreenCanvas}else this.cvs=Zi.createCanvas(this.params);if(!this.cvs)throw new Error("canvas create error");const t=this.cvs.getContext("2d",{alpha:!0});if(!t)throw new Error("context error");this.params.cvs=this.cvs,this.params.ctx=this.ctx=t,this.setSize(this.params.width,this.params.height)}resize(){this.setSize(this.params.width,this.params.height)}setSize(t,e){this.params.width=t,this.params.height=e,this.params.camera||(this.params.camera={}),this.params.camera.width=t,this.params.camera.height=e,this.params.aspect=t/e,this.params.camera.aspect=this.params.aspect,this.params.camera.left=-.5*t,this.params.camera.right=.5*t,this.params.camera.top=.5*e,this.params.camera.bottom=-.5*e}getSize(t=new Oe){return t.set(this.params.width,this.params.height)}bindEvents(){var t,e;null==(t=this.cvs)||t.addEventListener(wa,this.contextLostHandler,!1),null==(e=this.cvs)||e.addEventListener(Ea,this.contextRestoreHandler,!1)}unbindEvents(){var t,e;null==(t=this.cvs)||t.removeEventListener(wa,this.contextLostHandler,!1),null==(e=this.cvs)||e.removeEventListener(Ea,this.contextRestoreHandler,!1)}handleContextLost(t){t.preventDefault(),this._isContextLost=!0}handleContextRestore(){this._isContextLost=!1}clean(){this.ctx&&(this._currentRenderTarget?this._currentRenderTarget.ctx.clearRect(0,0,this.params.width,this.params.height):this.ctx.clearRect(0,0,this.params.width,this.params.height))}getRenderTarget(){return this._currentRenderTarget}setRenderTarget(t){this._currentRenderTarget=t}}const wa="contextlost",Ea="contextrestored";class Ta{constructor(t=1e3){f(this,"cellCapacity"),f(this,"firstIndex"),f(this,"lastIndex"),f(this,"items"),this.cellCapacity=t,this.firstIndex=0,this.lastIndex=0,this.items=[new Array(this.cellCapacity)]}adjustCells(){this.lastIndex<this.cellCapacity||(this.items.push(new Array(this.cellCapacity)),this.lastIndex=0)}enqueue(t,e){if(e)return this.unshift(t);this.items[this.items.length-1][this.lastIndex++]=t,this.adjustCells()}unshift(t){for(let t=this.items.length-1;t>=0;t--)for(let e=this.cellCapacity-1;e>=0;e--)e>0&&void 0===this.items[t][e-1]||(this.items[t][e]=0===e&&t>0?this.items[t-1][this.cellCapacity-1]:this.items[t][e-1]);this.items[0][this.firstIndex]=t,this.lastIndex++,this.adjustCells()}dequeue(){if(this.isEmpty())return;const t=this.items[0][this.firstIndex];return this.firstIndex===this.cellCapacity-1?(this.items.shift(),this.firstIndex=0):this.firstIndex++,t}isEmpty(){return 1===this.items.length&&this.firstIndex===this.lastIndex}peek(){if(!this.isEmpty())return this.items[0][this.firstIndex]}size(){return(this.items.length-1)*this.cellCapacity-this.firstIndex+this.lastIndex}clear(){this.firstIndex=0,this.lastIndex=0,this.items=[new Array(this.cellCapacity)]}toString(){if(this.isEmpty())return"";let t=`${this.items[0][this.firstIndex]}`;for(let e=this.firstIndex+1;e<this.items[0].length;e++)t=`${t},${this.items[0][e]}`;for(let e=1;e<this.items.length-1;e++)for(let r=0;r<this.items[e].length;r++)t=`${t},${this.items[e][r]}`;for(let e=0;e<this.lastIndex;e++)t=`${t},${this.items[this.items.length-1][e]}`;return t}getByIndex(t){if(t>=this.size())return;const e=Math.floor((this.firstIndex+t)/this.cellCapacity),r=(this.firstIndex+t)%this.cellCapacity;return this.items[e][r]}setByIndex(t,e){if(t>=this.size())return!1;const r=Math.floor((this.firstIndex+t)/this.cellCapacity),i=(this.firstIndex+t)%this.cellCapacity;return this.items[r][i]=e,!0}sort(t){const e=this.size(),r=new Array(e);for(let t=0;t<e;t++)r[t]=this.getByIndex(t);r.sort(t),this.clear();for(let t=0;t<r.length;t++)this.enqueue(r[t])}getAll(){const t=[];for(let e=0,r=this.size();e<r;e++)t[e]=this.getByIndex(e);return t}}class Sa{constructor(){f(this,"queue",new Ta),f(this,"mergedQueue",{})}destroy(){this.clear()}clear(){this.queue.clear();const t=De.keys(this.mergedQueue);for(let e=0,r=null==t?void 0:t.length;e<r;e++)void 0!==this.mergedQueue[t[e]]&&this.mergedQueue[t[e]].clear()}push(t,e){return e&&!t.renderOrder&&(t.renderOrder=e),this.queue.enqueue(t),this}unshift(t){this.queue.enqueue(t,!0)}sort(t){return this.queue.size()&&this.queue.sort(t||Aa),this}mergeQueue(){for(let t=0,e=this.queue.size();t<e;t++){const t=this.queue.dequeue(),e=fn(t.mat);let r=this.mergedQueue[e];r||(r=new Ta,this.mergedQueue[e]=r),r.enqueue(t)}return this}}function Aa(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.id-e.id}class Na{constructor(){f(this,"lists",new WeakMap)}destroy(){this.lists=new WeakMap}get(t,e){const r=this.lists.get(t);let i;return void 0===r?(i=new Sa,this.lists.set(t,[i])):e>=r.length?(i=new Sa,r.push(i)):i=r[e],i}}const Ca=class t{constructor(){f(this,"id",t.idCounter++),f(this,"timers",new Map),f(this,"timersDuration",new Map),f(this,"counters",new Map),f(this,"countersAmount",new Map),f(this,"out",[])}static active(e){t.actived=!!e,t.duration=e||0}static add(t){this.children.push(t),this.handleStart()}static remove(e){for(let r=0,i=t.children.length;r<i;r++)if(t.children[r].id===e.id){this.children.splice(r,1);break}}static handleStart(){this.isRunning||(this.isRunning=!0,Te(this.runLoop))}static runLoop(){t.children.length?(t.runFrames(),Te(t.runLoop)):t.isRunning=!1}static runFrames(){let e,r=Ee();if(!(r-t.lastTime<t.duration)){t.lastTime=r;for(let r=0,i=this.children.length;r<i;r++)e=this.children[r],e.calculateTimers(),e.calculateCounters(),t.messages=t.messages.concat(e.out),e.out.length=0;if(t.messages.length){if(t.actived){let t=[];t.push(Ra),t.push(Da),t.push(La),this.messages.forEach((e=>t.push(function(t,e=20){let r="│";r+=" ".repeat(Math.max(e-t.name.length,0)),r+=t.name,r+="│";const i="string"==typeof t.avg?Ia-t.avg.length:Ia-t.avg.toString().length;return r+=" ".repeat(Math.max(i,0)),r+=t.avg+" ",r+=" ".repeat(Math.max(Ia-t.min.toString().length,0)),r+=t.min+" ",r+=" ".repeat(Math.max(Ia-t.max.toString().length,0)),r+=t.max+" ",r+=" ".repeat(Math.max(Ia-t.stdDev.toString().length,0)),r+=t.stdDev+" ",r+=" ".repeat(Math.max(Ia-t.count.toString().length,0)),r+=t.count+" ",r+=" ".repeat(Math.max(Ia-t.FPS.toString().length,0)),r+=t.FPS,r}(e,this.maxLetters)))),t.push(Ba)}t.messages.length=0}}}destroy(){t.remove(this)}addTimer(t,e=Ee(),r=Ee()-(this.timersDuration.get(t)||Ee())){this.addTimerDuration(t,r),this.timersDuration.set(t,e)}addTimerDuration(t,e){var r;this.timers.has(t)||this.timers.set(t,[]),null==(r=this.timers.get(t))||r.push(e)}calculateTimers(){this.timers.forEach(((t,e)=>{t&&t.length&&(this.out.push(this.calculateDurations(e,t)),t.length=0)}))}addCounterAmount(t,e){var r;this.counters.has(t)||this.counters.set(t,[]),null==(r=this.counters.get(t))||r.push(e)}calculateCounters(){this.counters.forEach(((t,e)=>{t&&t.length&&(this.out.push(this.calculateAmounts(e,t)),t.length=0)}))}start(){return this.stop(),t.add(this),this}stop(){return t.remove(this),this}calculateDurations(e,r){const i={name:e,avg:0,min:0,max:0,stdDev:0,count:0,FPS:0};if(!r||!r.length)return i;const n=r.length,{min:s,max:a,avg:o}=this.minMaxAvg(r),h=parseFloat(this.stdDev(r,o).toFixed(2));return{name:e,avg:this.fd(o),min:this.fd(s),max:this.fd(a),stdDev:h,count:n,FPS:Math.ceil(n/t.duration*1e3)}}calculateAmounts(e,r){const i={name:e,avg:0,min:0,max:0,stdDev:0,count:0,FPS:0};if(!r||!r.length)return i;const n=r.length,{min:s,max:a,avg:o}=this.minMaxAvg(r);return{name:e,avg:o,min:s,max:a,stdDev:this.stdDev(r,o),count:n,FPS:Math.ceil(n/t.duration*1e3)}}minMaxAvg(t){let e=t[0],r=t[0],i=t.length,n=0;for(let i=0;i<t.length;i++){const s=t[i];n+=s,s<e&&(e=s),s>r&&(r=s)}const s=n/i;return{min:this.fx(e),max:this.fx(r),avg:this.fx(s)}}stdDev(t,e){let r=0;for(let i=0;i<t.length;i++){const n=t[i];r+=(n-e)*(n-e)}const i=t.length;return this.fx(Math.sqrt(r/i))}fd(t){return t>1e3?(t/1e3).toFixed(1)+"s":t.toFixed(1)+"ms"}fx(t,e=1){return 1===e?Math.round(10*t)/10:2===e?Math.round(100*t)/100:3===e?Math.round(1e3*t)/1e3:t}};f(Ca,"idCounter",0),f(Ca,"children",[]),f(Ca,"isRunning",!1),f(Ca,"actived",!1),f(Ca,"duration",0),f(Ca,"lastTime",Ee()),f(Ca,"messages",[]),f(Ca,"maxLetters",20);let Ma=Ca;const Oa=["avg","min","max","stdDev","count","FPS"],Ia=function(t,e=0){let r=0;for(let e=0,i=t.length;e<i;e++)r=Math.max(r,t[e].length);return r+e}(Oa,1),Ra=function(t,e=20){let r="┌";r+="─".repeat(e),r+="┬";for(let e=0,i=t.length;e<i;e++)r+="─".repeat(Ia),r+=e<i-1?"┬":"┐";return r}(Oa,20),Da=function(t,e=20){let r="│";r+=" ".repeat(e),r+="│";for(let e=0,i=t.length;e<i;e++)r+=" ".repeat(Math.max(Ia-t[e].length-1,0)),r+=t[e],r+=" │";return r}(Oa,20),La=function(t,e=20){let r="├";r+="─".repeat(e),r+="┼";for(let e=0,i=t.length;e<i;e++)r+="─".repeat(Ia),r+=e<i-1?"┴":"┘";return r}(Oa,20),Ba=function(t=20){let e="└";for(let r=0;r<t;r++)e+="─";return e+="┘",e}(20),ka=(new Ma).start();class Pa extends ba{constructor(t={}){super(t),f(this,"name","CvsRenderer"),f(this,"id"),f(this,"mergeRendering",!1),f(this,"renderer"),f(this,"bindingStates"),f(this,"renderStates",new da),f(this,"renderStateStack",[]),f(this,"currentRenderState"),f(this,"renderLists",new Na),f(this,"currentRenderList"),f(this,"renderListStack",[]),f(this,"renderingOnDemand",!0),f(this,"renderSliceComplete",!0),f(this,"_frustum",new Le),f(this,"_tic"),void 0!==t&&(this.mergeRendering=!!t.mergeRendering),this.id="CvsRenderer@"+Date.now().toString(),this.bindingStates=new _a(this.params),this.renderer=new pa(this.ctx,this.bindingStates),Ma.active(this.params.monitorDuration)}destroy(){this._tic&&this._tic.clear(),Ma.active(0),super.destroy(),this.renderer.destroy()}render(t,e,r){if(this._isContextLost)return;if(!this.ctx)return;this._currentRenderTarget?this.renderer.ctx=this._currentRenderTarget.ctx:this.renderer.ctx=this.ctx,this.currentRenderState=this.renderStates.get(t,this.renderStateStack.length);const i=this.renderingOnDemand&&void 0!==e&&this.currentRenderState.lastCameraVersion!==e.version;(i||t.dynamically||t.matrixWorldAutoUpdate)&&t.updateMatrixWorld(),(i||e&&void 0===e.parent&&(null==e?void 0:e.matrixWorldAutoUpdate))&&e.updateMatrixWorld(),e&&(this._frustum.copy(e.boundingBoxWorld),this.currentRenderState.lastCameraVersion=e.version),t.isScene&&t.onBeforeRender(this,t,e,r),this.currentRenderState.clear(),this.renderStateStack.push(this.currentRenderState),this.currentRenderList=this.renderLists.get(t,this.renderListStack.length),this.currentRenderList.clear(),this.renderListStack.push(this.currentRenderList),this.projectObject(t,e,0),ka.addCounterAmount("render objects",this.currentRenderList.queue.size()),this.currentRenderList.sort(),this.mergeRendering?(this.currentRenderList.mergeQueue(),this.renderMerged(this.currentRenderList,e)):t.isStatic&&this.params.sliceRendering?this.renderSlice(this.currentRenderList,t,e,r):this.renderScene(this.currentRenderList,t,e,r),t.isScene&&t.onAfterRender(this,t,e),this.renderStateStack.pop(),this.renderStateStack.length>0?this.currentRenderState=this.renderStateStack[this.renderStateStack.length-1]:this.currentRenderState=void 0,this.renderListStack.pop(),this.renderListStack.length?this.currentRenderList=this.renderListStack[this.renderListStack.length-1]:this.currentRenderList=void 0,ka.addTimer("render cycle")}projectObject(t,e,r=0){var i,n,s,a,o,h;if(t.visible)if(t.composeNode)t.boundingBoxWorld.isEmpty()?null==(i=this.currentRenderList)||i.push(t,r):this._frustum.intersectsBox(t.boundingBoxWorld)&&(null==(n=this.currentRenderList)||n.push(t,r));else{t.isGroup&&(r=t.renderOrder),t.isShape&&e?t.boundingBoxWorld.isEmpty()?null==(s=this.currentRenderList)||s.push(t,r):this._frustum.intersectsBox(t.boundingBoxWorld)&&(null==(a=this.currentRenderList)||a.push(t,r)):t.isShape&&(null==(o=this.currentRenderList)||o.push(t,r));for(let r=0,i=(null==(h=t.children)?void 0:h.length)||0;r<i;r++)this.projectObject(t.children[r],e)}}renderMerged(t,e){this.autoClear&&this.clean();const r=De.values(t.mergedQueue);for(let t=0,i=r.length;t<i;t++){const i=r[t];this.renderer.renderMergedBefore();let n=null;for(let t=0,r=i.size();t<r;t++)n=i.dequeue(),n&&(this.bindingStates.updateModelViewMatrix(n,e),this.bindingStates.setup(n,this.currentRenderState,e),this.renderer.renderMergedGeo(n));this.renderer.renderMergedMat(n),this.renderer.renderMergedAfter()}}renderSlice(t,e,r,i){var n;this.autoClear&&this.clean();const s=t.queue.getAll();if(!(null==s?void 0:s.length))return;this._tic&&this._tic.clear(),this.renderSliceComplete=!1;const a=(null==(n=this._currentRenderTarget)?void 0:n.ctx)||this.ctx;this._tic=new Zn(s,(t=>{this.renderSliceComplete=!1,this.renderer.ctx=a,this.renderObject(s[t],e,r,i),e.isStatic&&t===s.length-1&&this.params.debounceCache&&(this.renderSliceComplete=!0)}),this.params.sliceDuration),ka.addCounterAmount("renderSlice objects",s.length)}renderScene(t,e,r,i){this.autoClear&&this.clean();const n=t.queue;n.size()<=0||(this.renderObjects(n,e,r,i),n.clear())}renderObjects(t,e,r,i){if(t.size()<=0)return;const n=t.size();for(let s=0;s<n;s++){const n=t.dequeue();n&&this.renderObject(n,e,r,i)}}renderObject(t,e,r,i){t.onBeforeRender(this,e,r,i),this.bindingStates.updateModelViewMatrix(t,r),this.renderBufferDirect(t,e,r),t.onAfterRender(this,e,r)}renderBufferDirect(t,e,r){this.bindingStates.setup(t,this.currentRenderState,r),this.renderer.beforeRender(t),this.renderer.render(t),t.selected&&this.renderer.renderSelected(t),this.renderer.afterRender(),this.params.wireframe&&this.renderer.renderWireFrame(t),ka.addCounterAmount("renderBufferDirect",1)}renderTexture(t,e){t&&t.image&&(this._currentRenderTarget?this.renderer.ctx=this._currentRenderTarget.ctx:this.renderer.ctx=this.ctx,this.autoClear&&this.clean(),this.renderer.ctx.drawImage(t.image,0,0))}}let Ua=class extends Se{constructor(t={}){super(),f(this,"name","RenderTarget"),f(this,"uuid",Ke()),f(this,"featureKey",this.name+"@"+this.uuid),f(this,"offscreen",!0),f(this,"width"),f(this,"height"),f(this,"dpr"),f(this,"texture"),f(this,"cvs"),f(this,"ctx"),void 0!==t.offscreen&&(this.offscreen=t.offscreen),this.width=t.width,this.height=t.height,this.dpr=t.dpr||1,this.offscreen?this.cvs=Zi.get(this.featureKey,this.width,this.height,this.dpr):this.cvs=Zi.createHtmlCanvas(this.width,this.height,this.dpr),this.ctx=Zi.getContext2D(this.cvs,{alpha:!0}),this.texture=new Nn,this.texture.isRenderTargetTexture=!0,this.texture.image=this.cvs}destroy(){super.destroy()}setSize(t,e,r=be.dpr){this.width===t&&this.height===e&&this.dpr===r||(this.width=t,this.height=e,Zi.resizeCanvas(this.cvs,t,e,r))}clean(){this.ctx&&this.ctx.clearRect(0,0,this.width,this.height)}clone(){return new(0,this.constructor)({width:this.width,height:this.height,dpr:this.dpr}).copy(this)}copy(t){return this.name=t.name,this}};const Va=new Oe;class Fa{constructor(t,e){f(this,"name","EffectComposer"),f(this,"renderer"),f(this,"renderTarget1"),f(this,"renderTarget2"),f(this,"writeBuffer"),f(this,"readBuffer"),f(this,"_width"),f(this,"_height"),f(this,"_pixelRatio"),f(this,"renderToScreen",!0),f(this,"passes",[]),f(this,"clock",new Hs),this.renderer=t,e?(this.renderTarget1=e,this._width=e.width,this._height=e.height):(t.getSize(Va),this._width=Va.x,this._height=Va.y,this.renderTarget1=new Ua({width:this._width,height:this._height}),this.renderTarget1.name="EffectComposer.rt1"),this._pixelRatio=be.dpr,this.renderTarget2=this.renderTarget1.clone(),this.renderTarget2.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}destroy(){this.renderTarget1.destroy(),this.renderTarget2.destroy()}swapBuffers(){const t=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=t}addPass(t){this.passes.push(t),t.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(t,e){this.passes.splice(e,0,t),t.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(t){const e=this.passes.indexOf(t);-1!==e&&this.passes.splice(e,1)}clearPasses(){this.passes.length=0}isLastEnabledPass(t){for(let e=t+1,r=this.passes.length;e<r;e++)if(this.passes[e].enabled)return!1;return!0}render(t){void 0===t&&(t=this.clock.getDelta());const e=this.renderer.getRenderTarget();for(let e=0,r=this.passes.length;e<r;e++){const r=this.passes[e];r.enabled&&(r.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(e),r.render(this.renderer,this.writeBuffer,this.readBuffer,t,!1),r.needsSwap&&this.swapBuffers())}this.renderer.setRenderTarget(e)}reset(t){void 0===t&&(this.renderer.getSize(Va),this._pixelRatio=be.dpr,this._width=Va.x,this._height=Va.y,(t=this.renderTarget1.clone()).setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)),this.renderTarget1.destroy(),this.renderTarget2.destroy(),this.renderTarget1=t,this.renderTarget2=t.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}setSize(t,e){this._width=t,this._height=e;const r=this._width*this._pixelRatio,i=this._height*this._pixelRatio;this.renderTarget1.setSize(r,i),this.renderTarget2.setSize(r,i);for(let t=0,e=this.passes.length;t<e;t++)this.passes[t].setSize(r,i)}setPixelRatio(t){this._pixelRatio=t,this.setSize(this._width,this._height)}}class qa{constructor(){f(this,"isPass",!0),f(this,"enabled",!0),f(this,"needsSwap",!0),f(this,"clear",!1),f(this,"renderToScreen",!1)}destroy(){}setSize(t,e){}}class Ha{constructor(){f(this,"renderTarget"),f(this,"texture"),f(this,"width"),f(this,"height"),f(this,"dpr"),f(this,"version",-1),this.width=be.config.width,this.height=be.config.height,this.dpr=be.config.dpr,this.renderTarget=new Ua({width:this.width,height:this.height,dpr:this.dpr}),this.texture=this.renderTarget.texture,this.texture.image=this.renderTarget.cvs}destroy(){}render(t){t.renderTexture(this.texture)}}class za extends qa{constructor(t,e,r=!0,i=!1){super(),f(this,"name","RenderPass"),f(this,"scene"),f(this,"camera"),this.scene=t,this.camera=e,this.clear=r,this.needsSwap=i}render(t,e,r,i){const n=t.autoClear;t.autoClear=!1,t.setRenderTarget(this.renderToScreen?void 0:r),this.clear&&t.clean(),t.render(this.scene,this.camera,i),t.autoClear=n}}class ja extends Se{constructor(t={}){super(),f(this,"name","RenderTarget"),f(this,"uuid",Ke()),f(this,"featureKey",this.name+"@"+this.uuid),f(this,"offscreen",!0),f(this,"width"),f(this,"height"),f(this,"dpr"),f(this,"texture"),f(this,"cvs"),f(this,"ctx"),void 0!==t.offscreen&&(this.offscreen=t.offscreen),this.width=t.width,this.height=t.height,this.dpr=t.dpr||1,this.offscreen?this.cvs=Zi.get(this.featureKey,this.width,this.height,this.dpr):this.cvs=Zi.createHtmlCanvas(this.width,this.height,this.dpr),this.ctx=Zi.getContext2D(this.cvs,{alpha:!0}),this.texture=new Nn,this.texture.isRenderTargetTexture=!0,this.texture.image=this.cvs}destroy(){super.destroy()}setSize(t,e,r=be.dpr){this.width===t&&this.height===e&&this.dpr===r||(this.width=t,this.height=e,Zi.resizeCanvas(this.cvs,t,e,r))}clean(){this.ctx&&this.ctx.clearRect(0,0,this.width,this.height)}clone(){return new(0,this.constructor)({width:this.width,height:this.height,dpr:this.dpr}).copy(this)}copy(t){return this.name=t.name,this}}class Wa extends Se{constructor(t={}){super(),f(this,"name","App@"+Ee()),f(this,"params"),f(this,"scenes",[]),f(this,"nextScenes",[]),f(this,"nextBoundingBox",new Le),f(this,"loadingScene"),f(this,"composer"),f(this,"renderer"),f(this,"view"),f(this,"runningHandler",this.running.bind(this)),this.params=t,this.params.defaultFill||(this.params.defaultFill=Dr.getMoreTransparent(Sr,.3)),this.params.defaultStroke||(this.params.defaultStroke=Dr.getMoreTransparent(Ar,.8)),this.params.infoFill||(this.params.infoFill=Dr.getMoreTransparent(Sr,.3)),this.params.infoStroke||(this.params.infoStroke=Dr.getMoreTransparent(Ar,.8)),this.params.primaryFill||(this.params.primaryFill=Dr.getMoreTransparent(yr,.3)),this.params.primaryStroke||(this.params.primaryStroke=Dr.getMoreTransparent(vr,.8)),this.params.successFill||(this.params.successFill=Dr.getMoreTransparent(mr,.3)),this.params.successStroke||(this.params.successStroke=Dr.getMoreTransparent(gr,.8)),this.params.warningFill||(this.params.warningFill=Dr.getMoreTransparent(Er,.3)),this.params.warningStroke||(this.params.warningStroke=Dr.getMoreTransparent(Tr,.8)),this.params.dangerFill||(this.params.dangerFill=Dr.getMoreTransparent(xr,.3)),this.params.dangerStroke||(this.params.dangerStroke=Dr.getMoreTransparent(_r,.8)),this.params.activeFill||(this.params.activeFill=Dr.getMoreTransparent(br,.3)),this.params.activeStroke||(this.params.activeStroke=Dr.getMoreTransparent(wr,.8)),this.renderer=new Pa(t),this.view=new aa(t),be.window.postMessage({task:r.CAMERA_SYNC,data:JSON.stringify(this.view.camera)}),this.composer=new Fa(this.renderer,new ja(t)),this.trans2LoadingScene()}get isLoadingScene(){var t;return"LoadingScene"===(null==(t=this.scenes[0])?void 0:t.name)}destroy(){super.destroy(),this.renderer&&this.renderer.destroy()}usedCacheChanged(t=!1){return g(this,null,(function*(){yield this.trans2LoadingScene(),this.params.usedCache=t}))}svgLoadingTypeChanged(t){this.params.svgLoadingType=t}wireframeChanged(t=!1){this.params.wireframe=t}bgPassChanged(t=!1){this.params.bgPass=t}selectEnableChanged(t=!1){this.params.selectEnable=t}multiSelectEnableChanged(t=!1){this.params.multiSelectEnable=t}zoomToSelectEnableChanged(t=!1){this.params.zoomToSelectEnable=t}trans2LoadingScene(){return g(this,null,(function*(){var t,e,i,n,s,a;this.clearScenes(),this.loadingScene||(this.loadingScene=new Ys(this.params)),this.pushScene(this.loadingScene),this.view.fullscreen(1200),be.window.postMessage({task:r.CAMERA_CHANGED,data:{t:null==(e=null==(t=this.view)?void 0:t.camera)?void 0:e.position,r:null==(n=null==(i=this.view)?void 0:i.camera)?void 0:n.rotation.x,s:null==(a=null==(s=this.view)?void 0:s.camera)?void 0:a.scaled.x}});const o=new za(this.loadingScene,this.view.camera);this.composer.clearPasses(),this.composer.addPass(o)}))}hasScene(t){return this.scenes.findIndex((e=>e.uuid===t.uuid))>=0}pushScene(t){this.hasScene(t)||(this.view.bindScene(t),this.scenes.push(t))}clearScenes(){this.view.scenes.length=0,this.scenes.forEach((t=>this.removeScene(t))),this.scenes.length=0,this.loadingScene=void 0}removeScene(t){const e=this.scenes.findIndex((e=>e.uuid===t.uuid));e<0||(this.scenes[e].destroy(),this.scenes.splice(e,1))}prepareScenes(...t){var e,i,n,s,a,o;if(t&&t.length&&(this.nextBoundingBox.makeEmpty(),t.forEach((t=>this.nextScenes.push(t))),this.view.computeBoundingBox(this.nextScenes,this.nextBoundingBox),this.view.expandScenesBoundingBox(this.nextScenes,this.nextBoundingBox),be.window.postMessage({task:r.CAMERA_CHANGED,data:{t:null==(i=null==(e=this.view)?void 0:e.camera)?void 0:i.position,r:null==(s=null==(n=this.view)?void 0:n.camera)?void 0:s.rotation.x,s:null==(o=null==(a=this.view)?void 0:a.camera)?void 0:o.scaled.x}}),this.nextBoundingBox.isEmpty()))throw new Error("nothing in the scene")}pushScenes(...t){t&&t.length&&(this.prepareScenes(...t),this.clearScenes())}trans2Scenes(...t){var e,i,n,s,a,o;t&&t.length&&(this.prepareScenes(...t),this.clearScenes(),this.nextScenes.forEach((t=>t.isDynamic?void 0:this.pushScene(t))),this.nextScenes.forEach((t=>t.isDynamic?this.pushScene(t):void 0)),this.nextScenes.length=0,this.view.resetCameraByBoundingBox(this.nextBoundingBox,!1),be.window.postMessage({task:r.CAMERA_CHANGED,data:{t:null==(i=null==(e=this.view)?void 0:e.camera)?void 0:i.position,r:null==(s=null==(n=this.view)?void 0:n.camera)?void 0:s.rotation.x,s:null==(o=null==(a=this.view)?void 0:a.camera)?void 0:o.scaled.x}}))}start(){requestAnimationFrame(this.runningHandler)}running(t){var e;this.view&&this.view.update(t),(null==(e=this.scenes)?void 0:e.length)&&this.scenes.forEach((t=>"function"==typeof(null==t?void 0:t.update)?t.update():void 0)),this.composer.render(),requestAnimationFrame(this.runningHandler)}stop(){}}class Ya extends pr{constructor(){super(...arguments),f(this,"isStatic",!0),f(this,"featureKey","StaticScene_"+this.id),f(this,"cameraVersion",0),f(this,"dynamically",!1),f(this,"needsUpdateChangedHandler",this.handleNeedsUpdateChanged.bind(this))}handleNeedsUpdateChanged(){this.needsUpdate=!0}}class Ga extends Ki{constructor(t={}){t.commands||(t.commands=[]),super(t),f(this,"arrowLength",0),f(this,"arrowDeg",30),f(this,"stArrow",!1),f(this,"edArrow",!1),this.arrowLength=this.params.arrowLength||10,this.arrowDeg=this.params.arrowDeg||30,this.stArrow=this.params.stArrow||!1,this.edArrow=this.params.edArrow||!1,this.recomputePath()}recomputePath(){var t,e;if(!(null==(e=null==(t=this.params)?void 0:t.points)?void 0:e.length))return this;const r=this.params.points,i=[];for(let t=0,e=r.length;t<e;t++)t?i.push({type:ai.LINE_TO,x:r[t].x,y:r[t].y,relative:!1}):i.push({type:ai.MOVE_TO,x:r[t].x,y:r[t].y,relative:!1});return this.commands=i,(this.params.stArrow||this.params.edArrow)&&this.addArrow(),this}addArrow(t){t||(t=this.arrowLength);const e=this.params.points;if(!(null==e?void 0:e.length))return this;if(this.stArrow){if(Xa.set(e[1].x,e[1].y),Za.set(e[0].x,e[0].y),Xa.equals(Za))return this;Qa.subVectors(Xa,Za),$a.lerpVectors(Za,Xa,t/Qa.length()),Ka.copy($a).rotateAround(Za,Ce(this.arrowDeg)),Ja.copy($a).rotateAround(Za,-Ce(this.arrowDeg)),this.commands.push({type:ai.MOVE_TO,x:Ka.x,y:Ka.y,relative:!1}),this.commands.push({type:ai.LINE_TO,x:Za.x,y:Za.y,relative:!1}),this.commands.push({type:ai.LINE_TO,x:Ja.x,y:Ja.y,relative:!1})}if(this.edArrow){const r=e.length;if(Xa.set(e[r-2].x,e[r-2].y),Za.set(e[r-1].x,e[r-1].y),Xa.equals(Za))return this;Qa.subVectors(Xa,Za),$a.lerpVectors(Za,Xa,t/Qa.length()),Ka.copy($a).rotateAround(Za,Ce(this.arrowDeg)),Ja.copy($a).rotateAround(Za,-Ce(this.arrowDeg)),this.commands.push({type:ai.MOVE_TO,x:Ka.x,y:Ka.y,relative:!1}),this.commands.push({type:ai.LINE_TO,x:Za.x,y:Za.y,relative:!1}),this.commands.push({type:ai.LINE_TO,x:Ja.x,y:Ja.y,relative:!1})}return this}}const Xa=new Oe,Qa=new Oe,Za=new Oe,$a=new Oe,Ka=new Oe,Ja=new Oe;class to extends nn{constructor(t={}){if(!be.config.width||!be.config.height)throw new Error("error input");t.width||(t.width=.5*be.config.width),t.height||(t.height=.5*be.config.height),t.lineWidth||(t.lineWidth=1),t.stroke||(t.stroke=_r),t.arrowDeg||(t.arrowDeg=30),t.arrowLength||(t.arrowLength=10),t.points=[{x:-t.width,y:0},{x:t.width,y:0},{x:0,y:t.height},{x:0,y:-t.height}],t.castShadow=!1,t.usedCache=!1,t.wireframe=!1;const e=.5*(t.arrowLength||10),r=new gn({points:[{x:-e,y:0},{x:0,y:e},{x:e,y:0},{x:0,y:-e}]}),i=new rn({fill:_r});new nn(r,i).name="Axes.centralMesh",super(r,i),f(this,"name","Axes"),f(this,"isAxes",!0),f(this,"matrixAutoUpdate",!1),f(this,"matrixWorldAutoUpdate",!1),f(this,"composeNode",!0),f(this,"dynamically",!1),f(this,"arrowLength",10),f(this,"arrowDeg",30),f(this,"stroke",Sr),f(this,"fill"),f(this,"lineWidth",1),f(this,"xMesh"),f(this,"yMesh"),f(this,"xrMesh"),f(this,"yrMesh"),this.renderOrder=1/0,this.xMesh=new nn(new Ga({points:[{x:2*e,y:0},{x:t.width,y:0}],edArrow:!0}),new rn({fill:_r,stroke:_r,lineWidth:1})),this.xMesh.name="Axes.xMesh",this.yMesh=new nn(new Ga({points:[{x:0,y:2*e},{x:0,y:t.height}],edArrow:!0}),new rn({fill:gr,stroke:gr,lineWidth:1})),this.yMesh.name="Axes.yMesh",this.xrMesh=new nn(new Ga({points:[{x:-2*e,y:0},{x:-t.width,y:0}]}),new rn({stroke:_r,lineWidth:1,lineDash:[10,10]})),this.xrMesh.name="Axes.xrMesh",this.yrMesh=new nn(new Ga({points:[{x:0,y:-2*e},{x:0,y:-t.height}]}),new rn({stroke:gr,lineWidth:1,lineDash:[10,10]})),this.yrMesh.name="Axes.yrMesh",this.add(this.xMesh),this.add(this.yMesh),this.add(this.xrMesh),this.add(this.yrMesh),this.computeBoundingBox()}}class eo extends to{constructor(t={},e){void 0===t.name&&(t.name="AxesHelper"),t.selectable=!1,super(t),f(this,"name","AxesHelper2"),f(this,"usedCache",!1),f(this,"castShadow",!1),f(this,"padding",new Oe(50,20)),f(this,"camera"),this.traverse((t=>t.selectable=!1)),this.camera=e}computeBoundingBox(){return this.boundingBox.makeEmpty(),this.boundingBox}updateModelViewMatrix(t){t?(this.modelViewMatrix.copy(t.viewMatrix),this.lineWidth=t.scaled.x,this.computeAxes(t)):this.modelViewMatrix.copy(this.matrixWorld)}onBeforeRender(t,e,r,i){}computeAxes(t){if(!t)return;t.updateBoundingBox();const e=this.arrowLength*t.scaled.x,r=e/4;this.xMesh.geo.arrowLength=e,this.xMesh.geo.setFromPoints([{x:e+r,y:0},{x:t.boundingBoxWorld.max.x,y:0}]),this.yMesh.geo.arrowLength=e,this.yMesh.geo.setFromPoints([{x:0,y:e+r},{x:0,y:t.boundingBoxWorld.max.y}]),this.xrMesh.geo.setFromPoints([{x:-e-r,y:0},{x:t.boundingBoxWorld.min.x,y:0}]),this.yrMesh.geo.setFromPoints([{x:0,y:-e-r},{x:0,y:t.boundingBoxWorld.min.y}]),this.geo.setFromPoints([{x:-e,y:0},{x:-r,y:r},{x:0,y:e},{x:r,y:r},{x:e,y:0},{x:r,y:-r},{x:0,y:-e},{x:-r,y:-r}])}}class ro extends Ya{constructor(t={}){super(),f(this,"isMainScene",!0),f(this,"name","MainScene"),f(this,"params"),f(this,"featureKey","MainScene_"+this.id),f(this,"axesHelper"),f(this,"resourcesMap",{}),f(this,"_viewBox",new Le),this.params=t,this.selectable=!0,this.initAxesHelper()}destroy(){super.destroy()}initAxesHelper(){this.params.axesHelper&&(this.axesHelper&&this.axesHelper.destroy(),this.axesHelper=new eo(this.params.axesHelper),this.add(this.axesHelper))}setViewBox(t){t&&this._viewBox.copy(t)}computeBoundingBox(){return super.computeBoundingBox(),this._viewBox.isEmpty()?this.boundingBox:(this._viewBox.getCenter(io),this.boundingBox.getCenter(no),Math.round(Oe.getDistance(io,no)),this._viewBox)}add(t){return super.add(t),t.userData.id?(this.resourcesMap[t.userData.id]=t,this):this}getAssetIdsByType(t){const e=[];return this.traverse((r=>{r.userData.assetType===t&&r.userData.id&&e.push(r.userData.id)})),e}setFillOrStrokeByIds(t,e,r="fill"){this.traverse((i=>{i.mat&&t.includes(i.userData.id)&&(i.mat=De.cloneDeep(i.mat),"fill"===r?i.mat.fill=e:"stroke"===r&&(i.mat.stroke=e,i.mat.lineWidth=5))})),this.needsUpdate=!0}clearFill(){this.traverse((t=>{var e;t.mat&&(null==(e=t.mat)?void 0:e.fill)&&(t.mat.fill=void 0)})),this.needsUpdate=!0}clearStroke(){this.traverse((t=>{var e;t.mat&&(null==(e=t.mat)?void 0:e.stroke)&&(t.mat.stroke=be.config.defaultStroke||Ar,t.mat.lineWidth=1)})),this.needsUpdate=!0}fontZoomIn(t=1.1){this.traverse((e=>{e.mat&&e.isText&&e.textContent&&(e.mat=De.cloneDeep(e.mat),e.mat.fontSize*=t)})),this.needsUpdate=!0}fontZoomOut(t=.9){this.traverse((e=>{e.mat&&e.mat&&e.isText&&e.textContent&&(e.mat=De.cloneDeep(e.mat),e.mat.fontSize*=t)})),this.needsUpdate=!0}strokeMore(t=1.1){this.traverse((e=>{var r;e.mat&&(null==(r=e.mat)?void 0:r.stroke)&&e.mat.lineWidth&&(e.mat.lineWidth*=t)})),this.needsUpdate=!0}strokeLess(t=.9){this.traverse((e=>{var r;e.mat&&(null==(r=e.mat)?void 0:r.stroke)&&e.mat.lineWidth&&(e.mat.lineWidth*=t)})),this.needsUpdate=!0}}const io=new Oe,no=new Oe,so={enabled:!1,files:{},add:function(t,e){this.enabled&&(this.files[t]=e)},get:function(t){if(this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}},ao=new class{constructor(t,e,r){f(this,"isLoading",!1),f(this,"itemsLoaded",0),f(this,"itemsTotal",0),f(this,"urlModifier"),f(this,"handlers",[]),f(this,"onStart"),f(this,"onLoad"),f(this,"onProgress"),f(this,"onError"),this.onLoad=t,this.onProgress=e,this.onError=r}itemStart(t){this.itemsTotal++,this.isLoading||void 0!==this.onStart&&this.onStart(t,this.itemsLoaded,this.itemsTotal),this.isLoading=!0}itemEnd(t){this.itemsLoaded++,void 0!==this.onProgress&&this.onProgress(t,this.itemsLoaded,this.itemsTotal),this.itemsLoaded===this.itemsTotal&&(this.isLoading=!1,void 0!==this.onLoad&&this.onLoad())}itemError(t){void 0!==this.onError&&this.onError(t)}resolveURL(t){return void 0!==this.urlModifier?this.urlModifier(t):t}setURLModifier(t){return this.urlModifier=t,this}addHandler(t,e){return this.handlers.push(t,e),this}removeHandler(t){const e=this.handlers.indexOf(t);return-1!==e&&this.handlers.splice(e,2),this}getHandler(t){for(let e=0,r=this.handlers.length;e<r;e+=2){const r=this.handlers[e],i=this.handlers[e+1];if(r.global&&(r.lastIndex=0),r.test(t))return i}return null}};class oo{constructor(t=ao){f(this,"manager"),f(this,"crossOrigin","anonymous"),f(this,"withCredentials",!1),f(this,"path",""),f(this,"resourcePath",""),f(this,"requestHeader",{}),this.manager=t}loadAsync(t,e){const r=this;return new Promise((function(i,n){r.load(t,i,e,n)}))}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}const ho={};class uo extends Error{constructor(t,e){super(t),f(this,"response"),this.response=e}}class co extends oo{constructor(t){super(t),f(this,"mimeType"),f(this,"responseType")}load(t,e,r,i){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const n=so.get(t);if(void 0!==n)return this.manager.itemStart(t),setTimeout((()=>{e&&e(n),this.manager.itemEnd(t)}),0),n;if(void 0!==ho[t])return void ho[t].push({onLoad:e,onProgress:r,onError:i});ho[t]=[],ho[t].push({onLoad:e,onProgress:r,onError:i});const s=new be.window.Request(t,{headers:new be.window.Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,o=this.responseType;fetch(s).then((e=>{if(200===e.status||0===e.status){if(e.status,"undefined"==typeof ReadableStream||void 0===e.body||void 0===e.body.getReader)return e;const r=ho[t],i=e.body.getReader(),n=e.headers.get("Content-Length")||e.headers.get("X-File-Size"),s=n?parseInt(n):0,a=0!==s;let o=0;const h=new ReadableStream({start(t){!function e(){i.read().then((({done:i,value:n})=>{if(i)t.close();else{o+=n.byteLength;const i=new ProgressEvent("progress",{lengthComputable:a,loaded:o,total:s});for(let t=0,e=r.length;t<e;t++){const e=r[t];e.onProgress&&e.onProgress(i)}t.enqueue(n),e()}}))}()}});return new Response(h)}throw new uo(`fetch for "${e.url}" responded with ${e.status}: ${e.statusText}`,e)})).then((t=>{switch(o){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"document":return t.text().then((t=>(new DOMParser).parseFromString(t,a)));case"json":return t.json();default:if(void 0===a)return t.text();{const e=/charset="?([^;"\s]*)"?/i.exec(a),r=e&&e[1]?e[1].toLowerCase():void 0,i=new TextDecoder(r);return t.arrayBuffer().then((t=>i.decode(t)))}}})).then((e=>{so.add(t,e);const r=ho[t];delete ho[t];for(let t=0,i=r.length;t<i;t++){const i=r[t];i.onLoad&&i.onLoad(e)}})).catch((e=>{const r=ho[t];if(void 0===r)throw this.manager.itemError(t),e;delete ho[t];for(let t=0,i=r.length;t<i;t++){const i=r[t];i.onError&&i.onError(e)}this.manager.itemError(t)})).finally((()=>{this.manager.itemEnd(t)})),this.manager.itemStart(t)}setMimeType(t){return this.mimeType=t,this}setResponseType(t){return this.responseType=t,this}}class lo extends oo{constructor(t){super(t)}load(t,e,r,i){const n=this,s=new co(n.manager);s.setPath(n.path),s.setRequestHeader(n.requestHeader),s.setWithCredentials(n.withCredentials),s.load(t,(function(r){try{e&&e(r)}catch(e){i&&i(e),n.manager.itemError(t)}}),r,i)}}var po,fo,mo,go,yo,vo={},xo=y(Object.freeze({__proto__:null,default:{}})),_o={},bo={exports:{}},wo={},Eo={},To={};function So(){return mo||(mo=1,function(t){var e=function(){if(po)return Eo;po=1,Eo.byteLength=function(t){var e=s(t),r=e[0],i=e[1];return 3*(r+i)/4-i},Eo.toByteArray=function(t){var i,n,a=s(t),o=a[0],h=a[1],u=new r(function(t,e,r){return 3*(e+r)/4-r}(0,o,h)),c=0,l=h>0?o-4:o;for(n=0;n<l;n+=4)i=e[t.charCodeAt(n)]<<18|e[t.charCodeAt(n+1)]<<12|e[t.charCodeAt(n+2)]<<6|e[t.charCodeAt(n+3)],u[c++]=i>>16&255,u[c++]=i>>8&255,u[c++]=255&i;return 2===h&&(i=e[t.charCodeAt(n)]<<2|e[t.charCodeAt(n+1)]>>4,u[c++]=255&i),1===h&&(i=e[t.charCodeAt(n)]<<10|e[t.charCodeAt(n+1)]<<4|e[t.charCodeAt(n+2)]>>2,u[c++]=i>>8&255,u[c++]=255&i),u},Eo.fromByteArray=function(e){for(var r,i=e.length,n=i%3,s=[],o=16383,h=0,u=i-n;h<u;h+=o)s.push(a(e,h,h+o>u?u:h+o));return 1===n?(r=e[i-1],s.push(t[r>>2]+t[r<<4&63]+"==")):2===n&&(r=(e[i-2]<<8)+e[i-1],s.push(t[r>>10]+t[r>>4&63]+t[r<<2&63]+"=")),s.join("")};for(var t=[],e=[],r="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0;n<64;++n)t[n]=i[n],e[i.charCodeAt(n)]=n;function s(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function a(e,r,i){for(var n,s,a=[],o=r;o<i;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),a.push(t[(s=n)>>18&63]+t[s>>12&63]+t[s>>6&63]+t[63&s]);return a.join("")}return e["-".charCodeAt(0)]=62,e["_".charCodeAt(0)]=63,Eo}(),r=(fo||(fo=1,To.read=function(t,e,r,i,n){var s,a,o=8*n-i-1,h=(1<<o)-1,u=h>>1,c=-7,l=r?n-1:0,d=r?-1:1,p=t[e+l];for(l+=d,s=p&(1<<-c)-1,p>>=-c,c+=o;c>0;s=256*s+t[e+l],l+=d,c-=8);for(a=s&(1<<-c)-1,s>>=-c,c+=i;c>0;a=256*a+t[e+l],l+=d,c-=8);if(0===s)s=1-u;else{if(s===h)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,i),s-=u}return(p?-1:1)*a*Math.pow(2,s-i)},To.write=function(t,e,r,i,n,s){var a,o,h,u=8*s-n-1,c=(1<<u)-1,l=c>>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:s-1,f=i?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-a))<1&&(a--,h*=2),(e+=a+l>=1?d/h:d*Math.pow(2,1-l))*h>=2&&(a++,h/=2),a+l>=c?(o=0,a=c):a+l>=1?(o=(e*h-1)*Math.pow(2,n),a+=l):(o=e*Math.pow(2,l-1)*Math.pow(2,n),a=0));n>=8;t[r+p]=255&o,p+=f,o/=256,n-=8);for(a=a<<n|o,u+=n;u>0;t[r+p]=255&a,p+=f,a/=256,u-=8);t[r+p-f]|=128*m}),To),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=a,t.SlowBuffer=function(t){return+t!=t&&(t=0),a.alloc(+t)},t.INSPECT_MAX_BYTES=50;var n=2147483647;function s(t){if(t>n)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,a.prototype),e}function a(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return u(t)}return o(t,e,r)}function o(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!a.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|p(t,e),i=s(r),n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}(t,e);if(ArrayBuffer.isView(t))return function(t){if(V(t,Uint8Array)){var e=new Uint8Array(t);return l(e.buffer,e.byteOffset,e.byteLength)}return c(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(V(t,ArrayBuffer)||t&&V(t.buffer,ArrayBuffer))return l(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(V(t,SharedArrayBuffer)||t&&V(t.buffer,SharedArrayBuffer)))return l(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var i=t.valueOf&&t.valueOf();if(null!=i&&i!==t)return a.from(i,e,r);var n=function(t){if(a.isBuffer(t)){var e=0|d(t.length),r=s(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||F(t.length)?s(0):c(t):"Buffer"===t.type&&Array.isArray(t.data)?c(t.data):void 0}(t);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return a.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function u(t){return h(t),s(t<0?0:0|d(t))}function c(t){for(var e=t.length<0?0:0|d(t.length),r=s(e),i=0;i<e;i+=1)r[i]=255&t[i];return r}function l(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var i;return i=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(i,a.prototype),i}function d(t){if(t>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return 0|t}function p(t,e){if(a.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||V(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return k(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return P(t).length;default:if(n)return i?-1:k(t).length;e=(""+e).toLowerCase(),n=!0}}function f(t,e,r){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return C(this,e,r);case"utf8":case"utf-8":return T(this,e,r);case"ascii":return A(this,e,r);case"latin1":case"binary":return N(this,e,r);case"base64":return E(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function m(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function g(t,e,r,i,n){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),F(r=+r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=a.from(e,i)),a.isBuffer(e))return 0===e.length?-1:y(t,e,r,i,n);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):y(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function y(t,e,r,i,n){var s,a=1,o=t.length,h=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;a=2,o/=2,h/=2,r/=2}function u(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(n){var c=-1;for(s=r;s<o;s++)if(u(t,s)===u(e,-1===c?0:s-c)){if(-1===c&&(c=s),s-c+1===h)return c*a}else-1!==c&&(s-=s-c),c=-1}else for(r+h>o&&(r=o-h),s=r;s>=0;s--){for(var l=!0,d=0;d<h;d++)if(u(t,s+d)!==u(e,d)){l=!1;break}if(l)return s}return-1}function v(t,e,r,i){r=Number(r)||0;var n=t.length-r;i?(i=Number(i))>n&&(i=n):i=n;var s=e.length;i>s/2&&(i=s/2);for(var a=0;a<i;++a){var o=parseInt(e.substr(2*a,2),16);if(F(o))return a;t[r+a]=o}return a}function x(t,e,r,i){return U(k(e,t.length-r),t,r,i)}function _(t,e,r,i){return U(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,i)}function b(t,e,r,i){return U(P(e),t,r,i)}function w(t,e,r,i){return U(function(t,e){for(var r,i,n,s=[],a=0;a<t.length&&!((e-=2)<0);++a)i=(r=t.charCodeAt(a))>>8,n=r%256,s.push(n),s.push(i);return s}(e,t.length-r),t,r,i)}function E(t,r,i){return 0===r&&i===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,i))}function T(t,e,r){r=Math.min(t.length,r);for(var i=[],n=e;n<r;){var s,a,o,h,u=t[n],c=null,l=u>239?4:u>223?3:u>191?2:1;if(n+l<=r)switch(l){case 1:u<128&&(c=u);break;case 2:128==(192&(s=t[n+1]))&&(h=(31&u)<<6|63&s)>127&&(c=h);break;case 3:s=t[n+1],a=t[n+2],128==(192&s)&&128==(192&a)&&(h=(15&u)<<12|(63&s)<<6|63&a)>2047&&(h<55296||h>57343)&&(c=h);break;case 4:s=t[n+1],a=t[n+2],o=t[n+3],128==(192&s)&&128==(192&a)&&128==(192&o)&&(h=(15&u)<<18|(63&s)<<12|(63&a)<<6|63&o)>65535&&h<1114112&&(c=h)}null===c?(c=65533,l=1):c>65535&&(c-=65536,i.push(c>>>10&1023|55296),c=56320|1023&c),i.push(c),n+=l}return function(t){var e=t.length;if(e<=S)return String.fromCharCode.apply(String,t);for(var r="",i=0;i<e;)r+=String.fromCharCode.apply(String,t.slice(i,i+=S));return r}(i)}t.kMaxLength=n,a.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),!a.TYPED_ARRAY_SUPPORT&&"undefined"!=typeof console&&console.error,Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(t,e,r){return o(t,e,r)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(t,e,r){return function(t,e,r){return h(t),t<=0?s(t):void 0!==e?"string"==typeof r?s(t).fill(e,r):s(t).fill(e):s(t)}(t,e,r)},a.allocUnsafe=function(t){return u(t)},a.allocUnsafeSlow=function(t){return u(t)},a.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==a.prototype},a.compare=function(t,e){if(V(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),V(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(t)||!a.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,i=e.length,n=0,s=Math.min(r,i);n<s;++n)if(t[n]!==e[n]){r=t[n],i=e[n];break}return r<i?-1:i<r?1:0},a.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var i=a.allocUnsafe(e),n=0;for(r=0;r<t.length;++r){var s=t[r];if(V(s,Uint8Array))n+s.length>i.length?a.from(s).copy(i,n):Uint8Array.prototype.set.call(i,s,n);else{if(!a.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,n)}n+=s.length}return i},a.byteLength=p,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)m(this,e,e+1);return this},a.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},a.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},a.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?T(this,0,t):f.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},i&&(a.prototype[i]=a.prototype.inspect),a.prototype.compare=function(t,e,r,i,n){if(V(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(this===t)return 0;for(var s=(n>>>=0)-(i>>>=0),o=(r>>>=0)-(e>>>=0),h=Math.min(s,o),u=this.slice(i,n),c=t.slice(e,r),l=0;l<h;++l)if(u[l]!==c[l]){s=u[l],o=c[l];break}return s<o?-1:o<s?1:0},a.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},a.prototype.indexOf=function(t,e,r){return g(this,t,e,r,!0)},a.prototype.lastIndexOf=function(t,e,r){return g(this,t,e,r,!1)},a.prototype.write=function(t,e,r,i){if(void 0===e)i="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)i=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-e;if((void 0===r||r>n)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return x(this,t,e,r);case"ascii":case"latin1":case"binary":return _(this,t,e,r);case"base64":return b(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,t,e,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var S=4096;function A(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;n<r;++n)i+=String.fromCharCode(127&t[n]);return i}function N(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;n<r;++n)i+=String.fromCharCode(t[n]);return i}function C(t,e,r){var i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);for(var n="",s=e;s<r;++s)n+=q[t[s]];return n}function M(t,e,r){for(var i=t.slice(e,r),n="",s=0;s<i.length-1;s+=2)n+=String.fromCharCode(i[s]+256*i[s+1]);return n}function O(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function I(t,e,r,i,n,s){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<s)throw new RangeError('"value" argument is out of bounds');if(r+i>t.length)throw new RangeError("Index out of range")}function R(t,e,r,i,n,s){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(t,e,i,n,s){return e=+e,i>>>=0,s||R(t,0,i,4),r.write(t,e,i,n,23,4),i+4}function L(t,e,i,n,s){return e=+e,i>>>=0,s||R(t,0,i,8),r.write(t,e,i,n,52,8),i+8}a.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var i=this.subarray(t,e);return Object.setPrototypeOf(i,a.prototype),i},a.prototype.readUintLE=a.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);for(var i=this[t],n=1,s=0;++s<e&&(n*=256);)i+=this[t+s]*n;return i},a.prototype.readUintBE=a.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);for(var i=this[t+--e],n=1;e>0&&(n*=256);)i+=this[t+--e]*n;return i},a.prototype.readUint8=a.prototype.readUInt8=function(t,e){return t>>>=0,e||O(t,1,this.length),this[t]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(t,e){return t>>>=0,e||O(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(t,e){return t>>>=0,e||O(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(t,e){return t>>>=0,e||O(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(t,e){return t>>>=0,e||O(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);for(var i=this[t],n=1,s=0;++s<e&&(n*=256);)i+=this[t+s]*n;return i>=(n*=128)&&(i-=Math.pow(2,8*e)),i},a.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);for(var i=e,n=1,s=this[t+--i];i>0&&(n*=256);)s+=this[t+--i]*n;return s>=(n*=128)&&(s-=Math.pow(2,8*e)),s},a.prototype.readInt8=function(t,e){return t>>>=0,e||O(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,e){t>>>=0,e||O(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(t,e){t>>>=0,e||O(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(t,e){return t>>>=0,e||O(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return t>>>=0,e||O(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return t>>>=0,e||O(t,4,this.length),r.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return t>>>=0,e||O(t,4,this.length),r.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return t>>>=0,e||O(t,8,this.length),r.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return t>>>=0,e||O(t,8,this.length),r.read(this,t,!1,52,8)},a.prototype.writeUintLE=a.prototype.writeUIntLE=function(t,e,r,i){t=+t,e>>>=0,r>>>=0,i||I(this,t,e,r,Math.pow(2,8*r)-1,0);var n=1,s=0;for(this[e]=255&t;++s<r&&(n*=256);)this[e+s]=t/n&255;return e+r},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(t,e,r,i){t=+t,e>>>=0,r>>>=0,i||I(this,t,e,r,Math.pow(2,8*r)-1,0);var n=r-1,s=1;for(this[e+n]=255&t;--n>=0&&(s*=256);)this[e+n]=t/s&255;return e+r},a.prototype.writeUint8=a.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||I(this,t,e,1,255,0),this[e]=255&t,e+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||I(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||I(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||I(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||I(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e>>>=0,!i){var n=Math.pow(2,8*r-1);I(this,t,e,r,n-1,-n)}var s=0,a=1,o=0;for(this[e]=255&t;++s<r&&(a*=256);)t<0&&0===o&&0!==this[e+s-1]&&(o=1),this[e+s]=(t/a|0)-o&255;return e+r},a.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e>>>=0,!i){var n=Math.pow(2,8*r-1);I(this,t,e,r,n-1,-n)}var s=r-1,a=1,o=0;for(this[e+s]=255&t;--s>=0&&(a*=256);)t<0&&0===o&&0!==this[e+s+1]&&(o=1),this[e+s]=(t/a|0)-o&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||I(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||I(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||I(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||I(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},a.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||I(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return L(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return L(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,i){if(!a.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<r&&(i=r),i===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-r&&(i=t.length-e+r);var n=i-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,i):Uint8Array.prototype.set.call(t,this.subarray(r,i),e),n},a.prototype.fill=function(t,e,r,i){if("string"==typeof t){if("string"==typeof e?(i=e,e=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!a.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===t.length){var n=t.charCodeAt(0);("utf8"===i&&n<128||"latin1"===i)&&(t=n)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var s;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(s=e;s<r;++s)this[s]=t;else{var o=a.isBuffer(t)?t:a.from(t,i),h=o.length;if(0===h)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(s=0;s<r-e;++s)this[s+e]=o[s%h]}return this};var B=/[^+/0-9A-Za-z-_]/g;function k(t,e){var r;e=e||1/0;for(var i=t.length,n=null,s=[],a=0;a<i;++a){if((r=t.charCodeAt(a))>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(a+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function P(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(B,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function U(t,e,r,i){for(var n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function V(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function F(t){return t!=t}var q=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)e[i+n]=t[r]+t[n];return e}()}(wo)),wo}
|
|
10
|
-
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */function Ao(){if(yo)return _o;yo=1;var t=(go||(go=1,function(t,e){var r=So(),i=r.Buffer;function n(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=r:(n(r,e),e.Buffer=s),s.prototype=Object.create(i.prototype),n(i,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r.SlowBuffer(t)}}(bo,bo.exports)),bo.exports).Buffer,e=t.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(r){var i;switch(this.encoding=function(r){var i=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(r);if("string"!=typeof i&&(t.isEncoding===e||!e(r)))throw new Error("Unknown encoding: "+r);return i||r}(r),this.encoding){case"utf16le":this.text=s,this.end=a,i=4;break;case"utf8":this.fillLast=n,i=4;break;case"base64":this.text=o,this.end=h,i=3;break;default:return this.write=u,void(this.end=c)}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(i)}function i(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function n(t){var e=this.lastTotal-this.lastNeed,r=function(t,e){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function s(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function a(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function o(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function u(t){return t.toString(this.encoding)}function c(t){return t&&t.length?this.write(t):""}return _o.StringDecoder=r,r.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},r.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},r.prototype.text=function(t,e){var r=function(t,e,r){var n=e.length-1;if(n<r)return 0;var s=i(e[n]);return s>=0?(s>0&&(t.lastNeed=s-1),s):--n<r||-2===s?0:(s=i(e[n]))>=0?(s>0&&(t.lastNeed=s-2),s):--n<r||-2===s?0:(s=i(e[n]))>=0?(s>0&&(2===s?s=0:t.lastNeed=s-3),s):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},r.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length},_o}!function(t){!function(t){t.parser=function(t,e){return new i(t,e)},t.SAXParser=i,t.SAXStream=s,t.createStream=function(t,e){return new s(t,e)},t.MAX_BUFFER_LENGTH=65536;var e,r=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];function i(e,n){if(!(this instanceof i))return new i(e,n);var s=this;!function(t){for(var e=0,i=r.length;e<i;e++)t[r[e]]=""}(s),s.q=s.c="",s.bufferCheckPosition=t.MAX_BUFFER_LENGTH,s.opt=n||{},s.opt.lowercase=s.opt.lowercase||s.opt.lowercasetags,s.looseCase=s.opt.lowercase?"toLowerCase":"toUpperCase",s.tags=[],s.closed=s.closedRoot=s.sawRoot=!1,s.tag=s.error=null,s.strict=!!e,s.noscript=!(!e&&!s.opt.noscript),s.state=E.BEGIN,s.strictEntities=s.opt.strictEntities,s.ENTITIES=s.strictEntities?Object.create(t.XML_ENTITIES):Object.create(t.ENTITIES),s.attribList=[],s.opt.xmlns&&(s.ns=Object.create(c)),void 0===s.opt.unquotedAttributeValues&&(s.opt.unquotedAttributeValues=!e),s.trackPosition=!1!==s.opt.position,s.trackPosition&&(s.position=s.line=s.column=0),S(s,"onready")}t.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],Object.create||(Object.create=function(t){function e(){}return e.prototype=t,new e}),Object.keys||(Object.keys=function(t){var e=[];for(var r in t)t.hasOwnProperty(r)&&e.push(r);return e}),i.prototype={end:function(){O(this)},write:function(e){var i=this;if(this.error)throw this.error;if(i.closed)return M(i,"Cannot write after close. Assign an onready handler.");if(null===e)return O(i);"object"==typeof e&&(e=e.toString());for(var n=0,s="";s=V(e,n++),i.c=s,s;)switch(i.trackPosition&&(i.position++,"\n"===s?(i.line++,i.column=0):i.column++),i.state){case E.BEGIN:if(i.state=E.BEGIN_WHITESPACE,"\ufeff"===s)continue;U(i,s);continue;case E.BEGIN_WHITESPACE:U(i,s);continue;case E.TEXT:if(i.sawRoot&&!i.closedRoot){for(var h=n-1;s&&"<"!==s&&"&"!==s;)(s=V(e,n++))&&i.trackPosition&&(i.position++,"\n"===s?(i.line++,i.column=0):i.column++);i.textNode+=e.substring(h,n-1)}"<"!==s||i.sawRoot&&i.closedRoot&&!i.strict?(m(s)||i.sawRoot&&!i.closedRoot||I(i,"Text data outside of root node."),"&"===s?i.state=E.TEXT_ENTITY:i.textNode+=s):(i.state=E.OPEN_WAKA,i.startTagPosition=i.position);continue;case E.SCRIPT:"<"===s?i.state=E.SCRIPT_ENDING:i.script+=s;continue;case E.SCRIPT_ENDING:"/"===s?i.state=E.CLOSE_TAG:(i.script+="<"+s,i.state=E.SCRIPT);continue;case E.OPEN_WAKA:if("!"===s)i.state=E.SGML_DECL,i.sgmlDecl="";else if(m(s));else if(v(l,s))i.state=E.OPEN_TAG,i.tagName=s;else if("/"===s)i.state=E.CLOSE_TAG,i.tagName="";else if("?"===s)i.state=E.PROC_INST,i.procInstName=i.procInstBody="";else{if(I(i,"Unencoded <"),i.startTagPosition+1<i.position){var u=i.position-i.startTagPosition;s=new Array(u).join(" ")+s}i.textNode+="<"+s,i.state=E.TEXT}continue;case E.SGML_DECL:if(i.sgmlDecl+s==="--"){i.state=E.COMMENT,i.comment="",i.sgmlDecl="";continue}i.doctype&&!0!==i.doctype&&i.sgmlDecl?(i.state=E.DOCTYPE_DTD,i.doctype+="<!"+i.sgmlDecl+s,i.sgmlDecl=""):(i.sgmlDecl+s).toUpperCase()===a?(A(i,"onopencdata"),i.state=E.CDATA,i.sgmlDecl="",i.cdata=""):(i.sgmlDecl+s).toUpperCase()===o?(i.state=E.DOCTYPE,(i.doctype||i.sawRoot)&&I(i,"Inappropriately located doctype declaration"),i.doctype="",i.sgmlDecl=""):">"===s?(A(i,"onsgmldeclaration",i.sgmlDecl),i.sgmlDecl="",i.state=E.TEXT):g(s)?(i.state=E.SGML_DECL_QUOTED,i.sgmlDecl+=s):i.sgmlDecl+=s;continue;case E.SGML_DECL_QUOTED:s===i.q&&(i.state=E.SGML_DECL,i.q=""),i.sgmlDecl+=s;continue;case E.DOCTYPE:">"===s?(i.state=E.TEXT,A(i,"ondoctype",i.doctype),i.doctype=!0):(i.doctype+=s,"["===s?i.state=E.DOCTYPE_DTD:g(s)&&(i.state=E.DOCTYPE_QUOTED,i.q=s));continue;case E.DOCTYPE_QUOTED:i.doctype+=s,s===i.q&&(i.q="",i.state=E.DOCTYPE);continue;case E.DOCTYPE_DTD:"]"===s?(i.doctype+=s,i.state=E.DOCTYPE):"<"===s?(i.state=E.OPEN_WAKA,i.startTagPosition=i.position):g(s)?(i.doctype+=s,i.state=E.DOCTYPE_DTD_QUOTED,i.q=s):i.doctype+=s;continue;case E.DOCTYPE_DTD_QUOTED:i.doctype+=s,s===i.q&&(i.state=E.DOCTYPE_DTD,i.q="");continue;case E.COMMENT:"-"===s?i.state=E.COMMENT_ENDING:i.comment+=s;continue;case E.COMMENT_ENDING:"-"===s?(i.state=E.COMMENT_ENDED,i.comment=C(i.opt,i.comment),i.comment&&A(i,"oncomment",i.comment),i.comment=""):(i.comment+="-"+s,i.state=E.COMMENT);continue;case E.COMMENT_ENDED:">"!==s?(I(i,"Malformed comment"),i.comment+="--"+s,i.state=E.COMMENT):i.doctype&&!0!==i.doctype?i.state=E.DOCTYPE_DTD:i.state=E.TEXT;continue;case E.CDATA:"]"===s?i.state=E.CDATA_ENDING:i.cdata+=s;continue;case E.CDATA_ENDING:"]"===s?i.state=E.CDATA_ENDING_2:(i.cdata+="]"+s,i.state=E.CDATA);continue;case E.CDATA_ENDING_2:">"===s?(i.cdata&&A(i,"oncdata",i.cdata),A(i,"onclosecdata"),i.cdata="",i.state=E.TEXT):"]"===s?i.cdata+="]":(i.cdata+="]]"+s,i.state=E.CDATA);continue;case E.PROC_INST:"?"===s?i.state=E.PROC_INST_ENDING:m(s)?i.state=E.PROC_INST_BODY:i.procInstName+=s;continue;case E.PROC_INST_BODY:if(!i.procInstBody&&m(s))continue;"?"===s?i.state=E.PROC_INST_ENDING:i.procInstBody+=s;continue;case E.PROC_INST_ENDING:">"===s?(A(i,"onprocessinginstruction",{name:i.procInstName,body:i.procInstBody}),i.procInstName=i.procInstBody="",i.state=E.TEXT):(i.procInstBody+="?"+s,i.state=E.PROC_INST_BODY);continue;case E.OPEN_TAG:v(d,s)?i.tagName+=s:(R(i),">"===s?B(i):"/"===s?i.state=E.OPEN_TAG_SLASH:(m(s)||I(i,"Invalid character in tag name"),i.state=E.ATTRIB));continue;case E.OPEN_TAG_SLASH:">"===s?(B(i,!0),k(i)):(I(i,"Forward-slash in opening tag not followed by >"),i.state=E.ATTRIB);continue;case E.ATTRIB:if(m(s))continue;">"===s?B(i):"/"===s?i.state=E.OPEN_TAG_SLASH:v(l,s)?(i.attribName=s,i.attribValue="",i.state=E.ATTRIB_NAME):I(i,"Invalid attribute name");continue;case E.ATTRIB_NAME:"="===s?i.state=E.ATTRIB_VALUE:">"===s?(I(i,"Attribute without value"),i.attribValue=i.attribName,L(i),B(i)):m(s)?i.state=E.ATTRIB_NAME_SAW_WHITE:v(d,s)?i.attribName+=s:I(i,"Invalid attribute name");continue;case E.ATTRIB_NAME_SAW_WHITE:if("="===s)i.state=E.ATTRIB_VALUE;else{if(m(s))continue;I(i,"Attribute without value"),i.tag.attributes[i.attribName]="",i.attribValue="",A(i,"onattribute",{name:i.attribName,value:""}),i.attribName="",">"===s?B(i):v(l,s)?(i.attribName=s,i.state=E.ATTRIB_NAME):(I(i,"Invalid attribute name"),i.state=E.ATTRIB)}continue;case E.ATTRIB_VALUE:if(m(s))continue;g(s)?(i.q=s,i.state=E.ATTRIB_VALUE_QUOTED):(i.opt.unquotedAttributeValues||M(i,"Unquoted attribute value"),i.state=E.ATTRIB_VALUE_UNQUOTED,i.attribValue=s);continue;case E.ATTRIB_VALUE_QUOTED:if(s!==i.q){"&"===s?i.state=E.ATTRIB_VALUE_ENTITY_Q:i.attribValue+=s;continue}L(i),i.q="",i.state=E.ATTRIB_VALUE_CLOSED;continue;case E.ATTRIB_VALUE_CLOSED:m(s)?i.state=E.ATTRIB:">"===s?B(i):"/"===s?i.state=E.OPEN_TAG_SLASH:v(l,s)?(I(i,"No whitespace between attributes"),i.attribName=s,i.attribValue="",i.state=E.ATTRIB_NAME):I(i,"Invalid attribute name");continue;case E.ATTRIB_VALUE_UNQUOTED:if(!y(s)){"&"===s?i.state=E.ATTRIB_VALUE_ENTITY_U:i.attribValue+=s;continue}L(i),">"===s?B(i):i.state=E.ATTRIB;continue;case E.CLOSE_TAG:if(i.tagName)">"===s?k(i):v(d,s)?i.tagName+=s:i.script?(i.script+="</"+i.tagName,i.tagName="",i.state=E.SCRIPT):(m(s)||I(i,"Invalid tagname in closing tag"),i.state=E.CLOSE_TAG_SAW_WHITE);else{if(m(s))continue;x(l,s)?i.script?(i.script+="</"+s,i.state=E.SCRIPT):I(i,"Invalid tagname in closing tag."):i.tagName=s}continue;case E.CLOSE_TAG_SAW_WHITE:if(m(s))continue;">"===s?k(i):I(i,"Invalid characters in closing tag");continue;case E.TEXT_ENTITY:case E.ATTRIB_VALUE_ENTITY_Q:case E.ATTRIB_VALUE_ENTITY_U:var c,_;switch(i.state){case E.TEXT_ENTITY:c=E.TEXT,_="textNode";break;case E.ATTRIB_VALUE_ENTITY_Q:c=E.ATTRIB_VALUE_QUOTED,_="attribValue";break;case E.ATTRIB_VALUE_ENTITY_U:c=E.ATTRIB_VALUE_UNQUOTED,_="attribValue"}if(";"===s){var b=P(i);i.opt.unparsedEntities&&!Object.values(t.XML_ENTITIES).includes(b)?(i.entity="",i.state=c,i.write(b)):(i[_]+=b,i.entity="",i.state=c)}else v(i.entity.length?f:p,s)?i.entity+=s:(I(i,"Invalid character in entity name"),i[_]+="&"+i.entity+s,i.entity="",i.state=c);continue;default:throw new Error(i,"Unknown state: "+i.state)}return i.position>=i.bufferCheckPosition&&function(e){for(var i=Math.max(t.MAX_BUFFER_LENGTH,10),n=0,s=0,a=r.length;s<a;s++){var o=e[r[s]].length;if(o>i)switch(r[s]){case"textNode":N(e);break;case"cdata":A(e,"oncdata",e.cdata),e.cdata="";break;case"script":A(e,"onscript",e.script),e.script="";break;default:M(e,"Max buffer length exceeded: "+r[s])}n=Math.max(n,o)}var h=t.MAX_BUFFER_LENGTH-n;e.bufferCheckPosition=h+e.position}(i),i}
|
|
11
|
-
/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var t;N(t=this),""!==t.cdata&&(A(t,"oncdata",t.cdata),t.cdata=""),""!==t.script&&(A(t,"onscript",t.script),t.script="")}};try{e=xo.Stream}catch(t){e=function(){}}e||(e=function(){});var n=t.EVENTS.filter((function(t){return"error"!==t&&"end"!==t}));function s(t,r){if(!(this instanceof s))return new s(t,r);e.apply(this),this._parser=new i(t,r),this.writable=!0,this.readable=!0;var a=this;this._parser.onend=function(){a.emit("end")},this._parser.onerror=function(t){a.emit("error",t),a._parser.error=null},this._decoder=null,n.forEach((function(t){Object.defineProperty(a,"on"+t,{get:function(){return a._parser["on"+t]},set:function(e){if(!e)return a.removeAllListeners(t),a._parser["on"+t]=e,e;a.on(t,e)},enumerable:!0,configurable:!1})}))}s.prototype=Object.create(e.prototype,{constructor:{value:s}}),s.prototype.write=function(t){if("function"==typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(t)){if(!this._decoder){var e=Ao().StringDecoder;this._decoder=new e("utf8")}t=this._decoder.write(t)}return this._parser.write(t.toString()),this.emit("data",t),!0},s.prototype.end=function(t){return t&&t.length&&this.write(t),this._parser.end(),!0},s.prototype.on=function(t,r){var i=this;return i._parser["on"+t]||-1===n.indexOf(t)||(i._parser["on"+t]=function(){var e=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);e.splice(0,0,t),i.emit.apply(i,e)}),e.prototype.on.call(i,t,r)};var a="[CDATA[",o="DOCTYPE",h="http://www.w3.org/XML/1998/namespace",u="http://www.w3.org/2000/xmlns/",c={xml:h,xmlns:u},l=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,d=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,p=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,f=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function m(t){return" "===t||"\n"===t||"\r"===t||"\t"===t}function g(t){return'"'===t||"'"===t}function y(t){return">"===t||m(t)}function v(t,e){return t.test(e)}function x(t,e){return!v(t,e)}var _,b,w,E=0;for(var T in t.STATE={BEGIN:E++,BEGIN_WHITESPACE:E++,TEXT:E++,TEXT_ENTITY:E++,OPEN_WAKA:E++,SGML_DECL:E++,SGML_DECL_QUOTED:E++,DOCTYPE:E++,DOCTYPE_QUOTED:E++,DOCTYPE_DTD:E++,DOCTYPE_DTD_QUOTED:E++,COMMENT_STARTING:E++,COMMENT:E++,COMMENT_ENDING:E++,COMMENT_ENDED:E++,CDATA:E++,CDATA_ENDING:E++,CDATA_ENDING_2:E++,PROC_INST:E++,PROC_INST_BODY:E++,PROC_INST_ENDING:E++,OPEN_TAG:E++,OPEN_TAG_SLASH:E++,ATTRIB:E++,ATTRIB_NAME:E++,ATTRIB_NAME_SAW_WHITE:E++,ATTRIB_VALUE:E++,ATTRIB_VALUE_QUOTED:E++,ATTRIB_VALUE_CLOSED:E++,ATTRIB_VALUE_UNQUOTED:E++,ATTRIB_VALUE_ENTITY_Q:E++,ATTRIB_VALUE_ENTITY_U:E++,CLOSE_TAG:E++,CLOSE_TAG_SAW_WHITE:E++,SCRIPT:E++,SCRIPT_ENDING:E++},t.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},t.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(t.ENTITIES).forEach((function(e){var r=t.ENTITIES[e],i="number"==typeof r?String.fromCharCode(r):r;t.ENTITIES[e]=i})),t.STATE)t.STATE[t.STATE[T]]=T;function S(t,e,r){t[e]&&t[e](r)}function A(t,e,r){t.textNode&&N(t),S(t,e,r)}function N(t){t.textNode=C(t.opt,t.textNode),t.textNode&&S(t,"ontext",t.textNode),t.textNode=""}function C(t,e){return t.trim&&(e=e.trim()),t.normalize&&(e=e.replace(/\s+/g," ")),e}function M(t,e){return N(t),t.trackPosition&&(e+="\nLine: "+t.line+"\nColumn: "+t.column+"\nChar: "+t.c),e=new Error(e),t.error=e,S(t,"onerror",e),t}function O(t){return t.sawRoot&&!t.closedRoot&&I(t,"Unclosed root tag"),t.state!==E.BEGIN&&t.state!==E.BEGIN_WHITESPACE&&t.state!==E.TEXT&&M(t,"Unexpected end"),N(t),t.c="",t.closed=!0,S(t,"onend"),i.call(t,t.strict,t.opt),t}function I(t,e){if("object"!=typeof t||!(t instanceof i))throw new Error("bad call to strictFail");t.strict&&M(t,e)}function R(t){t.strict||(t.tagName=t.tagName[t.looseCase]());var e=t.tags[t.tags.length-1]||t,r=t.tag={name:t.tagName,attributes:{}};t.opt.xmlns&&(r.ns=e.ns),t.attribList.length=0,A(t,"onopentagstart",r)}function D(t,e){var r=t.indexOf(":")<0?["",t]:t.split(":"),i=r[0],n=r[1];return e&&"xmlns"===t&&(i="xmlns",n=""),{prefix:i,local:n}}function L(t){if(t.strict||(t.attribName=t.attribName[t.looseCase]()),-1!==t.attribList.indexOf(t.attribName)||t.tag.attributes.hasOwnProperty(t.attribName))t.attribName=t.attribValue="";else{if(t.opt.xmlns){var e=D(t.attribName,!0),r=e.prefix,i=e.local;if("xmlns"===r)if("xml"===i&&t.attribValue!==h)I(t,"xml: prefix must be bound to "+h+"\nActual: "+t.attribValue);else if("xmlns"===i&&t.attribValue!==u)I(t,"xmlns: prefix must be bound to "+u+"\nActual: "+t.attribValue);else{var n=t.tag,s=t.tags[t.tags.length-1]||t;n.ns===s.ns&&(n.ns=Object.create(s.ns)),n.ns[i]=t.attribValue}t.attribList.push([t.attribName,t.attribValue])}else t.tag.attributes[t.attribName]=t.attribValue,A(t,"onattribute",{name:t.attribName,value:t.attribValue});t.attribName=t.attribValue=""}}function B(t,e){if(t.opt.xmlns){var r=t.tag,i=D(t.tagName);r.prefix=i.prefix,r.local=i.local,r.uri=r.ns[i.prefix]||"",r.prefix&&!r.uri&&(I(t,"Unbound namespace prefix: "+JSON.stringify(t.tagName)),r.uri=i.prefix);var n=t.tags[t.tags.length-1]||t;r.ns&&n.ns!==r.ns&&Object.keys(r.ns).forEach((function(e){A(t,"onopennamespace",{prefix:e,uri:r.ns[e]})}));for(var s=0,a=t.attribList.length;s<a;s++){var o=t.attribList[s],h=o[0],u=o[1],c=D(h,!0),l=c.prefix,d=c.local,p=""===l?"":r.ns[l]||"",f={name:h,value:u,prefix:l,local:d,uri:p};l&&"xmlns"!==l&&!p&&(I(t,"Unbound namespace prefix: "+JSON.stringify(l)),f.uri=l),t.tag.attributes[h]=f,A(t,"onattribute",f)}t.attribList.length=0}t.tag.isSelfClosing=!!e,t.sawRoot=!0,t.tags.push(t.tag),A(t,"onopentag",t.tag),e||(t.noscript||"script"!==t.tagName.toLowerCase()?t.state=E.TEXT:t.state=E.SCRIPT,t.tag=null,t.tagName=""),t.attribName=t.attribValue="",t.attribList.length=0}function k(t){if(!t.tagName)return I(t,"Weird empty close tag."),t.textNode+="</>",void(t.state=E.TEXT);if(t.script){if("script"!==t.tagName)return t.script+="</"+t.tagName+">",t.tagName="",void(t.state=E.SCRIPT);A(t,"onscript",t.script),t.script=""}var e=t.tags.length,r=t.tagName;t.strict||(r=r[t.looseCase]());for(var i=r;e--&&t.tags[e].name!==i;)I(t,"Unexpected close tag");if(e<0)return I(t,"Unmatched closing tag: "+t.tagName),t.textNode+="</"+t.tagName+">",void(t.state=E.TEXT);t.tagName=r;for(var n=t.tags.length;n-- >e;){var s=t.tag=t.tags.pop();t.tagName=t.tag.name,A(t,"onclosetag",t.tagName);var a={};for(var o in s.ns)a[o]=s.ns[o];var h=t.tags[t.tags.length-1]||t;t.opt.xmlns&&s.ns!==h.ns&&Object.keys(s.ns).forEach((function(e){var r=s.ns[e];A(t,"onclosenamespace",{prefix:e,uri:r})}))}0===e&&(t.closedRoot=!0),t.tagName=t.attribValue=t.attribName="",t.attribList.length=0,t.state=E.TEXT}function P(t){var e,r=t.entity,i=r.toLowerCase(),n="";return t.ENTITIES[r]?t.ENTITIES[r]:t.ENTITIES[i]?t.ENTITIES[i]:("#"===(r=i).charAt(0)&&("x"===r.charAt(1)?(r=r.slice(2),n=(e=parseInt(r,16)).toString(16)):(r=r.slice(1),n=(e=parseInt(r,10)).toString(10))),r=r.replace(/^0+/,""),isNaN(e)||n.toLowerCase()!==r?(I(t,"Invalid character entity"),"&"+t.entity+";"):String.fromCodePoint(e))}function U(t,e){"<"===e?(t.state=E.OPEN_WAKA,t.startTagPosition=t.position):m(e)||(I(t,"Non-whitespace before first tag."),t.textNode=e,t.state=E.TEXT)}function V(t,e){var r="";return e<t.length&&(r=t.charAt(e)),r}E=t.STATE,String.fromCodePoint||(_=String.fromCharCode,b=Math.floor,w=function(){var t,e,r=[],i=-1,n=arguments.length;if(!n)return"";for(var s="";++i<n;){var a=Number(arguments[i]);if(!isFinite(a)||a<0||a>1114111||b(a)!==a)throw RangeError("Invalid code point: "+a);a<=65535?r.push(a):(t=55296+((a-=65536)>>10),e=a%1024+56320,r.push(t,e)),(i+1===n||r.length>16384)&&(s+=_.apply(null,r),r.length=0)}return s},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:w,configurable:!0,writable:!0}):String.fromCodePoint=w)}(t)}(vo),vo.SAXParser.MAX_BUFFER_LENGTH=134217728;const No=class t extends Se{constructor(){super(),f(this,"parser"),f(this,"pathData",[]),f(this,"_onOpenTagHandler",this.handleOnOpenTag.bind(this)),f(this,"_onCloseTagHandler",this.handleOnCloseTag.bind(this)),f(this,"currentNodeStack",[]),f(this,"rootNode",null),f(this,"_onTextHandler",this.handleOnText.bind(this)),f(this,"leftover",""),this.parser=new vo.SAXParser(!0),this.parser.onopentag=this._onOpenTagHandler,this.parser.onclosetag=this._onCloseTagHandler,this.parser.ontext=this._onTextHandler}static get instance(){return t._instance||(this._instance=new t),this._instance}handleOnOpenTag(t){const e={tagName:t.name,nodeName:t.name,attributes:t.attributes,parentNode:this.currentNodeStack.length>0?this.currentNodeStack[this.currentNodeStack.length-1]:null,childNodes:[]};"svg"!==t.name.toLowerCase()||this.rootNode||(this.rootNode=e),e.parentNode&&e.parentNode.childNodes.push(e),this.currentNodeStack.push(e)}handleOnCloseTag(t){this.currentNodeStack.length>0&&this.currentNodeStack[this.currentNodeStack.length-1].tagName===t&&this.currentNodeStack.pop()}handleOnText(t){if(this.currentNodeStack.length>0){const e=this.currentNodeStack[this.currentNodeStack.length-1];e.textContent=(e.textContent||"")+t.trim()}}loadAsync(t){return g(this,null,(function*(){return this.currentNodeStack=[],this.rootNode=null,new Promise(((e,r)=>{fetch(t).then((t=>{if(!t.body)throw new Error("error reading body");const i=t.body.getReader(),n=()=>g(this,null,(function*(){var t;try{const{done:r,value:s}=yield i.read();if(r)return this.leftover&&this.parser.write(this.leftover),this.parser.close(),void e(this.rootNode);const a=function(t){const e=Math.max(t.lastIndexOf('"'),t.lastIndexOf("'"),t.lastIndexOf(" "),t.lastIndexOf(">"));return{processed:e>=0?t.slice(0,e+1):"",remaining:e>=0?t.slice(e+1):t}}(this.leftover+(new TextDecoder).decode(s));try{this.parser.write(a.processed)}catch(e){(null==(t=e.message)?void 0:t.includes("Max buffer length exceeded"))&&this.parser.resume()}this.leftover=a.remaining,n()}catch(t){r(t)}}));n()})).catch(r)}))}))}};f(No,"_instance");let Co=No;class Mo extends Se{constructor(t={}){super(),f(this,"name","Adapter@"+Ee()),f(this,"params"),f(this,"boundingBox",new Le),f(this,"offset",new Oe),f(this,"requestHeader",{}),f(this,"resources",{}),f(this,"_resourcesMap",{}),f(this,"_resourcesTree",[]),f(this,"_svg"),f(this,"_svgRoot"),f(this,"_viewBox",new Le),f(this,"_elementsMap",{}),f(this,"_svgHelper",Kn.instance),f(this,"dynamicLoadedHandler",this.handleDynamicLoaded.bind(this)),f(this,"initializationCompleteHandler",this.handleInitializationComplete.bind(this)),this.params=t}destroy(){super.destroy()}clear(){this._svg=void 0,this._svgRoot=void 0,this._viewBox.makeEmpty(),this._elementsMap={},this._resourcesMap={}}setRequestHeader(t){return this.requestHeader=t,this}load(t,e){return g(this,null,(function*(){if(!t)throw"url not found";this.dispatchEvent({type:r.INITIALIZATION_START});let e=yield(new lo).setRequestHeader(this.requestHeader).loadAsync(t);this.clear(),yield this.init(e)}))}init(t){return g(this,null,(function*(){if(!t)throw"input nothing";this.bindSvgHelperEvents();const e=(new be.window.DOMParser).parseFromString(t,"image/svg+xml").documentElement;if(!e)throw new Error("svg load failed");let r=ji(e,"viewBox",null);if(!r)return;Bi(r,this._viewBox),this._viewBox.flipY(),this._svg=ki(e),yield Kn.init(this._svg).initResourcesSlice(),this._elementsMap=this._svgHelper.getElementsMap(),this._resourcesMap=this._svgHelper.getResourcesMap(),this.boundingBox.copy(this._svgHelper.getBoundingBox()),this.offset.copy(this._svgHelper.getOffset());const i=this.getElementById("mirror");i&&(this._svgRoot=i,this.initResourcesTree())}))}loadBySax(t,e){return g(this,null,(function*(){if(!t)throw"url not found";this.dispatchEvent({type:r.INITIALIZATION_START}),this.clear(),this.bindSvgHelperEvents();const e=yield Co.instance.loadAsync(t);if(!e)throw new Error("svg load failed");let i=ji(e,"viewBox",null);if(!i)return;Bi(i,this._viewBox),this._viewBox.flipY(),this._svg=ki(e),yield Kn.init(this._svg).initResourcesSlice(),this._elementsMap=this._svgHelper.getElementsMap(),this._resourcesMap=this._svgHelper.getResourcesMap(),this.boundingBox.copy(this._svgHelper.getBoundingBox()),this.offset.copy(this._svgHelper.getOffset());const n=this.getElementById("mirror");n&&(this._svgRoot=n,this.initResourcesTree())}))}bindSvgHelperEvents(){this.unbindSvgHelperEvents(),this._svgHelper.addEventListener(r.DYNAMIC_LOADED,this.dynamicLoadedHandler),this._svgHelper.addEventListener(r.INITIALIZATION_COMPLETE,this.initializationCompleteHandler)}unbindSvgHelperEvents(){this._svgHelper.removeEventListener(r.DYNAMIC_LOADED,this.dynamicLoadedHandler),this._svgHelper.removeEventListener(r.INITIALIZATION_COMPLETE,this.initializationCompleteHandler)}handleDynamicLoaded(t){var e,r;(null==(e=null==t?void 0:t.data)?void 0:e.o)&&"symbol"!==(null==(r=t.data.o.userData)?void 0:r.nodeName)&&this.dispatchEvent(t)}handleInitializationComplete(t){this.dispatchEvent(t)}initResourcesTree(){if(!this._svgRoot)throw"resources not found";this._resourcesTree=qi(this._svgRoot),Hi(this._resourcesTree,(t=>t.value=this._resourcesMap[t.label]))}getResources(){var t;if(!this._resourcesMap)return;const e=De.values(this._resourcesMap);for(let r=((null==e?void 0:e.length)||0)-1;r>=0;r--)"symbol"===(null==(t=e[r].userData)?void 0:t.nodeName)&&e.splice(r,1);return e}getLayers(t=2){return this._svg?qi(this._svg,t):[]}getElementById(t){if(t&&this._elementsMap)return this._elementsMap[t]}getSymbolElement(t){if(!t)return;const e=zi(t),r=this.getElementById(e);return r||void 0}getAssetLabelId(t){return t+Oo+Io}getViewBox(){return this._viewBox}getResourceById(t){if(t)return this._resourcesMap[t]}getResourceTreeById(t,e){var r;if(e)if(Array.isArray(t))for(let r=0,i=t.length;r<i;r++){const i=this.getResourceTreeById(t[r],e);if(i)return i}else{if(t.label===e)return t;if(!(null==(r=t.children)?void 0:r.length))return;for(let r=0,i=t.children.length;r<i;r++){const i=this.getResourceTreeById(t.children[r],e);if(i)return i}}}updateLayersVisibility(t,e=!1){if(!this._resourcesMap)throw new Error("please generate renderObjects first");if(t&&(Array.isArray(t)||(t=[t]),null==t?void 0:t.length)){this._updateAllLayersVisibility(!e);for(let r=0,i=t.length;r<i;r++){const i=this.getResourceTreeById(this._resourcesTree,t[r]);i&&this._updateLayersVisibility(i,e)}}}_updateAllLayersVisibility(t=!1){if(!this._resourcesMap)throw new Error("resources is not defined");const e=De.values(this._resourcesMap);for(let r=0,i=e.length;r<i;r++)e[r].visible=t}_updateLayersVisibility(t,e=!1){var r;if(t.value&&(t.value.visible=e),null==(r=t.children)?void 0:r.length)for(let r=0,i=t.children.length;r<i;r++)this._updateLayersVisibility(t.children[r],e)}getBoundingBoxByIds(t,e=new Le){e.makeEmpty(),Array.isArray(t)||(t=[t]);for(let r=0,i=t.length;r<i;r++){const i=this._resourcesMap[t[r]];i&&e.expandByBox(i.boundingBox)}return e}}const Oo="-",Io="label";class Ro{constructor(){f(this,"camera"),f(this,"screenCoords",new Oe),f(this,"worldCoords",new Oe),f(this,"params",{Shape:{},Line:{threshold:1},Points:{threshold:1},Sprite:{}})}setFromCamera(t,e){return this.camera=e,this.screenCoords.set(t.x,t.y),this.worldCoords.copy(this.screenCoords).unproject(e),this}intersectObjects(t,e=!0,r=[]){for(let i=0,n=t.length;i<n;i++)this.intersectObject(t[i],e,r)}intersectObject(t,e=!1,r=[]){if(!t.selectable)return r;if(t.raycast(this,r),!e||t.composeNode)return r;for(let i=0,n=t.children.length;i<n;i++)this.intersectObject(t.children[i],e,r);return r}}class Do extends fr{constructor(t={}){super(),f(this,"name","AnimateScene"),f(this,"params"),f(this,"resourcesMap",{}),f(this,"dynamicFill",xr),f(this,"dynamicScale",new Oe(1,1)),this.params=t}destroy(){super.destroy()}add(t){return super.add(t),t.userData.id?(this.resourcesMap[t.userData.id]=t,this):this}getByIds(t){const e=[];Array.isArray(t)||(t=[t]);for(let r=t.length-1;r>=0;r--)Object.hasOwnProperty.call(this.resourcesMap,t[r])&&e.push(this.resourcesMap[t[r]]);return e}onBeforeRender(){}}class Lo extends qa{constructor(t,e,r=!0,i=!1){super(),f(this,"name","DebouncePass"),f(this,"scene"),f(this,"camera"),f(this,"fsQuad",new Ha),f(this,"debounceQuad",new Ha),f(this,"cacheQuad",new Ha),f(this,"version",-1),f(this,"debounceRenderHandler",De.debounce(this.debounceRender.bind(this),300)),this.scene=t,this.camera=e,this.clear=r,this.needsSwap=i}destroy(){super.destroy()}get currentVersion(){var t;return this.scene.version+((null==(t=this.camera)?void 0:t.version)||0)}get isChanged(){return this.version!==this.currentVersion}get isDebounceChanged(){return this.debounceQuad.version!==this.currentVersion}render(t,e,r){const i=t.autoClear;t.autoClear=!1,this.isChanged?(this.renderCache(this.debounceQuad,this.cacheQuad),this.finalRender(this.cacheQuad,t,e,r),this.debounceRenderHandler(t,e,r)):this.isDebounceChanged&&be.config.sliceRendering&&t.renderSliceComplete?(this.saveCache(this.fsQuad,this.debounceQuad),t.renderSliceComplete=!1,this.finalRender(this.fsQuad,t,e,r)):(this.renderCache(this.debounceQuad,this.cacheQuad),this.finalRender(this.cacheQuad,t,e,r)),this.version=this.currentVersion,t.autoClear=i}saveCache(t,e){var r;this.isDebounceChanged&&(e.renderTarget.ctx.clearRect(0,0,be.config.width,be.config.height),e.renderTarget.ctx.drawImage(t.renderTarget.cvs,0,0),null==(r=this.camera)||r.updateMatrixWorld(),e.texture.matrix.copy(t.texture.matrix),e.version=this.currentVersion)}renderCache(t,e){var r;null==(r=this.camera)||r.updateMatrixWorld(),ko.copy(t.texture.matrix).invert().premultiply(this.camera.viewMatrix).getComponents(Po),Bo.set(be.config.width,be.config.height),e.renderTarget.ctx.clearRect(0,0,be.config.width,be.config.height),e.renderTarget.ctx.save(),e.renderTarget.ctx.transform(...Po),e.renderTarget.ctx.drawImage(t.renderTarget.cvs,0,0,Bo.x,Bo.y),e.renderTarget.ctx.restore()}finalRender(t,e,r,i){e.setRenderTarget(this.renderToScreen?void 0:i),this.clear&&e.clean(),e.renderTexture(t.renderTarget.texture,this.camera)}debounceRender(t,e,r){t.setRenderTarget(this.renderToScreen?void 0:this.fsQuad.renderTarget),t.clean(),t.render(this.scene,this.camera),this.fsQuad.texture.matrix.copy(this.camera.viewMatrix)}}const Bo=new Oe,ko=new Ve,Po=[1,0,0,1,0,0];class Uo extends qa{constructor(){super(),f(this,"name","OutputPass"),f(this,"texture"),f(this,"fsQuad"),this.fsQuad=new Ha,this.texture=this.fsQuad.texture,this.clear=!0}destroy(){super.destroy(),this.fsQuad.destroy()}render(t,e,r){const i=t.autoClear;t.autoClear=!1,this.fsQuad.texture.image=r.cvs,t.setRenderTarget(this.renderToScreen?void 0:e),this.clear&&t.clean(),this.fsQuad.render(t),r.clean(),t.autoClear=i}}class Vo{constructor(){f(this,"name","EffectDirector"),f(this,"clock",new Hs),f(this,"oriScene"),f(this,"desScene"),f(this,"mixer"),this.mixer=new qs}destroy(){}bind(t,e){var r;this.oriScene=t,this.desScene=e,this.desScene&&(null==(r=this.mixer)||r.bind(this.desScene))}getBoundingBoxByIds(t,e=new Le){if(e.makeEmpty(),!this.oriScene||!t)return e;Array.isArray(t)||(t=[t]);for(let r=0,i=t.length;r<i;r++){const i=this.oriScene.getObjectByProperty("name",t[r]);i&&e.expandByBox(i.boundingBoxWorld)}return e}update(){var t;null==(t=this.mixer)||t.update(this.clock.getDelta())}}class Fo extends Vo{constructor(t={}){super(),f(this,"name","EffectDirector"),f(this,"params"),f(this,"_selectedClip"),f(this,"selectedAction"),f(this,"_selectedIds",[]),this.params=t;const e=new ms(".dynamicFill",[0,1.2,2],[.95,.38,.38,.5,.95,.68,.68,.5,.95,.38,.38,.5]);this._selectedClip=new _s("selected",3,[e])}destroy(){}bind(t,e){var r;super.bind(t,e),this.selectedAction=null==(r=this.mixer)?void 0:r.clipAction(this._selectedClip,this.desScene)}hasSelected(t){var e;return!!(null==(e=this.desScene)?void 0:e.getObjectByProperty("name",t))}clearSelected(t){if(this.desScene)if(t&&t.length){Array.isArray(t)||(t=[t]);for(let e=0,r=t.length;e<r;e++){const r=this.desScene.getObjectByProperty("name",t[e]);null==r||r.destroy();const i=this._selectedIds.indexOf(t[e]);i>-1&&this._selectedIds.splice(i,1)}}else{for(let t=0,e=this._selectedIds.length;t<e;t++){const e=this.desScene.getObjectByProperty("name",this._selectedIds[t]);null==e||e.destroy()}this._selectedIds.length=0}}selectByIds(t,e){var r,i;if(this.oriScene&&this.desScene){if(Array.isArray(t)||(t=[t]),null==(r=this.selectedAction)||r.stop(),this.params.selectEnable&&1===(null==t?void 0:t.length)&&!this.hasSelected(t[0]))this.clearSelected();else if(this.params.selectEnable){const e=t.shift();(null==t?void 0:t.length)&&this.clearSelected(),e&&(t=[e])}else if(this.params.multiSelectEnable){const e=t.shift();e&&(t=[e])}this.toggleSelectByIds(t,e),null==(i=this.selectedAction)||i.play()}}toggleSelectByIds(t,e){if(this.oriScene&&this.desScene){Array.isArray(t)||(t=[t]);for(let r=0,i=t.length;r<i;r++){if(this.hasSelected(t[r])){e&&this.clearSelected(t[r]);continue}const i=this.oriScene.getObjectByProperty("name",t[r]);if(!i)continue;i.moveToLast();const n=i.clone(!0,!0);n.userData.actType="SELECT",n.isGroup?n.traverse((t=>(null==t?void 0:t.mat)?t.mat.lineWidth*=5:void 0)):n.mat.lineWidth=5*(n.mat.lineWidth||1),this.desScene.add(n),this._selectedIds.push(t[r])}}}multiSelectByRange(t,e){var r,i,n,s,a;qo.copy(t);const o=null==(r=this.oriScene)?void 0:r.getByRange(t,!0);if(!o)return;null==(i=this.selectedAction)||i.stop();const h=[];for(let t=0,e=(null==o?void 0:o.length)||0;t<e;t++)(null==(s=null==(n=o[t])?void 0:n.userData)?void 0:s.assetType)===this.params.assetType&&h.push(o[t]);const u=De.map(h,"name");this.toggleSelectByIds(u,e),null==(a=this.selectedAction)||a.play()}update(){var t,e,r;if(super.update(),null==(e=null==(t=this.desScene)?void 0:t.children)?void 0:e.length)for(let t=0,e=this.desScene.children.length;t<e;t++)this.updateGlobalSelectAnimate(null==(r=this.desScene)?void 0:r.children[t])}updateGlobalSelectAnimate(t){var e;this.desScene&&"SELECT"===(null==(e=null==t?void 0:t.userData)?void 0:e.actType)&&(t.isGroup?t.traverse((t=>t.mat?t.mat.stroke=t.mat.fill=this.desScene.dynamicFill:void 0)):t.isShape&&(t.mat.stroke=t.mat.fill=this.desScene.dynamicFill))}}const qo=new Le;class Ho{noise(t,e,r=0){const i=Math.floor(t),n=Math.floor(e),s=Math.floor(r),a=255&i,o=255&n,h=255&s,u=(t-=i)-1,c=(e-=n)-1,l=(r-=s)-1,d=jo(t),p=jo(e),f=jo(r),m=zo[a]+o,g=zo[m]+h,y=zo[m+1]+h,v=zo[a+1]+o,x=zo[v]+h,_=zo[v+1]+h;return Wo(f,Wo(p,Wo(d,Yo(zo[g],t,e,r),Yo(zo[x],u,e,r)),Wo(d,Yo(zo[y],t,c,r),Yo(zo[_],u,c,r))),Wo(p,Wo(d,Yo(zo[g+1],t,e,l),Yo(zo[x+1],u,e,l)),Wo(d,Yo(zo[y+1],t,c,l),Yo(zo[_+1],u,c,l))))}}const zo=[151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180];for(let t=0;t<256;t++)zo[256+t]=zo[t];function jo(t){return t*t*t*(t*(6*t-15)+10)}function Wo(t,e,r){return e+t*(r-e)}function Yo(t,e,r,i){const n=15&t,s=n<8?e:r,a=n<4?r:12==n||14==n?e:i;return(1&n?-s:s)+(2&n?-a:a)}class Go extends qa{constructor(t){super(),f(this,"name","PaperPass"),f(this,"fsQuad"),f(this,"ctx"),f(this,"camera"),f(this,"version",0),this.camera=t,this.fsQuad=new Ha,this.ctx=Zi.getContext2D(this.fsQuad.texture.image,{alpha:!0}),this.needsSwap=!1,function(t){const e=new Ho,r=t.createImageData(be.config.width,be.config.height),i=r.data,n=2.5;for(let t=0;t<be.config.height;t++)for(let r=0;r<be.config.width;r++){const s=e.noise(r/n,t/n,0),a=Math.floor(128*(s+1)),o=4*(t*be.config.width+r);i[o]=a,i[o+1]=a,i[o+2]=a,i[o+3]=16}t.putImageData(r,0,0)}(this.ctx)}destroy(){super.destroy(),this.fsQuad.destroy()}get currentVersion(){var t;return(null==(t=this.camera)?void 0:t.version)||0}render(t,e,r){const i=t.autoClear;t.autoClear=!1,this.currentVersion!==this.version&&(this.version=this.currentVersion),t.setRenderTarget(this.renderToScreen?void 0:r),t.renderTexture(this.fsQuad.texture),t.autoClear=i}}class Xo extends Wa{constructor(t={}){super(t),f(this,"adapter"),f(this,"dynamicLoadedHandler",this.handleDynamicLoaded.bind(this)),f(this,"initializationCompleteHandler",this.handleInitializationComplete.bind(this)),f(this,"mainScene"),f(this,"animateScene"),f(this,"director"),f(this,"requestHeader",{}),f(this,"_url"),f(this,"_layers"),f(this,"_tic"),f(this,"_t",performance.now()-1),f(this,"rayCaster",new Ro),f(this,"intersects",[]),f(this,"_cameraChangedHandler",this.handleCameraChanged.bind(this)),void 0===this.params.sliceRendering&&(this.params.sliceRendering=!0),void 0===this.params.debounceCache&&(this.params.debounceCache=!0),this.adapter=new Mo(t),this.mainScene=new ro(t),this.animateScene=new Do(t),this.director=new Fo(t),this.bindEvents()}destroy(){this.unbindEvents(),this._tic&&this._tic.clear(),super.destroy(),this.mainScene.destroy()}bindEvents(){var t,e;null==(e=null==(t=this.view)?void 0:t.camera)||e.addEventListener($s.UPDATE,this._cameraChangedHandler)}unbindEvents(){var t,e;null==(e=null==(t=this.view)?void 0:t.camera)||e.removeEventListener($s.UPDATE,this._cameraChangedHandler)}handleCameraChanged(){be.window.postMessage({task:r.CAMERA_SYNC,data:JSON.stringify(this.view.camera)})}setRequestHeader(t){return this.requestHeader=t,this}trans2LoadingScene(){return g(this,null,(function*(){yield m(Xo.prototype,this,"trans2LoadingScene").call(this),this.mainScene=new ro(this.params)}))}load(t,e){return g(this,null,(function*(){var r;if(this._tic&&this._tic.clear(),this._url=t,this._layers=e,this.isLoadingScene||(yield this.trans2LoadingScene()),!t)throw"url not found";1===(null==(r=this.params)?void 0:r.svgLoadingType)?yield this.adapter.setRequestHeader(this.requestHeader).load(t,e):yield this.adapter.loadBySax(t,e);const i=this.adapter.getResources();var n;this.pushResources2Scene(i),e||(e=[(n=lr.RM,n+"-"+dr.ASSETS)]),this.adapter.updateLayersVisibility(e,!0),this.trans2MainScene()}))}pushResources2Scene(t){if(null==t?void 0:t.length)if(this.params.dynamicLoading){this._tic&&this._tic.clear();let e=performance.now();this._tic=new Zn(t,(r=>{this.mainScene.add(t[r]),performance.now()-e>1e3&&(e=performance.now(),t[r].updateMatrix(),this.view.camera.needsUpdate=!0),r===t.length-1&&(this.mainScene.updateMatrix(),this.view.camera.needsUpdate=!0)}),15)}else{for(let e=0,r=t.length||0;e<r;e++){const r=t[e];if(!r)return;this.mainScene.add(r)}this.mainScene.updateMatrix()}}reload(){return g(this,null,(function*(){return this.load(this._url,this._layers)}))}assetTypeChanged(t=lr.RM){this.params.assetType=t}usedCacheChanged(t=!1){return g(this,null,(function*(){yield m(Xo.prototype,this,"usedCacheChanged").call(this,t),yield this.reload()}))}bgPassChanged(t=!1){return g(this,null,(function*(){m(Xo.prototype,this,"bgPassChanged").call(this,t),yield this.reload()}))}getLayers(t=2){return this.adapter.getLayers(t)}trans2MainScene(){this.mainScene||(this.mainScene=new ro(this.params)),this.animateScene||(this.animateScene=new Do(this.params)),this.director.bind(this.mainScene,this.animateScene),this.mainScene.setViewBox(this.adapter.getViewBox()),this.trans2Scenes(this.mainScene,this.animateScene),this.view.scene=this.mainScene,this.view.fullscreen(1);const t=new Lo(this.mainScene,this.view.camera,!1,!1),e=new za(this.animateScene,this.view.camera,!1,!1),i=new Uo;this.composer.clearPasses(),this.params.bgPass&&this.composer.addPass(new Go(this.view.camera)),this.composer.addPass(t),this.composer.addPass(e),this.composer.addPass(i),this.dispatchEvent({type:r.SCENES_CHANGED,data:{box:this.mainScene.boundingBox.toString()}})}bindAdapterEvents(){this.unbindAdapterEvents(),this.adapter.addEventListener(r.DYNAMIC_LOADED,this.dynamicLoadedHandler),this.adapter.addEventListener(r.INITIALIZATION_COMPLETE,this.initializationCompleteHandler)}unbindAdapterEvents(){this.adapter.removeEventListener(r.DYNAMIC_LOADED,this.dynamicLoadedHandler),this.adapter.removeEventListener(r.INITIALIZATION_COMPLETE,this.initializationCompleteHandler)}handleDynamicLoaded(t){var e;if(!this.mainScene||(null==t?void 0:t.type)!==r.DYNAMIC_LOADED||!(null==(e=null==t?void 0:t.data)?void 0:e.o))return;const i=t.data.o;t.data.p,i.updateMatrix(),this.mainScene.add(i),performance.now()-this._t>1e3&&(this._t=performance.now(),this.mainScene.updateMatrix(),this.mainScene.computeBoundingBox(),this.view.fullscreen(1))}handleInitializationComplete(t){(null==t?void 0:t.type)===r.INITIALIZATION_COMPLETE&&(this.mainScene.updateMatrix(),this.view.camera.needsUpdate=!0)}fullScreen(){this.view.fullscreen(1)}handleViewTap(t,e=[]){var i,n,s,a;if((null==t?void 0:t.type)!==r.TAP&&(null==t?void 0:t.task)!==r.TAP)return e;if(!this.mainScene)return e;this.intersects.length=0,this.rayCaster.setFromCamera(null==(i=t.data)?void 0:i.screenCoords,this.view.camera),this.rayCaster.intersectObject(this.mainScene,!0,this.intersects);for(let t=0,r=null==(n=this.intersects)?void 0:n.length;t<r;t++)(null==(a=null==(s=this.intersects[t])?void 0:s.userData)?void 0:a.assetType)===this.params.assetType&&e.push(this.intersects[t].userData.id);return e}updateLayersVisibility(t,e=!1){this.adapter.updateLayersVisibility(t,e),this.mainScene.needsUpdate=!0}selectByIds(t){this.director.selectByIds(t,!0)}clearSelected(t){this.director.clearSelected(t)}multiSelectByRange(t){this.director.multiSelectByRange(t,!0)}targetByIds(t){return g(this,null,(function*(){this.director.clearSelected(),this.director.selectByIds(t,!1),this.director.getBoundingBoxByIds(t,Qo),Qo.isEmpty()||(Qo.getSize(Zo),Qo.expandByScalar(Math.round(.5*Math.max(Zo.x,Zo.y))),yield this.view.resetCameraByBoundingBox(Qo,!0))}))}getAssetIdsByType(t){var e;return null==(e=this.mainScene)?void 0:e.getAssetIdsByType(t)}setFillByIds(t,e){var r;null==(r=this.mainScene)||r.setFillOrStrokeByIds(t,e,"fill")}clearFill(){var t;null==(t=this.mainScene)||t.clearFill()}setStrokeByIds(t,e){var r;null==(r=this.mainScene)||r.setFillOrStrokeByIds(t,e,"stroke")}clearStroke(){var t;null==(t=this.mainScene)||t.clearStroke()}fontZoomIn(t=1.1){var e;null==(e=this.mainScene)||e.fontZoomIn(t)}fontZoomOut(t=.9){var e;null==(e=this.mainScene)||e.fontZoomOut(t)}strokeMore(t=1.1){var e;null==(e=this.mainScene)||e.strokeMore(t)}strokeLess(t=.9){var e;null==(e=this.mainScene)||e.strokeLess(t)}running(t){super.running(t),this.director.update(),Ko(this)}}const Qo=new Le,Zo=new Oe;let $o=0;const Ko=t=>{if(Date.now()-$o<3e3)return;const e=new Map;for(const t of Mn.cached.keys()){const r=Mn.cached.get(t).clone();if(!r.image)continue;const i=Zi.get(r.uuid,r.image.width,r.image.height),n=i.getContext("2d",{alpha:!0});n&&(n.clearRect(0,0,r.image.width,r.image.height),n.drawImage(r.image,0,0),r.image=i.transferToImageBitmap(),e.set(t,r))}t.dispatchEvent({type:r.SYNC_TEXTURE_HELPER_CACHED,data:e}),$o=Date.now()};let Jo;onmessage=function(t){return g(this,null,(function*(){var e;let{task:i,data:n}=t.data;switch(i){case r.INIT:!function(t,e){const i=JSON.parse(e);i.workerRender=!0,i.offscreenCanvas=t,Jo=new Xo(i),Jo.start(),Jo.addEventListener(r.DYNAMIC_LOADED,th),Jo.addEventListener(r.SCENES_CHANGED,eh),Jo.addEventListener(r.SYNC_TEXTURE_HELPER_CACHED,rh)}(n.cvs,n.config);break;case r.LOAD:yield function(t,e){return g(this,null,(function*(){yield Jo.load(t,e),postMessage({task:r.LOAD})}))}(n.url,n.layers);break;case r.GET_LAYERS:!function(t=2){const e=Jo.getLayers(t);postMessage({task:r.GET_LAYERS,data:e})}(n.lv);break;case r.GET_ASSET_IDS_BY_TYPE:postMessage({task:r.GET_ASSET_IDS_BY_TYPE,data:Jo.getAssetIdsByType(n.assetType)});break;case r.SET_FILL_BY_IDS:Jo.setFillByIds(n.ids,n.c);break;case r.CLEAR_FILL:Jo.clearFill();break;case r.SET_STROKE_BY_IDS:Jo.setStrokeByIds(n.ids,n.c);break;case r.CLEAR_STROKE:Jo.clearStroke();break;case r.ASSET_TYPE_CHANGED:Jo.assetTypeChanged(n);break;case r.SVG_LOADING_TYPE_CHANGED:Jo.svgLoadingTypeChanged(n),postMessage({task:r.SVG_LOADING_TYPE_CHANGED});break;case r.USED_CACHE_CHANGED:Jo.usedCacheChanged(n);break;case r.DEBOUNCE_CACHE_CHANGED:Jo.params.debounceCache=!!n;break;case r.WIREFRAME_CHANGED:Jo.wireframeChanged(n);break;case r.BG_PASS_CHANGED:Jo.bgPassChanged(n);break;case r.SELECT_ENABLE_CHANGED:Jo.selectEnableChanged(n);break;case r.MULTI_SELECT_ENABLE_CHANGED:Jo.multiSelectEnableChanged(n);break;case r.MULTI_SELECT_BY_RANGE:Jo.multiSelectByRange(n);break;case r.ZOOM_TO_SELECT_ENABLE_CHANGED:Jo.zoomToSelectEnableChanged(n),postMessage({task:r.ZOOM_TO_SELECT_ENABLE_CHANGED});break;case r.FONT_ZOOM_IN:Jo.fontZoomIn(n),postMessage({task:r.FONT_ZOOM_IN});break;case r.FONT_ZOOM_OUT:Jo.fontZoomOut(n),postMessage({task:r.FONT_ZOOM_OUT});break;case r.STROKE_MORE:Jo.strokeMore(n),postMessage({task:r.STROKE_MORE});break;case r.STROKE_LESS:Jo.strokeLess(n),postMessage({task:r.STROKE_LESS});break;case r.CAMERA_CHANGED:null==(e=Jo.view.camera)||e.setTRS(n.t,n.r,n.s);break;case r.UPDATE_LAYERS_VISIBILITY:Jo.updateLayersVisibility(n.ids,n.visible);break;case r.SELECT_BY_IDS:Jo.selectByIds(n);break;case r.CLEAR_SELECTED:Jo.clearSelected(n),postMessage({task:r.CLEAR_SELECTED});break;case r.TARGET_BY_IDS:Jo.targetByIds(n);break;case r.TAP:postMessage({task:r.TAP,data:Jo.handleViewTap(t.data)});break;case r.TERMINATE:Jo.removeEventListener(r.DYNAMIC_LOADED,th),Jo.removeEventListener(r.SCENES_CHANGED,eh),Jo.removeEventListener(r.SYNC_TEXTURE_HELPER_CACHED,rh),Jo.stop(),self.close();break;case"ping":postMessage({task:"pong"});break;default:throw new Error(`unsupported type '${i}'`)}}))};const th=t=>postMessage({task:t.type,data:t.data}),eh=t=>postMessage({task:t.type,data:t.data}),rh=t=>postMessage({task:t.type,data:t.data})}},function(){return e||(0,t[s(t)[0]])((e={exports:{}}).exports,e),e.exports});export default y();
|