@hatiolab/things-scene 10.0.0-beta.13 → 10.0.0-beta.131
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-types/animation/animate.d.ts.map +1 -1
- package/dist-types/animation/animations/animation.d.ts +5 -3
- package/dist-types/animation/animations/animation.d.ts.map +1 -1
- package/dist-types/animation/animations/heartbeat.d.ts +0 -7
- package/dist-types/animation/animations/heartbeat.d.ts.map +1 -1
- package/dist-types/animation/animations/waypoint.d.ts +45 -4
- package/dist-types/animation/animations/waypoint.d.ts.map +1 -1
- package/dist-types/animation/interfaces.d.ts +1 -1
- package/dist-types/animation/interfaces.d.ts.map +1 -1
- package/dist-types/clock/frame-clock.d.ts +119 -0
- package/dist-types/clock/frame-clock.d.ts.map +1 -0
- package/dist-types/clock/index.d.ts +3 -0
- package/dist-types/clock/index.d.ts.map +1 -0
- package/dist-types/command/command-migrate.d.ts.map +1 -1
- package/dist-types/command/snapshot-commander.d.ts.map +1 -1
- package/dist-types/components/audio.d.ts +10 -3
- package/dist-types/components/audio.d.ts.map +1 -1
- package/dist-types/components/component-data.d.ts +24 -0
- package/dist-types/components/component-data.d.ts.map +1 -1
- package/dist-types/components/component-drawing.d.ts.map +1 -1
- package/dist-types/components/component-geometry.d.ts.map +1 -1
- package/dist-types/components/component-hierarchy.d.ts +1 -1
- package/dist-types/components/component-hierarchy.d.ts.map +1 -1
- package/dist-types/components/component.d.ts +33 -4
- package/dist-types/components/component.d.ts.map +1 -1
- package/dist-types/components/container-abstract.d.ts +56 -11
- package/dist-types/components/container-abstract.d.ts.map +1 -1
- package/dist-types/components/container.d.ts +9 -2
- package/dist-types/components/container.d.ts.map +1 -1
- package/dist-types/components/data/data.d.ts.map +1 -1
- package/dist-types/components/data/evaluator.d.ts +27 -0
- package/dist-types/components/data/evaluator.d.ts.map +1 -1
- package/dist-types/components/donut.d.ts.map +1 -1
- package/dist-types/components/drawer/fill.d.ts.map +1 -1
- package/dist-types/components/drawer/stroke.d.ts.map +1 -1
- package/dist-types/components/ellipse.d.ts +10 -3
- package/dist-types/components/ellipse.d.ts.map +1 -1
- package/dist-types/components/generic-placeholders.d.ts +294 -0
- package/dist-types/components/generic-placeholders.d.ts.map +1 -0
- package/dist-types/components/geometry/snap-guide.d.ts +45 -0
- package/dist-types/components/geometry/snap-guide.d.ts.map +1 -0
- package/dist-types/components/geometry/transcoord.d.ts.map +1 -1
- package/dist-types/components/global-ref.d.ts.map +1 -1
- package/dist-types/components/group.d.ts +2 -0
- package/dist-types/components/group.d.ts.map +1 -1
- package/dist-types/components/html/reposition.d.ts.map +1 -1
- package/dist-types/components/html/shadow.d.ts +33 -1
- package/dist-types/components/html/shadow.d.ts.map +1 -1
- package/dist-types/components/html-overlay-container.d.ts +9 -2
- package/dist-types/components/html-overlay-container.d.ts.map +1 -1
- package/dist-types/components/html-overlay-element.d.ts +19 -5
- package/dist-types/components/html-overlay-element.d.ts.map +1 -1
- package/dist-types/components/image-view.d.ts +10 -3
- package/dist-types/components/image-view.d.ts.map +1 -1
- package/dist-types/components/index.d.ts +7 -0
- package/dist-types/components/index.d.ts.map +1 -1
- package/dist-types/components/info-window.d.ts +10 -3
- package/dist-types/components/info-window.d.ts.map +1 -1
- package/dist-types/components/line.d.ts +2 -1
- package/dist-types/components/line.d.ts.map +1 -1
- package/dist-types/components/local-ref.d.ts +10 -3
- package/dist-types/components/local-ref.d.ts.map +1 -1
- package/dist-types/components/mixins/connectable.d.ts +10 -3
- package/dist-types/components/mixins/connectable.d.ts.map +1 -1
- package/dist-types/components/mixins/data-source.d.ts +10 -3
- package/dist-types/components/mixins/data-source.d.ts.map +1 -1
- package/dist-types/components/mixins/gltf-component.d.ts +282 -0
- package/dist-types/components/mixins/gltf-component.d.ts.map +1 -0
- package/dist-types/components/mixins/holdable.d.ts +12 -0
- package/dist-types/components/mixins/holdable.d.ts.map +1 -0
- package/dist-types/components/mixins/html-element.d.ts +9 -2
- package/dist-types/components/mixins/html-element.d.ts.map +1 -1
- package/dist-types/components/mixins/move-handle.d.ts +19 -7
- package/dist-types/components/mixins/move-handle.d.ts.map +1 -1
- package/dist-types/components/mixins/rect-path.d.ts +10 -3
- package/dist-types/components/mixins/rect-path.d.ts.map +1 -1
- package/dist-types/components/mixins/three-d-only.d.ts +250 -0
- package/dist-types/components/mixins/three-d-only.d.ts.map +1 -0
- package/dist-types/components/mixins/value-holder.d.ts +10 -3
- package/dist-types/components/mixins/value-holder.d.ts.map +1 -1
- package/dist-types/components/mutater/path.d.ts.map +1 -1
- package/dist-types/components/node.d.ts +10 -3
- package/dist-types/components/node.d.ts.map +1 -1
- package/dist-types/components/outline/path-outline.d.ts.map +1 -1
- package/dist-types/components/polygon-container.d.ts +61 -0
- package/dist-types/components/polygon-container.d.ts.map +1 -0
- package/dist-types/components/polygon.d.ts +2 -0
- package/dist-types/components/polygon.d.ts.map +1 -1
- package/dist-types/components/polyline.d.ts +6 -0
- package/dist-types/components/polyline.d.ts.map +1 -1
- package/dist-types/components/popup-container.d.ts +25 -0
- package/dist-types/components/popup-container.d.ts.map +1 -0
- package/dist-types/components/popup.d.ts +40 -3
- package/dist-types/components/popup.d.ts.map +1 -1
- package/dist-types/components/position/popup-position.d.ts +11 -0
- package/dist-types/components/position/popup-position.d.ts.map +1 -1
- package/dist-types/components/rect.d.ts +20 -6
- package/dist-types/components/rect.d.ts.map +1 -1
- package/dist-types/components/retention/retention-manager.d.ts +9 -1
- package/dist-types/components/retention/retention-manager.d.ts.map +1 -1
- package/dist-types/components/root-container.d.ts +18 -4
- package/dist-types/components/root-container.d.ts.map +1 -1
- package/dist-types/components/ruler.d.ts +10 -3
- package/dist-types/components/ruler.d.ts.map +1 -1
- package/dist-types/components/service-component.d.ts +271 -0
- package/dist-types/components/service-component.d.ts.map +1 -0
- package/dist-types/components/shape.d.ts.map +1 -1
- package/dist-types/components/star.d.ts.map +1 -1
- package/dist-types/components/text.d.ts +10 -3
- package/dist-types/components/text.d.ts.map +1 -1
- package/dist-types/core/dom-to-image.d.ts.map +1 -1
- package/dist-types/core/logger.d.ts.map +1 -1
- package/dist-types/core/memoize.d.ts.map +1 -1
- package/dist-types/decorator/decorator-registry.d.ts +14 -1
- package/dist-types/decorator/decorator-registry.d.ts.map +1 -1
- package/dist-types/decorator/decorators/animated-icon-decorator.d.ts.map +1 -1
- package/dist-types/decorator/decorators/border-highlighting-decorator.d.ts +0 -4
- package/dist-types/decorator/decorators/border-highlighting-decorator.d.ts.map +1 -1
- package/dist-types/decorator/decorators/bouncing-arrow-decorator.d.ts +0 -3
- package/dist-types/decorator/decorators/bouncing-arrow-decorator.d.ts.map +1 -1
- package/dist-types/decorator/decorators/data-spread-decorator.d.ts +16 -0
- package/dist-types/decorator/decorators/data-spread-decorator.d.ts.map +1 -1
- package/dist-types/diagnostics/contract-inspector.d.ts +110 -0
- package/dist-types/diagnostics/contract-inspector.d.ts.map +1 -0
- package/dist-types/diagnostics/data-lag-tracker.d.ts +50 -0
- package/dist-types/diagnostics/data-lag-tracker.d.ts.map +1 -0
- package/dist-types/diagnostics/inspector.d.ts +192 -5
- package/dist-types/diagnostics/inspector.d.ts.map +1 -1
- package/dist-types/diagnostics/load-tracker.d.ts +82 -0
- package/dist-types/diagnostics/load-tracker.d.ts.map +1 -0
- package/dist-types/diagnostics/loading-overlay.d.ts +58 -0
- package/dist-types/diagnostics/loading-overlay.d.ts.map +1 -0
- package/dist-types/diagnostics/metrics.d.ts +10 -0
- package/dist-types/diagnostics/metrics.d.ts.map +1 -1
- package/dist-types/effect/shadow.d.ts +3 -1
- package/dist-types/effect/shadow.d.ts.map +1 -1
- package/dist-types/event-map/index.d.ts +1 -0
- package/dist-types/event-map/index.d.ts.map +1 -1
- package/dist-types/event-map/transition-handler.d.ts +2 -0
- package/dist-types/event-map/transition-handler.d.ts.map +1 -0
- package/dist-types/flow/auto-route.d.ts +36 -0
- package/dist-types/flow/auto-route.d.ts.map +1 -0
- package/dist-types/flow/face-anchors.d.ts +26 -0
- package/dist-types/flow/face-anchors.d.ts.map +1 -0
- package/dist-types/flow/flow-engine.d.ts +122 -0
- package/dist-types/flow/flow-engine.d.ts.map +1 -0
- package/dist-types/flow/flow-graph-coordinator.d.ts +80 -0
- package/dist-types/flow/flow-graph-coordinator.d.ts.map +1 -0
- package/dist-types/flow/flow-graph-validator.d.ts +33 -0
- package/dist-types/flow/flow-graph-validator.d.ts.map +1 -0
- package/dist-types/flow/flow-graph.d.ts +76 -0
- package/dist-types/flow/flow-graph.d.ts.map +1 -0
- package/dist-types/flow/flow-introspection.d.ts +36 -0
- package/dist-types/flow/flow-introspection.d.ts.map +1 -0
- package/dist-types/flow/flow-node.d.ts +69 -0
- package/dist-types/flow/flow-node.d.ts.map +1 -0
- package/dist-types/flow/flow-orientation-coordinator.d.ts +13 -0
- package/dist-types/flow/flow-orientation-coordinator.d.ts.map +1 -0
- package/dist-types/flow/flow-orientation.d.ts +42 -0
- package/dist-types/flow/flow-orientation.d.ts.map +1 -0
- package/dist-types/flow/flow-trace.d.ts +5 -0
- package/dist-types/flow/flow-trace.d.ts.map +1 -0
- package/dist-types/flow/index.d.ts +16 -0
- package/dist-types/flow/index.d.ts.map +1 -0
- package/dist-types/flow/segment-topology.d.ts +225 -0
- package/dist-types/flow/segment-topology.d.ts.map +1 -0
- package/dist-types/flow/station-host-inference.d.ts +23 -0
- package/dist-types/flow/station-host-inference.d.ts.map +1 -0
- package/dist-types/interfaces/event-handler.d.ts +40 -0
- package/dist-types/interfaces/event-handler.d.ts.map +1 -0
- package/dist-types/interfaces/index.d.ts +2 -0
- package/dist-types/interfaces/index.d.ts.map +1 -1
- package/dist-types/interfaces/layout.d.ts +35 -1
- package/dist-types/interfaces/layout.d.ts.map +1 -1
- package/dist-types/interfaces/providers.d.ts +27 -3
- package/dist-types/interfaces/providers.d.ts.map +1 -1
- package/dist-types/interfaces/real-object.d.ts +8 -1
- package/dist-types/interfaces/real-object.d.ts.map +1 -1
- package/dist-types/interfaces/rendering.d.ts +86 -14
- package/dist-types/interfaces/rendering.d.ts.map +1 -1
- package/dist-types/interfaces/types.d.ts +20 -1
- package/dist-types/interfaces/types.d.ts.map +1 -1
- package/dist-types/items/arrangement/centering-queue-strategy.d.ts +10 -0
- package/dist-types/items/arrangement/centering-queue-strategy.d.ts.map +1 -0
- package/dist-types/items/arrangement/index.d.ts +2 -0
- package/dist-types/items/arrangement/index.d.ts.map +1 -0
- package/dist-types/items/capacity-mixin.d.ts +303 -0
- package/dist-types/items/capacity-mixin.d.ts.map +1 -0
- package/dist-types/items/capacity.d.ts +53 -0
- package/dist-types/items/capacity.d.ts.map +1 -0
- package/dist-types/items/index.d.ts +7 -0
- package/dist-types/items/index.d.ts.map +1 -0
- package/dist-types/items/items-data-binding.d.ts +103 -0
- package/dist-types/items/items-data-binding.d.ts.map +1 -0
- package/dist-types/items/slot-record.d.ts +23 -0
- package/dist-types/items/slot-record.d.ts.map +1 -0
- package/dist-types/items/stacking/index.d.ts +3 -0
- package/dist-types/items/stacking/index.d.ts.map +1 -0
- package/dist-types/items/stacking/stack-layout.d.ts +33 -0
- package/dist-types/items/stacking/stack-layout.d.ts.map +1 -0
- package/dist-types/items/stacking/stacking-strategy.d.ts +114 -0
- package/dist-types/items/stacking/stacking-strategy.d.ts.map +1 -0
- package/dist-types/layer/action/popup.d.ts +13 -0
- package/dist-types/layer/action/popup.d.ts.map +1 -1
- package/dist-types/layer/add-layer.d.ts +8 -0
- package/dist-types/layer/add-layer.d.ts.map +1 -1
- package/dist-types/layer/dual-canvas-layer.d.ts.map +1 -1
- package/dist-types/layer/index.d.ts +1 -0
- package/dist-types/layer/index.d.ts.map +1 -1
- package/dist-types/layer/layer.d.ts +2 -0
- package/dist-types/layer/layer.d.ts.map +1 -1
- package/dist-types/layer/model-layer.d.ts +81 -7
- package/dist-types/layer/model-layer.d.ts.map +1 -1
- package/dist-types/layer/modeler/index.d.ts +1 -0
- package/dist-types/layer/modeler/index.d.ts.map +1 -1
- package/dist-types/layer/modeler/move-handle-icon.d.ts +2 -0
- package/dist-types/layer/modeler/move-handle-icon.d.ts.map +1 -0
- package/dist-types/layer/modeler/move-handle-modeler.d.ts +18 -0
- package/dist-types/layer/modeler/move-handle-modeler.d.ts.map +1 -0
- package/dist-types/layer/modeler/path-handler.d.ts.map +1 -1
- package/dist-types/layer/modeler/rotator.d.ts.map +1 -1
- package/dist-types/layer/modeling-layer.d.ts +19 -0
- package/dist-types/layer/modeling-layer.d.ts.map +1 -1
- package/dist-types/layer/selection/selected-finder.d.ts +1 -1
- package/dist-types/layer/selection/selected-finder.d.ts.map +1 -1
- package/dist-types/layer/selection-layer.d.ts +7 -0
- package/dist-types/layer/selection-layer.d.ts.map +1 -1
- package/dist-types/layer/snap-guide-layer.d.ts +23 -0
- package/dist-types/layer/snap-guide-layer.d.ts.map +1 -0
- package/dist-types/layout/absolute.d.ts +2 -2
- package/dist-types/layout/card.d.ts +2 -2
- package/dist-types/layout/linear-horizontal.d.ts +2 -2
- package/dist-types/layout/linear-vertical.d.ts +2 -2
- package/dist-types/layout/table.d.ts +3 -3
- package/dist-types/license/license.d.ts.map +1 -1
- package/dist-types/math/component-pose.d.ts +51 -0
- package/dist-types/math/component-pose.d.ts.map +1 -0
- package/dist-types/math/index.d.ts +3 -0
- package/dist-types/math/index.d.ts.map +1 -0
- package/dist-types/math/pose6dof.d.ts +93 -0
- package/dist-types/math/pose6dof.d.ts.map +1 -0
- package/dist-types/navigation/index.d.ts +7 -0
- package/dist-types/navigation/index.d.ts.map +1 -0
- package/dist-types/navigation/nav-graph.d.ts +55 -0
- package/dist-types/navigation/nav-graph.d.ts.map +1 -0
- package/dist-types/navigation/path-planner.d.ts +29 -0
- package/dist-types/navigation/path-planner.d.ts.map +1 -0
- package/dist-types/navigation/reservation-table.d.ts +103 -0
- package/dist-types/navigation/reservation-table.d.ts.map +1 -0
- package/dist-types/navigation/types.d.ts +145 -0
- package/dist-types/navigation/types.d.ts.map +1 -0
- package/dist-types/placement/index.d.ts +3 -0
- package/dist-types/placement/index.d.ts.map +1 -0
- package/dist-types/placement/placement.d.ts +53 -0
- package/dist-types/placement/placement.d.ts.map +1 -0
- package/dist-types/search/index.d.ts +3 -0
- package/dist-types/search/index.d.ts.map +1 -0
- package/dist-types/search/scene-search-engine.d.ts +64 -0
- package/dist-types/search/scene-search-engine.d.ts.map +1 -0
- package/dist-types/search/search-overlay.d.ts +94 -0
- package/dist-types/search/search-overlay.d.ts.map +1 -0
- package/dist-types/things-scene/api/add-start.d.ts +25 -0
- package/dist-types/things-scene/api/add-start.d.ts.map +1 -1
- package/dist-types/things-scene/api/align.d.ts.map +1 -1
- package/dist-types/things-scene/api/distribute.d.ts.map +1 -1
- package/dist-types/things-scene/api/ids.d.ts +4 -1
- package/dist-types/things-scene/api/ids.d.ts.map +1 -1
- package/dist-types/things-scene/api/index.d.ts +1 -1
- package/dist-types/things-scene/api/index.d.ts.map +1 -1
- package/dist-types/things-scene/api/place.d.ts.map +1 -1
- package/dist-types/things-scene/api/zorder.d.ts.map +1 -1
- package/dist-types/things-scene/application-context.d.ts +62 -0
- package/dist-types/things-scene/application-context.d.ts.map +1 -1
- package/dist-types/things-scene/create.d.ts +43 -3
- package/dist-types/things-scene/create.d.ts.map +1 -1
- package/dist-types/things-scene/index.d.ts +29 -0
- package/dist-types/things-scene/index.d.ts.map +1 -1
- package/dist-types/things-scene/scene.d.ts +120 -2
- package/dist-types/things-scene/scene.d.ts.map +1 -1
- package/dist-types/threed/arrow-3d.d.ts +13 -4
- package/dist-types/threed/arrow-3d.d.ts.map +1 -1
- package/dist-types/threed/environments/base-environment.d.ts +17 -0
- package/dist-types/threed/environments/base-environment.d.ts.map +1 -0
- package/dist-types/threed/environments/cloudy-environment.d.ts +10 -0
- package/dist-types/threed/environments/cloudy-environment.d.ts.map +1 -0
- package/dist-types/threed/environments/factory-environment.d.ts +3 -3
- package/dist-types/threed/environments/factory-environment.d.ts.map +1 -1
- package/dist-types/threed/environments/home-environment.d.ts +3 -3
- package/dist-types/threed/environments/home-environment.d.ts.map +1 -1
- package/dist-types/threed/environments/office-environment.d.ts +3 -3
- package/dist-types/threed/environments/office-environment.d.ts.map +1 -1
- package/dist-types/threed/environments/rainy-environment.d.ts +10 -0
- package/dist-types/threed/environments/rainy-environment.d.ts.map +1 -0
- package/dist-types/threed/environments/studio-environment.d.ts +2 -3
- package/dist-types/threed/environments/studio-environment.d.ts.map +1 -1
- package/dist-types/threed/environments/sunny-environment.d.ts +10 -0
- package/dist-types/threed/environments/sunny-environment.d.ts.map +1 -0
- package/dist-types/threed/environments/warehouse-environment.d.ts +3 -3
- package/dist-types/threed/environments/warehouse-environment.d.ts.map +1 -1
- package/dist-types/threed/factories/backdrop.d.ts +541 -0
- package/dist-types/threed/factories/backdrop.d.ts.map +1 -0
- package/dist-types/threed/factories/banner.d.ts +16 -4
- package/dist-types/threed/factories/banner.d.ts.map +1 -1
- package/dist-types/threed/factories/camera.d.ts +12 -3
- package/dist-types/threed/factories/camera.d.ts.map +1 -1
- package/dist-types/threed/factories/cube.d.ts +11 -3
- package/dist-types/threed/factories/cube.d.ts.map +1 -1
- package/dist-types/threed/factories/cylinder.d.ts +1 -0
- package/dist-types/threed/factories/cylinder.d.ts.map +1 -1
- package/dist-types/threed/factories/decal.d.ts +516 -0
- package/dist-types/threed/factories/decal.d.ts.map +1 -0
- package/dist-types/threed/factories/floor-plate.d.ts +11 -0
- package/dist-types/threed/factories/floor-plate.d.ts.map +1 -0
- package/dist-types/threed/factories/gltf-object.d.ts +270 -38
- package/dist-types/threed/factories/gltf-object.d.ts.map +1 -1
- package/dist-types/threed/factories/group.d.ts +2 -0
- package/dist-types/threed/factories/group.d.ts.map +1 -0
- package/dist-types/threed/factories/light.d.ts +1 -0
- package/dist-types/threed/factories/light.d.ts.map +1 -1
- package/dist-types/threed/factories/line.d.ts +10 -0
- package/dist-types/threed/factories/line.d.ts.map +1 -0
- package/dist-types/threed/factories/ortholine.d.ts +10 -0
- package/dist-types/threed/factories/ortholine.d.ts.map +1 -0
- package/dist-types/threed/factories/polygon.d.ts +19 -0
- package/dist-types/threed/factories/polygon.d.ts.map +1 -1
- package/dist-types/threed/factories/polyline.d.ts +10 -0
- package/dist-types/threed/factories/polyline.d.ts.map +1 -0
- package/dist-types/threed/factories/rect.d.ts.map +1 -1
- package/dist-types/threed/factories/sphere.d.ts +6 -0
- package/dist-types/threed/factories/sphere.d.ts.map +1 -1
- package/dist-types/threed/factories/sprite.d.ts +11 -3
- package/dist-types/threed/factories/sprite.d.ts.map +1 -1
- package/dist-types/threed/factories/triangle.d.ts.map +1 -1
- package/dist-types/threed/factories/wall.d.ts +11 -3
- package/dist-types/threed/factories/wall.d.ts.map +1 -1
- package/dist-types/threed/floor/floor.d.ts.map +1 -1
- package/dist-types/threed/handle-3d.d.ts +21 -0
- package/dist-types/threed/handle-3d.d.ts.map +1 -0
- package/dist-types/threed/html/elements.d.ts.map +1 -1
- package/dist-types/threed/index.d.ts +24 -0
- package/dist-types/threed/index.d.ts.map +1 -1
- package/dist-types/threed/managers/box-selection-manager.d.ts +26 -0
- package/dist-types/threed/managers/box-selection-manager.d.ts.map +1 -0
- package/dist-types/threed/managers/camera-bookmark-manager.d.ts +66 -32
- package/dist-types/threed/managers/camera-bookmark-manager.d.ts.map +1 -1
- package/dist-types/threed/managers/camera-manager.d.ts +9 -3
- package/dist-types/threed/managers/camera-manager.d.ts.map +1 -1
- package/dist-types/threed/managers/controls-manager.d.ts +25 -4
- package/dist-types/threed/managers/controls-manager.d.ts.map +1 -1
- package/dist-types/threed/managers/event-manager3d.d.ts +14 -0
- package/dist-types/threed/managers/event-manager3d.d.ts.map +1 -1
- package/dist-types/threed/managers/gizmo-manager.d.ts +6 -0
- package/dist-types/threed/managers/gizmo-manager.d.ts.map +1 -1
- package/dist-types/threed/managers/gizmo-operation-manager.d.ts +54 -1
- package/dist-types/threed/managers/gizmo-operation-manager.d.ts.map +1 -1
- package/dist-types/threed/managers/index.d.ts +3 -1
- package/dist-types/threed/managers/index.d.ts.map +1 -1
- package/dist-types/threed/managers/interaction-manager.d.ts +17 -0
- package/dist-types/threed/managers/interaction-manager.d.ts.map +1 -1
- package/dist-types/threed/managers/light-manager.d.ts +15 -0
- package/dist-types/threed/managers/light-manager.d.ts.map +1 -1
- package/dist-types/threed/managers/renderer-manager.d.ts +37 -0
- package/dist-types/threed/managers/renderer-manager.d.ts.map +1 -1
- package/dist-types/threed/managers/scene-manager.d.ts +12 -2
- package/dist-types/threed/managers/scene-manager.d.ts.map +1 -1
- package/dist-types/threed/managers/types.d.ts +4 -2
- package/dist-types/threed/managers/types.d.ts.map +1 -1
- package/dist-types/threed/managers/vertex-gizmo-manager.d.ts +154 -0
- package/dist-types/threed/managers/vertex-gizmo-manager.d.ts.map +1 -0
- package/dist-types/threed/material-3d.d.ts +5 -2
- package/dist-types/threed/material-3d.d.ts.map +1 -1
- package/dist-types/threed/ratio-lock-utils.d.ts +9 -0
- package/dist-types/threed/ratio-lock-utils.d.ts.map +1 -0
- package/dist-types/threed/real-object-dom-element.d.ts +2 -0
- package/dist-types/threed/real-object-dom-element.d.ts.map +1 -1
- package/dist-types/threed/real-object-dom-texture.d.ts +9 -0
- package/dist-types/threed/real-object-dom-texture.d.ts.map +1 -1
- package/dist-types/threed/real-object-external-model.d.ts +24 -0
- package/dist-types/threed/real-object-external-model.d.ts.map +1 -0
- package/dist-types/threed/real-object-extrude.d.ts +16 -1
- package/dist-types/threed/real-object-extrude.d.ts.map +1 -1
- package/dist-types/threed/real-object-gltf.d.ts +21 -11
- package/dist-types/threed/real-object-gltf.d.ts.map +1 -1
- package/dist-types/threed/real-object-group.d.ts +2 -0
- package/dist-types/threed/real-object-group.d.ts.map +1 -1
- package/dist-types/threed/real-object-line.d.ts +83 -0
- package/dist-types/threed/real-object-line.d.ts.map +1 -0
- package/dist-types/threed/real-object-mesh.d.ts.map +1 -1
- package/dist-types/threed/real-object-plane-2d.d.ts +23 -0
- package/dist-types/threed/real-object-plane-2d.d.ts.map +1 -1
- package/dist-types/threed/real-object-service.d.ts +14 -0
- package/dist-types/threed/real-object-service.d.ts.map +1 -0
- package/dist-types/threed/real-object-sprite.d.ts +7 -1
- package/dist-types/threed/real-object-sprite.d.ts.map +1 -1
- package/dist-types/threed/real-object-text.d.ts +5 -0
- package/dist-types/threed/real-object-text.d.ts.map +1 -1
- package/dist-types/threed/real-object.d.ts +261 -7
- package/dist-types/threed/real-object.d.ts.map +1 -1
- package/dist-types/threed/text-editor-3d.d.ts +11 -0
- package/dist-types/threed/text-editor-3d.d.ts.map +1 -0
- package/dist-types/threed/texture/canvas-texture.d.ts +7 -0
- package/dist-types/threed/texture/canvas-texture.d.ts.map +1 -1
- package/dist-types/threed/texture/fillstyle-texture.d.ts +57 -0
- package/dist-types/threed/texture/fillstyle-texture.d.ts.map +1 -0
- package/dist-types/threed/texture/text-texture.d.ts +15 -0
- package/dist-types/threed/texture/text-texture.d.ts.map +1 -1
- package/dist-types/threed/three-capability.d.ts +131 -15
- package/dist-types/threed/three-capability.d.ts.map +1 -1
- package/dist-types/threed/three-container.d.ts +0 -1
- package/dist-types/threed/three-container.d.ts.map +1 -1
- package/dist-types/threed/three-dimensional-container.d.ts +0 -1
- package/dist-types/threed/three-dimensional-container.d.ts.map +1 -1
- package/dist-types/threed/utils/anchor.d.ts +33 -0
- package/dist-types/threed/utils/anchor.d.ts.map +1 -0
- package/dist-types/threed/utils/dispose.d.ts.map +1 -1
- package/dist-types/threed/utils/polygon-shape.d.ts +21 -0
- package/dist-types/threed/utils/polygon-shape.d.ts.map +1 -0
- package/dist-types/threed/utils/tether.d.ts +46 -0
- package/dist-types/threed/utils/tether.d.ts.map +1 -0
- package/dist-types/threed/z-priority.d.ts +27 -0
- package/dist-types/threed/z-priority.d.ts.map +1 -0
- package/dist-types/tracker/tracker.d.ts +57 -0
- package/dist-types/tracker/tracker.d.ts.map +1 -0
- package/dist-types/transfer/carrier-line-capability.d.ts +95 -0
- package/dist-types/transfer/carrier-line-capability.d.ts.map +1 -0
- package/dist-types/transfer/centering-slot-strategy.d.ts +8 -0
- package/dist-types/transfer/centering-slot-strategy.d.ts.map +1 -0
- package/dist-types/transfer/fixed-slot-strategy.d.ts +8 -0
- package/dist-types/transfer/fixed-slot-strategy.d.ts.map +1 -0
- package/dist-types/transfer/index.d.ts +24 -0
- package/dist-types/transfer/index.d.ts.map +1 -0
- package/dist-types/transfer/pickup-helpers.d.ts +75 -0
- package/dist-types/transfer/pickup-helpers.d.ts.map +1 -0
- package/dist-types/transfer/simulation-clock.d.ts +45 -0
- package/dist-types/transfer/simulation-clock.d.ts.map +1 -0
- package/dist-types/transfer/tracer.d.ts +35 -0
- package/dist-types/transfer/tracer.d.ts.map +1 -0
- package/dist-types/transfer/transfer-helpers.d.ts +18 -0
- package/dist-types/transfer/transfer-helpers.d.ts.map +1 -0
- package/dist-types/transfer/transfer.d.ts +257 -0
- package/dist-types/transfer/transfer.d.ts.map +1 -0
- package/dist-types/transfer/transferable-mixin.d.ts +275 -0
- package/dist-types/transfer/transferable-mixin.d.ts.map +1 -0
- package/dist-types/transfer/types.d.ts +462 -0
- package/dist-types/transfer/types.d.ts.map +1 -0
- package/dist-types/transition/transition-effect.d.ts +117 -0
- package/dist-types/transition/transition-effect.d.ts.map +1 -0
- package/dist-types/types/bounding.d.ts +1 -1
- package/dist-types/types/bounding.d.ts.map +1 -1
- package/dist-types/types/capability.d.ts +59 -0
- package/dist-types/types/capability.d.ts.map +1 -0
- package/dist-types/types/component.d.ts +6 -177
- package/dist-types/types/component.d.ts.map +1 -1
- package/dist-types/types/event.d.ts +57 -0
- package/dist-types/types/event.d.ts.map +1 -1
- package/dist-types/types/polygon-path-arc.d.ts +72 -0
- package/dist-types/types/polygon-path-arc.d.ts.map +1 -0
- package/dist-types/types/polygon-path.d.ts +153 -0
- package/dist-types/types/polygon-path.d.ts.map +1 -0
- package/package.json +13 -2
- package/things-scene-min.js +12 -13
- package/things-scene-min.js.map +1 -1
- package/things-scene-transfer.mjs +7 -0
- package/things-scene.mjs +8 -9
- package/things-scene.mjs.map +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
function t(...t){return e=>{const r=Object.getPrototypeOf(e),n=Array.isArray(r?.capabilities)?r.capabilities:[],i=new Set([...n,...t]);return Object.defineProperty(e,"capabilities",{value:Object.freeze([...i]),writable:!1,configurable:!0}),e}}const e=new Map;function r(t){e.set(t.name,t)}function n(t){return e.get(t)}function i(){return[...e.values()]}const o={x:0,y:0,z:0,w:1};function s(t){const e=t/2;return{x:0,y:Math.sin(e),z:0,w:Math.cos(e)}}function a(t,e){const r=t.rotation,n=e.rotation,i=e.position,o=r.w*i.x+r.y*i.z-r.z*i.y,s=r.w*i.y+r.z*i.x-r.x*i.z,a=r.w*i.z+r.x*i.y-r.y*i.x,c=-r.x*i.x-r.y*i.y-r.z*i.z,u=o*r.w+c*-r.x+s*-r.z-a*-r.y,l=s*r.w+c*-r.y+a*-r.x-o*-r.z,h=a*r.w+c*-r.z+o*-r.y-s*-r.x,f={x:r.w*n.x+r.x*n.w+r.y*n.z-r.z*n.y,y:r.w*n.y-r.x*n.z+r.y*n.w+r.z*n.x,z:r.w*n.z+r.x*n.y-r.y*n.x+r.z*n.w,w:r.w*n.w-r.x*n.x-r.y*n.y-r.z*n.z};return{position:{x:t.position.x+u,y:t.position.y+l,z:t.position.z+h},rotation:f}}const c={east:{axis:{x:1,y:0,z:0},yaw:0,idSuffix:"east"},west:{axis:{x:-1,y:0,z:0},yaw:Math.PI,idSuffix:"west"},south:{axis:{x:0,y:0,z:1},yaw:-Math.PI/2,idSuffix:"south"},north:{axis:{x:0,y:0,z:-1},yaw:Math.PI/2,idSuffix:"north"}};function u(t){const{carrierWorld:e,width:r,depth:n,entryHeight:i,mountLocalY:u,approachDistance:l,sides:h,toolType:f,tolerance:d,priority:p}=t,g="number"==typeof u?{position:{x:0,y:u,z:0},rotation:{...o}}:void 0,y=r/2,m=n/2;return h.map(t=>{const r=c[t],n="string"==typeof f?f:f[t]??"unknown",o={position:{x:r.axis.x*("east"===t||"west"===t?y:0),y:i,z:r.axis.z*("north"===t||"south"===t?m:0)},rotation:s(r.yaw)},u={position:{x:o.position.x+r.axis.x*l,y:i,z:o.position.z+r.axis.z*l},rotation:s(r.yaw)};return{id:`entry-${r.idSuffix}`,toolType:n,approach:a(e,u),engage:a(e,o),...g?{mount:g}:{},tolerance:d,priority:p}})}function l(t){const{carrierWorld:e,topY:r,approachDistance:n,toolType:i,mountLocalY:s,tolerance:c,priority:u,id:l}=t,h={position:{x:0,y:r,z:0},rotation:{...o}};return{id:l??"top",toolType:i,approach:a(e,{position:{x:0,y:r+n,z:0},rotation:{...o}}),engage:a(e,h),..."number"==typeof s?{mount:{position:{x:0,y:s,z:0},rotation:{...o}}}:{},tolerance:c,priority:u}}function h(t,e){return t.filter(t=>t.toolType===e.toolType)}function f(t,e){if(0===t.length)return null;const r=t.map(t=>{const r=t.approach.position.x-e.x,n=t.approach.position.y-e.y,i=t.approach.position.z-e.z;return{f:t,dist:Math.sqrt(r*r+n*n+i*i)}});return r.sort((t,e)=>{const r=t.f.priority??0,n=e.f.priority??0;return r!==n?r-n:t.dist-e.dist}),r[0].f}class d{positionAt(t,e,r){return 0!==t?null:e.localPosition??{x:0,y:0,z:0}}capacity(t){return 1}}const p=new d;class g{constructor(t){this.owner=t}positionAt(t,e,r,n){if(0!==t)return null;const i=this.owner?.state?.width??0,o=this.owner?.state?.height??0,s=n?.state?.width??0,a=n?.state?.height??0;return{x:Math.max(0,(i-s)/2),y:Math.max(0,(o-a)/2),z:0}}capacity(t){return t.maxCount??1}}
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2010-2026 Three.js Authors
|
|
5
|
+
* SPDX-License-Identifier: MIT
|
|
6
|
+
*/const y=2e3;function m(...t){t=function(t){const e=t[0];if("string"==typeof e&&e.startsWith("TSL:")){const e=t[1];e&&e.isStackTrace?t[0]+=" "+e.getLocation():t[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return t}(t);const e="THREE."+t.shift();{const r=t[0];r&&r.isStackTrace?console.warn(r.getError(e)):console.warn(e,...t)}}function b(t,e,r){return Math.max(e,Math.min(r,t))}class v{constructor(t=0,e=0,r=0,n=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=r,this._w=n}static slerpFlat(t,e,r,n,i,o,s){let a=r[n+0],c=r[n+1],u=r[n+2],l=r[n+3],h=i[o+0],f=i[o+1],d=i[o+2],p=i[o+3];if(l!==p||a!==h||c!==f||u!==d){let t=a*h+c*f+u*d+l*p;t<0&&(h=-h,f=-f,d=-d,p=-p,t=-t);let e=1-s;if(t<.9995){const r=Math.acos(t),n=Math.sin(r);e=Math.sin(e*r)/n,a=a*e+h*(s=Math.sin(s*r)/n),c=c*e+f*s,u=u*e+d*s,l=l*e+p*s}else{a=a*e+h*s,c=c*e+f*s,u=u*e+d*s,l=l*e+p*s;const t=1/Math.sqrt(a*a+c*c+u*u+l*l);a*=t,c*=t,u*=t,l*=t}}t[e]=a,t[e+1]=c,t[e+2]=u,t[e+3]=l}static multiplyQuaternionsFlat(t,e,r,n,i,o){const s=r[n],a=r[n+1],c=r[n+2],u=r[n+3],l=i[o],h=i[o+1],f=i[o+2],d=i[o+3];return t[e]=s*d+u*l+a*f-c*h,t[e+1]=a*d+u*h+c*l-s*f,t[e+2]=c*d+u*f+s*h-a*l,t[e+3]=u*d-s*l-a*h-c*f,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,r,n){return this._x=t,this._y=e,this._z=r,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const r=t._x,n=t._y,i=t._z,o=t._order,s=Math.cos,a=Math.sin,c=s(r/2),u=s(n/2),l=s(i/2),h=a(r/2),f=a(n/2),d=a(i/2);switch(o){case"XYZ":this._x=h*u*l+c*f*d,this._y=c*f*l-h*u*d,this._z=c*u*d+h*f*l,this._w=c*u*l-h*f*d;break;case"YXZ":this._x=h*u*l+c*f*d,this._y=c*f*l-h*u*d,this._z=c*u*d-h*f*l,this._w=c*u*l+h*f*d;break;case"ZXY":this._x=h*u*l-c*f*d,this._y=c*f*l+h*u*d,this._z=c*u*d+h*f*l,this._w=c*u*l-h*f*d;break;case"ZYX":this._x=h*u*l-c*f*d,this._y=c*f*l+h*u*d,this._z=c*u*d-h*f*l,this._w=c*u*l+h*f*d;break;case"YZX":this._x=h*u*l+c*f*d,this._y=c*f*l+h*u*d,this._z=c*u*d-h*f*l,this._w=c*u*l-h*f*d;break;case"XZY":this._x=h*u*l-c*f*d,this._y=c*f*l-h*u*d,this._z=c*u*d+h*f*l,this._w=c*u*l+h*f*d;break;default:m("Quaternion: .setFromEuler() encountered an unknown order: "+o)}return!0===e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const r=e/2,n=Math.sin(r);return this._x=t.x*n,this._y=t.y*n,this._z=t.z*n,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,r=e[0],n=e[4],i=e[8],o=e[1],s=e[5],a=e[9],c=e[2],u=e[6],l=e[10],h=r+s+l;if(h>0){const t=.5/Math.sqrt(h+1);this._w=.25/t,this._x=(u-a)*t,this._y=(i-c)*t,this._z=(o-n)*t}else if(r>s&&r>l){const t=2*Math.sqrt(1+r-s-l);this._w=(u-a)/t,this._x=.25*t,this._y=(n+o)/t,this._z=(i+c)/t}else if(s>l){const t=2*Math.sqrt(1+s-r-l);this._w=(i-c)/t,this._x=(n+o)/t,this._y=.25*t,this._z=(a+u)/t}else{const t=2*Math.sqrt(1+l-r-s);this._w=(o-n)/t,this._x=(i+c)/t,this._y=(a+u)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let r=t.dot(e)+1;return r<1e-8?(r=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=r):(this._x=0,this._y=-t.z,this._z=t.y,this._w=r)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=r),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(b(this.dot(t),-1,1)))}rotateTowards(t,e){const r=this.angleTo(t);if(0===r)return this;const n=Math.min(1,e/r);return this.slerp(t,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const r=t._x,n=t._y,i=t._z,o=t._w,s=e._x,a=e._y,c=e._z,u=e._w;return this._x=r*u+o*s+n*c-i*a,this._y=n*u+o*a+i*s-r*c,this._z=i*u+o*c+r*a-n*s,this._w=o*u-r*s-n*a-i*c,this._onChangeCallback(),this}slerp(t,e){let r=t._x,n=t._y,i=t._z,o=t._w,s=this.dot(t);s<0&&(r=-r,n=-n,i=-i,o=-o,s=-s);let a=1-e;if(s<.9995){const t=Math.acos(s),c=Math.sin(t);a=Math.sin(a*t)/c,e=Math.sin(e*t)/c,this._x=this._x*a+r*e,this._y=this._y*a+n*e,this._z=this._z*a+i*e,this._w=this._w*a+o*e,this._onChangeCallback()}else this._x=this._x*a+r*e,this._y=this._y*a+n*e,this._z=this._z*a+i*e,this._w=this._w*a+o*e,this.normalize();return this}slerpQuaternions(t,e,r){return this.copy(t).slerp(e,r)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),r=Math.random(),n=Math.sqrt(1-r),i=Math.sqrt(r);return this.set(n*Math.sin(t),n*Math.cos(t),i*Math.sin(e),i*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class x{constructor(t=0,e=0,r=0){x.prototype.isVector3=!0,this.x=t,this.y=e,this.z=r}set(t,e,r){return void 0===r&&(r=this.z),this.x=t,this.y=e,this.z=r,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,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("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(w.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(w.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,r=this.y,n=this.z,i=t.elements;return this.x=i[0]*e+i[3]*r+i[6]*n,this.y=i[1]*e+i[4]*r+i[7]*n,this.z=i[2]*e+i[5]*r+i[8]*n,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,r=this.y,n=this.z,i=t.elements,o=1/(i[3]*e+i[7]*r+i[11]*n+i[15]);return this.x=(i[0]*e+i[4]*r+i[8]*n+i[12])*o,this.y=(i[1]*e+i[5]*r+i[9]*n+i[13])*o,this.z=(i[2]*e+i[6]*r+i[10]*n+i[14])*o,this}applyQuaternion(t){const e=this.x,r=this.y,n=this.z,i=t.x,o=t.y,s=t.z,a=t.w,c=2*(o*n-s*r),u=2*(s*e-i*n),l=2*(i*r-o*e);return this.x=e+a*c+o*l-s*u,this.y=r+a*u+s*c-i*l,this.z=n+a*l+i*u-o*c,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,r=this.y,n=this.z,i=t.elements;return this.x=i[0]*e+i[4]*r+i[8]*n,this.y=i[1]*e+i[5]*r+i[9]*n,this.z=i[2]*e+i[6]*r+i[10]*n,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=b(this.x,t.x,e.x),this.y=b(this.y,t.y,e.y),this.z=b(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=b(this.x,t,e),this.y=b(this.y,t,e),this.z=b(this.z,t,e),this}clampLength(t,e){const r=this.length();return this.divideScalar(r||1).multiplyScalar(b(r,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*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.z=t.z+(e.z-t.z)*r,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const r=t.x,n=t.y,i=t.z,o=e.x,s=e.y,a=e.z;return this.x=n*a-i*s,this.y=i*o-r*a,this.z=r*s-n*o,this}projectOnVector(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const r=t.dot(this)/e;return this.copy(t).multiplyScalar(r)}projectOnPlane(t){return _.copy(this).projectOnVector(t),this.sub(_)}reflect(t){return this.sub(_.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const r=this.dot(t)/e;return Math.acos(b(r,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,r=this.y-t.y,n=this.z-t.z;return e*e+r*r+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,r){const n=Math.sin(e)*t;return this.x=n*Math.sin(r),this.y=Math.cos(e)*t,this.z=n*Math.cos(r),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,r){return this.x=t*Math.sin(e),this.y=r,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),r=this.setFromMatrixColumn(t,1).length(),n=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=r,this.z=n,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,e=2*Math.random()-1,r=Math.sqrt(1-e*e);return this.x=r*Math.cos(t),this.y=e,this.z=r*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const _=new x,w=new v;class k{constructor(t,e,r,n,i,o,s,a,c,u,l,h,f,d,p,g){k.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==t&&this.set(t,e,r,n,i,o,s,a,c,u,l,h,f,d,p,g)}set(t,e,r,n,i,o,s,a,c,u,l,h,f,d,p,g){const y=this.elements;return y[0]=t,y[4]=e,y[8]=r,y[12]=n,y[1]=i,y[5]=o,y[9]=s,y[13]=a,y[2]=c,y[6]=u,y[10]=l,y[14]=h,y[3]=f,y[7]=d,y[11]=p,y[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new k).fromArray(this.elements)}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],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],this}copyPosition(t){const e=this.elements,r=t.elements;return e[12]=r[12],e[13]=r[13],e[14]=r[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,r){return 0===this.determinant()?(t.set(1,0,0),e.set(0,1,0),r.set(0,0,1),this):(t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this)}makeBasis(t,e,r){return this.set(t.x,e.x,r.x,0,t.y,e.y,r.y,0,t.z,e.z,r.z,0,0,0,0,1),this}extractRotation(t){if(0===t.determinant())return this.identity();const e=this.elements,r=t.elements,n=1/S.setFromMatrixColumn(t,0).length(),i=1/S.setFromMatrixColumn(t,1).length(),o=1/S.setFromMatrixColumn(t,2).length();return e[0]=r[0]*n,e[1]=r[1]*n,e[2]=r[2]*n,e[3]=0,e[4]=r[4]*i,e[5]=r[5]*i,e[6]=r[6]*i,e[7]=0,e[8]=r[8]*o,e[9]=r[9]*o,e[10]=r[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,r=t.x,n=t.y,i=t.z,o=Math.cos(r),s=Math.sin(r),a=Math.cos(n),c=Math.sin(n),u=Math.cos(i),l=Math.sin(i);if("XYZ"===t.order){const t=o*u,r=o*l,n=s*u,i=s*l;e[0]=a*u,e[4]=-a*l,e[8]=c,e[1]=r+n*c,e[5]=t-i*c,e[9]=-s*a,e[2]=i-t*c,e[6]=n+r*c,e[10]=o*a}else if("YXZ"===t.order){const t=a*u,r=a*l,n=c*u,i=c*l;e[0]=t+i*s,e[4]=n*s-r,e[8]=o*c,e[1]=o*l,e[5]=o*u,e[9]=-s,e[2]=r*s-n,e[6]=i+t*s,e[10]=o*a}else if("ZXY"===t.order){const t=a*u,r=a*l,n=c*u,i=c*l;e[0]=t-i*s,e[4]=-o*l,e[8]=n+r*s,e[1]=r+n*s,e[5]=o*u,e[9]=i-t*s,e[2]=-o*c,e[6]=s,e[10]=o*a}else if("ZYX"===t.order){const t=o*u,r=o*l,n=s*u,i=s*l;e[0]=a*u,e[4]=n*c-r,e[8]=t*c+i,e[1]=a*l,e[5]=i*c+t,e[9]=r*c-n,e[2]=-c,e[6]=s*a,e[10]=o*a}else if("YZX"===t.order){const t=o*a,r=o*c,n=s*a,i=s*c;e[0]=a*u,e[4]=i-t*l,e[8]=n*l+r,e[1]=l,e[5]=o*u,e[9]=-s*u,e[2]=-c*u,e[6]=r*l+n,e[10]=t-i*l}else if("XZY"===t.order){const t=o*a,r=o*c,n=s*a,i=s*c;e[0]=a*u,e[4]=-l,e[8]=c*u,e[1]=t*l+i,e[5]=o*u,e[9]=r*l-n,e[2]=n*l-r,e[6]=s*u,e[10]=i*l+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(z,t,A)}lookAt(t,e,r){const n=this.elements;return O.subVectors(t,e),0===O.lengthSq()&&(O.z=1),O.normalize(),E.crossVectors(r,O),0===E.lengthSq()&&(1===Math.abs(r.z)?O.x+=1e-4:O.z+=1e-4,O.normalize(),E.crossVectors(r,O)),E.normalize(),j.crossVectors(O,E),n[0]=E.x,n[4]=j.x,n[8]=O.x,n[1]=E.y,n[5]=j.y,n[9]=O.y,n[2]=E.z,n[6]=j.z,n[10]=O.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const r=t.elements,n=e.elements,i=this.elements,o=r[0],s=r[4],a=r[8],c=r[12],u=r[1],l=r[5],h=r[9],f=r[13],d=r[2],p=r[6],g=r[10],y=r[14],m=r[3],b=r[7],v=r[11],x=r[15],_=n[0],w=n[4],k=n[8],S=n[12],M=n[1],z=n[5],A=n[9],E=n[13],j=n[2],O=n[6],T=n[10],P=n[14],I=n[3],C=n[7],F=n[11],R=n[15];return i[0]=o*_+s*M+a*j+c*I,i[4]=o*w+s*z+a*O+c*C,i[8]=o*k+s*A+a*T+c*F,i[12]=o*S+s*E+a*P+c*R,i[1]=u*_+l*M+h*j+f*I,i[5]=u*w+l*z+h*O+f*C,i[9]=u*k+l*A+h*T+f*F,i[13]=u*S+l*E+h*P+f*R,i[2]=d*_+p*M+g*j+y*I,i[6]=d*w+p*z+g*O+y*C,i[10]=d*k+p*A+g*T+y*F,i[14]=d*S+p*E+g*P+y*R,i[3]=m*_+b*M+v*j+x*I,i[7]=m*w+b*z+v*O+x*C,i[11]=m*k+b*A+v*T+x*F,i[15]=m*S+b*E+v*P+x*R,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],r=t[4],n=t[8],i=t[12],o=t[1],s=t[5],a=t[9],c=t[13],u=t[2],l=t[6],h=t[10],f=t[14],d=t[3],p=t[7],g=t[11],y=t[15],m=a*f-c*h,b=s*f-c*l,v=s*h-a*l,x=o*f-c*u,_=o*h-a*u,w=o*l-s*u;return e*(p*m-g*b+y*v)-r*(d*m-g*x+y*_)+n*(d*b-p*x+y*w)-i*(d*v-p*_+g*w)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,r){const n=this.elements;return t.isVector3?(n[12]=t.x,n[13]=t.y,n[14]=t.z):(n[12]=t,n[13]=e,n[14]=r),this}invert(){const t=this.elements,e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],s=t[5],a=t[6],c=t[7],u=t[8],l=t[9],h=t[10],f=t[11],d=t[12],p=t[13],g=t[14],y=t[15],m=e*s-r*o,b=e*a-n*o,v=e*c-i*o,x=r*a-n*s,_=r*c-i*s,w=n*c-i*a,k=u*p-l*d,S=u*g-h*d,M=u*y-f*d,z=l*g-h*p,A=l*y-f*p,E=h*y-f*g,j=m*E-b*A+v*z+x*M-_*S+w*k;if(0===j)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const O=1/j;return t[0]=(s*E-a*A+c*z)*O,t[1]=(n*A-r*E-i*z)*O,t[2]=(p*w-g*_+y*x)*O,t[3]=(h*_-l*w-f*x)*O,t[4]=(a*M-o*E-c*S)*O,t[5]=(e*E-n*M+i*S)*O,t[6]=(g*v-d*w-y*b)*O,t[7]=(u*w-h*v+f*b)*O,t[8]=(o*A-s*M+c*k)*O,t[9]=(r*M-e*A-i*k)*O,t[10]=(d*_-p*v+y*m)*O,t[11]=(l*v-u*_-f*m)*O,t[12]=(s*S-o*z-a*k)*O,t[13]=(e*z-r*S+n*k)*O,t[14]=(p*b-d*x-g*m)*O,t[15]=(u*x-l*b+h*m)*O,this}scale(t){const e=this.elements,r=t.x,n=t.y,i=t.z;return e[0]*=r,e[4]*=n,e[8]*=i,e[1]*=r,e[5]*=n,e[9]*=i,e[2]*=r,e[6]*=n,e[10]*=i,e[3]*=r,e[7]*=n,e[11]*=i,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],r=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],n=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,r,n))}makeTranslation(t,e,r){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,r,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),r=Math.sin(t);return this.set(1,0,0,0,0,e,-r,0,0,r,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),r=Math.sin(t);return this.set(e,0,r,0,0,1,0,0,-r,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),r=Math.sin(t);return this.set(e,-r,0,0,r,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const r=Math.cos(e),n=Math.sin(e),i=1-r,o=t.x,s=t.y,a=t.z,c=i*o,u=i*s;return this.set(c*o+r,c*s-n*a,c*a+n*s,0,c*s+n*a,u*s+r,u*a-n*o,0,c*a-n*s,u*a+n*o,i*a*a+r,0,0,0,0,1),this}makeScale(t,e,r){return this.set(t,0,0,0,0,e,0,0,0,0,r,0,0,0,0,1),this}makeShear(t,e,r,n,i,o){return this.set(1,r,i,0,t,1,o,0,e,n,1,0,0,0,0,1),this}compose(t,e,r){const n=this.elements,i=e._x,o=e._y,s=e._z,a=e._w,c=i+i,u=o+o,l=s+s,h=i*c,f=i*u,d=i*l,p=o*u,g=o*l,y=s*l,m=a*c,b=a*u,v=a*l,x=r.x,_=r.y,w=r.z;return n[0]=(1-(p+y))*x,n[1]=(f+v)*x,n[2]=(d-b)*x,n[3]=0,n[4]=(f-v)*_,n[5]=(1-(h+y))*_,n[6]=(g+m)*_,n[7]=0,n[8]=(d+b)*w,n[9]=(g-m)*w,n[10]=(1-(h+p))*w,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,this}decompose(t,e,r){const n=this.elements;t.x=n[12],t.y=n[13],t.z=n[14];const i=this.determinant();if(0===i)return r.set(1,1,1),e.identity(),this;let o=S.set(n[0],n[1],n[2]).length();const s=S.set(n[4],n[5],n[6]).length(),a=S.set(n[8],n[9],n[10]).length();i<0&&(o=-o),M.copy(this);const c=1/o,u=1/s,l=1/a;return M.elements[0]*=c,M.elements[1]*=c,M.elements[2]*=c,M.elements[4]*=u,M.elements[5]*=u,M.elements[6]*=u,M.elements[8]*=l,M.elements[9]*=l,M.elements[10]*=l,e.setFromRotationMatrix(M),r.x=o,r.y=s,r.z=a,this}makePerspective(t,e,r,n,i,o,s=2e3,a=!1){const c=this.elements,u=2*i/(e-t),l=2*i/(r-n),h=(e+t)/(e-t),f=(r+n)/(r-n);let d,p;if(a)d=i/(o-i),p=o*i/(o-i);else if(s===y)d=-(o+i)/(o-i),p=-2*o*i/(o-i);else{if(2001!==s)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s);d=-o/(o-i),p=-o*i/(o-i)}return c[0]=u,c[4]=0,c[8]=h,c[12]=0,c[1]=0,c[5]=l,c[9]=f,c[13]=0,c[2]=0,c[6]=0,c[10]=d,c[14]=p,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(t,e,r,n,i,o,s=2e3,a=!1){const c=this.elements,u=2/(e-t),l=2/(r-n),h=-(e+t)/(e-t),f=-(r+n)/(r-n);let d,p;if(a)d=1/(o-i),p=o/(o-i);else if(s===y)d=-2/(o-i),p=-(o+i)/(o-i);else{if(2001!==s)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+s);d=-1/(o-i),p=-i/(o-i)}return c[0]=u,c[4]=0,c[8]=0,c[12]=h,c[1]=0,c[5]=l,c[9]=0,c[13]=f,c[2]=0,c[6]=0,c[10]=d,c[14]=p,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(t){const e=this.elements,r=t.elements;for(let t=0;t<16;t++)if(e[t]!==r[t])return!1;return!0}fromArray(t,e=0){for(let r=0;r<16;r++)this.elements[r]=t[r+e];return 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[e+9]=r[9],t[e+10]=r[10],t[e+11]=r[11],t[e+12]=r[12],t[e+13]=r[13],t[e+14]=r[14],t[e+15]=r[15],t}}const S=new x,M=new k,z=new x(0,0,0),A=new x(1,1,1),E=new x,j=new x,O=new x,T=new k,P=new v;class I{constructor(t=0,e=0,r=0,n=I.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=r,this._order=n}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,r,n=this._order){return this._x=t,this._y=e,this._z=r,this._order=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,r=!0){const n=t.elements,i=n[0],o=n[4],s=n[8],a=n[1],c=n[5],u=n[9],l=n[2],h=n[6],f=n[10];switch(e){case"XYZ":this._y=Math.asin(b(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-u,f),this._z=Math.atan2(-o,i)):(this._x=Math.atan2(h,c),this._z=0);break;case"YXZ":this._x=Math.asin(-b(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(s,f),this._z=Math.atan2(a,c)):(this._y=Math.atan2(-l,i),this._z=0);break;case"ZXY":this._x=Math.asin(b(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-l,f),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(a,i));break;case"ZYX":this._y=Math.asin(-b(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(h,f),this._z=Math.atan2(a,i)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(b(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-l,i)):(this._x=0,this._y=Math.atan2(s,f));break;case"XZY":this._z=Math.asin(-b(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(h,c),this._y=Math.atan2(s,i)):(this._x=Math.atan2(-u,f),this._y=0);break;default:m("Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===r&&this._onChangeCallback(),this}setFromQuaternion(t,e,r){return T.makeRotationFromQuaternion(t),this.setFromRotationMatrix(T,e,r)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return P.setFromEuler(this),this.setFromQuaternion(P,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}function C(t){return{id:t?.state?.id??t?.id??t?.refid,type:t?.state?.type??t?.type}}I.DEFAULT_ORDER="XYZ","undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"183"}})),"undefined"!=typeof window&&(window.__THREE__?m("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="183");const F=new I;function R(t,e){F.setFromQuaternion(new v(e.x,e.y,e.z,e.w),"YXZ"),t.rotationX=F.x,t.rotation=-F.y,t.rotationY=F.z}const D="_transferSlotId";const L=new class{constructor(){this._now=0,this._speed=1,this._paused=!1,this._listeners=new Set}get now(){return this._now}get speed(){return this._speed}set speed(t){this._speed=Math.max(0,t),this._speed>0&&(this._paused=!1)}get isPaused(){return this._paused}pause(){this._paused=!0}resume(){this._paused=!1}tick(t){if(this._paused||0===this._speed)return 0;const e=Math.min(t,200)*this._speed;return this._now+=e,this._notify(e),e}step(t){t<=0||(this._now+=t,this._notify(t))}onTick(t){return this._listeners.add(t),()=>this._listeners.delete(t)}_notify(t){this._listeners.forEach(e=>e(t))}};"undefined"!=typeof globalThis&&(globalThis.__THINGS_SCENE_SIM_CLOCK__=L);let N=null;const Y=[],$=new Set;function U(t){if(!t)return;const e=t?.state?.id??t?.id??t?.refid;return void 0!==e?String(e):void 0}const W={beginContext(t){N=t},endContext(){N=null},current:()=>N,log(t){const e={role:t.role,contract:t.contract,componentId:t.componentId??U(t.component),componentType:t.componentType??(r=t.component,r?.state?.type??r?.type),atSimMs:L.now,args:t.args,result:t.result,error:t.error};var r;N?N.pushTrace(e):(Y.push(e),Y.length>500&&Y.shift(),$.forEach(t=>{try{t(e)}catch{}}))},standaloneEvents:()=>[...Y],onStandalone:t=>($.add(t),()=>{$.delete(t)}),clearStandalone(){Y.length=0}};function q(t){if(!t)return;const e=t?.state?.refid??t?.refid;if(null==e)return;const r=String(e);return r.length>0?r:void 0}function B(t){const e={transferId:t.transferId,phase:t.phase,timeline:{...t.timeline}},r=t.sourceId??q(t.source),n=t.targetId??q(t.target),i=t.carrierId??q(t.carrier);return void 0!==r&&(e.sourceId=r),void 0!==n&&(e.targetId=n),void 0!==i&&(e.carrierId=i),void 0!==t.slotId&&(e.slotId=t.slotId),void 0!==t.rejectReason&&(e.rejectReason=t.rejectReason),e}let G=1;class X{constructor(t){this._phase="pending",this._slot=null,this._reservation=null,this._traceEvents=[],this.meta={},this.id="xfer-"+G++,this.source=t.source,this.target=t.target,this.carrier=t.carrier,this.options=t.options??{},this.physical=t.physical??null,this._timeline={initiatedAt:L.now}}pushTrace(t){this._traceEvents.push({atSimMs:t.atSimMs??L.now,...t})}get phase(){return this._phase}get timeline(){return this._timeline}_rollback(){this._phase="rolled-back";const t=this._buildReceipt();return H.append(t),t}_planAndReserve(){this._phase="planning",this._timeline.planStartAt=L.now;const t=this.target.canAccept?.(this.carrier);if(t&&t.ok)this._slot=t.slot;else{if(t&&!t.ok&&"no-slots-defined"!==t.reason)return this._rejectReason=t.reason,this._rollback();if(t||"function"!=typeof this.target.canReceive)this._slot=null;else{if(!this.target.canReceive(this.carrier))return this._rejectReason="cannot-receive",this._rollback();this._slot="function"==typeof this.target.findSlot?this.target.findSlot(this.carrier):null}}return null===this._slot||"function"!=typeof this.target.reserve||"function"!=typeof this.target.commit||(this._reservation=this.target.reserve(this.carrier,{source:this.source}),this._reservation)?(this._timeline.planEndAt=L.now,null):(this._rejectReason="cannot-reserve",this._rollback())}_physicalFailed(t){return this._reservation&&this.target.release?.(this._reservation),this._rejectReason=`physical-failed: ${t.message??"unknown"}`,this._rollback()}_handoffFailed(t){throw this._rejectReason=`handoff-failed: ${t.message??"unknown"}`,this._phase="rolled-back",H.append(this._buildReceipt()),t}_commitReserved(){if(this._reservation&&"function"==typeof this.target.commit){try{this.target.commit(this._reservation,this.carrier,this.options)}catch(t){this.target.release?.(this._reservation),this._handoffFailed(t)}return!0}return!1}_finishCommitted(){this._phase="committed",this._timeline.committedAt=L.now;const t=this._buildReceipt();return H.append(t),t}_runPhysicalSync(){if(!this.physical)return null;this._phase="physical",this._timeline.physicalStartAt=L.now;try{const t=this.physical();t instanceof Promise&&t.catch(()=>{})}catch(t){return this._physicalFailed(t)}return this._timeline.physicalEndAt=L.now,null}async _runPhysicalAsync(){if(!this.physical)return null;this._phase="physical",this._timeline.physicalStartAt=L.now;try{await this.physical()}catch(t){return this._physicalFailed(t)}return this._timeline.physicalEndAt=L.now,null}_runReceiveSync(){const t=this.target.accept??this.target.receive;if("function"==typeof t)try{const e=t.call(this.target,this.carrier,this.options);e instanceof Promise&&e.catch(()=>{})}catch(t){this._handoffFailed(t)}else W.log({role:"target",contract:"handoff:noop",component:this.target,args:{reason:"no-accept-method"}})}async _runReceiveAsync(){const t=this.target.accept??this.target.receive;if("function"==typeof t)try{await t.call(this.target,this.carrier,this.options)}catch(t){this._handoffFailed(t)}else W.log({role:"target",contract:"handoff:noop",component:this.target,args:{reason:"no-accept-method"}})}async execute(){W.beginContext(this),W.log({role:"transfer",contract:"execute:begin",args:{transferId:this.id,source:q(this.source),target:q(this.target),carrier:q(this.carrier)}});try{return await this._executeImpl()}finally{W.log({role:"transfer",contract:"execute:end",args:{transferId:this.id,phase:this._phase}}),W.endContext()}}executeSync(){W.beginContext(this),W.log({role:"transfer",contract:"executeSync:begin",args:{transferId:this.id,source:q(this.source),target:q(this.target),carrier:q(this.carrier)}});try{const t=this._planAndReserve();if(t)return t;const e=this._runPhysicalSync();return e||(this._phase="handoff",this._timeline.handoffAt=L.now,this._commitReserved()||this._runReceiveSync(),this._finishCommitted())}finally{W.log({role:"transfer",contract:"executeSync:end",args:{transferId:this.id,phase:this._phase}}),W.endContext()}}async _executeImpl(){const t=this._planAndReserve();if(t)return t;const e=await this._runPhysicalAsync();return e||(this._phase="handoff",this._timeline.handoffAt=L.now,this._commitReserved()||await this._runReceiveAsync(),this._finishCommitted())}rollback(){if("committed"===this._phase)throw new Error("Cannot rollback a committed transfer");this._rejectReason=this._rejectReason??"manual-rollback",this._phase="rolled-back",H.append(this._buildReceipt())}_buildReceipt(){return{transferId:this.id,source:this.source,target:this.target,carrier:this.carrier,sourceId:q(this.source),targetId:q(this.target),carrierId:q(this.carrier),phase:this._phase,timeline:{...this._timeline},slotId:this._slot?.id,rejectReason:this._rejectReason,traceEvents:[...this._traceEvents],meta:Object.keys(this.meta).length>0?{...this.meta}:void 0}}}const H=new class{constructor(){this._flows=new Map,this._targetCount=new Map,this._byPhase=new Map,this._byRejectReason=new Map,this._total=0,this._committedDurationSum=0,this._committedCount=0,this._listeners=new Set}append(t){this._total++,this._byPhase.set(t.phase,(this._byPhase.get(t.phase)??0)+1);const e=t.sourceId??q(t.source),r=t.targetId??q(t.target);if("committed"===t.phase){if(e&&r){const t=e+">"+r;this._flows.set(t,(this._flows.get(t)??0)+1)}r&&this._targetCount.set(r,(this._targetCount.get(r)??0)+1),void 0!==t.timeline.committedAt&&(this._committedDurationSum+=t.timeline.committedAt-t.timeline.initiatedAt,this._committedCount++)}else if("rolled-back"===t.phase&&t.rejectReason){this._byRejectReason.set(t.rejectReason,(this._byRejectReason.get(t.rejectReason)??0)+1);try{t.source?._bumpRejected?.(t.carrier,t.rejectReason)}catch{}}this._listeners.forEach(e=>e(t))}flows(){return this._flows}targetCounts(){return this._targetCount}stats(){const t={};this._byPhase.forEach((e,r)=>{t[r]=e});const e=t["rolled-back"]??0;return{total:this._total,byPhase:t,committed:t.committed??0,rolledBack:e,rejectionRate:this._total>0?e/this._total:0,avgTransferDurationMs:this._committedCount>0?this._committedDurationSum/this._committedCount:0}}rejectReasonCounts(){return this._byRejectReason}subscribe(t){return this._listeners.add(t),()=>{this._listeners.delete(t)}}clear(){this._flows.clear(),this._targetCount.clear(),this._byPhase.clear(),this._byRejectReason.clear(),this._total=0,this._committedDurationSum=0,this._committedCount=0}entries(){return[]}forCarrier(t){return[]}forCarrierId(t){return[]}forSourceId(t){return[]}forTargetId(t){return[]}forPhase(t){return[]}inTimeRange(t,e,r){return[]}groupByRejectReason(){return new Map}toJSON(){return[]}fromJSON(t){}replayTo(t){}setMaxEntries(t){}};"undefined"!=typeof globalThis&&(globalThis.__THINGS_SCENE_TRANSFER_LOG__=H);let Z=1;function V(t,e){return t.startSimMs<e.endSimMs&&e.startSimMs<t.endSimMs}const Q={resolveConflict:(t,e)=>t.priority!==e.priority?t.priority<e.priority?"b-yields":"a-yields":t.id<e.id?"b-yields":"a-yields"};class J{constructor(t=Q){this._byResource=new Map,this._byReserver=new Map,this._listeners=new Set,this._conflictLog=[],this._maxConflictLog=1e3,this._yieldPolicy=t}add(t){const e={...t,id:"res-"+Z++},r=(this._byResource.get(e.resource)??[]).filter(t=>V(t.timeWindow,e.timeWindow));if(0===r.length)return this._insert(e),this._emit({kind:"added",reservation:e}),{ok:!0,reservation:e};const n=r.map(t=>{const r=this._yieldPolicy.resolveConflict(e,t);return{a:e,b:t,decision:r}});if(n.every(t=>"b-yields"===t.decision)){const n=r.slice();for(const t of n)this._remove(t),this._emit({kind:"evicted",reservation:t,by:e});return this._insert(e),this._emit({kind:"added",reservation:e}),this._appendConflictLog({simTime:e.timeWindow.startSimMs,resource:e.resource,proposed:t,existing:n,outcome:"preempted"}),{ok:"preempted",reservation:e,evicted:n}}return this._appendConflictLog({simTime:e.timeWindow.startSimMs,resource:e.resource,proposed:t,existing:r.slice(),outcome:"rejected"}),{ok:!1,conflicts:n}}conflictLog(){return[...this._conflictLog]}setMaxConflictLog(t){this._maxConflictLog=Math.max(1,t)}_appendConflictLog(t){this._conflictLog.push(t),this._conflictLog.length>this._maxConflictLog&&this._conflictLog.shift()}conflicts(t,e){return(this._byResource.get(t)??[]).filter(t=>V(t.timeWindow,e))}release(t){this._remove(t)&&this._emit({kind:"released",reservation:t})}releaseAllOf(t){const e=(this._byReserver.get(t)??[]).slice();for(const t of e)this._remove(t),this._emit({kind:"released",reservation:t});return e}forResource(t){return[...this._byResource.get(t)??[]]}forReserver(t){return[...this._byReserver.get(t)??[]]}all(){const t=[];for(const e of this._byResource.values())t.push(...e);return t}clear(){this._byResource.clear(),this._byReserver.clear(),this._conflictLog.length=0}subscribe(t){return this._listeners.add(t),()=>{this._listeners.delete(t)}}_insert(t){let e=this._byResource.get(t.resource);e||(e=[],this._byResource.set(t.resource,e));const r=e.findIndex(e=>e.timeWindow.startSimMs>t.timeWindow.startSimMs);r<0?e.push(t):e.splice(r,0,t);let n=this._byReserver.get(t.reserverId);n||(n=[],this._byReserver.set(t.reserverId,n)),n.push(t)}_remove(t){const e=this._byResource.get(t.resource);if(!e)return!1;const r=e.findIndex(e=>e.id===t.id);if(r<0)return!1;e.splice(r,1),0===e.length&&this._byResource.delete(t.resource);const n=this._byReserver.get(t.reserverId);if(n){const e=n.findIndex(e=>e.id===t.id);e>=0&&n.splice(e,1),0===n.length&&this._byReserver.delete(t.reserverId)}return!0}_emit(t){this._listeners.forEach(e=>e(t))}}const K=new J;"undefined"!=typeof globalThis&&(globalThis.__THINGS_SCENE_RESERVATION_TABLE__=K);class tt{constructor(){this.nodes=new Map,this.edges=new Map,this.laneEndpoints=new Map}addNode(t){this.nodes.has(t.id)||(this.nodes.set(t.id,t),this.edges.set(t.id,[]))}addEdge(t){const e=this.edges.get(t.fromNode);if(!e)throw new Error(`NavGraph.addEdge: source node not found: ${t.fromNode}`);if(!this.nodes.has(t.toNode))throw new Error(`NavGraph.addEdge: target node not found: ${t.toNode}`);e.push(t)}edgesFrom(t){return this.edges.get(t)??[]}findNearestNode(t){let e=null,r=1/0;for(const n of this.nodes.values()){const i=et(n.position,t);i<r&&(r=i,e=n)}return e}}function et(t,e){const r=t.x-e.x,n=t.y-e.y,i=t.z-e.z;return r*r+n*n+i*i}function rt(t,e){return Math.sqrt(et(t,e))}function nt(t,e,r={}){const n=new tt,i=r.defaultSpeed??100;for(const e of t){const t=e.geometry.centerPoints;if(t.length<2)continue;const r=`${e.id}:start`,o=`${e.id}:end`;n.addNode({id:r,position:t[0],type:"lane-start"}),n.addNode({id:o,position:t[t.length-1],type:"lane-end"}),n.laneEndpoints.set(e.id,{startNodeId:r,endNodeId:o});let s=0;for(let e=1;e<t.length;e++)s+=rt(t[e-1],t[e]);const a=s/(e.speedLimit??i)*1e3;n.addEdge({fromNode:r,toNode:o,resource:e.id,distance:s,durationMs:a,forward:!0}),"twoway"===e.direction&&n.addEdge({fromNode:o,toNode:r,resource:e.id,distance:s,durationMs:a,forward:!1})}for(const t of e){if(t.lanes.length<2)continue;const e=[];for(const r of t.lanes){const i=n.laneEndpoints.get(r);if(!i)continue;const o=n.nodes.get(i.startNodeId).position,s=n.nodes.get(i.endNodeId).position;let a=0,c=0,u=0;for(const e of t.lanes){if(e===r)continue;const t=n.laneEndpoints.get(e);if(!t)continue;const i=n.nodes.get(t.startNodeId).position,l=n.nodes.get(t.endNodeId).position;a+=Math.min(et(o,i),et(o,l)),c+=Math.min(et(s,i),et(s,l)),u++}if(0===u)continue;const l=a<c?i.startNodeId:i.endNodeId;e.push({laneId:r,nodeId:l,pos:n.nodes.get(l).position})}for(let r=0;r<e.length;r++)for(let i=0;i<e.length;i++){if(r===i)continue;const o=e[r],s=e[i],a=rt(o.pos,s.pos);n.addEdge({fromNode:o.nodeId,toNode:s.nodeId,resource:t.id,distance:a,durationMs:t.crossingTimeMs,forward:!0})}}return n}function it(t,e,r,n={}){const i=t.nodes.get(e),o=t.nodes.get(r);if(!i||!o)return null;const s=n.speed?.max??100,a=e=>{const r=t.nodes.get(e);var n,i;return(n=r.position,i=o.position,Math.sqrt(function(t,e){const r=t.x-e.x,n=t.y-e.y,i=t.z-e.z;return r*r+n*n+i*i}(n,i)))/s*1e3},c=new Map,u=new Set,l=new Set,h={nodeId:e,gScore:0,fScore:a(e)};c.set(e,h),u.add(e);const f=n.startSimMs??0,d=n.deadlineSimMs;for(;u.size>0;){let e=null,n=null;for(const t of u){const r=c.get(t);(!n||r.fScore<n.fScore||r.fScore===n.fScore&&t<e)&&(n=r,e=t)}if(!n||!e)return null;if(e===r){const t=[];let e=n,r=0;for(;e&&e.cameFromEdge;){const n=e.cameFromEdge,i=f+(e.gScore-n.durationMs);t.unshift({resource:n.resource,timeWindow:{startSimMs:i,endSimMs:i+n.durationMs},fromPos:n.fromPos,toPos:n.toPos}),r+=n.distance,e=c.get(n.fromNodeId)}const i=n.gScore;return void 0!==d&&f+i>d?null:{segments:t,totalDurationMs:i,totalDistance:r}}u.delete(e),l.add(e);for(const r of t.edgesFrom(e)){if(l.has(r.toNode))continue;const e=n.gScore+r.durationMs,i=c.get(r.toNode);if(!i||e<i.gScore){const n=t.nodes.get(r.fromNode),i=t.nodes.get(r.toNode),o={nodeId:r.toNode,gScore:e,fScore:e+a(r.toNode),cameFromEdge:{fromNodeId:r.fromNode,resource:r.resource,distance:r.distance,durationMs:r.durationMs,fromPos:n.position,toPos:i.position}};c.set(r.toNode,o),u.add(r.toNode)}}}return null}function ot(t,e,r=0,n){return t.segments.map(t=>({resource:t.resource,timeWindow:t.timeWindow,reserverId:e,priority:r,metadata:n}))}const st=.5;function at(t){const e=t.bulge;return null!=e&&Number.isFinite(e)&&Math.abs(e)>=.5}function ct(t,e,r){const n=e.x-t.x,i=e.y-t.y,o=Math.sqrt(n*n+i*i);if(0===o||!Number.isFinite(r)||Math.abs(r)<1e-9)return null;const s=Math.abs(r),a=(o*o+4*s*s)/(8*s),c=r>0?1:-1,u=a-s,l=(t.x+e.x)/2-c*(i/o)*u,h=(t.y+e.y)/2-c*-(n/o)*u;return{cx:l,cy:h,radius:a,startAngle:Math.atan2(t.y-h,t.x-l),endAngle:Math.atan2(e.y-h,e.x-l),clockwise:r<0}}function ut(t,e,r=0,n=16){const i=e.x-t.x,o=e.y-t.y,s=Math.sqrt(i*i+o*o);if(0===s)return null;const a=o/s,c=-(i/s),u=Number.isFinite(r)?r:0,l=Math.abs(u)>=1e-6?u:n;return{x:(t.x+e.x)/2+a*l,y:(t.y+e.y)/2+c*l,perpX:a,perpY:c}}function lt(t,e,r){const n=e.x-t.x,i=e.y-t.y,o=Math.sqrt(n*n+i*i);if(0===o)return 0;const s=i/o,a=-(n/o),c=(t.x+e.x)/2,u=(t.y+e.y)/2;let l=(r.x-c)*s+(r.y-u)*a;if(Math.abs(l)<.5)return 0;return l>o&&(l=o),l<-o&&(l=-o),l}function ht(t,e){const r=t.radius,n=Number.isFinite(e)?e:0;return null!=r&&Number.isFinite(r)?Math.max(0,r):Math.max(0,n)}function ft(t,e,r,n,i=16){const o=t.x-e.x,s=t.y-e.y,a=Math.sqrt(o*o+s*s);if(0===a)return null;const c=r.x-e.x,u=r.y-e.y,l=Math.sqrt(c*c+u*u);if(0===l)return null;const h=o/a+c/l,f=s/a+u/l,d=Math.sqrt(h*h+f*f);if(d<1e-9)return null;const p=h/d,g=f/d,y=Math.max(n,i);return{x:e.x+p*y,y:e.y+g*y,bisectorX:p,bisectorY:g}}function dt(t,e,r,n){const i=t.x-e.x,o=t.y-e.y,s=Math.sqrt(i*i+o*o),a=r.x-e.x,c=r.y-e.y,u=Math.sqrt(a*a+c*c);if(0===s||0===u)return 0;const l=i/s+a/u,h=o/s+c/u,f=Math.sqrt(l*l+h*h);if(f<1e-9)return 0;const d=l/f,p=h/f,g=(n.x-e.x)*d+(n.y-e.y)*p,y=Math.min(s,u)/2;return Math.max(0,Math.min(g,y))}function pt(t){if(0===t.length)return 0;let e;for(const r of t){const t=r.z??0;if(!Number.isFinite(t))return null;if(void 0===e)e=t;else if(Math.abs(t-e)>1e-9)return null}return e??0}const gt={closed:!0,round:0,divisions:24};class yt{constructor(t,e){this.points=t,this.closed=e;const r=[0];for(let e=1;e<t.length;e++){const n=t[e].x-t[e-1].x,i=t[e].y-t[e-1].y;r.push(r[e-1]+Math.sqrt(n*n+i*i))}this.cumulative=r,this.length=r[r.length-1]??0}sample(t){const e=this.length;if(0===this.points.length)return{x:0,y:0,theta:0};if(0===e)return{x:this.points[0].x,y:this.points[0].y,theta:0};let r=t;this.closed?r=(t%e+e)%e:r<0?r=0:r>e&&(r=e);const n=this.cumulative;let i=0,o=n.length-2;for(;i<o;){const t=i+o>>1;n[t+1]<=r?i=t+1:o=t}const s=n[i+1]-n[i],a=s>0?(r-n[i])/s:0,c=this.points[i],u=this.points[i+1],l=u.x-c.x,h=u.y-c.y;return{x:c.x+l*a,y:c.y+h*a,theta:0===l&&0===h?0:Math.atan2(h,l)}}}function mt(t,e={}){const r={...gt,...e},n=t.length;if(0===n)return new yt([],r.closed);if(1===n)return new yt([{x:t[0].x,y:t[0].y}],r.closed);const i=[],o=(t,e)=>{if(i.length>0){const r=i[i.length-1];if(Math.abs(r.x-t)<1e-9&&Math.abs(r.y-e)<1e-9)return}i.push({x:t,y:e})},s=(r.closed,n);for(let e=0;e<s;e++){const i=0===e?r.closed?n-1:-1:e-1,s=e===n-1?r.closed?0:-1:e+1,a=i>=0?t[i]:null,c=t[e],u=s>=0?t[s]:null;if(a&&a.x===c.x&&a.y===c.y)continue;const l=a&&u?ht(c,r.round):0;let h,f,d,p;if(a){const t=Math.sqrt((a.x-c.x)**2+(a.y-c.y)**2),e=0!==t?Math.atan2(a.x-c.x,a.y-c.y):0,r=Math.min(l,t/2);h=Math.sin(e)*r+c.x,f=Math.cos(e)*r+c.y}else h=c.x,f=c.y;if(u){const t=Math.sqrt((u.x-c.x)**2+(u.y-c.y)**2),e=0!==t?Math.atan2(u.x-c.x,u.y-c.y):0,r=Math.min(l,t/2);d=Math.sin(e)*r+c.x,p=Math.cos(e)*r+c.y}else d=c.x,p=c.y;if(o(h,f),l>0&&a&&u)for(let t=1;t<=r.divisions;t++){const e=t/r.divisions,n=1-e;o(n*n*h+2*n*e*c.x+e*e*d,n*n*f+2*n*e*c.y+e*e*p)}else h===d&&f===p||o(d,p);if(u&&at(c)){const t=ht(u,r.round),e=Math.sqrt((c.x-u.x)**2+(c.y-u.y)**2),n=0!==e?Math.atan2(c.x-u.x,c.y-u.y):0,i=Math.min(t,e/2),s=ct({x:d,y:p},{x:Math.sin(n)*i+u.x,y:Math.cos(n)*i+u.y},c.bulge);if(s){let t=s.endAngle-s.startAngle;if(s.clockwise)for(;t>0;)t-=2*Math.PI;else for(;t<0;)t+=2*Math.PI;for(let e=1;e<=r.divisions;e++){const n=e/r.divisions,i=s.startAngle+t*n;o(s.cx+s.radius*Math.cos(i),s.cy+s.radius*Math.sin(i))}}}}if(r.closed&&i.length>0){const t=i[0],e=i[i.length-1];(Math.abs(e.x-t.x)>1e-9||Math.abs(e.y-t.y)>1e-9)&&i.push({x:t.x,y:t.y})}return new yt(i,r.closed)}function bt(t,e){return mt(t,e).length}function vt(t){return!!t&&"function"==typeof t.capacity&&"function"==typeof t.available}function xt(t){if(vt(t)){const e=t.capacity(),r=t.available();return{capacity:e,available:r,isFull:0===r}}if("function"==typeof t?.slotIds){const e=t.slotIds().length,r="function"==typeof t.emptySlotIds?t.emptySlotIds().length:e;return{capacity:e,available:r,isFull:0===r}}const e=t?.state?.capacity,r=Array.isArray(t?.state?.data)?t.state.data.length:0;if("number"==typeof e){const t=Math.max(0,e-r);return{capacity:e,available:t,isFull:0===t}}return{capacity:1/0,available:1/0,isFull:!1}}class _t{constructor(){this.wasFull=!1,this.availableListeners=[],this.fullListeners=[]}notify(t){const e=0===t;if(e&&!this.wasFull){this.wasFull=!0;for(const t of this.fullListeners)try{t()}catch(t){}}else if(!e&&this.wasFull){this.wasFull=!1;for(const t of this.availableListeners)try{t()}catch(t){}}}onAvailable(t){return this.availableListeners.push(t),()=>{const e=this.availableListeners.indexOf(t);e>=0&&this.availableListeners.splice(e,1)}}onFull(t){return this.fullListeners.push(t),()=>{const e=this.fullListeners.indexOf(t);e>=0&&this.fullListeners.splice(e,1)}}dispose(){this.availableListeners=[],this.fullListeners=[]}}function wt(t,e){if(!t||!e)return()=>{};if("function"!=typeof t.pauseEmit||"function"!=typeof t.resumeEmit)return()=>{};if("function"!=typeof e.onFull||"function"!=typeof e.onAvailable)return()=>{};const r=e.onFull(()=>t.pauseEmit()),n=e.onAvailable(()=>t.resumeEmit());return xt(e).isFull&&t.pauseEmit(),()=>{r?.(),n?.()}}class kt{constructor(t,e=1,r="horizontal"){this.owner=t,this.itemSpacing=e,this.axis=r}positionAt(t,e,r,n){const i=e.maxCount??1/0;if(t<0||t>=i)return null;const o=this.owner?.state?.width??0,s=this.owner?.state?.height??0,a=n?.state?.width??0,c=n?.state?.height??0;return"horizontal"===this.axis?{x:t*this.itemSpacing,y:Math.max(0,(s-c)/2),z:0}:{x:Math.max(0,(o-a)/2),y:t*this.itemSpacing,z:0}}capacity(t){return t.maxCount??1/0}}function St(t,e,r,n,i,o,s){const a=r.w,c=r.h,u=n.w,l=n.h,h=n.d,f=[],d=u+i,p=l+i,g=Math.max(1,Math.floor((a+i)/d)),y=Math.max(1,Math.floor((c+i)/p)),m=g*y,b=o&&o>0?Math.floor(o):4;if("row"===t||"column"===t){const r=s?.advanceAlongX??!1,n=s?.reverse??!1,i=r?g:y,o=r?y:g,u=(t,e,n)=>((t,e,r)=>f.push({x:-a/2+(t+.5)*d,y:r*h+h/2,z:-c/2+(e+.5)*p}))(r?t:e,r?e:t,n);let l=0;for(let r=0;r<i&&l<e;r++){const s=n?i-1-r:r;if("column"===t)for(let t=0;t<o&&l<e;t++)for(let r=0;r<b&&l<e;r++)u(s,t,r),l++;else for(let t=0;t<b&&l<e;t++)for(let r=0;r<o&&l<e;r++)u(s,r,t),l++}return f}if("pyramid"===t){let t=e,r=0;for(;t>0;){const e=Math.max(1,g-r),n=Math.max(1,y-r),i=e*n,s=Math.min(t,i);for(let t=0;t<s;t++){const i=t%e,o=Math.floor(t/e),s=-a/2+(i+(g-e)/2+.5)*d,u=-c/2+(o+(y-n)/2+.5)*p;f.push({x:s,y:r*h+h/2,z:u})}if(t-=s,r++,1===e&&1===n){for(let e=0;e<t;e++)f.push({x:0,y:(r+e)*h+h/2,z:0});break}if(o&&r>=o)break}return f}if("pile"===t){const t=t=>(43758.5453*Math.sin(12.9898*t)%1+1)%1;for(let r=0;r<e;r++){const e=Math.floor(r/m),n=r%m,i=n%g,s=Math.floor(n/g),y=(t(2*r)-.5)*u*.2,b=(t(2*r+1)-.5)*l*.2,v=-a/2+(i+.5)*d+y,x=-c/2+(s+.5)*p+b;if(f.push({x:v,y:e*h+h/2,z:x}),o&&e>=o-1&&n===m-1)break}return f}for(let r=0;r<e;r++){const e=Math.floor(r/m);if(o&&e>=o)break;const n=r%m,i=n%g,s=Math.floor(n/g);let u=-a/2+(i+.5)*d;const l=-c/2+(s+.5)*p;"staggered"===t&&e%2==1&&(u+=d/2),f.push({x:u,y:e*h+h/2,z:l})}return f}class Mt{constructor(t,e={}){this.pattern=t,this.defaults=e}layout(t,e,r,n={}){const i=n.gap??this.defaults.gap??0,o=n.heightLimit??this.defaults.heightLimit,s=n.fill??this.defaults.fill;return St(this.pattern,t,e,r,i,o,s).map(t=>({position:t}))}}class zt{constructor(t,e,r={}){this.cols=t,this.rows=e,this.defaults=r}layout(t,e,r,n={}){const i=Math.max(1,this.cols),o=Math.max(1,this.rows),s=i*o,a=n.gap??this.defaults.gap??0,c=r.w+a,u=r.h+a,l=[];for(let e=0;e<t;e++){const t=Math.floor(e/s),n=e%s,a=n%i,h=Math.floor(n/i);l.push({position:{x:(a-(i-1)/2)*c,z:(h-(o-1)/2)*u,y:t*r.d+r.d/2}})}return l}}class At{constructor(t=.1,e=!1,r=!1){this.gapRatio=t,this.fillFromFar=e,this.sliceFirst=r}grid(t,e){const r=e.w*this.gapRatio,n=e.h*this.gapRatio;return{cols:Math.max(1,Math.floor((t.w-r)/(e.w+r))),rows:Math.max(1,Math.floor((t.h-n)/(e.h+n))),pitchX:e.w+r,pitchZ:e.h+n}}capacity(t,e,r){const{cols:n,rows:i}=this.grid(t,e);return n*i*Math.max(1,Math.floor(r))}layout(t,e,r,n={}){const{cols:i,rows:o,pitchX:s,pitchZ:a}=this.grid(e,r),c=r.d+r.d*this.gapRatio,u=null!=n.heightLimit?Math.max(1,Math.floor(n.heightLimit)):1/0,l=Number.isFinite(u),h=this.sliceFirst&&l,f=i*o,d=i*(l?u:1),p=i*o*(l?u:t),g=Math.min(t,p),y=[];for(let t=0;t<g;t++){let e,n,u;if(h){const r=Math.floor(t/d),o=t%d;e=o%i,u=Math.floor(o/i),n=r}else{u=Math.floor(t/f);const r=t%f;e=r%i,n=Math.floor(r/i)}this.fillFromFar&&(n=o-1-n),y.push({position:{x:(e-(i-1)/2)*s,z:(n-(o-1)/2)*a,y:u*c+r.d/2}})}return y}}function Et(t,e,r,n=0){for(let i=0;i<e.length;i++){const o=e[i],s=r[i];o&&s&&(o.parent!==t&&t.attach(o),o.position.set(s.position.x,n+s.position.y,s.position.z),s.rotation?o.quaternion.set(s.rotation.x,s.rotation.y,s.rotation.z,s.rotation.w):o.quaternion.identity())}}function jt(t,e,r,n=.12){const i=e.left+e.width/2,o=e.top+e.height/2,s=Math.min(r.w,r.h)*n,a=new Map;for(const e of t){const t=`${Math.round(e.position.x)},${Math.round(e.position.z)}`;let n=a.get(t);n||(n={x:i+e.position.x-r.w/2+s,y:o+e.position.z-r.h/2+s,w:r.w-2*s,h:r.h-2*s,count:0},a.set(t,n)),n.count++}return[...a.values()]}function Ot(t,e){return t===e||t!=t&&e!=e}function Tt(t,e){for(var r=t.length;r--;)if(Ot(t[r][0],e))return r;return-1}var Pt=Array.prototype.splice;function It(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}It.prototype.clear=function(){this.__data__=[],this.size=0},It.prototype.delete=function(t){var e=this.__data__,r=Tt(e,t);return!(r<0)&&(r==e.length-1?e.pop():Pt.call(e,r,1),--this.size,!0)},It.prototype.get=function(t){var e=this.__data__,r=Tt(e,t);return r<0?void 0:e[r][1]},It.prototype.has=function(t){return Tt(this.__data__,t)>-1},It.prototype.set=function(t,e){var r=this.__data__,n=Tt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};var Ct="object"==typeof global&&global&&global.Object===Object&&global,Ft="object"==typeof self&&self&&self.Object===Object&&self,Rt=Ct||Ft||Function("return this")(),Dt=Rt.Symbol,Lt=Object.prototype,Nt=Lt.hasOwnProperty,Yt=Lt.toString,$t=Dt?Dt.toStringTag:void 0;var Ut=Object.prototype.toString;var Wt=Dt?Dt.toStringTag:void 0;function qt(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Wt&&Wt in Object(t)?function(t){var e=Nt.call(t,$t),r=t[$t];try{t[$t]=void 0;var n=!0}catch(t){}var i=Yt.call(t);return n&&(e?t[$t]=r:delete t[$t]),i}(t):function(t){return Ut.call(t)}(t)}function Bt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Gt(t){if(!Bt(t))return!1;var e=qt(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}var Xt,Ht=Rt["__core-js_shared__"],Zt=(Xt=/[^.]+$/.exec(Ht&&Ht.keys&&Ht.keys.IE_PROTO||""))?"Symbol(src)_1."+Xt:"";var Vt=Function.prototype.toString;function Qt(t){if(null!=t){try{return Vt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var Jt=/^\[object .+?Constructor\]$/,Kt=Function.prototype,te=Object.prototype,ee=Kt.toString,re=te.hasOwnProperty,ne=RegExp("^"+ee.call(re).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ie(t){return!(!Bt(t)||(e=t,Zt&&Zt in e))&&(Gt(t)?ne:Jt).test(Qt(t));var e}function oe(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return ie(r)?r:void 0}var se=oe(Rt,"Map"),ae=oe(Object,"create");var ce=Object.prototype.hasOwnProperty;var ue=Object.prototype.hasOwnProperty;function le(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function he(t,e){var r=t.__data__;return function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}(e)?r["string"==typeof e?"string":"hash"]:r.map}function fe(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}le.prototype.clear=function(){this.__data__=ae?ae(null):{},this.size=0},le.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},le.prototype.get=function(t){var e=this.__data__;if(ae){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return ce.call(e,t)?e[t]:void 0},le.prototype.has=function(t){var e=this.__data__;return ae?void 0!==e[t]:ue.call(e,t)},le.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=ae&&void 0===e?"__lodash_hash_undefined__":e,this},fe.prototype.clear=function(){this.size=0,this.__data__={hash:new le,map:new(se||It),string:new le}},fe.prototype.delete=function(t){var e=he(this,t).delete(t);return this.size-=e?1:0,e},fe.prototype.get=function(t){return he(this,t).get(t)},fe.prototype.has=function(t){return he(this,t).has(t)},fe.prototype.set=function(t,e){var r=he(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function de(t){var e=this.__data__=new It(t);this.size=e.size}de.prototype.clear=function(){this.__data__=new It,this.size=0},de.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},de.prototype.get=function(t){return this.__data__.get(t)},de.prototype.has=function(t){return this.__data__.has(t)},de.prototype.set=function(t,e){var r=this.__data__;if(r instanceof It){var n=r.__data__;if(!se||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new fe(n)}return r.set(t,e),this.size=r.size,this};function pe(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new fe;++e<r;)this.add(t[e])}function ge(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}pe.prototype.add=pe.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},pe.prototype.has=function(t){return this.__data__.has(t)};function ye(t,e,r,n,i,o){var s=1&r,a=t.length,c=e.length;if(a!=c&&!(s&&c>a))return!1;var u=o.get(t),l=o.get(e);if(u&&l)return u==e&&l==t;var h=-1,f=!0,d=2&r?new pe:void 0;for(o.set(t,e),o.set(e,t);++h<a;){var p=t[h],g=e[h];if(n)var y=s?n(g,p,h,e,t,o):n(p,g,h,t,e,o);if(void 0!==y){if(y)continue;f=!1;break}if(d){if(!ge(e,function(t,e){if(s=e,!d.has(s)&&(p===t||i(p,t,r,n,o)))return d.push(e);var s})){f=!1;break}}else if(p!==g&&!i(p,g,r,n,o)){f=!1;break}}return o.delete(t),o.delete(e),f}var me=Rt.Uint8Array;function be(t){var e=-1,r=Array(t.size);return t.forEach(function(t,n){r[++e]=[n,t]}),r}function ve(t){var e=-1,r=Array(t.size);return t.forEach(function(t){r[++e]=t}),r}var xe=Dt?Dt.prototype:void 0,_e=xe?xe.valueOf:void 0;function we(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var ke=Array.isArray;function Se(){return[]}var Me=Object.prototype.propertyIsEnumerable,ze=Object.getOwnPropertySymbols,Ae=ze?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var r=-1,n=null==t?0:t.length,i=0,o=[];++r<n;){var s=t[r];e(s,r,t)&&(o[i++]=s)}return o}(ze(t),function(e){return Me.call(t,e)}))}:Se;function Ee(t){return null!=t&&"object"==typeof t}function je(t){return Ee(t)&&"[object Arguments]"==qt(t)}var Oe=Object.prototype,Te=Oe.hasOwnProperty,Pe=Oe.propertyIsEnumerable,Ie=je(function(){return arguments}())?je:function(t){return Ee(t)&&Te.call(t,"callee")&&!Pe.call(t,"callee")};var Ce="object"==typeof exports&&exports&&!exports.nodeType&&exports,Fe=Ce&&"object"==typeof module&&module&&!module.nodeType&&module,Re=Fe&&Fe.exports===Ce?Rt.Buffer:void 0,De=(Re?Re.isBuffer:void 0)||function(){return!1},Le=/^(?:0|[1-9]\d*)$/;function Ne(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&Le.test(t))&&t>-1&&t%1==0&&t<e}function Ye(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}var $e={};function Ue(t){return function(e){return t(e)}}$e["[object Float32Array]"]=$e["[object Float64Array]"]=$e["[object Int8Array]"]=$e["[object Int16Array]"]=$e["[object Int32Array]"]=$e["[object Uint8Array]"]=$e["[object Uint8ClampedArray]"]=$e["[object Uint16Array]"]=$e["[object Uint32Array]"]=!0,$e["[object Arguments]"]=$e["[object Array]"]=$e["[object ArrayBuffer]"]=$e["[object Boolean]"]=$e["[object DataView]"]=$e["[object Date]"]=$e["[object Error]"]=$e["[object Function]"]=$e["[object Map]"]=$e["[object Number]"]=$e["[object Object]"]=$e["[object RegExp]"]=$e["[object Set]"]=$e["[object String]"]=$e["[object WeakMap]"]=!1;var We="object"==typeof exports&&exports&&!exports.nodeType&&exports,qe=We&&"object"==typeof module&&module&&!module.nodeType&&module,Be=qe&&qe.exports===We&&Ct.process,Ge=function(){try{var t=qe&&qe.require&&qe.require("util").types;return t||Be&&Be.binding&&Be.binding("util")}catch(t){}}(),Xe=Ge&&Ge.isTypedArray,He=Xe?Ue(Xe):function(t){return Ee(t)&&Ye(t.length)&&!!$e[qt(t)]},Ze=Object.prototype.hasOwnProperty;function Ve(t,e){var r=ke(t),n=!r&&Ie(t),i=!r&&!n&&De(t),o=!r&&!n&&!i&&He(t),s=r||n||i||o,a=s?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],c=a.length;for(var u in t)!e&&!Ze.call(t,u)||s&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||Ne(u,c))||a.push(u);return a}var Qe=Object.prototype;function Je(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Qe)}function Ke(t,e){return function(r){return t(e(r))}}var tr=Ke(Object.keys,Object),er=Object.prototype.hasOwnProperty;function rr(t){if(!Je(t))return tr(t);var e=[];for(var r in Object(t))er.call(t,r)&&"constructor"!=r&&e.push(r);return e}function nr(t){return null!=t&&Ye(t.length)&&!Gt(t)}function ir(t){return nr(t)?Ve(t):rr(t)}function or(t){return function(t,e,r){var n=e(t);return ke(t)?n:we(n,r(t))}(t,ir,Ae)}var sr=Object.prototype.hasOwnProperty;var ar=oe(Rt,"DataView"),cr=oe(Rt,"Promise"),ur=oe(Rt,"Set"),lr=oe(Rt,"WeakMap"),hr="[object Map]",fr="[object Promise]",dr="[object Set]",pr="[object WeakMap]",gr="[object DataView]",yr=Qt(ar),mr=Qt(se),br=Qt(cr),vr=Qt(ur),xr=Qt(lr),_r=qt;(ar&&_r(new ar(new ArrayBuffer(1)))!=gr||se&&_r(new se)!=hr||cr&&_r(cr.resolve())!=fr||ur&&_r(new ur)!=dr||lr&&_r(new lr)!=pr)&&(_r=function(t){var e=qt(t),r="[object Object]"==e?t.constructor:void 0,n=r?Qt(r):"";if(n)switch(n){case yr:return gr;case mr:return hr;case br:return fr;case vr:return dr;case xr:return pr}return e});var wr="[object Arguments]",kr="[object Array]",Sr="[object Object]",Mr=Object.prototype.hasOwnProperty;function zr(t,e,r,n,i,o){var s=ke(t),a=ke(e),c=s?kr:_r(t),u=a?kr:_r(e),l=(c=c==wr?Sr:c)==Sr,h=(u=u==wr?Sr:u)==Sr,f=c==u;if(f&&De(t)){if(!De(e))return!1;s=!0,l=!1}if(f&&!l)return o||(o=new de),s||He(t)?ye(t,e,r,n,i,o):function(t,e,r,n,i,o,s){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!o(new me(t),new me(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Ot(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var a=be;case"[object Set]":var c=1&n;if(a||(a=ve),t.size!=e.size&&!c)return!1;var u=s.get(t);if(u)return u==e;n|=2,s.set(t,e);var l=ye(a(t),a(e),n,i,o,s);return s.delete(t),l;case"[object Symbol]":if(_e)return _e.call(t)==_e.call(e)}return!1}(t,e,c,r,n,i,o);if(!(1&r)){var d=l&&Mr.call(t,"__wrapped__"),p=h&&Mr.call(e,"__wrapped__");if(d||p){var g=d?t.value():t,y=p?e.value():e;return o||(o=new de),i(g,y,r,n,o)}}return!!f&&(o||(o=new de),function(t,e,r,n,i,o){var s=1&r,a=or(t),c=a.length;if(c!=or(e).length&&!s)return!1;for(var u=c;u--;){var l=a[u];if(!(s?l in e:sr.call(e,l)))return!1}var h=o.get(t),f=o.get(e);if(h&&f)return h==e&&f==t;var d=!0;o.set(t,e),o.set(e,t);for(var p=s;++u<c;){var g=t[l=a[u]],y=e[l];if(n)var m=s?n(y,g,l,e,t,o):n(g,y,l,t,e,o);if(!(void 0===m?g===y||i(g,y,r,n,o):m)){d=!1;break}p||(p="constructor"==l)}if(d&&!p){var b=t.constructor,v=e.constructor;b==v||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof v&&v instanceof v||(d=!1)}return o.delete(t),o.delete(e),d}(t,e,r,n,i,o))}function Ar(t,e,r,n,i){return t===e||(null==t||null==e||!Ee(t)&&!Ee(e)?t!=t&&e!=e:zr(t,e,r,n,Ar,i))}function Er(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&!1!==e(t[r],r,t););return t}var jr=function(){try{var t=oe(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();function Or(t,e,r){"__proto__"==e&&jr?jr(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var Tr=Object.prototype.hasOwnProperty;function Pr(t,e,r){var n=t[e];Tr.call(t,e)&&Ot(n,r)&&(void 0!==r||e in t)||Or(t,e,r)}function Ir(t,e,r,n){var i=!r;r||(r={});for(var o=-1,s=e.length;++o<s;){var a=e[o],c=n?n(r[a],t[a],a,r,t):void 0;void 0===c&&(c=t[a]),i?Or(r,a,c):Pr(r,a,c)}return r}function Cr(t){return t}function Fr(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)}var Rr=Math.max;function Dr(t){return function(){return t}}var Lr=jr?function(t,e){return jr(t,"toString",{configurable:!0,enumerable:!1,value:Dr(e),writable:!0})}:Cr,Nr=Date.now;var Yr,$r,Ur,Wr=(Yr=Lr,$r=0,Ur=0,function(){var t=Nr(),e=16-(t-Ur);if(Ur=t,e>0){if(++$r>=800)return arguments[0]}else $r=0;return Yr.apply(void 0,arguments)});function qr(t,e){return Wr(function(t,e,r){return e=Rr(void 0===e?t.length-1:e,0),function(){for(var n=arguments,i=-1,o=Rr(n.length-e,0),s=Array(o);++i<o;)s[i]=n[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=n[i];return a[e]=r(s),Fr(t,this,a)}}(t,e,Cr),t+"")}function Br(t,e,r){if(!Bt(r))return!1;var n=typeof e;return!!("number"==n?nr(r)&&Ne(e,r.length):"string"==n&&e in r)&&Ot(r[e],t)}var Gr,Xr=(Gr=function(t,e,r,n){Ir(e,ir(e),t,n)},qr(function(t,e){var r=-1,n=e.length,i=n>1?e[n-1]:void 0,o=n>2?e[2]:void 0;for(i=Gr.length>3&&"function"==typeof i?(n--,i):void 0,o&&Br(e[0],e[1],o)&&(i=n<3?void 0:i,n=1),t=Object(t);++r<n;){var s=e[r];s&&Gr(t,s,r,i)}return t})),Hr=Ke(Object.getPrototypeOf,Object),Zr=Function.prototype,Vr=Object.prototype,Qr=Zr.toString,Jr=Vr.hasOwnProperty,Kr=Qr.call(Object);function tn(t){if(!Ee(t))return!1;var e=qt(t);return"[object Error]"==e||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!function(t){if(!Ee(t)||"[object Object]"!=qt(t))return!1;var e=Hr(t);if(null===e)return!0;var r=Jr.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&Qr.call(r)==Kr}(t)}var en=qr(function(t,e){try{return Fr(t,void 0,e)}catch(t){return tn(t)?t:new Error(t)}});function rn(t,e){for(var r=-1,n=null==t?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var nn=Object.prototype,on=nn.hasOwnProperty;function sn(t,e,r,n){return void 0===t||Ot(t,nn[r])&&!on.call(n,r)?e:t}var an={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function cn(t){return"\\"+an[t]}var un=/<%=([\s\S]+?)%>/g;var ln,hn=(ln={"&":"&","<":"<",">":">",'"':""","'":"'"},function(t){return null==ln?void 0:ln[t]});function fn(t){return"symbol"==typeof t||Ee(t)&&"[object Symbol]"==qt(t)}var dn=Dt?Dt.prototype:void 0,pn=dn?dn.toString:void 0;function gn(t){if("string"==typeof t)return t;if(ke(t))return rn(t,gn)+"";if(fn(t))return pn?pn.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function yn(t){return null==t?"":gn(t)}var mn=/[&<>"']/g,bn=RegExp(mn.source);var vn={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:un,variable:"",imports:{_:{escape:function(t){return(t=yn(t))&&bn.test(t)?t.replace(mn,hn):t}}}},xn=/\b__p \+= '';/g,_n=/\b(__p \+=) '' \+/g,wn=/(__e\(.*?\)|\b__t\)) \+\n'';/g,kn=/[()=,{}\[\]\/\s]/,Sn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Mn=/($^)/,zn=/['\n\r\u2028\u2029\\]/g,An=Object.prototype.hasOwnProperty;var En=Object.prototype.hasOwnProperty;function jn(t){if(!Bt(t))return function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}(t);var e=Je(t),r=[];for(var n in t)("constructor"!=n||!e&&En.call(t,n))&&r.push(n);return r}function On(t,e){return t&&Ir(e,function(t){return nr(t)?Ve(t,!0):jn(t)}(e),t)}var Tn="object"==typeof exports&&exports&&!exports.nodeType&&exports,Pn=Tn&&"object"==typeof module&&module&&!module.nodeType&&module,In=Pn&&Pn.exports===Tn?Rt.Buffer:void 0,Cn=In?In.allocUnsafe:void 0;var Fn=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)we(e,Ae(t)),t=Hr(t);return e}:Se;var Rn=Object.prototype.hasOwnProperty;var Dn=/\w*$/;var Ln=Dt?Dt.prototype:void 0,Nn=Ln?Ln.valueOf:void 0;function Yn(t,e,r){var n,i,o,s,a,c=t.constructor;switch(e){case"[object ArrayBuffer]":return a=new(s=t).constructor(s.byteLength),new me(a).set(new me(s)),a;case"[object Boolean]":case"[object Date]":return new c(+t);case"[object DataView]":return o=(i=t).buffer,new i.constructor(o,i.byteOffset,i.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(t){var e=t.buffer;return new t.constructor(e,t.byteOffset,t.length)}(t);case"[object Map]":case"[object Set]":return new c;case"[object Number]":case"[object String]":return new c(t);case"[object RegExp]":return function(t){var e=new t.constructor(t.source,Dn.exec(t));return e.lastIndex=t.lastIndex,e}(t);case"[object Symbol]":return n=t,Nn?Object(Nn.call(n)):{}}}var $n=Object.create,Un=function(){function t(){}return function(e){if(!Bt(e))return{};if($n)return $n(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();var Wn=Ge&&Ge.isMap,qn=Wn?Ue(Wn):function(t){return Ee(t)&&"[object Map]"==_r(t)};var Bn=Ge&&Ge.isSet,Gn=Bn?Ue(Bn):function(t){return Ee(t)&&"[object Set]"==_r(t)},Xn="[object Arguments]",Hn="[object Function]",Zn="[object Object]",Vn={};function Qn(t,e,r,n,i,o){var s,a=2&e;if(void 0!==s)return s;if(!Bt(t))return t;var c=ke(t);if(c)return s=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&Rn.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),function(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}(t,s);var u=_r(t),l=u==Hn||"[object GeneratorFunction]"==u;if(De(t))return function(t){var e=t.length,r=Cn?Cn(e):new t.constructor(e);return t.copy(r),r}(t);if(u==Zn||u==Xn||l&&!i)return s=l?{}:function(t){return"function"!=typeof t.constructor||Je(t)?{}:Un(Hr(t))}(t),a?function(t,e){return Ir(t,Fn(t),e)}(t,On(s,t)):function(t,e){return Ir(t,Ae(t),e)}(t,function(t,e){return t&&Ir(e,ir(e),t)}(s,t));if(!Vn[u])return i?t:{};s=Yn(t,u),o||(o=new de);var h=o.get(t);if(h)return h;o.set(t,s),Gn(t)?t.forEach(function(n){s.add(Qn(n,e,r,n,t,o))}):qn(t)&&t.forEach(function(n,i){s.set(i,Qn(n,e,r,i,t,o))});var f=c?void 0:or(t);return Er(f||t,function(n,i){f&&(n=t[i=n]),Pr(s,i,Qn(n,e,r,i,t,o))}),s}Vn[Xn]=Vn["[object Array]"]=Vn["[object ArrayBuffer]"]=Vn["[object DataView]"]=Vn["[object Boolean]"]=Vn["[object Date]"]=Vn["[object Float32Array]"]=Vn["[object Float64Array]"]=Vn["[object Int8Array]"]=Vn["[object Int16Array]"]=Vn["[object Int32Array]"]=Vn["[object Map]"]=Vn["[object Number]"]=Vn[Zn]=Vn["[object RegExp]"]=Vn["[object Set]"]=Vn["[object String]"]=Vn["[object Symbol]"]=Vn["[object Uint8Array]"]=Vn["[object Uint8ClampedArray]"]=Vn["[object Uint16Array]"]=Vn["[object Uint32Array]"]=!0,Vn["[object Error]"]=Vn[Hn]=Vn["[object WeakMap]"]=!1;function Jn(t){return Qn(t,4)}var Kn=/\s/;var ti=/^\s+/;function ei(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&Kn.test(t.charAt(e)););return e}(t)+1).replace(ti,""):t}var ri=/^[-+]0x[0-9a-f]+$/i,ni=/^0b[01]+$/i,ii=/^0o[0-7]+$/i,oi=parseInt;var si=1/0;function ai(t){return t?(t=function(t){if("number"==typeof t)return t;if(fn(t))return NaN;if(Bt(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Bt(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=ei(t);var r=ni.test(t);return r||ii.test(t)?oi(t.slice(2),r?2:8):ri.test(t)?NaN:+t}(t))===si||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ci(t,e){var r;if("function"!=typeof e)throw new TypeError("Expected a function");return t=function(t){var e=ai(t),r=e%1;return e==e?r?e-r:e:0}(t),function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=void 0),r}}var ui=Object.prototype.hasOwnProperty;function li(t){if(null==t)return!0;if(nr(t)&&(ke(t)||"string"==typeof t||"function"==typeof t.splice||De(t)||He(t)||Ie(t)))return!t.length;var e=_r(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(Je(t))return!rr(t).length;for(var r in t)if(ui.call(t,r))return!1;return!0}let hi=0;function fi(t){for(;t&&"object"==typeof t;){const e=t;for(const e in t){t=t[e];break}if(t===e){t=void 0;break}}return t}function di(t,e){if(!this.__collection__)return this;return-1==this.__collection__.indexOf(e)&&this.__collection__.splice(t,0,e),this}function pi(t){return this.__collection__||(this.__collection__=[]),-1==this.__collection__.indexOf(t)&&this.__collection__.push(t),this}function gi(t){return this.__collection__||(this.__collection__=[]),-1==this.__collection__.indexOf(t)&&this.__collection__.unshift(t),this}function yi(t){if(!this.__collection__)return this;const e=this.__collection__.indexOf(t);return e>=0&&this.__collection__.splice(e,1),this}function mi(t){if(this.__collection__)return this.__collection__[t]}function bi(t,e){this.__collection__&&this.__collection__.forEach(t,e)}function vi(t){return this.__collection__?this.__collection__.indexOf(t):-1}function xi(){return this.__collection__?this.__collection__.length:0}function _i(){this.__collection__=[]}function wi(t){const e=this.indexOf(t);-1!=e&&0!=e&&(this.__collection__[e]=this.__collection__[e-1],this.__collection__[e-1]=t)}function ki(t){const e=this.indexOf(t);-1!=e&&e!=this.size()-1&&(this.__collection__[e]=this.__collection__[e+1],this.__collection__[e+1]=t)}function Si(t){const e=this.indexOf(t);if(-1==e||0==e)return;const r=this.__collection__.splice(0,e),n=this.__collection__.splice(1);this.__collection__=this.__collection__.concat(r,n)}function Mi(t){const e=this.indexOf(t);if(-1==e||e==this.size()-1)return;const r=this.__collection__.splice(0,e),n=this.__collection__.splice(1);this.__collection__=r.concat(n,this.__collection__)}class zi{constructor(){this.__collection__=[],this.insertAt=di,this.append=pi,this.prepend=gi,this.remove=yi,this.getAt=mi,this.forEach=bi,this.indexOf=vi,this.size=xi,this.clear=_i,this.moveForward=wi,this.moveBackward=ki,this.moveToHead=Si,this.moveToTail=Mi}}const Ai=new class{constructor(){this.enabled=!1,this.drawCount=0,this.drawTimeSum=0,this.drawTimeLast=0,this.invalidateCount=0,this.triggerCount=0,this.cacheHit=0,this.cacheMiss=0,this._lastSnapshotTime=0,this._frameCount=0,this._getResidents=null}enable(){this.drawCount=0,this.drawTimeSum=0,this.drawTimeLast=0,this.invalidateCount=0,this.triggerCount=0,this.cacheHit=0,this.cacheMiss=0,this._frameCount=0,this._lastSnapshotTime=0,this.enabled=!0}disable(){this.enabled=!1}registerResidents(t){this._getResidents=t}countFrame(){this._frameCount++}snapshot(){this.enabled||this.enable();const t=performance.now(),e=this.drawCount,r=this.cacheHit+this.cacheMiss,n=this._getResidents?.()??null;let i=0;if(this._lastSnapshotTime>0){const e=t-this._lastSnapshotTime;e>0&&(i=Math.round(1e3*this._frameCount/e))}this._lastSnapshotTime=t,this._frameCount=0;const o={fps:i,drawCount:e,drawTimeAvg:e>0?Math.round(this.drawTimeSum/e*100)/100:0,drawTimeLast:Math.round(100*this.drawTimeLast)/100,invalidateCount:this.invalidateCount,triggerCount:this.triggerCount,cacheHitRate:r>0?Math.round(this.cacheHit/r*1e3)/10:0,...n??{}};return this.drawCount=0,this.drawTimeSum=0,this.invalidateCount=0,this.triggerCount=0,this.cacheHit=0,this.cacheMiss=0,o}},Ei=/\s+/;function ji(t,e,r,n){if(!r)return!0;if("object"==typeof r){for(const n in r){const i=r[n];t[e].apply(t,[n,i])}return!1}if(Ei.test(r)){return r.split(Ei).forEach(r=>t[e].apply(t,[r].concat(n))),!1}return!0}const Oi=["on","off","once","delegate_on","delegate_off","trigger","listenTo"],Ti={withEvent(){Oi.forEach(t=>this[t]=Ti[t])},on(t,e,r){if(!ji(this,"on",t,[e,r])||!e)return this;this._listeners||(this._listeners={});return(this._listeners[t]||(this._listeners[t]=[])).push({callback:e,context:r,ctx:r||this}),this},once(t,e,r){if(!ji(this,"once",t,[e,r])||!e)return this;const n=this,i=function(t){return ci(2,t)}(function(){n.off(t,i,r),e.apply(n,arguments)});return i._callback=e,this.on(t,i,r),this},off(t,e,r){if(!this._listeners||!ji(this,"off",t,[e,r]))return this;if(!t&&!e&&!r)return this._listeners=void 0,this;let n;n=t&&"string"==typeof t?[t]:Object.keys(this._listeners||{});for(let t=0;t<n.length;t++){const i=n[t],o=this._listeners?.[i];if(o){const t=[];if(this._listeners[i]=t,e||r)for(let n=0;n<o.length;n++){const i=o[n];(e&&e!==i.callback&&e!==i.callback._callback||r&&r!==i.context)&&t.push(i)}t.length||delete this._listeners[i]}}return this},delegate_on(t){return this._delegators||(this._delegators=new zi),this._delegators.append(t),this},delegate_off(t){return this._delegators?(this._delegators.remove(t),this):this},delegate(){if(this._delegators&&this._delegators.size()>0&&Ii(this._delegators,arguments),!this._listeners)return this;const t=arguments.length-1,e=arguments[t];arguments[t]={origin:e.origin,name:e.name,deliverer:this};const r=this._listeners[e.name],n=this._listeners["(all)"];return r&&Pi(r,arguments),n&&Pi(n,arguments),this},trigger(t){Ai.enabled&&Ai.triggerCount++;const e=[].slice.call(arguments,1);if(e.push({origin:this,name:t,deliverer:this}),this._delegators&&this._delegators.size()>0&&Ii(this._delegators,e),!this._listeners)return this;if(!ji(this,"trigger",t,e))return this;const r=this._listeners[t],n=this._listeners["(all)"];return r&&Pi(r,e),n&&Pi(n,e),this},stopListening(t,e,r){let n=this._listeningTo;if(!n)return this;const i=!e&&!r;r||"object"!=typeof e||(r=this),t&&(n={},n[t._listenId]=t);for(const t in n){const o=n[t];o.off(e,r,this),(i||li(o._events))&&delete this._listeningTo[t]}return this}};function Pi(t,e){t.forEach(t=>t.callback.apply(t.ctx,e))}function Ii(t,e){t.forEach(t=>Ti.delegate.apply(t,e))}const Ci={listenTo:"on",listenToOnce:"once"};for(const t in Ci){const e=Ci[t];Ti[t]=function(t,r,n){this._listeningTo||(this._listeningTo={});const i=this._listeningTo;t._listenId||(t._listenId=`${"l"}${++hi}`);return i[t._listenId]=t,n||"object"!=typeof r||(n=this),t[e](r,n,this),this}}const Fi=Ti.on,Ri=Ti.off,Di=Ti.once,Li=Ti.trigger,Ni=Ti.delegate_on,Yi=Ti.delegate_off;const $i=(...t)=>{const e=[];t.forEach(t=>t&&t.stack&&e.push(t.stack)),console.error("[ERROR]",...t,e.join(" "))};var Ui="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Wi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function qi(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Bi,Gi={exports:{}};var Xi=(Bi||(Bi=1,function(t){var e=function(t){var e,r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,s=Object.create(o.prototype),a=new O(n||[]);return i(s,"_invoke",{value:z(t,r,a)}),s}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f="suspendedStart",d="suspendedYield",p="executing",g="completed",y={};function m(){}function b(){}function v(){}var x={};u(x,s,function(){return this});var _=Object.getPrototypeOf,w=_&&_(_(T([])));w&&w!==r&&n.call(w,s)&&(x=w);var k=v.prototype=m.prototype=Object.create(x);function S(t){["next","throw","return"].forEach(function(e){u(t,e,function(t){return this._invoke(e,t)})})}function M(t,e){function r(i,o,s,a){var c=h(t[i],t,o);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then(function(t){r("next",t,s,a)},function(t){r("throw",t,s,a)}):e.resolve(l).then(function(t){u.value=t,s(u)},function(t){return r("throw",t,s,a)})}a(c.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e(function(e,i){r(t,n,e,i)})}return o=o?o.then(i,i):i()}})}function z(t,r,n){var i=f;return function(o,s){if(i===p)throw new Error("Generator is already running");if(i===g){if("throw"===o)throw s;return{value:e,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var c=A(a,n);if(c){if(c===y)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===f)throw i=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var u=h(t,r,n);if("normal"===u.type){if(i=n.done?g:d,u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i=g,n.method="throw",n.arg=u.arg)}}}function A(t,r){var n=r.method,i=t.iterator[n];if(i===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,A(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var o=h(i,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,y;var s=o.arg;return s?s.done?(r[t.resultName]=s.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function T(t){if(null!=t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}throw new TypeError(typeof t+" is not iterable")}return b.prototype=v,i(k,"constructor",{value:v,configurable:!0}),i(v,"constructor",{value:b,configurable:!0}),b.displayName=u(v,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,u(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},t.awrap=function(t){return{__await:t}},S(M.prototype),u(M.prototype,a,function(){return this}),t.AsyncIterator=M,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var s=new M(l(e,r,n,i),o);return t.isGeneratorFunction(r)?s:s.next().then(function(t){return t.done?t.value:s.next()})},S(k),u(k,c,"Generator"),u(k,s,function(){return this}),u(k,"toString",function(){return"[object Generator]"}),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=T,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(j),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function i(n,i){return a.type="throw",a.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var c=n.call(s,"catchLoc"),u=n.call(s,"finallyLoc");if(c&&u){if(this.prev<s.catchLoc)return i(s.catchLoc,!0);if(this.prev<s.finallyLoc)return i(s.finallyLoc)}else if(c){if(this.prev<s.catchLoc)return i(s.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return i(s.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=e,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),j(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;j(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:T(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}Number.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},String.fromCodePoint||function(t){var e=function(e){for(var r=[],n=0,i="",o=0,s=arguments.length;o!==s;++o){var a=+arguments[o];if(!(a<1114111&&a>>>0===a))throw RangeError("Invalid code point: "+a);a<=65535?n=r.push(a):(a-=65536,n=r.push(55296+(a>>10),a%1024+56320)),n>=16383&&(i+=t.apply(null,r),r.length=0)}return i+t.apply(null,r)};try{Object.defineProperty(String,"fromCodePoint",{value:e,configurable:!0,writable:!0})}catch(t){String.fromCodePoint=e}}(String.fromCharCode),Object.is||(Object.is=function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e})
|
|
7
|
+
/*! https://mths.be/codepointat v0.2.0 by @mathias */,String.prototype.codePointAt||function(){var t=function(){try{var t={},e=Object.defineProperty,r=e(t,t,t)&&e}catch(t){}return r}(),e=function(t){if(null==this)throw TypeError();var e=String(this),r=e.length,n=t?Number(t):0;if(n!=n&&(n=0),!(n<0||n>=r)){var i,o=e.charCodeAt(n);return o>=55296&&o<=56319&&r>n+1&&(i=e.charCodeAt(n+1))>=56320&&i<=57343?1024*(o-55296)+i-56320+65536:o}};t?t(String.prototype,"codePointAt",{value:e,configurable:!0,writable:!0}):String.prototype.codePointAt=e}(),Math.log10=Math.log10||function(t){return Math.log(t)*Math.LOG10E},t.exports=function(){function t(e,r,n){function i(s,a){if(!r[s]){if(!e[s]){if(!a&&qi)return qi(s);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var u=r[s]={exports:{}};e[s][0].call(u.exports,function(t){return i(e[s][1][t]||t)},u,u.exports,t,e,r,n)}return r[s].exports}for(var o=qi,s=0;s<n.length;s++)i(n[s]);return i}return t}()({1:[function(t,e,r){var n=t("./utils"),i=function(){var t=n.stringToArray,e=["Zero","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"],r=["Zeroth","First","Second","Third","Fourth","Fifth","Sixth","Seventh","Eighth","Ninth","Tenth","Eleventh","Twelfth","Thirteenth","Fourteenth","Fifteenth","Sixteenth","Seventeenth","Eighteenth","Nineteenth"],i=["Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety","Hundred"],o=["Thousand","Million","Billion","Trillion"];function s(t,n){var s=function t(n,s,a){var c="";if(n<=19)c=(s?" and ":"")+(a?r[n]:e[n]);else if(n<100){var u=Math.floor(n/10),l=n%10;c=(s?" and ":"")+i[u-2],l>0?c+="-"+t(l,!1,a):a&&(c=c.substring(0,c.length-1)+"ieth")}else if(n<1e3){var h=Math.floor(n/100),f=n%100;c=(s?", ":"")+e[h]+" Hundred",f>0?c+=t(f,!0,a):a&&(c+="th")}else{var d=Math.floor(Math.log10(n)/3);d>o.length&&(d=o.length);var p=Math.pow(10,3*d),g=Math.floor(n/p),y=n-g*p;c=(s?", ":"")+t(g,!1,!1)+" "+o[d-1],y>0?c+=t(y,!0,a):a&&(c+="th")}return c};return s(t,!1,n)}var a={};function c(t){var e=t.split(/,\s|\sand\s|[\s\\-]/).map(function(t){return a[t]}),r=[0];return e.forEach(function(t){if(t<100){var e=r.pop();e>=1e3&&(r.push(e),e=0),r.push(e+t)}else r.push(r.pop()*t)}),r.reduce(function(t,e){return t+e},0)}e.forEach(function(t,e){a[t.toLowerCase()]=e}),r.forEach(function(t,e){a[t.toLowerCase()]=e}),i.forEach(function(t,e){var r=t.toLowerCase();a[r]=10*(e+2),a[r.substring(0,t.length-1)+"ieth"]=a[r]}),a.hundredth=100,o.forEach(function(t,e){var r=t.toLowerCase(),n=Math.pow(10,3*(e+1));a[r]=n,a[r+"th"]=n});var u=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],l={M:1e3,D:500,C:100,L:50,X:10,V:5,I:1};function h(t){for(var e=0;e<u.length;e++){var r=u[e];if(t>=r[0])return r[1]+h(t-r[0])}return""}function f(t){for(var e=0,r=1,n=t.length-1;n>=0;n--){var i=t[n],o=l[i];o<r?e-=o:(r=o,e+=o)}return e}function d(t,e){for(var r=[],n=e.charCodeAt(0);t>0;)r.unshift(String.fromCharCode((t-1)%26+n)),t=Math.floor((t-1)/26);return r.join("")}function p(t,e){for(var r=e.charCodeAt(0),n=0,i=0;i<t.length;i++)n+=(t.charCodeAt(t.length-i-1)-r+1)*Math.pow(26,i);return n}function g(t,e){if(void 0!==t)return b(t=Math.floor(t),x(e))}var y={DECIMAL:"decimal",LETTERS:"letters",ROMAN:"roman",WORDS:"words",SEQUENCE:"sequence"},m={UPPER:"upper",LOWER:"lower",TITLE:"title"};function b(e,r){var n,i=e<0;switch(e=Math.abs(e),r.primary){case y.LETTERS:n=d(e,r.case===m.UPPER?"A":"a");break;case y.ROMAN:n=h(e),r.case===m.UPPER&&(n=n.toUpperCase());break;case y.WORDS:n=s(e,r.ordinal),r.case===m.UPPER?n=n.toUpperCase():r.case===m.LOWER&&(n=n.toLowerCase());break;case y.DECIMAL:n=""+e;var o=r.mandatoryDigits-n.length;if(o>0){var a=new Array(o+1).join("0");n=a+n}if(48!==r.zeroCode&&(n=t(n).map(function(t){return String.fromCodePoint(t.codePointAt(0)+r.zeroCode-48)}).join("")),r.regular)for(var c=Math.floor((n.length-1)/r.groupingSeparators.position);c>0;c--){var u=n.length-c*r.groupingSeparators.position;n=n.substr(0,u)+r.groupingSeparators.character+n.substr(u)}else r.groupingSeparators.reverse().forEach(function(t){var e=n.length-t.position;n=n.substr(0,e)+t.character+n.substr(e)});if(r.ordinal){var l={1:"st",2:"nd",3:"rd"}[n[n.length-1]];(!l||n.length>1&&"1"===n[n.length-2])&&(l="th"),n+=l}break;case y.SEQUENCE:throw{code:"D3130",value:r.token}}return i&&(n="-"+n),n}var v=[48,1632,1776,1984,2406,2534,2662,2790,2918,3046,3174,3302,3430,3558,3664,3792,3872,4160,4240,6112,6160,6470,6608,6784,6800,6992,7088,7232,7248,42528,43216,43264,43472,43504,43600,44016,65296];function x(e){var r,n={type:"integer",primary:y.DECIMAL,case:m.LOWER,ordinal:!1},i=e.lastIndexOf(";");switch(-1===i?r=e:(r=e.substring(0,i),"o"===e.substring(i+1)[0]&&(n.ordinal=!0)),r){case"A":n.case=m.UPPER;case"a":n.primary=y.LETTERS;break;case"I":n.case=m.UPPER;case"i":n.primary=y.ROMAN;break;case"W":n.case=m.UPPER,n.primary=y.WORDS;break;case"Ww":n.case=m.TITLE,n.primary=y.WORDS;break;case"w":n.primary=y.WORDS;break;default:var o=null,s=0,a=0,c=[],u=0;if(t(r).map(function(t){return t.codePointAt(0)}).reverse().forEach(function(t){for(var e=!1,r=0;r<v.length;r++){var n=v[r];if(t>=n&&t<=n+9){if(e=!0,s++,u++,null===o)o=n;else if(n!==o)throw{code:"D3131"};break}}e||(35===t?(u++,a++):c.push({position:u,character:String.fromCodePoint(t)}))}),s>0){n.primary=y.DECIMAL,n.zeroCode=o,n.mandatoryDigits=s,n.optionalDigits=a;var l=function(t){if(0===t.length)return 0;for(var e=t[0].character,r=1;r<t.length;r++)if(t[r].character!==e)return 0;for(var n=t.map(function(t){return t.position}),i=function t(e,r){return 0===r?e:t(r,e%r)},o=n.reduce(i),s=1;s<=n.length;s++)if(-1===n.indexOf(s*o))return 0;return o}(c);l>0?(n.regular=!0,n.groupingSeparators={position:l,character:c[0].character}):(n.regular=!1,n.groupingSeparators=c)}else n.primary=y.SEQUENCE,n.token=r}return n}var _={Y:"1",M:"1",D:"1",d:"1",F:"n",W:"1",w:"1",X:"1",x:"1",H:"1",h:"1",P:"n",m:"01",s:"01",f:"1",Z:"01:01",z:"01:01",C:"n",E:"n"};function w(t){for(var e=[],r={type:"datetime",parts:e},n=function(r,n){if(n>r){var i=t.substring(r,n);i=i.split("]]").join("]"),e.push({type:"literal",value:i})}},i=0,o=0;o<t.length;){if("["===t.charAt(o)){if("["===t.charAt(o+1)){n(i,o),e.push({type:"literal",value:"["}),i=o+=2;continue}if(n(i,o),i=o,-1===(o=t.indexOf("]",i)))throw{code:"D3135"};var s,a=t.substring(i+1,o),c={type:"marker",component:(a=a.split(/\s+/).join("")).charAt(0)},u=a.lastIndexOf(",");if(-1!==u){var l=a.substring(u+1),h=l.indexOf("-"),f=void 0,d=void 0,p=function(t){return void 0===t||"*"===t?void 0:parseInt(t)};-1===h?f=l:(f=l.substring(0,h),d=l.substring(h+1));var g={min:p(f),max:p(d)};c.width=g,s=a.substring(1,u)}else s=a.substring(1);if(1===s.length)c.presentation1=s;else if(s.length>1){var y=s.charAt(s.length-1);-1!=="atco".indexOf(y)?(c.presentation2=y,"o"===y&&(c.ordinal=!0),c.presentation1=s.substring(0,s.length-1)):c.presentation1=s}else c.presentation1=_[c.component];if(void 0===c.presentation1)throw{code:"D3132",value:c.component};if("n"===c.presentation1[0])c.names=m.LOWER;else if("N"===c.presentation1[0])"n"===c.presentation1[1]?c.names=m.TITLE:c.names=m.UPPER;else if(-1!=="YMDdFWwXxHhmsf".indexOf(c.component)){var b=c.presentation1;if(c.presentation2&&(b+=";"+c.presentation2),c.integerFormat=x(b),c.width&&void 0!==c.width.min&&c.integerFormat.mandatoryDigits<c.width.min&&(c.integerFormat.mandatoryDigits=c.width.min),-1!=="YMD".indexOf(c.component))if(c.n=-1,c.width&&void 0!==c.width.max)c.n=c.width.max,c.integerFormat.mandatoryDigits=c.n;else{var v=c.integerFormat.mandatoryDigits+c.integerFormat.optionalDigits;v>=2&&(c.n=v)}}"Z"!==c.component&&"z"!==c.component||(c.integerFormat=x(c.presentation1)),e.push(c),i=o+1}o++}return n(i,o),r}var k=["","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],S=["January","February","March","April","May","June","July","August","September","October","November","December"],M=864e5,z=function(t){var e=Date.UTC(t.year,t.month),r=new Date(e).getUTCDay();return 0===r&&(r=7),r>4?e+(8-r)*M:e-(r-1)*M},A=function t(e,r){return{year:e,month:r,nextMonth:function(){return 11===r?t(e+1,0):t(e,r+1)},previousMonth:function(){return 0===r?t(e-1,11):t(e,r-1)},nextYear:function(){return t(e+1,r)},previousYear:function(){return t(e-1,r)}}},E=function(t,e){return(e-t)/(7*M)+1},j=function(t,e){var r;switch(e){case"Y":r=t.getUTCFullYear();break;case"M":r=t.getUTCMonth()+1;break;case"D":r=t.getUTCDate();break;case"d":r=(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())-Date.UTC(t.getUTCFullYear(),0))/M+1;break;case"F":0===(r=t.getUTCDay())&&(r=7);break;case"W":var n=A(t.getUTCFullYear(),0),i=z(n),o=Date.UTC(n.year,t.getUTCMonth(),t.getUTCDate()),s=E(i,o);if(s>52)o>=z(n.nextYear())&&(s=1);else if(s<1){var a=z(n.previousYear());s=E(a,o)}r=Math.floor(s);break;case"w":var c=A(t.getUTCFullYear(),t.getUTCMonth()),u=z(c),l=Date.UTC(c.year,c.month,t.getUTCDate()),h=E(u,l);if(h>4)l>=z(c.nextMonth())&&(h=1);else if(h<1){var f=z(c.previousMonth());h=E(f,l)}r=Math.floor(h);break;case"X":var d=A(t.getUTCFullYear(),0),p=z(d),g=z(d.nextYear()),y=t.getTime();r=y<p?d.year-1:y>=g?d.year+1:d.year;break;case"x":var m=A(t.getUTCFullYear(),t.getUTCMonth()),b=z(m),v=m.nextMonth(),x=z(v),_=t.getTime();r=_<b?m.previousMonth().month+1:_>=x?v.month+1:m.month+1;break;case"H":r=t.getUTCHours();break;case"h":r=t.getUTCHours(),0==(r%=12)&&(r=12);break;case"P":r=t.getUTCHours()>=12?"pm":"am";break;case"m":r=t.getUTCMinutes();break;case"s":r=t.getUTCSeconds();break;case"f":r=t.getUTCMilliseconds();break;case"Z":case"z":break;case"C":case"E":r="ISO"}return r},O=null;function T(t,e,r){var n=0,i=0;if(void 0!==r){var o=parseInt(r);n=Math.floor(o/100),i=o%100}var s,a=function(t,e){var r=j(t,e.component);if(-1!=="YMDdFWwXxHhms".indexOf(e.component))if("Y"===e.component&&-1!==e.n&&(r%=Math.pow(10,e.n)),e.names){if("M"===e.component||"x"===e.component)r=S[r-1];else{if("F"!==e.component)throw{code:"D3133",value:e.component};r=k[r]}e.names===m.UPPER?r=r.toUpperCase():e.names===m.LOWER&&(r=r.toLowerCase()),e.width&&r.length>e.width.max&&(r=r.substring(0,e.width.max))}else r=b(r,e.integerFormat);else if("f"===e.component)r=b(r,e.integerFormat);else if("Z"===e.component||"z"===e.component){var o=100*n+i;if(e.integerFormat.regular)r=b(o,e.integerFormat);else{var s=e.integerFormat.mandatoryDigits;if(1===s||2===s)r=b(n,e.integerFormat),0!==i&&(r+=":"+g(i,"00"));else{if(3!==s&&4!==s)throw{code:"D3134",value:s};r=b(o,e.integerFormat)}}o>=0&&(r="+"+r),"z"===e.component&&(r="GMT"+r),0===o&&"t"===e.presentation2&&(r="Z")}return r};void 0===e?(null===O&&(O=w("[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01].[f001][Z01:01t]")),s=O):s=w(e);var c=new Date(t+60*(60*n+i)*1e3),u="";return s.parts.forEach(function(t){"literal"===t.type?u+=t.value:u+=a(c,t)}),u}function P(t){var e={};if("datetime"===t.type)e.type="datetime",e.parts=t.parts.map(function(t){var e={};if("literal"===t.type)e.regex=t.value.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");else if("Z"===t.component||"z"===t.component){var r;Array.isArray(t.integerFormat.groupingSeparators)||(r=t.integerFormat.groupingSeparators),e.regex="","z"===t.component&&(e.regex="GMT"),e.regex+="[-+][0-9]+",r&&(e.regex+=r.character+"[0-9]+"),e.parse=function(e){"z"===t.component&&(e=e.substring(3));var n=0,i=0;return r?(n=Number.parseInt(e.substring(0,e.indexOf(r.character))),i=Number.parseInt(e.substring(e.indexOf(r.character)+1))):e.length-1<=2?n=Number.parseInt(e):(n=Number.parseInt(e.substring(0,3)),i=Number.parseInt(e.substring(3))),60*n+i}}else if(t.integerFormat)t.integerFormat.n=t.n,e=P(t.integerFormat);else{e.regex="[a-zA-Z]+";var n={};if("M"===t.component||"x"===t.component)S.forEach(function(e,r){t.width&&t.width.max?n[e.substring(0,t.width.max)]=r+1:n[e]=r+1});else if("F"===t.component)k.forEach(function(e,r){r>0&&(t.width&&t.width.max?n[e.substring(0,t.width.max)]=r:n[e]=r)});else{if("P"!==t.component)throw{code:"D3133",value:t.component};n={am:0,AM:0,pm:1,PM:1}}e.parse=function(t){return n[t]}}return e.component=t.component,e});else{e.type="integer";var r,n=t.case===m.UPPER;switch(r=t.n&&t.n>0?0===t.optionalDigits?"{".concat(t.n,"}"):"{".concat(t.n-t.optionalDigits,",").concat(t.n,"}"):"+",t.primary){case y.LETTERS:e.regex=n?"[A-Z]+":"[a-z]+",e.parse=function(t){return p(t,n?"A":"a")};break;case y.ROMAN:e.regex=n?"[MDCLXVI]+":"[mdclxvi]+",e.parse=function(t){return f(n?t:t.toUpperCase())};break;case y.WORDS:e.regex="(?:"+Object.keys(a).concat("and","[\\-, ]").join("|")+")+",e.parse=function(t){return c(t.toLowerCase())};break;case y.DECIMAL:e.regex="[0-9]".concat(r),t.ordinal&&(e.regex+="(?:th|st|nd|rd)"),e.parse=function(e){var r=e;return t.ordinal&&(r=e.substring(0,e.length-2)),t.regular?r=r.split(",").join(""):t.groupingSeparators.forEach(function(t){r=r.split(t.character).join("")}),48!==t.zeroCode&&(r=r.split("").map(function(e){return String.fromCodePoint(e.codePointAt(0)-t.zeroCode+48)}).join("")),parseInt(r)};break;case y.SEQUENCE:throw{code:"D3130",value:t.token}}}return e}function I(t,e){if(void 0!==t)return P(x(e)).parse(t)}function C(t,e){var r=P(w(e)),n="^"+r.parts.map(function(t){return"("+t.regex+")"}).join("")+"$",i=new RegExp(n,"i").exec(t);if(null!==i){for(var o=161,s=130,a=84,c=72,u=23,l=47,h={},f=1;f<i.length;f++){var d=r.parts[f-1];d.parse&&(h[d.component]=d.parse(i[f]))}if(0===Object.getOwnPropertyNames(h).length)return;var p=0,g=function(t){p<<=1,p+=t?1:0},y=function(t){return!(~t&p||!(t&p))};"YXMxWwdD".split("").forEach(function(t){return g(h[t])});var m=!y(o)&&y(s),b=y(a),v=!b&&y(c);p=0,"PHhmsf".split("").forEach(function(t){return g(h[t])});var x=!y(u)&&y(l),_=(m?"YD":b?"XxwF":v?"XWF":"YMD")+(x?"Phmsf":"Hmsf"),k=this.environment.timestamp,S=!1,M=!1;if(_.split("").forEach(function(t){if(void 0===h[t])S?(h[t]=-1!=="MDd".indexOf(t)?1:0,M=!0):h[t]=j(k,t);else if(S=!0,M)throw{code:"D3136"}}),h.M>0?h.M-=1:h.M=0,m){var z=Date.UTC(h.Y,0),A=1e3*(h.d-1)*60*60*24,E=new Date(z+A);h.M=E.getUTCMonth(),h.D=E.getUTCDate()}if(b)throw{code:"D3136"};if(v)throw{code:"D3136"};x&&(h.H=12===h.h?0:h.h,1===h.P&&(h.H+=12));var O=Date.UTC(h.Y,h.M,h.D,h.H,h.m,h.s,h.f);return(h.Z||h.z)&&(O-=60*(h.Z||h.z)*1e3),O}}var F=new RegExp("^\\d{4}(-[01]\\d)*(-[0-3]\\d)*(T[0-2]\\d:[0-5]\\d:[0-5]\\d)*(\\.\\d+)?([+-][0-2]\\d:?[0-5]\\d|Z)?$");function R(t,e){if(void 0!==t){if(void 0===e){if(!F.test(t))throw{stack:(new Error).stack,code:"D3110",value:t};return Date.parse(t)}return C.call(this,t,e)}}function D(t,e,r){if(void 0!==t)return T.call(this,t,e,r)}return{formatInteger:g,parseInteger:I,fromMillis:D,toMillis:R}}();e.exports=i},{"./utils":6}],2:[function(t,e,r){(function(r){(function(){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){return e};var t,e={},r=Object.prototype,o=r.hasOwnProperty,s=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,o=Object.create(i.prototype),a=new P(n||[]);return s(o,"_invoke",{value:E(t,r,a)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",g="suspendedYield",y="executing",m="completed",b={};function v(){}function x(){}function _(){}var w={};h(w,c,function(){return this});var k=Object.getPrototypeOf,S=k&&k(k(I([])));S&&S!==r&&o.call(S,c)&&(w=S);var M=_.prototype=v.prototype=Object.create(w);function z(t){["next","throw","return"].forEach(function(e){h(t,e,function(t){return this._invoke(e,t)})})}function A(t,e){function r(i,s,a,c){var u=d(t[i],t,s);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==n(h)&&o.call(h,"__await")?e.resolve(h.__await).then(function(t){r("next",t,a,c)},function(t){r("throw",t,a,c)}):e.resolve(h).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,c)})}c(u.arg)}var i;s(this,"_invoke",{value:function(t,n){function o(){return new e(function(e,i){r(t,n,e,i)})}return i=i?i.then(o,o):o()}})}function E(e,r,n){var i=p;return function(o,s){if(i===y)throw new Error("Generator is already running");if(i===m){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var c=j(a,n);if(c){if(c===b)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var u=d(e,r,n);if("normal"===u.type){if(i=n.done?m:g,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i=m,n.method="throw",n.arg=u.arg)}}}function j(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var o=d(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,b;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,b):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[c];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function r(){for(;++i<e.length;)if(o.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return s.next=s}}throw new TypeError(n(e)+" is not iterable")}return x.prototype=_,s(M,"constructor",{value:_,configurable:!0}),s(_,"constructor",{value:x,configurable:!0}),x.displayName=h(_,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===x||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,h(t,l,"GeneratorFunction")),t.prototype=Object.create(M),t},e.awrap=function(t){return{__await:t}},z(A.prototype),h(A.prototype,u,function(){return this}),e.AsyncIterator=A,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var s=new A(f(t,r,n,i),o);return e.isGeneratorFunction(r)?s:s.next().then(function(t){return t.done?t.value:s.next()})},z(M),h(M,l,"Generator"),h(M,c,function(){return this}),h(M,"toString",function(){return"[object Generator]"}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=I,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,i){return a.type="throw",a.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var c=o.call(s,"catchLoc"),u=o.call(s,"finallyLoc");if(c&&u){if(this.prev<s.catchLoc)return n(s.catchLoc,!0);if(this.prev<s.finallyLoc)return n(s.finallyLoc)}else if(c){if(this.prev<s.catchLoc)return n(s.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return n(s.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,b):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),b},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),b}},e}var o=t("./utils"),s=function(){var t=i().mark($),e=i().mark(U),s=i().mark(W),a=i().mark(q),c=i().mark(Q),u=i().mark(ft),l=i().mark(dt),h=i().mark(pt),f=i().mark(yt),d=i().mark(St),p=i().mark(Et),g=i().mark(Tt),y=o.isNumeric,m=o.isArrayOfStrings,b=o.isArrayOfNumbers,v=o.createSequence,x=o.isSequence,_=o.isFunction,w=o.isLambda,k=o.isIterable,S=o.getFunctionArity,M=o.isDeepEqual,z=o.stringToArray;function A(t){if(void 0!==t){var e=0;return t.forEach(function(t){e+=t}),e}}function E(t){return void 0===t?0:t.length}function j(t){if(void 0!==t&&0!==t.length)return Math.max.apply(Math,t)}function O(t){if(void 0!==t&&0!==t.length)return Math.min.apply(Math,t)}function T(t){if(void 0!==t&&0!==t.length){var e=0;return t.forEach(function(t){e+=t}),e/t.length}}function P(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(void 0!==t){var r;if("string"==typeof t)r=t;else if(_(t))r="";else{if("number"==typeof t&&!isFinite(t))throw{code:"D3001",value:t,stack:(new Error).stack};var n=e?2:0;Array.isArray(t)&&t.outerWrapper&&(t=t[0]),r=JSON.stringify(t,function(t,e){return null!=e&&e.toPrecision&&y(e)?Number(e.toPrecision(15)):e&&_(e)?"":e},n)}return r}}function I(t,e,r){if(void 0!==t){var n=z(t),i=n.length;if(i+e<0&&(e=0),void 0!==r){if(r<=0)return"";var o=e>=0?e+r:i+e+r;return n.slice(e,o).join("")}return n.slice(e).join("")}}function C(t,e){if(void 0!==t){var r=t.indexOf(e);return r>-1?t.substr(0,r):t}}function F(t,e){if(void 0!==t){var r=t.indexOf(e);return r>-1?t.substr(r+e.length):t}}function R(t){if(void 0!==t)return t.toLowerCase()}function D(t){if(void 0!==t)return t.toUpperCase()}function L(t){if(void 0!==t)return z(t).length}function N(t){if(void 0!==t){var e=t.replace(/[ \t\n\r]+/gm," ");return" "===e.charAt(0)&&(e=e.substring(1))," "===e.charAt(e.length-1)&&(e=e.substring(0,e.length-1)),e}}function Y(t,e,r){if(void 0!==t){var n;void 0!==r&&0!==r.length||(r=" ");var i=Math.abs(e)-L(t);if(i>0){var o=new Array(i+1).join(r);r.length>1&&(o=I(o,0,i)),n=e>0?t+o:o+t}else n=t;return n}}function $(e,r){var n;return i().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.apply(this,[r]),!k(n)){t.next=4;break}return t.delegateYield(n,"t0",3);case 3:n=t.t0;case 4:if(!n||"number"==typeof n.start||"number"===n.end||Array.isArray(n.groups)||_(n.next)){t.next=6;break}throw{code:"T1010",stack:(new Error).stack};case 6:return t.abrupt("return",n);case 7:case"end":return t.stop()}},t,this)}function U(t,r){var n,o;return i().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==t){e.next=2;break}return e.abrupt("return",void 0);case 2:if("string"!=typeof r){e.next=6;break}n=-1!==t.indexOf(r),e.next=9;break;case 6:return e.delegateYield($(r,t),"t0",7);case 7:o=e.t0,n=void 0!==o;case 9:return e.abrupt("return",n);case 10:case"end":return e.stop()}},e)}function W(t,e,r){var n,o,a;return i().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(void 0!==t){i.next=2;break}return i.abrupt("return",void 0);case 2:if(!(r<0)){i.next=4;break}throw{stack:(new Error).stack,value:r,code:"D3040",index:3};case 4:if(n=v(),!(void 0===r||r>0)){i.next=17;break}return o=0,i.delegateYield($(e,t),"t0",8);case 8:if(void 0===(a=i.t0)){i.next=17;break}case 10:if(void 0===a||!(void 0===r||o<r)){i.next=17;break}return n.push({match:a.match,index:a.start,groups:a.groups}),i.delegateYield($(a.next),"t1",13);case 13:a=i.t1,o++,i.next=10;break;case 17:return i.abrupt("return",n);case 18:case"end":return i.stop()}},s)}function q(t,e,r,n){var o,s,c,u,l,h,f,d;return i().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(void 0!==t){i.next=2;break}return i.abrupt("return",void 0);case 2:if(o=this,""!==e){i.next=5;break}throw{code:"D3010",stack:(new Error).stack,value:e,index:2};case 5:if(!(n<0)){i.next=7;break}throw{code:"D3011",stack:(new Error).stack,value:n,index:4};case 7:if(s="string"==typeof r?function(t){for(var e="",n=0,i=r.indexOf("$",n);-1!==i&&n<r.length;){e+=r.substring(n,i),n=i+1;var o=r.charAt(n);if("$"===o)e+="$",n++;else if("0"===o)e+=t.match,n++;else{var s;if(s=0===t.groups.length?1:Math.floor(Math.log(t.groups.length)*Math.LOG10E)+1,i=parseInt(r.substring(n,n+s),10),s>1&&i>t.groups.length&&(i=parseInt(r.substring(n,n+s-1),10)),isNaN(i))e+="$";else{if(t.groups.length>0){var a=t.groups[i-1];void 0!==a&&(e+=a)}n+=i.toString().length}}i=r.indexOf("$",n)}return e+=r.substring(n)}:r,c="",u=0,!(void 0===n||n>0)){i.next=44;break}if(l=0,"string"!=typeof e){i.next=18;break}for(h=t.indexOf(e,u);-1!==h&&(void 0===n||l<n);)c+=t.substring(u,h),c+=r,u=h+e.length,l++,h=t.indexOf(e,u);c+=t.substring(u),i.next=42;break;case 18:return i.delegateYield($(e,t),"t0",19);case 19:if(void 0===(f=i.t0)){i.next=41;break}case 21:if(void 0===f||!(void 0===n||l<n)){i.next=38;break}if(c+=t.substring(u,f.start),d=s.apply(o,[f]),!k(d)){i.next=27;break}return i.delegateYield(d,"t1",26);case 26:d=i.t1;case 27:if("string"!=typeof d){i.next=31;break}c+=d,i.next=32;break;case 31:throw{code:"D3012",stack:(new Error).stack,value:d};case 32:return u=f.start+f.match.length,l++,i.delegateYield($(f.next),"t2",35);case 35:f=i.t2,i.next=21;break;case 38:c+=t.substring(u),i.next=42;break;case 41:c=t;case 42:i.next=45;break;case 44:c=t;case 45:return i.abrupt("return",c);case 46:case"end":return i.stop()}},a,this)}function B(t){if(void 0!==t){var e="undefined"!=typeof window?window.btoa:function(t){return new r.Buffer.from(t,"binary").toString("base64")};return e(t)}}function G(t){if(void 0!==t){var e="undefined"!=typeof window?window.atob:function(t){return new r.Buffer.from(t,"base64").toString("binary")};return e(t)}}function X(t){if(void 0!==t){var e;try{e=encodeURIComponent(t)}catch(e){throw{code:"D3140",stack:(new Error).stack,value:t,functionName:"encodeUrlComponent"}}return e}}function H(t){if(void 0!==t){var e;try{e=encodeURI(t)}catch(e){throw{code:"D3140",stack:(new Error).stack,value:t,functionName:"encodeUrl"}}return e}}function Z(t){if(void 0!==t){var e;try{e=decodeURIComponent(t)}catch(e){throw{code:"D3140",stack:(new Error).stack,value:t,functionName:"decodeUrlComponent"}}return e}}function V(t){if(void 0!==t){var e;try{e=decodeURI(t)}catch(e){throw{code:"D3140",stack:(new Error).stack,value:t,functionName:"decodeUrl"}}return e}}function Q(t,e,r){var n,o,s,a;return i().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(void 0!==t){i.next=2;break}return i.abrupt("return",void 0);case 2:if(!(r<0)){i.next=4;break}throw{code:"D3020",stack:(new Error).stack,value:r,index:3};case 4:if(n=[],!(void 0===r||r>0)){i.next=27;break}if("string"!=typeof e){i.next=10;break}n=t.split(e,r),i.next=27;break;case 10:return o=0,i.delegateYield($(e,t),"t0",12);case 12:if(void 0===(s=i.t0)){i.next=26;break}a=0;case 15:if(void 0===s||!(void 0===r||o<r)){i.next=23;break}return n.push(t.substring(a,s.start)),a=s.end,i.delegateYield($(s.next),"t1",19);case 19:s=i.t1,o++,i.next=15;break;case 23:(void 0===r||o<r)&&n.push(t.substring(a)),i.next=27;break;case 26:n.push(t);case 27:return i.abrupt("return",n);case 28:case"end":return i.stop()}},c)}function J(t,e){if(void 0!==t)return void 0===e&&(e=""),t.join(e)}function K(t,e,r){if(void 0!==t){var n={"decimal-separator":".","grouping-separator":",","exponent-separator":"e",infinity:"Infinity","minus-sign":"-",NaN:"NaN",percent:"%","per-mille":"‰","zero-digit":"0",digit:"#","pattern-separator":";"};void 0!==r&&Object.keys(r).forEach(function(t){n[t]=r[t]});for(var i=[],o=n["zero-digit"].charCodeAt(0),s=o;s<o+10;s++)i.push(String.fromCharCode(s));var a=i.concat([n["decimal-separator"],n["exponent-separator"],n["grouping-separator"],n.digit,n["pattern-separator"]]),c=e.split(n["pattern-separator"]);if(c.length>2)throw{code:"D3080",stack:(new Error).stack};var u=function(t){var e,r,i,o,s=function(){for(var e,r=0;r<t.length;r++)if(e=t.charAt(r),-1!==a.indexOf(e)&&e!==n["exponent-separator"])return t.substring(0,r)}(),c=function(){for(var e,r=t.length-1;r>=0;r--)if(e=t.charAt(r),-1!==a.indexOf(e)&&e!==n["exponent-separator"])return t.substring(r+1)}(),u=t.substring(s.length,t.length-c.length),l=t.indexOf(n["exponent-separator"],s.length);-1===l||l>t.length-c.length?(e=u,r=void 0):(e=u.substring(0,l),r=u.substring(l+1));var h=e.indexOf(n["decimal-separator"]);return-1===h?(i=e,o=c):(i=e.substring(0,h),o=e.substring(h+1)),{prefix:s,suffix:c,activePart:u,mantissaPart:e,exponentPart:r,integerPart:i,fractionalPart:o,subpicture:t}},l=function(t){var e,r,o=t.subpicture,s=o.indexOf(n["decimal-separator"]);s!==o.lastIndexOf(n["decimal-separator"])&&(e="D3081"),o.indexOf(n.percent)!==o.lastIndexOf(n.percent)&&(e="D3082"),o.indexOf(n["per-mille"])!==o.lastIndexOf(n["per-mille"])&&(e="D3083"),-1!==o.indexOf(n.percent)&&-1!==o.indexOf(n["per-mille"])&&(e="D3084");var c=!1;for(r=0;r<t.mantissaPart.length;r++){var u=t.mantissaPart.charAt(r);if(-1!==i.indexOf(u)||u===n.digit){c=!0;break}}c||(e="D3085"),-1!==t.activePart.split("").map(function(t){return-1===a.indexOf(t)?"p":"a"}).join("").indexOf("p")&&(e="D3086"),-1!==s?o.charAt(s-1)!==n["grouping-separator"]&&o.charAt(s+1)!==n["grouping-separator"]||(e="D3087"):t.integerPart.charAt(t.integerPart.length-1)===n["grouping-separator"]&&(e="D3088"),-1!==o.indexOf(n["grouping-separator"]+n["grouping-separator"])&&(e="D3089");var l=t.integerPart.indexOf(n.digit);-1!==l&&t.integerPart.substring(0,l).split("").filter(function(t){return i.indexOf(t)>-1}).length>0&&(e="D3090"),-1!==(l=t.fractionalPart.lastIndexOf(n.digit))&&t.fractionalPart.substring(l).split("").filter(function(t){return i.indexOf(t)>-1}).length>0&&(e="D3091");var h="string"==typeof t.exponentPart;if(h&&t.exponentPart.length>0&&(-1!==o.indexOf(n.percent)||-1!==o.indexOf(n["per-mille"]))&&(e="D3092"),h&&(0===t.exponentPart.length||t.exponentPart.split("").filter(function(t){return-1===i.indexOf(t)}).length>0)&&(e="D3093"),e)throw{code:e,stack:(new Error).stack}},h=function(t){var e=function(e,r){for(var o=[],s=e.indexOf(n["grouping-separator"]);-1!==s;){var a=(r?e.substring(0,s):e.substring(s)).split("").filter(function(t){return-1!==i.indexOf(t)||t===n.digit}).length;o.push(a),s=t.integerPart.indexOf(n["grouping-separator"],s+1)}return o},r=e(t.integerPart),o=function(t){if(0===t.length)return 0;for(var e=function t(e,r){return 0===r?e:t(r,e%r)},r=t.reduce(e),n=1;n<=t.length;n++)if(-1===t.indexOf(n*r))return 0;return r}(r),s=e(t.fractionalPart,!0),a=t.integerPart.split("").filter(function(t){return-1!==i.indexOf(t)}).length,c=a,u=t.fractionalPart.split(""),l=u.filter(function(t){return-1!==i.indexOf(t)}).length,h=u.filter(function(t){return-1!==i.indexOf(t)||t===n.digit}).length,f="string"==typeof t.exponentPart;0===a&&0===h&&(f?(l=1,h=1):a=1),f&&0===a&&-1!==t.integerPart.indexOf(n.digit)&&(a=1),0===a&&0===l&&(l=1);var d=0;return f&&(d=t.exponentPart.split("").filter(function(t){return-1!==i.indexOf(t)}).length),{integerPartGroupingPositions:r,regularGrouping:o,minimumIntegerPartSize:a,scalingFactor:c,prefix:t.prefix,fractionalPartGroupingPositions:s,minimumFactionalPartSize:l,maximumFactionalPartSize:h,minimumExponentSize:d,suffix:t.suffix,picture:t.subpicture}},f=c.map(u);f.forEach(l);var d,p,g,y,m=f.map(h),b=n["minus-sign"],v=n["zero-digit"],x=n["decimal-separator"],_=n["grouping-separator"];if(1===m.length&&(m.push(JSON.parse(JSON.stringify(m[0]))),m[1].prefix=b+m[1].prefix),p=-1!==(d=t>=0?m[0]:m[1]).picture.indexOf(n.percent)?100*t:-1!==d.picture.indexOf(n["per-mille"])?1e3*t:t,0===d.minimumExponentSize)g=p;else{var w=Math.pow(10,d.scalingFactor),k=Math.pow(10,d.scalingFactor-1);for(g=p,y=0;g<k;)g*=10,y-=1;for(;g>w;)g/=10,y+=1}var S=function(t,e){var r=Math.abs(t).toFixed(e);return"0"!==v&&(r=r.split("").map(function(t){return t>="0"&&t<="9"?i[t.charCodeAt(0)-48]:t}).join("")),r},M=S(ot(g,d.maximumFactionalPartSize),d.maximumFactionalPartSize),z=M.indexOf(".");for(-1===z?M+=x:M=M.replace(".",x);M.charAt(0)===v;)M=M.substring(1);for(;M.charAt(M.length-1)===v;)M=M.substring(0,M.length-1);z=M.indexOf(x);var A=d.minimumIntegerPartSize-z,E=d.minimumFactionalPartSize-(M.length-z-1);if(M=(A>0?new Array(A+1).join(v):"")+M,M+=E>0?new Array(E+1).join(v):"",z=M.indexOf(x),d.regularGrouping>0)for(var j=Math.floor((z-1)/d.regularGrouping),O=1;O<=j;O++)M=[M.slice(0,z-O*d.regularGrouping),_,M.slice(z-O*d.regularGrouping)].join("");else d.integerPartGroupingPositions.forEach(function(t){M=[M.slice(0,z-t),_,M.slice(z-t)].join(""),z++});if(z=M.indexOf(x),d.fractionalPartGroupingPositions.forEach(function(t){M=[M.slice(0,t+z+1),_,M.slice(t+z+1)].join("")}),z=M.indexOf(x),-1!==d.picture.indexOf(x)&&z!==M.length-1||(M=M.substring(0,M.length-1)),void 0!==y){var T=S(y,0);(A=d.minimumExponentSize-T.length)>0&&(T=new Array(A+1).join(v)+T),M=M+n["exponent-separator"]+(y<0?b:"")+T}return M=d.prefix+M+d.suffix}}function tt(t,e){if(void 0!==t){if(t=ot(t),(e=void 0===e?10:ot(e))<2||e>36)throw{code:"D3100",stack:(new Error).stack,value:e};return t.toString(e)}}function et(t){var e;if(void 0!==t){if("number"==typeof t)e=t;else if("string"==typeof t&&/^-?[0-9]+(\.[0-9]+)?([Ee][-+]?[0-9]+)?$/.test(t)&&!isNaN(parseFloat(t))&&isFinite(t))e=parseFloat(t);else if(!0===t)e=1;else{if(!1!==t)throw{code:"D3030",value:t,stack:(new Error).stack,index:1};e=0}return e}}function rt(t){if(void 0!==t)return Math.abs(t)}function nt(t){if(void 0!==t)return Math.floor(t)}function it(t){if(void 0!==t)return Math.ceil(t)}function ot(t,e){var r;if(void 0!==t){if(e){var n=t.toString().split("e");t=+(n[0]+"e"+(n[1]?+n[1]+e:e))}var i=(r=Math.round(t))-t;return.5===Math.abs(i)&&1===Math.abs(r%2)&&(r-=1),e&&(n=r.toString().split("e"),r=+(n[0]+"e"+(n[1]?+n[1]-e:-e))),Object.is(r,-0)&&(r=0),r}}function st(t){if(void 0!==t){if(t<0)throw{stack:(new Error).stack,code:"D3060",index:1,value:t};return Math.sqrt(t)}}function at(t,e){var r;if(void 0!==t){if(r=Math.pow(t,e),!isFinite(r))throw{stack:(new Error).stack,code:"D3061",index:1,value:t,exp:e};return r}}function ct(){return Math.random()}function ut(t){if(void 0!==t){var e=!1;return Array.isArray(t)?1===t.length?e=ut(t[0]):t.length>1&&(e=t.filter(function(t){return ut(t)}).length>0):"string"==typeof t?t.length>0&&(e=!0):y(t)?0!==t&&(e=!0):null!==t&&"object"===n(t)?Object.keys(t).length>0&&(e=!0):"boolean"==typeof t&&!0===t&&(e=!0),e}}function lt(t){if(void 0!==t)return!ut(t)}function ht(t,e,r,n){var i=[e],o=S(t);return o>=2&&i.push(r),o>=3&&i.push(n),i}function ft(t,e){var r,n,o,s;return i().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(void 0!==t){i.next=2;break}return i.abrupt("return",void 0);case 2:r=v(),n=0;case 4:if(!(n<t.length)){i.next=12;break}return o=ht(e,t[n],n,t),i.delegateYield(e.apply(this,o),"t0",7);case 7:void 0!==(s=i.t0)&&r.push(s);case 9:n++,i.next=4;break;case 12:return i.abrupt("return",r);case 13:case"end":return i.stop()}},u,this)}function dt(t,e){var r,n,o,s;return i().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(void 0!==t){i.next=2;break}return i.abrupt("return",void 0);case 2:r=v(),n=0;case 4:if(!(n<t.length)){i.next=13;break}return o=t[n],s=ht(e,o,n,t),i.delegateYield(e.apply(this,s),"t0",8);case 8:ut(i.t0)&&r.push(o);case 10:n++,i.next=4;break;case 13:return i.abrupt("return",r);case 14:case"end":return i.stop()}},l,this)}function pt(t,e){var r,n,o,s,a,c,u;return i().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(void 0!==t){i.next=2;break}return i.abrupt("return",void 0);case 2:r=!1,o=0;case 4:if(!(o<t.length)){i.next=22;break}if(s=t[o],a=!0,void 0===e){i.next=12;break}return c=ht(e,s,o,t),i.delegateYield(e.apply(this,c),"t0",10);case 10:u=i.t0,a=ut(u);case 12:if(!a){i.next=19;break}if(r){i.next=18;break}n=s,r=!0,i.next=19;break;case 18:throw{stack:(new Error).stack,code:"D3138",index:o};case 19:o++,i.next=4;break;case 22:if(r){i.next=24;break}throw{stack:(new Error).stack,code:"D3139"};case 24:return i.abrupt("return",n);case 25:case"end":return i.stop()}},h,this)}function gt(){for(var t=[],e=Array.prototype.slice.call(arguments),r=Math.min.apply(Math,e.map(function(t){return Array.isArray(t)?t.length:0})),n=0;n<r;n++){var i=e.map(function(t){return t[n]});t.push(i)}return t}function yt(t,e,r){var n,o,s,a;return i().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(void 0!==t){i.next=2;break}return i.abrupt("return",void 0);case 2:if(!((o=S(e))<2)){i.next=5;break}throw{stack:(new Error).stack,code:"D3050",index:1};case 5:void 0===r&&t.length>0?(n=t[0],s=1):(n=r,s=0);case 6:if(!(s<t.length)){i.next=15;break}return a=[n,t[s]],o>=3&&a.push(s),o>=4&&a.push(t),i.delegateYield(e.apply(this,a),"t0",11);case 11:n=i.t0,s++,i.next=6;break;case 15:return i.abrupt("return",n);case 16:case"end":return i.stop()}},f,this)}function mt(t){var e=v();if(Array.isArray(t)){var r={};t.forEach(function(t){mt(t).forEach(function(t){r[t]=!0})}),e=mt(r)}else null===t||"object"!==n(t)||w(t)||Object.keys(t).forEach(function(t){return e.push(t)});return e}function bt(t,e){var r;if(Array.isArray(t)){r=v();for(var i=0;i<t.length;i++){var o=bt(t[i],e);void 0!==o&&(Array.isArray(o)?o.forEach(function(t){return r.push(t)}):r.push(o))}}else null!==t&&"object"===n(t)&&(r=t[e]);return r}function vt(t,e){return void 0===t?e:void 0===e?t:(Array.isArray(t)||(t=v(t)),Array.isArray(e)||(e=[e]),t.concat(e))}function xt(t){return void 0!==t}function _t(t){var e=v();if(Array.isArray(t))t.forEach(function(t){e=vt(e,_t(t))});else if(null===t||"object"!==n(t)||w(t))e=t;else for(var r in t){var i={};i[r]=t[r],e.push(i)}return e}function wt(t){if(void 0!==t){var e={};return t.forEach(function(t){for(var r in t)e[r]=t[r]}),e}}function kt(t){if(void 0!==t){if(t.length<=1)return t;for(var e=t.length,r=new Array(e),n=0;n<e;n++)r[e-n-1]=t[n];return r}}function St(t,e){var r,n,o,s;return i().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:r=v(),a.t0=i().keys(t);case 2:if((a.t1=a.t0()).done){a.next=10;break}return n=a.t1.value,o=ht(e,t[n],n,t),a.delegateYield(e.apply(this,o),"t2",6);case 6:void 0!==(s=a.t2)&&r.push(s),a.next=2;break;case 10:return a.abrupt("return",r);case 11:case"end":return a.stop()}},d,this)}function Mt(t){throw{code:"D3137",stack:(new Error).stack,message:t||"$error() function evaluated"}}function zt(t,e){if(!t)throw{code:"D3141",stack:(new Error).stack,message:e||"$assert() statement failed"}}function At(t){if(void 0!==t)return null===t?"null":y(t)?"number":"string"==typeof t?"string":"boolean"==typeof t?"boolean":Array.isArray(t)?"array":_(t)?"function":"object"}function Et(t,e){var r,n,o,s;return i().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(void 0!==t){a.next=2;break}return a.abrupt("return",void 0);case 2:if(!(t.length<=1)){a.next=4;break}return a.abrupt("return",t);case 4:if(void 0!==e){a.next=10;break}if(b(t)||m(t)){a.next=7;break}throw{stack:(new Error).stack,code:"D3070",index:1};case 7:r=i().mark(function t(e,r){return i().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e>r);case 1:case"end":return t.stop()}},t)}),a.next=11;break;case 10:r=e;case 11:return n=i().mark(function t(e,n){var o,s;return i().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o=i().mark(function t(e,n,o){return i().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(0!==n.length){i.next=4;break}Array.prototype.push.apply(e,o),i.next=16;break;case 4:if(0!==o.length){i.next=8;break}Array.prototype.push.apply(e,n),i.next=16;break;case 8:return i.delegateYield(r(n[0],o[0]),"t0",9);case 9:if(!i.t0){i.next=14;break}return e.push(o[0]),i.delegateYield(t(e,n,o.slice(1)),"t1",12);case 12:i.next=16;break;case 14:return e.push(n[0]),i.delegateYield(t(e,n.slice(1),o),"t2",16);case 16:case"end":return i.stop()}},t)}),s=[],t.delegateYield(o(s,e,n),"t0",3);case 3:return t.abrupt("return",s);case 4:case"end":return t.stop()}},t)}),o=i().mark(function t(e){var r,o,s;return i().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(Array.isArray(e)&&!(e.length<=1)){i.next=4;break}return i.abrupt("return",e);case 4:return r=Math.floor(e.length/2),o=e.slice(0,r),s=e.slice(r),i.delegateYield(t(o),"t0",8);case 8:return o=i.t0,i.delegateYield(t(s),"t1",10);case 10:return s=i.t1,i.delegateYield(n(o,s),"t2",12);case 12:return i.abrupt("return",i.t2);case 13:case"end":return i.stop()}},t)}),a.delegateYield(o(t),"t0",14);case 14:return s=a.t0,a.abrupt("return",s);case 16:case"end":return a.stop()}},p)}function jt(t){if(void 0!==t){if(t.length<=1)return t;for(var e=new Array(t.length),r=0;r<t.length;r++){var n=Math.floor(Math.random()*(r+1));r!==n&&(e[r]=e[n]),e[n]=t[r]}return e}}function Ot(t){if(void 0!==t){if(!Array.isArray(t)||t.length<=1)return t;for(var e=x(t)?v():[],r=0;r<t.length;r++){for(var n=t[r],i=!1,o=0;o<e.length;o++)if(M(n,e[o])){i=!0;break}i||e.push(n)}return e}}function Tt(t,e){var r,n,o,s;return i().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:r={},a.t0=i().keys(t);case 2:if((a.t1=a.t0()).done){a.next=11;break}return n=a.t1.value,o=t[n],s=ht(e,o,n,t),a.delegateYield(e.apply(this,s),"t2",7);case 7:ut(a.t2)&&(r[n]=o),a.next=2;break;case 11:return 0===Object.keys(r).length&&(r=void 0),a.abrupt("return",r);case 13:case"end":return a.stop()}},g,this)}return{sum:A,count:E,max:j,min:O,average:T,string:P,substring:I,substringBefore:C,substringAfter:F,lowercase:R,uppercase:D,length:L,trim:N,pad:Y,match:W,contains:U,replace:q,split:Q,join:J,formatNumber:K,formatBase:tt,number:et,floor:nt,ceil:it,round:ot,abs:rt,sqrt:st,power:at,random:ct,boolean:ut,not:lt,map:ft,zip:gt,filter:dt,single:pt,foldLeft:yt,sift:Tt,keys:mt,lookup:bt,append:vt,exists:xt,spread:_t,merge:wt,reverse:kt,each:St,error:Mt,assert:zt,type:At,sort:Et,shuffle:jt,distinct:Ot,base64encode:B,base64decode:G,encodeUrlComponent:X,encodeUrl:H,decodeUrlComponent:Z,decodeUrl:V}}();e.exports=s}).call(this)}).call(this,void 0!==Ui?Ui:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utils":6}],3:[function(t,e,r){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){return e};var t,e={},r=Object.prototype,o=r.hasOwnProperty,s=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,o=Object.create(i.prototype),a=new P(n||[]);return s(o,"_invoke",{value:E(t,r,a)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",g="suspendedYield",y="executing",m="completed",b={};function v(){}function x(){}function _(){}var w={};h(w,c,function(){return this});var k=Object.getPrototypeOf,S=k&&k(k(I([])));S&&S!==r&&o.call(S,c)&&(w=S);var M=_.prototype=v.prototype=Object.create(w);function z(t){["next","throw","return"].forEach(function(e){h(t,e,function(t){return this._invoke(e,t)})})}function A(t,e){function r(i,s,a,c){var u=d(t[i],t,s);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==n(h)&&o.call(h,"__await")?e.resolve(h.__await).then(function(t){r("next",t,a,c)},function(t){r("throw",t,a,c)}):e.resolve(h).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,c)})}c(u.arg)}var i;s(this,"_invoke",{value:function(t,n){function o(){return new e(function(e,i){r(t,n,e,i)})}return i=i?i.then(o,o):o()}})}function E(e,r,n){var i=p;return function(o,s){if(i===y)throw new Error("Generator is already running");if(i===m){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var c=j(a,n);if(c){if(c===b)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var u=d(e,r,n);if("normal"===u.type){if(i=n.done?m:g,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i=m,n.method="throw",n.arg=u.arg)}}}function j(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var o=d(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,b;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,b):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[c];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function r(){for(;++i<e.length;)if(o.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return s.next=s}}throw new TypeError(n(e)+" is not iterable")}return x.prototype=_,s(M,"constructor",{value:_,configurable:!0}),s(_,"constructor",{value:x,configurable:!0}),x.displayName=h(_,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===x||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,h(t,l,"GeneratorFunction")),t.prototype=Object.create(M),t},e.awrap=function(t){return{__await:t}},z(A.prototype),h(A.prototype,u,function(){return this}),e.AsyncIterator=A,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var s=new A(f(t,r,n,i),o);return e.isGeneratorFunction(r)?s:s.next().then(function(t){return t.done?t.value:s.next()})},z(M),h(M,l,"Generator"),h(M,c,function(){return this}),h(M,"toString",function(){return"[object Generator]"}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=I,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,i){return a.type="throw",a.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var c=o.call(s,"catchLoc"),u=o.call(s,"finallyLoc");if(c&&u){if(this.prev<s.catchLoc)return n(s.catchLoc,!0);if(this.prev<s.finallyLoc)return n(s.finallyLoc)}else if(c){if(this.prev<s.catchLoc)return n(s.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return n(s.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,b):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),b},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),b}},e}var o=t("./datetime"),s=t("./functions"),a=t("./utils"),c=t("./parser"),u=t("./signature"),l=function(){var t=i().mark(Y),e=i().mark($),r=i().mark(W),l=i().mark(q),h=i().mark(B),f=i().mark(G),d=i().mark(X),p=i().mark(H),g=i().mark(ot),y=i().mark(ct),m=i().mark(ht),b=i().mark(ft),v=i().mark(dt),x=i().mark(yt),_=i().mark(vt),w=i().mark(xt),k=i().mark(_t),S=i().mark(wt),M=i().mark(St),z=i().mark(zt),A=i().mark(jt),E=i().mark(Pt),j=a.isNumeric,O=a.isArrayOfStrings,T=a.isArrayOfNumbers,P=a.createSequence,I=a.isSequence,C=a.isFunction,F=a.isLambda,R=a.isIterable,D=a.getFunctionArity,L=a.isDeepEqual,N=Ct(null);function Y(e,r,n){var o,s,a,c;return i().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:(s=n.lookup("__evaluate_entry"))&&s(e,r,n),t.t0=e.type,t.next="path"===t.t0?5:"binary"===t.t0?8:"unary"===t.t0?11:"name"===t.t0?14:"string"===t.t0||"number"===t.t0||"value"===t.t0?16:"wildcard"===t.t0?18:"descendant"===t.t0?20:"parent"===t.t0?22:"condition"===t.t0?24:"block"===t.t0?27:"bind"===t.t0?30:"regex"===t.t0?33:"function"===t.t0?35:"variable"===t.t0?38:"lambda"===t.t0?40:"partial"===t.t0?42:"apply"===t.t0?45:"transform"===t.t0?48:50;break;case 5:return t.delegateYield($(e,r,n),"t1",6);case 6:return o=t.t1,t.abrupt("break",50);case 8:return t.delegateYield(X(e,r,n),"t2",9);case 9:return o=t.t2,t.abrupt("break",50);case 11:return t.delegateYield(H(e,r,n),"t3",12);case 12:return o=t.t3,t.abrupt("break",50);case 14:return o=Z(e,r),t.abrupt("break",50);case 16:return o=V(e),t.abrupt("break",50);case 18:return o=Q(e,r),t.abrupt("break",50);case 20:return o=K(e,r),t.abrupt("break",50);case 22:return o=n.lookup(e.slot.label),t.abrupt("break",50);case 24:return t.delegateYield(ft(e,r,n),"t4",25);case 25:return o=t.t4,t.abrupt("break",50);case 27:return t.delegateYield(dt(e,r,n),"t5",28);case 28:return o=t.t5,t.abrupt("break",50);case 30:return t.delegateYield(ht(e,r,n),"t6",31);case 31:return o=t.t6,t.abrupt("break",50);case 33:return o=pt(e),t.abrupt("break",50);case 35:return t.delegateYield(xt(e,r,n),"t7",36);case 36:return o=t.t7,t.abrupt("break",50);case 38:return o=gt(e,r,n),t.abrupt("break",50);case 40:return o=kt(e,r,n),t.abrupt("break",50);case 42:return t.delegateYield(St(e,r,n),"t8",43);case 43:return o=t.t8,t.abrupt("break",50);case 45:return t.delegateYield(vt(e,r,n),"t9",46);case 46:return o=t.t9,t.abrupt("break",50);case 48:return o=mt(e,r,n),t.abrupt("break",50);case 50:if(!n.async||null!=o&&"function"==typeof o.then||(o=Promise.resolve(o)),!n.async||"function"!=typeof o.then||!e.nextFunction||"function"!=typeof o[e.nextFunction]){t.next=54;break}t.next=57;break;case 54:return t.next=56,o;case 56:o=t.sent;case 57:if(!Object.prototype.hasOwnProperty.call(e,"predicate")){t.next=65;break}a=0;case 59:if(!(a<e.predicate.length)){t.next=65;break}return t.delegateYield(G(e.predicate[a].expr,o,n),"t10",61);case 61:o=t.t10;case 62:a++,t.next=59;break;case 65:if("path"===e.type||!Object.prototype.hasOwnProperty.call(e,"group")){t.next=68;break}return t.delegateYield(ct(e.group,o,n),"t11",67);case 67:o=t.t11;case 68:return(c=n.lookup("__evaluate_exit"))&&c(e,r,n,o),o&&I(o)&&!o.tupleStream&&(e.keepArray&&(o.keepSingleton=!0),0===o.length?o=void 0:1===o.length&&(o=o.keepSingleton?o:o[0])),t.abrupt("return",o);case 72:case"end":return t.stop()}},t)}function $(t,r,n){var o,s,a,c,u,l;return i().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:o=Array.isArray(r)&&"variable"!==t.steps[0].type?r:P(r),a=!1,c=void 0,u=0;case 4:if(!(u<t.steps.length)){e.next=25;break}if((l=t.steps[u]).tuple&&(a=!0),0!==u||!l.consarray){e.next=12;break}return e.delegateYield(Y(l,o,n),"t0",9);case 9:s=e.t0,e.next=19;break;case 12:if(!a){e.next=17;break}return e.delegateYield(B(l,o,c,n),"t1",14);case 14:c=e.t1,e.next=19;break;case 17:return e.delegateYield(W(l,o,n,u===t.steps.length-1),"t2",18);case 18:s=e.t2;case 19:if(a||void 0!==s&&0!==s.length){e.next=21;break}return e.abrupt("break",25);case 21:void 0===l.focus&&(o=s);case 22:u++,e.next=4;break;case 25:if(a)if(t.tuple)s=c;else for(s=P(),u=0;u<c.length;u++)s.push(c[u]["@"]);if(t.keepSingletonArray&&(Array.isArray(s)&&s.cons&&!s.sequence&&(s=P(s)),s.keepSingleton=!0),!t.hasOwnProperty("group")){e.next=30;break}return e.delegateYield(ct(t.group,a?c:s,n),"t3",29);case 29:s=e.t3;case 30:return e.abrupt("return",s);case 31:case"end":return e.stop()}},e)}function U(t,e){var r=Ct(t);for(var n in e)r.bind(n,e[n]);return r}function W(t,e,n,o){var s,a,c,u,l;return i().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if("sort"!==t.type){r.next=7;break}return r.delegateYield(yt(t,e,n),"t0",2);case 2:if(s=r.t0,!t.stages){r.next=6;break}return r.delegateYield(q(t.stages,s,n),"t1",5);case 5:s=r.t1;case 6:return r.abrupt("return",s);case 7:s=P(),a=0;case 9:if(!(a<e.length)){r.next=24;break}return r.delegateYield(Y(t,e[a],n),"t2",11);case 11:if(c=r.t2,!t.stages){r.next=20;break}u=0;case 14:if(!(u<t.stages.length)){r.next=20;break}return r.delegateYield(G(t.stages[u].expr,c,n),"t3",16);case 16:c=r.t3;case 17:u++,r.next=14;break;case 20:void 0!==c&&s.push(c);case 21:a++,r.next=9;break;case 24:return l=P(),o&&1===s.length&&Array.isArray(s[0])&&!I(s[0])?l=s[0]:s.forEach(function(t){!Array.isArray(t)||t.cons?l.push(t):t.forEach(function(t){return l.push(t)})}),r.abrupt("return",l);case 27:case"end":return r.stop()}},r)}function q(t,e,r){var n,o,s,a;return i().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:n=e,o=0;case 2:if(!(o<t.length)){i.next=15;break}s=t[o],i.t0=s.type,i.next="filter"===i.t0?7:"index"===i.t0?10:12;break;case 7:return i.delegateYield(G(s.expr,n,r),"t1",8);case 8:return n=i.t1,i.abrupt("break",12);case 10:for(a=0;a<n.length;a++)n[a][s.value]=a;return i.abrupt("break",12);case 12:o++,i.next=2;break;case 15:return i.abrupt("return",n);case 16:case"end":return i.stop()}},l)}function B(t,e,r,n){var o,s,a,c,u,l,f,d;return i().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if("sort"!==t.type){i.next=15;break}if(!r){i.next=6;break}return i.delegateYield(yt(t,r,n),"t0",3);case 3:o=i.t0,i.next=11;break;case 6:return i.delegateYield(yt(t,e,n),"t1",7);case 7:for(s=i.t1,(o=P()).tupleStream=!0,a=0;a<s.length;a++)(c={"@":s[a]})[t.index]=a,o.push(c);case 11:if(!t.stages){i.next=14;break}return i.delegateYield(q(t.stages,o,n),"t2",13);case 13:o=i.t2;case 14:return i.abrupt("return",o);case 15:(o=P()).tupleStream=!0,u=n,void 0===r&&(r=e.map(function(t){return{"@":t}})),l=0;case 20:if(!(l<r.length)){i.next=28;break}return u=U(n,r[l]),i.delegateYield(Y(t,r[l]["@"],u),"t3",23);case 23:if(void 0!==(f=i.t3))for(Array.isArray(f)||(f=[f]),d=0;d<f.length;d++)c={},Object.assign(c,r[l]),f.tupleStream?Object.assign(c,f[d]):(t.focus?(c[t.focus]=f[d],c["@"]=r[l]["@"]):c["@"]=f[d],t.index&&(c[t.index]=d),t.ancestor&&(c[t.ancestor.label]=r[l]["@"])),o.push(c);case 25:l++,i.next=20;break;case 28:if(!t.stages){i.next=31;break}return i.delegateYield(q(t.stages,o,n),"t4",30);case 30:o=i.t4;case 31:return i.abrupt("return",o);case 32:case"end":return i.stop()}},h)}function G(t,e,r){var n,o,a,c,u,l;return i().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(n=P(),e&&e.tupleStream&&(n.tupleStream=!0),Array.isArray(e)||(e=P(e)),"number"!==t.type){i.next=10;break}(o=Math.floor(t.value))<0&&(o=e.length+o),void 0!==(a=e[o])&&(Array.isArray(a)?n=a:n.push(a)),i.next=23;break;case 10:o=0;case 11:if(!(o<e.length)){i.next=23;break}return a=e[o],c=a,u=r,e.tupleStream&&(c=a["@"],u=U(r,a)),i.delegateYield(Y(t,c,u),"t0",17);case 17:l=i.t0,j(l)&&(l=[l]),T(l)?l.forEach(function(t){var r=Math.floor(t);r<0&&(r=e.length+r),r===o&&n.push(a)}):s.boolean(l)&&n.push(a);case 20:o++,i.next=11;break;case 23:return i.abrupt("return",n);case 24:case"end":return i.stop()}},f)}function X(t,e,r){var n,o,s,a,c;return i().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.delegateYield(Y(t.lhs,e,r),"t0",1);case 1:if(o=u.t0,s=t.value,a=i().mark(function n(){return i().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.delegateYield(Y(t.rhs,e,r),"t0",1);case 1:return n.abrupt("return",n.t0);case 2:case"end":return n.stop()}},n)}),"and"!==s&&"or"!==s){u.next=15;break}return u.prev=5,u.delegateYield(ot(o,a,s),"t1",7);case 7:return u.abrupt("return",u.t1);case 10:throw u.prev=10,u.t2=u.catch(5),u.t2.position=t.position,u.t2.token=s,u.t2;case 15:return u.delegateYield(a(),"t3",16);case 16:c=u.t3,u.prev=17,u.t4=s,u.next="+"===u.t4||"-"===u.t4||"*"===u.t4||"/"===u.t4||"%"===u.t4?21:"="===u.t4||"!="===u.t4?23:"<"===u.t4||"<="===u.t4||">"===u.t4||">="===u.t4?25:"&"===u.t4?27:".."===u.t4?29:"in"===u.t4?31:33;break;case 21:return n=et(o,c,s),u.abrupt("break",33);case 23:return n=rt(o,c,s),u.abrupt("break",33);case 25:return n=nt(o,c,s),u.abrupt("break",33);case 27:return n=at(o,c),u.abrupt("break",33);case 29:return n=lt(o,c),u.abrupt("break",33);case 31:return n=it(o,c),u.abrupt("break",33);case 33:u.next=40;break;case 35:throw u.prev=35,u.t5=u.catch(17),u.t5.position=t.position,u.t5.token=s,u.t5;case 40:return u.abrupt("return",n);case 41:case"end":return u.stop()}},d,null,[[5,10],[17,35]])}function H(t,e,r){var n,o,a,c;return i().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:i.t0=t.value,i.next="-"===i.t0?3:"["===i.t0?15:"{"===i.t0?27:30;break;case 3:return i.delegateYield(Y(t.expression,e,r),"t1",4);case 4:if(void 0!==(n=i.t1)){i.next=9;break}n=void 0,i.next=14;break;case 9:if(!j(n)){i.next=13;break}n=-n,i.next=14;break;case 13:throw{code:"D1002",stack:(new Error).stack,position:t.position,token:t.value,value:n};case 14:return i.abrupt("break",30);case 15:n=[],o=0;case 17:if(!(o<t.expressions.length)){i.next=25;break}return a=t.expressions[o],i.delegateYield(Y(a,e,r),"t2",20);case 20:void 0!==(c=i.t2)&&("["===a.value?n.push(c):n=s.append(n,c));case 22:o++,i.next=17;break;case 25:return t.consarray&&Object.defineProperty(n,"cons",{enumerable:!1,configurable:!1,value:!0}),i.abrupt("break",30);case 27:return i.delegateYield(ct(t,e,r),"t3",28);case 28:return n=i.t3,i.abrupt("break",30);case 30:return i.abrupt("return",n);case 31:case"end":return i.stop()}},p)}function Z(t,e,r){return s.lookup(e,t.value)}function V(t){return t.value}function Q(t,e){var r=P();return Array.isArray(e)&&e.outerWrapper&&e.length>0&&(e=e[0]),null!==e&&"object"===n(e)&&Object.keys(e).forEach(function(t){var n=e[t];Array.isArray(n)?(n=J(n),r=s.append(r,n)):r.push(n)}),r}function J(t,e){return void 0===e&&(e=[]),Array.isArray(t)?t.forEach(function(t){J(t,e)}):e.push(t),e}function K(t,e){var r,n=P();return void 0!==e&&(tt(e,n),r=1===n.length?n[0]:n),r}function tt(t,e){Array.isArray(t)||e.push(t),Array.isArray(t)?t.forEach(function(t){tt(t,e)}):null!==t&&"object"===n(t)&&Object.keys(t).forEach(function(r){tt(t[r],e)})}function et(t,e,r){var n;if(void 0!==t&&!j(t))throw{code:"T2001",stack:(new Error).stack,value:t};if(void 0!==e&&!j(e))throw{code:"T2002",stack:(new Error).stack,value:e};if(void 0===t||void 0===e)return n;switch(r){case"+":n=t+e;break;case"-":n=t-e;break;case"*":n=t*e;break;case"/":n=t/e;break;case"%":n=t%e}return n}function rt(t,e,r){var i,o=n(t),s=n(e);if("undefined"===o||"undefined"===s)return!1;switch(r){case"=":i=L(t,e);break;case"!=":i=!L(t,e)}return i}function nt(t,e,r){var i,o=n(t),s=n(e);if("undefined"!==o&&"string"!==o&&"number"!==o||"undefined"!==s&&"string"!==s&&"number"!==s)throw{code:"T2010",stack:(new Error).stack,value:"string"!==o&&"number"!==o?t:e};if("undefined"!==o&&"undefined"!==s){if(o!==s)throw{code:"T2009",stack:(new Error).stack,value:t,value2:e};switch(r){case"<":i=t<e;break;case"<=":i=t<=e;break;case">":i=t>e;break;case">=":i=t>=e}return i}}function it(t,e){var r=!1;if(void 0===t||void 0===e)return!1;Array.isArray(e)||(e=[e]);for(var n=0;n<e.length;n++)if(e[n]===t){r=!0;break}return r}function ot(t,e,r){var n,o;return i().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:o=st(t),i.t0=r,i.next="and"===i.t0?4:"or"===i.t0?12:20;break;case 4:if(i.t1=o,!i.t1){i.next=10;break}return i.t2=st,i.delegateYield(e(),"t3",8);case 8:i.t4=i.t3,i.t1=(0,i.t2)(i.t4);case 10:return n=i.t1,i.abrupt("break",20);case 12:if(i.t5=o,i.t5){i.next=18;break}return i.t6=st,i.delegateYield(e(),"t7",16);case 16:i.t8=i.t7,i.t5=(0,i.t6)(i.t8);case 18:return n=i.t5,i.abrupt("break",20);case 20:return i.abrupt("return",n);case 21:case"end":return i.stop()}},g)}function st(t){var e=s.boolean(t);return void 0!==e&&e}function at(t,e){var r="",n="";return void 0!==t&&(r=s.string(t)),void 0!==e&&(n=s.string(e)),r.concat(n)}function ct(t,e,r){var n,o,a,c,u,l,h,f,d,p,g,m,b;return i().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:n={},o={},a=!(!e||!e.tupleStream),Array.isArray(e)||(e=P(e)),0===e.length&&e.push(void 0),c=0;case 6:if(!(c<e.length)){y.next=31;break}u=e[c],l=a?U(r,u):r,h=0;case 10:if(!(h<t.lhs.length)){y.next=28;break}return f=t.lhs[h],y.delegateYield(Y(f[0],a?u["@"]:u,l),"t0",13);case 13:if("string"==typeof(d=y.t0)||void 0===d){y.next=16;break}throw{code:"T1003",stack:(new Error).stack,position:t.position,value:d};case 16:if(void 0===d){y.next=25;break}if(p={data:u,exprIndex:h},!o.hasOwnProperty(d)){y.next=24;break}if(o[d].exprIndex===h){y.next=21;break}throw{code:"D1009",stack:(new Error).stack,position:t.position,value:d};case 21:o[d].data=s.append(o[d].data,u),y.next=25;break;case 24:o[d]=p;case 25:h++,y.next=10;break;case 28:c++,y.next=6;break;case 31:y.t1=i().keys(o);case 32:if((y.t2=y.t1()).done){y.next=43;break}return d=y.t2.value,p=o[d],g=p.data,l=r,a&&(m=ut(p.data),g=m["@"],delete m["@"],l=U(r,m)),y.delegateYield(Y(t.lhs[p.exprIndex][1],g,l),"t3",39);case 39:void 0!==(b=y.t3)&&(n[d]=b),y.next=32;break;case 43:return y.abrupt("return",n);case 44:case"end":return y.stop()}},y)}function ut(t){if(!Array.isArray(t))return t;var e={};Object.assign(e,t[0]);for(var r=1;r<t.length;r++)for(var n in t[r])e[n]=s.append(e[n],t[r][n]);return e}function lt(t,e){var r;if(void 0!==t&&!Number.isInteger(t))throw{code:"T2003",stack:(new Error).stack,value:t};if(void 0!==e&&!Number.isInteger(e))throw{code:"T2004",stack:(new Error).stack,value:e};if(void 0===t||void 0===e)return r;if(t>e)return r;var n=e-t+1;if(n>1e7)throw{code:"D2014",stack:(new Error).stack,value:n};r=new Array(n);for(var i=t,o=0;i<=e;i++,o++)r[o]=i;return r.sequence=!0,r}function ht(t,e,r){var n;return i().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.delegateYield(Y(t.rhs,e,r),"t0",1);case 1:return n=i.t0,r.bind(t.lhs.value,n),i.abrupt("return",n);case 4:case"end":return i.stop()}},m)}function ft(t,e,r){var n,o;return i().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.delegateYield(Y(t.condition,e,r),"t0",1);case 1:if(o=i.t0,!s.boolean(o)){i.next=7;break}return i.delegateYield(Y(t.then,e,r),"t1",4);case 4:n=i.t1,i.next=10;break;case 7:if(void 0===t.else){i.next=10;break}return i.delegateYield(Y(t.else,e,r),"t2",9);case 9:n=i.t2;case 10:return i.abrupt("return",n);case 11:case"end":return i.stop()}},b)}function dt(t,e,r){var n,o,s;return i().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:o=Ct(r),s=0;case 2:if(!(s<t.expressions.length)){i.next=8;break}return i.delegateYield(Y(t.expressions[s],e,o),"t0",4);case 4:n=i.t0;case 5:s++,i.next=2;break;case 8:return i.abrupt("return",n);case 9:case"end":return i.stop()}},v)}function pt(t){var e=new Dt.RegexEngine(t.value),r=function r(n,i){var o;e.lastIndex=i||0;var s=e.exec(n);if(null!==s){if(o={match:s[0],start:s.index,end:s.index+s[0].length,groups:[]},s.length>1)for(var a=1;a<s.length;a++)o.groups.push(s[a]);o.next=function(){if(!(e.lastIndex>=n.length)){var i=r(n,e.lastIndex);if(i&&""===i.match)throw{code:"D1004",stack:(new Error).stack,position:t.position,value:t.value.source};return i}}}return o};return r}function gt(t,e,r){return""===t.value?e&&e.outerWrapper?e[0]:e:r.lookup(t.value)}function yt(t,e,r){var o,a,c,u,l;return i().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return a=e,c=!!e.tupleStream,u=i().mark(function e(o,s){var a,u,l,h,f,d,p,g,y;return i().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:a=0,u=0;case 2:if(!(0===a&&u<t.terms.length)){e.next=35;break}return l=t.terms[u],h=o,f=r,c&&(h=o["@"],f=U(r,o)),e.delegateYield(Y(l.expression,h,f),"t0",8);case 8:return d=e.t0,h=s,f=r,c&&(h=s["@"],f=U(r,s)),e.delegateYield(Y(l.expression,h,f),"t1",13);case 13:if(p=e.t1,g=n(d),y=n(p),"undefined"!==g){e.next=19;break}return a="undefined"===y?0:1,e.abrupt("continue",32);case 19:if("undefined"!==y){e.next=22;break}return a=-1,e.abrupt("continue",32);case 22:if(!("string"!==g&&"number"!==g||"string"!==y&&"number"!==y)){e.next=24;break}throw{code:"T2008",stack:(new Error).stack,position:t.position,value:"string"!==g&&"number"!==g?d:p};case 24:if(g===y){e.next=26;break}throw{code:"T2007",stack:(new Error).stack,position:t.position,value:d,value2:p};case 26:if(d!==p){e.next=30;break}return e.abrupt("continue",32);case 30:a=d<p?-1:1;case 31:!0===l.descending&&(a=-a);case 32:u++,e.next=2;break;case 35:return e.abrupt("return",1===a);case 36:case"end":return e.stop()}},e)}),l={environment:r,input:e},h.delegateYield(s.sort.apply(l,[a,u]),"t0",5);case 5:return o=h.t0,h.abrupt("return",o);case 7:case"end":return h.stop()}},x)}function mt(t,e,r){return Tt(i().mark(function e(o){var s,a,c,u,l,h,f,d,p,g,y;return i().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==o){e.next=2;break}return e.abrupt("return",void 0);case 2:if(s=r.lookup("clone"),C(s)){e.next=5;break}throw{code:"T2013",stack:(new Error).stack,position:t.position};case 5:return e.delegateYield(_t(s,[o],null,r),"t0",6);case 6:return a=e.t0,e.delegateYield(Y(t.pattern,a,r),"t1",8);case 8:if(void 0===(c=e.t1)){e.next=35;break}Array.isArray(c)||(c=[c]),u=0;case 12:if(!(u<c.length)){e.next=35;break}if(!(l=c[u])||!(l.isPrototypeOf(a)||l instanceof Object.constructor)){e.next=16;break}throw{code:"D1010",stack:(new Error).stack,position:t.position};case 16:return e.delegateYield(Y(t.update,l,r),"t2",17);case 17:if(h=e.t2,"undefined"===(f=n(h))){e.next=23;break}if("object"===f&&null!==h&&!Array.isArray(h)){e.next=22;break}throw{code:"T2011",stack:(new Error).stack,position:t.update.position,value:h};case 22:for(d in h)l[d]=h[d];case 23:if(void 0===t.delete){e.next=32;break}return e.delegateYield(Y(t.delete,l,r),"t3",25);case 25:if(void 0===(p=e.t3)){e.next=32;break}if(g=p,Array.isArray(p)||(p=[p]),O(p)){e.next=31;break}throw{code:"T2012",stack:(new Error).stack,position:t.delete.position,value:g};case 31:for(y=0;y<p.length;y++)"object"===n(l)&&null!==l&&delete l[p[y]];case 32:u++,e.next=12;break;case 35:return e.abrupt("return",a);case 36:case"end":return e.stop()}},e)}),"<(oa):o>")}var bt=c("function($f, $g) { function($x){ $g($f($x)) } }");function vt(t,e,r){var n,o,s,a;return i().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.delegateYield(Y(t.lhs,e,r),"t0",1);case 1:if(o=i.t0,"function"!==t.rhs.type){i.next=7;break}return i.delegateYield(xt(t.rhs,e,r,{context:o}),"t1",4);case 4:n=i.t1,i.next=20;break;case 7:return i.delegateYield(Y(t.rhs,e,r),"t2",8);case 8:if(s=i.t2,C(s)){i.next=11;break}throw{code:"T2006",stack:(new Error).stack,position:t.position,value:s};case 11:if(!C(o)){i.next=18;break}return i.delegateYield(Y(bt,null,r),"t3",13);case 13:return a=i.t3,i.delegateYield(_t(a,[o,s],null,r),"t4",15);case 15:n=i.t4,i.next=20;break;case 18:return i.delegateYield(_t(s,[o],null,r),"t5",19);case 19:n=i.t5;case 20:return i.abrupt("return",n);case 21:case"end":return i.stop()}},_)}function xt(t,e,r,o){var s,a,c,u,l,h;return i().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.delegateYield(Y(t.procedure,e,r),"t0",1);case 1:if(void 0!==(a=f.t0)||"path"!==t.procedure.type||!r.lookup(t.procedure.steps[0].value)){f.next=4;break}throw{code:"T1005",stack:(new Error).stack,position:t.position,token:t.procedure.steps[0].value};case 4:c=[],void 0!==o&&c.push(o.context),u=i().mark(function n(){var o,s;return i().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.delegateYield(Y(t.arguments[l],e,r),"t0",1);case 1:o=n.t0,C(o)?(s=i().mark(function t(){var e,n,s,a=arguments;return i().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:for(e=a.length,n=new Array(e),s=0;s<e;s++)n[s]=a[s];return t.delegateYield(_t(o,n,null,r),"t0",2);case 2:return t.abrupt("return",t.t0);case 3:case"end":return t.stop()}},t)}),s.arity=D(o),c.push(s)):c.push(o);case 3:case"end":return n.stop()}},n)}),l=0;case 8:if(!(l<t.arguments.length)){f.next=13;break}return f.delegateYield(u(),"t1",10);case 10:l++,f.next=8;break;case 13:return h="path"===t.procedure.type?t.procedure.steps[0].value:t.procedure.value,f.prev=14,"object"===n(a)&&(a.token=h,a.position=t.position),f.delegateYield(_t(a,c,e,r),"t2",17);case 17:s=f.t2,f.next=25;break;case 20:throw f.prev=20,f.t3=f.catch(14),f.t3.position||(f.t3.position=t.position),f.t3.token||(f.t3.token=h),f.t3;case 25:return f.abrupt("return",s);case 26:case"end":return f.stop()}},w,null,[[14,20]])}function _t(t,e,r,n){var o,s,a,c;return i().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.delegateYield(wt(t,e,r,n),"t0",1);case 1:o=i.t0;case 2:if(!F(o)||!0!==o.thunk){i.next=21;break}return i.delegateYield(Y(o.body.procedure,o.input,o.environment),"t1",4);case 4:s=i.t1,"variable"===o.body.procedure.type&&(s.token=o.body.procedure.value),s.position=o.body.procedure.position,a=[],c=0;case 9:if(!(c<o.body.arguments.length)){i.next=17;break}return i.t2=a,i.delegateYield(Y(o.body.arguments[c],o.input,o.environment),"t3",12);case 12:i.t4=i.t3,i.t2.push.call(i.t2,i.t4);case 14:c++,i.next=9;break;case 17:return i.delegateYield(wt(s,a,r,n),"t5",18);case 18:o=i.t5,i.next=2;break;case 21:return i.abrupt("return",o);case 22:case"end":return i.stop()}},k)}function wt(t,e,r,n){var o,s,a;return i().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(i.prev=0,s=e,t&&(s=Mt(t.signature,e,r)),!F(t)){i.next=8;break}return i.delegateYield(zt(t,s),"t0",5);case 5:o=i.t0,i.next=24;break;case 8:if(!t||!0!==t._jsonata_function){i.next=16;break}if(a={environment:n,input:r},o=t.implementation.apply(a,s),!R(o)){i.next=14;break}return i.delegateYield(o,"t1",13);case 13:o=i.t1;case 14:i.next=24;break;case 16:if("function"!=typeof t){i.next=23;break}if(o=t.apply(r,s),!R(o)){i.next=21;break}return i.delegateYield(o,"t2",20);case 20:o=i.t2;case 21:i.next=24;break;case 23:throw{code:"T1006",stack:(new Error).stack};case 24:i.next=30;break;case 26:throw i.prev=26,i.t3=i.catch(0),t&&(void 0===i.t3.token&&void 0!==t.token&&(i.t3.token=t.token),i.t3.position=t.position||i.t3.position),i.t3;case 30:return i.abrupt("return",o);case 31:case"end":return i.stop()}},S,null,[[0,26]])}function kt(t,e,r){var n={_jsonata_lambda:!0,input:e,environment:r,arguments:t.arguments,signature:t.signature,body:t.body};return!0===t.thunk&&(n.thunk=!0),n.apply=i().mark(function t(r,o){return i().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.delegateYield(_t(n,o,e,r.environment),"t0",1);case 1:return t.abrupt("return",t.t0);case 2:case"end":return t.stop()}},t)}),n}function St(t,e,r){var n,o,s,a,c;return i().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:o=[],s=0;case 2:if(!(s<t.arguments.length)){i.next=15;break}if("operator"!==(a=t.arguments[s]).type||"?"!==a.value){i.next=8;break}o.push(a),i.next=12;break;case 8:return i.t0=o,i.delegateYield(Y(a,e,r),"t1",10);case 10:i.t2=i.t1,i.t0.push.call(i.t0,i.t2);case 12:s++,i.next=2;break;case 15:return i.delegateYield(Y(t.procedure,e,r),"t3",16);case 16:if(void 0!==(c=i.t3)||"path"!==t.procedure.type||!r.lookup(t.procedure.steps[0].value)){i.next=19;break}throw{code:"T1007",stack:(new Error).stack,position:t.position,token:t.procedure.steps[0].value};case 19:if(!F(c)){i.next=23;break}n=At(c,o),i.next=32;break;case 23:if(!c||!0!==c._jsonata_function){i.next=27;break}n=Et(c.implementation,o),i.next=32;break;case 27:if("function"!=typeof c){i.next=31;break}n=Et(c,o),i.next=32;break;case 31:throw{code:"T1008",stack:(new Error).stack,position:t.position,token:"path"===t.procedure.type?t.procedure.steps[0].value:t.procedure.value};case 32:return i.abrupt("return",n);case 33:case"end":return i.stop()}},M)}function Mt(t,e,r){return void 0===t?e:t.validate(e,r)}function zt(t,e){var r,n;return i().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(n=Ct(t.environment),t.arguments.forEach(function(t,r){n.bind(t.value,e[r])}),"function"!=typeof t.body){i.next=7;break}return i.delegateYield(jt(t.body,n),"t0",4);case 4:r=i.t0,i.next=9;break;case 7:return i.delegateYield(Y(t.body,t.input,n),"t1",8);case 8:r=i.t1;case 9:return i.abrupt("return",r);case 10:case"end":return i.stop()}},z)}function At(t,e){var r=Ct(t.environment),n=[];return t.arguments.forEach(function(t,i){var o=e[i];o&&"operator"===o.type&&"?"===o.value?n.push(t):r.bind(t.value,o)}),{_jsonata_lambda:!0,input:t.input,environment:r,arguments:n,body:t.body}}function Et(t,e){var r=Ot(t),n="function("+(r=r.map(function(t){return"$"+t.trim()})).join(", ")+"){ _ }",i=c(n);return i.body=t,At(i,e)}function jt(t,e){var r,n,o,s;return i().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(r=Ot(t),n=r.map(function(t){return e.lookup(t.trim())}),o={environment:e},s=t.apply(o,n),!R(s)){i.next=7;break}return i.delegateYield(s,"t0",6);case 6:s=i.t0;case 7:return i.abrupt("return",s);case 8:case"end":return i.stop()}},A)}function Ot(t){var e=t.toString();return/\(([^)]*)\)/.exec(e)[1].split(",")}function Tt(t,e){var r={_jsonata_function:!0,implementation:t};return void 0!==e&&(r.signature=u(e)),r}function Pt(t,e){var r,n,o;return i().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(void 0!==t){i.next=2;break}return i.abrupt("return",void 0);case 2:r=this.input,void 0!==e&&(r=e,Array.isArray(r)&&!I(r)&&((r=P(r)).outerWrapper=!0)),i.prev=4,n=c(t,!1),i.next=12;break;case 8:throw i.prev=8,i.t0=i.catch(4),Rt(i.t0),{stack:(new Error).stack,code:"D3120",value:i.t0.message,error:i.t0};case 12:return i.prev=12,i.delegateYield(Y(n,r,this.environment),"t1",14);case 14:o=i.t1,i.next=21;break;case 17:throw i.prev=17,i.t2=i.catch(12),Rt(i.t2),{stack:(new Error).stack,code:"D3121",value:i.t2.message,error:i.t2};case 21:return i.abrupt("return",o);case 22:case"end":return i.stop()}},E,this,[[4,8],[12,17]])}function It(t){if(void 0!==t)return JSON.parse(s.string(t))}function Ct(t){var e={};return{bind:function(t,r){e[t]=r},lookup:function(r){var n;return e.hasOwnProperty(r)?n=e[r]:t&&(n=t.lookup(r)),n},timestamp:t?t.timestamp:null,async:!!t&&t.async,global:t?t.global:{ancestry:[null]}}}N.bind("sum",Tt(s.sum,"<a<n>:n>")),N.bind("count",Tt(s.count,"<a:n>")),N.bind("max",Tt(s.max,"<a<n>:n>")),N.bind("min",Tt(s.min,"<a<n>:n>")),N.bind("average",Tt(s.average,"<a<n>:n>")),N.bind("string",Tt(s.string,"<x-b?:s>")),N.bind("substring",Tt(s.substring,"<s-nn?:s>")),N.bind("substringBefore",Tt(s.substringBefore,"<s-s:s>")),N.bind("substringAfter",Tt(s.substringAfter,"<s-s:s>")),N.bind("lowercase",Tt(s.lowercase,"<s-:s>")),N.bind("uppercase",Tt(s.uppercase,"<s-:s>")),N.bind("length",Tt(s.length,"<s-:n>")),N.bind("trim",Tt(s.trim,"<s-:s>")),N.bind("pad",Tt(s.pad,"<s-ns?:s>")),N.bind("match",Tt(s.match,"<s-f<s:o>n?:a<o>>")),N.bind("contains",Tt(s.contains,"<s-(sf):b>")),N.bind("replace",Tt(s.replace,"<s-(sf)(sf)n?:s>")),N.bind("split",Tt(s.split,"<s-(sf)n?:a<s>>")),N.bind("join",Tt(s.join,"<a<s>s?:s>")),N.bind("formatNumber",Tt(s.formatNumber,"<n-so?:s>")),N.bind("formatBase",Tt(s.formatBase,"<n-n?:s>")),N.bind("formatInteger",Tt(o.formatInteger,"<n-s:s>")),N.bind("parseInteger",Tt(o.parseInteger,"<s-s:n>")),N.bind("number",Tt(s.number,"<(nsb)-:n>")),N.bind("floor",Tt(s.floor,"<n-:n>")),N.bind("ceil",Tt(s.ceil,"<n-:n>")),N.bind("round",Tt(s.round,"<n-n?:n>")),N.bind("abs",Tt(s.abs,"<n-:n>")),N.bind("sqrt",Tt(s.sqrt,"<n-:n>")),N.bind("power",Tt(s.power,"<n-n:n>")),N.bind("random",Tt(s.random,"<:n>")),N.bind("boolean",Tt(s.boolean,"<x-:b>")),N.bind("not",Tt(s.not,"<x-:b>")),N.bind("map",Tt(s.map,"<af>")),N.bind("zip",Tt(s.zip,"<a+>")),N.bind("filter",Tt(s.filter,"<af>")),N.bind("single",Tt(s.single,"<af?>")),N.bind("reduce",Tt(s.foldLeft,"<afj?:j>")),N.bind("sift",Tt(s.sift,"<o-f?:o>")),N.bind("keys",Tt(s.keys,"<x-:a<s>>")),N.bind("lookup",Tt(s.lookup,"<x-s:x>")),N.bind("append",Tt(s.append,"<xx:a>")),N.bind("exists",Tt(s.exists,"<x:b>")),N.bind("spread",Tt(s.spread,"<x-:a<o>>")),N.bind("merge",Tt(s.merge,"<a<o>:o>")),N.bind("reverse",Tt(s.reverse,"<a:a>")),N.bind("each",Tt(s.each,"<o-f:a>")),N.bind("error",Tt(s.error,"<s?:x>")),N.bind("assert",Tt(s.assert,"<bs?:x>")),N.bind("type",Tt(s.type,"<x:s>")),N.bind("sort",Tt(s.sort,"<af?:a>")),N.bind("shuffle",Tt(s.shuffle,"<a:a>")),N.bind("distinct",Tt(s.distinct,"<x:x>")),N.bind("base64encode",Tt(s.base64encode,"<s-:s>")),N.bind("base64decode",Tt(s.base64decode,"<s-:s>")),N.bind("encodeUrlComponent",Tt(s.encodeUrlComponent,"<s-:s>")),N.bind("encodeUrl",Tt(s.encodeUrl,"<s-:s>")),N.bind("decodeUrlComponent",Tt(s.decodeUrlComponent,"<s-:s>")),N.bind("decodeUrl",Tt(s.decodeUrl,"<s-:s>")),N.bind("eval",Tt(Pt,"<sx?:x>")),N.bind("toMillis",Tt(o.toMillis,"<s-s?:n>")),N.bind("fromMillis",Tt(o.fromMillis,"<n-s?s?:s>")),N.bind("clone",Tt(It,"<(oa)-:o>"));var Ft={S0101:"String literal must be terminated by a matching quote",S0102:"Number out of range: {{token}}",S0103:"Unsupported escape sequence: \\{{token}}",S0104:"The escape sequence \\u must be followed by 4 hex digits",S0105:"Quoted property name must be terminated with a backquote (`)",S0106:"Comment has no closing tag",S0201:"Syntax error: {{token}}",S0202:"Expected {{value}}, got {{token}}",S0203:"Expected {{value}} before end of expression",S0204:"Unknown operator: {{token}}",S0205:"Unexpected token: {{token}}",S0206:"Unknown expression type: {{token}}",S0207:"Unexpected end of expression",S0208:"Parameter {{value}} of function definition must be a variable name (start with $)",S0209:"A predicate cannot follow a grouping expression in a step",S0210:"Each step can only have one grouping expression",S0211:"The symbol {{token}} cannot be used as a unary operator",S0212:"The left side of := must be a variable name (start with $)",S0213:"The literal value {{value}} cannot be used as a step within a path expression",S0214:"The right side of {{token}} must be a variable name (start with $)",S0215:"A context variable binding must precede any predicates on a step",S0216:"A context variable binding must precede the 'order-by' clause on a step",S0217:"The object representing the 'parent' cannot be derived from this expression",S0301:"Empty regular expressions are not allowed",S0302:"No terminating / in regular expression",S0402:"Choice groups containing parameterized types are not supported",S0401:"Type parameters can only be applied to functions and arrays",S0500:"Attempted to evaluate an expression containing syntax error(s)",T0410:"Argument {{index}} of function {{token}} does not match function signature",T0411:"Context value is not a compatible type with argument {{index}} of function {{token}}",T0412:"Argument {{index}} of function {{token}} must be an array of {{type}}",D1001:"Number out of range: {{value}}",D1002:"Cannot negate a non-numeric value: {{value}}",T1003:"Key in object structure must evaluate to a string; got: {{value}}",D1004:"Regular expression matches zero length string",T1005:"Attempted to invoke a non-function. Did you mean ${{{token}}}?",T1006:"Attempted to invoke a non-function",T1007:"Attempted to partially apply a non-function. Did you mean ${{{token}}}?",T1008:"Attempted to partially apply a non-function",D1009:"Multiple key definitions evaluate to same key: {{value}}",D1010:"Attempted to access the Javascript object prototype",T1010:"The matcher function argument passed to function {{token}} does not return the correct object structure",T2001:"The left side of the {{token}} operator must evaluate to a number",T2002:"The right side of the {{token}} operator must evaluate to a number",T2003:"The left side of the range operator (..) must evaluate to an integer",T2004:"The right side of the range operator (..) must evaluate to an integer",D2005:"The left side of := must be a variable name (start with $)",T2006:"The right side of the function application operator ~> must be a function",T2007:"Type mismatch when comparing values {{value}} and {{value2}} in order-by clause",T2008:"The expressions within an order-by clause must evaluate to numeric or string values",T2009:"The values {{value}} and {{value2}} either side of operator {{token}} must be of the same data type",T2010:"The expressions either side of operator {{token}} must evaluate to numeric or string values",T2011:"The insert/update clause of the transform expression must evaluate to an object: {{value}}",T2012:"The delete clause of the transform expression must evaluate to a string or array of strings: {{value}}",T2013:"The transform expression clones the input object using the $clone() function. This has been overridden in the current scope by a non-function.",D2014:"The size of the sequence allocated by the range operator (..) must not exceed 1e6. Attempted to allocate {{value}}.",D3001:"Attempting to invoke string function on Infinity or NaN",D3010:"Second argument of replace function cannot be an empty string",D3011:"Fourth argument of replace function must evaluate to a positive number",D3012:"Attempted to replace a matched string with a non-string value",D3020:"Third argument of split function must evaluate to a positive number",D3030:"Unable to cast value to a number: {{value}}",D3040:"Third argument of match function must evaluate to a positive number",D3050:"The second argument of reduce function must be a function with at least two arguments",D3060:"The sqrt function cannot be applied to a negative number: {{value}}",D3061:"The power function has resulted in a value that cannot be represented as a JSON number: base={{value}}, exponent={{exp}}",D3070:"The single argument form of the sort function can only be applied to an array of strings or an array of numbers. Use the second argument to specify a comparison function",D3080:"The picture string must only contain a maximum of two sub-pictures",D3081:"The sub-picture must not contain more than one instance of the 'decimal-separator' character",D3082:"The sub-picture must not contain more than one instance of the 'percent' character",D3083:"The sub-picture must not contain more than one instance of the 'per-mille' character",D3084:"The sub-picture must not contain both a 'percent' and a 'per-mille' character",D3085:"The mantissa part of a sub-picture must contain at least one character that is either an 'optional digit character' or a member of the 'decimal digit family'",D3086:"The sub-picture must not contain a passive character that is preceded by an active character and that is followed by another active character",D3087:"The sub-picture must not contain a 'grouping-separator' character that appears adjacent to a 'decimal-separator' character",D3088:"The sub-picture must not contain a 'grouping-separator' at the end of the integer part",D3089:"The sub-picture must not contain two adjacent instances of the 'grouping-separator' character",D3090:"The integer part of the sub-picture must not contain a member of the 'decimal digit family' that is followed by an instance of the 'optional digit character'",D3091:"The fractional part of the sub-picture must not contain an instance of the 'optional digit character' that is followed by a member of the 'decimal digit family'",D3092:"A sub-picture that contains a 'percent' or 'per-mille' character must not contain a character treated as an 'exponent-separator'",D3093:"The exponent part of the sub-picture must comprise only of one or more characters that are members of the 'decimal digit family'",D3100:"The radix of the formatBase function must be between 2 and 36. It was given {{value}}",D3110:"The argument of the toMillis function must be an ISO 8601 formatted timestamp. Given {{value}}",D3120:"Syntax error in expression passed to function eval: {{value}}",D3121:"Dynamic error evaluating the expression passed to function eval: {{value}}",D3130:"Formatting or parsing an integer as a sequence starting with {{value}} is not supported by this implementation",D3131:"In a decimal digit pattern, all digits must be from the same decimal group",D3132:"Unknown component specifier {{value}} in date/time picture string",D3133:"The 'name' modifier can only be applied to months and days in the date/time picture string, not {{value}}",D3134:"The timezone integer format specifier cannot have more than four digits",D3135:"No matching closing bracket ']' in date/time picture string",D3136:"The date/time picture string is missing specifiers required to parse the timestamp",D3137:"{{{message}}}",D3138:"The $single() function expected exactly 1 matching result. Instead it matched more.",D3139:"The $single() function expected exactly 1 matching result. Instead it matched 0.",D3140:"Malformed URL passed to ${{{functionName}}}(): {{value}}",D3141:"{{{message}}}"};function Rt(t){var e=Ft[t.code];if(void 0!==e){var r=e.replace(/\{\{\{([^}]+)}}}/g,function(){return t[arguments[1]]});r=r.replace(/\{\{([^}]+)}}/g,function(){return JSON.stringify(t[arguments[1]])}),t.message=r}}function Dt(t,e){var r,n;try{r=c(t,e&&e.recover),n=r.errors,delete r.errors}catch(t){throw Rt(t),t}var i=Ct(N),s=new Date;return i.bind("now",Tt(function(t,e){return o.fromMillis(s.getTime(),t,e)},"<s?s?:s>")),i.bind("millis",Tt(function(){return s.getTime()},"<:n>")),e&&e.RegexEngine?Dt.RegexEngine=e.RegexEngine:Dt.RegexEngine=RegExp,{evaluate:function(t,e,o){if(void 0!==n){var a={code:"S0500",position:0};throw Rt(a),a}var c,u,l;if(void 0!==e)for(var h in c=Ct(i),e)c.bind(h,e[h]);else c=i;if(c.bind("$",t),s=new Date,c.timestamp=s,Array.isArray(t)&&!I(t)&&((t=P(t)).outerWrapper=!0),"function"==typeof o){c.async=!0;var f=function(t){Rt(t),o(t,null)},d=function t(e){(u=l.next(e)).done?o(null,u.value):u.value.then(t).catch(f)};l=Y(r,t,c),(u=l.next()).value.then(d).catch(f)}else try{for(l=Y(r,t,c),u=l.next();!u.done;)u=l.next(u.value);return u.value}catch(a){throw Rt(a),a}},assign:function(t,e){i.bind(t,e)},registerFunction:function(t,e,r){var n=Tt(e,r);i.bind(t,n)},ast:function(){return r},errors:function(){return n}}}return Dt.parser=c,Dt}();e.exports=l},{"./datetime":1,"./functions":2,"./parser":4,"./signature":5,"./utils":6}],4:[function(t,e,r){var n=t("./signature"),i=function(){var t={".":75,"[":80,"]":0,"{":70,"}":0,"(":80,")":0,",":0,"@":80,"#":80,";":80,":":80,"?":20,"+":50,"-":50,"*":60,"/":60,"%":60,"|":20,"=":40,"<":40,">":40,"^":40,"**":60,"..":20,":=":10,"!=":40,"<=":40,">=":40,"~>":40,and:30,or:25,in:40,"&":50,"!":0,"~":0},e={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},r=function(r){var n=0,i=r.length,o=function(t,e){return{type:t,value:e,position:n}},s=function(){for(var t,e,o=n,s=0;n<i;){var a=r.charAt(n);if("/"===a&&"\\"!==r.charAt(n-1)&&0===s){if(""===(t=r.substring(o,n)))throw{code:"S0301",stack:(new Error).stack,position:n};for(n++,a=r.charAt(n),o=n;"i"===a||"m"===a;)n++,a=r.charAt(n);return e=r.substring(o,n)+"g",new RegExp(t,e)}"("!==a&&"["!==a&&"{"!==a||"\\"===r.charAt(n-1)||s++,")"!==a&&"]"!==a&&"}"!==a||"\\"===r.charAt(n-1)||s--,n++}throw{code:"S0302",stack:(new Error).stack,position:n}};return function a(c){if(n>=i)return null;for(var u=r.charAt(n);n<i&&" \t\n\r\v".indexOf(u)>-1;)n++,u=r.charAt(n);if("/"===u&&"*"===r.charAt(n+1)){var l=n;for(n+=2,u=r.charAt(n);"*"!==u||"/"!==r.charAt(n+1);)if(u=r.charAt(++n),n>=i)throw{code:"S0106",stack:(new Error).stack,position:l};return n+=2,u=r.charAt(n),a(c)}if(!0!==c&&"/"===u)return n++,o("regex",s());if("."===u&&"."===r.charAt(n+1))return n+=2,o("operator","..");if(":"===u&&"="===r.charAt(n+1))return n+=2,o("operator",":=");if("!"===u&&"="===r.charAt(n+1))return n+=2,o("operator","!=");if(">"===u&&"="===r.charAt(n+1))return n+=2,o("operator",">=");if("<"===u&&"="===r.charAt(n+1))return n+=2,o("operator","<=");if("*"===u&&"*"===r.charAt(n+1))return n+=2,o("operator","**");if("~"===u&&">"===r.charAt(n+1))return n+=2,o("operator","~>");if(Object.prototype.hasOwnProperty.call(t,u))return n++,o("operator",u);if('"'===u||"'"===u){var h=u;n++;for(var f="";n<i;){if("\\"===(u=r.charAt(n)))if(n++,u=r.charAt(n),Object.prototype.hasOwnProperty.call(e,u))f+=e[u];else{if("u"!==u)throw{code:"S0103",stack:(new Error).stack,position:n,token:u};var d=r.substr(n+1,4);if(!/^[0-9a-fA-F]+$/.test(d))throw{code:"S0104",stack:(new Error).stack,position:n};var p=parseInt(d,16);f+=String.fromCharCode(p),n+=4}else{if(u===h)return n++,o("string",f);f+=u}n++}throw{code:"S0101",stack:(new Error).stack,position:n}}var g,y=/^-?(0|([1-9][0-9]*))(\.[0-9]+)?([Ee][-+]?[0-9]+)?/.exec(r.substring(n));if(null!==y){var m=parseFloat(y[0]);if(!isNaN(m)&&isFinite(m))return n+=y[0].length,o("number",m);throw{code:"S0102",stack:(new Error).stack,position:n,token:y[0]}}if("`"===u){n++;var b=r.indexOf("`",n);if(-1!==b)return g=r.substring(n,b),n=b+1,o("name",g);throw n=i,{code:"S0105",stack:(new Error).stack,position:n}}for(var v,x=n;;)if(v=r.charAt(x),x===i||" \t\n\r\v".indexOf(v)>-1||Object.prototype.hasOwnProperty.call(t,v)){if("$"===r.charAt(n))return g=r.substring(n+1,x),n=x,o("variable",g);switch(g=r.substring(n,x),n=x,g){case"or":case"in":case"and":return o("operator",g);case"true":return o("value",!0);case"false":return o("value",!1);case"null":return o("value",null);default:return n===i&&""===g?null:o("name",g)}}else x++}},i=function(e,i){var o,s,a={},c=[],u=function(){var t=[];"(end)"!==o.id&&t.push({type:o.type,value:o.value,position:o.position});for(var e=s();null!==e;)t.push(e),e=s();return t},l={nud:function(){var t={code:"S0211",token:this.value,position:this.position};if(i)return t.remaining=u(),t.type="error",c.push(t),t;throw t.stack=(new Error).stack,t}},h=function(t,e){var r=a[t];return e=e||0,r?e>=r.lbp&&(r.lbp=e):((r=Object.create(l)).id=r.value=t,r.lbp=e,a[t]=r),r},f=function(t){if(i){t.remaining=u(),c.push(t);var e=a["(error)"];return(o=Object.create(e)).error=t,o.type="(error)",o}throw t.stack=(new Error).stack,t},d=function(t,r){if(t&&o.id!==t){var n={code:"(end)"===o.id?"S0203":"S0202",position:o.position,token:o.value,value:t};return f(n)}var i=s(r);if(null===i)return(o=a["(end)"]).position=e.length,o;var c,u=i.value,l=i.type;switch(l){case"name":case"variable":c=a["(name)"];break;case"operator":if(!(c=a[u]))return f({code:"S0204",stack:(new Error).stack,position:i.position,token:u});break;case"string":case"number":case"value":c=a["(literal)"];break;case"regex":l="regex",c=a["(regex)"];break;default:return f({code:"S0205",stack:(new Error).stack,position:i.position,token:u})}return(o=Object.create(c)).value=u,o.type=l,o.position=i.position,o},p=function(t){var e,r=o;for(d(null,!0),e=r.nud();t<o.lbp;)r=o,d(),e=r.led(e);return e},g=function(t){h(t,0).nud=function(){return this}},y=function(e,r,n){var i=r||t[e],o=h(e,i);return o.led=n||function(t){return this.lhs=t,this.rhs=p(i),this.type="binary",this},o},m=function(t,e,r){var n=h(t,e);return n.led=r,n},b=function(t,e){var r=h(t);return r.nud=e||function(){return this.expression=p(70),this.type="unary",this},r};g("(end)"),g("(name)"),g("(literal)"),g("(regex)"),h(":"),h(";"),h(","),h(")"),h("]"),h("}"),h(".."),y("."),y("+"),y("-"),y("*"),y("/"),y("%"),y("="),y("<"),y(">"),y("!="),y("<="),y(">="),y("&"),y("and"),y("or"),y("in"),g("and"),g("or"),g("in"),b("-"),y("~>"),m("(error)",10,function(t){return this.lhs=t,this.error=o.error,this.remaining=u(),this.type="error",this}),b("*",function(){return this.type="wildcard",this}),b("**",function(){return this.type="descendant",this}),b("%",function(){return this.type="parent",this}),y("(",t["("],function(t){if(this.procedure=t,this.type="function",this.arguments=[],")"!==o.id)for(;"operator"===o.type&&"?"===o.id?(this.type="partial",this.arguments.push(o),d("?")):this.arguments.push(p(0)),","===o.id;)d(",");if(d(")",!0),"name"===t.type&&("function"===t.value||"λ"===t.value)){if(this.arguments.forEach(function(t,e){if("variable"!==t.type)return f({code:"S0208",stack:(new Error).stack,position:t.position,token:t.value,value:e+1})}),this.type="lambda","<"===o.id){for(var e=o.position,r=1,i="<";r>0&&"{"!==o.id&&"(end)"!==o.id;){var s=d();">"===s.id?r--:"<"===s.id&&r++,i+=s.value}d(">");try{this.signature=n(i)}catch(t){return t.position=e+t.offset,f(t)}}d("{"),this.body=p(0),d("}")}return this}),b("(",function(){for(var t=[];")"!==o.id&&(t.push(p(0)),";"===o.id);)d(";");return d(")",!0),this.type="block",this.expressions=t,this}),b("[",function(){var t=[];if("]"!==o.id)for(;;){var e=p(0);if(".."===o.id){var r={type:"binary",value:"..",position:o.position,lhs:e};d(".."),r.rhs=p(0),e=r}if(t.push(e),","!==o.id)break;d(",")}return d("]",!0),this.expressions=t,this.type="unary",this}),y("[",t["["],function(e){if("]"===o.id){for(var r=e;r&&"binary"===r.type&&"["===r.value;)r=r.lhs;return r.keepArray=!0,d("]"),e}return this.lhs=e,this.rhs=p(t["]"]),this.type="binary",d("]",!0),this}),y("^",t["^"],function(t){d("(");for(var e=[];;){var r={descending:!1};if("<"===o.id?d("<"):">"===o.id&&(r.descending=!0,d(">")),r.expression=p(0),e.push(r),","!==o.id)break;d(",")}return d(")"),this.lhs=t,this.rhs=e,this.type="binary",this});var v=function(t){var e=[];if("}"!==o.id)for(;;){var r=p(0);d(":");var n=p(0);if(e.push([r,n]),","!==o.id)break;d(",")}return d("}",!0),void 0===t?(this.lhs=e,this.type="unary"):(this.lhs=t,this.rhs=e,this.type="binary"),this};b("{",v),y("{",t["{"],v),m(":=",t[":="],function(e){return"variable"!==e.type?f({code:"S0212",stack:(new Error).stack,position:e.position,token:e.value}):(this.lhs=e,this.rhs=p(t[":="]-1),this.type="binary",this)}),y("@",t["@"],function(e){return this.lhs=e,this.rhs=p(t["@"]),"variable"!==this.rhs.type?f({code:"S0214",stack:(new Error).stack,position:this.rhs.position,token:"@"}):(this.type="binary",this)}),y("#",t["#"],function(e){return this.lhs=e,this.rhs=p(t["#"]),"variable"!==this.rhs.type?f({code:"S0214",stack:(new Error).stack,position:this.rhs.position,token:"#"}):(this.type="binary",this)}),y("?",t["?"],function(t){return this.type="condition",this.condition=t,this.then=p(0),":"===o.id&&(d(":"),this.else=p(0)),this}),b("|",function(){return this.type="transform",this.pattern=p(0),d("|"),this.update=p(0),","===o.id&&(d(","),this.delete=p(0)),d("|"),this});var x=function t(e){var r;if("function"!==e.type||e.predicate)if("condition"===e.type)e.then=t(e.then),void 0!==e.else&&(e.else=t(e.else)),r=e;else if("block"===e.type){var n=e.expressions.length;n>0&&(e.expressions[n-1]=t(e.expressions[n-1])),r=e}else r=e;else{var i={type:"lambda",thunk:!0,arguments:[],position:e.position};i.body=e,r=i}return r},_=0,w=0,k=[],S=function t(e,r){switch(e.type){case"name":case"wildcard":r.level--,0===r.level&&(void 0===e.ancestor||(k[r.index].slot.label=e.ancestor.label),e.ancestor=r,e.tuple=!0);break;case"parent":r.level++;break;case"block":e.expressions.length>0&&(e.tuple=!0,r=t(e.expressions[e.expressions.length-1],r));break;case"path":e.tuple=!0;var n=e.steps.length-1;for(r=t(e.steps[n--],r);r.level>0&&n>=0;)r=t(e.steps[n--],r);break;default:throw{code:"S0217",token:e.type,position:e.position}}return r},M=function(t,e){if(void 0!==e.seekingParent||"parent"===e.type){var r=void 0!==e.seekingParent?e.seekingParent:[];"parent"===e.type&&r.push(e.slot),void 0===t.seekingParent?t.seekingParent=r:Array.prototype.push.apply(t.seekingParent,r)}},z=function(t){var e=t.steps.length-1,r=t.steps[e],n=void 0!==r.seekingParent?r.seekingParent:[];"parent"===r.type&&n.push(r.slot);for(var i=0;i<n.length;i++){var o=n[i];for(e=t.steps.length-2;o.level>0;){if(e<0){void 0===t.seekingParent?t.seekingParent=[o]:t.seekingParent.push(o);break}for(var s=t.steps[e--];e>=0&&s.focus&&t.steps[e].focus;)s=t.steps[e--];o=S(s,o)}}},A=function t(e){var r;switch(e.type){case"binary":switch(e.value){case".":var n=t(e.lhs);r="path"===n.type?n:{type:"path",steps:[n]},"parent"===n.type&&(r.seekingParent=[n.slot]);var o=t(e.rhs);"function"===o.type&&"path"===o.procedure.type&&1===o.procedure.steps.length&&"name"===o.procedure.steps[0].type&&"function"===r.steps[r.steps.length-1].type&&(r.steps[r.steps.length-1].nextFunction=o.procedure.steps[0].value),"path"===o.type?Array.prototype.push.apply(r.steps,o.steps):(void 0!==o.predicate&&(o.stages=o.predicate,delete o.predicate),r.steps.push(o)),r.steps.filter(function(t){if("number"===t.type||"value"===t.type)throw{code:"S0213",stack:(new Error).stack,position:t.position,value:t.value};return"string"===t.type}).forEach(function(t){t.type="name"}),r.steps.filter(function(t){return!0===t.keepArray}).length>0&&(r.keepSingletonArray=!0);var s=r.steps[0];"unary"===s.type&&"["===s.value&&(s.consarray=!0);var a=r.steps[r.steps.length-1];"unary"===a.type&&"["===a.value&&(a.consarray=!0),z(r);break;case"[":var u=r=t(e.lhs),l="predicate";if("path"===r.type&&(u=r.steps[r.steps.length-1],l="stages"),void 0!==u.group)throw{code:"S0209",stack:(new Error).stack,position:e.position};void 0===u[l]&&(u[l]=[]);var h=t(e.rhs);void 0!==h.seekingParent&&(h.seekingParent.forEach(function(t){1===t.level?S(u,t):t.level--}),M(u,h)),u[l].push({type:"filter",expr:h,position:e.position});break;case"{":if(void 0!==(r=t(e.lhs)).group)throw{code:"S0210",stack:(new Error).stack,position:e.position};r.group={lhs:e.rhs.map(function(e){return[t(e[0]),t(e[1])]}),position:e.position};break;case"^":"path"!==(r=t(e.lhs)).type&&(r={type:"path",steps:[r]});var f={type:"sort",position:e.position};f.terms=e.rhs.map(function(e){var r=t(e.expression);return M(f,r),{descending:e.descending,expression:r}}),r.steps.push(f),z(r);break;case":=":(r={type:"bind",value:e.value,position:e.position}).lhs=t(e.lhs),r.rhs=t(e.rhs),M(r,r.rhs);break;case"@":if(r=t(e.lhs),u=r,"path"===r.type&&(u=r.steps[r.steps.length-1]),void 0!==u.stages||void 0!==u.predicate)throw{code:"S0215",stack:(new Error).stack,position:e.position};if("sort"===u.type)throw{code:"S0216",stack:(new Error).stack,position:e.position};e.keepArray&&(u.keepArray=!0),u.focus=e.rhs.value,u.tuple=!0;break;case"#":r=t(e.lhs),u=r,"path"===r.type?u=r.steps[r.steps.length-1]:(r={type:"path",steps:[r]},void 0!==u.predicate&&(u.stages=u.predicate,delete u.predicate)),void 0===u.stages?u.index=e.rhs.value:u.stages.push({type:"index",value:e.rhs.value,position:e.position}),u.tuple=!0;break;case"~>":(r={type:"apply",value:e.value,position:e.position}).lhs=t(e.lhs),r.rhs=t(e.rhs);break;default:(r={type:e.type,value:e.value,position:e.position}).lhs=t(e.lhs),r.rhs=t(e.rhs),M(r,r.lhs),M(r,r.rhs)}break;case"unary":r={type:e.type,value:e.value,position:e.position},"["===e.value?r.expressions=e.expressions.map(function(e){var n=t(e);return M(r,n),n}):"{"===e.value?r.lhs=e.lhs.map(function(e){var n=t(e[0]);M(r,n);var i=t(e[1]);return M(r,i),[n,i]}):(r.expression=t(e.expression),"-"===e.value&&"number"===r.expression.type?(r=r.expression).value=-r.value:M(r,r.expression));break;case"function":case"partial":(r={type:e.type,name:e.name,value:e.value,position:e.position}).arguments=e.arguments.map(function(e){var n=t(e);return M(r,n),n}),r.procedure=t(e.procedure);break;case"lambda":r={type:e.type,arguments:e.arguments,signature:e.signature,position:e.position};var d=t(e.body);r.body=x(d);break;case"condition":(r={type:e.type,position:e.position}).condition=t(e.condition),M(r,r.condition),r.then=t(e.then),M(r,r.then),void 0!==e.else&&(r.else=t(e.else),M(r,r.else));break;case"transform":(r={type:e.type,position:e.position}).pattern=t(e.pattern),r.update=t(e.update),void 0!==e.delete&&(r.delete=t(e.delete));break;case"block":(r={type:e.type,position:e.position}).expressions=e.expressions.map(function(e){var n=t(e);return M(r,n),(n.consarray||"path"===n.type&&n.steps[0].consarray)&&(r.consarray=!0),n});break;case"name":r={type:"path",steps:[e]},e.keepArray&&(r.keepSingletonArray=!0);break;case"parent":r={type:"parent",slot:{label:"!"+_++,level:1,index:w++}},k.push(r);break;case"string":case"number":case"value":case"wildcard":case"descendant":case"variable":case"regex":r=e;break;case"operator":if("and"===e.value||"or"===e.value||"in"===e.value)e.type="name",r=t(e);else{if("?"!==e.value)throw{code:"S0201",stack:(new Error).stack,position:e.position,token:e.value};r=e}break;case"error":r=e,e.lhs&&(r=t(e.lhs));break;default:var p="S0206";"(end)"===e.id&&(p="S0207");var g={code:p,position:e.position,token:e.value};if(i)return c.push(g),{type:"error",error:g};throw g.stack=(new Error).stack,g}return e.keepArray&&(r.keepArray=!0),r};s=r(e),d();var E=p(0);if("(end)"!==o.id){var j={code:"S0201",position:o.position,token:o.value};f(j)}if("parent"===(E=A(E)).type||void 0!==E.seekingParent)throw{code:"S0217",token:E.type,position:E.position};return c.length>0&&(E.errors=c),E};return i}();e.exports=i},{"./signature":5}],5:[function(t,e,r){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i=t("./utils"),o=function(){var t={a:"arrays",b:"booleans",f:"functions",n:"numbers",o:"objects",s:"strings"};function e(e){for(var r=1,o=[],s={},a=s;r<e.length;){var c=e.charAt(r);if(":"===c)break;var u=function(){o.push(s),a=s,s={}},l=function(t,e,r,n){for(var i=1,o=e;o<t.length;)if(o++,(c=t.charAt(o))===n){if(0===--i)break}else c===r&&i++;return o};switch(c){case"s":case"n":case"b":case"l":case"o":s.regex="["+c+"m]",s.type=c,u();break;case"a":s.regex="[asnblfom]",s.type=c,s.array=!0,u();break;case"f":s.regex="f",s.type=c,u();break;case"j":s.regex="[asnblom]",s.type=c,u();break;case"x":s.regex="[asnblfom]",s.type=c,u();break;case"-":a.context=!0,a.contextRegex=new RegExp(a.regex),a.regex+="?";break;case"?":case"+":a.regex+=c;break;case"(":var h=l(e,r,"(",")"),f=e.substring(r+1,h);if(-1!==f.indexOf("<"))throw{code:"S0402",stack:(new Error).stack,value:f,offset:r};s.regex="["+f+"m]",s.type="("+f+")",r=h,u();break;case"<":if("a"!==a.type&&"f"!==a.type)throw{code:"S0401",stack:(new Error).stack,value:a.type,offset:r};var d=l(e,r,"<",">");a.subtype=e.substring(r+1,d),r=d}r++}var p="^"+o.map(function(t){return"("+t.regex+")"}).join("")+"$",g=new RegExp(p),y=function(t){var e;if(i.isFunction(t))e="f";else switch(n(t)){case"string":e="s";break;case"number":e="n";break;case"boolean":e="b";break;case"object":e=null===t?"l":Array.isArray(t)?"a":"o";break;default:e="m"}return e},m=function(t,e){for(var r="^",n=0,i=0;i<o.length;i++){r+=o[i].regex;var s=e.match(r);if(null===s)throw{code:"T0410",stack:(new Error).stack,value:t[n],index:n+1};n=s[0].length}throw{code:"T0410",stack:(new Error).stack,value:t[n],index:n+1}};return{definition:e,validate:function(e,r){var n="";e.forEach(function(t){n+=y(t)});var i=g.exec(n);if(i){var s=[],a=0;return o.forEach(function(n,o){var c=e[a],u=i[o+1];if(""===u)if(n.context&&n.contextRegex){var l=y(r);if(!n.contextRegex.test(l))throw{code:"T0411",stack:(new Error).stack,value:r,index:a+1};s.push(r)}else s.push(c),a++;else u.split("").forEach(function(r){if("a"===n.type){if("m"===r)c=void 0;else{c=e[a];var i=!0;if(void 0!==n.subtype)if("a"!==r&&u!==n.subtype)i=!1;else if("a"===r&&c.length>0){var o=y(c[0]);i=o===n.subtype.charAt(0)&&0===c.filter(function(t){return y(t)!==o}).length}if(!i)throw{code:"T0412",stack:(new Error).stack,value:c,index:a+1,type:t[n.subtype]};"a"!==r&&(c=[c])}s.push(c),a++}else s.push(c),a++})}),s}m(e,n)}}}return e}();e.exports=o},{"./utils":6}],6:[function(t,e,r){function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=i(t))||e){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw s}}}}function i(t,e){if(t){if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}var a=function(){function t(t){var e=!1;if("number"==typeof t&&(e=!isNaN(t))&&!isFinite(t))throw{code:"D1001",value:t,stack:(new Error).stack};return e}function e(t){var e=!1;return Array.isArray(t)&&(e=0===t.filter(function(t){return"string"!=typeof t}).length),e}function r(e){var r=!1;return Array.isArray(e)&&(r=0===e.filter(function(e){return!t(e)}).length),r}function i(){var t=[];return t.sequence=!0,1===arguments.length&&t.push(arguments[0]),t}function o(t){return!0===t.sequence&&Array.isArray(t)}function a(t){return t&&(!0===t._jsonata_function||!0===t._jsonata_lambda)||"function"==typeof t}function c(t){return"number"==typeof t.arity?t.arity:"function"==typeof t.implementation?t.implementation.length:"number"==typeof t.length?t.length:t.arguments.length}function u(t){return t&&!0===t._jsonata_lambda}var l=("function"==typeof Symbol?Symbol:{}).iterator||"@@iterator";function h(t){return"object"===s(t)&&null!==t&&l in t&&"next"in t&&"function"==typeof t.next}function f(t,e){if(t===e)return!0;if("object"===s(t)&&"object"===s(e)&&null!==t&&null!==e){if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(!f(t[r],e[r]))return!1;return!0}var n=Object.getOwnPropertyNames(t),i=Object.getOwnPropertyNames(e);if(n.length!==i.length)return!1;for(n=n.sort(),i=i.sort(),r=0;r<n.length;r++)if(n[r]!==i[r])return!1;for(r=0;r<n.length;r++){var o=n[r];if(!f(t[o],e[o]))return!1}return!0}return!1}function d(t){var e,r=[],i=n(t);try{for(i.s();!(e=i.n()).done;){var o=e.value;r.push(o)}}catch(t){i.e(t)}finally{i.f()}return r}return{isNumeric:t,isArrayOfStrings:e,isArrayOfNumbers:r,createSequence:i,isSequence:o,isFunction:a,isLambda:u,isIterable:h,getFunctionArity:c,isDeepEqual:f,stringToArray:d}}();e.exports=a},{}]},{},[3])(3)}(Gi)),Gi.exports),Hi=Wi(Xi);const Zi=function(t){return t};function Vi(t){if(!t)return Zi;try{const e=Hi(function(t){return t.replace(/(?<=^|\.|\[)([a-zA-Z_][\w]*-[\w-]*)(?=\.|$|\[|])/g,"`$1`")}(t));return function(t){return e.evaluate(t)}}catch(t){return $i(t),Zi}}function Qi(t){const e=fi(t);return null==e?"":String(e)}function Ji(t){return Number(fi(t))}function Ki(t){return t}function to(t){return Qi(t)}function eo(t){return Ji(t)}function ro(t){if(this.param)return t=Qi(t),this.param.hasOwnProperty(t)?this.param[t]:this.param.default}function no(t){const{param:e}=this;if(e){for(const r in e){let[n,i]=r.split("~");const o=!!n,s=!!i,a=parseFloat(n),c=parseFloat(i);if(t=Ji(t),o&&!s&&t>=a)return e[r];if(!o&&s&&t<a)return e[r];if(t>=a&&t<c)return e[r]}return e.default}}function io(t){return Ji(t)*Math.PI/180}function oo(){}const so=[/\bimport\b/,/\brequire\b/,/\b__proto__\b/,/\bconstructor\s*\[/,/\bprototype\b/];const ao=["globalThis","self","top","parent","frames","fetch","XMLHttpRequest","eval","Function","require","importScripts","process"],co=new Array(ao.length).fill(void 0),uo=Object.getPrototypeOf(async function(){}).constructor;function lo(t,e){!function(t){for(const e of so)if(e.test(t))throw new Error(`Blocked pattern detected: ${e}`)}(t);const r=function(t){return/\bawait\b/.test(t)}(t),n=new(r?uo:Function)(...e,...ao,t);return function(t,...e){return n.call(t,...e,...co)}}function ho(t,e,r,n,i){switch(r){case"value":return"text"===i||"string"===i?to.bind(t):"number"===i?eo.bind(t):Ki.bind(e);case"map":return ro.bind(t);case"range":return no.bind(t);case"radian":return io.bind(t);case"eval":return function(t){try{const e=lo(t,["value","targets","scene"]);return function(t,r){try{const n=e(this,t,r,globalThis.scene);return n&&"function"==typeof n.then?n.catch(t=>{$i(t)}):n}catch(t){return void $i(t)}}}catch(t){return $i(t),oo}}(n).bind(e);default:return Ki.bind(e)}}class fo{constructor(t,e){this.owner=e,this.model=t}dispose(){this._model=null,this.owner=null,this.evaluator=null,this.accessor=null}get model(){return this._model}set model(t){const{target:e,property:r,rule:n,param:i,accessor:o}=t;this._model=t,this.evaluator=ho(this,this.owner,n,i,function(t){switch(t){case"ref":case"fillStyle":case"strokeStyle":return"string";default:return}}(r)),this.accessor=Vi(o);const s=e.match(/\[(.*?)\]/);if(s){const[t,e]=s[1].split(":");this.propAccessor=Vi(t),this.partAccessor=Vi(e)}}get target(){return this.model.target}get property(){return this.model.property}get source(){return this.model.source}get param(){return this.model.param}get ndnsp(){return!!this.model.ndnsp}get partial(){return!!this.model.partial}}function po(t,e,r,n){const i=e.split(".");if(1===i.length)return void(t[e]=n?{...t[e],...r}:r);const o=i[0],s=void 0!==t[o]?t[o]:"function"==typeof t.get?t.get(o):void 0,a=s?{...s}:{};let c=a;for(let t=1;t<i.length-1;t++)c[i[t]]=c[i[t]]?{...c[i[t]]}:{},c=c[i[t]];const u=i[i.length-1];c[u]=n?{...c[u],...r}:r,t[o]=a}function go(t,e,r,n){t.forEach(t=>po(t,e,r,n))}function yo(t,e,r,n){t&&"function"==typeof t.then?t.then(t=>{void 0!==r&&void 0!==n&&r._dataGeneration!==n||e(t)}).catch(t=>$i(t)):e(t)}function mo(t=!1){if(!t&&void 0===this.data)return;this._dataGeneration=(this._dataGeneration??0)+1;const e=this._dataGeneration,r=this;this.mappings&&this.mappings.forEach(t=>{try{let n,{source:i,target:o,property:s,accessor:a,propAccessor:c,partAccessor:u,ndnsp:l=!1,partial:h=!1}=t;o=(o||"(self)").trim(),t.rule||(t.rule="value"),i&&"(self)"!=i?(i.startsWith("#")&&(i=i.substring(1)),n=this.root.findById(i)?.data||{}):n=this.data;const f=a(n);if("(root)"==o||"(key)"==o){if(null==f)return;const n=Object.keys(f||{}).map(t=>this.root.findOrCreate(t)).filter(Boolean).flat();n.length>0&&n.forEach(n=>{yo(t.evaluator(f[n.get("id")],[n]),t=>{!s||"(action)"===s||l&&!t&&0!==t&&!1!==t||po(n,s,t,h)},r,e)})}else if(o.startsWith("[")){if(null==f)return;if(f instanceof Array)f.forEach(n=>{const i=c(n);if(i){const o=this.root.findOrCreate(i);o&&yo(t.evaluator(u(n),o),t=>{!s||"(action)"===s||l&&!t&&0!==t&&!1!==t||go(o,s,t,h)},r,e)}});else{if(!(f instanceof Object))throw String("mapping data should be an object to target property-id.("+f+")");{const n=c(f);if(n){const i=this.root.findOrCreate(n);i&&yo(t.evaluator(u(f),i),t=>{!s||"(action)"===s||l&&!t&&0!==t&&!1!==t||go(i,s,t,h)},r,e)}}}}else{const n=this.root.findAll(o,this);n.length>0&&yo(t.evaluator(f,n),t=>{!s||"(action)"===s||l&&!t&&0!==t&&!1!==t||go(n,s,t,h)},r,e)}}catch(e){$i(e,this,t)}})}function bo(t,e){this.state.persistent&&this.app?.isViewMode&&this.app?.dataStorage.save(this,t.data),mo.call(this,!0)}function vo(){if(this._model.mappings)return this._model.mappings instanceof Array?void(this._mappings=(this._model.mappings||[]).filter(t=>t.property).map(t=>new fo({target:"(self)",rule:"value",...t},this))):($i("Mappings model is invalid (should be a Array) ..",this._model.mappings),void(this._mappings=[]));this._mappings=[]}function xo(){this._mappings&&this._mappings.forEach(t=>t.dispose()),delete this._mappings}function _o(t,e){this.disposeMappings(),mo.call(this)}function wo(t,e,r,n,i,o){e.complete?t.drawImage(e,r,n,i,o):e.addEventListener("load",()=>{this.invalidate()})}function ko(t){const{effects:e}=this.state;(e||[]).forEach(e=>{this.effect(t,e)})}const So="undefined"==typeof window?1:window.devicePixelRatio||(window.matchMedia&&window.matchMedia("(min-resolution: 2dppx), (-webkit-min-device-pixel-ratio: 1.5),(-moz-min-device-pixel-ratio: 1.5),(min-device-pixel-ratio: 1.5)").matches?2:1),Mo={FONT_SIZE:15,FONT_FAMILY:"Roboto, sans-serif",FONT_COLOR:"black",TEXT_ALIGN:"center",TEXT_BASELINE:"middle",BOLD:!1,ITALIC:!1,LINE_DASH:"solid"},zo=()=>{if("undefined"==typeof document||"function"!=typeof getComputedStyle||!document.documentElement)return;const t=getComputedStyle(document.documentElement);if(!t)return;const e=t.getPropertyValue?.("--scene-theme-font-family")?.trim(),r=t.fontFamily||"sans-serif";Mo.FONT_FAMILY=e||r};let Ao;function Eo(t,e,r,n,i){const{alpha:o=1}=n,s=i.fillStyle;if(t.globalAlpha*=o,s)if("string"==typeof s)t.fillStyle=s,t.fill();else if("object"==typeof s)if("gradient"==s.type){t.translate(r.x,r.y);let n,{width:i,height:o}=e;if("linear"==s.gradientType){const e=3.141592653589793,r="number"==typeof s.rotation&&Number.isFinite(s.rotation)?s.rotation:0;if(r>=.436332&&r<=1.13446||r>=2.00713&&r<=2.70526||r>=3.57792&&r<=4.27606||r>=5.14872&&r<=5.84685){let s=Math.sqrt(Math.pow((i-4)/2,2)+Math.pow((o-4)/2,2));s-=s-(i+o)/3,n=t.createLinearGradient(s*Math.cos(r+e),s*Math.sin(r+e),s*Math.cos(r),s*Math.sin(r))}else n=t.createLinearGradient((i-4)/2*Math.cos(r+e),(o-4)/2*Math.sin(r+e),(i-4)/2*Math.cos(r),(o-4)/2*Math.sin(r))}else if("radial"==s.gradientType){const e=.95*Math.sqrt(Math.pow((i-4)/2,2)+Math.pow((o-4)/2,2));switch(s.center){case"center":default:n=t.createRadialGradient(0,0,0,0,0,e);break;case"left-top":n=t.createRadialGradient(-i/2,-o/2,0,-i/2,-o/2,2*e);break;case"right-top":n=t.createRadialGradient(i/2,-o/2,0,i/2,-o/2,2*e);break;case"left-bottom":n=t.createRadialGradient(-i/2,o/2,0,-i/2,o/2,2*e);break;case"right-bottom":n=t.createRadialGradient(i/2,o/2,0,i/2,o/2,2*e)}}(Array.isArray(s.colorStops)?s.colorStops:Array.isArray(s.gradientStops)?s.gradientStops:[]).forEach(t=>{if(t.position>=0&&t.position<=1)try{n.addColorStop(t.position,t.color)}catch(e){((...t)=>{const e=[];t.forEach(t=>t&&t.stack&&e.push(t.stack)),console.warn("[WARN]",...t,e.join(" "))})("Invalid Color for colorstop : ",t.color),n.addColorStop(t.position,"#fff")}}),t.fillStyle=n,t.fill(),t.translate(-r.x,-r.y)}else if("pattern"==s.type&&s.image)if(s.guideOnly&&1!=i.app.mode)s.color&&(t.fillStyle=s.color,t.fill());else{i.prepareFillIf(!i._pattern_image_origin);const r=i._pattern_image;if(!r||!r.width||!r.height)return;let n=0,o=0,a=0,c=0,u=e.left,l=e.top;if(!s.fitPattern){n=s.offsetX,o=s.offsetY;const t=s.width?s.width:r.width,i=s.height?s.height:r.height;switch(s.align){case"center":a=e.width/2-t/2,c=e.height/2-i/2;break;case"left-top":a=0,c=0;break;case"left-bottom":a=0,c=e.height-i;break;case"right-top":a=e.width-t,c=0;break;case"right-bottom":a=e.width-t,c=e.height-i;break;case"left":a=0,c=e.height/2-i/2;break;case"right":a=e.width-t,c=e.height/2-i/2;break;case"top":a=e.width/2-t/2,c=0;break;case"bottom":a=e.width/2-t/2,c=e.height-i}u+=n+a,l+=o+c}t.translate(u,l),s.color&&(t.fillStyle=s.color,t.fill()),s.fitPattern?Math.abs((r.width-e.width)*(r.height-e.height))>1?(delete i._pattern_image,delete i._pattern_image_origin):t.fillStyle=t.createPattern(r,"no-repeat"):t.fillStyle=t.createPattern(r,s.noRepeat?"no-repeat":"repeat"),t.fill(),t.translate(-u,-l)}}function jo(t,e){const r=this.fillStyle;if(!r||"pattern"!=r.type||!r.image)return void t(this);if("string"!=typeof r.image)return this._pattern_image_origin=this._pattern_image=r.image,void t(this);this._pattern_image=null,this._pattern_image_origin=new Image;const n=this;this._pattern_image_origin.onload=function(){if(!r.fitPattern&&!r.width&&!r.height)return n._pattern_image=n._pattern_image_origin,void t(this);let e=r.width||this.width,i=r.height||this.height;r.fitPattern&&(e=n.bounds.width,i=n.bounds.height);const o=Ao(e,i);o.getContext("2d").drawImage(this,0,0,this.width,this.height,0,0,e,i),n._pattern_image=o,t(this)},this._pattern_image_origin.onerror=function(t){e(t)};try{"data"!==String(r.image).substring(0,4)?this._pattern_image_origin.crossOrigin="use-credentials":this._pattern_image_origin.crossOrigin=null,this._pattern_image_origin.src=this.app.url(r.image)}catch(t){e(t)}}function Oo(t){t&&this.prepareFill(t=>{this.invalidate()},t=>{$i(t)})}function To(t,e){const r=this.fillStyle;r&&"pattern"!==r.type?this._pattern_image&&(this._pattern_image=null,this._pattern_image_origin=null):r?.image&&this.prepareFillIf(r.image)}function Po(t,e,r){let{strokeStyle:n,lineDash:i,lineWidth:o,lineCap:s,lineJoin:a,alpha:c}=e;if(n&&0!=o){if(s&&(t.lineCap=s),i){const e="round"==s;switch(i){case"solid":i=[0,0];break;case"round-dot":i=e?[0,2*o]:[o,o];break;case"square-dot":i=e?[o,2*o]:[2*o,o];break;case"dash":i=e?[3*o,2.5*o]:[4*o,1.5*o];break;case"dash-dot":i=e?[3*o,3*o,0,3*o]:[4*o,2*o,o,2*o];break;case"long-dash":i=e?[5*o,4*o]:[6*o,3*o];break;case"long-dash-dot":i=e?[5*o,3*o,0,3*o]:[6*o,2*o,o,2*o];break;case"long-dash-dot-dot":i=e?[5*o,2*o,0,2*o,0,2*o]:[6*o,o,o,o,o,o]}Array.isArray(i)||(i=[]),t.setLineDash(i)}t.globalAlpha*=c,t.strokeStyle=n,t.lineWidth=o,t.lineJoin=a,t.stroke()}}function Io(t){const e=/(\*\*|__)(.*?)\1|(\*|_)(.*?)\3|([^\*_]+)/g,r=[];let n;for(;null!==(n=e.exec(t));)n[1]?r.push({text:n[2],bold:!0,italic:!1}):n[3]?r.push({text:n[4],bold:!1,italic:!0}):n[5]&&r.push({text:n[5],bold:!1,italic:!1});return r}function Co(t,e,r,n=0){if(e.text.length<2)return e;let i=2;for(;i<e.text.length;i++){const o=e.text.substring(0,i);if(!(t.measureText(o).width+(i-1)*n<r))break}return{...e,text:e.text.substring(0,i-1)}}function Fo(t,e,r,n,i,o=0){const s=String(e).split("\n");return n?[].concat(...s.map(e=>function(t,e,r,n=0){const i=[];let o=[],s=0;return e.forEach(e=>{let a=e.text;for(;a.length>0;){const c=r-s,u=t.measureText(a).width+(a.length-1)*n;if(u<=c)o.push({...e,text:a}),s+=u,a="";else{const r=Co(t,{...e,text:a},c,n);o.push(r),i.push(o),o=[],s=0,a=a.substring(r.text.length)}}}),o.length>0&&i.push(o),i}(t,i?Io(e):[{text:e,bold:!1,italic:!1}],r,o))):s.map(t=>i?Io(t):[{text:t,bold:!1,italic:!1}])}function Ro(t,e,r,n,i,o,s=0){if(!n)return[];t.save(),t.font=r;const a=Fo(t,n,e,!!i,o,s);return t.restore(),a}function Do(t){const{fontFamily:e=Mo.FONT_FAMILY,bold:r=Mo.BOLD,italic:n=Mo.ITALIC,fontSize:i=Mo.FONT_SIZE}=t,o=[];return r&&o.push("bold"),n&&o.push("italic"),o.push(i+"px"),o.push(e),o.join(" ")}function Lo(t,e){const r=t.bold||e.bold,n=t.italic||e.italic;return Do({...t,bold:r,italic:n})}function No(t,e,r,n){let{alpha:i,rotation:o,keepTextAngle:s=!1,fontColor:a=Mo.FONT_COLOR,textAlign:c=Mo.TEXT_ALIGN,textBaseline:u=Mo.TEXT_BASELINE,textBackgroundStyle:l,fontSize:h,lineHeight:f,textWrap:d,textOverflow:p,letterSpacing:g=0}=n;i=void 0!==i?i:1,h||=Mo.FONT_SIZE,f||=1.2*h,t.save();const{left:y,top:m,width:b,height:v}=e;if(o&&s&&(t.translate(y+b/2,m+v/2),t.rotate(-o),t.translate(-(y+b/2),-(m+v/2))),t.beginPath(),t.font=Do(n),!d&&p){const e=function(t,e,r,n){const i="ellipsis"===t?"…":"",o=e.measureText(i).width,s=[];let a=0;for(const i of r){const r=[];for(const c of i){const i=e.measureText(c.text).width;if(!(a+i<=n-("ellipsis"===t?o:0))){const i=Yo(e,c,n-a-("ellipsis"===t?o:0),t);return r.push(i),s.push(r),s}r.push(c),a+=i}s.push(r),a=0}return s}(p,t,r,b);r=e}const x=r.length*f;let _;switch(u){case"top":_=m,t.textBaseline="top";break;case"bottom":_=m+v-x+f,t.textBaseline="bottom";break;default:_=m+v/2-x/2+f/2,t.textBaseline="middle"}t.globalAlpha*=i,t.fillStyle=a,r.forEach((e,i)=>{const o=_+i*f,s=function(t,e,r,n=0){return e.reduce((e,i)=>(t.font=Lo(r,i),e+t.measureText(i.text).width+n*(i.text.length-1)),0)}(t,e,n,g);let u=y;switch(c){case"left":case"justify":u=y;break;case"right":u=y+b-s;break;case"center":u=y+(b-s)/2}if(l&&(t.fillStyle=l,function(t,e,r,n,i,o=0,s=!1,a=!0){o="number"==typeof o?{tl:o,tr:o,br:o,bl:o}:{tl:0,tr:0,br:0,bl:0,...o},t.beginPath(),t.moveTo(e+o.tl,r),t.lineTo(e+n-o.tr,r),t.quadraticCurveTo(e+n,r,e+n,r+o.tr),t.lineTo(e+n,r+i-o.br),t.quadraticCurveTo(e+n,r+i,e+n-o.br,r+i),t.lineTo(e+o.bl,r+i),t.quadraticCurveTo(e,r+i,e,r+i-o.bl),t.lineTo(e,r+o.tl),t.quadraticCurveTo(e,r,e+o.tl,r),t.closePath(),s&&t.fill(),a&&t.stroke()}(t,u-4,o-h/2-4,s+8,h+8,4,!0,!1),t.fillStyle=a),"justify"===c&&i<r.length-1&&e.length>1){const r=b-s,i=e.length-1,a=r/i;e.forEach((e,r)=>{t.font=Lo(n,e),t.fillText(e.text,u,o),u+=t.measureText(e.text).width+(r<i?a:0)})}else e.forEach(e=>{t.font=Lo(n,e),[...e.text].forEach(e=>{t.fillText(e,u,o),u+=t.measureText(e).width+g})})}),t.restore()}function Yo(t,e,r,n){let i="";for(let n=0;n<e.text.length;n++){const o=i+e.text[n];if(t.measureText(o).width>r)break;i=o}return{...e,text:i+("ellipsis"===n?"…":"")}}function $o(t,e){for(let r=0;r<t.length;r++)if(t[r].type.startsWith("image/"))return void this.set("fillStyle",{type:"pattern",image:e[r],fitPattern:!0})}(()=>{if("undefined"!=typeof window&&"undefined"!=typeof document&&(window.addEventListener("load",()=>{zo()}),"fonts"in document&&"ready"in document.fonts&&document.fonts.ready.then(zo),"undefined"!=typeof MutationObserver&&document.documentElement)){new MutationObserver(()=>{zo()}).observe(document.documentElement,{attributes:!0,attributeFilter:["style","class"]})}})(),zo(),Ao="undefined"==typeof document?function(t,e){return new Canvas(t,e)}:function(t,e){const r=document.createElement("canvas");return r.width=t,r.height=e,r};const Uo=[];function Wo(t,e,r={x:0,y:0},n=0,i={x:1,y:1}){if(1!==i.x||1!==i.y?(t=(t-r.x)/i.x,e=(e-r.y)/i.y):(t-=r.x,e-=r.y),0!==n){const r=Math.cos(-n),i=Math.sin(-n),o=t*i+e*r;t=t*r-e*i,e=o}return{x:t+r.x,y:e+r.y}}function qo(t,e,r={x:0,y:0},n=0,i={x:1,y:1}){if(t-=r.x,e-=r.y,0!==n){const r=Math.cos(n),i=Math.sin(n),o=t*i+e*r;t=t*r-e*i,e=o}return 1!==i.x||1!==i.y?{x:t*i.x+r.x,y:e*i.y+r.y}:{x:t+r.x,y:e+r.y}}function Bo(t,e,r){if(!this.parent)return{x:t,y:e};const{rotation:n=0,scale:i={x:1,y:1}}=this.state;if(this.isLayer()){const r=this.state.translate,o=Wo(t,e,r,n,i);return r&&(o.x-=r.x,o.y-=r.y),o}return Wo(t,e,r=r||this.rotatePoint,n,i)}function Go(t,e,r){if(!this.parent)return{x:t,y:e};let{rotation:n=0,scale:i={x:1,y:1}}=this.state;if(this.isLayer()){const r=this.state.translate,o=qo(t,e,void 0,n+(this._delta?.theta??0),i);return r&&(o.x+=r.x,o.y+=r.y),o}r=r||this.rotatePoint;const{theta:o=0,tx:s=0,ty:a=0,sx:c=1,sy:u=1}=this._delta||{};if(0===o&&0===s&&0===a&&1===c&&1===u)return qo(t,e,r,n,i);return qo(t+s,e+a,{x:r.x+s,y:r.y+a},n+o,{x:i.x*c,y:i.y*u})}function Xo(t,e,r){r=r||this.rootModel;const n=this.transcoordS2T(t,e,r);return qo(n.x,n.y,void 0,(r.get("rotation")||0)+r._delta.theta)}function Ho(t,e,r){r=r||this.rootModel,Uo.length=0;for(let t=this.parent;t&&t!==r;t=t.parent)Uo.push(t);let n=this.transcoordS2P(t,e);for(let t=0;t<Uo.length;t++){const e=Uo[t],r=e.bounds;n.x+=r.left,n.y+=r.top,n=e.transcoordS2P(n.x,n.y)}return n}function Zo(t,e,r){r=r||this.rootModel,Uo.length=0;for(let t=this.parent;t&&t!==r;t=t.parent)Uo.push(t);let n={x:t,y:e};for(let t=Uo.length-1;t>=0;t--){const e=Uo[t];n=e.transcoordP2S(n.x,n.y);const r=e.bounds;n.x-=r.left,n.y-=r.top}return n}function Vo(t,e,r){const n=this.transcoordT2P(t,e,r);return this.transcoordP2S(n.x,n.y)}function Qo(t,e,r){const n=this.rootModel,i=this.transcoordS2T(t,e,n);return r.transcoordT2S(i.x,i.y,n)}function Jo(t,e,r){if(!r)for(r=this;r&&!r.isLayer();)r=r.parent;const{translate:n={x:0,y:0},scale:i={x:1,y:1},rotation:o=0}=r.model,s=Wo(t,e,n,o,i);return n&&(s.x-=n.x,s.y-=n.y),r===this?s:this.transcoordT2S(s.x,s.y,r)}function Ko(t,e,r){if(!r)for(r=this;r&&!r.isLayer();)r=r.parent;let n;if(n=r!==this?this.transcoordS2T(t,e,r):{x:t,y:e},!this.scalable)return n;const{translate:i={x:0,y:0},rotation:o=0,scale:s={x:1,y:1}}=r.model;return n=qo(n.x,n.y,void 0,o+r._delta.theta,s),i&&(n.x+=i.x,n.y+=i.y),n}function ts(t){const e=t.element,r=t.fillStyle,n=e.style;if(r)if("string"==typeof r)n.backgroundColor=r;else switch(r.type){case"pattern":if(n.backgroundImage="url("+r.image+")",n.backgroundColor="transparent",r.fitPattern?n.backgroundSize="100% 100%":r.width||r.height?n.backgroundSize=`${r.width?r.width+"px":"auto"} ${r.height?r.height+"px":"auto"}`:n.backgroundSize="contain",r.fitPattern)n.backgroundRepeat="no-repeat";else{const{offsetX:t,offsetY:e,noRepeat:i,align:o,color:s}=r;if(i&&(n.backgroundRepeat="no-repeat"),s&&(n.backgroundColor=s),o)switch(o){case"center":n.backgroundPosition="center center";break;case"left-top":n.backgroundPosition="left top";break;case"left-bottom":n.backgroundPosition="left bottom";break;case"right-top":n.backgroundPosition="right top";break;case"right-bottom":n.backgroundPosition="right bottom";break;case"left":n.backgroundPosition="left center";break;case"right":n.backgroundPosition="right center";break;case"top":n.backgroundPosition="center top";break;case"bottom":n.backgroundPosition="center bottom"}else t||e?n.backgroundPosition=`${Number(t)||0}px ${Number(e)||0}px`:delete n.backgroundPosition}break;case"gradient":n.background=function(t,e){const r=e.colorStops,n=e.gradientType;if(r instanceof Array&&r.length>0)switch(n){case"radial":return"radial-gradient(farthest-corner at "+function(t,e){const{width:r,height:n}=t.bounds;switch(e){case"center":return[r/2,n/2];case"left-top":return[0,0];case"right-top":return[r,0];case"left-bottom":return[0,n];default:return[r,n]}}(t,e.center||"center").map(t=>t+"px").join(" ")+","+r.map(t=>`${t.color} ${100*t.position}%`).join(",")+")";case"linear":return"linear-gradient("+(180*(e.rotation||0)/3.141592653589793+90+"deg")+", "+r.map(t=>`${t.color} ${100*t.position}%`).join(",")+")"}return""}(t,r)}else n.background="transparent"}const es={x:1,y:1},rs={boxSizing:"border-box",margin:"0px",position:"absolute",outline:"none"};function ns(t,e){let r=this.bounds,n=this.rotatePoint;const i=this.get("rotation"),o=this.get("scale");if(t){const n=t.call(e,r);n&&(r=n)}const{left:s,top:a,width:c,height:u}=r;let l=[{x:s,y:a},{x:s+c,y:a+u}];l=l.map(t=>qo(t.x,t.y,n,i,o));let h=l[0],f=l[1];n={x:(h.x+f.x)/2,y:(h.y+f.y)/2},l=l.map(t=>Wo(t.x,t.y,n,i,o)),h=l[0],f=l[1],this.bounds={left:h.x,top:h.y,width:f.x-h.x,height:f.y-h.y}}function is(t,e,r){let n=this.path,i=this.rotatePoint;t&&(n=t.call(r,n));let o=n.map(t=>{const e=this.toParent(t.x,t.y);return{...t,x:e.x,y:e.y}});if(e){const t=e.call(r,o);t&&(o=t)}const s={x:0,y:0};let a,c,u,l;n=o.map(t=>this.fromParent(t.x,t.y,s)),a=c=n[0].x,u=l=n[0].y;for(let t=1;t<n.length;t++){const e=n[t];e.x<a?a=e.x:e.x>c&&(c=e.x),e.y<u?u=e.y:e.y>l&&(l=e.y)}i={x:(a+c)/2,y:(u+l)/2},i=this.toParent(i.x,i.y,s),this.path=o.map(t=>{const e=this.fromParent(t.x,t.y,i);return{...t,x:e.x,y:e.y}})}function os(t){const e=t?.state;return{type:e?.type??t?.constructor?.name,id:e?.id,refid:e?.refid,className:t?.constructor?.name}}const ss=new class{constructor(){this._realTime=0,this._totalTicks=0,this._subs=new Set,this._nextId=1,this._externals=new Set,this._externalNextId=1,this._rafId=null,this._lastWallTime=null,this._emaDt=16.67,this._ticking=!1,this._hasPendingRemoval=!1}get realTime(){return this._realTime}get simTime(){return L.now}get isRunning(){return null!==this._rafId}subscribe(t,e){const r=e?.component,n=r?.app??r?.root?.app;if(n&&"boolean"==typeof n.isViewMode&&!n.isViewMode)return()=>{};const i={id:this._nextId++,handler:t,description:e?.description??`<anonymous#${this._nextId-1}>`,componentRef:null!=e?.component&&"undefined"!=typeof WeakRef?new WeakRef(e.component):void 0,targetsGetter:e?.getTargets,metadata:e?.metadata,registeredAt:this._realTime,tickCount:0,totalDurationMs:0,lastDt:0,lastDurationMs:0};return this._subs.add(i),this.isRunning||this.start(),()=>{this._ticking?(i._removed=!0,this._hasPendingRemoval=!0):(this._subs.delete(i),0===this._subs.size&&this.stop())}}tick(t){const e=Math.min(Math.max(t,0),200);this._realTime+=e,Ai.enabled&&(this._totalTicks++,e>0&&(this._emaDt=.9*this._emaDt+.1*e));const r=L.tick(e),n=L.now;if(this._ticking=!0,Ai.enabled)for(const t of this._subs){if(t._removed)continue;const e=performance.now();try{t.handler(r,n)}finally{const n=performance.now()-e;t.tickCount++,t.totalDurationMs+=n,t.lastDt=r,t.lastDurationMs=n}}else for(const t of this._subs)t._removed||t.handler(r,n);if(this._ticking=!1,this._hasPendingRemoval){this._hasPendingRemoval=!1;for(const t of this._subs)t._removed&&this._subs.delete(t);0===this._subs.size&&this.stop()}}start(){if(null!==this._rafId)return;this._lastWallTime=null;const t=()=>{if(null===this._rafId)return;const e=performance.now(),r=null===this._lastWallTime?0:e-this._lastWallTime;this._lastWallTime=e,this.tick(r),null!==this._rafId&&(this._rafId=requestAnimationFrame(t))};this._rafId=requestAnimationFrame(t)}stop(){null!==this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._lastWallTime=null}registerExternalAnimation(t,e,r){const n={id:this._externalNextId++,description:t,source:e,metadata:r,registeredAt:this._realTime};return this._externals.add(n),{update:t=>{n.metadata={...n.metadata??{},...t}},unregister:()=>{this._externals.delete(n)}}}snapshot(){const t=[];for(const e of this._subs){if(e._removed)continue;let r;const n=e.componentRef?.deref();let i;if(n&&(r=os(n)),e.targetsGetter)try{const t=e.targetsGetter();if(null!=t){const e=Array.isArray(t)?t:[t],r=[];for(const t of e)null!=t&&r.push(os(t));r.length>0&&(i=r)}}catch{}t.push({id:e.id,description:e.description,componentInfo:r,targetInfos:i,metadata:e.metadata,registeredAt:e.registeredAt,tickCount:e.tickCount,totalDurationMs:Math.round(100*e.totalDurationMs)/100,avgDurationMs:e.tickCount>0?Math.round(e.totalDurationMs/e.tickCount*100)/100:0,lastDt:Math.round(100*e.lastDt)/100,lastDurationMs:Math.round(100*e.lastDurationMs)/100})}const e=[];for(const t of this._externals)e.push({id:t.id,description:t.description,source:t.source,metadata:t.metadata,registeredAt:t.registeredAt,liveDurationMs:Math.round(this._realTime-t.registeredAt)});return{realTime:Math.round(this._realTime),simTime:Math.round(L.now),isRunning:this.isRunning,speed:L.speed,paused:L.isPaused,totalTicks:this._totalTicks,ticksPerSecond:this._emaDt>0?Math.round(1e3/this._emaDt):0,totalSubs:t.length,subscriptions:t,externalAnimations:e}}},as=new Map;let cs=null;function us(){cs&&(cs(),cs=null)}function ls(t){return!t.disposed&&t.retention>0&&!t.isTemplate()&&t.app&&t.app.isViewMode}var hs=new class{add(t){var e;ls(t)&&!as.has(t)&&(as.set(t,0),e=t?.root,cs||(cs=ss.subscribe(t=>{if(0===t)return;const e=[];for(const[r,n]of as){if(!ls(r)){e.push(r);continue}const i=n+t;i>=r.retention?e.push(r):as.set(r,i)}for(const t of e){as.delete(t);try{t.disposed||t.removeSelf?.(!0)}catch(t){$i("RetentionManager removeSelf failed:",t)}}0===as.size&&us()},{description:"retention timer",component:e,getTargets:()=>Array.from(as.keys()),metadata:{get count(){return as.size},get preview(){return Array.from(as.entries()).slice(0,3).map(([t,e])=>({type:t?.state?.type,id:t?.state?.id??"-",retentionMs:t?.retention,remainingMs:Math.max(0,Math.round(t?.retention-e))}))}}})))}remove(t){as.delete(t)&&0===as.size&&us()}touch(t){t&&as.has(t)&&as.set(t,0)}dispose(){us(),as.clear()}get length(){return as.size}};const fs=function(t){return t};function ds(t){const e=t.indexOf("||");let r="",n="";-1!=e&&(r=t,n=t.substring(e+2,t.length-1).trim(),t=t.replace(t.substring(e,t.length-1),"").trim());const i=t.substr(2,t.length-3).trim().replace(/\[(\w+)\]/g,".$1").replace(/^\./,"").split(".").filter(t=>!!t.trim()),o=i.slice(1);return{defaultValue:n,match:t,originText:r||t,target:i[0],accessor:o.length>0?function(t){return o.reduce((t,e)=>t?t[e]:void 0,t)}:fs}}function ps(t){if(!t)return;const e=String(t),r=(e.match(/#{(\S*)}/)||[]).map(t=>ds(t))[0];if(r)return r.accessor(this.getState(r.target));const n=(e.match(/\${[^}]*}/)||[]).map(t=>ds(t))[0];if(n){const t=this.root.findById(n.target);return n.accessor(this.getState(t))}return t}function gs(t,e){if(!t)return;const r=String(t),n=e||fi,i=(r.match(/#{(\S*)}/gi)||[]).map(t=>ds(t)),o=(r.match(/\${[^}]*}/gi)||[]).map(t=>ds(t));if(0==i.length&&0==o.length)return r;let s=r;return i.forEach(t=>{const e=n(t.accessor(this.getState(t.target)));s=s.replace(t.match,void 0===e?"":e)}),o.forEach(t=>{const e=this.root.findById(t.target),r=n(t.accessor(e&&e.data));s=s.replace(t.match,void 0===r?"":r)}),s}function ys(t,e,r){if(!t)return;const n=r||fi,i=String(t),o=(i.match(/#{[^}]*}/gi)||[]).map(t=>ds(t)),s=(i.match(/\${[^}]*}/gi)||[]).map(t=>ds(t));return 0!=o.length||0!=s.length?function(){let t=i;return o.forEach(r=>{const i=n(r.accessor(e.getState(r.target)));t=t.replace(r.originText,void 0===i?r.defaultValue||"":i)}),s.forEach(r=>{const i=e.root.findById(r.target),o=n(r.accessor(i&&i.data));t=t.replace(r.originText,void 0===o?r.defaultValue||"":o)}),t}:void 0}class ms{constructor(){}static registerDecorator(t,e){ms.constructors.set(t,e)}static create(t,e,r={},n){const i=ms.constructors.get(t);if(!i)throw new Error(`unknown decorator type: ${t}`);return new i(n,e,r)}}function bs(t,e){const r=e.x-t.x,n=e.y-t.y,i=Math.sqrt(r*r+n*n);if(!at(t))return i;const o=ct(t,e,t.bulge);if(!o)return i;const s=Math.min(o.radius,i/2),a=2*Math.asin(s/o.radius);return o.radius*a}function vs(t,e){const r=t.path.slice();if(!r||!r.length)return void $i("path should not be empty");let n=1;const i=[];if(t.isLine()||r.push(r[0]),e<=0)return t.toScene(r[0].x,r[0].y);if(e>=1)return t.toScene(r[r.length-1].x,r[r.length-1].y);for(;r[n];)i.push(bs(r[n-1],r[n])),n++;const o=i.reduce(function(t,e){return t+e},0);n=0;let s=0;do{s+=i[n++]}while(s/o<e);s-=i[--n];e=(e-s/o)*(o/i[n]);const a=r[n%r.length],c=r[(n+1)%r.length],{x:u,y:l}=function(t,e,r){if(at(t)){const n=ct(t,e,t.bulge);if(n){let t=n.endAngle-n.startAngle;n.clockwise?t>0&&(t-=2*Math.PI):t<0&&(t+=2*Math.PI);const e=n.startAngle+r*t;return{x:n.cx+n.radius*Math.cos(e),y:n.cy+n.radius*Math.sin(e)}}}return{x:t.x+Math.round((e.x-t.x)*r),y:t.y+Math.round((e.y-t.y)*r)}}(a,c,e);return t.toScene(u,l)}function xs(t,e){return!1}function _s({x:t,y:e},...r){const n=this.path,i=t,o=e;this.path=n.map(t=>({...t,x:t.x+i,y:t.y+o}))}function ws(t){const e=t??this.center.x,{rotation:r}=this.state,n=this.fillStyle;if(this.set("rotation",2*Math.PI-r),n&&"gradient"===n.type&&"linear"===n.gradientType){const t=Jn(n);t.rotation=(Math.PI-parseFloat(n.rotation||0))%(2*Math.PI),this.set("fillStyle",t)}this.path=this.path.map(t=>({...t,x:2*e-t.x,y:t.y}))}function ks(t){this.symmetryX(),this.set("rotation",(Math.PI+this.model.rotation)%(2*Math.PI)),t&&this.move({x:0,y:2*(t-this.center.y)},!1)}function Ss(t,e,r){if(r){const e=this.bounds,r=e.height/e.width;let n=t.width-e.width,i=t.height-e.height;n*r>i?i=n*r:n=i/r;let o=t.left-e.left,s=t.top-e.top;return 0!=o&&0!=s?(s=-i,o=-n):0!=o?o=-n:0!=s&&(s=-i),{left:e.left+o,top:e.top+s,width:e.width+n,height:e.height+i}}return t}function Ms(t,e){if(e||this.app.rotateStepForced){const e=this.app.rotateStep;return Math.floor((t+e/2)/e)*e}return t}function zs(t){return vs(this,t||0)}function As(){const t=this.path;let e,r,n,i;e=r=t[0].x,n=i=t[0].y;for(let o=1;o<t.length;o++){const s=t[o];s.x<e?e=s.x:s.x>r&&(r=s.x),s.y<n?n=s.y:s.y>i&&(i=s.y)}return{left:e,top:n,width:r-e,height:i-n}}function Es(t){const e=this.bounds;if(Math.round(100*t.width)/100==Math.round(100*e.width)/100&&Math.round(100*t.height)/100==Math.round(100*e.height)/100&&Math.round(100*t.left)/100==Math.round(100*e.left)/100&&Math.round(100*t.top)/100==Math.round(100*e.top)/100)return;const r=0==e.width?1:t.width/e.width,n=0==e.height?1:t.height/e.height;this.path=this.path.map(i=>({...i,x:t.left+(i.x-e.left)*r,y:t.top+(i.y-e.top)*n}))}function js(){const t=this.bounds;return{x:t.left+t.width/2,y:t.top+t.height/2}}function Os(t){if(!t||isNaN(t.x)||isNaN(t.y))return;const e=this.center;if(Math.round(100*t.x)/100==Math.round(100*e.x)/100&&Math.round(100*t.y)/100==Math.round(100*e.y)/100)return;const r=t.x-e.x,n=t.y-e.y;this.path=this.path.map(t=>({...t,x:t.x+r,y:t.y+n}))}function Ts(){const{x:t,y:e}=this.center;return{x:t,y:e,z:this.state.zPos}}function Ps(t){const{x:e,y:r,z:n}=t||{};this.center={x:e,y:r},isNaN(n)||this.setState("zPos",Number(n))}function Is(){const{rotationX:t,rotationY:e,rotation:r}=this.state;return{x:t,y:e,z:-r}}function Cs(t){const{x:e,y:r,z:n}=t;this.setState({rotationX:e,rotationY:r,rotation:-n})}function Fs(){const{width:t,height:e}=this.bounds,{depth:r}=this.state;return{width:t,height:e,depth:r}}function Rs(t){const{width:e,height:r,depth:n}=t,{top:i,left:o}=this.bounds;this.bounds={top:i,left:o,width:e,height:r},this.setState("depth",n)}function Ds(){return $i("이 컴포넌트에 get path 가 구현되어있지 않음.",this),[]}function Ls(t){$i("이 컴포넌트에 get path 가 구현되어있지 않음.",this)}function Ns(){return this.path}function Ys(){return this.center}function $s(){return this.nature.mutable}function Us(){return this.nature.resizable&&!this.stuck}function Ws(){return this.nature.rotatable&&!this.stuck}ms.constructors=new Map;const qs={x:1,y:1};function Bs(t,e,r){const{offsetX:n,offsetY:i,blur:o,color:s}=function(t){return{offsetX:t.offsetX??t.left??0,offsetY:t.offsetY??t.top??0,blur:t.blur??t.blurSize??0,color:t.color??"transparent"}}(e),a=r.rootModel.get("scale")??qs;t.shadowOffsetX=n*a.x*So,t.shadowOffsetY=i*a.y*So,t.shadowBlur=o*a.x*So,t.shadowColor=s}function Gs(t){t.save(),this.prerender(t),this.render(t),this.postrender(t),t.restore()}function Xs(t){const e=this.rotatePoint,{scale:r,rotation:n,shadow:i,alpha:o}=this.state,s=(r&&r.x||1)*this._delta.sx,a=(r&&r.y||1)*this._delta.sy,c=(n||0)+this._delta.theta,{tx:u=0,ty:l=0}=this._delta,h=(o||1)-this._delta.fade;(u||l)&&t.translate(u,l),(1!=s||1!=a||c)&&(t.translate(e.x,e.y),1==s&&1==a||t.scale(s,a),c&&t.rotate(c),t.translate(-e.x,-e.y)),h&&(t.globalAlpha=h),i&&Bs(t,i,this),this.app.isEditMode&&this.hidden&&(t.globalAlpha*=.5);const f=this.app.focusFilter;this.app.isEditMode&&f&&!f(this)&&(t.globalAlpha*=.35)}function Hs(t){}function Zs(t){this.drawText(t)}function Vs(t,e){t(this)}function Qs(t){t&&this.prepare&&this.prepare(t=>{this.invalidate()},t=>{$i(t)})}function Js(t){!this.textHidden&&this.text&&this.hasTextProperty&&No(t,this.textBounds,this.textLines(t),this.state)}function Ks(t,e){Po(t,e?{...this.state,...e}:this.state)}function ta(t,e){this.fillStyle&&"transparent"!=this.fillStyle&&(Eo(t,this.bounds,this.center,e?{...this.state,...e}:this.state,this),function(t){t.shadowColor="transparent"}(t))}function ea(){return this.get("strokeStyle")}function ra(t){this.set("strokeStyle",t)}function na(){return this.getState("fillStyle")}function ia(t){this.setState("fillStyle",t)}function oa(){return this.get("fontColor")}function sa(t){this.set("fontColor",String(fi(t)))}function aa(){return this.getState("rotation")}function ca(t){this.setState("rotation",Number(fi(t)))}function ua(){return this.app.isEditMode?["decotag","data-spread"]:[]}function la(){const{id:t,tag:e}=this.state;return(t?`#${t}`:"")+(e?`@${e}`:"")}function ha(){return this.getState("hidden")||!this.data&&0!==this.data&&this.getState("ndns")||this.isTemplate()}function fa(t){this.setState("hidden",t)}function da(){return this.state.tag}function pa(t){this.setState("tag",t)}function ga(){}function ya(t){this.data instanceof Array?this.data=this.data.concat(t):this.data instanceof Object?this.data={...this.data,...t}:this.data??=t}function ma(){const t=this.getState("text");return null==t?"":String(t)}function ba(t){const{textWrap:e,supportMarkdown:r}=this.state;return Ro(t||this.getContext(),this.textBounds.width,this.font,this.text,e,r)}function va(){return Do(this.model)}function xa(){const t=this.get("lineHeight");return t||1.2*this.fontSize}function _a(){return this._text_substitutor||(this._text_substitutor=ys(this.getState("text"),this,void 0)||this.defaultTextSubstitutor),this._text_substitutor}function wa(){const t=this.get("textFormat");return t?function(t,e){if(!t||isNaN(+e))return e;let r,n,i,o,s,a,c,u,l,h,f,d=t.length,p=t.search(/[0-9\-\+#]/),g=p>0?t.substring(0,p):"",y=t.split("").reverse().join(""),m=y.search(/[0-9\-\+#]/),b=d-m,v=t.substring(b,b+1),x=b+("."===v||","===v?1:0),_=m>0?t.substring(x,d):"";if(r=(e="-"===(t=t.substring(p,x)).charAt(0)?-e:+e)<0?e=-e:0,n=t.match(/[^\d\-\+#]/g),i=".",o=n&&n[1]&&n[0]||",",t=t.split("."),e=+(e=e.toFixed(t[1]&&t[1].length))+"",a=t[1]&&t[1].lastIndexOf("0"),u=e.split("."),(!u[1]||u[1]&&u[1].length<=a)&&(e=(+e).toFixed(a+1)),l=t[0].split(o),t[0]=l.join(""),s=t[0]&&t[0].indexOf("0"),s>-1)for(;u[0].length<t[0].length-s;)u[0]="0"+u[0];else 0===+u[0]&&(u[0]="");if((e=e.split("."))[0]=u[0],c=l[1]&&l[l.length-1].length,c){for(h=e[0],y="",b=h.length%c,d=h.length,x=0;x<d;x++)y+=h.charAt(x),!((x-b+1)%c)&&x<d-c&&(y+=o);e[0]=y}return e[1]=t[1]&&e[1]?"."+e[1]:"",n=e.join(""),"0"!==n&&""!==n||(r=!1),f="+"==t[0].substring(0,1)?r?"-":"+":r?"-":"",g+(f+n)+_}(t,this.textSubstitutor()):this.textSubstitutor()}function ka(t){delete this._text_substitutor;const e=fi(t);this.setState("text",null==e?"":String(e))}function Sa(){let{paddingTop:t,paddingLeft:e,paddingRight:r,paddingBottom:n}=this.state;n||=0,t||=0,e||=0,r||=0;const{left:i,top:o,width:s,height:a}=this.bounds;return{left:i+e,top:o+t,width:Math.max(s-e-r,0),height:Math.max(a-t-n,0)}}function Ma(){return 0}function za(){return!!this._textHidden}function Aa(t){this._textHidden=!!t,this.invalidate()}function Ea(){return!0}function ja(t){return t}function Oa(t){return Math.pow(t,2)}function Ta(t){return 1-Math.sin(Math.acos(t))}function Pa(t,e={x:1.5}){return Math.pow(t,2)*((e.x+1)*t-e.x)}function Ia(t){for(let e=0,r=1;;e+=r,r/=2)if(t>=(7-4*e)/11)return-Math.pow((11-6*e-11*t)/4,2)+Math.pow(r,2)}function Ca(t,e={x:1.5}){return Math.pow(2,10*(t-1))*Math.cos(20*Math.PI*e.x/3*t)}var Fa={linear:ja,quad:Oa,circ:Ta,back:Pa,bounce:Ia,elastic:Ca},Ra=Object.freeze({__proto__:null,back:Pa,bounce:Ia,circ:Ta,default:Fa,elastic:Ca,linear:ja,quad:Oa});class Da{constructor(t,e){this._started=!1,this._unsub=null,this._timeout=null,this.client=t,this.config=e,this._started=!1;const{delta:r="linear",options:n,ease:i}=this.config;let o;o="string"==typeof r?Fa[r]:r,this.delta="out"===i?function(t,e){return function(r){return 1-t(1-r,e)}}(o,n):"inout"===i?function(t,e){return function(r){return r<.5?t(2*r,e)/2:(2-t(2*(1-r),e))/2}}(o,n):o,this.init()}dispose(){this.stop(),delete this.client}init(){}start(){if(this._started)return;if(this.client?.root?.app?.suppressAnimations)return;const{duration:t=2e3,delay:e=0,repeat:r=!1,interval:n=0,onComplete:i}=this.config;this._started=!0;const o=this.config?.type??"animation";let s=0,a=0;const c=()=>ss.simTime,u=()=>{if(!this._started)return;if(this.client?.root?.app?.suppressAnimations)return void this.stop(i);0==s&&(s=c(),this.client?.touch?.());const l=c()-s,h=Math.max((l-e)%(t+n),0)/t,f=n<=0&&a>h;if(a=h,h>=1||f){if(this.step(1),this.client&&this.client.invalidate?.(),!r||!this._started)return this.stop(i),void(s=0);if(n>0)return this._unsub?.(),this._unsub=null,void(this._timeout=setTimeout(()=>{this._timeout=null,this.step(0),this.client&&this.client.invalidate?.(),this._timeout=setTimeout(()=>{this._timeout=null,this._started&&(this._unsub=ss.subscribe(u,{description:`animation: ${o}`,component:this.client,metadata:{duration:t,delay:e,repeat:r,interval:n}}))},n/2)},n/2))}else this.step(this.delta(h)),this.client&&this.client.invalidate?.()};this._unsub=ss.subscribe(u,{description:`animation: ${o}`,component:this.client,metadata:{duration:t,delay:e,repeat:r,interval:n}})}stop(t){this._unsub&&(this._unsub(),this._unsub=null),this._timeout&&clearTimeout(this._timeout),this._timeout=null,this._started=!1,t?.()}step(t){}get started(){return this._started}set started(t){this.started!=!!t&&(t?this.start():this.stop())}}const La={rotation:class extends Da{step(t){const{theta:e=6.28}=this.config;this.client.delta?.("theta",t*e)}},vibration:class extends Da{step(t){const{theta:e=.2617993877991494}=this.config,r=4*e;let n=t*r;t<1/4?n*=-1:t<3/4?n-=2*e:n=r-n,this.client.delta?.("theta",n)}},heartbeat:class extends Da{step(t){const{scale:e=1.3}=this.config,r=2*(e-1);let n;n=t<.5?1+r*t:1+(1-t)*r,this.client.delta?.({sx:n,sy:n,sz:n})}},moving:class extends Da{step(t){const{x:e=0,y:r=0}=this.config;this.client.delta?.({tx:t*e,ty:t*r})}},outline:class extends Da{step(t){const{rideOn:e}=this.config;if(!e||!this.client)return;const r=this.client.root.findById(e);if(!r)return;let n={tx:0,ty:0};const i=this.client.delta("");i&&"object"==typeof i&&"tx"in i&&"ty"in i&&(n=i);const{tx:o,ty:s}=n,a=r.outline(t),{x:c,y:u}=this.client.center,l=this.client.toScene(c,u);this.client.delta({tx:a.x-l.x+o,ty:a.y-l.y+s})}},fade:class extends Da{step(t){const{startAlpha:e=1,endAlpha:r=0}=this.config,n=Math.max(Math.min(e,r,1),0),i=2*(Math.min(Math.max(e,r,1),1)-n);let o;o=t<.5?i*t:(1-t)*i,this.client.delta?.("fade",o)}},waypoint:class extends Da{constructor(){super(...arguments),this._startX=0,this._startY=0,this._endX=0,this._endY=0}start(){let{toComponent:t,fromComponent:e}=this.config;e||(e=t);const r=e.center,n=t.center,{x:i,y:o}=e.toScene(r.x,r.y),{x:s,y:a}=t.toScene(n.x,n.y);this._startX=i,this._startY=o,this._endX=s,this._endY=a;const c=this.config.yawOffset??Math.PI/2,u=Math.atan2(a-o,s-i)+c;this.client.location={x:i,y:o},this.client.setState("rotation",u),super.start()}stop(t){const{toComponent:e,finalize:r="snap"}=this.config;if(super.stop(t),"snap"===r&&e){const t=e.center,r=e.toScene(t.x,t.y);this.client.delta({tx:0,ty:0}),this.client.location=r}}step(t){const e=(this._endX-this._startX)*t,r=(this._endY-this._startY)*t;this.client.location={x:this._startX+e,y:this._startY+r}}}};const Na={gradation:function(t,e,r){const{subType:n,from:i,to:o,colors:s}=r;let a;switch(n){case"linear":default:a=e.createLinearGradient(i.x,i.y,o.x,o.y);break;case"radial":a=e.createRadialGradient(i.x,i.y,i.r,o.x,o.y,o.r)}s&&(s.forEach(function(t){a.addColorStop(t.endPoint,t.color)}),e.fillStyle=a,e.fill())},shadow:Bs};function Ya(t){return this._animate&&this._animate.stop(),this._animate=function(t){const{duration:e=1e3,easing:r,component:n,step:i=()=>{},onStart:o,onProgress:s,onComplete:a,options:c,repeat:u=!1,delta:l}=t;let h;h="string"==typeof l?Ra[l]:l||ja,"out"===r?h=function(t,e){return function(r){return 1-t(1-r,e)}}(h,c):"inout"===r&&(h=function(t,e){return function(r){return r<.5?t(2*r,e)/2:(2-t(2*(1-r),e))/2}}(h,c));let f=!1,d=null;return{start:function(){if(f)return this;if(n?.root?.app?.suppressAnimations)return this;f=!0,o&&o();let t=0;const r=()=>ss.simTime;return d=ss.subscribe(()=>{if(!f)return;if(n?.root?.app?.suppressAnimations)return this.stop(),void(t=0);0===t&&(t=r());const o=(r()-t)/e,a=u?o%1:Math.min(o,1);i(h(a,c)),s&&s(a),!(o>=1)||u&&f||(this.stop(),t=0)},{description:"animate()",component:n,metadata:{duration:e,repeat:u}}),this},stop:function(){return f=!1,d&&(d(),d=null),a&&a(),this}}}({component:this,...t}),this._animate}function $a(t,e){return function(t,e,r){const n=Na[r.type];n&&n(t,e,r)}(this,t,e)}const Ua=100;function Wa(t,e){if(null!==e){if("number"==typeof e){if(!Number.isFinite(e))return;if(!Number.isInteger(e))return Math.round(e*Ua)/Ua}return e}}function qa(t){if(null==t||"object"!=typeof t)return t;for(const e in t){const r=t[e];null===r?delete t[e]:"number"==typeof r?Number.isFinite(r)?Number.isInteger(r)||(t[e]=Math.round(r*Ua)/Ua):delete t[e]:"object"==typeof r&&qa(r)}return t}function Ba(...t){return JSON.stringify(this.hierarchy,Wa,...t)}function Ga(){delete this._model[""],"chartjs"!==this._model.type&&delete this._model.chart}function Xa(t){this.rootModel.closeScene(t)}function Ha(t,e){return t?"object"==typeof t?(this._delta={...this._delta,...t},this._delta):void 0!==e?(this._delta[t]=e,this._delta[t]):void 0:this._delta}function Za(){this.parent&&this.parent.invalidate()}function Va(){const t=this.nature["value-property"]||"text";return"value"==t?this.getState("value"):this[t]}function Qa(t){const e=this.nature["value-property"]||"text";"value"==e?this.setState("value",t):this[e]=t}function Ja(){return this.getState("data")}function Ka(t){this.setState("data",t),this.touch()}function tc(t){const e=this.model.event?.tap;if(e){const{x:t,y:r}=this.center;this.rootModel?._doEventAction(e,this,!0,new MouseEvent("click",{clientX:t,clientY:r}))}}function ec(){return!this._mappings&&this.parent&&this.buildMappings(),this._mappings}function rc(){return Number(this.get("retention"))||0}function nc(){if(this.app.isViewMode&&!this.isTemplate()){if(!this._animation){const t=this.state.animation;t&&t.oncreate&&(this._animation=function(t,e){const r=e.type?La[e.type]:void 0;return r?new r(t,e):null}(this,t.oncreate))}return this._animation}}function ic(){return!!this.animation?.started}function oc(t){this.animation&&(this.animation.started=t)}function sc(){}function ac(t,e,r,n){const i=e.get("class");if(!i)return!1;return(i.split(" ")||[]).indexOf(t.substr(1))>=0}function cc(t,e,r,n){return t==e.get("type")}function uc(t,e,r,n,i,o){return t(e,r,n,i)&&o.push(r),r.components&&r.components.forEach(r=>{uc(t,e,r,n,i,o)}),o}function lc(t,e,r,n){switch(t){case"(all)":return!0;case"(parent)":return r&&r.parent===e;case"(child)":case"(children)":return r&&r===e.parent;case"(sibling)":case"(siblings)":return r&&r.parent===e.parent&&r!==e;default:return!1}}function hc(t,e,r){if("(root)"==t)return[e];if("(self)"==t)return r?[r]:[];let n;switch(t.charAt(0)){case"#":const r=e.root.findAllById?.(t.substring(1));return r||[];case".":n=ac;break;case"(":n=lc;break;default:n=cc}return uc(n,t,e,r,e,[])}function fc(t,...e){if(t(this,...e))return this}function dc(t,...e){return"string"==typeof t?hc(t,this,e[0]||this):"function"==typeof t&&t(this,...e)?[this]:void 0}function pc(t,e,r){if(!this.capturable||r?.(this))return!1;const n=this.fromParent(t,e);return this.contains(n.x,n.y)?this:void 0}function gc(t){return this.anchors.find(e=>e.name===t)}function yc(t){return!0}function mc(t){return this._parent.getContext(t??this)}function bc(){return this.isRoot()?this:this.parent&&this.parent.root}function vc(){return this.isRootModel()?this:this.parent&&this.parent.rootModel}function xc(){return this._parent}function _c(t){this._parent=t}function wc(){return this.nature.anchors||[]}function kc(){let t=this.position,e=this;for(;"static"===t&&e.parent;)e=e.parent,t=e.position;return"static"==t}function Sc(){if(this.parent&&this.parent.layout.isStuck(this)||this.get("locked"))return!0;const t=this.app?.focusFilter;return!(!this.app?.isEditMode||!t||t(this))}function Mc(){if(!1===this.get("capturable"))return!1;if(!this.app.isEditMode&&this.hidden)return!1;if(this.app.isEditMode){if(this.get("locked"))return!1;const t=this.app.focusFilter;if(t&&!t(this))return!1}return!0}function zc(){return this.app?.isViewMode&&this.isPositionable()?this.state.position??"static":"static"}function Ac(){return this.app&&this.app.isViewMode&&this.state.origin||""}function Ec(){const{offsetX:t=0,offsetY:e=0}=this.state;return{x:t,y:e}}function jc(){return!this._app&&this.parent&&(this._app=this.parent.app),this._app}const Oc={},Tc={mutable:!1,resizable:!0,rotatable:!0,properties:[],"value-property":"text"},Pc=[],Ic=new Set(["data","text","value","source","accessor","mappings","variables","fillStyle","strokeStyle","fontColor","alpha","opacity","hidden","locked","hatched","started","animation","sensitive","event","src","href","url","class","templatePrefix"]),Cc={theta:0,tx:0,ty:0,sx:1,sy:1,fade:0};let Fc=0;const Rc={};const Dc=new FinalizationRegistry(t=>{!function(t){Fc--;let e=Rc[t];e||(e=Rc[t]={up:0,down:0}),e.down++}(t)});class Lc{static get nature(){return Tc}static register(t,e){if(!e)return Oc[t];Oc[t]=e}static types(){return Object.keys(Oc)}static get residents(){return Rc}static get residentsCount(){return Fc}static registerDecorator(t,e){ms.registerDecorator(t,e)}constructor(t,e){if(this._readyInvoked=!1,this._app=e,this._model=t||{},this._model.event&&"object"==typeof this._model.event&&!Array.isArray(this._model.event)&&!Array.isArray(this._model.eventHandlers)){const t=function(t){if(!t||"object"!=typeof t||Array.isArray(t))return[];const e={tap:"click",hover:"mouseenter",dblclick:"dblclick",longpress:"longpress"},r=[];for(const n of Object.keys(t)){const i=e[n];if(!i)continue;const o=t[n];if(o&&"object"==typeof o){if("script"===o.action){const t="string"==typeof o.value?o.value:o.value&&"object"==typeof o.value?o.value.script:"";t&&r.push({trigger:i,action:"script",code:t,target:o.target});continue}r.push({trigger:i,action:o.action,target:o.target,value:o.value,options:{emphasize:o.emphasize,restore:o.restore,pressed:o.pressed,...o.options??{}}})}}return r}(this._model.event);t.length>0&&(this._model.eventHandlers=t)}this._state={},this._delta=Jn(Cc),e&&this.animation?.config&&(1==this.animation.config.autoplay||(this.animation.config.autoplay??1))&&(this.animation.started=!0),this.clearCache(),hs.add(this),function(t){Fc++;let e=Rc[t];e||(e=Rc[t]={up:0,down:0}),e.up++}(this._model.type),Dc.register(this,this._model.type)}created(){}added(t){}removed(t){}async ready(){if(this.state.persistent){const{isViewMode:t,dataStorage:e}=this.app;t&&(this.data=await e.load(this))}}invokeReady(){if(!this._readyInvoked)return this._readyInvoked=!0,this.ready()}touch(){this.updatedAt=performance.now(),hs.touch(this)}clearCache(...t){this._cachedState=null,function(t,...e){0==e.length?t.__cache__={}:e.forEach(e=>delete t.__cache__[e])}(this,...t)}removeSelf(t){t?this.dispose():this.parent?.removeComponent?.(this)}resetAnimation(){this._animation&&(this._animation.dispose(),this._animation=null,this._delta=Jn(Cc))}dispose(){this.resetAnimation(),this.disposeMappings();const t=this.parent;t&&"function"==typeof t.removeItem&&-1!==t._items?.indexOf?.(this)&&t.removeItem(this),t?.removeComponent?.(this),delete this._text_substitutor,delete this._value_substitutor,this._disposed=!0,this._realObject&&(this._realObject.dispose(),this._realObject=void 0),this.retention&&hs.touch(),this.clearCache(),delete this._app}get nature(){return this.constructor.nature}get disposed(){return!!this._disposed}isLayer(){return!1}isGroup(){return!1}isContainer(){return!1}isLine(){return!1}isRoot(){return!1}isRootModel(){return!1}is3dish(){return!0}get is3dMode(){return!1}isIn3DSpace(){return!!this._realObject}isTemplate(){return!!this.get("templatePrefix")}isHTMLElement(){return!1}isConnectable(){return!1}isIdentifiable(){return!0}isPositionable(){return this.parent?.isRootModel()}replaceRefids(t){}get(t){return this._model[t]}set(t,e){if("string"==typeof t)return this.set({[t]:e});const r=this;return this._applyProps(this._model,t,{getBeforeVal:function(t){return r._model[t]},clearState:!0,sensitive:!1,beforeFillStyle:function(t,e){t.hasOwnProperty("retention")&&hs.add(r)},afterFillStyle:function(t,e){t.hasOwnProperty("mappings")&&r.onchangeMappings(t,e)}})}getState(t){return this._state.hasOwnProperty(t)?this._state[t]:this.get(t)}setState(t,e){if("string"==typeof t)return this.setState({[t]:e});const r=this;return this._applyProps(this._state,t,{getBeforeVal:function(t){return r.getState(t)},clearState:!1,sensitive:this.getState("sensitive")})}get model(){return this._model}get state(){return this._cachedState||(this._cachedState=Object.freeze(Object.assign({},this._model,this._state))),this._cachedState}get refid(){return this.get("refid")}get hierarchy(){const t=Jn(this._model);return this.volatile.forEach(e=>{delete t[e]}),qa(t)}get volatile(){return Pc}_applyProps(t,e,r){const n={},i={};let o=!1;const s=Jn(e),a=this;if(Object.getOwnPropertyNames(s).forEach(function(e){const c=r.getBeforeVal(e),u=s[e];!r.sensitive&&function(t,e){return Ar(t,e)}(c,u)||(i[e]=c,n[e]=u,t[e]=u,r.clearState&&delete a._state[e],o=!0)}),o){this._cachedState=null;Object.keys(n).some(t=>!Ic.has(t))&&this.clearCache(),n.hasOwnProperty("text")&&delete this._text_substitutor,r.beforeFillStyle&&r.beforeFillStyle(n,i),n.hasOwnProperty("fillStyle")&&this.onchangeFill(n,i),r.afterFillStyle&&r.afterFillStyle(n,i),n.hasOwnProperty("data")&&this.onchangeData(n,i),this.onchange&&this.onchange(n,i),this.trigger("change",n,i)}return this}contains(t,e){return xs.call(this,t,e)}move(t,...e){_s.call(this,t,...e)}symmetryX(t){ws.call(this,t)}symmetryY(t){ks.call(this,t)}adjustResize(t,e,r){return Ss.call(this,t,e,r)}adjustRotation(t,e){return Ms.call(this,t,e)}outline(t){return zs.call(this,t)}get bounds(){return As.call(this)}set bounds(t){Es.call(this,t)}get center(){return js.call(this)}set center(t){Os.call(this,t)}get location(){return Ts.call(this)}set location(t){Ps.call(this,t)}get rotate(){return Is.call(this)}set rotate(t){Cs.call(this,t)}get dimension(){return Fs.call(this)}set dimension(t){Rs.call(this,t)}get path(){return Ds.call(this)}set path(t){Ls.call(this,t)}get drawPath(){return Ns.call(this)}get rotatePoint(){return Ys.call(this)}get mutable(){return $s.call(this)}get resizable(){return Us.call(this)}get rotatable(){return Ws.call(this)}buildRealObject(){}get realObject(){return this.disposed||this._realObject||(this._realObject=this.buildRealObject(),this._realObject&&(this._realObject.update(),this._realObject.updateTransform())),this._realObject}draw(t){t&&Gs.call(this,t)}prerender(t){Xs.call(this,t)}render(t){Hs.call(this,t)}postrender(t){Zs.call(this,t)}prepare(t,e){Vs.call(this,t,e)}prepareIf(t){Qs.call(this,t)}drawText(t){Js.call(this,t)}drawStroke(t,e){Ks.call(this,t,e)}drawFill(t,e){ta.call(this,t,e)}get strokeStyle(){return ea.call(this)}set strokeStyle(t){ra.call(this,t)}get fillStyle(){return na.call(this)}set fillStyle(t){ia.call(this,t)}get fontColor(){return oa.call(this)}set fontColor(t){sa.call(this,t)}get rotation(){return aa.call(this)}set rotation(t){ca.call(this,t)}get decorators(){return ua.call(this)}get decotag(){return la.call(this)}get hidden(){return ha.call(this)}set hidden(t){fa.call(this,t)}get tag(){return da.call(this)}set tag(t){pa.call(this,t)}get appendum(){return ga.call(this)}set appendum(t){ya.call(this,t)}defaultTextSubstitutor(){return ma.call(this)}textLines(t){return ba.call(this,t)}get font(){return va.call(this)}get lineHeight(){return xa.call(this)}get textSubstitutor(){return _a.call(this)}get text(){return wa.call(this)}set text(t){ka.call(this,t)}get textBounds(){return Sa.call(this)}get textRotation(){return Ma.call(this)}get textHidden(){return za.call(this)}set textHidden(t){Aa.call(this,t)}get hasTextProperty(){return Ea.call(this)}animate(t){return Ya.call(this,t)}effect(t,e){return $a.call(this,t,e)}serialize(...t){return Ba.call(this,...t)}trim(){Ga.call(this)}closeScene(t){Xa.call(this,t)}delta(t,e){return Ha.call(this,t,e)}invalidate(){Za.call(this)}get value(){return Va.call(this)}set value(t){Qa.call(this,t)}get data(){return Ja.call(this)}set data(t){Ka.call(this,t)}set tap(t){tc.call(this,t)}get mappings(){return ec.call(this)}get retention(){return rc.call(this)}get animation(){return nc.call(this)}get started(){return ic.call(this)}set started(t){oc.call(this,t)}get controls(){return sc.call(this)}findFirst(t,...e){return fc.call(this,t,...e)}findAll(t,...e){return dc.call(this,t,...e)}capture(t,e,r){return pc.call(this,t,e,r)}findAnchor(t){return gc.call(this,t)}isDescendible(t){return yc.call(this,t)}getContext(t){return mc.call(this,t)}get root(){return bc.call(this)}get rootModel(){return vc.call(this)}get parent(){return xc.call(this)}set parent(t){_c.call(this,t)}get anchors(){return wc.call(this)}get scalable(){return kc.call(this)}get stuck(){return Sc.call(this)}get capturable(){return Mc.call(this)}get position(){return zc.call(this)}get origin(){return Ac.call(this)}get offset(){return Ec.call(this)}get app(){return jc.call(this)}drawEffect(t){ko.call(this,t)}prepareFill(t,e){jo.call(this,t,e)}prepareFillIf(t){Oo.call(this,t)}onchangeFill(t,e){To.call(this,t,e)}drawImage(t,e,r,n,i,o){wo.call(this,t,e,r,n,i,o)}mutateBounds(t,e){ns.call(this,t,e)}mutatePath(t,e,r){is.call(this,t,e,r)}access(t){return ps.call(this,t)}substitute(t,e){return gs.call(this,t,e)}onchangeMappings(t,e){_o.call(this,t,e)}onchangeData(t,e){bo.call(this,t,e)}buildMappings(){vo.call(this)}executeMappings(t){mo.call(this,t)}disposeMappings(){xo.call(this)}ondropfile(t,e){$o.call(this,t,e)}transcoordS2P(t,e,r){return Go.call(this,t,e,r)}transcoordP2S(t,e,r){return Bo.call(this,t,e,r)}transcoordS2T(t,e,r){return Ho.call(this,t,e,r)}transcoordT2P(t,e,r){return Zo.call(this,t,e,r)}transcoordT2S(t,e,r){return Vo.call(this,t,e,r)}transcoordS2TR(t,e,r){return Xo.call(this,t,e,r)}transcoordS2O(t,e,r){return Qo.call(this,t,e,r)}transcoordC2S(t,e,r){return Jo.call(this,t,e,r)}transcoordS2C(t,e,r){return Ko.call(this,t,e,r)}toParent(t,e,r){return Go.call(this,t,e,r)}fromParent(t,e,r){return Bo.call(this,t,e,r)}toScene(t,e,r){return Ho.call(this,t,e,r)}fromScene(t,e,r){return Vo.call(this,t,e,r)}toLocal(t,e,r){return Jo.call(this,t,e,r)}toGlobal(t,e,r){return Ko.call(this,t,e,r)}toOther(t,e,r){return Qo.call(this,t,e,r)}on(t,e,r){return Fi.call(this,t,e,r)}off(t,e,r){return Ri.call(this,t,e,r)}once(t,e,r){return Di.call(this,t,e,r)}trigger(t,...e){return Li.call(this,t,...e)}delegate_on(t){return Ni.call(this,t)}delegate_off(t){return Yi.call(this,t)}onchange(t,e){}removeComponent(t,e){}addComponent(t,e){}insertComponentAt(t,e,r){}getOverlay(t){}findById(t){}findByRefid(t){}findAllById(t){return[]}resize(){}fit(t){}get components(){}get layout(){}get auxOverlay(){}get isReady(){return!1}get unitScale(){return 1}get selected(){return[]}set selected(t){}get focused(){return null}set focused(t){}get hasSameParentForAllSelected(){return!1}set hasSameParentForAllSelected(t){}get fitMode(){}set fitMode(t){}get element(){return null}set element(t){}}Lc.capabilities=[],Lc.union=function(t){let e=0,r=0,n=0,i=0,o=!1;return t.forEach(t=>{o?(e=Math.min(t.left,e),r=Math.min(t.top,r),n=Math.max(t.left+t.width,n),i=Math.max(t.top+t.height,i)):(e=t.left,r=t.top,n=t.left+t.width,i=t.top+t.height,o=!0)}),{left:e,top:r,width:n-e,height:i-r}},Lc.transcoordR=Wo,Lc.transcoordRR=qo,Lc.createCanvas=Ao,Lc.memoize=function(t,e,r){const n=function(t,e){let r=t;for(;r;){const t=Object.getOwnPropertyDescriptor(r,e);if(t?.get)return t;r=Object.getPrototypeOf(r)}}(t,e);if(!n?.get)return void $i(`${String(e)} is not defined in ${t.constructor.name}`);const i=n.get,o={get:r?function(){return e in this.__cache__?Ai.enabled&&Ai.cacheHit++:(Ai.enabled&&Ai.cacheMiss++,this.__cache__[e]=Object.freeze(i.call(this))),this.__cache__[e]}:function(){return e in this.__cache__?Ai.enabled&&Ai.cacheHit++:(Ai.enabled&&Ai.cacheMiss++,this.__cache__[e]=i.call(this)),this.__cache__[e]},configurable:!0};n.set&&(o.set=n.set),Object.defineProperty(t,e,o)},Lc.mixin=function t(e,r){if(r instanceof Array)r.forEach(r=>t(e,r));else{if(e.mixedIn=e.hasOwnProperty("mixedIn")?e.mixedIn:[],e.mixingIn=e.hasOwnProperty("mixingIn")?e.mixingIn:[],e.mixedIn.indexOf(r)>=0)return e;if(e.mixingIn.indexOf(r)>=0)throw new Error(`found cyclic dependencies between ${e.mixingIn}`);e.mixingIn.push(r),r.call(e),e.mixingIn.pop(),e.mixedIn.push(r)}return e},Lc.drawText=No,Lc.font=Do,Lc.textLines=Ro,Lc.drawStroke=Po,Lc.drawFill=Eo,Lc.reposition=function(t){let{id:e,scale:r=es,bold:n,italic:i,fontFamily:o="",textAlign:s,textBaseline:a,textOverflow:c,paddingTop:u,paddingBottom:l,paddingLeft:h,paddingRight:f,fontSize:d=Mo.FONT_SIZE,lineWidth:p=0,lineHeight:g,lineDash:y}=t.state;l||=0,u||=0,h||=0,f||=0;const m=t.state.class,{strokeStyle:b,rotation:v=0,fontColor:x,hidden:_}=t,{left:w,top:k,width:S,height:M}=t.bounds,z=t.element;if(z.hidden=_,e&&(z.id=e),m&&(z.className=m),Object.assign(z.style,rs,{fontFamily:o,fontSize:d+"px",width:S+"px",height:M+"px",paddingTop:u+"px",paddingRight:f+"px",paddingBottom:l+"px",paddingLeft:h+"px",border:p+"px",borderColor:b,borderStyle:p>0?y||Mo.LINE_DASH:"",color:x,fontWeight:n?"bold":"",fontStyle:i?"italic":"",textAlign:"end"==s?"right":"start"==s?"left":s,verticalAlign:a,lineHeight:void 0===g?"":g+"px",whiteSpace:c?"nowrap":"",overflow:c?"hidden":"",textOverflow:c||""},t.isIn3DSpace()?{}:{left:w+"px",top:k+"px"}),ts(t),function(t){if(!t.isShadowable()||!t.state.shadow)return;const e=t.state.shadow,r=e.offsetX??e.left??0,n=e.offsetY??e.top??0,i=e.blur??e.blurSize??0,o=e.color??"transparent";t.element.style.boxShadow=`${r}px ${n}px ${i}px ${o}`}(t),t.isIn3DSpace())return;const A=t.delta(),E=(r&&r.x||1)*A.sx,j=(r&&r.y||1)*A.sy,O=(v||0)+A.theta,T=A.tx||0,P=A.ty||0;z.style.transform=`rotate(${O}rad) translate(${T}px, ${P}px) scale(${E}, ${j}) perspective(1px)`},Lc.RetentionManager=hs,Lc.template=function(t,e,r){var n=vn.imports._.templateSettings||vn;r&&Br(t,e,r)&&(e=void 0),t=yn(t),e=Xr({},e,n,sn);var i=Xr({},e.imports,n.imports,sn),o=ir(i),s=function(t,e){return rn(e,function(e){return t[e]})}(i,o);Er(o,function(t){if(kn.test(t))throw new Error("Invalid `imports` option passed into `_.template`")});var a,c,u=0,l=e.interpolate||Mn,h="__p += '",f=RegExp((e.escape||Mn).source+"|"+l.source+"|"+(l===un?Sn:Mn).source+"|"+(e.evaluate||Mn).source+"|$","g"),d=An.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+"\n":"";t.replace(f,function(e,r,n,i,o,s){return n||(n=i),h+=t.slice(u,s).replace(zn,cn),r&&(a=!0,h+="' +\n__e("+r+") +\n'"),o&&(c=!0,h+="';\n"+o+";\n__p += '"),n&&(h+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),u=s+e.length,e}),h+="';\n";var p=An.call(e,"variable")&&e.variable;if(p){if(kn.test(p))throw new Error("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(c?h.replace(xn,""):h).replace(_n,"$1").replace(wn,"$1;"),h="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(a?", __e = _.escape":"")+(c?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var g=en(function(){return Function(o,d+"return "+h).apply(void 0,s)});if(g.source=h,tn(g))throw g;return g},Lc.buildSubstitutor=ys,["rotatePoint","font","lineHeight","retention"].forEach(t=>Lc.memoize(Lc.prototype,t,!1)),["bounds","center","textBounds"].forEach(t=>Lc.memoize(Lc.prototype,t,!0));const Nc=new Set(["left","top","width","height","depth","zPos","rotation","rotationX","rotationY","rotationZ","scale","translate","material3d","fillStyle","strokeStyle","lineWidth","lineDash","alpha","opacity","hidden","text","fontColor","fontSize","fontFamily","bold","italic","textAlign","textBaseline","shadow","border","cssText","object3d","_realObject","refid","id"]);function Yc(t){return class extends t{async ready(){await(super.ready?.());const t=this.state?.data;Array.isArray(t)&&0===this._items.length&&!this.isRecordStorage&&this._reconcileItems(t)}set data(t){if(Array.isArray(t)){if(this.isRecordStorage){const e=this.setState;return void("function"==typeof e&&e.call(this,{data:t}))}this._reconcileItems(t)}else this.setState?.({data:t})}get data(){if(this.isRecordStorage)return this.state?.data??[];const t=this._exportSlotRecords();return 0===t.length?this.state?.data:t}_reconcileItems(t){const e=new Map;for(const r of t){const t=this._recordKey(r);t&&e.set(t,r)}const r=new Map;for(const t of this._items){const e=t[D];null!=e&&r.set(String(e),t)}for(const[t,n]of r)if(!e.has(t)){try{this.removeItem(n,!0)}catch{}try{n?.dispose?.()}catch{}}for(const[t,n]of e){if(r.has(t))continue;if(null==n.itemId)continue;const e=this._createItemFromRecord(n);if(e){e[D]=t;try{this.handoverIn(e)}catch{}}}for(const[t,n]of e){const e=r.get(t);if(e&&(n.itemState&&"function"==typeof e.setState))try{e.setState(n.itemState)}catch{}}}_exportSlotRecords(){const t=this.slotIds?.()??[],e=[],r=new Map,n=[];for(const t of this._items){const e=t[D];null!=e?r.set(String(e),t):n.push(t)}for(const n of t){const t=r.get(n)??null;e.push(this._slotRecordOf(n,t))}for(const t of n)e.push(this._slotRecordOf("",t));for(const[n,i]of r)t.includes(n)||e.push(this._slotRecordOf(n,i));return e}_recordKey(t){return t.slotId??t.cellId??""}_slotRecordOf(t,e){if(!e)return{slotId:t,itemId:null};const r=e?.state?.id;return{slotId:t,itemId:null!=r?String(r):null,itemType:e?.state?.type,itemState:this._extractItemState(e)}}_extractItemState(t){const e=t?.state;if(!e||"object"!=typeof e)return;const r=this._businessFields?.();if(Array.isArray(r)){if(0===r.length)return;const t={};for(const n of r)n in e&&void 0!==e[n]&&(t[n]=e[n]);return Object.keys(t).length>0?t:void 0}const n={};for(const t of Object.keys(e))Nc.has(t)||t.startsWith("_")||(n[t]=e[t]);return Object.keys(n).length>0?n:void 0}_businessFields(){return null}_createItemFromRecord(t){const e=t.itemType??t.type;if(!e)return null;try{const r=Lc.register?.(e);if(r&&"function"==typeof r){return new r({type:e,...t.itemState??{}})}}catch{}return null}}}const $c=[{id:"__default__",maxCount:1/0}];function Uc(t){var e;return e=class extends t{get slots(){return[]}get arrangementStrategy(){return p}canReceive(t,e){const r=null!==this.findSlot(t);return W.log({role:"target",contract:"canReceive",component:this,args:{carrier:C(t)},result:r}),r}findSlot(t){const e=this.slots.length?this.slots:$c;for(const r of e){if(r.allowedTypes?.length){const e=t?.state?.type??t?.type;if(!e||!r.allowedTypes.includes(e))continue}const e=r.maxCount??this.arrangementStrategy.capacity(r),n=this._countOccupied(r.id);if(!(n>=e))return W.log({role:"target",contract:"findSlot",component:this,args:{carrier:C(t)},result:{slotId:r.id,occupied:n,max:e}}),r}return W.log({role:"target",contract:"findSlot",component:this,args:{carrier:C(t)},result:null}),null}acceptanceRotation(t,e){}deliveryWorldRotation(t){const e=this.acceptanceRotation?.(t);if(!e)return;const r=this._realObject?.object3d;if(!r)return;r.updateWorldMatrix(!0,!1);const n=new v;r.getWorldQuaternion(n);const i=new v(e.x,e.y,e.z,e.w);return n.clone().multiply(i)}deliveryWorldPosition(t){const e=this._realObject,r=e?.object3d;if(!r)return;r.updateWorldMatrix(!0,!1);const n=new x;r.getWorldPosition(n);const i=this._receivingSurfaceLocalY();if(null!==i){const t=new x(0,i,0);return r.localToWorld(t),{x:n.x,y:t.y,z:n.z}}return{x:n.x,y:n.y,z:n.z}}attachPointFor(t){const e=t?.[D];if(!e)return null;const r=this.slots.find(t=>t.id===e);return r?{position:r.localPosition??{x:0,y:0,z:0},rotation:r.localRotation??{x:0,y:0,z:0},slotId:r.id}:null}placementFor(t,e={}){const r=t&&"object"==typeof t&&"state"in t?t:void 0,n=r?r.state??{}:t??{},i={width:Number(n.width)||0,height:Number(n.height)||0,depth:Number(n.depth)||0},o=e.slot??this.slots.find(t=>{const e=t.maxCount??this.arrangementStrategy.capacity(t);return this._countOccupied(t.id)<e});if(!o)return null;const s=e.index??this._countOccupied(o.id),a=e.occupantCount??s,c=this.arrangementStrategy.positionAt(s,o,a,r??{state:{...i}});if(!c)return null;const u=Number(this.state?.width)||0,l=Number(this.state?.height)||0,h=c.x+i.width/2-u/2,f=c.y+i.height/2-l/2,d=this._realObject,p=d?.placementMode??"floor",g="space"===p?0:"inverted"===p?-i.depth/2:i.depth/2,y=this._receivingSurfaceLocalY();let m;m=null!==y?y+g:o.localPosition&&Number.isFinite(o.localPosition.z)?o.localPosition.z+g:g-(d?.geometricOffsetY??0);const b=this.acceptanceRotation?.(r??i,o)??void 0;return b?{position:{x:h,y:m,z:f},rotation:b}:{position:{x:h,y:m,z:f}}}_zPosFromSeatY(t,e,r){const n=this._realObject,i=n?.receivingSurfaceY??0,o=!(!r.localPosition||!Number.isFinite(r.localPosition.z));if(0===i&&!o)return null;const s=Number(e)||0,a=n?.placementMode??"floor";return t-("space"===a?0:"inverted"===a?-s/2:s/2)+(n?.geometricOffsetY??0)-i}_receivingSurfaceLocalY(){const t=this._realObject,e=t?.receivingSurfaceY;return"number"!=typeof e||0===e?null:e-(t.geometricOffsetY??0)}_countOccupied(t){const e=this._items;if(e)return e.filter(e=>e?.[D]===t).length;const r=this.components;return r?r.filter(e=>e.parent===this&&e[D]===t).length:0}},e.__hasCapacity=!0,e}function Wc(t,e){const r=t.left??0,n=t.top??0,i=t.width??0,o=t.height??0;if(i<=0||o<=0)return[];const s="number"==typeof t.rotation?t.rotation:0,a=Math.cos(s),c=Math.sin(s),u=r+i/2,l=n+o/2,h="inbound"===e?-1:1;return[{lx:-i/2,lz:0,odx:-1,odz:0},{lx:i/2,lz:0,odx:1,odz:0},{lx:0,lz:-o/2,odx:0,odz:-1},{lx:0,lz:o/2,odx:0,odz:1}].map(t=>{var e,r;return{worldPos:(e=t.lx,r=t.lz,{x:u+e*a-r*c,z:l+e*c+r*a}),direction:{x:h*(t.odx*a-t.odz*c),z:h*(t.odx*c+t.odz*a)},halfSpan:0!==t.odx?o/2:i/2}})}function qc(t,e){const r=t.left??0,n=t.top??0,i=t.width??0,o=t.height??0;if(i<=0||o<=0)return{inbounds:[],outbounds:[]};const s="number"==typeof t.rotation?t.rotation:0,a=e??"reverse"===t.status,c="vertical"===t.orientation||"horizontal"!==t.orientation&&i<o,u=r+i/2,l=n+o/2,h=c?o/2:i/2,f=c?0:1,d=c?1:0,p=Math.cos(s),g=Math.sin(s),y=(t,e)=>({x:u+t*p-e*g,z:l+t*g+e*p}),m=c?{lx:0,lz:-h}:{lx:-h,lz:0},b=c?{lx:0,lz:h}:{lx:h,lz:0},v=y(m.lx,m.lz),x=y(b.lx,b.lz),_={x:f*p-d*g,z:f*g+d*p},w=Math.hypot(_.x,_.z)||1,k={x:_.x/w,z:_.z/w},S={x:-k.x,z:-k.z},M=(c?i:o)/2;return a?{inbounds:[{worldPos:x,direction:S,halfSpan:M}],outbounds:[{worldPos:v,direction:S,halfSpan:M}]}:{inbounds:[{worldPos:v,direction:k,halfSpan:M}],outbounds:[{worldPos:x,direction:k,halfSpan:M}]}}function Bc(t){const e=t.left??0,r=t.top??0,n=t.width??0,i=t.height??0;if(n<=0||i<=0)return null;const o="number"==typeof t.rotation?t.rotation:0,s="vertical"===t.orientation||"horizontal"!==t.orientation&&n<i,a=e+n/2,c=r+i/2,u=s?i/2:n/2,l=Math.cos(o),h=Math.sin(o),f=(t,e)=>({x:a+t*l-e*h,z:c+t*h+e*l});return{start:s?f(0,-u):f(-u,0),end:s?f(0,u):f(u,0)}}function Gc(t){const e=t.cx??0,r=t.cy??0,n=Math.abs(t.rx??100),i=Math.abs(t.ry??100),o=t.ratio??50,s=(n+n*o/100)/2,a=(i+i*o/100)/2,c=t.startAngle??0,u=t.endAngle??Math.PI/2,l="reverse"===t.status;if(n<=0||i<=0)return{inbounds:[],outbounds:[]};const h={x:e+s*Math.sin(c),z:r-a*Math.cos(c)},f={x:e+s*Math.sin(u),z:r-a*Math.cos(u)},d={x:Math.cos(c),z:Math.sin(c)},p={x:Math.cos(u),z:Math.sin(u)};return l?{inbounds:[{worldPos:f,direction:{x:-p.x,z:-p.z}}],outbounds:[{worldPos:h,direction:{x:-d.x,z:-d.z}}]}:{inbounds:[{worldPos:h,direction:d}],outbounds:[{worldPos:f,direction:p}]}}function Xc(t){const e=qc(t),r=e.outbounds[0];if(!r)return{inbounds:Wc(t,"inbound"),outbounds:[]};const n=Wc(t,"inbound").filter(t=>{const e=t.worldPos.x-r.worldPos.x,n=t.worldPos.z-r.worldPos.z;return Math.hypot(e,n)>1}),i=r.direction,o=[];for(const t of n){const e=t.direction.x*i.x+t.direction.z*i.z;if(Math.abs(e)>=.1)continue;const r=t.direction.x+i.x,n=t.direction.z+i.z,s=Math.hypot(r,n)||1;o.push({worldPos:t.worldPos,direction:{x:r/s,z:n/s},halfSpan:t.halfSpan})}return{inbounds:[...n,...o],outbounds:e.outbounds}}function Hc(t,e,r={}){const n=r.distance??5,i=r.cosine??.9;if(t.direction.x*e.direction.x+t.direction.z*e.direction.z<i)return!1;const o=t.worldPos.x-e.worldPos.x,s=t.worldPos.z-e.worldPos.z;if("number"==typeof t.halfSpan&&"number"==typeof e.halfSpan){const r=t.direction.x,i=t.direction.z;if(Math.abs(o*r+s*i)>n)return!1;const a=Math.abs(o*-i+s*r);return t.halfSpan+e.halfSpan-a>0}return Math.hypot(o,s)<=n}function Zc(t,e,r,n=0){const i=r.width??0,o=r.height??0;if(i<=0||o<=0)return!1;const s=(r.left??0)+i/2,a=(r.top??0)+o/2,c="number"==typeof r.rotation?r.rotation:0,u=Math.cos(-c),l=Math.sin(-c),h=t-s,f=e-a,d=h*u-f*l,p=h*l+f*u;return Math.abs(d)<=i/2+n&&Math.abs(p)<=o/2+n}function Vc(t,e,r){const n=r.width??0,i=r.height??0;if(n<=0||i<=0)return 1/0;const o=(r.left??0)+n/2,s=(r.top??0)+i/2;let a=t.x-o,c=t.z-s,u=e.x,l=e.z;const h="number"==typeof r.rotation?r.rotation:0;if(0!==h){const t=Math.cos(-h),e=Math.sin(-h),r=a*e+c*t,n=u*e+l*t;a=a*t-c*e,c=r,u=u*t-l*e,l=n}const f=n/2,d=i/2;let p=-1/0,g=1/0;if(Math.abs(u)<1e-9){if(a<-f||a>f)return 1/0}else{const t=(-f-a)/u,e=(f-a)/u;p=Math.max(p,Math.min(t,e)),g=Math.min(g,Math.max(t,e))}if(Math.abs(l)<1e-9){if(c<-d||c>d)return 1/0}else{const t=(-d-c)/l,e=(d-c)/l;p=Math.max(p,Math.min(t,e)),g=Math.min(g,Math.max(t,e))}return g<p?1/0:p>=0?p:g>=0?Math.min(-p,g):-g}function Qc(t,e,r,n=6){return!!Zc(t.worldPos.x,t.worldPos.z,e,n)&&(!r||t.direction.x*r.x+t.direction.z*r.z>=0)}function Jc(t,e,r){return t.outbounds.map(t=>{const n=[];for(const i of e){let e=null;for(const n of i.topology.inbounds){if(!Hc(t,n,r))continue;const i=t.worldPos.x-n.worldPos.x,o=t.worldPos.z-n.worldPos.z,s=Math.hypot(i,o);(null===e||s<e)&&(e=s)}if(null===e&&i.bounds){const n=i.topology.outbounds[0]?.direction,o=!(i.topology.outbounds&&i.topology.outbounds.length)?r?.sinkMargin??30:6;if(Qc(t,i.bounds,n,o)){const r=Vc(t.worldPos,t.direction,i.bounds);if(Number.isFinite(r))e=r+1e3;else{const r=(i.bounds.left??0)+(i.bounds.width??0)/2,n=(i.bounds.top??0)+(i.bounds.height??0)/2;e=Math.hypot(t.worldPos.x-r,t.worldPos.z-n)+1e3}}}null!==e&&n.push({id:i.id,dist:e})}return 0===n.length?null:(n.sort((t,e)=>t.dist-e.dist||(t.id<e.id?-1:1)),n[0].id)})}function Kc(t,e){const r=new Map;for(const e of t)r.set(e.id,e);const n=new Map,i=new Set;for(const r of t){const o=t.filter(t=>t.id!==r.id),s=Jc(r.topology,o,e);n.set(r.id,s);for(const t of s)null!=t&&i.add(t)}const o=(t,e)=>{if(!r.has(t)||!r.has(e)||t===e)return;const o=n.get(t)??[];o.includes(e)||(o.push(e),n.set(t,o),i.add(e))};for(const e of t)if(e.links){for(const t of e.links.downstream??[])o(e.id,t);for(const t of e.links.upstream??[])o(t,e.id)}const s=new Set,a=new Set;for(const e of t){(n.get(e.id)??[]).some(t=>null!=t)||s.add(e.id),i.has(e.id)||a.add(e.id)}return{nodes:r,out:n,sinks:s,sources:a}}function tu(t,e){const r=new Map;return(t.out.get(e)??[]).map(e=>{if(null==e)return new Set;const n=new Set([e]);for(const i of function(t,e,r){const n=r.get(e);if(n)return n;const i=new Set,o=[e],s=new Set([e]);for(;o.length;){const e=o.shift();for(const r of t.out.get(e)??[])null!=r&&(i.add(r),s.has(r)||(s.add(r),o.push(r)))}return r.set(e,i),i}(t,e,r))n.add(i);return n})}function eu(t,e,r,n){return e===r?0:function(t,e,r){const n=r.get(e);if(n)return n;const i=new Map([[e,0]]),o=[e];for(;o.length;){const e=o.shift(),r=i.get(e);for(const n of t.out.get(e)??[])null==n||i.has(n)||(i.set(n,r+1),o.push(n))}return r.set(e,i),i}(t,e,n).get(r)??1/0}function ru(t,e,r){const n=t.out.get(e)??[],i=new Map,o=[];for(let e=0;e<n.length;e++){const s=n[e];if(null==s)continue;const a=s===r?0:eu(t,s,r,i);a!==1/0&&o.push({i:e,hops:1+a})}return o.sort((t,e)=>t.hops-e.hops||t.i-e.i),o.map(t=>t.i)}function nu(t,e,r){const n=ru(t,e,r);return n.length?n[0]:-1}function iu(t,e,r){return e===r||ru(t,e,r).length>0}function ou(t,e){const r=new Set;for(const n of tu(t,e))for(const e of n)t.sinks.has(e)&&r.add(e);return r}function su(t,e,r){return au(t,e,r).map(t=>t.index)}function au(t,e,r){const n=r instanceof Set?r:new Set(r);if(0===n.size)return[];const i=t.out.get(e)??[],o=new Map,s=[...n].sort(),a=[];for(let e=0;e<i.length;e++){const r=i[e];if(null==r)continue;let n=1/0,c="";for(const e of s){const i=1+(r===e?0:eu(t,r,e,o));i<n&&(n=i,c=e)}n!==1/0&&a.push({index:e,hops:n,target:c})}return a.sort((t,e)=>t.hops-e.hops||t.index-e.index),a}function cu(t,e={}){const r=[],n=e.loopCapableIds??new Set,i=e.routingTargetIds??new Set;for(const e of[...t.sources].sort()){const n=t.nodes.get(e);if(!n||!n.topology.outbounds?.length)continue;(t.out.get(e)??[]).some(t=>null!=t)||r.push({severity:"error",code:"orphan-source",nodeId:e,message:`source 노드 "${e}" 가 outgoing edge 0 — 아무 데도 carrier 를 보낼 수 없음`})}for(const e of[...t.nodes.keys()].sort()){(t.out.get(e)??[]).some(t=>null!=t)||(i.has(e)||t.sources.has(e)||r.push({severity:"error",code:"dead-end",nodeId:e,message:`노드 "${e}" 가 outgoing 0 인데 RoutingTarget 자격 없음 — routing 미정의 종착`}))}const o=function(t){const e=[],r=[...t.nodes.keys()].sort(),n=new Set,i=[],o=new Set,s=r=>{n.add(r),i.push(r),o.add(r);for(const a of t.out.get(r)??[])if(null!=a)if(o.has(a)){const t=i.indexOf(a),r=i.slice(t),n=r.indexOf([...r].sort()[0]),o=[...r.slice(n),...r.slice(0,n)],s=o.join("→");e.some(t=>t.join("→")===s)||e.push(o)}else n.has(a)||s(a);i.pop(),o.delete(r)};for(const t of r)n.has(t)||s(t);return e.sort((t,e)=>t[0].localeCompare(e[0])||t.length-e.length),e}(t);for(const t of o){t.some(t=>n.has(t))||r.push({severity:"error",code:"cycle",cycle:t,message:`의도 cycle 자격 (isLoop) 없는 cycle: ${t.join(" → ")} → ${t[0]}`})}const s=e.routingWeights;if(s)for(const[t,e]of[...s].sort((t,e)=>t[0].localeCompare(e[0])))(!Number.isFinite(e)||e<=0)&&r.push({severity:"warning",code:"invalid-weight",nodeId:t,message:`RoutingTarget "${t}" 의 routingWeight=${e} — weight ≤ 0 비정상, weight 정책에서 제외됨`});const a=new Set;for(const e of t.out.values())for(const t of e)null!=t&&a.add(t);for(const e of[...i].sort())t.nodes.has(e)&&(a.has(e)||r.push({severity:"warning",code:"unreachable-target",nodeId:e,message:`RoutingTarget "${e}" 에 incoming edge 0 — 누구도 이쪽으로 carrier 를 보내지 않음`}));return r.sort((t,e)=>t.code!==e.code?t.code.localeCompare(e.code):(t.nodeId??"").localeCompare(e.nodeId??"")),r}function uu(t,e){if(!t)return[];const r=[],n=new Set,i=t=>{if(!t||n.has(t))return;if(n.add(t),t!==e&&"function"==typeof t?.getSegmentTopology){const e=t.state?.id,n=t.refid??t.state?.refid,i="string"==typeof e&&e.length>0?e:null!=n?String(n):void 0;if(i)try{const e=t.getSegmentTopology(),n=t.state??{},o={left:n.left,top:n.top,width:n.width,height:n.height,rotation:n.rotation};e&&r.push({id:i,topology:e,bounds:o})}catch{}}const o=t?.components;if(Array.isArray(o))for(const t of o)i(t)};return i(t),r}function lu(t,e){const r=t.state?.targetRef??t.state?.downstreamRef;if("string"==typeof r&&r.length>0)return r;if("function"!=typeof t.getSegmentTopology)return null;const n=t.getSegmentTopology();if(!n||0===n.outbounds.length)return null;const i=Jc(n,uu(t.parent??t.rootModel??t.root,t).filter(t=>t.topology.inbounds.length>0),e);for(const t of i)if(t)return t;return null}function hu(t){return!!t&&"function"==typeof t.routingConstraints}function fu(t){return!!t&&"function"==typeof t.acceptedCarrierData}function du(t,e=16){const r=[],n=t.parent??t.rootModel??t.root;if(!n)return r;const i=lu(t);if(!i)return r;const o=yu(n,i);if(!o)return r;const s=[{segment:o,accumulated:{},pathIds:[i],visited:new Set([i])}];for(;s.length>0;){const t=s.shift();if(t.pathIds.length>e)continue;const i=hu(t.segment)?t.segment.routingConstraints():null;if(i&&i.length>0)for(const e of i)for(const i of e.candidates){const o=pu(t.accumulated,i);if(!o)continue;const a=gu(t.segment,e.portId,n);a&&!t.visited.has(a.state?.id??"")?s.push({segment:a,accumulated:o,pathIds:[...t.pathIds,a.state?.id??"?"],visited:new Set([...t.visited,a.state?.id??""])}):r.push({data:o,weight:1,pathIds:[...t.pathIds,`${e.portId}`],destination:e.portId})}else{if(fu(t.segment)){const e=t.segment.acceptedCarrierData(),n=t.segment.state?.id;if(0===e.length)r.push({data:t.accumulated,weight:1,pathIds:t.pathIds,destination:n});else for(const i of e){const e=pu(t.accumulated,i);e&&r.push({data:e,weight:1,pathIds:t.pathIds,destination:n})}continue}const e=lu(t.segment);if(!e||t.visited.has(e)){r.push({data:t.accumulated,weight:1,pathIds:t.pathIds,destination:t.pathIds[t.pathIds.length-1]});continue}const i=yu(n,e);if(!i)continue;s.push({segment:i,accumulated:t.accumulated,pathIds:[...t.pathIds,e],visited:new Set([...t.visited,e])})}}return r}function pu(t,e){const r={...t};for(const[t,n]of Object.entries(e)){if(t in r&&r[t]!==n)return null;r[t]=n}return r}function gu(t,e,r){if("straight"===e&&t.state?.downstreamRef)return yu(r,t.state.downstreamRef);const n=yu(r,e);if(n)return n;const i=lu(t);return i?yu(r,i):null}function yu(t,e){if(!t||!e)return null;if("function"==typeof t.findById)return t.findById(e);const r=new Set,n=t=>{if(!t||r.has(t))return null;if(r.add(t),t.state?.id===e)return t;const i=t.components;if(Array.isArray(i))for(const t of i){const e=n(t);if(e)return e}return null};return n(t)}function mu(t,e){return Math.hypot(t.x-e.x,t.z-e.z)}function bu(t,e,r=5,n=[],i=r){const o=t.length,s=new Array(o).fill(void 0),a=new Set,c=(e,r)=>"start"===r?t[e].start:t[e].end,u=[],l=new Map,h=[],f=new Map;for(const t of n){const e=Array.isArray(t),r=e?t:t.positions,n=e?void 0:t.kind;if(!r.length)continue;const i=u.length;u.push({pos:r[0],members:[]});for(const t of r)h.push({pos:t,pt:i});n&&f.set(i,n)}const d=(t,e)=>{const n=c(t,e),i=l.get(`${t}:${"end"===e?"start":"end"}`),o=[];for(const t of h)mu(t.pos,n)<=r&&!o.includes(t.pt)&&o.push(t.pt);for(let t=0;t<u.length;t++)mu(u[t].pos,n)<=r&&!o.includes(t)&&o.push(t);let s=o.find(t=>t!==i)??-1;s<0&&(s=u.length,u.push({pos:n,members:[]})),u[s].members.push({seg:t,end:e}),l.set(`${t}:${e}`,s)};for(let t=0;t<o;t++)d(t,"start"),d(t,"end");const p=new Set,g=new Set,y=new Set;{const t=t=>{let e=-1,r=1/0;for(let n=0;n<u.length;n++){const i=mu(u[n].pos,t);i<r&&(r=i,e=n)}for(const n of h){const i=mu(n.pos,t);i<r&&(r=i,e=n.pt)}return{pt:e,d:r}};for(const r of e){const{pt:e,d:n}=t(r.pos);e>=0&&n<=i&&(p.add(e),("source"===r.kind?g:y).add(e))}}for(const[t,e]of f)p.add(t),("source"===e?g:y).add(t);const m=(t,e)=>"end"===e!==s[t],b=[],v=(e,r)=>{if(void 0===s[e])return s[e]=r,void b.push(e);s[e]!==r&&a.add(t[e].id)},x=t=>{for(const e of["start","end"]){const r=l.get(`${t}:${e}`);if(void 0===r)continue;const n=u[r];if(2!==n.members.length||p.has(r))continue;const i=n.members[0],o=i.seg===t&&i.end===e?n.members[1]:i;if(o.seg===t)continue;const a="end"===e!==s[t],c="end"===o.end!==!a;v(o.seg,c)}},_=()=>{for(;b.length;)x(b.shift())},w=t=>{let e=-1,r="start",n=1/0;for(let i=0;i<o;i++)for(const o of["start","end"]){const s=mu(c(i,o),t.pos);s<n&&(n=s,e=i,r=o)}if(e<0||n>i)return;const s="source"===t.kind?"end"===r:"start"===r;v(e,s)};for(const t of e)"source"===t.kind&&w(t);_();for(const t of e)"sink"===t.kind&&w(t);_();let k=!0;for(;k;){k=!1;for(const t of u){if(t.members.length<3)continue;const e=t.members.filter(t=>void 0===s[t.seg]);if(1!==e.length)continue;let r=0,n=0;for(const e of t.members)void 0!==s[e.seg]&&(m(e.seg,e.end)?r++:n++);const i=e[0];let o;0===n&&r>0?o="end"===i.end:0===r&&n>0&&(o="start"===i.end),void 0!==o&&(s[i.seg]=o,b.push(i.seg),_(),k=!0)}}if(s.some(t=>void 0===t)&&g.size>0&&y.size>0){const t=t=>{const e=new Array(u.length).fill(1/0),r=[];for(const n of t)e[n]=0,r.push(n);for(;r.length;){const t=r.shift();for(const n of u[t].members){const i=l.get(`${n.seg}:${"start"===n.end?"end":"start"}`);void 0!==i&&e[i]>e[t]+1&&(e[i]=e[t]+1,r.push(i))}}return e},e=t(g),r=t(y);for(let t=0;t<o;t++){if(void 0!==s[t])continue;const n=l.get(`${t}:start`),i=l.get(`${t}:end`);if(void 0===n||void 0===i)continue;if(u[n].members.length<2||u[i].members.length<2)continue;if(e[n]===1/0||e[i]===1/0||r[n]===1/0||r[i]===1/0)continue;let o;e[n]!==e[i]?o=e[n]<e[i]:r[n]!==r[i]&&(o=r[i]<r[n]),void 0!==o&&(s[t]=!o,b.push(t))}_()}const S=new Map;for(let e=0;e<o;e++)S.set(t[e].id,void 0===s[e]?"unknown":s[e]?"reverse":"forward");return{directions:S,conflicts:[...a]}}function vu(...t){}function xu(t){return String(t?.state?.id??t?.refid??t?.state?.refid??"?")}function _u(t){const e=t?.state?.id;if("string"==typeof e&&e.length>0)return e;const r=t?.refid??t?.state?.refid;return null!=r?String(r):void 0}function*wu(t){if(!t)return;("function"==typeof t.getSegmentTopology||t.flowOrientable)&&(yield t);const e=t.components;if(Array.isArray(e))for(const t of e)yield*wu(t)}function ku(t,e,r){const n=e.width??0,i=e.height??0;if(n<=0||i<=0)return!1;const o=(e.left??0)+n/2,s=(e.top??0)+i/2,a="number"==typeof e.rotation?e.rotation:0,c=t.x-o,u=t.z-s,l=Math.cos(-a),h=Math.sin(-a),f=c*l-u*h,d=c*h+u*l;return Math.abs(f)<=n/2+r&&Math.abs(d)<=i/2+r}function Su(t){const e=[],r=[],n=[],i=[];for(const o of wu(t)){const t=_u(o);if(!t)continue;if(o.flowOrientable){const r=Bc(o.state??{});r&&e.push({id:t,start:r.start,end:r.end});continue}if("function"==typeof o.openings){const t=o.state??{};(t.width??0)>0&&(t.height??0)>0&&i.push(t);continue}let s;try{s=o.getSegmentTopology()}catch{continue}if(!s)continue;const a=s.inbounds??[],c=s.outbounds??[],u="function"==typeof o.routingDestination;if(0===a.length&&c.length>0)for(const t of c)r.push({pos:{x:t.worldPos.x,z:t.worldPos.z},kind:"source"});else if(a.length>0&&(0===c.length||u))for(const t of a)r.push({pos:{x:t.worldPos.x,z:t.worldPos.z},kind:"sink"});else if(a.length>0||c.length>0){const t=[];for(const e of a)t.push({x:e.worldPos.x,z:e.worldPos.z});for(const e of c)t.push({x:e.worldPos.x,z:e.worldPos.z});t.length&&n.push({positions:t})}}for(const t of i){const i=[];for(const r of e)for(const e of[r.start,r.end])ku(e,t,16)&&i.push(e);let o=!1,s=!1;for(const e of r)ku(e.pos,t,16)&&("sink"===e.kind?o=!0:s=!0);const a=o&&!s?"sink":s&&!o?"source":void 0;(i.length>=2||a&&i.length>=1)&&n.push({positions:i,kind:a})}if(0===e.length||0===r.length)return e.length,r.length,new Map;const o=bu(e,r,8,n,60).directions;return e.length,r.length,n.length,[...o].map(([t,e])=>`#${t}:${e}`).join(" "),o}function Mu(t){const e=t?.root;if(!e)return;if(e.__flowComputing)return;let r=e.__flowOrientation;if(!r){e.__flowComputing=!0;try{r={map:Su(e)}}finally{e.__flowComputing=!1}e.__flowOrientation=r}const n=_u(t),i=n?r.map.get(n):void 0;return"reverse"===i||"forward"!==i&&void 0}function zu(t){return!!t&&"function"==typeof t.distanceToBoardPoint&&"function"==typeof t.routingLinks&&("function"==typeof t.registerDivertStation||"function"==typeof t.registerInductStation)}function Au(t,e,r){if(!e)return null;const n=[],i=e=>{if(!e||e===r)return;if(zu(e)){const r=function(t){const e=t?.state?.id;if("string"==typeof e&&e.length>0)return e;const r=t?.refid??t?.state?.refid;return null!=r?String(r):void 0}(e);if(r){const i=e.distanceToBoardPoint(t.x,t.y);n.push({id:r,component:e,distance:i})}}const o=e.components;if(Array.isArray(o))for(const t of o)i(t)};return i(e),0===n.length?null:(n.sort((t,e)=>t.distance-e.distance||t.id.localeCompare(e.id)),n[0])}function Eu(t){return!!t&&"function"==typeof t.routingDestination}function ju(t){const e=t?.state?.id;if("string"==typeof e&&e.length>0)return e;const r=t?.refid??t?.state?.refid;return null!=r?String(r):void 0}function*Ou(t){if(!t)return;yield t;const e=t.components;if(Array.isArray(e))for(const t of e)yield*Ou(t)}function Tu(t){const e=[],r=new Map,n=new Map,i=new Set,o=[];for(const s of Ou(t)){"function"==typeof s?.registerWithStationHost&&o.push(s);const t="function"==typeof s?.getSegmentTopology,a="function"==typeof s?.routingLinks?s.routingLinks():void 0,c=!(!a||!((a.downstream?.length??0)>0||(a.upstream?.length??0)>0));if(!(t||Eu(s)||c||zu(s)))continue;const u=ju(s);if(!u)continue;let l={inbounds:[],outbounds:[]};if(t){try{l=s.getSegmentTopology()}catch{continue}if(!l)continue}const h=s.state??{},f={left:h.left,top:h.top,width:h.width,height:h.height,rotation:h.rotation};if(e.push({id:u,topology:l,bounds:f,links:a}),n.set(u,s),Eu(s)){i.add(u);const t=s.routingDestination();if("string"==typeof t&&t.length>0){const e=r.get(t)??[];e.push(u),r.set(t,e)}}}return{nodes:e,destToSinks:r,components:n,routingTargetIds:i,stationClients:o}}function Pu(t){if(!t)return null;let e=t.__flowGraph;if(!e){const{nodes:r,destToSinks:n,components:i,routingTargetIds:o,stationClients:s}=Tu(t),a=Kc(r);!function(t,e){if(!t)return;const r=t=>{if(!t)return;"function"==typeof t.clearStations&&t.clearStations();const e=t.components;if(Array.isArray(e))for(const t of e)r(t)};if(r(t),0===e.length)return;const n=[...e].sort((t,e)=>{const r=ju(t)??"",n=ju(e)??"";return r.localeCompare(n)});for(const e of n){const r=e.stationHostRef?.();let n=null;if(r&&(n=t.findById?.(r)??null),!n){const r=e.sorterFacingPoint?.()??e._sorterFacingPoint?.();r&&(n=Au(r,t,e)?.component??null)}n&&"function"==typeof e.registerWithStationHost&&e.registerWithStationHost(n)}}(t,s);const c=new Set;for(const[t,e]of i){((e?.state?.type??e?.model?.type??"").includes("loop")||!0===e?.isLoop)&&c.add(t)}const u=new Map;for(const t of o){const e=i.get(t);if("function"==typeof e?.routingWeight){const r=e.routingWeight();"number"==typeof r&&(!Number.isFinite(r)||r<=0)&&u.set(t,r)}}const l=cu(a,{routingTargetIds:o,loopCapableIds:c,routingWeights:u});if(l.length>0&&"undefined"!=typeof console){const t=l.filter(t=>"error"===t.severity),e=l.filter(t=>"warning"===t.severity);t.length>0?console.warn(`[FlowGraph] ${t.length} error(s) / ${e.length} warning(s):`,l):console.info(`[FlowGraph] ${e.length} warning(s):`,l)}e={graph:a,destToSinks:n,components:i,issues:l},t.__flowGraph=e}return e}function Iu(t){return Pu(t)?.issues??[]}function Cu(t){const e=Pu(t);return e&&e.graph.nodes.size>0?e.graph:null}function Fu(t,e){return Pu(t)?.destToSinks.get(e)??[]}function Ru(t,e){return Pu(t)?.components.get(e)}function Du(t){const e=Pu(t);return e?[...e.destToSinks.keys()]:[]}function Lu(t){return ju(t)}function Nu(t){const e="number"==typeof t?.inventoryCount?t.inventoryCount:"function"==typeof t?.size?t.size():0,r=t?.state?.capacity;return"number"==typeof r&&r>0?e/r:e}function Yu(t,e,r,n,i){if(1===n.length)return n[0];switch(t){case"index":default:return n[0];case"round-robin":{const t=r.counters.get(e)??0;return r.counters.set(e,t+1),n[t%n.length]}case"weight":{const t=n.map(t=>function(t){if("function"==typeof t?.routingWeight){const e=t.routingWeight();if("number"==typeof e&&Number.isFinite(e)&&e>0)return e}return 1}(i.get(t.target))),o=t.reduce((t,e)=>t+e,0);if(o<=0)return n[0];const s=r.counters.get(e)??0;r.counters.set(e,s+1);let a=s%o;for(let e=0;e<n.length;e++){if(a<t[e])return n[e];a-=t[e]}return n[n.length-1]}case"utilization":{let t=1/0,e=n[0];for(const r of n){const n=Nu(i.get(r.target));n<t&&(t=n,e=r)}return e}}}function $u(t,e,r){const n=t?.root;if(!n)return null;const i=e?.state?.meta?.destination;if("string"!=typeof i||0===i.length)return null;const o=Pu(n);if(!o||0===o.graph.nodes.size)return null;const s=ju(t);if(!s)return null;let a=o.destToSinks.get(i)??[];0===a.length&&(a=[i]);const c=au(o.graph,s,a);if(0===c.length)return null;const u=o.graph.out.get(s)??[],l=c.filter(t=>{const r=u[t.index],n=r?o.components.get(r):null;return!n||"function"!=typeof n.canReceive||n.canReceive(e)});if(0===l.length)return u[c[0].index]??null;const h=r?.policy??function(t,e){const r=t?.state?.balancingPolicy;if(r)return r;const n=e?.state?.routingBalancingPolicy;return n||"round-robin"}(t,n),f=Yu(h,s,function(t){return t.__balancingState||(t.__balancingState={counters:new Map}),t.__balancingState}(n),l,o.components);return u[f.index]??null}r({name:"Capacity",description:"Item 을 *보유(keep)* 하는 측면 — slot 위상 / 수용 판정(canReceive/findSlot) / 3D 안착(placementFor/attachPointFor/acceptanceRotation) / delivery 좌표 질의 / 점유 수. 이동(receive/dispatch 등)은 Transferable 소관.",methods:["get slots","get arrangementStrategy","canReceive","findSlot","placementFor","attachPointFor","acceptanceRotation","deliveryWorldRotation","deliveryWorldPosition","_countOccupied"],sourceFile:"src/items/capacity-mixin.ts"}),r({name:"PlacementSurface",description:"carrier 가 holder 위 *정확히 어디에 앉는가* 의 단일 진입점 — placementFor(carrier, ctx) → SeatingPose (holder object3d local frame, 순수 함수). I1 접촉 (밑면 = 받침 상면) / I2 frame-explicit (parent-child 비가정 — Sovereign handover 와 reparent 양쪽이 같은 값 소비) / I3 순수성 / I4 per-carrier 치수. default 구현은 Capacity(FlowNode) 가 기존 receivingSurfaceY + ArrangementStrategy + acceptanceRotation 합성과 수치 동일하게 제공.",methods:["placementFor"],models:["CarrierDims","PlacementContext","SeatingPose"],sourceFile:"src/items/capacity-mixin.ts"});try{globalThis.__operatoBuildFlowGraph=(t,e)=>{try{return e?.force&&t&&delete t.__flowGraph,Cu(t)}catch{return null}}}catch{}function Uu(t,e,r){const n=$u(t,e,r);if(null==n)return null;const i=t?.root,o=Ru(i,n)??i?.findById?.(n)??null;return o?{targetId:n,component:o,origin:"explicit"}:null}function Wu(t){const e=t?.root,r=Cu(e),n=Lu(t);if(!r||!n)return null;const i=(r.out.get(n)??[]).find(Boolean);if(!i)return null;const o=Ru(e,i)??e?.findById?.(i)??null;return o?{id:i,component:o}:null}function qu(t){const e=Lu(t);return e?Bu(t?.root,e):[]}function Bu(t,e){if(!t||!e)return[];const r=Cu(t);if(!r)return[];const n=new Set;for(const i of ou(r,e)){const e=Ru(t,i);if(Eu(e)){const t=e.routingDestination();"string"==typeof t&&t.length>0&&n.add(t)}}return[...n]}function Gu(t,e){if(!t||!e)return[];const r=Cu(t);if(!r)return[];const n=new Map;for(const t of r.out.values())for(const e of t)null!=e&&n.set(e,(n.get(e)??0)+1);const i=new Map;for(const o of ou(r,e)){const e=Ru(t,o);if(!Eu(e))continue;const r=e.routingDestination();if("string"!=typeof r||0===r.length)continue;let s=null;if("function"==typeof e.routingWeight){const t=e.routingWeight();"number"==typeof t&&Number.isFinite(t)&&t>0&&(s=t)}null===s&&(s=n.get(o)??0,0===s&&(s=1)),i.set(r,(i.get(r)??0)+s)}return[...i].map(([t,e])=>({value:t,weight:e}))}function Xu(t){return Cu(t)}function Hu(t){const e=Cu(t);if(!e)return[];const r=new Set,n=new Set,i=t=>{if(!t)return;const o=Lu(t);if(o&&e.nodes.has(o)){Eu(t)&&r.add(o);((t?.state?.type??t?.model?.type??"").includes("loop")||!0===t?.isLoop)&&n.add(o)}const s=t.components;if(Array.isArray(s))for(const t of s)i(t)};return i(t),cu(e,{routingTargetIds:r,loopCapableIds:n})}function Zu(t){if(0===t.length)return;const e=t.reduce((t,e)=>t+e.weight,0);if(e<=0)return t[Math.floor(Math.random()*t.length)].value;const r=Math.random()*e;let n=0;for(const e of t)if(n+=e.weight,r<n)return e.value;return t[t.length-1].value}const Vu={next:Uu,downstream:Wu,reachableDestinations:qu,reachableDestinationsFrom:Bu,reachableDestinationsWeightedFrom:Gu,pickWeightedDestination:Zu,graphFor:Xu,validate:Hu};function Qu(t){var e;return e=class extends t{constructor(){super(...arguments),this._items=[]}get items(){return this._items}containsItem(t){return-1!==this._items.indexOf(t)}attachPointFor(e,r){const n=t.prototype?.attachPointFor;return"function"==typeof n?n.call(this,e,r):null}addItem(t,e){if(!t||this.containsItem(t))return;const r=t.parent;if(r&&"function"==typeof r.removeItem&&r!==this&&r.removeItem(t,!0),this._items.push(t),t.parent=this,!e?.silent&&"function"==typeof this.trigger)try{this.trigger("hold",this,t,this._items.length-1)}catch{}t.held?.(this)}removeItem(t,e){if(!t)return;const r=this._items.indexOf(t);if(-1!==r&&(this._items.splice(r,1),t.parent=null,!e)){if("function"==typeof this.trigger)try{this.trigger("release",this,t,r)}catch{}t.released?.(this)}}forEachItem(t,e){this._items.forEach(t,e)}handoverIn(t,e){if(!t)return;const r=t.parent;r&&("function"==typeof r.removeComponent&&-1!==r._components?.indexOf?.(t)&&r.removeComponent(t,!0),r!==this&&"function"==typeof r.removeItem&&-1!==r._items?.indexOf?.(t)&&r.removeItem(t,!0));const n=-1===this._items.indexOf(t);if(n&&this._items.push(t),t.parent=this,n&&"function"==typeof this.trigger)try{this.trigger("hold",this,t,this._items.length-1)}catch{}t.realObject;const i=t._realObject,o=i?.object3d;if(o){let r,n,s=e?.toParent3D,a="world-preserve";if(!s){const i=this.attachPointFor?.(t,{slotId:e?.slotId});i?.attach&&(s=i.attach,r=i.localPosition,n=i.localRotation,a=i.carryPolicy??"world-preserve")}s&&o.parent!==s&&(s.updateWorldMatrix?.(!0,!1),o.updateWorldMatrix?.(!0,!1),s.attach(o),i.suppressTransform=!0),s&&(r&&o.position.set(r.x,r.y,r.z),"world-preserve"!==a?n?o.rotation.set(n.x,n.y,n.z):o.quaternion.identity():n&&o.rotation.set(n.x,n.y,n.z),i?.setTransientPlacement?.({policy:"carried",meta:{carryPolicy:a}}))}t.held?.(this),this._bumpReceived?.(t)}handoverOut(t){this.removeItem(t),this._bumpDispatched?.(t)}dispose(){const t=this._items.slice();this._items.length=0;for(const e of t)try{e.dispose?.()}catch{}super.dispose?.()}_drawItems(t){const e=this.root?.transitionEffect;for(const t of this._items)e?.isReparenting?.(t)||t.draw?.(this.getContext?.(t))}_captureItems(t,e,r,n,i){for(let o=this._items.length-1;o>=0;o--){const s=this._items[o],a="static"===s.position?s.capture?.(t,e,i):s.capture?.(r,n,i);if(a)return a}return null}postrender(t){super.postrender?.(t);const e=this;if("popup"===e.position)return;const r=this._items;if(!r||0===r.length)return;t.save();const n=e.bounds;!e.showOverflow&&n&&(t.beginPath(),t.rect(n.left,n.top,n.width,n.height),t.clip(),t.closePath());const{left:i=0,top:o=0}=e.state??{};t.translate(i,o),this._drawItems(t),t.translate(-i,-o),t.restore()}capture(t,e,r){const n=this,i=this._items;if(i&&i.length>0&&(!n.app||n.app.isEditMode||!n.hidden)){const i=n.fromParent?.(t,e);if(i&&n.contains?.(i.x,i.y)){const o=n.bounds,s=this._captureItems(i.x-o.left,i.y-o.top,t,e,r);if(s)return s}}return super.capture?.(t,e,r)}},e.capabilities=Object.freeze([...t.capabilities??[],"Holdable"]),e}function Ju(t){var e;const r=!!t.__hasCapacity,n=!!t.__hasTransferable,i=r?t:Uc(t),o=n?i:function(t){var e;return(e=class extends t{reserve(t,e){const r=this.findSlot(t);return r?{slot:r,token:Symbol("slot-reservation")}:null}release(t){}async receive(t,e={}){W.log({role:"target",contract:"receive:enter",component:this,args:{carrier:C(t),options:e}});const r=this.reserve(t,e);if(!r){W.log({role:"target",contract:"receive:reject",component:this,args:{carrier:C(t)},result:{reason:"no-slot"}}),this.trigger("transfer-rejected",{type:"transfer-rejected",component:t,container:this,reason:"no-slot"});const e=new Error("receive rejected: no-slot");throw e.reason="no-slot",e}this.commit(r,t,e)}commit(t,e,r={}){const n=t.slot,i=this._countOccupied(n.id),o=this.arrangementStrategy.positionAt(i,n,i,e);W.log({role:"target",contract:"arrangementStrategy.positionAt",component:this,args:{idx:i,slotId:n.id,occupantCount:i,carrier:C(e)},result:o}),e[D]=n.id;const s=e._realObject;let a,c;s?.object3d&&(s.object3d.updateWorldMatrix(!0,!1),a=new x,c=new v,s.object3d.getWorldPosition(a),s.object3d.getWorldQuaternion(c));const{animated:u=!1,duration:l,ease:h}=r;"function"==typeof this.handoverIn?this.handoverIn(e,{slotId:n.id}):this.reparent?.(e,{animated:u,duration:l,ease:h}),!u&&e._realObject&&(e._realObject.suppressTransform=!1);{const t={},r=this.placementFor?.(e,{slot:n,index:i,occupantCount:i})??null;if(W.log({role:"target",contract:"placementFor",component:this,args:{carrier:C(e),slotId:n.id,index:i},result:r}),r){const i=e.state??{},o=this.state??{};t.left=r.position.x-(Number(i.width)||0)/2+(Number(o.width)||0)/2,t.top=r.position.z-(Number(i.height)||0)/2+(Number(o.height)||0)/2;const s=this._zPosFromSeatY(r.position.y,i.depth,n);null!==s&&(t.zPos=s),r.rotation&&R(t,r.rotation)}else{if(o&&(t.left=o.x,t.top=o.y),0!==(this._realObject?.receivingSurfaceY??0))t.zPos=0;else if(n.localPosition&&Number.isFinite(n.localPosition.z)){const e=this._realObject?.geometricOffsetY??0;t.zPos=n.localPosition.z+e}const r=this.acceptanceRotation?.(e,n);W.log({role:"target",contract:"acceptanceRotation",component:this,args:{carrier:C(e),slotId:n.id},result:r}),r&&R(t,r)}const s=this.normalizePose?.(e,n);"function"==typeof this.normalizePose&&W.log({role:"target",contract:"normalizePose",component:this,args:{carrier:C(e),slotId:n.id},result:s}),s&&Object.assign(t,s),Object.keys(t).length&&(e.setState?.(t),W.log({role:"target",contract:"receive:setState",component:this,args:{carrier:C(e),keys:Object.keys(t)}}))}this.trigger("transfer-received",{type:"transfer-received",component:e,container:this,slotId:n.id,preReceiveWorldPos:a,preReceiveWorldQuat:c}),W.log({role:"target",contract:"receive:done",component:this,args:{carrier:C(e),slotId:n.id}})}async dispatch(t,e,r={}){const n=new X({source:this,target:e,carrier:t,options:r,physical:async()=>{delete t[D]}}),i=await n.execute();"rolled-back"!==i.phase?this.trigger("transfer-dispatched",{type:"transfer-dispatched",component:t,container:this,target:e}):this.trigger("transfer-rejected",{type:"transfer-rejected",component:t,container:this,reason:i.rejectReason??"rejected"})}route(t){return null}resolveRoute(t,e){}rejectRoute(t,e="rejected"){this.trigger("transfer-rejected",{type:"transfer-rejected",component:t,container:this,reason:e})}canAccept(t){const e=(()=>{const e=this.slots;if(!e.length)return{ok:!1,reason:"no-slots-defined"};const r=this.findSlot(t);if(!r){const r=t?.state?.type??t?.type;for(const t of e)if(!t.allowedTypes?.length||!r||t.allowedTypes.includes(r))return{ok:!1,reason:"all-slots-full"};return{ok:!1,reason:"type-not-accepted"}}return{ok:!0,slot:r}})();return W.log({role:"target",contract:"canAccept",component:this,args:{carrier:C(t)},result:e.ok?{ok:!0,slotId:e.slot.id}:{ok:!1,reason:e.reason}}),e}accept(t,e){return this.receive(t,e)}}).__hasTransferable=!0,e}(i),s=[...t.capabilities??[]];r||s.push("Capacity","PlacementSurface"),n||s.push("Transferable"),s.push("Holdable","FlowNode");var a,c,u;return Yc((e=class extends(Qu(o)){get isFlowNode(){return!0}containable(t){return!!t&&!0===t.isItem}get showMoveHandle(){return!1}inboundPorts(){return[]}outboundPorts(){return[]}_bumpReceived(t){const e=this.state?.received??0;this.setState?.({received:e+1})}_bumpDispatched(t){const e=this.state?.dispatched??0;this.setState?.({dispatched:e+1})}_bumpRejected(t,e){const r=this.state?.rejected??0;this.setState?.({rejected:r+1})}route(t){return null}resolveRoute(t,e){}rejectRoute(t,e){}resolveDownstream(){const t=this.state?.downstreamRef;if(!t)return[];return(this.root?.findAll?.(t)??[]).map(t=>t?.state?.id).filter(Boolean)}routingLinks(){return{downstream:this.resolveDownstream()}}},a=e,"symbol"==typeof(c="FlowNodeMixed")&&(c=c.description?"[".concat(c.description,"]"):""),Object.defineProperty(a,"name",{configurable:!0,value:u?"".concat(u," ",c):c}),e.capabilities=Object.freeze(s),e.isFlowNode=!0,e))}function Ku(t){return!!t&&!0===t.isFlowNode}"function"==typeof SuppressedError&&SuppressedError,r({name:"Holdable",description:"어떤 Component 든 item(데이타바인딩 동적 물건) 을 보유하는 capability. _items + add/remove/forEach + handover + hold/release event + dispose cascade. Container(정적 _components) 와 직교 — 컨테이너 비의존.",methods:["addItem","removeItem","forEachItem","containsItem","handoverIn","handoverOut","_drawItems","_captureItems","dispose"],sourceFile:"src/components/mixins/holdable.ts"}),r({name:"Transferable",description:"Item 을 노드 간에 옮기는 *이동(move)* 측면. 수용 트랜잭션 라이프사이클(reserve → commit → release)과 receive/accept/dispatch/route 를 제공. 보유(keep — slots/findSlot/canReceive 등)는 Capacity 소관.",methods:["reserve","commit","release","receive","accept","canAccept","dispatch","route","resolveRoute","rejectRoute"],sourceFile:"src/transfer/transferable-mixin.ts"}),r({name:"FlowNode",description:"Flow graph 의 노드 — 구조 (inbound/outbound port + slot) + flow (route + 5-phase transfer stat). 보유(_items/handover)는 Holdable base 위임. 모든 flow 컴포넌트의 base — Storable/Mobile/Processable 의도가 위에 직교로 적용.",methods:["inboundPorts","outboundPorts","slotIds","slotAt","route","resolveRoute","rejectRoute"],models:["Port","SlotInfo","Vec3"],sourceFile:"src/flow/flow-node.ts"});export{st as BULGE_EPSILON,Uc as Capacity,_t as CapacityEventTracker,kt as CenteringQueueStrategy,g as CenteringSlotStrategy,d as FixedSlotStrategy,Vu as FlowEngine,Ju as FlowNode,zt as GridStacking,Qu as Holdable,Yc as ItemsDataBinding,tt as NavGraph,Mt as PatternStacking,yt as PolygonPathPolyline,J as ReservationTable,D as TRANSFER_SLOT_KEY,X as Transfer,At as VolumeStacking,Du as allDestinations,Hc as anchorsConnect,Yu as applyPolicy,R as applySeatingRotation,Et as applyStackLayout,Gc as arcSegmentTopology,wt as autoWireBackPressure,Kc as buildFlowGraph,nt as buildNavGraph,lt as bulgeFromDrag,ut as bulgeHandlePosition,iu as canReach,t as capability,f as chooseNearestPickupFrame,uu as collectAdjacentSegments,Ru as componentForNode,ct as computeArcParams,Su as computeFlowMap,St as computeStackPositions,ft as cornerHandlePosition,dt as cornerRadiusFromDrag,Qc as deliversInto,Wu as downstream,ht as effectiveCornerRadius,du as enumerateDataScenarios,h as filterByToolType,Au as findNearestStationHost,p as fixedSlotStrategy,mt as flattenPolygonPath,Cu as flowGraphFor,Iu as flowGraphIssues,Mu as flowReverseFor,jt as footprint2D,xu as ftId,vu as ftrace,i as getAllCapabilityMeta,n as getCapabilityMeta,L as globalSimClock,Xu as graphFor,at as hasArc,vt as hasCapacity,xt as inferCapacity,lu as inferDownstreamId,bu as inferFlowDirections,Ku as isFlowNode,Eu as isRoutingTarget,zu as isStationHost,Jc as matchOutbounds,Uu as next,nu as nextHop,ru as nextHops,su as nextHopsToAny,au as nextHopsToAnyDetailed,Lu as nodeIdOf,Zu as pickWeightedDestination,it as planPathAStar,ot as planToReservations,Zc as pointInRotatedRect,bt as polygonPathLength,s as quatFromYaw,Vc as rayAbsDistanceToRect,tu as reachableByOutbound,qu as reachableDestinations,Bu as reachableDestinationsFrom,Gu as reachableDestinationsWeightedFrom,ou as reachableSinks,B as receiptToJSON,Wc as rectFaceAnchors,u as rectangularFootprintFrames,r as registerCapabilityMeta,K as reservationTable,$u as resolveNextHop,Fu as sinksForDestination,Q as standardYieldPolicy,Bc as straightSegmentEndpoints,Xc as straightSegmentMultiInbound,qc as straightSegmentTopology,l as topApproachFrame,H as transferLog,W as transferTracer,pt as uniformZ,Hu as validate,cu as validateFlowGraph};
|