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hBq+B,EAAMjmC,OAIDimC,EAAMjmC,MAAQ4H,KAFnBq+B,EAAMjmC,MAAQ4H,EAAI,IAOD,OAAjBq+B,EAAMxrB,QAIDwrB,EAAMxrB,OAAS5S,KAFpBo+B,EAAMxrB,OAAS5S,IAgB3B,OAPkB,OAAdo+B,EAAMlmC,MAEN2X,EAAQuuB,EAAMjmC,MAAQimC,EAAMnmC,KAC5BG,EAASgmC,EAAMxrB,OAASwrB,EAAMlmC,IAAM,EACpCsH,EAAO0I,EAAQysD,aAAav2B,EAAMnmC,KAAMmmC,EAAMlmC,IAAK2X,EAAOzX,IAGvD,CACHA,OAAMA,EACNyX,MAAKA,EACLrQ,KAAIA,EAEZ,CCnFa,ICNTk+H,EAYY,SAAA95D,EAAqB+5D,EAAa/nD,GAG9C,QAH8C,IAAAA,IAAAA,EAAgB1R,WAAW5vB,UAG5C,IAAzBqpF,EAAI9qH,QAAQ,SAEZ,MAAO,GAIX+iE,EAAMA,GAAO1R,WAAW5vB,SAEnBopF,IAEDA,EAAarzH,SAASC,cAAc,MAMxCozH,EAAWl4E,KAAOm4E,EAClB,IAAMC,EAAYn3E,EAAK9gC,MAAM+3G,EAAWl4E,MAElCq4E,GAAaD,EAAUz4E,MAAqB,KAAbywB,EAAIzwB,MAAiBy4E,EAAUz4E,OAASywB,EAAIzwB,KAGjF,OAAIy4E,EAAUx4E,WAAawwB,EAAIxwB,UAAay4E,GAAYD,EAAU54E,WAAa4wB,EAAI5wB,SAK5E,GAHI,WAIf,CClCgB,SAAAomB,EAAmB3kB,EAAa+6B,GAE5C,IAAM7uB,EAAa4F,EAAAA,GAAAA,cAAAA,KAA4B9R,GAE/C,OAAIkM,EAEOn/B,WAAWm/B,EAAW,SAGT93D,IAAjB2mF,EAA6BA,EAAe,CACvD","sources":["../node_modules/@mui/icons-material/esm/Attachment.js","../node_modules/@mui/icons-material/esm/AutoAwesomeOutlined.js","../node_modules/@mui/icons-material/esm/CancelScheduleSend.js","../node_modules/@mui/icons-material/esm/ChevronLeft.js","../node_modules/@mui/icons-material/esm/ChevronRight.js","../node_modules/@mui/icons-material/esm/Code.js","../node_modules/@mui/icons-material/esm/CommentOutlined.js","../node_modules/@mui/icons-material/esm/DeleteForeverOutlined.js","../node_modules/@mui/icons-material/esm/EditOffOutlined.js","../node_modules/@mui/icons-material/esm/FileCopyOutlined.js","../node_modules/@mui/icons-material/esm/FitScreenOutlined.js","../node_modules/@mui/icons-material/esm/FormatQuote.js","../node_modules/@mui/icons-material/esm/LockOpen.js","../node_modules/@mui/icons-material/esm/MoreHoriz.js","../node_modules/@mui/icons-material/esm/Notes.js","../node_modules/@mui/icons-material/esm/PeopleOutline.js","../node_modules/@mui/icons-material/esm/PersonAddOutlined.js","../node_modules/@mui/icons-material/esm/PersonOutline.js","../node_modules/@mui/icons-material/esm/PhotoOutlined.js","../node_modules/@mui/icons-material/esm/Redo.js","../node_modules/@mui/icons-material/esm/Remove.js","../node_modules/@mui/icons-material/esm/RemoveCircleOutline.js","../node_modules/@mui/icons-material/esm/Replay.js","../node_modules/@mui/icons-material/esm/StarOutlineRounded.js","../node_modules/@mui/icons-material/esm/StarRounded.js","../node_modules/@mui/icons-material/esm/TextFieldsOutlined.js","../node_modules/@mui/icons-material/esm/Undo.js","../node_modules/@mui/material/AccordionDetails/accordionDetailsClasses.js","../node_modules/@mui/material/AccordionDetails/AccordionDetails.js","../node_modules/@mui/material/AccordionSummary/accordionSummaryClasses.js","../node_modules/@mui/material/AccordionSummary/AccordionSummary.js","../node_modules/@mui/material/Accordion/accordionClasses.js","../node_modules/@mui/material/Accordion/Accordion.js","../node_modules/@mui/material/Accordion/AccordionContext.js","../node_modules/@mui/material/FormGroup/formGroupClasses.js","../node_modules/@mui/material/FormGroup/FormGroup.js","../node_modules/@mui/styles/withStyles/withStyles.js","../node_modules/@mui/styles/getThemeProps/getThemeProps.js","../node_modules/deepmerge/dist/cjs.js","../node_modules/earcut/src/earcut.js","../node_modules/emoji-regex/index.js","../node_modules/eventemitter3/index.js","../node_modules/exenv/index.js","../node_modules/fast-deep-equal/index.js","../node_modules/pixi-viewport/src/plugins/Plugin.ts","../node_modules/pixi-viewport/node_modules/penner/penner.js","../node_modules/pixi-viewport/src/ease.ts","../node_modules/pixi-viewport/src/plugins/Animate.ts","../node_modules/pixi-viewport/src/plugins/Bounce.ts","../node_modules/pixi-viewport/src/plugins/Clamp.ts","../node_modules/pixi-viewport/src/plugins/ClampZoom.ts","../node_modules/pixi-viewport/src/plugins/Decelerate.ts","../node_modules/pixi-viewport/src/plugins/Drag.ts","../node_modules/pixi-viewport/src/plugins/Follow.ts","../node_modules/pixi-viewport/src/plugins/MouseEdges.ts","../node_modules/pixi-viewport/src/plugins/Pinch.ts","../node_modules/pixi-viewport/src/plugins/Snap.ts","../node_modules/pixi-viewport/src/plugins/SnapZoom.ts","../node_modules/pixi-viewport/src/plugins/Wheel.ts","../node_modules/pixi-viewport/src/InputManager.ts","../node_modules/pixi-viewport/src/PluginManager.ts","../node_modules/pixi-viewport/src/Viewport.ts","../node_modules/querystring/decode.js","../node_modules/querystring/encode.js","../node_modules/querystring/index.js","../node_modules/react-colorful/src/hooks/useEventCallback.ts","../node_modules/react-colorful/src/utils/clamp.ts","../node_modules/react-colorful/src/components/common/Interactive.tsx","../node_modules/react-colorful/src/utils/format.ts","../node_modules/react-colorful/src/components/common/Pointer.tsx","../node_modules/react-colorful/src/utils/round.ts","../node_modules/react-colorful/src/utils/convert.ts","../node_modules/react-colorful/src/components/common/Hue.tsx","../node_modules/react-colorful/src/components/common/Saturation.tsx","../node_modules/react-colorful/src/utils/compare.ts","../node_modules/react-colorful/src/hooks/useColorManipulation.ts","../node_modules/react-colorful/src/utils/nonce.ts","../node_modules/react-colorful/src/hooks/useIsomorphicLayoutEffect.ts","../node_modules/react-colorful/src/hooks/useStyleSheet.ts","../node_modules/react-colorful/src/components/common/ColorPicker.tsx","../node_modules/react-colorful/src/components/HexColorPicker.tsx","../node_modules/react-colorful/src/utils/validate.ts","../node_modules/react-colorful/src/components/common/ColorInput.tsx","../node_modules/react-colorful/src/components/HexColorInput.tsx","../node_modules/is-lite/src/index.ts","../node_modules/tree-changes/src/helpers.ts","../node_modules/tree-changes/src/index.ts","../node_modules/popper.js/src/utils/isBrowser.js","../node_modules/popper.js/src/utils/debounce.js","../node_modules/popper.js/src/utils/isFunction.js","../node_modules/popper.js/src/utils/getStyleComputedProperty.js","../node_modules/popper.js/src/utils/getParentNode.js","../node_modules/popper.js/src/utils/getScrollParent.js","../node_modules/popper.js/src/utils/getReferenceNode.js","../node_modules/popper.js/src/utils/isIE.js","../node_modules/popper.js/src/utils/getOffsetParent.js","../node_modules/popper.js/src/utils/getRoot.js","../node_modules/popper.js/src/utils/findCommonOffsetParent.js","../node_modules/popper.js/src/utils/isOffsetContainer.js","../node_modules/popper.js/src/utils/getScroll.js","../node_modules/popper.js/src/utils/getBordersSize.js","../node_modules/popper.js/src/utils/getWindowSizes.js","../node_modules/popper.js/src/utils/getClientRect.js","../node_modules/popper.js/src/utils/getBoundingClientRect.js","../node_modules/popper.js/src/utils/getOffsetRectRelativeToArbitraryNode.js","../node_modules/popper.js/src/utils/includeScroll.js","../node_modules/popper.js/src/utils/isFixed.js","../node_modules/popper.js/src/utils/getFixedPositionOffsetParent.js","../node_modules/popper.js/src/utils/getBoundaries.js","../node_modules/popper.js/src/utils/getViewportOffsetRectRelativeToArtbitraryNode.js","../node_modules/popper.js/src/utils/computeAutoPlacement.js","../node_modules/popper.js/src/utils/getReferenceOffsets.js","../node_modules/popper.js/src/utils/getOuterSizes.js","../node_modules/popper.js/src/utils/getOppositePlacement.js","../node_modules/popper.js/src/utils/getPopperOffsets.js","../node_modules/popper.js/src/utils/find.js","../node_modules/popper.js/src/utils/runModifiers.js","../node_modules/popper.js/src/utils/findIndex.js","../node_modules/popper.js/src/methods/update.js","../node_modules/popper.js/src/utils/isModifierEnabled.js","../node_modules/popper.js/src/utils/getSupportedPropertyName.js","../node_modules/popper.js/src/methods/destroy.js","../node_modules/popper.js/src/utils/getWindow.js","../node_modules/popper.js/src/utils/setupEventListeners.js","../node_modules/popper.js/src/methods/enableEventListeners.js","../node_modules/popper.js/src/methods/disableEventListeners.js","../node_modules/popper.js/src/utils/removeEventListeners.js","../node_modules/popper.js/src/utils/isNumeric.js","../node_modules/popper.js/src/utils/setStyles.js","../node_modules/popper.js/src/modifiers/computeStyle.js","../node_modules/popper.js/src/utils/isModifierRequired.js","../node_modules/popper.js/src/methods/placements.js","../node_modules/popper.js/src/utils/clockwise.js","../node_modules/popper.js/src/modifiers/flip.js","../node_modules/popper.js/src/modifiers/offset.js","../node_modules/popper.js/src/modifiers/index.js","../node_modules/popper.js/src/modifiers/shift.js","../node_modules/popper.js/src/modifiers/preventOverflow.js","../node_modules/popper.js/src/modifiers/keepTogether.js","../node_modules/popper.js/src/modifiers/arrow.js","../node_modules/popper.js/src/utils/getOppositeVariation.js","../node_modules/popper.js/src/modifiers/inner.js","../node_modules/popper.js/src/modifiers/hide.js","../node_modules/popper.js/src/utils/getRoundedOffsets.js","../node_modules/popper.js/src/modifiers/applyStyle.js","../node_modules/popper.js/src/utils/setAttributes.js","../node_modules/popper.js/src/methods/defaults.js","../node_modules/popper.js/src/index.js","../node_modules/@gilbarbara/deep-equal/src/helpers.ts","../node_modules/@gilbarbara/deep-equal/src/index.ts","../node_modules/react-floater/node_modules/tree-changes/src/helpers.ts","../node_modules/react-floater/es/index.js","../node_modules/react-floater/node_modules/tree-changes/src/index.ts","../node_modules/react-joyride/es/index.js","../node_modules/react-joyride/node_modules/react-is/cjs/react-is.production.min.js","../node_modules/react-joyride/node_modules/react-is/index.js","../node_modules/react-proptype-conditional-require/isRequiredIf.js","../node_modules/scroll/index.js","../node_modules/scrollparent/scrollparent.js","../node_modules/url/node_modules/punycode/punycode.js","../node_modules/url/url.js","../node_modules/url/util.js","../node_modules/@pixi/canvas-display/src/Container.ts","../node_modules/@pixi/canvas-display/src/DisplayObject.ts","../node_modules/@pixi/canvas-graphics/src/Graphics.ts","../node_modules/@pixi/canvas-graphics/src/utils/PolygonUtils.ts","../node_modules/@pixi/canvas-graphics/src/CanvasGraphicsRenderer.ts","../node_modules/node_modules/tslib/tslib.es6.js","../node_modules/@pixi/canvas-renderer/src/utils/CanvasMaskManager.ts","../node_modules/@pixi/canvas-renderer/src/utils/canUseNewCanvasBlendModes.ts","../node_modules/@pixi/canvas-renderer/src/CanvasRenderer.ts","../node_modules/@pixi/canvas-renderer/src/utils/mapCanvasBlendModesToPixi.ts","../node_modules/@pixi/canvas-renderer/src/canvasUtils.ts","../node_modules/@pixi/canvas-renderer/src/Renderer.ts","../node_modules/@pixi/canvas-renderer/src/BaseTexture.ts","../node_modules/@pixi/canvas-sprite/src/CanvasSpriteRenderer.ts","../node_modules/@pixi/canvas-sprite/src/Sprite.ts","../node_modules/@pixi/constants/src/index.ts","../node_modules/@pixi/runner/src/Runner.ts","../node_modules/@pixi/core/src/settings.ts","../node_modules/@pixi/core/src/textures/resources/autoDetectResource.ts","../node_modules/@pixi/core/src/textures/resources/Resource.ts","../node_modules/@pixi/core/src/textures/resources/BufferResource.ts","../node_modules/@pixi/core/src/textures/BaseTexture.ts","../node_modules/@pixi/core/src/textures/resources/AbstractMultiResource.ts","../node_modules/@pixi/core/src/textures/resources/ArrayResource.ts","../node_modules/@pixi/core/src/textures/resources/BaseImageResource.ts","../node_modules/@pixi/core/src/textures/resources/CanvasResource.ts","../node_modules/@pixi/core/src/textures/resources/CubeResource.ts","../node_modules/@pixi/core/src/textures/resources/ImageResource.ts","../node_modules/@pixi/core/src/textures/resources/SVGResource.ts","../node_modules/@pixi/core/src/textures/resources/VideoResource.ts","../node_modules/@pixi/core/src/textures/resources/ImageBitmapResource.ts","../node_modules/@pixi/core/src/textures/resources/index.ts","../node_modules/@pixi/core/src/textures/resources/DepthResource.ts","../node_modules/@pixi/core/src/framebuffer/Framebuffer.ts","../node_modules/@pixi/core/src/renderTexture/BaseRenderTexture.ts","../node_modules/@pixi/core/src/textures/TextureUvs.ts","../node_modules/@pixi/core/src/textures/Texture.ts","../node_modules/@pixi/core/src/renderTexture/RenderTexture.ts","../node_modules/@pixi/core/src/renderTexture/RenderTexturePool.ts","../node_modules/@pixi/core/src/geometry/Attribute.ts","../node_modules/@pixi/core/src/geometry/Buffer.ts","../node_modules/@pixi/core/src/geometry/utils/interleaveTypedArrays.ts","../node_modules/@pixi/core/src/geometry/Geometry.ts","../node_modules/@pixi/core/src/utils/Quad.ts","../node_modules/@pixi/core/src/utils/QuadUv.ts","../node_modules/@pixi/core/src/shader/UniformGroup.ts","../node_modules/@pixi/core/src/filters/FilterState.ts","../node_modules/@pixi/core/src/filters/FilterSystem.ts","../node_modules/@pixi/core/src/batch/ObjectRenderer.ts","../node_modules/@pixi/core/src/batch/BatchSystem.ts","../node_modules/@pixi/core/src/context/ContextSystem.ts","../node_modules/@pixi/core/src/framebuffer/GLFramebuffer.ts","../node_modules/@pixi/core/src/framebuffer/FramebufferSystem.ts","../node_modules/@pixi/core/src/geometry/GeometrySystem.ts","../node_modules/@pixi/core/src/mask/MaskData.ts","../node_modules/@pixi/core/src/shader/utils/compileShader.ts","../node_modules/@pixi/core/src/shader/utils/logProgramError.ts","../node_modules/@pixi/core/src/shader/utils/defaultValue.ts","../node_modules/@pixi/core/src/shader/utils/getTestContext.ts","../node_modules/@pixi/core/src/shader/utils/getMaxFragmentPrecision.ts","../node_modules/@pixi/core/src/shader/utils/setPrecision.ts","../node_modules/@pixi/core/src/shader/utils/mapSize.ts","../node_modules/@pixi/core/src/shader/utils/mapType.ts","../node_modules/@pixi/core/src/shader/utils/uniformParsers.ts","../node_modules/@pixi/core/src/shader/utils/generateUniformsSync.ts","../node_modules/@pixi/core/src/shader/utils/checkMaxIfStatementsInShader.ts","../node_modules/@pixi/core/src/shader/utils/unsafeEvalSupported.ts","../node_modules/@pixi/core/src/shader/Program.ts","../node_modules/@pixi/core/src/shader/Shader.ts","../node_modules/@pixi/core/src/state/State.ts","../node_modules/@pixi/core/src/filters/Filter.ts","../node_modules/@pixi/core/src/textures/TextureMatrix.ts","../node_modules/@pixi/core/src/filters/spriteMask/SpriteMaskFilter.ts","../node_modules/@pixi/core/src/mask/MaskSystem.ts","../node_modules/@pixi/core/src/mask/AbstractMaskSystem.ts","../node_modules/@pixi/core/src/mask/ScissorSystem.ts","../node_modules/@pixi/core/src/mask/StencilSystem.ts","../node_modules/@pixi/core/src/projection/ProjectionSystem.ts","../node_modules/@pixi/core/src/renderTexture/RenderTextureSystem.ts","../node_modules/@pixi/core/src/shader/utils/generateUniformBufferSync.ts","../node_modules/@pixi/core/src/shader/GLProgram.ts","../node_modules/@pixi/core/src/shader/utils/generateProgram.ts","../node_modules/@pixi/core/src/shader/utils/getAttributeData.ts","../node_modules/@pixi/core/src/shader/utils/getUniformData.ts","../node_modules/@pixi/core/src/shader/ShaderSystem.ts","../node_modules/@pixi/core/src/state/StateSystem.ts","../node_modules/@pixi/core/src/state/utils/mapWebGLBlendModesToPixi.ts","../node_modules/@pixi/core/src/textures/TextureGCSystem.ts","../node_modules/@pixi/core/src/textures/GLTexture.ts","../node_modules/@pixi/core/src/textures/TextureSystem.ts","../node_modules/@pixi/core/src/textures/utils/mapTypeAndFormatToInternalFormat.ts","../node_modules/@pixi/core/src/AbstractRenderer.ts","../node_modules/@pixi/core/src/geometry/GLBuffer.ts","../node_modules/@pixi/core/src/geometry/BufferSystem.ts","../node_modules/@pixi/core/src/Renderer.ts","../node_modules/@pixi/core/src/autoDetectRenderer.ts","../node_modules/@pixi/core/src/ISystem.ts","../node_modules/@pixi/core/src/batch/BatchDrawCall.ts","../node_modules/@pixi/core/src/batch/BatchTextureArray.ts","../node_modules/@pixi/core/src/geometry/ViewableBuffer.ts","../node_modules/@pixi/core/src/batch/AbstractBatchRenderer.ts","../node_modules/@pixi/core/src/batch/BatchShaderGenerator.ts","../node_modules/@pixi/core/src/batch/BatchGeometry.ts","../node_modules/@pixi/core/src/batch/BatchPluginFactory.ts","../node_modules/@pixi/core/src/deprecations.ts","../node_modules/@pixi/display/src/settings.ts","../node_modules/@pixi/display/src/Bounds.ts","../node_modules/@pixi/display/src/DisplayObject.ts","../node_modules/@pixi/constants/dist/esm/constants.mjs","../node_modules/@pixi/display/src/Container.ts","../node_modules/@pixi/extensions/src/index.ts","../node_modules/@pixi/graphics/src/const.ts","../node_modules/@pixi/graphics/src/styles/FillStyle.ts","../node_modules/@pixi/graphics/src/utils/buildPoly.ts","../node_modules/@pixi/graphics/src/utils/buildCircle.ts","../node_modules/@pixi/graphics/src/utils/buildRectangle.ts","../node_modules/@pixi/graphics/src/utils/buildRoundedRectangle.ts","../node_modules/@pixi/graphics/src/utils/buildLine.ts","../node_modules/@pixi/graphics/src/utils/ArcUtils.ts","../node_modules/@pixi/graphics/src/utils/BezierUtils.ts","../node_modules/@pixi/graphics/src/utils/QuadraticUtils.ts","../node_modules/@pixi/graphics/src/utils/BatchPart.ts","../node_modules/@pixi/graphics/src/utils/index.ts","../node_modules/@pixi/graphics/src/GraphicsData.ts","../node_modules/@pixi/graphics/src/GraphicsGeometry.ts","../node_modules/@pixi/graphics/src/styles/LineStyle.ts","../node_modules/@pixi/graphics/src/Graphics.ts","../node_modules/@pixi/interaction/src/InteractionData.ts","../node_modules/@pixi/interaction/src/InteractionEvent.ts","../node_modules/@pixi/interaction/src/InteractionTrackingData.ts","../node_modules/@pixi/interaction/src/TreeSearch.ts","../node_modules/@pixi/interaction/src/interactiveTarget.ts","../node_modules/@pixi/interaction/src/InteractionManager.ts","../node_modules/@pixi/math/src/const.ts","../node_modules/@pixi/math/src/Point.ts","../node_modules/@pixi/math/src/shapes/Rectangle.ts","../node_modules/@pixi/math/src/shapes/Circle.ts","../node_modules/@pixi/math/src/shapes/Ellipse.ts","../node_modules/@pixi/math/src/shapes/Polygon.ts","../node_modules/@pixi/math/src/shapes/RoundedRectangle.ts","../node_modules/@pixi/math/src/ObservablePoint.ts","../node_modules/@pixi/math/src/Matrix.ts","../node_modules/@pixi/math/src/groupD8.ts","../node_modules/@pixi/math/src/Transform.ts","../node_modules/@pixi/settings/src/adapter.ts","../node_modules/node_modules/ismobilejs/esm/isMobile.js","../node_modules/@pixi/settings/src/utils/isMobile.ts","../node_modules/@pixi/settings/src/settings.ts","../node_modules/@pixi/settings/src/utils/maxRecommendedTextures.ts","../node_modules/@pixi/settings/src/utils/canUploadSameBuffer.ts","../node_modules/@pixi/sprite/src/Sprite.ts","../node_modules/@pixi/text/src/const.ts","../node_modules/@pixi/text/src/TextStyle.ts","../node_modules/@pixi/text/src/TextMetrics.ts","../node_modules/@pixi/text/src/Text.ts","../node_modules/@pixi/ticker/src/const.ts","../node_modules/@pixi/ticker/src/settings.ts","../node_modules/@pixi/ticker/src/TickerListener.ts","../node_modules/@pixi/ticker/src/Ticker.ts","../node_modules/@pixi/ticker/src/TickerPlugin.ts","../node_modules/@pixi/utils/src/url.ts","../node_modules/@pixi/utils/src/settings.ts","../node_modules/@pixi/utils/src/browser/hello.ts","../node_modules/@pixi/utils/src/browser/isWebGLSupported.ts","../node_modules/@pixi/utils/src/color/hex.ts","../node_modules/@pixi/utils/src/color/premultiply.ts","../node_modules/@pixi/utils/src/data/getBufferType.ts","../node_modules/@pixi/utils/src/data/interleaveTypedArrays.ts","../node_modules/@pixi/utils/src/data/pow2.ts","../node_modules/@pixi/utils/src/data/removeItems.ts","../node_modules/@pixi/utils/src/data/sign.ts","../node_modules/@pixi/utils/src/data/uid.ts","../node_modules/@pixi/utils/src/logging/deprecation.ts","../node_modules/@pixi/utils/src/media/caches.ts","../node_modules/@pixi/utils/src/media/CanvasRenderTarget.ts","../node_modules/@pixi/utils/src/media/trimCanvas.ts","../node_modules/@pixi/utils/src/const.ts","../node_modules/@pixi/utils/src/network/determineCrossOrigin.ts","../node_modules/@pixi/utils/src/network/getResolutionOfUrl.ts"],"sourcesContent":["import createSvgIcon from './utils/createSvgIcon';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M2 12.5C2 9.46 4.46 7 7.5 7H18c2.21 0 4 1.79 4 4s-1.79 4-4 4H9.5C8.12 15 7 13.88 7 12.5S8.12 10 9.5 10H17v2H9.41c-.55 0-.55 1 0 1H18c1.1 0 2-.9 2-2s-.9-2-2-2H7.5C5.57 9 4 10.57 4 12.5S5.57 16 7.5 16H17v2H7.5C4.46 18 2 15.54 2 12.5z\"\n}), 'Attachment');","import createSvgIcon from './utils/createSvgIcon';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"m19 9 1.25-2.75L23 5l-2.75-1.25L19 1l-1.25 2.75L15 5l2.75 1.25zm0 6-1.25 2.75L15 19l2.75 1.25L19 23l1.25-2.75L23 19l-2.75-1.25zm-7.5-5.5L9 4 6.5 9.5 1 12l5.5 2.5L9 20l2.5-5.5L17 12l-5.5-2.5zm-1.51 3.49L9 15.17l-.99-2.18L5.83 12l2.18-.99L9 8.83l.99 2.18 2.18.99-2.18.99z\"\n}), 'AutoAwesomeOutlined');","import createSvgIcon from './utils/createSvgIcon';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon([/*#__PURE__*/_jsx(\"path\", {\n d: \"M16.5 9c-.42 0-.83.04-1.24.11L1.01 3 1 10l9 2-9 2 .01 7 8.07-3.46C9.59 21.19 12.71 24 16.5 24c4.14 0 7.5-3.36 7.5-7.5S20.64 9 16.5 9zm0 13c-3.03 0-5.5-2.47-5.5-5.5s2.47-5.5 5.5-5.5 5.5 2.47 5.5 5.5-2.47 5.5-5.5 5.5z\"\n}, \"0\"), /*#__PURE__*/_jsx(\"path\", {\n d: \"m18.27 14.03-1.77 1.76-1.77-1.76-.7.7 1.76 1.77-1.76 1.77.7.7 1.77-1.76 1.77 1.76.7-.7-1.76-1.77 1.76-1.77z\"\n}, \"1\")], 'CancelScheduleSend');","import createSvgIcon from './utils/createSvgIcon';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z\"\n}), 'ChevronLeft');","import createSvgIcon from './utils/createSvgIcon';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\"\n}), 'ChevronRight');","import createSvgIcon from './utils/createSvgIcon';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z\"\n}), 'Code');","import createSvgIcon from './utils/createSvgIcon';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M21.99 4c0-1.1-.89-2-1.99-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14l4 4-.01-18zM20 4v13.17L18.83 16H4V4h16zM6 12h12v2H6zm0-3h12v2H6zm0-3h12v2H6z\"\n}), 'CommentOutlined');","import createSvgIcon from './utils/createSvgIcon';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M14.12 10.47 12 12.59l-2.13-2.12-1.41 1.41L10.59 14l-2.12 2.12 1.41 1.41L12 15.41l2.12 2.12 1.41-1.41L13.41 14l2.12-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4zM6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM8 9h8v10H8V9z\"\n}), 'DeleteForeverOutlined');","import createSvgIcon from './utils/createSvgIcon';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"m14.06 9.02.92.92-1.11 1.11 1.41 1.41 2.52-2.52-3.75-3.75-2.52 2.52 1.41 1.41 1.12-1.1zm6.65-1.98c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29s-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83zM2.81 2.81 1.39 4.22l7.32 7.32L3 17.25V21h3.75l5.71-5.71 7.32 7.32 1.41-1.41L2.81 2.81zM5.92 19H5v-.92l5.13-5.13.92.92L5.92 19z\"\n}), 'EditOffOutlined');","import createSvgIcon from './utils/createSvgIcon';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4H8c-1.1 0-1.99.9-1.99 2L6 21c0 1.1.89 2 1.99 2H19c1.1 0 2-.9 2-2V11l-6-6zM8 21V7h6v5h5v9H8z\"\n}), 'FileCopyOutlined');","import createSvgIcon from './utils/createSvgIcon';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M6 16h12V8H6v8zm2-6h8v4H8v-4zm-4 5H2v3c0 1.1.9 2 2 2h3v-2H4v-3zm0-9h3V4H4c-1.1 0-2 .9-2 2v3h2V6zm16-2h-3v2h3v3h2V6c0-1.1-.9-2-2-2zm0 14h-3v2h3c1.1 0 2-.9 2-2v-3h-2v3z\"\n}), 'FitScreenOutlined');","import createSvgIcon from './utils/createSvgIcon';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z\"\n}), 'FormatQuote');","import createSvgIcon from './utils/createSvgIcon';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M12 17c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm6-9h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6h1.9c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm0 12H6V10h12v10z\"\n}), 'LockOpen');","import createSvgIcon from './utils/createSvgIcon';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z\"\n}), 'MoreHoriz');","import createSvgIcon from './utils/createSvgIcon';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M3 18h12v-2H3v2zM3 6v2h18V6H3zm0 7h18v-2H3v2z\"\n}), 'Notes');","import createSvgIcon from './utils/createSvgIcon';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M16.5 13c-1.2 0-3.07.34-4.5 1-1.43-.67-3.3-1-4.5-1C5.33 13 1 14.08 1 16.25V19h22v-2.75c0-2.17-4.33-3.25-6.5-3.25zm-4 4.5h-10v-1.25c0-.54 2.56-1.75 5-1.75s5 1.21 5 1.75v1.25zm9 0H14v-1.25c0-.46-.2-.86-.52-1.22.88-.3 1.96-.53 3.02-.53 2.44 0 5 1.21 5 1.75v1.25zM7.5 12c1.93 0 3.5-1.57 3.5-3.5S9.43 5 7.5 5 4 6.57 4 8.5 5.57 12 7.5 12zm0-5.5c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm9 5.5c1.93 0 3.5-1.57 3.5-3.5S18.43 5 16.5 5 13 6.57 13 8.5s1.57 3.5 3.5 3.5zm0-5.5c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2z\"\n}), 'PeopleOutline');","import createSvgIcon from './utils/createSvgIcon';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M15 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0-6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm0 8c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4zm-6 4c.22-.72 3.31-2 6-2 2.7 0 5.8 1.29 6 2H9zm-3-3v-3h3v-2H6V7H4v3H1v2h3v3z\"\n}), 'PersonAddOutlined');","import createSvgIcon from './utils/createSvgIcon';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M12 5.9c1.16 0 2.1.94 2.1 2.1s-.94 2.1-2.1 2.1S9.9 9.16 9.9 8s.94-2.1 2.1-2.1m0 9c2.97 0 6.1 1.46 6.1 2.1v1.1H5.9V17c0-.64 3.13-2.1 6.1-2.1M12 4C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 9c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4z\"\n}), 'PersonOutline');","import createSvgIcon from './utils/createSvgIcon';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86-3 3.87L9 13.14 6 17h12l-3.86-5.14z\"\n}), 'PhotoOutlined');","import createSvgIcon from './utils/createSvgIcon';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z\"\n}), 'Redo');","import createSvgIcon from './utils/createSvgIcon';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M19 13H5v-2h14v2z\"\n}), 'Remove');","import createSvgIcon from './utils/createSvgIcon';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M7 11v2h10v-2H7zm5-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z\"\n}), 'RemoveCircleOutline');","import createSvgIcon from './utils/createSvgIcon';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z\"\n}), 'Replay');","import createSvgIcon from './utils/createSvgIcon';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"m19.65 9.04-4.84-.42-1.89-4.45c-.34-.81-1.5-.81-1.84 0L9.19 8.63l-4.83.41c-.88.07-1.24 1.17-.57 1.75l3.67 3.18-1.1 4.72c-.2.86.73 1.54 1.49 1.08l4.15-2.5 4.15 2.51c.76.46 1.69-.22 1.49-1.08l-1.1-4.73 3.67-3.18c.67-.58.32-1.68-.56-1.75zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z\"\n}), 'StarOutlineRounded');","import createSvgIcon from './utils/createSvgIcon';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"m12 17.27 4.15 2.51c.76.46 1.69-.22 1.49-1.08l-1.1-4.72 3.67-3.18c.67-.58.31-1.68-.57-1.75l-4.83-.41-1.89-4.46c-.34-.81-1.5-.81-1.84 0L9.19 8.63l-4.83.41c-.88.07-1.24 1.17-.57 1.75l3.67 3.18-1.1 4.72c-.2.86.73 1.54 1.49 1.08l4.15-2.5z\"\n}), 'StarRounded');","import createSvgIcon from './utils/createSvgIcon';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M2.5 4v3h5v12h3V7h5V4h-13zm19 5h-9v3h3v7h3v-7h3V9z\"\n}), 'TextFieldsOutlined');","import createSvgIcon from './utils/createSvgIcon';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z\"\n}), 'Undo');","import { generateUtilityClass, generateUtilityClasses } from '@mui/core';\nexport function getAccordionDetailsUtilityClass(slot) {\n return generateUtilityClass('MuiAccordionDetails', slot);\n}\nconst accordionDetailsClasses = generateUtilityClasses('MuiAccordionDetails', ['root']);\nexport default accordionDetailsClasses;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"className\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { unstable_composeClasses as composeClasses } from '@mui/core';\nimport styled from '../styles/styled';\nimport useThemeProps from '../styles/useThemeProps';\nimport { getAccordionDetailsUtilityClass } from './accordionDetailsClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['root']\n };\n return composeClasses(slots, getAccordionDetailsUtilityClass, classes);\n};\n\nconst AccordionDetailsRoot = styled('div', {\n name: 'MuiAccordionDetails',\n slot: 'Root',\n overridesResolver: (props, styles) => styles.root\n})(({\n theme\n}) => ({\n padding: theme.spacing(1, 2, 2)\n}));\nconst AccordionDetails = /*#__PURE__*/React.forwardRef(function AccordionDetails(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiAccordionDetails'\n });\n\n const {\n className\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n const ownerState = props;\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsx(AccordionDetailsRoot, _extends({\n className: clsx(classes.root, className),\n ref: ref,\n ownerState: ownerState\n }, other));\n});\nprocess.env.NODE_ENV !== \"production\" ? AccordionDetails.propTypes\n/* remove-proptypes */\n= {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n\n /**\n * @ignore\n */\n className: PropTypes.string,\n\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object])), PropTypes.func, PropTypes.object])\n} : void 0;\nexport default AccordionDetails;","import { generateUtilityClass, generateUtilityClasses } from '@mui/core';\nexport function getAccordionSummaryUtilityClass(slot) {\n return generateUtilityClass('MuiAccordionSummary', slot);\n}\nconst accordionSummaryClasses = generateUtilityClasses('MuiAccordionSummary', ['root', 'expanded', 'focusVisible', 'disabled', 'gutters', 'contentGutters', 'content', 'expandIconWrapper']);\nexport default accordionSummaryClasses;","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"children\", \"className\", \"expandIcon\", \"focusVisibleClassName\", \"onClick\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { unstable_composeClasses as composeClasses } from '@mui/core';\nimport styled from '../styles/styled';\nimport useThemeProps from '../styles/useThemeProps';\nimport ButtonBase from '../ButtonBase';\nimport AccordionContext from '../Accordion/AccordionContext';\nimport accordionSummaryClasses, { getAccordionSummaryUtilityClass } from './accordionSummaryClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\n\nconst useUtilityClasses = ownerState => {\n const {\n classes,\n expanded,\n disabled,\n disableGutters\n } = ownerState;\n const slots = {\n root: ['root', expanded && 'expanded', disabled && 'disabled', !disableGutters && 'gutters'],\n focusVisible: ['focusVisible'],\n content: ['content', expanded && 'expanded', !disableGutters && 'contentGutters'],\n expandIconWrapper: ['expandIconWrapper', expanded && 'expanded']\n };\n return composeClasses(slots, getAccordionSummaryUtilityClass, classes);\n};\n\nconst AccordionSummaryRoot = styled(ButtonBase, {\n name: 'MuiAccordionSummary',\n slot: 'Root',\n overridesResolver: (props, styles) => styles.root\n})(({\n theme,\n ownerState\n}) => {\n const transition = {\n duration: theme.transitions.duration.shortest\n };\n return _extends({\n display: 'flex',\n minHeight: 48,\n padding: theme.spacing(0, 2),\n transition: theme.transitions.create(['min-height', 'background-color'], transition),\n [`&.${accordionSummaryClasses.focusVisible}`]: {\n backgroundColor: theme.palette.action.focus\n },\n [`&.${accordionSummaryClasses.disabled}`]: {\n opacity: theme.palette.action.disabledOpacity\n },\n [`&:hover:not(.${accordionSummaryClasses.disabled})`]: {\n cursor: 'pointer'\n }\n }, !ownerState.disableGutters && {\n [`&.${accordionSummaryClasses.expanded}`]: {\n minHeight: 64\n }\n });\n});\nconst AccordionSummaryContent = styled('div', {\n name: 'MuiAccordionSummary',\n slot: 'Content',\n overridesResolver: (props, styles) => styles.content\n})(({\n theme,\n ownerState\n}) => _extends({\n display: 'flex',\n flexGrow: 1,\n margin: '12px 0'\n}, !ownerState.disableGutters && {\n transition: theme.transitions.create(['margin'], {\n duration: theme.transitions.duration.shortest\n }),\n [`&.${accordionSummaryClasses.expanded}`]: {\n margin: '20px 0'\n }\n}));\nconst AccordionSummaryExpandIconWrapper = styled('div', {\n name: 'MuiAccordionSummary',\n slot: 'ExpandIconWrapper',\n overridesResolver: (props, styles) => styles.expandIconWrapper\n})(({\n theme\n}) => ({\n display: 'flex',\n color: theme.palette.action.active,\n transform: 'rotate(0deg)',\n transition: theme.transitions.create('transform', {\n duration: theme.transitions.duration.shortest\n }),\n [`&.${accordionSummaryClasses.expanded}`]: {\n transform: 'rotate(180deg)'\n }\n}));\nconst AccordionSummary = /*#__PURE__*/React.forwardRef(function AccordionSummary(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiAccordionSummary'\n });\n\n const {\n children,\n className,\n expandIcon,\n focusVisibleClassName,\n onClick\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n const {\n disabled = false,\n disableGutters,\n expanded,\n toggle\n } = React.useContext(AccordionContext);\n\n const handleChange = event => {\n if (toggle) {\n toggle(event);\n }\n\n if (onClick) {\n onClick(event);\n }\n };\n\n const ownerState = _extends({}, props, {\n expanded,\n disabled,\n disableGutters\n });\n\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsxs(AccordionSummaryRoot, _extends({\n focusRipple: false,\n disableRipple: true,\n disabled: disabled,\n component: \"div\",\n \"aria-expanded\": expanded,\n className: clsx(classes.root, className),\n focusVisibleClassName: clsx(classes.focusVisible, focusVisibleClassName),\n onClick: handleChange,\n ref: ref,\n ownerState: ownerState\n }, other, {\n children: [/*#__PURE__*/_jsx(AccordionSummaryContent, {\n className: classes.content,\n ownerState: ownerState,\n children: children\n }), expandIcon && /*#__PURE__*/_jsx(AccordionSummaryExpandIconWrapper, {\n className: classes.expandIconWrapper,\n ownerState: ownerState,\n children: expandIcon\n })]\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? AccordionSummary.propTypes\n/* remove-proptypes */\n= {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n\n /**\n * @ignore\n */\n className: PropTypes.string,\n\n /**\n * The icon to display as the expand indicator.\n */\n expandIcon: PropTypes.node,\n\n /**\n * This prop can help identify which element has keyboard focus.\n * The class name will be applied when the element gains the focus through keyboard interaction.\n * It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).\n * The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/master/explainer.md).\n * A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components\n * if needed.\n */\n focusVisibleClassName: PropTypes.string,\n\n /**\n * @ignore\n */\n onClick: PropTypes.func,\n\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object])), PropTypes.func, PropTypes.object])\n} : void 0;\nexport default AccordionSummary;","import { generateUtilityClass, generateUtilityClasses } from '@mui/core';\nexport function getAccordionUtilityClass(slot) {\n return generateUtilityClass('MuiAccordion', slot);\n}\nconst accordionClasses = generateUtilityClasses('MuiAccordion', ['root', 'rounded', 'expanded', 'disabled', 'gutters', 'region']);\nexport default accordionClasses;","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"children\", \"className\", \"defaultExpanded\", \"disabled\", \"disableGutters\", \"expanded\", \"onChange\", \"square\", \"TransitionComponent\", \"TransitionProps\"];\nimport * as React from 'react';\nimport { isFragment } from 'react-is';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { chainPropTypes } from '@mui/utils';\nimport { unstable_composeClasses as composeClasses } from '@mui/core';\nimport styled from '../styles/styled';\nimport useThemeProps from '../styles/useThemeProps';\nimport Collapse from '../Collapse';\nimport Paper from '../Paper';\nimport AccordionContext from './AccordionContext';\nimport useControlled from '../utils/useControlled';\nimport accordionClasses, { getAccordionUtilityClass } from './accordionClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\n\nconst useUtilityClasses = ownerState => {\n const {\n classes,\n square,\n expanded,\n disabled,\n disableGutters\n } = ownerState;\n const slots = {\n root: ['root', !square && 'rounded', expanded && 'expanded', disabled && 'disabled', !disableGutters && 'gutters'],\n region: ['region']\n };\n return composeClasses(slots, getAccordionUtilityClass, classes);\n};\n\nconst AccordionRoot = styled(Paper, {\n name: 'MuiAccordion',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [{\n [`& .${accordionClasses.region}`]: styles.region\n }, styles.root, !ownerState.square && styles.rounded, !ownerState.disableGutters && styles.gutters];\n }\n})(({\n theme\n}) => {\n const transition = {\n duration: theme.transitions.duration.shortest\n };\n return {\n position: 'relative',\n transition: theme.transitions.create(['margin'], transition),\n overflowAnchor: 'none',\n // Keep the same scrolling position\n '&:before': {\n position: 'absolute',\n left: 0,\n top: -1,\n right: 0,\n height: 1,\n content: '\"\"',\n opacity: 1,\n backgroundColor: theme.palette.divider,\n transition: theme.transitions.create(['opacity', 'background-color'], transition)\n },\n '&:first-of-type': {\n '&:before': {\n display: 'none'\n }\n },\n [`&.${accordionClasses.expanded}`]: {\n '&:before': {\n opacity: 0\n },\n '&:first-of-type': {\n marginTop: 0\n },\n '&:last-of-type': {\n marginBottom: 0\n },\n '& + &': {\n '&:before': {\n display: 'none'\n }\n }\n },\n [`&.${accordionClasses.disabled}`]: {\n backgroundColor: theme.palette.action.disabledBackground\n }\n };\n}, ({\n theme,\n ownerState\n}) => _extends({}, !ownerState.square && {\n borderRadius: 0,\n '&:first-of-type': {\n borderTopLeftRadius: theme.shape.borderRadius,\n borderTopRightRadius: theme.shape.borderRadius\n },\n '&:last-of-type': {\n borderBottomLeftRadius: theme.shape.borderRadius,\n borderBottomRightRadius: theme.shape.borderRadius,\n // Fix a rendering issue on Edge\n '@supports (-ms-ime-align: auto)': {\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0\n }\n }\n}, !ownerState.disableGutters && {\n [`&.${accordionClasses.expanded}`]: {\n margin: '16px 0'\n }\n}));\nconst Accordion = /*#__PURE__*/React.forwardRef(function Accordion(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiAccordion'\n });\n\n const {\n children: childrenProp,\n className,\n defaultExpanded = false,\n disabled = false,\n disableGutters = false,\n expanded: expandedProp,\n onChange,\n square = false,\n TransitionComponent = Collapse,\n TransitionProps\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n const [expanded, setExpandedState] = useControlled({\n controlled: expandedProp,\n default: defaultExpanded,\n name: 'Accordion',\n state: 'expanded'\n });\n const handleChange = React.useCallback(event => {\n setExpandedState(!expanded);\n\n if (onChange) {\n onChange(event, !expanded);\n }\n }, [expanded, onChange, setExpandedState]);\n const [summary, ...children] = React.Children.toArray(childrenProp);\n const contextValue = React.useMemo(() => ({\n expanded,\n disabled,\n disableGutters,\n toggle: handleChange\n }), [expanded, disabled, disableGutters, handleChange]);\n\n const ownerState = _extends({}, props, {\n square,\n disabled,\n disableGutters,\n expanded\n });\n\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsxs(AccordionRoot, _extends({\n className: clsx(classes.root, className),\n ref: ref,\n ownerState: ownerState,\n square: square\n }, other, {\n children: [/*#__PURE__*/_jsx(AccordionContext.Provider, {\n value: contextValue,\n children: summary\n }), /*#__PURE__*/_jsx(TransitionComponent, _extends({\n in: expanded,\n timeout: \"auto\"\n }, TransitionProps, {\n children: /*#__PURE__*/_jsx(\"div\", {\n \"aria-labelledby\": summary.props.id,\n id: summary.props['aria-controls'],\n role: \"region\",\n className: classes.region,\n children: children\n })\n }))]\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? Accordion.propTypes\n/* remove-proptypes */\n= {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * The content of the component.\n */\n children: chainPropTypes(PropTypes.node.isRequired, props => {\n const summary = React.Children.toArray(props.children)[0];\n\n if (isFragment(summary)) {\n return new Error(\"MUI: The Accordion doesn't accept a Fragment as a child. \" + 'Consider providing an array instead.');\n }\n\n if (! /*#__PURE__*/React.isValidElement(summary)) {\n return new Error('MUI: Expected the first child of Accordion to be a valid element.');\n }\n\n return null;\n }),\n\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n\n /**\n * @ignore\n */\n className: PropTypes.string,\n\n /**\n * If `true`, expands the accordion by default.\n * @default false\n */\n defaultExpanded: PropTypes.bool,\n\n /**\n * If `true`, the component is disabled.\n * @default false\n */\n disabled: PropTypes.bool,\n\n /**\n * If `true`, it removes the margin between two expanded accordion items and the increase of height.\n * @default false\n */\n disableGutters: PropTypes.bool,\n\n /**\n * If `true`, expands the accordion, otherwise collapse it.\n * Setting this prop enables control over the accordion.\n */\n expanded: PropTypes.bool,\n\n /**\n * Callback fired when the expand/collapse state is changed.\n *\n * @param {React.SyntheticEvent} event The event source of the callback. **Warning**: This is a generic event not a change event.\n * @param {boolean} expanded The `expanded` state of the accordion.\n */\n onChange: PropTypes.func,\n\n /**\n * If `true`, rounded corners are disabled.\n * @default false\n */\n square: PropTypes.bool,\n\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object])), PropTypes.func, PropTypes.object]),\n\n /**\n * The component used for the transition.\n * [Follow this guide](/components/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.\n * @default Collapse\n */\n TransitionComponent: PropTypes.elementType,\n\n /**\n * Props applied to the transition element.\n * By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition) component.\n */\n TransitionProps: PropTypes.object\n} : void 0;\nexport default Accordion;","import * as React from 'react';\n/**\n * @ignore - internal component.\n * @type {React.Context<{} | {expanded: boolean, disabled: boolean, toggle: () => void}>}\n */\n\nconst AccordionContext = /*#__PURE__*/React.createContext({});\n\nif (process.env.NODE_ENV !== 'production') {\n AccordionContext.displayName = 'AccordionContext';\n}\n\nexport default AccordionContext;","import { generateUtilityClass, generateUtilityClasses } from '@mui/core';\nexport function getFormGroupUtilityClass(slot) {\n return generateUtilityClass('MuiFormGroup', slot);\n}\nconst formGroupClasses = generateUtilityClasses('MuiFormGroup', ['root', 'row']);\nexport default formGroupClasses;","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"className\", \"row\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { unstable_composeClasses as composeClasses } from '@mui/core';\nimport styled from '../styles/styled';\nimport useThemeProps from '../styles/useThemeProps';\nimport { getFormGroupUtilityClass } from './formGroupClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n\nconst useUtilityClasses = ownerState => {\n const {\n classes,\n row\n } = ownerState;\n const slots = {\n root: ['root', row && 'row']\n };\n return composeClasses(slots, getFormGroupUtilityClass, classes);\n};\n\nconst FormGroupRoot = styled('div', {\n name: 'MuiFormGroup',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, ownerState.row && styles.row];\n }\n})(({\n ownerState\n}) => _extends({\n display: 'flex',\n flexDirection: 'column',\n flexWrap: 'wrap'\n}, ownerState.row && {\n flexDirection: 'row'\n}));\n/**\n * `FormGroup` wraps controls such as `Checkbox` and `Switch`.\n * It provides compact row layout.\n * For the `Radio`, you should be using the `RadioGroup` component instead of this one.\n */\n\nconst FormGroup = /*#__PURE__*/React.forwardRef(function FormGroup(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiFormGroup'\n });\n\n const {\n className,\n row = false\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n const ownerState = _extends({}, props, {\n row\n });\n\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsx(FormGroupRoot, _extends({\n className: clsx(classes.root, className),\n ownerState: ownerState,\n ref: ref\n }, other));\n});\nprocess.env.NODE_ENV !== \"production\" ? FormGroup.propTypes\n/* remove-proptypes */\n= {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n\n /**\n * @ignore\n */\n className: PropTypes.string,\n\n /**\n * Display group of elements in a compact row.\n * @default false\n */\n row: PropTypes.bool,\n\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object])), PropTypes.func, PropTypes.object])\n} : void 0;\nexport default FormGroup;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"defaultTheme\", \"withTheme\", \"name\"],\n _excluded2 = [\"classes\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\nimport { getDisplayName } from '@mui/utils';\nimport makeStyles from '../makeStyles';\nimport getThemeProps from '../getThemeProps';\nimport useTheme from '../useTheme'; // Link a style sheet with a component.\n// It does not modify the component passed to it;\n// instead, it returns a new component, with a `classes` property.\n\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n\nconst withStyles = (stylesOrCreator, options = {}) => Component => {\n const {\n defaultTheme,\n withTheme = false,\n name\n } = options,\n stylesOptions = _objectWithoutPropertiesLoose(options, _excluded);\n\n if (process.env.NODE_ENV !== 'production') {\n if (Component === undefined) {\n throw new Error(['You are calling withStyles(styles)(Component) with an undefined component.', 'You may have forgotten to import it.'].join('\\n'));\n }\n }\n\n let classNamePrefix = name;\n\n if (process.env.NODE_ENV !== 'production') {\n if (!name) {\n // Provide a better DX outside production.\n const displayName = getDisplayName(Component);\n\n if (displayName !== undefined) {\n classNamePrefix = displayName;\n }\n }\n }\n\n const useStyles = makeStyles(stylesOrCreator, _extends({\n defaultTheme,\n Component,\n name: name || Component.displayName,\n classNamePrefix\n }, stylesOptions));\n const WithStyles = /*#__PURE__*/React.forwardRef(function WithStyles(props, ref) {\n const other = _objectWithoutPropertiesLoose(props, _excluded2); // The wrapper receives only user supplied props, which could be a subset of\n // the actual props Component might receive due to merging with defaultProps.\n // So copying it here would give us the same result in the wrapper as well.\n\n\n const classes = useStyles(_extends({}, Component.defaultProps, props));\n let theme;\n let more = other;\n\n if (typeof name === 'string' || withTheme) {\n // name and withTheme are invariant in the outer scope\n // eslint-disable-next-line react-hooks/rules-of-hooks\n theme = useTheme() || defaultTheme;\n\n if (name) {\n more = getThemeProps({\n theme,\n name,\n props: other\n });\n } // Provide the theme to the wrapped component.\n // So we don't have to use the `withTheme()` Higher-order Component.\n\n\n if (withTheme && !more.theme) {\n more.theme = theme;\n }\n }\n\n return /*#__PURE__*/_jsx(Component, _extends({\n ref: ref,\n classes: classes\n }, more));\n });\n process.env.NODE_ENV !== \"production\" ? WithStyles.propTypes = {\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object\n } : void 0;\n\n if (process.env.NODE_ENV !== 'production') {\n WithStyles.displayName = `WithStyles(${getDisplayName(Component)})`;\n }\n\n hoistNonReactStatics(WithStyles, Component);\n\n if (process.env.NODE_ENV !== 'production') {\n // Exposed for test purposes.\n WithStyles.Naked = Component;\n WithStyles.options = options;\n WithStyles.useStyles = useStyles;\n }\n\n return WithStyles;\n};\n\nexport default withStyles;","import _extends from \"@babel/runtime/helpers/esm/extends\";\n\n/* eslint-disable no-restricted-syntax */\nexport default function getThemeProps(params) {\n const {\n theme,\n name,\n props\n } = params;\n\n if (!theme || !theme.components || !theme.components[name] || !theme.components[name].defaultProps) {\n return props;\n }\n\n const output = _extends({}, props); // Resolve default props, code borrow from React source.\n // https://github.com/facebook/react/blob/15a8f031838a553e41c0b66eb1bcf1da8448104d/packages/react/src/ReactElement.js#L221\n\n\n const defaultProps = theme.components[name].defaultProps;\n let propName;\n\n for (propName in defaultProps) {\n if (output[propName] === undefined) {\n output[propName] = defaultProps[propName];\n }\n }\n\n return output;\n}","'use strict';\n\nvar isMergeableObject = function isMergeableObject(value) {\n\treturn isNonNullObject(value)\n\t\t&& !isSpecial(value)\n};\n\nfunction isNonNullObject(value) {\n\treturn !!value && typeof value === 'object'\n}\n\nfunction isSpecial(value) {\n\tvar stringValue = Object.prototype.toString.call(value);\n\n\treturn stringValue === '[object RegExp]'\n\t\t|| stringValue === '[object Date]'\n\t\t|| isReactElement(value)\n}\n\n// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25\nvar canUseSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;\n\nfunction isReactElement(value) {\n\treturn value.$$typeof === REACT_ELEMENT_TYPE\n}\n\nfunction emptyTarget(val) {\n\treturn Array.isArray(val) ? [] : {}\n}\n\nfunction cloneUnlessOtherwiseSpecified(value, options) {\n\treturn (options.clone !== false && options.isMergeableObject(value))\n\t\t? deepmerge(emptyTarget(value), value, options)\n\t\t: value\n}\n\nfunction defaultArrayMerge(target, source, options) {\n\treturn target.concat(source).map(function(element) {\n\t\treturn cloneUnlessOtherwiseSpecified(element, options)\n\t})\n}\n\nfunction getMergeFunction(key, options) {\n\tif (!options.customMerge) {\n\t\treturn deepmerge\n\t}\n\tvar customMerge = options.customMerge(key);\n\treturn typeof customMerge === 'function' ? customMerge : deepmerge\n}\n\nfunction getEnumerableOwnPropertySymbols(target) {\n\treturn Object.getOwnPropertySymbols\n\t\t? Object.getOwnPropertySymbols(target).filter(function(symbol) {\n\t\t\treturn target.propertyIsEnumerable(symbol)\n\t\t})\n\t\t: []\n}\n\nfunction getKeys(target) {\n\treturn Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))\n}\n\nfunction propertyIsOnObject(object, property) {\n\ttry {\n\t\treturn property in object\n\t} catch(_) {\n\t\treturn false\n\t}\n}\n\n// Protects from prototype poisoning and unexpected merging up the prototype chain.\nfunction propertyIsUnsafe(target, key) {\n\treturn propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,\n\t\t&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,\n\t\t\t&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.\n}\n\nfunction mergeObject(target, source, options) {\n\tvar destination = {};\n\tif (options.isMergeableObject(target)) {\n\t\tgetKeys(target).forEach(function(key) {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(target[key], options);\n\t\t});\n\t}\n\tgetKeys(source).forEach(function(key) {\n\t\tif (propertyIsUnsafe(target, key)) {\n\t\t\treturn\n\t\t}\n\n\t\tif (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {\n\t\t\tdestination[key] = getMergeFunction(key, options)(target[key], source[key], options);\n\t\t} else {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(source[key], options);\n\t\t}\n\t});\n\treturn destination\n}\n\nfunction deepmerge(target, source, options) {\n\toptions = options || {};\n\toptions.arrayMerge = options.arrayMerge || defaultArrayMerge;\n\toptions.isMergeableObject = options.isMergeableObject || isMergeableObject;\n\t// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()\n\t// implementations can use it. The caller may not replace it.\n\toptions.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;\n\n\tvar sourceIsArray = Array.isArray(source);\n\tvar targetIsArray = Array.isArray(target);\n\tvar sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;\n\n\tif (!sourceAndTargetTypesMatch) {\n\t\treturn cloneUnlessOtherwiseSpecified(source, options)\n\t} else if (sourceIsArray) {\n\t\treturn options.arrayMerge(target, source, options)\n\t} else {\n\t\treturn mergeObject(target, source, options)\n\t}\n}\n\ndeepmerge.all = function deepmergeAll(array, options) {\n\tif (!Array.isArray(array)) {\n\t\tthrow new Error('first argument should be an array')\n\t}\n\n\treturn array.reduce(function(prev, next) {\n\t\treturn deepmerge(prev, next, options)\n\t}, {})\n};\n\nvar deepmerge_1 = deepmerge;\n\nmodule.exports = deepmerge_1;\n","'use strict';\n\nmodule.exports = earcut;\nmodule.exports.default = earcut;\n\nfunction earcut(data, holeIndices, dim) {\n\n dim = dim || 2;\n\n var hasHoles = holeIndices && holeIndices.length,\n outerLen = hasHoles ? holeIndices[0] * dim : data.length,\n outerNode = linkedList(data, 0, outerLen, dim, true),\n triangles = [];\n\n if (!outerNode || outerNode.next === outerNode.prev) return triangles;\n\n var minX, minY, maxX, maxY, x, y, invSize;\n\n if (hasHoles) outerNode = eliminateHoles(data, holeIndices, outerNode, dim);\n\n // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox\n if (data.length > 80 * dim) {\n minX = maxX = data[0];\n minY = maxY = data[1];\n\n for (var i = dim; i < outerLen; i += dim) {\n x = data[i];\n y = data[i + 1];\n if (x < minX) minX = x;\n if (y < minY) minY = y;\n if (x > maxX) maxX = x;\n if (y > maxY) maxY = y;\n }\n\n // minX, minY and invSize are later used to transform coords into integers for z-order calculation\n invSize = Math.max(maxX - minX, maxY - minY);\n invSize = invSize !== 0 ? 32767 / invSize : 0;\n }\n\n earcutLinked(outerNode, triangles, dim, minX, minY, invSize, 0);\n\n return triangles;\n}\n\n// create a circular doubly linked list from polygon points in the specified winding order\nfunction linkedList(data, start, end, dim, clockwise) {\n var i, last;\n\n if (clockwise === (signedArea(data, start, end, dim) > 0)) {\n for (i = start; i < end; i += dim) last = insertNode(i, data[i], data[i + 1], last);\n } else {\n for (i = end - dim; i >= start; i -= dim) last = insertNode(i, data[i], data[i + 1], last);\n }\n\n if (last && equals(last, last.next)) {\n removeNode(last);\n last = last.next;\n }\n\n return last;\n}\n\n// eliminate colinear or duplicate points\nfunction filterPoints(start, end) {\n if (!start) return start;\n if (!end) end = start;\n\n var p = start,\n again;\n do {\n again = false;\n\n if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {\n removeNode(p);\n p = end = p.prev;\n if (p === p.next) break;\n again = true;\n\n } else {\n p = p.next;\n }\n } while (again || p !== end);\n\n return end;\n}\n\n// main ear slicing loop which triangulates a polygon (given as a linked list)\nfunction earcutLinked(ear, triangles, dim, minX, minY, invSize, pass) {\n if (!ear) return;\n\n // interlink polygon nodes in z-order\n if (!pass && invSize) indexCurve(ear, minX, minY, invSize);\n\n var stop = ear,\n prev, next;\n\n // iterate through ears, slicing them one by one\n while (ear.prev !== ear.next) {\n prev = ear.prev;\n next = ear.next;\n\n if (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) {\n // cut off the triangle\n triangles.push(prev.i / dim | 0);\n triangles.push(ear.i / dim | 0);\n triangles.push(next.i / dim | 0);\n\n removeNode(ear);\n\n // skipping the next vertex leads to less sliver triangles\n ear = next.next;\n stop = next.next;\n\n continue;\n }\n\n ear = next;\n\n // if we looped through the whole remaining polygon and can't find any more ears\n if (ear === stop) {\n // try filtering points and slicing again\n if (!pass) {\n earcutLinked(filterPoints(ear), triangles, dim, minX, minY, invSize, 1);\n\n // if this didn't work, try curing all small self-intersections locally\n } else if (pass === 1) {\n ear = cureLocalIntersections(filterPoints(ear), triangles, dim);\n earcutLinked(ear, triangles, dim, minX, minY, invSize, 2);\n\n // as a last resort, try splitting the remaining polygon into two\n } else if (pass === 2) {\n splitEarcut(ear, triangles, dim, minX, minY, invSize);\n }\n\n break;\n }\n }\n}\n\n// check whether a polygon node forms a valid ear with adjacent nodes\nfunction isEar(ear) {\n var a = ear.prev,\n b = ear,\n c = ear.next;\n\n if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\n // now make sure we don't have other points inside the potential ear\n var ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;\n\n // triangle bbox; min & max are calculated like this for speed\n var x0 = ax < bx ? (ax < cx ? ax : cx) : (bx < cx ? bx : cx),\n y0 = ay < by ? (ay < cy ? ay : cy) : (by < cy ? by : cy),\n x1 = ax > bx ? (ax > cx ? ax : cx) : (bx > cx ? bx : cx),\n y1 = ay > by ? (ay > cy ? ay : cy) : (by > cy ? by : cy);\n\n var p = c.next;\n while (p !== a) {\n if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 &&\n pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) &&\n area(p.prev, p, p.next) >= 0) return false;\n p = p.next;\n }\n\n return true;\n}\n\nfunction isEarHashed(ear, minX, minY, invSize) {\n var a = ear.prev,\n b = ear,\n c = ear.next;\n\n if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\n var ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;\n\n // triangle bbox; min & max are calculated like this for speed\n var x0 = ax < bx ? (ax < cx ? ax : cx) : (bx < cx ? bx : cx),\n y0 = ay < by ? (ay < cy ? ay : cy) : (by < cy ? by : cy),\n x1 = ax > bx ? (ax > cx ? ax : cx) : (bx > cx ? bx : cx),\n y1 = ay > by ? (ay > cy ? ay : cy) : (by > cy ? by : cy);\n\n // z-order range for the current triangle bbox;\n var minZ = zOrder(x0, y0, minX, minY, invSize),\n maxZ = zOrder(x1, y1, minX, minY, invSize);\n\n var p = ear.prevZ,\n n = ear.nextZ;\n\n // look for points inside the triangle in both directions\n while (p && p.z >= minZ && n && n.z <= maxZ) {\n if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&\n pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;\n p = p.prevZ;\n\n if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&\n pointInTriangle(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;\n n = n.nextZ;\n }\n\n // look for remaining points in decreasing z-order\n while (p && p.z >= minZ) {\n if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&\n pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;\n p = p.prevZ;\n }\n\n // look for remaining points in increasing z-order\n while (n && n.z <= maxZ) {\n if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&\n pointInTriangle(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;\n n = n.nextZ;\n }\n\n return true;\n}\n\n// go through all polygon nodes and cure small local self-intersections\nfunction cureLocalIntersections(start, triangles, dim) {\n var p = start;\n do {\n var a = p.prev,\n b = p.next.next;\n\n if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) {\n\n triangles.push(a.i / dim | 0);\n triangles.push(p.i / dim | 0);\n triangles.push(b.i / dim | 0);\n\n // remove two nodes involved\n removeNode(p);\n removeNode(p.next);\n\n p = start = b;\n }\n p = p.next;\n } while (p !== start);\n\n return filterPoints(p);\n}\n\n// try splitting polygon into two and triangulate them independently\nfunction splitEarcut(start, triangles, dim, minX, minY, invSize) {\n // look for a valid diagonal that divides the polygon into two\n var a = start;\n do {\n var b = a.next.next;\n while (b !== a.prev) {\n if (a.i !== b.i && isValidDiagonal(a, b)) {\n // split the polygon in two by the diagonal\n var c = splitPolygon(a, b);\n\n // filter colinear points around the cuts\n a = filterPoints(a, a.next);\n c = filterPoints(c, c.next);\n\n // run earcut on each half\n earcutLinked(a, triangles, dim, minX, minY, invSize, 0);\n earcutLinked(c, triangles, dim, minX, minY, invSize, 0);\n return;\n }\n b = b.next;\n }\n a = a.next;\n } while (a !== start);\n}\n\n// link every hole into the outer loop, producing a single-ring polygon without holes\nfunction eliminateHoles(data, holeIndices, outerNode, dim) {\n var queue = [],\n i, len, start, end, list;\n\n for (i = 0, len = holeIndices.length; i < len; i++) {\n start = holeIndices[i] * dim;\n end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n list = linkedList(data, start, end, dim, false);\n if (list === list.next) list.steiner = true;\n queue.push(getLeftmost(list));\n }\n\n queue.sort(compareX);\n\n // process holes from left to right\n for (i = 0; i < queue.length; i++) {\n outerNode = eliminateHole(queue[i], outerNode);\n }\n\n return outerNode;\n}\n\nfunction compareX(a, b) {\n return a.x - b.x;\n}\n\n// find a bridge between vertices that connects hole with an outer ring and and link it\nfunction eliminateHole(hole, outerNode) {\n var bridge = findHoleBridge(hole, outerNode);\n if (!bridge) {\n return outerNode;\n }\n\n var bridgeReverse = splitPolygon(bridge, hole);\n\n // filter collinear points around the cuts\n filterPoints(bridgeReverse, bridgeReverse.next);\n return filterPoints(bridge, bridge.next);\n}\n\n// David Eberly's algorithm for finding a bridge between hole and outer polygon\nfunction findHoleBridge(hole, outerNode) {\n var p = outerNode,\n hx = hole.x,\n hy = hole.y,\n qx = -Infinity,\n m;\n\n // find a segment intersected by a ray from the hole's leftmost point to the left;\n // segment's endpoint with lesser x will be potential connection point\n do {\n if (hy <= p.y && hy >= p.next.y && p.next.y !== p.y) {\n var x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y);\n if (x <= hx && x > qx) {\n qx = x;\n m = p.x < p.next.x ? p : p.next;\n if (x === hx) return m; // hole touches outer segment; pick leftmost endpoint\n }\n }\n p = p.next;\n } while (p !== outerNode);\n\n if (!m) return null;\n\n // look for points inside the triangle of hole point, segment intersection and endpoint;\n // if there are no points found, we have a valid connection;\n // otherwise choose the point of the minimum angle with the ray as connection point\n\n var stop = m,\n mx = m.x,\n my = m.y,\n tanMin = Infinity,\n tan;\n\n p = m;\n\n do {\n if (hx >= p.x && p.x >= mx && hx !== p.x &&\n pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) {\n\n tan = Math.abs(hy - p.y) / (hx - p.x); // tangential\n\n if (locallyInside(p, hole) &&\n (tan < tanMin || (tan === tanMin && (p.x > m.x || (p.x === m.x && sectorContainsSector(m, p)))))) {\n m = p;\n tanMin = tan;\n }\n }\n\n p = p.next;\n } while (p !== stop);\n\n return m;\n}\n\n// whether sector in vertex m contains sector in vertex p in the same coordinates\nfunction sectorContainsSector(m, p) {\n return area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0;\n}\n\n// interlink polygon nodes in z-order\nfunction indexCurve(start, minX, minY, invSize) {\n var p = start;\n do {\n if (p.z === 0) p.z = zOrder(p.x, p.y, minX, minY, invSize);\n p.prevZ = p.prev;\n p.nextZ = p.next;\n p = p.next;\n } while (p !== start);\n\n p.prevZ.nextZ = null;\n p.prevZ = null;\n\n sortLinked(p);\n}\n\n// Simon Tatham's linked list merge sort algorithm\n// http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html\nfunction sortLinked(list) {\n var i, p, q, e, tail, numMerges, pSize, qSize,\n inSize = 1;\n\n do {\n p = list;\n list = null;\n tail = null;\n numMerges = 0;\n\n while (p) {\n numMerges++;\n q = p;\n pSize = 0;\n for (i = 0; i < inSize; i++) {\n pSize++;\n q = q.nextZ;\n if (!q) break;\n }\n qSize = inSize;\n\n while (pSize > 0 || (qSize > 0 && q)) {\n\n if (pSize !== 0 && (qSize === 0 || !q || p.z <= q.z)) {\n e = p;\n p = p.nextZ;\n pSize--;\n } else {\n e = q;\n q = q.nextZ;\n qSize--;\n }\n\n if (tail) tail.nextZ = e;\n else list = e;\n\n e.prevZ = tail;\n tail = e;\n }\n\n p = q;\n }\n\n tail.nextZ = null;\n inSize *= 2;\n\n } while (numMerges > 1);\n\n return list;\n}\n\n// z-order of a point given coords and inverse of the longer side of data bbox\nfunction zOrder(x, y, minX, minY, invSize) {\n // coords are transformed into non-negative 15-bit integer range\n x = (x - minX) * invSize | 0;\n y = (y - minY) * invSize | 0;\n\n x = (x | (x << 8)) & 0x00FF00FF;\n x = (x | (x << 4)) & 0x0F0F0F0F;\n x = (x | (x << 2)) & 0x33333333;\n x = (x | (x << 1)) & 0x55555555;\n\n y = (y | (y << 8)) & 0x00FF00FF;\n y = (y | (y << 4)) & 0x0F0F0F0F;\n y = (y | (y << 2)) & 0x33333333;\n y = (y | (y << 1)) & 0x55555555;\n\n return x | (y << 1);\n}\n\n// find the leftmost node of a polygon ring\nfunction getLeftmost(start) {\n var p = start,\n leftmost = start;\n do {\n if (p.x < leftmost.x || (p.x === leftmost.x && p.y < leftmost.y)) leftmost = p;\n p = p.next;\n } while (p !== start);\n\n return leftmost;\n}\n\n// check if a point lies within a convex triangle\nfunction pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) >= (ax - px) * (cy - py) &&\n (ax - px) * (by - py) >= (bx - px) * (ay - py) &&\n (bx - px) * (cy - py) >= (cx - px) * (by - py);\n}\n\n// check if a diagonal between two polygon nodes is valid (lies in polygon interior)\nfunction isValidDiagonal(a, b) {\n return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && // dones't intersect other edges\n (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && // locally visible\n (area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors\n equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0); // special zero-length case\n}\n\n// signed area of a triangle\nfunction area(p, q, r) {\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}\n\n// check if two points are equal\nfunction equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}\n\n// check if two segments intersect\nfunction intersects(p1, q1, p2, q2) {\n var o1 = sign(area(p1, q1, p2));\n var o2 = sign(area(p1, q1, q2));\n var o3 = sign(area(p2, q2, p1));\n var o4 = sign(area(p2, q2, q1));\n\n if (o1 !== o2 && o3 !== o4) return true; // general case\n\n if (o1 === 0 && onSegment(p1, p2, q1)) return true; // p1, q1 and p2 are collinear and p2 lies on p1q1\n if (o2 === 0 && onSegment(p1, q2, q1)) return true; // p1, q1 and q2 are collinear and q2 lies on p1q1\n if (o3 === 0 && onSegment(p2, p1, q2)) return true; // p2, q2 and p1 are collinear and p1 lies on p2q2\n if (o4 === 0 && onSegment(p2, q1, q2)) return true; // p2, q2 and q1 are collinear and q1 lies on p2q2\n\n return false;\n}\n\n// for collinear points p, q, r, check if point q lies on segment pr\nfunction onSegment(p, q, r) {\n return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}\n\nfunction sign(num) {\n return num > 0 ? 1 : num < 0 ? -1 : 0;\n}\n\n// check if a polygon diagonal intersects any polygon segments\nfunction intersectsPolygon(a, b) {\n var p = a;\n do {\n if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i &&\n intersects(p, p.next, a, b)) return true;\n p = p.next;\n } while (p !== a);\n\n return false;\n}\n\n// check if a polygon diagonal is locally inside the polygon\nfunction locallyInside(a, b) {\n return area(a.prev, a, a.next) < 0 ?\n area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 :\n area(a, b, a.prev) < 0 || area(a, a.next, b) < 0;\n}\n\n// check if the middle point of a polygon diagonal is inside the polygon\nfunction middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y &&\n (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n}\n\n// link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two;\n// if one belongs to the outer ring and another to a hole, it merges it into a single ring\nfunction splitPolygon(a, b) {\n var a2 = new Node(a.i, a.x, a.y),\n b2 = new Node(b.i, b.x, b.y),\n an = a.next,\n bp = b.prev;\n\n a.next = b;\n b.prev = a;\n\n a2.next = an;\n an.prev = a2;\n\n b2.next = a2;\n a2.prev = b2;\n\n bp.next = b2;\n b2.prev = bp;\n\n return b2;\n}\n\n// create a node and optionally link it with previous one (in a circular doubly linked list)\nfunction insertNode(i, x, y, last) {\n var p = new Node(i, x, y);\n\n if (!last) {\n p.prev = p;\n p.next = p;\n\n } else {\n p.next = last.next;\n p.prev = last;\n last.next.prev = p;\n last.next = p;\n }\n return p;\n}\n\nfunction removeNode(p) {\n p.next.prev = p.prev;\n p.prev.next = p.next;\n\n if (p.prevZ) p.prevZ.nextZ = p.nextZ;\n if (p.nextZ) p.nextZ.prevZ = p.prevZ;\n}\n\nfunction Node(i, x, y) {\n // vertex index in coordinates array\n this.i = i;\n\n // vertex coordinates\n this.x = x;\n this.y = y;\n\n // previous and next vertex nodes in a polygon ring\n this.prev = null;\n this.next = null;\n\n // z-order curve value\n this.z = 0;\n\n // previous and next nodes in z-order\n this.prevZ = null;\n this.nextZ = null;\n\n // indicates whether this is a steiner point\n this.steiner = false;\n}\n\n// return a percentage difference between the polygon area and its triangulation area;\n// used to verify correctness of triangulation\nearcut.deviation = function (data, holeIndices, dim, triangles) {\n var hasHoles = holeIndices && holeIndices.length;\n var outerLen = hasHoles ? holeIndices[0] * dim : data.length;\n\n var polygonArea = Math.abs(signedArea(data, 0, outerLen, dim));\n if (hasHoles) {\n for (var i = 0, len = holeIndices.length; i < len; i++) {\n var start = holeIndices[i] * dim;\n var end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n polygonArea -= Math.abs(signedArea(data, start, end, dim));\n }\n }\n\n var trianglesArea = 0;\n for (i = 0; i < triangles.length; i += 3) {\n var a = triangles[i] * dim;\n var b = triangles[i + 1] * dim;\n var c = triangles[i + 2] * dim;\n trianglesArea += Math.abs(\n (data[a] - data[c]) * (data[b + 1] - data[a + 1]) -\n (data[a] - data[b]) * (data[c + 1] - data[a + 1]));\n }\n\n return polygonArea === 0 && trianglesArea === 0 ? 0 :\n Math.abs((trianglesArea - polygonArea) / polygonArea);\n};\n\nfunction signedArea(data, start, end, dim) {\n var sum = 0;\n for (var i = start, j = end - dim; i < end; i += dim) {\n sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]);\n j = i;\n }\n return sum;\n}\n\n// turn a polygon in a multi-dimensional array form (e.g. as in GeoJSON) into a form Earcut accepts\nearcut.flatten = function (data) {\n var dim = data[0][0].length,\n result = {vertices: [], holes: [], dimensions: dim},\n holeIndex = 0;\n\n for (var i = 0; i < data.length; i++) {\n for (var j = 0; j < data[i].length; j++) {\n for (var d = 0; d < dim; d++) result.vertices.push(data[i][j][d]);\n }\n if (i > 0) {\n holeIndex += data[i - 1].length;\n result.holes.push(holeIndex);\n }\n }\n return result;\n};\n","\"use strict\";\n\nmodule.exports = function () {\n // https://mths.be/emoji\n return /\\uD83C\\uDFF4\\uDB40\\uDC67\\uDB40\\uDC62(?:\\uDB40\\uDC77\\uDB40\\uDC6C\\uDB40\\uDC73|\\uDB40\\uDC73\\uDB40\\uDC63\\uDB40\\uDC74|\\uDB40\\uDC65\\uDB40\\uDC6E\\uDB40\\uDC67)\\uDB40\\uDC7F|(?:\\uD83E\\uDDD1\\uD83C\\uDFFF\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB-\\uDFFE])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFE\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFD\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFC\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFB\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFC-\\uDFFF])|\\uD83D\\uDC68(?:\\uD83C\\uDFFB(?:\\u200D(?:\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF]))|\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFC-\\uDFFF])|[\\u2695\\u2696\\u2708]\\uFE0F|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD]))?|(?:\\uD83C[\\uDFFC-\\uDFFF])\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF]))|\\u200D(?:\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83D\\uDC68|(?:\\uD83D[\\uDC68\\uDC69])\\u200D(?:\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67]))|\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFF\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFE])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFE\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFD\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFC\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|(?:\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])\\uFE0F|\\u200D(?:(?:\\uD83D[\\uDC68\\uDC69])\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83D[\\uDC66\\uDC67])|\\uD83C\\uDFFF|\\uD83C\\uDFFE|\\uD83C\\uDFFD|\\uD83C\\uDFFC)?|(?:\\uD83D\\uDC69(?:\\uD83C\\uDFFB\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D(?:\\uD83D[\\uDC68\\uDC69])|\\uD83D[\\uDC68\\uDC69])|(?:\\uD83C[\\uDFFC-\\uDFFF])\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D(?:\\uD83D[\\uDC68\\uDC69])|\\uD83D[\\uDC68\\uDC69]))|\\uD83E\\uDDD1(?:\\uD83C[\\uDFFB-\\uDFFF])\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1)(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D(?:\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67]))|\\uD83D\\uDC69(?:\\u200D(?:\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D(?:\\uD83D[\\uDC68\\uDC69])|\\uD83D[\\uDC68\\uDC69])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFF\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFE\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83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uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFD\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFC\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFB\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD]))|\\uD83D\\uDC69\\u200D\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83D\\uDC69\\u200D\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67])|(?:\\uD83D\\uDC41\\uFE0F\\u200D\\uD83D\\uDDE8|\\uD83E\\uDDD1(?:\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFB\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])|\\uD83D\\uDC69(?:\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFB\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])|\\uD83D\\uDE36\\u200D\\uD83C\\uDF2B|\\uD83C\\uDFF3\\uFE0F\\u200D\\u26A7|\\uD83D\\uDC3B\\u200D\\u2744|(?:(?:\\uD83C[\\uDFC3\\uDFC4\\uDFCA]|\\uD83D[\\uDC6E\\uDC70\\uDC71\\uDC73\\uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD35\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD4\\uDDD6-\\uDDDD])(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC6F|\\uD83E[\\uDD3C\\uDDDE\\uDDDF])\\u200D[\\u2640\\u2642]|(?:\\u26F9|\\uD83C[\\uDFCB\\uDFCC]|\\uD83D\\uDD75)(?:\\uFE0F|\\uD83C[\\uDFFB-\\uDFFF])\\u200D[\\u2640\\u2642]|\\uD83C\\uDFF4\\u200D\\u2620|(?:\\uD83C[\\uDFC3\\uDFC4\\uDFCA]|\\uD83D[\\uDC6E\\uDC70\\uDC71\\uDC73\\uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD35\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD4\\uDDD6-\\uDDDD])\\u200D[\\u2640\\u2642]|[\\xA9\\xAE\\u203C\\u2049\\u2122\\u2139\\u2194-\\u2199\\u21A9\\u21AA\\u2328\\u23CF\\u23ED-\\u23EF\\u23F1\\u23F2\\u23F8-\\u23FA\\u24C2\\u25AA\\u25AB\\u25B6\\u25C0\\u25FB\\u25FC\\u2600-\\u2604\\u260E\\u2611\\u2618\\u2620\\u2622\\u2623\\u2626\\u262A\\u262E\\u262F\\u2638-\\u263A\\u2640\\u2642\\u265F\\u2660\\u2663\\u2665\\u2666\\u2668\\u267B\\u267E\\u2692\\u2694-\\u2697\\u2699\\u269B\\u269C\\u26A0\\u26A7\\u26B0\\u26B1\\u26C8\\u26CF\\u26D1\\u26D3\\u26E9\\u26F0\\u26F1\\u26F4\\u26F7\\u26F8\\u2702\\u2708\\u2709\\u270F\\u2712\\u2714\\u2716\\u271D\\u2721\\u2733\\u2734\\u2744\\u2747\\u2763\\u27A1\\u2934\\u2935\\u2B05-\\u2B07\\u3030\\u303D\\u3297\\u3299]|\\uD83C[\\uDD70\\uDD71\\uDD7E\\uDD7F\\uDE02\\uDE37\\uDF21\\uDF24-\\uDF2C\\uDF36\\uDF7D\\uDF96\\uDF97\\uDF99-\\uDF9B\\uDF9E\\uDF9F\\uDFCD\\uDFCE\\uDFD4-\\uDFDF\\uDFF5\\uDFF7]|\\uD83D[\\uDC3F\\uDCFD\\uDD49\\uDD4A\\uDD6F\\uDD70\\uDD73\\uDD76-\\uDD79\\uDD87\\uDD8A-\\uDD8D\\uDDA5\\uDDA8\\uDDB1\\uDDB2\\uDDBC\\uDDC2-\\uDDC4\\uDDD1-\\uDDD3\\uDDDC-\\uDDDE\\uDDE1\\uDDE3\\uDDE8\\uDDEF\\uDDF3\\uDDFA\\uDECB\\uDECD-\\uDECF\\uDEE0-\\uDEE5\\uDEE9\\uDEF0\\uDEF3])\\uFE0F|\\uD83C\\uDFF3\\uFE0F\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uDFFF])|(?:[\\u261D\\u270C\\u270D]|\\uD83D[\\uDD74\\uDD90])(?:\\uFE0F|\\uD83C[\\uDFFB-\\uDFFF])|[\\u270A\\u270B]|\\uD83C[\\uDF85\\uDFC2\\uDFC7]|\\uD83D[\\uDC08\\uDC15\\uDC3B\\uDC42\\uDC43\\uDC46-\\uDC50\\uDC66\\uDC67\\uDC6B-\\uDC6D\\uDC72\\uDC74-\\uDC76\\uDC78\\uDC7C\\uDC83\\uDC85\\uDC8F\\uDC91\\uDCAA\\uDD7A\\uDD95\\uDD96\\uDE2E\\uDE35\\uDE36\\uDE4C\\uDE4F\\uDEC0\\uDECC]|\\uD83E[\\uDD0C\\uDD0F\\uDD18-\\uDD1C\\uDD1E\\uDD1F\\uDD30-\\uDD34\\uDD36\\uDD77\\uDDB5\\uDDB6\\uDDBB\\uDDD2\\uDDD3\\uDDD5]|\\uD83C[\\uDFC3\\uDFC4\\uDFCA]|\\uD83D[\\uDC6E\\uDC70\\uDC71\\uDC73\\uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD35\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD4\\uDDD6-\\uDDDD]|\\uD83D\\uDC6F|\\uD83E[\\uDD3C\\uDDDE\\uDDDF]|[\\u231A\\u231B\\u23E9-\\u23EC\\u23F0\\u23F3\\u25FD\\u25FE\\u2614\\u2615\\u2648-\\u2653\\u267F\\u2693\\u26A1\\u26AA\\u26AB\\u26BD\\u26BE\\u26C4\\u26C5\\u26CE\\u26D4\\u26EA\\u26F2\\u26F3\\u26F5\\u26FA\\u26FD\\u2705\\u2728\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2795-\\u2797\\u27B0\\u27BF\\u2B1B\\u2B1C\\u2B50\\u2B55]|\\uD83C[\\uDC04\\uDCCF\\u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u26AB\\u26BD\\u26BE\\u26C4\\u26C5\\u26CE\\u26D4\\u26EA\\u26F2\\u26F3\\u26F5\\u26FA\\u26FD\\u2705\\u270A\\u270B\\u2728\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2795-\\u2797\\u27B0\\u27BF\\u2B1B\\u2B1C\\u2B50\\u2B55]|\\uD83C[\\uDC04\\uDCCF\\uDD8E\\uDD91-\\uDD9A\\uDDE6-\\uDDFF\\uDE01\\uDE1A\\uDE2F\\uDE32-\\uDE36\\uDE38-\\uDE3A\\uDE50\\uDE51\\uDF00-\\uDF20\\uDF2D-\\uDF35\\uDF37-\\uDF7C\\uDF7E-\\uDF93\\uDFA0-\\uDFCA\\uDFCF-\\uDFD3\\uDFE0-\\uDFF0\\uDFF4\\uDFF8-\\uDFFF]|\\uD83D[\\uDC00-\\uDC3E\\uDC40\\uDC42-\\uDCFC\\uDCFF-\\uDD3D\\uDD4B-\\uDD4E\\uDD50-\\uDD67\\uDD7A\\uDD95\\uDD96\\uDDA4\\uDDFB-\\uDE4F\\uDE80-\\uDEC5\\uDECC\\uDED0-\\uDED2\\uDED5-\\uDED7\\uDEEB\\uDEEC\\uDEF4-\\uDEFC\\uDFE0-\\uDFEB]|\\uD83E[\\uDD0C-\\uDD3A\\uDD3C-\\uDD45\\uDD47-\\uDD78\\uDD7A-\\uDDCB\\uDDCD-\\uDDFF\\uDE70-\\uDE74\\uDE78-\\uDE7A\\uDE80-\\uDE86\\uDE90-\\uDEA8\\uDEB0-\\uDEB6\\uDEC0-\\uDEC2\\uDED0-\\uDED6])|(?:[#\\*0-9\\xA9\\xAE\\u203C\\u2049\\u2122\\u2139\\u2194-\\u2199\\u21A9\\u21AA\\u231A\\u231B\\u2328\\u23CF\\u23E9-\\u23F3\\u23F8-\\u23FA\\u24C2\\u25AA\\u25AB\\u25B6\\u25C0\\u25FB-\\u25FE\\u2600-\\u2604\\u260E\\u2611\\u2614\\u2615\\u2618\\u261D\\u2620\\u2622\\u2623\\u2626\\u262A\\u262E\\u262F\\u2638-\\u263A\\u2640\\u2642\\u2648-\\u2653\\u265F\\u2660\\u2663\\u2665\\u2666\\u2668\\u267B\\u267E\\u267F\\u2692-\\u2697\\u2699\\u269B\\u269C\\u26A0\\u26A1\\u26A7\\u26AA\\u26AB\\u26B0\\u26B1\\u26BD\\u26BE\\u26C4\\u26C5\\u26C8\\u26CE\\u26CF\\u26D1\\u26D3\\u26D4\\u26E9\\u26EA\\u26F0-\\u26F5\\u26F7-\\u26FA\\u26FD\\u2702\\u2705\\u2708-\\u270D\\u270F\\u2712\\u2714\\u2716\\u271D\\u2721\\u2728\\u2733\\u2734\\u2744\\u2747\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2763\\u2764\\u2795-\\u2797\\u27A1\\u27B0\\u27BF\\u2934\\u2935\\u2B05-\\u2B07\\u2B1B\\u2B1C\\u2B50\\u2B55\\u3030\\u303D\\u3297\\u3299]|\\uD83C[\\uDC04\\uDCCF\\uDD70\\uDD71\\uDD7E\\uDD7F\\uDD8E\\uDD91-\\uDD9A\\uDDE6-\\uDDFF\\uDE01\\uDE02\\uDE1A\\uDE2F\\uDE32-\\uDE3A\\uDE50\\uDE51\\uDF00-\\uDF21\\uDF24-\\uDF93\\uDF96\\uDF97\\uDF99-\\uDF9B\\uDF9E-\\uDFF0\\uDFF3-\\uDFF5\\uDFF7-\\uDFFF]|\\uD83D[\\uDC00-\\uDCFD\\uDCFF-\\uDD3D\\uDD49-\\uDD4E\\uDD50-\\uDD67\\uDD6F\\uDD70\\uDD73-\\uDD7A\\uDD87\\uDD8A-\\uDD8D\\uDD90\\uDD95\\uDD96\\uDDA4\\uDDA5\\uDDA8\\uDDB1\\uDDB2\\uDDBC\\uDDC2-\\uDDC4\\uDDD1-\\uDDD3\\uDDDC-\\uDDDE\\uDDE1\\uDDE3\\uDDE8\\uDDEF\\uDDF3\\uDDFA-\\uDE4F\\uDE80-\\uDEC5\\uDECB-\\uDED2\\uDED5-\\uDED7\\uDEE0-\\uDEE5\\uDEE9\\uDEEB\\uDEEC\\uDEF0\\uDEF3-\\uDEFC\\uDFE0-\\uDFEB]|\\uD83E[\\uDD0C-\\uDD3A\\uDD3C-\\uDD45\\uDD47-\\uDD78\\uDD7A-\\uDDCB\\uDDCD-\\uDDFF\\uDE70-\\uDE74\\uDE78-\\uDE7A\\uDE80-\\uDE86\\uDE90-\\uDEA8\\uDEB0-\\uDEB6\\uDEC0-\\uDEC2\\uDED0-\\uDED6])\\uFE0F|(?:[\\u261D\\u26F9\\u270A-\\u270D]|\\uD83C[\\uDF85\\uDFC2-\\uDFC4\\uDFC7\\uDFCA-\\uDFCC]|\\uD83D[\\uDC42\\uDC43\\uDC46-\\uDC50\\uDC66-\\uDC78\\uDC7C\\uDC81-\\uDC83\\uDC85-\\uDC87\\uDC8F\\uDC91\\uDCAA\\uDD74\\uDD75\\uDD7A\\uDD90\\uDD95\\uDD96\\uDE45-\\uDE47\\uDE4B-\\uDE4F\\uDEA3\\uDEB4-\\uDEB6\\uDEC0\\uDECC]|\\uD83E[\\uDD0C\\uDD0F\\uDD18-\\uDD1F\\uDD26\\uDD30-\\uDD39\\uDD3C-\\uDD3E\\uDD77\\uDDB5\\uDDB6\\uDDB8\\uDDB9\\uDDBB\\uDDCD-\\uDDCF\\uDDD1-\\uDDDD])/g;\n};\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n","/*!\n Copyright (c) 2015 Jed Watson.\n Based on code that is Copyright 2013-2015, Facebook, Inc.\n All rights reserved.\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar canUseDOM = !!(\n\t\ttypeof window !== 'undefined' &&\n\t\twindow.document &&\n\t\twindow.document.createElement\n\t);\n\n\tvar ExecutionEnvironment = {\n\n\t\tcanUseDOM: canUseDOM,\n\n\t\tcanUseWorkers: typeof Worker !== 'undefined',\n\n\t\tcanUseEventListeners:\n\t\t\tcanUseDOM && !!(window.addEventListener || window.attachEvent),\n\n\t\tcanUseViewport: canUseDOM && !!window.screen\n\n\t};\n\n\tif (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\tdefine(function () {\n\t\t\treturn ExecutionEnvironment;\n\t\t});\n\t} else if (typeof module !== 'undefined' && module.exports) {\n\t\tmodule.exports = ExecutionEnvironment;\n\t} else {\n\t\twindow.ExecutionEnvironment = ExecutionEnvironment;\n\t}\n\n}());\n","'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n","import type { InteractionEvent } from '@pixi/interaction';\nimport type { Viewport } from '../Viewport';\n\n/**\n * Derive this class to create user-defined plugins\n *\n * @public\n */\nexport class Plugin\n{\n /** The viewport to which this plugin is attached. */\n public readonly parent: Viewport;\n\n /**\n * Flags whether this plugin has been \"paused\".\n *\n * @see Plugin#pause\n * @see Plugin#resume\n */\n public paused: boolean;\n\n /** @param {Viewport} parent */\n constructor(parent: Viewport)\n {\n this.parent = parent;\n this.paused = false;\n }\n\n /** Called when plugin is removed */\n public destroy()\n {\n // Override for implementation\n }\n\n /** Handler for pointerdown PIXI event */\n public down(_e: InteractionEvent): boolean\n {\n return false;\n }\n\n /** Handler for pointermove PIXI event */\n public move(_e: InteractionEvent): boolean\n {\n return false;\n }\n\n /** Handler for pointerup PIXI event */\n public up(_e: InteractionEvent): boolean\n {\n return false;\n }\n\n /** Handler for wheel event on div */\n public wheel(_e: WheelEvent): boolean | undefined\n {\n return false;\n }\n\n /**\n * Called on each tick\n * @param {number} elapsed time in millisecond since last update\n */\n public update(_delta: number): void\n {\n // Override for implementation\n }\n\n /** Called when the viewport is resized */\n public resize()\n {\n // Override for implementation\n }\n\n /** Called when the viewport is manually moved */\n public reset(): void\n {\n // Override for implementation\n }\n\n /** Pause the plugin */\n public pause(): void\n {\n this.paused = true;\n }\n\n /** Un-pause the plugin */\n public resume(): void\n {\n this.paused = false;\n }\n}\n","\n/*\n\tCopyright © 2001 Robert Penner\n\tAll rights reserved.\n\n\tRedistribution and use in source and binary forms, with or without modification, \n\tare permitted provided that the following conditions are met:\n\n\tRedistributions of source code must retain the above copyright notice, this list of \n\tconditions and the following disclaimer.\n\tRedistributions in binary form must reproduce the above copyright notice, this list \n\tof conditions and the following disclaimer in the documentation and/or other materials \n\tprovided with the distribution.\n\n\tNeither the name of the author nor the names of contributors may be used to endorse \n\tor promote products derived from this software without specific prior written permission.\n\n\tTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY \n\tEXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n\tMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n\tCOPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n\tEXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE\n\tGOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED \n\tAND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n\tNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED \n\tOF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n(function() {\n var penner, umd;\n\n umd = function(factory) {\n if (typeof exports === 'object') {\n return module.exports = factory;\n } else if (typeof define === 'function' && define.amd) {\n return define([], factory);\n } else {\n return this.penner = factory;\n }\n };\n\n penner = {\n linear: function(t, b, c, d) {\n return c * t / d + b;\n },\n easeInQuad: function(t, b, c, d) {\n return c * (t /= d) * t + b;\n },\n easeOutQuad: function(t, b, c, d) {\n return -c * (t /= d) * (t - 2) + b;\n },\n easeInOutQuad: function(t, b, c, d) {\n if ((t /= d / 2) < 1) {\n return c / 2 * t * t + b;\n } else {\n return -c / 2 * ((--t) * (t - 2) - 1) + b;\n }\n },\n easeInCubic: function(t, b, c, d) {\n return c * (t /= d) * t * t + b;\n },\n easeOutCubic: function(t, b, c, d) {\n return c * ((t = t / d - 1) * t * t + 1) + b;\n },\n easeInOutCubic: function(t, b, c, d) {\n if ((t /= d / 2) < 1) {\n return c / 2 * t * t * t + b;\n } else {\n return c / 2 * ((t -= 2) * t * t + 2) + b;\n }\n },\n easeInQuart: function(t, b, c, d) {\n return c * (t /= d) * t * t * t + b;\n },\n easeOutQuart: function(t, b, c, d) {\n return -c * ((t = t / d - 1) * t * t * t - 1) + b;\n },\n easeInOutQuart: function(t, b, c, d) {\n if ((t /= d / 2) < 1) {\n return c / 2 * t * t * t * t + b;\n } else {\n return -c / 2 * ((t -= 2) * t * t * t - 2) + b;\n }\n },\n easeInQuint: function(t, b, c, d) {\n return c * (t /= d) * t * t * t * t + b;\n },\n easeOutQuint: function(t, b, c, d) {\n return c * ((t = t / d - 1) * t * t * t * t + 1) + b;\n },\n easeInOutQuint: function(t, b, c, d) {\n if ((t /= d / 2) < 1) {\n return c / 2 * t * t * t * t * t + b;\n } else {\n return c / 2 * ((t -= 2) * t * t * t * t + 2) + b;\n }\n },\n easeInSine: function(t, b, c, d) {\n return -c * Math.cos(t / d * (Math.PI / 2)) + c + b;\n },\n easeOutSine: function(t, b, c, d) {\n return c * Math.sin(t / d * (Math.PI / 2)) + b;\n },\n easeInOutSine: function(t, b, c, d) {\n return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b;\n },\n easeInExpo: function(t, b, c, d) {\n if (t === 0) {\n return b;\n } else {\n return c * Math.pow(2, 10 * (t / d - 1)) + b;\n }\n },\n easeOutExpo: function(t, b, c, d) {\n if (t === d) {\n return b + c;\n } else {\n return c * (-Math.pow(2, -10 * t / d) + 1) + b;\n }\n },\n easeInOutExpo: function(t, b, c, d) {\n if (t === 0) {\n b;\n }\n if (t === d) {\n b + c;\n }\n if ((t /= d / 2) < 1) {\n return c / 2 * Math.pow(2, 10 * (t - 1)) + b;\n } else {\n return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b;\n }\n },\n easeInCirc: function(t, b, c, d) {\n return -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b;\n },\n easeOutCirc: function(t, b, c, d) {\n return c * Math.sqrt(1 - (t = t / d - 1) * t) + b;\n },\n easeInOutCirc: function(t, b, c, d) {\n if ((t /= d / 2) < 1) {\n return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b;\n } else {\n return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b;\n }\n },\n easeInElastic: function(t, b, c, d) {\n var a, p, s;\n s = 1.70158;\n p = 0;\n a = c;\n if (t === 0) {\n b;\n } else if ((t /= d) === 1) {\n b + c;\n }\n if (!p) {\n p = d * .3;\n }\n if (a < Math.abs(c)) {\n a = c;\n s = p / 4;\n } else {\n s = p / (2 * Math.PI) * Math.asin(c / a);\n }\n return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;\n },\n easeOutElastic: function(t, b, c, d) {\n var a, p, s;\n s = 1.70158;\n p = 0;\n a = c;\n if (t === 0) {\n b;\n } else if ((t /= d) === 1) {\n b + c;\n }\n if (!p) {\n p = d * .3;\n }\n if (a < Math.abs(c)) {\n a = c;\n s = p / 4;\n } else {\n s = p / (2 * Math.PI) * Math.asin(c / a);\n }\n return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b;\n },\n easeInOutElastic: function(t, b, c, d) {\n var a, p, s;\n s = 1.70158;\n p = 0;\n a = c;\n if (t === 0) {\n b;\n } else if ((t /= d / 2) === 2) {\n b + c;\n }\n if (!p) {\n p = d * (.3 * 1.5);\n }\n if (a < Math.abs(c)) {\n a = c;\n s = p / 4;\n } else {\n s = p / (2 * Math.PI) * Math.asin(c / a);\n }\n if (t < 1) {\n return -.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;\n } else {\n return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b;\n }\n },\n easeInBack: function(t, b, c, d, s) {\n if (s === void 0) {\n s = 1.70158;\n }\n return c * (t /= d) * t * ((s + 1) * t - s) + b;\n },\n easeOutBack: function(t, b, c, d, s) {\n if (s === void 0) {\n s = 1.70158;\n }\n return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;\n },\n easeInOutBack: function(t, b, c, d, s) {\n if (s === void 0) {\n s = 1.70158;\n }\n if ((t /= d / 2) < 1) {\n return c / 2 * (t * t * (((s *= 1.525) + 1) * t - s)) + b;\n } else {\n return c / 2 * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2) + b;\n }\n },\n easeInBounce: function(t, b, c, d) {\n var v;\n v = penner.easeOutBounce(d - t, 0, c, d);\n return c - v + b;\n },\n easeOutBounce: function(t, b, c, d) {\n if ((t /= d) < 1 / 2.75) {\n return c * (7.5625 * t * t) + b;\n } else if (t < 2 / 2.75) {\n return c * (7.5625 * (t -= 1.5 / 2.75) * t + .75) + b;\n } else if (t < 2.5 / 2.75) {\n return c * (7.5625 * (t -= 2.25 / 2.75) * t + .9375) + b;\n } else {\n return c * (7.5625 * (t -= 2.625 / 2.75) * t + .984375) + b;\n }\n },\n easeInOutBounce: function(t, b, c, d) {\n var v;\n if (t < d / 2) {\n v = penner.easeInBounce(t * 2, 0, c, d);\n return v * .5 + b;\n } else {\n v = penner.easeOutBounce(t * 2 - d, 0, c, d);\n return v * .5 + c * .5 + b;\n }\n }\n };\n\n umd(penner);\n\n}).call(this);\n","// eslint-disable-next-line\n// @ts-expect-error Penner seems to have no typings.\nimport Penner from 'penner';\n\n/**\n * Returns correct Penner equation using string or Function.\n *\n * @internal\n * @ignore\n * @param {(function|string)} [ease]\n * @param {defaults} default penner equation to use if none is provided\n */\nexport default function ease(ease: any, defaults?: any): any\n{\n if (!ease)\n {\n return Penner[defaults]\n }\n else if (typeof ease === 'function')\n {\n return ease\n }\n else if (typeof ease === 'string')\n {\n return Penner[ease]\n }\n}","import { IPointData, Point } from '@pixi/math';\nimport { Plugin } from './Plugin';\nimport ease from '../ease';\n\nimport type { Viewport } from '../Viewport';\n\n/** Options for {@link Animate}. */\nexport interface IAnimateOptions\n{\n /** Time to animate */\n time?: number;\n\n /** Position to move the viewport to */\n position?: IPointData;\n\n /**\n * Desired viewport width in world pixels\n *\n * (use instead of scale; aspect ratio is maintained if height is not provided)\n */\n width?: number;\n\n /**\n * Desired viewport height in world pixels\n *\n * (use instead of scale; aspect ratio is maintained if width is not provided)\n */\n height?: number;\n\n /** Scale to change zoom (scale.x = scale.y) */\n scale?: number;\n\n /** Independently change zoom in x-direction */\n scaleX?: number;\n\n /** Independently change zoom in y-direction */\n scaleY?: number;\n\n /** Easing function to use */\n ease?: any;\n\n /** Callback to invoke when the animation completes */\n callbackOnComplete?: (viewport: Viewport) => void;\n\n /** Removes this plugin if interrupted by any user input */\n removeOnInterrupt?: boolean;\n}\n\nconst DEFAULT_ANIMATE_OPTIONS = {\n removeOnInterrupt: false,\n ease: 'linear',\n time: 1000,\n};\n\n/**\n * Animation plugin.\n *\n * @see Viewport#animate\n * @fires animate-end\n */\nexport class Animate extends Plugin\n{\n public readonly options: IAnimateOptions & { ease: any; time: number };\n\n /** The starting x-coordinate of the viewport. */\n protected startX?: number;\n\n /** The starting y-coordinate of the viewport. */\n protected startY?: number;\n\n /** The change in the x-coordinate of the viewport through the animation.*/\n protected deltaX?: number;\n\n /** The change in the y-coordinate of the viewport through the animation. */\n protected deltaY?: number;\n\n /** Marks whether the center of the viewport is preserved in the animation. */\n protected keepCenter!: boolean;\n\n /** The starting viewport width. */\n protected startWidth: number | null = null;\n\n /** The starting viewport height. */\n protected startHeight: number | null = null;\n\n /** The change in the viewport's width through the animation. */\n protected deltaWidth: number | null = null;\n\n /** The change in the viewport's height through the animation. */\n protected deltaHeight: number | null = null;\n\n /** The viewport's width post-animation. */\n protected width: number | null = null;\n\n /** The viewport's height post-animation. */\n protected height: number | null = null;\n\n /** The time since the animation started. */\n protected time = 0;\n\n /**\n * This is called by {@link Viewport.animate}.\n *\n * @param parent\n * @param options\n */\n constructor(parent: Viewport, options: IAnimateOptions = {})\n {\n super(parent);\n\n this.options = Object.assign({}, DEFAULT_ANIMATE_OPTIONS, options);\n this.options.ease = ease(this.options.ease);\n\n this.setupPosition();\n this.setupZoom();\n\n this.time = 0;\n }\n\n /**\n * Setup `startX`, `startY`, `deltaX`, `deltaY`, `keepCenter`.\n *\n * This is called during construction.\n */\n protected setupPosition(): void\n {\n if (typeof this.options.position !== 'undefined')\n {\n this.startX = this.parent.center.x;\n this.startY = this.parent.center.y;\n this.deltaX = this.options.position.x - this.parent.center.x;\n this.deltaY = this.options.position.y - this.parent.center.y;\n this.keepCenter = false;\n }\n else\n {\n this.keepCenter = true;\n }\n }\n\n /**\n * Setup `startWidth, `startHeight`, `deltaWidth, `deltaHeight, `width`, `height`.\n *\n * This is called during construction.\n */\n protected setupZoom(): void\n {\n this.width = null;\n this.height = null;\n\n if (typeof this.options.scale !== 'undefined')\n {\n this.width = this.parent.screenWidth / this.options.scale;\n }\n else if (typeof this.options.scaleX !== 'undefined' || typeof this.options.scaleY !== 'undefined')\n {\n if (typeof this.options.scaleX !== 'undefined')\n {\n // screenSizeInWorldPixels = screenWidth / scale\n this.width = this.parent.screenWidth / this.options.scaleX;\n }\n if (typeof this.options.scaleY !== 'undefined')\n {\n this.height = this.parent.screenHeight / this.options.scaleY;\n }\n }\n else\n {\n if (typeof this.options.width !== 'undefined')\n {\n this.width = this.options.width;\n }\n if (typeof this.options.height !== 'undefined')\n {\n this.height = this.options.height;\n }\n }\n\n if (this.width !== null)\n {\n this.startWidth = this.parent.screenWidthInWorldPixels;\n this.deltaWidth = this.width - this.startWidth;\n }\n if (this.height !== null)\n {\n this.startHeight = this.parent.screenHeightInWorldPixels;\n this.deltaHeight = this.height - this.startHeight;\n }\n }\n\n public down(): boolean\n {\n if (this.options.removeOnInterrupt)\n {\n this.parent.plugins.remove('animate');\n }\n\n return false;\n }\n\n public complete(): void\n {\n this.parent.plugins.remove('animate');\n if (this.width !== null)\n {\n this.parent.fitWidth(this.width, this.keepCenter, this.height === null);\n }\n if (this.height !== null)\n {\n this.parent.fitHeight(this.height, this.keepCenter, this.width === null);\n }\n if (!this.keepCenter)\n {\n this.parent.moveCenter(this.options.position!);\n }\n\n this.parent.emit('animate-end', this.parent);\n\n if (this.options.callbackOnComplete)\n {\n this.options.callbackOnComplete(this.parent);\n }\n }\n\n public update(elapsed: number): void\n {\n if (this.paused)\n {\n return;\n }\n this.time += elapsed;\n\n const originalZoom = new Point(this.parent.scale.x, this.parent.scale.y);\n\n if (this.time >= this.options.time)\n {\n const originalWidth = this.parent.width;\n const originalHeight = this.parent.height;\n\n this.complete();\n if (originalWidth !== this.parent.width || originalHeight !== this.parent.height)\n {\n this.parent.emit('zoomed', { viewport: this.parent, original: originalZoom, type: 'animate' });\n }\n }\n else\n {\n const percent = this.options.ease(this.time, 0, 1, this.options.time);\n\n if (this.width !== null)\n {\n const startWidth = this.startWidth as number;\n const deltaWidth = this.deltaWidth as number;\n\n this.parent.fitWidth(\n startWidth + (deltaWidth * percent),\n this.keepCenter,\n this.height === null);\n }\n if (this.height !== null)\n {\n const startHeight = this.startHeight as number;\n const deltaHeight = this.deltaHeight as number;\n\n this.parent.fitHeight(\n startHeight + (deltaHeight * percent),\n this.keepCenter,\n this.width === null);\n }\n if (this.width === null)\n {\n this.parent.scale.x = this.parent.scale.y;\n }\n else if (this.height === null)\n {\n this.parent.scale.y = this.parent.scale.x;\n }\n if (!this.keepCenter)\n {\n const startX = this.startX as number;\n const startY = this.startY as number;\n const deltaX = this.deltaX as number;\n const deltaY = this.deltaY as number;\n const original = new Point(this.parent.x, this.parent.y);\n\n this.parent.moveCenter(startX + (deltaX * percent), startY + (deltaY * percent));\n this.parent.emit('moved', { viewport: this.parent, original, type: 'animate' });\n }\n if (this.width || this.height)\n {\n this.parent.emit('zoomed', { viewport: this.parent, original: originalZoom, type: 'animate' });\n }\n }\n }\n}\n","import { Point, Rectangle } from '@pixi/math';\nimport { Plugin } from './Plugin';\nimport ease from '../ease';\n\nimport type { Drag } from './Drag';\nimport type { IDecelerateOptions } from './Decelerate';\nimport type { Pinch } from './Pinch';\nimport type { Viewport } from '../Viewport';\n\n/** Options for {@link Bounce}. */\nexport interface IBounceOptions {\n /** \"all\", \"horizontal\", \"vertical\", or combination of \"top\", \"bottom\", \"right\", \"left\" (e.g., 'top-bottom-right') */\n sides?:\n 'all'\n | 'horizontal'\n | 'vertical'\n | string;\n\n /** Friction to apply to decelerate if active */\n friction?: number;\n\n /** Time in ms to finish bounce */\n time?: number;\n\n /** Use this bounceBox instead of (0, 0, viewport.worldWidth, viewport.worldHeight) */\n bounceBox?: Rectangle | null;\n\n /** Ease function or name (see http://easings.net/ for supported names) */\n ease?: any;\n\n /** (top/bottom/center and left/right/center, or center) where to place world if too small for screen */\n underflow?: 'center' | string;\n}\n\n/** Bounce state along an axis */\nexport interface IBounceState {\n /** Elapsed time since bounce started */\n time: number;\n\n /** Starting coordinate */\n start: number;\n\n /** Change in coordinate through bounce */\n delta: number;\n\n /** Ending coordinate */\n end: number;\n}\n\nconst DEFAULT_BOUNCE_OPTIONS: Required<IBounceOptions> = {\n sides: 'all',\n friction: 0.5,\n time: 150,\n ease: 'easeInOutSine',\n underflow: 'center',\n bounceBox: null\n};\n\n/**\n * @fires bounce-start-x\n * @fires bounce.end-x\n * @fires bounce-start-y\n * @fires bounce-end-y\n * @public\n */\nexport class Bounce extends Plugin\n{\n /** The options passed to initialize this plugin, cannot be modified again. */\n public readonly options: Readonly<Required<IBounceOptions>>;\n\n /** Holds whether to bounce from left side. */\n public readonly left: boolean ;\n\n /** Holds whether to bounce from top side. */\n public readonly top: boolean;\n\n /** Holds whether to bounce from right side. */\n public readonly right: boolean;\n\n /** Holds whether to bounce from bottom side. */\n public readonly bottom: boolean;\n\n /** Direction of underflow along x-axis. */\n public readonly underflowX: -1 | 0 | 1;\n\n /** Direction of underflow along y-axis. */\n public readonly underflowY: -1 | 0 | 1;\n\n /** Easing */\n protected ease: any;\n\n /** Bounce state along x-axis */\n protected toX!: IBounceState | null;\n\n /** Bounce state along y-axis */\n protected toY!: IBounceState | null;\n\n /**\n * This is called by {@link Viewport.bounce}.\n */\n constructor(parent: Viewport, options: IBounceOptions = {})\n {\n super(parent);\n\n this.options = Object.assign({}, DEFAULT_BOUNCE_OPTIONS, options);\n this.ease = ease(this.options.ease, 'easeInOutSine');\n\n if (this.options.sides)\n {\n if (this.options.sides === 'all')\n {\n this.top = this.bottom = this.left = this.right = true;\n }\n else if (this.options.sides === 'horizontal')\n {\n this.right = this.left = true;\n this.top = this.bottom = false;\n }\n else if (this.options.sides === 'vertical')\n {\n this.left = this.right = false;\n this.top = this.bottom = true;\n }\n else\n {\n this.top = this.options.sides.indexOf('top') !== -1;\n this.bottom = this.options.sides.indexOf('bottom') !== -1;\n this.left = this.options.sides.indexOf('left') !== -1;\n this.right = this.options.sides.indexOf('right') !== -1;\n }\n } else {\n this.left = this.top = this.right = this.bottom = false;\n }\n\n const clamp = this.options.underflow.toLowerCase();\n\n if (clamp === 'center')\n {\n this.underflowX = 0;\n this.underflowY = 0;\n }\n else\n {\n this.underflowX = (clamp.indexOf('left') !== -1) ? -1 : (clamp.indexOf('right') !== -1) ? 1 : 0;\n this.underflowY = (clamp.indexOf('top') !== -1) ? -1 : (clamp.indexOf('bottom') !== -1) ? 1 : 0;\n }\n\n this.reset();\n }\n\n public isActive(): boolean\n {\n return this.toX !== null || this.toY !== null;\n }\n\n public down(): boolean\n {\n this.toX = this.toY = null;\n\n return false;\n }\n\n public up(): boolean\n {\n this.bounce();\n\n return false;\n }\n\n public update(elapsed: number): void\n {\n if (this.paused)\n {\n return;\n }\n\n this.bounce();\n\n if (this.toX)\n {\n const toX = this.toX;\n\n toX.time += elapsed;\n this.parent.emit('moved', { viewport: this.parent, type: 'bounce-x' });\n\n if (toX.time >= this.options.time)\n {\n this.parent.x = toX.end;\n this.toX = null;\n this.parent.emit('bounce-x-end', this.parent);\n }\n else\n {\n this.parent.x = this.ease(toX.time, toX.start, toX.delta, this.options.time);\n }\n }\n\n if (this.toY)\n {\n const toY = this.toY;\n\n toY.time += elapsed;\n this.parent.emit('moved', { viewport: this.parent, type: 'bounce-y' });\n\n if (toY.time >= this.options.time)\n {\n this.parent.y = toY.end;\n this.toY = null;\n this.parent.emit('bounce-y-end', this.parent);\n }\n else\n {\n this.parent.y = this.ease(toY.time, toY.start, toY.delta, this.options.time);\n }\n }\n }\n\n /** @internal */\n protected calcUnderflowX(): number\n {\n let x: number;\n\n switch (this.underflowX)\n {\n case -1:\n x = 0;\n break;\n case 1:\n x = (this.parent.screenWidth - this.parent.screenWorldWidth);\n break;\n default:\n x = (this.parent.screenWidth - this.parent.screenWorldWidth) / 2;\n }\n\n return x;\n }\n\n /** @internal */\n protected calcUnderflowY(): number\n {\n let y: number;\n\n switch (this.underflowY)\n {\n case -1:\n y = 0;\n break;\n case 1:\n y = (this.parent.screenHeight - this.parent.screenWorldHeight);\n break;\n default:\n y = (this.parent.screenHeight - this.parent.screenWorldHeight) / 2;\n }\n\n return y;\n }\n\n private oob(): Record<'left' | 'right' | 'top' | 'bottom', boolean> & Record<'topLeft' | 'bottomRight', Point>\n {\n const box = this.options.bounceBox;\n\n if (box)\n {\n const x1 = typeof box.x === 'undefined' ? 0 : box.x;\n const y1 = typeof box.y === 'undefined' ? 0 : box.y;\n const width = typeof box.width === 'undefined' ? this.parent.worldWidth : box.width;\n const height = typeof box.height === 'undefined' ? this.parent.worldHeight : box.height;\n\n return {\n left: this.parent.left < x1,\n right: this.parent.right > width,\n top: this.parent.top < y1,\n bottom: this.parent.bottom > height,\n topLeft: new Point(\n x1 * this.parent.scale.x,\n y1 * this.parent.scale.y\n ),\n bottomRight: new Point(\n width * this.parent.scale.x - this.parent.screenWidth,\n height * this.parent.scale.y - this.parent.screenHeight\n )\n };\n }\n\n return {\n left: this.parent.left < 0,\n right: this.parent.right > this.parent.worldWidth,\n top: this.parent.top < 0,\n bottom: this.parent.bottom > this.parent.worldHeight,\n topLeft: new Point(0, 0),\n bottomRight: new Point(\n this.parent.worldWidth * this.parent.scale.x - this.parent.screenWidth,\n this.parent.worldHeight * this.parent.scale.y - this.parent.screenHeight\n )\n };\n }\n\n public bounce(): void\n {\n if (this.paused)\n {\n return;\n }\n\n let oob;\n let decelerate: undefined | null | {\n percentChangeX?: number;\n percentChangeY?: number;\n x?: number;\n y?: number;\n options?: IDecelerateOptions\n } = this.parent.plugins.get('decelerate', true) as any;\n\n if (decelerate && (decelerate.x || decelerate.y))\n {\n if ((decelerate.x && decelerate.percentChangeX === decelerate.options?.friction) || (decelerate.y && decelerate.percentChangeY === decelerate.options?.friction))\n {\n oob = this.oob();\n if ((oob.left && this.left) || (oob.right && this.right))\n {\n decelerate.percentChangeX = this.options.friction;\n }\n if ((oob.top && this.top) || (oob.bottom && this.bottom))\n {\n decelerate.percentChangeY = this.options.friction;\n }\n }\n }\n const drag: Partial<Drag> = this.parent.plugins.get('drag', true) || {};\n const pinch: Partial<Pinch> = this.parent.plugins.get('pinch', true) || {};\n\n decelerate = decelerate || {};\n\n if (!drag?.active && !pinch?.active && ((!this.toX || !this.toY) && (!decelerate.x || !decelerate.y)))\n {\n oob = oob || this.oob();\n const topLeft = oob.topLeft;\n const bottomRight = oob.bottomRight;\n\n if (!this.toX && !decelerate.x)\n {\n let x = null;\n\n if (oob.left && this.left)\n {\n x = (this.parent.screenWorldWidth < this.parent.screenWidth) ? this.calcUnderflowX() : -topLeft.x;\n }\n else if (oob.right && this.right)\n {\n x = (this.parent.screenWorldWidth < this.parent.screenWidth) ? this.calcUnderflowX() : -bottomRight.x;\n }\n if (x !== null && this.parent.x !== x)\n {\n this.toX = { time: 0, start: this.parent.x, delta: x - this.parent.x, end: x };\n this.parent.emit('bounce-x-start', this.parent);\n }\n }\n if (!this.toY && !decelerate.y)\n {\n let y = null;\n\n if (oob.top && this.top)\n {\n y = (this.parent.screenWorldHeight < this.parent.screenHeight) ? this.calcUnderflowY() : -topLeft.y;\n }\n else if (oob.bottom && this.bottom)\n {\n y = (this.parent.screenWorldHeight < this.parent.screenHeight) ? this.calcUnderflowY() : -bottomRight.y;\n }\n if (y !== null && this.parent.y !== y)\n {\n this.toY = { time: 0, start: this.parent.y, delta: y - this.parent.y, end: y };\n this.parent.emit('bounce-y-start', this.parent);\n }\n }\n }\n }\n\n public reset(): void\n {\n this.toX = this.toY = null;\n this.bounce();\n }\n}\n","import { Plugin } from './Plugin';\n\nimport type { Viewport } from '../Viewport';\n\n/**\n * There are three ways to clamp:\n * 1. direction: 'all' = the world is clamped to its world boundaries, ie, you cannot drag any part of the world offscreen\n * direction: 'x' | 'y' = only the x or y direction is clamped to its world boundary\n * 2. left, right, top, bottom = true | number = the world is clamped to the world's pixel location for each side;\n * if any of these are set to true, then the location is set to the boundary [0, viewport.worldWidth/viewport.worldHeight]\n * eg: to allow the world to be completely dragged offscreen, set [-viewport.worldWidth, -viewport.worldHeight, viewport.worldWidth * 2, viewport.worldHeight * 2]\n *\n * Underflow determines what happens when the world is smaller than the viewport\n * 1. none = the world is clamped but there is no special behavior\n * 2. center = the world is centered on the viewport\n * 3. combination of top/bottom/center and left/right/center (case insensitive) = the world is stuck to the appropriate boundaries\n *\n */\nexport interface IClampOptions\n{\n /**\n * Clamp left; true = 0\n *\n * @default false\n */\n left?: number | boolean | null;\n\n /**\n * Clamp top; true = 0\n *\n * @default false\n */\n top?: number | boolean | null;\n\n /**\n * Clamp right; true = viewport.worldWidth\n *\n * @default false\n */\n right?: number | boolean | null;\n\n /**\n * Clamp bottom; true = viewport.worldHeight\n *\n * @default false\n */\n bottom?: number | boolean | null;\n\n /**\n * (all, x, or y) using clamps of [0, viewport.worldWidth/viewport.worldHeight]; replaces left/right/top/bottom if set\n *\n * @default null\n */\n direction?: 'all' | 'x' | 'y' | null;\n\n /**\n * Where to place world if too small for screen (e.g., top-right, center, none, bottomleft)\n *\n * @default 'center'\n */\n underflow?: 'center' | string;\n}\n\nconst DEFAULT_CLAMP_OPTIONS: Required<IClampOptions> = {\n left: false,\n right: false,\n top: false,\n bottom: false,\n direction: null,\n underflow: 'center'\n};\n\n/**\n * Plugin to clamp the viewport to a specific world bounding box.\n *\n * @public\n */\nexport class Clamp extends Plugin\n{\n /** Options used to initialize this plugin, cannot be modified later. */\n public readonly options: Required<IClampOptions>;\n\n /** Last state of viewport */\n protected last: {\n x: number | null;\n y: number | null;\n scaleX: number | null;\n scaleY: number | null;\n };\n\n protected noUnderflow!: boolean;\n protected underflowX!: -1 | 0 | 1;\n protected underflowY!: -1 | 0 | 1;\n\n /**\n * This is called by {@link Viewport.clamp}.\n */\n constructor(parent: Viewport, options : IClampOptions = {})\n {\n super(parent);\n this.options = Object.assign({}, DEFAULT_CLAMP_OPTIONS, options);\n\n if (this.options.direction)\n {\n this.options.left = this.options.direction === 'x' || this.options.direction === 'all' ? true : null;\n this.options.right = this.options.direction === 'x' || this.options.direction === 'all' ? true : null;\n this.options.top = this.options.direction === 'y' || this.options.direction === 'all' ? true : null;\n this.options.bottom = this.options.direction === 'y' || this.options.direction === 'all' ? true : null;\n }\n\n this.parseUnderflow();\n this.last = { x: null, y: null, scaleX: null, scaleY: null };\n this.update();\n }\n\n private parseUnderflow()\n {\n const clamp = this.options.underflow.toLowerCase();\n\n if (clamp === 'none')\n {\n this.noUnderflow = true;\n }\n else if (clamp === 'center')\n {\n this.underflowX = this.underflowY = 0;\n this.noUnderflow = false;\n }\n else\n {\n this.underflowX = (clamp.indexOf('left') !== -1) ? -1 : (clamp.indexOf('right') !== -1) ? 1 : 0;\n this.underflowY = (clamp.indexOf('top') !== -1) ? -1 : (clamp.indexOf('bottom') !== -1) ? 1 : 0;\n this.noUnderflow = false;\n }\n }\n\n public move(): boolean\n {\n this.update();\n\n return false;\n }\n\n public update(): void\n {\n if (this.paused)\n {\n return;\n }\n\n // only clamp on change\n if (this.parent.x === this.last.x\n && this.parent.y === this.last.y\n && this.parent.scale.x === this.last.scaleX\n && this.parent.scale.y === this.last.scaleY)\n {\n return;\n }\n const original = { x: this.parent.x, y: this.parent.y };\n // TODO: Fix\n const decelerate: any = (this.parent.plugins as any).decelerate || {};\n\n if (this.options.left !== null || this.options.right !== null)\n {\n let moved = false;\n\n if (!this.noUnderflow && this.parent.screenWorldWidth < this.parent.screenWidth)\n {\n switch (this.underflowX)\n {\n case -1:\n if (this.parent.x !== 0)\n {\n this.parent.x = 0;\n moved = true;\n }\n break;\n case 1:\n if (this.parent.x !== this.parent.screenWidth - this.parent.screenWorldWidth)\n {\n this.parent.x = this.parent.screenWidth - this.parent.screenWorldWidth;\n moved = true;\n }\n break;\n default:\n if (this.parent.x !== (this.parent.screenWidth - this.parent.screenWorldWidth) / 2)\n {\n this.parent.x = (this.parent.screenWidth - this.parent.screenWorldWidth) / 2;\n moved = true;\n }\n }\n }\n else\n {\n if (this.options.left !== null)\n {\n if (this.parent.left < (this.options.left === true ? 0 : this.options.left))\n {\n this.parent.x = -(this.options.left === true ? 0 : this.options.left) * this.parent.scale.x;\n decelerate.x = 0;\n moved = true;\n }\n }\n if (this.options.right !== null)\n {\n if (this.parent.right > (this.options.right === true ? this.parent.worldWidth : this.options.right))\n {\n this.parent.x = -(this.options.right === true ? this.parent.worldWidth : this.options.right) * this.parent.scale.x + this.parent.screenWidth;\n decelerate.x = 0;\n moved = true;\n }\n }\n }\n if (moved)\n {\n this.parent.emit('moved', { viewport: this.parent, original, type: 'clamp-x' });\n }\n }\n if (this.options.top !== null || this.options.bottom !== null)\n {\n let moved = false;\n\n if (!this.noUnderflow && this.parent.screenWorldHeight < this.parent.screenHeight)\n {\n switch (this.underflowY)\n {\n case -1:\n if (this.parent.y !== 0)\n {\n this.parent.y = 0;\n moved = true;\n }\n break;\n case 1:\n if (this.parent.y !== this.parent.screenHeight - this.parent.screenWorldHeight)\n {\n this.parent.y = (this.parent.screenHeight - this.parent.screenWorldHeight);\n moved = true;\n }\n break;\n default:\n if (this.parent.y !== (this.parent.screenHeight - this.parent.screenWorldHeight) / 2)\n {\n this.parent.y = (this.parent.screenHeight - this.parent.screenWorldHeight) / 2;\n moved = true;\n }\n }\n }\n else\n {\n if (this.options.top !== null)\n {\n if (this.parent.top < (this.options.top === true ? 0 : this.options.top))\n {\n this.parent.y = -(this.options.top === true ? 0 : this.options.top)\n * this.parent.scale.y;\n decelerate.y = 0;\n moved = true;\n }\n }\n if (this.options.bottom !== null)\n {\n if (this.parent.bottom > (this.options.bottom === true ? this.parent.worldHeight : this.options.bottom))\n {\n this.parent.y = -(this.options.bottom === true ? this.parent.worldHeight : this.options.bottom)\n * this.parent.scale.y + this.parent.screenHeight;\n decelerate.y = 0;\n moved = true;\n }\n }\n }\n if (moved)\n {\n this.parent.emit('moved', { viewport: this.parent, original, type: 'clamp-y' });\n }\n }\n this.last.x = this.parent.x;\n this.last.y = this.parent.y;\n this.last.scaleX = this.parent.scale.x;\n this.last.scaleY = this.parent.scale.y;\n }\n\n public reset(): void\n {\n this.update();\n }\n}\n","import { Plugin } from './Plugin';\n\nimport type { Viewport } from '../Viewport';\n\n/**\n * Options for {@link ClampZoom}.\n *\n * Use either minimum width/height or minimum scale\n */\nexport interface IClampZoomOptions\n{\n /** Minimum width */\n minWidth?: number | null;\n\n /** Minimum height */\n minHeight?: number | null;\n\n /** Maximum width */\n maxWidth?: number | null;\n\n /** Maximum height */\n maxHeight?: number | null;\n\n /** Minimum scale */\n minScale?: number | null | IScale;\n\n /** Maximum scale */\n maxScale?: number | null | IScale;\n}\n\nconst DEFAULT_CLAMP_ZOOM_OPTIONS: Required<IClampZoomOptions> = {\n minWidth: null,\n minHeight: null,\n maxWidth: null,\n maxHeight: null,\n minScale: null,\n maxScale: null\n};\n\n/**\n * Plugin to clamp the viewport's zoom to a specific range.\n *\n * @public\n */\nexport class ClampZoom extends Plugin\n{\n public readonly options: Required<IClampZoomOptions>;\n\n /**\n * This is called by {@link Viewport.clampZoom}.\n */\n constructor(parent: Viewport, options = {})\n {\n super(parent);\n this.options = Object.assign({}, DEFAULT_CLAMP_ZOOM_OPTIONS, options);\n\n this.clamp();\n }\n\n public resize(): void\n {\n this.clamp();\n }\n\n /** Clamp the viewport scale zoom) */\n public clamp(): void\n {\n if (this.paused)\n {\n return;\n }\n\n if (this.options.minWidth || this.options.minHeight || this.options.maxWidth || this.options.maxHeight)\n {\n let width = this.parent.worldScreenWidth;\n let height = this.parent.worldScreenHeight;\n\n if (this.options.minWidth !== null && width < this.options.minWidth)\n {\n const original = this.parent.scale.x;\n\n this.parent.fitWidth(this.options.minWidth, false, false, true);\n this.parent.scale.y *= this.parent.scale.x / original;\n width = this.parent.worldScreenWidth;\n height = this.parent.worldScreenHeight;\n this.parent.emit('zoomed', { viewport: this.parent, type: 'clamp-zoom' });\n }\n if (this.options.maxWidth !== null && width > this.options.maxWidth)\n {\n const original = this.parent.scale.x;\n\n this.parent.fitWidth(this.options.maxWidth, false, false, true);\n this.parent.scale.y *= this.parent.scale.x / original;\n width = this.parent.worldScreenWidth;\n height = this.parent.worldScreenHeight;\n this.parent.emit('zoomed', { viewport: this.parent, type: 'clamp-zoom' });\n }\n if (this.options.minHeight !== null && height < this.options.minHeight)\n {\n const original = this.parent.scale.y;\n\n this.parent.fitHeight(this.options.minHeight, false, false, true);\n this.parent.scale.x *= this.parent.scale.y / original;\n width = this.parent.worldScreenWidth;\n height = this.parent.worldScreenHeight;\n this.parent.emit('zoomed', { viewport: this.parent, type: 'clamp-zoom' });\n }\n if (this.options.maxHeight !== null && height > this.options.maxHeight)\n {\n const original = this.parent.scale.y;\n\n this.parent.fitHeight(this.options.maxHeight, false, false, true);\n this.parent.scale.x *= this.parent.scale.y / original;\n this.parent.emit('zoomed', { viewport: this.parent, type: 'clamp-zoom' });\n }\n }\n else\n if (this.options.minScale || this.options.maxScale)\n {\n const minScale: IScale = { x: null, y: null };\n const maxScale: IScale = { x: null, y: null };\n\n if (typeof this.options.minScale === 'number')\n {\n minScale.x = this.options.minScale;\n minScale.y = this.options.minScale;\n }\n else if (this.options.minScale !== null)\n {\n const optsMinScale = this.options.minScale as IScale;\n\n minScale.x = typeof optsMinScale.x === 'undefined' ? null : optsMinScale.x;\n minScale.y = typeof optsMinScale.y === 'undefined' ? null : optsMinScale.y;\n }\n\n if (typeof this.options.maxScale === 'number')\n {\n maxScale.x = this.options.maxScale;\n maxScale.y = this.options.maxScale;\n }\n else if (this.options.maxScale !== null)\n {\n const optsMaxScale = this.options.maxScale as IScale;\n\n maxScale.x = typeof optsMaxScale.x === 'undefined' ? null : optsMaxScale.x;\n maxScale.y = typeof optsMaxScale.y === 'undefined' ? null : optsMaxScale.y;\n }\n\n let scaleX = this.parent.scale.x;\n let scaleY = this.parent.scale.y;\n\n if (minScale.x !== null && scaleX < minScale.x)\n {\n scaleX = minScale.x;\n }\n if (maxScale.x !== null && scaleX > maxScale.x)\n {\n scaleX = maxScale.x;\n }\n if (minScale.y !== null && scaleY < minScale.y)\n {\n scaleY = minScale.y;\n }\n if (maxScale.y !== null && scaleY > maxScale.y)\n {\n scaleY = maxScale.y;\n }\n if (scaleX !== this.parent.scale.x || scaleY !== this.parent.scale.y)\n {\n this.parent.scale.set(scaleX, scaleY);\n this.parent.emit('zoomed', { viewport: this.parent, type: 'clamp-zoom' });\n }\n }\n }\n\n public reset(): void\n {\n this.clamp();\n }\n}\n\n/** This allows independent x and y values for min/maxScale */\nexport interface IScale {\n x: null | number\n y: null | number\n}\n","import { Plugin } from './Plugin';\n\nimport type { Point } from '@pixi/math';\nimport type { Viewport } from '../Viewport';\n\nexport interface IDecelerateOptions {\n /**\n * Percent to decelerate after movement. This should be between 0 and 1, exclusive.\n *\n * @default 0.95\n */\n friction?: number;\n\n /**\n * Percent to decelerate when past boundaries (only applicable when viewport.bounce() is active)\n *\n * @default 0.8\n */\n bounce?: number;\n\n /**\n * Minimum velocity before stopping/reversing acceleration\n *\n * @default 0.01\n */\n minSpeed?: number;\n}\n\n/** Viewport position snapshot that's saved by {@link DeceleratePlugin} to estimate panning velocity. */\nexport interface IDecelerateSnapshot {\n /** x-coordinate of the viewport. */\n x: number;\n\n /** y-coordinate of the viewport. */\n y: number;\n\n /** Time at which this snapshot was taken. */\n time: number;\n}\n\nconst DEFAULT_DECELERATE_OPTIONS: Required<IDecelerateOptions> = {\n friction: 0.98,\n bounce: 0.8,\n minSpeed: 0.01\n};\n\n/**\n * Time period of decay (1 frame)\n *\n * @internal\n * @ignore\n */\nconst TP = 16;\n\n/**\n * Plugin to decelerate viewport velocity smoothly after panning ends.\n *\n * @public\n */\nexport class Decelerate extends Plugin\n{\n /** Options used to initialize this plugin. */\n public readonly options: Required<IDecelerateOptions>;\n\n /**\n * x-component of the velocity of viewport provided by this plugin, at the current time.\n *\n * This is measured in px/frame, where a frame is normalized to 16 milliseconds.\n */\n public x!: number | null;\n\n /**\n * y-component of the velocity of the viewport provided by this plugin, at the current time.\n *\n * This is measured in px/frame, where a frame is normalized to 16 milliseconds.\n */\n public y!: number | null;\n\n /**\n * The decay factor for the x-component of the viewport.\n *\n * The viewport's velocity decreased by this amount each 16 milliseconds.\n */\n public percentChangeX!: number;\n\n /**\n * The decay factor for the y-component of the viewport.\n *\n * The viewport's velocity decreased by this amount each 16 milliseconds.\n */\n public percentChangeY!: number;\n\n /** Saved list of recent viewport position snapshots, to estimate velocity. */\n protected saved: Array<IDecelerateSnapshot>;\n\n /** The time since the user released panning of the viewport. */\n protected timeSinceRelease: number;\n\n /**\n * This is called by {@link Viewport.decelerate}.\n */\n constructor(parent: Viewport, options: IDecelerateOptions = {})\n {\n super(parent);\n\n this.options = Object.assign({}, DEFAULT_DECELERATE_OPTIONS, options);\n this.saved = [];\n this.timeSinceRelease = 0;\n\n this.reset();\n this.parent.on('moved', (data) => this.moved(data));\n }\n\n public down(): boolean\n {\n this.saved = [];\n this.x = this.y = null;\n\n return false;\n }\n\n public isActive(): boolean\n {\n return !!(this.x || this.y);\n }\n\n public move(): boolean\n {\n if (this.paused)\n {\n return false;\n }\n\n const count = this.parent.input.count();\n\n if (count === 1 || (count > 1 && !this.parent.plugins.get('pinch', true)))\n {\n this.saved.push({ x: this.parent.x, y: this.parent.y, time: performance.now() });\n\n if (this.saved.length > 60)\n {\n this.saved.splice(0, 30);\n }\n }\n\n // Silently recording viewport positions\n return false;\n }\n\n /** Listener to viewport's \"moved\" event. */\n protected moved(data: { type: 'clamp-x' | 'clamp-y'; original: Point }): void\n {\n if (this.saved.length)\n {\n const last = this.saved[this.saved.length - 1];\n\n if (data.type === 'clamp-x')\n {\n if (last.x === data.original.x)\n {\n last.x = this.parent.x;\n }\n }\n else if (data.type === 'clamp-y')\n {\n if (last.y === data.original.y)\n {\n last.y = this.parent.y;\n }\n }\n }\n }\n\n public up(): boolean\n {\n if (this.parent.input.count() === 0 && this.saved.length)\n {\n const now = performance.now();\n\n for (const save of this.saved)\n {\n if (save.time >= now - 100)\n {\n const time = now - save.time;\n\n this.x = (this.parent.x - save.x) / time;\n this.y = (this.parent.y - save.y) / time;\n this.percentChangeX = this.percentChangeY = this.options.friction;\n this.timeSinceRelease = 0;\n break;\n }\n }\n }\n\n return false;\n }\n\n /**\n * Manually activate deceleration, starting from the (x, y) velocity components passed in the options.\n *\n * @param {object} options\n * @param {number} [options.x] - Specify x-component of initial velocity.\n * @param {number} [options.y] - Specify y-component of initial velocity.\n */\n public activate(options: { x?: number; y?: number; }): void\n {\n options = options || {};\n\n if (typeof options.x !== 'undefined')\n {\n this.x = options.x;\n this.percentChangeX = this.options.friction;\n }\n if (typeof options.y !== 'undefined')\n {\n this.y = options.y;\n this.percentChangeY = this.options.friction;\n }\n }\n\n public update(elapsed: number): void\n {\n if (this.paused)\n {\n return;\n }\n\n /*\n * See https://github.com/davidfig/pixi-viewport/issues/271 for math.\n *\n * The viewport velocity (this.x, this.y) decays exponentially by the the decay factor\n * (this.percentChangeX, this.percentChangeY) each frame. This velocity function is integrated\n * to calculate the displacement.\n */\n\n const moved = this.x || this.y;\n\n const ti = this.timeSinceRelease;\n const tf = this.timeSinceRelease + elapsed;\n\n if (this.x)\n {\n const k = this.percentChangeX;\n const lnk = Math.log(k);\n\n // Apply velocity delta on the viewport x-coordinate.\n this.parent.x += ((this.x * TP) / lnk) * (Math.pow(k, tf / TP) - Math.pow(k, ti / TP));\n\n // Apply decay on x-component of velocity\n this.x *= Math.pow(this.percentChangeX, elapsed / TP);\n }\n if (this.y)\n {\n const k = this.percentChangeY;\n const lnk = Math.log(k);\n\n // Apply velocity delta on the viewport y-coordinate.\n this.parent.y += ((this.y * TP) / lnk) * (Math.pow(k, tf / TP) - Math.pow(k, ti / TP));\n\n // Apply decay on y-component of velocity\n this.y *= Math.pow(this.percentChangeY, elapsed / TP);\n }\n\n this.timeSinceRelease += elapsed;\n\n // End decelerate velocity once it goes under a certain amount of precision.\n if (this.x && this.y) {\n if (Math.abs(this.x) < this.options.minSpeed && Math.abs(this.y) < this.options.minSpeed) {\n this.x = 0;\n this.y = 0;\n }\n } else {\n if (Math.abs(this.x || 0) < this.options.minSpeed) {\n this.x = 0;\n }\n if (Math.abs(this.y || 0) < this.options.minSpeed) {\n this.y = 0;\n }\n }\n\n if (moved)\n {\n this.parent.emit('moved', { viewport: this.parent, type: 'decelerate' });\n }\n }\n\n public reset(): void\n {\n this.x = this.y = null;\n }\n}\n","import { Point } from '@pixi/math';\nimport { Plugin } from './Plugin';\n\nimport type { Decelerate } from './Decelerate';\nimport type { InteractionEvent } from '@pixi/interaction';\nimport type { IPointData } from '@pixi/math';\nimport type { Viewport } from '../Viewport';\n\n/** Options for {@link Drag}. */\nexport interface IDragOptions {\n /**\n * direction to drag\n *\n * @default \"all\"\n */\n direction?: string;\n\n /**\n * whether click to drag is active\n *\n * @default true\n */\n pressDrag?: boolean;\n\n /**\n * Use wheel to scroll in direction (unless wheel plugin is active)\n *\n * @default true\n */\n wheel?: boolean;\n\n /**\n * number of pixels to scroll with each wheel spin\n *\n * @default 1\n */\n wheelScroll?: number;\n\n /**\n * reverse the direction of the wheel scroll\n *\n * @default false\n */\n reverse?: boolean;\n\n /**\n * clamp wheel(to avoid weird bounce with mouse wheel). Can be 'x' or 'y' or `true`.\n *\n * @default false\n */\n clampWheel?: boolean | string;\n\n /**\n * where to place world if too small for screen\n *\n * @default \"center\"\n */\n underflow?: string;\n\n /**\n * factor to multiply drag to increase the speed of movement\n *\n * @default 1\n */\n factor?: number;\n\n /**\n * Changes which mouse buttons trigger drag.\n *\n * Use: 'all', 'left', right' 'middle', or some combination, like, 'middle-right'; you may want to set\n * `viewport.options.disableOnContextMenu` if you want to use right-click dragging.\n *\n * @default \"all\"\n */\n mouseButtons?: 'all' | string;\n\n /**\n * Array containing {@link key|https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code} codes of\n * keys that can be pressed for the drag to be triggered, e.g.: ['ShiftLeft', 'ShiftRight'}.\n *\n * @default null\n */\n keyToPress?: string[] | null;\n\n /**\n * Ignore keyToPress for touch events.\n *\n * @default false\n */\n ignoreKeyToPressOnTouch?: boolean;\n\n /**\n * Scaling factor for non-DOM_DELTA_PIXEL scrolling events.\n *\n * @default 20\n */\n lineHeight?: number;\n\n /**\n * Swap x and y axes when scrolling.\n *\n * @default false\n */\n wheelSwapAxes?: boolean;\n}\n\nconst DEFAULT_DRAG_OPTIONS: Required<IDragOptions> = {\n direction: 'all',\n pressDrag: true,\n wheel: true,\n wheelScroll: 1,\n reverse: false,\n clampWheel: false,\n underflow: 'center',\n factor: 1,\n mouseButtons: 'all',\n keyToPress: null,\n ignoreKeyToPressOnTouch: false,\n lineHeight: 20,\n wheelSwapAxes: false,\n};\n\n/**\n * Plugin to enable panning/dragging of the viewport to move around.\n *\n * @public\n */\nexport class Drag extends Plugin\n{\n /** Options used to initialize this plugin, cannot be modified later. */\n public readonly options: Readonly<Required<IDragOptions>>;\n\n /** Flags when viewport is moving. */\n protected moved: boolean;\n\n /** Factor to apply from {@link IDecelerateOptions}'s reverse. */\n protected reverse: 1 | -1;\n\n /** Holds whether dragging is enabled along the x-axis. */\n protected xDirection: boolean;\n\n /** Holds whether dragging is enabled along the y-axis. */\n protected yDirection: boolean;\n\n /** Flags whether the keys required to drag are pressed currently. */\n protected keyIsPressed: boolean;\n\n /** Holds whether the left, center, and right buttons are required to pan. */\n protected mouse!: [boolean, boolean, boolean];\n\n /** Underflow factor along x-axis */\n protected underflowX!: -1 | 0 | 1;\n\n /** Underflow factor along y-axis */\n protected underflowY!: -1 | 0 | 1;\n\n /** Last pointer position while panning. */\n protected last?: IPointData | null;\n\n /** The ID of the pointer currently panning the viewport. */\n protected current?: number;\n\n /**\n * This is called by {@link Viewport.drag}.\n */\n constructor(parent: Viewport, options = {})\n {\n super(parent);\n\n this.options = Object.assign({}, DEFAULT_DRAG_OPTIONS, options);\n this.moved = false;\n this.reverse = this.options.reverse ? 1 : -1;\n this.xDirection = !this.options.direction || this.options.direction === 'all' || this.options.direction === 'x';\n this.yDirection = !this.options.direction || this.options.direction === 'all' || this.options.direction === 'y';\n this.keyIsPressed = false;\n\n this.parseUnderflow();\n this.mouseButtons(this.options.mouseButtons);\n\n if (this.options.keyToPress)\n {\n this.handleKeyPresses(this.options.keyToPress);\n }\n }\n\n /**\n * Handles keypress events and set the keyIsPressed boolean accordingly\n *\n * @param {array} codes - key codes that can be used to trigger drag event\n */\n protected handleKeyPresses(codes: string[]): void\n {\n window.addEventListener('keydown', (e) =>\n {\n if (codes.includes(e.code))\n { this.keyIsPressed = true; }\n });\n\n window.addEventListener('keyup', (e) =>\n {\n if (codes.includes(e.code))\n { this.keyIsPressed = false; }\n });\n }\n\n /**\n * initialize mousebuttons array\n * @param {string} buttons\n */\n protected mouseButtons(buttons: string): void\n {\n if (!buttons || buttons === 'all')\n {\n this.mouse = [true, true, true];\n }\n else\n {\n this.mouse = [\n buttons.indexOf('left') !== -1,\n buttons.indexOf('middle') !== -1,\n buttons.indexOf('right') !== -1\n ];\n }\n }\n\n protected parseUnderflow(): void\n {\n const clamp = this.options.underflow.toLowerCase();\n\n if (clamp === 'center')\n {\n this.underflowX = 0;\n this.underflowY = 0;\n }\n else\n {\n if (clamp.includes('left'))\n {\n this.underflowX = -1;\n }\n else if (clamp.includes('right'))\n {\n this.underflowX = 1;\n }\n else\n {\n this.underflowX = 0;\n }\n if (clamp.includes('top'))\n {\n this.underflowY = -1;\n }\n else if (clamp.includes('bottom'))\n {\n this.underflowY = 1;\n }\n else\n {\n this.underflowY = 0;\n }\n }\n }\n\n /**\n * @param {PIXI.InteractionEvent} event\n * @returns {boolean}\n */\n protected checkButtons(event: InteractionEvent): boolean\n {\n const isMouse = event.data.pointerType === 'mouse';\n const count = this.parent.input.count();\n\n if ((count === 1) || (count > 1 && !this.parent.plugins.get('pinch', true)))\n {\n if (!isMouse || this.mouse[event.data.button])\n {\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * @param {PIXI.InteractionEvent} event\n * @returns {boolean}\n */\n protected checkKeyPress(event: InteractionEvent): boolean\n {\n return (!this.options.keyToPress\n || this.keyIsPressed\n || (this.options.ignoreKeyToPressOnTouch && event.data.pointerType === 'touch'));\n }\n\n public down(event: InteractionEvent): boolean\n {\n if (this.paused || !this.options.pressDrag)\n {\n return false;\n }\n if (this.checkButtons(event) && this.checkKeyPress(event))\n {\n this.last = { x: event.data.global.x, y: event.data.global.y };\n this.current = event.data.pointerId;\n\n return true;\n }\n this.last = null;\n\n return false;\n }\n\n get active(): boolean\n {\n return this.moved;\n }\n\n public move(event: InteractionEvent): boolean\n {\n if (this.paused || !this.options.pressDrag)\n {\n return false;\n }\n if (this.last && this.current === event.data.pointerId)\n {\n const x = event.data.global.x;\n const y = event.data.global.y;\n const count = this.parent.input.count();\n\n if (count === 1 || (count > 1 && !this.parent.plugins.get('pinch', true)))\n {\n const distX = x - this.last.x;\n const distY = y - this.last.y;\n\n if (this.moved\n || ((this.xDirection && this.parent.input.checkThreshold(distX))\n || (this.yDirection && this.parent.input.checkThreshold(distY))))\n {\n const newPoint = { x, y };\n\n if (this.xDirection)\n {\n this.parent.x += (newPoint.x - this.last.x) * this.options.factor;\n }\n if (this.yDirection)\n {\n this.parent.y += (newPoint.y - this.last.y) * this.options.factor;\n }\n this.last = newPoint;\n if (!this.moved)\n {\n this.parent.emit('drag-start', {\n event,\n screen: new Point(this.last.x, this.last.y),\n world: this.parent.toWorld(new Point(this.last.x, this.last.y)),\n viewport: this.parent\n });\n }\n this.moved = true;\n this.parent.emit('moved', { viewport: this.parent, type: 'drag' });\n\n return true;\n }\n }\n else\n {\n this.moved = false;\n }\n }\n\n return false;\n }\n\n public up(event: InteractionEvent): boolean\n {\n if (this.paused)\n {\n return false;\n }\n\n const touches = this.parent.input.touches;\n\n if (touches.length === 1)\n {\n const pointer = touches[0];\n\n if (pointer.last)\n {\n this.last = { x: pointer.last.x, y: pointer.last.y };\n this.current = pointer.id;\n }\n this.moved = false;\n\n return true;\n }\n else if (this.last)\n {\n if (this.moved)\n {\n const screen = new Point(this.last.x, this.last.y);\n\n this.parent.emit('drag-end', {\n event, screen,\n world: this.parent.toWorld(screen),\n viewport: this.parent,\n });\n this.last = null;\n this.moved = false;\n\n return true;\n }\n }\n\n return false;\n }\n\n public wheel(event: WheelEvent): boolean\n {\n if (this.paused)\n {\n return false;\n }\n\n if (this.options.wheel)\n {\n const wheel = this.parent.plugins.get('wheel', true);\n\n if (!wheel || (!wheel.options.wheelZoom && !event.ctrlKey))\n {\n const step = event.deltaMode ? this.options.lineHeight : 1;\n\n const deltas = [event.deltaX, event.deltaY];\n const [deltaX, deltaY] = this.options.wheelSwapAxes ? deltas.reverse() : deltas;\n\n if (this.xDirection)\n {\n this.parent.x += deltaX * step * this.options.wheelScroll * this.reverse;\n }\n if (this.yDirection)\n {\n this.parent.y += deltaY * step * this.options.wheelScroll * this.reverse;\n }\n if (this.options.clampWheel)\n {\n this.clamp();\n }\n this.parent.emit('wheel-scroll', this.parent);\n this.parent.emit('moved', { viewport: this.parent, type: 'wheel' });\n if (!this.parent.options.passiveWheel)\n {\n event.preventDefault();\n }\n if (this.parent.options.stopPropagation)\n {\n event.stopPropagation();\n }\n\n return true;\n }\n }\n\n return false;\n }\n\n public resume(): void\n {\n this.last = null;\n this.paused = false;\n }\n\n public clamp(): void\n {\n const decelerate: Partial<Decelerate> = this.parent.plugins.get('decelerate', true) || {};\n\n if (this.options.clampWheel !== 'y')\n {\n if (this.parent.screenWorldWidth < this.parent.screenWidth)\n {\n switch (this.underflowX)\n {\n case -1:\n this.parent.x = 0;\n break;\n case 1:\n this.parent.x = (this.parent.screenWidth - this.parent.screenWorldWidth);\n break;\n default:\n this.parent.x = (this.parent.screenWidth - this.parent.screenWorldWidth) / 2;\n }\n }\n else\n if (this.parent.left < 0)\n {\n this.parent.x = 0;\n decelerate.x = 0;\n }\n else if (this.parent.right > this.parent.worldWidth)\n {\n this.parent.x = (-this.parent.worldWidth * this.parent.scale.x) + this.parent.screenWidth;\n decelerate.x = 0;\n }\n }\n if (this.options.clampWheel !== 'x')\n {\n if (this.parent.screenWorldHeight < this.parent.screenHeight)\n {\n switch (this.underflowY)\n {\n case -1:\n this.parent.y = 0;\n break;\n case 1:\n this.parent.y = (this.parent.screenHeight - this.parent.screenWorldHeight);\n break;\n default:\n this.parent.y = (this.parent.screenHeight - this.parent.screenWorldHeight) / 2;\n }\n }\n else\n {\n if (this.parent.top < 0)\n {\n this.parent.y = 0;\n decelerate.y = 0;\n }\n if (this.parent.bottom > this.parent.worldHeight)\n {\n this.parent.y = (-this.parent.worldHeight * this.parent.scale.y) + this.parent.screenHeight;\n decelerate.y = 0;\n }\n }\n }\n }\n}\n","import { Plugin } from './Plugin';\n\nimport type { DisplayObject } from '@pixi/display';\nimport type { IPointData } from '@pixi/math';\nimport type { Viewport } from '../Viewport';\n\n/** Options for {@link Follow}. */\nexport interface IFollowOptions\n{\n /**\n * Speed to follow in px/frame (0 = teleport to location)\n *\n * @default 9\n */\n speed?: number;\n\n /**\n * Set acceleration to accelerate and decelerate at this rate; speed cannot be 0 to use acceleration\n *\n * @default null\n */\n acceleration?: number | null;\n\n /**\n * Radius (in world coordinates) of center circle where movement is allowed without moving the viewport\n *\n * @default null\n */\n radius?: number | null;\n}\n\nconst DEFAULT_FOLLOW_OPTIONS: Required<IFollowOptions> = {\n speed: 0,\n acceleration: null,\n radius: null\n};\n\n/**\n * Plugin to follow a display-object.\n *\n * @see Viewport.follow\n * @public\n */\nexport class Follow extends Plugin\n{\n /** The options used to initialize this plugin. */\n public readonly options: Required<IFollowOptions>;\n\n /** The target this plugin will make the viewport follow. */\n public target: DisplayObject;\n\n /** The velocity provided the viewport by following, at the current time. */\n protected velocity: IPointData;\n\n /**\n * This is called by {@link Viewport.follow}.\n *\n * @param parent\n * @param target - target to follow\n * @param options\n */\n constructor(parent: Viewport, target: DisplayObject, options: IFollowOptions = {})\n {\n super(parent);\n\n this.target = target;\n this.options = Object.assign({}, DEFAULT_FOLLOW_OPTIONS, options);\n this.velocity = { x: 0, y: 0 };\n }\n\n public update(elapsed: number): void\n {\n if (this.paused)\n {\n return;\n }\n\n const center = this.parent.center;\n let toX = this.target.x;\n let toY = this.target.y;\n\n if (this.options.radius)\n {\n const distance = Math.sqrt(Math.pow(this.target.y - center.y, 2) + Math.pow(this.target.x - center.x, 2));\n\n if (distance > this.options.radius)\n {\n const angle = Math.atan2(this.target.y - center.y, this.target.x - center.x);\n\n toX = this.target.x - (Math.cos(angle) * this.options.radius);\n toY = this.target.y - (Math.sin(angle) * this.options.radius);\n }\n else\n {\n return;\n }\n }\n\n const deltaX = toX - center.x;\n const deltaY = toY - center.y;\n\n if (deltaX || deltaY)\n {\n if (this.options.speed)\n {\n if (this.options.acceleration)\n {\n const angle = Math.atan2(toY - center.y, toX - center.x);\n const distance = Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));\n\n if (distance)\n {\n const decelerationDistance = (Math.pow(this.velocity.x, 2) + Math.pow(this.velocity.y, 2)) / (2 * this.options.acceleration);\n\n if (distance > decelerationDistance)\n {\n this.velocity = {\n x: Math.min(this.velocity.x + this.options.acceleration * elapsed, this.options.speed),\n y: Math.min(this.velocity.y + this.options.acceleration * elapsed, this.options.speed)\n };\n }\n else\n {\n this.velocity = {\n x: Math.max(this.velocity.x - this.options.acceleration * this.options.speed, 0),\n y: Math.max(this.velocity.y - this.options.acceleration * this.options.speed, 0)\n };\n }\n const changeX = Math.cos(angle) * this.velocity.x;\n const changeY = Math.sin(angle) * this.velocity.y;\n const x = Math.abs(changeX) > Math.abs(deltaX) ? toX : center.x + changeX;\n const y = Math.abs(changeY) > Math.abs(deltaY) ? toY : center.y + changeY;\n\n this.parent.moveCenter(x, y);\n this.parent.emit('moved', { viewport: this.parent, type: 'follow' });\n }\n }\n else\n {\n const angle = Math.atan2(toY - center.y, toX - center.x);\n const changeX = Math.cos(angle) * this.options.speed;\n const changeY = Math.sin(angle) * this.options.speed;\n const x = Math.abs(changeX) > Math.abs(deltaX) ? toX : center.x + changeX;\n const y = Math.abs(changeY) > Math.abs(deltaY) ? toY : center.y + changeY;\n\n this.parent.moveCenter(x, y);\n this.parent.emit('moved', { viewport: this.parent, type: 'follow' });\n }\n }\n else\n {\n this.parent.moveCenter(toX, toY);\n this.parent.emit('moved', { viewport: this.parent, type: 'follow' });\n }\n }\n }\n}\n","import { Plugin } from './Plugin';\n\nimport type { Viewport } from '../Viewport';\nimport type { InteractionEvent } from '@pixi/interaction';\n\n/** Insets for mouse edges scrolling regions */\nexport interface IMouseEdgesInsets {\n /** Distance from center of screen in screen pixels */\n radius?: number | null;\n\n /** Distance from all sides in screen pixels */\n distance?: number | null;\n\n /** Alternatively, set top distance (leave unset for no top scroll) */\n top?: number | null;\n\n /** Alternatively, set bottom distance (leave unset for no top scroll) */\n bottom?: number | null;\n\n /** Alternatively, set left distance (leave unset for no top scroll) */\n left?: number | null;\n\n /** Alternatively, set right distance (leave unset for no top scroll) */\n right?: number | null;\n}\n\n/** Options for {@link MouseEdges}. */\nexport interface IMouseEdgesOptions extends IMouseEdgesInsets {\n /** Speed in pixels/frame to scroll viewport */\n speed?: number;\n\n /** Reverse direction of scroll */\n reverse?: boolean;\n\n /** Don't use decelerate plugin even if it's installed */\n noDecelerate?: boolean;\n\n /**\n * If using radius, use linear movement (+/- 1, +/- 1) instead of angled movement.\n *\n * (Math.cos(angle from center), Math.sin(angle from center))\n */\n linear?: boolean;\n\n /** Allows plugin to continue working even when there's a `mousedown` event. */\n allowButtons?: boolean;\n}\n\nconst MOUSE_EDGES_OPTIONS: Required<IMouseEdgesOptions> = {\n radius: null,\n distance: null,\n top: null,\n bottom: null,\n left: null,\n right: null,\n speed: 8,\n reverse: false,\n noDecelerate: false,\n linear: false,\n allowButtons: false,\n};\n\n/**\n * Scroll viewport when mouse hovers near one of the edges.\n *\n * @event mouse-edge-start(Viewport) emitted when mouse-edge starts\n * @event mouse-edge-end(Viewport) emitted when mouse-edge ends\n */\nexport class MouseEdges extends Plugin\n{\n /** Options used to initialize this plugin, cannot be modified later. */\n public readonly options: Readonly<Required<IMouseEdgesOptions>>;\n\n /** Factor from reverse option. */\n protected readonly reverse: -1 | 1;\n\n /** Radius squared */\n protected readonly radiusSquared: number | null;\n\n /** Scroll region size on the left side. */\n protected left!: number | null;\n\n /** Scroll region size on the top size. */\n protected top!: number | null;\n\n /** Scroll region size on the right side. */\n protected right!: number | null;\n\n /** Scroll region size on the bottom side. */\n protected bottom!: number | null;\n\n protected horizontal?: number | null;\n\n protected vertical?: number | null;\n\n /**\n * This is called by {@link Viewport.mouseEdges}.\n */\n constructor(parent: Viewport, options: IMouseEdgesOptions = {})\n {\n super(parent);\n\n this.options = Object.assign({}, MOUSE_EDGES_OPTIONS, options);\n this.reverse = this.options.reverse ? 1 : -1;\n this.radiusSquared = typeof this.options.radius === 'number' ? Math.pow(this.options.radius, 2) : null;\n\n this.resize();\n }\n\n public resize(): void\n {\n const distance = this.options.distance;\n\n if (distance !== null)\n {\n this.left = distance;\n this.top = distance;\n this.right = this.parent.screenWidth - distance;\n this.bottom = this.parent.screenHeight - distance;\n }\n else if (!this.options.radius)\n {\n this.left = this.options.left;\n this.top = this.options.top;\n this.right = this.options.right === null ? null : this.parent.screenWidth - this.options.right;\n this.bottom = this.options.bottom === null ? null : this.parent.screenHeight - this.options.bottom;\n }\n }\n\n public down(): boolean\n {\n if (this.paused)\n {\n return false;\n }\n if (!this.options.allowButtons)\n {\n this.horizontal = this.vertical = null;\n }\n\n return false;\n }\n\n public move(event: InteractionEvent): boolean\n {\n if (this.paused)\n {\n return false;\n }\n if ((event.data.pointerType !== 'mouse' && event.data.identifier !== 1)\n || (!this.options.allowButtons && event.data.buttons !== 0))\n {\n return false;\n }\n\n const x = event.data.global.x;\n const y = event.data.global.y;\n\n if (this.radiusSquared)\n {\n const center = this.parent.toScreen(this.parent.center);\n const distance = Math.pow(center.x - x, 2) + Math.pow(center.y - y, 2);\n\n if (distance >= this.radiusSquared)\n {\n const angle = Math.atan2(center.y - y, center.x - x);\n\n if (this.options.linear)\n {\n this.horizontal = Math.round(Math.cos(angle)) * this.options.speed * this.reverse * (60 / 1000);\n this.vertical = Math.round(Math.sin(angle)) * this.options.speed * this.reverse * (60 / 1000);\n }\n else\n {\n this.horizontal = Math.cos(angle) * this.options.speed * this.reverse * (60 / 1000);\n this.vertical = Math.sin(angle) * this.options.speed * this.reverse * (60 / 1000);\n }\n }\n else\n {\n if (this.horizontal)\n {\n this.decelerateHorizontal();\n }\n if (this.vertical)\n {\n this.decelerateVertical();\n }\n\n this.horizontal = this.vertical = 0;\n }\n }\n else\n {\n if (this.left !== null && x < this.left)\n {\n this.horizontal = Number(this.reverse) * this.options.speed * (60 / 1000);\n }\n else if (this.right !== null && x > this.right)\n {\n this.horizontal = -1 * this.reverse * this.options.speed * (60 / 1000);\n }\n else\n {\n this.decelerateHorizontal();\n this.horizontal = 0;\n }\n if (this.top !== null && y < this.top)\n {\n this.vertical = Number(this.reverse) * this.options.speed * (60 / 1000);\n }\n else if (this.bottom !== null && y > this.bottom)\n {\n this.vertical = -1 * this.reverse * this.options.speed * (60 / 1000);\n }\n else\n {\n this.decelerateVertical();\n this.vertical = 0;\n }\n }\n\n return false;\n }\n\n private decelerateHorizontal(): void\n {\n const decelerate = this.parent.plugins.get('decelerate', true);\n\n if (this.horizontal && decelerate && !this.options.noDecelerate)\n {\n decelerate.activate({ x: (this.horizontal * this.options.speed * this.reverse) / (1000 / 60) });\n }\n }\n\n private decelerateVertical(): void\n {\n const decelerate = this.parent.plugins.get('decelerate', true);\n\n if (this.vertical && decelerate && !this.options.noDecelerate)\n {\n decelerate.activate({ y: (this.vertical * this.options.speed * this.reverse) / (1000 / 60) });\n }\n }\n\n public up(): boolean\n {\n if (this.paused)\n {\n return false;\n }\n if (this.horizontal)\n {\n this.decelerateHorizontal();\n }\n if (this.vertical)\n {\n this.decelerateVertical();\n }\n this.horizontal = this.vertical = null;\n\n return false;\n }\n\n public update(): void\n {\n if (this.paused)\n {\n return;\n }\n\n if (this.horizontal || this.vertical)\n {\n const center = this.parent.center;\n\n if (this.horizontal)\n {\n center.x += this.horizontal * this.options.speed;\n }\n if (this.vertical)\n {\n center.y += this.vertical * this.options.speed;\n }\n\n this.parent.moveCenter(center);\n this.parent.emit('moved', { viewport: this.parent, type: 'mouse-edges' });\n }\n }\n}\n","import { Plugin } from './Plugin';\nimport { Point } from '@pixi/math';\n\nimport type { IPointData } from '@pixi/math';\nimport type { InteractionEvent } from '@pixi/interaction';\nimport type { IViewportTouch } from '../InputManager';\nimport type { Viewport } from '../Viewport';\n\n/** Options for {@link Pinch}. */\nexport interface IPinchOptions\n{\n /** Disable two-finger dragging. */\n noDrag?: boolean;\n\n /**\n * Percent to modify pinch speed.\n *\n * @default 1\n */\n percent?: number;\n\n /**\n * Factor to multiply two-finger drag to increase speed of movement\n *\n * @default 1\n */\n factor?: number;\n\n /** Place this point at center during zoom instead of center of two fingers */\n center?: Point | null;\n\n /** Axis to zoom */\n axis?: 'all' | 'x' | 'y';\n}\n\nconst DEFAULT_PINCH_OPTIONS: Required<IPinchOptions> = {\n noDrag: false,\n percent: 1,\n center: null,\n factor: 1,\n axis: 'all',\n};\n\n/**\n * Plugin for enabling two-finger pinching (or dragging).\n *\n * @public\n */\nexport class Pinch extends Plugin\n{\n /** Options used to initialize this plugin. */\n public readonly options: Required<IPinchOptions>;\n\n /** Flags whether this plugin is active, i.e. a pointer is down on the viewport. */\n public active = false;\n\n /** Flags whether the viewport is being pinched. */\n public pinching = false;\n\n protected moved = false;\n protected lastCenter?: IPointData | null;\n\n /**\n * This is called by {@link Viewport.pinch}.\n */\n constructor(parent: Viewport, options: IPinchOptions = {})\n {\n super(parent);\n this.options = Object.assign({}, DEFAULT_PINCH_OPTIONS, options);\n }\n\n public down(): boolean\n {\n if (this.parent.input.count() >= 2)\n {\n this.active = true;\n\n return true;\n }\n\n return false;\n }\n\n public isAxisX(): boolean\n {\n return ['all', 'x'].includes(this.options.axis);\n }\n\n public isAxisY(): boolean\n {\n return ['all', 'y'].includes(this.options.axis);\n }\n\n public move(e: InteractionEvent): boolean\n {\n if (this.paused || !this.active)\n {\n return false;\n }\n\n const x = e.data.global.x;\n const y = e.data.global.y;\n\n const pointers = this.parent.input.touches;\n\n if (pointers.length >= 2)\n {\n const first = pointers[0] as IViewportTouch;\n const second = pointers[1] as IViewportTouch;\n const last = (first.last && second.last)\n ? Math.sqrt(Math.pow(second.last.x - first.last.x, 2) + Math.pow(second.last.y - first.last.y, 2))\n : null;\n\n if (first.id === e.data.pointerId)\n {\n first.last = { x, y, data: e.data } as IPointData;\n }\n else if (second.id === e.data.pointerId)\n {\n second.last = { x, y, data: e.data } as IPointData;\n }\n if (last)\n {\n let oldPoint: IPointData | undefined;\n\n const point = {\n x: (first.last as IPointData).x\n + ((second.last as IPointData).x - (first.last as IPointData).x) / 2,\n y: (first.last as IPointData).y\n + ((second.last as IPointData).y - (first.last as IPointData).y) / 2,\n };\n\n if (!this.options.center)\n {\n oldPoint = this.parent.toLocal(point);\n }\n let dist = Math.sqrt(Math.pow(\n (second.last as IPointData).x - (first.last as IPointData).x, 2)\n + Math.pow((second.last as IPointData).y - (first.last as IPointData).y, 2));\n\n dist = dist === 0 ? dist = 0.0000000001 : dist;\n\n const change = (1 - last / dist) * this.options.percent\n * (this.isAxisX() ? this.parent.scale.x : this.parent.scale.y);\n\n if (this.isAxisX())\n {\n this.parent.scale.x += change;\n }\n if (this.isAxisY())\n {\n this.parent.scale.y += change;\n }\n\n this.parent.emit('zoomed', { viewport: this.parent, type: 'pinch', center: point });\n\n const clamp = this.parent.plugins.get('clamp-zoom', true);\n\n if (clamp)\n {\n clamp.clamp();\n }\n if (this.options.center)\n {\n this.parent.moveCenter(this.options.center);\n }\n else\n {\n const newPoint = this.parent.toGlobal(oldPoint as IPointData);\n\n this.parent.x += (point.x - newPoint.x) * this.options.factor;\n this.parent.y += (point.y - newPoint.y) * this.options.factor;\n this.parent.emit('moved', { viewport: this.parent, type: 'pinch' });\n }\n if (!this.options.noDrag && this.lastCenter)\n {\n this.parent.x += (point.x - this.lastCenter.x) * this.options.factor;\n this.parent.y += (point.y - this.lastCenter.y) * this.options.factor;\n this.parent.emit('moved', { viewport: this.parent, type: 'pinch' });\n }\n\n this.lastCenter = point;\n this.moved = true;\n }\n else if (!this.pinching)\n {\n this.parent.emit('pinch-start', this.parent);\n this.pinching = true;\n }\n\n return true;\n }\n\n return false;\n }\n\n public up(): boolean\n {\n if (this.pinching)\n {\n if (this.parent.input.touches.length <= 1)\n {\n this.active = false;\n this.lastCenter = null;\n this.pinching = false;\n this.moved = false;\n this.parent.emit('pinch-end', this.parent);\n\n return true;\n }\n }\n\n return false;\n }\n}\n","import { Plugin } from './Plugin';\nimport ease from '../ease';\n\nimport type { Viewport } from '../Viewport';\n\nexport interface ISnapOptions\n{\n /** snap to the top-left of viewport instead of center */\n topLeft?: boolean;\n\n /**\n * Friction/frame to apply if decelerate is active\n *\n * @default 0.8\n */\n friction?: number;\n\n /**\n * @default 1000\n */\n time?: number;\n\n /** Easing function or name (see http://easings.net/ for supported names) */\n ease?: any;\n\n /**\n * Pause snapping with any user input on the viewport\n *\n * @default true\n */\n interrupt?: boolean;\n\n /**\n * Removes this plugin after snapping is complete\n *\n * @default false\n */\n removeOnComplete?: boolean;\n\n /**\n * Removes this plugin if interrupted by any user input\n *\n * @default false\n */\n removeOnInterrupt?: boolean;\n\n /**\n * Starts the snap immediately regardless of whether the viewport is at the desired location\n *\n * @default false\n */\n forceStart?: boolean;\n}\n\nconst DEFAULT_SNAP_OPTIONS: Required<ISnapOptions> = {\n topLeft: false,\n friction: 0.8,\n time: 1000,\n ease: 'easeInOutSine',\n interrupt: true,\n removeOnComplete: false,\n removeOnInterrupt: false,\n forceStart: false\n};\n\n/**\n * @event snap-start(Viewport) emitted each time a snap animation starts\n * @event snap-restart(Viewport) emitted each time a snap resets because of a change in viewport size\n * @event snap-end(Viewport) emitted each time snap reaches its target\n * @event snap-remove(Viewport) emitted if snap plugin is removed\n */\nexport class Snap extends Plugin\n{\n public readonly options: Required<ISnapOptions>;\n public ease?: any;\n public x: number;\n public y: number;\n\n protected percent?: number;\n protected snapping?: { time: number } | null;\n protected deltaX?: number;\n protected deltaY?: number;\n protected startX?: number;\n protected startY?: number;\n\n /**\n * This is called by {@link Viewport.snap}.\n */\n constructor(parent: Viewport, x: number, y: number, options: ISnapOptions = {})\n {\n super(parent);\n this.options = Object.assign({}, DEFAULT_SNAP_OPTIONS, options);\n this.ease = ease(options.ease, 'easeInOutSine');\n this.x = x;\n this.y = y;\n\n if (this.options.forceStart)\n {\n this.snapStart();\n }\n }\n\n public snapStart(): void\n {\n this.percent = 0;\n this.snapping = { time: 0 };\n const current = this.options.topLeft ? this.parent.corner : this.parent.center;\n\n this.deltaX = this.x - current.x;\n this.deltaY = this.y - current.y;\n this.startX = current.x;\n this.startY = current.y;\n this.parent.emit('snap-start', this.parent);\n }\n\n public wheel(): boolean\n {\n if (this.options.removeOnInterrupt)\n {\n this.parent.plugins.remove('snap');\n }\n\n return false;\n }\n\n public down(): boolean\n {\n if (this.options.removeOnInterrupt)\n {\n this.parent.plugins.remove('snap');\n }\n else if (this.options.interrupt)\n {\n this.snapping = null;\n }\n\n return false;\n }\n\n public up(): boolean\n {\n if (this.parent.input.count() === 0)\n {\n const decelerate = this.parent.plugins.get('decelerate', true);\n\n if (decelerate && (decelerate.x || decelerate.y))\n {\n decelerate.percentChangeX = decelerate.percentChangeY = this.options.friction;\n }\n }\n\n return false;\n }\n\n public update(elapsed: number): void\n {\n if (this.paused)\n {\n return;\n }\n if (this.options.interrupt && this.parent.input.count() !== 0)\n {\n return;\n }\n if (!this.snapping)\n {\n const current = this.options.topLeft ? this.parent.corner : this.parent.center;\n\n if (current.x !== this.x || current.y !== this.y)\n {\n this.snapStart();\n }\n }\n else\n {\n const snapping = this.snapping;\n\n snapping.time += elapsed;\n let finished;\n let x;\n let y;\n\n const startX = this.startX as number;\n const startY = this.startY as number;\n const deltaX = this.deltaX as number;\n const deltaY = this.deltaY as number;\n\n if (snapping.time > this.options.time)\n {\n finished = true;\n x = startX + deltaX;\n y = startY + deltaY;\n }\n else\n {\n const percent = this.ease(snapping.time, 0, 1, this.options.time);\n\n x = startX + (deltaX * percent);\n y = startY + (deltaY * percent);\n }\n if (this.options.topLeft)\n {\n this.parent.moveCorner(x, y);\n }\n else\n {\n this.parent.moveCenter(x, y);\n }\n\n this.parent.emit('moved', { viewport: this.parent, type: 'snap' });\n\n if (finished)\n {\n if (this.options.removeOnComplete)\n {\n this.parent.plugins.remove('snap');\n }\n this.parent.emit('snap-end', this.parent);\n this.snapping = null;\n }\n }\n }\n}\n","import { Plugin } from './Plugin';\nimport ease from '../ease';\n\nimport type { Point } from '@pixi/math';\nimport type { Viewport } from '../Viewport';\n\n/** Options for {@link SnapZoom}. */\nexport interface ISnapZoomOptions\n{\n /** the desired width to snap (to maintain aspect ratio, choose only width or height) */\n width?: number;\n\n /** the desired height to snap (to maintain aspect ratio, choose only width or height) */\n height?: number;\n\n /**\n * time for snapping in ms\n *\n * @default 1000\n */\n time?: number;\n\n /** ease function or name (see http://easings.net/ for supported names) */\n ease?: any;\n\n /** Place this point at center during zoom instead of center of the viewport */\n center?: Point | null;\n\n /**\n * Pause snapping with any user input on the viewport\n *\n * @default true\n */\n interrupt?: boolean;\n\n /**\n * Removes this plugin after snapping is complete\n *\n * @default false\n */\n removeOnComplete?: boolean;\n\n /**\n * Removes this plugin if interrupted by any user input\n *\n * @default false\n */\n removeOnInterrupt?: boolean;\n\n /**\n * Starts the snap immediately regardless of whether the viewport is at the desired zoom\n *\n * @default false\n */\n forceStart?: boolean;\n\n /**\n * Zoom but do not move\n *\n * @default false\n */\n noMove?: boolean;\n}\n\nconst DEFAULT_SNAP_ZOOM_OPTIONS: Required<ISnapZoomOptions> = {\n width: 0,\n height: 0,\n time: 1000,\n ease: 'easeInOutSine',\n center: null,\n interrupt: true,\n removeOnComplete: false,\n removeOnInterrupt: false,\n forceStart: false,\n noMove: false\n};\n\n/**\n * @event snap-zoom-start(Viewport) emitted each time a fit animation starts\n * @event snap-zoom-end(Viewport) emitted each time fit reaches its target\n * @event snap-zoom-end(Viewport) emitted each time fit reaches its target\n */\nexport class SnapZoom extends Plugin\n{\n public readonly options: Required<ISnapZoomOptions>;\n\n protected ease: any;\n protected xScale: number;\n protected yScale: number;\n protected xIndependent: boolean;\n protected yIndependent: boolean;\n protected snapping?: {\n time: number;\n startX: number;\n startY: number;\n deltaX: number;\n deltaY: number;\n } | null;\n\n /**\n * This is called by {@link Viewport.snapZoom}.\n */\n constructor(parent: Viewport, options: ISnapZoomOptions = {})\n {\n super(parent);\n\n this.options = Object.assign({}, DEFAULT_SNAP_ZOOM_OPTIONS, options);\n this.ease = ease(this.options.ease);\n\n // Assign defaults for typescript.\n this.xIndependent = false;\n this.yIndependent = false;\n this.xScale = 0;\n this.yScale = 0;\n\n if (this.options.width > 0)\n {\n this.xScale = parent.screenWidth / this.options.width;\n this.xIndependent = true;\n }\n if (this.options.height > 0)\n {\n this.yScale = parent.screenHeight / this.options.height;\n this.yIndependent = true;\n }\n\n this.xScale = this.xIndependent ? (this.xScale as number) : (this.yScale as number);\n this.yScale = this.yIndependent ? (this.yScale as number) : this.xScale;\n\n if (this.options.time === 0)\n {\n // TODO: Fix this\n // @ts-expect-error todo\n parent.container.scale.x = this.xScale;\n\n // TODO: Fix this\n // @ts-expect-error todo\n parent.container.scale.y = this.yScale;\n\n if (this.options.removeOnComplete)\n {\n this.parent.plugins.remove('snap-zoom');\n }\n }\n else if (options.forceStart)\n {\n this.createSnapping();\n }\n }\n\n private createSnapping(): void\n {\n const startWorldScreenWidth = this.parent.worldScreenWidth;\n const startWorldScreenHeight = this.parent.worldScreenHeight;\n const endWorldScreenWidth = this.parent.screenWidth / this.xScale;\n const endWorldScreenHeight = this.parent.screenHeight / this.yScale;\n\n this.snapping = {\n time: 0,\n startX: startWorldScreenWidth,\n startY: startWorldScreenHeight,\n deltaX: endWorldScreenWidth - startWorldScreenWidth,\n deltaY: endWorldScreenHeight - startWorldScreenHeight\n };\n\n this.parent.emit('snap-zoom-start', this.parent);\n }\n\n public resize(): void\n {\n this.snapping = null;\n\n if (this.options.width > 0)\n {\n this.xScale = this.parent.screenWidth / this.options.width;\n }\n if (this.options.height > 0)\n {\n this.yScale = this.parent.screenHeight / this.options.height;\n }\n this.xScale = this.xIndependent ? this.xScale : this.yScale;\n this.yScale = this.yIndependent ? this.yScale : this.xScale;\n }\n\n public wheel(): boolean\n {\n if (this.options.removeOnInterrupt)\n {\n this.parent.plugins.remove('snap-zoom');\n }\n\n return false;\n }\n\n public down(): boolean\n {\n if (this.options.removeOnInterrupt)\n {\n this.parent.plugins.remove('snap-zoom');\n }\n else if (this.options.interrupt)\n {\n this.snapping = null;\n }\n\n return false;\n }\n\n public update(elapsed: number): void\n {\n if (this.paused)\n {\n return;\n }\n if (this.options.interrupt && this.parent.input.count() !== 0)\n {\n return;\n }\n\n let oldCenter: Point | undefined;\n\n if (!this.options.center && !this.options.noMove)\n {\n oldCenter = this.parent.center;\n }\n if (!this.snapping)\n {\n if (this.parent.scale.x !== this.xScale || this.parent.scale.y !== this.yScale)\n {\n this.createSnapping();\n }\n }\n else if (this.snapping)\n {\n const snapping = this.snapping;\n\n snapping.time += elapsed;\n\n if (snapping.time >= this.options.time)\n {\n this.parent.scale.set(this.xScale, this.yScale);\n if (this.options.removeOnComplete)\n {\n this.parent.plugins.remove('snap-zoom');\n }\n this.parent.emit('snap-zoom-end', this.parent);\n this.snapping = null;\n }\n else\n {\n const snapping = this.snapping;\n const worldScreenWidth = this.ease(snapping.time, snapping.startX, snapping.deltaX, this.options.time);\n const worldScreenHeight = this.ease(snapping.time, snapping.startY, snapping.deltaY, this.options.time);\n\n this.parent.scale.x = this.parent.screenWidth / worldScreenWidth;\n this.parent.scale.y = this.parent.screenHeight / worldScreenHeight;\n }\n const clamp = this.parent.plugins.get('clamp-zoom', true);\n\n if (clamp)\n {\n clamp.clamp();\n }\n if (!this.options.noMove)\n {\n if (!this.options.center)\n {\n this.parent.moveCenter(oldCenter as Point);\n }\n else\n {\n this.parent.moveCenter(this.options.center);\n }\n }\n }\n }\n\n public resume(): void\n {\n this.snapping = null;\n super.resume();\n }\n}\n","import { Plugin } from './Plugin';\nimport { IPointData, Point } from '@pixi/math';\n\nimport type { Viewport } from '../Viewport';\n\n/** Options for {@link Wheel}. */\nexport interface IWheelOptions\n{\n /**\n * Percent to scroll with each spin\n *\n * @default 0.1\n */\n percent?: number;\n\n /**\n * smooth the zooming by providing the number of frames to zoom between wheel spins\n *\n * @default false\n */\n smooth?: false | number;\n\n /**\n * Stop smoothing with any user input on the viewport\n *\n * @default true\n */\n interrupt?: boolean;\n\n /**\n * Reverse the direction of the scroll\n *\n * @default false\n */\n reverse?: boolean;\n\n /**\n * Place this point at center during zoom instead of current mouse position\n *\n * @default null\n */\n center?: Point | null;\n\n /**\n * Scaling factor for non-DOM_DELTA_PIXEL scrolling events\n *\n * @default 20\n */\n lineHeight?: number;\n\n /**\n * Axis to zoom\n *\n * @default 'all'\n */\n axis?: 'all' | 'x' | 'y';\n\n /**\n * Array containing {@link key|https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code} codes of\n * keys that can be pressed for the zoom to be triggered, e.g.: ['ShiftLeft', 'ShiftRight'}.\n *\n * @default null\n */\n keyToPress?: string[] | null;\n\n /**\n * pinch the trackpad to zoom\n */\n trackpadPinch?: boolean;\n\n /**\n * zooms on wheel spin (use this as an alternative to drag.options.wheel)\n */\n wheelZoom?: boolean;\n}\n\nconst DEFAULT_WHEEL_OPTIONS: Required<IWheelOptions> = {\n percent: 0.1,\n smooth: false,\n interrupt: true,\n reverse: false,\n center: null,\n lineHeight: 20,\n axis: 'all',\n keyToPress: null,\n trackpadPinch: false,\n wheelZoom: true,\n};\n\n/**\n * Plugin for handling wheel scrolling for viewport zoom.\n *\n * @event wheel({wheel: {dx, dy, dz}, event, viewport})\n */\nexport class Wheel extends Plugin\n{\n public readonly options: Required<IWheelOptions>;\n\n protected smoothing?: IPointData | null;\n protected smoothingCenter?: Point | null;\n protected smoothingCount?: number;\n\n /** Flags whether the keys required to zoom are pressed currently. */\n protected keyIsPressed: boolean;\n\n /**\n * This is called by {@link Viewport.wheel}.\n */\n constructor(parent: Viewport, options: IWheelOptions = {})\n {\n super(parent);\n this.options = Object.assign({}, DEFAULT_WHEEL_OPTIONS, options);\n this.keyIsPressed = false;\n\n if (this.options.keyToPress)\n {\n this.handleKeyPresses(this.options.keyToPress);\n }\n }\n\n /**\n * Handles keypress events and set the keyIsPressed boolean accordingly\n *\n * @param {array} codes - key codes that can be used to trigger zoom event\n */\n protected handleKeyPresses(codes: string[]): void\n {\n window.addEventListener('keydown', (e) =>\n {\n if (codes.includes(e.code))\n {\n this.keyIsPressed = true;\n }\n });\n\n window.addEventListener('keyup', (e) =>\n {\n if (codes.includes(e.code))\n {\n this.keyIsPressed = false;\n }\n });\n }\n\n protected checkKeyPress(): boolean\n {\n return !this.options.keyToPress || this.keyIsPressed;\n }\n\n public down(): boolean\n {\n if (this.options.interrupt)\n {\n this.smoothing = null;\n }\n\n return false;\n }\n\n protected isAxisX(): boolean\n {\n return ['all', 'x'].includes(this.options.axis);\n }\n\n protected isAxisY(): boolean\n {\n return ['all', 'y'].includes(this.options.axis);\n }\n\n public update(): void\n {\n if (this.smoothing)\n {\n const point = this.smoothingCenter;\n const change = this.smoothing;\n let oldPoint;\n\n if (!this.options.center)\n {\n oldPoint = this.parent.toLocal(point as IPointData);\n }\n if (this.isAxisX())\n {\n this.parent.scale.x += change.x;\n }\n if (this.isAxisY())\n {\n this.parent.scale.y += change.y;\n }\n\n this.parent.emit('zoomed', { viewport: this.parent, type: 'wheel' });\n const clamp = this.parent.plugins.get('clamp-zoom', true);\n\n if (clamp)\n {\n clamp.clamp();\n }\n if (this.options.center)\n {\n this.parent.moveCenter(this.options.center);\n }\n else\n {\n const newPoint = this.parent.toGlobal(oldPoint as IPointData);\n\n this.parent.x += (point as IPointData).x - newPoint.x;\n this.parent.y += (point as IPointData).y - newPoint.y;\n }\n\n this.parent.emit('moved', { viewport: this.parent, type: 'wheel' });\n (this.smoothingCount as number)++;\n\n if ((this.smoothingCount as number) >= this.options.smooth)\n {\n this.smoothing = null;\n }\n }\n }\n\n private pinch(e: WheelEvent)\n {\n if (this.paused)\n {\n return;\n }\n\n const point = this.parent.input.getPointerPosition(e);\n const step = -e.deltaY * (e.deltaMode ? this.options.lineHeight : 1) / 200;\n const change = Math.pow(2, (1 + this.options.percent) * step);\n\n let oldPoint: IPointData | undefined;\n\n if (!this.options.center)\n {\n oldPoint = this.parent.toLocal(point);\n }\n if (this.isAxisX())\n {\n this.parent.scale.x *= change;\n }\n if (this.isAxisY())\n {\n this.parent.scale.y *= change;\n }\n this.parent.emit('zoomed', { viewport: this.parent, type: 'wheel' });\n const clamp = this.parent.plugins.get('clamp-zoom', true);\n\n if (clamp)\n {\n clamp.clamp();\n }\n if (this.options.center)\n {\n this.parent.moveCenter(this.options.center);\n }\n else\n {\n const newPoint = this.parent.toGlobal(oldPoint as IPointData);\n\n this.parent.x += point.x - newPoint.x;\n this.parent.y += point.y - newPoint.y;\n }\n this.parent.emit('moved', { viewport: this.parent, type: 'wheel' });\n this.parent.emit('wheel',\n { wheel: { dx: e.deltaX, dy: e.deltaY, dz: e.deltaZ }, event: e, viewport: this.parent });\n }\n\n public wheel(e: WheelEvent): boolean\n {\n if (this.paused)\n {\n return false;\n }\n\n if (!this.checkKeyPress())\n {\n return false;\n }\n\n if (e.ctrlKey && this.options.trackpadPinch)\n {\n this.pinch(e);\n }\n else if (this.options.wheelZoom)\n {\n const point = this.parent.input.getPointerPosition(e);\n const sign = this.options.reverse ? -1 : 1;\n const step = sign * -e.deltaY * (e.deltaMode ? this.options.lineHeight : 1) / 500;\n const change = Math.pow(2, (1 + this.options.percent) * step);\n\n if (this.options.smooth)\n {\n const original = {\n x: this.smoothing ? this.smoothing.x * (this.options.smooth - (this.smoothingCount as number)) : 0,\n y: this.smoothing ? this.smoothing.y * (this.options.smooth - (this.smoothingCount as number)) : 0\n };\n\n this.smoothing = {\n x: ((this.parent.scale.x + original.x) * change - this.parent.scale.x) / this.options.smooth,\n y: ((this.parent.scale.y + original.y) * change - this.parent.scale.y) / this.options.smooth,\n };\n this.smoothingCount = 0;\n this.smoothingCenter = point;\n }\n else\n {\n let oldPoint: IPointData | undefined;\n\n if (!this.options.center)\n {\n oldPoint = this.parent.toLocal(point);\n }\n if (this.isAxisX())\n {\n this.parent.scale.x *= change;\n }\n if (this.isAxisY())\n {\n this.parent.scale.y *= change;\n }\n this.parent.emit('zoomed', { viewport: this.parent, type: 'wheel' });\n const clamp = this.parent.plugins.get('clamp-zoom', true);\n\n if (clamp)\n {\n clamp.clamp();\n }\n if (this.options.center)\n {\n this.parent.moveCenter(this.options.center);\n }\n else\n {\n const newPoint = this.parent.toGlobal(oldPoint as IPointData);\n\n this.parent.x += point.x - newPoint.x;\n this.parent.y += point.y - newPoint.y;\n }\n }\n\n this.parent.emit('moved', { viewport: this.parent, type: 'wheel' });\n this.parent.emit('wheel',\n { wheel: { dx: e.deltaX, dy: e.deltaY, dz: e.deltaZ }, event: e, viewport: this.parent });\n }\n\n return !this.parent.options.passiveWheel;\n }\n}\n","import { Point, Rectangle } from '@pixi/math';\n\nimport type { IPointData } from '@pixi/math';\nimport type { InteractionEvent } from '@pixi/interaction';\nimport type { Viewport } from './Viewport';\n\nexport interface IViewportTouch\n{\n id: number;\n last: IPointData | null;\n}\n\n/**\n * Handles all input for Viewport\n *\n * @internal\n * @ignore\n * @private\n */\nexport class InputManager\n{\n public readonly viewport: Viewport;\n\n public clickedAvailable?: boolean;\n public isMouseDown?: boolean;\n public last?: Point | null;\n public wheelFunction?: (e: WheelEvent) => void;\n /** List of active touches on viewport */\n public touches: IViewportTouch[];\n\n constructor(viewport: Viewport)\n {\n this.viewport = viewport;\n this.touches = [];\n\n this.addListeners();\n }\n\n /** Add input listeners */\n private addListeners()\n {\n this.viewport.interactive = true;\n if (!this.viewport.forceHitArea)\n {\n this.viewport.hitArea = new Rectangle(0, 0, this.viewport.worldWidth, this.viewport.worldHeight);\n }\n this.viewport.on('pointerdown', this.down, this);\n this.viewport.on('pointermove', this.move, this);\n this.viewport.on('pointerup', this.up, this);\n this.viewport.on('pointerupoutside', this.up, this);\n this.viewport.on('pointercancel', this.up, this);\n this.viewport.on('pointerout', this.up, this);\n this.wheelFunction = (e) => this.handleWheel(e);\n this.viewport.options.divWheel.addEventListener(\n 'wheel',\n this.wheelFunction as any,\n { passive: this.viewport.options.passiveWheel });\n this.isMouseDown = false;\n }\n\n /**\n * Removes all event listeners from viewport\n * (useful for cleanup of wheel when removing viewport)\n */\n public destroy(): void\n {\n this.viewport.options.divWheel.removeEventListener('wheel', this.wheelFunction as any);\n }\n\n /**\n * handle down events for viewport\n *\n * @param {PIXI.InteractionEvent} event\n */\n public down(event: InteractionEvent): void\n {\n if (this.viewport.pause || !this.viewport.worldVisible)\n {\n return;\n }\n if (event.data.pointerType === 'mouse')\n {\n this.isMouseDown = true;\n }\n else if (!this.get(event.data.pointerId))\n {\n this.touches.push({ id: event.data.pointerId, last: null });\n }\n if (this.count() === 1)\n {\n this.last = event.data.global.clone();\n\n // clicked event does not fire if viewport is decelerating or bouncing\n const decelerate = this.viewport.plugins.get('decelerate', true);\n const bounce = this.viewport.plugins.get('bounce', true);\n\n if ((!decelerate || !decelerate.isActive()) && (!bounce || !bounce.isActive()))\n {\n this.clickedAvailable = true;\n }\n else\n {\n this.clickedAvailable = false;\n }\n }\n else\n {\n this.clickedAvailable = false;\n }\n\n const stop = this.viewport.plugins.down(event);\n\n if (stop && this.viewport.options.stopPropagation)\n {\n event.stopPropagation();\n }\n }\n\n /** Clears all pointer events */\n public clear(): void\n {\n this.isMouseDown = false;\n this.touches = [];\n this.last = null;\n }\n\n /**\n * @param {number} change\n * @returns whether change exceeds threshold\n */\n public checkThreshold(change: number): boolean\n {\n if (Math.abs(change) >= this.viewport.threshold)\n {\n return true;\n }\n\n return false;\n }\n\n /** Handle move events for viewport */\n public move(event: InteractionEvent): void\n {\n if (this.viewport.pause || !this.viewport.worldVisible)\n {\n return;\n }\n\n const stop = this.viewport.plugins.move(event);\n\n if (this.clickedAvailable && this.last)\n {\n const distX = event.data.global.x - this.last.x;\n const distY = event.data.global.y - this.last.y;\n\n if (this.checkThreshold(distX) || this.checkThreshold(distY))\n {\n this.clickedAvailable = false;\n }\n }\n\n if (stop && this.viewport.options.stopPropagation)\n {\n event.stopPropagation();\n }\n }\n\n /** Handle up events for viewport */\n public up(event: InteractionEvent): void\n {\n if (this.viewport.pause || !this.viewport.worldVisible)\n {\n return;\n }\n\n if (event.data.pointerType === 'mouse')\n {\n this.isMouseDown = false;\n }\n\n if (event.data.pointerType !== 'mouse')\n {\n this.remove(event.data.pointerId);\n }\n\n const stop = this.viewport.plugins.up(event);\n\n if (this.clickedAvailable && this.count() === 0 && this.last)\n {\n this.viewport.emit('clicked', {\n event,\n screen: this.last,\n world: this.viewport.toWorld(this.last),\n viewport: this\n });\n this.clickedAvailable = false;\n }\n\n if (stop && this.viewport.options.stopPropagation)\n {\n event.stopPropagation();\n }\n }\n\n /** Gets pointer position if this.interaction is set */\n public getPointerPosition(event: WheelEvent): Point\n {\n const point = new Point();\n\n if (this.viewport.options.interaction)\n {\n this.viewport.options.interaction.mapPositionToPoint(point, event.clientX, event.clientY);\n }\n else if (this.viewport.options.useDivWheelForInputManager && this.viewport.options.divWheel)\n {\n const rect = this.viewport.options.divWheel.getBoundingClientRect();\n\n point.x = event.clientX - rect.left;\n point.y = event.clientY - rect.top;\n }\n else\n {\n point.x = event.clientX;\n point.y = event.clientY;\n }\n\n return point;\n }\n\n /** Handle wheel events */\n public handleWheel(event: WheelEvent): void\n {\n if (this.viewport.pause || !this.viewport.worldVisible)\n {\n return;\n }\n\n // do not handle events coming from other elements\n if (this.viewport.options.interaction\n && (this.viewport.options.interaction as any).interactionDOMElement !== event.target)\n {\n return;\n }\n\n // only handle wheel events where the mouse is over the viewport\n const point = this.viewport.toLocal(this.getPointerPosition(event));\n\n if (this.viewport.left <= point.x\n && point.x <= this.viewport.right\n && this.viewport.top <= point.y\n && point.y <= this.viewport.bottom)\n {\n const stop = this.viewport.plugins.wheel(event);\n\n if (stop && !this.viewport.options.passiveWheel)\n {\n event.preventDefault();\n }\n }\n }\n\n public pause(): void\n {\n this.touches = [];\n this.isMouseDown = false;\n }\n\n /** Get touch by id */\n public get(id: number): IViewportTouch | null\n {\n for (const touch of this.touches)\n {\n if (touch.id === id)\n {\n return touch;\n }\n }\n\n return null;\n }\n\n /** Remove touch by number */\n remove(id: number): void\n {\n for (let i = 0; i < this.touches.length; i++)\n {\n if (this.touches[i].id === id)\n {\n this.touches.splice(i, 1);\n\n return;\n }\n }\n }\n\n /**\n * @returns {number} count of mouse/touch pointers that are down on the viewport\n */\n count(): number\n {\n return (this.isMouseDown ? 1 : 0) + this.touches.length;\n }\n}\n","import type {\n Animate,\n Bounce,\n Clamp,\n ClampZoom,\n Decelerate,\n Drag,\n Follow,\n MouseEdges,\n Pinch,\n Plugin,\n Snap,\n SnapZoom,\n Wheel,\n} from './plugins';\nimport type { InteractionEvent } from '@pixi/interaction';\nimport type { Viewport } from './Viewport';\n\nconst PLUGIN_ORDER = [\n 'drag',\n 'pinch',\n 'wheel',\n 'follow',\n 'mouse-edges',\n 'decelerate',\n 'animate',\n 'bounce',\n 'snap-zoom',\n 'clamp-zoom',\n 'snap',\n 'clamp',\n];\n\n/**\n * Use this to access current plugins or add user-defined plugins\n *\n * @public\n */\nexport class PluginManager\n{\n /** Maps mounted plugins by their type */\n public plugins: Partial<Record<string, Plugin>>;\n\n /**\n * List of plugins mounted\n *\n * This list is kept sorted by the internal priority of plugins (hard-coded).\n */\n public list: Array<Plugin>;\n\n /** The viewport using the plugins managed by `this`. */\n public readonly viewport: Viewport;\n\n /** This is called by {@link Viewport} to initialize the {@link Viewport.plugins plugins}. */\n constructor(viewport: Viewport)\n {\n this.viewport = viewport;\n this.list = [];\n this.plugins = {};\n }\n\n /**\n * Inserts a named plugin or a user plugin into the viewport\n * default plugin order: 'drag', 'pinch', 'wheel', 'follow', 'mouse-edges', 'decelerate', 'bounce',\n * 'snap-zoom', 'clamp-zoom', 'snap', 'clamp'\n *\n * @param {string} name of plugin\n * @param {Plugin} plugin - instantiated Plugin class\n * @param {number} index to insert userPlugin (otherwise inserts it at the end)\n */\n public add(name: string, plugin: Plugin, index: number = PLUGIN_ORDER.length)\n {\n this.plugins[name] = plugin;\n\n const current = PLUGIN_ORDER.indexOf(name);\n\n if (current !== -1)\n {\n PLUGIN_ORDER.splice(current, 1);\n }\n\n PLUGIN_ORDER.splice(index, 0, name);\n this.sort();\n }\n\n public get(name: 'animate', ignorePaused?: boolean): Animate | undefined | null;\n public get(name: 'bounce', ignorePaused?: boolean): Bounce | undefined | null;\n public get(name: 'clamp', ignorePaused?: boolean): Clamp | undefined | null;\n public get(name: 'clamp-zoom', ignorePaused?: boolean): ClampZoom | undefined | null;\n public get(name: 'decelerate', ignorePaused?: boolean): Decelerate | undefined | null;\n public get(name: 'drag', ignorePaused?: boolean): Drag | undefined | null;\n public get(name: 'follow', ignorePaused?: boolean): Follow | undefined | null;\n public get(name: 'mouse-edges', ignorePaused?: boolean): MouseEdges | undefined | null;\n public get(name: 'pinch', ignorePaused?: boolean): Pinch | undefined | null;\n public get(name: 'snap', ignorePaused?: boolean): Snap | undefined | null;\n public get(name: 'snap-zoom', ignorePaused?: boolean): SnapZoom | undefined | null;\n public get(name: 'wheel', ignorePaused?: boolean): Wheel | undefined | null;\n public get<T extends Plugin = Plugin>(name: string, ignorePaused?: boolean): T | undefined | null;\n\n /**\n * Get plugin\n *\n * @param {string} name of plugin\n * @param {boolean} [ignorePaused] return null if plugin is paused\n */\n public get<T extends Plugin = Plugin>(name: string, ignorePaused?: boolean): T | undefined | null\n {\n if (ignorePaused)\n {\n if (this.plugins[name]?.paused)\n {\n return null;\n }\n }\n\n return this.plugins[name] as T;\n }\n\n /**\n * Update all active plugins\n *\n * @internal\n * @ignore\n * @param {number} elapsed type in milliseconds since last update\n */\n public update(elapsed: number): void\n {\n for (const plugin of this.list)\n {\n plugin.update(elapsed);\n }\n }\n\n /**\n * Resize all active plugins\n *\n * @internal\n * @ignore\n */\n public resize(): void\n {\n for (const plugin of this.list)\n {\n plugin.resize();\n }\n }\n\n /** Clamps and resets bounce and decelerate (as needed) after manually moving viewport */\n public reset(): void\n {\n for (const plugin of this.list)\n {\n plugin.reset();\n }\n }\n\n /** removes all installed plugins */\n public removeAll(): void\n {\n this.plugins = {};\n this.sort();\n }\n\n /**\n * Removes installed plugin\n *\n * @param {string} name of plugin (e.g., 'drag', 'pinch')\n */\n public remove(name: string): void\n {\n if (this.plugins[name])\n {\n delete this.plugins[name];\n this.viewport.emit(`${name}-remove`);\n this.sort();\n }\n }\n\n /**\n * Pause plugin\n *\n * @param {string} name of plugin (e.g., 'drag', 'pinch')\n */\n public pause(name: string): void\n {\n this.plugins[name]?.pause();\n }\n\n /**\n * Resume plugin\n *\n * @param {string} name of plugin (e.g., 'drag', 'pinch')\n */\n public resume(name: string): void\n {\n this.plugins[name]?.resume();\n }\n\n /**\n * Sort plugins according to PLUGIN_ORDER\n *\n * @internal\n * @ignore\n */\n public sort()\n {\n this.list = [];\n\n for (const plugin of PLUGIN_ORDER)\n {\n if (this.plugins[plugin])\n {\n this.list.push(this.plugins[plugin] as Plugin);\n }\n }\n }\n\n /**\n * Handle down for all plugins\n *\n * @internal\n * @ignore\n */\n public down(event: InteractionEvent): boolean\n {\n let stop = false;\n\n for (const plugin of this.list)\n {\n if (plugin.down(event))\n {\n stop = true;\n }\n }\n\n return stop;\n }\n\n /**\n * Handle move for all plugins\n *\n * @internal\n * @ignore\n */\n public move(event: InteractionEvent): boolean\n {\n let stop = false;\n\n for (const plugin of this.viewport.plugins.list)\n {\n if (plugin.move(event))\n {\n stop = true;\n }\n }\n\n return stop;\n }\n\n /**\n * Handle up for all plugins\n *\n * @internal\n * @ignore\n */\n public up(event: InteractionEvent): boolean\n {\n let stop = false;\n\n for (const plugin of this.list)\n {\n if (plugin.up(event))\n {\n stop = true;\n }\n }\n\n return stop;\n }\n\n /**\n * Handle wheel event for all plugins\n *\n * @internal\n * @ignore\n */\n public wheel(e: WheelEvent): boolean\n {\n let result = false;\n\n for (const plugin of this.list)\n {\n if (plugin.wheel(e))\n {\n result = true;\n }\n }\n\n return result;\n }\n}\n","import { Container } from '@pixi/display';\nimport { IPointData, Point, Rectangle } from '@pixi/math';\nimport { Ticker } from '@pixi/ticker';\n\nimport { InputManager } from './InputManager';\nimport { PluginManager } from './PluginManager';\nimport {\n Animate, IAnimateOptions,\n Bounce, IBounceOptions,\n Clamp, IClampOptions,\n ClampZoom, IClampZoomOptions,\n Decelerate, IDecelerateOptions,\n Drag, IDragOptions,\n Follow, IFollowOptions,\n MouseEdges, IMouseEdgesOptions,\n Pinch, IPinchOptions,\n Snap, ISnapOptions,\n SnapZoom, ISnapZoomOptions,\n Wheel, IWheelOptions,\n} from './plugins';\n\nimport type { DisplayObject, IDestroyOptions } from '@pixi/display';\nimport type { IHitArea, InteractionManager } from '@pixi/interaction';\n\n/** Options for {@link Viewport}. */\nexport interface IViewportOptions\n{\n /** @default window.innerWidth */\n screenWidth?: number;\n\n /** @default window.innerHeight */\n screenHeight?: number;\n\n /** @default this.width */\n worldWidth?: number | null;\n\n /** @default this.height */\n worldHeight?: number | null;\n\n /**\n * Number of pixels to move to trigger an input event (e.g., drag, pinch) or disable a clicked event\n *\n * @default 5\n */\n threshold?: number;\n\n /**\n * Whether the 'wheel' event is set to passive (note: if false, e.preventDefault() will be called when wheel\n * is used over the viewport)\n *\n * @default true\n */\n passiveWheel?: boolean;\n\n /**\n * Whether to stopPropagation of events that impact the viewport (except wheel events, see options.passiveWheel)\n */\n stopPropagation?: boolean;\n\n /**\n * Change the default hitArea from world size to a new value\n */\n forceHitArea?: Rectangle | null;\n\n /**\n * Set this if you want to manually call update() function on each frame\n *\n * @default false\n */\n noTicker?: boolean;\n\n /**\n * InteractionManager, available from instantiated `WebGLRenderer/CanvasRenderer.plugins.interaction`\n *\n * It's used to calculate pointer postion relative to canvas location on screen\n */\n interaction?: InteractionManager | null;\n\n /**\n * Remove oncontextmenu=() => {} from the divWheel element\n */\n disableOnContextMenu?: boolean;\n\n /**\n * div to attach the wheel event\n *\n * @default document.body\n */\n divWheel?: HTMLElement;\n\n /**\n * Use this PIXI.ticker for updates\n *\n * @default PIXI.Ticker.shared\n */\n ticker?: Ticker;\n\n /**\n * Uses divWheel definition for InputManager to calculate positioning relative to containing div\n * this is used only if options.interaction is not defined\n */\n useDivWheelForInputManager?: boolean;\n}\n\nexport interface ICompleteViewportOptions extends IViewportOptions\n{\n screenWidth: number;\n screenHeight: number;\n threshold: number;\n passiveWheel: boolean;\n stopPropagation: boolean;\n noTicker: boolean;\n ticker: Ticker;\n}\n\nexport interface IViewportTransformState\n{\n x: number;\n y: number;\n scaleX: number;\n scaleY: number;\n}\n\nconst DEFAULT_VIEWPORT_OPTIONS: ICompleteViewportOptions = {\n screenWidth: window.innerWidth,\n screenHeight: window.innerHeight,\n worldWidth: null,\n worldHeight: null,\n threshold: 5,\n passiveWheel: true,\n stopPropagation: false,\n forceHitArea: null,\n noTicker: false,\n interaction: null,\n disableOnContextMenu: false,\n ticker: Ticker.shared,\n};\n\n/**\n * Main class to use when creating a Viewport\n *\n * @public\n * @fires clicked\n * @fires drag-start\n * @fires drag-end\n * @fires drag-remove\n * @fires pinch-start\n * @fires pinch-end\n * @fires pinch-remove\n * @fires snap-start\n * @fires snap-end\n * @fires snap-remove\n * @fires snap-zoom-start\n * @fires snap-zoom-end\n * @fires snap-zoom-remove\n * @fires bounce-x-start\n * @fires bounce-x-end\n * @fires bounce-y-start\n * @fires bounce-y-end\n * @fires bounce-remove\n * @fires wheel\n * @fires wheel-remove\n * @fires wheel-scroll\n * @fires wheel-scroll-remove\n * @fires mouse-edge-start\n * @fires mouse-edge-end\n * @fires mouse-edge-remove\n * @fires moved\n * @fires moved-end\n * @fires zoomed\n * @fires zoomed-end\n * @fires frame-end\n */\nexport class Viewport extends Container\n{\n /** Flags whether the viewport is being panned */\n public moving?: boolean;\n\n public screenWidth: number;\n public screenHeight: number;\n\n /** Number of pixels to move to trigger an input event (e.g., drag, pinch) or disable a clicked event */\n public threshold: number;\n\n public readonly input: InputManager;\n\n /** Use this to add user plugins or access existing plugins (e.g., to pause, resume, or remove them) */\n public readonly plugins: PluginManager;\n\n /** Flags whether the viewport zoom is being changed. */\n public zooming?: boolean;\n\n public lastViewport?: IViewportTransformState | null;\n\n /** The options passed when creating this viewport, merged with the default values */\n public readonly options: ICompleteViewportOptions & { divWheel: HTMLElement };\n\n private _dirty?: boolean;\n private _forceHitArea?: IHitArea | null;\n private _hitAreaDefault?: Rectangle;\n private _pause?: boolean;\n private readonly tickerFunction?: () => void;\n private _worldWidth?: number | null;\n private _worldHeight?: number | null;\n private _disableOnContextMenu = (e: MouseEvent) => e.preventDefault();\n\n /**\n * @param {IViewportOptions} ViewportOptions\n * @param {number} [options.screenWidth=window.innerWidth]\n * @param {number} [options.screenHeight=window.innerHeight]\n * @param {number} [options.worldWidth=this.width]\n * @param {number} [options.worldHeight=this.height]\n * @param {number} [options.threshold=5] number of pixels to move to trigger an input event (e.g., drag, pinch)\n * or disable a clicked event\n * @param {boolean} [options.passiveWheel=true] whether the 'wheel' event is set to passive (note: if false,\n * e.preventDefault() will be called when wheel is used over the viewport)\n * @param {boolean} [options.stopPropagation=false] whether to stopPropagation of events that impact the viewport\n * (except wheel events, see options.passiveWheel)\n * @param {HitArea} [options.forceHitArea] change the default hitArea from world size to a new value\n * @param {boolean} [options.noTicker] set this if you want to manually call update() function on each frame\n * @param {PIXI.Ticker} [options.ticker=PIXI.Ticker.shared] use this PIXI.ticker for updates\n * @param {PIXI.InteractionManager} [options.interaction=null] InteractionManager, available from instantiated\n * WebGLRenderer/CanvasRenderer.plugins.interaction - used to calculate pointer position relative to canvas\n * location on screen\n * @param {HTMLElement} [options.divWheel=document.body] div to attach the wheel event\n * @param {boolean} [options.disableOnContextMenu] remove oncontextmenu=() => {} from the divWheel element\n */\n constructor(options: IViewportOptions = {})\n {\n super();\n this.options = Object.assign(\n {},\n { divWheel: document.body },\n DEFAULT_VIEWPORT_OPTIONS,\n options\n );\n\n this.screenWidth = this.options.screenWidth;\n this.screenHeight = this.options.screenHeight;\n\n this._worldWidth = this.options.worldWidth;\n this._worldHeight = this.options.worldHeight;\n this.forceHitArea = this.options.forceHitArea;\n this.threshold = this.options.threshold;\n\n this.options.divWheel = this.options.divWheel || document.body;\n\n if (this.options.disableOnContextMenu)\n {\n this.options.divWheel.addEventListener('contextmenu', this._disableOnContextMenu);\n }\n if (!this.options.noTicker)\n {\n this.tickerFunction = () => this.update(this.options.ticker.elapsedMS);\n this.options.ticker.add(this.tickerFunction);\n }\n\n this.input = new InputManager(this);\n this.plugins = new PluginManager(this);\n }\n\n /** Overrides PIXI.Container's destroy to also remove the 'wheel' and PIXI.Ticker listeners */\n destroy(options?: IDestroyOptions): void\n {\n if (!this.options.noTicker && this.tickerFunction)\n {\n this.options.ticker.remove(this.tickerFunction);\n }\n if (this.options.disableOnContextMenu)\n {\n this.options.divWheel.removeEventListener('contextmenu', this._disableOnContextMenu);\n }\n\n this.input.destroy();\n super.destroy(options);\n }\n\n /**\n * Update viewport on each frame.\n *\n * By default, you do not need to call this unless you set `options.noTicker=true`.\n *\n * @param {number} elapsed time in milliseconds since last update\n */\n update(elapsed: number): void\n {\n if (!this.pause)\n {\n this.plugins.update(elapsed);\n\n if (this.lastViewport)\n {\n // Check for moved-end event\n if (this.lastViewport.x !== this.x || this.lastViewport.y !== this.y)\n {\n this.moving = true;\n }\n else if (this.moving)\n {\n this.emit('moved-end', this);\n this.moving = false;\n }\n\n // Check for zoomed-end event\n if (this.lastViewport.scaleX !== this.scale.x || this.lastViewport.scaleY !== this.scale.y)\n {\n this.zooming = true;\n }\n else if (this.zooming)\n {\n this.emit('zoomed-end', this);\n this.zooming = false;\n }\n }\n\n if (!this.forceHitArea)\n {\n this._hitAreaDefault = new Rectangle(this.left, this.top, this.worldScreenWidth, this.worldScreenHeight);\n this.hitArea = this._hitAreaDefault;\n }\n\n this._dirty = this._dirty || !this.lastViewport\n || this.lastViewport.x !== this.x || this.lastViewport.y !== this.y\n || this.lastViewport.scaleX !== this.scale.x || this.lastViewport.scaleY !== this.scale.y;\n\n this.lastViewport = {\n x: this.x,\n y: this.y,\n scaleX: this.scale.x,\n scaleY: this.scale.y\n };\n this.emit('frame-end', this);\n }\n }\n\n /**\n * Use this to set screen and world sizes, needed for pinch/wheel/clamp/bounce.\n * @param {number} screenWidth=window.innerWidth\n * @param {number} screenHeight=window.innerHeight\n * @param {number} [worldWidth]\n * @param {number} [worldHeight]\n */\n resize(\n screenWidth: number = window.innerWidth,\n screenHeight: number = window.innerHeight,\n worldWidth?: number,\n worldHeight?: number\n ): void\n {\n this.screenWidth = screenWidth;\n this.screenHeight = screenHeight;\n\n if (typeof worldWidth !== 'undefined')\n {\n this._worldWidth = worldWidth;\n }\n if (typeof worldHeight !== 'undefined')\n {\n this._worldHeight = worldHeight;\n }\n\n this.plugins.resize();\n this.dirty = true;\n }\n\n /** World width, in pixels */\n get worldWidth(): number\n {\n if (this._worldWidth)\n {\n return this._worldWidth;\n }\n\n return this.width / this.scale.x;\n }\n set worldWidth(value: number)\n {\n this._worldWidth = value;\n this.plugins.resize();\n }\n\n /** World height, in pixels */\n get worldHeight(): number\n {\n if (this._worldHeight)\n {\n return this._worldHeight;\n }\n\n return this.height / this.scale.y;\n }\n set worldHeight(value: number)\n {\n this._worldHeight = value;\n this.plugins.resize();\n }\n\n /** Get visible world bounds of viewport */\n public getVisibleBounds(): Rectangle\n {\n return new Rectangle(this.left, this.top, this.worldScreenWidth, this.worldScreenHeight);\n }\n\n /** Change coordinates from screen to world */\n public toWorld<P extends IPointData = Point>(x: number, y: number): P;\n /** Change coordinates from screen to world */\n public toWorld<P extends IPointData = Point>(screenPoint: IPointData): P;\n\n /**\n * Changes coordinate from screen to world\n * @param {number|PIXI.Point} x\n * @param {number} y\n * @returns {PIXI.Point}\n */\n public toWorld<P extends IPointData = Point>(x: number | IPointData, y?: number): P\n {\n if (arguments.length === 2)\n {\n return this.toLocal<P>(new Point(x as number, y));\n }\n\n return this.toLocal<P>(x as IPointData);\n }\n\n /** Change coordinates from world to screen */\n public toScreen<P extends IPointData = Point>(x: number, y: number): P\n /** Change coordinates from world to screen */\n public toScreen<P extends IPointData = Point>(worldPoint: IPointData): P\n\n /**\n * Changes coordinate from world to screen\n * @param {number|PIXI.Point} x\n * @param {number} y\n * @returns {PIXI.Point}\n */\n public toScreen<P extends IPointData = Point>(x: number | IPointData, y?: number): P\n {\n if (arguments.length === 2)\n {\n return this.toGlobal<P>(new Point(x as number, y));\n }\n\n return this.toGlobal<P>(x as IPointData);\n }\n\n /** Screen width in world coordinates */\n get worldScreenWidth(): number\n {\n return this.screenWidth / this.scale.x;\n }\n\n /** Screen height in world coordinates */\n get worldScreenHeight(): number\n {\n return this.screenHeight / this.scale.y;\n }\n\n /** World width in screen coordinates */\n get screenWorldWidth(): number\n {\n return this.worldWidth * this.scale.x;\n }\n\n /** World height in screen coordinates */\n get screenWorldHeight(): number\n {\n return this.worldHeight * this.scale.y;\n }\n\n /** Center of screen in world coordinates */\n get center(): Point\n {\n return new Point(\n (this.worldScreenWidth / 2) - (this.x / this.scale.x),\n (this.worldScreenHeight / 2) - (this.y / this.scale.y),\n );\n }\n set center(value: Point)\n {\n this.moveCenter(value);\n }\n\n public moveCenter(x: number, y: number): Viewport;\n\n /** Move center of viewport to {@code center}. */\n public moveCenter(center: IPointData): Viewport;\n\n /**\n * Move center of viewport to (x, y)\n * @param {number|PIXI.Point} x\n * @param {number} [y]\n * @return {Viewport}\n */\n public moveCenter(...args: [number, number] | [IPointData]): Viewport\n {\n let x: number;\n let y: number;\n\n if (typeof args[0] === 'number')\n {\n x = args[0];\n y = args[1] as number;\n }\n else\n {\n x = args[0].x;\n y = args[0].y;\n }\n\n const newX = ((this.worldScreenWidth / 2) - x) * this.scale.x;\n const newY = ((this.worldScreenHeight / 2) - y) * this.scale.y;\n\n if (this.x !== newX || this.y !== newY)\n {\n this.position.set(newX, newY);\n this.plugins.reset();\n this.dirty = true;\n }\n\n return this;\n }\n\n /** Top-left corner of Viewport */\n get corner(): Point\n {\n return new Point(-this.x / this.scale.x, -this.y / this.scale.y);\n }\n set corner(value: Point)\n {\n this.moveCorner(value);\n }\n\n /** Move Viewport's top-left corner; also clamps and resets decelerate and bounce (as needed) */\n public moveCorner(x: number, y: number): Viewport;\n\n /** move Viewport's top-left corner; also clamps and resets decelerate and bounce (as needed) */\n public moveCorner(center: Point): Viewport;\n\n /**\n * MoveCorner\n * @param {number|PIXI.Point} x\n * @param {number} [y]\n * @returns {Viewport}\n */\n public moveCorner(...args: [number, number] | [Point]): Viewport\n {\n let x;\n let y;\n\n if (args.length === 1)\n {\n x = -args[0].x * this.scale.x;\n y = -args[0].y * this.scale.y;\n }\n else\n {\n x = -args[0] * this.scale.x;\n y = -args[1] * this.scale.y;\n }\n\n if (x !== this.x || y !== this.y)\n {\n this.position.set(x, y);\n this.plugins.reset();\n this.dirty = true;\n }\n\n return this;\n }\n\n /** Get how many world pixels fit in screen's width */\n get screenWidthInWorldPixels(): number\n {\n return this.screenWidth / this.scale.x;\n }\n\n /** Get how many world pixels fit on screen's height */\n get screenHeightInWorldPixels(): number\n {\n return this.screenHeight / this.scale.y;\n }\n\n /**\n * Find the scale value that fits a world width on the screen\n * does not change the viewport (use fit... to change)\n *\n * @param width - Width in world pixels\n * @return - scale\n */\n findFitWidth(width: number): number\n {\n return this.screenWidth / width;\n }\n\n /**\n * Finds the scale value that fits a world height on the screens\n * does not change the viewport (use fit... to change)\n *\n * @param height - Height in world pixels\n * @return - scale\n */\n findFitHeight(height: number): number\n {\n return this.screenHeight / height;\n }\n\n /**\n * Finds the scale value that fits the smaller of a world width and world height on the screen\n * does not change the viewport (use fit... to change)\n *\n * @param {number} width in world pixels\n * @param {number} height in world pixels\n * @returns {number} scale\n */\n findFit(width: number, height: number): number\n {\n const scaleX = this.screenWidth / width;\n const scaleY = this.screenHeight / height;\n\n return Math.min(scaleX, scaleY);\n }\n\n /**\n * Finds the scale value that fits the larger of a world width and world height on the screen\n * does not change the viewport (use fit... to change)\n *\n * @param {number} width in world pixels\n * @param {number} height in world pixels\n * @returns {number} scale\n */\n findCover(width: number, height: number): number\n {\n const scaleX = this.screenWidth / width;\n const scaleY = this.screenHeight / height;\n\n return Math.max(scaleX, scaleY);\n }\n\n /**\n * Change zoom so the width fits in the viewport\n *\n * @param width - width in world coordinates\n * @param center - maintain the same center\n * @param scaleY - whether to set scaleY=scaleX\n * @param noClamp - whether to disable clamp-zoom\n * @returns {Viewport} this\n */\n fitWidth(width = this.worldWidth, center?: boolean, scaleY = true, noClamp?: boolean): Viewport\n {\n let save: Point | undefined;\n\n if (center)\n {\n save = this.center;\n }\n this.scale.x = this.screenWidth / width;\n\n if (scaleY)\n {\n this.scale.y = this.scale.x;\n }\n\n const clampZoom = this.plugins.get('clamp-zoom', true);\n\n if (!noClamp && clampZoom)\n {\n clampZoom.clamp();\n }\n\n if (center && save)\n {\n this.moveCenter(save);\n }\n\n return this;\n }\n\n /**\n * Change zoom so the height fits in the viewport\n *\n * @param {number} [height=this.worldHeight] in world coordinates\n * @param {boolean} [center] maintain the same center of the screen after zoom\n * @param {boolean} [scaleX=true] whether to set scaleX = scaleY\n * @param {boolean} [noClamp] whether to disable clamp-zoom\n * @returns {Viewport} this\n */\n fitHeight(height = this.worldHeight, center?: boolean, scaleX = true, noClamp?: boolean): Viewport\n {\n let save: Point | undefined;\n\n if (center)\n {\n save = this.center;\n }\n this.scale.y = this.screenHeight / height;\n\n if (scaleX)\n {\n this.scale.x = this.scale.y;\n }\n\n const clampZoom = this.plugins.get('clamp-zoom', true);\n\n if (!noClamp && clampZoom)\n {\n clampZoom.clamp();\n }\n\n if (center && save)\n {\n this.moveCenter(save);\n }\n\n return this;\n }\n\n /**\n * Change zoom so it fits the entire world in the viewport\n *\n * @param {boolean} center maintain the same center of the screen after zoom\n * @returns {Viewport} this\n */\n fitWorld(center?: boolean): Viewport\n {\n let save: Point | undefined;\n\n if (center)\n {\n save = this.center;\n }\n\n this.scale.x = this.screenWidth / this.worldWidth;\n this.scale.y = this.screenHeight / this.worldHeight;\n\n if (this.scale.x < this.scale.y)\n {\n this.scale.y = this.scale.x;\n }\n else\n {\n this.scale.x = this.scale.y;\n }\n\n const clampZoom = this.plugins.get('clamp-zoom', true);\n\n if (clampZoom)\n {\n clampZoom.clamp();\n }\n\n if (center && save)\n {\n this.moveCenter(save);\n }\n\n return this;\n }\n\n /**\n * Change zoom so it fits the size or the entire world in the viewport\n *\n * @param {boolean} [center] maintain the same center of the screen after zoom\n * @param {number} [width=this.worldWidth] desired width\n * @param {number} [height=this.worldHeight] desired height\n * @returns {Viewport} this\n */\n fit(center?: boolean, width = this.worldWidth, height = this.worldHeight): Viewport\n {\n let save: Point | undefined;\n\n if (center)\n {\n save = this.center;\n }\n\n this.scale.x = this.screenWidth / width;\n this.scale.y = this.screenHeight / height;\n\n if (this.scale.x < this.scale.y)\n {\n this.scale.y = this.scale.x;\n }\n else\n {\n this.scale.x = this.scale.y;\n }\n const clampZoom = this.plugins.get('clamp-zoom', true);\n\n if (clampZoom)\n {\n clampZoom.clamp();\n }\n if (center && save)\n {\n this.moveCenter(save);\n }\n\n return this;\n }\n\n /**\n * Zoom viewport to specific value.\n *\n * @param {number} scale value (e.g., 1 would be 100%, 0.25 would be 25%)\n * @param {boolean} [center] maintain the same center of the screen after zoom\n * @return {Viewport} this\n */\n setZoom(scale: number, center?: boolean): Viewport\n {\n let save;\n\n if (center)\n {\n save = this.center;\n }\n this.scale.set(scale);\n const clampZoom = this.plugins.get('clamp-zoom', true);\n\n if (clampZoom)\n {\n clampZoom.clamp();\n }\n if (center && save)\n {\n this.moveCenter(save);\n }\n\n return this;\n }\n\n /**\n * Zoom viewport by a certain percent (in both x and y direction).\n *\n * @param {number} percent change (e.g., 0.25 would increase a starting scale of 1.0 to 1.25)\n * @param {boolean} [center] maintain the same center of the screen after zoom\n * @return {Viewport} this\n */\n zoomPercent(percent: number, center?: boolean): Viewport\n {\n return this.setZoom(this.scale.x + (this.scale.x * percent), center);\n }\n\n /**\n * Zoom viewport by increasing/decreasing width by a certain number of pixels.\n *\n * @param {number} change in pixels\n * @param {boolean} [center] maintain the same center of the screen after zoom\n * @return {Viewport} this\n */\n zoom(change: number, center?: boolean): Viewport\n {\n this.fitWidth(change + this.worldScreenWidth, center);\n\n return this;\n }\n\n /** Changes scale of viewport and maintains center of viewport */\n get scaled(): number\n {\n return this.scale.x;\n }\n set scaled(scale: number)\n {\n this.setZoom(scale, true);\n }\n\n /**\n * Returns zoom to the desired scale\n *\n * @param {ISnapZoomOptions} options\n * @param {number} [options.width=0] - the desired width to snap (to maintain aspect ratio, choose width or height)\n * @param {number} [options.height=0] - the desired height to snap (to maintain aspect ratio, choose width or height)\n * @param {number} [options.time=1000] - time for snapping in ms\n * @param {(string|function)} [options.ease=easeInOutSine] ease function or name (see http://easings.net/\n * for supported names)\n * @param {PIXI.Point} [options.center] - place this point at center during zoom instead of center of the viewport\n * @param {boolean} [options.interrupt=true] - pause snapping with any user input on the viewport\n * @param {boolean} [options.removeOnComplete] - removes this plugin after snapping is complete\n * @param {boolean} [options.removeOnInterrupt] - removes this plugin if interrupted by any user input\n * @param {boolean} [options.forceStart] - starts the snap immediately regardless of whether the viewport is at the\n * desired zoom\n * @param {boolean} [options.noMove] - zoom but do not move\n */\n snapZoom(options?: ISnapZoomOptions): Viewport\n {\n this.plugins.add('snap-zoom', new SnapZoom(this, options));\n\n return this;\n }\n\n /** Is container out of world bounds */\n OOB(): {\n left: boolean;\n right: boolean;\n top: boolean;\n bottom: boolean;\n cornerPoint: Point;\n }\n {\n return {\n left: this.left < 0,\n right: this.right > this.worldWidth,\n top: this.top < 0,\n bottom: this.bottom > this.worldHeight,\n cornerPoint: new Point(\n (this.worldWidth * this.scale.x) - this.screenWidth,\n (this.worldHeight * this.scale.y) - this.screenHeight\n )\n };\n }\n\n /** World coordinates of the right edge of the screen */\n get right(): number\n {\n return (-this.x / this.scale.x) + this.worldScreenWidth;\n }\n set right(value: number)\n {\n this.x = (-value * this.scale.x) + this.screenWidth;\n this.plugins.reset();\n }\n\n /** World coordinates of the left edge of the screen */\n get left(): number\n {\n return -this.x / this.scale.x;\n }\n set left(value: number)\n {\n this.x = -value * this.scale.x;\n this.plugins.reset();\n }\n\n /** World coordinates of the top edge of the screen */\n get top(): number\n {\n return -this.y / this.scale.y;\n }\n set top(value: number)\n {\n this.y = -value * this.scale.y;\n this.plugins.reset();\n }\n\n /** World coordinates of the bottom edge of the screen */\n get bottom(): number\n {\n return (-this.y / this.scale.y) + this.worldScreenHeight;\n }\n set bottom(value: number)\n {\n this.y = (-value * this.scale.y) + this.screenHeight;\n this.plugins.reset();\n }\n\n /**\n * Determines whether the viewport is dirty (i.e., needs to be rendered to the screen because of a change)\n */\n get dirty(): boolean\n {\n return !!this._dirty;\n }\n set dirty(value: boolean)\n {\n this._dirty = value;\n }\n\n /**\n * Permanently changes the Viewport's hitArea\n *\n * NOTE: if not set then hitArea = PIXI.Rectangle(Viewport.left, Viewport.top, Viewport.worldScreenWidth,\n * Viewport.worldScreenHeight)\n */\n get forceHitArea(): IHitArea | null | undefined\n {\n return this._forceHitArea;\n }\n set forceHitArea(value: IHitArea | null | undefined)\n {\n if (value)\n {\n this._forceHitArea = value;\n this.hitArea = value;\n }\n else\n {\n this._forceHitArea = null;\n this.hitArea = new Rectangle(0, 0, this.worldWidth, this.worldHeight);\n }\n }\n\n /**\n * Enable one-finger touch to drag\n *\n * NOTE: if you expect users to use right-click dragging, you should enable `viewport.options.disableOnContextMenu`\n * to avoid the context menu popping up on each right-click drag.\n *\n * @param {IDragOptions} [options]\n * @param {string} [options.direction=all] direction to drag\n * @param {boolean} [options.pressDrag=true] whether click to drag is active\n * @param {boolean} [options.wheel=true] use wheel to scroll in direction (unless wheel plugin is active)\n * @param {number} [options.wheelScroll=1] number of pixels to scroll with each wheel spin\n * @param {boolean} [options.reverse] reverse the direction of the wheel scroll\n * @param {(boolean|string)} [options.clampWheel=false] clamp wheel(to avoid weird bounce with mouse wheel)\n * @param {string} [options.underflow=center] where to place world if too small for screen\n * @param {number} [options.factor=1] factor to multiply drag to increase the speed of movement\n * @param {string} [options.mouseButtons=all] changes which mouse buttons trigger drag, use: 'all', 'left',\n * 'right' 'middle', or some combination, like, 'middle-right'; you may want to set\n * viewport.options.disableOnContextMenu if you want to use right-click dragging\n * @param {string[]} [options.keyToPress=null] - array containing\n * {@link key|https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code} codes of keys that can be\n * pressed for the drag to be triggered, e.g.: ['ShiftLeft', 'ShiftRight'}.\n * @param {boolean} [options.ignoreKeyToPressOnTouch=false] - ignore keyToPress for touch events\n * @param {number} [options.lineHeight=20] - scaling factor for non-DOM_DELTA_PIXEL scrolling events\n * @returns {Viewport} this\n */\n public drag(options?: IDragOptions): Viewport\n {\n this.plugins.add('drag', new Drag(this, options));\n\n return this;\n }\n\n /**\n * Clamp to world boundaries or other provided boundaries\n * There are three ways to clamp:\n * 1. direction: 'all' = the world is clamped to its world boundaries, ie, you cannot drag any part of offscreen\n * direction: 'x' | 'y' = only the x or y direction is clamped to its world boundary\n * 2. left, right, top, bottom = true | number = the world is clamped to the world's pixel location for each side;\n * if any of these are set to true, then the location is set to the boundary\n * [0, viewport.worldWidth/viewport.worldHeight], eg: to allow the world to be completely dragged offscreen,\n * set [-viewport.worldWidth, -viewport.worldHeight, viewport.worldWidth * 2, viewport.worldHeight * 2]\n *\n * Underflow determines what happens when the world is smaller than the viewport\n * 1. none = the world is clamped but there is no special behavior\n * 2. center = the world is centered on the viewport\n * 3. combination of top/bottom/center and left/right/center (case insensitive) = the world is stuck to the\n * appropriate boundaries\n *\n * NOTES:\n * clamp is disabled if called with no options; use { direction: 'all' } for all edge clamping\n * screenWidth, screenHeight, worldWidth, and worldHeight needs to be set for this to work properly\n *\n * @param {object} [options]\n * @param {(number|boolean)} [options.left=false] - clamp left; true = 0\n * @param {(number|boolean)} [options.right=false] - clamp right; true = viewport.worldWidth\n * @param {(number|boolean)} [options.top=false] - clamp top; true = 0\n * @param {(number|boolean)} [options.bottom=false] - clamp bottom; true = viewport.worldHeight\n * @param {string} [direction] - (all, x, or y) using clamps of [0, viewport.worldWidth/viewport.worldHeight];\n * replaces left/right/top/bottom if set\n * @param {string} [underflow=center] - where to place world if too small for screen (e.g., top-right, center,\n * none, bottomLeft) * @returns {Viewport} this\n */\n public clamp(options?: IClampOptions): Viewport\n {\n this.plugins.add('clamp', new Clamp(this, options));\n\n return this;\n }\n\n /**\n * Decelerate after a move\n *\n * NOTE: this fires 'moved' event during deceleration\n *\n * @param {IDecelerateOptions} [options]\n * @param {number} [options.friction=0.95] - percent to decelerate after movement\n * @param {number} [options.bounce=0.8] - percent to decelerate when past boundaries (only applicable when\n * viewport.bounce() is active)\n * @param {number} [options.minSpeed=0.01] - minimum velocity before stopping/reversing acceleration\n * @return {Viewport} this\n */\n public decelerate(options?: IDecelerateOptions): Viewport\n {\n this.plugins.add('decelerate', new Decelerate(this, options));\n\n return this;\n }\n\n /**\n * Bounce on borders\n * NOTES:\n * screenWidth, screenHeight, worldWidth, and worldHeight needs to be set for this to work properly\n * fires 'moved', 'bounce-x-start', 'bounce-y-start', 'bounce-x-end', and 'bounce-y-end' events\n * @param {object} [options]\n * @param {string} [options.sides=all] - all, horizontal, vertical, or combination of top, bottom, right, left\n * (e.g., 'top-bottom-right')\n * @param {number} [options.friction=0.5] - friction to apply to decelerate if active\n * @param {number} [options.time=150] - time in ms to finish bounce\n * @param {object} [options.bounceBox] - use this bounceBox instead of (0, 0, viewport.worldWidth, viewport.worldHeight)\n * @param {number} [options.bounceBox.x=0]\n * @param {number} [options.bounceBox.y=0]\n * @param {number} [options.bounceBox.width=viewport.worldWidth]\n * @param {number} [options.bounceBox.height=viewport.worldHeight]\n * @param {string|function} [options.ease=easeInOutSine] - ease function or name\n * (see http://easings.net/ for supported names)\n * @param {string} [options.underflow=center] - (top/bottom/center and left/right/center, or center)\n * where to place world if too small for screen\n * @return {Viewport} this\n */\n public bounce(options?: IBounceOptions): Viewport\n {\n this.plugins.add('bounce', new Bounce(this, options));\n\n return this;\n }\n\n /**\n * Enable pinch to zoom and two-finger touch to drag\n *\n * @param {PinchOptions} [options]\n * @param {boolean} [options.noDrag] - disable two-finger dragging\n * @param {number} [options.percent=1] - percent to modify pinch speed\n * @param {number} [options.factor=1] - factor to multiply two-finger drag to increase the speed of movement\n * @param {PIXI.Point} [options.center] - place this point at center during zoom instead of center of two fingers\n * @param {('all'|'x'|'y')} [options.axis=all] - axis to zoom\n * @return {Viewport} this\n */\n public pinch(options?: IPinchOptions): Viewport\n {\n this.plugins.add('pinch', new Pinch(this, options));\n\n return this;\n }\n\n /**\n * Snap to a point\n *\n * @param {number} x\n * @param {number} y\n * @param {ISnapOptions} [options]\n * @param {boolean} [options.topLeft] - snap to the top-left of viewport instead of center\n * @param {number} [options.friction=0.8] - friction/frame to apply if decelerate is active\n * @param {number} [options.time=1000] - time in ms to snap\n * @param {string|function} [options.ease=easeInOutSine] - ease function or name (see http://easings.net/\n * for supported names)\n * @param {boolean} [options.interrupt=true] - pause snapping with any user input on the viewport\n * @param {boolean} [options.removeOnComplete] - removes this plugin after snapping is complete\n * @param {boolean} [options.removeOnInterrupt] - removes this plugin if interrupted by any user input\n * @param {boolean} [options.forceStart] - starts the snap immediately regardless of whether the viewport is at\n * the desired location\n * @return {Viewport} this\n */\n public snap(x: number, y: number, options?: ISnapOptions): Viewport\n {\n this.plugins.add('snap', new Snap(this, x, y, options));\n\n return this;\n }\n\n /**\n * Follow a target\n *\n * NOTES:\n * uses the (x, y) as the center to follow; for PIXI.Sprite to work properly, use sprite.anchor.set(0.5)\n * options.acceleration is not perfect as it doesn't know the velocity of the target. It adds acceleration\n * to the start of movement and deceleration to the end of movement when the target is stopped.\n * To cancel the follow, use: `viewport.plugins.remove('follow')`\n *\n * @fires 'moved' event\n *\n * @param {PIXI.DisplayObject} target to follow\n * @param {IFollowOptions} [options]\n * @param {number} [options.speed=0] - to follow in pixels/frame (0=teleport to location)\n * @param {number} [options.acceleration] - set acceleration to accelerate and decelerate at this rate; speed\n * cannot be 0 to use acceleration\n * @param {number} [options.radius] - radius (in world coordinates) of center circle where movement is allowed\n * without moving the viewport * @returns {Viewport} this\n * @returns {Viewport} this\n */\n public follow(target: DisplayObject, options?: IFollowOptions): Viewport\n {\n this.plugins.add('follow', new Follow(this, target, options));\n\n return this;\n }\n\n /**\n * Zoom using mouse wheel\n *\n * NOTE: the default event listener for 'wheel' event is document.body. Use `Viewport.options.divWheel` to\n * change this default\n *\n * @param {IWheelOptions} [options]\n * @param {number} [options.percent=0.1] - percent to scroll with each spin\n * @param {number} [options.smooth] - smooth the zooming by providing the number of frames to zoom between wheel spins\n * @param {boolean} [options.interrupt=true] - stop smoothing with any user input on the viewport\n * @param {boolean} [options.reverse] - reverse the direction of the scroll\n * @param {PIXI.Point} [options.center] - place this point at center during zoom instead of current mouse position\n * @param {number} [options.lineHeight=20] - scaling factor for non-DOM_DELTA_PIXEL scrolling events\n * @param {('all'|'x'|'y')} [options.axis=all] - axis to zoom\n * @return {Viewport} this\n */\n public wheel(options?: IWheelOptions): Viewport\n {\n this.plugins.add('wheel', new Wheel(this, options));\n\n return this;\n }\n\n /**\n * Animate the position and/or scale of the viewport\n * To set the zoom level, use: (1) scale, (2) scaleX and scaleY, or (3) width and/or height\n * @param {object} options\n * @param {number} [options.time=1000] - time to animate\n * @param {PIXI.Point} [options.position=viewport.center] - position to move viewport\n * @param {number} [options.width] - desired viewport width in world pixels (use instead of scale;\n * aspect ratio is maintained if height is not provided)\n * @param {number} [options.height] - desired viewport height in world pixels (use instead of scale;\n * aspect ratio is maintained if width is not provided)\n * @param {number} [options.scale] - scale to change zoom (scale.x = scale.y)\n * @param {number} [options.scaleX] - independently change zoom in x-direction\n * @param {number} [options.scaleY] - independently change zoom in y-direction\n * @param {(function|string)} [options.ease=linear] - easing function to use\n * @param {function} [options.callbackOnComplete]\n * @param {boolean} [options.removeOnInterrupt] removes this plugin if interrupted by any user input\n * @returns {Viewport} this\n */\n public animate(options: IAnimateOptions): Viewport\n {\n this.plugins.add('animate', new Animate(this, options));\n\n return this;\n }\n\n /**\n * Enable clamping of zoom to constraints\n *\n * The minWidth/Height settings are how small the world can get (as it would appear on the screen)\n * before clamping. The maxWidth/maxHeight is how larger the world can scale (as it would appear on\n * the screen) before clamping.\n *\n * For example, if you have a world size of 1000 x 1000 and a screen size of 100 x 100, if you set\n * minWidth/Height = 100 then the world will not be able to zoom smaller than the screen size (ie,\n * zooming out so it appears smaller than the screen). Similarly, if you set maxWidth/Height = 100\n * the world will not be able to zoom larger than the screen size (ie, zooming in so it appears\n * larger than the screen).\n *\n * @param {object} [options]\n * @param {number} [options.minWidth] - minimum width\n * @param {number} [options.minHeight] - minimum height\n * @param {number} [options.maxWidth] - maximum width\n * @param {number} [options.maxHeight] - maximum height\n * @param {number} [options.minScale] - minimum scale\n * @param {number} [options.maxScale] - minimum scale\n * @return {Viewport} this\n */\n public clampZoom(options: IClampZoomOptions): Viewport\n {\n this.plugins.add('clamp-zoom', new ClampZoom(this, options));\n\n return this;\n }\n\n /**\n * Scroll viewport when mouse hovers near one of the edges or radius-distance from center of screen.\n *\n * NOTES: fires 'moved' event; there's a known bug where the mouseEdges does not work properly with \"windowed\" viewports\n *\n * @param {IMouseEdgesOptions} [options]\n * @param {number} [options.radius] - distance from center of screen in screen pixels\n * @param {number} [options.distance] - distance from all sides in screen pixels\n * @param {number} [options.top] - alternatively, set top distance (leave unset for no top scroll)\n * @param {number} [options.bottom] - alternatively, set bottom distance (leave unset for no top scroll)\n * @param {number} [options.left] - alternatively, set left distance (leave unset for no top scroll)\n * @param {number} [options.right] - alternatively, set right distance (leave unset for no top scroll)\n * @param {number} [options.speed=8] - speed in pixels/frame to scroll viewport\n * @param {boolean} [options.reverse] - reverse direction of scroll\n * @param {boolean} [options.noDecelerate] - don't use decelerate plugin even if it's installed\n * @param {boolean} [options.linear] - if using radius, use linear movement (+/- 1, +/- 1) instead of angled\n * movement (Math.cos(angle from center), Math.sin(angle from center))\n * @param {boolean} [options.allowButtons] allows plugin to continue working even when there's a mousedown event\n */\n public mouseEdges(options: IMouseEdgesOptions): Viewport\n {\n this.plugins.add('mouse-edges', new MouseEdges(this, options));\n\n return this;\n }\n\n /** Pause viewport (including animation updates such as decelerate) */\n get pause(): boolean\n {\n return !!this._pause;\n }\n set pause(value: boolean)\n {\n this._pause = value;\n\n this.lastViewport = null;\n this.moving = false;\n this.zooming = false;\n\n if (value)\n {\n this.input.pause();\n }\n }\n\n /**\n * Move the viewport so the bounding box is visible\n *\n * @param x - left\n * @param y - top\n * @param width\n * @param height\n * @param resizeToFit - Resize the viewport so the box fits within the viewport\n */\n public ensureVisible(x: number, y: number, width: number, height: number, resizeToFit?: boolean): void\n {\n if (resizeToFit && (width > this.worldScreenWidth || height > this.worldScreenHeight))\n {\n this.fit(true, width, height);\n this.emit('zoomed', { viewport: this, type: 'ensureVisible' });\n }\n let moved = false;\n\n if (x < this.left)\n {\n this.left = x;\n moved = true;\n }\n else if (x + width > this.right)\n {\n this.right = x + width;\n moved = true;\n }\n if (y < this.top)\n {\n this.top = y;\n moved = true;\n }\n else if (y + height > this.bottom)\n {\n this.bottom = y + height;\n moved = true;\n }\n if (moved)\n {\n this.emit('moved', { viewport: this, type: 'ensureVisible' });\n }\n }\n}\n\n/**\n * Fires after a mouse or touch click\n * @event Viewport#clicked\n * @type {object}\n * @property {PIXI.Point} screen\n * @property {PIXI.Point} world\n * @property {Viewport} viewport\n */\n\n/**\n * Fires when a drag starts\n * @event Viewport#drag-start\n * @type {object}\n * @property {PIXI.Point} screen\n * @property {PIXI.Point} world\n * @property {Viewport} viewport\n */\n\n/**\n * Fires when a drag ends\n * @event Viewport#drag-end\n * @type {object}\n * @property {PIXI.Point} screen\n * @property {PIXI.Point} world\n * @property {Viewport} viewport\n */\n\n/**\n * Fires when a pinch starts\n * @event Viewport#pinch-start\n * @type {Viewport}\n */\n\n/**\n * Fires when a pinch end\n * @event Viewport#pinch-end\n * @type {Viewport}\n */\n\n/**\n * Fires when a snap starts\n * @event Viewport#snap-start\n * @type {Viewport}\n */\n\n/**\n * Fires when a snap ends\n * @event Viewport#snap-end\n * @type {Viewport}\n */\n\n/**\n * Fires when a snap-zoom starts\n * @event Viewport#snap-zoom-start\n * @type {Viewport}\n */\n\n/**\n * Fires when a snap-zoom ends\n * @event Viewport#snap-zoom-end\n * @type {Viewport}\n */\n\n/**\n * Fires when a bounce starts in the x direction\n * @event Viewport#bounce-x-start\n * @type {Viewport}\n */\n\n/**\n * Fires when a bounce ends in the x direction\n * @event Viewport#bounce-x-end\n * @type {Viewport}\n */\n\n/**\n * Fires when a bounce starts in the y direction\n * @event Viewport#bounce-y-start\n * @type {Viewport}\n */\n\n/**\n * Fires when a bounce ends in the y direction\n * @event Viewport#bounce-y-end\n * @type {Viewport}\n */\n\n/**\n * Fires when for a mouse wheel event\n * @event Viewport#wheel\n * @type {object}\n * @property {object} wheel\n * @property {number} wheel.dx\n * @property {number} wheel.dy\n * @property {number} wheel.dz\n * @property {Viewport} viewport\n */\n\n/**\n * Fires when a wheel-scroll occurs\n * @event Viewport#wheel-scroll\n * @type {Viewport}\n */\n\n/**\n * Fires when a mouse-edge starts to scroll\n * @event Viewport#mouse-edge-start\n * @type {Viewport}\n */\n\n/**\n * Fires when the mouse-edge scrolling ends\n * @event Viewport#mouse-edge-end\n * @type {Viewport}\n */\n\n/**\n * Fires when viewport moves through UI interaction, deceleration, ensureVisible, or follow\n * @event Viewport#moved\n * @type {object}\n * @property {Viewport} viewport\n * @property {string} type - (drag, snap, pinch, follow, bounce-x, bounce-y,\n * clamp-x, clamp-y, decelerate, mouse-edges, wheel, ensureVisible)\n */\n\n/**\n * Fires when viewport moves through UI interaction, deceleration, ensureVisible, or follow\n * @event Viewport#zoomed\n * @type {object}\n * @property {Viewport} viewport\n * @property {string} type (drag-zoom, pinch, wheel, clamp-zoom, ensureVisible)\n */\n\n/**\n * Fires when viewport stops moving\n * @event Viewport#moved-end\n * @type {Viewport}\n */\n\n/**\n * Fires when viewport stops zooming\n * @event Viewport#zoomed-end\n * @type {Viewport}\n */\n\n/**\n* Fires at the end of an update frame\n* @event Viewport#frame-end\n* @type {Viewport}\n*/\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\n// If obj.hasOwnProperty has been overridden, then calling\n// obj.hasOwnProperty(prop) will break.\n// See: https://github.com/joyent/node/issues/1707\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nmodule.exports = function(qs, sep, eq, options) {\n sep = sep || '&';\n eq = eq || '=';\n var obj = {};\n\n if (typeof qs !== 'string' || qs.length === 0) {\n return obj;\n }\n\n var regexp = /\\+/g;\n qs = qs.split(sep);\n\n var maxKeys = 1000;\n if (options && typeof options.maxKeys === 'number') {\n maxKeys = options.maxKeys;\n }\n\n var len = qs.length;\n // maxKeys <= 0 means that we should not limit keys count\n if (maxKeys > 0 && len > maxKeys) {\n len = maxKeys;\n }\n\n for (var i = 0; i < len; ++i) {\n var x = qs[i].replace(regexp, '%20'),\n idx = x.indexOf(eq),\n kstr, vstr, k, v;\n\n if (idx >= 0) {\n kstr = x.substr(0, idx);\n vstr = x.substr(idx + 1);\n } else {\n kstr = x;\n vstr = '';\n }\n\n k = decodeURIComponent(kstr);\n v = decodeURIComponent(vstr);\n\n if (!hasOwnProperty(obj, k)) {\n obj[k] = v;\n } else if (Array.isArray(obj[k])) {\n obj[k].push(v);\n } else {\n obj[k] = [obj[k], v];\n }\n }\n\n return obj;\n};\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar stringifyPrimitive = function(v) {\n switch (typeof v) {\n case 'string':\n return v;\n\n case 'boolean':\n return v ? 'true' : 'false';\n\n case 'number':\n return isFinite(v) ? v : '';\n\n default:\n return '';\n }\n};\n\nmodule.exports = function(obj, sep, eq, name) {\n sep = sep || '&';\n eq = eq || '=';\n if (obj === null) {\n obj = undefined;\n }\n\n if (typeof obj === 'object') {\n return Object.keys(obj).map(function(k) {\n var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\n if (Array.isArray(obj[k])) {\n return obj[k].map(function(v) {\n return ks + encodeURIComponent(stringifyPrimitive(v));\n }).join(sep);\n } else {\n return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\n }\n }).join(sep);\n\n }\n\n if (!name) return '';\n return encodeURIComponent(stringifyPrimitive(name)) + eq +\n encodeURIComponent(stringifyPrimitive(obj));\n};\n","'use strict';\n\nexports.decode = exports.parse = require('./decode');\nexports.encode = exports.stringify = require('./encode');\n","import { useRef } from \"react\";\n\n// Saves incoming handler to the ref in order to avoid \"useCallback hell\"\nexport function useEventCallback<T>(handler?: (value: T) => void): (value: T) => void {\n const callbackRef = useRef(handler);\n const fn = useRef((value: T) => {\n callbackRef.current && callbackRef.current(value);\n });\n callbackRef.current = handler;\n\n return fn.current;\n}\n","// Clamps a value between an upper and lower bound.\n// We use ternary operators because it makes the minified code\n// 2 times shorter then `Math.min(Math.max(a,b),c)`\nexport const clamp = (number: number, min = 0, max = 1): number => {\n return number > max ? max : number < min ? min : number;\n};\n","import React, { useRef, useMemo, useEffect } from \"react\";\n\nimport { useEventCallback } from \"../../hooks/useEventCallback\";\nimport { clamp } from \"../../utils/clamp\";\n\nexport interface Interaction {\n left: number;\n top: number;\n}\n\n// Check if an event was triggered by touch\nconst isTouch = (event: MouseEvent | TouchEvent): event is TouchEvent => \"touches\" in event;\n\n// Finds a proper touch point by its identifier\nconst getTouchPoint = (touches: TouchList, touchId: null | number): Touch => {\n for (let i = 0; i < touches.length; i++) {\n if (touches[i].identifier === touchId) return touches[i];\n }\n return touches[0];\n};\n\n// Finds the proper window object to fix iframe embedding issues\nconst getParentWindow = (node?: HTMLDivElement | null): Window => {\n return (node && node.ownerDocument.defaultView) || self;\n};\n\n// Returns a relative position of the pointer inside the node's bounding box\nconst getRelativePosition = (\n node: HTMLDivElement,\n event: MouseEvent | TouchEvent,\n touchId: null | number\n): Interaction => {\n const rect = node.getBoundingClientRect();\n\n // Get user's pointer position from `touches` array if it's a `TouchEvent`\n const pointer = isTouch(event) ? getTouchPoint(event.touches, touchId) : (event as MouseEvent);\n\n return {\n left: clamp((pointer.pageX - (rect.left + getParentWindow(node).pageXOffset)) / rect.width),\n top: clamp((pointer.pageY - (rect.top + getParentWindow(node).pageYOffset)) / rect.height),\n };\n};\n\n// Browsers introduced an intervention, making touch events passive by default.\n// This workaround removes `preventDefault` call from the touch handlers.\n// https://github.com/facebook/react/issues/19651\nconst preventDefaultMove = (event: MouseEvent | TouchEvent): void => {\n !isTouch(event) && event.preventDefault();\n};\n\n// Prevent mobile browsers from handling mouse events (conflicting with touch ones).\n// If we detected a touch interaction before, we prefer reacting to touch events only.\nconst isInvalid = (event: MouseEvent | TouchEvent, hasTouch: boolean): boolean => {\n return hasTouch && !isTouch(event);\n};\n\ninterface Props {\n onMove: (interaction: Interaction) => void;\n onKey: (offset: Interaction) => void;\n children: React.ReactNode;\n}\n\nconst InteractiveBase = ({ onMove, onKey, ...rest }: Props) => {\n const container = useRef<HTMLDivElement>(null);\n const onMoveCallback = useEventCallback<Interaction>(onMove);\n const onKeyCallback = useEventCallback<Interaction>(onKey);\n const touchId = useRef<null | number>(null);\n const hasTouch = useRef(false);\n\n const [handleMoveStart, handleKeyDown, toggleDocumentEvents] = useMemo(() => {\n const handleMoveStart = ({ nativeEvent }: React.MouseEvent | React.TouchEvent) => {\n const el = container.current;\n if (!el) return;\n\n // Prevent text selection\n preventDefaultMove(nativeEvent);\n\n if (isInvalid(nativeEvent, hasTouch.current) || !el) return;\n\n if (isTouch(nativeEvent)) {\n hasTouch.current = true;\n const changedTouches = nativeEvent.changedTouches || [];\n if (changedTouches.length) touchId.current = changedTouches[0].identifier;\n }\n\n el.focus();\n onMoveCallback(getRelativePosition(el, nativeEvent, touchId.current));\n toggleDocumentEvents(true);\n };\n\n const handleMove = (event: MouseEvent | TouchEvent) => {\n // Prevent text selection\n preventDefaultMove(event);\n\n // If user moves the pointer outside of the window or iframe bounds and release it there,\n // `mouseup`/`touchend` won't be fired. In order to stop the picker from following the cursor\n // after the user has moved the mouse/finger back to the document, we check `event.buttons`\n // and `event.touches`. It allows us to detect that the user is just moving his pointer\n // without pressing it down\n const isDown = isTouch(event) ? event.touches.length > 0 : event.buttons > 0;\n\n if (isDown && container.current) {\n onMoveCallback(getRelativePosition(container.current, event, touchId.current));\n } else {\n toggleDocumentEvents(false);\n }\n };\n\n const handleMoveEnd = () => toggleDocumentEvents(false);\n\n const handleKeyDown = (event: React.KeyboardEvent) => {\n const keyCode = event.which || event.keyCode;\n\n // Ignore all keys except arrow ones\n if (keyCode < 37 || keyCode > 40) return;\n // Do not scroll page by arrow keys when document is focused on the element\n event.preventDefault();\n // Send relative offset to the parent component.\n // We use codes (37â†, 38↑, 39→, 40↓) instead of keys ('ArrowRight', 'ArrowDown', etc)\n // to reduce the size of the library\n onKeyCallback({\n left: keyCode === 39 ? 0.05 : keyCode === 37 ? -0.05 : 0,\n top: keyCode === 40 ? 0.05 : keyCode === 38 ? -0.05 : 0,\n });\n };\n\n function toggleDocumentEvents(state?: boolean) {\n const touch = hasTouch.current;\n const el = container.current;\n const parentWindow = getParentWindow(el);\n\n // Add or remove additional pointer event listeners\n const toggleEvent = state ? parentWindow.addEventListener : parentWindow.removeEventListener;\n toggleEvent(touch ? \"touchmove\" : \"mousemove\", handleMove);\n toggleEvent(touch ? \"touchend\" : \"mouseup\", handleMoveEnd);\n }\n\n return [handleMoveStart, handleKeyDown, toggleDocumentEvents];\n }, [onKeyCallback, onMoveCallback]);\n\n // Remove window event listeners before unmounting\n useEffect(() => toggleDocumentEvents, [toggleDocumentEvents]);\n\n return (\n <div\n {...rest}\n onTouchStart={handleMoveStart}\n onMouseDown={handleMoveStart}\n className=\"react-colorful__interactive\"\n ref={container}\n onKeyDown={handleKeyDown}\n tabIndex={0}\n role=\"slider\"\n />\n );\n};\n\nexport const Interactive = React.memo(InteractiveBase);\n","export const formatClassName = (names: unknown[]): string => names.filter(Boolean).join(\" \");\n","import React from \"react\";\nimport { formatClassName } from \"../../utils/format\";\n\ninterface Props {\n className?: string;\n top?: number;\n left: number;\n color: string;\n}\n\nexport const Pointer = ({ className, color, left, top = 0.5 }: Props): JSX.Element => {\n const nodeClassName = formatClassName([\"react-colorful__pointer\", className]);\n\n const style = {\n top: `${top * 100}%`,\n left: `${left * 100}%`,\n };\n\n return (\n <div className={nodeClassName} style={style}>\n <div className=\"react-colorful__pointer-fill\" style={{ backgroundColor: color }} />\n </div>\n );\n};\n","export const round = (number: number, digits = 0, base = Math.pow(10, digits)): number => {\n return Math.round(base * number) / base;\n};\n","import { round } from \"./round\";\nimport { RgbaColor, RgbColor, HslaColor, HslColor, HsvaColor, HsvColor } from \"../types\";\n\n/**\n * Valid CSS <angle> units.\n * https://developer.mozilla.org/en-US/docs/Web/CSS/angle\n */\nconst angleUnits: Record<string, number> = {\n grad: 360 / 400,\n turn: 360,\n rad: 360 / (Math.PI * 2),\n};\n\nexport const hexToHsva = (hex: string): HsvaColor => rgbaToHsva(hexToRgba(hex));\n\nexport const hexToRgba = (hex: string): RgbaColor => {\n if (hex[0] === \"#\") hex = hex.substr(1);\n\n if (hex.length < 6) {\n return {\n r: parseInt(hex[0] + hex[0], 16),\n g: parseInt(hex[1] + hex[1], 16),\n b: parseInt(hex[2] + hex[2], 16),\n a: 1,\n };\n }\n\n return {\n r: parseInt(hex.substr(0, 2), 16),\n g: parseInt(hex.substr(2, 2), 16),\n b: parseInt(hex.substr(4, 2), 16),\n a: 1,\n };\n};\n\nexport const parseHue = (value: string, unit = \"deg\"): number => {\n return Number(value) * (angleUnits[unit] || 1);\n};\n\nexport const hslaStringToHsva = (hslString: string): HsvaColor => {\n const matcher = /hsla?\\(?\\s*(-?\\d*\\.?\\d+)(deg|rad|grad|turn)?[,\\s]+(-?\\d*\\.?\\d+)%?[,\\s]+(-?\\d*\\.?\\d+)%?,?\\s*[/\\s]*(-?\\d*\\.?\\d+)?(%)?\\s*\\)?/i;\n const match = matcher.exec(hslString);\n\n if (!match) return { h: 0, s: 0, v: 0, a: 1 };\n\n return hslaToHsva({\n h: parseHue(match[1], match[2]),\n s: Number(match[3]),\n l: Number(match[4]),\n a: match[5] === undefined ? 1 : Number(match[5]) / (match[6] ? 100 : 1),\n });\n};\n\nexport const hslStringToHsva = hslaStringToHsva;\n\nexport const hslaToHsva = ({ h, s, l, a }: HslaColor): HsvaColor => {\n s *= (l < 50 ? l : 100 - l) / 100;\n\n return {\n h: h,\n s: s > 0 ? ((2 * s) / (l + s)) * 100 : 0,\n v: l + s,\n a,\n };\n};\n\nexport const hsvaToHex = (hsva: HsvaColor): string => rgbaToHex(hsvaToRgba(hsva));\n\nexport const hsvaToHsla = ({ h, s, v, a }: HsvaColor): HslaColor => {\n const hh = ((200 - s) * v) / 100;\n\n return {\n h: round(h),\n s: round(hh > 0 && hh < 200 ? ((s * v) / 100 / (hh <= 100 ? hh : 200 - hh)) * 100 : 0),\n l: round(hh / 2),\n a: round(a, 2),\n };\n};\n\nexport const hsvaToHslString = (hsva: HsvaColor): string => {\n const { h, s, l } = hsvaToHsla(hsva);\n return `hsl(${h}, ${s}%, ${l}%)`;\n};\n\nexport const hsvaToHsvString = (hsva: HsvaColor): string => {\n const { h, s, v } = roundHsva(hsva);\n return `hsv(${h}, ${s}%, ${v}%)`;\n};\n\nexport const hsvaToHsvaString = (hsva: HsvaColor): string => {\n const { h, s, v, a } = roundHsva(hsva);\n return `hsva(${h}, ${s}%, ${v}%, ${a})`;\n};\n\nexport const hsvaToHslaString = (hsva: HsvaColor): string => {\n const { h, s, l, a } = hsvaToHsla(hsva);\n return `hsla(${h}, ${s}%, ${l}%, ${a})`;\n};\n\nexport const hsvaToRgba = ({ h, s, v, a }: HsvaColor): RgbaColor => {\n h = (h / 360) * 6;\n s = s / 100;\n v = v / 100;\n\n const hh = Math.floor(h),\n b = v * (1 - s),\n c = v * (1 - (h - hh) * s),\n d = v * (1 - (1 - h + hh) * s),\n module = hh % 6;\n\n return {\n r: round([v, c, b, b, d, v][module] * 255),\n g: round([d, v, v, c, b, b][module] * 255),\n b: round([b, b, d, v, v, c][module] * 255),\n a: round(a, 2),\n };\n};\n\nexport const hsvaToRgbString = (hsva: HsvaColor): string => {\n const { r, g, b } = hsvaToRgba(hsva);\n return `rgb(${r}, ${g}, ${b})`;\n};\n\nexport const hsvaToRgbaString = (hsva: HsvaColor): string => {\n const { r, g, b, a } = hsvaToRgba(hsva);\n return `rgba(${r}, ${g}, ${b}, ${a})`;\n};\n\nexport const hsvaStringToHsva = (hsvString: string): HsvaColor => {\n const matcher = /hsva?\\(?\\s*(-?\\d*\\.?\\d+)(deg|rad|grad|turn)?[,\\s]+(-?\\d*\\.?\\d+)%?[,\\s]+(-?\\d*\\.?\\d+)%?,?\\s*[/\\s]*(-?\\d*\\.?\\d+)?(%)?\\s*\\)?/i;\n const match = matcher.exec(hsvString);\n\n if (!match) return { h: 0, s: 0, v: 0, a: 1 };\n\n return roundHsva({\n h: parseHue(match[1], match[2]),\n s: Number(match[3]),\n v: Number(match[4]),\n a: match[5] === undefined ? 1 : Number(match[5]) / (match[6] ? 100 : 1),\n });\n};\n\nexport const hsvStringToHsva = hsvaStringToHsva;\n\nexport const rgbaStringToHsva = (rgbaString: string): HsvaColor => {\n const matcher = /rgba?\\(?\\s*(-?\\d*\\.?\\d+)(%)?[,\\s]+(-?\\d*\\.?\\d+)(%)?[,\\s]+(-?\\d*\\.?\\d+)(%)?,?\\s*[/\\s]*(-?\\d*\\.?\\d+)?(%)?\\s*\\)?/i;\n const match = matcher.exec(rgbaString);\n\n if (!match) return { h: 0, s: 0, v: 0, a: 1 };\n\n return rgbaToHsva({\n r: Number(match[1]) / (match[2] ? 100 / 255 : 1),\n g: Number(match[3]) / (match[4] ? 100 / 255 : 1),\n b: Number(match[5]) / (match[6] ? 100 / 255 : 1),\n a: match[7] === undefined ? 1 : Number(match[7]) / (match[8] ? 100 : 1),\n });\n};\n\nexport const rgbStringToHsva = rgbaStringToHsva;\n\nconst format = (number: number) => {\n const hex = number.toString(16);\n return hex.length < 2 ? \"0\" + hex : hex;\n};\n\nexport const rgbaToHex = ({ r, g, b }: RgbaColor): string => {\n return \"#\" + format(r) + format(g) + format(b);\n};\n\nexport const rgbaToHsva = ({ r, g, b, a }: RgbaColor): HsvaColor => {\n const max = Math.max(r, g, b);\n const delta = max - Math.min(r, g, b);\n\n // prettier-ignore\n const hh = delta\n ? max === r\n ? (g - b) / delta\n : max === g\n ? 2 + (b - r) / delta\n : 4 + (r - g) / delta\n : 0;\n\n return {\n h: round(60 * (hh < 0 ? hh + 6 : hh)),\n s: round(max ? (delta / max) * 100 : 0),\n v: round((max / 255) * 100),\n a,\n };\n};\n\nexport const roundHsva = (hsva: HsvaColor): HsvaColor => ({\n h: round(hsva.h),\n s: round(hsva.s),\n v: round(hsva.v),\n a: round(hsva.a, 2),\n});\n\nexport const rgbaToRgb = ({ r, g, b }: RgbaColor): RgbColor => ({ r, g, b });\n\nexport const hslaToHsl = ({ h, s, l }: HslaColor): HslColor => ({ h, s, l });\n\nexport const hsvaToHsv = (hsva: HsvaColor): HsvColor => {\n const { h, s, v } = roundHsva(hsva);\n return { h, s, v };\n};\n","import React from \"react\";\n\nimport { Interactive, Interaction } from \"./Interactive\";\nimport { Pointer } from \"./Pointer\";\n\nimport { hsvaToHslString } from \"../../utils/convert\";\nimport { formatClassName } from \"../../utils/format\";\nimport { clamp } from \"../../utils/clamp\";\nimport { round } from \"../../utils/round\";\n\ninterface Props {\n className?: string;\n hue: number;\n onChange: (newHue: { h: number }) => void;\n}\n\nconst HueBase = ({ className, hue, onChange }: Props) => {\n const handleMove = (interaction: Interaction) => {\n onChange({ h: 360 * interaction.left });\n };\n\n const handleKey = (offset: Interaction) => {\n // Hue measured in degrees of the color circle ranging from 0 to 360\n onChange({\n h: clamp(hue + offset.left * 360, 0, 360),\n });\n };\n\n const nodeClassName = formatClassName([\"react-colorful__hue\", className]);\n\n return (\n <div className={nodeClassName}>\n <Interactive\n onMove={handleMove}\n onKey={handleKey}\n aria-label=\"Hue\"\n aria-valuetext={round(hue)}\n >\n <Pointer\n className=\"react-colorful__hue-pointer\"\n left={hue / 360}\n color={hsvaToHslString({ h: hue, s: 100, v: 100, a: 1 })}\n />\n </Interactive>\n </div>\n );\n};\n\nexport const Hue = React.memo(HueBase);\n","import React from \"react\";\nimport { Interactive, Interaction } from \"./Interactive\";\nimport { Pointer } from \"./Pointer\";\nimport { HsvaColor } from \"../../types\";\nimport { hsvaToHslString } from \"../../utils/convert\";\nimport { clamp } from \"../../utils/clamp\";\nimport { round } from \"../../utils/round\";\n\ninterface Props {\n hsva: HsvaColor;\n onChange: (newColor: { s: number; v: number }) => void;\n}\n\nconst SaturationBase = ({ hsva, onChange }: Props) => {\n const handleMove = (interaction: Interaction) => {\n onChange({\n s: interaction.left * 100,\n v: 100 - interaction.top * 100,\n });\n };\n\n const handleKey = (offset: Interaction) => {\n // Saturation and brightness always fit into [0, 100] range\n onChange({\n s: clamp(hsva.s + offset.left * 100, 0, 100),\n v: clamp(hsva.v - offset.top * 100, 0, 100),\n });\n };\n\n const containerStyle = {\n backgroundColor: hsvaToHslString({ h: hsva.h, s: 100, v: 100, a: 1 }),\n };\n\n return (\n <div className=\"react-colorful__saturation\" style={containerStyle}>\n <Interactive\n onMove={handleMove}\n onKey={handleKey}\n aria-label=\"Color\"\n aria-valuetext={`Saturation ${round(hsva.s)}%, Brightness ${round(hsva.v)}%`}\n >\n <Pointer\n className=\"react-colorful__saturation-pointer\"\n top={1 - hsva.v / 100}\n left={hsva.s / 100}\n color={hsvaToHslString(hsva)}\n />\n </Interactive>\n </div>\n );\n};\n\nexport const Saturation = React.memo(SaturationBase);\n","import { hexToRgba } from \"./convert\";\nimport { ObjectColor } from \"../types\";\n\nexport const equalColorObjects = (first: ObjectColor, second: ObjectColor): boolean => {\n if (first === second) return true;\n\n for (const prop in first) {\n // The following allows for a type-safe calling of this function (first & second have to be HSL, HSV, or RGB)\n // with type-unsafe iterating over object keys. TS does not allow this without an index (`[key: string]: number`)\n // on an object to define how iteration is normally done. To ensure extra keys are not allowed on our types,\n // we must cast our object to unknown (as RGB demands `r` be a key, while `Record<string, x>` does not care if\n // there is or not), and then as a type TS can iterate over.\n if (\n ((first as unknown) as Record<string, number>)[prop] !==\n ((second as unknown) as Record<string, number>)[prop]\n )\n return false;\n }\n\n return true;\n};\n\nexport const equalColorString = (first: string, second: string): boolean => {\n return first.replace(/\\s/g, \"\") === second.replace(/\\s/g, \"\");\n};\n\nexport const equalHex = (first: string, second: string): boolean => {\n if (first.toLowerCase() === second.toLowerCase()) return true;\n\n // To compare colors like `#FFF` and `ffffff` we convert them into RGB objects\n return equalColorObjects(hexToRgba(first), hexToRgba(second));\n};\n","import { useState, useEffect, useCallback, useRef } from \"react\";\nimport { ColorModel, AnyColor, HsvaColor } from \"../types\";\nimport { equalColorObjects } from \"../utils/compare\";\nimport { useEventCallback } from \"./useEventCallback\";\n\nexport function useColorManipulation<T extends AnyColor>(\n colorModel: ColorModel<T>,\n color: T,\n onChange?: (color: T) => void\n): [HsvaColor, (color: Partial<HsvaColor>) => void] {\n // Save onChange callback in the ref for avoiding \"useCallback hell\"\n const onChangeCallback = useEventCallback<T>(onChange);\n\n // No matter which color model is used (HEX, RGB(A) or HSL(A)),\n // all internal calculations are based on HSVA model\n const [hsva, updateHsva] = useState<HsvaColor>(() => colorModel.toHsva(color));\n\n // By using this ref we're able to prevent extra updates\n // and the effects recursion during the color conversion\n const cache = useRef({ color, hsva });\n\n // Update local HSVA-value if `color` property value is changed,\n // but only if that's not the same color that we just sent to the parent\n useEffect(() => {\n if (!colorModel.equal(color, cache.current.color)) {\n const newHsva = colorModel.toHsva(color);\n cache.current = { hsva: newHsva, color };\n updateHsva(newHsva);\n }\n }, [color, colorModel]);\n\n // Trigger `onChange` callback only if an updated color is different from cached one;\n // save the new color to the ref to prevent unnecessary updates\n useEffect(() => {\n let newColor;\n if (\n !equalColorObjects(hsva, cache.current.hsva) &&\n !colorModel.equal((newColor = colorModel.fromHsva(hsva)), cache.current.color)\n ) {\n cache.current = { hsva, color: newColor };\n onChangeCallback(newColor);\n }\n }, [hsva, colorModel, onChangeCallback]);\n\n // Merge the current HSVA color object with updated params.\n // For example, when a child component sends `h` or `s` only\n const handleChange = useCallback((params: Partial<HsvaColor>) => {\n updateHsva((current) => Object.assign({}, current, params));\n }, []);\n\n return [hsva, handleChange];\n}\n","declare const __webpack_nonce__: string | undefined;\nlet nonce: string | undefined;\n\n/**\n * Returns a nonce hash included by Webpack or the one defined manually by developer.\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/nonce\n * https://webpack.js.org/guides/csp/\n */\nexport const getNonce = (): string | undefined => {\n if (nonce) return nonce;\n if (typeof __webpack_nonce__ !== \"undefined\") return __webpack_nonce__;\n return undefined;\n};\n\n/**\n * Signs the style tag with a base64-encoded string (nonce) to conforms to Content Security Policies.\n * This function has to be invoked before any picker is rendered if you aren't using Webpack for CSP.\n */\nexport const setNonce = (hash: string): void => {\n nonce = hash;\n};\n","import { useLayoutEffect, useEffect } from \"react\";\n\n// React currently throws a warning when using useLayoutEffect on the server.\n// To get around it, we can conditionally useEffect on the server (no-op) and\n// useLayoutEffect in the browser.\nexport const useIsomorphicLayoutEffect =\n typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n","import { RefObject } from \"react\";\n\nimport { useIsomorphicLayoutEffect } from \"./useIsomorphicLayoutEffect\";\nimport { getNonce } from \"../utils/nonce\";\n\n// Bundler is configured to load this as a processed minified CSS-string\nimport styles from \"../css/styles.css\";\n\nconst styleElementMap: Map<Document, HTMLStyleElement> = new Map();\n\n/**\n * Injects CSS code into the document's <head>\n */\nexport const useStyleSheet = (nodeRef: RefObject<HTMLDivElement>): void => {\n useIsomorphicLayoutEffect(() => {\n const parentDocument = nodeRef.current ? nodeRef.current.ownerDocument : document;\n\n if (typeof parentDocument !== \"undefined\" && !styleElementMap.has(parentDocument)) {\n const styleElement = parentDocument.createElement(\"style\");\n styleElement.innerHTML = styles;\n styleElementMap.set(parentDocument, styleElement);\n\n // Conform to CSP rules by setting `nonce` attribute to the inline styles\n const nonce = getNonce();\n if (nonce) styleElement.setAttribute(\"nonce\", nonce);\n\n parentDocument.head.appendChild(styleElement);\n }\n }, []);\n};\n","import React, { useRef } from \"react\";\n\nimport { Hue } from \"./Hue\";\nimport { Saturation } from \"./Saturation\";\n\nimport { ColorModel, ColorPickerBaseProps, AnyColor } from \"../../types\";\nimport { useColorManipulation } from \"../../hooks/useColorManipulation\";\nimport { useStyleSheet } from \"../../hooks/useStyleSheet\";\nimport { formatClassName } from \"../../utils/format\";\n\ninterface Props<T extends AnyColor> extends Partial<ColorPickerBaseProps<T>> {\n colorModel: ColorModel<T>;\n}\n\nexport const ColorPicker = <T extends AnyColor>({\n className,\n colorModel,\n color = colorModel.defaultColor,\n onChange,\n ...rest\n}: Props<T>): JSX.Element => {\n const nodeRef = useRef<HTMLDivElement>(null);\n useStyleSheet(nodeRef);\n\n const [hsva, updateHsva] = useColorManipulation<T>(colorModel, color, onChange);\n\n const nodeClassName = formatClassName([\"react-colorful\", className]);\n\n return (\n <div {...rest} ref={nodeRef} className={nodeClassName}>\n <Saturation hsva={hsva} onChange={updateHsva} />\n <Hue hue={hsva.h} onChange={updateHsva} className=\"react-colorful__last-control\" />\n </div>\n );\n};\n","import React from \"react\";\n\nimport { ColorPicker } from \"./common/ColorPicker\";\nimport { ColorModel, ColorPickerBaseProps } from \"../types\";\nimport { equalHex } from \"../utils/compare\";\nimport { hexToHsva, hsvaToHex } from \"../utils/convert\";\n\nconst colorModel: ColorModel<string> = {\n defaultColor: \"000\",\n toHsva: hexToHsva,\n fromHsva: hsvaToHex,\n equal: equalHex,\n};\n\nexport const HexColorPicker = (props: Partial<ColorPickerBaseProps<string>>): JSX.Element => (\n <ColorPicker {...props} colorModel={colorModel} />\n);\n","const matcher = /^#?([0-9A-F]{3,8})$/i;\n\nexport const validHex = (value: string, alpha?: boolean): boolean => {\n const match = matcher.exec(value);\n const length = match ? match[1].length : 0;\n\n return (\n length === 3 || // '#rgb' format\n length === 6 || // '#rrggbb' format\n (!!alpha && length === 4) || // '#rgba' format\n (!!alpha && length === 8) // '#rrggbbaa' format\n );\n};\n","import React, { useState, useEffect, useCallback } from \"react\";\n\nimport { useEventCallback } from \"../../hooks/useEventCallback\";\nimport { ColorInputBaseProps } from \"../../types\";\n\ninterface Props extends ColorInputBaseProps {\n /** Blocks typing invalid characters and limits string length */\n escape: (value: string) => string;\n /** Checks that value is valid color string */\n validate: (value: string) => boolean;\n /** Processes value before displaying it in the input */\n format?: (value: string) => string;\n /** Processes value before sending it in `onChange` */\n process?: (value: string) => string;\n}\n\nexport const ColorInput = (props: Props): JSX.Element => {\n const { color = \"\", onChange, onBlur, escape, validate, format, process, ...rest } = props;\n const [value, setValue] = useState(() => escape(color));\n const onChangeCallback = useEventCallback<string>(onChange);\n const onBlurCallback = useEventCallback<React.FocusEvent<HTMLInputElement>>(onBlur);\n\n // Trigger `onChange` handler only if the input value is a valid color\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const inputValue = escape(e.target.value);\n setValue(inputValue);\n if (validate(inputValue)) onChangeCallback(process ? process(inputValue) : inputValue);\n },\n [escape, process, validate, onChangeCallback]\n );\n\n // Take the color from props if the last typed color (in local state) is not valid\n const handleBlur = useCallback(\n (e: React.FocusEvent<HTMLInputElement>) => {\n if (!validate(e.target.value)) setValue(escape(color));\n onBlurCallback(e);\n },\n [color, escape, validate, onBlurCallback]\n );\n\n // Update the local state when `color` property value is changed\n useEffect(() => {\n setValue(escape(color));\n }, [color, escape]);\n\n return (\n <input\n {...rest}\n value={format ? format(value) : value}\n spellCheck=\"false\" // the element should not be checked for spelling errors\n onChange={handleChange}\n onBlur={handleBlur}\n />\n );\n};\n","import React, { useCallback } from \"react\";\nimport { ColorInputBaseProps } from \"../types\";\n\nimport { validHex } from \"../utils/validate\";\nimport { ColorInput } from \"./common/ColorInput\";\n\ninterface HexColorInputProps extends ColorInputBaseProps {\n /** Enables `#` prefix displaying */\n prefixed?: boolean;\n /** Allows `#rgba` and `#rrggbbaa` color formats */\n alpha?: boolean;\n}\n\n/** Adds \"#\" symbol to the beginning of the string */\nconst prefix = (value: string) => \"#\" + value;\n\nexport const HexColorInput = (props: HexColorInputProps): JSX.Element => {\n const { prefixed, alpha, ...rest } = props;\n\n /** Escapes all non-hexadecimal characters including \"#\" */\n const escape = useCallback(\n (value: string) => value.replace(/([^0-9A-F]+)/gi, \"\").substr(0, alpha ? 8 : 6),\n [alpha]\n );\n\n /** Validates hexadecimal strings */\n const validate = useCallback((value: string) => validHex(value, alpha), [alpha]);\n\n return (\n <ColorInput\n {...rest}\n escape={escape}\n format={prefixed ? prefix : undefined}\n process={prefix}\n validate={validate}\n />\n );\n};\n","import { Class, PlainObject, Primitive } from './types';\n\nconst DOM_PROPERTIES_TO_CHECK: Array<keyof HTMLElement> = [\n 'innerHTML',\n 'ownerDocument',\n 'style',\n 'attributes',\n 'nodeValue',\n];\n\nconst objectTypes = [\n 'Array',\n 'ArrayBuffer',\n 'AsyncFunction',\n 'AsyncGenerator',\n 'AsyncGeneratorFunction',\n 'Date',\n 'Error',\n 'Function',\n 'Generator',\n 'GeneratorFunction',\n 'HTMLElement',\n 'Map',\n 'Object',\n 'Promise',\n 'RegExp',\n 'Set',\n 'WeakMap',\n 'WeakSet',\n] as const;\n\nconst primitiveTypes = [\n 'bigint',\n 'boolean',\n 'null',\n 'number',\n 'string',\n 'symbol',\n 'undefined',\n] as const;\n\nexport type ObjectTypes = typeof objectTypes[number];\n\nexport type PrimitiveTypes = typeof primitiveTypes[number];\n\nexport type TypeName = ObjectTypes | PrimitiveTypes;\n\nexport function getObjectType(value: unknown): ObjectTypes | undefined {\n const objectTypeName = Object.prototype.toString.call(value).slice(8, -1);\n\n if (/HTML\\w+Element/.test(objectTypeName)) {\n return 'HTMLElement';\n }\n\n if (isObjectType(objectTypeName)) {\n return objectTypeName;\n }\n\n return undefined;\n}\n\nfunction isObjectOfType<T>(type: string) {\n return (value: unknown): value is T => getObjectType(value) === type;\n}\n\nfunction isObjectType(name: unknown): name is ObjectTypes {\n return objectTypes.includes(name as ObjectTypes);\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction isOfType<T extends Primitive | Function>(type: string) {\n return (value: unknown): value is T => typeof value === type;\n}\n\nfunction isPrimitiveType(name: unknown): name is PrimitiveTypes {\n return primitiveTypes.includes(name as PrimitiveTypes);\n}\n\nfunction is(value: unknown): TypeName {\n if (value === null) {\n return 'null';\n }\n\n switch (typeof value) {\n case 'bigint':\n return 'bigint';\n case 'boolean':\n return 'boolean';\n case 'number':\n return 'number';\n case 'string':\n return 'string';\n case 'symbol':\n return 'symbol';\n case 'undefined':\n return 'undefined';\n default:\n }\n\n if (is.array(value)) {\n return 'Array';\n }\n\n if (is.plainFunction(value)) {\n return 'Function';\n }\n\n const tagType = getObjectType(value);\n\n /* istanbul ignore else */\n if (tagType) {\n return tagType;\n }\n\n /* istanbul ignore next */\n return 'Object';\n}\n\nis.array = Array.isArray;\n\nis.arrayOf = (target: unknown[], predicate: (v: unknown) => boolean): boolean => {\n if (!is.array(target) && !is.function(predicate)) {\n return false;\n }\n\n return target.every(d => predicate(d));\n};\n\nis.asyncGeneratorFunction = (value: unknown): value is (...arguments_: any[]) => Promise<unknown> =>\n getObjectType(value) === 'AsyncGeneratorFunction';\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nis.asyncFunction = isObjectOfType<Function>('AsyncFunction');\n\nis.bigint = isOfType<bigint>('bigint');\n\nis.boolean = (value: unknown): value is boolean => {\n return value === true || value === false;\n};\n\nis.date = isObjectOfType<Date>('Date');\n\nis.defined = (value: unknown): boolean => !is.undefined(value);\n\nis.domElement = (value: unknown): value is HTMLElement => {\n return (\n is.object(value) &&\n !is.plainObject(value) &&\n (value as HTMLElement).nodeType === 1 &&\n is.string((value as HTMLElement).nodeName) &&\n DOM_PROPERTIES_TO_CHECK.every(property => property in (value as HTMLElement))\n );\n};\n\nis.empty = (value: unknown): boolean => {\n return (\n (is.string(value) && value.length === 0) ||\n (is.array(value) && value.length === 0) ||\n (is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length === 0) ||\n (is.set(value) && value.size === 0) ||\n (is.map(value) && value.size === 0)\n );\n};\n\nis.error = isObjectOfType<Error>('Error');\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nis.function = isOfType<Function>('function');\n\nis.generator = (value: unknown): value is Generator => {\n return (\n is.iterable(value) &&\n is.function((value as IterableIterator<unknown>).next) &&\n is.function((value as IterableIterator<unknown>).throw)\n );\n};\n\nis.generatorFunction = isObjectOfType<GeneratorFunction>('GeneratorFunction');\n\nis.instanceOf = <T>(instance: unknown, class_: Class<T>): instance is T => {\n if (!instance || !(class_ as Class<T>)) {\n return false;\n }\n\n return Object.getPrototypeOf(instance) === class_.prototype;\n};\n\nis.iterable = (value: unknown): value is IterableIterator<unknown> => {\n return (\n !is.nullOrUndefined(value) && is.function((value as IterableIterator<unknown>)[Symbol.iterator])\n );\n};\n\nis.map = isObjectOfType<Map<unknown, unknown>>('Map');\n\nis.nan = (value: unknown): boolean => {\n return Number.isNaN(value as number);\n};\n\nis.null = (value: unknown): value is null => {\n return value === null;\n};\n\nis.nullOrUndefined = (value: unknown): value is null | undefined => {\n return is.null(value) || is.undefined(value);\n};\n\nis.number = (value: unknown): value is number => {\n return isOfType<number>('number')(value) && !is.nan(value);\n};\n\nis.numericString = (value: unknown): value is string => {\n return is.string(value) && (value as string).length > 0 && !Number.isNaN(Number(value));\n};\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nis.object = (value: unknown): value is object => {\n return !is.nullOrUndefined(value) && (is.function(value) || typeof value === 'object');\n};\n\nis.oneOf = (target: unknown[], value: any): boolean => {\n if (!is.array(target)) {\n return false;\n }\n\n // eslint-disable-next-line unicorn/prefer-includes\n return target.indexOf(value) > -1;\n};\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nis.plainFunction = isObjectOfType<Function>('Function');\n\nis.plainObject = (value: unknown): value is PlainObject => {\n if (getObjectType(value) !== 'Object') {\n return false;\n }\n\n const prototype = Object.getPrototypeOf(value);\n\n return prototype === null || prototype === Object.getPrototypeOf({});\n};\n\nis.primitive = (value: unknown): value is Primitive =>\n is.null(value) || isPrimitiveType(typeof value);\n\nis.promise = isObjectOfType<Promise<unknown>>('Promise');\n\nis.propertyOf = (\n target: PlainObject,\n key: string,\n predicate?: (v: unknown) => boolean,\n): boolean => {\n if (!is.object(target) || !key) {\n return false;\n }\n\n const value = target[key];\n\n if (is.function(predicate)) {\n return predicate(value);\n }\n\n return is.defined(value);\n};\n\nis.regexp = isObjectOfType<RegExp>('RegExp');\n\nis.set = isObjectOfType<Set<PlainObject>>('Set');\n\nis.string = isOfType<string>('string');\n\nis.symbol = isOfType<symbol>('symbol');\n\nis.undefined = isOfType<undefined>('undefined');\n\nis.weakMap = isObjectOfType<WeakMap<PlainObject, unknown>>('WeakMap');\n\nis.weakSet = isObjectOfType<WeakSet<PlainObject>>('WeakSet');\n\nexport * from './types';\n\nexport default is;\n","import * as equal from 'fast-deep-equal';\nimport is from 'is-lite';\n\nimport { CompareValuesOptions, Data, Key, Options, ValidTypes, Value } from './types';\n\nexport function canHaveLength(...args: any): boolean {\n return args.every((d: unknown) => is.string(d) || is.array(d) || is.plainObject(d));\n}\n\nexport function checkEquality(left: Data, right: Data, value: Value) {\n if (!isSameType(left, right)) {\n return false;\n }\n\n if ([left, right].every(is.array)) {\n return !left.some(hasValue(value)) && right.some(hasValue(value));\n }\n\n /* istanbul ignore else */\n if ([left, right].every(is.plainObject)) {\n return (\n !Object.entries(left).some(hasEntry(value)) && Object.entries(right).some(hasEntry(value))\n );\n }\n\n return right === value;\n}\n\nexport function compareNumbers<K = Key>(\n previousData: Data,\n data: Data,\n options: Options<K>,\n): boolean {\n const { actual, key, previous, type } = options;\n const left = nested(previousData, key);\n const right = nested(data, key);\n\n let changed =\n [left, right].every(is.number) && (type === 'increased' ? left < right : left > right);\n\n if (!is.undefined(actual)) {\n changed = changed && right === actual;\n }\n\n if (!is.undefined(previous)) {\n changed = changed && left === previous;\n }\n\n return changed;\n}\n\nexport function compareValues<K = Key>(\n previousData: Data,\n data: Data,\n options: CompareValuesOptions<K>,\n) {\n const { key, type, value } = options;\n\n const left = nested(previousData, key);\n const right = nested(data, key);\n const primary = type === 'added' ? left : right;\n const secondary = type === 'added' ? right : left;\n\n // console.log({ primary, secondary });\n\n if (!is.nullOrUndefined(value)) {\n if (is.defined(primary)) {\n // check if nested data matches\n if (is.array(primary) || is.plainObject(primary)) {\n return checkEquality(primary, secondary, value);\n }\n } else {\n return equal(secondary, value);\n }\n\n return false;\n }\n\n if ([left, right].every(is.array)) {\n return !secondary.every(isEqualPredicate(primary));\n }\n\n if ([left, right].every(is.plainObject)) {\n return hasExtraKeys(Object.keys(primary), Object.keys(secondary));\n }\n\n return (\n ![left, right].every(d => is.primitive(d) && is.defined(d)) &&\n (type === 'added'\n ? !is.defined(left) && is.defined(right)\n : is.defined(left) && !is.defined(right))\n );\n}\n\nexport function getIterables<K = Key>(previousData: Data, data: Data, { key }: Options<K> = {}) {\n let left = nested(previousData, key);\n let right = nested(data, key);\n\n if (!isSameType(left, right)) {\n throw new TypeError('Inputs have different types');\n }\n\n if (!canHaveLength(left, right)) {\n throw new TypeError(\"Inputs don't have length\");\n }\n\n if ([left, right].every(is.plainObject)) {\n left = Object.keys(left);\n right = Object.keys(right);\n }\n\n return [left, right];\n}\n\nexport function hasEntry(input: Value) {\n return ([key, value]: [string, Value]) => {\n if (is.array(input)) {\n return (\n equal(input, value) ||\n input.some(d => equal(d, value) || (is.array(value) && isEqualPredicate(value)(d)))\n );\n }\n\n /* istanbul ignore else */\n if (is.plainObject(input) && input[key]) {\n return !!input[key] && equal(input[key], value);\n }\n\n return equal(input, value);\n };\n}\n\nexport function hasExtraKeys(left: string[], right: string[]): boolean {\n return right.some(d => left.indexOf(d) < 0);\n}\n\nexport function hasValue(input: Value) {\n return (value: Value) => {\n if (is.array(input)) {\n return input.some(d => equal(d, value) || (is.array(value) && isEqualPredicate(value)(d)));\n }\n\n return equal(input, value);\n };\n}\n\nexport function includesOrEqualsTo<T>(previousValue: T | T[], value: T): boolean {\n return is.array(previousValue)\n ? previousValue.some(d => equal(d, value))\n : equal(previousValue, value);\n}\n\nexport function isEqualPredicate(data: unknown[]) {\n return (value: unknown) => !!data.find(d => equal(d, value));\n}\n\nexport function isSameType(...args: ValidTypes[]): boolean {\n return (\n args.every(is.array) ||\n args.every(is.number) ||\n args.every(is.plainObject) ||\n args.every(is.string)\n );\n}\n\nexport function nested<T extends Data, K = Key>(data: T, property?: K) {\n /* istanbul ignore else */\n if (is.plainObject(data) || is.array(data)) {\n /* istanbul ignore else */\n if (is.string(property)) {\n const props: Array<any> = property.split('.');\n\n return props.reduce((acc, d) => acc && acc[d], data);\n }\n\n /* istanbul ignore else */\n if (is.number(property)) {\n return data[property];\n }\n\n return data;\n }\n\n return data;\n}\n","import * as equal from 'fast-deep-equal';\nimport is from 'is-lite';\n\nimport { compareNumbers, compareValues, getIterables, includesOrEqualsTo, nested } from './helpers';\nimport { Data, KeyType, TreeChanges, Value } from './types';\n\nexport default function treeChanges<P extends Data, D extends Data, K = KeyType<P, D>>(\n previousData: P,\n data: D,\n): TreeChanges<K> {\n if ([previousData, data].some(is.nullOrUndefined)) {\n throw new Error('Missing required parameters');\n }\n\n if (![previousData, data].every(d => is.plainObject(d) || is.array(d))) {\n throw new Error('Expected plain objects or array');\n }\n\n const added = (key?: K, value?: Value): boolean => {\n try {\n return compareValues<K>(previousData, data, { key, type: 'added', value });\n } catch {\n /* istanbul ignore next */\n return false;\n }\n };\n\n const changed = (key?: K | string, actual?: Value, previous?: Value): boolean => {\n try {\n const left = nested(previousData, key);\n const right = nested(data, key);\n const hasActual = is.defined(actual);\n const hasPrevious = is.defined(previous);\n\n if (hasActual || hasPrevious) {\n const leftComparator = hasPrevious\n ? includesOrEqualsTo(previous, left)\n : !includesOrEqualsTo(actual, left);\n const rightComparator = includesOrEqualsTo(actual, right);\n\n return leftComparator && rightComparator;\n }\n\n if ([left, right].every(is.array) || [left, right].every(is.plainObject)) {\n return !equal(left, right);\n }\n\n return left !== right;\n } catch {\n /* istanbul ignore next */\n return false;\n }\n };\n\n const changedFrom = (key: K | string, previous: Value, actual?: Value): boolean => {\n if (!is.defined(key)) {\n return false;\n }\n\n try {\n const left = nested(previousData, key);\n const right = nested(data, key);\n const hasActual = is.defined(actual);\n\n return (\n includesOrEqualsTo(previous, left) &&\n (hasActual ? includesOrEqualsTo(actual, right) : !hasActual)\n );\n } catch {\n /* istanbul ignore next */\n return false;\n }\n };\n\n /**\n * @deprecated\n * Use \"changed\" instead\n */\n const changedTo = (key: K | string, actual: Value): boolean => {\n if (!is.defined(key)) {\n return false;\n }\n\n /* istanbul ignore next */\n if (process.env.NODE_ENV === 'development') {\n // eslint-disable-next-line no-console\n console.warn('`changedTo` is deprecated! Replace it with `change`');\n }\n\n return changed(key, actual);\n };\n\n const decreased = (key: K, actual?: Value, previous?: Value): boolean => {\n if (!is.defined(key)) {\n return false;\n }\n\n try {\n return compareNumbers<K>(previousData, data, { key, actual, previous, type: 'decreased' });\n } catch {\n /* istanbul ignore next */\n return false;\n }\n };\n\n const emptied = (key?: K): boolean => {\n try {\n const [left, right] = getIterables(previousData, data, { key });\n\n return !!left.length && !right.length;\n } catch {\n /* istanbul ignore next */\n return false;\n }\n };\n\n const filled = (key?: K): boolean => {\n try {\n const [left, right] = getIterables(previousData, data, { key });\n\n return !left.length && !!right.length;\n } catch {\n /* istanbul ignore next */\n return false;\n }\n };\n\n const increased = (key: K, actual?: Value, previous?: Value): boolean => {\n if (!is.defined(key)) {\n return false;\n }\n\n try {\n return compareNumbers<K>(previousData, data, { key, actual, previous, type: 'increased' });\n } catch {\n /* istanbul ignore next */\n return false;\n }\n };\n\n const removed = (key?: K, value?: Value): boolean => {\n try {\n return compareValues<K>(previousData, data, { key, type: 'removed', value });\n } catch {\n /* istanbul ignore next */\n return false;\n }\n };\n\n return { added, changed, changedFrom, changedTo, decreased, emptied, filled, increased, removed };\n}\n\nexport * from './types';\n","export default typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined';\n","import isBrowser from './isBrowser';\n\nconst timeoutDuration = (function(){\n const longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];\n for (let i = 0; i < longerTimeoutBrowsers.length; i += 1) {\n if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {\n return 1;\n }\n }\n return 0;\n}());\n\nexport function microtaskDebounce(fn) {\n let called = false\n return () => {\n if (called) {\n return\n }\n called = true\n window.Promise.resolve().then(() => {\n called = false\n fn()\n })\n }\n}\n\nexport function taskDebounce(fn) {\n let scheduled = false;\n return () => {\n if (!scheduled) {\n scheduled = true;\n setTimeout(() => {\n scheduled = false;\n fn();\n }, timeoutDuration);\n }\n };\n}\n\nconst supportsMicroTasks = isBrowser && window.Promise\n\n\n/**\n* Create a debounced version of a method, that's asynchronously deferred\n* but called in the minimum time possible.\n*\n* @method\n* @memberof Popper.Utils\n* @argument {Function} fn\n* @returns {Function}\n*/\nexport default (supportsMicroTasks\n ? microtaskDebounce\n : taskDebounce);\n","/**\n * Check if the given variable is a function\n * @method\n * @memberof Popper.Utils\n * @argument {Any} functionToCheck - variable to check\n * @returns {Boolean} answer to: is a function?\n */\nexport default function isFunction(functionToCheck) {\n const getType = {};\n return (\n functionToCheck &&\n getType.toString.call(functionToCheck) === '[object Function]'\n );\n}\n","/**\n * Get CSS computed property of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Eement} element\n * @argument {String} property\n */\nexport default function getStyleComputedProperty(element, property) {\n if (element.nodeType !== 1) {\n return [];\n }\n // NOTE: 1 DOM access here\n const window = element.ownerDocument.defaultView;\n const css = window.getComputedStyle(element, null);\n return property ? css[property] : css;\n}\n","/**\n * Returns the parentNode or the host of the element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} parent\n */\nexport default function getParentNode(element) {\n if (element.nodeName === 'HTML') {\n return element;\n }\n return element.parentNode || element.host;\n}\n","import getStyleComputedProperty from './getStyleComputedProperty';\nimport getParentNode from './getParentNode';\n\n/**\n * Returns the scrolling parent of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} scroll parent\n */\nexport default function getScrollParent(element) {\n // Return body, `getScroll` will take care to get the correct `scrollTop` from it\n if (!element) {\n return document.body\n }\n\n switch (element.nodeName) {\n case 'HTML':\n case 'BODY':\n return element.ownerDocument.body\n case '#document':\n return element.body\n }\n\n // Firefox want us to check `-x` and `-y` variations as well\n const { overflow, overflowX, overflowY } = getStyleComputedProperty(element);\n if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {\n return element;\n }\n\n return getScrollParent(getParentNode(element));\n}\n","/**\n * Returns the reference node of the reference object, or the reference object itself.\n * @method\n * @memberof Popper.Utils\n * @param {Element|Object} reference - the reference element (the popper will be relative to this)\n * @returns {Element} parent\n */\nexport default function getReferenceNode(reference) {\n return reference && reference.referenceNode ? reference.referenceNode : reference;\n}\n","import isBrowser from './isBrowser';\n\nconst isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);\nconst isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);\n\n/**\n * Determines if the browser is Internet Explorer\n * @method\n * @memberof Popper.Utils\n * @param {Number} version to check\n * @returns {Boolean} isIE\n */\nexport default function isIE(version) {\n if (version === 11) {\n return isIE11;\n }\n if (version === 10) {\n return isIE10;\n }\n return isIE11 || isIE10;\n}\n","import getStyleComputedProperty from './getStyleComputedProperty';\nimport isIE from './isIE';\n/**\n * Returns the offset parent of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} offset parent\n */\nexport default function getOffsetParent(element) {\n if (!element) {\n return document.documentElement;\n }\n\n const noOffsetParent = isIE(10) ? document.body : null;\n\n // NOTE: 1 DOM access here\n let offsetParent = element.offsetParent || null;\n // Skip hidden elements which don't have an offsetParent\n while (offsetParent === noOffsetParent && element.nextElementSibling) {\n offsetParent = (element = element.nextElementSibling).offsetParent;\n }\n\n const nodeName = offsetParent && offsetParent.nodeName;\n\n if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {\n return element ? element.ownerDocument.documentElement : document.documentElement;\n }\n\n // .offsetParent will return the closest TH, TD or TABLE in case\n // no offsetParent is present, I hate this job...\n if (\n ['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 &&\n getStyleComputedProperty(offsetParent, 'position') === 'static'\n ) {\n return getOffsetParent(offsetParent);\n }\n\n return offsetParent;\n}\n","/**\n * Finds the root node (document, shadowDOM root) of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} node\n * @returns {Element} root node\n */\nexport default function getRoot(node) {\n if (node.parentNode !== null) {\n return getRoot(node.parentNode);\n }\n\n return node;\n}\n","import isOffsetContainer from './isOffsetContainer';\nimport getRoot from './getRoot';\nimport getOffsetParent from './getOffsetParent';\n\n/**\n * Finds the offset parent common to the two provided nodes\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element1\n * @argument {Element} element2\n * @returns {Element} common offset parent\n */\nexport default function findCommonOffsetParent(element1, element2) {\n // This check is needed to avoid errors in case one of the elements isn't defined for any reason\n if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {\n return document.documentElement;\n }\n\n // Here we make sure to give as \"start\" the element that comes first in the DOM\n const order =\n element1.compareDocumentPosition(element2) &\n Node.DOCUMENT_POSITION_FOLLOWING;\n const start = order ? element1 : element2;\n const end = order ? element2 : element1;\n\n // Get common ancestor container\n const range = document.createRange();\n range.setStart(start, 0);\n range.setEnd(end, 0);\n const { commonAncestorContainer } = range;\n\n // Both nodes are inside #document\n if (\n (element1 !== commonAncestorContainer &&\n element2 !== commonAncestorContainer) ||\n start.contains(end)\n ) {\n if (isOffsetContainer(commonAncestorContainer)) {\n return commonAncestorContainer;\n }\n\n return getOffsetParent(commonAncestorContainer);\n }\n\n // one of the nodes is inside shadowDOM, find which one\n const element1root = getRoot(element1);\n if (element1root.host) {\n return findCommonOffsetParent(element1root.host, element2);\n } else {\n return findCommonOffsetParent(element1, getRoot(element2).host);\n }\n}\n","import getOffsetParent from './getOffsetParent';\n\nexport default function isOffsetContainer(element) {\n const { nodeName } = element;\n if (nodeName === 'BODY') {\n return false;\n }\n return (\n nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element\n );\n}\n","/**\n * Gets the scroll value of the given element in the given side (top and left)\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @argument {String} side `top` or `left`\n * @returns {number} amount of scrolled pixels\n */\nexport default function getScroll(element, side = 'top') {\n const upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';\n const nodeName = element.nodeName;\n\n if (nodeName === 'BODY' || nodeName === 'HTML') {\n const html = element.ownerDocument.documentElement;\n const scrollingElement = element.ownerDocument.scrollingElement || html;\n return scrollingElement[upperSide];\n }\n\n return element[upperSide];\n}\n","/*\n * Helper to detect borders of a given element\n * @method\n * @memberof Popper.Utils\n * @param {CSSStyleDeclaration} styles\n * Result of `getStyleComputedProperty` on the given element\n * @param {String} axis - `x` or `y`\n * @return {number} borders - The borders size of the given axis\n */\n\nexport default function getBordersSize(styles, axis) {\n const sideA = axis === 'x' ? 'Left' : 'Top';\n const sideB = sideA === 'Left' ? 'Right' : 'Bottom';\n\n return (\n parseFloat(styles[`border${sideA}Width`]) +\n parseFloat(styles[`border${sideB}Width`])\n );\n}\n","import isIE from './isIE';\n\nfunction getSize(axis, body, html, computedStyle) {\n return Math.max(\n body[`offset${axis}`],\n body[`scroll${axis}`],\n html[`client${axis}`],\n html[`offset${axis}`],\n html[`scroll${axis}`],\n isIE(10)\n ? (parseInt(html[`offset${axis}`]) + \n parseInt(computedStyle[`margin${axis === 'Height' ? 'Top' : 'Left'}`]) + \n parseInt(computedStyle[`margin${axis === 'Height' ? 'Bottom' : 'Right'}`]))\n : 0 \n );\n}\n\nexport default function getWindowSizes(document) {\n const body = document.body;\n const html = document.documentElement;\n const computedStyle = isIE(10) && getComputedStyle(html);\n\n return {\n height: getSize('Height', body, html, computedStyle),\n width: getSize('Width', body, html, computedStyle),\n };\n}\n","/**\n * Given element offsets, generate an output similar to getBoundingClientRect\n * @method\n * @memberof Popper.Utils\n * @argument {Object} offsets\n * @returns {Object} ClientRect like output\n */\nexport default function getClientRect(offsets) {\n return {\n ...offsets,\n right: offsets.left + offsets.width,\n bottom: offsets.top + offsets.height,\n };\n}\n","import getStyleComputedProperty from './getStyleComputedProperty';\nimport getBordersSize from './getBordersSize';\nimport getWindowSizes from './getWindowSizes';\nimport getScroll from './getScroll';\nimport getClientRect from './getClientRect';\nimport isIE from './isIE';\n\n/**\n * Get bounding client rect of given element\n * @method\n * @memberof Popper.Utils\n * @param {HTMLElement} element\n * @return {Object} client rect\n */\nexport default function getBoundingClientRect(element) {\n let rect = {};\n\n // IE10 10 FIX: Please, don't ask, the element isn't\n // considered in DOM in some circumstances...\n // This isn't reproducible in IE10 compatibility mode of IE11\n try {\n if (isIE(10)) {\n rect = element.getBoundingClientRect();\n const scrollTop = getScroll(element, 'top');\n const scrollLeft = getScroll(element, 'left');\n rect.top += scrollTop;\n rect.left += scrollLeft;\n rect.bottom += scrollTop;\n rect.right += scrollLeft;\n }\n else {\n rect = element.getBoundingClientRect();\n }\n }\n catch(e){}\n\n const result = {\n left: rect.left,\n top: rect.top,\n width: rect.right - rect.left,\n height: rect.bottom - rect.top,\n };\n\n // subtract scrollbar size from sizes\n const sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};\n const width =\n sizes.width || element.clientWidth || result.width;\n const height =\n sizes.height || element.clientHeight || result.height;\n\n let horizScrollbar = element.offsetWidth - width;\n let vertScrollbar = element.offsetHeight - height;\n\n // if an hypothetical scrollbar is detected, we must be sure it's not a `border`\n // we make this check conditional for performance reasons\n if (horizScrollbar || vertScrollbar) {\n const styles = getStyleComputedProperty(element);\n horizScrollbar -= getBordersSize(styles, 'x');\n vertScrollbar -= getBordersSize(styles, 'y');\n\n result.width -= horizScrollbar;\n result.height -= vertScrollbar;\n }\n\n return getClientRect(result);\n}\n","import getStyleComputedProperty from './getStyleComputedProperty';\nimport includeScroll from './includeScroll';\nimport getScrollParent from './getScrollParent';\nimport getBoundingClientRect from './getBoundingClientRect';\nimport runIsIE from './isIE';\nimport getClientRect from './getClientRect';\n\nexport default function getOffsetRectRelativeToArbitraryNode(children, parent, fixedPosition = false) {\n const isIE10 = runIsIE(10);\n const isHTML = parent.nodeName === 'HTML';\n const childrenRect = getBoundingClientRect(children);\n const parentRect = getBoundingClientRect(parent);\n const scrollParent = getScrollParent(children);\n\n const styles = getStyleComputedProperty(parent);\n const borderTopWidth = parseFloat(styles.borderTopWidth);\n const borderLeftWidth = parseFloat(styles.borderLeftWidth);\n\n // In cases where the parent is fixed, we must ignore negative scroll in offset calc\n if(fixedPosition && isHTML) {\n parentRect.top = Math.max(parentRect.top, 0);\n parentRect.left = Math.max(parentRect.left, 0);\n }\n let offsets = getClientRect({\n top: childrenRect.top - parentRect.top - borderTopWidth,\n left: childrenRect.left - parentRect.left - borderLeftWidth,\n width: childrenRect.width,\n height: childrenRect.height,\n });\n offsets.marginTop = 0;\n offsets.marginLeft = 0;\n\n // Subtract margins of documentElement in case it's being used as parent\n // we do this only on HTML because it's the only element that behaves\n // differently when margins are applied to it. The margins are included in\n // the box of the documentElement, in the other cases not.\n if (!isIE10 && isHTML) {\n const marginTop = parseFloat(styles.marginTop);\n const marginLeft = parseFloat(styles.marginLeft);\n\n offsets.top -= borderTopWidth - marginTop;\n offsets.bottom -= borderTopWidth - marginTop;\n offsets.left -= borderLeftWidth - marginLeft;\n offsets.right -= borderLeftWidth - marginLeft;\n\n // Attach marginTop and marginLeft because in some circumstances we may need them\n offsets.marginTop = marginTop;\n offsets.marginLeft = marginLeft;\n }\n\n if (\n isIE10 && !fixedPosition\n ? parent.contains(scrollParent)\n : parent === scrollParent && scrollParent.nodeName !== 'BODY'\n ) {\n offsets = includeScroll(offsets, parent);\n }\n\n return offsets;\n}\n","import getScroll from './getScroll';\n\n/*\n * Sum or subtract the element scroll values (left and top) from a given rect object\n * @method\n * @memberof Popper.Utils\n * @param {Object} rect - Rect object you want to change\n * @param {HTMLElement} element - The element from the function reads the scroll values\n * @param {Boolean} subtract - set to true if you want to subtract the scroll values\n * @return {Object} rect - The modifier rect object\n */\nexport default function includeScroll(rect, element, subtract = false) {\n const scrollTop = getScroll(element, 'top');\n const scrollLeft = getScroll(element, 'left');\n const modifier = subtract ? -1 : 1;\n rect.top += scrollTop * modifier;\n rect.bottom += scrollTop * modifier;\n rect.left += scrollLeft * modifier;\n rect.right += scrollLeft * modifier;\n return rect;\n}\n","import getStyleComputedProperty from './getStyleComputedProperty';\nimport getParentNode from './getParentNode';\n\n/**\n * Check if the given element is fixed or is inside a fixed parent\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @argument {Element} customContainer\n * @returns {Boolean} answer to \"isFixed?\"\n */\nexport default function isFixed(element) {\n const nodeName = element.nodeName;\n if (nodeName === 'BODY' || nodeName === 'HTML') {\n return false;\n }\n if (getStyleComputedProperty(element, 'position') === 'fixed') {\n return true;\n }\n const parentNode = getParentNode(element);\n if (!parentNode) {\n return false;\n }\n return isFixed(parentNode);\n}\n","import getStyleComputedProperty from './getStyleComputedProperty';\nimport isIE from './isIE';\n/**\n * Finds the first parent of an element that has a transformed property defined\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} first transformed parent or documentElement\n */\n\nexport default function getFixedPositionOffsetParent(element) {\n // This check is needed to avoid errors in case one of the elements isn't defined for any reason\n if (!element || !element.parentElement || isIE()) {\n return document.documentElement;\n }\n let el = element.parentElement;\n while (el && getStyleComputedProperty(el, 'transform') === 'none') {\n el = el.parentElement;\n }\n return el || document.documentElement;\n\n}\n","import getScrollParent from './getScrollParent';\nimport getParentNode from './getParentNode';\nimport getReferenceNode from './getReferenceNode';\nimport findCommonOffsetParent from './findCommonOffsetParent';\nimport getOffsetRectRelativeToArbitraryNode from './getOffsetRectRelativeToArbitraryNode';\nimport getViewportOffsetRectRelativeToArtbitraryNode from './getViewportOffsetRectRelativeToArtbitraryNode';\nimport getWindowSizes from './getWindowSizes';\nimport isFixed from './isFixed';\nimport getFixedPositionOffsetParent from './getFixedPositionOffsetParent';\n\n/**\n * Computed the boundaries limits and return them\n * @method\n * @memberof Popper.Utils\n * @param {HTMLElement} popper\n * @param {HTMLElement} reference\n * @param {number} padding\n * @param {HTMLElement} boundariesElement - Element used to define the boundaries\n * @param {Boolean} fixedPosition - Is in fixed position mode\n * @returns {Object} Coordinates of the boundaries\n */\nexport default function getBoundaries(\n popper,\n reference,\n padding,\n boundariesElement,\n fixedPosition = false\n) {\n // NOTE: 1 DOM access here\n\n let boundaries = { top: 0, left: 0 };\n const offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));\n\n // Handle viewport case\n if (boundariesElement === 'viewport' ) {\n boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);\n }\n\n else {\n // Handle other cases based on DOM element used as boundaries\n let boundariesNode;\n if (boundariesElement === 'scrollParent') {\n boundariesNode = getScrollParent(getParentNode(reference));\n if (boundariesNode.nodeName === 'BODY') {\n boundariesNode = popper.ownerDocument.documentElement;\n }\n } else if (boundariesElement === 'window') {\n boundariesNode = popper.ownerDocument.documentElement;\n } else {\n boundariesNode = boundariesElement;\n }\n\n const offsets = getOffsetRectRelativeToArbitraryNode(\n boundariesNode,\n offsetParent,\n fixedPosition\n );\n\n // In case of HTML, we need a different computation\n if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {\n const { height, width } = getWindowSizes(popper.ownerDocument);\n boundaries.top += offsets.top - offsets.marginTop;\n boundaries.bottom = height + offsets.top;\n boundaries.left += offsets.left - offsets.marginLeft;\n boundaries.right = width + offsets.left;\n } else {\n // for all the other DOM elements, this one is good\n boundaries = offsets;\n }\n }\n\n // Add paddings\n padding = padding || 0;\n const isPaddingNumber = typeof padding === 'number';\n boundaries.left += isPaddingNumber ? padding : padding.left || 0; \n boundaries.top += isPaddingNumber ? padding : padding.top || 0; \n boundaries.right -= isPaddingNumber ? padding : padding.right || 0; \n boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0; \n\n return boundaries;\n}\n","import getOffsetRectRelativeToArbitraryNode from './getOffsetRectRelativeToArbitraryNode';\nimport getScroll from './getScroll';\nimport getClientRect from './getClientRect';\n\nexport default function getViewportOffsetRectRelativeToArtbitraryNode(element, excludeScroll = false) {\n const html = element.ownerDocument.documentElement;\n const relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);\n const width = Math.max(html.clientWidth, window.innerWidth || 0);\n const height = Math.max(html.clientHeight, window.innerHeight || 0);\n\n const scrollTop = !excludeScroll ? getScroll(html) : 0;\n const scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;\n\n const offset = {\n top: scrollTop - relativeOffset.top + relativeOffset.marginTop,\n left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,\n width,\n height,\n };\n\n return getClientRect(offset);\n}\n","import getBoundaries from '../utils/getBoundaries';\n\nfunction getArea({ width, height }) {\n return width * height;\n}\n\n/**\n * Utility used to transform the `auto` placement to the placement with more\n * available space.\n * @method\n * @memberof Popper.Utils\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function computeAutoPlacement(\n placement,\n refRect,\n popper,\n reference,\n boundariesElement,\n padding = 0\n) {\n if (placement.indexOf('auto') === -1) {\n return placement;\n }\n\n const boundaries = getBoundaries(\n popper,\n reference,\n padding,\n boundariesElement\n );\n\n const rects = {\n top: {\n width: boundaries.width,\n height: refRect.top - boundaries.top,\n },\n right: {\n width: boundaries.right - refRect.right,\n height: boundaries.height,\n },\n bottom: {\n width: boundaries.width,\n height: boundaries.bottom - refRect.bottom,\n },\n left: {\n width: refRect.left - boundaries.left,\n height: boundaries.height,\n },\n };\n\n const sortedAreas = Object.keys(rects)\n .map(key => ({\n key,\n ...rects[key],\n area: getArea(rects[key]),\n }))\n .sort((a, b) => b.area - a.area);\n\n const filteredAreas = sortedAreas.filter(\n ({ width, height }) =>\n width >= popper.clientWidth && height >= popper.clientHeight\n );\n\n const computedPlacement = filteredAreas.length > 0\n ? filteredAreas[0].key\n : sortedAreas[0].key;\n\n const variation = placement.split('-')[1];\n\n return computedPlacement + (variation ? `-${variation}` : '');\n}\n","import findCommonOffsetParent from './findCommonOffsetParent';\nimport getOffsetRectRelativeToArbitraryNode from './getOffsetRectRelativeToArbitraryNode';\nimport getFixedPositionOffsetParent from './getFixedPositionOffsetParent';\nimport getReferenceNode from './getReferenceNode';\n\n/**\n * Get offsets to the reference element\n * @method\n * @memberof Popper.Utils\n * @param {Object} state\n * @param {Element} popper - the popper element\n * @param {Element} reference - the reference element (the popper will be relative to this)\n * @param {Element} fixedPosition - is in fixed position mode\n * @returns {Object} An object containing the offsets which will be applied to the popper\n */\nexport default function getReferenceOffsets(state, popper, reference, fixedPosition = null) {\n const commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));\n return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);\n}\n","/**\n * Get the outer sizes of the given element (offset size + margins)\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Object} object containing width and height properties\n */\nexport default function getOuterSizes(element) {\n const window = element.ownerDocument.defaultView;\n const styles = window.getComputedStyle(element);\n const x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0);\n const y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0);\n const result = {\n width: element.offsetWidth + y,\n height: element.offsetHeight + x,\n };\n return result;\n}\n","/**\n * Get the opposite placement of the given one\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement\n * @returns {String} flipped placement\n */\nexport default function getOppositePlacement(placement) {\n const hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };\n return placement.replace(/left|right|bottom|top/g, matched => hash[matched]);\n}\n","import getOuterSizes from './getOuterSizes';\nimport getOppositePlacement from './getOppositePlacement';\n\n/**\n * Get offsets to the popper\n * @method\n * @memberof Popper.Utils\n * @param {Object} position - CSS position the Popper will get applied\n * @param {HTMLElement} popper - the popper element\n * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)\n * @param {String} placement - one of the valid placement options\n * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper\n */\nexport default function getPopperOffsets(popper, referenceOffsets, placement) {\n placement = placement.split('-')[0];\n\n // Get popper node sizes\n const popperRect = getOuterSizes(popper);\n\n // Add position, width and height to our offsets object\n const popperOffsets = {\n width: popperRect.width,\n height: popperRect.height,\n };\n\n // depending by the popper placement we have to compute its offsets slightly differently\n const isHoriz = ['right', 'left'].indexOf(placement) !== -1;\n const mainSide = isHoriz ? 'top' : 'left';\n const secondarySide = isHoriz ? 'left' : 'top';\n const measurement = isHoriz ? 'height' : 'width';\n const secondaryMeasurement = !isHoriz ? 'height' : 'width';\n\n popperOffsets[mainSide] =\n referenceOffsets[mainSide] +\n referenceOffsets[measurement] / 2 -\n popperRect[measurement] / 2;\n if (placement === secondarySide) {\n popperOffsets[secondarySide] =\n referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];\n } else {\n popperOffsets[secondarySide] =\n referenceOffsets[getOppositePlacement(secondarySide)];\n }\n\n return popperOffsets;\n}\n","/**\n * Mimics the `find` method of Array\n * @method\n * @memberof Popper.Utils\n * @argument {Array} arr\n * @argument prop\n * @argument value\n * @returns index or -1\n */\nexport default function find(arr, check) {\n // use native find if supported\n if (Array.prototype.find) {\n return arr.find(check);\n }\n\n // use `filter` to obtain the same behavior of `find`\n return arr.filter(check)[0];\n}\n","import isFunction from './isFunction';\nimport findIndex from './findIndex';\nimport getClientRect from '../utils/getClientRect';\n\n/**\n * Loop trough the list of modifiers and run them in order,\n * each of them will then edit the data object.\n * @method\n * @memberof Popper.Utils\n * @param {dataObject} data\n * @param {Array} modifiers\n * @param {String} ends - Optional modifier name used as stopper\n * @returns {dataObject}\n */\nexport default function runModifiers(modifiers, data, ends) {\n const modifiersToRun = ends === undefined\n ? modifiers\n : modifiers.slice(0, findIndex(modifiers, 'name', ends));\n\n modifiersToRun.forEach(modifier => {\n if (modifier['function']) { // eslint-disable-line dot-notation\n console.warn('`modifier.function` is deprecated, use `modifier.fn`!');\n }\n const fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation\n if (modifier.enabled && isFunction(fn)) {\n // Add properties to offsets to make them a complete clientRect object\n // we do this before each modifier to make sure the previous one doesn't\n // mess with these values\n data.offsets.popper = getClientRect(data.offsets.popper);\n data.offsets.reference = getClientRect(data.offsets.reference);\n\n data = fn(data, modifier);\n }\n });\n\n return data;\n}\n","import find from './find';\n\n/**\n * Return the index of the matching object\n * @method\n * @memberof Popper.Utils\n * @argument {Array} arr\n * @argument prop\n * @argument value\n * @returns index or -1\n */\nexport default function findIndex(arr, prop, value) {\n // use native findIndex if supported\n if (Array.prototype.findIndex) {\n return arr.findIndex(cur => cur[prop] === value);\n }\n\n // use `find` + `indexOf` if `findIndex` isn't supported\n const match = find(arr, obj => obj[prop] === value);\n return arr.indexOf(match);\n}\n","import computeAutoPlacement from '../utils/computeAutoPlacement';\nimport getReferenceOffsets from '../utils/getReferenceOffsets';\nimport getPopperOffsets from '../utils/getPopperOffsets';\nimport runModifiers from '../utils/runModifiers';\n\n/**\n * Updates the position of the popper, computing the new offsets and applying\n * the new style.<br />\n * Prefer `scheduleUpdate` over `update` because of performance reasons.\n * @method\n * @memberof Popper\n */\nexport default function update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n let data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {},\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(\n this.state,\n this.popper,\n this.reference,\n this.options.positionFixed\n );\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(\n this.options.placement,\n data.offsets.reference,\n this.popper,\n this.reference,\n this.options.modifiers.flip.boundariesElement,\n this.options.modifiers.flip.padding\n );\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(\n this.popper,\n data.offsets.reference,\n data.placement\n );\n\n data.offsets.popper.position = this.options.positionFixed\n ? 'fixed'\n : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}\n","/**\n * Helper used to know if the given modifier is enabled.\n * @method\n * @memberof Popper.Utils\n * @returns {Boolean}\n */\nexport default function isModifierEnabled(modifiers, modifierName) {\n return modifiers.some(\n ({ name, enabled }) => enabled && name === modifierName\n );\n}\n","/**\n * Get the prefixed supported property name\n * @method\n * @memberof Popper.Utils\n * @argument {String} property (camelCase)\n * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)\n */\nexport default function getSupportedPropertyName(property) {\n const prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];\n const upperProp = property.charAt(0).toUpperCase() + property.slice(1);\n\n for (let i = 0; i < prefixes.length; i++) {\n const prefix = prefixes[i];\n const toCheck = prefix ? `${prefix}${upperProp}` : property;\n if (typeof document.body.style[toCheck] !== 'undefined') {\n return toCheck;\n }\n }\n return null;\n}\n","import isModifierEnabled from '../utils/isModifierEnabled';\nimport getSupportedPropertyName from '../utils/getSupportedPropertyName';\n\n/**\n * Destroys the popper.\n * @method\n * @memberof Popper\n */\nexport default function destroy() {\n this.state.isDestroyed = true;\n\n // touch DOM only if `applyStyle` modifier is enabled\n if (isModifierEnabled(this.modifiers, 'applyStyle')) {\n this.popper.removeAttribute('x-placement');\n this.popper.style.position = '';\n this.popper.style.top = '';\n this.popper.style.left = '';\n this.popper.style.right = '';\n this.popper.style.bottom = '';\n this.popper.style.willChange = '';\n this.popper.style[getSupportedPropertyName('transform')] = '';\n }\n\n this.disableEventListeners();\n\n // remove the popper if user explicitly asked for the deletion on destroy\n // do not use `remove` because IE11 doesn't support it\n if (this.options.removeOnDestroy) {\n this.popper.parentNode.removeChild(this.popper);\n }\n return this;\n}\n","/**\n * Get the window associated with the element\n * @argument {Element} element\n * @returns {Window}\n */\nexport default function getWindow(element) {\n const ownerDocument = element.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView : window;\n}\n","import getScrollParent from './getScrollParent';\nimport getWindow from './getWindow';\n\nfunction attachToScrollParents(scrollParent, event, callback, scrollParents) {\n const isBody = scrollParent.nodeName === 'BODY';\n const target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;\n target.addEventListener(event, callback, { passive: true });\n\n if (!isBody) {\n attachToScrollParents(\n getScrollParent(target.parentNode),\n event,\n callback,\n scrollParents\n );\n }\n scrollParents.push(target);\n}\n\n/**\n * Setup needed event listeners used to update the popper position\n * @method\n * @memberof Popper.Utils\n * @private\n */\nexport default function setupEventListeners(\n reference,\n options,\n state,\n updateBound\n) {\n // Resize event listener on window\n state.updateBound = updateBound;\n getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });\n\n // Scroll event listener on scroll parents\n const scrollElement = getScrollParent(reference);\n attachToScrollParents(\n scrollElement,\n 'scroll',\n state.updateBound,\n state.scrollParents\n );\n state.scrollElement = scrollElement;\n state.eventsEnabled = true;\n\n return state;\n}\n","import setupEventListeners from '../utils/setupEventListeners';\n\n/**\n * It will add resize/scroll events and start recalculating\n * position of the popper element when they are triggered.\n * @method\n * @memberof Popper\n */\nexport default function enableEventListeners() {\n if (!this.state.eventsEnabled) {\n this.state = setupEventListeners(\n this.reference,\n this.options,\n this.state,\n this.scheduleUpdate\n );\n }\n}\n","import removeEventListeners from '../utils/removeEventListeners';\n\n/**\n * It will remove resize/scroll events and won't recalculate popper position\n * when they are triggered. It also won't trigger `onUpdate` callback anymore,\n * unless you call `update` method manually.\n * @method\n * @memberof Popper\n */\nexport default function disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n}\n","import getWindow from './getWindow';\n\n/**\n * Remove event listeners used to update the popper position\n * @method\n * @memberof Popper.Utils\n * @private\n */\nexport default function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(target => {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}\n","/**\n * Tells if a given input is a number\n * @method\n * @memberof Popper.Utils\n * @param {*} input to check\n * @return {Boolean}\n */\nexport default function isNumeric(n) {\n return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);\n}\n","import isNumeric from './isNumeric';\n\n/**\n * Set the style to the given popper\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element - Element to apply the style to\n * @argument {Object} styles\n * Object with a list of properties and values which will be applied to the element\n */\nexport default function setStyles(element, styles) {\n Object.keys(styles).forEach(prop => {\n let unit = '';\n // add unit if the value is numeric and is one of the following\n if (\n ['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !==\n -1 &&\n isNumeric(styles[prop])\n ) {\n unit = 'px';\n }\n element.style[prop] = styles[prop] + unit;\n });\n}\n","import getSupportedPropertyName from '../utils/getSupportedPropertyName';\nimport find from '../utils/find';\nimport getOffsetParent from '../utils/getOffsetParent';\nimport getBoundingClientRect from '../utils/getBoundingClientRect';\nimport getRoundedOffsets from '../utils/getRoundedOffsets';\nimport isBrowser from '../utils/isBrowser';\n\nconst isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent);\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function computeStyle(data, options) {\n const { x, y } = options;\n const { popper } = data.offsets;\n\n // Remove this legacy support in Popper.js v2\n const legacyGpuAccelerationOption = find(\n data.instance.modifiers,\n modifier => modifier.name === 'applyStyle'\n ).gpuAcceleration;\n if (legacyGpuAccelerationOption !== undefined) {\n console.warn(\n 'WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!'\n );\n }\n const gpuAcceleration =\n legacyGpuAccelerationOption !== undefined\n ? legacyGpuAccelerationOption\n : options.gpuAcceleration;\n\n const offsetParent = getOffsetParent(data.instance.popper);\n const offsetParentRect = getBoundingClientRect(offsetParent);\n\n // Styles\n const styles = {\n position: popper.position,\n };\n\n const offsets = getRoundedOffsets(\n data,\n window.devicePixelRatio < 2 || !isFirefox\n );\n\n const sideA = x === 'bottom' ? 'top' : 'bottom';\n const sideB = y === 'right' ? 'left' : 'right';\n\n // if gpuAcceleration is set to `true` and transform is supported,\n // we use `translate3d` to apply the position to the popper we\n // automatically use the supported prefixed version if needed\n const prefixedProperty = getSupportedPropertyName('transform');\n\n // now, let's make a step back and look at this code closely (wtf?)\n // If the content of the popper grows once it's been positioned, it\n // may happen that the popper gets misplaced because of the new content\n // overflowing its reference element\n // To avoid this problem, we provide two options (x and y), which allow\n // the consumer to define the offset origin.\n // If we position a popper on top of a reference element, we can set\n // `x` to `top` to make the popper grow towards its top instead of\n // its bottom.\n let left, top;\n if (sideA === 'bottom') {\n // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar)\n // and not the bottom of the html element\n if (offsetParent.nodeName === 'HTML') {\n top = -offsetParent.clientHeight + offsets.bottom;\n } else {\n top = -offsetParentRect.height + offsets.bottom;\n }\n } else {\n top = offsets.top;\n }\n if (sideB === 'right') {\n if (offsetParent.nodeName === 'HTML') {\n left = -offsetParent.clientWidth + offsets.right;\n } else {\n left = -offsetParentRect.width + offsets.right;\n }\n } else {\n left = offsets.left;\n }\n if (gpuAcceleration && prefixedProperty) {\n styles[prefixedProperty] = `translate3d(${left}px, ${top}px, 0)`;\n styles[sideA] = 0;\n styles[sideB] = 0;\n styles.willChange = 'transform';\n } else {\n // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties\n const invertTop = sideA === 'bottom' ? -1 : 1;\n const invertLeft = sideB === 'right' ? -1 : 1;\n styles[sideA] = top * invertTop;\n styles[sideB] = left * invertLeft;\n styles.willChange = `${sideA}, ${sideB}`;\n }\n\n // Attributes\n const attributes = {\n 'x-placement': data.placement,\n };\n\n // Update `data` attributes, styles and arrowStyles\n data.attributes = { ...attributes, ...data.attributes };\n data.styles = { ...styles, ...data.styles };\n data.arrowStyles = { ...data.offsets.arrow, ...data.arrowStyles };\n\n return data;\n}\n","import find from './find';\n\n/**\n * Helper used to know if the given modifier depends from another one.<br />\n * It checks if the needed modifier is listed and enabled.\n * @method\n * @memberof Popper.Utils\n * @param {Array} modifiers - list of modifiers\n * @param {String} requestingName - name of requesting modifier\n * @param {String} requestedName - name of requested modifier\n * @returns {Boolean}\n */\nexport default function isModifierRequired(\n modifiers,\n requestingName,\n requestedName\n) {\n const requesting = find(modifiers, ({ name }) => name === requestingName);\n\n const isRequired =\n !!requesting &&\n modifiers.some(modifier => {\n return (\n modifier.name === requestedName &&\n modifier.enabled &&\n modifier.order < requesting.order\n );\n });\n\n if (!isRequired) {\n const requesting = `\\`${requestingName}\\``;\n const requested = `\\`${requestedName}\\``;\n console.warn(\n `${requested} modifier is required by ${requesting} modifier in order to work, be sure to include it before ${requesting}!`\n );\n }\n return isRequired;\n}\n","/**\n * List of accepted placements to use as values of the `placement` option.<br />\n * Valid placements are:\n * - `auto`\n * - `top`\n * - `right`\n * - `bottom`\n * - `left`\n *\n * Each placement can have a variation from this list:\n * - `-start`\n * - `-end`\n *\n * Variations are interpreted easily if you think of them as the left to right\n * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`\n * is right.<br />\n * Vertically (`left` and `right`), `start` is top and `end` is bottom.\n *\n * Some valid examples are:\n * - `top-end` (on top of reference, right aligned)\n * - `right-start` (on right of reference, top aligned)\n * - `bottom` (on bottom, centered)\n * - `auto-end` (on the side with more space available, alignment depends by placement)\n *\n * @static\n * @type {Array}\n * @enum {String}\n * @readonly\n * @method placements\n * @memberof Popper\n */\nexport default [\n 'auto-start',\n 'auto',\n 'auto-end',\n 'top-start',\n 'top',\n 'top-end',\n 'right-start',\n 'right',\n 'right-end',\n 'bottom-end',\n 'bottom',\n 'bottom-start',\n 'left-end',\n 'left',\n 'left-start',\n];\n","import placements from '../methods/placements';\n\n// Get rid of `auto` `auto-start` and `auto-end`\nconst validPlacements = placements.slice(3);\n\n/**\n * Given an initial placement, returns all the subsequent placements\n * clockwise (or counter-clockwise).\n *\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement - A valid placement (it accepts variations)\n * @argument {Boolean} counter - Set to true to walk the placements counterclockwise\n * @returns {Array} placements including their variations\n */\nexport default function clockwise(placement, counter = false) {\n const index = validPlacements.indexOf(placement);\n const arr = validPlacements\n .slice(index + 1)\n .concat(validPlacements.slice(0, index));\n return counter ? arr.reverse() : arr;\n}\n","import getOppositePlacement from '../utils/getOppositePlacement';\nimport getOppositeVariation from '../utils/getOppositeVariation';\nimport getPopperOffsets from '../utils/getPopperOffsets';\nimport runModifiers from '../utils/runModifiers';\nimport getBoundaries from '../utils/getBoundaries';\nimport isModifierEnabled from '../utils/isModifierEnabled';\nimport clockwise from '../utils/clockwise';\n\nconst BEHAVIORS = {\n FLIP: 'flip',\n CLOCKWISE: 'clockwise',\n COUNTERCLOCKWISE: 'counterclockwise',\n};\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function flip(data, options) {\n // if `inner` modifier is enabled, we can't use the `flip` modifier\n if (isModifierEnabled(data.instance.modifiers, 'inner')) {\n return data;\n }\n\n if (data.flipped && data.placement === data.originalPlacement) {\n // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides\n return data;\n }\n\n const boundaries = getBoundaries(\n data.instance.popper,\n data.instance.reference,\n options.padding,\n options.boundariesElement,\n data.positionFixed\n );\n\n let placement = data.placement.split('-')[0];\n let placementOpposite = getOppositePlacement(placement);\n let variation = data.placement.split('-')[1] || '';\n\n let flipOrder = [];\n\n switch (options.behavior) {\n case BEHAVIORS.FLIP:\n flipOrder = [placement, placementOpposite];\n break;\n case BEHAVIORS.CLOCKWISE:\n flipOrder = clockwise(placement);\n break;\n case BEHAVIORS.COUNTERCLOCKWISE:\n flipOrder = clockwise(placement, true);\n break;\n default:\n flipOrder = options.behavior;\n }\n\n flipOrder.forEach((step, index) => {\n if (placement !== step || flipOrder.length === index + 1) {\n return data;\n }\n\n placement = data.placement.split('-')[0];\n placementOpposite = getOppositePlacement(placement);\n\n const popperOffsets = data.offsets.popper;\n const refOffsets = data.offsets.reference;\n\n // using floor because the reference offsets may contain decimals we are not going to consider here\n const floor = Math.floor;\n const overlapsRef =\n (placement === 'left' &&\n floor(popperOffsets.right) > floor(refOffsets.left)) ||\n (placement === 'right' &&\n floor(popperOffsets.left) < floor(refOffsets.right)) ||\n (placement === 'top' &&\n floor(popperOffsets.bottom) > floor(refOffsets.top)) ||\n (placement === 'bottom' &&\n floor(popperOffsets.top) < floor(refOffsets.bottom));\n\n const overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);\n const overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);\n const overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);\n const overflowsBottom =\n floor(popperOffsets.bottom) > floor(boundaries.bottom);\n\n const overflowsBoundaries =\n (placement === 'left' && overflowsLeft) ||\n (placement === 'right' && overflowsRight) ||\n (placement === 'top' && overflowsTop) ||\n (placement === 'bottom' && overflowsBottom);\n\n // flip the variation if required\n const isVertical = ['top', 'bottom'].indexOf(placement) !== -1;\n\n // flips variation if reference element overflows boundaries\n const flippedVariationByRef =\n !!options.flipVariations &&\n ((isVertical && variation === 'start' && overflowsLeft) ||\n (isVertical && variation === 'end' && overflowsRight) ||\n (!isVertical && variation === 'start' && overflowsTop) ||\n (!isVertical && variation === 'end' && overflowsBottom));\n\n // flips variation if popper content overflows boundaries\n const flippedVariationByContent =\n !!options.flipVariationsByContent &&\n ((isVertical && variation === 'start' && overflowsRight) ||\n (isVertical && variation === 'end' && overflowsLeft) ||\n (!isVertical && variation === 'start' && overflowsBottom) ||\n (!isVertical && variation === 'end' && overflowsTop));\n\n const flippedVariation = flippedVariationByRef || flippedVariationByContent;\n\n if (overlapsRef || overflowsBoundaries || flippedVariation) {\n // this boolean to detect any flip loop\n data.flipped = true;\n\n if (overlapsRef || overflowsBoundaries) {\n placement = flipOrder[index + 1];\n }\n\n if (flippedVariation) {\n variation = getOppositeVariation(variation);\n }\n\n data.placement = placement + (variation ? '-' + variation : '');\n\n // this object contains `position`, we want to preserve it along with\n // any additional property we may add in the future\n data.offsets.popper = {\n ...data.offsets.popper,\n ...getPopperOffsets(\n data.instance.popper,\n data.offsets.reference,\n data.placement\n ),\n };\n\n data = runModifiers(data.instance.modifiers, data, 'flip');\n }\n });\n return data;\n}\n","import isNumeric from '../utils/isNumeric';\nimport getClientRect from '../utils/getClientRect';\nimport find from '../utils/find';\n\n/**\n * Converts a string containing value + unit into a px value number\n * @function\n * @memberof {modifiers~offset}\n * @private\n * @argument {String} str - Value + unit string\n * @argument {String} measurement - `height` or `width`\n * @argument {Object} popperOffsets\n * @argument {Object} referenceOffsets\n * @returns {Number|String}\n * Value in pixels, or original string if no values were extracted\n */\nexport function toValue(str, measurement, popperOffsets, referenceOffsets) {\n // separate value from unit\n const split = str.match(/((?:\\-|\\+)?\\d*\\.?\\d*)(.*)/);\n const value = +split[1];\n const unit = split[2];\n\n // If it's not a number it's an operator, I guess\n if (!value) {\n return str;\n }\n\n if (unit.indexOf('%') === 0) {\n let element;\n switch (unit) {\n case '%p':\n element = popperOffsets;\n break;\n case '%':\n case '%r':\n default:\n element = referenceOffsets;\n }\n\n const rect = getClientRect(element);\n return rect[measurement] / 100 * value;\n } else if (unit === 'vh' || unit === 'vw') {\n // if is a vh or vw, we calculate the size based on the viewport\n let size;\n if (unit === 'vh') {\n size = Math.max(\n document.documentElement.clientHeight,\n window.innerHeight || 0\n );\n } else {\n size = Math.max(\n document.documentElement.clientWidth,\n window.innerWidth || 0\n );\n }\n return size / 100 * value;\n } else {\n // if is an explicit pixel unit, we get rid of the unit and keep the value\n // if is an implicit unit, it's px, and we return just the value\n return value;\n }\n}\n\n/**\n * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.\n * @function\n * @memberof {modifiers~offset}\n * @private\n * @argument {String} offset\n * @argument {Object} popperOffsets\n * @argument {Object} referenceOffsets\n * @argument {String} basePlacement\n * @returns {Array} a two cells array with x and y offsets in numbers\n */\nexport function parseOffset(\n offset,\n popperOffsets,\n referenceOffsets,\n basePlacement\n) {\n const offsets = [0, 0];\n\n // Use height if placement is left or right and index is 0 otherwise use width\n // in this way the first offset will use an axis and the second one\n // will use the other one\n const useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;\n\n // Split the offset string to obtain a list of values and operands\n // The regex addresses values with the plus or minus sign in front (+10, -20, etc)\n const fragments = offset.split(/(\\+|\\-)/).map(frag => frag.trim());\n\n // Detect if the offset string contains a pair of values or a single one\n // they could be separated by comma or space\n const divider = fragments.indexOf(\n find(fragments, frag => frag.search(/,|\\s/) !== -1)\n );\n\n if (fragments[divider] && fragments[divider].indexOf(',') === -1) {\n console.warn(\n 'Offsets separated by white space(s) are deprecated, use a comma (,) instead.'\n );\n }\n\n // If divider is found, we divide the list of values and operands to divide\n // them by ofset X and Y.\n const splitRegex = /\\s*,\\s*|\\s+/;\n let ops = divider !== -1\n ? [\n fragments\n .slice(0, divider)\n .concat([fragments[divider].split(splitRegex)[0]]),\n [fragments[divider].split(splitRegex)[1]].concat(\n fragments.slice(divider + 1)\n ),\n ]\n : [fragments];\n\n // Convert the values with units to absolute pixels to allow our computations\n ops = ops.map((op, index) => {\n // Most of the units rely on the orientation of the popper\n const measurement = (index === 1 ? !useHeight : useHeight)\n ? 'height'\n : 'width';\n let mergeWithPrevious = false;\n return (\n op\n // This aggregates any `+` or `-` sign that aren't considered operators\n // e.g.: 10 + +5 => [10, +, +5]\n .reduce((a, b) => {\n if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {\n a[a.length - 1] = b;\n mergeWithPrevious = true;\n return a;\n } else if (mergeWithPrevious) {\n a[a.length - 1] += b;\n mergeWithPrevious = false;\n return a;\n } else {\n return a.concat(b);\n }\n }, [])\n // Here we convert the string values into number values (in px)\n .map(str => toValue(str, measurement, popperOffsets, referenceOffsets))\n );\n });\n\n // Loop trough the offsets arrays and execute the operations\n ops.forEach((op, index) => {\n op.forEach((frag, index2) => {\n if (isNumeric(frag)) {\n offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);\n }\n });\n });\n return offsets;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @argument {Number|String} options.offset=0\n * The offset value as described in the modifier description\n * @returns {Object} The data object, properly modified\n */\nexport default function offset(data, { offset }) {\n const { placement, offsets: { popper, reference } } = data;\n const basePlacement = placement.split('-')[0];\n\n let offsets;\n if (isNumeric(+offset)) {\n offsets = [+offset, 0];\n } else {\n offsets = parseOffset(offset, popper, reference, basePlacement);\n }\n\n if (basePlacement === 'left') {\n popper.top += offsets[0];\n popper.left -= offsets[1];\n } else if (basePlacement === 'right') {\n popper.top += offsets[0];\n popper.left += offsets[1];\n } else if (basePlacement === 'top') {\n popper.left += offsets[0];\n popper.top -= offsets[1];\n } else if (basePlacement === 'bottom') {\n popper.left += offsets[0];\n popper.top += offsets[1];\n }\n\n data.popper = popper;\n return data;\n}\n","import applyStyle, { applyStyleOnLoad } from './applyStyle';\nimport computeStyle from './computeStyle';\nimport arrow from './arrow';\nimport flip from './flip';\nimport keepTogether from './keepTogether';\nimport offset from './offset';\nimport preventOverflow from './preventOverflow';\nimport shift from './shift';\nimport hide from './hide';\nimport inner from './inner';\n\n/**\n * Modifier function, each modifier can have a function of this type assigned\n * to its `fn` property.<br />\n * These functions will be called on each update, this means that you must\n * make sure they are performant enough to avoid performance bottlenecks.\n *\n * @function ModifierFn\n * @argument {dataObject} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {dataObject} The data object, properly modified\n */\n\n/**\n * Modifiers are plugins used to alter the behavior of your poppers.<br />\n * Popper.js uses a set of 9 modifiers to provide all the basic functionalities\n * needed by the library.\n *\n * Usually you don't want to override the `order`, `fn` and `onLoad` props.\n * All the other properties are configurations that could be tweaked.\n * @namespace modifiers\n */\nexport default {\n /**\n * Modifier used to shift the popper on the start or end of its reference\n * element.<br />\n * It will read the variation of the `placement` property.<br />\n * It can be one either `-end` or `-start`.\n * @memberof modifiers\n * @inner\n */\n shift: {\n /** @prop {number} order=100 - Index used to define the order of execution */\n order: 100,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: shift,\n },\n\n /**\n * The `offset` modifier can shift your popper on both its axis.\n *\n * It accepts the following units:\n * - `px` or unit-less, interpreted as pixels\n * - `%` or `%r`, percentage relative to the length of the reference element\n * - `%p`, percentage relative to the length of the popper element\n * - `vw`, CSS viewport width unit\n * - `vh`, CSS viewport height unit\n *\n * For length is intended the main axis relative to the placement of the popper.<br />\n * This means that if the placement is `top` or `bottom`, the length will be the\n * `width`. In case of `left` or `right`, it will be the `height`.\n *\n * You can provide a single value (as `Number` or `String`), or a pair of values\n * as `String` divided by a comma or one (or more) white spaces.<br />\n * The latter is a deprecated method because it leads to confusion and will be\n * removed in v2.<br />\n * Additionally, it accepts additions and subtractions between different units.\n * Note that multiplications and divisions aren't supported.\n *\n * Valid examples are:\n * ```\n * 10\n * '10%'\n * '10, 10'\n * '10%, 10'\n * '10 + 10%'\n * '10 - 5vh + 3%'\n * '-10px + 5vh, 5px - 6%'\n * ```\n * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap\n * > with their reference element, unfortunately, you will have to disable the `flip` modifier.\n * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).\n *\n * @memberof modifiers\n * @inner\n */\n offset: {\n /** @prop {number} order=200 - Index used to define the order of execution */\n order: 200,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: offset,\n /** @prop {Number|String} offset=0\n * The offset value as described in the modifier description\n */\n offset: 0,\n },\n\n /**\n * Modifier used to prevent the popper from being positioned outside the boundary.\n *\n * A scenario exists where the reference itself is not within the boundaries.<br />\n * We can say it has \"escaped the boundaries\" — or just \"escaped\".<br />\n * In this case we need to decide whether the popper should either:\n *\n * - detach from the reference and remain \"trapped\" in the boundaries, or\n * - if it should ignore the boundary and \"escape with its reference\"\n *\n * When `escapeWithReference` is set to`true` and reference is completely\n * outside its boundaries, the popper will overflow (or completely leave)\n * the boundaries in order to remain attached to the edge of the reference.\n *\n * @memberof modifiers\n * @inner\n */\n preventOverflow: {\n /** @prop {number} order=300 - Index used to define the order of execution */\n order: 300,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: preventOverflow,\n /**\n * @prop {Array} [priority=['left','right','top','bottom']]\n * Popper will try to prevent overflow following these priorities by default,\n * then, it could overflow on the left and on top of the `boundariesElement`\n */\n priority: ['left', 'right', 'top', 'bottom'],\n /**\n * @prop {number} padding=5\n * Amount of pixel used to define a minimum distance between the boundaries\n * and the popper. This makes sure the popper always has a little padding\n * between the edges of its container\n */\n padding: 5,\n /**\n * @prop {String|HTMLElement} boundariesElement='scrollParent'\n * Boundaries used by the modifier. Can be `scrollParent`, `window`,\n * `viewport` or any DOM element.\n */\n boundariesElement: 'scrollParent',\n },\n\n /**\n * Modifier used to make sure the reference and its popper stay near each other\n * without leaving any gap between the two. Especially useful when the arrow is\n * enabled and you want to ensure that it points to its reference element.\n * It cares only about the first axis. You can still have poppers with margin\n * between the popper and its reference element.\n * @memberof modifiers\n * @inner\n */\n keepTogether: {\n /** @prop {number} order=400 - Index used to define the order of execution */\n order: 400,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: keepTogether,\n },\n\n /**\n * This modifier is used to move the `arrowElement` of the popper to make\n * sure it is positioned between the reference element and its popper element.\n * It will read the outer size of the `arrowElement` node to detect how many\n * pixels of conjunction are needed.\n *\n * It has no effect if no `arrowElement` is provided.\n * @memberof modifiers\n * @inner\n */\n arrow: {\n /** @prop {number} order=500 - Index used to define the order of execution */\n order: 500,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: arrow,\n /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */\n element: '[x-arrow]',\n },\n\n /**\n * Modifier used to flip the popper's placement when it starts to overlap its\n * reference element.\n *\n * Requires the `preventOverflow` modifier before it in order to work.\n *\n * **NOTE:** this modifier will interrupt the current update cycle and will\n * restart it if it detects the need to flip the placement.\n * @memberof modifiers\n * @inner\n */\n flip: {\n /** @prop {number} order=600 - Index used to define the order of execution */\n order: 600,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: flip,\n /**\n * @prop {String|Array} behavior='flip'\n * The behavior used to change the popper's placement. It can be one of\n * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid\n * placements (with optional variations)\n */\n behavior: 'flip',\n /**\n * @prop {number} padding=5\n * The popper will flip if it hits the edges of the `boundariesElement`\n */\n padding: 5,\n /**\n * @prop {String|HTMLElement} boundariesElement='viewport'\n * The element which will define the boundaries of the popper position.\n * The popper will never be placed outside of the defined boundaries\n * (except if `keepTogether` is enabled)\n */\n boundariesElement: 'viewport',\n /**\n * @prop {Boolean} flipVariations=false\n * The popper will switch placement variation between `-start` and `-end` when\n * the reference element overlaps its boundaries.\n *\n * The original placement should have a set variation.\n */\n flipVariations: false,\n /**\n * @prop {Boolean} flipVariationsByContent=false\n * The popper will switch placement variation between `-start` and `-end` when\n * the popper element overlaps its reference boundaries.\n *\n * The original placement should have a set variation.\n */\n flipVariationsByContent: false,\n },\n\n /**\n * Modifier used to make the popper flow toward the inner of the reference element.\n * By default, when this modifier is disabled, the popper will be placed outside\n * the reference element.\n * @memberof modifiers\n * @inner\n */\n inner: {\n /** @prop {number} order=700 - Index used to define the order of execution */\n order: 700,\n /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */\n enabled: false,\n /** @prop {ModifierFn} */\n fn: inner,\n },\n\n /**\n * Modifier used to hide the popper when its reference element is outside of the\n * popper boundaries. It will set a `x-out-of-boundaries` attribute which can\n * be used to hide with a CSS selector the popper when its reference is\n * out of boundaries.\n *\n * Requires the `preventOverflow` modifier before it in order to work.\n * @memberof modifiers\n * @inner\n */\n hide: {\n /** @prop {number} order=800 - Index used to define the order of execution */\n order: 800,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: hide,\n },\n\n /**\n * Computes the style that will be applied to the popper element to gets\n * properly positioned.\n *\n * Note that this modifier will not touch the DOM, it just prepares the styles\n * so that `applyStyle` modifier can apply it. This separation is useful\n * in case you need to replace `applyStyle` with a custom implementation.\n *\n * This modifier has `850` as `order` value to maintain backward compatibility\n * with previous versions of Popper.js. Expect the modifiers ordering method\n * to change in future major versions of the library.\n *\n * @memberof modifiers\n * @inner\n */\n computeStyle: {\n /** @prop {number} order=850 - Index used to define the order of execution */\n order: 850,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: computeStyle,\n /**\n * @prop {Boolean} gpuAcceleration=true\n * If true, it uses the CSS 3D transformation to position the popper.\n * Otherwise, it will use the `top` and `left` properties\n */\n gpuAcceleration: true,\n /**\n * @prop {string} [x='bottom']\n * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.\n * Change this if your popper should grow in a direction different from `bottom`\n */\n x: 'bottom',\n /**\n * @prop {string} [x='left']\n * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.\n * Change this if your popper should grow in a direction different from `right`\n */\n y: 'right',\n },\n\n /**\n * Applies the computed styles to the popper element.\n *\n * All the DOM manipulations are limited to this modifier. This is useful in case\n * you want to integrate Popper.js inside a framework or view library and you\n * want to delegate all the DOM manipulations to it.\n *\n * Note that if you disable this modifier, you must make sure the popper element\n * has its position set to `absolute` before Popper.js can do its work!\n *\n * Just disable this modifier and define your own to achieve the desired effect.\n *\n * @memberof modifiers\n * @inner\n */\n applyStyle: {\n /** @prop {number} order=900 - Index used to define the order of execution */\n order: 900,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: applyStyle,\n /** @prop {Function} */\n onLoad: applyStyleOnLoad,\n /**\n * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier\n * @prop {Boolean} gpuAcceleration=true\n * If true, it uses the CSS 3D transformation to position the popper.\n * Otherwise, it will use the `top` and `left` properties\n */\n gpuAcceleration: undefined,\n },\n};\n\n/**\n * The `dataObject` is an object containing all the information used by Popper.js.\n * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks.\n * @name dataObject\n * @property {Object} data.instance The Popper.js instance\n * @property {String} data.placement Placement applied to popper\n * @property {String} data.originalPlacement Placement originally defined on init\n * @property {Boolean} data.flipped True if popper has been flipped by flip modifier\n * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper\n * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier\n * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`)\n * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`)\n * @property {Object} data.boundaries Offsets of the popper boundaries\n * @property {Object} data.offsets The measurements of popper, reference and arrow elements\n * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values\n * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values\n * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0\n */\n","/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function shift(data) {\n const placement = data.placement;\n const basePlacement = placement.split('-')[0];\n const shiftvariation = placement.split('-')[1];\n\n // if shift shiftvariation is specified, run the modifier\n if (shiftvariation) {\n const { reference, popper } = data.offsets;\n const isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;\n const side = isVertical ? 'left' : 'top';\n const measurement = isVertical ? 'width' : 'height';\n\n const shiftOffsets = {\n start: { [side]: reference[side] },\n end: {\n [side]: reference[side] + reference[measurement] - popper[measurement],\n },\n };\n\n data.offsets.popper = { ...popper, ...shiftOffsets[shiftvariation] };\n }\n\n return data;\n}\n","import getOffsetParent from '../utils/getOffsetParent';\nimport getBoundaries from '../utils/getBoundaries';\nimport getSupportedPropertyName from '../utils/getSupportedPropertyName';\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function preventOverflow(data, options) {\n let boundariesElement =\n options.boundariesElement || getOffsetParent(data.instance.popper);\n\n // If offsetParent is the reference element, we really want to\n // go one step up and use the next offsetParent as reference to\n // avoid to make this modifier completely useless and look like broken\n if (data.instance.reference === boundariesElement) {\n boundariesElement = getOffsetParent(boundariesElement);\n }\n\n // NOTE: DOM access here\n // resets the popper's position so that the document size can be calculated excluding\n // the size of the popper element itself\n const transformProp = getSupportedPropertyName('transform');\n const popperStyles = data.instance.popper.style; // assignment to help minification\n const { top, left, [transformProp]: transform } = popperStyles;\n popperStyles.top = '';\n popperStyles.left = '';\n popperStyles[transformProp] = '';\n\n const boundaries = getBoundaries(\n data.instance.popper,\n data.instance.reference,\n options.padding,\n boundariesElement,\n data.positionFixed\n );\n\n // NOTE: DOM access here\n // restores the original style properties after the offsets have been computed\n popperStyles.top = top;\n popperStyles.left = left;\n popperStyles[transformProp] = transform;\n\n options.boundaries = boundaries;\n\n const order = options.priority;\n let popper = data.offsets.popper;\n\n const check = {\n primary(placement) {\n let value = popper[placement];\n if (\n popper[placement] < boundaries[placement] &&\n !options.escapeWithReference\n ) {\n value = Math.max(popper[placement], boundaries[placement]);\n }\n return { [placement]: value };\n },\n secondary(placement) {\n const mainSide = placement === 'right' ? 'left' : 'top';\n let value = popper[mainSide];\n if (\n popper[placement] > boundaries[placement] &&\n !options.escapeWithReference\n ) {\n value = Math.min(\n popper[mainSide],\n boundaries[placement] -\n (placement === 'right' ? popper.width : popper.height)\n );\n }\n return { [mainSide]: value };\n },\n };\n\n order.forEach(placement => {\n const side =\n ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';\n popper = { ...popper, ...check[side](placement) };\n });\n\n data.offsets.popper = popper;\n\n return data;\n}\n","/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function keepTogether(data) {\n const { popper, reference } = data.offsets;\n const placement = data.placement.split('-')[0];\n const floor = Math.floor;\n const isVertical = ['top', 'bottom'].indexOf(placement) !== -1;\n const side = isVertical ? 'right' : 'bottom';\n const opSide = isVertical ? 'left' : 'top';\n const measurement = isVertical ? 'width' : 'height';\n\n if (popper[side] < floor(reference[opSide])) {\n data.offsets.popper[opSide] =\n floor(reference[opSide]) - popper[measurement];\n }\n if (popper[opSide] > floor(reference[side])) {\n data.offsets.popper[opSide] = floor(reference[side]);\n }\n\n return data;\n}\n","import getClientRect from '../utils/getClientRect';\nimport getOuterSizes from '../utils/getOuterSizes';\nimport isModifierRequired from '../utils/isModifierRequired';\nimport getStyleComputedProperty from '../utils/getStyleComputedProperty';\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function arrow(data, options) {\n // arrow depends on keepTogether in order to work\n if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {\n return data;\n }\n\n let arrowElement = options.element;\n\n // if arrowElement is a string, suppose it's a CSS selector\n if (typeof arrowElement === 'string') {\n arrowElement = data.instance.popper.querySelector(arrowElement);\n\n // if arrowElement is not found, don't run the modifier\n if (!arrowElement) {\n return data;\n }\n } else {\n // if the arrowElement isn't a query selector we must check that the\n // provided DOM node is child of its popper node\n if (!data.instance.popper.contains(arrowElement)) {\n console.warn(\n 'WARNING: `arrow.element` must be child of its popper element!'\n );\n return data;\n }\n }\n\n const placement = data.placement.split('-')[0];\n const { popper, reference } = data.offsets;\n const isVertical = ['left', 'right'].indexOf(placement) !== -1;\n\n const len = isVertical ? 'height' : 'width';\n const sideCapitalized = isVertical ? 'Top' : 'Left';\n const side = sideCapitalized.toLowerCase();\n const altSide = isVertical ? 'left' : 'top';\n const opSide = isVertical ? 'bottom' : 'right';\n const arrowElementSize = getOuterSizes(arrowElement)[len];\n\n //\n // extends keepTogether behavior making sure the popper and its\n // reference have enough pixels in conjunction\n //\n\n // top/left side\n if (reference[opSide] - arrowElementSize < popper[side]) {\n data.offsets.popper[side] -=\n popper[side] - (reference[opSide] - arrowElementSize);\n }\n // bottom/right side\n if (reference[side] + arrowElementSize > popper[opSide]) {\n data.offsets.popper[side] +=\n reference[side] + arrowElementSize - popper[opSide];\n }\n data.offsets.popper = getClientRect(data.offsets.popper);\n\n // compute center of the popper\n const center = reference[side] + reference[len] / 2 - arrowElementSize / 2;\n\n // Compute the sideValue using the updated popper offsets\n // take popper margin in account because we don't have this info available\n const css = getStyleComputedProperty(data.instance.popper);\n const popperMarginSide = parseFloat(css[`margin${sideCapitalized}`]);\n const popperBorderSide = parseFloat(css[`border${sideCapitalized}Width`]);\n let sideValue =\n center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;\n\n // prevent arrowElement from being placed not contiguously to its popper\n sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);\n\n data.arrowElement = arrowElement;\n data.offsets.arrow = {\n [side]: Math.round(sideValue),\n [altSide]: '', // make sure to unset any eventual altSide value from the DOM node\n };\n\n return data;\n}\n","/**\n * Get the opposite placement variation of the given one\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement variation\n * @returns {String} flipped placement variation\n */\nexport default function getOppositeVariation(variation) {\n if (variation === 'end') {\n return 'start';\n } else if (variation === 'start') {\n return 'end';\n }\n return variation;\n}\n","import getClientRect from '../utils/getClientRect';\nimport getOppositePlacement from '../utils/getOppositePlacement';\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function inner(data) {\n const placement = data.placement;\n const basePlacement = placement.split('-')[0];\n const { popper, reference } = data.offsets;\n const isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;\n\n const subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;\n\n popper[isHoriz ? 'left' : 'top'] =\n reference[basePlacement] -\n (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);\n\n data.placement = getOppositePlacement(placement);\n data.offsets.popper = getClientRect(popper);\n\n return data;\n}\n","import isModifierRequired from '../utils/isModifierRequired';\nimport find from '../utils/find';\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nexport default function hide(data) {\n if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {\n return data;\n }\n\n const refRect = data.offsets.reference;\n const bound = find(\n data.instance.modifiers,\n modifier => modifier.name === 'preventOverflow'\n ).boundaries;\n\n if (\n refRect.bottom < bound.top ||\n refRect.left > bound.right ||\n refRect.top > bound.bottom ||\n refRect.right < bound.left\n ) {\n // Avoid unnecessary DOM access if visibility hasn't changed\n if (data.hide === true) {\n return data;\n }\n\n data.hide = true;\n data.attributes['x-out-of-boundaries'] = '';\n } else {\n // Avoid unnecessary DOM access if visibility hasn't changed\n if (data.hide === false) {\n return data;\n }\n\n data.hide = false;\n data.attributes['x-out-of-boundaries'] = false;\n }\n\n return data;\n}\n","/**\n * @function\n * @memberof Popper.Utils\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Boolean} shouldRound - If the offsets should be rounded at all\n * @returns {Object} The popper's position offsets rounded\n *\n * The tale of pixel-perfect positioning. It's still not 100% perfect, but as\n * good as it can be within reason.\n * Discussion here: https://github.com/FezVrasta/popper.js/pull/715\n *\n * Low DPI screens cause a popper to be blurry if not using full pixels (Safari\n * as well on High DPI screens).\n *\n * Firefox prefers no rounding for positioning and does not have blurriness on\n * high DPI screens.\n *\n * Only horizontal placement and left/right values need to be considered.\n */\nexport default function getRoundedOffsets(data, shouldRound) {\n const { popper, reference } = data.offsets;\n const { round, floor } = Math;\n const noRound = v => v;\n \n const referenceWidth = round(reference.width);\n const popperWidth = round(popper.width);\n \n const isVertical = ['left', 'right'].indexOf(data.placement) !== -1;\n const isVariation = data.placement.indexOf('-') !== -1;\n const sameWidthParity = referenceWidth % 2 === popperWidth % 2;\n const bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1;\n\n const horizontalToInteger = !shouldRound\n ? noRound\n : isVertical || isVariation || sameWidthParity\n ? round\n : floor;\n const verticalToInteger = !shouldRound ? noRound : round;\n\n return {\n left: horizontalToInteger(\n bothOddWidth && !isVariation && shouldRound\n ? popper.left - 1\n : popper.left\n ),\n top: verticalToInteger(popper.top),\n bottom: verticalToInteger(popper.bottom),\n right: horizontalToInteger(popper.right),\n };\n}\n","import setStyles from '../utils/setStyles';\nimport setAttributes from '../utils/setAttributes';\nimport getReferenceOffsets from '../utils/getReferenceOffsets';\nimport computeAutoPlacement from '../utils/computeAutoPlacement';\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} data.styles - List of style properties - values to apply to popper element\n * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The same data object\n */\nexport default function applyStyle(data) {\n // any property present in `data.styles` will be applied to the popper,\n // in this way we can make the 3rd party modifiers add custom styles to it\n // Be aware, modifiers could override the properties defined in the previous\n // lines of this modifier!\n setStyles(data.instance.popper, data.styles);\n\n // any property present in `data.attributes` will be applied to the popper,\n // they will be set as HTML attributes of the element\n setAttributes(data.instance.popper, data.attributes);\n\n // if arrowElement is defined and arrowStyles has some properties\n if (data.arrowElement && Object.keys(data.arrowStyles).length) {\n setStyles(data.arrowElement, data.arrowStyles);\n }\n\n return data;\n}\n\n/**\n * Set the x-placement attribute before everything else because it could be used\n * to add margins to the popper margins needs to be calculated to get the\n * correct popper offsets.\n * @method\n * @memberof Popper.modifiers\n * @param {HTMLElement} reference - The reference element used to position the popper\n * @param {HTMLElement} popper - The HTML element used as popper\n * @param {Object} options - Popper.js options\n */\nexport function applyStyleOnLoad(\n reference,\n popper,\n options,\n modifierOptions,\n state\n) {\n // compute reference element offsets\n const referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n const placement = computeAutoPlacement(\n options.placement,\n referenceOffsets,\n popper,\n reference,\n options.modifiers.flip.boundariesElement,\n options.modifiers.flip.padding\n );\n\n popper.setAttribute('x-placement', placement);\n\n // Apply `position` to popper before anything else because\n // without the position applied we can't guarantee correct computations\n setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });\n\n return options;\n}\n","/**\n * Set the attributes to the given popper\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element - Element to apply the attributes to\n * @argument {Object} styles\n * Object with a list of properties and values which will be applied to the element\n */\nexport default function setAttributes(element, attributes) {\n Object.keys(attributes).forEach(function(prop) {\n const value = attributes[prop];\n if (value !== false) {\n element.setAttribute(prop, attributes[prop]);\n } else {\n element.removeAttribute(prop);\n }\n });\n}\n","import modifiers from '../modifiers/index';\n\n/**\n * Default options provided to Popper.js constructor.<br />\n * These can be overridden using the `options` argument of Popper.js.<br />\n * To override an option, simply pass an object with the same\n * structure of the `options` object, as the 3rd argument. For example:\n * ```\n * new Popper(ref, pop, {\n * modifiers: {\n * preventOverflow: { enabled: false }\n * }\n * })\n * ```\n * @type {Object}\n * @static\n * @memberof Popper\n */\nexport default {\n /**\n * Popper's placement.\n * @prop {Popper.placements} placement='bottom'\n */\n placement: 'bottom',\n\n /**\n * Set this to true if you want popper to position it self in 'fixed' mode\n * @prop {Boolean} positionFixed=false\n */\n positionFixed: false,\n\n /**\n * Whether events (resize, scroll) are initially enabled.\n * @prop {Boolean} eventsEnabled=true\n */\n eventsEnabled: true,\n\n /**\n * Set to true if you want to automatically remove the popper when\n * you call the `destroy` method.\n * @prop {Boolean} removeOnDestroy=false\n */\n removeOnDestroy: false,\n\n /**\n * Callback called when the popper is created.<br />\n * By default, it is set to no-op.<br />\n * Access Popper.js instance with `data.instance`.\n * @prop {onCreate}\n */\n onCreate: () => {},\n\n /**\n * Callback called when the popper is updated. This callback is not called\n * on the initialization/creation of the popper, but only on subsequent\n * updates.<br />\n * By default, it is set to no-op.<br />\n * Access Popper.js instance with `data.instance`.\n * @prop {onUpdate}\n */\n onUpdate: () => {},\n\n /**\n * List of modifiers used to modify the offsets before they are applied to the popper.\n * They provide most of the functionalities of Popper.js.\n * @prop {modifiers}\n */\n modifiers,\n};\n\n/**\n * @callback onCreate\n * @param {dataObject} data\n */\n\n/**\n * @callback onUpdate\n * @param {dataObject} data\n */\n","// Utils\nimport debounce from './utils/debounce';\nimport isFunction from './utils/isFunction';\n\n// Methods\nimport update from './methods/update';\nimport destroy from './methods/destroy';\nimport enableEventListeners from './methods/enableEventListeners';\nimport disableEventListeners from './methods/disableEventListeners';\nimport Defaults from './methods/defaults';\nimport placements from './methods/placements';\n\nexport default class Popper {\n /**\n * Creates a new Popper.js instance.\n * @class Popper\n * @param {Element|referenceObject} reference - The reference element used to position the popper\n * @param {Element} popper - The HTML / XML element used as the popper\n * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)\n * @return {Object} instance - The generated Popper.js instance\n */\n constructor(reference, popper, options = {}) {\n // make update() debounced, so that it only runs at most once-per-tick\n this.update = debounce(this.update.bind(this));\n\n // with {} we create a new object with the options inside it\n this.options = { ...Popper.Defaults, ...options };\n\n // init state\n this.state = {\n isDestroyed: false,\n isCreated: false,\n scrollParents: [],\n };\n\n // get reference and popper elements (allow jQuery wrappers)\n this.reference = reference && reference.jquery ? reference[0] : reference;\n this.popper = popper && popper.jquery ? popper[0] : popper;\n\n // Deep merge modifiers options\n this.options.modifiers = {};\n Object.keys({\n ...Popper.Defaults.modifiers,\n ...options.modifiers,\n }).forEach(name => {\n this.options.modifiers[name] = {\n // If it's a built-in modifier, use it as base\n ...(Popper.Defaults.modifiers[name] || {}),\n // If there are custom options, override and merge with default ones\n ...(options.modifiers ? options.modifiers[name] : {}),\n };\n });\n\n // Refactoring modifiers' list (Object => Array)\n this.modifiers = Object.keys(this.options.modifiers)\n .map(name => ({\n name,\n ...this.options.modifiers[name],\n }))\n // sort the modifiers by order\n .sort((a, b) => a.order - b.order);\n\n // modifiers have the ability to execute arbitrary code when Popper.js get inited\n // such code is executed in the same order of its modifier\n // they could add new properties to their options configuration\n // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!\n this.modifiers.forEach(modifierOptions => {\n if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {\n modifierOptions.onLoad(\n this.reference,\n this.popper,\n this.options,\n modifierOptions,\n this.state\n );\n }\n });\n\n // fire the first update to position the popper in the right place\n this.update();\n\n const eventsEnabled = this.options.eventsEnabled;\n if (eventsEnabled) {\n // setup event listeners, they will take care of update the position in specific situations\n this.enableEventListeners();\n }\n\n this.state.eventsEnabled = eventsEnabled;\n }\n\n // We can't use class properties because they don't get listed in the\n // class prototype and break stuff like Sinon stubs\n update() {\n return update.call(this);\n }\n destroy() {\n return destroy.call(this);\n }\n enableEventListeners() {\n return enableEventListeners.call(this);\n }\n disableEventListeners() {\n return disableEventListeners.call(this);\n }\n\n /**\n * Schedules an update. It will run on the next UI update available.\n * @method scheduleUpdate\n * @memberof Popper\n */\n scheduleUpdate = () => requestAnimationFrame(this.update);\n\n /**\n * Collection of utilities useful when writing custom modifiers.\n * Starting from version 1.7, this method is available only if you\n * include `popper-utils.js` before `popper.js`.\n *\n * **DEPRECATION**: This way to access PopperUtils is deprecated\n * and will be removed in v2! Use the PopperUtils module directly instead.\n * Due to the high instability of the methods contained in Utils, we can't\n * guarantee them to follow semver. Use them at your own risk!\n * @static\n * @private\n * @type {Object}\n * @deprecated since version 1.8\n * @member Utils\n * @memberof Popper\n */\n static Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;\n\n static placements = placements;\n\n static Defaults = Defaults;\n}\n\n/**\n * The `referenceObject` is an object that provides an interface compatible with Popper.js\n * and lets you use it as replacement of a real DOM node.<br />\n * You can use this method to position a popper relatively to a set of coordinates\n * in case you don't have a DOM node to use as reference.\n *\n * ```\n * new Popper(referenceObject, popperNode);\n * ```\n *\n * NB: This feature isn't supported in Internet Explorer 10.\n * @name referenceObject\n * @property {Function} data.getBoundingClientRect\n * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.\n * @property {number} data.clientWidth\n * An ES6 getter that will return the width of the virtual reference element.\n * @property {number} data.clientHeight\n * An ES6 getter that will return the height of the virtual reference element.\n */\n","import { AnyObject, Primitive } from './types';\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction isOfType<T extends Primitive | Function>(type: string) {\n return (value: unknown): value is T => typeof value === type;\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport const isFunction = isOfType<Function>('function');\n\nexport const isNull = (value: unknown): value is null => {\n return value === null;\n};\n\nexport const isRegex = (value: unknown): value is RegExp => {\n return Object.prototype.toString.call(value).slice(8, -1) === 'RegExp';\n};\n\nexport const isObject = (value: unknown): value is AnyObject => {\n return !isUndefined(value) && !isNull(value) && (isFunction(value) || typeof value === 'object');\n};\n\nexport const isUndefined = isOfType<undefined>('undefined');\n","import { isObject, isRegex } from './helpers';\n\nfunction equalArray(left: unknown[], right: unknown[]) {\n const { length } = left;\n\n if (length !== right.length) {\n return false;\n }\n\n for (let index = length; index-- !== 0; ) {\n if (!equal(left[index], right[index])) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction equalArrayBuffer(left: ArrayBufferView, right: ArrayBufferView) {\n if (left.byteLength !== right.byteLength) {\n return false;\n }\n\n const view1 = new DataView(left.buffer);\n const view2 = new DataView(right.buffer);\n\n let index = left.byteLength;\n\n while (index--) {\n if (view1.getUint8(index) !== view2.getUint8(index)) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction equalMap(left: Map<unknown, unknown>, right: Map<unknown, unknown>) {\n if (left.size !== right.size) {\n return false;\n }\n\n for (const index of left.entries()) {\n if (!right.has(index[0])) {\n return false;\n }\n }\n\n for (const index of left.entries()) {\n if (!equal(index[1], right.get(index[0]))) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction equalSet(left: Set<unknown>, right: Set<unknown>) {\n if (left.size !== right.size) {\n return false;\n }\n\n for (const index of left.entries()) {\n if (!right.has(index[0])) {\n return false;\n }\n }\n\n return true;\n}\n\nexport default function equal(left: unknown, right: unknown) {\n if (left === right) {\n return true;\n }\n\n if (left && isObject(left) && right && isObject(right)) {\n if (left.constructor !== right.constructor) {\n return false;\n }\n\n if (Array.isArray(left) && Array.isArray(right)) {\n return equalArray(left, right);\n }\n\n if (left instanceof Map && right instanceof Map) {\n return equalMap(left, right);\n }\n\n if (left instanceof Set && right instanceof Set) {\n return equalSet(left, right);\n }\n\n if (ArrayBuffer.isView(left) && ArrayBuffer.isView(right)) {\n return equalArrayBuffer(left, right);\n }\n\n if (isRegex(left) && isRegex(right)) {\n return left.source === right.source && left.flags === right.flags;\n }\n\n if (left.valueOf !== Object.prototype.valueOf) {\n return left.valueOf() === right.valueOf();\n }\n\n if (left.toString !== Object.prototype.toString) {\n return left.toString() === right.toString();\n }\n\n const leftKeys = Object.keys(left);\n const rightKeys = Object.keys(right);\n\n if (leftKeys.length !== rightKeys.length) {\n return false;\n }\n\n for (let index = leftKeys.length; index-- !== 0; ) {\n if (!Object.prototype.hasOwnProperty.call(right, leftKeys[index])) {\n return false;\n }\n }\n\n for (let index = leftKeys.length; index-- !== 0; ) {\n const key = leftKeys[index];\n\n if (key === '_owner' && left.$$typeof) {\n // React-specific: avoid traversing React elements' _owner.\n // _owner contains circular references\n // and is not needed when comparing the actual elements (and not their owners)\n // eslint-disable-next-line no-continue\n continue;\n }\n\n if (!equal(left[key], right[key])) {\n return false;\n }\n }\n\n return true;\n }\n\n if (Number.isNaN(left) && Number.isNaN(right)) {\n return true;\n }\n\n return left === right;\n}\n","import equal from '@gilbarbara/deep-equal';\nimport is from 'is-lite';\n\nimport { CompareValuesOptions, Data, Key, Options, ValidTypes, Value } from './types';\n\nexport function canHaveLength(...arguments_: any): boolean {\n return arguments_.every((d: unknown) => is.string(d) || is.array(d) || is.plainObject(d));\n}\n\nexport function checkEquality(left: Data, right: Data, value: Value) {\n if (!isSameType(left, right)) {\n return false;\n }\n\n if ([left, right].every(is.array)) {\n return !left.some(hasValue(value)) && right.some(hasValue(value));\n }\n\n /* istanbul ignore else */\n if ([left, right].every(is.plainObject)) {\n return (\n !Object.entries(left).some(hasEntry(value)) && Object.entries(right).some(hasEntry(value))\n );\n }\n\n return right === value;\n}\n\nexport function compareNumbers<K = Key>(\n previousData: Data,\n data: Data,\n options: Options<K>,\n): boolean {\n const { actual, key, previous, type } = options;\n const left = nested(previousData, key);\n const right = nested(data, key);\n\n let changed =\n [left, right].every(is.number) && (type === 'increased' ? left < right : left > right);\n\n if (!is.undefined(actual)) {\n changed = changed && right === actual;\n }\n\n if (!is.undefined(previous)) {\n changed = changed && left === previous;\n }\n\n return changed;\n}\n\nexport function compareValues<K = Key>(\n previousData: Data,\n data: Data,\n options: CompareValuesOptions<K>,\n) {\n const { key, type, value } = options;\n\n const left = nested(previousData, key);\n const right = nested(data, key);\n const primary = type === 'added' ? left : right;\n const secondary = type === 'added' ? right : left;\n\n // console.log({ primary, secondary });\n\n if (!is.nullOrUndefined(value)) {\n if (is.defined(primary)) {\n // check if nested data matches\n if (is.array(primary) || is.plainObject(primary)) {\n return checkEquality(primary, secondary, value);\n }\n } else {\n return equal(secondary, value);\n }\n\n return false;\n }\n\n if ([left, right].every(is.array)) {\n return !secondary.every(isEqualPredicate(primary));\n }\n\n if ([left, right].every(is.plainObject)) {\n return hasExtraKeys(Object.keys(primary), Object.keys(secondary));\n }\n\n return (\n ![left, right].every(d => is.primitive(d) && is.defined(d)) &&\n (type === 'added'\n ? !is.defined(left) && is.defined(right)\n : is.defined(left) && !is.defined(right))\n );\n}\n\nexport function getIterables<K = Key>(previousData: Data, data: Data, { key }: Options<K> = {}) {\n let left = nested(previousData, key);\n let right = nested(data, key);\n\n if (!isSameType(left, right)) {\n throw new TypeError('Inputs have different types');\n }\n\n if (!canHaveLength(left, right)) {\n throw new TypeError(\"Inputs don't have length\");\n }\n\n if ([left, right].every(is.plainObject)) {\n left = Object.keys(left);\n right = Object.keys(right);\n }\n\n return [left, right];\n}\n\nexport function hasEntry(input: Value) {\n return ([key, value]: [string, Value]) => {\n if (is.array(input)) {\n return (\n equal(input, value) ||\n input.some(d => equal(d, value) || (is.array(value) && isEqualPredicate(value)(d)))\n );\n }\n\n /* istanbul ignore else */\n if (is.plainObject(input) && input[key]) {\n return !!input[key] && equal(input[key], value);\n }\n\n return equal(input, value);\n };\n}\n\nexport function hasExtraKeys(left: string[], right: string[]): boolean {\n return right.some(d => !left.includes(d));\n}\n\nexport function hasValue(input: Value) {\n return (value: Value) => {\n if (is.array(input)) {\n return input.some(d => equal(d, value) || (is.array(value) && isEqualPredicate(value)(d)));\n }\n\n return equal(input, value);\n };\n}\n\nexport function includesOrEqualsTo<T>(previousValue: T | T[], value: T): boolean {\n return is.array(previousValue)\n ? previousValue.some(d => equal(d, value))\n : equal(previousValue, value);\n}\n\nexport function isEqualPredicate(data: unknown[]) {\n return (value: unknown) => data.some(d => equal(d, value));\n}\n\nexport function isSameType(...arguments_: ValidTypes[]): boolean {\n return (\n arguments_.every(is.array) ||\n arguments_.every(is.number) ||\n arguments_.every(is.plainObject) ||\n arguments_.every(is.string)\n );\n}\n\nexport function nested<T extends Data, K = Key>(data: T, property?: K) {\n /* istanbul ignore else */\n if (is.plainObject(data) || is.array(data)) {\n /* istanbul ignore else */\n if (is.string(property)) {\n const props: Array<any> = property.split('.');\n\n return props.reduce((acc, d) => acc && acc[d], data);\n }\n\n /* istanbul ignore else */\n if (is.number(property)) {\n return data[property];\n }\n\n return data;\n }\n\n return data;\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport isRequiredIf from 'react-proptype-conditional-require';\nimport Popper from 'popper.js';\nimport deepmerge from 'deepmerge';\nimport is from 'is-lite';\nimport treeChanges from 'tree-changes';\nimport ReactDOM from 'react-dom';\nimport ExecutionEnvironment from 'exenv';\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n enumerableOnly && (symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n })), keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = null != arguments[i] ? arguments[i] : {};\n i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n\n return target;\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (typeof call === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _createSuper(Derived) {\n var hasNativeReflectConstruct = _isNativeReflectConstruct();\n\n return function _createSuperInternal() {\n var Super = _getPrototypeOf(Derived),\n result;\n\n if (hasNativeReflectConstruct) {\n var NewTarget = _getPrototypeOf(this).constructor;\n\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return _possibleConstructorReturn(this, result);\n };\n}\n\nvar DEFAULTS = {flip:{padding:20},preventOverflow:{padding:10}};\n\nvar STATUS = {INIT:'init',IDLE:'idle',OPENING:'opening',OPEN:'open',CLOSING:'closing',ERROR:'error'};\n\nvar canUseDOM=ExecutionEnvironment.canUseDOM;var isReact16=ReactDOM.createPortal!==undefined;function isMobile(){return 'ontouchstart'in window&&/Mobi/.test(navigator.userAgent);}/**\n * Log method calls if debug is enabled\n *\n * @private\n * @param {Object} arg\n * @param {string} arg.title - The title the logger was called from\n * @param {Object|Array} [arg.data] - The data to be logged\n * @param {boolean} [arg.warn] - If true, the message will be a warning\n * @param {boolean} [arg.debug] - Nothing will be logged unless debug is true\n */function log(_ref){var title=_ref.title,data=_ref.data,_ref$warn=_ref.warn,warn=_ref$warn===void 0?false:_ref$warn,_ref$debug=_ref.debug,debug=_ref$debug===void 0?false:_ref$debug;/* eslint-disable no-console */var logFn=warn?console.warn||console.error:console.log;if(debug&&title&&data){console.groupCollapsed(\"%creact-floater: \".concat(title),'color: #9b00ff; font-weight: bold; font-size: 12px;');if(Array.isArray(data)){data.forEach(function(d){if(is.plainObject(d)&&d.key){logFn.apply(console,[d.key,d.value]);}else {logFn.apply(console,[d]);}});}else {logFn.apply(console,[data]);}console.groupEnd();}/* eslint-enable */}function on(element,event,cb){var capture=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;element.addEventListener(event,cb,capture);}function off(element,event,cb){var capture=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;element.removeEventListener(event,cb,capture);}function once(element,event,cb){var capture=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var _nextCB;// eslint-disable-next-line prefer-const\n_nextCB=function nextCB(e){cb(e);off(element,event,_nextCB);};on(element,event,_nextCB,capture);}function noop(){}\n\nvar ReactFloaterPortal=/*#__PURE__*/function(_React$Component){_inherits(ReactFloaterPortal,_React$Component);var _super=_createSuper(ReactFloaterPortal);function ReactFloaterPortal(){_classCallCheck(this,ReactFloaterPortal);return _super.apply(this,arguments);}_createClass(ReactFloaterPortal,[{key:\"componentDidMount\",value:function componentDidMount(){if(!canUseDOM)return;if(!this.node){this.appendNode();}if(!isReact16){this.renderPortal();}}},{key:\"componentDidUpdate\",value:function componentDidUpdate(){if(!canUseDOM)return;if(!isReact16){this.renderPortal();}}},{key:\"componentWillUnmount\",value:function componentWillUnmount(){if(!canUseDOM||!this.node)return;if(!isReact16){ReactDOM.unmountComponentAtNode(this.node);}if(this.node&&this.node.parentNode===document.body){document.body.removeChild(this.node);this.node=undefined;}}},{key:\"appendNode\",value:function appendNode(){var _this$props=this.props,id=_this$props.id,zIndex=_this$props.zIndex;if(!this.node){this.node=document.createElement('div');/* istanbul ignore else */if(id){this.node.id=id;}if(zIndex){this.node.style.zIndex=zIndex;}document.body.appendChild(this.node);}}},{key:\"renderPortal\",value:function renderPortal(){if(!canUseDOM)return null;var _this$props2=this.props,children=_this$props2.children,setRef=_this$props2.setRef;if(!this.node){this.appendNode();}/* istanbul ignore else */if(isReact16){return/*#__PURE__*/ReactDOM.createPortal(children,this.node);}var portal=ReactDOM.unstable_renderSubtreeIntoContainer(this,children.length>1?/*#__PURE__*/React.createElement(\"div\",null,children):children[0],this.node);setRef(portal);return null;}},{key:\"renderReact16\",value:function renderReact16(){var _this$props3=this.props,hasChildren=_this$props3.hasChildren,placement=_this$props3.placement,target=_this$props3.target;if(!hasChildren){if(target||placement==='center'){return this.renderPortal();}return null;}return this.renderPortal();}},{key:\"render\",value:function render(){if(!isReact16){return null;}return this.renderReact16();}}]);return ReactFloaterPortal;}(React.Component);_defineProperty(ReactFloaterPortal,\"propTypes\",{children:PropTypes.oneOfType([PropTypes.element,PropTypes.array]),hasChildren:PropTypes.bool,id:PropTypes.oneOfType([PropTypes.string,PropTypes.number]),placement:PropTypes.string,setRef:PropTypes.func.isRequired,target:PropTypes.oneOfType([PropTypes.object,PropTypes.string]),zIndex:PropTypes.number});\n\nvar FloaterArrow=/*#__PURE__*/function(_React$Component){_inherits(FloaterArrow,_React$Component);var _super=_createSuper(FloaterArrow);function FloaterArrow(){_classCallCheck(this,FloaterArrow);return _super.apply(this,arguments);}_createClass(FloaterArrow,[{key:\"parentStyle\",get:function get(){var _this$props=this.props,placement=_this$props.placement,styles=_this$props.styles;var length=styles.arrow.length;var arrow={pointerEvents:'none',position:'absolute',width:'100%'};/* istanbul ignore else */if(placement.startsWith('top')){arrow.bottom=0;arrow.left=0;arrow.right=0;arrow.height=length;}else if(placement.startsWith('bottom')){arrow.left=0;arrow.right=0;arrow.top=0;arrow.height=length;}else if(placement.startsWith('left')){arrow.right=0;arrow.top=0;arrow.bottom=0;}else if(placement.startsWith('right')){arrow.left=0;arrow.top=0;}return arrow;}},{key:\"render\",value:function render(){var _this$props2=this.props,placement=_this$props2.placement,setArrowRef=_this$props2.setArrowRef,styles=_this$props2.styles;var _styles$arrow=styles.arrow,color=_styles$arrow.color,display=_styles$arrow.display,length=_styles$arrow.length,margin=_styles$arrow.margin,position=_styles$arrow.position,spread=_styles$arrow.spread;var arrowStyles={display:display,position:position};var points;var x=spread;var y=length;/* istanbul ignore else */if(placement.startsWith('top')){points=\"0,0 \".concat(x/2,\",\").concat(y,\" \").concat(x,\",0\");arrowStyles.bottom=0;arrowStyles.marginLeft=margin;arrowStyles.marginRight=margin;}else if(placement.startsWith('bottom')){points=\"\".concat(x,\",\").concat(y,\" \").concat(x/2,\",0 0,\").concat(y);arrowStyles.top=0;arrowStyles.marginLeft=margin;arrowStyles.marginRight=margin;}else if(placement.startsWith('left')){y=spread;x=length;points=\"0,0 \".concat(x,\",\").concat(y/2,\" 0,\").concat(y);arrowStyles.right=0;arrowStyles.marginTop=margin;arrowStyles.marginBottom=margin;}else if(placement.startsWith('right')){y=spread;x=length;points=\"\".concat(x,\",\").concat(y,\" \").concat(x,\",0 0,\").concat(y/2);arrowStyles.left=0;arrowStyles.marginTop=margin;arrowStyles.marginBottom=margin;}return/*#__PURE__*/React.createElement(\"div\",{className:\"__floater__arrow\",style:this.parentStyle},/*#__PURE__*/React.createElement(\"span\",{ref:setArrowRef,style:arrowStyles},/*#__PURE__*/React.createElement(\"svg\",{width:x,height:y,version:\"1.1\",xmlns:\"http://www.w3.org/2000/svg\"},/*#__PURE__*/React.createElement(\"polygon\",{points:points,fill:color}))));}}]);return FloaterArrow;}(React.Component);_defineProperty(FloaterArrow,\"propTypes\",{placement:PropTypes.string.isRequired,setArrowRef:PropTypes.func.isRequired,styles:PropTypes.object.isRequired});\n\nvar _excluded$1=[\"color\",\"height\",\"width\"];var FloaterCloseBtn=function FloaterCloseBtn(_ref){var handleClick=_ref.handleClick,styles=_ref.styles;var color=styles.color,height=styles.height,width=styles.width,style=_objectWithoutProperties(styles,_excluded$1);return/*#__PURE__*/React.createElement(\"button\",{\"aria-label\":\"close\",onClick:handleClick,style:style,type:\"button\"},/*#__PURE__*/React.createElement(\"svg\",{width:\"\".concat(width,\"px\"),height:\"\".concat(height,\"px\"),viewBox:\"0 0 18 18\",version:\"1.1\",xmlns:\"http://www.w3.org/2000/svg\",preserveAspectRatio:\"xMidYMid\"},/*#__PURE__*/React.createElement(\"g\",null,/*#__PURE__*/React.createElement(\"path\",{d:\"M8.13911129,9.00268191 L0.171521827,17.0258467 C-0.0498027049,17.248715 -0.0498027049,17.6098394 0.171521827,17.8327545 C0.28204354,17.9443526 0.427188206,17.9998706 0.572051765,17.9998706 C0.71714958,17.9998706 0.862013139,17.9443526 0.972581703,17.8327545 L9.0000937,9.74924618 L17.0276057,17.8327545 C17.1384085,17.9443526 17.2832721,17.9998706 17.4281356,17.9998706 C17.5729992,17.9998706 17.718097,17.9443526 17.8286656,17.8327545 C18.0499901,17.6098862 18.0499901,17.2487618 17.8286656,17.0258467 L9.86135722,9.00268191 L17.8340066,0.973848225 C18.0553311,0.750979934 18.0553311,0.389855532 17.8340066,0.16694039 C17.6126821,-0.0556467968 17.254037,-0.0556467968 17.0329467,0.16694039 L9.00042166,8.25611765 L0.967006424,0.167268345 C0.745681892,-0.0553188426 0.387317931,-0.0553188426 0.165993399,0.167268345 C-0.0553311331,0.390136635 -0.0553311331,0.751261038 0.165993399,0.974176179 L8.13920499,9.00268191 L8.13911129,9.00268191 Z\",fill:color}))));};FloaterCloseBtn.propTypes={handleClick:PropTypes.func.isRequired,styles:PropTypes.object.isRequired};\n\nvar FloaterContainer=function FloaterContainer(_ref){var content=_ref.content,footer=_ref.footer,handleClick=_ref.handleClick,open=_ref.open,positionWrapper=_ref.positionWrapper,showCloseButton=_ref.showCloseButton,title=_ref.title,styles=_ref.styles;var output={content:/*#__PURE__*/React.isValidElement(content)?content:/*#__PURE__*/React.createElement(\"div\",{className:\"__floater__content\",style:styles.content},content)};if(title){output.title=/*#__PURE__*/React.isValidElement(title)?title:/*#__PURE__*/React.createElement(\"div\",{className:\"__floater__title\",style:styles.title},title);}if(footer){output.footer=/*#__PURE__*/React.isValidElement(footer)?footer:/*#__PURE__*/React.createElement(\"div\",{className:\"__floater__footer\",style:styles.footer},footer);}if((showCloseButton||positionWrapper)&&!is[\"boolean\"](open)){output.close=/*#__PURE__*/React.createElement(FloaterCloseBtn,{styles:styles.close,handleClick:handleClick});}return/*#__PURE__*/React.createElement(\"div\",{className:\"__floater__container\",style:styles.container},output.close,output.title,output.content,output.footer);};FloaterContainer.propTypes={content:PropTypes.node.isRequired,footer:PropTypes.node,handleClick:PropTypes.func.isRequired,open:PropTypes.bool,positionWrapper:PropTypes.bool.isRequired,showCloseButton:PropTypes.bool.isRequired,styles:PropTypes.object.isRequired,title:PropTypes.node};\n\nvar Floater=/*#__PURE__*/function(_React$Component){_inherits(Floater,_React$Component);var _super=_createSuper(Floater);function Floater(){_classCallCheck(this,Floater);return _super.apply(this,arguments);}_createClass(Floater,[{key:\"style\",get:function get(){var _this$props=this.props,disableAnimation=_this$props.disableAnimation,component=_this$props.component,placement=_this$props.placement,hideArrow=_this$props.hideArrow,status=_this$props.status,styles=_this$props.styles;var length=styles.arrow.length,floater=styles.floater,floaterCentered=styles.floaterCentered,floaterClosing=styles.floaterClosing,floaterOpening=styles.floaterOpening,floaterWithAnimation=styles.floaterWithAnimation,floaterWithComponent=styles.floaterWithComponent;var element={};if(!hideArrow){if(placement.startsWith('top')){element.padding=\"0 0 \".concat(length,\"px\");}else if(placement.startsWith('bottom')){element.padding=\"\".concat(length,\"px 0 0\");}else if(placement.startsWith('left')){element.padding=\"0 \".concat(length,\"px 0 0\");}else if(placement.startsWith('right')){element.padding=\"0 0 0 \".concat(length,\"px\");}}if([STATUS.OPENING,STATUS.OPEN].indexOf(status)!==-1){element=_objectSpread2(_objectSpread2({},element),floaterOpening);}if(status===STATUS.CLOSING){element=_objectSpread2(_objectSpread2({},element),floaterClosing);}if(status===STATUS.OPEN&&!disableAnimation){element=_objectSpread2(_objectSpread2({},element),floaterWithAnimation);}if(placement==='center'){element=_objectSpread2(_objectSpread2({},element),floaterCentered);}if(component){element=_objectSpread2(_objectSpread2({},element),floaterWithComponent);}return _objectSpread2(_objectSpread2({},floater),element);}},{key:\"render\",value:function render(){var _this$props2=this.props,component=_this$props2.component,closeFn=_this$props2.handleClick,hideArrow=_this$props2.hideArrow,setFloaterRef=_this$props2.setFloaterRef,status=_this$props2.status;var output={};var classes=['__floater'];if(component){if(/*#__PURE__*/React.isValidElement(component)){output.content=/*#__PURE__*/React.cloneElement(component,{closeFn:closeFn});}else {output.content=component({closeFn:closeFn});}}else {output.content=/*#__PURE__*/React.createElement(FloaterContainer,this.props);}if(status===STATUS.OPEN){classes.push('__floater__open');}if(!hideArrow){output.arrow=/*#__PURE__*/React.createElement(FloaterArrow,this.props);}return/*#__PURE__*/React.createElement(\"div\",{ref:setFloaterRef,className:classes.join(' '),style:this.style},/*#__PURE__*/React.createElement(\"div\",{className:\"__floater__body\"},output.content,output.arrow));}}]);return Floater;}(React.Component);_defineProperty(Floater,\"propTypes\",{component:PropTypes.oneOfType([PropTypes.func,PropTypes.element]),content:PropTypes.node,disableAnimation:PropTypes.bool.isRequired,footer:PropTypes.node,handleClick:PropTypes.func.isRequired,hideArrow:PropTypes.bool.isRequired,open:PropTypes.bool,placement:PropTypes.string.isRequired,positionWrapper:PropTypes.bool.isRequired,setArrowRef:PropTypes.func.isRequired,setFloaterRef:PropTypes.func.isRequired,showCloseButton:PropTypes.bool,status:PropTypes.string.isRequired,styles:PropTypes.object.isRequired,title:PropTypes.node});\n\nvar ReactFloaterWrapper=/*#__PURE__*/function(_React$Component){_inherits(ReactFloaterWrapper,_React$Component);var _super=_createSuper(ReactFloaterWrapper);function ReactFloaterWrapper(){_classCallCheck(this,ReactFloaterWrapper);return _super.apply(this,arguments);}_createClass(ReactFloaterWrapper,[{key:\"render\",value:function render(){var _this$props=this.props,children=_this$props.children,handleClick=_this$props.handleClick,handleMouseEnter=_this$props.handleMouseEnter,handleMouseLeave=_this$props.handleMouseLeave,setChildRef=_this$props.setChildRef,setWrapperRef=_this$props.setWrapperRef,style=_this$props.style,styles=_this$props.styles;var element;/* istanbul ignore else */if(children){if(React.Children.count(children)===1){if(!/*#__PURE__*/React.isValidElement(children)){element=/*#__PURE__*/React.createElement(\"span\",null,children);}else {var refProp=is[\"function\"](children.type)?'innerRef':'ref';element=/*#__PURE__*/React.cloneElement(React.Children.only(children),_defineProperty({},refProp,setChildRef));}}else {element=children;}}if(!element){return null;}return/*#__PURE__*/React.createElement(\"span\",{ref:setWrapperRef,style:_objectSpread2(_objectSpread2({},styles),style),onClick:handleClick,onMouseEnter:handleMouseEnter,onMouseLeave:handleMouseLeave},element);}}]);return ReactFloaterWrapper;}(React.Component);_defineProperty(ReactFloaterWrapper,\"propTypes\",{children:PropTypes.node,handleClick:PropTypes.func.isRequired,handleMouseEnter:PropTypes.func.isRequired,handleMouseLeave:PropTypes.func.isRequired,setChildRef:PropTypes.func.isRequired,setWrapperRef:PropTypes.func.isRequired,style:PropTypes.object,styles:PropTypes.object.isRequired});\n\nvar defaultOptions={zIndex:100};function getStyles(styles){var options=deepmerge(defaultOptions,styles.options||{});return {wrapper:{cursor:'help',display:'inline-flex',flexDirection:'column',zIndex:options.zIndex},wrapperPosition:{left:-1000,position:'absolute',top:-1000,visibility:'hidden'},floater:{display:'inline-block',filter:'drop-shadow(0 0 3px rgba(0, 0, 0, 0.3))',maxWidth:300,opacity:0,position:'relative',transition:'opacity 0.3s',visibility:'hidden',zIndex:options.zIndex},floaterOpening:{opacity:1,visibility:'visible'},floaterWithAnimation:{opacity:1,transition:'opacity 0.3s, transform 0.2s',visibility:'visible'},floaterWithComponent:{maxWidth:'100%'},floaterClosing:{opacity:0,visibility:'visible'},floaterCentered:{left:'50%',position:'fixed',top:'50%',transform:'translate(-50%, -50%)'},container:{backgroundColor:'#fff',color:'#666',minHeight:60,minWidth:200,padding:20,position:'relative',zIndex:10},title:{borderBottom:'1px solid #555',color:'#555',fontSize:18,marginBottom:5,paddingBottom:6,paddingRight:18},content:{fontSize:15},close:{backgroundColor:'transparent',border:0,borderRadius:0,color:'#555',fontSize:0,height:15,outline:'none',padding:10,position:'absolute',right:0,top:0,width:15,WebkitAppearance:'none'},footer:{borderTop:'1px solid #ccc',fontSize:13,marginTop:10,paddingTop:5},arrow:{color:'#fff',display:'inline-flex',length:16,margin:8,position:'absolute',spread:32},options:options};}\n\nvar _excluded=[\"arrow\",\"flip\",\"offset\"];var POSITIONING_PROPS=['position','top','right','bottom','left'];var ReactFloater=/*#__PURE__*/function(_React$Component){_inherits(ReactFloater,_React$Component);var _super=_createSuper(ReactFloater);function ReactFloater(props){var _this;_classCallCheck(this,ReactFloater);_this=_super.call(this,props);/* istanbul ignore else */_defineProperty(_assertThisInitialized(_this),\"setArrowRef\",function(ref){_this.arrowRef=ref;});_defineProperty(_assertThisInitialized(_this),\"setChildRef\",function(ref){_this.childRef=ref;});_defineProperty(_assertThisInitialized(_this),\"setFloaterRef\",function(ref){_this.floaterRef=ref;});_defineProperty(_assertThisInitialized(_this),\"setWrapperRef\",function(ref){_this.wrapperRef=ref;});_defineProperty(_assertThisInitialized(_this),\"handleTransitionEnd\",function(){var status=_this.state.status;var callback=_this.props.callback;/* istanbul ignore else */if(_this.wrapperPopper){_this.wrapperPopper.instance.update();}_this.setState({status:status===STATUS.OPENING?STATUS.OPEN:STATUS.IDLE},function(){var newStatus=_this.state.status;callback(newStatus===STATUS.OPEN?'open':'close',_this.props);});});_defineProperty(_assertThisInitialized(_this),\"handleClick\",function(){var _this$props=_this.props,event=_this$props.event,open=_this$props.open;if(is[\"boolean\"](open))return;var _this$state=_this.state,positionWrapper=_this$state.positionWrapper,status=_this$state.status;/* istanbul ignore else */if(_this.event==='click'||_this.event==='hover'&&positionWrapper){log({title:'click',data:[{event:event,status:status===STATUS.OPEN?'closing':'opening'}],debug:_this.debug});_this.toggle();}});_defineProperty(_assertThisInitialized(_this),\"handleMouseEnter\",function(){var _this$props2=_this.props,event=_this$props2.event,open=_this$props2.open;if(is[\"boolean\"](open)||isMobile())return;var status=_this.state.status;/* istanbul ignore else */if(_this.event==='hover'&&status===STATUS.IDLE){log({title:'mouseEnter',data:[{key:'originalEvent',value:event}],debug:_this.debug});clearTimeout(_this.eventDelayTimeout);_this.toggle();}});_defineProperty(_assertThisInitialized(_this),\"handleMouseLeave\",function(){var _this$props3=_this.props,event=_this$props3.event,eventDelay=_this$props3.eventDelay,open=_this$props3.open;if(is[\"boolean\"](open)||isMobile())return;var _this$state2=_this.state,status=_this$state2.status,positionWrapper=_this$state2.positionWrapper;/* istanbul ignore else */if(_this.event==='hover'){log({title:'mouseLeave',data:[{key:'originalEvent',value:event}],debug:_this.debug});if(!eventDelay){_this.toggle(STATUS.IDLE);}else if([STATUS.OPENING,STATUS.OPEN].indexOf(status)!==-1&&!positionWrapper&&!_this.eventDelayTimeout){_this.eventDelayTimeout=setTimeout(function(){delete _this.eventDelayTimeout;_this.toggle();},eventDelay*1000);}}});_this.state={currentPlacement:props.placement,needsUpdate:false,positionWrapper:props.wrapperOptions.position&&!!props.target,status:STATUS.INIT,statusWrapper:STATUS.INIT};_this._isMounted=false;_this.hasMounted=false;if(canUseDOM){window.addEventListener('load',function(){if(_this.popper){_this.popper.instance.update();}if(_this.wrapperPopper){_this.wrapperPopper.instance.update();}});}return _this;}_createClass(ReactFloater,[{key:\"componentDidMount\",value:function componentDidMount(){if(!canUseDOM)return;var positionWrapper=this.state.positionWrapper;var _this$props5=this.props,children=_this$props5.children,open=_this$props5.open,target=_this$props5.target;this._isMounted=true;log({title:'init',data:{hasChildren:!!children,hasTarget:!!target,isControlled:is[\"boolean\"](open),positionWrapper:positionWrapper,target:this.target,floater:this.floaterRef},debug:this.debug});if(!this.hasMounted){this.initPopper();this.hasMounted=true;}if(!children&&target&&!is[\"boolean\"](open));}},{key:\"componentDidUpdate\",value:function componentDidUpdate(prevProps,prevState){if(!canUseDOM)return;var _this$props6=this.props,autoOpen=_this$props6.autoOpen,open=_this$props6.open,target=_this$props6.target,wrapperOptions=_this$props6.wrapperOptions;var _treeChanges=treeChanges(prevState,this.state),changedFrom=_treeChanges.changedFrom,changed=_treeChanges.changed;if(prevProps.open!==open){var forceStatus;// always follow `open` in controlled mode\nif(is[\"boolean\"](open)){forceStatus=open?STATUS.OPENING:STATUS.CLOSING;}this.toggle(forceStatus);}if(prevProps.wrapperOptions.position!==wrapperOptions.position||prevProps.target!==target){this.changeWrapperPosition(this.props);}if(changed('status',STATUS.IDLE)&&open){this.toggle(STATUS.OPEN);}else if(changedFrom('status',STATUS.INIT,STATUS.IDLE)&&autoOpen){this.toggle(STATUS.OPEN);}if(this.popper&&changed('status',STATUS.OPENING)){this.popper.instance.update();}if(this.floaterRef&&(changed('status',STATUS.OPENING)||changed('status',STATUS.CLOSING))){once(this.floaterRef,'transitionend',this.handleTransitionEnd);}if(changed('needsUpdate',true)){this.rebuildPopper();}}},{key:\"componentWillUnmount\",value:function componentWillUnmount(){if(!canUseDOM)return;this._isMounted=false;if(this.popper){this.popper.instance.destroy();}if(this.wrapperPopper){this.wrapperPopper.instance.destroy();}}},{key:\"initPopper\",value:function initPopper(){var _this2=this;var target=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.target;var positionWrapper=this.state.positionWrapper;var _this$props7=this.props,disableFlip=_this$props7.disableFlip,getPopper=_this$props7.getPopper,hideArrow=_this$props7.hideArrow,offset=_this$props7.offset,placement=_this$props7.placement,wrapperOptions=_this$props7.wrapperOptions;var flipBehavior=placement==='top'||placement==='bottom'?'flip':['right','bottom-end','top-end','left','top-start','bottom-start'];/* istanbul ignore else */if(placement==='center'){this.setState({status:STATUS.IDLE});}else if(target&&this.floaterRef){var _this$options=this.options,arrow=_this$options.arrow,flip=_this$options.flip,offsetOptions=_this$options.offset,rest=_objectWithoutProperties(_this$options,_excluded);new Popper(target,this.floaterRef,{placement:placement,modifiers:_objectSpread2({arrow:_objectSpread2({enabled:!hideArrow,element:this.arrowRef},arrow),flip:_objectSpread2({enabled:!disableFlip,behavior:flipBehavior},flip),offset:_objectSpread2({offset:\"0, \".concat(offset,\"px\")},offsetOptions)},rest),onCreate:function onCreate(data){var _this2$floaterRef;_this2.popper=data;if(!((_this2$floaterRef=_this2.floaterRef)!==null&&_this2$floaterRef!==void 0&&_this2$floaterRef.isConnected)){_this2.setState({needsUpdate:true});return;}getPopper(data,'floater');if(_this2._isMounted){_this2.setState({currentPlacement:data.placement,status:STATUS.IDLE});}if(placement!==data.placement){setTimeout(function(){data.instance.update();},1);}},onUpdate:function onUpdate(data){_this2.popper=data;var currentPlacement=_this2.state.currentPlacement;if(_this2._isMounted&&data.placement!==currentPlacement){_this2.setState({currentPlacement:data.placement});}}});}if(positionWrapper){var wrapperOffset=!is.undefined(wrapperOptions.offset)?wrapperOptions.offset:0;new Popper(this.target,this.wrapperRef,{placement:wrapperOptions.placement||placement,modifiers:{arrow:{enabled:false},offset:{offset:\"0, \".concat(wrapperOffset,\"px\")},flip:{enabled:false}},onCreate:function onCreate(data){_this2.wrapperPopper=data;if(_this2._isMounted){_this2.setState({statusWrapper:STATUS.IDLE});}getPopper(data,'wrapper');if(placement!==data.placement){setTimeout(function(){data.instance.update();},1);}}});}}},{key:\"rebuildPopper\",value:function rebuildPopper(){var _this3=this;this.floaterRefInterval=setInterval(function(){var _this3$floaterRef;if((_this3$floaterRef=_this3.floaterRef)!==null&&_this3$floaterRef!==void 0&&_this3$floaterRef.isConnected){clearInterval(_this3.floaterRefInterval);_this3.setState({needsUpdate:false});_this3.initPopper();}},50);}},{key:\"changeWrapperPosition\",value:function changeWrapperPosition(_ref){var target=_ref.target,wrapperOptions=_ref.wrapperOptions;this.setState({positionWrapper:wrapperOptions.position&&!!target});}},{key:\"toggle\",value:function toggle(forceStatus){var status=this.state.status;var nextStatus=status===STATUS.OPEN?STATUS.CLOSING:STATUS.OPENING;if(!is.undefined(forceStatus)){nextStatus=forceStatus;}this.setState({status:nextStatus});}},{key:\"debug\",get:function get(){var debug=this.props.debug;return debug||!!global.ReactFloaterDebug;}},{key:\"event\",get:function get(){var _this$props8=this.props,disableHoverToClick=_this$props8.disableHoverToClick,event=_this$props8.event;if(event==='hover'&&isMobile()&&!disableHoverToClick){return 'click';}return event;}},{key:\"options\",get:function get(){var options=this.props.options;return deepmerge(DEFAULTS,options||{});}},{key:\"styles\",get:function get(){var _this4=this;var _this$state3=this.state,status=_this$state3.status,positionWrapper=_this$state3.positionWrapper,statusWrapper=_this$state3.statusWrapper;var styles=this.props.styles;var nextStyles=deepmerge(getStyles(styles),styles);if(positionWrapper){var wrapperStyles;if(!([STATUS.IDLE].indexOf(status)!==-1)||!([STATUS.IDLE].indexOf(statusWrapper)!==-1)){wrapperStyles=nextStyles.wrapperPosition;}else {wrapperStyles=this.wrapperPopper.styles;}nextStyles.wrapper=_objectSpread2(_objectSpread2({},nextStyles.wrapper),wrapperStyles);}/* istanbul ignore else */if(this.target){var targetStyles=window.getComputedStyle(this.target);/* istanbul ignore else */if(this.wrapperStyles){nextStyles.wrapper=_objectSpread2(_objectSpread2({},nextStyles.wrapper),this.wrapperStyles);}else if(!(['relative','static'].indexOf(targetStyles.position)!==-1)){this.wrapperStyles={};if(!positionWrapper){POSITIONING_PROPS.forEach(function(d){_this4.wrapperStyles[d]=targetStyles[d];});nextStyles.wrapper=_objectSpread2(_objectSpread2({},nextStyles.wrapper),this.wrapperStyles);this.target.style.position='relative';this.target.style.top='auto';this.target.style.right='auto';this.target.style.bottom='auto';this.target.style.left='auto';}}}return nextStyles;}},{key:\"target\",get:function get(){if(!canUseDOM)return null;var target=this.props.target;if(target){if(is.domElement(target)){return target;}return document.querySelector(target);}return this.childRef||this.wrapperRef;}},{key:\"render\",value:function render(){var _this$state4=this.state,currentPlacement=_this$state4.currentPlacement,positionWrapper=_this$state4.positionWrapper,status=_this$state4.status;var _this$props9=this.props,children=_this$props9.children,component=_this$props9.component,content=_this$props9.content,disableAnimation=_this$props9.disableAnimation,footer=_this$props9.footer,hideArrow=_this$props9.hideArrow,id=_this$props9.id,open=_this$props9.open,showCloseButton=_this$props9.showCloseButton,style=_this$props9.style,target=_this$props9.target,title=_this$props9.title;var wrapper=/*#__PURE__*/React.createElement(ReactFloaterWrapper,{handleClick:this.handleClick,handleMouseEnter:this.handleMouseEnter,handleMouseLeave:this.handleMouseLeave,setChildRef:this.setChildRef,setWrapperRef:this.setWrapperRef,style:style,styles:this.styles.wrapper},children);var output={};if(positionWrapper){output.wrapperInPortal=wrapper;}else {output.wrapperAsChildren=wrapper;}return/*#__PURE__*/React.createElement(\"span\",null,/*#__PURE__*/React.createElement(ReactFloaterPortal,{hasChildren:!!children,id:id,placement:currentPlacement,setRef:this.setFloaterRef,target:target,zIndex:this.styles.options.zIndex},/*#__PURE__*/React.createElement(Floater,{component:component,content:content,disableAnimation:disableAnimation,footer:footer,handleClick:this.handleClick,hideArrow:hideArrow||currentPlacement==='center',open:open,placement:currentPlacement,positionWrapper:positionWrapper,setArrowRef:this.setArrowRef,setFloaterRef:this.setFloaterRef,showCloseButton:showCloseButton,status:status,styles:this.styles,title:title}),output.wrapperInPortal),output.wrapperAsChildren);}}]);return ReactFloater;}(React.Component);_defineProperty(ReactFloater,\"propTypes\",{autoOpen:PropTypes.bool,callback:PropTypes.func,children:PropTypes.node,component:isRequiredIf(PropTypes.oneOfType([PropTypes.func,PropTypes.element]),function(props){return !props.content;}),content:isRequiredIf(PropTypes.node,function(props){return !props.component;}),debug:PropTypes.bool,disableAnimation:PropTypes.bool,disableFlip:PropTypes.bool,disableHoverToClick:PropTypes.bool,event:PropTypes.oneOf(['hover','click']),eventDelay:PropTypes.number,footer:PropTypes.node,getPopper:PropTypes.func,hideArrow:PropTypes.bool,id:PropTypes.oneOfType([PropTypes.string,PropTypes.number]),offset:PropTypes.number,open:PropTypes.bool,options:PropTypes.object,placement:PropTypes.oneOf(['top','top-start','top-end','bottom','bottom-start','bottom-end','left','left-start','left-end','right','right-start','right-end','auto','center']),showCloseButton:PropTypes.bool,style:PropTypes.object,styles:PropTypes.object,target:PropTypes.oneOfType([PropTypes.object,PropTypes.string]),title:PropTypes.node,wrapperOptions:PropTypes.shape({offset:PropTypes.number,placement:PropTypes.oneOf(['top','top-start','top-end','bottom','bottom-start','bottom-end','left','left-start','left-end','right','right-start','right-end','auto']),position:PropTypes.bool})});_defineProperty(ReactFloater,\"defaultProps\",{autoOpen:false,callback:noop,debug:false,disableAnimation:false,disableFlip:false,disableHoverToClick:false,event:'click',eventDelay:0.4,getPopper:noop,hideArrow:false,offset:15,placement:'bottom',showCloseButton:false,styles:{},target:null,wrapperOptions:{position:false}});\n\nexport { ReactFloater as default };\n","import equal from '@gilbarbara/deep-equal';\nimport is from 'is-lite';\n\nimport { compareNumbers, compareValues, getIterables, includesOrEqualsTo, nested } from './helpers';\nimport { Data, KeyType, TreeChanges, Value } from './types';\n\nexport default function treeChanges<P extends Data, D extends Data, K = KeyType<P, D>>(\n previousData: P,\n data: D,\n): TreeChanges<K> {\n if ([previousData, data].some(is.nullOrUndefined)) {\n throw new Error('Missing required parameters');\n }\n\n if (![previousData, data].every(d => is.plainObject(d) || is.array(d))) {\n throw new Error('Expected plain objects or array');\n }\n\n const added = (key?: K, value?: Value): boolean => {\n try {\n return compareValues<K>(previousData, data, { key, type: 'added', value });\n } catch {\n /* istanbul ignore next */\n return false;\n }\n };\n\n const changed = (key?: K | string, actual?: Value, previous?: Value): boolean => {\n try {\n const left = nested(previousData, key);\n const right = nested(data, key);\n const hasActual = is.defined(actual);\n const hasPrevious = is.defined(previous);\n\n if (hasActual || hasPrevious) {\n const leftComparator = hasPrevious\n ? includesOrEqualsTo(previous, left)\n : !includesOrEqualsTo(actual, left);\n const rightComparator = includesOrEqualsTo(actual, right);\n\n return leftComparator && rightComparator;\n }\n\n if ([left, right].every(is.array) || [left, right].every(is.plainObject)) {\n return !equal(left, right);\n }\n\n return left !== right;\n } catch {\n /* istanbul ignore next */\n return false;\n }\n };\n\n const changedFrom = (key: K | string, previous: Value, actual?: Value): boolean => {\n if (!is.defined(key)) {\n return false;\n }\n\n try {\n const left = nested(previousData, key);\n const right = nested(data, key);\n const hasActual = is.defined(actual);\n\n return (\n includesOrEqualsTo(previous, left) &&\n (hasActual ? includesOrEqualsTo(actual, right) : !hasActual)\n );\n } catch {\n /* istanbul ignore next */\n return false;\n }\n };\n\n /**\n * @deprecated\n * Use \"changed\" instead\n */\n const changedTo = (key: K | string, actual: Value): boolean => {\n if (!is.defined(key)) {\n return false;\n }\n\n /* istanbul ignore next */\n if (process.env.NODE_ENV === 'development') {\n // eslint-disable-next-line no-console\n console.warn('`changedTo` is deprecated! Replace it with `change`');\n }\n\n return changed(key, actual);\n };\n\n const decreased = (key: K, actual?: Value, previous?: Value): boolean => {\n if (!is.defined(key)) {\n return false;\n }\n\n try {\n return compareNumbers<K>(previousData, data, { key, actual, previous, type: 'decreased' });\n } catch {\n /* istanbul ignore next */\n return false;\n }\n };\n\n const emptied = (key?: K): boolean => {\n try {\n const [left, right] = getIterables(previousData, data, { key });\n\n return !!left.length && !right.length;\n } catch {\n /* istanbul ignore next */\n return false;\n }\n };\n\n const filled = (key?: K): boolean => {\n try {\n const [left, right] = getIterables(previousData, data, { key });\n\n return !left.length && !!right.length;\n } catch {\n /* istanbul ignore next */\n return false;\n }\n };\n\n const increased = (key: K, actual?: Value, previous?: Value): boolean => {\n if (!is.defined(key)) {\n return false;\n }\n\n try {\n return compareNumbers<K>(previousData, data, { key, actual, previous, type: 'increased' });\n } catch {\n /* istanbul ignore next */\n return false;\n }\n };\n\n const removed = (key?: K, value?: Value): boolean => {\n try {\n return compareValues<K>(previousData, data, { key, type: 'removed', value });\n } catch {\n /* istanbul ignore next */\n return false;\n }\n };\n\n return { added, changed, changedFrom, changedTo, decreased, emptied, filled, increased, removed };\n}\n\nexport * from './types';\n","import React, { isValidElement } from 'react';\nimport 'prop-types';\nimport treeChanges from 'tree-changes';\nimport is from 'is-lite';\nimport ReactDOM, { createPortal } from 'react-dom';\nimport ExecutionEnvironment from 'exenv';\nimport scroll from 'scroll';\nimport scrollParent from 'scrollparent';\nimport { isValidElementType, Element, ForwardRef, typeOf } from 'react-is';\nimport deepmerge from 'deepmerge';\nimport Floater from 'react-floater';\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (typeof call === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _createSuper(Derived) {\n var hasNativeReflectConstruct = _isNativeReflectConstruct();\n\n return function _createSuperInternal() {\n var Super = _getPrototypeOf(Derived),\n result;\n\n if (hasNativeReflectConstruct) {\n var NewTarget = _getPrototypeOf(this).constructor;\n\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return _possibleConstructorReturn(this, result);\n };\n}\n\nvar ACTIONS = {\n INIT: 'init',\n START: 'start',\n STOP: 'stop',\n RESET: 'reset',\n PREV: 'prev',\n NEXT: 'next',\n GO: 'go',\n CLOSE: 'close',\n SKIP: 'skip',\n UPDATE: 'update'\n};\n\nvar EVENTS = {\n TOUR_START: 'tour:start',\n STEP_BEFORE: 'step:before',\n BEACON: 'beacon',\n TOOLTIP: 'tooltip',\n STEP_AFTER: 'step:after',\n TOUR_END: 'tour:end',\n TOUR_STATUS: 'tour:status',\n TARGET_NOT_FOUND: 'error:target_not_found',\n ERROR: 'error'\n};\n\nvar LIFECYCLE = {\n INIT: 'init',\n READY: 'ready',\n BEACON: 'beacon',\n TOOLTIP: 'tooltip',\n COMPLETE: 'complete',\n ERROR: 'error'\n};\n\nvar STATUS = {\n IDLE: 'idle',\n READY: 'ready',\n WAITING: 'waiting',\n RUNNING: 'running',\n PAUSED: 'paused',\n SKIPPED: 'skipped',\n FINISHED: 'finished',\n ERROR: 'error'\n};\n\nvar canUseDOM = ExecutionEnvironment.canUseDOM;\nvar isReact16 = createPortal !== undefined;\n/**\n * Get the current browser\n *\n * @param {string} userAgent\n *\n * @returns {String}\n */\n\nfunction getBrowser() {\n var userAgent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : navigator.userAgent;\n var browser = userAgent;\n\n if (typeof window === 'undefined') {\n browser = 'node';\n } else if (document.documentMode) {\n browser = 'ie';\n } else if (/Edge/.test(userAgent)) {\n browser = 'edge';\n } // Opera 8.0+\n else if (Boolean(window.opera) || userAgent.indexOf(' OPR/') >= 0) {\n browser = 'opera';\n } // Firefox 1.0+\n else if (typeof window.InstallTrigger !== 'undefined') {\n browser = 'firefox';\n } // Chrome 1+\n else if (window.chrome) {\n browser = 'chrome';\n } // Safari (and Chrome iOS, Firefox iOS)\n else if (/(Version\\/([0-9._]+).*Safari|CriOS|FxiOS| Mobile\\/)/.test(userAgent)) {\n browser = 'safari';\n }\n\n return browser;\n}\n/**\n * Get the toString Object type\n * @param {*} value\n * @returns {string}\n */\n\nfunction getObjectType(value) {\n return Object.prototype.toString.call(value).slice(8, -1).toLowerCase();\n}\n/**\n * Get text from React components\n *\n * @param {*} root\n *\n * @returns {string}\n */\n\nfunction getText(root) {\n var content = [];\n\n var recurse = function recurse(child) {\n /* istanbul ignore else */\n if (typeof child === 'string' || typeof child === 'number') {\n content.push(child);\n } else if (Array.isArray(child)) {\n child.forEach(function (c) {\n return recurse(c);\n });\n } else if (child && child.props) {\n var children = child.props.children;\n\n if (Array.isArray(children)) {\n children.forEach(function (c) {\n return recurse(c);\n });\n } else {\n recurse(children);\n }\n }\n };\n\n recurse(root);\n return content.join(' ').trim();\n}\nfunction hasOwnProperty(value, key) {\n return Object.prototype.hasOwnProperty.call(value, key);\n}\nfunction hasValidKeys(value, keys) {\n if (!is.plainObject(value) || !is.array(keys)) {\n return false;\n }\n\n return Object.keys(value).every(function (d) {\n return keys.indexOf(d) !== -1;\n });\n}\n/**\n * Convert hex to RGB\n *\n * @param {string} hex\n * @returns {Array}\n */\n\nfunction hexToRGB(hex) {\n var shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n var properHex = hex.replace(shorthandRegex, function (m, r, g, b) {\n return r + r + g + g + b + b;\n });\n var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(properHex);\n return result ? [parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16)] : [];\n}\n/**\n * Decide if the step shouldn't skip the beacon\n * @param {Object} step\n *\n * @returns {boolean}\n */\n\nfunction hideBeacon(step) {\n return step.disableBeacon || step.placement === 'center';\n}\n/**\n * Compare if two variables are equal\n *\n * @param {*} left\n * @param {*} right\n *\n * @returns {boolean}\n */\n\nfunction isEqual(left, right) {\n var type;\n var hasReactElement = /*#__PURE__*/isValidElement(left) || /*#__PURE__*/isValidElement(right);\n var hasUndefined = is.undefined(left) || is.undefined(right);\n\n if (getObjectType(left) !== getObjectType(right) || hasReactElement || hasUndefined) {\n return false;\n }\n\n if (is.domElement(left)) {\n return left.isSameNode(right);\n }\n\n if (is.number(left)) {\n return left === right;\n }\n\n if (is[\"function\"](left)) {\n return left.toString() === right.toString();\n }\n\n for (var key in left) {\n /* istanbul ignore else */\n if (hasOwnProperty(left, key)) {\n if (typeof left[key] === 'undefined' || typeof right[key] === 'undefined') {\n return false;\n }\n\n type = getObjectType(left[key]);\n\n if (['object', 'array'].indexOf(type) !== -1 && isEqual(left[key], right[key])) {\n continue;\n }\n\n if (type === 'function' && isEqual(left[key], right[key])) {\n continue;\n }\n\n if (left[key] !== right[key]) {\n return false;\n }\n }\n }\n\n for (var p in right) {\n /* istanbul ignore else */\n if (hasOwnProperty(right, p)) {\n if (typeof left[p] === 'undefined') {\n return false;\n }\n }\n }\n\n return true;\n}\n/**\n * Detect legacy browsers\n *\n * @returns {boolean}\n */\n\nfunction isLegacy() {\n return !(['chrome', 'safari', 'firefox', 'opera'].indexOf(getBrowser()) !== -1);\n}\n/**\n * Log method calls if debug is enabled\n *\n * @private\n * @param {Object} arg\n * @param {string} arg.title - The title the logger was called from\n * @param {Object|Array} [arg.data] - The data to be logged\n * @param {boolean} [arg.warn] - If true, the message will be a warning\n * @param {boolean} [arg.debug] - Nothing will be logged unless debug is true\n */\n\nfunction log(_ref) {\n var title = _ref.title,\n data = _ref.data,\n _ref$warn = _ref.warn,\n warn = _ref$warn === void 0 ? false : _ref$warn,\n _ref$debug = _ref.debug,\n debug = _ref$debug === void 0 ? false : _ref$debug;\n\n /* eslint-disable no-console */\n var logFn = warn ? console.warn || console.error : console.log;\n\n if (debug) {\n if (title && data) {\n console.groupCollapsed(\"%creact-joyride: \".concat(title), 'color: #ff0044; font-weight: bold; font-size: 12px;');\n\n if (Array.isArray(data)) {\n data.forEach(function (d) {\n if (is.plainObject(d) && d.key) {\n logFn.apply(console, [d.key, d.value]);\n } else {\n logFn.apply(console, [d]);\n }\n });\n } else {\n logFn.apply(console, [data]);\n }\n\n console.groupEnd();\n } else {\n console.error('Missing title or data props');\n }\n }\n /* eslint-enable */\n\n}\n\nvar defaultState = {\n action: '',\n controlled: false,\n index: 0,\n lifecycle: LIFECYCLE.INIT,\n size: 0,\n status: STATUS.IDLE\n};\nvar validKeys = ['action', 'index', 'lifecycle', 'status'];\nfunction createStore(props) {\n var store = new Map();\n var data = new Map();\n\n var Store = /*#__PURE__*/function () {\n function Store() {\n var _this = this;\n\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$continuous = _ref.continuous,\n continuous = _ref$continuous === void 0 ? false : _ref$continuous,\n stepIndex = _ref.stepIndex,\n _ref$steps = _ref.steps,\n _steps = _ref$steps === void 0 ? [] : _ref$steps;\n\n _classCallCheck(this, Store);\n\n _defineProperty(this, \"listener\", void 0);\n\n _defineProperty(this, \"setSteps\", function (steps) {\n var _this$getState = _this.getState(),\n size = _this$getState.size,\n status = _this$getState.status;\n\n var state = {\n size: steps.length,\n status: status\n };\n data.set('steps', steps);\n\n if (status === STATUS.WAITING && !size && steps.length) {\n state.status = STATUS.RUNNING;\n }\n\n _this.setState(state);\n });\n\n _defineProperty(this, \"addListener\", function (listener) {\n _this.listener = listener;\n });\n\n _defineProperty(this, \"update\", function (state) {\n if (!hasValidKeys(state, validKeys)) {\n throw new Error(\"State is not valid. Valid keys: \".concat(validKeys.join(', ')));\n }\n\n _this.setState(_objectSpread2({}, _this.getNextState(_objectSpread2(_objectSpread2(_objectSpread2({}, _this.getState()), state), {}, {\n action: state.action || ACTIONS.UPDATE\n }), true)));\n });\n\n _defineProperty(this, \"start\", function (nextIndex) {\n var _this$getState2 = _this.getState(),\n index = _this$getState2.index,\n size = _this$getState2.size;\n\n _this.setState(_objectSpread2(_objectSpread2({}, _this.getNextState({\n action: ACTIONS.START,\n index: is.number(nextIndex) ? nextIndex : index\n }, true)), {}, {\n status: size ? STATUS.RUNNING : STATUS.WAITING\n }));\n });\n\n _defineProperty(this, \"stop\", function () {\n var advance = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n var _this$getState3 = _this.getState(),\n index = _this$getState3.index,\n status = _this$getState3.status;\n\n if ([STATUS.FINISHED, STATUS.SKIPPED].indexOf(status) !== -1) return;\n\n _this.setState(_objectSpread2(_objectSpread2({}, _this.getNextState({\n action: ACTIONS.STOP,\n index: index + (advance ? 1 : 0)\n })), {}, {\n status: STATUS.PAUSED\n }));\n });\n\n _defineProperty(this, \"close\", function () {\n var _this$getState4 = _this.getState(),\n index = _this$getState4.index,\n status = _this$getState4.status;\n\n if (status !== STATUS.RUNNING) return;\n\n _this.setState(_objectSpread2({}, _this.getNextState({\n action: ACTIONS.CLOSE,\n index: index + 1\n })));\n });\n\n _defineProperty(this, \"go\", function (nextIndex) {\n var _this$getState5 = _this.getState(),\n controlled = _this$getState5.controlled,\n status = _this$getState5.status;\n\n if (controlled || status !== STATUS.RUNNING) return;\n\n var step = _this.getSteps()[nextIndex];\n\n _this.setState(_objectSpread2(_objectSpread2({}, _this.getNextState({\n action: ACTIONS.GO,\n index: nextIndex\n })), {}, {\n status: step ? status : STATUS.FINISHED\n }));\n });\n\n _defineProperty(this, \"info\", function () {\n return _this.getState();\n });\n\n _defineProperty(this, \"next\", function () {\n var _this$getState6 = _this.getState(),\n index = _this$getState6.index,\n status = _this$getState6.status;\n\n if (status !== STATUS.RUNNING) return;\n\n _this.setState(_this.getNextState({\n action: ACTIONS.NEXT,\n index: index + 1\n }));\n });\n\n _defineProperty(this, \"open\", function () {\n var _this$getState7 = _this.getState(),\n status = _this$getState7.status;\n\n if (status !== STATUS.RUNNING) return;\n\n _this.setState(_objectSpread2({}, _this.getNextState({\n action: ACTIONS.UPDATE,\n lifecycle: LIFECYCLE.TOOLTIP\n })));\n });\n\n _defineProperty(this, \"prev\", function () {\n var _this$getState8 = _this.getState(),\n index = _this$getState8.index,\n status = _this$getState8.status;\n\n if (status !== STATUS.RUNNING) return;\n\n _this.setState(_objectSpread2({}, _this.getNextState({\n action: ACTIONS.PREV,\n index: index - 1\n })));\n });\n\n _defineProperty(this, \"reset\", function () {\n var restart = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n var _this$getState9 = _this.getState(),\n controlled = _this$getState9.controlled;\n\n if (controlled) return;\n\n _this.setState(_objectSpread2(_objectSpread2({}, _this.getNextState({\n action: ACTIONS.RESET,\n index: 0\n })), {}, {\n status: restart ? STATUS.RUNNING : STATUS.READY\n }));\n });\n\n _defineProperty(this, \"skip\", function () {\n var _this$getState10 = _this.getState(),\n status = _this$getState10.status;\n\n if (status !== STATUS.RUNNING) return;\n\n _this.setState({\n action: ACTIONS.SKIP,\n lifecycle: LIFECYCLE.INIT,\n status: STATUS.SKIPPED\n });\n });\n\n this.setState({\n action: ACTIONS.INIT,\n controlled: is.number(stepIndex),\n continuous: continuous,\n index: is.number(stepIndex) ? stepIndex : 0,\n lifecycle: LIFECYCLE.INIT,\n status: _steps.length ? STATUS.READY : STATUS.IDLE\n }, true);\n this.setSteps(_steps);\n }\n\n _createClass(Store, [{\n key: \"setState\",\n value: function setState(nextState) {\n var initial = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var state = this.getState();\n\n var _state$nextState = _objectSpread2(_objectSpread2({}, state), nextState),\n action = _state$nextState.action,\n index = _state$nextState.index,\n lifecycle = _state$nextState.lifecycle,\n size = _state$nextState.size,\n status = _state$nextState.status;\n\n store.set('action', action);\n store.set('index', index);\n store.set('lifecycle', lifecycle);\n store.set('size', size);\n store.set('status', status);\n\n if (initial) {\n store.set('controlled', nextState.controlled);\n store.set('continuous', nextState.continuous);\n }\n /* istanbul ignore else */\n\n\n if (this.listener && this.hasUpdatedState(state)) {\n // console.log('â–¶ â–¶ â–¶ NEW STATE', this.getState());\n this.listener(this.getState());\n }\n }\n }, {\n key: \"getState\",\n value: function getState() {\n if (!store.size) {\n return _objectSpread2({}, defaultState);\n }\n\n return {\n action: store.get('action') || '',\n controlled: store.get('controlled') || false,\n index: parseInt(store.get('index'), 10),\n lifecycle: store.get('lifecycle') || '',\n size: store.get('size') || 0,\n status: store.get('status') || ''\n };\n }\n }, {\n key: \"getNextState\",\n value: function getNextState(state) {\n var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n var _this$getState11 = this.getState(),\n action = _this$getState11.action,\n controlled = _this$getState11.controlled,\n index = _this$getState11.index,\n size = _this$getState11.size,\n status = _this$getState11.status;\n\n var newIndex = is.number(state.index) ? state.index : index;\n var nextIndex = controlled && !force ? index : Math.min(Math.max(newIndex, 0), size);\n return {\n action: state.action || action,\n controlled: controlled,\n index: nextIndex,\n lifecycle: state.lifecycle || LIFECYCLE.INIT,\n size: state.size || size,\n status: nextIndex === size ? STATUS.FINISHED : state.status || status\n };\n }\n }, {\n key: \"hasUpdatedState\",\n value: function hasUpdatedState(oldState) {\n var before = JSON.stringify(oldState);\n var after = JSON.stringify(this.getState());\n return before !== after;\n }\n }, {\n key: \"getSteps\",\n value: function getSteps() {\n var steps = data.get('steps');\n return Array.isArray(steps) ? steps : [];\n }\n }, {\n key: \"getHelpers\",\n value: function getHelpers() {\n return {\n close: this.close,\n go: this.go,\n info: this.info,\n next: this.next,\n open: this.open,\n prev: this.prev,\n reset: this.reset,\n skip: this.skip\n };\n }\n }]);\n\n return Store;\n }();\n\n return new Store(props);\n}\n\nfunction scrollDoc() {\n return document.scrollingElement || document.createElement('body');\n}\n/**\n * Find the bounding client rect\n *\n * @private\n * @param {HTMLElement} element - The target element\n * @returns {Object}\n */\n\nfunction getClientRect(element) {\n if (!element) {\n return {};\n }\n\n return element.getBoundingClientRect();\n}\n/**\n * Helper function to get the browser-normalized \"document height\"\n * @returns {Number}\n */\n\nfunction getDocumentHeight() {\n var _document = document,\n body = _document.body,\n html = _document.documentElement;\n\n if (!body || !html) {\n return 0;\n }\n\n return Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);\n}\n/**\n * Find and return the target DOM element based on a step's 'target'.\n *\n * @private\n * @param {string|HTMLElement} element\n *\n * @returns {HTMLElement|null}\n */\n\nfunction getElement(element) {\n /* istanbul ignore else */\n if (typeof element === 'string') {\n return document.querySelector(element);\n }\n\n return element;\n}\n/**\n * Get computed style property\n *\n * @param {HTMLElement} el\n *\n * @returns {Object}\n */\n\nfunction getStyleComputedProperty(el) {\n if (!el || el.nodeType !== 1) {\n return {};\n }\n\n return getComputedStyle(el);\n}\n/**\n * Get scroll parent with fix\n *\n * @param {HTMLElement} element\n * @param {boolean} skipFix\n * @param {boolean} [forListener]\n *\n * @returns {*}\n */\n\nfunction getScrollParent(element, skipFix, forListener) {\n var parent = scrollParent(element);\n\n if (parent.isSameNode(scrollDoc())) {\n if (forListener) {\n return document;\n }\n\n return scrollDoc();\n }\n\n var hasScrolling = parent.scrollHeight > parent.offsetHeight;\n /* istanbul ignore else */\n\n if (!hasScrolling && !skipFix) {\n parent.style.overflow = 'initial';\n return scrollDoc();\n }\n\n return parent;\n}\n/**\n * Check if the element has custom scroll parent\n *\n * @param {HTMLElement} element\n * @param {boolean} skipFix\n *\n * @returns {boolean}\n */\n\nfunction hasCustomScrollParent(element, skipFix) {\n if (!element) return false;\n var parent = getScrollParent(element, skipFix);\n return !parent.isSameNode(scrollDoc());\n}\n/**\n * Check if the element has custom offset parent\n *\n * @param {HTMLElement} element\n *\n * @returns {boolean}\n */\n\nfunction hasCustomOffsetParent(element) {\n return element.offsetParent !== document.body;\n}\n/**\n * Check if an element has fixed/sticky position\n * @param {HTMLElement|Node} el\n * @param {string} [type]\n *\n * @returns {boolean}\n */\n\nfunction hasPosition(el) {\n var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'fixed';\n\n if (!el || !(el instanceof HTMLElement)) {\n return false;\n }\n\n var nodeName = el.nodeName;\n\n if (nodeName === 'BODY' || nodeName === 'HTML') {\n return false;\n }\n\n if (getStyleComputedProperty(el).position === type) {\n return true;\n }\n\n return hasPosition(el.parentNode, type);\n}\n/**\n * Check if the element is visible\n *\n * @param {HTMLElement} element\n *\n * @returns {boolean}\n */\n\nfunction isElementVisible(element) {\n if (!element) return false;\n var parentElement = element;\n\n while (parentElement) {\n if (parentElement === document.body) break;\n /* istanbul ignore else */\n\n if (parentElement instanceof HTMLElement) {\n var _getComputedStyle = getComputedStyle(parentElement),\n display = _getComputedStyle.display,\n visibility = _getComputedStyle.visibility;\n\n if (display === 'none' || visibility === 'hidden') {\n return false;\n }\n }\n\n parentElement = parentElement.parentNode;\n }\n\n return true;\n}\n/**\n * Find and return the target DOM element based on a step's 'target'.\n *\n * @private\n * @param {string|HTMLElement} element\n * @param {number} offset\n * @param {boolean} skipFix\n *\n * @returns {HTMLElement|undefined}\n */\n\nfunction getElementPosition(element, offset, skipFix) {\n var elementRect = getClientRect(element);\n var parent = getScrollParent(element, skipFix);\n var hasScrollParent = hasCustomScrollParent(element, skipFix);\n var parentTop = 0;\n /* istanbul ignore else */\n\n if (parent instanceof HTMLElement) {\n parentTop = parent.scrollTop;\n }\n\n var top = elementRect.top + (!hasScrollParent && !hasPosition(element) ? parentTop : 0);\n return Math.floor(top - offset);\n}\n/**\n * Get the offsetTop of each element up to the body\n *\n * @param {HTMLElement} element\n *\n * @returns {number}\n */\n\nfunction getTopOffset(element) {\n if (element instanceof HTMLElement) {\n if (element.offsetParent instanceof HTMLElement) {\n return getTopOffset(element.offsetParent) + element.offsetTop;\n }\n\n return element.offsetTop;\n }\n\n return 0;\n}\n/**\n * Get the scrollTop position\n *\n * @param {HTMLElement} element\n * @param {number} offset\n * @param {boolean} skipFix\n *\n * @returns {number}\n */\n\nfunction getScrollTo(element, offset, skipFix) {\n if (!element) {\n return 0;\n }\n\n var parent = scrollParent(element);\n var top = getTopOffset(element);\n\n if (hasCustomScrollParent(element, skipFix) && !hasCustomOffsetParent(element)) {\n top -= getTopOffset(parent);\n }\n\n return Math.floor(top - offset);\n}\n/**\n * Scroll to position\n * @param {number} value\n * @param {HTMLElement} element\n * @param {number} scrollDuration\n * @returns {Promise<*>}\n */\n\nfunction scrollTo(value) {\n var element = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : scrollDoc();\n var scrollDuration = arguments.length > 2 ? arguments[2] : undefined;\n return new Promise(function (resolve, reject) {\n var scrollTop = element.scrollTop;\n var limit = value > scrollTop ? value - scrollTop : scrollTop - value;\n scroll.top(element, value, {\n duration: limit < 100 ? 50 : scrollDuration\n }, function (error) {\n if (error && error.message !== 'Element already at target scroll position') {\n return reject(error);\n }\n\n return resolve();\n });\n });\n}\n\nfunction createChainableTypeChecker(validate) {\n function checkType(isRequired, props, propName, componentName, location, propFullName) {\n var componentNameSafe = componentName || '<<anonymous>>';\n var propFullNameSafe = propFullName || propName;\n /* istanbul ignore else */\n\n if (props[propName] == null) {\n if (isRequired) {\n return new Error(\"Required \".concat(location, \" `\").concat(propFullNameSafe, \"` was not specified in `\").concat(componentNameSafe, \"`.\"));\n }\n\n return null;\n }\n\n for (var _len = arguments.length, args = new Array(_len > 6 ? _len - 6 : 0), _key = 6; _key < _len; _key++) {\n args[_key - 6] = arguments[_key];\n }\n\n return validate.apply(void 0, [props, propName, componentNameSafe, location, propFullNameSafe].concat(args));\n }\n\n var chainedCheckType = checkType.bind(null, false);\n chainedCheckType.isRequired = checkType.bind(null, true);\n return chainedCheckType;\n}\n\ncreateChainableTypeChecker(function (props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var Component = propValue;\n\n if (! /*#__PURE__*/React.isValidElement(propValue) && isValidElementType(propValue)) {\n var ownProps = {\n ref: function ref() {},\n step: {}\n };\n Component = /*#__PURE__*/React.createElement(Component, ownProps);\n }\n\n if (is.string(propValue) || is.number(propValue) || !isValidElementType(propValue) || !([Element, ForwardRef].indexOf(typeOf(Component)) !== -1)) {\n return new Error(\"Invalid \".concat(location, \" `\").concat(propFullName, \"` supplied to `\").concat(componentName, \"`. Expected a React class or forwardRef.\"));\n }\n\n return undefined;\n});\n\nvar defaultOptions = {\n arrowColor: '#fff',\n backgroundColor: '#fff',\n beaconSize: 36,\n overlayColor: 'rgba(0, 0, 0, 0.5)',\n primaryColor: '#f04',\n spotlightShadow: '0 0 15px rgba(0, 0, 0, 0.5)',\n textColor: '#333',\n zIndex: 100\n};\nvar buttonBase = {\n backgroundColor: 'transparent',\n border: 0,\n borderRadius: 0,\n color: '#555',\n cursor: 'pointer',\n fontSize: 16,\n lineHeight: 1,\n padding: 8,\n WebkitAppearance: 'none'\n};\nvar spotlight = {\n borderRadius: 4,\n position: 'absolute'\n};\nfunction getStyles() {\n var stepStyles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var options = deepmerge(defaultOptions, stepStyles.options || {});\n var width = 290;\n\n if (window.innerWidth > 480) {\n width = 380;\n }\n\n if (options.width) {\n if (window.innerWidth < options.width) {\n width = window.innerWidth - 30;\n } else {\n width = options.width; //eslint-disable-line prefer-destructuring\n }\n }\n\n var overlay = {\n bottom: 0,\n left: 0,\n overflow: 'hidden',\n position: 'absolute',\n right: 0,\n top: 0,\n zIndex: options.zIndex\n };\n var defaultStyles = {\n beacon: _objectSpread2(_objectSpread2({}, buttonBase), {}, {\n display: 'inline-block',\n height: options.beaconSize,\n position: 'relative',\n width: options.beaconSize,\n zIndex: options.zIndex\n }),\n beaconInner: {\n animation: 'joyride-beacon-inner 1.2s infinite ease-in-out',\n backgroundColor: options.primaryColor,\n borderRadius: '50%',\n display: 'block',\n height: '50%',\n left: '50%',\n opacity: 0.7,\n position: 'absolute',\n top: '50%',\n transform: 'translate(-50%, -50%)',\n width: '50%'\n },\n beaconOuter: {\n animation: 'joyride-beacon-outer 1.2s infinite ease-in-out',\n backgroundColor: \"rgba(\".concat(hexToRGB(options.primaryColor).join(','), \", 0.2)\"),\n border: \"2px solid \".concat(options.primaryColor),\n borderRadius: '50%',\n boxSizing: 'border-box',\n display: 'block',\n height: '100%',\n left: 0,\n opacity: 0.9,\n position: 'absolute',\n top: 0,\n transformOrigin: 'center',\n width: '100%'\n },\n tooltip: {\n backgroundColor: options.backgroundColor,\n borderRadius: 5,\n boxSizing: 'border-box',\n color: options.textColor,\n fontSize: 16,\n maxWidth: '100%',\n padding: 15,\n position: 'relative',\n width: width\n },\n tooltipContainer: {\n lineHeight: 1.4,\n textAlign: 'center'\n },\n tooltipTitle: {\n fontSize: 18,\n margin: 0\n },\n tooltipContent: {\n padding: '20px 10px'\n },\n tooltipFooter: {\n alignItems: 'center',\n display: 'flex',\n justifyContent: 'flex-end',\n marginTop: 15\n },\n tooltipFooterSpacer: {\n flex: 1\n },\n buttonNext: _objectSpread2(_objectSpread2({}, buttonBase), {}, {\n backgroundColor: options.primaryColor,\n borderRadius: 4,\n color: '#fff'\n }),\n buttonBack: _objectSpread2(_objectSpread2({}, buttonBase), {}, {\n color: options.primaryColor,\n marginLeft: 'auto',\n marginRight: 5\n }),\n buttonClose: _objectSpread2(_objectSpread2({}, buttonBase), {}, {\n color: options.textColor,\n height: 14,\n padding: 15,\n position: 'absolute',\n right: 0,\n top: 0,\n width: 14\n }),\n buttonSkip: _objectSpread2(_objectSpread2({}, buttonBase), {}, {\n color: options.textColor,\n fontSize: 14\n }),\n overlay: _objectSpread2(_objectSpread2({}, overlay), {}, {\n backgroundColor: options.overlayColor,\n mixBlendMode: 'hard-light'\n }),\n overlayLegacy: _objectSpread2({}, overlay),\n overlayLegacyCenter: _objectSpread2(_objectSpread2({}, overlay), {}, {\n backgroundColor: options.overlayColor\n }),\n spotlight: _objectSpread2(_objectSpread2({}, spotlight), {}, {\n backgroundColor: 'gray'\n }),\n spotlightLegacy: _objectSpread2(_objectSpread2({}, spotlight), {}, {\n boxShadow: \"0 0 0 9999px \".concat(options.overlayColor, \", \").concat(options.spotlightShadow)\n }),\n floaterStyles: {\n arrow: {\n color: options.arrowColor\n },\n options: {\n zIndex: options.zIndex\n }\n },\n options: options\n };\n return deepmerge(defaultStyles, stepStyles);\n}\n\nvar DEFAULTS = {\n floaterProps: {\n options: {\n preventOverflow: {\n boundariesElement: 'scrollParent'\n }\n },\n wrapperOptions: {\n offset: -18,\n position: true\n }\n },\n locale: {\n back: 'Back',\n close: 'Close',\n last: 'Last',\n next: 'Next',\n open: 'Open the dialog',\n skip: 'Skip'\n },\n step: {\n event: 'click',\n placement: 'bottom',\n offset: 10\n }\n};\n\nfunction getTourProps(props) {\n var sharedTourProps = ['beaconComponent', 'disableCloseOnEsc', 'disableOverlay', 'disableOverlayClose', 'disableScrolling', 'disableScrollParentFix', 'floaterProps', 'hideBackButton', 'locale', 'showProgress', 'showSkipButton', 'spotlightClicks', 'spotlightPadding', 'styles', 'tooltipComponent'];\n return Object.keys(props).filter(function (d) {\n return sharedTourProps.indexOf(d) !== -1;\n }).reduce(function (acc, i) {\n acc[i] = props[i]; //eslint-disable-line react/destructuring-assignment\n\n return acc;\n }, {});\n}\n\nfunction getMergedStep(step, props) {\n if (!step) return null;\n var mergedStep = deepmerge.all([getTourProps(props), DEFAULTS.step, step], {\n isMergeableObject: is.plainObject\n });\n var mergedStyles = getStyles(deepmerge(props.styles || {}, step.styles || {}));\n var scrollParent = hasCustomScrollParent(getElement(step.target), mergedStep.disableScrollParentFix);\n var floaterProps = deepmerge.all([props.floaterProps || {}, DEFAULTS.floaterProps, mergedStep.floaterProps || {}]); // Set react-floater props\n\n floaterProps.offset = mergedStep.offset;\n floaterProps.styles = deepmerge(floaterProps.styles || {}, mergedStyles.floaterStyles || {});\n delete mergedStyles.floaterStyles;\n floaterProps.offset += props.spotlightPadding || step.spotlightPadding || 0;\n\n if (step.placementBeacon) {\n floaterProps.wrapperOptions.placement = step.placementBeacon;\n }\n\n if (scrollParent) {\n floaterProps.options.preventOverflow.boundariesElement = 'window';\n }\n\n return _objectSpread2(_objectSpread2({}, mergedStep), {}, {\n locale: deepmerge.all([DEFAULTS.locale, props.locale || {}, mergedStep.locale || {}]),\n floaterProps: floaterProps,\n styles: mergedStyles\n });\n}\n/**\n * Validate if a step is valid\n *\n * @param {Object} step - A step object\n * @param {boolean} debug\n *\n * @returns {boolean} - True if the step is valid, false otherwise\n */\n\nfunction validateStep(step) {\n var debug = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (!is.plainObject(step)) {\n log({\n title: 'validateStep',\n data: 'step must be an object',\n warn: true,\n debug: debug\n });\n return false;\n }\n\n if (!step.target) {\n log({\n title: 'validateStep',\n data: 'target is missing from the step',\n warn: true,\n debug: debug\n });\n return false;\n }\n\n return true;\n}\n/**\n * Validate if steps is valid\n *\n * @param {Array} steps - A steps array\n * @param {boolean} debug\n *\n * @returns {boolean} - True if the steps are valid, false otherwise\n */\n\nfunction validateSteps(steps) {\n var debug = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (!is.array(steps)) {\n log({\n title: 'validateSteps',\n data: 'steps must be an array',\n warn: true,\n debug: debug\n });\n return false;\n }\n\n return steps.every(function (d) {\n return validateStep(d, debug);\n });\n}\n\nvar Scope = function Scope(_element) {\n var _this = this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, Scope);\n\n _defineProperty(this, \"element\", void 0);\n\n _defineProperty(this, \"options\", void 0);\n\n _defineProperty(this, \"canBeTabbed\", function (element) {\n var tabIndex = element.tabIndex;\n if (tabIndex === null || tabIndex < 0) tabIndex = undefined;\n var isTabIndexNaN = isNaN(tabIndex);\n return !isTabIndexNaN && _this.canHaveFocus(element);\n });\n\n _defineProperty(this, \"canHaveFocus\", function (element) {\n var validTabNodes = /input|select|textarea|button|object/;\n var nodeName = element.nodeName.toLowerCase();\n var res = validTabNodes.test(nodeName) && !element.getAttribute('disabled') || nodeName === 'a' && !!element.getAttribute('href');\n return res && _this.isVisible(element);\n });\n\n _defineProperty(this, \"findValidTabElements\", function () {\n return [].slice.call(_this.element.querySelectorAll('*'), 0).filter(_this.canBeTabbed);\n });\n\n _defineProperty(this, \"handleKeyDown\", function (e) {\n var _this$options$keyCode = _this.options.keyCode,\n keyCode = _this$options$keyCode === void 0 ? 9 : _this$options$keyCode;\n /* istanbul ignore else */\n\n if (e.keyCode === keyCode) {\n _this.interceptTab(e);\n }\n });\n\n _defineProperty(this, \"interceptTab\", function (event) {\n event.preventDefault();\n\n var elements = _this.findValidTabElements();\n\n var shiftKey = event.shiftKey;\n\n if (!elements.length) {\n return;\n }\n\n var x = elements.indexOf(document.activeElement);\n\n if (x === -1 || !shiftKey && x + 1 === elements.length) {\n x = 0;\n } else if (shiftKey && x === 0) {\n x = elements.length - 1;\n } else {\n x += shiftKey ? -1 : 1;\n }\n\n elements[x].focus();\n });\n\n _defineProperty(this, \"isHidden\", function (element) {\n var noSize = element.offsetWidth <= 0 && element.offsetHeight <= 0;\n var style = window.getComputedStyle(element);\n if (noSize && !element.innerHTML) return true;\n return noSize && style.getPropertyValue('overflow') !== 'visible' || style.getPropertyValue('display') === 'none';\n });\n\n _defineProperty(this, \"isVisible\", function (element) {\n var parentElement = element;\n\n while (parentElement) {\n /* istanbul ignore else */\n if (parentElement instanceof HTMLElement) {\n if (parentElement === document.body) break;\n /* istanbul ignore else */\n\n if (_this.isHidden(parentElement)) return false;\n parentElement = parentElement.parentNode;\n }\n }\n\n return true;\n });\n\n _defineProperty(this, \"removeScope\", function () {\n window.removeEventListener('keydown', _this.handleKeyDown);\n });\n\n _defineProperty(this, \"checkFocus\", function (target) {\n if (document.activeElement !== target) {\n target.focus();\n window.requestAnimationFrame(function () {\n return _this.checkFocus(target);\n });\n }\n });\n\n _defineProperty(this, \"setFocus\", function () {\n var selector = _this.options.selector;\n if (!selector) return;\n\n var target = _this.element.querySelector(selector);\n /* istanbul ignore else */\n\n\n if (target) {\n window.requestAnimationFrame(function () {\n return _this.checkFocus(target);\n });\n }\n });\n\n if (!(_element instanceof HTMLElement)) {\n throw new TypeError('Invalid parameter: element must be an HTMLElement');\n }\n\n this.element = _element;\n this.options = options;\n window.addEventListener('keydown', this.handleKeyDown, false);\n this.setFocus();\n};\n\nvar JoyrideBeacon = /*#__PURE__*/function (_React$Component) {\n _inherits(JoyrideBeacon, _React$Component);\n\n var _super = _createSuper(JoyrideBeacon);\n\n function JoyrideBeacon(props) {\n var _this;\n\n _classCallCheck(this, JoyrideBeacon);\n\n _this = _super.call(this, props);\n\n _defineProperty(_assertThisInitialized(_this), \"setBeaconRef\", function (c) {\n _this.beacon = c;\n });\n\n if (!props.beaconComponent) {\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n var css = \"\\n @keyframes joyride-beacon-inner {\\n 20% {\\n opacity: 0.9;\\n }\\n \\n 90% {\\n opacity: 0.7;\\n }\\n }\\n \\n @keyframes joyride-beacon-outer {\\n 0% {\\n transform: scale(1);\\n }\\n \\n 45% {\\n opacity: 0.7;\\n transform: scale(0.75);\\n }\\n \\n 100% {\\n opacity: 0.9;\\n transform: scale(1);\\n }\\n }\\n \";\n style.type = 'text/css';\n style.id = 'joyride-beacon-animation';\n\n if (props.nonce !== undefined) {\n style.setAttribute('nonce', props.nonce);\n }\n\n style.appendChild(document.createTextNode(css));\n head.appendChild(style);\n }\n\n return _this;\n }\n\n _createClass(JoyrideBeacon, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this2 = this;\n\n var shouldFocus = this.props.shouldFocus;\n\n setTimeout(function () {\n if (is.domElement(_this2.beacon) && shouldFocus) {\n _this2.beacon.focus();\n }\n }, 0);\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n var style = document.getElementById('joyride-beacon-animation');\n\n if (style) {\n style.parentNode.removeChild(style);\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n beaconComponent = _this$props.beaconComponent,\n locale = _this$props.locale,\n onClickOrHover = _this$props.onClickOrHover,\n styles = _this$props.styles;\n var props = {\n 'aria-label': locale.open,\n onClick: onClickOrHover,\n onMouseEnter: onClickOrHover,\n ref: this.setBeaconRef,\n title: locale.open\n };\n var component;\n\n if (beaconComponent) {\n var BeaconComponent = beaconComponent;\n component = /*#__PURE__*/React.createElement(BeaconComponent, props);\n } else {\n component = /*#__PURE__*/React.createElement(\"button\", _extends({\n key: \"JoyrideBeacon\",\n className: \"react-joyride__beacon\",\n style: styles.beacon,\n type: \"button\"\n }, props), /*#__PURE__*/React.createElement(\"span\", {\n style: styles.beaconInner\n }), /*#__PURE__*/React.createElement(\"span\", {\n style: styles.beaconOuter\n }));\n }\n\n return component;\n }\n }]);\n\n return JoyrideBeacon;\n}(React.Component);\n\nvar JoyrideSpotlight = function JoyrideSpotlight(_ref) {\n var styles = _ref.styles;\n return /*#__PURE__*/React.createElement(\"div\", {\n key: \"JoyrideSpotlight\",\n className: \"react-joyride__spotlight\",\n style: styles\n });\n};\n\nvar _excluded$2 = [\"mixBlendMode\", \"zIndex\"];\n\nvar JoyrideOverlay = /*#__PURE__*/function (_React$Component) {\n _inherits(JoyrideOverlay, _React$Component);\n\n var _super = _createSuper(JoyrideOverlay);\n\n function JoyrideOverlay() {\n var _this;\n\n _classCallCheck(this, JoyrideOverlay);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this].concat(args));\n\n _defineProperty(_assertThisInitialized(_this), \"_isMounted\", false);\n\n _defineProperty(_assertThisInitialized(_this), \"state\", {\n mouseOverSpotlight: false,\n isScrolling: false,\n showSpotlight: true\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleMouseMove\", function (e) {\n var mouseOverSpotlight = _this.state.mouseOverSpotlight;\n var _this$spotlightStyles = _this.spotlightStyles,\n height = _this$spotlightStyles.height,\n left = _this$spotlightStyles.left,\n position = _this$spotlightStyles.position,\n top = _this$spotlightStyles.top,\n width = _this$spotlightStyles.width;\n var offsetY = position === 'fixed' ? e.clientY : e.pageY;\n var offsetX = position === 'fixed' ? e.clientX : e.pageX;\n var inSpotlightHeight = offsetY >= top && offsetY <= top + height;\n var inSpotlightWidth = offsetX >= left && offsetX <= left + width;\n var inSpotlight = inSpotlightWidth && inSpotlightHeight;\n\n if (inSpotlight !== mouseOverSpotlight) {\n _this.updateState({\n mouseOverSpotlight: inSpotlight\n });\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleScroll\", function () {\n var target = _this.props.target;\n var element = getElement(target);\n\n if (_this.scrollParent !== document) {\n var isScrolling = _this.state.isScrolling;\n\n if (!isScrolling) {\n _this.updateState({\n isScrolling: true,\n showSpotlight: false\n });\n }\n\n clearTimeout(_this.scrollTimeout);\n _this.scrollTimeout = setTimeout(function () {\n _this.updateState({\n isScrolling: false,\n showSpotlight: true\n });\n }, 50);\n } else if (hasPosition(element, 'sticky')) {\n _this.updateState({});\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleResize\", function () {\n clearTimeout(_this.resizeTimeout);\n _this.resizeTimeout = setTimeout(function () {\n if (!_this._isMounted) {\n return;\n }\n\n _this.forceUpdate();\n }, 100);\n });\n\n return _this;\n }\n\n _createClass(JoyrideOverlay, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this$props = this.props;\n _this$props.debug;\n _this$props.disableScrolling;\n var disableScrollParentFix = _this$props.disableScrollParentFix,\n target = _this$props.target;\n var element = getElement(target);\n this.scrollParent = getScrollParent(element, disableScrollParentFix, true);\n this._isMounted = true;\n\n window.addEventListener('resize', this.handleResize);\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n var _this2 = this;\n\n var _this$props2 = this.props,\n lifecycle = _this$props2.lifecycle,\n spotlightClicks = _this$props2.spotlightClicks;\n\n var _treeChanges = treeChanges(prevProps, this.props),\n changed = _treeChanges.changed;\n /* istanbul ignore else */\n\n\n if (changed('lifecycle', LIFECYCLE.TOOLTIP)) {\n this.scrollParent.addEventListener('scroll', this.handleScroll, {\n passive: true\n });\n setTimeout(function () {\n var isScrolling = _this2.state.isScrolling;\n\n if (!isScrolling) {\n _this2.updateState({\n showSpotlight: true\n });\n }\n }, 100);\n }\n\n if (changed('spotlightClicks') || changed('disableOverlay') || changed('lifecycle')) {\n if (spotlightClicks && lifecycle === LIFECYCLE.TOOLTIP) {\n window.addEventListener('mousemove', this.handleMouseMove, false);\n } else if (lifecycle !== LIFECYCLE.TOOLTIP) {\n window.removeEventListener('mousemove', this.handleMouseMove);\n }\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this._isMounted = false;\n window.removeEventListener('mousemove', this.handleMouseMove);\n window.removeEventListener('resize', this.handleResize);\n clearTimeout(this.resizeTimeout);\n clearTimeout(this.scrollTimeout);\n this.scrollParent.removeEventListener('scroll', this.handleScroll);\n }\n }, {\n key: \"spotlightStyles\",\n get: function get() {\n var showSpotlight = this.state.showSpotlight;\n var _this$props3 = this.props,\n disableScrollParentFix = _this$props3.disableScrollParentFix,\n spotlightClicks = _this$props3.spotlightClicks,\n spotlightPadding = _this$props3.spotlightPadding,\n styles = _this$props3.styles,\n target = _this$props3.target;\n var element = getElement(target);\n var elementRect = getClientRect(element);\n var isFixedTarget = hasPosition(element);\n var top = getElementPosition(element, spotlightPadding, disableScrollParentFix);\n return _objectSpread2(_objectSpread2({}, isLegacy() ? styles.spotlightLegacy : styles.spotlight), {}, {\n height: Math.round(elementRect.height + spotlightPadding * 2),\n left: Math.round(elementRect.left - spotlightPadding),\n opacity: showSpotlight ? 1 : 0,\n pointerEvents: spotlightClicks ? 'none' : 'auto',\n position: isFixedTarget ? 'fixed' : 'absolute',\n top: top,\n transition: 'opacity 0.2s',\n width: Math.round(elementRect.width + spotlightPadding * 2)\n });\n }\n }, {\n key: \"updateState\",\n value: function updateState(state) {\n if (!this._isMounted) {\n return;\n }\n\n this.setState(state);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$state = this.state,\n mouseOverSpotlight = _this$state.mouseOverSpotlight,\n showSpotlight = _this$state.showSpotlight;\n var _this$props4 = this.props,\n disableOverlay = _this$props4.disableOverlay,\n disableOverlayClose = _this$props4.disableOverlayClose,\n lifecycle = _this$props4.lifecycle,\n onClickOverlay = _this$props4.onClickOverlay,\n placement = _this$props4.placement,\n styles = _this$props4.styles;\n\n if (disableOverlay || lifecycle !== LIFECYCLE.TOOLTIP) {\n return null;\n }\n\n var baseStyles = styles.overlay;\n /* istanbul ignore else */\n\n if (isLegacy()) {\n baseStyles = placement === 'center' ? styles.overlayLegacyCenter : styles.overlayLegacy;\n }\n\n var stylesOverlay = _objectSpread2({\n cursor: disableOverlayClose ? 'default' : 'pointer',\n height: getDocumentHeight(),\n pointerEvents: mouseOverSpotlight ? 'none' : 'auto'\n }, baseStyles);\n\n var spotlight = placement !== 'center' && showSpotlight && /*#__PURE__*/React.createElement(JoyrideSpotlight, {\n styles: this.spotlightStyles\n }); // Hack for Safari bug with mix-blend-mode with z-index\n\n if (getBrowser() === 'safari') {\n stylesOverlay.mixBlendMode;\n stylesOverlay.zIndex;\n var safarOverlay = _objectWithoutProperties(stylesOverlay, _excluded$2);\n\n spotlight = /*#__PURE__*/React.createElement(\"div\", {\n style: _objectSpread2({}, safarOverlay)\n }, spotlight);\n delete stylesOverlay.backgroundColor;\n }\n\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"react-joyride__overlay\",\n style: stylesOverlay,\n onClick: onClickOverlay\n }, spotlight);\n }\n }]);\n\n return JoyrideOverlay;\n}(React.Component);\n\nvar _excluded$1 = [\"styles\"],\n _excluded2 = [\"color\", \"height\", \"width\"];\n\nvar JoyrideTooltipCloseBtn = function JoyrideTooltipCloseBtn(_ref) {\n var styles = _ref.styles,\n props = _objectWithoutProperties(_ref, _excluded$1);\n\n var color = styles.color,\n height = styles.height,\n width = styles.width,\n style = _objectWithoutProperties(styles, _excluded2);\n\n return /*#__PURE__*/React.createElement(\"button\", _extends({\n style: style,\n type: \"button\"\n }, props), /*#__PURE__*/React.createElement(\"svg\", {\n width: typeof width === 'number' ? \"\".concat(width, \"px\") : width,\n height: typeof height === 'number' ? \"\".concat(height, \"px\") : height,\n viewBox: \"0 0 18 18\",\n version: \"1.1\",\n xmlns: \"http://www.w3.org/2000/svg\",\n preserveAspectRatio: \"xMidYMid\"\n }, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M8.13911129,9.00268191 L0.171521827,17.0258467 C-0.0498027049,17.248715 -0.0498027049,17.6098394 0.171521827,17.8327545 C0.28204354,17.9443526 0.427188206,17.9998706 0.572051765,17.9998706 C0.71714958,17.9998706 0.862013139,17.9443526 0.972581703,17.8327545 L9.0000937,9.74924618 L17.0276057,17.8327545 C17.1384085,17.9443526 17.2832721,17.9998706 17.4281356,17.9998706 C17.5729992,17.9998706 17.718097,17.9443526 17.8286656,17.8327545 C18.0499901,17.6098862 18.0499901,17.2487618 17.8286656,17.0258467 L9.86135722,9.00268191 L17.8340066,0.973848225 C18.0553311,0.750979934 18.0553311,0.389855532 17.8340066,0.16694039 C17.6126821,-0.0556467968 17.254037,-0.0556467968 17.0329467,0.16694039 L9.00042166,8.25611765 L0.967006424,0.167268345 C0.745681892,-0.0553188426 0.387317931,-0.0553188426 0.165993399,0.167268345 C-0.0553311331,0.390136635 -0.0553311331,0.751261038 0.165993399,0.974176179 L8.13920499,9.00268191 L8.13911129,9.00268191 Z\",\n fill: color\n }))));\n};\n\nvar JoyrideTooltipContainer = /*#__PURE__*/function (_React$Component) {\n _inherits(JoyrideTooltipContainer, _React$Component);\n\n var _super = _createSuper(JoyrideTooltipContainer);\n\n function JoyrideTooltipContainer() {\n _classCallCheck(this, JoyrideTooltipContainer);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(JoyrideTooltipContainer, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n backProps = _this$props.backProps,\n closeProps = _this$props.closeProps,\n continuous = _this$props.continuous,\n index = _this$props.index,\n isLastStep = _this$props.isLastStep,\n primaryProps = _this$props.primaryProps,\n size = _this$props.size,\n skipProps = _this$props.skipProps,\n step = _this$props.step,\n tooltipProps = _this$props.tooltipProps;\n var content = step.content,\n hideBackButton = step.hideBackButton,\n hideCloseButton = step.hideCloseButton,\n hideFooter = step.hideFooter,\n showProgress = step.showProgress,\n showSkipButton = step.showSkipButton,\n title = step.title,\n styles = step.styles;\n var _step$locale = step.locale,\n back = _step$locale.back,\n close = _step$locale.close,\n last = _step$locale.last,\n next = _step$locale.next,\n skip = _step$locale.skip;\n var output = {\n primary: close\n };\n\n if (continuous) {\n output.primary = isLastStep ? last : next;\n\n if (showProgress) {\n output.primary = /*#__PURE__*/React.createElement(\"span\", null, output.primary, \" (\", index + 1, \"/\", size, \")\");\n }\n }\n\n if (showSkipButton && !isLastStep) {\n output.skip = /*#__PURE__*/React.createElement(\"button\", _extends({\n style: styles.buttonSkip,\n type: \"button\",\n \"aria-live\": \"off\"\n }, skipProps), skip);\n }\n\n if (!hideBackButton && index > 0) {\n output.back = /*#__PURE__*/React.createElement(\"button\", _extends({\n style: styles.buttonBack,\n type: \"button\"\n }, backProps), back);\n }\n\n output.close = !hideCloseButton && /*#__PURE__*/React.createElement(JoyrideTooltipCloseBtn, _extends({\n styles: styles.buttonClose\n }, closeProps));\n return /*#__PURE__*/React.createElement(\"div\", _extends({\n key: \"JoyrideTooltip\",\n className: \"react-joyride__tooltip\",\n style: styles.tooltip\n }, tooltipProps), /*#__PURE__*/React.createElement(\"div\", {\n style: styles.tooltipContainer\n }, title && /*#__PURE__*/React.createElement(\"h4\", {\n style: styles.tooltipTitle,\n \"aria-label\": title\n }, title), /*#__PURE__*/React.createElement(\"div\", {\n style: styles.tooltipContent\n }, content)), !hideFooter && /*#__PURE__*/React.createElement(\"div\", {\n style: styles.tooltipFooter\n }, /*#__PURE__*/React.createElement(\"div\", {\n style: styles.tooltipFooterSpacer\n }, output.skip), output.back, /*#__PURE__*/React.createElement(\"button\", _extends({\n style: styles.buttonNext,\n type: \"button\"\n }, primaryProps), output.primary)), output.close);\n }\n }]);\n\n return JoyrideTooltipContainer;\n}(React.Component);\n\nvar _excluded = [\"beaconComponent\", \"tooltipComponent\"];\n\nvar JoyrideTooltip = /*#__PURE__*/function (_React$Component) {\n _inherits(JoyrideTooltip, _React$Component);\n\n var _super = _createSuper(JoyrideTooltip);\n\n function JoyrideTooltip() {\n var _this;\n\n _classCallCheck(this, JoyrideTooltip);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this].concat(args));\n\n _defineProperty(_assertThisInitialized(_this), \"handleClickBack\", function (e) {\n e.preventDefault();\n var helpers = _this.props.helpers;\n helpers.prev();\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleClickClose\", function (e) {\n e.preventDefault();\n var helpers = _this.props.helpers;\n helpers.close();\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleClickPrimary\", function (e) {\n e.preventDefault();\n var _this$props = _this.props,\n continuous = _this$props.continuous,\n helpers = _this$props.helpers;\n\n if (!continuous) {\n helpers.close();\n return;\n }\n\n helpers.next();\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleClickSkip\", function (e) {\n e.preventDefault();\n var helpers = _this.props.helpers;\n helpers.skip();\n });\n\n _defineProperty(_assertThisInitialized(_this), \"getElementsProps\", function () {\n var _this$props2 = _this.props,\n continuous = _this$props2.continuous,\n isLastStep = _this$props2.isLastStep,\n setTooltipRef = _this$props2.setTooltipRef,\n step = _this$props2.step;\n var back = getText(step.locale.back);\n var close = getText(step.locale.close);\n var last = getText(step.locale.last);\n var next = getText(step.locale.next);\n var skip = getText(step.locale.skip);\n var primaryText = continuous ? next : close;\n\n if (isLastStep) {\n primaryText = last;\n }\n\n return {\n backProps: {\n 'aria-label': back,\n 'data-action': 'back',\n onClick: _this.handleClickBack,\n role: 'button',\n title: back\n },\n closeProps: {\n 'aria-label': close,\n 'data-action': 'close',\n onClick: _this.handleClickClose,\n role: 'button',\n title: close\n },\n primaryProps: {\n 'aria-label': primaryText,\n 'data-action': 'primary',\n onClick: _this.handleClickPrimary,\n role: 'button',\n title: primaryText\n },\n skipProps: {\n 'aria-label': skip,\n 'data-action': 'skip',\n onClick: _this.handleClickSkip,\n role: 'button',\n title: skip\n },\n tooltipProps: {\n 'aria-modal': true,\n ref: setTooltipRef,\n role: 'alertdialog'\n }\n };\n });\n\n return _this;\n }\n\n _createClass(JoyrideTooltip, [{\n key: \"render\",\n value: function render() {\n var _this$props3 = this.props,\n continuous = _this$props3.continuous,\n index = _this$props3.index,\n isLastStep = _this$props3.isLastStep,\n size = _this$props3.size,\n step = _this$props3.step;\n\n step.beaconComponent;\n var tooltipComponent = step.tooltipComponent,\n cleanStep = _objectWithoutProperties(step, _excluded);\n\n var component;\n\n if (tooltipComponent) {\n var renderProps = _objectSpread2(_objectSpread2({}, this.getElementsProps()), {}, {\n continuous: continuous,\n index: index,\n isLastStep: isLastStep,\n size: size,\n step: cleanStep\n });\n\n var TooltipComponent = tooltipComponent;\n component = /*#__PURE__*/React.createElement(TooltipComponent, renderProps);\n } else {\n component = /*#__PURE__*/React.createElement(JoyrideTooltipContainer, _extends({}, this.getElementsProps(), {\n continuous: continuous,\n index: index,\n isLastStep: isLastStep,\n size: size,\n step: step\n }));\n }\n\n return component;\n }\n }]);\n\n return JoyrideTooltip;\n}(React.Component);\n\nvar JoyridePortal = /*#__PURE__*/function (_React$Component) {\n _inherits(JoyridePortal, _React$Component);\n\n var _super = _createSuper(JoyridePortal);\n\n function JoyridePortal(props) {\n var _this;\n\n _classCallCheck(this, JoyridePortal);\n\n _this = _super.call(this, props);\n if (!canUseDOM) return _possibleConstructorReturn(_this);\n _this.node = document.createElement('div');\n /* istanbul ignore else */\n\n if (props.id) {\n _this.node.id = props.id;\n }\n\n document.body.appendChild(_this.node);\n return _this;\n }\n\n _createClass(JoyridePortal, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n if (!canUseDOM) return;\n\n if (!isReact16) {\n this.renderReact15();\n }\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate() {\n if (!canUseDOM) return;\n\n if (!isReact16) {\n this.renderReact15();\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n if (!canUseDOM || !this.node) return;\n\n if (!isReact16) {\n ReactDOM.unmountComponentAtNode(this.node);\n }\n\n document.body.removeChild(this.node);\n }\n }, {\n key: \"renderReact15\",\n value: function renderReact15() {\n if (!canUseDOM) return null;\n var children = this.props.children;\n ReactDOM.unstable_renderSubtreeIntoContainer(this, children, this.node);\n return null;\n }\n }, {\n key: \"renderReact16\",\n value: function renderReact16() {\n if (!canUseDOM || !isReact16) return null;\n var children = this.props.children;\n return /*#__PURE__*/ReactDOM.createPortal(children, this.node);\n }\n }, {\n key: \"render\",\n value: function render() {\n if (!isReact16) {\n return null;\n }\n\n return this.renderReact16();\n }\n }]);\n\n return JoyridePortal;\n}(React.Component);\n\nvar JoyrideStep = /*#__PURE__*/function (_React$Component) {\n _inherits(JoyrideStep, _React$Component);\n\n var _super = _createSuper(JoyrideStep);\n\n function JoyrideStep() {\n var _this;\n\n _classCallCheck(this, JoyrideStep);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this].concat(args));\n\n _defineProperty(_assertThisInitialized(_this), \"scope\", {\n removeScope: function removeScope() {}\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleClickHoverBeacon\", function (e) {\n var _this$props = _this.props,\n step = _this$props.step,\n update = _this$props.update;\n\n if (e.type === 'mouseenter' && step.event !== 'hover') {\n return;\n }\n\n update({\n lifecycle: LIFECYCLE.TOOLTIP\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleClickOverlay\", function () {\n var _this$props2 = _this.props,\n helpers = _this$props2.helpers,\n step = _this$props2.step;\n\n if (!step.disableOverlayClose) {\n helpers.close();\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"setTooltipRef\", function (c) {\n _this.tooltip = c;\n });\n\n _defineProperty(_assertThisInitialized(_this), \"setPopper\", function (popper, type) {\n var _this$props3 = _this.props,\n action = _this$props3.action,\n setPopper = _this$props3.setPopper,\n update = _this$props3.update;\n\n if (type === 'wrapper') {\n _this.beaconPopper = popper;\n } else {\n _this.tooltipPopper = popper;\n }\n\n setPopper(popper, type);\n\n if (_this.beaconPopper && _this.tooltipPopper) {\n update({\n action: action === ACTIONS.CLOSE ? ACTIONS.CLOSE : action,\n lifecycle: LIFECYCLE.READY\n });\n }\n });\n\n return _this;\n }\n\n _createClass(JoyrideStep, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this$props4 = this.props,\n debug = _this$props4.debug,\n index = _this$props4.index;\n log({\n title: \"step:\".concat(index),\n data: [{\n key: 'props',\n value: this.props\n }],\n debug: debug\n });\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n var _this$props5 = this.props,\n action = _this$props5.action,\n callback = _this$props5.callback,\n continuous = _this$props5.continuous,\n controlled = _this$props5.controlled,\n debug = _this$props5.debug,\n index = _this$props5.index,\n lifecycle = _this$props5.lifecycle,\n size = _this$props5.size,\n status = _this$props5.status,\n step = _this$props5.step,\n update = _this$props5.update;\n\n var _treeChanges = treeChanges(prevProps, this.props),\n changed = _treeChanges.changed,\n changedFrom = _treeChanges.changedFrom;\n\n var state = {\n action: action,\n controlled: controlled,\n index: index,\n lifecycle: lifecycle,\n size: size,\n status: status\n };\n var skipBeacon = continuous && action !== ACTIONS.CLOSE && (index > 0 || action === ACTIONS.PREV);\n var hasStoreChanged = changed('action') || changed('index') || changed('lifecycle') || changed('status');\n var hasStarted = changedFrom('lifecycle', [LIFECYCLE.TOOLTIP, LIFECYCLE.INIT], LIFECYCLE.INIT);\n var isAfterAction = changed('action', [ACTIONS.NEXT, ACTIONS.PREV, ACTIONS.SKIP, ACTIONS.CLOSE]);\n\n if (isAfterAction && (hasStarted || controlled)) {\n callback(_objectSpread2(_objectSpread2({}, state), {}, {\n index: prevProps.index,\n lifecycle: LIFECYCLE.COMPLETE,\n step: prevProps.step,\n type: EVENTS.STEP_AFTER\n }));\n } // There's a step to use, but there's no target in the DOM\n\n\n if (hasStoreChanged && step) {\n var element = getElement(step.target);\n var elementExists = !!element;\n var hasRenderedTarget = elementExists && isElementVisible(element);\n\n if (hasRenderedTarget) {\n if (changedFrom('status', STATUS.READY, STATUS.RUNNING) || changedFrom('lifecycle', LIFECYCLE.INIT, LIFECYCLE.READY)) {\n callback(_objectSpread2(_objectSpread2({}, state), {}, {\n step: step,\n type: EVENTS.STEP_BEFORE\n }));\n }\n } else {\n console.warn(elementExists ? 'Target not visible' : 'Target not mounted', step); //eslint-disable-line no-console\n\n callback(_objectSpread2(_objectSpread2({}, state), {}, {\n type: EVENTS.TARGET_NOT_FOUND,\n step: step\n }));\n\n if (!controlled) {\n update({\n index: index + ([ACTIONS.PREV].indexOf(action) !== -1 ? -1 : 1)\n });\n }\n }\n }\n\n if (changedFrom('lifecycle', LIFECYCLE.INIT, LIFECYCLE.READY)) {\n update({\n lifecycle: hideBeacon(step) || skipBeacon ? LIFECYCLE.TOOLTIP : LIFECYCLE.BEACON\n });\n }\n\n if (changed('index')) {\n log({\n title: \"step:\".concat(lifecycle),\n data: [{\n key: 'props',\n value: this.props\n }],\n debug: debug\n });\n }\n /* istanbul ignore else */\n\n\n if (changed('lifecycle', LIFECYCLE.BEACON)) {\n callback(_objectSpread2(_objectSpread2({}, state), {}, {\n step: step,\n type: EVENTS.BEACON\n }));\n }\n\n if (changed('lifecycle', LIFECYCLE.TOOLTIP)) {\n callback(_objectSpread2(_objectSpread2({}, state), {}, {\n step: step,\n type: EVENTS.TOOLTIP\n }));\n this.scope = new Scope(this.tooltip, {\n selector: '[data-action=primary]'\n });\n this.scope.setFocus();\n }\n\n if (changedFrom('lifecycle', [LIFECYCLE.TOOLTIP, LIFECYCLE.INIT], LIFECYCLE.INIT)) {\n this.scope.removeScope();\n delete this.beaconPopper;\n delete this.tooltipPopper;\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.scope.removeScope();\n }\n /**\n * Beacon click/hover event listener\n *\n * @param {Event} e\n */\n\n }, {\n key: \"open\",\n get: function get() {\n var _this$props6 = this.props,\n step = _this$props6.step,\n lifecycle = _this$props6.lifecycle;\n return !!(hideBeacon(step) || lifecycle === LIFECYCLE.TOOLTIP);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props7 = this.props,\n continuous = _this$props7.continuous,\n debug = _this$props7.debug,\n helpers = _this$props7.helpers,\n index = _this$props7.index,\n lifecycle = _this$props7.lifecycle,\n nonce = _this$props7.nonce,\n shouldScroll = _this$props7.shouldScroll,\n size = _this$props7.size,\n step = _this$props7.step;\n var target = getElement(step.target);\n\n if (!validateStep(step) || !is.domElement(target)) {\n return null;\n }\n\n return /*#__PURE__*/React.createElement(\"div\", {\n key: \"JoyrideStep-\".concat(index),\n className: \"react-joyride__step\"\n }, /*#__PURE__*/React.createElement(JoyridePortal, {\n id: \"react-joyride-portal\"\n }, /*#__PURE__*/React.createElement(JoyrideOverlay, _extends({}, step, {\n debug: debug,\n lifecycle: lifecycle,\n onClickOverlay: this.handleClickOverlay\n }))), /*#__PURE__*/React.createElement(Floater, _extends({\n component: /*#__PURE__*/React.createElement(JoyrideTooltip, {\n continuous: continuous,\n helpers: helpers,\n index: index,\n isLastStep: index + 1 === size,\n setTooltipRef: this.setTooltipRef,\n size: size,\n step: step\n }),\n debug: debug,\n getPopper: this.setPopper,\n id: \"react-joyride-step-\".concat(index),\n isPositioned: step.isFixed || hasPosition(target),\n open: this.open,\n placement: step.placement,\n target: step.target\n }, step.floaterProps), /*#__PURE__*/React.createElement(JoyrideBeacon, {\n beaconComponent: step.beaconComponent,\n locale: step.locale,\n nonce: nonce,\n onClickOrHover: this.handleClickHoverBeacon,\n shouldFocus: shouldScroll,\n styles: step.styles\n })));\n }\n }]);\n\n return JoyrideStep;\n}(React.Component);\n\nvar Joyride = /*#__PURE__*/function (_React$Component) {\n _inherits(Joyride, _React$Component);\n\n var _super = _createSuper(Joyride);\n\n function Joyride(props) {\n var _this;\n\n _classCallCheck(this, Joyride);\n\n _this = _super.call(this, props);\n\n _defineProperty(_assertThisInitialized(_this), \"initStore\", function () {\n var _this$props = _this.props,\n debug = _this$props.debug,\n getHelpers = _this$props.getHelpers,\n run = _this$props.run,\n stepIndex = _this$props.stepIndex;\n _this.store = new createStore(_objectSpread2(_objectSpread2({}, _this.props), {}, {\n controlled: run && is.number(stepIndex)\n }));\n _this.helpers = _this.store.getHelpers();\n var addListener = _this.store.addListener;\n log({\n title: 'init',\n data: [{\n key: 'props',\n value: _this.props\n }, {\n key: 'state',\n value: _this.state\n }],\n debug: debug\n }); // Sync the store to this component's state.\n\n addListener(_this.syncState);\n getHelpers(_this.helpers);\n return _this.store.getState();\n });\n\n _defineProperty(_assertThisInitialized(_this), \"callback\", function (data) {\n var callback = _this.props.callback;\n /* istanbul ignore else */\n\n if (is[\"function\"](callback)) {\n callback(data);\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleKeyboard\", function (e) {\n var _this$state = _this.state,\n index = _this$state.index,\n lifecycle = _this$state.lifecycle;\n var steps = _this.props.steps;\n var step = steps[index];\n var intKey = window.Event ? e.which : e.keyCode;\n\n if (lifecycle === LIFECYCLE.TOOLTIP) {\n if (intKey === 27 && step && !step.disableCloseOnEsc) {\n _this.store.close();\n }\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"syncState\", function (state) {\n _this.setState(state);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"setPopper\", function (popper, type) {\n if (type === 'wrapper') {\n _this.beaconPopper = popper;\n } else {\n _this.tooltipPopper = popper;\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"shouldScroll\", function (disableScrolling, index, scrollToFirstStep, lifecycle, step, target, prevState) {\n return !disableScrolling && (index !== 0 || scrollToFirstStep || lifecycle === LIFECYCLE.TOOLTIP) && step.placement !== 'center' && (!step.isFixed || !hasPosition(target)) && // fixed steps don't need to scroll\n prevState.lifecycle !== lifecycle && [LIFECYCLE.BEACON, LIFECYCLE.TOOLTIP].indexOf(lifecycle) !== -1;\n });\n\n _this.state = _this.initStore();\n return _this;\n }\n\n _createClass(Joyride, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n if (!canUseDOM) return;\n var _this$props2 = this.props,\n disableCloseOnEsc = _this$props2.disableCloseOnEsc,\n debug = _this$props2.debug,\n run = _this$props2.run,\n steps = _this$props2.steps;\n var start = this.store.start;\n\n if (validateSteps(steps, debug) && run) {\n start();\n }\n /* istanbul ignore else */\n\n\n if (!disableCloseOnEsc) {\n document.body.addEventListener('keydown', this.handleKeyboard, {\n passive: true\n });\n }\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps, prevState) {\n if (!canUseDOM) return;\n var _this$state2 = this.state,\n action = _this$state2.action,\n controlled = _this$state2.controlled,\n index = _this$state2.index,\n lifecycle = _this$state2.lifecycle,\n status = _this$state2.status;\n var _this$props3 = this.props,\n debug = _this$props3.debug,\n run = _this$props3.run,\n stepIndex = _this$props3.stepIndex,\n steps = _this$props3.steps;\n var prevSteps = prevProps.steps,\n prevStepIndex = prevProps.stepIndex;\n var _this$store = this.store,\n setSteps = _this$store.setSteps,\n reset = _this$store.reset,\n start = _this$store.start,\n stop = _this$store.stop,\n update = _this$store.update;\n\n var _treeChanges = treeChanges(prevProps, this.props),\n changedProps = _treeChanges.changed;\n\n var _treeChanges2 = treeChanges(prevState, this.state),\n changed = _treeChanges2.changed,\n changedFrom = _treeChanges2.changedFrom;\n\n var step = getMergedStep(steps[index], this.props);\n var stepsChanged = !isEqual(prevSteps, steps);\n var stepIndexChanged = is.number(stepIndex) && changedProps('stepIndex');\n var target = getElement(step === null || step === void 0 ? void 0 : step.target);\n\n if (stepsChanged) {\n if (validateSteps(steps, debug)) {\n setSteps(steps);\n } else {\n console.warn('Steps are not valid', steps); //eslint-disable-line no-console\n }\n }\n /* istanbul ignore else */\n\n\n if (changedProps('run')) {\n if (run) {\n start(stepIndex);\n } else {\n stop();\n }\n }\n /* istanbul ignore else */\n\n\n if (stepIndexChanged) {\n var nextAction = prevStepIndex < stepIndex ? ACTIONS.NEXT : ACTIONS.PREV;\n\n if (action === ACTIONS.STOP) {\n nextAction = ACTIONS.START;\n }\n\n if (!([STATUS.FINISHED, STATUS.SKIPPED].indexOf(status) !== -1)) {\n update({\n action: action === ACTIONS.CLOSE ? ACTIONS.CLOSE : nextAction,\n index: stepIndex,\n lifecycle: LIFECYCLE.INIT\n });\n }\n } // Update the index if the first step is not found\n\n\n if (!controlled && status === STATUS.RUNNING && index === 0 && !target) {\n this.store.update({\n index: index + 1\n });\n this.callback(_objectSpread2(_objectSpread2({}, this.state), {}, {\n type: EVENTS.TARGET_NOT_FOUND,\n step: step\n }));\n }\n\n var callbackData = _objectSpread2(_objectSpread2({}, this.state), {}, {\n index: index,\n step: step\n });\n\n var isAfterAction = changed('action', [ACTIONS.NEXT, ACTIONS.PREV, ACTIONS.SKIP, ACTIONS.CLOSE]);\n\n if (isAfterAction && changed('status', STATUS.PAUSED)) {\n var prevStep = getMergedStep(steps[prevState.index], this.props);\n this.callback(_objectSpread2(_objectSpread2({}, callbackData), {}, {\n index: prevState.index,\n lifecycle: LIFECYCLE.COMPLETE,\n step: prevStep,\n type: EVENTS.STEP_AFTER\n }));\n }\n\n if (changed('status', [STATUS.FINISHED, STATUS.SKIPPED])) {\n var _prevStep = getMergedStep(steps[prevState.index], this.props);\n\n if (!controlled) {\n this.callback(_objectSpread2(_objectSpread2({}, callbackData), {}, {\n index: prevState.index,\n lifecycle: LIFECYCLE.COMPLETE,\n step: _prevStep,\n type: EVENTS.STEP_AFTER\n }));\n }\n\n this.callback(_objectSpread2(_objectSpread2({}, callbackData), {}, {\n type: EVENTS.TOUR_END,\n // Return the last step when the tour is finished\n step: _prevStep,\n index: prevState.index\n }));\n reset();\n } else if (changedFrom('status', [STATUS.IDLE, STATUS.READY], STATUS.RUNNING)) {\n this.callback(_objectSpread2(_objectSpread2({}, callbackData), {}, {\n type: EVENTS.TOUR_START\n }));\n } else if (changed('status')) {\n this.callback(_objectSpread2(_objectSpread2({}, callbackData), {}, {\n type: EVENTS.TOUR_STATUS\n }));\n } else if (changed('action', ACTIONS.RESET)) {\n this.callback(_objectSpread2(_objectSpread2({}, callbackData), {}, {\n type: EVENTS.TOUR_STATUS\n }));\n }\n\n if (step) {\n this.scrollToStep(prevState);\n\n if (step.placement === 'center' && status === STATUS.RUNNING && lifecycle === LIFECYCLE.INIT) {\n this.store.update({\n lifecycle: LIFECYCLE.READY\n });\n }\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n var disableCloseOnEsc = this.props.disableCloseOnEsc;\n /* istanbul ignore else */\n\n if (!disableCloseOnEsc) {\n document.body.removeEventListener('keydown', this.handleKeyboard);\n }\n }\n }, {\n key: \"scrollToStep\",\n value: function scrollToStep(prevState) {\n var _this$state3 = this.state,\n index = _this$state3.index,\n lifecycle = _this$state3.lifecycle,\n status = _this$state3.status;\n var _this$props4 = this.props,\n debug = _this$props4.debug,\n disableScrolling = _this$props4.disableScrolling,\n disableScrollParentFix = _this$props4.disableScrollParentFix,\n scrollToFirstStep = _this$props4.scrollToFirstStep,\n scrollOffset = _this$props4.scrollOffset,\n scrollDuration = _this$props4.scrollDuration,\n steps = _this$props4.steps;\n var step = getMergedStep(steps[index], this.props);\n /* istanbul ignore else */\n\n if (step) {\n var target = getElement(step.target);\n var shouldScroll = this.shouldScroll(disableScrolling, index, scrollToFirstStep, lifecycle, step, target, prevState);\n\n if (status === STATUS.RUNNING && shouldScroll) {\n var hasCustomScroll = hasCustomScrollParent(target, disableScrollParentFix);\n var scrollParent = getScrollParent(target, disableScrollParentFix);\n var scrollY = Math.floor(getScrollTo(target, scrollOffset, disableScrollParentFix)) || 0;\n log({\n title: 'scrollToStep',\n data: [{\n key: 'index',\n value: index\n }, {\n key: 'lifecycle',\n value: lifecycle\n }, {\n key: 'status',\n value: status\n }],\n debug: debug\n });\n /* istanbul ignore else */\n\n if (lifecycle === LIFECYCLE.BEACON && this.beaconPopper) {\n var _this$beaconPopper = this.beaconPopper,\n placement = _this$beaconPopper.placement,\n popper = _this$beaconPopper.popper;\n /* istanbul ignore else */\n\n if (!(['bottom'].indexOf(placement) !== -1) && !hasCustomScroll) {\n scrollY = Math.floor(popper.top - scrollOffset);\n }\n } else if (lifecycle === LIFECYCLE.TOOLTIP && this.tooltipPopper) {\n var _this$tooltipPopper = this.tooltipPopper,\n flipped = _this$tooltipPopper.flipped,\n _placement = _this$tooltipPopper.placement,\n _popper = _this$tooltipPopper.popper;\n\n if (['top', 'right', 'left'].indexOf(_placement) !== -1 && !flipped && !hasCustomScroll) {\n scrollY = Math.floor(_popper.top - scrollOffset);\n } else {\n scrollY -= step.spotlightPadding;\n }\n }\n\n scrollY = scrollY >= 0 ? scrollY : 0;\n /* istanbul ignore else */\n\n if (status === STATUS.RUNNING) {\n scrollTo(scrollY, scrollParent, scrollDuration);\n }\n }\n }\n }\n /**\n * Trigger the callback.\n *\n * @private\n * @param {Object} data\n */\n\n }, {\n key: \"render\",\n value: function render() {\n if (!canUseDOM) return null;\n var _this$state4 = this.state,\n index = _this$state4.index,\n status = _this$state4.status;\n var _this$props5 = this.props,\n continuous = _this$props5.continuous,\n debug = _this$props5.debug,\n nonce = _this$props5.nonce,\n scrollToFirstStep = _this$props5.scrollToFirstStep,\n steps = _this$props5.steps;\n var step = getMergedStep(steps[index], this.props);\n var output;\n\n if (status === STATUS.RUNNING && step) {\n output = /*#__PURE__*/React.createElement(JoyrideStep, _extends({}, this.state, {\n callback: this.callback,\n continuous: continuous,\n debug: debug,\n setPopper: this.setPopper,\n helpers: this.helpers,\n nonce: nonce,\n shouldScroll: !step.disableScrolling && (index !== 0 || scrollToFirstStep),\n step: step,\n update: this.store.update\n }));\n }\n\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"react-joyride\"\n }, output);\n }\n }]);\n\n return Joyride;\n}(React.Component);\n\n_defineProperty(Joyride, \"defaultProps\", {\n continuous: false,\n debug: false,\n disableCloseOnEsc: false,\n disableOverlay: false,\n disableOverlayClose: false,\n disableScrolling: false,\n disableScrollParentFix: false,\n getHelpers: function getHelpers() {},\n hideBackButton: false,\n run: true,\n scrollOffset: 20,\n scrollDuration: 300,\n scrollToFirstStep: false,\n showSkipButton: false,\n showProgress: false,\n spotlightClicks: false,\n spotlightPadding: 10,\n steps: []\n});\n\nexport { ACTIONS, EVENTS, LIFECYCLE, STATUS, Joyride as default };\n","/** @license React v16.13.1\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","const VALIDATOR_ARG_ERROR_MESSAGE =\n 'The typeValidator argument must be a function ' +\n 'with the signature function(props, propName, componentName).';\n\nconst MESSAGE_ARG_ERROR_MESSAGE =\n 'The error message is optional, but must be a string if provided.';\n\nconst propIsRequired = (condition, props, propName, componentName) => {\n if (typeof condition === 'boolean') {\n return condition;\n } else if (typeof condition === 'function') {\n return condition(props, propName, componentName);\n } else if (Boolean(condition) === true) {\n return Boolean(condition);\n }\n\n return false;\n};\n\nconst propExists = (props, propName) => Object.hasOwnProperty.call(props, propName);\n\nconst missingPropError = (props, propName, componentName, message) => {\n if (message) {\n return new Error(message);\n }\n\n return new Error(\n `Required ${props[propName]} \\`${propName}\\`` +\n ` was not specified in \\`${componentName}\\`.`,\n );\n};\n\nconst guardAgainstInvalidArgTypes = (typeValidator, message) => {\n if (typeof typeValidator !== 'function') {\n throw new TypeError(VALIDATOR_ARG_ERROR_MESSAGE);\n }\n\n if (Boolean(message) && typeof message !== 'string') {\n throw new TypeError(MESSAGE_ARG_ERROR_MESSAGE);\n }\n};\n\nconst isRequiredIf = (typeValidator, condition, message) => {\n guardAgainstInvalidArgTypes(typeValidator, message);\n\n return (props, propName, componentName, ...rest) => {\n if (propIsRequired(condition, props, propName, componentName)) {\n if (propExists(props, propName)) {\n return typeValidator(props, propName, componentName, ...rest);\n }\n\n return missingPropError(props, propName, componentName, message);\n }\n\n // Is not required, so just run typeValidator.\n return typeValidator(props, propName, componentName, ...rest);\n };\n};\n\nexport default isRequiredIf;\n","var E_NOSCROLL = new Error('Element already at target scroll position')\nvar E_CANCELLED = new Error('Scroll cancelled')\nvar min = Math.min\nvar ms = Date.now\n\nmodule.exports = {\n left: make('scrollLeft'),\n top: make('scrollTop')\n}\n\nfunction make (prop) {\n return function scroll (el, to, opts, cb) {\n opts = opts || {}\n\n if (typeof opts == 'function') cb = opts, opts = {}\n if (typeof cb != 'function') cb = noop\n\n var start = ms()\n var from = el[prop]\n var ease = opts.ease || inOutSine\n var duration = !isNaN(opts.duration) ? +opts.duration : 350\n var cancelled = false\n\n return from === to ?\n cb(E_NOSCROLL, el[prop]) :\n requestAnimationFrame(animate), cancel\n\n function cancel () {\n cancelled = true\n }\n\n function animate (timestamp) {\n if (cancelled) return cb(E_CANCELLED, el[prop])\n\n var now = ms()\n var time = min(1, ((now - start) / duration))\n var eased = ease(time)\n\n el[prop] = (eased * (to - from)) + from\n\n time < 1 ?\n requestAnimationFrame(animate) :\n requestAnimationFrame(function () {\n cb(null, el[prop])\n })\n }\n }\n}\n\nfunction inOutSine (n) {\n return 0.5 * (1 - Math.cos(Math.PI * n))\n}\n\nfunction noop () {}\n","(function (root, factory) {\n if (typeof define === \"function\" && define.amd) {\n define([], factory);\n } else if (typeof module === \"object\" && module.exports) {\n module.exports = factory();\n } else {\n root.Scrollparent = factory();\n }\n}(this, function () {\n var regex = /(auto|scroll)/;\n\n var parents = function (node, ps) {\n if (node.parentNode === null) { return ps; }\n\n return parents(node.parentNode, ps.concat([node]));\n };\n\n var style = function (node, prop) {\n return getComputedStyle(node, null).getPropertyValue(prop);\n };\n\n var overflow = function (node) {\n return style(node, \"overflow\") + style(node, \"overflow-y\") + style(node, \"overflow-x\");\n };\n\n var scroll = function (node) {\n return regex.test(overflow(node));\n };\n\n var scrollParent = function (node) {\n if (!(node instanceof HTMLElement || node instanceof SVGElement)) {\n return ;\n }\n\n var ps = parents(node.parentNode, []);\n\n for (var i = 0; i < ps.length; i += 1) {\n if (scroll(ps[i])) {\n return ps[i];\n }\n }\n\n return document.scrollingElement || document.documentElement;\n };\n\n return scrollParent;\n}));\n","/*! https://mths.be/punycode v1.3.2 by @mathias */\n;(function(root) {\n\n\t/** Detect free variables */\n\tvar freeExports = typeof exports == 'object' && exports &&\n\t\t!exports.nodeType && exports;\n\tvar freeModule = typeof module == 'object' && module &&\n\t\t!module.nodeType && module;\n\tvar freeGlobal = typeof global == 'object' && global;\n\tif (\n\t\tfreeGlobal.global === freeGlobal ||\n\t\tfreeGlobal.window === freeGlobal ||\n\t\tfreeGlobal.self === freeGlobal\n\t) {\n\t\troot = freeGlobal;\n\t}\n\n\t/**\n\t * The `punycode` object.\n\t * @name punycode\n\t * @type Object\n\t */\n\tvar punycode,\n\n\t/** Highest positive signed 32-bit float value */\n\tmaxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1\n\n\t/** Bootstring parameters */\n\tbase = 36,\n\ttMin = 1,\n\ttMax = 26,\n\tskew = 38,\n\tdamp = 700,\n\tinitialBias = 72,\n\tinitialN = 128, // 0x80\n\tdelimiter = '-', // '\\x2D'\n\n\t/** Regular expressions */\n\tregexPunycode = /^xn--/,\n\tregexNonASCII = /[^\\x20-\\x7E]/, // unprintable ASCII chars + non-ASCII chars\n\tregexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g, // RFC 3490 separators\n\n\t/** Error messages */\n\terrors = {\n\t\t'overflow': 'Overflow: input needs wider integers to process',\n\t\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t\t'invalid-input': 'Invalid input'\n\t},\n\n\t/** Convenience shortcuts */\n\tbaseMinusTMin = base - tMin,\n\tfloor = Math.floor,\n\tstringFromCharCode = String.fromCharCode,\n\n\t/** Temporary variable */\n\tkey;\n\n\t/*--------------------------------------------------------------------------*/\n\n\t/**\n\t * A generic error utility function.\n\t * @private\n\t * @param {String} type The error type.\n\t * @returns {Error} Throws a `RangeError` with the applicable error message.\n\t */\n\tfunction error(type) {\n\t\tthrow RangeError(errors[type]);\n\t}\n\n\t/**\n\t * A generic `Array#map` utility function.\n\t * @private\n\t * @param {Array} array The array to iterate over.\n\t * @param {Function} callback The function that gets called for every array\n\t * item.\n\t * @returns {Array} A new array of values returned by the callback function.\n\t */\n\tfunction map(array, fn) {\n\t\tvar length = array.length;\n\t\tvar result = [];\n\t\twhile (length--) {\n\t\t\tresult[length] = fn(array[length]);\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * A simple `Array#map`-like wrapper to work with domain name strings or email\n\t * addresses.\n\t * @private\n\t * @param {String} domain The domain name or email address.\n\t * @param {Function} callback The function that gets called for every\n\t * character.\n\t * @returns {Array} A new string of characters returned by the callback\n\t * function.\n\t */\n\tfunction mapDomain(string, fn) {\n\t\tvar parts = string.split('@');\n\t\tvar result = '';\n\t\tif (parts.length > 1) {\n\t\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t\t// the local part (i.e. everything up to `@`) intact.\n\t\t\tresult = parts[0] + '@';\n\t\t\tstring = parts[1];\n\t\t}\n\t\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\t\tstring = string.replace(regexSeparators, '\\x2E');\n\t\tvar labels = string.split('.');\n\t\tvar encoded = map(labels, fn).join('.');\n\t\treturn result + encoded;\n\t}\n\n\t/**\n\t * Creates an array containing the numeric code points of each Unicode\n\t * character in the string. While JavaScript uses UCS-2 internally,\n\t * this function will convert a pair of surrogate halves (each of which\n\t * UCS-2 exposes as separate characters) into a single code point,\n\t * matching UTF-16.\n\t * @see `punycode.ucs2.encode`\n\t * @see <https://mathiasbynens.be/notes/javascript-encoding>\n\t * @memberOf punycode.ucs2\n\t * @name decode\n\t * @param {String} string The Unicode input string (UCS-2).\n\t * @returns {Array} The new array of code points.\n\t */\n\tfunction ucs2decode(string) {\n\t\tvar output = [],\n\t\t counter = 0,\n\t\t length = string.length,\n\t\t value,\n\t\t extra;\n\t\twhile (counter < length) {\n\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t} else {\n\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\toutput.push(value);\n\t\t\t\t\tcounter--;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\toutput.push(value);\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t}\n\n\t/**\n\t * Creates a string based on an array of numeric code points.\n\t * @see `punycode.ucs2.decode`\n\t * @memberOf punycode.ucs2\n\t * @name encode\n\t * @param {Array} codePoints The array of numeric code points.\n\t * @returns {String} The new Unicode string (UCS-2).\n\t */\n\tfunction ucs2encode(array) {\n\t\treturn map(array, function(value) {\n\t\t\tvar output = '';\n\t\t\tif (value > 0xFFFF) {\n\t\t\t\tvalue -= 0x10000;\n\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t}\n\t\t\toutput += stringFromCharCode(value);\n\t\t\treturn output;\n\t\t}).join('');\n\t}\n\n\t/**\n\t * Converts a basic code point into a digit/integer.\n\t * @see `digitToBasic()`\n\t * @private\n\t * @param {Number} codePoint The basic numeric code point value.\n\t * @returns {Number} The numeric value of a basic code point (for use in\n\t * representing integers) in the range `0` to `base - 1`, or `base` if\n\t * the code point does not represent a value.\n\t */\n\tfunction basicToDigit(codePoint) {\n\t\tif (codePoint - 48 < 10) {\n\t\t\treturn codePoint - 22;\n\t\t}\n\t\tif (codePoint - 65 < 26) {\n\t\t\treturn codePoint - 65;\n\t\t}\n\t\tif (codePoint - 97 < 26) {\n\t\t\treturn codePoint - 97;\n\t\t}\n\t\treturn base;\n\t}\n\n\t/**\n\t * Converts a digit/integer into a basic code point.\n\t * @see `basicToDigit()`\n\t * @private\n\t * @param {Number} digit The numeric value of a basic code point.\n\t * @returns {Number} The basic code point whose value (when used for\n\t * representing integers) is `digit`, which needs to be in the range\n\t * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n\t * used; else, the lowercase form is used. The behavior is undefined\n\t * if `flag` is non-zero and `digit` has no uppercase form.\n\t */\n\tfunction digitToBasic(digit, flag) {\n\t\t// 0..25 map to ASCII a..z or A..Z\n\t\t// 26..35 map to ASCII 0..9\n\t\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n\t}\n\n\t/**\n\t * Bias adaptation function as per section 3.4 of RFC 3492.\n\t * http://tools.ietf.org/html/rfc3492#section-3.4\n\t * @private\n\t */\n\tfunction adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}\n\n\t/**\n\t * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n\t * symbols.\n\t * @memberOf punycode\n\t * @param {String} input The Punycode string of ASCII-only symbols.\n\t * @returns {String} The resulting string of Unicode symbols.\n\t */\n\tfunction decode(input) {\n\t\t// Don't use UCS-2\n\t\tvar output = [],\n\t\t inputLength = input.length,\n\t\t out,\n\t\t i = 0,\n\t\t n = initialN,\n\t\t bias = initialBias,\n\t\t basic,\n\t\t j,\n\t\t index,\n\t\t oldi,\n\t\t w,\n\t\t k,\n\t\t digit,\n\t\t t,\n\t\t /** Cached calculation results */\n\t\t baseMinusT;\n\n\t\t// Handle the basic code points: let `basic` be the number of input code\n\t\t// points before the last delimiter, or `0` if there is none, then copy\n\t\t// the first basic code points to the output.\n\n\t\tbasic = input.lastIndexOf(delimiter);\n\t\tif (basic < 0) {\n\t\t\tbasic = 0;\n\t\t}\n\n\t\tfor (j = 0; j < basic; ++j) {\n\t\t\t// if it's not a basic code point\n\t\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\t\terror('not-basic');\n\t\t\t}\n\t\t\toutput.push(input.charCodeAt(j));\n\t\t}\n\n\t\t// Main decoding loop: start just after the last delimiter if any basic code\n\t\t// points were copied; start at the beginning otherwise.\n\n\t\tfor (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t\t// `index` is the index of the next character to be consumed.\n\t\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t\t// which gets added to `i`. The overflow checking is easier\n\t\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t\t// value at the end to obtain `delta`.\n\t\t\tfor (oldi = i, w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\t\tif (index >= inputLength) {\n\t\t\t\t\terror('invalid-input');\n\t\t\t\t}\n\n\t\t\t\tdigit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\ti += digit * w;\n\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\t\tif (digit < t) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tbaseMinusT = base - t;\n\t\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\tw *= baseMinusT;\n\n\t\t\t}\n\n\t\t\tout = output.length + 1;\n\t\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t\t// incrementing `n` each time, so we'll fix that now:\n\t\t\tif (floor(i / out) > maxInt - n) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tn += floor(i / out);\n\t\t\ti %= out;\n\n\t\t\t// Insert `n` at position `i` of the output\n\t\t\toutput.splice(i++, 0, n);\n\n\t\t}\n\n\t\treturn ucs2encode(output);\n\t}\n\n\t/**\n\t * Converts a string of Unicode symbols (e.g. a domain name label) to a\n\t * Punycode string of ASCII-only symbols.\n\t * @memberOf punycode\n\t * @param {String} input The string of Unicode symbols.\n\t * @returns {String} The resulting Punycode string of ASCII-only symbols.\n\t */\n\tfunction encode(input) {\n\t\tvar n,\n\t\t delta,\n\t\t handledCPCount,\n\t\t basicLength,\n\t\t bias,\n\t\t j,\n\t\t m,\n\t\t q,\n\t\t k,\n\t\t t,\n\t\t currentValue,\n\t\t output = [],\n\t\t /** `inputLength` will hold the number of code points in `input`. */\n\t\t inputLength,\n\t\t /** Cached calculation results */\n\t\t handledCPCountPlusOne,\n\t\t baseMinusT,\n\t\t qMinusT;\n\n\t\t// Convert the input in UCS-2 to Unicode\n\t\tinput = ucs2decode(input);\n\n\t\t// Cache the length\n\t\tinputLength = input.length;\n\n\t\t// Initialize the state\n\t\tn = initialN;\n\t\tdelta = 0;\n\t\tbias = initialBias;\n\n\t\t// Handle the basic code points\n\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\tcurrentValue = input[j];\n\t\t\tif (currentValue < 0x80) {\n\t\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t\t}\n\t\t}\n\n\t\thandledCPCount = basicLength = output.length;\n\n\t\t// `handledCPCount` is the number of code points that have been handled;\n\t\t// `basicLength` is the number of basic code points.\n\n\t\t// Finish the basic string - if it is not empty - with a delimiter\n\t\tif (basicLength) {\n\t\t\toutput.push(delimiter);\n\t\t}\n\n\t\t// Main encoding loop:\n\t\twhile (handledCPCount < inputLength) {\n\n\t\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t\t// larger one:\n\t\t\tfor (m = maxInt, j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\t\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\t\tm = currentValue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,\n\t\t\t// but guard against overflow\n\t\t\thandledCPCountPlusOne = handledCPCount + 1;\n\t\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\t\tn = m;\n\n\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\n\t\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\tif (currentValue == n) {\n\t\t\t\t\t// Represent delta as a generalized variable-length integer\n\t\t\t\t\tfor (q = delta, k = base; /* no condition */; k += base) {\n\t\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tqMinusT = q - t;\n\t\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\t\toutput.push(\n\t\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t\t);\n\t\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t\t}\n\n\t\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\t\tdelta = 0;\n\t\t\t\t\t++handledCPCount;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t++delta;\n\t\t\t++n;\n\n\t\t}\n\t\treturn output.join('');\n\t}\n\n\t/**\n\t * Converts a Punycode string representing a domain name or an email address\n\t * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n\t * it doesn't matter if you call it on a string that has already been\n\t * converted to Unicode.\n\t * @memberOf punycode\n\t * @param {String} input The Punycoded domain name or email address to\n\t * convert to Unicode.\n\t * @returns {String} The Unicode representation of the given Punycode\n\t * string.\n\t */\n\tfunction toUnicode(input) {\n\t\treturn mapDomain(input, function(string) {\n\t\t\treturn regexPunycode.test(string)\n\t\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t\t: string;\n\t\t});\n\t}\n\n\t/**\n\t * Converts a Unicode string representing a domain name or an email address to\n\t * Punycode. Only the non-ASCII parts of the domain name will be converted,\n\t * i.e. it doesn't matter if you call it with a domain that's already in\n\t * ASCII.\n\t * @memberOf punycode\n\t * @param {String} input The domain name or email address to convert, as a\n\t * Unicode string.\n\t * @returns {String} The Punycode representation of the given domain name or\n\t * email address.\n\t */\n\tfunction toASCII(input) {\n\t\treturn mapDomain(input, function(string) {\n\t\t\treturn regexNonASCII.test(string)\n\t\t\t\t? 'xn--' + encode(string)\n\t\t\t\t: string;\n\t\t});\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\t/** Define the public API */\n\tpunycode = {\n\t\t/**\n\t\t * A string representing the current Punycode.js version number.\n\t\t * @memberOf punycode\n\t\t * @type String\n\t\t */\n\t\t'version': '1.3.2',\n\t\t/**\n\t\t * An object of methods to convert from JavaScript's internal character\n\t\t * representation (UCS-2) to Unicode code points, and back.\n\t\t * @see <https://mathiasbynens.be/notes/javascript-encoding>\n\t\t * @memberOf punycode\n\t\t * @type Object\n\t\t */\n\t\t'ucs2': {\n\t\t\t'decode': ucs2decode,\n\t\t\t'encode': ucs2encode\n\t\t},\n\t\t'decode': decode,\n\t\t'encode': encode,\n\t\t'toASCII': toASCII,\n\t\t'toUnicode': toUnicode\n\t};\n\n\t/** Expose `punycode` */\n\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t// like the following:\n\tif (\n\t\ttypeof define == 'function' &&\n\t\ttypeof define.amd == 'object' &&\n\t\tdefine.amd\n\t) {\n\t\tdefine('punycode', function() {\n\t\t\treturn punycode;\n\t\t});\n\t} else if (freeExports && freeModule) {\n\t\tif (module.exports == freeExports) { // in Node.js or RingoJS v0.8.0+\n\t\t\tfreeModule.exports = punycode;\n\t\t} else { // in Narwhal or RingoJS v0.7.0-\n\t\t\tfor (key in punycode) {\n\t\t\t\tpunycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);\n\t\t\t}\n\t\t}\n\t} else { // in Rhino or a web browser\n\t\troot.punycode = punycode;\n\t}\n\n}(this));\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar punycode = require('punycode');\nvar util = require('./util');\n\nexports.parse = urlParse;\nexports.resolve = urlResolve;\nexports.resolveObject = urlResolveObject;\nexports.format = urlFormat;\n\nexports.Url = Url;\n\nfunction Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.host = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.query = null;\n this.pathname = null;\n this.path = null;\n this.href = null;\n}\n\n// Reference: RFC 3986, RFC 1808, RFC 2396\n\n// define these here so at least they only have to be\n// compiled once on the first module load.\nvar protocolPattern = /^([a-z0-9.+-]+:)/i,\n portPattern = /:[0-9]*$/,\n\n // Special case for a simple path URL\n simplePathPattern = /^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,\n\n // RFC 2396: characters reserved for delimiting URLs.\n // We actually just auto-escape these.\n delims = ['<', '>', '\"', '`', ' ', '\\r', '\\n', '\\t'],\n\n // RFC 2396: characters not allowed for various reasons.\n unwise = ['{', '}', '|', '\\\\', '^', '`'].concat(delims),\n\n // Allowed by RFCs, but cause of XSS attacks. Always escape these.\n autoEscape = ['\\''].concat(unwise),\n // Characters that are never ever allowed in a hostname.\n // Note that any invalid chars are also handled, but these\n // are the ones that are *expected* to be seen, so we fast-path\n // them.\n nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),\n hostEndingChars = ['/', '?', '#'],\n hostnameMaxLen = 255,\n hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,\n hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,\n // protocols that can allow \"unsafe\" and \"unwise\" chars.\n unsafeProtocol = {\n 'javascript': true,\n 'javascript:': true\n },\n // protocols that never have a hostname.\n hostlessProtocol = {\n 'javascript': true,\n 'javascript:': true\n },\n // protocols that always contain a // bit.\n slashedProtocol = {\n 'http': true,\n 'https': true,\n 'ftp': true,\n 'gopher': true,\n 'file': true,\n 'http:': true,\n 'https:': true,\n 'ftp:': true,\n 'gopher:': true,\n 'file:': true\n },\n querystring = require('querystring');\n\nfunction urlParse(url, parseQueryString, slashesDenoteHost) {\n if (url && util.isObject(url) && url instanceof Url) return url;\n\n var u = new Url;\n u.parse(url, parseQueryString, slashesDenoteHost);\n return u;\n}\n\nUrl.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {\n if (!util.isString(url)) {\n throw new TypeError(\"Parameter 'url' must be a string, not \" + typeof url);\n }\n\n // Copy chrome, IE, opera backslash-handling behavior.\n // Back slashes before the query string get converted to forward slashes\n // See: https://code.google.com/p/chromium/issues/detail?id=25916\n var queryIndex = url.indexOf('?'),\n splitter =\n (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#',\n uSplit = url.split(splitter),\n slashRegex = /\\\\/g;\n uSplit[0] = uSplit[0].replace(slashRegex, '/');\n url = uSplit.join(splitter);\n\n var rest = url;\n\n // trim before proceeding.\n // This is to support parse stuff like \" http://foo.com \\n\"\n rest = rest.trim();\n\n if (!slashesDenoteHost && url.split('#').length === 1) {\n // Try fast path regexp\n var simplePath = simplePathPattern.exec(rest);\n if (simplePath) {\n this.path = rest;\n this.href = rest;\n this.pathname = simplePath[1];\n if (simplePath[2]) {\n this.search = simplePath[2];\n if (parseQueryString) {\n this.query = querystring.parse(this.search.substr(1));\n } else {\n this.query = this.search.substr(1);\n }\n } else if (parseQueryString) {\n this.search = '';\n this.query = {};\n }\n return this;\n }\n }\n\n var proto = protocolPattern.exec(rest);\n if (proto) {\n proto = proto[0];\n var lowerProto = proto.toLowerCase();\n this.protocol = lowerProto;\n rest = rest.substr(proto.length);\n }\n\n // figure out if it's got a host\n // user@server is *always* interpreted as a hostname, and url\n // resolution will treat //foo/bar as host=foo,path=bar because that's\n // how the browser resolves relative URLs.\n if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)) {\n var slashes = rest.substr(0, 2) === '//';\n if (slashes && !(proto && hostlessProtocol[proto])) {\n rest = rest.substr(2);\n this.slashes = true;\n }\n }\n\n if (!hostlessProtocol[proto] &&\n (slashes || (proto && !slashedProtocol[proto]))) {\n\n // there's a hostname.\n // the first instance of /, ?, ;, or # ends the host.\n //\n // If there is an @ in the hostname, then non-host chars *are* allowed\n // to the left of the last @ sign, unless some host-ending character\n // comes *before* the @-sign.\n // URLs are obnoxious.\n //\n // ex:\n // http://a@b@c/ => user:a@b host:c\n // http://a@b?@c => user:a host:c path:/?@c\n\n // v0.12 TODO(isaacs): This is not quite how Chrome does things.\n // Review our test case against browsers more comprehensively.\n\n // find the first instance of any hostEndingChars\n var hostEnd = -1;\n for (var i = 0; i < hostEndingChars.length; i++) {\n var hec = rest.indexOf(hostEndingChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n\n // at this point, either we have an explicit point where the\n // auth portion cannot go past, or the last @ char is the decider.\n var auth, atSign;\n if (hostEnd === -1) {\n // atSign can be anywhere.\n atSign = rest.lastIndexOf('@');\n } else {\n // atSign must be in auth portion.\n // http://a@b/c@d => host:b auth:a path:/c@d\n atSign = rest.lastIndexOf('@', hostEnd);\n }\n\n // Now we have a portion which is definitely the auth.\n // Pull that off.\n if (atSign !== -1) {\n auth = rest.slice(0, atSign);\n rest = rest.slice(atSign + 1);\n this.auth = decodeURIComponent(auth);\n }\n\n // the host is the remaining to the left of the first non-host char\n hostEnd = -1;\n for (var i = 0; i < nonHostChars.length; i++) {\n var hec = rest.indexOf(nonHostChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n // if we still have not hit it, then the entire thing is a host.\n if (hostEnd === -1)\n hostEnd = rest.length;\n\n this.host = rest.slice(0, hostEnd);\n rest = rest.slice(hostEnd);\n\n // pull out port.\n this.parseHost();\n\n // we've indicated that there is a hostname,\n // so even if it's empty, it has to be present.\n this.hostname = this.hostname || '';\n\n // if hostname begins with [ and ends with ]\n // assume that it's an IPv6 address.\n var ipv6Hostname = this.hostname[0] === '[' &&\n this.hostname[this.hostname.length - 1] === ']';\n\n // validate a little.\n if (!ipv6Hostname) {\n var hostparts = this.hostname.split(/\\./);\n for (var i = 0, l = hostparts.length; i < l; i++) {\n var part = hostparts[i];\n if (!part) continue;\n if (!part.match(hostnamePartPattern)) {\n var newpart = '';\n for (var j = 0, k = part.length; j < k; j++) {\n if (part.charCodeAt(j) > 127) {\n // we replace non-ASCII char with a temporary placeholder\n // we need this to make sure size of hostname is not\n // broken by replacing non-ASCII by nothing\n newpart += 'x';\n } else {\n newpart += part[j];\n }\n }\n // we test again with ASCII char only\n if (!newpart.match(hostnamePartPattern)) {\n var validParts = hostparts.slice(0, i);\n var notHost = hostparts.slice(i + 1);\n var bit = part.match(hostnamePartStart);\n if (bit) {\n validParts.push(bit[1]);\n notHost.unshift(bit[2]);\n }\n if (notHost.length) {\n rest = '/' + notHost.join('.') + rest;\n }\n this.hostname = validParts.join('.');\n break;\n }\n }\n }\n }\n\n if (this.hostname.length > hostnameMaxLen) {\n this.hostname = '';\n } else {\n // hostnames are always lower case.\n this.hostname = this.hostname.toLowerCase();\n }\n\n if (!ipv6Hostname) {\n // IDNA Support: Returns a punycoded representation of \"domain\".\n // It only converts parts of the domain name that\n // have non-ASCII characters, i.e. it doesn't matter if\n // you call it with a domain that already is ASCII-only.\n this.hostname = punycode.toASCII(this.hostname);\n }\n\n var p = this.port ? ':' + this.port : '';\n var h = this.hostname || '';\n this.host = h + p;\n this.href += this.host;\n\n // strip [ and ] from the hostname\n // the host field still retains them, though\n if (ipv6Hostname) {\n this.hostname = this.hostname.substr(1, this.hostname.length - 2);\n if (rest[0] !== '/') {\n rest = '/' + rest;\n }\n }\n }\n\n // now rest is set to the post-host stuff.\n // chop off any delim chars.\n if (!unsafeProtocol[lowerProto]) {\n\n // First, make 100% sure that any \"autoEscape\" chars get\n // escaped, even if encodeURIComponent doesn't think they\n // need to be.\n for (var i = 0, l = autoEscape.length; i < l; i++) {\n var ae = autoEscape[i];\n if (rest.indexOf(ae) === -1)\n continue;\n var esc = encodeURIComponent(ae);\n if (esc === ae) {\n esc = escape(ae);\n }\n rest = rest.split(ae).join(esc);\n }\n }\n\n\n // chop off from the tail first.\n var hash = rest.indexOf('#');\n if (hash !== -1) {\n // got a fragment string.\n this.hash = rest.substr(hash);\n rest = rest.slice(0, hash);\n }\n var qm = rest.indexOf('?');\n if (qm !== -1) {\n this.search = rest.substr(qm);\n this.query = rest.substr(qm + 1);\n if (parseQueryString) {\n this.query = querystring.parse(this.query);\n }\n rest = rest.slice(0, qm);\n } else if (parseQueryString) {\n // no query string, but parseQueryString still requested\n this.search = '';\n this.query = {};\n }\n if (rest) this.pathname = rest;\n if (slashedProtocol[lowerProto] &&\n this.hostname && !this.pathname) {\n this.pathname = '/';\n }\n\n //to support http.request\n if (this.pathname || this.search) {\n var p = this.pathname || '';\n var s = this.search || '';\n this.path = p + s;\n }\n\n // finally, reconstruct the href based on what has been validated.\n this.href = this.format();\n return this;\n};\n\n// format a parsed object into a url string\nfunction urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (util.isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}\n\nUrl.prototype.format = function() {\n var auth = this.auth || '';\n if (auth) {\n auth = encodeURIComponent(auth);\n auth = auth.replace(/%3A/i, ':');\n auth += '@';\n }\n\n var protocol = this.protocol || '',\n pathname = this.pathname || '',\n hash = this.hash || '',\n host = false,\n query = '';\n\n if (this.host) {\n host = auth + this.host;\n } else if (this.hostname) {\n host = auth + (this.hostname.indexOf(':') === -1 ?\n this.hostname :\n '[' + this.hostname + ']');\n if (this.port) {\n host += ':' + this.port;\n }\n }\n\n if (this.query &&\n util.isObject(this.query) &&\n Object.keys(this.query).length) {\n query = querystring.stringify(this.query);\n }\n\n var search = this.search || (query && ('?' + query)) || '';\n\n if (protocol && protocol.substr(-1) !== ':') protocol += ':';\n\n // only the slashedProtocols get the //. Not mailto:, xmpp:, etc.\n // unless they had them to begin with.\n if (this.slashes ||\n (!protocol || slashedProtocol[protocol]) && host !== false) {\n host = '//' + (host || '');\n if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;\n } else if (!host) {\n host = '';\n }\n\n if (hash && hash.charAt(0) !== '#') hash = '#' + hash;\n if (search && search.charAt(0) !== '?') search = '?' + search;\n\n pathname = pathname.replace(/[?#]/g, function(match) {\n return encodeURIComponent(match);\n });\n search = search.replace('#', '%23');\n\n return protocol + host + pathname + search + hash;\n};\n\nfunction urlResolve(source, relative) {\n return urlParse(source, false, true).resolve(relative);\n}\n\nUrl.prototype.resolve = function(relative) {\n return this.resolveObject(urlParse(relative, false, true)).format();\n};\n\nfunction urlResolveObject(source, relative) {\n if (!source) return relative;\n return urlParse(source, false, true).resolveObject(relative);\n}\n\nUrl.prototype.resolveObject = function(relative) {\n if (util.isString(relative)) {\n var rel = new Url();\n rel.parse(relative, false, true);\n relative = rel;\n }\n\n var result = new Url();\n var tkeys = Object.keys(this);\n for (var tk = 0; tk < tkeys.length; tk++) {\n var tkey = tkeys[tk];\n result[tkey] = this[tkey];\n }\n\n // hash is always overridden, no matter what.\n // even href=\"\" will remove it.\n result.hash = relative.hash;\n\n // if the relative url is empty, then there's nothing left to do here.\n if (relative.href === '') {\n result.href = result.format();\n return result;\n }\n\n // hrefs like //foo/bar always cut to the protocol.\n if (relative.slashes && !relative.protocol) {\n // take everything except the protocol from relative\n var rkeys = Object.keys(relative);\n for (var rk = 0; rk < rkeys.length; rk++) {\n var rkey = rkeys[rk];\n if (rkey !== 'protocol')\n result[rkey] = relative[rkey];\n }\n\n //urlParse appends trailing / to urls like http://www.example.com\n if (slashedProtocol[result.protocol] &&\n result.hostname && !result.pathname) {\n result.path = result.pathname = '/';\n }\n\n result.href = result.format();\n return result;\n }\n\n if (relative.protocol && relative.protocol !== result.protocol) {\n // if it's a known url protocol, then changing\n // the protocol does weird things\n // first, if it's not file:, then we MUST have a host,\n // and if there was a path\n // to begin with, then we MUST have a path.\n // if it is file:, then the host is dropped,\n // because that's known to be hostless.\n // anything else is assumed to be absolute.\n if (!slashedProtocol[relative.protocol]) {\n var keys = Object.keys(relative);\n for (var v = 0; v < keys.length; v++) {\n var k = keys[v];\n result[k] = relative[k];\n }\n result.href = result.format();\n return result;\n }\n\n result.protocol = relative.protocol;\n if (!relative.host && !hostlessProtocol[relative.protocol]) {\n var relPath = (relative.pathname || '').split('/');\n while (relPath.length && !(relative.host = relPath.shift()));\n if (!relative.host) relative.host = '';\n if (!relative.hostname) relative.hostname = '';\n if (relPath[0] !== '') relPath.unshift('');\n if (relPath.length < 2) relPath.unshift('');\n result.pathname = relPath.join('/');\n } else {\n result.pathname = relative.pathname;\n }\n result.search = relative.search;\n result.query = relative.query;\n result.host = relative.host || '';\n result.auth = relative.auth;\n result.hostname = relative.hostname || relative.host;\n result.port = relative.port;\n // to support http.request\n if (result.pathname || result.search) {\n var p = result.pathname || '';\n var s = result.search || '';\n result.path = p + s;\n }\n result.slashes = result.slashes || relative.slashes;\n result.href = result.format();\n return result;\n }\n\n var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'),\n isRelAbs = (\n relative.host ||\n relative.pathname && relative.pathname.charAt(0) === '/'\n ),\n mustEndAbs = (isRelAbs || isSourceAbs ||\n (result.host && relative.pathname)),\n removeAllDots = mustEndAbs,\n srcPath = result.pathname && result.pathname.split('/') || [],\n relPath = relative.pathname && relative.pathname.split('/') || [],\n psychotic = result.protocol && !slashedProtocol[result.protocol];\n\n // if the url is a non-slashed url, then relative\n // links like ../.. should be able\n // to crawl up to the hostname, as well. This is strange.\n // result.protocol has already been set by now.\n // Later on, put the first path part into the host field.\n if (psychotic) {\n result.hostname = '';\n result.port = null;\n if (result.host) {\n if (srcPath[0] === '') srcPath[0] = result.host;\n else srcPath.unshift(result.host);\n }\n result.host = '';\n if (relative.protocol) {\n relative.hostname = null;\n relative.port = null;\n if (relative.host) {\n if (relPath[0] === '') relPath[0] = relative.host;\n else relPath.unshift(relative.host);\n }\n relative.host = null;\n }\n mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');\n }\n\n if (isRelAbs) {\n // it's absolute.\n result.host = (relative.host || relative.host === '') ?\n relative.host : result.host;\n result.hostname = (relative.hostname || relative.hostname === '') ?\n relative.hostname : result.hostname;\n result.search = relative.search;\n result.query = relative.query;\n srcPath = relPath;\n // fall through to the dot-handling below.\n } else if (relPath.length) {\n // it's relative\n // throw away the existing file, and take the new path instead.\n if (!srcPath) srcPath = [];\n srcPath.pop();\n srcPath = srcPath.concat(relPath);\n result.search = relative.search;\n result.query = relative.query;\n } else if (!util.isNullOrUndefined(relative.search)) {\n // just pull out the search.\n // like href='?foo'.\n // Put this after the other two cases because it simplifies the booleans\n if (psychotic) {\n result.hostname = result.host = srcPath.shift();\n //occationaly the auth can get stuck only in host\n //this especially happens in cases like\n //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n var authInHost = result.host && result.host.indexOf('@') > 0 ?\n result.host.split('@') : false;\n if (authInHost) {\n result.auth = authInHost.shift();\n result.host = result.hostname = authInHost.shift();\n }\n }\n result.search = relative.search;\n result.query = relative.query;\n //to support http.request\n if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n result.path = (result.pathname ? result.pathname : '') +\n (result.search ? result.search : '');\n }\n result.href = result.format();\n return result;\n }\n\n if (!srcPath.length) {\n // no path at all. easy.\n // we've already handled the other stuff above.\n result.pathname = null;\n //to support http.request\n if (result.search) {\n result.path = '/' + result.search;\n } else {\n result.path = null;\n }\n result.href = result.format();\n return result;\n }\n\n // if a url ENDs in . or .., then it must get a trailing slash.\n // however, if it ends in anything else non-slashy,\n // then it must NOT get a trailing slash.\n var last = srcPath.slice(-1)[0];\n var hasTrailingSlash = (\n (result.host || relative.host || srcPath.length > 1) &&\n (last === '.' || last === '..') || last === '');\n\n // strip single dots, resolve double dots to parent dir\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = srcPath.length; i >= 0; i--) {\n last = srcPath[i];\n if (last === '.') {\n srcPath.splice(i, 1);\n } else if (last === '..') {\n srcPath.splice(i, 1);\n up++;\n } else if (up) {\n srcPath.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (!mustEndAbs && !removeAllDots) {\n for (; up--; up) {\n srcPath.unshift('..');\n }\n }\n\n if (mustEndAbs && srcPath[0] !== '' &&\n (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {\n srcPath.unshift('');\n }\n\n if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {\n srcPath.push('');\n }\n\n var isAbsolute = srcPath[0] === '' ||\n (srcPath[0] && srcPath[0].charAt(0) === '/');\n\n // put the host back\n if (psychotic) {\n result.hostname = result.host = isAbsolute ? '' :\n srcPath.length ? srcPath.shift() : '';\n //occationaly the auth can get stuck only in host\n //this especially happens in cases like\n //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n var authInHost = result.host && result.host.indexOf('@') > 0 ?\n result.host.split('@') : false;\n if (authInHost) {\n result.auth = authInHost.shift();\n result.host = result.hostname = authInHost.shift();\n }\n }\n\n mustEndAbs = mustEndAbs || (result.host && srcPath.length);\n\n if (mustEndAbs && !isAbsolute) {\n srcPath.unshift('');\n }\n\n if (!srcPath.length) {\n result.pathname = null;\n result.path = null;\n } else {\n result.pathname = srcPath.join('/');\n }\n\n //to support request.http\n if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n result.path = (result.pathname ? result.pathname : '') +\n (result.search ? result.search : '');\n }\n result.auth = relative.auth || result.auth;\n result.slashes = result.slashes || relative.slashes;\n result.href = result.format();\n return result;\n};\n\nUrl.prototype.parseHost = function() {\n var host = this.host;\n var port = portPattern.exec(host);\n if (port) {\n port = port[0];\n if (port !== ':') {\n this.port = port.substr(1);\n }\n host = host.substr(0, host.length - port.length);\n }\n if (host) this.hostname = host;\n};\n","'use strict';\n\nmodule.exports = {\n isString: function(arg) {\n return typeof(arg) === 'string';\n },\n isObject: function(arg) {\n return typeof(arg) === 'object' && arg !== null;\n },\n isNull: function(arg) {\n return arg === null;\n },\n isNullOrUndefined: function(arg) {\n return arg == null;\n }\n};\n","import { Container } from '@pixi/display';\nimport type { CanvasRenderer } from '@pixi/canvas-renderer';\nimport type { MaskData } from '@pixi/core';\n\n/**\n * To be overridden by the subclass\n * @method _renderCanvas\n * @memberof PIXI.Container#\n * @protected\n * @param {PIXI.CanvasRenderer} _renderer - The renderer\n */\nContainer.prototype._renderCanvas = function _renderCanvas(_renderer: CanvasRenderer): void\n{\n // this is where content itself gets rendered...\n};\n\n/**\n * Renders the object using the Canvas renderer\n * @method renderCanvas\n * @memberof PIXI.Container#\n * @param {PIXI.CanvasRenderer} renderer - The renderer\n */\nContainer.prototype.renderCanvas = function renderCanvas(renderer: CanvasRenderer): void\n{\n // if not visible or the alpha is 0 then no need to render this\n if (!this.visible || this.worldAlpha <= 0 || !this.renderable)\n {\n return;\n }\n\n if (this._mask)\n {\n renderer.maskManager.pushMask(this._mask as MaskData);\n }\n\n this._renderCanvas(renderer);\n for (let i = 0, j = this.children.length; i < j; ++i)\n {\n this.children[i].renderCanvas(renderer);\n }\n\n if (this._mask)\n {\n renderer.maskManager.popMask(renderer);\n }\n};\n","import { DisplayObject } from '@pixi/display';\nimport type { CanvasRenderer } from '@pixi/canvas-renderer';\n\n/**\n * Renders the object using the Canvas renderer\n * @method renderCanvas\n * @memberof PIXI.Container#\n * @param {PIXI.CanvasRenderer} _renderer - The renderer\n */\nDisplayObject.prototype.renderCanvas = function renderCanvas(_renderer: CanvasRenderer): void\n{\n // OVERWRITE;\n};\n","import { Graphics } from '@pixi/graphics';\nimport { CanvasRenderer } from '@pixi/canvas-renderer';\nimport { RenderTexture, Texture } from '@pixi/core';\nimport { Matrix } from '@pixi/math';\n\nimport type { SCALE_MODES } from '@pixi/constants';\nimport type { BaseRenderTexture } from '@pixi/core';\n\nlet canvasRenderer: CanvasRenderer;\nconst tempMatrix = new Matrix();\n\n/**\n * Generates a canvas texture. Only available with **pixi.js-legacy** bundle\n * or the **@pixi/canvas-graphics** package.\n * @method generateCanvasTexture\n * @memberof PIXI.Graphics#\n * @param {PIXI.SCALE_MODES} [scaleMode] - The scale mode of the texture.\n * @param {number} resolution - The resolution of the texture.\n * @returns {PIXI.Texture} The new texture.\n */\nGraphics.prototype.generateCanvasTexture = function generateCanvasTexture(scaleMode?: SCALE_MODES, resolution = 1): Texture\n{\n const bounds = this.getLocalBounds();\n\n const canvasBuffer = RenderTexture.create({\n width: bounds.width,\n height: bounds.height,\n scaleMode,\n resolution,\n });\n\n if (!canvasRenderer)\n {\n canvasRenderer = new CanvasRenderer();\n }\n\n this.transform.updateLocalTransform();\n this.transform.localTransform.copyTo(tempMatrix);\n\n tempMatrix.invert();\n\n tempMatrix.tx -= bounds.x;\n tempMatrix.ty -= bounds.y;\n\n canvasRenderer.render(this, { renderTexture: canvasBuffer, clear: true, transform: tempMatrix });\n\n const texture = Texture.from((canvasBuffer.baseTexture as BaseRenderTexture)._canvasRenderTarget.canvas, {\n scaleMode,\n });\n\n texture.baseTexture.setResolution(resolution);\n\n return texture;\n};\n\nGraphics.prototype.cachedGraphicsData = [];\n\n/**\n * Renders the object using the Canvas renderer\n * @method _renderCanvas\n * @memberof PIXI.Graphics#\n * @private\n * @param {PIXI.CanvasRenderer} renderer - The renderer\n */\nGraphics.prototype._renderCanvas = function _renderCanvas(renderer: CanvasRenderer): void\n{\n if (this.isMask === true)\n {\n return;\n }\n\n this.finishPoly();\n renderer.plugins.graphics.render(this);\n};\n","/**\n * Utilities for polygon\n * @class\n * @private\n */\nexport class PolygonUtils\n{\n /**\n * Calculate points of an offset polygon\n * @see {@link http://csharphelper.com/blog/2016/01/enlarge-a-polygon-in-c/}\n * @private\n * @param {number[]} points - polygon coordinates\n * @param {number} offset\n * @returns {number[]} - offset points\n */\n static offsetPolygon(points: number[], offset: number): number[]\n {\n const offsetPoints: number[] = [];\n const length: number = points.length;\n\n offset = PolygonUtils.isPolygonClockwise(points) ? offset : -1 * offset;\n\n for (let j = 0; j < length; j += 2)\n {\n // Find location for the points before and after j\n let i = (j - 2);\n\n if (i < 0)\n {\n i += length;\n }\n\n const k = (j + 2) % length;\n\n // Move the points by the offset\n let v1x = points[j] - points[i];\n let v1y = points[j + 1] - points[i + 1];\n let len = Math.sqrt((v1x * v1x) + (v1y * v1y));\n\n v1x /= len;\n v1y /= len;\n v1x *= offset;\n v1y *= offset;\n\n const norm1x = -v1y;\n const norm1y = v1x;\n\n const pij1 = [points[i] + norm1x, points[i + 1] + norm1y];\n const pij2 = [points[j] + norm1x, points[j + 1] + norm1y];\n\n let v2x = points[k] - points[j];\n let v2y = points[k + 1] - points[j + 1];\n\n len = Math.sqrt((v2x * v2x) + (v2y * v2y));\n\n v2x /= len;\n v2y /= len;\n v2x *= offset;\n v2y *= offset;\n\n const norm2x = -v2y;\n const norm2y = v2x;\n\n const pjk1 = [points[j] + norm2x, points[j + 1] + norm2y];\n const pjk2 = [points[k] + norm2x, points[k + 1] + norm2y];\n\n // Find where the shifted lines ij and jk intersect.\n const intersectPoint = PolygonUtils\n .findIntersection(pij1[0], pij1[1], pij2[0], pij2[1], pjk1[0], pjk1[1], pjk2[0], pjk2[1]);\n\n if (intersectPoint)\n {\n offsetPoints.push(...intersectPoint);\n }\n }\n\n return offsetPoints;\n }\n\n /**\n * Determine the intersection point of two line segments\n * @see {@link here http://paulbourke.net/geometry/pointlineplane/}\n * @private\n * @param {number} x1 - x-coordinate of start point at first line\n * @param {number} y1 - y-coordinate of start point at first line\n * @param {number} x2 - x-coordinate of end point at first line\n * @param {number} y2 - y-coordinate of end point at first line\n * @param {number} x3 - x-coordinate of start point at second line\n * @param {number} y3 - y-coordinate of start point at second line\n * @param {number} x4 - x-coordinate of end point at second line\n * @param {number} y4 - y-coordinate of end point at second line\n * @returns {[number, number] | null} - [x, y] coordinates of intersection\n */\n static findIntersection(\n x1: number, y1: number, x2: number, y2: number,\n x3: number, y3: number, x4: number, y4: number\n ): [number, number] | null\n {\n const denominator = ((y4 - y3) * (x2 - x1)) - ((x4 - x3) * (y2 - y1));\n const numeratorA = ((x4 - x3) * (y1 - y3)) - ((y4 - y3) * (x1 - x3));\n const numeratorB = ((x2 - x1) * (y1 - y3)) - ((y2 - y1) * (x1 - x3));\n\n // lines are parallel\n if (denominator === 0)\n {\n // lines are coincident\n if (numeratorA === 0 && numeratorB === 0)\n {\n return [(x1 + x2) / 2, (y1 + y2) / 2];\n }\n\n return null;\n }\n\n const uA = numeratorA / denominator;\n\n return [x1 + (uA * (x2 - x1)), y1 + (uA * (y2 - y1))];\n }\n\n /**\n * Determine polygon are clockwise or counterclockwise\n * @see {@link https://stackoverflow.com/questions/1165647}\n * @private\n * @param {number[]} polygon - polygon coordinates\n * @returns {boolean} - true if polygon is clockwise\n */\n static isPolygonClockwise(polygon: number[]): boolean\n {\n let sum = 0;\n\n for (let i = 0, j = polygon.length - 2; i < polygon.length; j = i, i += 2)\n {\n sum += (polygon[i] - polygon[j]) * (polygon[i + 1] + polygon[j + 1]);\n }\n\n return sum > 0;\n }\n}\n","import type { ExtensionMetadata } from '@pixi/core';\nimport { ExtensionType, Texture } from '@pixi/core';\nimport { SHAPES, Matrix } from '@pixi/math';\nimport { canvasUtils } from '@pixi/canvas-renderer';\nimport type { CanvasRenderer, CrossPlatformCanvasRenderingContext2D } from '@pixi/canvas-renderer';\nimport type { FillStyle, Graphics, GraphicsData, LineStyle } from '@pixi/graphics';\nimport type { Circle, Ellipse, Polygon, Rectangle, RoundedRectangle } from '@pixi/math';\nimport { PolygonUtils } from './utils/PolygonUtils';\n\n/*\n * @author Mat Groves\n *\n * Big thanks to the very clever Matt DesLauriers <mattdesl> https://github.com/mattdesl/\n * for creating the original PixiJS version!\n * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that they\n * now share 4 bytes on the vertex buffer\n *\n * Heavily inspired by LibGDX's CanvasGraphicsRenderer:\n * https://github.com/libgdx/libgdx/blob/1.0.0/gdx/src/com/badlogic/gdx/graphics/glutils/ShapeRenderer.java\n */\n\n/**\n * Renderer dedicated to drawing and batching graphics objects.\n * @class\n * @protected\n * @memberof PIXI\n */\nexport class CanvasGraphicsRenderer\n{\n /** @ignore */\n static extension: ExtensionMetadata = {\n name: 'graphics',\n type: ExtensionType.CanvasRendererPlugin,\n };\n\n /** A reference to the current renderer */\n public renderer: CanvasRenderer;\n private _svgMatrix: DOMMatrix | boolean = null;\n private _tempMatrix: Matrix = new Matrix();\n\n /**\n * @param renderer - A reference to the current renderer.\n */\n constructor(renderer: CanvasRenderer)\n {\n this.renderer = renderer;\n }\n\n /**\n * calculates fill/stroke style for canvas\n * @private\n * @param style - A graphics {@link PIXI.FILL_STYLE} where if `texture` is specified then a tinted CanvasPattern\n * will be used for the fill.stroke\n * @param tint - color to set the fill/stroke too.\n */\n private _calcCanvasStyle(style: FillStyle, tint: number): string | CanvasPattern\n {\n let res;\n\n if (style.texture && style.texture.baseTexture !== Texture.WHITE.baseTexture)\n {\n if (style.texture.valid)\n {\n res = canvasUtils.getTintedPattern(style.texture, tint);\n this.setPatternTransform(res, style.matrix || Matrix.IDENTITY);\n }\n else\n {\n res = '#808080';\n }\n }\n else\n {\n res = `#${(`00000${(tint | 0).toString(16)}`).slice(-6)}`;\n }\n\n return res;\n }\n\n /**\n * Renders a Graphics object to a canvas.\n * @param graphics - the actual graphics object to render\n */\n public render(graphics: Graphics): void\n {\n const renderer = this.renderer;\n const context = renderer.context;\n const worldAlpha = graphics.worldAlpha;\n const transform = graphics.transform.worldTransform;\n\n renderer.setContextTransform(transform);\n renderer.setBlendMode(graphics.blendMode);\n\n const graphicsData = graphics.geometry.graphicsData;\n\n let contextFillStyle;\n let contextStrokeStyle;\n\n const tintR = ((graphics.tint >> 16) & 0xFF) / 255;\n const tintG = ((graphics.tint >> 8) & 0xFF) / 255;\n const tintB = (graphics.tint & 0xFF) / 255;\n\n for (let i = 0; i < graphicsData.length; i++)\n {\n const data = graphicsData[i];\n const shape = data.shape;\n const fillStyle = data.fillStyle;\n const lineStyle = data.lineStyle;\n\n const fillColor = data.fillStyle.color | 0;\n const lineColor = data.lineStyle.color | 0;\n\n if (data.matrix)\n {\n renderer.setContextTransform(transform.copyTo(this._tempMatrix).append(data.matrix));\n }\n\n if (fillStyle.visible)\n {\n const fillTint = (\n (((fillColor >> 16) & 0xFF) / 255 * tintR * 255 << 16)\n + (((fillColor >> 8) & 0xFF) / 255 * tintG * 255 << 8)\n + (((fillColor & 0xFF) / 255) * tintB * 255)\n );\n\n contextFillStyle = this._calcCanvasStyle(fillStyle, fillTint);\n }\n if (lineStyle.visible)\n {\n const lineTint = (\n (((lineColor >> 16) & 0xFF) / 255 * tintR * 255 << 16)\n + (((lineColor >> 8) & 0xFF) / 255 * tintG * 255 << 8)\n + (((lineColor & 0xFF) / 255) * tintB * 255)\n );\n\n contextStrokeStyle = this._calcCanvasStyle(lineStyle, lineTint);\n }\n\n context.lineWidth = lineStyle.width;\n context.lineCap = lineStyle.cap;\n context.lineJoin = lineStyle.join;\n context.miterLimit = lineStyle.miterLimit;\n\n if (data.type === SHAPES.POLY)\n {\n context.beginPath();\n\n const tempShape = shape as Polygon;\n let points = tempShape.points;\n const holes = data.holes;\n let outerArea;\n let innerArea;\n let px;\n let py;\n let holesDirection: boolean[];\n\n context.moveTo(points[0], points[1]);\n\n for (let j = 2; j < points.length; j += 2)\n {\n context.lineTo(points[j], points[j + 1]);\n }\n\n if (tempShape.closeStroke)\n {\n context.closePath();\n }\n\n if (holes.length > 0)\n {\n holesDirection = [];\n outerArea = 0;\n px = points[0];\n py = points[1];\n for (let j = 2; j + 2 < points.length; j += 2)\n {\n outerArea += ((points[j] - px) * (points[j + 3] - py))\n - ((points[j + 2] - px) * (points[j + 1] - py));\n }\n\n for (let k = 0; k < holes.length; k++)\n {\n points = (holes[k].shape as Polygon).points;\n\n if (!points)\n {\n continue;\n }\n\n innerArea = 0;\n px = points[0];\n py = points[1];\n for (let j = 2; j + 2 < points.length; j += 2)\n {\n innerArea += ((points[j] - px) * (points[j + 3] - py))\n - ((points[j + 2] - px) * (points[j + 1] - py));\n }\n\n if (innerArea * outerArea < 0)\n {\n context.moveTo(points[0], points[1]);\n\n for (let j = 2; j < points.length; j += 2)\n {\n context.lineTo(points[j], points[j + 1]);\n }\n }\n else\n {\n context.moveTo(points[points.length - 2], points[points.length - 1]);\n\n for (let j = points.length - 4; j >= 0; j -= 2)\n {\n context.lineTo(points[j], points[j + 1]);\n }\n }\n\n if ((holes[k].shape as Polygon).closeStroke)\n {\n context.closePath();\n }\n\n holesDirection[k] = innerArea * outerArea < 0;\n }\n }\n\n if (fillStyle.visible)\n {\n context.globalAlpha = fillStyle.alpha * worldAlpha;\n context.fillStyle = contextFillStyle;\n context.fill();\n }\n\n if (lineStyle.visible)\n {\n this.paintPolygonStroke(\n tempShape, lineStyle, contextStrokeStyle, holes, holesDirection, worldAlpha, context\n );\n }\n }\n else if (data.type === SHAPES.RECT)\n {\n const tempShape = shape as Rectangle;\n\n if (fillStyle.visible)\n {\n context.globalAlpha = fillStyle.alpha * worldAlpha;\n context.fillStyle = contextFillStyle;\n context.fillRect(tempShape.x, tempShape.y, tempShape.width, tempShape.height);\n }\n\n if (lineStyle.visible)\n {\n const alignmentOffset = lineStyle.width * (0.5 - (1 - lineStyle.alignment));\n const width = tempShape.width + (2 * alignmentOffset);\n const height = tempShape.height + (2 * alignmentOffset);\n\n context.globalAlpha = lineStyle.alpha * worldAlpha;\n context.strokeStyle = contextStrokeStyle;\n context.strokeRect(tempShape.x - alignmentOffset, tempShape.y - alignmentOffset, width, height);\n }\n }\n else if (data.type === SHAPES.CIRC)\n {\n const tempShape = shape as Circle;\n\n // TODO - need to be Undefined!\n context.beginPath();\n context.arc(tempShape.x, tempShape.y, tempShape.radius, 0, 2 * Math.PI);\n context.closePath();\n\n if (fillStyle.visible)\n {\n context.globalAlpha = fillStyle.alpha * worldAlpha;\n context.fillStyle = contextFillStyle;\n context.fill();\n }\n\n if (lineStyle.visible)\n {\n if (lineStyle.alignment !== 0.5)\n {\n const alignmentOffset = lineStyle.width * (0.5 - (1 - lineStyle.alignment));\n\n context.beginPath();\n context.arc(tempShape.x, tempShape.y, tempShape.radius + alignmentOffset, 0, 2 * Math.PI);\n context.closePath();\n }\n\n context.globalAlpha = lineStyle.alpha * worldAlpha;\n context.strokeStyle = contextStrokeStyle;\n context.stroke();\n }\n }\n else if (data.type === SHAPES.ELIP)\n {\n const tempShape = shape as Ellipse;\n const drawShapeOverStroke = lineStyle.alignment === 1;\n\n if (!drawShapeOverStroke)\n {\n this.paintEllipse(tempShape, fillStyle, lineStyle, contextFillStyle, worldAlpha, context);\n }\n\n if (lineStyle.visible)\n {\n if (lineStyle.alignment !== 0.5)\n {\n const kappa = 0.5522848;\n const alignmentOffset = lineStyle.width * (0.5 - (1 - lineStyle.alignment));\n const sW = (tempShape.width + alignmentOffset) * 2;\n const sH = (tempShape.height + alignmentOffset) * 2;\n const sX = tempShape.x - (sW / 2);\n const sY = tempShape.y - (sH / 2);\n const sOx = (sW / 2) * kappa;\n const sOy = (sH / 2) * kappa;\n const sXe = sX + sW;\n const sYe = sY + sH;\n const sXm = sX + (sW / 2);\n const sYm = sY + (sH / 2);\n\n context.beginPath();\n context.moveTo(sX, sYm);\n context.bezierCurveTo(sX, sYm - sOy, sXm - sOx, sY, sXm, sY);\n context.bezierCurveTo(sXm + sOx, sY, sXe, sYm - sOy, sXe, sYm);\n context.bezierCurveTo(sXe, sYm + sOy, sXm + sOx, sYe, sXm, sYe);\n context.bezierCurveTo(sXm - sOx, sYe, sX, sYm + sOy, sX, sYm);\n context.closePath();\n }\n\n context.globalAlpha = lineStyle.alpha * worldAlpha;\n context.strokeStyle = contextStrokeStyle;\n context.stroke();\n }\n\n if (drawShapeOverStroke)\n {\n this.paintEllipse(tempShape, fillStyle, lineStyle, contextFillStyle, worldAlpha, context);\n }\n }\n else if (data.type === SHAPES.RREC)\n {\n const tempShape = shape as RoundedRectangle;\n const drawShapeOverStroke = lineStyle.alignment === 1;\n\n if (!drawShapeOverStroke)\n {\n this.paintRoundedRectangle(tempShape, fillStyle, lineStyle, contextFillStyle, worldAlpha, context);\n }\n\n if (lineStyle.visible)\n {\n if (lineStyle.alignment !== 0.5)\n {\n const width = tempShape.width;\n const height = tempShape.height;\n const alignmentOffset = lineStyle.width * (0.5 - (1 - lineStyle.alignment));\n const sRx = tempShape.x - alignmentOffset;\n const sRy = tempShape.y - alignmentOffset;\n const sWidth = tempShape.width + (2 * alignmentOffset);\n const sHeight = tempShape.height + (2 * alignmentOffset);\n const radiusOffset = alignmentOffset * (lineStyle.alignment >= 1\n ? Math.min(sWidth / width, sHeight / height) : Math.min(width / sWidth, height / sHeight));\n let sRadius = tempShape.radius + radiusOffset;\n const sMaxRadius = Math.min(sWidth, sHeight) / 2;\n\n sRadius = sRadius > sMaxRadius ? sMaxRadius : sRadius;\n\n context.beginPath();\n context.moveTo(sRx, sRy + sRadius);\n context.lineTo(sRx, sRy + sHeight - sRadius);\n context.quadraticCurveTo(sRx, sRy + sHeight, sRx + sRadius, sRy + sHeight);\n context.lineTo(sRx + sWidth - sRadius, sRy + sHeight);\n context.quadraticCurveTo(sRx + sWidth, sRy + sHeight, sRx + sWidth, sRy + sHeight - sRadius);\n context.lineTo(sRx + sWidth, sRy + sRadius);\n context.quadraticCurveTo(sRx + sWidth, sRy, sRx + sWidth - sRadius, sRy);\n context.lineTo(sRx + sRadius, sRy);\n context.quadraticCurveTo(sRx, sRy, sRx, sRy + sRadius);\n context.closePath();\n }\n\n context.globalAlpha = lineStyle.alpha * worldAlpha;\n context.strokeStyle = contextStrokeStyle;\n context.stroke();\n }\n\n if (drawShapeOverStroke)\n {\n this.paintRoundedRectangle(tempShape, fillStyle, lineStyle, contextFillStyle, worldAlpha, context);\n }\n }\n }\n }\n\n /**\n * Paint stroke for polygon and holes\n * @private\n * @param shape - Shape to be drawn\n * @param lineStyle - Line style for the shape\n * @param contextStrokeStyle - The strokeStyle for the canvas context\n * @param holes - Holes to be added to the shape\n * @param holesDirection -\n * @param worldAlpha - The multiplied alpha of the displayObject\n * @param context - The canvas context\n */\n private paintPolygonStroke(\n shape: Polygon, lineStyle: LineStyle, contextStrokeStyle: string | CanvasPattern,\n holes: GraphicsData[], holesDirection: boolean[],\n worldAlpha: number, context: CrossPlatformCanvasRenderingContext2D\n ): void\n {\n if (lineStyle.alignment !== 0.5)\n {\n const alignmentOffset = lineStyle.width * (0.5 - (1 - lineStyle.alignment));\n let offsetPoints = PolygonUtils.offsetPolygon(shape.points, alignmentOffset);\n let points;\n\n context.beginPath();\n context.moveTo(offsetPoints[0], offsetPoints[1]);\n\n for (let j = 2; j < offsetPoints.length; j += 2)\n {\n context.lineTo(offsetPoints[j], offsetPoints[j + 1]);\n }\n\n if (shape.closeStroke)\n {\n context.closePath();\n }\n\n for (let k = 0; k < holes.length; k++)\n {\n points = (holes[k].shape as Polygon).points;\n offsetPoints = PolygonUtils.offsetPolygon(points, alignmentOffset);\n\n if (holesDirection[k])\n {\n context.moveTo(offsetPoints[0], offsetPoints[1]);\n\n for (let j = 2; j < offsetPoints.length; j += 2)\n {\n context.lineTo(offsetPoints[j], offsetPoints[j + 1]);\n }\n }\n else\n {\n context.moveTo(offsetPoints[offsetPoints.length - 2], offsetPoints[offsetPoints.length - 1]);\n\n for (let j = offsetPoints.length - 4; j >= 0; j -= 2)\n {\n context.lineTo(offsetPoints[j], offsetPoints[j + 1]);\n }\n }\n\n if ((holes[k].shape as Polygon).closeStroke)\n {\n context.closePath();\n }\n }\n }\n\n context.globalAlpha = lineStyle.alpha * worldAlpha;\n context.strokeStyle = contextStrokeStyle;\n context.stroke();\n }\n\n /**\n * Paint Ellipse\n * @private\n * @param shape - Shape to be drawn\n * @param fillStyle - Fill for the shape\n * @param lineStyle - Line style for the shape\n * @param contextFillStyle - The canvas context fill style\n * @param worldAlpha - The multiplied alpha of the displayObject\n * @param context - The canvas context\n */\n private paintEllipse(\n shape: Ellipse, fillStyle: FillStyle, lineStyle: LineStyle,\n contextFillStyle: string | CanvasPattern, worldAlpha: number,\n context: CrossPlatformCanvasRenderingContext2D): void\n {\n // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas\n const w = shape.width * 2;\n const h = shape.height * 2;\n\n const x = shape.x - (w / 2);\n const y = shape.y - (h / 2);\n\n const kappa = 0.5522848;\n const ox = (w / 2) * kappa; // control point offset horizontal\n const oy = (h / 2) * kappa; // control point offset vertical\n const xe = x + w; // x-end\n const ye = y + h; // y-end\n const xm = x + (w / 2); // x-middle\n const ym = y + (h / 2); // y-middle\n\n if (lineStyle.alignment === 0)\n {\n context.save();\n }\n\n context.beginPath();\n context.moveTo(x, ym);\n context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);\n context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);\n context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);\n context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);\n context.closePath();\n\n if (lineStyle.alignment === 0)\n {\n context.clip();\n }\n\n if (fillStyle.visible)\n {\n context.globalAlpha = fillStyle.alpha * worldAlpha;\n context.fillStyle = contextFillStyle;\n context.fill();\n }\n\n if (lineStyle.alignment === 0)\n {\n context.restore();\n }\n }\n\n /**\n * Paint Rounded Rectangle\n * @private\n * @param shape - Shape to be drawn\n * @param fillStyle - Fill for the shape\n * @param lineStyle - Line style for the shape\n * @param contextFillStyle - The canvas context fill style\n * @param worldAlpha - The multiplied alpha of the displayObject\n * @param context - The canvas context\n */\n private paintRoundedRectangle(\n shape: RoundedRectangle, fillStyle: FillStyle, lineStyle: LineStyle,\n contextFillStyle: string | CanvasPattern, worldAlpha: number,\n context: CrossPlatformCanvasRenderingContext2D\n ): void\n {\n const rx = shape.x;\n const ry = shape.y;\n const width = shape.width;\n const height = shape.height;\n let radius = shape.radius;\n\n const maxRadius = Math.min(width, height) / 2;\n\n radius = radius > maxRadius ? maxRadius : radius;\n\n if (lineStyle.alignment === 0)\n {\n context.save();\n }\n\n context.beginPath();\n context.moveTo(rx, ry + radius);\n context.lineTo(rx, ry + height - radius);\n context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height);\n context.lineTo(rx + width - radius, ry + height);\n context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius);\n context.lineTo(rx + width, ry + radius);\n context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry);\n context.lineTo(rx + radius, ry);\n context.quadraticCurveTo(rx, ry, rx, ry + radius);\n context.closePath();\n\n if (lineStyle.alignment === 0)\n {\n context.clip();\n }\n\n if (fillStyle.visible)\n {\n context.globalAlpha = fillStyle.alpha * worldAlpha;\n context.fillStyle = contextFillStyle;\n context.fill();\n }\n\n if (lineStyle.alignment === 0)\n {\n context.restore();\n }\n }\n\n public setPatternTransform(pattern: CanvasPattern, matrix: Matrix): void\n {\n if (this._svgMatrix === false)\n {\n return;\n }\n if (!this._svgMatrix)\n {\n const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n\n if (svg && svg.createSVGMatrix)\n {\n this._svgMatrix = svg.createSVGMatrix();\n }\n if (!this._svgMatrix || !pattern.setTransform)\n {\n this._svgMatrix = false;\n\n return;\n }\n }\n\n (this._svgMatrix as DOMMatrix).a = matrix.a;\n (this._svgMatrix as DOMMatrix).b = matrix.b;\n (this._svgMatrix as DOMMatrix).c = matrix.c;\n (this._svgMatrix as DOMMatrix).d = matrix.d;\n (this._svgMatrix as DOMMatrix).e = matrix.tx;\n (this._svgMatrix as DOMMatrix).f = matrix.ty;\n pattern.setTransform((this._svgMatrix as DOMMatrix).inverse());\n }\n\n /** destroy graphics object */\n public destroy(): void\n {\n this.renderer = null;\n this._svgMatrix = null;\n this._tempMatrix = null;\n }\n}\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","import type { Polygon } from '@pixi/math';\nimport { SHAPES } from '@pixi/math';\n\nimport type { CanvasRenderer } from '../CanvasRenderer';\nimport type { Graphics } from '@pixi/graphics';\nimport type { MaskData } from '@pixi/core';\nimport type { Container } from '@pixi/display';\n\n/**\n * A set of functions used to handle masking.\n *\n * Sprite masking is not supported on the CanvasRenderer.\n * @class\n * @memberof PIXI\n */\nexport class CanvasMaskManager\n{\n /** A reference to the current renderer */\n private renderer: CanvasRenderer;\n private _foundShapes: Array<Graphics> = [];\n\n /** @param renderer - A reference to the current renderer */\n constructor(renderer: CanvasRenderer)\n {\n this.renderer = renderer;\n }\n\n /**\n * This method adds it to the current stack of masks.\n * @param maskData - the maskData that will be pushed\n */\n pushMask(maskData: MaskData | Graphics): void\n {\n const renderer = this.renderer;\n const maskObject = ((maskData as MaskData).maskObject || maskData) as Container;\n\n renderer.context.save();\n\n // TODO support sprite alpha masks??\n // lots of effort required. If demand is great enough..\n\n const foundShapes = this._foundShapes;\n\n this.recursiveFindShapes(maskObject, foundShapes);\n if (foundShapes.length > 0)\n {\n const { context } = renderer;\n\n context.beginPath();\n\n for (let i = 0; i < foundShapes.length; i++)\n {\n const shape = foundShapes[i];\n const transform = shape.transform.worldTransform;\n\n this.renderer.setContextTransform(transform);\n\n this.renderGraphicsShape(shape);\n }\n\n foundShapes.length = 0;\n context.clip();\n }\n }\n\n /**\n * Renders all PIXI.Graphics shapes in a subtree.\n * @param container - container to scan.\n * @param out - where to put found shapes\n */\n recursiveFindShapes(container: Container, out: Array<Graphics>): void\n {\n if ((container as Graphics).geometry && (container as Graphics).geometry.graphicsData)\n {\n out.push(container as Graphics);\n }\n\n const { children } = container;\n\n if (children)\n {\n for (let i = 0; i < children.length; i++)\n {\n this.recursiveFindShapes(children[i] as Container, out);\n }\n }\n }\n\n /**\n * Renders a PIXI.Graphics shape.\n * @param graphics - The object to render.\n */\n renderGraphicsShape(graphics: Graphics): void\n {\n graphics.finishPoly();\n\n const context = this.renderer.context;\n const graphicsData = graphics.geometry.graphicsData;\n const len = graphicsData.length;\n\n if (len === 0)\n {\n return;\n }\n\n for (let i = 0; i < len; i++)\n {\n const data = graphicsData[i];\n const shape = data.shape;\n\n if (shape.type === SHAPES.POLY)\n {\n let points = shape.points;\n const holes = data.holes;\n let outerArea;\n let innerArea;\n let px;\n let py;\n\n context.moveTo(points[0], points[1]);\n\n for (let j = 1; j < points.length / 2; j++)\n {\n context.lineTo(points[j * 2], points[(j * 2) + 1]);\n }\n if (holes.length > 0)\n {\n outerArea = 0;\n px = points[0];\n py = points[1];\n for (let j = 2; j + 2 < points.length; j += 2)\n {\n outerArea += ((points[j] - px) * (points[j + 3] - py))\n - ((points[j + 2] - px) * (points[j + 1] - py));\n }\n\n for (let k = 0; k < holes.length; k++)\n {\n points = (holes[k].shape as Polygon).points;\n\n if (!points)\n {\n continue;\n }\n\n innerArea = 0;\n px = points[0];\n py = points[1];\n for (let j = 2; j + 2 < points.length; j += 2)\n {\n innerArea += ((points[j] - px) * (points[j + 3] - py))\n - ((points[j + 2] - px) * (points[j + 1] - py));\n }\n\n if (innerArea * outerArea < 0)\n {\n context.moveTo(points[0], points[1]);\n\n for (let j = 2; j < points.length; j += 2)\n {\n context.lineTo(points[j], points[j + 1]);\n }\n }\n else\n {\n context.moveTo(points[points.length - 2], points[points.length - 1]);\n\n for (let j = points.length - 4; j >= 0; j -= 2)\n {\n context.lineTo(points[j], points[j + 1]);\n }\n }\n\n if ((holes[k].shape as Polygon).closeStroke)\n {\n context.closePath();\n }\n }\n }\n // if the first and last point are the same close the path - much neater :)\n if (points[0] === points[points.length - 2] && points[1] === points[points.length - 1])\n {\n context.closePath();\n }\n }\n else if (shape.type === SHAPES.RECT)\n {\n context.rect(shape.x, shape.y, shape.width, shape.height);\n context.closePath();\n }\n else if (shape.type === SHAPES.CIRC)\n {\n // TODO - need to be Undefined!\n context.arc(shape.x, shape.y, shape.radius, 0, 2 * Math.PI);\n context.closePath();\n }\n else if (shape.type === SHAPES.ELIP)\n {\n // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas\n\n const w = shape.width * 2;\n const h = shape.height * 2;\n\n const x = shape.x - (w / 2);\n const y = shape.y - (h / 2);\n\n const kappa = 0.5522848;\n const ox = (w / 2) * kappa; // control point offset horizontal\n const oy = (h / 2) * kappa; // control point offset vertical\n const xe = x + w; // x-end\n const ye = y + h; // y-end\n const xm = x + (w / 2); // x-middle\n const ym = y + (h / 2); // y-middle\n\n context.moveTo(x, ym);\n context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);\n context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);\n context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);\n context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);\n context.closePath();\n }\n else if (shape.type === SHAPES.RREC)\n {\n const rx = shape.x;\n const ry = shape.y;\n const width = shape.width;\n const height = shape.height;\n let radius = shape.radius;\n\n const maxRadius = Math.min(width, height) / 2;\n\n radius = radius > maxRadius ? maxRadius : radius;\n\n context.moveTo(rx, ry + radius);\n context.lineTo(rx, ry + height - radius);\n context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height);\n context.lineTo(rx + width - radius, ry + height);\n context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius);\n context.lineTo(rx + width, ry + radius);\n context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry);\n context.lineTo(rx + radius, ry);\n context.quadraticCurveTo(rx, ry, rx, ry + radius);\n context.closePath();\n }\n }\n }\n\n /**\n * Restores the current drawing context to the state it was before the mask was applied.\n * @param renderer - The renderer context to use.\n */\n popMask(renderer: CanvasRenderer): void\n {\n renderer.context.restore();\n renderer.invalidateBlendMode();\n }\n\n /** Destroys this canvas mask manager. */\n public destroy(): void\n {\n /* empty */\n }\n}\n","/**\n * Creates a little colored canvas\n * @ignore\n * @param {string} color - The color to make the canvas\n * @returns {HTMLCanvasElement} a small canvas element\n */\nfunction createColoredCanvas(color: string): HTMLCanvasElement\n{\n const canvas = document.createElement('canvas');\n\n canvas.width = 6;\n canvas.height = 1;\n\n const context = canvas.getContext('2d');\n\n context.fillStyle = color;\n context.fillRect(0, 0, 6, 1);\n\n return canvas;\n}\n\n/**\n * Checks whether the Canvas BlendModes are supported by the current browser\n * @private\n * @returns {boolean} whether they are supported\n */\nexport function canUseNewCanvasBlendModes(): boolean\n{\n if (typeof document === 'undefined')\n {\n return false;\n }\n\n const magenta = createColoredCanvas('#ff00ff');\n const yellow = createColoredCanvas('#ffff00');\n\n const canvas = document.createElement('canvas');\n\n canvas.width = 6;\n canvas.height = 1;\n\n const context = canvas.getContext('2d');\n\n context.globalCompositeOperation = 'multiply';\n context.drawImage(magenta, 0, 0);\n context.drawImage(yellow, 2, 0);\n\n const imageData = context.getImageData(2, 0, 1, 1);\n\n if (!imageData)\n {\n return false;\n }\n\n const data = imageData.data;\n\n return (data[0] === 255 && data[1] === 0 && data[2] === 0);\n}\n","import {\n AbstractRenderer,\n CanvasResource,\n RenderTexture,\n BaseRenderTexture,\n extensions,\n ExtensionType } from '@pixi/core';\nimport { CanvasRenderTarget, sayHello, rgb2hex, hex2string, deprecation } from '@pixi/utils';\nimport { CanvasMaskManager } from './utils/CanvasMaskManager';\nimport { mapCanvasBlendModesToPixi } from './utils/mapCanvasBlendModesToPixi';\nimport { RENDERER_TYPE, SCALE_MODES, BLEND_MODES } from '@pixi/constants';\nimport { settings } from '@pixi/settings';\nimport { Matrix } from '@pixi/math';\n\nimport type { DisplayObject } from '@pixi/display';\nimport type {\n IRendererOptions,\n IRendererPlugin,\n IRendererPlugins,\n IRendererRenderOptions\n} from '@pixi/core';\n\nconst tempMatrix = new Matrix();\n\nexport interface ICanvasRendererPluginConstructor\n{\n new (renderer: CanvasRenderer, options?: any): IRendererPlugin;\n}\n\nexport interface ICanvasRendererPlugins\n{\n [key: string]: any;\n}\n\n/*\n * Different browsers support different smoothing property names\n * this is the list of all platform props.\n */\ntype SmoothingEnabledProperties =\n 'imageSmoothingEnabled' |\n 'webkitImageSmoothingEnabled' |\n 'mozImageSmoothingEnabled' |\n 'oImageSmoothingEnabled' |\n 'msImageSmoothingEnabled';\n\n/**\n * Rendering context for all browsers. This includes platform-specific\n * properties that are not included in the spec for CanvasRenderingContext2D\n * @private\n */\nexport interface CrossPlatformCanvasRenderingContext2D extends CanvasRenderingContext2D\n{\n webkitImageSmoothingEnabled: boolean;\n mozImageSmoothingEnabled: boolean;\n oImageSmoothingEnabled: boolean;\n msImageSmoothingEnabled: boolean;\n}\n\n/**\n * The CanvasRenderer draws the scene and all its content onto a 2d canvas.\n *\n * This renderer should be used for browsers that do not support WebGL.\n * Don't forget to add the CanvasRenderer.view to your DOM or you will not see anything!\n * @class\n * @memberof PIXI\n * @extends PIXI.AbstractRenderer\n */\nexport class CanvasRenderer extends AbstractRenderer\n{\n /**\n * Fired after rendering finishes.\n * @event PIXI.CanvasRenderer#postrender\n */\n /**\n * Fired before rendering starts.\n * @event PIXI.CanvasRenderer#prerender\n */\n\n /** The root canvas 2d context that everything is drawn with. */\n public readonly rootContext: CrossPlatformCanvasRenderingContext2D;\n /** The currently active canvas 2d context (could change with renderTextures) */\n public context: CrossPlatformCanvasRenderingContext2D;\n /** Boolean flag controlling canvas refresh. */\n public refresh = true;\n /**\n * Instance of a CanvasMaskManager, handles masking when using the canvas renderer.\n * @member {PIXI.CanvasMaskManager}\n */\n public maskManager: CanvasMaskManager = new CanvasMaskManager(this);\n /** The canvas property used to set the canvas smoothing property. */\n public smoothProperty: SmoothingEnabledProperties = 'imageSmoothingEnabled';\n /** Tracks the blend modes useful for this renderer. */\n public readonly blendModes: string[] = mapCanvasBlendModesToPixi();\n public renderingToScreen = false;\n\n private _activeBlendMode: BLEND_MODES = null;\n /** Projection transform, passed in render() stored here */\n private _projTransform: Matrix = null;\n\n /** @private */\n _outerBlend = false;\n\n /**\n * @param options - The optional renderer parameters\n * @param {number} [options.width=800] - the width of the screen\n * @param {number} [options.height=600] - the height of the screen\n * @param {HTMLCanvasElement} [options.view] - the canvas to use as a view, optional\n * @param {boolean} [options.useContextAlpha=true] - Pass-through value for canvas' context `alpha` property.\n * If you want to set transparency, please use `backgroundAlpha`. This option is for cases where the\n * canvas needs to be opaque, possibly for performance reasons on some older devices.\n * @param {boolean} [options.autoDensity=false] - Resizes renderer view in CSS pixels to allow for\n * resolutions other than 1\n * @param {boolean} [options.antialias=false] - sets antialias\n * @param {number} [options.resolution=PIXI.settings.RESOLUTION] - The resolution / device pixel ratio of the renderer.\n * @param {boolean} [options.preserveDrawingBuffer=false] - enables drawing buffer preservation,\n * enable this if you need to call toDataUrl on the webgl context.\n * @param {boolean} [options.clearBeforeRender=true] - This sets if the renderer will clear the canvas or\n * not before the new render pass.\n * @param {number} [options.backgroundColor=0x000000] - The background color of the rendered area\n * (shown if not transparent).\n * @param {number} [options.backgroundAlpha=1] - Value from 0 (fully transparent) to 1 (fully opaque).\n */\n constructor(options?: IRendererOptions)\n {\n super(RENDERER_TYPE.CANVAS, options);\n\n this.rootContext = this.view.getContext('2d', { alpha: this.useContextAlpha }) as\n CrossPlatformCanvasRenderingContext2D;\n\n this.context = this.rootContext;\n\n if (!this.rootContext.imageSmoothingEnabled)\n {\n const rc = this.rootContext;\n\n if (rc.webkitImageSmoothingEnabled)\n {\n this.smoothProperty = 'webkitImageSmoothingEnabled';\n }\n else if (rc.mozImageSmoothingEnabled)\n {\n this.smoothProperty = 'mozImageSmoothingEnabled';\n }\n else if (rc.oImageSmoothingEnabled)\n {\n this.smoothProperty = 'oImageSmoothingEnabled';\n }\n else if (rc.msImageSmoothingEnabled)\n {\n this.smoothProperty = 'msImageSmoothingEnabled';\n }\n }\n\n this.initPlugins(CanvasRenderer.__plugins);\n\n sayHello('Canvas');\n\n this.resize(this.options.width, this.options.height);\n }\n\n /** Adds a new system to the renderer. It does nothing in the CanvasRenderer. */\n addSystem(): this\n {\n return this;\n }\n\n /**\n * Renders the object to its WebGL view.\n * @param displayObject - The object to be rendered.\n * @param options - Object to use for render options.\n * @param {PIXI.RenderTexture} [options.renderTexture] - The render texture to render to.\n * @param {boolean} [options.clear=true] - Should the canvas be cleared before the new render.\n * @param {PIXI.Matrix} [options.transform] - A transform to apply to the render texture before rendering.\n * @param {boolean} [options.skipUpdateTransform=false] - Should we skip the update transform pass?\n */\n render(displayObject: DisplayObject, options?: IRendererRenderOptions): void;\n\n /**\n * Please use the `option` render arguments instead.\n * @deprecated Since 6.0.0\n * @param displayObject - The object to be rendered.\n * @param renderTexture - The render texture to render to.\n * @param clear - Should the canvas be cleared before the new render.\n * @param transform - A transform to apply to the render texture before rendering.\n * @param skipUpdateTransform - Should we skip the update transform pass?\n */\n render(displayObject: DisplayObject, renderTexture?: RenderTexture | BaseRenderTexture,\n clear?: boolean, transform?: Matrix, skipUpdateTransform?: boolean): void;\n\n /** @ignore */\n public render(displayObject: DisplayObject, options?: IRendererRenderOptions | RenderTexture | BaseRenderTexture): void\n {\n if (!this.view)\n {\n return;\n }\n\n let renderTexture: BaseRenderTexture | RenderTexture;\n let clear: boolean;\n let transform: Matrix;\n let skipUpdateTransform: boolean;\n\n if (options)\n {\n if (options instanceof RenderTexture || options instanceof BaseRenderTexture)\n {\n // #if _DEBUG\n deprecation('6.0.0', 'CanvasRenderer#render arguments changed, use options instead.');\n // #endif\n\n /* eslint-disable prefer-rest-params */\n renderTexture = options;\n clear = arguments[2];\n transform = arguments[3];\n skipUpdateTransform = arguments[4];\n /* eslint-enable prefer-rest-params */\n }\n else\n {\n renderTexture = options.renderTexture;\n clear = options.clear;\n transform = options.transform;\n skipUpdateTransform = options.skipUpdateTransform;\n }\n }\n\n // can be handy to know!\n this.renderingToScreen = !renderTexture;\n\n this.emit('prerender');\n\n const rootResolution = this.resolution;\n\n if (renderTexture)\n {\n renderTexture = renderTexture.castToBaseTexture() as BaseRenderTexture;\n\n if (!renderTexture._canvasRenderTarget)\n {\n renderTexture._canvasRenderTarget = new CanvasRenderTarget(\n renderTexture.width,\n renderTexture.height,\n renderTexture.resolution\n );\n renderTexture.resource = new CanvasResource(renderTexture._canvasRenderTarget.canvas);\n renderTexture.valid = true;\n }\n\n this.context = renderTexture._canvasRenderTarget.context as CrossPlatformCanvasRenderingContext2D;\n this.resolution = renderTexture._canvasRenderTarget.resolution;\n }\n else\n {\n this.context = this.rootContext;\n }\n\n const context = this.context;\n\n this._projTransform = transform || null;\n\n if (!renderTexture)\n {\n this._lastObjectRendered = displayObject;\n }\n\n if (!skipUpdateTransform)\n {\n // update the scene graph\n const cacheParent = displayObject.enableTempParent();\n\n displayObject.updateTransform();\n displayObject.disableTempParent(cacheParent);\n }\n\n context.save();\n context.setTransform(1, 0, 0, 1, 0, 0);\n context.globalAlpha = 1;\n this._activeBlendMode = BLEND_MODES.NORMAL;\n this._outerBlend = false;\n context.globalCompositeOperation = this.blendModes[BLEND_MODES.NORMAL];\n\n if (clear !== undefined ? clear : this.clearBeforeRender)\n {\n if (this.renderingToScreen)\n {\n context.clearRect(0, 0, this.width, this.height);\n\n if (this.backgroundAlpha > 0)\n {\n context.globalAlpha = this.useContextAlpha ? this.backgroundAlpha : 1;\n context.fillStyle = this._backgroundColorString;\n context.fillRect(0, 0, this.width, this.height);\n context.globalAlpha = 1;\n }\n }\n else\n {\n renderTexture = (renderTexture as BaseRenderTexture);\n renderTexture._canvasRenderTarget.clear();\n\n const clearColor = renderTexture.clearColor;\n\n if (clearColor[3] > 0)\n {\n context.globalAlpha = this.useContextAlpha ? clearColor[3] : 1;\n context.fillStyle = hex2string(rgb2hex(clearColor));\n context.fillRect(0, 0, renderTexture.realWidth, renderTexture.realHeight);\n context.globalAlpha = 1;\n }\n }\n }\n\n // TODO RENDER TARGET STUFF HERE..\n const tempContext = this.context;\n\n this.context = context;\n displayObject.renderCanvas(this);\n this.context = tempContext;\n\n context.restore();\n\n this.resolution = rootResolution;\n this._projTransform = null;\n\n this.emit('postrender');\n }\n\n /**\n * Sets matrix of context.\n * called only from render() methods\n * takes care about resolution\n * @param transform - world matrix of current element\n * @param roundPixels - whether to round (tx,ty) coords\n * @param localResolution - If specified, used instead of `renderer.resolution` for local scaling\n */\n setContextTransform(transform: Matrix, roundPixels?: boolean, localResolution?: number): void\n {\n let mat = transform;\n const proj = this._projTransform;\n const resolution = this.resolution;\n\n localResolution = localResolution || resolution;\n\n if (proj)\n {\n mat = tempMatrix;\n mat.copyFrom(transform);\n mat.prepend(proj);\n }\n\n if (roundPixels)\n {\n this.context.setTransform(\n mat.a * localResolution,\n mat.b * localResolution,\n mat.c * localResolution,\n mat.d * localResolution,\n (mat.tx * resolution) | 0,\n (mat.ty * resolution) | 0\n );\n }\n else\n {\n this.context.setTransform(\n mat.a * localResolution,\n mat.b * localResolution,\n mat.c * localResolution,\n mat.d * localResolution,\n mat.tx * resolution,\n mat.ty * resolution\n );\n }\n }\n\n /**\n * Clear the canvas of renderer.\n * @param {string} [clearColor] - Clear the canvas with this color, except the canvas is transparent.\n * @param {number} [alpha] - Alpha to apply to the background fill color.\n */\n public clear(clearColor: string = this._backgroundColorString, alpha: number = this.backgroundAlpha): void\n {\n const { context } = this;\n\n context.clearRect(0, 0, this.width, this.height);\n\n if (clearColor)\n {\n context.globalAlpha = this.useContextAlpha ? alpha : 1;\n context.fillStyle = clearColor;\n context.fillRect(0, 0, this.width, this.height);\n context.globalAlpha = 1;\n }\n }\n\n /**\n * Sets the blend mode of the renderer.\n * @param {number} blendMode - See {@link PIXI.BLEND_MODES} for valid values.\n * @param {boolean} [readyForOuterBlend=false] - Some blendModes are dangerous, they affect outer space of sprite.\n * Pass `true` only if you are ready to use them.\n */\n setBlendMode(blendMode: BLEND_MODES, readyForOuterBlend?: boolean): void\n {\n const outerBlend = blendMode === BLEND_MODES.SRC_IN\n || blendMode === BLEND_MODES.SRC_OUT\n || blendMode === BLEND_MODES.DST_IN\n || blendMode === BLEND_MODES.DST_ATOP;\n\n if (!readyForOuterBlend && outerBlend)\n {\n blendMode = BLEND_MODES.NORMAL;\n }\n\n if (this._activeBlendMode === blendMode)\n {\n return;\n }\n\n this._activeBlendMode = blendMode;\n this._outerBlend = outerBlend;\n this.context.globalCompositeOperation = this.blendModes[blendMode];\n }\n\n /**\n * Removes everything from the renderer and optionally removes the Canvas DOM element.\n * @param {boolean} [removeView=false] - Removes the Canvas element from the DOM.\n */\n public destroy(removeView?: boolean): void\n {\n // call the base destroy\n super.destroy(removeView);\n\n this.context = null;\n\n this.refresh = true;\n\n this.maskManager.destroy();\n this.maskManager = null;\n\n this.smoothProperty = null;\n }\n\n /**\n * Resizes the canvas view to the specified width and height.\n * @extends PIXI.AbstractRenderer#resize\n * @param desiredScreenWidth - the desired width of the screen\n * @param desiredScreenHeight - the desired height of the screen\n */\n public resize(desiredScreenWidth: number, desiredScreenHeight: number): void\n {\n super.resize(desiredScreenWidth, desiredScreenHeight);\n\n // reset the scale mode.. oddly this seems to be reset when the canvas is resized.\n // surely a browser bug?? Let PixiJS fix that for you..\n if (this.smoothProperty)\n {\n this.rootContext[this.smoothProperty] = (settings.SCALE_MODE === SCALE_MODES.LINEAR);\n }\n }\n\n /** Checks if blend mode has changed. */\n invalidateBlendMode(): void\n {\n this._activeBlendMode = this.blendModes.indexOf(this.context.globalCompositeOperation);\n }\n\n static __plugins: IRendererPlugins = {};\n\n /**\n * Collection of installed plugins. These are included by default in PIXI, but can be excluded\n * by creating a custom build. Consult the README for more information about creating custom\n * builds and excluding plugins.\n * @member {object} plugins\n * @readonly\n * @property {PIXI.AccessibilityManager} accessibility Support tabbing interactive elements.\n * @property {PIXI.CanvasExtract} extract Extract image data from renderer.\n * @property {PIXI.InteractionManager} interaction Handles mouse, touch and pointer events.\n * @property {PIXI.CanvasPrepare} prepare Pre-render display objects.\n */\n\n /**\n * Use the {@link PIXI.extensions.add} API to register plugins.\n * @deprecated since 6.5.0\n * @param pluginName - The name of the plugin.\n * @param ctor - The constructor function or class for the plugin.\n */\n static registerPlugin(pluginName: string, ctor: ICanvasRendererPluginConstructor): void\n {\n // #if _DEBUG\n deprecation('6.5.0', 'CanvasRenderer.registerPlugin() has been deprecated, please use extensions.add() instead.');\n // #endif\n extensions.add({\n name: pluginName,\n type: ExtensionType.CanvasRendererPlugin,\n ref: ctor,\n });\n }\n}\n\nextensions.handleByMap(ExtensionType.CanvasRendererPlugin, CanvasRenderer.__plugins);\n","import { BLEND_MODES } from '@pixi/constants';\nimport { canUseNewCanvasBlendModes } from './canUseNewCanvasBlendModes';\n\n/**\n * Maps blend combinations to Canvas.\n * @memberof PIXI\n * @function mapCanvasBlendModesToPixi\n * @private\n * @param {string[]} [array=[]] - The array to output into.\n * @returns {string[]} Mapped modes.\n */\n// TODO after upgrading to typeScript 4.6, replace `string[]` with `GlobalCompositeOperation[]`\nexport function mapCanvasBlendModesToPixi(array: string[] = []): string[]\n{\n if (canUseNewCanvasBlendModes())\n {\n array[BLEND_MODES.NORMAL] = 'source-over';\n array[BLEND_MODES.ADD] = 'lighter'; // IS THIS OK???\n array[BLEND_MODES.MULTIPLY] = 'multiply';\n array[BLEND_MODES.SCREEN] = 'screen';\n array[BLEND_MODES.OVERLAY] = 'overlay';\n array[BLEND_MODES.DARKEN] = 'darken';\n array[BLEND_MODES.LIGHTEN] = 'lighten';\n array[BLEND_MODES.COLOR_DODGE] = 'color-dodge';\n array[BLEND_MODES.COLOR_BURN] = 'color-burn';\n array[BLEND_MODES.HARD_LIGHT] = 'hard-light';\n array[BLEND_MODES.SOFT_LIGHT] = 'soft-light';\n array[BLEND_MODES.DIFFERENCE] = 'difference';\n array[BLEND_MODES.EXCLUSION] = 'exclusion';\n array[BLEND_MODES.HUE] = 'hue';\n array[BLEND_MODES.SATURATION] = 'saturation';\n array[BLEND_MODES.COLOR] = 'color';\n array[BLEND_MODES.LUMINOSITY] = 'luminosity';\n }\n else\n {\n // this means that the browser does not support the cool new blend modes in canvas 'cough' ie 'cough'\n array[BLEND_MODES.NORMAL] = 'source-over';\n array[BLEND_MODES.ADD] = 'lighter'; // IS THIS OK???\n array[BLEND_MODES.MULTIPLY] = 'source-over';\n array[BLEND_MODES.SCREEN] = 'source-over';\n array[BLEND_MODES.OVERLAY] = 'source-over';\n array[BLEND_MODES.DARKEN] = 'source-over';\n array[BLEND_MODES.LIGHTEN] = 'source-over';\n array[BLEND_MODES.COLOR_DODGE] = 'source-over';\n array[BLEND_MODES.COLOR_BURN] = 'source-over';\n array[BLEND_MODES.HARD_LIGHT] = 'source-over';\n array[BLEND_MODES.SOFT_LIGHT] = 'source-over';\n array[BLEND_MODES.DIFFERENCE] = 'source-over';\n array[BLEND_MODES.EXCLUSION] = 'source-over';\n array[BLEND_MODES.HUE] = 'source-over';\n array[BLEND_MODES.SATURATION] = 'source-over';\n array[BLEND_MODES.COLOR] = 'source-over';\n array[BLEND_MODES.LUMINOSITY] = 'source-over';\n }\n // not-premultiplied, only for webgl\n array[BLEND_MODES.NORMAL_NPM] = array[BLEND_MODES.NORMAL];\n array[BLEND_MODES.ADD_NPM] = array[BLEND_MODES.ADD];\n array[BLEND_MODES.SCREEN_NPM] = array[BLEND_MODES.SCREEN];\n\n // composite operations\n array[BLEND_MODES.SRC_IN] = 'source-in';\n array[BLEND_MODES.SRC_OUT] = 'source-out';\n array[BLEND_MODES.SRC_ATOP] = 'source-atop';\n array[BLEND_MODES.DST_OVER] = 'destination-over';\n array[BLEND_MODES.DST_IN] = 'destination-in';\n array[BLEND_MODES.DST_OUT] = 'destination-out';\n array[BLEND_MODES.DST_ATOP] = 'destination-atop';\n array[BLEND_MODES.XOR] = 'xor';\n\n // SUBTRACT from flash, does not exist in canvas\n array[BLEND_MODES.SUBTRACT] = 'source-over';\n\n return array;\n}\n","import { hex2rgb, rgb2hex } from '@pixi/utils';\nimport { canUseNewCanvasBlendModes } from './utils/canUseNewCanvasBlendModes';\n\nimport type { Texture } from '@pixi/core';\n\n/**\n * Utility methods for Sprite/Texture tinting.\n *\n * Tinting with the CanvasRenderer involves creating a new canvas to use as a texture,\n * so be aware of the performance implications.\n * @namespace PIXI.canvasUtils\n * @memberof PIXI\n */\nexport const canvasUtils = {\n canvas: null as HTMLCanvasElement,\n\n /**\n * Basically this method just needs a sprite and a color and tints the sprite with the given color.\n * @memberof PIXI.canvasUtils\n * @param {PIXI.Sprite} sprite - the sprite to tint\n * @param sprite.texture\n * @param {number} color - the color to use to tint the sprite with\n * @returns {HTMLCanvasElement} The tinted canvas\n */\n getTintedCanvas: (sprite: { texture: Texture }, color: number): HTMLCanvasElement | HTMLImageElement =>\n {\n const texture = sprite.texture;\n\n color = canvasUtils.roundColor(color);\n\n const stringColor = `#${(`00000${(color | 0).toString(16)}`).slice(-6)}`;\n\n texture.tintCache = texture.tintCache || {};\n\n const cachedCanvas = texture.tintCache[stringColor];\n\n let canvas: HTMLCanvasElement;\n\n if (cachedCanvas)\n {\n if (cachedCanvas.tintId === texture._updateID)\n {\n return texture.tintCache[stringColor];\n }\n\n canvas = texture.tintCache[stringColor] as HTMLCanvasElement;\n }\n else\n {\n canvas = document.createElement('canvas');\n }\n\n canvasUtils.tintMethod(texture, color, canvas);\n\n canvas.tintId = texture._updateID;\n\n if (canvasUtils.convertTintToImage)\n {\n // is this better?\n const tintImage = new Image();\n\n tintImage.src = (canvas as HTMLCanvasElement).toDataURL();\n\n texture.tintCache[stringColor] = tintImage;\n }\n else\n {\n texture.tintCache[stringColor] = canvas;\n }\n\n return canvas;\n },\n\n /**\n * Basically this method just needs a sprite and a color and tints the sprite with the given color.\n * @memberof PIXI.canvasUtils\n * @param {PIXI.Texture} texture - the sprite to tint\n * @param {number} color - the color to use to tint the sprite with\n * @returns {HTMLCanvasElement} The tinted canvas\n */\n getTintedPattern: (texture: Texture, color: number): CanvasPattern =>\n {\n color = canvasUtils.roundColor(color);\n\n const stringColor = `#${(`00000${(color | 0).toString(16)}`).slice(-6)}`;\n\n texture.patternCache = texture.patternCache || {};\n\n let pattern = texture.patternCache[stringColor];\n\n if (pattern && pattern.tintId === texture._updateID)\n {\n return pattern;\n }\n if (!canvasUtils.canvas)\n {\n canvasUtils.canvas = document.createElement('canvas');\n }\n canvasUtils.tintMethod(texture, color, canvasUtils.canvas);\n pattern = canvasUtils.canvas.getContext('2d').createPattern(canvasUtils.canvas, 'repeat');\n pattern.tintId = texture._updateID;\n texture.patternCache[stringColor] = pattern;\n\n return pattern;\n },\n\n /**\n * Tint a texture using the 'multiply' operation.\n * @memberof PIXI.canvasUtils\n * @param {PIXI.Texture} texture - the texture to tint\n * @param {number} color - the color to use to tint the sprite with\n * @param {HTMLCanvasElement} canvas - the current canvas\n */\n tintWithMultiply: (texture: Texture, color: number, canvas: HTMLCanvasElement): void =>\n {\n const context = canvas.getContext('2d');\n const crop = texture._frame.clone();\n const resolution = texture.baseTexture.resolution;\n\n crop.x *= resolution;\n crop.y *= resolution;\n crop.width *= resolution;\n crop.height *= resolution;\n\n canvas.width = Math.ceil(crop.width);\n canvas.height = Math.ceil(crop.height);\n\n context.save();\n context.fillStyle = `#${(`00000${(color | 0).toString(16)}`).slice(-6)}`;\n\n context.fillRect(0, 0, crop.width, crop.height);\n\n context.globalCompositeOperation = 'multiply';\n\n const source = texture.baseTexture.getDrawableSource();\n\n context.drawImage(\n source,\n crop.x,\n crop.y,\n crop.width,\n crop.height,\n 0,\n 0,\n crop.width,\n crop.height\n );\n\n context.globalCompositeOperation = 'destination-atop';\n\n context.drawImage(\n source,\n crop.x,\n crop.y,\n crop.width,\n crop.height,\n 0,\n 0,\n crop.width,\n crop.height\n );\n context.restore();\n },\n\n /**\n * Tint a texture using the 'overlay' operation.\n * @memberof PIXI.canvasUtils\n * @param {PIXI.Texture} texture - the texture to tint\n * @param {number} color - the color to use to tint the sprite with\n * @param {HTMLCanvasElement} canvas - the current canvas\n */\n tintWithOverlay: (texture: Texture, color: number, canvas: HTMLCanvasElement): void =>\n {\n const context = canvas.getContext('2d');\n const crop = texture._frame.clone();\n const resolution = texture.baseTexture.resolution;\n\n crop.x *= resolution;\n crop.y *= resolution;\n crop.width *= resolution;\n crop.height *= resolution;\n\n canvas.width = Math.ceil(crop.width);\n canvas.height = Math.ceil(crop.height);\n\n context.save();\n context.globalCompositeOperation = 'copy';\n context.fillStyle = `#${(`00000${(color | 0).toString(16)}`).slice(-6)}`;\n context.fillRect(0, 0, crop.width, crop.height);\n\n context.globalCompositeOperation = 'destination-atop';\n context.drawImage(\n texture.baseTexture.getDrawableSource(),\n crop.x,\n crop.y,\n crop.width,\n crop.height,\n 0,\n 0,\n crop.width,\n crop.height\n );\n\n // context.globalCompositeOperation = 'copy';\n context.restore();\n },\n\n /**\n * Tint a texture pixel per pixel.\n * @memberof PIXI.canvasUtils\n * @param {PIXI.Texture} texture - the texture to tint\n * @param {number} color - the color to use to tint the sprite with\n * @param {HTMLCanvasElement} canvas - the current canvas\n */\n tintWithPerPixel: (texture: Texture, color: number, canvas: HTMLCanvasElement): void =>\n {\n const context = canvas.getContext('2d');\n const crop = texture._frame.clone();\n const resolution = texture.baseTexture.resolution;\n\n crop.x *= resolution;\n crop.y *= resolution;\n crop.width *= resolution;\n crop.height *= resolution;\n\n canvas.width = Math.ceil(crop.width);\n canvas.height = Math.ceil(crop.height);\n\n context.save();\n context.globalCompositeOperation = 'copy';\n context.drawImage(\n texture.baseTexture.getDrawableSource(),\n crop.x,\n crop.y,\n crop.width,\n crop.height,\n 0,\n 0,\n crop.width,\n crop.height\n );\n context.restore();\n\n const rgbValues = hex2rgb(color);\n const r = rgbValues[0];\n const g = rgbValues[1];\n const b = rgbValues[2];\n\n const pixelData = context.getImageData(0, 0, crop.width, crop.height);\n\n const pixels = pixelData.data;\n\n for (let i = 0; i < pixels.length; i += 4)\n {\n pixels[i + 0] *= r;\n pixels[i + 1] *= g;\n pixels[i + 2] *= b;\n }\n\n context.putImageData(pixelData, 0, 0);\n },\n\n /**\n * Rounds the specified color according to the canvasUtils.cacheStepsPerColorChannel.\n * @memberof PIXI.canvasUtils\n * @param {number} color - the color to round, should be a hex color\n * @returns {number} The rounded color.\n */\n roundColor: (color: number): number =>\n {\n const step = canvasUtils.cacheStepsPerColorChannel;\n\n const rgbValues = hex2rgb(color);\n\n rgbValues[0] = Math.min(255, (rgbValues[0] / step) * step);\n rgbValues[1] = Math.min(255, (rgbValues[1] / step) * step);\n rgbValues[2] = Math.min(255, (rgbValues[2] / step) * step);\n\n return rgb2hex(rgbValues);\n },\n\n /**\n * Number of steps which will be used as a cap when rounding colors.\n * @memberof PIXI.canvasUtils\n * @type {number}\n */\n cacheStepsPerColorChannel: 8,\n\n /**\n * Tint cache boolean flag.\n * @memberof PIXI.canvasUtils\n * @type {boolean}\n */\n convertTintToImage: false,\n\n /**\n * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method.\n * @memberof PIXI.canvasUtils\n * @type {boolean}\n */\n canUseMultiply: canUseNewCanvasBlendModes(),\n\n /**\n * The tinting method that will be used.\n * @memberof PIXI.canvasUtils\n * @type {Function}\n */\n tintMethod: null as (texture: Texture, color: number, canvas: HTMLCanvasElement) => void,\n};\n\ncanvasUtils.tintMethod = canvasUtils.canUseMultiply ? canvasUtils.tintWithMultiply : canvasUtils.tintWithPerPixel;\n","import { Renderer } from '@pixi/core';\nimport { CanvasRenderer } from './CanvasRenderer';\n\nimport type { AbstractRenderer, IRendererOptionsAuto } from '@pixi/core';\n\n// Reference to Renderer.create static function\nconst parentCreate = Renderer.create;\n\n/**\n * Override the Renderer.create to fallback to use CanvasRenderer.\n * Also supports forceCanvas option with Application or autoDetectRenderer.\n * @param options\n * @private\n */\nRenderer.create = function create(options: IRendererOptionsAuto): AbstractRenderer\n{\n const forceCanvas = options && options.forceCanvas;\n\n if (!forceCanvas)\n {\n try\n {\n return parentCreate(options);\n }\n catch (err)\n {\n // swallow WebGL-unsupported error\n }\n }\n\n return new CanvasRenderer(options);\n};\n","import { BaseTexture, BaseRenderTexture, Texture } from '@pixi/core';\n\n/**\n * Get the drawable source, such as HTMLCanvasElement or HTMLImageElement suitable\n * for rendering with CanvasRenderer. Provided by **@pixi/canvas-renderer** package.\n * @method getDrawableSource\n * @memberof PIXI.BaseTexture#\n * @returns {PIXI.ICanvasImageSource} Source to render with CanvasRenderer\n */\nBaseTexture.prototype.getDrawableSource = function getDrawableSource(): CanvasImageSource\n{\n const resource = this.resource as any;\n\n return resource ? (resource.bitmap || resource.source) : null;\n};\n\n/**\n * A reference to the canvas render target (we only need one as this can be shared across renderers)\n * @protected\n * @member {PIXI.utils.CanvasRenderTarget} _canvasRenderTarget\n * @memberof PIXI.BaseRenderTexture#\n */\n\nBaseRenderTexture.prototype._canvasRenderTarget = null;\n\nTexture.prototype.patternCache = null;\n\nTexture.prototype.tintCache = null;\n","import { SCALE_MODES, BLEND_MODES } from '@pixi/constants';\nimport { Matrix, groupD8 } from '@pixi/math';\nimport { canvasUtils } from '@pixi/canvas-renderer';\nimport type { CanvasRenderer } from '@pixi/canvas-renderer';\nimport type { Sprite } from '@pixi/sprite';\nimport type { ExtensionMetadata } from '@pixi/core';\nimport { ExtensionType } from '@pixi/core';\n\nconst canvasRenderWorldTransform = new Matrix();\n\n/**\n * Types that can be passed to drawImage\n * @typedef {HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap} ICanvasImageSource\n * @memberof PIXI\n */\n\n/*\n * @author Mat Groves\n *\n * Big thanks to the very clever Matt DesLauriers <mattdesl> https://github.com/mattdesl/\n * for creating the original PixiJS version!\n * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that they now\n * share 4 bytes on the vertex buffer\n *\n * Heavily inspired by LibGDX's CanvasSpriteRenderer:\n * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/CanvasSpriteRenderer.java\n */\n\n/**\n * Renderer dedicated to drawing and batching sprites.\n * @class\n * @protected\n * @memberof PIXI\n */\nexport class CanvasSpriteRenderer\n{\n /** @ignore */\n static extension: ExtensionMetadata = {\n name: 'sprite',\n type: ExtensionType.CanvasRendererPlugin,\n };\n\n /** A reference to the current renderer */\n protected renderer: CanvasRenderer;\n\n /** @param renderer - A reference to the current renderer */\n constructor(renderer: CanvasRenderer)\n {\n this.renderer = renderer;\n }\n\n /**\n * Renders the sprite object.\n * @param sprite - the sprite to render when using this spritebatch\n */\n render(sprite: Sprite): void\n {\n const texture = sprite._texture;\n const renderer = this.renderer;\n const context = renderer.context;\n\n if (!texture.valid)\n {\n return;\n }\n\n const sourceWidth = texture._frame.width;\n const sourceHeight = texture._frame.height;\n\n let destWidth = texture._frame.width;\n let destHeight = texture._frame.height;\n\n if (texture.trim)\n {\n destWidth = texture.trim.width;\n destHeight = texture.trim.height;\n }\n\n let wt = sprite.transform.worldTransform;\n let dx = 0;\n let dy = 0;\n\n const source = texture.baseTexture.getDrawableSource();\n\n if (texture.orig.width <= 0 || texture.orig.height <= 0 || !texture.valid || !source)\n {\n return;\n }\n\n renderer.setBlendMode(sprite.blendMode, true);\n\n renderer.context.globalAlpha = sprite.worldAlpha;\n\n // If smoothingEnabled is supported and we need to change the smoothing property for sprite texture\n const smoothingEnabled = texture.baseTexture.scaleMode === SCALE_MODES.LINEAR;\n\n if (renderer.smoothProperty\n && renderer.context[renderer.smoothProperty] !== smoothingEnabled)\n {\n context[renderer.smoothProperty] = smoothingEnabled;\n }\n\n if (texture.trim)\n {\n dx = (texture.trim.width / 2) + texture.trim.x - (sprite.anchor.x * texture.orig.width);\n dy = (texture.trim.height / 2) + texture.trim.y - (sprite.anchor.y * texture.orig.height);\n }\n else\n {\n dx = (0.5 - sprite.anchor.x) * texture.orig.width;\n dy = (0.5 - sprite.anchor.y) * texture.orig.height;\n }\n\n if (texture.rotate)\n {\n wt.copyTo(canvasRenderWorldTransform);\n wt = canvasRenderWorldTransform;\n groupD8.matrixAppendRotationInv(wt, texture.rotate, dx, dy);\n // the anchor has already been applied above, so lets set it to zero\n dx = 0;\n dy = 0;\n\n const h = destWidth;\n\n destWidth = destHeight;\n destHeight = h;\n }\n\n dx -= destWidth / 2;\n dy -= destHeight / 2;\n\n renderer.setContextTransform(wt, sprite.roundPixels, 1);\n // Allow for pixel rounding\n if (sprite.roundPixels)\n {\n dx = dx | 0;\n dy = dy | 0;\n }\n\n const resolution = texture.baseTexture.resolution;\n const outerBlend = renderer._outerBlend;\n\n if (outerBlend)\n {\n context.save();\n context.beginPath();\n context.rect(\n dx * renderer.resolution,\n dy * renderer.resolution,\n destWidth * renderer.resolution,\n destHeight * renderer.resolution\n );\n context.clip();\n }\n\n if (sprite.tint !== 0xFFFFFF)\n {\n if (sprite._cachedTint !== sprite.tint || sprite._tintedCanvas.tintId !== sprite._texture._updateID)\n {\n sprite._cachedTint = sprite.tint;\n\n // TODO clean up caching - how to clean up the caches?\n sprite._tintedCanvas = canvasUtils.getTintedCanvas(sprite, sprite.tint);\n }\n\n context.drawImage(\n sprite._tintedCanvas,\n 0,\n 0,\n Math.floor(sourceWidth * resolution),\n Math.floor(sourceHeight * resolution),\n Math.floor(dx * renderer.resolution),\n Math.floor(dy * renderer.resolution),\n Math.floor(destWidth * renderer.resolution),\n Math.floor(destHeight * renderer.resolution)\n );\n }\n else\n {\n context.drawImage(\n source,\n texture._frame.x * resolution,\n texture._frame.y * resolution,\n Math.floor(sourceWidth * resolution),\n Math.floor(sourceHeight * resolution),\n Math.floor(dx * renderer.resolution),\n Math.floor(dy * renderer.resolution),\n Math.floor(destWidth * renderer.resolution),\n Math.floor(destHeight * renderer.resolution)\n );\n }\n\n if (outerBlend)\n {\n context.restore();\n }\n // just in case, leaking outer blend here will be catastrophic!\n renderer.setBlendMode(BLEND_MODES.NORMAL);\n }\n\n /** destroy the sprite object */\n destroy(): void\n {\n this.renderer = null;\n }\n}\n","import { Sprite } from '@pixi/sprite';\nimport type { CanvasRenderer } from '@pixi/canvas-renderer';\n\n/**\n * Cached tinted texture.\n * @memberof PIXI.Sprite#\n * @member {HTMLCanvasElement} _tintedCanvas\n * @protected\n */\nSprite.prototype._tintedCanvas = null;\n\n/**\n * Renders the object using the Canvas renderer\n * @private\n * @method _renderCanvas\n * @memberof PIXI.Sprite#\n * @param {PIXI.CanvasRenderer} renderer - The renderer\n */\nSprite.prototype._renderCanvas = function _renderCanvas(renderer: CanvasRenderer): void\n{\n renderer.plugins.sprite.render(this);\n};\n","/**\n * Different types of environments for WebGL.\n * @static\n * @memberof PIXI\n * @name ENV\n * @enum {number}\n * @property {number} WEBGL_LEGACY - Used for older v1 WebGL devices. PixiJS will aim to ensure compatibility\n * with older / less advanced devices. If you experience unexplained flickering prefer this environment.\n * @property {number} WEBGL - Version 1 of WebGL\n * @property {number} WEBGL2 - Version 2 of WebGL\n */\nexport enum ENV\n// eslint-disable-next-line @typescript-eslint/indent\n{\n WEBGL_LEGACY,\n WEBGL,\n WEBGL2,\n}\n\n/**\n * Constant to identify the Renderer Type.\n * @static\n * @memberof PIXI\n * @name RENDERER_TYPE\n * @enum {number}\n * @property {number} UNKNOWN - Unknown render type.\n * @property {number} WEBGL - WebGL render type.\n * @property {number} CANVAS - Canvas render type.\n */\nexport enum RENDERER_TYPE\n// eslint-disable-next-line @typescript-eslint/indent\n{\n UNKNOWN,\n WEBGL,\n CANVAS,\n}\n\n/**\n * Bitwise OR of masks that indicate the buffers to be cleared.\n * @static\n * @memberof PIXI\n * @name BUFFER_BITS\n * @enum {number}\n * @property {number} COLOR - Indicates the buffers currently enabled for color writing.\n * @property {number} DEPTH - Indicates the depth buffer.\n * @property {number} STENCIL - Indicates the stencil buffer.\n */\nexport enum BUFFER_BITS\n// eslint-disable-next-line @typescript-eslint/indent\n{\n COLOR = 0x00004000,\n DEPTH = 0x00000100,\n STENCIL = 0x00000400\n}\n\n/**\n * Various blend modes supported by PIXI.\n *\n * IMPORTANT - The WebGL renderer only supports the NORMAL, ADD, MULTIPLY and SCREEN blend modes.\n * Anything else will silently act like NORMAL.\n * @memberof PIXI\n * @name BLEND_MODES\n * @enum {number}\n * @property {number} NORMAL -\n * @property {number} ADD -\n * @property {number} MULTIPLY -\n * @property {number} SCREEN -\n * @property {number} OVERLAY -\n * @property {number} DARKEN -\n * @property {number} LIGHTEN -\n * @property {number} COLOR_DODGE -\n * @property {number} COLOR_BURN -\n * @property {number} HARD_LIGHT -\n * @property {number} SOFT_LIGHT -\n * @property {number} DIFFERENCE -\n * @property {number} EXCLUSION -\n * @property {number} HUE -\n * @property {number} SATURATION -\n * @property {number} COLOR -\n * @property {number} LUMINOSITY -\n * @property {number} NORMAL_NPM -\n * @property {number} ADD_NPM -\n * @property {number} SCREEN_NPM -\n * @property {number} NONE -\n * @property {number} SRC_IN -\n * @property {number} SRC_OUT -\n * @property {number} SRC_ATOP -\n * @property {number} DST_OVER -\n * @property {number} DST_IN -\n * @property {number} DST_OUT -\n * @property {number} DST_ATOP -\n * @property {number} SUBTRACT -\n * @property {number} SRC_OVER -\n * @property {number} ERASE -\n * @property {number} XOR -\n */\nexport enum BLEND_MODES\n// eslint-disable-next-line @typescript-eslint/indent\n{\n NORMAL = 0,\n ADD = 1,\n MULTIPLY = 2,\n SCREEN = 3,\n OVERLAY = 4,\n DARKEN = 5,\n LIGHTEN = 6,\n COLOR_DODGE = 7,\n COLOR_BURN = 8,\n HARD_LIGHT = 9,\n SOFT_LIGHT = 10,\n DIFFERENCE = 11,\n EXCLUSION = 12,\n HUE = 13,\n SATURATION = 14,\n COLOR = 15,\n LUMINOSITY = 16,\n NORMAL_NPM = 17,\n ADD_NPM = 18,\n SCREEN_NPM = 19,\n NONE = 20,\n\n SRC_OVER = 0,\n SRC_IN = 21,\n SRC_OUT = 22,\n SRC_ATOP = 23,\n DST_OVER = 24,\n DST_IN = 25,\n DST_OUT = 26,\n DST_ATOP = 27,\n ERASE = 26,\n SUBTRACT = 28,\n XOR = 29,\n}\n\n/**\n * Various webgl draw modes. These can be used to specify which GL drawMode to use\n * under certain situations and renderers.\n * @memberof PIXI\n * @static\n * @name DRAW_MODES\n * @enum {number}\n * @property {number} POINTS -\n * @property {number} LINES -\n * @property {number} LINE_LOOP -\n * @property {number} LINE_STRIP -\n * @property {number} TRIANGLES -\n * @property {number} TRIANGLE_STRIP -\n * @property {number} TRIANGLE_FAN -\n */\nexport enum DRAW_MODES\n// eslint-disable-next-line @typescript-eslint/indent\n{\n POINTS,\n LINES,\n LINE_LOOP,\n LINE_STRIP,\n TRIANGLES,\n TRIANGLE_STRIP,\n TRIANGLE_FAN,\n}\n\n/**\n * Various GL texture/resources formats.\n * @memberof PIXI\n * @static\n * @name FORMATS\n * @enum {number}\n * @property {number} [RGBA=6408] -\n * @property {number} [RGB=6407] -\n * @property {number} [RG=33319] -\n * @property {number} [RED=6403] -\n * @property {number} [RGBA_INTEGER=36249] -\n * @property {number} [RGB_INTEGER=36248] -\n * @property {number} [RG_INTEGER=33320] -\n * @property {number} [RED_INTEGER=36244] -\n * @property {number} [ALPHA=6406] -\n * @property {number} [LUMINANCE=6409] -\n * @property {number} [LUMINANCE_ALPHA=6410] -\n * @property {number} [DEPTH_COMPONENT=6402] -\n * @property {number} [DEPTH_STENCIL=34041] -\n */\nexport enum FORMATS\n// eslint-disable-next-line @typescript-eslint/indent\n{\n RGBA = 6408,\n RGB = 6407,\n RG = 33319,\n RED = 6403,\n RGBA_INTEGER = 36249,\n RGB_INTEGER = 36248,\n RG_INTEGER = 33320,\n RED_INTEGER = 36244,\n ALPHA = 6406,\n LUMINANCE = 6409,\n LUMINANCE_ALPHA = 6410,\n DEPTH_COMPONENT = 6402,\n DEPTH_STENCIL = 34041,\n}\n\n/**\n * Various GL target types.\n * @memberof PIXI\n * @static\n * @name TARGETS\n * @enum {number}\n * @property {number} [TEXTURE_2D=3553] -\n * @property {number} [TEXTURE_CUBE_MAP=34067] -\n * @property {number} [TEXTURE_2D_ARRAY=35866] -\n * @property {number} [TEXTURE_CUBE_MAP_POSITIVE_X=34069] -\n * @property {number} [TEXTURE_CUBE_MAP_NEGATIVE_X=34070] -\n * @property {number} [TEXTURE_CUBE_MAP_POSITIVE_Y=34071] -\n * @property {number} [TEXTURE_CUBE_MAP_NEGATIVE_Y=34072] -\n * @property {number} [TEXTURE_CUBE_MAP_POSITIVE_Z=34073] -\n * @property {number} [TEXTURE_CUBE_MAP_NEGATIVE_Z=34074] -\n */\nexport enum TARGETS\n// eslint-disable-next-line @typescript-eslint/indent\n{\n TEXTURE_2D = 3553,\n TEXTURE_CUBE_MAP = 34067,\n TEXTURE_2D_ARRAY = 35866,\n TEXTURE_CUBE_MAP_POSITIVE_X = 34069,\n TEXTURE_CUBE_MAP_NEGATIVE_X = 34070,\n TEXTURE_CUBE_MAP_POSITIVE_Y = 34071,\n TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072,\n TEXTURE_CUBE_MAP_POSITIVE_Z = 34073,\n TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074,\n}\n\n/**\n * Various GL data format types.\n * @memberof PIXI\n * @static\n * @name TYPES\n * @enum {number}\n * @property {number} [UNSIGNED_BYTE=5121] -\n * @property {number} [UNSIGNED_SHORT=5123] -\n * @property {number} [UNSIGNED_SHORT_5_6_5=33635] -\n * @property {number} [UNSIGNED_SHORT_4_4_4_4=32819] -\n * @property {number} [UNSIGNED_SHORT_5_5_5_1=32820] -\n * @property {number} [UNSIGNED_INT=5125] -\n * @property {number} [UNSIGNED_INT_10F_11F_11F_REV=35899] -\n * @property {number} [UNSIGNED_INT_2_10_10_10_REV=33640] -\n * @property {number} [UNSIGNED_INT_24_8=34042] -\n * @property {number} [UNSIGNED_INT_5_9_9_9_REV=35902] -\n * @property {number} [BYTE=5120] -\n * @property {number} [SHORT=5122] -\n * @property {number} [INT=5124] -\n * @property {number} [FLOAT=5126] -\n * @property {number} [FLOAT_32_UNSIGNED_INT_24_8_REV=36269] -\n * @property {number} [HALF_FLOAT=36193] -\n */\nexport enum TYPES\n// eslint-disable-next-line @typescript-eslint/indent\n{\n UNSIGNED_BYTE = 5121,\n UNSIGNED_SHORT = 5123,\n UNSIGNED_SHORT_5_6_5 = 33635,\n UNSIGNED_SHORT_4_4_4_4 = 32819,\n UNSIGNED_SHORT_5_5_5_1 = 32820,\n UNSIGNED_INT = 5125,\n UNSIGNED_INT_10F_11F_11F_REV = 35899,\n UNSIGNED_INT_2_10_10_10_REV = 33640,\n UNSIGNED_INT_24_8 = 34042,\n UNSIGNED_INT_5_9_9_9_REV = 35902,\n BYTE = 5120,\n SHORT = 5122,\n INT = 5124,\n FLOAT = 5126,\n FLOAT_32_UNSIGNED_INT_24_8_REV = 36269,\n HALF_FLOAT = 36193,\n}\n\n/**\n * Various sampler types. Correspond to `sampler`, `isampler`, `usampler` GLSL types respectively.\n * WebGL1 works only with FLOAT.\n * @memberof PIXI\n * @static\n * @name SAMPLER_TYPES\n * @enum {number}\n * @property {number} [FLOAT=0] -\n * @property {number} [INT=1] -\n * @property {number} [UINT=2] -\n */\nexport enum SAMPLER_TYPES\n// eslint-disable-next-line @typescript-eslint/indent\n{\n FLOAT = 0,\n INT = 1,\n UINT = 2,\n}\n\n/**\n * The scale modes that are supported by pixi.\n *\n * The {@link PIXI.settings.SCALE_MODE} scale mode affects the default scaling mode of future operations.\n * It can be re-assigned to either LINEAR or NEAREST, depending upon suitability.\n * @memberof PIXI\n * @static\n * @name SCALE_MODES\n * @enum {number}\n * @property {number} LINEAR Smooth scaling\n * @property {number} NEAREST Pixelating scaling\n */\nexport enum SCALE_MODES\n// eslint-disable-next-line @typescript-eslint/indent\n{\n NEAREST,\n LINEAR,\n}\n\n/**\n * The wrap modes that are supported by pixi.\n *\n * The {@link PIXI.settings.WRAP_MODE} wrap mode affects the default wrapping mode of future operations.\n * It can be re-assigned to either CLAMP or REPEAT, depending upon suitability.\n * If the texture is non power of two then clamp will be used regardless as WebGL can\n * only use REPEAT if the texture is po2.\n *\n * This property only affects WebGL.\n * @name WRAP_MODES\n * @memberof PIXI\n * @static\n * @enum {number}\n * @property {number} CLAMP - The textures uvs are clamped\n * @property {number} REPEAT - The texture uvs tile and repeat\n * @property {number} MIRRORED_REPEAT - The texture uvs tile and repeat with mirroring\n */\nexport enum WRAP_MODES\n// eslint-disable-next-line @typescript-eslint/indent\n{\n CLAMP = 33071,\n REPEAT = 10497,\n MIRRORED_REPEAT = 33648,\n}\n\n/**\n * Mipmap filtering modes that are supported by pixi.\n *\n * The {@link PIXI.settings.MIPMAP_TEXTURES} affects default texture filtering.\n * Mipmaps are generated for a baseTexture if its `mipmap` field is `ON`,\n * or its `POW2` and texture dimensions are powers of 2.\n * Due to platform restriction, `ON` option will work like `POW2` for webgl-1.\n *\n * This property only affects WebGL.\n * @name MIPMAP_MODES\n * @memberof PIXI\n * @static\n * @enum {number}\n * @property {number} OFF - No mipmaps\n * @property {number} POW2 - Generate mipmaps if texture dimensions are pow2\n * @property {number} ON - Always generate mipmaps\n * @property {number} ON_MANUAL - Use mipmaps, but do not auto-generate them; this is used with a resource\n * that supports buffering each level-of-detail.\n */\nexport enum MIPMAP_MODES\n// eslint-disable-next-line @typescript-eslint/indent\n{\n OFF,\n POW2,\n ON,\n ON_MANUAL\n}\n\n/**\n * How to treat textures with premultiplied alpha\n * @name ALPHA_MODES\n * @memberof PIXI\n * @static\n * @enum {number}\n * @property {number} NO_PREMULTIPLIED_ALPHA - Source is not premultiplied, leave it like that.\n * Option for compressed and data textures that are created from typed arrays.\n * @property {number} PREMULTIPLY_ON_UPLOAD - Source is not premultiplied, premultiply on upload.\n * Default option, used for all loaded images.\n * @property {number} PREMULTIPLIED_ALPHA - Source is already premultiplied\n * Example: spine atlases with `_pma` suffix.\n * @property {number} NPM - Alias for NO_PREMULTIPLIED_ALPHA.\n * @property {number} UNPACK - Default option, alias for PREMULTIPLY_ON_UPLOAD.\n * @property {number} PMA - Alias for PREMULTIPLIED_ALPHA.\n */\nexport enum ALPHA_MODES\n// eslint-disable-next-line @typescript-eslint/indent\n{\n NPM = 0,\n UNPACK = 1,\n PMA = 2,\n NO_PREMULTIPLIED_ALPHA = 0,\n PREMULTIPLY_ON_UPLOAD = 1,\n PREMULTIPLY_ALPHA = 2, // deprecated, undocumented\n PREMULTIPLIED_ALPHA = 2,\n}\n\n/**\n * Configure whether filter textures are cleared after binding.\n *\n * Filter textures need not be cleared if the filter does not use pixel blending. {@link CLEAR_MODES.BLIT} will detect\n * this and skip clearing as an optimization.\n * @name CLEAR_MODES\n * @memberof PIXI\n * @static\n * @enum {number}\n * @property {number} BLEND - Do not clear the filter texture. The filter's output will blend on top of the output texture.\n * @property {number} CLEAR - Always clear the filter texture.\n * @property {number} BLIT - Clear only if {@link FilterSystem.forceClear} is set or if the filter uses pixel blending.\n * @property {number} NO - Alias for BLEND, same as `false` in earlier versions\n * @property {number} YES - Alias for CLEAR, same as `true` in earlier versions\n * @property {number} AUTO - Alias for BLIT\n */\nexport enum CLEAR_MODES\n// eslint-disable-next-line @typescript-eslint/indent\n{\n NO = 0,\n YES = 1,\n AUTO = 2,\n BLEND = 0,\n CLEAR = 1,\n BLIT = 2,\n}\n\n/**\n * The gc modes that are supported by pixi.\n *\n * The {@link PIXI.settings.GC_MODE} Garbage Collection mode for PixiJS textures is AUTO\n * If set to GC_MODE, the renderer will occasionally check textures usage. If they are not\n * used for a specified period of time they will be removed from the GPU. They will of course\n * be uploaded again when they are required. This is a silent behind the scenes process that\n * should ensure that the GPU does not get filled up.\n *\n * Handy for mobile devices!\n * This property only affects WebGL.\n * @name GC_MODES\n * @enum {number}\n * @static\n * @memberof PIXI\n * @property {number} AUTO - Garbage collection will happen periodically automatically\n * @property {number} MANUAL - Garbage collection will need to be called manually\n */\nexport enum GC_MODES\n// eslint-disable-next-line @typescript-eslint/indent\n{\n AUTO,\n MANUAL,\n}\n\n/**\n * Constants that specify float precision in shaders.\n * @name PRECISION\n * @memberof PIXI\n * @constant\n * @static\n * @enum {string}\n * @property {string} [LOW='lowp'] -\n * @property {string} [MEDIUM='mediump'] -\n * @property {string} [HIGH='highp'] -\n */\nexport enum PRECISION\n// eslint-disable-next-line @typescript-eslint/indent\n{\n LOW = 'lowp',\n MEDIUM = 'mediump',\n HIGH = 'highp',\n}\n\n/**\n * Constants for mask implementations.\n * We use `type` suffix because it leads to very different behaviours\n * @name MASK_TYPES\n * @memberof PIXI\n * @static\n * @enum {number}\n * @property {number} NONE - Mask is ignored\n * @property {number} SCISSOR - Scissor mask, rectangle on screen, cheap\n * @property {number} STENCIL - Stencil mask, 1-bit, medium, works only if renderer supports stencil\n * @property {number} SPRITE - Mask that uses SpriteMaskFilter, uses temporary RenderTexture\n * @property {number} COLOR - Color mask (RGBA)\n */\nexport enum MASK_TYPES\n// eslint-disable-next-line @typescript-eslint/indent\n{\n NONE = 0,\n SCISSOR = 1,\n STENCIL = 2,\n SPRITE = 3,\n COLOR = 4,\n}\n\n/**\n * Bitwise OR of masks that indicate the color channels that are rendered to.\n * @static\n * @memberof PIXI\n * @name COLOR_MASK_BITS\n * @enum {number}\n * @property {number} RED - Red channel.\n * @property {number} GREEN - Green channel\n * @property {number} BLUE - Blue channel.\n * @property {number} ALPHA - Alpha channel.\n */\nexport enum COLOR_MASK_BITS\n// eslint-disable-next-line @typescript-eslint/indent\n{\n RED = 0x1,\n GREEN = 0x2,\n BLUE = 0x4,\n ALPHA = 0x8\n}\n\n/**\n * Constants for multi-sampling antialiasing.\n * @see PIXI.Framebuffer#multisample\n * @name MSAA_QUALITY\n * @memberof PIXI\n * @static\n * @enum {number}\n * @property {number} NONE - No multisampling for this renderTexture\n * @property {number} LOW - Try 2 samples\n * @property {number} MEDIUM - Try 4 samples\n * @property {number} HIGH - Try 8 samples\n */\nexport enum MSAA_QUALITY\n// eslint-disable-next-line @typescript-eslint/indent\n{\n NONE = 0,\n LOW = 2,\n MEDIUM = 4,\n HIGH = 8\n}\n\n/**\n * Constants for various buffer types in Pixi\n * @see PIXI.BUFFER_TYPE\n * @name BUFFER_TYPE\n * @memberof PIXI\n * @static\n * @enum {number}\n * @property {number} ELEMENT_ARRAY_BUFFER - buffer type for using as an index buffer\n * @property {number} ARRAY_BUFFER - buffer type for using attribute data\n * @property {number} UNIFORM_BUFFER - the buffer type is for uniform buffer objects\n */\nexport enum BUFFER_TYPE\n// eslint-disable-next-line @typescript-eslint/indent\n{\n ELEMENT_ARRAY_BUFFER = 34963,\n ARRAY_BUFFER = 34962,\n // NOT YET SUPPORTED\n UNIFORM_BUFFER = 35345,\n}\n","/**\n * A Runner is a highly performant and simple alternative to signals. Best used in situations\n * where events are dispatched to many objects at high frequency (say every frame!)\n *\n *\n * like a signal..\n * ```\n * import { Runner } from '@pixi/runner';\n *\n * const myObject = {\n * loaded: new Runner('loaded')\n * }\n *\n * const listener = {\n * loaded: function(){\n * // thin\n * }\n * }\n *\n * myObject.loaded.add(listener);\n *\n * myObject.loaded.emit();\n * ```\n *\n * Or for handling calling the same function on many items\n * ```\n * import { Runner } from '@pixi/runner';\n *\n * const myGame = {\n * update: new Runner('update')\n * }\n *\n * const gameObject = {\n * update: function(time){\n * // update my gamey state\n * }\n * }\n *\n * myGame.update.add(gameObject);\n *\n * myGame.update.emit(time);\n * ```\n * @memberof PIXI\n */\nexport class Runner\n{\n public items: any[];\n private _name: string;\n private _aliasCount: number;\n\n /**\n * @param name - The function name that will be executed on the listeners added to this Runner.\n */\n constructor(name: string)\n {\n this.items = [];\n this._name = name;\n this._aliasCount = 0;\n }\n\n /* eslint-disable jsdoc/require-param, jsdoc/check-param-names */\n /**\n * Dispatch/Broadcast Runner to all listeners added to the queue.\n * @param {...any} params - (optional) parameters to pass to each listener\n */\n /* eslint-enable jsdoc/require-param, jsdoc/check-param-names */\n public emit(a0?: unknown, a1?: unknown, a2?: unknown, a3?: unknown,\n a4?: unknown, a5?: unknown, a6?: unknown, a7?: unknown): this\n {\n if (arguments.length > 8)\n {\n throw new Error('max arguments reached');\n }\n\n const { name, items } = this;\n\n this._aliasCount++;\n\n for (let i = 0, len = items.length; i < len; i++)\n {\n items[i][name](a0, a1, a2, a3, a4, a5, a6, a7);\n }\n\n if (items === this.items)\n {\n this._aliasCount--;\n }\n\n return this;\n }\n\n private ensureNonAliasedItems(): void\n {\n if (this._aliasCount > 0 && this.items.length > 1)\n {\n this._aliasCount = 0;\n this.items = this.items.slice(0);\n }\n }\n\n /**\n * Add a listener to the Runner\n *\n * Runners do not need to have scope or functions passed to them.\n * All that is required is to pass the listening object and ensure that it has contains a function that has the same name\n * as the name provided to the Runner when it was created.\n *\n * Eg A listener passed to this Runner will require a 'complete' function.\n *\n * ```\n * import { Runner } from '@pixi/runner';\n *\n * const complete = new Runner('complete');\n * ```\n *\n * The scope used will be the object itself.\n * @param {any} item - The object that will be listening.\n */\n public add(item: unknown): this\n {\n if ((item as any)[this._name])\n {\n this.ensureNonAliasedItems();\n this.remove(item);\n this.items.push(item);\n }\n\n return this;\n }\n\n /**\n * Remove a single listener from the dispatch queue.\n * @param {any} item - The listener that you would like to remove.\n */\n public remove(item: unknown): this\n {\n const index = this.items.indexOf(item);\n\n if (index !== -1)\n {\n this.ensureNonAliasedItems();\n this.items.splice(index, 1);\n }\n\n return this;\n }\n\n /**\n * Check to see if the listener is already in the Runner\n * @param {any} item - The listener that you would like to check.\n */\n public contains(item: unknown): boolean\n {\n return this.items.indexOf(item) !== -1;\n }\n\n /** Remove all listeners from the Runner */\n public removeAll(): this\n {\n this.ensureNonAliasedItems();\n this.items.length = 0;\n\n return this;\n }\n\n /** Remove all references, don't use after this. */\n public destroy(): void\n {\n this.removeAll();\n this.items = null;\n this._name = null;\n }\n\n /**\n * `true` if there are no this Runner contains no listeners\n * @readonly\n */\n public get empty(): boolean\n {\n return this.items.length === 0;\n }\n\n /**\n * The name of the runner.\n * @readonly\n */\n public get name(): string\n {\n return this._name;\n }\n}\n\nObject.defineProperties(Runner.prototype, {\n /**\n * Alias for `emit`\n * @memberof PIXI.Runner#\n * @method dispatch\n * @see PIXI.Runner#emit\n */\n dispatch: { value: Runner.prototype.emit },\n /**\n * Alias for `emit`\n * @memberof PIXI.Runner#\n * @method run\n * @see PIXI.Runner#emit\n */\n run: { value: Runner.prototype.emit },\n});\n","import { settings } from '@pixi/settings';\nimport { ENV } from '@pixi/constants';\nimport { isMobile } from '@pixi/utils';\n\n/**\n * The maximum support for using WebGL. If a device does not\n * support WebGL version, for instance WebGL 2, it will still\n * attempt to fallback support to WebGL 1. If you want to\n * explicitly remove feature support to target a more stable\n * baseline, prefer a lower environment.\n *\n * Due to {@link https://bugs.chromium.org/p/chromium/issues/detail?id=934823|bug in chromium}\n * we disable webgl2 by default for all non-apple mobile devices.\n * @static\n * @name PREFER_ENV\n * @memberof PIXI.settings\n * @type {number}\n * @default PIXI.ENV.WEBGL2\n */\nsettings.PREFER_ENV = isMobile.any ? ENV.WEBGL : ENV.WEBGL2;\n\n/**\n * If set to `true`, *only* Textures and BaseTexture objects stored\n * in the caches ({@link PIXI.utils.TextureCache TextureCache} and\n * {@link PIXI.utils.BaseTextureCache BaseTextureCache}) can be\n * used when calling {@link PIXI.Texture.from Texture.from} or\n * {@link PIXI.BaseTexture.from BaseTexture.from}.\n * Otherwise, these `from` calls throw an exception. Using this property\n * can be useful if you want to enforce preloading all assets with\n * {@link PIXI.Loader Loader}.\n * @static\n * @name STRICT_TEXTURE_CACHE\n * @memberof PIXI.settings\n * @type {boolean}\n * @default false\n */\nsettings.STRICT_TEXTURE_CACHE = false;\n\nexport { settings };\n","import type { Resource } from './Resource';\n\nimport type { IImageResourceOptions } from './ImageResource';\nimport type { ISize } from '@pixi/math';\nimport type { ICubeResourceOptions } from './CubeResource';\nimport type { ISVGResourceOptions } from './SVGResource';\nimport type { IVideoResourceOptions } from './VideoResource';\n\n/*\n * Allow flexible options for resource plugins\n */\nexport type IResourcePluginOptions = { [key: string]: any };\n\n/*\n * All allowable options for autoDetectResource\n */\nexport type IAutoDetectOptions = ISize\n| ICubeResourceOptions\n| IImageResourceOptions\n| ISVGResourceOptions\n| IVideoResourceOptions\n| IResourcePluginOptions;\n\n/**\n * Shape of supported resource plugins\n * @memberof PIXI\n */\nexport interface IResourcePlugin<R, RO>\n{\n test(source: unknown, extension: string): boolean;\n new (source: any, options?: RO): R;\n}\n\n/**\n * Collection of installed resource types, class must extend {@link PIXI.Resource}.\n * @example\n * class CustomResource extends PIXI.Resource {\n * // MUST have source, options constructor signature\n * // for auto-detected resources to be created.\n * constructor(source, options) {\n * super();\n * }\n * upload(renderer, baseTexture, glTexture) {\n * // upload with GL\n * return true;\n * }\n * // used to auto-detect resource\n * static test(source, extension) {\n * return extension === 'xyz'|| source instanceof SomeClass;\n * }\n * }\n * // Install the new resource type\n * PIXI.INSTALLED.push(CustomResource);\n * @memberof PIXI\n * @type {Array<PIXI.IResourcePlugin>}\n * @static\n * @readonly\n */\nexport const INSTALLED: Array<IResourcePlugin<any, any>> = [];\n\n/**\n * Create a resource element from a single source element. This\n * auto-detects which type of resource to create. All resources that\n * are auto-detectable must have a static `test` method and a constructor\n * with the arguments `(source, options?)`. Currently, the supported\n * resources for auto-detection include:\n * - {@link PIXI.ImageResource}\n * - {@link PIXI.CanvasResource}\n * - {@link PIXI.VideoResource}\n * - {@link PIXI.SVGResource}\n * - {@link PIXI.BufferResource}\n * @static\n * @memberof PIXI\n * @function autoDetectResource\n * @param {string|*} source - Resource source, this can be the URL to the resource,\n * a typed-array (for BufferResource), HTMLVideoElement, SVG data-uri\n * or any other resource that can be auto-detected. If not resource is\n * detected, it's assumed to be an ImageResource.\n * @param {object} [options] - Pass-through options to use for Resource\n * @param {number} [options.width] - Width of BufferResource or SVG rasterization\n * @param {number} [options.height] - Height of BufferResource or SVG rasterization\n * @param {boolean} [options.autoLoad=true] - Image, SVG and Video flag to start loading\n * @param {number} [options.scale=1] - SVG source scale. Overridden by width, height\n * @param {boolean} [options.createBitmap=PIXI.settings.CREATE_IMAGE_BITMAP] - Image option to create Bitmap object\n * @param {boolean} [options.crossorigin=true] - Image and Video option to set crossOrigin\n * @param {boolean} [options.autoPlay=true] - Video option to start playing video immediately\n * @param {number} [options.updateFPS=0] - Video option to update how many times a second the\n * texture should be updated from the video. Leave at 0 to update at every render\n * @returns {PIXI.Resource} The created resource.\n */\nexport function autoDetectResource<R extends Resource, RO>(source: unknown, options?: RO): R\n{\n if (!source)\n {\n return null;\n }\n\n let extension = '';\n\n if (typeof source === 'string')\n {\n // search for file extension: period, 3-4 chars, then ?, # or EOL\n const result = (/\\.(\\w{3,4})(?:$|\\?|#)/i).exec(source);\n\n if (result)\n {\n extension = result[1].toLowerCase();\n }\n }\n\n for (let i = INSTALLED.length - 1; i >= 0; --i)\n {\n const ResourcePlugin = INSTALLED[i] as IResourcePlugin<R, RO>;\n\n if (ResourcePlugin.test && ResourcePlugin.test(source, extension))\n {\n return new ResourcePlugin(source, options);\n }\n }\n\n throw new Error('Unrecognized source type to auto-detect Resource');\n}\n","import { Runner } from '@pixi/runner';\n\nimport type { BaseTexture } from '../BaseTexture';\nimport type { Renderer } from '../../Renderer';\nimport type { GLTexture } from '../GLTexture';\n\n/**\n * Base resource class for textures that manages validation and uploading, depending on its type.\n *\n * Uploading of a base texture to the GPU is required.\n * @memberof PIXI\n */\nexport abstract class Resource\n{\n /** The url of the resource */\n public src: string;\n\n /**\n * If resource has been destroyed.\n * @readonly\n * @default false\n */\n public destroyed: boolean;\n\n /**\n * `true` if resource is created by BaseTexture\n * useful for doing cleanup with BaseTexture destroy\n * and not cleaning up resources that were created\n * externally.\n */\n public internal: boolean;\n\n /** Internal width of the resource. */\n protected _width: number;\n\n /** Internal height of the resource. */\n protected _height: number;\n\n /**\n * Mini-runner for handling resize events\n * accepts 2 parameters: width, height\n * @member {Runner}\n * @private\n */\n protected onResize: Runner; // TODO: Should this be private? It doesn't seem to be used anywhere else.\n\n /**\n * Mini-runner for handling update events\n * @member {Runner}\n * @private\n */\n protected onUpdate: Runner;\n\n /**\n * Handle internal errors, such as loading errors\n * accepts 1 param: error\n * @member {Runner}\n * @private\n */\n protected onError: Runner;\n\n /**\n * @param width - Width of the resource\n * @param height - Height of the resource\n */\n constructor(width = 0, height = 0)\n {\n this._width = width;\n this._height = height;\n\n this.destroyed = false;\n this.internal = false;\n\n this.onResize = new Runner('setRealSize');\n this.onUpdate = new Runner('update');\n this.onError = new Runner('onError');\n }\n\n /**\n * Bind to a parent BaseTexture\n * @param baseTexture - Parent texture\n */\n bind(baseTexture: BaseTexture): void\n {\n this.onResize.add(baseTexture);\n this.onUpdate.add(baseTexture);\n this.onError.add(baseTexture);\n\n // Call a resize immediate if we already\n // have the width and height of the resource\n if (this._width || this._height)\n {\n this.onResize.emit(this._width, this._height);\n }\n }\n\n /**\n * Unbind to a parent BaseTexture\n * @param baseTexture - Parent texture\n */\n unbind(baseTexture: BaseTexture): void\n {\n this.onResize.remove(baseTexture);\n this.onUpdate.remove(baseTexture);\n this.onError.remove(baseTexture);\n }\n\n /**\n * Trigger a resize event\n * @param width - X dimension\n * @param height - Y dimension\n */\n resize(width: number, height: number): void\n {\n if (width !== this._width || height !== this._height)\n {\n this._width = width;\n this._height = height;\n this.onResize.emit(width, height);\n }\n }\n\n /**\n * Has been validated\n * @readonly\n */\n get valid(): boolean\n {\n return !!this._width && !!this._height;\n }\n\n /** Has been updated trigger event. */\n update(): void\n {\n if (!this.destroyed)\n {\n this.onUpdate.emit();\n }\n }\n\n /**\n * This can be overridden to start preloading a resource\n * or do any other prepare step.\n * @protected\n * @returns Handle the validate event\n */\n load(): Promise<Resource>\n {\n return Promise.resolve(this);\n }\n\n /**\n * The width of the resource.\n * @readonly\n */\n get width(): number\n {\n return this._width;\n }\n\n /**\n * The height of the resource.\n * @readonly\n */\n get height(): number\n {\n return this._height;\n }\n\n /**\n * Uploads the texture or returns false if it cant for some reason. Override this.\n * @param renderer - yeah, renderer!\n * @param baseTexture - the texture\n * @param glTexture - texture instance for this webgl context\n * @returns - true is success\n */\n abstract upload(renderer: Renderer, baseTexture: BaseTexture, glTexture: GLTexture): boolean;\n\n /**\n * Set the style, optional to override\n * @param _renderer - yeah, renderer!\n * @param _baseTexture - the texture\n * @param _glTexture - texture instance for this webgl context\n * @returns - `true` is success\n */\n style(_renderer: Renderer, _baseTexture: BaseTexture, _glTexture: GLTexture): boolean\n {\n return false;\n }\n\n /** Clean up anything, this happens when destroying is ready. */\n dispose(): void\n {\n // override\n }\n\n /**\n * Call when destroying resource, unbind any BaseTexture object\n * before calling this method, as reference counts are maintained\n * internally.\n */\n destroy(): void\n {\n if (!this.destroyed)\n {\n this.destroyed = true;\n this.dispose();\n this.onError.removeAll();\n this.onError = null;\n this.onResize.removeAll();\n this.onResize = null;\n this.onUpdate.removeAll();\n this.onUpdate = null;\n }\n }\n\n /**\n * Abstract, used to auto-detect resource type.\n * @param {*} _source - The source object\n * @param {string} _extension - The extension of source, if set\n */\n static test(_source: unknown, _extension?: string): boolean\n {\n return false;\n }\n}\n","import { Resource } from './Resource';\nimport { ALPHA_MODES } from '@pixi/constants';\n\nimport type { ISize } from '@pixi/math';\nimport type { BaseTexture } from '../BaseTexture';\nimport type { Renderer } from '../../Renderer';\nimport type { GLTexture } from '../GLTexture';\n/**\n * @interface SharedArrayBuffer\n */\n\n/**\n * Buffer resource with data of typed array.\n * @memberof PIXI\n */\nexport class BufferResource extends Resource\n{\n /** Source array Cannot be {@code ClampedUint8Array} because it cant be uploaded to WebGL */\n data: Float32Array | Uint8Array | Uint16Array | Int32Array | Uint32Array;\n\n /**\n * @param source - Source buffer\n * @param options - Options\n * @param {number} options.width - Width of the texture\n * @param {number} options.height - Height of the texture\n */\n constructor(source: Float32Array | Uint8Array | Uint16Array | Int32Array | Uint32Array, options: ISize)\n {\n const { width, height } = options || {};\n\n if (!width || !height)\n {\n throw new Error('BufferResource width or height invalid');\n }\n\n super(width, height);\n\n this.data = source;\n }\n\n /**\n * Upload the texture to the GPU.\n * @param renderer - Upload to the renderer\n * @param baseTexture - Reference to parent texture\n * @param glTexture - glTexture\n * @returns - true is success\n */\n upload(renderer: Renderer, baseTexture: BaseTexture, glTexture: GLTexture): boolean\n {\n const gl = renderer.gl;\n\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, baseTexture.alphaMode === ALPHA_MODES.UNPACK);\n\n const width = baseTexture.realWidth;\n const height = baseTexture.realHeight;\n\n if (glTexture.width === width && glTexture.height === height)\n {\n gl.texSubImage2D(\n baseTexture.target,\n 0,\n 0,\n 0,\n width,\n height,\n baseTexture.format,\n glTexture.type,\n this.data\n );\n }\n else\n {\n glTexture.width = width;\n glTexture.height = height;\n\n gl.texImage2D(\n baseTexture.target,\n 0,\n glTexture.internalFormat,\n width,\n height,\n 0,\n baseTexture.format,\n glTexture.type,\n this.data\n );\n }\n\n return true;\n }\n\n /** Destroy and don't use after this. */\n dispose(): void\n {\n this.data = null;\n }\n\n /**\n * Used to auto-detect the type of resource.\n * @param {*} source - The source object\n * @returns {boolean} `true` if <canvas>\n */\n static test(source: unknown): source is Float32Array | Uint8Array | Uint32Array\n {\n return source instanceof Float32Array\n || source instanceof Uint8Array\n || source instanceof Uint32Array;\n }\n}\n","import { BaseTextureCache, EventEmitter, isPow2, TextureCache, uid } from '@pixi/utils';\nimport { FORMATS, SCALE_MODES, TARGETS, TYPES, ALPHA_MODES } from '@pixi/constants';\nimport { Resource } from './resources/Resource';\nimport { BufferResource } from './resources/BufferResource';\nimport { autoDetectResource } from './resources/autoDetectResource';\nimport { settings } from '@pixi/settings';\n\nimport type { MSAA_QUALITY, MIPMAP_MODES, WRAP_MODES } from '@pixi/constants';\nimport type { IAutoDetectOptions } from './resources/autoDetectResource';\nimport type { GLTexture } from './GLTexture';\n\nconst defaultBufferOptions = {\n scaleMode: SCALE_MODES.NEAREST,\n format: FORMATS.RGBA,\n alphaMode: ALPHA_MODES.NPM,\n};\n\nexport type ImageSource = HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap;\n\nexport interface IBaseTextureOptions<RO = any>\n{\n alphaMode?: ALPHA_MODES;\n mipmap?: MIPMAP_MODES;\n anisotropicLevel?: number;\n scaleMode?: SCALE_MODES;\n width?: number;\n height?: number;\n wrapMode?: WRAP_MODES;\n format?: FORMATS;\n type?: TYPES;\n target?: TARGETS;\n resolution?: number;\n multisample?: MSAA_QUALITY;\n resourceOptions?: RO;\n pixiIdPrefix?: string;\n}\n\nexport interface BaseTexture extends GlobalMixins.BaseTexture, EventEmitter {}\n\n/**\n * A Texture stores the information that represents an image.\n * All textures have a base texture, which contains information about the source.\n * Therefore you can have many textures all using a single BaseTexture\n * @memberof PIXI\n * @typeParam R - The BaseTexture's Resource type.\n * @typeParam RO - The options for constructing resource.\n */\nexport class BaseTexture<R extends Resource = Resource, RO = IAutoDetectOptions> extends EventEmitter\n{\n /**\n * The width of the base texture set when the image has loaded\n * @readonly\n */\n public width: number;\n\n /**\n * The height of the base texture set when the image has loaded\n * @readonly\n */\n public height: number;\n\n /**\n * The resolution / device pixel ratio of the texture\n * @readonly\n * @default PIXI.settings.RESOLUTION\n */\n public resolution: number;\n\n /**\n * How to treat premultiplied alpha, see {@link PIXI.ALPHA_MODES}.\n * @member {PIXI.ALPHA_MODES}\n * @default PIXI.ALPHA_MODES.UNPACK\n */\n public alphaMode?: ALPHA_MODES;\n\n /**\n * Anisotropic filtering level of texture\n * @member {number}\n * @default PIXI.settings.ANISOTROPIC_LEVEL\n */\n public anisotropicLevel?: number;\n\n /**\n * The pixel format of the texture\n * @default PIXI.FORMATS.RGBA\n */\n public format?: FORMATS;\n\n /**\n * The type of resource data\n * @default PIXI.TYPES.UNSIGNED_BYTE\n */\n public type?: TYPES;\n\n /**\n * The target type\n * @default PIXI.TARGETS.TEXTURE_2D\n */\n public target?: TARGETS;\n\n /**\n * Global unique identifier for this BaseTexture\n * @protected\n */\n public readonly uid: number;\n\n /**\n * Used by automatic texture Garbage Collection, stores last GC tick when it was bound\n * @protected\n */\n touched: number;\n\n /**\n * Whether or not the texture is a power of two, try to use power of two textures as much\n * as you can\n * @readonly\n * @default false\n */\n isPowerOfTwo: boolean;\n\n /**\n * The map of render context textures where this is bound\n * @private\n */\n _glTextures: { [key: number]: GLTexture };\n\n /**\n * Used by TextureSystem to only update texture to the GPU when needed.\n * Please call `update()` to increment it.\n * @readonly\n */\n dirtyId: number;\n\n /**\n * Used by TextureSystem to only update texture style when needed.\n * @protected\n */\n dirtyStyleId: number;\n\n /**\n * Currently default cache ID.\n * @member {string}\n */\n public cacheId: string;\n\n /**\n * Generally speaking means when resource is loaded.\n * @readonly\n * @member {boolean}\n */\n public valid: boolean;\n\n /**\n * The collection of alternative cache ids, since some BaseTextures\n * can have more than one ID, short name and longer full URL\n * @member {Array<string>}\n * @readonly\n */\n public textureCacheIds: Array<string>;\n\n /**\n * Flag if BaseTexture has been destroyed.\n * @member {boolean}\n * @readonly\n */\n public destroyed: boolean;\n\n /**\n * The resource used by this BaseTexture, there can only\n * be one resource per BaseTexture, but textures can share\n * resources.\n * @member {PIXI.Resource}\n * @readonly\n */\n public resource: R;\n\n /**\n * Number of the texture batch, used by multi-texture renderers\n * @member {number}\n */\n _batchEnabled: number;\n\n /**\n * Location inside texture batch, used by multi-texture renderers\n * @member {number}\n */\n _batchLocation: number;\n\n /**\n * Whether its a part of another texture, handled by ArrayResource or CubeResource\n * @member {PIXI.BaseTexture}\n */\n parentTextureArray: BaseTexture;\n\n private _mipmap?: MIPMAP_MODES;\n private _scaleMode?: SCALE_MODES;\n private _wrapMode?: WRAP_MODES;\n\n /**\n * @param {PIXI.Resource|string|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement} [resource=null] -\n * The current resource to use, for things that aren't Resource objects, will be converted\n * into a Resource.\n * @param options - Collection of options\n * @param {PIXI.MIPMAP_MODES} [options.mipmap=PIXI.settings.MIPMAP_TEXTURES] - If mipmapping is enabled for texture\n * @param {number} [options.anisotropicLevel=PIXI.settings.ANISOTROPIC_LEVEL] - Anisotropic filtering level of texture\n * @param {PIXI.WRAP_MODES} [options.wrapMode=PIXI.settings.WRAP_MODE] - Wrap mode for textures\n * @param {PIXI.SCALE_MODES} [options.scaleMode=PIXI.settings.SCALE_MODE] - Default scale mode, linear, nearest\n * @param {PIXI.FORMATS} [options.format=PIXI.FORMATS.RGBA] - GL format type\n * @param {PIXI.TYPES} [options.type=PIXI.TYPES.UNSIGNED_BYTE] - GL data type\n * @param {PIXI.TARGETS} [options.target=PIXI.TARGETS.TEXTURE_2D] - GL texture target\n * @param {PIXI.ALPHA_MODES} [options.alphaMode=PIXI.ALPHA_MODES.UNPACK] - Pre multiply the image alpha\n * @param {number} [options.width=0] - Width of the texture\n * @param {number} [options.height=0] - Height of the texture\n * @param {number} [options.resolution=PIXI.settings.RESOLUTION] - Resolution of the base texture\n * @param {object} [options.resourceOptions] - Optional resource options,\n * see {@link PIXI.autoDetectResource autoDetectResource}\n */\n constructor(resource: R | ImageSource | string | any = null, options: IBaseTextureOptions<RO> = null)\n {\n super();\n\n options = options || {};\n\n const { alphaMode, mipmap, anisotropicLevel, scaleMode, width, height,\n wrapMode, format, type, target, resolution, resourceOptions } = options;\n\n // Convert the resource to a Resource object\n if (resource && !(resource instanceof Resource))\n {\n resource = autoDetectResource<R, RO>(resource, resourceOptions);\n resource.internal = true;\n }\n\n this.resolution = resolution || settings.RESOLUTION;\n this.width = Math.round((width || 0) * this.resolution) / this.resolution;\n this.height = Math.round((height || 0) * this.resolution) / this.resolution;\n this._mipmap = mipmap !== undefined ? mipmap : settings.MIPMAP_TEXTURES;\n this.anisotropicLevel = anisotropicLevel !== undefined ? anisotropicLevel : settings.ANISOTROPIC_LEVEL;\n this._wrapMode = wrapMode || settings.WRAP_MODE;\n this._scaleMode = scaleMode !== undefined ? scaleMode : settings.SCALE_MODE;\n this.format = format || FORMATS.RGBA;\n this.type = type || TYPES.UNSIGNED_BYTE;\n this.target = target || TARGETS.TEXTURE_2D;\n this.alphaMode = alphaMode !== undefined ? alphaMode : ALPHA_MODES.UNPACK;\n\n this.uid = uid();\n this.touched = 0;\n this.isPowerOfTwo = false;\n this._refreshPOT();\n\n this._glTextures = {};\n this.dirtyId = 0;\n this.dirtyStyleId = 0;\n this.cacheId = null;\n this.valid = width > 0 && height > 0;\n this.textureCacheIds = [];\n this.destroyed = false;\n this.resource = null;\n\n this._batchEnabled = 0;\n this._batchLocation = 0;\n this.parentTextureArray = null;\n\n /**\n * Fired when a not-immediately-available source finishes loading.\n * @protected\n * @event PIXI.BaseTexture#loaded\n * @param {PIXI.BaseTexture} baseTexture - Resource loaded.\n */\n\n /**\n * Fired when a not-immediately-available source fails to load.\n * @protected\n * @event PIXI.BaseTexture#error\n * @param {PIXI.BaseTexture} baseTexture - Resource errored.\n * @param {ErrorEvent} event - Load error event.\n */\n\n /**\n * Fired when BaseTexture is updated.\n * @protected\n * @event PIXI.BaseTexture#loaded\n * @param {PIXI.BaseTexture} baseTexture - Resource loaded.\n */\n\n /**\n * Fired when BaseTexture is updated.\n * @protected\n * @event PIXI.BaseTexture#update\n * @param {PIXI.BaseTexture} baseTexture - Instance of texture being updated.\n */\n\n /**\n * Fired when BaseTexture is destroyed.\n * @protected\n * @event PIXI.BaseTexture#dispose\n * @param {PIXI.BaseTexture} baseTexture - Instance of texture being destroyed.\n */\n\n // Set the resource\n this.setResource(resource);\n }\n\n /**\n * Pixel width of the source of this texture\n * @readonly\n */\n get realWidth(): number\n {\n return Math.round(this.width * this.resolution);\n }\n\n /**\n * Pixel height of the source of this texture\n * @readonly\n */\n get realHeight(): number\n {\n return Math.round(this.height * this.resolution);\n }\n\n /**\n * Mipmap mode of the texture, affects downscaled images\n * @default PIXI.settings.MIPMAP_TEXTURES\n */\n get mipmap(): MIPMAP_MODES\n {\n return this._mipmap;\n }\n set mipmap(value: MIPMAP_MODES)\n {\n if (this._mipmap !== value)\n {\n this._mipmap = value;\n this.dirtyStyleId++;\n }\n }\n\n /**\n * The scale mode to apply when scaling this texture\n * @default PIXI.settings.SCALE_MODE\n */\n get scaleMode(): SCALE_MODES\n {\n return this._scaleMode;\n }\n set scaleMode(value: SCALE_MODES)\n {\n if (this._scaleMode !== value)\n {\n this._scaleMode = value;\n this.dirtyStyleId++;\n }\n }\n\n /**\n * How the texture wraps\n * @default PIXI.settings.WRAP_MODE\n */\n get wrapMode(): WRAP_MODES\n {\n return this._wrapMode;\n }\n set wrapMode(value: WRAP_MODES)\n {\n if (this._wrapMode !== value)\n {\n this._wrapMode = value;\n this.dirtyStyleId++;\n }\n }\n\n /**\n * Changes style options of BaseTexture\n * @param scaleMode - Pixi scalemode\n * @param mipmap - enable mipmaps\n * @returns - this\n */\n setStyle(scaleMode?: SCALE_MODES, mipmap?: MIPMAP_MODES): this\n {\n let dirty;\n\n if (scaleMode !== undefined && scaleMode !== this.scaleMode)\n {\n this.scaleMode = scaleMode;\n dirty = true;\n }\n\n if (mipmap !== undefined && mipmap !== this.mipmap)\n {\n this.mipmap = mipmap;\n dirty = true;\n }\n\n if (dirty)\n {\n this.dirtyStyleId++;\n }\n\n return this;\n }\n\n /**\n * Changes w/h/resolution. Texture becomes valid if width and height are greater than zero.\n * @param desiredWidth - Desired visual width\n * @param desiredHeight - Desired visual height\n * @param resolution - Optionally set resolution\n * @returns - this\n */\n setSize(desiredWidth: number, desiredHeight: number, resolution?: number): this\n {\n resolution = resolution || this.resolution;\n\n return this.setRealSize(desiredWidth * resolution, desiredHeight * resolution, resolution);\n }\n\n /**\n * Sets real size of baseTexture, preserves current resolution.\n * @param realWidth - Full rendered width\n * @param realHeight - Full rendered height\n * @param resolution - Optionally set resolution\n * @returns - this\n */\n setRealSize(realWidth: number, realHeight: number, resolution?: number): this\n {\n this.resolution = resolution || this.resolution;\n this.width = Math.round(realWidth) / this.resolution;\n this.height = Math.round(realHeight) / this.resolution;\n this._refreshPOT();\n this.update();\n\n return this;\n }\n\n /**\n * Refresh check for isPowerOfTwo texture based on size\n * @private\n */\n protected _refreshPOT(): void\n {\n this.isPowerOfTwo = isPow2(this.realWidth) && isPow2(this.realHeight);\n }\n\n /**\n * Changes resolution\n * @param resolution - res\n * @returns - this\n */\n setResolution(resolution: number): this\n {\n const oldResolution = this.resolution;\n\n if (oldResolution === resolution)\n {\n return this;\n }\n\n this.resolution = resolution;\n\n if (this.valid)\n {\n this.width = Math.round(this.width * oldResolution) / resolution;\n this.height = Math.round(this.height * oldResolution) / resolution;\n this.emit('update', this);\n }\n\n this._refreshPOT();\n\n return this;\n }\n\n /**\n * Sets the resource if it wasn't set. Throws error if resource already present\n * @param resource - that is managing this BaseTexture\n * @returns - this\n */\n setResource(resource: R): this\n {\n if (this.resource === resource)\n {\n return this;\n }\n\n if (this.resource)\n {\n throw new Error('Resource can be set only once');\n }\n\n resource.bind(this);\n\n this.resource = resource;\n\n return this;\n }\n\n /** Invalidates the object. Texture becomes valid if width and height are greater than zero. */\n update(): void\n {\n if (!this.valid)\n {\n if (this.width > 0 && this.height > 0)\n {\n this.valid = true;\n this.emit('loaded', this);\n this.emit('update', this);\n }\n }\n else\n {\n this.dirtyId++;\n this.dirtyStyleId++;\n this.emit('update', this);\n }\n }\n\n /**\n * Handle errors with resources.\n * @private\n * @param event - Error event emitted.\n */\n onError(event: ErrorEvent): void\n {\n this.emit('error', this, event);\n }\n\n /**\n * Destroys this base texture.\n * The method stops if resource doesn't want this texture to be destroyed.\n * Removes texture from all caches.\n */\n destroy(): void\n {\n // remove and destroy the resource\n if (this.resource)\n {\n this.resource.unbind(this);\n // only destroy resourced created internally\n if (this.resource.internal)\n {\n this.resource.destroy();\n }\n this.resource = null;\n }\n\n if (this.cacheId)\n {\n delete BaseTextureCache[this.cacheId];\n delete TextureCache[this.cacheId];\n\n this.cacheId = null;\n }\n\n // finally let the WebGL renderer know..\n this.dispose();\n\n BaseTexture.removeFromCache(this);\n this.textureCacheIds = null;\n\n this.destroyed = true;\n }\n\n /**\n * Frees the texture from WebGL memory without destroying this texture object.\n * This means you can still use the texture later which will upload it to GPU\n * memory again.\n * @fires PIXI.BaseTexture#dispose\n */\n dispose(): void\n {\n this.emit('dispose', this);\n }\n\n /** Utility function for BaseTexture|Texture cast. */\n castToBaseTexture(): BaseTexture\n {\n return this;\n }\n\n /**\n * Helper function that creates a base texture based on the source you provide.\n * The source can be - image url, image element, canvas element. If the\n * source is an image url or an image element and not in the base texture\n * cache, it will be created and loaded.\n * @static\n * @param {string|string[]|HTMLImageElement|HTMLCanvasElement|SVGElement|HTMLVideoElement} source - The\n * source to create base texture from.\n * @param options - See {@link PIXI.BaseTexture}'s constructor for options.\n * @param {string} [options.pixiIdPrefix=pixiid] - If a source has no id, this is the prefix of the generated id\n * @param {boolean} [strict] - Enforce strict-mode, see {@link PIXI.settings.STRICT_TEXTURE_CACHE}.\n * @returns {PIXI.BaseTexture} The new base texture.\n */\n static from<R extends Resource = Resource, RO = IAutoDetectOptions>(source: ImageSource | string | string[],\n options?: IBaseTextureOptions<RO>, strict = settings.STRICT_TEXTURE_CACHE): BaseTexture<R>\n {\n const isFrame = typeof source === 'string';\n let cacheId = null;\n\n if (isFrame)\n {\n cacheId = source;\n }\n else\n {\n if (!(source as any)._pixiId)\n {\n const prefix = (options && options.pixiIdPrefix) || 'pixiid';\n\n (source as any)._pixiId = `${prefix}_${uid()}`;\n }\n\n cacheId = (source as any)._pixiId;\n }\n\n let baseTexture = BaseTextureCache[cacheId] as BaseTexture<R>;\n\n // Strict-mode rejects invalid cacheIds\n if (isFrame && strict && !baseTexture)\n {\n throw new Error(`The cacheId \"${cacheId}\" does not exist in BaseTextureCache.`);\n }\n\n if (!baseTexture)\n {\n baseTexture = new BaseTexture<R>(source, options);\n baseTexture.cacheId = cacheId;\n BaseTexture.addToCache(baseTexture, cacheId);\n }\n\n return baseTexture;\n }\n\n /**\n * Create a new BaseTexture with a BufferResource from a Float32Array.\n * RGBA values are floats from 0 to 1.\n * @param {Float32Array|Uint8Array} buffer - The optional array to use, if no data\n * is provided, a new Float32Array is created.\n * @param width - Width of the resource\n * @param height - Height of the resource\n * @param options - See {@link PIXI.BaseTexture}'s constructor for options.\n * Default properties are different from the constructor's defaults.\n * @param {PIXI.FORMATS} [options.format=PIXI.FORMATS.RGBA] - GL format type\n * @param {PIXI.ALPHA_MODES} [options.alphaMode=PIXI.ALPHA_MODES.NPM] - Image alpha, not premultiplied by default\n * @param {PIXI.SCALE_MODES} [options.scaleMode=PIXI.SCALE_MODES.NEAREST] - Scale mode, pixelating by default\n * @returns - The resulting new BaseTexture\n */\n static fromBuffer(buffer: Float32Array | Uint8Array,\n width: number, height: number, options?: IBaseTextureOptions): BaseTexture<BufferResource>\n {\n buffer = buffer || new Float32Array(width * height * 4);\n\n const resource = new BufferResource(buffer, { width, height });\n const type = buffer instanceof Float32Array ? TYPES.FLOAT : TYPES.UNSIGNED_BYTE;\n\n return new BaseTexture(resource, Object.assign(defaultBufferOptions, options || { width, height, type }));\n }\n\n /**\n * Adds a BaseTexture to the global BaseTextureCache. This cache is shared across the whole PIXI object.\n * @param {PIXI.BaseTexture} baseTexture - The BaseTexture to add to the cache.\n * @param {string} id - The id that the BaseTexture will be stored against.\n */\n static addToCache(baseTexture: BaseTexture, id: string): void\n {\n if (id)\n {\n if (baseTexture.textureCacheIds.indexOf(id) === -1)\n {\n baseTexture.textureCacheIds.push(id);\n }\n\n if (BaseTextureCache[id])\n {\n // eslint-disable-next-line no-console\n console.warn(`BaseTexture added to the cache with an id [${id}] that already had an entry`);\n }\n\n BaseTextureCache[id] = baseTexture;\n }\n }\n\n /**\n * Remove a BaseTexture from the global BaseTextureCache.\n * @param {string|PIXI.BaseTexture} baseTexture - id of a BaseTexture to be removed, or a BaseTexture instance itself.\n * @returns {PIXI.BaseTexture|null} The BaseTexture that was removed.\n */\n static removeFromCache(baseTexture: string | BaseTexture): BaseTexture | null\n {\n if (typeof baseTexture === 'string')\n {\n const baseTextureFromCache = BaseTextureCache[baseTexture];\n\n if (baseTextureFromCache)\n {\n const index = baseTextureFromCache.textureCacheIds.indexOf(baseTexture);\n\n if (index > -1)\n {\n baseTextureFromCache.textureCacheIds.splice(index, 1);\n }\n\n delete BaseTextureCache[baseTexture];\n\n return baseTextureFromCache;\n }\n }\n else if (baseTexture && baseTexture.textureCacheIds)\n {\n for (let i = 0; i < baseTexture.textureCacheIds.length; ++i)\n {\n delete BaseTextureCache[baseTexture.textureCacheIds[i]];\n }\n\n baseTexture.textureCacheIds.length = 0;\n\n return baseTexture;\n }\n\n return null;\n }\n\n /** Global number of the texture batch, used by multi-texture renderers. */\n static _globalBatch = 0;\n}\n","import { Resource } from './Resource';\nimport { BaseTexture } from '../BaseTexture';\nimport type { ISize } from '@pixi/math';\nimport type { IAutoDetectOptions } from './autoDetectResource';\nimport { autoDetectResource } from './autoDetectResource';\n\n/**\n * Resource that can manage several resource (items) inside.\n * All resources need to have the same pixel size.\n * Parent class for CubeResource and ArrayResource\n * @memberof PIXI\n */\nexport abstract class AbstractMultiResource extends Resource\n{\n /** Number of elements in array. */\n readonly length: number;\n\n /**\n * Collection of partial baseTextures that correspond to resources.\n * @readonly\n */\n items: Array<BaseTexture>;\n\n /**\n * Dirty IDs for each part.\n * @readonly\n */\n itemDirtyIds: Array<number>;\n\n /**\n * Promise when loading.\n * @default null\n */\n private _load: Promise<this>;\n\n /** Bound baseTexture, there can only be one. */\n baseTexture: BaseTexture;\n\n /**\n * @param length\n * @param options - Options to for Resource constructor\n * @param {number} [options.width] - Width of the resource\n * @param {number} [options.height] - Height of the resource\n */\n constructor(length: number, options?: ISize)\n {\n const { width, height } = options || {};\n\n super(width, height);\n\n this.items = [];\n this.itemDirtyIds = [];\n\n for (let i = 0; i < length; i++)\n {\n const partTexture = new BaseTexture();\n\n this.items.push(partTexture);\n // -2 - first run of texture array upload\n // -1 - texture item was allocated\n // >=0 - texture item uploaded , in sync with items[i].dirtyId\n this.itemDirtyIds.push(-2);\n }\n\n this.length = length;\n this._load = null;\n this.baseTexture = null;\n }\n\n /**\n * Used from ArrayResource and CubeResource constructors.\n * @param resources - Can be resources, image elements, canvas, etc. ,\n * length should be same as constructor length\n * @param options - Detect options for resources\n */\n protected initFromArray(resources: Array<any>, options?: IAutoDetectOptions): void\n {\n for (let i = 0; i < this.length; i++)\n {\n if (!resources[i])\n {\n continue;\n }\n if (resources[i].castToBaseTexture)\n {\n this.addBaseTextureAt(resources[i].castToBaseTexture(), i);\n }\n else if (resources[i] instanceof Resource)\n {\n this.addResourceAt(resources[i], i);\n }\n else\n {\n this.addResourceAt(autoDetectResource(resources[i], options), i);\n }\n }\n }\n\n /** Destroy this BaseImageResource. */\n dispose(): void\n {\n for (let i = 0, len = this.length; i < len; i++)\n {\n this.items[i].destroy();\n }\n this.items = null;\n this.itemDirtyIds = null;\n this._load = null;\n }\n\n /**\n * Set a baseTexture by ID\n * @param baseTexture\n * @param index - Zero-based index of resource to set\n * @returns - Instance for chaining\n */\n abstract addBaseTextureAt(baseTexture: BaseTexture, index: number): this;\n\n /**\n * Set a resource by ID\n * @param resource\n * @param index - Zero-based index of resource to set\n * @returns - Instance for chaining\n */\n addResourceAt(resource: Resource, index: number): this\n {\n if (!this.items[index])\n {\n throw new Error(`Index ${index} is out of bounds`);\n }\n\n // Inherit the first resource dimensions\n if (resource.valid && !this.valid)\n {\n this.resize(resource.width, resource.height);\n }\n\n this.items[index].setResource(resource);\n\n return this;\n }\n\n /**\n * Set the parent base texture.\n * @param baseTexture\n */\n bind(baseTexture: BaseTexture): void\n {\n if (this.baseTexture !== null)\n {\n throw new Error('Only one base texture per TextureArray is allowed');\n }\n super.bind(baseTexture);\n\n for (let i = 0; i < this.length; i++)\n {\n this.items[i].parentTextureArray = baseTexture;\n this.items[i].on('update', baseTexture.update, baseTexture);\n }\n }\n\n /**\n * Unset the parent base texture.\n * @param baseTexture\n */\n unbind(baseTexture: BaseTexture): void\n {\n super.unbind(baseTexture);\n\n for (let i = 0; i < this.length; i++)\n {\n this.items[i].parentTextureArray = null;\n this.items[i].off('update', baseTexture.update, baseTexture);\n }\n }\n\n /**\n * Load all the resources simultaneously\n * @returns - When load is resolved\n */\n load(): Promise<this>\n {\n if (this._load)\n {\n return this._load;\n }\n\n const resources = this.items.map((item) => item.resource).filter((item) => item);\n\n // TODO: also implement load part-by-part strategy\n const promises = resources.map((item) => item.load());\n\n this._load = Promise.all(promises)\n .then(() =>\n {\n const { realWidth, realHeight } = this.items[0];\n\n this.resize(realWidth, realHeight);\n\n return Promise.resolve(this);\n }\n );\n\n return this._load;\n }\n}\n","import { AbstractMultiResource } from './AbstractMultiResource';\nimport { TARGETS } from '@pixi/constants';\nimport type { BaseTexture } from '../BaseTexture';\n\nimport type { BaseImageResource } from './BaseImageResource';\nimport type { Renderer } from '../../Renderer';\nimport type { GLTexture } from '../GLTexture';\nimport type { ISize } from '@pixi/math';\n\n/**\n * A resource that contains a number of sources.\n * @memberof PIXI\n */\nexport class ArrayResource extends AbstractMultiResource\n{\n /**\n * @param source - Number of items in array or the collection\n * of image URLs to use. Can also be resources, image elements, canvas, etc.\n * @param options - Options to apply to {@link PIXI.autoDetectResource}\n * @param {number} [options.width] - Width of the resource\n * @param {number} [options.height] - Height of the resource\n */\n constructor(source: number | Array<any>, options?: ISize)\n {\n const { width, height } = options || {};\n\n let urls;\n let length: number;\n\n if (Array.isArray(source))\n {\n urls = source;\n length = source.length;\n }\n else\n {\n length = source;\n }\n\n super(length, { width, height });\n\n if (urls)\n {\n this.initFromArray(urls, options);\n }\n }\n\n /**\n * Set a baseTexture by ID,\n * ArrayResource just takes resource from it, nothing more\n * @param baseTexture\n * @param index - Zero-based index of resource to set\n * @returns - Instance for chaining\n */\n addBaseTextureAt(baseTexture: BaseTexture, index: number): this\n {\n if (baseTexture.resource)\n {\n this.addResourceAt(baseTexture.resource, index);\n }\n else\n {\n throw new Error('ArrayResource does not support RenderTexture');\n }\n\n return this;\n }\n\n /**\n * Add binding\n * @param baseTexture\n */\n bind(baseTexture: BaseTexture): void\n {\n super.bind(baseTexture);\n\n baseTexture.target = TARGETS.TEXTURE_2D_ARRAY;\n }\n\n /**\n * Upload the resources to the GPU.\n * @param renderer\n * @param texture\n * @param glTexture\n * @returns - whether texture was uploaded\n */\n upload(renderer: Renderer, texture: BaseTexture, glTexture: GLTexture): boolean\n {\n const { length, itemDirtyIds, items } = this;\n const { gl } = renderer;\n\n if (glTexture.dirtyId < 0)\n {\n gl.texImage3D(\n gl.TEXTURE_2D_ARRAY,\n 0,\n glTexture.internalFormat,\n this._width,\n this._height,\n length,\n 0,\n texture.format,\n glTexture.type,\n null\n );\n }\n\n for (let i = 0; i < length; i++)\n {\n const item = items[i];\n\n if (itemDirtyIds[i] < item.dirtyId)\n {\n itemDirtyIds[i] = item.dirtyId;\n if (item.valid)\n {\n gl.texSubImage3D(\n gl.TEXTURE_2D_ARRAY,\n 0,\n 0, // xoffset\n 0, // yoffset\n i, // zoffset\n item.resource.width,\n item.resource.height,\n 1,\n texture.format,\n glTexture.type,\n (item.resource as BaseImageResource).source\n );\n }\n }\n }\n\n return true;\n }\n}\n","import { Resource } from './Resource';\nimport { determineCrossOrigin } from '@pixi/utils';\nimport { ALPHA_MODES } from '@pixi/constants';\n\nimport type { BaseTexture, ImageSource } from '../BaseTexture';\nimport type { Renderer } from '../../Renderer';\nimport type { GLTexture } from '../GLTexture';\n\n/**\n * Base for all the image/canvas resources.\n * @memberof PIXI\n */\nexport class BaseImageResource extends Resource\n{\n /**\n * The source element.\n * @member {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|SVGElement}\n * @readonly\n */\n public source: ImageSource;\n\n /**\n * If set to `true`, will force `texImage2D` over `texSubImage2D` for uploading.\n * Certain types of media (e.g. video) using `texImage2D` is more performant.\n * @default false\n * @private\n */\n public noSubImage: boolean;\n\n /**\n * @param {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|SVGElement} source\n */\n constructor(source: ImageSource)\n {\n const sourceAny = source as any;\n const width = sourceAny.naturalWidth || sourceAny.videoWidth || sourceAny.width;\n const height = sourceAny.naturalHeight || sourceAny.videoHeight || sourceAny.height;\n\n super(width, height);\n\n this.source = source;\n this.noSubImage = false;\n }\n\n /**\n * Set cross origin based detecting the url and the crossorigin\n * @param element - Element to apply crossOrigin\n * @param url - URL to check\n * @param crossorigin - Cross origin value to use\n */\n static crossOrigin(element: HTMLImageElement | HTMLVideoElement, url: string, crossorigin?: boolean | string): void\n {\n if (crossorigin === undefined && url.indexOf('data:') !== 0)\n {\n element.crossOrigin = determineCrossOrigin(url);\n }\n else if (crossorigin !== false)\n {\n element.crossOrigin = typeof crossorigin === 'string' ? crossorigin : 'anonymous';\n }\n }\n\n /**\n * Upload the texture to the GPU.\n * @param renderer - Upload to the renderer\n * @param baseTexture - Reference to parent texture\n * @param glTexture\n * @param {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|SVGElement} [source] - (optional)\n * @returns - true is success\n */\n upload(renderer: Renderer, baseTexture: BaseTexture, glTexture: GLTexture, source?: ImageSource): boolean\n {\n const gl = renderer.gl;\n const width = baseTexture.realWidth;\n const height = baseTexture.realHeight;\n\n source = source || this.source;\n\n if (source instanceof HTMLImageElement)\n {\n if (!source.complete || source.naturalWidth === 0)\n {\n return false;\n }\n }\n else if (source instanceof HTMLVideoElement)\n {\n if (source.readyState <= 1)\n {\n return false;\n }\n }\n\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, baseTexture.alphaMode === ALPHA_MODES.UNPACK);\n\n if (!this.noSubImage\n && baseTexture.target === gl.TEXTURE_2D\n && glTexture.width === width\n && glTexture.height === height)\n {\n gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, baseTexture.format, glTexture.type, source);\n }\n else\n {\n glTexture.width = width;\n glTexture.height = height;\n\n gl.texImage2D(baseTexture.target, 0, glTexture.internalFormat, baseTexture.format, glTexture.type, source);\n }\n\n return true;\n }\n\n /**\n * Checks if source width/height was changed, resize can cause extra baseTexture update.\n * Triggers one update in any case.\n */\n update(): void\n {\n if (this.destroyed)\n {\n return;\n }\n\n const source = this.source as any;\n\n const width = source.naturalWidth || source.videoWidth || source.width;\n const height = source.naturalHeight || source.videoHeight || source.height;\n\n this.resize(width, height);\n\n super.update();\n }\n\n /** Destroy this {@link BaseImageResource} */\n dispose(): void\n {\n this.source = null;\n }\n}\n","import { BaseImageResource } from './BaseImageResource';\n\n/**\n * @interface OffscreenCanvas\n */\n\n/**\n * Resource type for HTMLCanvasElement.\n * @memberof PIXI\n */\nexport class CanvasResource extends BaseImageResource\n{\n /**\n * @param source - Canvas element to use\n */\n // eslint-disable-next-line @typescript-eslint/no-useless-constructor\n constructor(source: HTMLCanvasElement)\n {\n super(source);\n }\n\n /**\n * Used to auto-detect the type of resource.\n * @param {*} source - The source object\n * @returns {boolean} `true` if source is HTMLCanvasElement or OffscreenCanvas\n */\n static test(source: unknown): source is OffscreenCanvas | HTMLCanvasElement\n {\n const { OffscreenCanvas } = globalThis;\n\n // Check for browsers that don't yet support OffscreenCanvas\n if (OffscreenCanvas && source instanceof OffscreenCanvas)\n {\n return true;\n }\n\n return globalThis.HTMLCanvasElement && source instanceof HTMLCanvasElement;\n }\n}\n","import { AbstractMultiResource } from './AbstractMultiResource';\nimport { TARGETS } from '@pixi/constants';\n\nimport type { Resource } from './Resource';\nimport type { ISize } from '@pixi/math';\nimport type { ArrayFixed } from '@pixi/utils';\nimport type { BaseTexture } from '../BaseTexture';\nimport type { Renderer } from '../../Renderer';\nimport type { GLTexture } from '../GLTexture';\n\n/** Constructor options for CubeResource */\nexport interface ICubeResourceOptions extends ISize\n{\n /** Whether to auto-load resources */\n autoLoad?: boolean;\n\n /** In case BaseTextures are supplied, whether to copy them or use. */\n linkBaseTexture?: boolean;\n}\n\n/**\n * Resource for a CubeTexture which contains six resources.\n * @memberof PIXI\n */\nexport class CubeResource extends AbstractMultiResource\n{\n items: ArrayFixed<BaseTexture, 6>;\n\n /**\n * In case BaseTextures are supplied, whether to use same resource or bind baseTexture itself.\n * @protected\n */\n linkBaseTexture: boolean;\n\n /**\n * @param {Array<string|PIXI.Resource>} [source] - Collection of URLs or resources\n * to use as the sides of the cube.\n * @param options - ImageResource options\n * @param {number} [options.width] - Width of resource\n * @param {number} [options.height] - Height of resource\n * @param {number} [options.autoLoad=true] - Whether to auto-load resources\n * @param {number} [options.linkBaseTexture=true] - In case BaseTextures are supplied,\n * whether to copy them or use\n */\n constructor(source?: ArrayFixed<string | Resource, 6>, options?: ICubeResourceOptions)\n {\n const { width, height, autoLoad, linkBaseTexture } = options || {};\n\n if (source && source.length !== CubeResource.SIDES)\n {\n throw new Error(`Invalid length. Got ${source.length}, expected 6`);\n }\n\n super(6, { width, height });\n\n for (let i = 0; i < CubeResource.SIDES; i++)\n {\n this.items[i].target = TARGETS.TEXTURE_CUBE_MAP_POSITIVE_X + i;\n }\n\n this.linkBaseTexture = linkBaseTexture !== false;\n\n if (source)\n {\n this.initFromArray(source, options);\n }\n\n if (autoLoad !== false)\n {\n this.load();\n }\n }\n\n /**\n * Add binding.\n * @param baseTexture - parent base texture\n */\n bind(baseTexture: BaseTexture): void\n {\n super.bind(baseTexture);\n\n baseTexture.target = TARGETS.TEXTURE_CUBE_MAP;\n }\n\n addBaseTextureAt(baseTexture: BaseTexture, index: number, linkBaseTexture?: boolean): this\n {\n if (linkBaseTexture === undefined)\n {\n linkBaseTexture = this.linkBaseTexture;\n }\n\n if (!this.items[index])\n {\n throw new Error(`Index ${index} is out of bounds`);\n }\n\n if (!this.linkBaseTexture\n || baseTexture.parentTextureArray\n || Object.keys(baseTexture._glTextures).length > 0)\n {\n // copy mode\n if (baseTexture.resource)\n {\n this.addResourceAt(baseTexture.resource, index);\n }\n else\n {\n throw new Error(`CubeResource does not support copying of renderTexture.`);\n }\n }\n else\n {\n // link mode, the difficult one!\n baseTexture.target = TARGETS.TEXTURE_CUBE_MAP_POSITIVE_X + index;\n baseTexture.parentTextureArray = this.baseTexture;\n\n this.items[index] = baseTexture;\n }\n\n if (baseTexture.valid && !this.valid)\n {\n this.resize(baseTexture.realWidth, baseTexture.realHeight);\n }\n\n this.items[index] = baseTexture;\n\n return this;\n }\n\n /**\n * Upload the resource\n * @param renderer\n * @param _baseTexture\n * @param glTexture\n * @returns {boolean} true is success\n */\n upload(renderer: Renderer, _baseTexture: BaseTexture, glTexture: GLTexture): boolean\n {\n const dirty = this.itemDirtyIds;\n\n for (let i = 0; i < CubeResource.SIDES; i++)\n {\n const side = this.items[i];\n\n if (dirty[i] < side.dirtyId || glTexture.dirtyId < _baseTexture.dirtyId)\n {\n if (side.valid && side.resource)\n {\n side.resource.upload(renderer, side, glTexture);\n dirty[i] = side.dirtyId;\n }\n else if (dirty[i] < -1)\n {\n // either item is not valid yet, either its a renderTexture\n // allocate the memory\n renderer.gl.texImage2D(side.target, 0,\n glTexture.internalFormat,\n _baseTexture.realWidth,\n _baseTexture.realHeight,\n 0,\n _baseTexture.format,\n glTexture.type,\n null);\n dirty[i] = -1;\n }\n }\n }\n\n return true;\n }\n\n /** Number of texture sides to store for CubeResources. */\n static SIDES = 6;\n\n /**\n * Used to auto-detect the type of resource.\n * @param {*} source - The source object\n * @returns {boolean} `true` if source is an array of 6 elements\n */\n static test(source: unknown): source is ArrayFixed<string | Resource, 6>\n {\n return Array.isArray(source) && source.length === CubeResource.SIDES;\n }\n}\n","import { BaseImageResource } from './BaseImageResource';\nimport { settings } from '@pixi/settings';\nimport { ALPHA_MODES } from '@pixi/constants';\n\nimport type { BaseTexture } from '../BaseTexture';\nimport type { Renderer } from '../../Renderer';\nimport type { GLTexture } from '../GLTexture';\n\nexport interface IImageResourceOptions\n{\n /** Start loading process */\n autoLoad?: boolean;\n\n /** Whether its required to create a bitmap before upload. */\n createBitmap?: boolean;\n\n /** Load image using cross origin. */\n crossorigin?: boolean | string;\n\n /** Premultiply image alpha in bitmap. */\n alphaMode?: ALPHA_MODES;\n}\n\n/**\n * Resource type for HTMLImageElement.\n * @memberof PIXI\n */\nexport class ImageResource extends BaseImageResource\n{\n /** URL of the image source */\n url: string;\n\n /**\n * If the image should be disposed after upload\n * @default false\n */\n preserveBitmap: boolean;\n\n /**\n * If capable, convert the image using createImageBitmap API.\n * @default PIXI.settings.CREATE_IMAGE_BITMAP\n */\n createBitmap: boolean;\n\n /**\n * Controls texture alphaMode field\n * Copies from options\n * Default is `null`, copies option from baseTexture\n * @readonly\n */\n alphaMode: ALPHA_MODES;\n\n /**\n * The ImageBitmap element created for a {@code HTMLImageElement}.\n * @default null\n */\n bitmap: ImageBitmap;\n\n /**\n * Promise when loading.\n * @default null\n */\n private _load: Promise<ImageResource>;\n\n /** When process is completed */\n private _process: Promise<ImageResource>;\n\n /**\n * @param source - image source or URL\n * @param options\n * @param {boolean} [options.autoLoad=true] - start loading process\n * @param {boolean} [options.createBitmap=PIXI.settings.CREATE_IMAGE_BITMAP] - whether its required to create\n * a bitmap before upload\n * @param {boolean} [options.crossorigin=true] - Load image using cross origin\n * @param {PIXI.ALPHA_MODES} [options.alphaMode=PIXI.ALPHA_MODES.UNPACK] - Premultiply image alpha in bitmap\n */\n constructor(source: HTMLImageElement | string, options?: IImageResourceOptions)\n {\n options = options || {};\n\n if (!(source instanceof HTMLImageElement))\n {\n const imageElement = new Image();\n\n BaseImageResource.crossOrigin(imageElement, source, options.crossorigin);\n\n imageElement.src = source;\n source = imageElement;\n }\n\n super(source);\n\n // FireFox 68, and possibly other versions, seems like setting the HTMLImageElement#width and #height\n // to non-zero values before its loading completes if images are in a cache.\n // Because of this, need to set the `_width` and the `_height` to zero to avoid uploading incomplete images.\n // Please refer to the issue #5968 (https://github.com/pixijs/pixi.js/issues/5968).\n if (!source.complete && !!this._width && !!this._height)\n {\n this._width = 0;\n this._height = 0;\n }\n\n this.url = source.src;\n\n this._process = null;\n\n this.preserveBitmap = false;\n this.createBitmap = (options.createBitmap !== undefined\n ? options.createBitmap : settings.CREATE_IMAGE_BITMAP) && !!globalThis.createImageBitmap;\n this.alphaMode = typeof options.alphaMode === 'number' ? options.alphaMode : null;\n this.bitmap = null;\n\n this._load = null;\n\n if (options.autoLoad !== false)\n {\n this.load();\n }\n }\n\n /**\n * Returns a promise when image will be loaded and processed.\n * @param createBitmap - whether process image into bitmap\n */\n load(createBitmap?: boolean): Promise<ImageResource>\n {\n if (this._load)\n {\n return this._load;\n }\n\n if (createBitmap !== undefined)\n {\n this.createBitmap = createBitmap;\n }\n\n this._load = new Promise((resolve, reject): void =>\n {\n const source = this.source as HTMLImageElement;\n\n this.url = source.src;\n\n const completed = (): void =>\n {\n if (this.destroyed)\n {\n return;\n }\n source.onload = null;\n source.onerror = null;\n\n this.resize(source.width, source.height);\n this._load = null;\n\n if (this.createBitmap)\n {\n resolve(this.process());\n }\n else\n {\n resolve(this);\n }\n };\n\n if (source.complete && source.src)\n {\n completed();\n }\n else\n {\n source.onload = completed;\n source.onerror = (event): void =>\n {\n // Avoids Promise freezing when resource broken\n reject(event);\n this.onError.emit(event);\n };\n }\n });\n\n return this._load;\n }\n\n /**\n * Called when we need to convert image into BitmapImage.\n * Can be called multiple times, real promise is cached inside.\n * @returns - Cached promise to fill that bitmap\n */\n process(): Promise<ImageResource>\n {\n const source = this.source as HTMLImageElement;\n\n if (this._process !== null)\n {\n return this._process;\n }\n if (this.bitmap !== null || !globalThis.createImageBitmap)\n {\n return Promise.resolve(this);\n }\n\n const createImageBitmap = globalThis.createImageBitmap as any;\n const cors = !source.crossOrigin || source.crossOrigin === 'anonymous';\n\n this._process = fetch(source.src,\n {\n mode: cors ? 'cors' : 'no-cors'\n })\n .then((r) => r.blob())\n .then((blob) => createImageBitmap(blob,\n 0, 0, source.width, source.height,\n {\n premultiplyAlpha: this.alphaMode === ALPHA_MODES.UNPACK ? 'premultiply' : 'none',\n }))\n .then((bitmap: ImageBitmap) =>\n {\n if (this.destroyed)\n {\n return Promise.reject();\n }\n this.bitmap = bitmap;\n this.update();\n this._process = null;\n\n return Promise.resolve(this);\n });\n\n return this._process;\n }\n\n /**\n * Upload the image resource to GPU.\n * @param renderer - Renderer to upload to\n * @param baseTexture - BaseTexture for this resource\n * @param glTexture - GLTexture to use\n * @returns {boolean} true is success\n */\n upload(renderer: Renderer, baseTexture: BaseTexture, glTexture: GLTexture): boolean\n {\n if (typeof this.alphaMode === 'number')\n {\n // bitmap stores unpack premultiply flag, we dont have to notify texImage2D about it\n\n baseTexture.alphaMode = this.alphaMode;\n }\n\n if (!this.createBitmap)\n {\n return super.upload(renderer, baseTexture, glTexture);\n }\n if (!this.bitmap)\n {\n // yeah, ignore the output\n this.process();\n if (!this.bitmap)\n {\n return false;\n }\n }\n\n super.upload(renderer, baseTexture, glTexture, this.bitmap);\n\n if (!this.preserveBitmap)\n {\n // checks if there are other renderers that possibly need this bitmap\n\n let flag = true;\n\n const glTextures = baseTexture._glTextures;\n\n for (const key in glTextures)\n {\n const otherTex = glTextures[key];\n\n if (otherTex !== glTexture && otherTex.dirtyId !== baseTexture.dirtyId)\n {\n flag = false;\n break;\n }\n }\n\n if (flag)\n {\n if (this.bitmap.close)\n {\n this.bitmap.close();\n }\n\n this.bitmap = null;\n }\n }\n\n return true;\n }\n\n /** Destroys this resource. */\n dispose(): void\n {\n (this.source as HTMLImageElement).onload = null;\n (this.source as HTMLImageElement).onerror = null;\n\n super.dispose();\n\n if (this.bitmap)\n {\n this.bitmap.close();\n this.bitmap = null;\n }\n this._process = null;\n this._load = null;\n }\n\n /**\n * Used to auto-detect the type of resource.\n * @param {*} source - The source object\n * @returns {boolean} `true` if source is string or HTMLImageElement\n */\n static test(source: unknown): source is string | HTMLImageElement\n {\n return typeof source === 'string' || source instanceof HTMLImageElement;\n }\n}\n","import { uid } from '@pixi/utils';\nimport { BaseImageResource } from './BaseImageResource';\n\nimport type { ISize } from '@pixi/math';\n\nexport interface ISVGResourceOptions\n{\n source?: string;\n scale?: number;\n width?: number;\n height?: number;\n autoLoad?: boolean;\n crossorigin?: boolean | string;\n}\n/**\n * Resource type for SVG elements and graphics.\n * @memberof PIXI\n */\nexport class SVGResource extends BaseImageResource\n{\n /** Base64 encoded SVG element or URL for SVG file. */\n public readonly svg: string;\n\n /** The source scale to apply when rasterizing on load. */\n public readonly scale: number;\n\n /** A width override for rasterization on load. */\n public readonly _overrideWidth: number;\n\n /** A height override for rasterization on load. */\n public readonly _overrideHeight: number;\n\n /** Call when completely loaded. */\n private _resolve: () => void;\n\n /** Promise when loading */\n private _load: Promise<SVGResource>;\n\n /** Cross origin value to use */\n private _crossorigin?: boolean | string;\n\n /**\n * @param sourceBase64 - Base64 encoded SVG element or URL for SVG file.\n * @param {object} [options] - Options to use\n * @param {number} [options.scale=1] - Scale to apply to SVG. Overridden by...\n * @param {number} [options.width] - Rasterize SVG this wide. Aspect ratio preserved if height not specified.\n * @param {number} [options.height] - Rasterize SVG this high. Aspect ratio preserved if width not specified.\n * @param {boolean} [options.autoLoad=true] - Start loading right away.\n */\n constructor(sourceBase64: string, options?: ISVGResourceOptions)\n {\n options = options || {};\n\n super(document.createElement('canvas'));\n this._width = 0;\n this._height = 0;\n\n this.svg = sourceBase64;\n this.scale = options.scale || 1;\n this._overrideWidth = options.width;\n this._overrideHeight = options.height;\n\n this._resolve = null;\n this._crossorigin = options.crossorigin;\n this._load = null;\n\n if (options.autoLoad !== false)\n {\n this.load();\n }\n }\n\n load(): Promise<SVGResource>\n {\n if (this._load)\n {\n return this._load;\n }\n\n this._load = new Promise((resolve): void =>\n {\n // Save this until after load is finished\n this._resolve = (): void =>\n {\n this.resize(this.source.width, this.source.height);\n resolve(this);\n };\n\n // Convert SVG inline string to data-uri\n if (SVGResource.SVG_XML.test(this.svg.trim()))\n {\n if (!btoa)\n {\n throw new Error('Your browser doesn\\'t support base64 conversions.');\n }\n (this as any).svg = `data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(this.svg)))}`;\n }\n\n this._loadSvg();\n });\n\n return this._load;\n }\n\n /** Loads an SVG image from `imageUrl` or `data URL`. */\n private _loadSvg(): void\n {\n const tempImage = new Image();\n\n BaseImageResource.crossOrigin(tempImage, this.svg, this._crossorigin);\n tempImage.src = this.svg;\n\n tempImage.onerror = (event): void =>\n {\n if (!this._resolve)\n {\n return;\n }\n\n tempImage.onerror = null;\n this.onError.emit(event);\n };\n\n tempImage.onload = (): void =>\n {\n if (!this._resolve)\n {\n return;\n }\n\n const svgWidth = tempImage.width;\n const svgHeight = tempImage.height;\n\n if (!svgWidth || !svgHeight)\n {\n throw new Error('The SVG image must have width and height defined (in pixels), canvas API needs them.');\n }\n\n // Set render size\n let width = svgWidth * this.scale;\n let height = svgHeight * this.scale;\n\n if (this._overrideWidth || this._overrideHeight)\n {\n width = this._overrideWidth || this._overrideHeight / svgHeight * svgWidth;\n height = this._overrideHeight || this._overrideWidth / svgWidth * svgHeight;\n }\n width = Math.round(width);\n height = Math.round(height);\n\n // Create a canvas element\n const canvas = this.source as HTMLCanvasElement;\n\n canvas.width = width;\n canvas.height = height;\n (canvas as any)._pixiId = `canvas_${uid()}`;\n\n // Draw the Svg to the canvas\n canvas\n .getContext('2d')\n .drawImage(tempImage, 0, 0, svgWidth, svgHeight, 0, 0, width, height);\n\n this._resolve();\n this._resolve = null;\n };\n }\n\n /**\n * Get size from an svg string using a regular expression.\n * @param svgString - a serialized svg element\n * @returns - image extension\n */\n static getSize(svgString?: string): ISize\n {\n const sizeMatch = SVGResource.SVG_SIZE.exec(svgString);\n const size: any = {};\n\n if (sizeMatch)\n {\n size[sizeMatch[1]] = Math.round(parseFloat(sizeMatch[3]));\n size[sizeMatch[5]] = Math.round(parseFloat(sizeMatch[7]));\n }\n\n return size;\n }\n\n /** Destroys this texture. */\n dispose(): void\n {\n super.dispose();\n this._resolve = null;\n this._crossorigin = null;\n }\n\n /**\n * Used to auto-detect the type of resource.\n * @param {*} source - The source object\n * @param {string} extension - The extension of source, if set\n * @returns {boolean} - If the source is a SVG source or data file\n */\n static test(source: unknown, extension?: string): boolean\n {\n // url file extension is SVG\n return extension === 'svg'\n // source is SVG data-uri\n || (typeof source === 'string' && (/^data:image\\/svg\\+xml(;(charset=utf8|utf8))?;base64/).test(source))\n // source is SVG inline\n || (typeof source === 'string' && SVGResource.SVG_XML.test(source));\n }\n\n /**\n * Regular expression for SVG XML document.\n * @example <?xml version=\"1.0\" encoding=\"utf-8\" ?><!-- image/svg --><svg\n * @readonly\n */\n static SVG_XML = /^(<\\?xml[^?]+\\?>)?\\s*(<!--[^(-->)]*-->)?\\s*\\<svg/m;\n\n /**\n * Regular expression for SVG size.\n * @example <svg width=\"100\" height=\"100\"></svg>\n * @readonly\n */\n static SVG_SIZE = /<svg[^>]*(?:\\s(width|height)=('|\")(\\d*(?:\\.\\d+)?)(?:px)?('|\"))[^>]*(?:\\s(width|height)=('|\")(\\d*(?:\\.\\d+)?)(?:px)?('|\"))[^>]*>/i; // eslint-disable-line max-len\n}\n","import { BaseImageResource } from './BaseImageResource';\nimport { Ticker } from '@pixi/ticker';\n\nimport type { Dict } from '@pixi/utils';\n\nexport interface IVideoResourceOptions\n{\n autoLoad?: boolean;\n autoPlay?: boolean;\n updateFPS?: number;\n crossorigin?: boolean | string;\n}\n\nexport interface IVideoResourceOptionsElement\n{\n src: string;\n mime: string;\n}\n\n/**\n * Resource type for {@code HTMLVideoElement}.\n * @memberof PIXI\n */\nexport class VideoResource extends BaseImageResource\n{\n /** Override the source to be the video element. */\n public source: HTMLVideoElement;\n\n /**\n * `true` to use PIXI.Ticker.shared to auto update the base texture.\n * @default true\n */\n protected _autoUpdate: boolean;\n\n /**\n * `true` if the instance is currently connected to PIXI.Ticker.shared to auto update the base texture.\n * @default false\n */\n protected _isConnectedToTicker: boolean;\n protected _updateFPS: number;\n protected _msToNextUpdate: number;\n\n /**\n * When set to true will automatically play videos used by this texture once\n * they are loaded. If false, it will not modify the playing state.\n * @default true\n */\n protected autoPlay: boolean;\n\n /**\n * Promise when loading.\n * @default null\n */\n private _load: Promise<VideoResource>;\n\n /** Callback when completed with load. */\n private _resolve: (value?: VideoResource | PromiseLike<VideoResource>) => void;\n\n /**\n * @param {HTMLVideoElement|object|string|Array<string|object>} source - Video element to use.\n * @param {object} [options] - Options to use\n * @param {boolean} [options.autoLoad=true] - Start loading the video immediately\n * @param {boolean} [options.autoPlay=true] - Start playing video immediately\n * @param {number} [options.updateFPS=0] - How many times a second to update the texture from the video.\n * Leave at 0 to update at every render.\n * @param {boolean} [options.crossorigin=true] - Load image using cross origin\n */\n constructor(\n source?: HTMLVideoElement | Array<string | IVideoResourceOptionsElement> | string, options?: IVideoResourceOptions\n )\n {\n options = options || {};\n\n if (!(source instanceof HTMLVideoElement))\n {\n const videoElement = document.createElement('video');\n\n // workaround for https://github.com/pixijs/pixi.js/issues/5996\n videoElement.setAttribute('preload', 'auto');\n videoElement.setAttribute('webkit-playsinline', '');\n videoElement.setAttribute('playsinline', '');\n\n if (typeof source === 'string')\n {\n source = [source];\n }\n\n const firstSrc = (source[0] as IVideoResourceOptionsElement).src || source[0] as string;\n\n BaseImageResource.crossOrigin(videoElement, firstSrc, options.crossorigin);\n\n // array of objects or strings\n for (let i = 0; i < source.length; ++i)\n {\n const sourceElement = document.createElement('source');\n\n let { src, mime } = source[i] as IVideoResourceOptionsElement;\n\n src = src || source[i] as string;\n\n const baseSrc = src.split('?').shift().toLowerCase();\n const ext = baseSrc.slice(baseSrc.lastIndexOf('.') + 1);\n\n mime = mime || VideoResource.MIME_TYPES[ext] || `video/${ext}`;\n\n sourceElement.src = src;\n sourceElement.type = mime;\n\n videoElement.appendChild(sourceElement);\n }\n\n // Override the source\n source = videoElement;\n }\n\n super(source);\n\n this.noSubImage = true;\n\n this._autoUpdate = true;\n this._isConnectedToTicker = false;\n\n this._updateFPS = options.updateFPS || 0;\n this._msToNextUpdate = 0;\n this.autoPlay = options.autoPlay !== false;\n\n this._load = null;\n this._resolve = null;\n\n // Bind for listeners\n this._onCanPlay = this._onCanPlay.bind(this);\n this._onError = this._onError.bind(this);\n\n if (options.autoLoad !== false)\n {\n this.load();\n }\n }\n\n /**\n * Trigger updating of the texture.\n * @param _deltaTime - time delta since last tick\n */\n update(_deltaTime = 0): void\n {\n if (!this.destroyed)\n {\n // account for if video has had its playbackRate changed\n const elapsedMS = Ticker.shared.elapsedMS * (this.source as HTMLVideoElement).playbackRate;\n\n this._msToNextUpdate = Math.floor(this._msToNextUpdate - elapsedMS);\n if (!this._updateFPS || this._msToNextUpdate <= 0)\n {\n super.update(/* deltaTime*/);\n this._msToNextUpdate = this._updateFPS ? Math.floor(1000 / this._updateFPS) : 0;\n }\n }\n }\n\n /**\n * Start preloading the video resource.\n * @returns {Promise<void>} Handle the validate event\n */\n load(): Promise<VideoResource>\n {\n if (this._load)\n {\n return this._load;\n }\n\n const source = this.source as HTMLVideoElement;\n\n if ((source.readyState === source.HAVE_ENOUGH_DATA || source.readyState === source.HAVE_FUTURE_DATA)\n && source.width && source.height)\n {\n (source as any).complete = true;\n }\n\n source.addEventListener('play', this._onPlayStart.bind(this));\n source.addEventListener('pause', this._onPlayStop.bind(this));\n\n if (!this._isSourceReady())\n {\n source.addEventListener('canplay', this._onCanPlay);\n source.addEventListener('canplaythrough', this._onCanPlay);\n source.addEventListener('error', this._onError, true);\n }\n else\n {\n this._onCanPlay();\n }\n\n this._load = new Promise((resolve): void =>\n {\n if (this.valid)\n {\n resolve(this);\n }\n else\n {\n this._resolve = resolve;\n\n source.load();\n }\n });\n\n return this._load;\n }\n\n /**\n * Handle video error events.\n * @param event\n */\n private _onError(event: ErrorEvent): void\n {\n (this.source as HTMLVideoElement).removeEventListener('error', this._onError, true);\n this.onError.emit(event);\n }\n\n /**\n * Returns true if the underlying source is playing.\n * @returns - True if playing.\n */\n private _isSourcePlaying(): boolean\n {\n const source = this.source as HTMLVideoElement;\n\n return (source.currentTime > 0 && source.paused === false && source.ended === false && source.readyState > 2);\n }\n\n /**\n * Returns true if the underlying source is ready for playing.\n * @returns - True if ready.\n */\n private _isSourceReady(): boolean\n {\n const source = this.source as HTMLVideoElement;\n\n return source.readyState === 3 || source.readyState === 4;\n }\n\n /** Runs the update loop when the video is ready to play. */\n private _onPlayStart(): void\n {\n // Just in case the video has not received its can play even yet..\n if (!this.valid)\n {\n this._onCanPlay();\n }\n\n if (this.autoUpdate && !this._isConnectedToTicker)\n {\n Ticker.shared.add(this.update, this);\n this._isConnectedToTicker = true;\n }\n }\n\n /** Fired when a pause event is triggered, stops the update loop. */\n private _onPlayStop(): void\n {\n if (this._isConnectedToTicker)\n {\n Ticker.shared.remove(this.update, this);\n this._isConnectedToTicker = false;\n }\n }\n\n /** Fired when the video is loaded and ready to play. */\n private _onCanPlay(): void\n {\n const source = this.source as HTMLVideoElement;\n\n source.removeEventListener('canplay', this._onCanPlay);\n source.removeEventListener('canplaythrough', this._onCanPlay);\n\n const valid = this.valid;\n\n this.resize(source.videoWidth, source.videoHeight);\n\n // prevent multiple loaded dispatches..\n if (!valid && this._resolve)\n {\n this._resolve(this);\n this._resolve = null;\n }\n\n if (this._isSourcePlaying())\n {\n this._onPlayStart();\n }\n else if (this.autoPlay)\n {\n source.play();\n }\n }\n\n /** Destroys this texture. */\n dispose(): void\n {\n if (this._isConnectedToTicker)\n {\n Ticker.shared.remove(this.update, this);\n this._isConnectedToTicker = false;\n }\n\n const source = this.source as HTMLVideoElement;\n\n if (source)\n {\n source.removeEventListener('error', this._onError, true);\n source.pause();\n source.src = '';\n source.load();\n }\n super.dispose();\n }\n\n /** Should the base texture automatically update itself, set to true by default. */\n get autoUpdate(): boolean\n {\n return this._autoUpdate;\n }\n\n set autoUpdate(value: boolean)\n {\n if (value !== this._autoUpdate)\n {\n this._autoUpdate = value;\n\n if (!this._autoUpdate && this._isConnectedToTicker)\n {\n Ticker.shared.remove(this.update, this);\n this._isConnectedToTicker = false;\n }\n else if (this._autoUpdate && !this._isConnectedToTicker && this._isSourcePlaying())\n {\n Ticker.shared.add(this.update, this);\n this._isConnectedToTicker = true;\n }\n }\n }\n\n /**\n * How many times a second to update the texture from the video. Leave at 0 to update at every render.\n * A lower fps can help performance, as updating the texture at 60fps on a 30ps video may not be efficient.\n */\n get updateFPS(): number\n {\n return this._updateFPS;\n }\n\n set updateFPS(value: number)\n {\n if (value !== this._updateFPS)\n {\n this._updateFPS = value;\n }\n }\n\n /**\n * Used to auto-detect the type of resource.\n * @param {*} source - The source object\n * @param {string} extension - The extension of source, if set\n * @returns {boolean} `true` if video source\n */\n static test(source: unknown, extension?: string): source is HTMLVideoElement\n {\n return (globalThis.HTMLVideoElement && source instanceof HTMLVideoElement)\n || VideoResource.TYPES.indexOf(extension) > -1;\n }\n\n /**\n * List of common video file extensions supported by VideoResource.\n * @readonly\n */\n static TYPES: Array<string> = ['mp4', 'm4v', 'webm', 'ogg', 'ogv', 'h264', 'avi', 'mov'];\n\n /**\n * Map of video MIME types that can't be directly derived from file extensions.\n * @readonly\n */\n static MIME_TYPES: Dict<string> = {\n ogv: 'video/ogg',\n mov: 'video/quicktime',\n m4v: 'video/mp4',\n };\n}\n","import { BaseImageResource } from './BaseImageResource';\n\n/**\n * Resource type for ImageBitmap.\n * @memberof PIXI\n */\nexport class ImageBitmapResource extends BaseImageResource\n{\n /**\n * @param source - Image element to use\n */\n // eslint-disable-next-line @typescript-eslint/no-useless-constructor\n constructor(source: ImageBitmap)\n {\n super(source);\n }\n\n /**\n * Used to auto-detect the type of resource.\n * @param {*} source - The source object\n * @returns {boolean} `true` if source is an ImageBitmap\n */\n static test(source: unknown): source is ImageBitmap\n {\n return !!globalThis.createImageBitmap && typeof ImageBitmap !== 'undefined' && source instanceof ImageBitmap;\n }\n}\n","import { INSTALLED } from './autoDetectResource';\nimport { ArrayResource } from './ArrayResource';\nimport { BufferResource } from './BufferResource';\nimport { CanvasResource } from './CanvasResource';\nimport { CubeResource } from './CubeResource';\nimport { ImageResource } from './ImageResource';\nimport { SVGResource } from './SVGResource';\nimport { VideoResource } from './VideoResource';\nimport { ImageBitmapResource } from './ImageBitmapResource';\n\nexport * from './Resource';\nexport * from './BaseImageResource';\n\nINSTALLED.push(\n ImageResource,\n ImageBitmapResource,\n CanvasResource,\n VideoResource,\n SVGResource,\n BufferResource,\n CubeResource,\n ArrayResource\n);\n\nexport * from './autoDetectResource';\nexport * from './AbstractMultiResource';\nexport * from './ArrayResource';\nexport * from './BufferResource';\nexport * from './CanvasResource';\nexport * from './CubeResource';\nexport * from './ImageResource';\nexport * from './SVGResource';\nexport * from './VideoResource';\nexport * from './ImageBitmapResource';\n","import { ALPHA_MODES } from '@pixi/constants';\nimport { BufferResource } from './BufferResource';\n\nimport type { BaseTexture } from '../BaseTexture';\nimport type { Renderer } from '../../Renderer';\nimport type { GLTexture } from '../GLTexture';\n\n/**\n * Resource type for DepthTexture.\n * @memberof PIXI\n */\nexport class DepthResource extends BufferResource\n{\n /**\n * Upload the texture to the GPU.\n * @param renderer - Upload to the renderer\n * @param baseTexture - Reference to parent texture\n * @param glTexture - glTexture\n * @returns - true is success\n */\n upload(renderer: Renderer, baseTexture: BaseTexture, glTexture: GLTexture): boolean\n {\n const gl = renderer.gl;\n\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, baseTexture.alphaMode === ALPHA_MODES.UNPACK);\n\n const width = baseTexture.realWidth;\n const height = baseTexture.realHeight;\n\n if (glTexture.width === width && glTexture.height === height)\n {\n gl.texSubImage2D(\n baseTexture.target,\n 0,\n 0,\n 0,\n width,\n height,\n baseTexture.format,\n glTexture.type,\n this.data,\n );\n }\n else\n {\n glTexture.width = width;\n glTexture.height = height;\n\n gl.texImage2D(\n baseTexture.target,\n 0,\n glTexture.internalFormat,\n width,\n height,\n 0,\n baseTexture.format,\n glTexture.type,\n this.data,\n );\n }\n\n return true;\n }\n}\n","import { Runner } from '@pixi/runner';\nimport { BaseTexture } from '../textures/BaseTexture';\nimport { DepthResource } from '../textures/resources/DepthResource';\nimport { FORMATS, MIPMAP_MODES, SCALE_MODES, TYPES, MSAA_QUALITY } from '@pixi/constants';\n\nimport type { GLFramebuffer } from './GLFramebuffer';\n\n/**\n * A framebuffer can be used to render contents off of the screen. {@link PIXI.BaseRenderTexture} uses\n * one internally to render into itself. You can attach a depth or stencil buffer to a framebuffer.\n *\n * On WebGL 2 machines, shaders can output to multiple textures simultaneously with GLSL 300 ES.\n * @memberof PIXI\n */\nexport class Framebuffer\n{\n /** Width of framebuffer in pixels. */\n public width: number;\n\n /** Height of framebuffer in pixels. */\n public height: number;\n\n /**\n * Desired number of samples for antialiasing. 0 means AA should not be used.\n *\n * Experimental WebGL2 feature, allows to use antialiasing in individual renderTextures.\n * Antialiasing is the same as for main buffer with renderer `antialias:true` options.\n * Seriously affects GPU memory consumption and GPU performance.\n *\n *```js\n * renderTexture.framebuffer.multisample = PIXI.MSAA_QUALITY.HIGH;\n * //...\n * renderer.render(myContainer, {renderTexture});\n * renderer.framebuffer.blit(); // copies data from MSAA framebuffer to texture\n * ```\n * @default PIXI.MSAA_QUALITY.NONE\n */\n public multisample: MSAA_QUALITY;\n\n stencil: boolean;\n depth: boolean;\n dirtyId: number;\n dirtyFormat: number;\n dirtySize: number;\n depthTexture: BaseTexture;\n colorTextures: Array<BaseTexture>;\n glFramebuffers: {[key: string]: GLFramebuffer};\n disposeRunner: Runner;\n\n /**\n * @param width - Width of the frame buffer\n * @param height - Height of the frame buffer\n */\n constructor(width: number, height: number)\n {\n this.width = Math.round(width || 100);\n this.height = Math.round(height || 100);\n\n this.stencil = false;\n this.depth = false;\n\n this.dirtyId = 0;\n this.dirtyFormat = 0;\n this.dirtySize = 0;\n\n this.depthTexture = null;\n this.colorTextures = [];\n\n this.glFramebuffers = {};\n\n this.disposeRunner = new Runner('disposeFramebuffer');\n this.multisample = MSAA_QUALITY.NONE;\n }\n\n /**\n * Reference to the colorTexture.\n * @readonly\n */\n get colorTexture(): BaseTexture\n {\n return this.colorTextures[0];\n }\n\n /**\n * Add texture to the colorTexture array.\n * @param index - Index of the array to add the texture to\n * @param texture - Texture to add to the array\n */\n addColorTexture(index = 0, texture?: BaseTexture): this\n {\n // TODO add some validation to the texture - same width / height etc?\n this.colorTextures[index] = texture || new BaseTexture(null, {\n scaleMode: SCALE_MODES.NEAREST,\n resolution: 1,\n mipmap: MIPMAP_MODES.OFF,\n width: this.width,\n height: this.height,\n });\n\n this.dirtyId++;\n this.dirtyFormat++;\n\n return this;\n }\n\n /**\n * Add a depth texture to the frame buffer.\n * @param texture - Texture to add.\n */\n addDepthTexture(texture?: BaseTexture): this\n {\n /* eslint-disable max-len */\n this.depthTexture = texture || new BaseTexture(new DepthResource(null, { width: this.width, height: this.height }), {\n scaleMode: SCALE_MODES.NEAREST,\n resolution: 1,\n width: this.width,\n height: this.height,\n mipmap: MIPMAP_MODES.OFF,\n format: FORMATS.DEPTH_COMPONENT,\n type: TYPES.UNSIGNED_SHORT,\n });\n\n this.dirtyId++;\n this.dirtyFormat++;\n\n return this;\n }\n\n /** Enable depth on the frame buffer. */\n enableDepth(): this\n {\n this.depth = true;\n\n this.dirtyId++;\n this.dirtyFormat++;\n\n return this;\n }\n\n /** Enable stencil on the frame buffer. */\n enableStencil(): this\n {\n this.stencil = true;\n\n this.dirtyId++;\n this.dirtyFormat++;\n\n return this;\n }\n\n /**\n * Resize the frame buffer\n * @param width - Width of the frame buffer to resize to\n * @param height - Height of the frame buffer to resize to\n */\n resize(width: number, height: number): void\n {\n width = Math.round(width);\n height = Math.round(height);\n\n if (width === this.width && height === this.height) return;\n\n this.width = width;\n this.height = height;\n\n this.dirtyId++;\n this.dirtySize++;\n\n for (let i = 0; i < this.colorTextures.length; i++)\n {\n const texture = this.colorTextures[i];\n const resolution = texture.resolution;\n\n // take into account the fact the texture may have a different resolution..\n texture.setSize(width / resolution, height / resolution);\n }\n\n if (this.depthTexture)\n {\n const resolution = this.depthTexture.resolution;\n\n this.depthTexture.setSize(width / resolution, height / resolution);\n }\n }\n\n /** Disposes WebGL resources that are connected to this geometry. */\n dispose(): void\n {\n this.disposeRunner.emit(this, false);\n }\n\n /** Destroys and removes the depth texture added to this framebuffer. */\n destroyDepthTexture(): void\n {\n if (this.depthTexture)\n {\n this.depthTexture.destroy();\n this.depthTexture = null;\n\n ++this.dirtyId;\n ++this.dirtyFormat;\n }\n }\n}\n","import { BaseTexture } from '../textures/BaseTexture';\nimport { Framebuffer } from '../framebuffer/Framebuffer';\nimport { MIPMAP_MODES, MSAA_QUALITY } from '@pixi/constants';\n\nimport type { IBaseTextureOptions } from '../textures/BaseTexture';\nimport type { MaskData } from '../mask/MaskData';\n\nexport interface BaseRenderTexture extends GlobalMixins.BaseRenderTexture, BaseTexture {}\n\n/**\n * A BaseRenderTexture is a special texture that allows any PixiJS display object to be rendered to it.\n *\n * __Hint__: All DisplayObjects (i.e. Sprites) that render to a BaseRenderTexture should be preloaded\n * otherwise black rectangles will be drawn instead.\n *\n * A BaseRenderTexture takes a snapshot of any Display Object given to its render method. The position\n * and rotation of the given Display Objects is ignored. For example:\n *\n * ```js\n * let renderer = PIXI.autoDetectRenderer();\n * let baseRenderTexture = new PIXI.BaseRenderTexture({ width: 800, height: 600 });\n * let renderTexture = new PIXI.RenderTexture(baseRenderTexture);\n * let sprite = PIXI.Sprite.from(\"spinObj_01.png\");\n *\n * sprite.position.x = 800/2;\n * sprite.position.y = 600/2;\n * sprite.anchor.x = 0.5;\n * sprite.anchor.y = 0.5;\n *\n * renderer.render(sprite, {renderTexture});\n * ```\n *\n * The Sprite in this case will be rendered using its local transform. To render this sprite at 0,0\n * you can clear the transform\n *\n * ```js\n *\n * sprite.setTransform()\n *\n * let baseRenderTexture = new PIXI.BaseRenderTexture({ width: 100, height: 100 });\n * let renderTexture = new PIXI.RenderTexture(baseRenderTexture);\n *\n * renderer.render(sprite, {renderTexture}); // Renders to center of RenderTexture\n * ```\n * @memberof PIXI\n */\nexport class BaseRenderTexture extends BaseTexture\n{\n public clearColor: number[];\n public framebuffer: Framebuffer;\n\n /** The data structure for the stencil masks. */\n maskStack: Array<MaskData>;\n\n /** The data structure for the filters. */\n filterStack: Array<any>;\n\n /**\n * @param options\n * @param {number} [options.width=100] - The width of the base render texture.\n * @param {number} [options.height=100] - The height of the base render texture.\n * @param {PIXI.SCALE_MODES} [options.scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES}\n * for possible values.\n * @param {number} [options.resolution=PIXI.settings.RESOLUTION] - The resolution / device pixel ratio\n * of the texture being generated.\n * @param {PIXI.MSAA_QUALITY} [options.multisample=PIXI.MSAA_QUALITY.NONE] - The number of samples of the frame buffer.\n */\n constructor(options: IBaseTextureOptions = {})\n {\n if (typeof options === 'number')\n {\n /* eslint-disable prefer-rest-params */\n // Backward compatibility of signature\n const width = arguments[0];\n const height = arguments[1];\n const scaleMode = arguments[2];\n const resolution = arguments[3];\n\n options = { width, height, scaleMode, resolution };\n /* eslint-enable prefer-rest-params */\n }\n\n options.width = options.width || 100;\n options.height = options.height || 100;\n options.multisample = options.multisample !== undefined ? options.multisample : MSAA_QUALITY.NONE;\n\n super(null, options);\n\n // Set defaults\n this.mipmap = MIPMAP_MODES.OFF;\n this.valid = true;\n\n this.clearColor = [0, 0, 0, 0];\n\n this.framebuffer = new Framebuffer(this.realWidth, this.realHeight)\n .addColorTexture(0, this);\n this.framebuffer.multisample = options.multisample;\n\n // TODO - could this be added the systems?\n this.maskStack = [];\n this.filterStack = [{}];\n }\n\n /**\n * Resizes the BaseRenderTexture.\n * @param desiredWidth - The desired width to resize to.\n * @param desiredHeight - The desired height to resize to.\n */\n resize(desiredWidth: number, desiredHeight: number): void\n {\n this.framebuffer.resize(desiredWidth * this.resolution, desiredHeight * this.resolution);\n this.setRealSize(this.framebuffer.width, this.framebuffer.height);\n }\n\n /**\n * Frees the texture and framebuffer from WebGL memory without destroying this texture object.\n * This means you can still use the texture later which will upload it to GPU\n * memory again.\n * @fires PIXI.BaseTexture#dispose\n */\n dispose(): void\n {\n this.framebuffer.dispose();\n\n super.dispose();\n }\n\n /** Destroys this texture. */\n destroy(): void\n {\n super.destroy();\n\n this.framebuffer.destroyDepthTexture();\n this.framebuffer = null;\n }\n}\n","import { groupD8 } from '@pixi/math';\n\nimport type { Rectangle, ISize } from '@pixi/math';\n\n/**\n * Stores a texture's frame in UV coordinates, in\n * which everything lies in the rectangle `[(0,0), (1,0),\n * (1,1), (0,1)]`.\n *\n * | Corner | Coordinates |\n * |--------------|-------------|\n * | Top-Left | `(x0,y0)` |\n * | Top-Right | `(x1,y1)` |\n * | Bottom-Right | `(x2,y2)` |\n * | Bottom-Left | `(x3,y3)` |\n * @protected\n * @memberof PIXI\n */\nexport class TextureUvs\n{\n /** X-component of top-left corner `(x0,y0)`. */\n public x0: number;\n\n /** Y-component of top-left corner `(x0,y0)`. */\n public y0: number;\n\n /** X-component of top-right corner `(x1,y1)`. */\n public x1: number;\n\n /** Y-component of top-right corner `(x1,y1)`. */\n public y1: number;\n\n /** X-component of bottom-right corner `(x2,y2)`. */\n public x2: number;\n\n /** Y-component of bottom-right corner `(x2,y2)`. */\n public y2: number;\n\n /** X-component of bottom-left corner `(x3,y3)`. */\n public x3: number;\n\n /** Y-component of bottom-right corner `(x3,y3)`. */\n public y3: number;\n public uvsFloat32: Float32Array;\n\n constructor()\n {\n this.x0 = 0;\n this.y0 = 0;\n this.x1 = 1;\n this.y1 = 0;\n this.x2 = 1;\n this.y2 = 1;\n this.x3 = 0;\n this.y3 = 1;\n\n this.uvsFloat32 = new Float32Array(8);\n }\n\n /**\n * Sets the texture Uvs based on the given frame information.\n * @protected\n * @param frame - The frame of the texture\n * @param baseFrame - The base frame of the texture\n * @param rotate - Rotation of frame, see {@link PIXI.groupD8}\n */\n set(frame: Rectangle, baseFrame: ISize, rotate: number): void\n {\n const tw = baseFrame.width;\n const th = baseFrame.height;\n\n if (rotate)\n {\n // width and height div 2 div baseFrame size\n const w2 = frame.width / 2 / tw;\n const h2 = frame.height / 2 / th;\n\n // coordinates of center\n const cX = (frame.x / tw) + w2;\n const cY = (frame.y / th) + h2;\n\n rotate = groupD8.add(rotate, groupD8.NW); // NW is top-left corner\n this.x0 = cX + (w2 * groupD8.uX(rotate));\n this.y0 = cY + (h2 * groupD8.uY(rotate));\n\n rotate = groupD8.add(rotate, 2); // rotate 90 degrees clockwise\n this.x1 = cX + (w2 * groupD8.uX(rotate));\n this.y1 = cY + (h2 * groupD8.uY(rotate));\n\n rotate = groupD8.add(rotate, 2);\n this.x2 = cX + (w2 * groupD8.uX(rotate));\n this.y2 = cY + (h2 * groupD8.uY(rotate));\n\n rotate = groupD8.add(rotate, 2);\n this.x3 = cX + (w2 * groupD8.uX(rotate));\n this.y3 = cY + (h2 * groupD8.uY(rotate));\n }\n else\n {\n this.x0 = frame.x / tw;\n this.y0 = frame.y / th;\n\n this.x1 = (frame.x + frame.width) / tw;\n this.y1 = frame.y / th;\n\n this.x2 = (frame.x + frame.width) / tw;\n this.y2 = (frame.y + frame.height) / th;\n\n this.x3 = frame.x / tw;\n this.y3 = (frame.y + frame.height) / th;\n }\n\n this.uvsFloat32[0] = this.x0;\n this.uvsFloat32[1] = this.y0;\n this.uvsFloat32[2] = this.x1;\n this.uvsFloat32[3] = this.y1;\n this.uvsFloat32[4] = this.x2;\n this.uvsFloat32[5] = this.y2;\n this.uvsFloat32[6] = this.x3;\n this.uvsFloat32[7] = this.y3;\n }\n\n // #if _DEBUG\n toString(): string\n {\n return `[@pixi/core:TextureUvs `\n + `x0=${this.x0} y0=${this.y0} `\n + `x1=${this.x1} y1=${this.y1} x2=${this.x2} `\n + `y2=${this.y2} x3=${this.x3} y3=${this.y3}`\n + `]`;\n }\n // #endif\n}\n","import { BaseTexture } from './BaseTexture';\nimport { ImageResource } from './resources/ImageResource';\nimport type { CanvasResource } from './resources/CanvasResource';\nimport { TextureUvs } from './TextureUvs';\nimport { settings } from '@pixi/settings';\nimport { Rectangle, Point } from '@pixi/math';\nimport { uid, TextureCache, getResolutionOfUrl, EventEmitter } from '@pixi/utils';\n\nimport type { Resource } from './resources/Resource';\nimport type { BufferResource } from './resources/BufferResource';\nimport type { IPointData, ISize } from '@pixi/math';\nimport type { IBaseTextureOptions, ImageSource } from './BaseTexture';\nimport type { TextureMatrix } from './TextureMatrix';\n\nconst DEFAULT_UVS = new TextureUvs();\n\nexport type TextureSource = string | BaseTexture | ImageSource;\n\nexport interface Texture extends GlobalMixins.Texture, EventEmitter {}\n\n/**\n * Used to remove listeners from WHITE and EMPTY Textures\n * @ignore\n */\nfunction removeAllHandlers(tex: any): void\n{\n tex.destroy = function _emptyDestroy(): void { /* empty */ };\n tex.on = function _emptyOn(): void { /* empty */ };\n tex.once = function _emptyOnce(): void { /* empty */ };\n tex.emit = function _emptyEmit(): void { /* empty */ };\n}\n\n/**\n * A texture stores the information that represents an image or part of an image.\n *\n * It cannot be added to the display list directly; instead use it as the texture for a Sprite.\n * If no frame is provided for a texture, then the whole image is used.\n *\n * You can directly create a texture from an image and then reuse it multiple times like this :\n *\n * ```js\n * let texture = PIXI.Texture.from('assets/image.png');\n * let sprite1 = new PIXI.Sprite(texture);\n * let sprite2 = new PIXI.Sprite(texture);\n * ```\n *\n * If you didnt pass the texture frame to constructor, it enables `noFrame` mode:\n * it subscribes on baseTexture events, it automatically resizes at the same time as baseTexture.\n *\n * Textures made from SVGs, loaded or not, cannot be used before the file finishes processing.\n * You can check for this by checking the sprite's _textureID property.\n * ```js\n * var texture = PIXI.Texture.from('assets/image.svg');\n * var sprite1 = new PIXI.Sprite(texture);\n * //sprite1._textureID should not be undefined if the texture has finished processing the SVG file\n * ```\n * You can use a ticker or rAF to ensure your sprites load the finished textures after processing. See issue #3068.\n * @memberof PIXI\n * @typeParam R - The BaseTexture's Resource type.\n */\nexport class Texture<R extends Resource = Resource> extends EventEmitter\n{\n /** The base texture that this texture uses. */\n public baseTexture: BaseTexture<R>;\n\n /** This is the area of original texture, before it was put in atlas. */\n public orig: Rectangle;\n\n /**\n * This is the trimmed area of original texture, before it was put in atlas\n * Please call `updateUvs()` after you change coordinates of `trim` manually.\n */\n public trim: Rectangle;\n\n /** This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. */\n public valid: boolean;\n\n /**\n * Does this Texture have any frame data assigned to it?\n *\n * This mode is enabled automatically if no frame was passed inside constructor.\n *\n * In this mode texture is subscribed to baseTexture events, and fires `update` on any change.\n *\n * Beware, after loading or resize of baseTexture event can fired two times!\n * If you want more control, subscribe on baseTexture itself.\n *\n * ```js\n * texture.on('update', () => {});\n * ```\n *\n * Any assignment of `frame` switches off `noFrame` mode.\n */\n public noFrame: boolean;\n\n /**\n * Anchor point that is used as default if sprite is created with this texture.\n * Changing the `defaultAnchor` at a later point of time will not update Sprite's anchor point.\n * @default {0,0}\n */\n public defaultAnchor: Point;\n\n /** Default TextureMatrix instance for this texture. By default, that object is not created because its heavy. */\n public uvMatrix: TextureMatrix;\n protected _rotate: number;\n\n /**\n * Update ID is observed by sprites and TextureMatrix instances.\n * Call updateUvs() to increment it.\n * @protected\n */\n _updateID: number;\n\n /**\n * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering,\n * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)\n */\n _frame: Rectangle;\n\n /**\n * The WebGL UV data cache. Can be used as quad UV.\n * @protected\n */\n _uvs: TextureUvs;\n\n /**\n * The ids under which this Texture has been added to the texture cache. This is\n * automatically set as long as Texture.addToCache is used, but may not be set if a\n * Texture is added directly to the TextureCache array.\n */\n textureCacheIds: Array<string>;\n\n /**\n * @param baseTexture - The base texture source to create the texture from\n * @param frame - The rectangle frame of the texture to show\n * @param orig - The area of original texture\n * @param trim - Trimmed rectangle of original texture\n * @param rotate - indicates how the texture was rotated by texture packer. See {@link PIXI.groupD8}\n * @param anchor - Default anchor point used for sprite placement / rotation\n */\n constructor(baseTexture: BaseTexture<R>, frame?: Rectangle,\n orig?: Rectangle, trim?: Rectangle, rotate?: number, anchor?: IPointData)\n {\n super();\n\n this.noFrame = false;\n\n if (!frame)\n {\n this.noFrame = true;\n frame = new Rectangle(0, 0, 1, 1);\n }\n\n if (baseTexture instanceof Texture)\n {\n baseTexture = baseTexture.baseTexture;\n }\n\n this.baseTexture = baseTexture;\n this._frame = frame;\n this.trim = trim;\n this.valid = false;\n this._uvs = DEFAULT_UVS;\n this.uvMatrix = null;\n this.orig = orig || frame;// new Rectangle(0, 0, 1, 1);\n\n this._rotate = Number(rotate || 0);\n\n if (rotate as any === true)\n {\n // this is old texturepacker legacy, some games/libraries are passing \"true\" for rotated textures\n this._rotate = 2;\n }\n else if (this._rotate % 2 !== 0)\n {\n throw new Error('attempt to use diamond-shaped UVs. If you are sure, set rotation manually');\n }\n\n this.defaultAnchor = anchor ? new Point(anchor.x, anchor.y) : new Point(0, 0);\n\n this._updateID = 0;\n\n this.textureCacheIds = [];\n\n if (!baseTexture.valid)\n {\n baseTexture.once('loaded', this.onBaseTextureUpdated, this);\n }\n else if (this.noFrame)\n {\n // if there is no frame we should monitor for any base texture changes..\n if (baseTexture.valid)\n {\n this.onBaseTextureUpdated(baseTexture);\n }\n }\n else\n {\n this.frame = frame;\n }\n\n if (this.noFrame)\n {\n baseTexture.on('update', this.onBaseTextureUpdated, this);\n }\n }\n\n /**\n * Updates this texture on the gpu.\n *\n * Calls the TextureResource update.\n *\n * If you adjusted `frame` manually, please call `updateUvs()` instead.\n */\n update(): void\n {\n if (this.baseTexture.resource)\n {\n this.baseTexture.resource.update();\n }\n }\n\n /**\n * Called when the base texture is updated\n * @protected\n * @param baseTexture - The base texture.\n */\n onBaseTextureUpdated(baseTexture: BaseTexture): void\n {\n if (this.noFrame)\n {\n if (!this.baseTexture.valid)\n {\n return;\n }\n\n this._frame.width = baseTexture.width;\n this._frame.height = baseTexture.height;\n this.valid = true;\n this.updateUvs();\n }\n else\n {\n // TODO this code looks confusing.. boo to abusing getters and setters!\n // if user gave us frame that has bigger size than resized texture it can be a problem\n this.frame = this._frame;\n }\n\n this.emit('update', this);\n }\n\n /**\n * Destroys this texture\n * @param [destroyBase=false] - Whether to destroy the base texture as well\n */\n destroy(destroyBase?: boolean): void\n {\n if (this.baseTexture)\n {\n if (destroyBase)\n {\n const { resource } = this.baseTexture as unknown as BaseTexture<ImageResource>;\n\n // delete the texture if it exists in the texture cache..\n // this only needs to be removed if the base texture is actually destroyed too..\n if (resource && resource.url && TextureCache[resource.url])\n {\n Texture.removeFromCache(resource.url);\n }\n\n this.baseTexture.destroy();\n }\n\n this.baseTexture.off('loaded', this.onBaseTextureUpdated, this);\n this.baseTexture.off('update', this.onBaseTextureUpdated, this);\n\n this.baseTexture = null;\n }\n\n this._frame = null;\n this._uvs = null;\n this.trim = null;\n this.orig = null;\n\n this.valid = false;\n\n Texture.removeFromCache(this);\n this.textureCacheIds = null;\n }\n\n /**\n * Creates a new texture object that acts the same as this one.\n * @returns - The new texture\n */\n clone(): Texture\n {\n const clonedFrame = this._frame.clone();\n const clonedOrig = this._frame === this.orig ? clonedFrame : this.orig.clone();\n const clonedTexture = new Texture(this.baseTexture,\n !this.noFrame && clonedFrame,\n clonedOrig,\n this.trim && this.trim.clone(),\n this.rotate,\n this.defaultAnchor\n );\n\n if (this.noFrame)\n {\n clonedTexture._frame = clonedFrame;\n }\n\n return clonedTexture;\n }\n\n /**\n * Updates the internal WebGL UV cache. Use it after you change `frame` or `trim` of the texture.\n * Call it after changing the frame\n */\n updateUvs(): void\n {\n if (this._uvs === DEFAULT_UVS)\n {\n this._uvs = new TextureUvs();\n }\n\n this._uvs.set(this._frame, this.baseTexture, this.rotate);\n\n this._updateID++;\n }\n\n /**\n * Helper function that creates a new Texture based on the source you provide.\n * The source can be - frame id, image url, video url, canvas element, video element, base texture\n * @param {string|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|PIXI.BaseTexture} source -\n * Source or array of sources to create texture from\n * @param options - See {@link PIXI.BaseTexture}'s constructor for options.\n * @param {string} [options.pixiIdPrefix=pixiid] - If a source has no id, this is the prefix of the generated id\n * @param {boolean} [strict] - Enforce strict-mode, see {@link PIXI.settings.STRICT_TEXTURE_CACHE}.\n * @returns {PIXI.Texture} The newly created texture\n */\n static from<R extends Resource = Resource, RO = any>(source: TextureSource | TextureSource[],\n options: IBaseTextureOptions<RO> = {},\n strict = settings.STRICT_TEXTURE_CACHE): Texture<R>\n {\n const isFrame = typeof source === 'string';\n let cacheId = null;\n\n if (isFrame)\n {\n cacheId = source;\n }\n else if (source instanceof BaseTexture)\n {\n if (!source.cacheId)\n {\n const prefix = (options && options.pixiIdPrefix) || 'pixiid';\n\n source.cacheId = `${prefix}-${uid()}`;\n BaseTexture.addToCache(source, source.cacheId);\n }\n\n cacheId = source.cacheId;\n }\n else\n {\n if (!(source as any)._pixiId)\n {\n const prefix = (options && options.pixiIdPrefix) || 'pixiid';\n\n (source as any)._pixiId = `${prefix}_${uid()}`;\n }\n\n cacheId = (source as any)._pixiId;\n }\n\n let texture = TextureCache[cacheId] as Texture<R>;\n\n // Strict-mode rejects invalid cacheIds\n if (isFrame && strict && !texture)\n {\n throw new Error(`The cacheId \"${cacheId}\" does not exist in TextureCache.`);\n }\n\n if (!texture && !(source instanceof BaseTexture))\n {\n if (!options.resolution)\n {\n options.resolution = getResolutionOfUrl(source as string);\n }\n\n texture = new Texture<R>(new BaseTexture<R>(source, options));\n texture.baseTexture.cacheId = cacheId;\n\n BaseTexture.addToCache(texture.baseTexture, cacheId);\n Texture.addToCache(texture, cacheId);\n }\n else if (!texture && (source instanceof BaseTexture))\n {\n texture = new Texture<R>(source as BaseTexture<R>);\n\n Texture.addToCache(texture, cacheId);\n }\n\n // lets assume its a base texture!\n return texture;\n }\n\n /**\n * Useful for loading textures via URLs. Use instead of `Texture.from` because\n * it does a better job of handling failed URLs more effectively. This also ignores\n * `PIXI.settings.STRICT_TEXTURE_CACHE`. Works for Videos, SVGs, Images.\n * @param url - The remote URL or array of URLs to load.\n * @param options - Optional options to include\n * @returns - A Promise that resolves to a Texture.\n */\n static fromURL<R extends Resource = Resource, RO = any>(\n url: string | string[], options?: IBaseTextureOptions<RO>): Promise<Texture<R>>\n {\n const resourceOptions = Object.assign({ autoLoad: false }, options?.resourceOptions);\n const texture = Texture.from<R>(url, Object.assign({ resourceOptions }, options), false);\n const resource = texture.baseTexture.resource;\n\n // The texture was already loaded\n if (texture.baseTexture.valid)\n {\n return Promise.resolve(texture);\n }\n\n // Manually load the texture, this should allow users to handle load errors\n return resource.load().then(() => Promise.resolve(texture));\n }\n\n /**\n * Create a new Texture with a BufferResource from a Float32Array.\n * RGBA values are floats from 0 to 1.\n * @param {Float32Array|Uint8Array} buffer - The optional array to use, if no data\n * is provided, a new Float32Array is created.\n * @param width - Width of the resource\n * @param height - Height of the resource\n * @param options - See {@link PIXI.BaseTexture}'s constructor for options.\n * @returns - The resulting new BaseTexture\n */\n static fromBuffer(buffer: Float32Array | Uint8Array,\n width: number, height: number, options?: IBaseTextureOptions<ISize>): Texture<BufferResource>\n {\n return new Texture(BaseTexture.fromBuffer(buffer, width, height, options));\n }\n\n /**\n * Create a texture from a source and add to the cache.\n * @param {HTMLImageElement|HTMLCanvasElement|string} source - The input source.\n * @param imageUrl - File name of texture, for cache and resolving resolution.\n * @param name - Human readable name for the texture cache. If no name is\n * specified, only `imageUrl` will be used as the cache ID.\n * @param options\n * @returns - Output texture\n */\n static fromLoader<R extends Resource = Resource>(source: HTMLImageElement | HTMLCanvasElement | string,\n imageUrl: string, name?: string, options?: IBaseTextureOptions): Promise<Texture<R>>\n {\n const baseTexture = new BaseTexture<R>(source, Object.assign({\n scaleMode: settings.SCALE_MODE,\n resolution: getResolutionOfUrl(imageUrl),\n }, options));\n\n const { resource } = baseTexture;\n\n if (resource instanceof ImageResource)\n {\n resource.url = imageUrl;\n }\n\n const texture = new Texture<R>(baseTexture);\n\n // No name, use imageUrl instead\n if (!name)\n {\n name = imageUrl;\n }\n\n // lets also add the frame to pixi's global cache for 'fromLoader' function\n BaseTexture.addToCache(texture.baseTexture, name);\n Texture.addToCache(texture, name);\n\n // also add references by url if they are different.\n if (name !== imageUrl)\n {\n BaseTexture.addToCache(texture.baseTexture, imageUrl);\n Texture.addToCache(texture, imageUrl);\n }\n\n // Generally images are valid right away\n if (texture.baseTexture.valid)\n {\n return Promise.resolve(texture);\n }\n\n // SVG assets need to be parsed async, let's wait\n return new Promise((resolve) =>\n {\n texture.baseTexture.once('loaded', () => resolve(texture));\n });\n }\n\n /**\n * Adds a Texture to the global TextureCache. This cache is shared across the whole PIXI object.\n * @param texture - The Texture to add to the cache.\n * @param id - The id that the Texture will be stored against.\n */\n static addToCache(texture: Texture, id: string): void\n {\n if (id)\n {\n if (texture.textureCacheIds.indexOf(id) === -1)\n {\n texture.textureCacheIds.push(id);\n }\n\n if (TextureCache[id])\n {\n // eslint-disable-next-line no-console\n console.warn(`Texture added to the cache with an id [${id}] that already had an entry`);\n }\n\n TextureCache[id] = texture;\n }\n }\n\n /**\n * Remove a Texture from the global TextureCache.\n * @param texture - id of a Texture to be removed, or a Texture instance itself\n * @returns - The Texture that was removed\n */\n static removeFromCache(texture: string | Texture): Texture | null\n {\n if (typeof texture === 'string')\n {\n const textureFromCache = TextureCache[texture];\n\n if (textureFromCache)\n {\n const index = textureFromCache.textureCacheIds.indexOf(texture);\n\n if (index > -1)\n {\n textureFromCache.textureCacheIds.splice(index, 1);\n }\n\n delete TextureCache[texture];\n\n return textureFromCache;\n }\n }\n else if (texture && texture.textureCacheIds)\n {\n for (let i = 0; i < texture.textureCacheIds.length; ++i)\n {\n // Check that texture matches the one being passed in before deleting it from the cache.\n if (TextureCache[texture.textureCacheIds[i]] === texture)\n {\n delete TextureCache[texture.textureCacheIds[i]];\n }\n }\n\n texture.textureCacheIds.length = 0;\n\n return texture;\n }\n\n return null;\n }\n\n /**\n * Returns resolution of baseTexture\n * @readonly\n */\n get resolution(): number\n {\n return this.baseTexture.resolution;\n }\n\n /**\n * The frame specifies the region of the base texture that this texture uses.\n * Please call `updateUvs()` after you change coordinates of `frame` manually.\n */\n get frame(): Rectangle\n {\n return this._frame;\n }\n\n set frame(frame: Rectangle)\n {\n this._frame = frame;\n\n this.noFrame = false;\n\n const { x, y, width, height } = frame;\n const xNotFit = x + width > this.baseTexture.width;\n const yNotFit = y + height > this.baseTexture.height;\n\n if (xNotFit || yNotFit)\n {\n const relationship = xNotFit && yNotFit ? 'and' : 'or';\n const errorX = `X: ${x} + ${width} = ${x + width} > ${this.baseTexture.width}`;\n const errorY = `Y: ${y} + ${height} = ${y + height} > ${this.baseTexture.height}`;\n\n throw new Error('Texture Error: frame does not fit inside the base Texture dimensions: '\n + `${errorX} ${relationship} ${errorY}`);\n }\n\n this.valid = width && height && this.baseTexture.valid;\n\n if (!this.trim && !this.rotate)\n {\n this.orig = frame;\n }\n\n if (this.valid)\n {\n this.updateUvs();\n }\n }\n\n /**\n * Indicates whether the texture is rotated inside the atlas\n * set to 2 to compensate for texture packer rotation\n * set to 6 to compensate for spine packer rotation\n * can be used to rotate or mirror sprites\n * See {@link PIXI.groupD8} for explanation\n */\n get rotate(): number\n {\n return this._rotate;\n }\n\n set rotate(rotate: number)\n {\n this._rotate = rotate;\n if (this.valid)\n {\n this.updateUvs();\n }\n }\n\n /** The width of the Texture in pixels. */\n get width(): number\n {\n return this.orig.width;\n }\n\n /** The height of the Texture in pixels. */\n get height(): number\n {\n return this.orig.height;\n }\n\n /** Utility function for BaseTexture|Texture cast. */\n castToBaseTexture(): BaseTexture\n {\n return this.baseTexture;\n }\n\n private static _EMPTY: Texture<Resource>;\n private static _WHITE: Texture<CanvasResource>;\n\n /** An empty texture, used often to not have to create multiple empty textures. Can not be destroyed. */\n public static get EMPTY(): Texture<Resource>\n {\n if (!Texture._EMPTY)\n {\n Texture._EMPTY = new Texture(new BaseTexture());\n removeAllHandlers(Texture._EMPTY);\n removeAllHandlers(Texture._EMPTY.baseTexture);\n }\n\n return Texture._EMPTY;\n }\n\n /** A white texture of 16x16 size, used for graphics and other things Can not be destroyed. */\n public static get WHITE(): Texture<CanvasResource>\n {\n if (!Texture._WHITE)\n {\n const canvas = settings.ADAPTER.createCanvas(16, 16);\n const context = canvas.getContext('2d');\n\n canvas.width = 16;\n canvas.height = 16;\n context.fillStyle = 'white';\n context.fillRect(0, 0, 16, 16);\n\n Texture._WHITE = new Texture(BaseTexture.from(canvas));\n removeAllHandlers(Texture._WHITE);\n removeAllHandlers(Texture._WHITE.baseTexture);\n }\n\n return Texture._WHITE;\n }\n}\n\n","import { BaseRenderTexture } from './BaseRenderTexture';\nimport { Texture } from '../textures/Texture';\n\nimport type { Rectangle } from '@pixi/math';\nimport type { Framebuffer } from '../framebuffer/Framebuffer';\nimport type { IBaseTextureOptions } from '../textures/BaseTexture';\nimport type { MSAA_QUALITY, SCALE_MODES } from '@pixi/constants';\nimport { deprecation } from '@pixi/utils';\n\n/**\n * A RenderTexture is a special texture that allows any PixiJS display object to be rendered to it.\n *\n * __Hint__: All DisplayObjects (i.e. Sprites) that render to a RenderTexture should be preloaded\n * otherwise black rectangles will be drawn instead.\n *\n * __Hint-2__: The actual memory allocation will happen on first render.\n * You shouldn't create renderTextures each frame just to delete them after, try to reuse them.\n *\n * A RenderTexture takes a snapshot of any Display Object given to its render method. For example:\n *\n * ```js\n * let renderer = PIXI.autoDetectRenderer();\n * let renderTexture = PIXI.RenderTexture.create({ width: 800, height: 600 });\n * let sprite = PIXI.Sprite.from(\"spinObj_01.png\");\n *\n * sprite.position.x = 800/2;\n * sprite.position.y = 600/2;\n * sprite.anchor.x = 0.5;\n * sprite.anchor.y = 0.5;\n *\n * renderer.render(sprite, {renderTexture});\n * ```\n * Note that you should not create a new renderer, but reuse the same one as the rest of the application.\n *\n * The Sprite in this case will be rendered using its local transform. To render this sprite at 0,0\n * you can clear the transform\n *\n * ```js\n *\n * sprite.setTransform()\n *\n * let renderTexture = new PIXI.RenderTexture.create({ width: 100, height: 100 });\n *\n * renderer.render(sprite, {renderTexture}); // Renders to center of RenderTexture\n * ```\n * @memberof PIXI\n */\nexport class RenderTexture extends Texture\n{\n public baseTexture: BaseRenderTexture;\n\n /**\n * Stores `sourceFrame` when this texture is inside current filter stack.\n *\n * You can read it inside filters.\n * @readonly\n */\n public filterFrame: Rectangle | null;\n\n /**\n * The key for pooled texture of FilterSystem.\n * @see PIXI.RenderTexturePool\n */\n public filterPoolKey: string | number | null;\n\n /**\n * @param baseRenderTexture - The base texture object that this texture uses.\n * @param frame - The rectangle frame of the texture to show.\n */\n constructor(baseRenderTexture: BaseRenderTexture, frame?: Rectangle)\n {\n super(baseRenderTexture, frame);\n\n this.valid = true;\n\n this.filterFrame = null;\n this.filterPoolKey = null;\n\n this.updateUvs();\n }\n\n /**\n * Shortcut to `this.baseTexture.framebuffer`, saves baseTexture cast.\n * @readonly\n */\n get framebuffer(): Framebuffer\n {\n return this.baseTexture.framebuffer;\n }\n\n /**\n * Shortcut to `this.framebuffer.multisample`.\n * @default PIXI.MSAA_QUALITY.NONE\n */\n get multisample(): MSAA_QUALITY\n {\n return this.framebuffer.multisample;\n }\n\n set multisample(value: MSAA_QUALITY)\n {\n this.framebuffer.multisample = value;\n }\n\n /**\n * Resizes the RenderTexture.\n * @param desiredWidth - The desired width to resize to.\n * @param desiredHeight - The desired height to resize to.\n * @param resizeBaseTexture - Should the baseTexture.width and height values be resized as well?\n */\n resize(desiredWidth: number, desiredHeight: number, resizeBaseTexture = true): void\n {\n const resolution = this.baseTexture.resolution;\n const width = Math.round(desiredWidth * resolution) / resolution;\n const height = Math.round(desiredHeight * resolution) / resolution;\n\n // TODO - could be not required..\n this.valid = (width > 0 && height > 0);\n\n this._frame.width = this.orig.width = width;\n this._frame.height = this.orig.height = height;\n\n if (resizeBaseTexture)\n {\n this.baseTexture.resize(width, height);\n }\n\n this.updateUvs();\n }\n\n /**\n * Changes the resolution of baseTexture, but does not change framebuffer size.\n * @param resolution - The new resolution to apply to RenderTexture\n */\n setResolution(resolution: number): void\n {\n const { baseTexture } = this;\n\n if (baseTexture.resolution === resolution)\n {\n return;\n }\n\n baseTexture.setResolution(resolution);\n this.resize(baseTexture.width, baseTexture.height, false);\n }\n\n /**\n * Use the object-based construction instead.\n * @deprecated since 6.0.0\n * @param {number} [width]\n * @param {number} [height]\n * @param {PIXI.SCALE_MODES} [scaleMode=PIXI.settings.SCALE_MODE]\n * @param {number} [resolution=PIXI.settings.FILTER_RESOLUTION]\n */\n static create(width: number, height: number, scaleMode?: SCALE_MODES, resolution?: number): RenderTexture;\n\n /**\n * A short hand way of creating a render texture.\n * @param options - Options\n * @param {number} [options.width=100] - The width of the render texture\n * @param {number} [options.height=100] - The height of the render texture\n * @param {PIXI.SCALE_MODES} [options.scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES}\n * for possible values\n * @param {number} [options.resolution=PIXI.settings.RESOLUTION] - The resolution / device pixel ratio of the texture\n * being generated\n * @param {PIXI.MSAA_QUALITY} [options.multisample=PIXI.MSAA_QUALITY.NONE] - The number of samples of the frame buffer\n * @returns The new render texture\n */\n static create(options?: IBaseTextureOptions): RenderTexture;\n static create(options?: IBaseTextureOptions | number, ...rest: any[]): RenderTexture\n {\n // @deprecated fallback, old-style: create(width, height, scaleMode, resolution)\n if (typeof options === 'number')\n {\n // #if _DEBUG\n deprecation('6.0.0', 'Arguments (width, height, scaleMode, resolution) have been deprecated.');\n // #endif\n\n /* eslint-disable prefer-rest-params */\n options = {\n width: options,\n height: rest[0],\n scaleMode: rest[1],\n resolution: rest[2],\n };\n /* eslint-enable prefer-rest-params */\n }\n\n return new RenderTexture(new BaseRenderTexture(options));\n }\n}\n","import { RenderTexture } from './RenderTexture';\nimport { BaseRenderTexture } from './BaseRenderTexture';\nimport { nextPow2 } from '@pixi/utils';\nimport { MSAA_QUALITY } from '@pixi/constants';\n\nimport type { IBaseTextureOptions } from '../textures/BaseTexture';\nimport type { ISize } from '@pixi/math';\n\n/**\n * Texture pool, used by FilterSystem and plugins.\n *\n * Stores collection of temporary pow2 or screen-sized renderTextures\n *\n * If you use custom RenderTexturePool for your filters, you can use methods\n * `getFilterTexture` and `returnFilterTexture` same as in\n * @memberof PIXI\n */\nexport class RenderTexturePool\n{\n public textureOptions: IBaseTextureOptions;\n\n /**\n * Allow renderTextures of the same size as screen, not just pow2\n *\n * Automatically sets to true after `setScreenSize`\n * @default false\n */\n public enableFullScreen: boolean;\n texturePool: {[x in string | number]: RenderTexture[]};\n private _pixelsWidth: number;\n private _pixelsHeight: number;\n\n /**\n * @param textureOptions - options that will be passed to BaseRenderTexture constructor\n * @param {PIXI.SCALE_MODES} [textureOptions.scaleMode] - See {@link PIXI.SCALE_MODES} for possible values.\n */\n constructor(textureOptions?: IBaseTextureOptions)\n {\n this.texturePool = {};\n this.textureOptions = textureOptions || {};\n this.enableFullScreen = false;\n\n this._pixelsWidth = 0;\n this._pixelsHeight = 0;\n }\n\n /**\n * Creates texture with params that were specified in pool constructor.\n * @param realWidth - Width of texture in pixels.\n * @param realHeight - Height of texture in pixels.\n * @param multisample - Number of samples of the framebuffer.\n */\n createTexture(realWidth: number, realHeight: number, multisample = MSAA_QUALITY.NONE): RenderTexture\n {\n const baseRenderTexture = new BaseRenderTexture(Object.assign({\n width: realWidth,\n height: realHeight,\n resolution: 1,\n multisample,\n }, this.textureOptions));\n\n return new RenderTexture(baseRenderTexture);\n }\n\n /**\n * Gets a Power-of-Two render texture or fullScreen texture\n * @param minWidth - The minimum width of the render texture.\n * @param minHeight - The minimum height of the render texture.\n * @param resolution - The resolution of the render texture.\n * @param multisample - Number of samples of the render texture.\n * @returns The new render texture.\n */\n getOptimalTexture(minWidth: number, minHeight: number, resolution = 1, multisample = MSAA_QUALITY.NONE): RenderTexture\n {\n let key;\n\n minWidth = Math.ceil((minWidth * resolution) - 1e-6);\n minHeight = Math.ceil((minHeight * resolution) - 1e-6);\n\n if (!this.enableFullScreen || minWidth !== this._pixelsWidth || minHeight !== this._pixelsHeight)\n {\n minWidth = nextPow2(minWidth);\n minHeight = nextPow2(minHeight);\n key = (((minWidth & 0xFFFF) << 16) | (minHeight & 0xFFFF)) >>> 0;\n\n if (multisample > 1)\n {\n key += multisample * 0x100000000;\n }\n }\n else\n {\n key = multisample > 1 ? -multisample : -1;\n }\n\n if (!this.texturePool[key])\n {\n this.texturePool[key] = [];\n }\n\n let renderTexture = this.texturePool[key].pop();\n\n if (!renderTexture)\n {\n renderTexture = this.createTexture(minWidth, minHeight, multisample);\n }\n\n renderTexture.filterPoolKey = key;\n renderTexture.setResolution(resolution);\n\n return renderTexture;\n }\n\n /**\n * Gets extra texture of the same size as input renderTexture\n *\n * `getFilterTexture(input, 0.5)` or `getFilterTexture(0.5, input)`\n * @param input - renderTexture from which size and resolution will be copied\n * @param resolution - override resolution of the renderTexture\n * It overrides, it does not multiply\n * @param multisample - number of samples of the renderTexture\n */\n getFilterTexture(input: RenderTexture, resolution?: number, multisample?: MSAA_QUALITY): RenderTexture\n {\n const filterTexture = this.getOptimalTexture(input.width, input.height, resolution || input.resolution,\n multisample || MSAA_QUALITY.NONE);\n\n filterTexture.filterFrame = input.filterFrame;\n\n return filterTexture;\n }\n\n /**\n * Place a render texture back into the pool.\n * @param renderTexture - The renderTexture to free\n */\n returnTexture(renderTexture: RenderTexture): void\n {\n const key = renderTexture.filterPoolKey;\n\n renderTexture.filterFrame = null;\n this.texturePool[key].push(renderTexture);\n }\n\n /**\n * Alias for returnTexture, to be compliant with FilterSystem interface.\n * @param renderTexture - The renderTexture to free\n */\n returnFilterTexture(renderTexture: RenderTexture): void\n {\n this.returnTexture(renderTexture);\n }\n\n /**\n * Clears the pool.\n * @param destroyTextures - Destroy all stored textures.\n */\n clear(destroyTextures?: boolean): void\n {\n destroyTextures = destroyTextures !== false;\n if (destroyTextures)\n {\n for (const i in this.texturePool)\n {\n const textures = this.texturePool[i];\n\n if (textures)\n {\n for (let j = 0; j < textures.length; j++)\n {\n textures[j].destroy(true);\n }\n }\n }\n }\n\n this.texturePool = {};\n }\n\n /**\n * If screen size was changed, drops all screen-sized textures,\n * sets new screen size, sets `enableFullScreen` to true\n *\n * Size is measured in pixels, `renderer.view` can be passed here, not `renderer.screen`\n * @param size - Initial size of screen.\n */\n setScreenSize(size: ISize): void\n {\n if (size.width === this._pixelsWidth\n && size.height === this._pixelsHeight)\n {\n return;\n }\n\n this.enableFullScreen = size.width > 0 && size.height > 0;\n\n for (const i in this.texturePool)\n {\n if (!(Number(i) < 0))\n {\n continue;\n }\n\n const textures = this.texturePool[i];\n\n if (textures)\n {\n for (let j = 0; j < textures.length; j++)\n {\n textures[j].destroy(true);\n }\n }\n\n this.texturePool[i] = [];\n }\n\n this._pixelsWidth = size.width;\n this._pixelsHeight = size.height;\n }\n\n /**\n * Key that is used to store fullscreen renderTextures in a pool\n * @constant\n */\n static SCREEN_KEY = -1;\n}\n","import { TYPES } from '@pixi/constants';\n\n/* eslint-disable max-len */\n\n/**\n * Holds the information for a single attribute structure required to render geometry.\n *\n * This does not contain the actual data, but instead has a buffer id that maps to a {@link PIXI.Buffer}\n * This can include anything from positions, uvs, normals, colors etc.\n * @memberof PIXI\n */\nexport class Attribute\n{\n public buffer: number;\n public size: number;\n public normalized: boolean;\n public type: TYPES;\n public stride: number;\n public start: number;\n public instance: boolean;\n\n /**\n * @param buffer - the id of the buffer that this attribute will look for\n * @param size - the size of the attribute. If you have 2 floats per vertex (eg position x and y) this would be 2.\n * @param normalized - should the data be normalized.\n * @param {PIXI.TYPES} [type=PIXI.TYPES.FLOAT] - what type of number is the attribute. Check {@link PIXI.TYPES} to see the ones available\n * @param [stride=0] - How far apart, in bytes, the start of each value is. (used for interleaving data)\n * @param [start=0] - How far into the array to start reading values (used for interleaving data)\n * @param [instance=false] - Whether the geometry is instanced.\n */\n constructor(buffer: number, size = 0, normalized = false, type = TYPES.FLOAT, stride?: number, start?: number, instance?: boolean)\n {\n this.buffer = buffer;\n this.size = size;\n this.normalized = normalized;\n this.type = type;\n this.stride = stride;\n this.start = start;\n this.instance = instance;\n }\n\n /** Destroys the Attribute. */\n destroy(): void\n {\n this.buffer = null;\n }\n\n /**\n * Helper function that creates an Attribute based on the information provided\n * @param buffer - the id of the buffer that this attribute will look for\n * @param [size=0] - the size of the attribute. If you have 2 floats per vertex (eg position x and y) this would be 2\n * @param [normalized=false] - should the data be normalized.\n * @param [type=PIXI.TYPES.FLOAT] - what type of number is the attribute. Check {@link PIXI.TYPES} to see the ones available\n * @param [stride=0] - How far apart, in bytes, the start of each value is. (used for interleaving data)\n * @returns - A new {@link PIXI.Attribute} based on the information provided\n */\n static from(buffer: number, size?: number, normalized?: boolean, type?: TYPES, stride?: number): Attribute\n {\n return new Attribute(buffer, size, normalized, type, stride);\n }\n}\n","import { BUFFER_TYPE } from '@pixi/constants';\nimport { Runner } from '@pixi/runner';\nimport type { GLBuffer } from './GLBuffer';\n\nlet UID = 0;\n/* eslint-disable max-len */\n\n/**\n * Marks places in PixiJS where you can pass Float32Array, UInt32Array, any typed arrays, and ArrayBuffer\n *\n * Same as ArrayBuffer in typescript lib, defined here just for documentation\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface IArrayBuffer extends ArrayBuffer\n{\n}\n\n/**\n * PixiJS classes use this type instead of ArrayBuffer and typed arrays\n * to support expressions like `geometry.buffers[0].data[0] = position.x`.\n *\n * Gives access to indexing and `length` field\n * * @popelyshev: If data is actually ArrayBuffer and throws Exception on indexing - its user problem :)\n */\nexport interface ITypedArray extends IArrayBuffer\n{\n readonly length: number;\n [index: number]: number;\n readonly BYTES_PER_ELEMENT: number;\n}\n\n/**\n * A wrapper for data so that it can be used and uploaded by WebGL\n * @memberof PIXI\n */\nexport class Buffer\n{\n /**\n * The data in the buffer, as a typed array\n * @type {PIXI.IArrayBuffer}\n */\n public data: ITypedArray;\n\n /**\n * The type of buffer this is, one of:\n * + ELEMENT_ARRAY_BUFFER - used as an index buffer\n * + ARRAY_BUFFER - used as an attribute buffer\n * + UNIFORM_BUFFER - used as a uniform buffer (if available)\n */\n public type: BUFFER_TYPE;\n\n public static: boolean;\n public id: number;\n disposeRunner: Runner;\n\n /**\n * A map of renderer IDs to webgl buffer\n * @private\n * @type {Object<number, GLBuffer>}\n */\n _glBuffers: {[key: number]: GLBuffer};\n _updateID: number;\n\n /**\n * @param {PIXI.IArrayBuffer} data - the data to store in the buffer.\n * @param _static - `true` for static buffer\n * @param index - `true` for index buffer\n */\n constructor(data?: IArrayBuffer, _static = true, index = false)\n {\n this.data = (data || new Float32Array(1)) as ITypedArray;\n\n this._glBuffers = {};\n this._updateID = 0;\n\n this.index = index;\n this.static = _static;\n this.id = UID++;\n\n this.disposeRunner = new Runner('disposeBuffer');\n }\n\n // TODO could explore flagging only a partial upload?\n /**\n * Flags this buffer as requiring an upload to the GPU.\n * @param {PIXI.IArrayBuffer|number[]} [data] - the data to update in the buffer.\n */\n update(data?: IArrayBuffer | Array<number>): void\n {\n if (data instanceof Array)\n {\n data = new Float32Array(data);\n }\n this.data = (data as ITypedArray) || this.data;\n this._updateID++;\n }\n\n /** Disposes WebGL resources that are connected to this geometry. */\n dispose(): void\n {\n this.disposeRunner.emit(this, false);\n }\n\n /** Destroys the buffer. */\n destroy(): void\n {\n this.dispose();\n\n this.data = null;\n }\n\n /**\n * Flags whether this is an index buffer.\n *\n * Index buffers are of type `ELEMENT_ARRAY_BUFFER`. Note that setting this property to false will make\n * the buffer of type `ARRAY_BUFFER`.\n *\n * For backwards compatibility.\n */\n set index(value: boolean)\n {\n this.type = value ? BUFFER_TYPE.ELEMENT_ARRAY_BUFFER : BUFFER_TYPE.ARRAY_BUFFER;\n }\n\n get index(): boolean\n {\n return this.type === BUFFER_TYPE.ELEMENT_ARRAY_BUFFER;\n }\n\n /**\n * Helper function that creates a buffer based on an array or TypedArray\n * @param {ArrayBufferView | number[]} data - the TypedArray that the buffer will store. If this is a regular Array it will be converted to a Float32Array.\n * @returns - A new Buffer based on the data provided.\n */\n static from(data: IArrayBuffer | number[]): Buffer\n {\n if (data instanceof Array)\n {\n data = new Float32Array(data);\n }\n\n return new Buffer(data);\n }\n}\n","import { getBufferType } from '@pixi/utils';\n\nimport type { ITypedArray } from '../Buffer';\nimport type { Dict } from '@pixi/utils';\n\n/* eslint-disable object-shorthand */\nconst map: Dict<any> = {\n Float32Array: Float32Array,\n Uint32Array: Uint32Array,\n Int32Array: Int32Array,\n Uint8Array: Uint8Array,\n};\n\nexport function interleaveTypedArrays(arrays: Array<ITypedArray>, sizes: Array<number>): Float32Array\n{\n let outSize = 0;\n let stride = 0;\n const views: Dict<any> = {};\n\n for (let i = 0; i < arrays.length; i++)\n {\n stride += sizes[i];\n outSize += arrays[i].length;\n }\n\n const buffer = new ArrayBuffer(outSize * 4);\n\n let out = null;\n let littleOffset = 0;\n\n for (let i = 0; i < arrays.length; i++)\n {\n const size = sizes[i];\n const array = arrays[i];\n\n const type = getBufferType(array);\n\n if (!views[type])\n {\n views[type] = new map[type](buffer);\n }\n\n out = views[type];\n\n for (let j = 0; j < array.length; j++)\n {\n const indexStart = ((j / size | 0) * stride) + littleOffset;\n const index = j % size;\n\n out[indexStart + index] = array[j];\n }\n\n littleOffset += size;\n }\n\n return new Float32Array(buffer);\n}\n","import { Attribute } from './Attribute';\nimport { Buffer } from './Buffer';\nimport { interleaveTypedArrays } from './utils/interleaveTypedArrays';\nimport { getBufferType } from '@pixi/utils';\nimport { Runner } from '@pixi/runner';\n\nimport type { TYPES } from '@pixi/constants';\nimport { BUFFER_TYPE } from '@pixi/constants';\nimport type { IArrayBuffer } from './Buffer';\nimport type { Dict } from '@pixi/utils';\n\nconst byteSizeMap: {[key: number]: number} = { 5126: 4, 5123: 2, 5121: 1 };\nlet UID = 0;\n\n/* eslint-disable object-shorthand */\nconst map: Dict<any> = {\n Float32Array: Float32Array,\n Uint32Array: Uint32Array,\n Int32Array: Int32Array,\n Uint8Array: Uint8Array,\n Uint16Array: Uint16Array,\n};\n\n/* eslint-disable max-len */\n\n/**\n * The Geometry represents a model. It consists of two components:\n * - GeometryStyle - The structure of the model such as the attributes layout\n * - GeometryData - the data of the model - this consists of buffers.\n * This can include anything from positions, uvs, normals, colors etc.\n *\n * Geometry can be defined without passing in a style or data if required (thats how I prefer!)\n *\n * ```js\n * let geometry = new PIXI.Geometry();\n *\n * geometry.addAttribute('positions', [0, 0, 100, 0, 100, 100, 0, 100], 2);\n * geometry.addAttribute('uvs', [0,0,1,0,1,1,0,1],2)\n * geometry.addIndex([0,1,2,1,3,2])\n * ```\n * @memberof PIXI\n */\nexport class Geometry\n{\n public buffers: Array<Buffer>;\n public indexBuffer: Buffer;\n public attributes: {[key: string]: Attribute};\n public id: number;\n\n /** Whether the geometry is instanced. */\n public instanced: boolean;\n\n /**\n * Number of instances in this geometry, pass it to `GeometrySystem.draw()`.\n * @default 1\n */\n public instanceCount: number;\n\n /**\n * A map of renderer IDs to webgl VAOs\n * @type {object}\n */\n glVertexArrayObjects: {[key: number]: {[key: string]: WebGLVertexArrayObject}};\n disposeRunner: Runner;\n\n /** Count of existing (not destroyed) meshes that reference this geometry. */\n refCount: number;\n\n /**\n * @param buffers - An array of buffers. optional.\n * @param attributes - Of the geometry, optional structure of the attributes layout\n */\n constructor(buffers: Array<Buffer> = [], attributes: {[key: string]: Attribute} = {})\n {\n this.buffers = buffers;\n\n this.indexBuffer = null;\n\n this.attributes = attributes;\n\n this.glVertexArrayObjects = {};\n\n this.id = UID++;\n\n this.instanced = false;\n this.instanceCount = 1;\n\n this.disposeRunner = new Runner('disposeGeometry');\n this.refCount = 0;\n }\n\n /**\n *\n * Adds an attribute to the geometry\n * Note: `stride` and `start` should be `undefined` if you dont know them, not 0!\n * @param id - the name of the attribute (matching up to a shader)\n * @param {PIXI.Buffer|number[]} buffer - the buffer that holds the data of the attribute . You can also provide an Array and a buffer will be created from it.\n * @param size - the size of the attribute. If you have 2 floats per vertex (eg position x and y) this would be 2\n * @param normalized - should the data be normalized.\n * @param [type=PIXI.TYPES.FLOAT] - what type of number is the attribute. Check {PIXI.TYPES} to see the ones available\n * @param [stride=0] - How far apart, in bytes, the start of each value is. (used for interleaving data)\n * @param [start=0] - How far into the array to start reading values (used for interleaving data)\n * @param instance - Instancing flag\n * @returns - Returns self, useful for chaining.\n */\n addAttribute(id: string, buffer: Buffer | Float32Array | Uint32Array | Array<number>, size = 0, normalized = false,\n type?: TYPES, stride?: number, start?: number, instance = false): this\n {\n if (!buffer)\n {\n throw new Error('You must pass a buffer when creating an attribute');\n }\n\n // check if this is a buffer!\n if (!(buffer instanceof Buffer))\n {\n // its an array!\n if (buffer instanceof Array)\n {\n buffer = new Float32Array(buffer);\n }\n\n buffer = new Buffer(buffer);\n }\n\n const ids = id.split('|');\n\n if (ids.length > 1)\n {\n for (let i = 0; i < ids.length; i++)\n {\n this.addAttribute(ids[i], buffer, size, normalized, type);\n }\n\n return this;\n }\n\n let bufferIndex = this.buffers.indexOf(buffer);\n\n if (bufferIndex === -1)\n {\n this.buffers.push(buffer);\n bufferIndex = this.buffers.length - 1;\n }\n\n this.attributes[id] = new Attribute(bufferIndex, size, normalized, type, stride, start, instance);\n\n // assuming that if there is instanced data then this will be drawn with instancing!\n this.instanced = this.instanced || instance;\n\n return this;\n }\n\n /**\n * Returns the requested attribute.\n * @param id - The name of the attribute required\n * @returns - The attribute requested.\n */\n getAttribute(id: string): Attribute\n {\n return this.attributes[id];\n }\n\n /**\n * Returns the requested buffer.\n * @param id - The name of the buffer required.\n * @returns - The buffer requested.\n */\n getBuffer(id: string): Buffer\n {\n return this.buffers[this.getAttribute(id).buffer];\n }\n\n /**\n *\n * Adds an index buffer to the geometry\n * The index buffer contains integers, three for each triangle in the geometry, which reference the various attribute buffers (position, colour, UV coordinates, other UV coordinates, normal, …). There is only ONE index buffer.\n * @param {PIXI.Buffer|number[]} [buffer] - The buffer that holds the data of the index buffer. You can also provide an Array and a buffer will be created from it.\n * @returns - Returns self, useful for chaining.\n */\n addIndex(buffer?: Buffer | IArrayBuffer | number[]): Geometry\n {\n if (!(buffer instanceof Buffer))\n {\n // its an array!\n if (buffer instanceof Array)\n {\n buffer = new Uint16Array(buffer);\n }\n\n buffer = new Buffer(buffer);\n }\n\n buffer.type = BUFFER_TYPE.ELEMENT_ARRAY_BUFFER;\n\n this.indexBuffer = buffer;\n\n if (this.buffers.indexOf(buffer) === -1)\n {\n this.buffers.push(buffer);\n }\n\n return this;\n }\n\n /**\n * Returns the index buffer\n * @returns - The index buffer.\n */\n getIndex(): Buffer\n {\n return this.indexBuffer;\n }\n\n /**\n * This function modifies the structure so that all current attributes become interleaved into a single buffer\n * This can be useful if your model remains static as it offers a little performance boost\n * @returns - Returns self, useful for chaining.\n */\n interleave(): Geometry\n {\n // a simple check to see if buffers are already interleaved..\n if (this.buffers.length === 1 || (this.buffers.length === 2 && this.indexBuffer)) return this;\n\n // assume already that no buffers are interleaved\n const arrays = [];\n const sizes = [];\n const interleavedBuffer = new Buffer();\n let i;\n\n for (i in this.attributes)\n {\n const attribute = this.attributes[i];\n\n const buffer = this.buffers[attribute.buffer];\n\n arrays.push(buffer.data);\n\n sizes.push((attribute.size * byteSizeMap[attribute.type]) / 4);\n\n attribute.buffer = 0;\n }\n\n interleavedBuffer.data = interleaveTypedArrays(arrays, sizes);\n\n for (i = 0; i < this.buffers.length; i++)\n {\n if (this.buffers[i] !== this.indexBuffer)\n {\n this.buffers[i].destroy();\n }\n }\n\n this.buffers = [interleavedBuffer];\n\n if (this.indexBuffer)\n {\n this.buffers.push(this.indexBuffer);\n }\n\n return this;\n }\n\n /** Get the size of the geometries, in vertices. */\n getSize(): number\n {\n for (const i in this.attributes)\n {\n const attribute = this.attributes[i];\n const buffer = this.buffers[attribute.buffer];\n\n return (buffer.data as any).length / ((attribute.stride / 4) || attribute.size);\n }\n\n return 0;\n }\n\n /** Disposes WebGL resources that are connected to this geometry. */\n dispose(): void\n {\n this.disposeRunner.emit(this, false);\n }\n\n /** Destroys the geometry. */\n destroy(): void\n {\n this.dispose();\n\n this.buffers = null;\n this.indexBuffer = null;\n this.attributes = null;\n }\n\n /**\n * Returns a clone of the geometry.\n * @returns - A new clone of this geometry.\n */\n clone(): Geometry\n {\n const geometry = new Geometry();\n\n for (let i = 0; i < this.buffers.length; i++)\n {\n geometry.buffers[i] = new Buffer(this.buffers[i].data.slice(0));\n }\n\n for (const i in this.attributes)\n {\n const attrib = this.attributes[i];\n\n geometry.attributes[i] = new Attribute(\n attrib.buffer,\n attrib.size,\n attrib.normalized,\n attrib.type,\n attrib.stride,\n attrib.start,\n attrib.instance\n );\n }\n\n if (this.indexBuffer)\n {\n geometry.indexBuffer = geometry.buffers[this.buffers.indexOf(this.indexBuffer)];\n geometry.indexBuffer.type = BUFFER_TYPE.ELEMENT_ARRAY_BUFFER;\n }\n\n return geometry;\n }\n\n /**\n * Merges an array of geometries into a new single one.\n *\n * Geometry attribute styles must match for this operation to work.\n * @param geometries - array of geometries to merge\n * @returns - Shiny new geometry!\n */\n static merge(geometries: Array<Geometry>): Geometry\n {\n // todo add a geometry check!\n // also a size check.. cant be too big!]\n\n const geometryOut = new Geometry();\n\n const arrays = [];\n const sizes: Array<number> = [];\n const offsets = [];\n\n let geometry;\n\n // pass one.. get sizes..\n for (let i = 0; i < geometries.length; i++)\n {\n geometry = geometries[i];\n\n for (let j = 0; j < geometry.buffers.length; j++)\n {\n sizes[j] = sizes[j] || 0;\n sizes[j] += geometry.buffers[j].data.length;\n offsets[j] = 0;\n }\n }\n\n // build the correct size arrays..\n for (let i = 0; i < geometry.buffers.length; i++)\n {\n // TODO types!\n arrays[i] = new map[getBufferType(geometry.buffers[i].data)](sizes[i]);\n geometryOut.buffers[i] = new Buffer(arrays[i]);\n }\n\n // pass to set data..\n for (let i = 0; i < geometries.length; i++)\n {\n geometry = geometries[i];\n\n for (let j = 0; j < geometry.buffers.length; j++)\n {\n arrays[j].set(geometry.buffers[j].data, offsets[j]);\n offsets[j] += geometry.buffers[j].data.length;\n }\n }\n\n geometryOut.attributes = geometry.attributes;\n\n if (geometry.indexBuffer)\n {\n geometryOut.indexBuffer = geometryOut.buffers[geometry.buffers.indexOf(geometry.indexBuffer)];\n geometryOut.indexBuffer.type = BUFFER_TYPE.ELEMENT_ARRAY_BUFFER;\n\n let offset = 0;\n let stride = 0;\n let offset2 = 0;\n let bufferIndexToCount = 0;\n\n // get a buffer\n for (let i = 0; i < geometry.buffers.length; i++)\n {\n if (geometry.buffers[i] !== geometry.indexBuffer)\n {\n bufferIndexToCount = i;\n break;\n }\n }\n\n // figure out the stride of one buffer..\n for (const i in geometry.attributes)\n {\n const attribute = geometry.attributes[i];\n\n if ((attribute.buffer | 0) === bufferIndexToCount)\n {\n stride += ((attribute.size * byteSizeMap[attribute.type]) / 4);\n }\n }\n\n // time to off set all indexes..\n for (let i = 0; i < geometries.length; i++)\n {\n const indexBufferData = geometries[i].indexBuffer.data;\n\n for (let j = 0; j < indexBufferData.length; j++)\n {\n geometryOut.indexBuffer.data[j + offset2] += offset;\n }\n\n offset += geometries[i].buffers[bufferIndexToCount].data.length / (stride);\n offset2 += indexBufferData.length;\n }\n }\n\n return geometryOut;\n }\n}\n","import { Geometry } from '../geometry/Geometry';\n\n/**\n * Helper class to create a quad\n * @memberof PIXI\n */\nexport class Quad extends Geometry\n{\n constructor()\n {\n super();\n\n this.addAttribute('aVertexPosition', new Float32Array([\n 0, 0,\n 1, 0,\n 1, 1,\n 0, 1,\n ]))\n .addIndex([0, 1, 3, 2]);\n }\n}\n","import { Geometry } from '../geometry/Geometry';\nimport { Buffer } from '../geometry/Buffer';\n\nimport type { Rectangle } from '@pixi/math';\n\n/**\n * Helper class to create a quad with uvs like in v4\n * @memberof PIXI\n */\nexport class QuadUv extends Geometry\n{\n vertexBuffer: Buffer;\n uvBuffer: Buffer;\n\n /** An array of vertices. */\n vertices: Float32Array;\n\n /** The Uvs of the quad. */\n uvs: Float32Array;\n\n constructor()\n {\n super();\n\n this.vertices = new Float32Array([\n -1, -1,\n 1, -1,\n 1, 1,\n -1, 1,\n ]);\n\n this.uvs = new Float32Array([\n 0, 0,\n 1, 0,\n 1, 1,\n 0, 1,\n ]);\n\n this.vertexBuffer = new Buffer(this.vertices);\n this.uvBuffer = new Buffer(this.uvs);\n\n this.addAttribute('aVertexPosition', this.vertexBuffer)\n .addAttribute('aTextureCoord', this.uvBuffer)\n .addIndex([0, 1, 2, 0, 2, 3]);\n }\n\n /**\n * Maps two Rectangle to the quad.\n * @param targetTextureFrame - The first rectangle\n * @param destinationFrame - The second rectangle\n * @returns - Returns itself.\n */\n map(targetTextureFrame: Rectangle, destinationFrame: Rectangle): this\n {\n let x = 0; // destinationFrame.x / targetTextureFrame.width;\n let y = 0; // destinationFrame.y / targetTextureFrame.height;\n\n this.uvs[0] = x;\n this.uvs[1] = y;\n\n this.uvs[2] = x + (destinationFrame.width / targetTextureFrame.width);\n this.uvs[3] = y;\n\n this.uvs[4] = x + (destinationFrame.width / targetTextureFrame.width);\n this.uvs[5] = y + (destinationFrame.height / targetTextureFrame.height);\n\n this.uvs[6] = x;\n this.uvs[7] = y + (destinationFrame.height / targetTextureFrame.height);\n\n x = destinationFrame.x;\n y = destinationFrame.y;\n\n this.vertices[0] = x;\n this.vertices[1] = y;\n\n this.vertices[2] = x + destinationFrame.width;\n this.vertices[3] = y;\n\n this.vertices[4] = x + destinationFrame.width;\n this.vertices[5] = y + destinationFrame.height;\n\n this.vertices[6] = x;\n this.vertices[7] = y + destinationFrame.height;\n\n this.invalidate();\n\n return this;\n }\n\n /**\n * Legacy upload method, just marks buffers dirty.\n * @returns - Returns itself.\n */\n invalidate(): this\n {\n this.vertexBuffer._updateID++;\n this.uvBuffer._updateID++;\n\n return this;\n }\n}\n","import { BUFFER_TYPE } from '@pixi/constants';\nimport type { Dict } from '@pixi/utils';\nimport { Buffer } from '../geometry/Buffer';\nimport type { UniformsSyncCallback } from './utils';\n\nlet UID = 0;\n\n/**\n * Uniform group holds uniform map and some ID's for work\n *\n * `UniformGroup` has two modes:\n *\n * 1: Normal mode\n * Normal mode will upload the uniforms with individual function calls as required\n *\n * 2: Uniform buffer mode\n * This mode will treat the uniforms as a uniform buffer. You can pass in either a buffer that you manually handle, or\n * or a generic object that PixiJS will automatically map to a buffer for you.\n * For maximum benefits, make Ubo UniformGroups static, and only update them each frame.\n *\n * Rules of UBOs:\n * - UBOs only work with WebGL2, so make sure you have a fallback!\n * - Only floats are supported (including vec[2,3,4], mat[2,3,4])\n * - Samplers cannot be used in ubo's (a GPU limitation)\n * - You must ensure that the object you pass in exactly matches in the shader ubo structure.\n * Otherwise, weirdness will ensue!\n * - The name of the ubo object added to the group must match exactly the name of the ubo in the shader.\n *\n * ```\n * // ubo in shader:\n * uniform myCoolData { // declaring a ubo..\n * mat4 uCoolMatrix;\n * float uFloatyMcFloatFace\n *\n *\n * // a new uniform buffer object..\n * const myCoolData = new UniformBufferGroup({\n * uCoolMatrix: new Matrix(),\n * uFloatyMcFloatFace: 23,\n * }}\n *\n * // build a shader...\n * const shader = Shader.from(srcVert, srcFrag, {\n * myCoolData // name matches the ubo name in the shader. will be processed accordingly.\n * })\n *\n * ```\n * @memberof PIXI\n */\nexport class UniformGroup<LAYOUT = Dict<any>>\n{\n /**\n * Uniform values\n * @member {object}\n */\n public readonly uniforms: LAYOUT;\n\n /**\n * Its a group and not a single uniforms.\n * @default true\n */\n public readonly group: boolean;\n\n /**\n * unique id\n * @protected\n */\n public id: number;\n syncUniforms: Dict<UniformsSyncCallback>;\n\n /**\n * Dirty version\n * @protected\n */\n dirtyId: number;\n\n /** Flag for if uniforms wont be changed after creation. */\n static: boolean;\n\n /** Flags whether this group is treated like a uniform buffer object. */\n ubo: boolean;\n buffer?: Buffer;\n autoManage: boolean;\n\n /**\n * @param {object | Buffer} [uniforms] - Custom uniforms to use to augment the built-in ones. Or a pixi buffer.\n * @param isStatic - Uniforms wont be changed after creation.\n * @param isUbo - If true, will treat this uniform group as a uniform buffer object.\n */\n constructor(uniforms: LAYOUT | Buffer, isStatic?: boolean, isUbo?: boolean)\n {\n this.group = true;\n\n // lets generate this when the shader ?\n this.syncUniforms = {};\n this.dirtyId = 0;\n this.id = UID++;\n this.static = !!isStatic;\n this.ubo = !!isUbo;\n\n if (uniforms instanceof Buffer)\n {\n this.buffer = uniforms;\n this.buffer.type = BUFFER_TYPE.UNIFORM_BUFFER;\n this.autoManage = false;\n this.ubo = true;\n }\n else\n {\n this.uniforms = uniforms;\n\n if (this.ubo)\n {\n this.buffer = new Buffer(new Float32Array(1));\n this.buffer.type = BUFFER_TYPE.UNIFORM_BUFFER;\n this.autoManage = true;\n }\n }\n }\n\n update(): void\n {\n this.dirtyId++;\n\n if (!this.autoManage && this.buffer)\n {\n this.buffer.update();\n }\n }\n\n add(name: string, uniforms: Dict<any>, _static?: boolean): void\n {\n if (!this.ubo)\n {\n (this.uniforms as any)[name] = new UniformGroup(uniforms, _static);\n }\n else\n {\n // eslint-disable-next-line max-len\n throw new Error('[UniformGroup] uniform groups in ubo mode cannot be modified, or have uniform groups nested in them');\n }\n }\n\n static from(uniforms: Dict<any> | Buffer, _static?: boolean, _ubo?: boolean): UniformGroup\n {\n return new UniformGroup(uniforms, _static, _ubo);\n }\n\n /**\n * A short hand function for creating a static UBO UniformGroup.\n * @param uniforms - the ubo item\n * @param _static - should this be updated each time it is used? defaults to true here!\n */\n static uboFrom(uniforms: Dict<any> | Buffer, _static?: boolean): UniformGroup\n {\n return new UniformGroup(uniforms, _static ?? true, true);\n }\n}\n","import type { Matrix } from '@pixi/math';\nimport { Rectangle } from '@pixi/math';\nimport { MSAA_QUALITY } from '@pixi/constants';\n\nimport type { Filter } from './Filter';\nimport type { IFilterTarget } from './IFilterTarget';\nimport type { RenderTexture } from '../renderTexture/RenderTexture';\n\n/**\n * System plugin to the renderer to manage filter states.\n * @ignore\n */\nexport class FilterState\n{\n renderTexture: RenderTexture;\n\n /**\n * Target of the filters\n * We store for case when custom filter wants to know the element it was applied on\n * @member {PIXI.DisplayObject}\n */\n target: IFilterTarget;\n\n /**\n * Compatibility with PixiJS v4 filters\n * @default false\n */\n legacy: boolean;\n\n /**\n * Resolution of filters\n * @default 1\n */\n resolution: number;\n\n /**\n * Number of samples\n * @default MSAA_QUALITY.NONE\n */\n multisample: MSAA_QUALITY;\n\n /** Source frame. */\n sourceFrame: Rectangle;\n\n /** Destination frame. */\n destinationFrame: Rectangle;\n\n /** Original render-target source frame. */\n bindingSourceFrame: Rectangle;\n\n /** Original render-target destination frame. */\n bindingDestinationFrame: Rectangle;\n\n /** Collection of filters. */\n filters: Array<Filter>;\n\n /** Projection system transform saved by link. */\n transform: Matrix;\n\n constructor()\n {\n this.renderTexture = null;\n\n this.target = null;\n this.legacy = false;\n this.resolution = 1;\n this.multisample = MSAA_QUALITY.NONE;\n\n // next three fields are created only for root\n // re-assigned for everything else\n\n this.sourceFrame = new Rectangle();\n this.destinationFrame = new Rectangle();\n this.bindingSourceFrame = new Rectangle();\n this.bindingDestinationFrame = new Rectangle();\n this.filters = [];\n this.transform = null;\n }\n\n /** Clears the state */\n clear(): void\n {\n this.target = null;\n this.filters = null;\n this.renderTexture = null;\n }\n}\n","import { RenderTexturePool } from '../renderTexture/RenderTexturePool';\nimport { Quad } from '../utils/Quad';\nimport { QuadUv } from '../utils/QuadUv';\nimport { Rectangle, Matrix, Point } from '@pixi/math';\nimport { UniformGroup } from '../shader/UniformGroup';\nimport { DRAW_MODES, CLEAR_MODES, MSAA_QUALITY } from '@pixi/constants';\nimport { FilterState } from './FilterState';\n\nimport type { ISystem } from '../ISystem';\nimport type { Filter } from './Filter';\nimport type { IFilterTarget } from './IFilterTarget';\nimport type { ISpriteMaskTarget } from './spriteMask/SpriteMaskFilter';\nimport type { RenderTexture } from '../renderTexture/RenderTexture';\nimport type { Renderer } from '../Renderer';\n\nconst tempPoints = [new Point(), new Point(), new Point(), new Point()];\nconst tempMatrix = new Matrix();\n\n/**\n * System plugin to the renderer to manage filters.\n *\n * ## Pipeline\n *\n * The FilterSystem executes the filtering pipeline by rendering the display-object into a texture, applying its\n * [filters]{@link PIXI.Filter} in series, and the last filter outputs into the final render-target.\n *\n * The filter-frame is the rectangle in world space being filtered, and those contents are mapped into\n * `(0, 0, filterFrame.width, filterFrame.height)` into the filter render-texture. The filter-frame is also called\n * the source-frame, as it is used to bind the filter render-textures. The last filter outputs to the `filterFrame`\n * in the final render-target.\n *\n * ## Usage\n *\n * {@link PIXI.Container#renderAdvanced} is an example of how to use the filter system. It is a 3 step process:\n *\n * **push**: Use {@link PIXI.FilterSystem#push} to push the set of filters to be applied on a filter-target.\n * **render**: Render the contents to be filtered using the renderer. The filter-system will only capture the contents\n * inside the bounds of the filter-target. NOTE: Using {@link PIXI.Renderer#render} is\n * illegal during an existing render cycle, and it may reset the filter system.\n * **pop**: Use {@link PIXI.FilterSystem#pop} to pop & execute the filters you initially pushed. It will apply them\n * serially and output to the bounds of the filter-target.\n * @memberof PIXI\n */\nexport class FilterSystem implements ISystem\n{\n /**\n * List of filters for the FilterSystem\n * @member {object[]}\n */\n public readonly defaultFilterStack: Array<FilterState>;\n\n /** A pool for storing filter states, save us creating new ones each tick. */\n public statePool: Array<FilterState>;\n\n /** Stores a bunch of POT textures used for filtering. */\n public texturePool: RenderTexturePool;\n\n /** Whether to clear output renderTexture in AUTO/BLIT mode. See {@link PIXI.CLEAR_MODES}. */\n public forceClear: boolean;\n\n /**\n * Old padding behavior is to use the max amount instead of sum padding.\n * Use this flag if you need the old behavior.\n * @default false\n */\n public useMaxPadding: boolean;\n\n /** A very simple geometry used when drawing a filter effect to the screen. */\n protected quad: Quad;\n\n /** Quad UVs */\n protected quadUv: QuadUv;\n\n /**\n * Active state\n * @member {object}\n */\n protected activeState: FilterState;\n\n /**\n * This uniform group is attached to filter uniforms when used.\n * @property {PIXI.Rectangle} outputFrame -\n * @property {Float32Array} inputSize -\n * @property {Float32Array} inputPixel -\n * @property {Float32Array} inputClamp -\n * @property {number} resolution -\n * @property {Float32Array} filterArea -\n * @property {Float32Array} filterClamp -\n */\n protected globalUniforms: UniformGroup;\n\n /** Temporary rect for math. */\n private tempRect: Rectangle;\n public renderer: Renderer;\n\n /**\n * @param renderer - The renderer this System works for.\n */\n constructor(renderer: Renderer)\n {\n this.renderer = renderer;\n\n this.defaultFilterStack = [{}] as any;\n\n this.texturePool = new RenderTexturePool();\n this.texturePool.setScreenSize(renderer.view);\n this.statePool = [];\n\n this.quad = new Quad();\n this.quadUv = new QuadUv();\n this.tempRect = new Rectangle();\n this.activeState = {} as any;\n\n this.globalUniforms = new UniformGroup({\n outputFrame: new Rectangle(),\n inputSize: new Float32Array(4),\n inputPixel: new Float32Array(4),\n inputClamp: new Float32Array(4),\n resolution: 1,\n\n // legacy variables\n filterArea: new Float32Array(4),\n filterClamp: new Float32Array(4),\n }, true);\n\n this.forceClear = false;\n this.useMaxPadding = false;\n }\n\n /**\n * Pushes a set of filters to be applied later to the system. This will redirect further rendering into an\n * input render-texture for the rest of the filtering pipeline.\n * @param {PIXI.DisplayObject} target - The target of the filter to render.\n * @param filters - The filters to apply.\n */\n push(target: IFilterTarget, filters: Array<Filter>): void\n {\n const renderer = this.renderer;\n const filterStack = this.defaultFilterStack;\n const state = this.statePool.pop() || new FilterState();\n const renderTextureSystem = this.renderer.renderTexture;\n\n let resolution = filters[0].resolution;\n let multisample = filters[0].multisample;\n let padding = filters[0].padding;\n let autoFit = filters[0].autoFit;\n // We don't know whether it's a legacy filter until it was bound for the first time,\n // therefore we have to assume that it is if legacy is undefined.\n let legacy = filters[0].legacy ?? true;\n\n for (let i = 1; i < filters.length; i++)\n {\n const filter = filters[i];\n\n // let's use the lowest resolution\n resolution = Math.min(resolution, filter.resolution);\n // let's use the lowest number of samples\n multisample = Math.min(multisample, filter.multisample);\n // figure out the padding required for filters\n padding = this.useMaxPadding\n // old behavior: use largest amount of padding!\n ? Math.max(padding, filter.padding)\n // new behavior: sum the padding\n : padding + filter.padding;\n // only auto fit if all filters are autofit\n autoFit = autoFit && filter.autoFit;\n\n legacy = legacy || (filter.legacy ?? true);\n }\n\n if (filterStack.length === 1)\n {\n this.defaultFilterStack[0].renderTexture = renderTextureSystem.current;\n }\n\n filterStack.push(state);\n\n state.resolution = resolution;\n state.multisample = multisample;\n\n state.legacy = legacy;\n\n state.target = target;\n state.sourceFrame.copyFrom(target.filterArea || target.getBounds(true));\n\n state.sourceFrame.pad(padding);\n\n const sourceFrameProjected = this.tempRect.copyFrom(renderTextureSystem.sourceFrame);\n\n // Project source frame into world space (if projection is applied)\n if (renderer.projection.transform)\n {\n this.transformAABB(\n tempMatrix.copyFrom(renderer.projection.transform).invert(),\n sourceFrameProjected\n );\n }\n\n if (autoFit)\n {\n state.sourceFrame.fit(sourceFrameProjected);\n\n if (state.sourceFrame.width <= 0 || state.sourceFrame.height <= 0)\n {\n state.sourceFrame.width = 0;\n state.sourceFrame.height = 0;\n }\n }\n else if (!state.sourceFrame.intersects(sourceFrameProjected))\n {\n state.sourceFrame.width = 0;\n state.sourceFrame.height = 0;\n }\n\n // Round sourceFrame in screen space based on render-texture.\n this.roundFrame(\n state.sourceFrame,\n renderTextureSystem.current ? renderTextureSystem.current.resolution : renderer.resolution,\n renderTextureSystem.sourceFrame,\n renderTextureSystem.destinationFrame,\n renderer.projection.transform,\n );\n\n state.renderTexture = this.getOptimalFilterTexture(state.sourceFrame.width, state.sourceFrame.height,\n resolution, multisample);\n state.filters = filters;\n\n state.destinationFrame.width = state.renderTexture.width;\n state.destinationFrame.height = state.renderTexture.height;\n\n const destinationFrame = this.tempRect;\n\n destinationFrame.x = 0;\n destinationFrame.y = 0;\n destinationFrame.width = state.sourceFrame.width;\n destinationFrame.height = state.sourceFrame.height;\n\n state.renderTexture.filterFrame = state.sourceFrame;\n state.bindingSourceFrame.copyFrom(renderTextureSystem.sourceFrame);\n state.bindingDestinationFrame.copyFrom(renderTextureSystem.destinationFrame);\n\n state.transform = renderer.projection.transform;\n renderer.projection.transform = null;\n renderTextureSystem.bind(state.renderTexture, state.sourceFrame, destinationFrame);\n renderer.framebuffer.clear(0, 0, 0, 0);\n }\n\n /** Pops off the filter and applies it. */\n pop(): void\n {\n const filterStack = this.defaultFilterStack;\n const state = filterStack.pop();\n const filters = state.filters;\n\n this.activeState = state;\n\n const globalUniforms = this.globalUniforms.uniforms;\n\n globalUniforms.outputFrame = state.sourceFrame;\n globalUniforms.resolution = state.resolution;\n\n const inputSize = globalUniforms.inputSize;\n const inputPixel = globalUniforms.inputPixel;\n const inputClamp = globalUniforms.inputClamp;\n\n inputSize[0] = state.destinationFrame.width;\n inputSize[1] = state.destinationFrame.height;\n inputSize[2] = 1.0 / inputSize[0];\n inputSize[3] = 1.0 / inputSize[1];\n\n inputPixel[0] = Math.round(inputSize[0] * state.resolution);\n inputPixel[1] = Math.round(inputSize[1] * state.resolution);\n inputPixel[2] = 1.0 / inputPixel[0];\n inputPixel[3] = 1.0 / inputPixel[1];\n\n inputClamp[0] = 0.5 * inputPixel[2];\n inputClamp[1] = 0.5 * inputPixel[3];\n inputClamp[2] = (state.sourceFrame.width * inputSize[2]) - (0.5 * inputPixel[2]);\n inputClamp[3] = (state.sourceFrame.height * inputSize[3]) - (0.5 * inputPixel[3]);\n\n // only update the rect if its legacy..\n if (state.legacy)\n {\n const filterArea = globalUniforms.filterArea;\n\n filterArea[0] = state.destinationFrame.width;\n filterArea[1] = state.destinationFrame.height;\n filterArea[2] = state.sourceFrame.x;\n filterArea[3] = state.sourceFrame.y;\n\n globalUniforms.filterClamp = globalUniforms.inputClamp;\n }\n\n this.globalUniforms.update();\n\n const lastState = filterStack[filterStack.length - 1];\n\n this.renderer.framebuffer.blit();\n\n if (filters.length === 1)\n {\n filters[0].apply(this, state.renderTexture, lastState.renderTexture, CLEAR_MODES.BLEND, state);\n\n this.returnFilterTexture(state.renderTexture);\n }\n else\n {\n let flip = state.renderTexture;\n let flop = this.getOptimalFilterTexture(\n flip.width,\n flip.height,\n state.resolution\n );\n\n flop.filterFrame = flip.filterFrame;\n\n let i = 0;\n\n for (i = 0; i < filters.length - 1; ++i)\n {\n if (i === 1 && state.multisample > 1)\n {\n flop = this.getOptimalFilterTexture(\n flip.width,\n flip.height,\n state.resolution\n );\n\n flop.filterFrame = flip.filterFrame;\n }\n\n filters[i].apply(this, flip, flop, CLEAR_MODES.CLEAR, state);\n\n const t = flip;\n\n flip = flop;\n flop = t;\n }\n\n filters[i].apply(this, flip, lastState.renderTexture, CLEAR_MODES.BLEND, state);\n\n if (i > 1 && state.multisample > 1)\n {\n this.returnFilterTexture(state.renderTexture);\n }\n\n this.returnFilterTexture(flip);\n this.returnFilterTexture(flop);\n }\n\n // lastState.renderTexture is blitted when lastState is popped\n\n state.clear();\n this.statePool.push(state);\n }\n\n /**\n * Binds a renderTexture with corresponding `filterFrame`, clears it if mode corresponds.\n * @param filterTexture - renderTexture to bind, should belong to filter pool or filter stack\n * @param clearMode - clearMode, by default its CLEAR/YES. See {@link PIXI.CLEAR_MODES}\n */\n bindAndClear(filterTexture: RenderTexture, clearMode: CLEAR_MODES = CLEAR_MODES.CLEAR): void\n {\n const {\n renderTexture: renderTextureSystem,\n state: stateSystem,\n } = this.renderer;\n\n if (filterTexture === this.defaultFilterStack[this.defaultFilterStack.length - 1].renderTexture)\n {\n // Restore projection transform if rendering into the output render-target.\n this.renderer.projection.transform = this.activeState.transform;\n }\n else\n {\n // Prevent projection within filtering pipeline.\n this.renderer.projection.transform = null;\n }\n\n if (filterTexture && filterTexture.filterFrame)\n {\n const destinationFrame = this.tempRect;\n\n destinationFrame.x = 0;\n destinationFrame.y = 0;\n destinationFrame.width = filterTexture.filterFrame.width;\n destinationFrame.height = filterTexture.filterFrame.height;\n\n renderTextureSystem.bind(filterTexture, filterTexture.filterFrame, destinationFrame);\n }\n else if (filterTexture !== this.defaultFilterStack[this.defaultFilterStack.length - 1].renderTexture)\n {\n renderTextureSystem.bind(filterTexture);\n }\n else\n {\n // Restore binding for output render-target.\n this.renderer.renderTexture.bind(\n filterTexture,\n this.activeState.bindingSourceFrame,\n this.activeState.bindingDestinationFrame\n );\n }\n\n // Clear the texture in BLIT mode if blending is disabled or the forceClear flag is set. The blending\n // is stored in the 0th bit of the state.\n const autoClear = (stateSystem.stateId & 1) || this.forceClear;\n\n if (clearMode === CLEAR_MODES.CLEAR\n || (clearMode === CLEAR_MODES.BLIT && autoClear))\n {\n // Use framebuffer.clear because we want to clear the whole filter texture, not just the filtering\n // area over which the shaders are run. This is because filters may sampling outside of it (e.g. blur)\n // instead of clamping their arithmetic.\n this.renderer.framebuffer.clear(0, 0, 0, 0);\n }\n }\n\n /**\n * Draws a filter using the default rendering process.\n *\n * This should be called only by {@link Filter#apply}.\n * @param filter - The filter to draw.\n * @param input - The input render target.\n * @param output - The target to output to.\n * @param clearMode - Should the output be cleared before rendering to it\n */\n applyFilter(filter: Filter, input: RenderTexture, output: RenderTexture, clearMode?: CLEAR_MODES): void\n {\n const renderer = this.renderer;\n\n // Set state before binding, so bindAndClear gets the blend mode.\n renderer.state.set(filter.state);\n this.bindAndClear(output, clearMode);\n\n // set the uniforms..\n filter.uniforms.uSampler = input;\n filter.uniforms.filterGlobals = this.globalUniforms;\n\n // TODO make it so that the order of this does not matter..\n // because it does at the moment cos of global uniforms.\n // they need to get resynced\n renderer.shader.bind(filter);\n\n // check to see if the filter is a legacy one..\n filter.legacy = !!filter.program.attributeData.aTextureCoord;\n\n if (filter.legacy)\n {\n this.quadUv.map(input._frame, input.filterFrame);\n\n renderer.geometry.bind(this.quadUv);\n renderer.geometry.draw(DRAW_MODES.TRIANGLES);\n }\n else\n {\n renderer.geometry.bind(this.quad);\n renderer.geometry.draw(DRAW_MODES.TRIANGLE_STRIP);\n }\n }\n\n /**\n * Multiply _input normalized coordinates_ to this matrix to get _sprite texture normalized coordinates_.\n *\n * Use `outputMatrix * vTextureCoord` in the shader.\n * @param outputMatrix - The matrix to output to.\n * @param {PIXI.Sprite} sprite - The sprite to map to.\n * @returns The mapped matrix.\n */\n calculateSpriteMatrix(outputMatrix: Matrix, sprite: ISpriteMaskTarget): Matrix\n {\n const { sourceFrame, destinationFrame } = this.activeState;\n const { orig } = sprite._texture;\n const mappedMatrix = outputMatrix.set(destinationFrame.width, 0, 0,\n destinationFrame.height, sourceFrame.x, sourceFrame.y);\n const worldTransform = sprite.worldTransform.copyTo(Matrix.TEMP_MATRIX);\n\n worldTransform.invert();\n mappedMatrix.prepend(worldTransform);\n mappedMatrix.scale(1.0 / orig.width, 1.0 / orig.height);\n mappedMatrix.translate(sprite.anchor.x, sprite.anchor.y);\n\n return mappedMatrix;\n }\n\n /** Destroys this Filter System. */\n destroy(): void\n {\n this.renderer = null;\n\n // Those textures has to be destroyed by RenderTextureSystem or FramebufferSystem\n this.texturePool.clear(false);\n }\n\n /**\n * Gets a Power-of-Two render texture or fullScreen texture\n * @param minWidth - The minimum width of the render texture in real pixels.\n * @param minHeight - The minimum height of the render texture in real pixels.\n * @param resolution - The resolution of the render texture.\n * @param multisample - Number of samples of the render texture.\n * @returns - The new render texture.\n */\n protected getOptimalFilterTexture(minWidth: number, minHeight: number, resolution = 1,\n multisample: MSAA_QUALITY = MSAA_QUALITY.NONE): RenderTexture\n {\n return this.texturePool.getOptimalTexture(minWidth, minHeight, resolution, multisample);\n }\n\n /**\n * Gets extra render texture to use inside current filter\n * To be compliant with older filters, you can use params in any order\n * @param input - renderTexture from which size and resolution will be copied\n * @param resolution - override resolution of the renderTexture\n * @param multisample - number of samples of the renderTexture\n */\n getFilterTexture(input?: RenderTexture, resolution?: number, multisample?: MSAA_QUALITY): RenderTexture\n {\n if (typeof input === 'number')\n {\n const swap = input;\n\n input = resolution as any;\n resolution = swap;\n }\n\n input = input || this.activeState.renderTexture;\n\n const filterTexture = this.texturePool.getOptimalTexture(input.width, input.height, resolution || input.resolution,\n multisample || MSAA_QUALITY.NONE);\n\n filterTexture.filterFrame = input.filterFrame;\n\n return filterTexture;\n }\n\n /**\n * Frees a render texture back into the pool.\n * @param renderTexture - The renderTarget to free\n */\n returnFilterTexture(renderTexture: RenderTexture): void\n {\n this.texturePool.returnTexture(renderTexture);\n }\n\n /** Empties the texture pool. */\n emptyPool(): void\n {\n this.texturePool.clear(true);\n }\n\n /** Calls `texturePool.resize()`, affects fullScreen renderTextures. */\n resize(): void\n {\n this.texturePool.setScreenSize(this.renderer.view);\n }\n\n /**\n * @param matrix - first param\n * @param rect - second param\n */\n private transformAABB(matrix: Matrix, rect: Rectangle): void\n {\n const lt = tempPoints[0];\n const lb = tempPoints[1];\n const rt = tempPoints[2];\n const rb = tempPoints[3];\n\n lt.set(rect.left, rect.top);\n lb.set(rect.left, rect.bottom);\n rt.set(rect.right, rect.top);\n rb.set(rect.right, rect.bottom);\n\n matrix.apply(lt, lt);\n matrix.apply(lb, lb);\n matrix.apply(rt, rt);\n matrix.apply(rb, rb);\n\n const x0 = Math.min(lt.x, lb.x, rt.x, rb.x);\n const y0 = Math.min(lt.y, lb.y, rt.y, rb.y);\n const x1 = Math.max(lt.x, lb.x, rt.x, rb.x);\n const y1 = Math.max(lt.y, lb.y, rt.y, rb.y);\n\n rect.x = x0;\n rect.y = y0;\n rect.width = x1 - x0;\n rect.height = y1 - y0;\n }\n\n private roundFrame(\n frame: Rectangle,\n resolution: number,\n bindingSourceFrame: Rectangle,\n bindingDestinationFrame: Rectangle,\n transform?: Matrix\n )\n {\n if (frame.width <= 0 || frame.height <= 0 || bindingSourceFrame.width <= 0 || bindingSourceFrame.height <= 0)\n {\n return;\n }\n\n if (transform)\n {\n const { a, b, c, d } = transform;\n\n // Skip if skew/rotation present in matrix, except for multiple of 90° rotation. If rotation\n // is a multiple of 90°, then either pair of (b,c) or (a,d) will be (0,0).\n if ((Math.abs(b) > 1e-4 || Math.abs(c) > 1e-4)\n && (Math.abs(a) > 1e-4 || Math.abs(d) > 1e-4))\n {\n return;\n }\n }\n\n transform = transform ? tempMatrix.copyFrom(transform) : tempMatrix.identity();\n\n // Get forward transform from world space to screen space\n transform\n .translate(-bindingSourceFrame.x, -bindingSourceFrame.y)\n .scale(\n bindingDestinationFrame.width / bindingSourceFrame.width,\n bindingDestinationFrame.height / bindingSourceFrame.height)\n .translate(bindingDestinationFrame.x, bindingDestinationFrame.y);\n\n // Convert frame to screen space\n this.transformAABB(transform, frame);\n\n // Round frame in screen space\n frame.ceil(resolution);\n\n // Project back into world space.\n this.transformAABB(transform.invert(), frame);\n }\n}\n","import type { ISystem } from '../ISystem';\nimport type { Renderer } from '../Renderer';\n\n/**\n * Base for a common object renderer that can be used as a\n * system renderer plugin.\n * @memberof PIXI\n */\nexport class ObjectRenderer implements ISystem\n{\n /** The renderer this manager works for. */\n protected renderer: Renderer;\n\n /**\n * @param renderer - The renderer this manager works for.\n */\n constructor(renderer: Renderer)\n {\n this.renderer = renderer;\n }\n\n /** Stub method that should be used to empty the current batch by rendering objects now. */\n flush(): void\n {\n // flush!\n }\n\n /** Generic destruction method that frees all resources. This should be called by subclasses. */\n destroy(): void\n {\n this.renderer = null;\n }\n\n /**\n * Stub method that initializes any state required before\n * rendering starts. It is different from the `prerender`\n * signal, which occurs every frame, in that it is called\n * whenever an object requests _this_ renderer specifically.\n */\n start(): void\n {\n // set the shader..\n }\n\n /** Stops the renderer. It should free up any state and become dormant. */\n stop(): void\n {\n this.flush();\n }\n\n /**\n * Keeps the object to render. It doesn't have to be\n * rendered immediately.\n * @param {PIXI.DisplayObject} _object - The object to render.\n */\n render(_object: any): void // eslint-disable-line @typescript-eslint/explicit-module-boundary-types\n {\n // render the object\n }\n}\n","import { ObjectRenderer } from './ObjectRenderer';\n\nimport type { ISystem } from '../ISystem';\nimport type { Renderer } from '../Renderer';\nimport type { BaseTexture } from '../textures/BaseTexture';\nimport type { BatchTextureArray } from './BatchTextureArray';\n\n/**\n * System plugin to the renderer to manage batching.\n * @memberof PIXI\n */\nexport class BatchSystem implements ISystem\n{\n /** An empty renderer. */\n public readonly emptyRenderer: ObjectRenderer;\n\n /** The currently active ObjectRenderer. */\n public currentRenderer: ObjectRenderer;\n private renderer: Renderer;\n\n /**\n * @param renderer - The renderer this System works for.\n */\n constructor(renderer: Renderer)\n {\n this.renderer = renderer;\n this.emptyRenderer = new ObjectRenderer(renderer);\n this.currentRenderer = this.emptyRenderer;\n }\n\n /**\n * Changes the current renderer to the one given in parameter\n * @param objectRenderer - The object renderer to use.\n */\n setObjectRenderer(objectRenderer: ObjectRenderer): void\n {\n if (this.currentRenderer === objectRenderer)\n {\n return;\n }\n\n this.currentRenderer.stop();\n this.currentRenderer = objectRenderer;\n\n this.currentRenderer.start();\n }\n\n /**\n * This should be called if you wish to do some custom rendering\n * It will basically render anything that may be batched up such as sprites\n */\n flush(): void\n {\n this.setObjectRenderer(this.emptyRenderer);\n }\n\n /** Reset the system to an empty renderer */\n reset(): void\n {\n this.setObjectRenderer(this.emptyRenderer);\n }\n\n /**\n * Handy function for batch renderers: copies bound textures in first maxTextures locations to array\n * sets actual _batchLocation for them\n * @param arr - arr copy destination\n * @param maxTextures - number of copied elements\n */\n copyBoundTextures(arr: BaseTexture[], maxTextures: number): void\n {\n const { boundTextures } = this.renderer.texture;\n\n for (let i = maxTextures - 1; i >= 0; --i)\n {\n arr[i] = boundTextures[i] || null;\n if (arr[i])\n {\n arr[i]._batchLocation = i;\n }\n }\n }\n\n /**\n * Assigns batch locations to textures in array based on boundTextures state.\n * All textures in texArray should have `_batchEnabled = _batchId`,\n * and their count should be less than `maxTextures`.\n * @param texArray - textures to bound\n * @param boundTextures - current state of bound textures\n * @param batchId - marker for _batchEnabled param of textures in texArray\n * @param maxTextures - number of texture locations to manipulate\n */\n boundArray(texArray: BatchTextureArray, boundTextures: Array<BaseTexture>,\n batchId: number, maxTextures: number): void\n {\n const { elements, ids, count } = texArray;\n let j = 0;\n\n for (let i = 0; i < count; i++)\n {\n const tex = elements[i];\n const loc = tex._batchLocation;\n\n if (loc >= 0 && loc < maxTextures\n && boundTextures[loc] === tex)\n {\n ids[i] = loc;\n continue;\n }\n\n while (j < maxTextures)\n {\n const bound = boundTextures[j];\n\n if (bound && bound._batchEnabled === batchId\n && bound._batchLocation === j)\n {\n j++;\n continue;\n }\n\n ids[i] = j;\n tex._batchLocation = j;\n boundTextures[j] = tex;\n break;\n }\n }\n }\n\n /**\n * @ignore\n */\n destroy(): void\n {\n this.renderer = null;\n }\n}\n","import { ENV } from '@pixi/constants';\nimport { settings } from '../settings';\n\nimport type { ISystem } from '../ISystem';\nimport type { IRenderingContext } from '../IRenderingContext';\nimport type { Renderer } from '../Renderer';\nimport type { WebGLExtensions } from './WebGLExtensions';\n\nlet CONTEXT_UID_COUNTER = 0;\n\nexport interface ISupportDict\n{\n uint32Indices: boolean;\n}\n\n/**\n * System plugin to the renderer to manage the context.\n * @memberof PIXI\n */\nexport class ContextSystem implements ISystem\n{\n /**\n * Either 1 or 2 to reflect the WebGL version being used.\n * @readonly\n */\n public webGLVersion: number;\n\n /**\n * Features supported by current context.\n * @type {object}\n * @readonly\n * @property {boolean} uint32Indices - Support for 32-bit indices buffer.\n */\n readonly supports: ISupportDict;\n\n protected CONTEXT_UID: number;\n protected gl: IRenderingContext;\n\n /**\n * Extensions available.\n * @type {object}\n * @readonly\n * @property {WEBGL_draw_buffers} drawBuffers - WebGL v1 extension\n * @property {WEBGL_depth_texture} depthTexture - WebGL v1 extension\n * @property {OES_texture_float} floatTexture - WebGL v1 extension\n * @property {WEBGL_lose_context} loseContext - WebGL v1 extension\n * @property {OES_vertex_array_object} vertexArrayObject - WebGL v1 extension\n * @property {EXT_texture_filter_anisotropic} anisotropicFiltering - WebGL v1 and v2 extension\n */\n public extensions: WebGLExtensions;\n\n private renderer: Renderer;\n\n /** @param renderer - The renderer this System works for. */\n constructor(renderer: Renderer)\n {\n this.renderer = renderer;\n\n this.webGLVersion = 1;\n this.extensions = {};\n\n this.supports = {\n uint32Indices: false,\n };\n\n // Bind functions\n this.handleContextLost = this.handleContextLost.bind(this);\n this.handleContextRestored = this.handleContextRestored.bind(this);\n\n (renderer.view as any).addEventListener('webglcontextlost', this.handleContextLost, false);\n renderer.view.addEventListener('webglcontextrestored', this.handleContextRestored, false);\n }\n\n /**\n * `true` if the context is lost\n * @readonly\n */\n get isLost(): boolean\n {\n return (!this.gl || this.gl.isContextLost());\n }\n\n /**\n * Handles the context change event.\n * @param {WebGLRenderingContext} gl - New WebGL context.\n */\n protected contextChange(gl: IRenderingContext): void\n {\n this.gl = gl;\n this.renderer.gl = gl;\n this.renderer.CONTEXT_UID = CONTEXT_UID_COUNTER++;\n\n // restore a context if it was previously lost\n if (gl.isContextLost() && gl.getExtension('WEBGL_lose_context'))\n {\n gl.getExtension('WEBGL_lose_context').restoreContext();\n }\n }\n\n /**\n * Initializes the context.\n * @protected\n * @param {WebGLRenderingContext} gl - WebGL context\n */\n initFromContext(gl: IRenderingContext): void\n {\n this.gl = gl;\n this.validateContext(gl);\n this.renderer.gl = gl;\n this.renderer.CONTEXT_UID = CONTEXT_UID_COUNTER++;\n this.renderer.runners.contextChange.emit(gl);\n }\n\n /**\n * Initialize from context options\n * @protected\n * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/getContext\n * @param {object} options - context attributes\n */\n initFromOptions(options: WebGLContextAttributes): void\n {\n const gl = this.createContext(this.renderer.view, options);\n\n this.initFromContext(gl);\n }\n\n /**\n * Helper class to create a WebGL Context\n * @param canvas - the canvas element that we will get the context from\n * @param options - An options object that gets passed in to the canvas element containing the\n * context attributes\n * @see https://developer.mozilla.org/en/docs/Web/API/HTMLCanvasElement/getContext\n * @returns {WebGLRenderingContext} the WebGL context\n */\n createContext(canvas: HTMLCanvasElement, options: WebGLContextAttributes): IRenderingContext\n {\n let gl;\n\n if (settings.PREFER_ENV >= ENV.WEBGL2)\n {\n gl = canvas.getContext('webgl2', options);\n }\n\n if (gl)\n {\n this.webGLVersion = 2;\n }\n else\n {\n this.webGLVersion = 1;\n\n gl = canvas.getContext('webgl', options) || canvas.getContext('experimental-webgl', options);\n\n if (!gl)\n {\n // fail, not able to get a context\n throw new Error('This browser does not support WebGL. Try using the canvas renderer');\n }\n }\n\n this.gl = gl as IRenderingContext;\n\n this.getExtensions();\n\n return this.gl;\n }\n\n /** Auto-populate the {@link PIXI.ContextSystem.extensions extensions}. */\n protected getExtensions(): void\n {\n // time to set up default extensions that Pixi uses.\n const { gl } = this;\n\n const common = {\n anisotropicFiltering: gl.getExtension('EXT_texture_filter_anisotropic'),\n floatTextureLinear: gl.getExtension('OES_texture_float_linear'),\n\n s3tc: gl.getExtension('WEBGL_compressed_texture_s3tc'),\n s3tc_sRGB: gl.getExtension('WEBGL_compressed_texture_s3tc_srgb'), // eslint-disable-line camelcase\n etc: gl.getExtension('WEBGL_compressed_texture_etc'),\n etc1: gl.getExtension('WEBGL_compressed_texture_etc1'),\n pvrtc: gl.getExtension('WEBGL_compressed_texture_pvrtc')\n || gl.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc'),\n atc: gl.getExtension('WEBGL_compressed_texture_atc'),\n astc: gl.getExtension('WEBGL_compressed_texture_astc')\n };\n\n if (this.webGLVersion === 1)\n {\n Object.assign(this.extensions, common, {\n drawBuffers: gl.getExtension('WEBGL_draw_buffers'),\n depthTexture: gl.getExtension('WEBGL_depth_texture'),\n loseContext: gl.getExtension('WEBGL_lose_context'),\n vertexArrayObject: gl.getExtension('OES_vertex_array_object')\n || gl.getExtension('MOZ_OES_vertex_array_object')\n || gl.getExtension('WEBKIT_OES_vertex_array_object'),\n uint32ElementIndex: gl.getExtension('OES_element_index_uint'),\n // Floats and half-floats\n floatTexture: gl.getExtension('OES_texture_float'),\n floatTextureLinear: gl.getExtension('OES_texture_float_linear'),\n textureHalfFloat: gl.getExtension('OES_texture_half_float'),\n textureHalfFloatLinear: gl.getExtension('OES_texture_half_float_linear'),\n });\n }\n else if (this.webGLVersion === 2)\n {\n Object.assign(this.extensions, common, {\n // Floats and half-floats\n colorBufferFloat: gl.getExtension('EXT_color_buffer_float')\n });\n }\n }\n\n /**\n * Handles a lost webgl context\n * @param {WebGLContextEvent} event - The context lost event.\n */\n protected handleContextLost(event: WebGLContextEvent): void\n {\n event.preventDefault();\n }\n\n /** Handles a restored webgl context. */\n protected handleContextRestored(): void\n {\n this.renderer.runners.contextChange.emit(this.gl);\n }\n\n destroy(): void\n {\n const view = this.renderer.view;\n\n this.renderer = null;\n\n // remove listeners\n (view as any).removeEventListener('webglcontextlost', this.handleContextLost);\n view.removeEventListener('webglcontextrestored', this.handleContextRestored);\n\n this.gl.useProgram(null);\n\n if (this.extensions.loseContext)\n {\n this.extensions.loseContext.loseContext();\n }\n }\n\n /** Handle the post-render runner event. */\n protected postrender(): void\n {\n if (this.renderer.renderingToScreen)\n {\n this.gl.flush();\n }\n }\n\n /**\n * Validate context.\n * @param {WebGLRenderingContext} gl - Render context.\n */\n protected validateContext(gl: IRenderingContext): void\n {\n const attributes = gl.getContextAttributes();\n\n const isWebGl2 = 'WebGL2RenderingContext' in globalThis && gl instanceof globalThis.WebGL2RenderingContext;\n\n if (isWebGl2)\n {\n this.webGLVersion = 2;\n }\n\n // this is going to be fairly simple for now.. but at least we have room to grow!\n if (attributes && !attributes.stencil)\n {\n /* eslint-disable max-len, no-console */\n console.warn('Provided WebGL context does not have a stencil buffer, masks may not render correctly');\n /* eslint-enable max-len, no-console */\n }\n\n const hasuint32 = isWebGl2 || !!(gl as WebGLRenderingContext).getExtension('OES_element_index_uint');\n\n this.supports.uint32Indices = hasuint32;\n\n if (!hasuint32)\n {\n /* eslint-disable max-len, no-console */\n console.warn('Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly');\n /* eslint-enable max-len, no-console */\n }\n }\n}\n","import { MSAA_QUALITY } from '@pixi/constants';\n\nimport type { Framebuffer } from './Framebuffer';\n\n/**\n * Internal framebuffer for WebGL context.\n * @memberof PIXI\n */\nexport class GLFramebuffer\n{\n /** The WebGL framebuffer. */\n public framebuffer: WebGLFramebuffer;\n\n /** Stencil+depth , usually costs 32bits per pixel. */\n public stencil: WebGLRenderbuffer;\n\n /** Detected AA samples number. */\n public multisample: MSAA_QUALITY;\n\n /** In case MSAA, we use this Renderbuffer instead of colorTextures[0] when we write info. */\n public msaaBuffer: WebGLRenderbuffer;\n\n /**\n * In case we use MSAA, this is actual framebuffer that has colorTextures[0]\n * The contents of that framebuffer are read when we use that renderTexture in sprites\n */\n public blitFramebuffer: Framebuffer;\n\n /** Latest known version of framebuffer. */\n dirtyId: number;\n\n /** Latest known version of framebuffer format. */\n dirtyFormat: number;\n\n /** Latest known version of framebuffer size. */\n dirtySize: number;\n\n /** Store the current mipmap of the textures the framebuffer will write too. */\n mipLevel: number;\n\n constructor(framebuffer: WebGLTexture)\n {\n this.framebuffer = framebuffer;\n this.stencil = null;\n this.dirtyId = -1;\n this.dirtyFormat = -1;\n this.dirtySize = -1;\n this.multisample = MSAA_QUALITY.NONE;\n this.msaaBuffer = null;\n this.blitFramebuffer = null;\n this.mipLevel = 0;\n }\n}\n","import { Rectangle } from '@pixi/math';\nimport { ENV, BUFFER_BITS, MSAA_QUALITY } from '@pixi/constants';\nimport { settings } from '../settings';\nimport { Framebuffer } from './Framebuffer';\nimport { GLFramebuffer } from './GLFramebuffer';\n\nimport type { ISystem } from '../ISystem';\nimport type { Renderer } from '../Renderer';\nimport type { IRenderingContext } from '../IRenderingContext';\n\nconst tempRectangle = new Rectangle();\n\n/**\n * System plugin to the renderer to manage framebuffers.\n * @memberof PIXI\n */\nexport class FramebufferSystem implements ISystem\n{\n /** A list of managed framebuffers. */\n public readonly managedFramebuffers: Array<Framebuffer>;\n public current: Framebuffer;\n public viewport: Rectangle;\n public hasMRT: boolean;\n public writeDepthTexture: boolean;\n protected CONTEXT_UID: number;\n protected gl: IRenderingContext;\n\n /** Framebuffer value that shows that we don't know what is bound. */\n protected unknownFramebuffer: Framebuffer;\n protected msaaSamples: Array<number>;\n public renderer: Renderer;\n\n /**\n * @param renderer - The renderer this System works for.\n */\n constructor(renderer: Renderer)\n {\n this.renderer = renderer;\n this.managedFramebuffers = [];\n this.unknownFramebuffer = new Framebuffer(10, 10);\n\n this.msaaSamples = null;\n }\n\n /** Sets up the renderer context and necessary buffers. */\n protected contextChange(): void\n {\n const gl = this.gl = this.renderer.gl;\n\n this.CONTEXT_UID = this.renderer.CONTEXT_UID;\n this.current = this.unknownFramebuffer;\n this.viewport = new Rectangle();\n this.hasMRT = true;\n this.writeDepthTexture = true;\n\n this.disposeAll(true);\n\n // webgl2\n if (this.renderer.context.webGLVersion === 1)\n {\n // webgl 1!\n let nativeDrawBuffersExtension = this.renderer.context.extensions.drawBuffers;\n let nativeDepthTextureExtension = this.renderer.context.extensions.depthTexture;\n\n if (settings.PREFER_ENV === ENV.WEBGL_LEGACY)\n {\n nativeDrawBuffersExtension = null;\n nativeDepthTextureExtension = null;\n }\n\n if (nativeDrawBuffersExtension)\n {\n gl.drawBuffers = (activeTextures: number[]): void =>\n nativeDrawBuffersExtension.drawBuffersWEBGL(activeTextures);\n }\n else\n {\n this.hasMRT = false;\n gl.drawBuffers = (): void =>\n {\n // empty\n };\n }\n\n if (!nativeDepthTextureExtension)\n {\n this.writeDepthTexture = false;\n }\n }\n else\n {\n // WebGL2\n // cache possible MSAA samples\n this.msaaSamples = gl.getInternalformatParameter(gl.RENDERBUFFER, gl.RGBA8, gl.SAMPLES);\n }\n }\n\n /**\n * Bind a framebuffer.\n * @param framebuffer\n * @param frame - frame, default is framebuffer size\n * @param mipLevel - optional mip level to set on the framebuffer - defaults to 0\n */\n bind(framebuffer?: Framebuffer, frame?: Rectangle, mipLevel = 0): void\n {\n const { gl } = this;\n\n if (framebuffer)\n {\n // TODO caching layer!\n\n const fbo = framebuffer.glFramebuffers[this.CONTEXT_UID] || this.initFramebuffer(framebuffer);\n\n if (this.current !== framebuffer)\n {\n this.current = framebuffer;\n gl.bindFramebuffer(gl.FRAMEBUFFER, fbo.framebuffer);\n }\n // make sure all textures are unbound..\n\n if (fbo.mipLevel !== mipLevel)\n {\n framebuffer.dirtyId++;\n framebuffer.dirtyFormat++;\n fbo.mipLevel = mipLevel;\n }\n\n // now check for updates...\n if (fbo.dirtyId !== framebuffer.dirtyId)\n {\n fbo.dirtyId = framebuffer.dirtyId;\n\n if (fbo.dirtyFormat !== framebuffer.dirtyFormat)\n {\n fbo.dirtyFormat = framebuffer.dirtyFormat;\n fbo.dirtySize = framebuffer.dirtySize;\n this.updateFramebuffer(framebuffer, mipLevel);\n }\n else if (fbo.dirtySize !== framebuffer.dirtySize)\n {\n fbo.dirtySize = framebuffer.dirtySize;\n this.resizeFramebuffer(framebuffer);\n }\n }\n\n for (let i = 0; i < framebuffer.colorTextures.length; i++)\n {\n const tex = framebuffer.colorTextures[i];\n\n this.renderer.texture.unbind(tex.parentTextureArray || tex);\n }\n\n if (framebuffer.depthTexture)\n {\n this.renderer.texture.unbind(framebuffer.depthTexture);\n }\n\n if (frame)\n {\n const mipWidth = (frame.width >> mipLevel);\n const mipHeight = (frame.height >> mipLevel);\n\n const scale = mipWidth / frame.width;\n\n this.setViewport(\n frame.x * scale,\n frame.y * scale,\n mipWidth,\n mipHeight\n );\n }\n else\n {\n const mipWidth = (framebuffer.width >> mipLevel);\n const mipHeight = (framebuffer.height >> mipLevel);\n\n this.setViewport(0, 0, mipWidth, mipHeight);\n }\n }\n else\n {\n if (this.current)\n {\n this.current = null;\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n }\n\n if (frame)\n {\n this.setViewport(frame.x, frame.y, frame.width, frame.height);\n }\n else\n {\n this.setViewport(0, 0, this.renderer.width, this.renderer.height);\n }\n }\n }\n\n /**\n * Set the WebGLRenderingContext's viewport.\n * @param x - X position of viewport\n * @param y - Y position of viewport\n * @param width - Width of viewport\n * @param height - Height of viewport\n */\n setViewport(x: number, y: number, width: number, height: number): void\n {\n const v = this.viewport;\n\n x = Math.round(x);\n y = Math.round(y);\n width = Math.round(width);\n height = Math.round(height);\n\n if (v.width !== width || v.height !== height || v.x !== x || v.y !== y)\n {\n v.x = x;\n v.y = y;\n v.width = width;\n v.height = height;\n\n this.gl.viewport(x, y, width, height);\n }\n }\n\n /**\n * Get the size of the current width and height. Returns object with `width` and `height` values.\n * @readonly\n */\n get size(): { x: number; y: number; width: number; height: number }\n {\n if (this.current)\n {\n // TODO store temp\n return { x: 0, y: 0, width: this.current.width, height: this.current.height };\n }\n\n return { x: 0, y: 0, width: this.renderer.width, height: this.renderer.height };\n }\n\n /**\n * Clear the color of the context\n * @param r - Red value from 0 to 1\n * @param g - Green value from 0 to 1\n * @param b - Blue value from 0 to 1\n * @param a - Alpha value from 0 to 1\n * @param {PIXI.BUFFER_BITS} [mask=BUFFER_BITS.COLOR | BUFFER_BITS.DEPTH] - Bitwise OR of masks\n * that indicate the buffers to be cleared, by default COLOR and DEPTH buffers.\n */\n clear(r: number, g: number, b: number, a: number, mask: BUFFER_BITS = BUFFER_BITS.COLOR | BUFFER_BITS.DEPTH): void\n {\n const { gl } = this;\n\n // TODO clear color can be set only one right?\n gl.clearColor(r, g, b, a);\n gl.clear(mask);\n }\n\n /**\n * Initialize framebuffer for this context\n * @protected\n * @param framebuffer\n * @returns - created GLFramebuffer\n */\n initFramebuffer(framebuffer: Framebuffer): GLFramebuffer\n {\n const { gl } = this;\n const fbo = new GLFramebuffer(gl.createFramebuffer());\n\n fbo.multisample = this.detectSamples(framebuffer.multisample);\n framebuffer.glFramebuffers[this.CONTEXT_UID] = fbo;\n\n this.managedFramebuffers.push(framebuffer);\n framebuffer.disposeRunner.add(this);\n\n return fbo;\n }\n\n /**\n * Resize the framebuffer\n * @param framebuffer\n * @protected\n */\n resizeFramebuffer(framebuffer: Framebuffer): void\n {\n const { gl } = this;\n\n const fbo = framebuffer.glFramebuffers[this.CONTEXT_UID];\n\n if (fbo.msaaBuffer)\n {\n gl.bindRenderbuffer(gl.RENDERBUFFER, fbo.msaaBuffer);\n gl.renderbufferStorageMultisample(gl.RENDERBUFFER, fbo.multisample,\n gl.RGBA8, framebuffer.width, framebuffer.height);\n }\n\n if (fbo.stencil)\n {\n gl.bindRenderbuffer(gl.RENDERBUFFER, fbo.stencil);\n\n if (fbo.msaaBuffer)\n {\n gl.renderbufferStorageMultisample(gl.RENDERBUFFER, fbo.multisample,\n gl.DEPTH24_STENCIL8, framebuffer.width, framebuffer.height);\n }\n else\n {\n gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, framebuffer.width, framebuffer.height);\n }\n }\n\n const colorTextures = framebuffer.colorTextures;\n\n let count = colorTextures.length;\n\n if (!gl.drawBuffers)\n {\n count = Math.min(count, 1);\n }\n\n for (let i = 0; i < count; i++)\n {\n const texture = colorTextures[i];\n const parentTexture = texture.parentTextureArray || texture;\n\n this.renderer.texture.bind(parentTexture, 0);\n }\n\n if (framebuffer.depthTexture && this.writeDepthTexture)\n {\n this.renderer.texture.bind(framebuffer.depthTexture, 0);\n }\n }\n\n /**\n * Update the framebuffer\n * @param framebuffer\n * @param mipLevel\n * @protected\n */\n updateFramebuffer(framebuffer: Framebuffer, mipLevel: number): void\n {\n const { gl } = this;\n\n const fbo = framebuffer.glFramebuffers[this.CONTEXT_UID];\n\n // bind the color texture\n const colorTextures = framebuffer.colorTextures;\n\n let count = colorTextures.length;\n\n if (!gl.drawBuffers)\n {\n count = Math.min(count, 1);\n }\n\n if (fbo.multisample > 1 && this.canMultisampleFramebuffer(framebuffer))\n {\n fbo.msaaBuffer = fbo.msaaBuffer || gl.createRenderbuffer();\n gl.bindRenderbuffer(gl.RENDERBUFFER, fbo.msaaBuffer);\n gl.renderbufferStorageMultisample(gl.RENDERBUFFER, fbo.multisample,\n gl.RGBA8, framebuffer.width, framebuffer.height);\n gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, fbo.msaaBuffer);\n }\n else if (fbo.msaaBuffer)\n {\n gl.deleteRenderbuffer(fbo.msaaBuffer);\n fbo.msaaBuffer = null;\n\n if (fbo.blitFramebuffer)\n {\n fbo.blitFramebuffer.dispose();\n fbo.blitFramebuffer = null;\n }\n }\n\n const activeTextures = [];\n\n for (let i = 0; i < count; i++)\n {\n const texture = colorTextures[i];\n const parentTexture = texture.parentTextureArray || texture;\n\n this.renderer.texture.bind(parentTexture, 0);\n\n if (i === 0 && fbo.msaaBuffer)\n {\n continue;\n }\n\n gl.framebufferTexture2D(gl.FRAMEBUFFER,\n gl.COLOR_ATTACHMENT0 + i,\n texture.target,\n parentTexture._glTextures[this.CONTEXT_UID].texture,\n mipLevel);\n\n activeTextures.push(gl.COLOR_ATTACHMENT0 + i);\n }\n\n if (activeTextures.length > 1)\n {\n gl.drawBuffers(activeTextures);\n }\n\n if (framebuffer.depthTexture)\n {\n const writeDepthTexture = this.writeDepthTexture;\n\n if (writeDepthTexture)\n {\n const depthTexture = framebuffer.depthTexture;\n\n this.renderer.texture.bind(depthTexture, 0);\n\n gl.framebufferTexture2D(gl.FRAMEBUFFER,\n gl.DEPTH_ATTACHMENT,\n gl.TEXTURE_2D,\n depthTexture._glTextures[this.CONTEXT_UID].texture,\n mipLevel);\n }\n }\n\n if ((framebuffer.stencil || framebuffer.depth) && !(framebuffer.depthTexture && this.writeDepthTexture))\n {\n fbo.stencil = fbo.stencil || gl.createRenderbuffer();\n\n gl.bindRenderbuffer(gl.RENDERBUFFER, fbo.stencil);\n\n if (fbo.msaaBuffer)\n {\n gl.renderbufferStorageMultisample(gl.RENDERBUFFER, fbo.multisample,\n gl.DEPTH24_STENCIL8, framebuffer.width, framebuffer.height);\n }\n else\n {\n gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, framebuffer.width, framebuffer.height);\n }\n\n gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, fbo.stencil);\n }\n else if (fbo.stencil)\n {\n gl.deleteRenderbuffer(fbo.stencil);\n fbo.stencil = null;\n }\n }\n\n /**\n * Returns true if the frame buffer can be multisampled.\n * @param framebuffer\n */\n protected canMultisampleFramebuffer(framebuffer: Framebuffer): boolean\n {\n return this.renderer.context.webGLVersion !== 1\n && framebuffer.colorTextures.length <= 1 && !framebuffer.depthTexture;\n }\n\n /**\n * Detects number of samples that is not more than a param but as close to it as possible\n * @param samples - number of samples\n * @returns - recommended number of samples\n */\n protected detectSamples(samples: MSAA_QUALITY): MSAA_QUALITY\n {\n const { msaaSamples } = this;\n let res: number = MSAA_QUALITY.NONE;\n\n if (samples <= 1 || msaaSamples === null)\n {\n return res;\n }\n for (let i = 0; i < msaaSamples.length; i++)\n {\n if (msaaSamples[i] <= samples)\n {\n res = msaaSamples[i];\n break;\n }\n }\n\n if (res === 1)\n {\n res = MSAA_QUALITY.NONE;\n }\n\n return res;\n }\n\n /**\n * Only works with WebGL2\n *\n * blits framebuffer to another of the same or bigger size\n * after that target framebuffer is bound\n *\n * Fails with WebGL warning if blits multisample framebuffer to different size\n * @param framebuffer - by default it blits \"into itself\", from renderBuffer to texture.\n * @param sourcePixels - source rectangle in pixels\n * @param destPixels - dest rectangle in pixels, assumed to be the same as sourcePixels\n */\n public blit(framebuffer?: Framebuffer, sourcePixels?: Rectangle, destPixels?: Rectangle): void\n {\n const { current, renderer, gl, CONTEXT_UID } = this;\n\n if (renderer.context.webGLVersion !== 2)\n {\n return;\n }\n\n if (!current)\n {\n return;\n }\n const fbo = current.glFramebuffers[CONTEXT_UID];\n\n if (!fbo)\n {\n return;\n }\n if (!framebuffer)\n {\n if (!fbo.msaaBuffer)\n {\n return;\n }\n\n const colorTexture = current.colorTextures[0];\n\n if (!colorTexture)\n {\n return;\n }\n\n if (!fbo.blitFramebuffer)\n {\n fbo.blitFramebuffer = new Framebuffer(current.width, current.height);\n fbo.blitFramebuffer.addColorTexture(0, colorTexture);\n }\n\n framebuffer = fbo.blitFramebuffer;\n\n if (framebuffer.colorTextures[0] !== colorTexture)\n {\n framebuffer.colorTextures[0] = colorTexture;\n framebuffer.dirtyId++;\n framebuffer.dirtyFormat++;\n }\n\n if (framebuffer.width !== current.width || framebuffer.height !== current.height)\n {\n framebuffer.width = current.width;\n framebuffer.height = current.height;\n framebuffer.dirtyId++;\n framebuffer.dirtySize++;\n }\n }\n\n if (!sourcePixels)\n {\n sourcePixels = tempRectangle;\n sourcePixels.width = current.width;\n sourcePixels.height = current.height;\n }\n if (!destPixels)\n {\n destPixels = sourcePixels;\n }\n\n const sameSize = sourcePixels.width === destPixels.width && sourcePixels.height === destPixels.height;\n\n this.bind(framebuffer);\n gl.bindFramebuffer(gl.READ_FRAMEBUFFER, fbo.framebuffer);\n gl.blitFramebuffer(\n sourcePixels.left, sourcePixels.top, sourcePixels.right, sourcePixels.bottom,\n destPixels.left, destPixels.top, destPixels.right, destPixels.bottom,\n gl.COLOR_BUFFER_BIT, sameSize ? gl.NEAREST : gl.LINEAR\n );\n }\n\n /**\n * Disposes framebuffer.\n * @param framebuffer - framebuffer that has to be disposed of\n * @param contextLost - If context was lost, we suppress all delete function calls\n */\n disposeFramebuffer(framebuffer: Framebuffer, contextLost?: boolean): void\n {\n const fbo = framebuffer.glFramebuffers[this.CONTEXT_UID];\n const gl = this.gl;\n\n if (!fbo)\n {\n return;\n }\n\n delete framebuffer.glFramebuffers[this.CONTEXT_UID];\n\n const index = this.managedFramebuffers.indexOf(framebuffer);\n\n if (index >= 0)\n {\n this.managedFramebuffers.splice(index, 1);\n }\n\n framebuffer.disposeRunner.remove(this);\n\n if (!contextLost)\n {\n gl.deleteFramebuffer(fbo.framebuffer);\n\n if (fbo.msaaBuffer)\n {\n gl.deleteRenderbuffer(fbo.msaaBuffer);\n }\n\n if (fbo.stencil)\n {\n gl.deleteRenderbuffer(fbo.stencil);\n }\n }\n\n if (fbo.blitFramebuffer)\n {\n fbo.blitFramebuffer.dispose();\n }\n }\n\n /**\n * Disposes all framebuffers, but not textures bound to them.\n * @param [contextLost=false] - If context was lost, we suppress all delete function calls\n */\n disposeAll(contextLost?: boolean): void\n {\n const list = this.managedFramebuffers;\n\n (this.managedFramebuffers as any) = [];\n\n for (let i = 0; i < list.length; i++)\n {\n this.disposeFramebuffer(list[i], contextLost);\n }\n }\n\n /**\n * Forcing creation of stencil buffer for current framebuffer, if it wasn't done before.\n * Used by MaskSystem, when its time to use stencil mask for Graphics element.\n *\n * Its an alternative for public lazy `framebuffer.enableStencil`, in case we need stencil without rebind.\n * @private\n */\n forceStencil(): void\n {\n const framebuffer = this.current;\n\n if (!framebuffer)\n {\n return;\n }\n\n const fbo = framebuffer.glFramebuffers[this.CONTEXT_UID];\n\n if (!fbo || fbo.stencil)\n {\n return;\n }\n\n framebuffer.stencil = true;\n\n const w = framebuffer.width;\n const h = framebuffer.height;\n const gl = this.gl;\n const stencil = gl.createRenderbuffer();\n\n gl.bindRenderbuffer(gl.RENDERBUFFER, stencil);\n\n if (fbo.msaaBuffer)\n {\n gl.renderbufferStorageMultisample(gl.RENDERBUFFER, fbo.multisample, gl.DEPTH24_STENCIL8, w, h);\n }\n else\n {\n gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, w, h);\n }\n\n fbo.stencil = stencil;\n gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, stencil);\n }\n\n /** Resets framebuffer stored state, binds screen framebuffer. Should be called before renderTexture reset(). */\n reset(): void\n {\n this.current = this.unknownFramebuffer;\n this.viewport = new Rectangle();\n }\n\n destroy(): void\n {\n this.renderer = null;\n }\n}\n","import type { GLBuffer } from './GLBuffer';\nimport { ENV } from '@pixi/constants';\nimport { settings } from '../settings';\n\nimport type { ISystem } from '../ISystem';\nimport type { DRAW_MODES } from '@pixi/constants';\nimport type { Renderer } from '../Renderer';\nimport type { IRenderingContext } from '../IRenderingContext';\nimport type { Geometry } from './Geometry';\nimport type { Shader } from '../shader/Shader';\nimport type { Program } from '../shader/Program';\nimport type { Dict } from '@pixi/utils';\n\nconst byteSizeMap: {[key: number]: number} = { 5126: 4, 5123: 2, 5121: 1 };\n\n/**\n * System plugin to the renderer to manage geometry.\n * @memberof PIXI\n */\nexport class GeometrySystem implements ISystem\n{\n /**\n * `true` if we has `*_vertex_array_object` extension.\n * @readonly\n */\n public hasVao: boolean;\n\n /**\n * `true` if has `ANGLE_instanced_arrays` extension.\n * @readonly\n */\n public hasInstance: boolean;\n\n /**\n * `true` if support `gl.UNSIGNED_INT` in `gl.drawElements` or `gl.drawElementsInstanced`.\n * @readonly\n */\n public canUseUInt32ElementIndex: boolean;\n\n protected CONTEXT_UID: number;\n protected gl: IRenderingContext;\n protected _activeGeometry: Geometry;\n protected _activeVao: WebGLVertexArrayObject;\n protected _boundBuffer: GLBuffer;\n\n /** Cache for all geometries by id, used in case renderer gets destroyed or for profiling. */\n readonly managedGeometries: {[key: number]: Geometry};\n\n /** Renderer that owns this {@link GeometrySystem}. */\n private renderer: Renderer;\n\n /** @param renderer - The renderer this System works for. */\n constructor(renderer: Renderer)\n {\n this.renderer = renderer;\n this._activeGeometry = null;\n this._activeVao = null;\n\n this.hasVao = true;\n this.hasInstance = true;\n this.canUseUInt32ElementIndex = false;\n this.managedGeometries = {};\n }\n\n /** Sets up the renderer context and necessary buffers. */\n protected contextChange(): void\n {\n this.disposeAll(true);\n\n const gl = this.gl = this.renderer.gl;\n const context = this.renderer.context;\n\n this.CONTEXT_UID = this.renderer.CONTEXT_UID;\n\n // webgl2\n if (context.webGLVersion !== 2)\n {\n // webgl 1!\n let nativeVaoExtension = this.renderer.context.extensions.vertexArrayObject;\n\n if (settings.PREFER_ENV === ENV.WEBGL_LEGACY)\n {\n nativeVaoExtension = null;\n }\n\n if (nativeVaoExtension)\n {\n gl.createVertexArray = (): WebGLVertexArrayObject =>\n nativeVaoExtension.createVertexArrayOES();\n\n gl.bindVertexArray = (vao): void =>\n nativeVaoExtension.bindVertexArrayOES(vao);\n\n gl.deleteVertexArray = (vao): void =>\n nativeVaoExtension.deleteVertexArrayOES(vao);\n }\n else\n {\n this.hasVao = false;\n gl.createVertexArray = (): WebGLVertexArrayObject =>\n null;\n\n gl.bindVertexArray = (): void =>\n null;\n\n gl.deleteVertexArray = (): void =>\n null;\n }\n }\n\n if (context.webGLVersion !== 2)\n {\n const instanceExt = gl.getExtension('ANGLE_instanced_arrays');\n\n if (instanceExt)\n {\n gl.vertexAttribDivisor = (a, b): void =>\n instanceExt.vertexAttribDivisorANGLE(a, b);\n\n gl.drawElementsInstanced = (a, b, c, d, e): void =>\n instanceExt.drawElementsInstancedANGLE(a, b, c, d, e);\n\n gl.drawArraysInstanced = (a, b, c, d): void =>\n instanceExt.drawArraysInstancedANGLE(a, b, c, d);\n }\n else\n {\n this.hasInstance = false;\n }\n }\n\n this.canUseUInt32ElementIndex = context.webGLVersion === 2 || !!context.extensions.uint32ElementIndex;\n }\n\n /**\n * Binds geometry so that is can be drawn. Creating a Vao if required\n * @param geometry - Instance of geometry to bind.\n * @param shader - Instance of shader to use vao for.\n */\n bind(geometry?: Geometry, shader?: Shader): void\n {\n shader = shader || this.renderer.shader.shader;\n\n const { gl } = this;\n\n // not sure the best way to address this..\n // currently different shaders require different VAOs for the same geometry\n // Still mulling over the best way to solve this one..\n // will likely need to modify the shader attribute locations at run time!\n let vaos = geometry.glVertexArrayObjects[this.CONTEXT_UID];\n let incRefCount = false;\n\n if (!vaos)\n {\n this.managedGeometries[geometry.id] = geometry;\n geometry.disposeRunner.add(this);\n geometry.glVertexArrayObjects[this.CONTEXT_UID] = vaos = {};\n incRefCount = true;\n }\n\n const vao = vaos[shader.program.id] || this.initGeometryVao(geometry, shader, incRefCount);\n\n this._activeGeometry = geometry;\n\n if (this._activeVao !== vao)\n {\n this._activeVao = vao;\n\n if (this.hasVao)\n {\n gl.bindVertexArray(vao);\n }\n else\n {\n this.activateVao(geometry, shader.program);\n }\n }\n\n // TODO - optimise later!\n // don't need to loop through if nothing changed!\n // maybe look to add an 'autoupdate' to geometry?\n this.updateBuffers();\n }\n\n /** Reset and unbind any active VAO and geometry. */\n reset(): void\n {\n this.unbind();\n }\n\n /** Update buffers of the currently bound geometry. */\n updateBuffers(): void\n {\n const geometry = this._activeGeometry;\n\n const bufferSystem = this.renderer.buffer;\n\n for (let i = 0; i < geometry.buffers.length; i++)\n {\n const buffer = geometry.buffers[i];\n\n bufferSystem.update(buffer);\n }\n }\n\n /**\n * Check compatibility between a geometry and a program\n * @param geometry - Geometry instance.\n * @param program - Program instance.\n */\n protected checkCompatibility(geometry: Geometry, program: Program): void\n {\n // geometry must have at least all the attributes that the shader requires.\n const geometryAttributes = geometry.attributes;\n const shaderAttributes = program.attributeData;\n\n for (const j in shaderAttributes)\n {\n if (!geometryAttributes[j])\n {\n throw new Error(`shader and geometry incompatible, geometry missing the \"${j}\" attribute`);\n }\n }\n }\n\n /**\n * Takes a geometry and program and generates a unique signature for them.\n * @param geometry - To get signature from.\n * @param program - To test geometry against.\n * @returns - Unique signature of the geometry and program\n */\n protected getSignature(geometry: Geometry, program: Program): string\n {\n const attribs = geometry.attributes;\n const shaderAttributes = program.attributeData;\n\n const strings = ['g', geometry.id];\n\n for (const i in attribs)\n {\n if (shaderAttributes[i])\n {\n strings.push(i, shaderAttributes[i].location);\n }\n }\n\n return strings.join('-');\n }\n\n /**\n * Creates or gets Vao with the same structure as the geometry and stores it on the geometry.\n * If vao is created, it is bound automatically. We use a shader to infer what and how to set up the\n * attribute locations.\n * @param geometry - Instance of geometry to to generate Vao for.\n * @param shader - Instance of the shader.\n * @param incRefCount - Increment refCount of all geometry buffers.\n */\n protected initGeometryVao(geometry: Geometry, shader: Shader, incRefCount = true): WebGLVertexArrayObject\n {\n const gl = this.gl;\n const CONTEXT_UID = this.CONTEXT_UID;\n const bufferSystem = this.renderer.buffer;\n const program = shader.program;\n\n if (!program.glPrograms[CONTEXT_UID])\n {\n this.renderer.shader.generateProgram(shader);\n }\n\n this.checkCompatibility(geometry, program);\n\n const signature = this.getSignature(geometry, program);\n\n const vaoObjectHash = geometry.glVertexArrayObjects[this.CONTEXT_UID];\n\n let vao = vaoObjectHash[signature];\n\n if (vao)\n {\n // this will give us easy access to the vao\n vaoObjectHash[program.id] = vao;\n\n return vao;\n }\n\n const buffers = geometry.buffers;\n const attributes = geometry.attributes;\n const tempStride: Dict<number> = {};\n const tempStart: Dict<number> = {};\n\n for (const j in buffers)\n {\n tempStride[j] = 0;\n tempStart[j] = 0;\n }\n\n for (const j in attributes)\n {\n if (!attributes[j].size && program.attributeData[j])\n {\n attributes[j].size = program.attributeData[j].size;\n }\n else if (!attributes[j].size)\n {\n console.warn(`PIXI Geometry attribute '${j}' size cannot be determined (likely the bound shader does not have the attribute)`); // eslint-disable-line\n }\n\n tempStride[attributes[j].buffer] += attributes[j].size * byteSizeMap[attributes[j].type];\n }\n\n for (const j in attributes)\n {\n const attribute = attributes[j];\n const attribSize = attribute.size;\n\n if (attribute.stride === undefined)\n {\n if (tempStride[attribute.buffer] === attribSize * byteSizeMap[attribute.type])\n {\n attribute.stride = 0;\n }\n else\n {\n attribute.stride = tempStride[attribute.buffer];\n }\n }\n\n if (attribute.start === undefined)\n {\n attribute.start = tempStart[attribute.buffer];\n\n tempStart[attribute.buffer] += attribSize * byteSizeMap[attribute.type];\n }\n }\n\n vao = gl.createVertexArray();\n\n gl.bindVertexArray(vao);\n\n // first update - and create the buffers!\n // only create a gl buffer if it actually gets\n for (let i = 0; i < buffers.length; i++)\n {\n const buffer = buffers[i];\n\n bufferSystem.bind(buffer);\n\n if (incRefCount)\n {\n buffer._glBuffers[CONTEXT_UID].refCount++;\n }\n }\n\n // TODO - maybe make this a data object?\n // lets wait to see if we need to first!\n\n this.activateVao(geometry, program);\n\n this._activeVao = vao;\n\n // add it to the cache!\n vaoObjectHash[program.id] = vao;\n vaoObjectHash[signature] = vao;\n\n return vao;\n }\n\n /**\n * Disposes geometry.\n * @param geometry - Geometry with buffers. Only VAO will be disposed\n * @param [contextLost=false] - If context was lost, we suppress deleteVertexArray\n */\n disposeGeometry(geometry: Geometry, contextLost?: boolean): void\n {\n if (!this.managedGeometries[geometry.id])\n {\n return;\n }\n\n delete this.managedGeometries[geometry.id];\n\n const vaos = geometry.glVertexArrayObjects[this.CONTEXT_UID];\n const gl = this.gl;\n const buffers = geometry.buffers;\n const bufferSystem = this.renderer?.buffer;\n\n geometry.disposeRunner.remove(this);\n\n if (!vaos)\n {\n return;\n }\n\n // bufferSystem may have already been destroyed..\n // if this is the case, there is no need to destroy the geometry buffers...\n // they already have been!\n if (bufferSystem)\n {\n for (let i = 0; i < buffers.length; i++)\n {\n const buf = buffers[i]._glBuffers[this.CONTEXT_UID];\n\n // my be null as context may have changed right before the dispose is called\n if (buf)\n {\n buf.refCount--;\n if (buf.refCount === 0 && !contextLost)\n {\n bufferSystem.dispose(buffers[i], contextLost);\n }\n }\n }\n }\n\n if (!contextLost)\n {\n for (const vaoId in vaos)\n {\n // delete only signatures, everything else are copies\n if (vaoId[0] === 'g')\n {\n const vao = vaos[vaoId];\n\n if (this._activeVao === vao)\n {\n this.unbind();\n }\n gl.deleteVertexArray(vao);\n }\n }\n }\n\n delete geometry.glVertexArrayObjects[this.CONTEXT_UID];\n }\n\n /**\n * Dispose all WebGL resources of all managed geometries.\n * @param [contextLost=false] - If context was lost, we suppress `gl.delete` calls\n */\n disposeAll(contextLost?: boolean): void\n {\n const all: Array<any> = Object.keys(this.managedGeometries);\n\n for (let i = 0; i < all.length; i++)\n {\n this.disposeGeometry(this.managedGeometries[all[i]], contextLost);\n }\n }\n\n /**\n * Activate vertex array object.\n * @param geometry - Geometry instance.\n * @param program - Shader program instance.\n */\n protected activateVao(geometry: Geometry, program: Program): void\n {\n const gl = this.gl;\n const CONTEXT_UID = this.CONTEXT_UID;\n const bufferSystem = this.renderer.buffer;\n const buffers = geometry.buffers;\n const attributes = geometry.attributes;\n\n if (geometry.indexBuffer)\n {\n // first update the index buffer if we have one..\n bufferSystem.bind(geometry.indexBuffer);\n }\n\n let lastBuffer = null;\n\n // add a new one!\n for (const j in attributes)\n {\n const attribute = attributes[j];\n const buffer = buffers[attribute.buffer];\n const glBuffer = buffer._glBuffers[CONTEXT_UID];\n\n if (program.attributeData[j])\n {\n if (lastBuffer !== glBuffer)\n {\n bufferSystem.bind(buffer);\n\n lastBuffer = glBuffer;\n }\n\n const location = program.attributeData[j].location;\n\n // TODO introduce state again\n // we can optimise this for older devices that have no VAOs\n gl.enableVertexAttribArray(location);\n\n gl.vertexAttribPointer(location,\n attribute.size,\n attribute.type || gl.FLOAT,\n attribute.normalized,\n attribute.stride,\n attribute.start);\n\n if (attribute.instance)\n {\n // TODO calculate instance count based of this...\n if (this.hasInstance)\n {\n gl.vertexAttribDivisor(location, 1);\n }\n else\n {\n throw new Error('geometry error, GPU Instancing is not supported on this device');\n }\n }\n }\n }\n }\n\n /**\n * Draws the currently bound geometry.\n * @param type - The type primitive to render.\n * @param size - The number of elements to be rendered. If not specified, all vertices after the\n * starting vertex will be drawn.\n * @param start - The starting vertex in the geometry to start drawing from. If not specified,\n * drawing will start from the first vertex.\n * @param instanceCount - The number of instances of the set of elements to execute. If not specified,\n * all instances will be drawn.\n */\n draw(type: DRAW_MODES, size?: number, start?: number, instanceCount?: number): this\n {\n const { gl } = this;\n const geometry = this._activeGeometry;\n\n // TODO.. this should not change so maybe cache the function?\n\n if (geometry.indexBuffer)\n {\n const byteSize = geometry.indexBuffer.data.BYTES_PER_ELEMENT;\n const glType = byteSize === 2 ? gl.UNSIGNED_SHORT : gl.UNSIGNED_INT;\n\n if (byteSize === 2 || (byteSize === 4 && this.canUseUInt32ElementIndex))\n {\n if (geometry.instanced)\n {\n /* eslint-disable max-len */\n gl.drawElementsInstanced(type, size || geometry.indexBuffer.data.length, glType, (start || 0) * byteSize, instanceCount || 1);\n /* eslint-enable max-len */\n }\n else\n {\n /* eslint-disable max-len */\n gl.drawElements(type, size || geometry.indexBuffer.data.length, glType, (start || 0) * byteSize);\n /* eslint-enable max-len */\n }\n }\n else\n {\n console.warn('unsupported index buffer type: uint32');\n }\n }\n else if (geometry.instanced)\n {\n // TODO need a better way to calculate size..\n gl.drawArraysInstanced(type, start, size || geometry.getSize(), instanceCount || 1);\n }\n else\n {\n gl.drawArrays(type, start, size || geometry.getSize());\n }\n\n return this;\n }\n\n /** Unbind/reset everything. */\n protected unbind(): void\n {\n this.gl.bindVertexArray(null);\n this._activeVao = null;\n this._activeGeometry = null;\n }\n\n destroy(): void\n {\n this.renderer = null;\n }\n}\n","import { MASK_TYPES } from '@pixi/constants';\nimport { settings } from '@pixi/settings';\nimport type { ISpriteMaskFilter } from '@pixi/core';\n\nimport type { COLOR_MASK_BITS, MSAA_QUALITY } from '@pixi/constants';\nimport type { Rectangle, Matrix } from '@pixi/math';\nimport type { IFilterTarget } from '../filters/IFilterTarget';\nimport type { Renderer } from '../Renderer';\n\nexport interface IMaskTarget extends IFilterTarget\n{\n renderable: boolean;\n isSprite?: boolean;\n worldTransform: Matrix;\n isFastRect?(): boolean;\n getBounds(skipUpdate?: boolean, rect?: Rectangle): Rectangle;\n render(renderer: Renderer): void;\n}\n/**\n * Component for masked elements.\n *\n * Holds mask mode and temporary data about current mask.\n * @memberof PIXI\n */\nexport class MaskData\n{\n /** Mask type */\n public type: MASK_TYPES;\n\n /**\n * Whether we know the mask type beforehand\n * @default true\n */\n public autoDetect: boolean;\n\n /**\n * Which element we use to mask\n * @member {PIXI.DisplayObject}\n */\n public maskObject: IMaskTarget;\n\n /** Whether it belongs to MaskSystem pool */\n public pooled: boolean;\n\n /** Indicator of the type (always true for {@link MaskData} objects) */\n public isMaskData: boolean;// webdoc crashes if the type is true because reasons... (will fix)\n\n /**\n * Resolution of the sprite mask filter.\n * If set to `null` or `0`, the resolution of the current render target is used.\n * @default null\n */\n public resolution: number;\n\n /**\n * Number of samples of the sprite mask filter.\n * If set to `null`, the sample count of the current render target is used.\n * @default PIXI.settings.FILTER_MULTISAMPLE\n */\n public multisample: MSAA_QUALITY;\n\n /** If enabled is true the mask is applied, if false it will not. */\n public enabled: boolean;\n\n /** Color mask. */\n public colorMask: COLOR_MASK_BITS;\n\n /**\n * The sprite mask filter wrapped in an array.\n * @private\n */\n _filters: ISpriteMaskFilter[];\n\n /**\n * Stencil counter above the mask in stack\n * @private\n */\n _stencilCounter: number;\n\n /**\n * Scissor counter above the mask in stack\n * @private\n */\n _scissorCounter: number;\n\n /**\n * Scissor operation above the mask in stack.\n * Null if _scissorCounter is zero, rectangle instance if positive.\n * @private\n */\n _scissorRect: Rectangle;\n\n /**\n * pre-computed scissor rect\n * does become _scissorRect when mask is actually pushed\n * @private\n */\n _scissorRectLocal: Rectangle;\n\n /**\n * pre-computed color mask\n * @private\n */\n _colorMask: number;\n\n /**\n * Targeted element. Temporary variable set by MaskSystem\n * @member {PIXI.DisplayObject}\n * @private\n */\n _target: IMaskTarget;\n\n /**\n * Create MaskData\n * @param {PIXI.DisplayObject} [maskObject=null] - object that describes the mask\n */\n constructor(maskObject: IMaskTarget = null)\n {\n this.type = MASK_TYPES.NONE;\n this.autoDetect = true;\n this.maskObject = maskObject || null;\n this.pooled = false;\n this.isMaskData = true;\n this.resolution = null;\n this.multisample = settings.FILTER_MULTISAMPLE;\n this.enabled = true;\n this.colorMask = 0xf;\n this._filters = null;\n this._stencilCounter = 0;\n this._scissorCounter = 0;\n this._scissorRect = null;\n this._scissorRectLocal = null;\n this._colorMask = 0xf;\n this._target = null;\n }\n\n /**\n * The sprite mask filter.\n * If set to `null`, the default sprite mask filter is used.\n * @default null\n */\n get filter(): ISpriteMaskFilter\n {\n return this._filters ? this._filters[0] : null;\n }\n\n set filter(value: ISpriteMaskFilter)\n {\n if (value)\n {\n if (this._filters)\n {\n this._filters[0] = value;\n }\n else\n {\n this._filters = [value];\n }\n }\n else\n {\n this._filters = null;\n }\n }\n\n /** Resets the mask data after popMask(). */\n reset(): void\n {\n if (this.pooled)\n {\n this.maskObject = null;\n\n this.type = MASK_TYPES.NONE;\n\n this.autoDetect = true;\n }\n\n this._target = null;\n this._scissorRectLocal = null;\n }\n\n /**\n * Copies counters from maskData above, called from pushMask().\n * @param maskAbove\n */\n copyCountersOrReset(maskAbove?: MaskData): void\n {\n if (maskAbove)\n {\n this._stencilCounter = maskAbove._stencilCounter;\n this._scissorCounter = maskAbove._scissorCounter;\n this._scissorRect = maskAbove._scissorRect;\n }\n else\n {\n this._stencilCounter = 0;\n this._scissorCounter = 0;\n this._scissorRect = null;\n }\n }\n}\n","/**\n * @private\n * @param {WebGLRenderingContext} gl - The current WebGL context {WebGLProgram}\n * @param {number} type - the type, can be either VERTEX_SHADER or FRAGMENT_SHADER\n * @param {string} src - The vertex shader source as an array of strings.\n * @returns {WebGLShader} the shader\n */\nexport function compileShader(gl: WebGLRenderingContextBase, type: number, src: string): WebGLShader\n{\n const shader = gl.createShader(type);\n\n gl.shaderSource(shader, src);\n gl.compileShader(shader);\n\n return shader;\n}\n","/**\n * will log a shader error highlighting the lines with the error\n * also will add numbers along the side.\n * @param gl - the WebGLContext\n * @param shader - the shader to log errors for\n */\nfunction logPrettyShaderError(gl: WebGLRenderingContext, shader: WebGLShader): void\n{\n const shaderSrc = gl.getShaderSource(shader)\n .split('\\n')\n .map((line, index) => `${index}: ${line}`);\n\n const shaderLog = gl.getShaderInfoLog(shader);\n const splitShader = shaderLog.split('\\n');\n\n const dedupe: Record<number, boolean> = {};\n\n const lineNumbers = splitShader.map((line) => parseFloat(line.replace(/^ERROR\\: 0\\:([\\d]+)\\:.*$/, '$1')))\n .filter((n) =>\n {\n if (n && !dedupe[n])\n {\n dedupe[n] = true;\n\n return true;\n }\n\n return false;\n });\n\n const logArgs = [''];\n\n lineNumbers.forEach((number) =>\n {\n shaderSrc[number - 1] = `%c${shaderSrc[number - 1]}%c`;\n logArgs.push('background: #FF0000; color:#FFFFFF; font-size: 10px', 'font-size: 10px');\n });\n\n const fragmentSourceToLog = shaderSrc\n .join('\\n');\n\n logArgs[0] = fragmentSourceToLog;\n\n console.error(shaderLog);\n\n // eslint-disable-next-line no-console\n console.groupCollapsed('click to view full shader code');\n console.warn(...logArgs);\n // eslint-disable-next-line no-console\n console.groupEnd();\n}\n\n/**\n *\n * logs out any program errors\n * @param gl - The current WebGL context\n * @param program - the WebGL program to display errors for\n * @param vertexShader - the fragment WebGL shader program\n * @param fragmentShader - the vertex WebGL shader program\n */\nexport function logProgramError(\n gl: WebGLRenderingContext,\n program: WebGLProgram,\n vertexShader: WebGLShader,\n fragmentShader: WebGLShader\n): void\n{\n // if linking fails, then log and cleanup\n if (!gl.getProgramParameter(program, gl.LINK_STATUS))\n {\n if (!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS))\n {\n logPrettyShaderError(gl, vertexShader);\n }\n\n if (!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS))\n {\n logPrettyShaderError(gl, fragmentShader);\n }\n\n console.error('PixiJS Error: Could not initialize shader.');\n\n // if there is a program info log, log it\n if (gl.getProgramInfoLog(program) !== '')\n {\n console.warn('PixiJS Warning: gl.getProgramInfoLog()', gl.getProgramInfoLog(program));\n }\n }\n}\n","function booleanArray(size: number): Array<boolean>\n{\n const array = new Array(size);\n\n for (let i = 0; i < array.length; i++)\n {\n array[i] = false;\n }\n\n return array;\n}\n\n/**\n * @method defaultValue\n * @memberof PIXI.glCore.shader\n * @param {string} type - Type of value\n * @param {number} size\n * @private\n */\nexport function defaultValue(\n type: string,\n size: number\n): number | Float32Array | Int32Array | Uint32Array | boolean | boolean[]\n{\n switch (type)\n {\n case 'float':\n return 0;\n\n case 'vec2':\n return new Float32Array(2 * size);\n\n case 'vec3':\n return new Float32Array(3 * size);\n\n case 'vec4':\n return new Float32Array(4 * size);\n\n case 'int':\n case 'uint':\n case 'sampler2D':\n case 'sampler2DArray':\n return 0;\n\n case 'ivec2':\n return new Int32Array(2 * size);\n\n case 'ivec3':\n return new Int32Array(3 * size);\n\n case 'ivec4':\n return new Int32Array(4 * size);\n\n case 'uvec2':\n return new Uint32Array(2 * size);\n\n case 'uvec3':\n return new Uint32Array(3 * size);\n\n case 'uvec4':\n return new Uint32Array(4 * size);\n\n case 'bool':\n return false;\n\n case 'bvec2':\n\n return booleanArray(2 * size);\n\n case 'bvec3':\n return booleanArray(3 * size);\n\n case 'bvec4':\n return booleanArray(4 * size);\n\n case 'mat2':\n return new Float32Array([1, 0,\n 0, 1]);\n\n case 'mat3':\n return new Float32Array([1, 0, 0,\n 0, 1, 0,\n 0, 0, 1]);\n\n case 'mat4':\n return new Float32Array([1, 0, 0, 0,\n 0, 1, 0, 0,\n 0, 0, 1, 0,\n 0, 0, 0, 1]);\n }\n\n return null;\n}\n","import { settings } from '../../settings';\nimport { ENV } from '@pixi/constants';\n\nconst unknownContext = {};\nlet context: WebGLRenderingContext | WebGL2RenderingContext = unknownContext as any;\n\n/**\n * returns a little WebGL context to use for program inspection.\n * @static\n * @private\n * @returns {WebGLRenderingContext} a gl context to test with\n */\nexport function getTestContext(): WebGLRenderingContext | WebGL2RenderingContext\n{\n if (context === unknownContext || (context && context.isContextLost()))\n {\n const canvas = settings.ADAPTER.createCanvas();\n\n let gl: WebGLRenderingContext | WebGL2RenderingContext;\n\n if (settings.PREFER_ENV >= ENV.WEBGL2)\n {\n gl = canvas.getContext('webgl2', {});\n }\n\n if (!gl)\n {\n gl = (canvas.getContext('webgl', {})\n || (canvas.getContext('experimental-webgl', {}) as WebGLRenderingContext));\n\n if (!gl)\n {\n // fail, not able to get a context\n gl = null;\n }\n else\n {\n // for shader testing..\n gl.getExtension('WEBGL_draw_buffers');\n }\n }\n\n context = gl;\n }\n\n return context;\n}\n","import { getTestContext } from './getTestContext';\nimport { PRECISION } from '@pixi/constants';\n\nlet maxFragmentPrecision: PRECISION;\n\nexport function getMaxFragmentPrecision(): PRECISION\n{\n if (!maxFragmentPrecision)\n {\n maxFragmentPrecision = PRECISION.MEDIUM;\n const gl = getTestContext();\n\n if (gl)\n {\n if (gl.getShaderPrecisionFormat)\n {\n const shaderFragment = gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT);\n\n maxFragmentPrecision = shaderFragment.precision ? PRECISION.HIGH : PRECISION.MEDIUM;\n }\n }\n }\n\n return maxFragmentPrecision;\n}\n","import { PRECISION } from '@pixi/constants';\n\n/**\n * Sets the float precision on the shader, ensuring the device supports the request precision.\n * If the precision is already present, it just ensures that the device is able to handle it.\n * @private\n * @param {string} src - The shader source\n * @param {PIXI.PRECISION} requestedPrecision - The request float precision of the shader.\n * @param {PIXI.PRECISION} maxSupportedPrecision - The maximum precision the shader supports.\n * @returns {string} modified shader source\n */\nexport function setPrecision(src: string, requestedPrecision: PRECISION, maxSupportedPrecision: PRECISION): string\n{\n if (src.substring(0, 9) !== 'precision')\n {\n // no precision supplied, so PixiJS will add the requested level.\n let precision = requestedPrecision;\n\n // If highp is requested but not supported, downgrade precision to a level all devices support.\n if (requestedPrecision === PRECISION.HIGH && maxSupportedPrecision !== PRECISION.HIGH)\n {\n precision = PRECISION.MEDIUM;\n }\n\n return `precision ${precision} float;\\n${src}`;\n }\n else if (maxSupportedPrecision !== PRECISION.HIGH && src.substring(0, 15) === 'precision highp')\n {\n // precision was supplied, but at a level this device does not support, so downgrading to mediump.\n return src.replace('precision highp', 'precision mediump');\n }\n\n return src;\n}\n","import type { Dict } from '@pixi/utils';\n\nconst GLSL_TO_SIZE: Dict<number> = {\n float: 1,\n vec2: 2,\n vec3: 3,\n vec4: 4,\n\n int: 1,\n ivec2: 2,\n ivec3: 3,\n ivec4: 4,\n\n uint: 1,\n uvec2: 2,\n uvec3: 3,\n uvec4: 4,\n\n bool: 1,\n bvec2: 2,\n bvec3: 3,\n bvec4: 4,\n\n mat2: 4,\n mat3: 9,\n mat4: 16,\n\n sampler2D: 1,\n};\n\n/**\n * @private\n * @method mapSize\n * @memberof PIXI.glCore.shader\n * @param {string} type\n */\nexport function mapSize(type: string): number\n{\n return GLSL_TO_SIZE[type];\n}\n","import type { Dict } from '@pixi/utils';\n\nlet GL_TABLE: Dict<string> = null;\n\nconst GL_TO_GLSL_TYPES: Dict<string> = {\n FLOAT: 'float',\n FLOAT_VEC2: 'vec2',\n FLOAT_VEC3: 'vec3',\n FLOAT_VEC4: 'vec4',\n\n INT: 'int',\n INT_VEC2: 'ivec2',\n INT_VEC3: 'ivec3',\n INT_VEC4: 'ivec4',\n\n UNSIGNED_INT: 'uint',\n UNSIGNED_INT_VEC2: 'uvec2',\n UNSIGNED_INT_VEC3: 'uvec3',\n UNSIGNED_INT_VEC4: 'uvec4',\n\n BOOL: 'bool',\n BOOL_VEC2: 'bvec2',\n BOOL_VEC3: 'bvec3',\n BOOL_VEC4: 'bvec4',\n\n FLOAT_MAT2: 'mat2',\n FLOAT_MAT3: 'mat3',\n FLOAT_MAT4: 'mat4',\n\n SAMPLER_2D: 'sampler2D',\n INT_SAMPLER_2D: 'sampler2D',\n UNSIGNED_INT_SAMPLER_2D: 'sampler2D',\n SAMPLER_CUBE: 'samplerCube',\n INT_SAMPLER_CUBE: 'samplerCube',\n UNSIGNED_INT_SAMPLER_CUBE: 'samplerCube',\n SAMPLER_2D_ARRAY: 'sampler2DArray',\n INT_SAMPLER_2D_ARRAY: 'sampler2DArray',\n UNSIGNED_INT_SAMPLER_2D_ARRAY: 'sampler2DArray',\n};\n\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function mapType(gl: any, type: number): string\n{\n if (!GL_TABLE)\n {\n const typeNames = Object.keys(GL_TO_GLSL_TYPES);\n\n GL_TABLE = {};\n\n for (let i = 0; i < typeNames.length; ++i)\n {\n const tn = typeNames[i];\n\n GL_TABLE[gl[tn]] = GL_TO_GLSL_TYPES[tn];\n }\n }\n\n return GL_TABLE[type];\n}\n","/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n// Parsers, each one of these will take a look at the type of shader property and uniform.\n// if they pass the test function then the code function is called that returns a the shader upload code for that uniform.\n// Shader upload code is automagically generated with these parsers.\n// If no parser is valid then the default upload functions are used.\n// exposing Parsers means that custom upload logic can be added to pixi's shaders.\n// A good example would be a pixi rectangle can be directly set on a uniform.\n// If the shader sees it it knows how to upload the rectangle structure as a vec4\n// format is as follows:\n//\n// {\n// test: (data, uniform) => {} <--- test is this code should be used for this uniform\n// code: (name, uniform) => {} <--- returns the string of the piece of code that uploads the uniform\n// codeUbo: (name, uniform) => {} <--- returns the string of the piece of code that uploads the\n// uniform to a uniform buffer\n// }\n\nexport interface IUniformParser\n{\n test(data: unknown, uniform: any): boolean;\n code(name: string, uniform: any): string;\n codeUbo?(name: string, uniform: any): string;\n}\n\nexport const uniformParsers: IUniformParser[] = [\n\n // a float cache layer\n {\n test: (data: any): boolean =>\n data.type === 'float' && data.size === 1,\n code: (name: string): string =>\n `\n if(uv[\"${name}\"] !== ud[\"${name}\"].value)\n {\n ud[\"${name}\"].value = uv[\"${name}\"]\n gl.uniform1f(ud[\"${name}\"].location, uv[\"${name}\"])\n }\n `,\n },\n // handling samplers\n {\n test: (data: any): boolean =>\n // eslint-disable-next-line max-len\n (data.type === 'sampler2D' || data.type === 'samplerCube' || data.type === 'sampler2DArray') && data.size === 1 && !data.isArray,\n code: (name: string): string => `t = syncData.textureCount++;\n\n renderer.texture.bind(uv[\"${name}\"], t);\n\n if(ud[\"${name}\"].value !== t)\n {\n ud[\"${name}\"].value = t;\n gl.uniform1i(ud[\"${name}\"].location, t);\\n; // eslint-disable-line max-len\n }`,\n },\n // uploading pixi matrix object to mat3\n {\n test: (data: any, uniform: any): boolean =>\n data.type === 'mat3' && data.size === 1 && uniform.a !== undefined,\n code: (name: string): string =>\n\n // TODO and some smart caching dirty ids here!\n `\n gl.uniformMatrix3fv(ud[\"${name}\"].location, false, uv[\"${name}\"].toArray(true));\n `,\n codeUbo: (name: string): string =>\n `\n var ${name}_matrix = uv.${name}.toArray(true);\n\n data[offset] = ${name}_matrix[0];\n data[offset+1] = ${name}_matrix[1];\n data[offset+2] = ${name}_matrix[2];\n \n data[offset + 4] = ${name}_matrix[3];\n data[offset + 5] = ${name}_matrix[4];\n data[offset + 6] = ${name}_matrix[5];\n \n data[offset + 8] = ${name}_matrix[6];\n data[offset + 9] = ${name}_matrix[7];\n data[offset + 10] = ${name}_matrix[8];\n `\n ,\n\n },\n // uploading a pixi point as a vec2 with caching layer\n {\n test: (data: any, uniform: any): boolean =>\n data.type === 'vec2' && data.size === 1 && uniform.x !== undefined,\n code: (name: string): string =>\n `\n cv = ud[\"${name}\"].value;\n v = uv[\"${name}\"];\n\n if(cv[0] !== v.x || cv[1] !== v.y)\n {\n cv[0] = v.x;\n cv[1] = v.y;\n gl.uniform2f(ud[\"${name}\"].location, v.x, v.y);\n }`,\n codeUbo: (name: string): string =>\n `\n v = uv.${name};\n\n data[offset] = v.x;\n data[offset+1] = v.y;\n `\n },\n // caching layer for a vec2\n {\n test: (data: any): boolean =>\n data.type === 'vec2' && data.size === 1,\n code: (name: string): string =>\n `\n cv = ud[\"${name}\"].value;\n v = uv[\"${name}\"];\n\n if(cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2f(ud[\"${name}\"].location, v[0], v[1]);\n }\n `,\n },\n // upload a pixi rectangle as a vec4 with caching layer\n {\n test: (data: any, uniform: any): boolean =>\n data.type === 'vec4' && data.size === 1 && uniform.width !== undefined,\n\n code: (name: string): string =>\n `\n cv = ud[\"${name}\"].value;\n v = uv[\"${name}\"];\n\n if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height)\n {\n cv[0] = v.x;\n cv[1] = v.y;\n cv[2] = v.width;\n cv[3] = v.height;\n gl.uniform4f(ud[\"${name}\"].location, v.x, v.y, v.width, v.height)\n }`,\n codeUbo: (name: string): string =>\n `\n v = uv.${name};\n\n data[offset] = v.x;\n data[offset+1] = v.y;\n data[offset+2] = v.width;\n data[offset+3] = v.height;\n `\n },\n // a caching layer for vec4 uploading\n {\n test: (data: any): boolean =>\n data.type === 'vec4' && data.size === 1,\n code: (name: string): string =>\n `\n cv = ud[\"${name}\"].value;\n v = uv[\"${name}\"];\n\n if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4f(ud[\"${name}\"].location, v[0], v[1], v[2], v[3])\n }`,\n },\n];\n\n","import { uniformParsers } from './uniformParsers';\n\nimport type { UniformGroup } from '../UniformGroup';\nimport type { Dict } from '@pixi/utils';\n\nexport type UniformsSyncCallback = (...args: any[]) => void;\n\n// cu = Cached value's uniform data field\n// cv = Cached value\n// v = value to upload\n// ud = uniformData\n// uv = uniformValue\n// l = location\nconst GLSL_TO_SINGLE_SETTERS_CACHED: Dict<string> = {\n\n float: `\n if (cv !== v)\n {\n cu.value = v;\n gl.uniform1f(location, v);\n }`,\n\n vec2: `\n if (cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2f(location, v[0], v[1])\n }`,\n\n vec3: `\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3f(location, v[0], v[1], v[2])\n }`,\n\n vec4: `\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4f(location, v[0], v[1], v[2], v[3]);\n }`,\n\n int: `\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1i(location, v);\n }`,\n ivec2: `\n if (cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2i(location, v[0], v[1]);\n }`,\n ivec3: `\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3i(location, v[0], v[1], v[2]);\n }`,\n ivec4: `\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n }`,\n\n uint: `\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1ui(location, v);\n }`,\n uvec2: `\n if (cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2ui(location, v[0], v[1]);\n }`,\n uvec3: `\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3ui(location, v[0], v[1], v[2]);\n }`,\n uvec4: `\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4ui(location, v[0], v[1], v[2], v[3]);\n }`,\n\n bool: `\n if (cv !== v)\n {\n cu.value = v;\n gl.uniform1i(location, v);\n }`,\n bvec2: `\n if (cv[0] != v[0] || cv[1] != v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2i(location, v[0], v[1]);\n }`,\n bvec3: `\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3i(location, v[0], v[1], v[2]);\n }`,\n bvec4: `\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n }`,\n\n mat2: 'gl.uniformMatrix2fv(location, false, v)',\n mat3: 'gl.uniformMatrix3fv(location, false, v)',\n mat4: 'gl.uniformMatrix4fv(location, false, v)',\n\n sampler2D: 'gl.uniform1i(location, v)',\n samplerCube: 'gl.uniform1i(location, v)',\n sampler2DArray: 'gl.uniform1i(location, v)',\n};\n\nconst GLSL_TO_ARRAY_SETTERS: Dict<string> = {\n\n float: `gl.uniform1fv(location, v)`,\n\n vec2: `gl.uniform2fv(location, v)`,\n vec3: `gl.uniform3fv(location, v)`,\n vec4: 'gl.uniform4fv(location, v)',\n\n mat4: 'gl.uniformMatrix4fv(location, false, v)',\n mat3: 'gl.uniformMatrix3fv(location, false, v)',\n mat2: 'gl.uniformMatrix2fv(location, false, v)',\n\n int: 'gl.uniform1iv(location, v)',\n ivec2: 'gl.uniform2iv(location, v)',\n ivec3: 'gl.uniform3iv(location, v)',\n ivec4: 'gl.uniform4iv(location, v)',\n\n uint: 'gl.uniform1uiv(location, v)',\n uvec2: 'gl.uniform2uiv(location, v)',\n uvec3: 'gl.uniform3uiv(location, v)',\n uvec4: 'gl.uniform4uiv(location, v)',\n\n bool: 'gl.uniform1iv(location, v)',\n bvec2: 'gl.uniform2iv(location, v)',\n bvec3: 'gl.uniform3iv(location, v)',\n bvec4: 'gl.uniform4iv(location, v)',\n\n sampler2D: 'gl.uniform1iv(location, v)',\n samplerCube: 'gl.uniform1iv(location, v)',\n sampler2DArray: 'gl.uniform1iv(location, v)',\n};\n\nexport function generateUniformsSync(group: UniformGroup, uniformData: Dict<any>): UniformsSyncCallback\n{\n const funcFragments = [`\n var v = null;\n var cv = null;\n var cu = null;\n var t = 0;\n var gl = renderer.gl;\n `];\n\n for (const i in group.uniforms)\n {\n const data = uniformData[i];\n\n if (!data)\n {\n if (group.uniforms[i]?.group)\n {\n if (group.uniforms[i].ubo)\n {\n funcFragments.push(`\n renderer.shader.syncUniformBufferGroup(uv.${i}, '${i}');\n `);\n }\n else\n {\n funcFragments.push(`\n renderer.shader.syncUniformGroup(uv.${i}, syncData);\n `);\n }\n }\n\n continue;\n }\n\n const uniform = group.uniforms[i];\n\n let parsed = false;\n\n for (let j = 0; j < uniformParsers.length; j++)\n {\n if (uniformParsers[j].test(data, uniform))\n {\n funcFragments.push(uniformParsers[j].code(i, uniform));\n parsed = true;\n\n break;\n }\n }\n\n if (!parsed)\n {\n const templateType = (data.size === 1) ? GLSL_TO_SINGLE_SETTERS_CACHED : GLSL_TO_ARRAY_SETTERS;\n\n const template = templateType[data.type].replace('location', `ud[\"${i}\"].location`);\n\n funcFragments.push(`\n cu = ud[\"${i}\"];\n cv = cu.value;\n v = uv[\"${i}\"];\n ${template};`);\n }\n }\n\n /*\n * the introduction of syncData is to solve an issue where textures in uniform groups are not set correctly\n * the texture count was always starting from 0 in each group. This needs to increment each time a texture is used\n * no matter which group is being used\n *\n */\n // eslint-disable-next-line no-new-func\n return new Function('ud', 'uv', 'renderer', 'syncData', funcFragments.join('\\n')) as UniformsSyncCallback;\n}\n","import type { IRenderingContext } from '../../IRenderingContext';\n\nconst fragTemplate = [\n 'precision mediump float;',\n 'void main(void){',\n 'float test = 0.1;',\n '%forloop%',\n 'gl_FragColor = vec4(0.0);',\n '}',\n].join('\\n');\n\nfunction generateIfTestSrc(maxIfs: number): string\n{\n let src = '';\n\n for (let i = 0; i < maxIfs; ++i)\n {\n if (i > 0)\n {\n src += '\\nelse ';\n }\n\n if (i < maxIfs - 1)\n {\n src += `if(test == ${i}.0){}`;\n }\n }\n\n return src;\n}\n\nexport function checkMaxIfStatementsInShader(maxIfs: number, gl: IRenderingContext): number\n{\n if (maxIfs === 0)\n {\n throw new Error('Invalid value of `0` passed to `checkMaxIfStatementsInShader`');\n }\n\n const shader = gl.createShader(gl.FRAGMENT_SHADER);\n\n while (true) // eslint-disable-line no-constant-condition\n {\n const fragmentSrc = fragTemplate.replace(/%forloop%/gi, generateIfTestSrc(maxIfs));\n\n gl.shaderSource(shader, fragmentSrc);\n gl.compileShader(shader);\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS))\n {\n maxIfs = (maxIfs / 2) | 0;\n }\n else\n {\n // valid!\n break;\n }\n }\n\n return maxIfs;\n}\n","// Cache the result to prevent running this over and over\nlet unsafeEval: boolean;\n\n/**\n * Not all platforms allow to generate function code (e.g., `new Function`).\n * this provides the platform-level detection.\n * @private\n * @returns {boolean} `true` if `new Function` is supported.\n */\nexport function unsafeEvalSupported(): boolean\n{\n if (typeof unsafeEval === 'boolean')\n {\n return unsafeEval;\n }\n\n try\n {\n /* eslint-disable no-new-func */\n const func = new Function('param1', 'param2', 'param3', 'return param1[param2] === param3;');\n /* eslint-enable no-new-func */\n\n unsafeEval = func({ a: 'b' }, 'a', 'b') === true;\n }\n catch (e)\n {\n unsafeEval = false;\n }\n\n return unsafeEval;\n}\n","import { setPrecision,\n getMaxFragmentPrecision } from './utils';\nimport { ProgramCache } from '@pixi/utils';\nimport defaultFragment from './defaultProgram.frag';\nimport defaultVertex from './defaultProgram.vert';\nimport { settings } from '@pixi/settings';\nimport { PRECISION } from '@pixi/constants';\n\nimport type { GLProgram } from './GLProgram';\n\nlet UID = 0;\n\nconst nameCache: { [key: string]: number } = {};\n\nexport interface IAttributeData\n{\n type: string;\n size: number;\n location: number;\n name: string;\n}\n\nexport interface IUniformData\n{\n index: number;\n type: string;\n size: number;\n isArray: boolean;\n value: any;\n name: string;\n}\n\n/**\n * Helper class to create a shader program.\n * @memberof PIXI\n */\nexport class Program\n{\n public id: number;\n\n /** Source code for the vertex shader. */\n public vertexSrc: string;\n\n /** Source code for the fragment shader. */\n public fragmentSrc: string;\n\n nameCache: any;\n glPrograms: { [ key: number ]: GLProgram};\n syncUniforms: any;\n\n /** Assigned when a program is first bound to the shader system. */\n attributeData: { [key: string]: IAttributeData};\n\n /** Assigned when a program is first bound to the shader system. */\n uniformData: {[key: string]: IUniformData};\n\n /**\n * @param vertexSrc - The source of the vertex shader.\n * @param fragmentSrc - The source of the fragment shader.\n * @param name - Name for shader\n */\n constructor(vertexSrc?: string, fragmentSrc?: string, name = 'pixi-shader')\n {\n this.id = UID++;\n this.vertexSrc = vertexSrc || Program.defaultVertexSrc;\n this.fragmentSrc = fragmentSrc || Program.defaultFragmentSrc;\n\n this.vertexSrc = this.vertexSrc.trim();\n this.fragmentSrc = this.fragmentSrc.trim();\n\n if (this.vertexSrc.substring(0, 8) !== '#version')\n {\n name = name.replace(/\\s+/g, '-');\n\n if (nameCache[name])\n {\n nameCache[name]++;\n name += `-${nameCache[name]}`;\n }\n else\n {\n nameCache[name] = 1;\n }\n\n this.vertexSrc = `#define SHADER_NAME ${name}\\n${this.vertexSrc}`;\n this.fragmentSrc = `#define SHADER_NAME ${name}\\n${this.fragmentSrc}`;\n\n this.vertexSrc = setPrecision(this.vertexSrc, settings.PRECISION_VERTEX, PRECISION.HIGH);\n this.fragmentSrc = setPrecision(this.fragmentSrc, settings.PRECISION_FRAGMENT, getMaxFragmentPrecision());\n }\n\n // currently this does not extract structs only default types\n // this is where we store shader references..\n this.glPrograms = {};\n\n this.syncUniforms = null;\n }\n\n /**\n * The default vertex shader source.\n * @constant\n */\n static get defaultVertexSrc(): string\n {\n return defaultVertex;\n }\n\n /**\n * The default fragment shader source.\n * @constant\n */\n static get defaultFragmentSrc(): string\n {\n return defaultFragment;\n }\n\n /**\n * A short hand function to create a program based of a vertex and fragment shader.\n *\n * This method will also check to see if there is a cached program.\n * @param vertexSrc - The source of the vertex shader.\n * @param fragmentSrc - The source of the fragment shader.\n * @param name - Name for shader\n * @returns A shiny new PixiJS shader program!\n */\n static from(vertexSrc?: string, fragmentSrc?: string, name?: string): Program\n {\n const key = vertexSrc + fragmentSrc;\n\n let program = ProgramCache[key];\n\n if (!program)\n {\n ProgramCache[key] = program = new Program(vertexSrc, fragmentSrc, name);\n }\n\n return program;\n }\n}\n","import { Program } from './Program';\nimport { UniformGroup } from './UniformGroup';\n\nimport type { Dict } from '@pixi/utils';\n\n/**\n * A helper class for shaders.\n * @memberof PIXI\n */\nexport class Shader\n{\n /** Program that the shader uses. */\n public program: Program;\n public uniformGroup: UniformGroup;\n\n /**\n * Used internally to bind uniform buffer objects.\n * @ignore\n */\n uniformBindCount = 0;\n\n /**\n * @param program - The program the shader will use.\n * @param uniforms - Custom uniforms to use to augment the built-in ones.\n */\n constructor(program: Program, uniforms?: Dict<any>)\n {\n this.program = program;\n\n // lets see whats been passed in\n // uniforms should be converted to a uniform group\n if (uniforms)\n {\n if (uniforms instanceof UniformGroup)\n {\n this.uniformGroup = uniforms;\n }\n else\n {\n this.uniformGroup = new UniformGroup(uniforms);\n }\n }\n else\n {\n this.uniformGroup = new UniformGroup({});\n }\n }\n\n // TODO move to shader system..\n checkUniformExists(name: string, group: UniformGroup): boolean\n {\n if (group.uniforms[name])\n {\n return true;\n }\n\n for (const i in group.uniforms)\n {\n const uniform = group.uniforms[i];\n\n if (uniform.group)\n {\n if (this.checkUniformExists(name, uniform))\n {\n return true;\n }\n }\n }\n\n return false;\n }\n\n destroy(): void\n {\n // usage count on programs?\n // remove if not used!\n this.uniformGroup = null;\n }\n\n /**\n * Shader uniform values, shortcut for `uniformGroup.uniforms`.\n * @readonly\n */\n get uniforms(): Dict<any>\n {\n return this.uniformGroup.uniforms;\n }\n\n /**\n * A short hand function to create a shader based of a vertex and fragment shader.\n * @param vertexSrc - The source of the vertex shader.\n * @param fragmentSrc - The source of the fragment shader.\n * @param uniforms - Custom uniforms to use to augment the built-in ones.\n * @returns A shiny new PixiJS shader!\n */\n static from(vertexSrc?: string, fragmentSrc?: string, uniforms?: Dict<any>): Shader\n {\n const program = Program.from(vertexSrc, fragmentSrc);\n\n return new Shader(program, uniforms);\n }\n}\n","import { BLEND_MODES } from '@pixi/constants';\n\n/* eslint-disable max-len */\n\nconst BLEND = 0;\nconst OFFSET = 1;\nconst CULLING = 2;\nconst DEPTH_TEST = 3;\nconst WINDING = 4;\nconst DEPTH_MASK = 5;\n\n/**\n * This is a WebGL state, and is is passed to {@link PIXI.StateSystem}.\n *\n * Each mesh rendered may require WebGL to be in a different state.\n * For example you may want different blend mode or to enable polygon offsets\n * @memberof PIXI\n */\nexport class State\n{\n data: number;\n _blendMode: BLEND_MODES;\n _polygonOffset: number;\n\n constructor()\n {\n this.data = 0;\n\n this.blendMode = BLEND_MODES.NORMAL;\n this.polygonOffset = 0;\n\n this.blend = true;\n this.depthMask = true;\n // this.depthTest = true;\n }\n\n /**\n * Activates blending of the computed fragment color values.\n * @default true\n */\n get blend(): boolean\n {\n return !!(this.data & (1 << BLEND));\n }\n\n set blend(value: boolean)\n {\n if (!!(this.data & (1 << BLEND)) !== value)\n {\n this.data ^= (1 << BLEND);\n }\n }\n\n /**\n * Activates adding an offset to depth values of polygon's fragments\n * @default false\n */\n get offsets(): boolean\n {\n return !!(this.data & (1 << OFFSET));\n }\n\n set offsets(value: boolean)\n {\n if (!!(this.data & (1 << OFFSET)) !== value)\n {\n this.data ^= (1 << OFFSET);\n }\n }\n\n /**\n * Activates culling of polygons.\n * @default false\n */\n get culling(): boolean\n {\n return !!(this.data & (1 << CULLING));\n }\n\n set culling(value: boolean)\n {\n if (!!(this.data & (1 << CULLING)) !== value)\n {\n this.data ^= (1 << CULLING);\n }\n }\n\n /**\n * Activates depth comparisons and updates to the depth buffer.\n * @default false\n */\n get depthTest(): boolean\n {\n return !!(this.data & (1 << DEPTH_TEST));\n }\n\n set depthTest(value: boolean)\n {\n if (!!(this.data & (1 << DEPTH_TEST)) !== value)\n {\n this.data ^= (1 << DEPTH_TEST);\n }\n }\n\n /**\n * Enables or disables writing to the depth buffer.\n * @default true\n */\n get depthMask(): boolean\n {\n return !!(this.data & (1 << DEPTH_MASK));\n }\n\n set depthMask(value: boolean)\n {\n if (!!(this.data & (1 << DEPTH_MASK)) !== value)\n {\n this.data ^= (1 << DEPTH_MASK);\n }\n }\n\n /**\n * Specifies whether or not front or back-facing polygons can be culled.\n * @default false\n */\n get clockwiseFrontFace(): boolean\n {\n return !!(this.data & (1 << WINDING));\n }\n\n set clockwiseFrontFace(value: boolean)\n {\n if (!!(this.data & (1 << WINDING)) !== value)\n {\n this.data ^= (1 << WINDING);\n }\n }\n\n /**\n * The blend mode to be applied when this state is set. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode.\n * Setting this mode to anything other than NO_BLEND will automatically switch blending on.\n * @default PIXI.BLEND_MODES.NORMAL\n */\n get blendMode(): BLEND_MODES\n {\n return this._blendMode;\n }\n\n set blendMode(value: BLEND_MODES)\n {\n this.blend = (value !== BLEND_MODES.NONE);\n this._blendMode = value;\n }\n\n /**\n * The polygon offset. Setting this property to anything other than 0 will automatically enable polygon offset fill.\n * @default 0\n */\n get polygonOffset(): number\n {\n return this._polygonOffset;\n }\n\n set polygonOffset(value: number)\n {\n this.offsets = !!value;\n this._polygonOffset = value;\n }\n\n // #if _DEBUG\n toString(): string\n {\n return `[@pixi/core:State `\n + `blendMode=${this.blendMode} `\n + `clockwiseFrontFace=${this.clockwiseFrontFace} `\n + `culling=${this.culling} `\n + `depthMask=${this.depthMask} `\n + `polygonOffset=${this.polygonOffset}`\n + `]`;\n }\n // #endif\n\n static for2d(): State\n {\n const state = new State();\n\n state.depthTest = false;\n state.blend = true;\n\n return state;\n }\n}\n\n","import { settings } from '@pixi/settings';\nimport { Program } from '../shader/Program';\nimport { Shader } from '../shader/Shader';\nimport { State } from '../state/State';\nimport defaultFragment from './defaultFilter.frag';\nimport defaultVertex from './defaultFilter.vert';\n\nimport type { MSAA_QUALITY, BLEND_MODES, CLEAR_MODES } from '@pixi/constants';\nimport type { Dict } from '@pixi/utils';\nimport type { RenderTexture } from '../renderTexture/RenderTexture';\nimport type { FilterState } from './FilterState';\nimport type { FilterSystem } from './FilterSystem';\n\n/**\n * A filter is a special shader that applies post-processing effects to an input texture and writes into an output\n * render-target.\n *\n * {@link http://pixijs.io/examples/#/filters/blur-filter.js Example} of the\n * {@link PIXI.filters.BlurFilter BlurFilter}.\n *\n * ### Usage\n * Filters can be applied to any DisplayObject or Container.\n * PixiJS' `FilterSystem` renders the container into temporary Framebuffer,\n * then filter renders it to the screen.\n * Multiple filters can be added to the `filters` array property and stacked on each other.\n *\n * ```\n * const filter = new PIXI.Filter(myShaderVert, myShaderFrag, { myUniform: 0.5 });\n * const container = new PIXI.Container();\n * container.filters = [filter];\n * ```\n *\n * ### Previous Version Differences\n *\n * In PixiJS **v3**, a filter was always applied to _whole screen_.\n *\n * In PixiJS **v4**, a filter can be applied _only part of the screen_.\n * Developers had to create a set of uniforms to deal with coordinates.\n *\n * In PixiJS **v5** combines _both approaches_.\n * Developers can use normal coordinates of v3 and then allow filter to use partial Framebuffers,\n * bringing those extra uniforms into account.\n *\n * Also be aware that we have changed default vertex shader, please consult\n * {@link https://github.com/pixijs/pixi.js/wiki/v5-Creating-filters Wiki}.\n *\n * ### Frames\n *\n * The following table summarizes the coordinate spaces used in the filtering pipeline:\n *\n * <table>\n * <thead>\n * <tr>\n * <th>Coordinate Space</th>\n * <th>Description</th>\n * </tr>\n * </thead>\n * <tbody>\n * <tr>\n * <td>Texture Coordinates</td>\n * <td>\n * The texture (or UV) coordinates in the input base-texture's space. These are normalized into the (0,1) range along\n * both axes.\n * </td>\n * </tr>\n * <tr>\n * <td>World Space</td>\n * <td>\n * A point in the same space as the world bounds of any display-object (i.e. in the scene graph's space).\n * </td>\n * </tr>\n * <tr>\n * <td>Physical Pixels</td>\n * <td>\n * This is base-texture's space with the origin on the top-left. You can calculate these by multiplying the texture\n * coordinates by the dimensions of the texture.\n * </td>\n * </tr>\n * </tbody>\n * </table>\n *\n * ### Built-in Uniforms\n *\n * PixiJS viewport uses screen (CSS) coordinates, `(0, 0, renderer.screen.width, renderer.screen.height)`,\n * and `projectionMatrix` uniform maps it to the gl viewport.\n *\n * **uSampler**\n *\n * The most important uniform is the input texture that container was rendered into.\n * _Important note: as with all Framebuffers in PixiJS, both input and output are\n * premultiplied by alpha._\n *\n * By default, input normalized coordinates are passed to fragment shader with `vTextureCoord`.\n * Use it to sample the input.\n *\n * ```\n * const fragment = `\n * varying vec2 vTextureCoord;\n * uniform sampler2D uSampler;\n * void main(void)\n * {\n * gl_FragColor = texture2D(uSampler, vTextureCoord);\n * }\n * `;\n *\n * const myFilter = new PIXI.Filter(null, fragment);\n * ```\n *\n * This filter is just one uniform less than {@link PIXI.filters.AlphaFilter AlphaFilter}.\n *\n * **outputFrame**\n *\n * The `outputFrame` holds the rectangle where filter is applied in screen (CSS) coordinates.\n * It's the same as `renderer.screen` for a fullscreen filter.\n * Only a part of `outputFrame.zw` size of temporary Framebuffer is used,\n * `(0, 0, outputFrame.width, outputFrame.height)`,\n *\n * Filters uses this quad to normalized (0-1) space, its passed into `aVertexPosition` attribute.\n * To calculate vertex position in screen space using normalized (0-1) space:\n *\n * ```\n * vec4 filterVertexPosition( void )\n * {\n * vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n * return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n * }\n * ```\n *\n * **inputSize**\n *\n * Temporary framebuffer is different, it can be either the size of screen, either power-of-two.\n * The `inputSize.xy` are size of temporary framebuffer that holds input.\n * The `inputSize.zw` is inverted, it's a shortcut to evade division inside the shader.\n *\n * Set `inputSize.xy = outputFrame.zw` for a fullscreen filter.\n *\n * To calculate input normalized coordinate, you have to map it to filter normalized space.\n * Multiply by `outputFrame.zw` to get input coordinate.\n * Divide by `inputSize.xy` to get input normalized coordinate.\n *\n * ```\n * vec2 filterTextureCoord( void )\n * {\n * return aVertexPosition * (outputFrame.zw * inputSize.zw); // same as /inputSize.xy\n * }\n * ```\n * **resolution**\n *\n * The `resolution` is the ratio of screen (CSS) pixels to real pixels.\n *\n * **inputPixel**\n *\n * `inputPixel.xy` is the size of framebuffer in real pixels, same as `inputSize.xy * resolution`\n * `inputPixel.zw` is inverted `inputPixel.xy`.\n *\n * It's handy for filters that use neighbour pixels, like {@link PIXI.filters.FXAAFilter FXAAFilter}.\n *\n * **inputClamp**\n *\n * If you try to get info from outside of used part of Framebuffer - you'll get undefined behaviour.\n * For displacements, coordinates has to be clamped.\n *\n * The `inputClamp.xy` is left-top pixel center, you may ignore it, because we use left-top part of Framebuffer\n * `inputClamp.zw` is bottom-right pixel center.\n *\n * ```\n * vec4 color = texture2D(uSampler, clamp(modifiedTextureCoord, inputClamp.xy, inputClamp.zw))\n * ```\n * OR\n * ```\n * vec4 color = texture2D(uSampler, min(modifigedTextureCoord, inputClamp.zw))\n * ```\n *\n * ### Additional Information\n *\n * Complete documentation on Filter usage is located in the\n * {@link https://github.com/pixijs/pixi.js/wiki/v5-Creating-filters Wiki}.\n *\n * Since PixiJS only had a handful of built-in filters, additional filters can be downloaded\n * {@link https://github.com/pixijs/pixi-filters here} from the PixiJS Filters repository.\n * @memberof PIXI\n */\nexport class Filter extends Shader\n{\n /**\n * The padding of the filter. Some filters require extra space to breath such as a blur.\n * Increasing this will add extra width and height to the bounds of the object that the\n * filter is applied to.\n */\n public padding: number;\n\n /** The samples of the filter. */\n public multisample: MSAA_QUALITY;\n\n /** If enabled is true the filter is applied, if false it will not. */\n public enabled: boolean;\n\n /**\n * If enabled, PixiJS will fit the filter area into boundaries for better performance.\n * Switch it off if it does not work for specific shader.\n * @default true\n */\n public autoFit: boolean;\n\n /**\n * Legacy filters use position and uvs from attributes (set by filter system)\n * @readonly\n */\n public legacy: boolean;\n\n /** The WebGL state the filter requires to render. */\n state: State;\n\n protected _resolution: number;\n\n /**\n * @param vertexSrc - The source of the vertex shader.\n * @param fragmentSrc - The source of the fragment shader.\n * @param uniforms - Custom uniforms to use to augment the built-in ones.\n */\n constructor(vertexSrc?: string, fragmentSrc?: string, uniforms?: Dict<any>)\n {\n const program = Program.from(vertexSrc || Filter.defaultVertexSrc,\n fragmentSrc || Filter.defaultFragmentSrc);\n\n super(program, uniforms);\n\n this.padding = 0;\n this.resolution = settings.FILTER_RESOLUTION;\n this.multisample = settings.FILTER_MULTISAMPLE;\n this.enabled = true;\n this.autoFit = true;\n this.state = new State();\n }\n\n /**\n * Applies the filter\n * @param {PIXI.FilterSystem} filterManager - The renderer to retrieve the filter from\n * @param {PIXI.RenderTexture} input - The input render target.\n * @param {PIXI.RenderTexture} output - The target to output to.\n * @param {PIXI.CLEAR_MODES} [clearMode] - Should the output be cleared before rendering to it.\n * @param {object} [_currentState] - It's current state of filter.\n * There are some useful properties in the currentState :\n * target, filters, sourceFrame, destinationFrame, renderTarget, resolution\n */\n apply(filterManager: FilterSystem, input: RenderTexture, output: RenderTexture, clearMode?: CLEAR_MODES,\n _currentState?: FilterState): void\n {\n // do as you please!\n\n filterManager.applyFilter(this, input, output, clearMode);\n\n // or just do a regular render..\n }\n\n /**\n * Sets the blend mode of the filter.\n * @default PIXI.BLEND_MODES.NORMAL\n */\n get blendMode(): BLEND_MODES\n {\n return this.state.blendMode;\n }\n\n set blendMode(value: BLEND_MODES)\n {\n this.state.blendMode = value;\n }\n\n /**\n * The resolution of the filter. Setting this to be lower will lower the quality but\n * increase the performance of the filter.\n */\n get resolution(): number\n {\n return this._resolution;\n }\n\n set resolution(value: number)\n {\n this._resolution = value;\n }\n\n /**\n * The default vertex shader source\n * @constant\n */\n static get defaultVertexSrc(): string\n {\n return defaultVertex;\n }\n\n /**\n * The default fragment shader source\n * @constant\n */\n static get defaultFragmentSrc(): string\n {\n return defaultFragment;\n }\n\n /** Used for caching shader IDs. */\n static SOURCE_KEY_MAP: Dict<string>;\n}\n","import { Matrix } from '@pixi/math';\n\nimport type { Texture } from './Texture';\n\nconst tempMat = new Matrix();\n\n/**\n * Class controls uv mapping from Texture normal space to BaseTexture normal space.\n *\n * Takes `trim` and `rotate` into account. May contain clamp settings for Meshes and TilingSprite.\n *\n * Can be used in Texture `uvMatrix` field, or separately, you can use different clamp settings on the same texture.\n * If you want to add support for texture region of certain feature or filter, that's what you're looking for.\n *\n * Takes track of Texture changes through `_lastTextureID` private field.\n * Use `update()` method call to track it from outside.\n * @see PIXI.Texture\n * @see PIXI.Mesh\n * @see PIXI.TilingSprite\n * @memberof PIXI\n */\nexport class TextureMatrix\n{\n /**\n * Matrix operation that converts texture region coords to texture coords\n * @readonly\n */\n public mapCoord: Matrix;\n\n /**\n * Changes frame clamping\n * Works with TilingSprite and Mesh\n * Change to 1.5 if you texture has repeated right and bottom lines, that leads to smoother borders\n * @default 0\n */\n public clampOffset: number;\n\n /**\n * Changes frame clamping\n * Works with TilingSprite and Mesh\n * Change to -0.5 to add a pixel to the edge, recommended for transparent trimmed textures in atlas\n * @default 0.5\n */\n public clampMargin: number;\n\n /**\n * Clamp region for normalized coords, left-top pixel center in xy , bottom-right in zw.\n * Calculated based on clampOffset.\n */\n readonly uClampFrame: Float32Array;\n\n /** Normalized clamp offset. Calculated based on clampOffset. */\n readonly uClampOffset: Float32Array;\n\n /**\n * Tracks Texture frame changes.\n * @protected\n */\n _textureID: number;\n\n /**\n * Tracks Texture frame changes.\n * @protected\n */\n _updateID: number;\n _texture: Texture;\n\n /**\n * If texture size is the same as baseTexture.\n * @default false\n * @readonly\n */\n isSimple: boolean;\n\n /**\n * @param texture - observed texture\n * @param clampMargin - Changes frame clamping, 0.5 by default. Use -0.5 for extra border.\n */\n constructor(texture: Texture, clampMargin?: number)\n {\n this._texture = texture;\n\n this.mapCoord = new Matrix();\n this.uClampFrame = new Float32Array(4);\n this.uClampOffset = new Float32Array(2);\n this._textureID = -1;\n this._updateID = 0;\n\n this.clampOffset = 0;\n this.clampMargin = (typeof clampMargin === 'undefined') ? 0.5 : clampMargin;\n this.isSimple = false;\n }\n\n /** Texture property. */\n get texture(): Texture\n {\n return this._texture;\n }\n\n set texture(value: Texture)\n {\n this._texture = value;\n this._textureID = -1;\n }\n\n /**\n * Multiplies uvs array to transform\n * @param uvs - mesh uvs\n * @param [out=uvs] - output\n * @returns - output\n */\n multiplyUvs(uvs: Float32Array, out?: Float32Array): Float32Array\n {\n if (out === undefined)\n {\n out = uvs;\n }\n\n const mat = this.mapCoord;\n\n for (let i = 0; i < uvs.length; i += 2)\n {\n const x = uvs[i];\n const y = uvs[i + 1];\n\n out[i] = (x * mat.a) + (y * mat.c) + mat.tx;\n out[i + 1] = (x * mat.b) + (y * mat.d) + mat.ty;\n }\n\n return out;\n }\n\n /**\n * Updates matrices if texture was changed.\n * @param [forceUpdate=false] - if true, matrices will be updated any case\n * @returns - Whether or not it was updated\n */\n update(forceUpdate?: boolean): boolean\n {\n const tex = this._texture;\n\n if (!tex || !tex.valid)\n {\n return false;\n }\n\n if (!forceUpdate\n && this._textureID === tex._updateID)\n {\n return false;\n }\n\n this._textureID = tex._updateID;\n this._updateID++;\n\n const uvs = tex._uvs;\n\n this.mapCoord.set(uvs.x1 - uvs.x0, uvs.y1 - uvs.y0, uvs.x3 - uvs.x0, uvs.y3 - uvs.y0, uvs.x0, uvs.y0);\n\n const orig = tex.orig;\n const trim = tex.trim;\n\n if (trim)\n {\n tempMat.set(orig.width / trim.width, 0, 0, orig.height / trim.height,\n -trim.x / trim.width, -trim.y / trim.height);\n this.mapCoord.append(tempMat);\n }\n\n const texBase = tex.baseTexture;\n const frame = this.uClampFrame;\n const margin = this.clampMargin / texBase.resolution;\n const offset = this.clampOffset;\n\n frame[0] = (tex._frame.x + margin + offset) / texBase.width;\n frame[1] = (tex._frame.y + margin + offset) / texBase.height;\n frame[2] = (tex._frame.x + tex._frame.width - margin + offset) / texBase.width;\n frame[3] = (tex._frame.y + tex._frame.height - margin + offset) / texBase.height;\n this.uClampOffset[0] = offset / texBase.realWidth;\n this.uClampOffset[1] = offset / texBase.realHeight;\n\n this.isSimple = tex._frame.width === texBase.width\n && tex._frame.height === texBase.height\n && tex.rotate === 0;\n\n return true;\n }\n}\n","import { Filter } from '../Filter';\nimport type { Point } from '@pixi/math';\nimport { Matrix } from '@pixi/math';\nimport type { CLEAR_MODES } from '@pixi/constants';\nimport vertex from './spriteMaskFilter.vert';\nimport fragment from './spriteMaskFilter.frag';\nimport { TextureMatrix } from '../../textures/TextureMatrix';\n\nimport type { FilterSystem } from '../FilterSystem';\nimport type { IMaskTarget } from '../../mask/MaskData';\nimport type { Texture } from '../../textures/Texture';\nimport type { RenderTexture } from '../../renderTexture/RenderTexture';\nimport type { Dict } from '@pixi/utils';\n\nexport interface ISpriteMaskTarget extends IMaskTarget\n{\n _texture: Texture;\n worldAlpha: number;\n anchor: Point;\n}\n\nexport interface ISpriteMaskFilter extends Filter\n{\n maskSprite: IMaskTarget;\n}\n\n/**\n * This handles a Sprite acting as a mask, as opposed to a Graphic.\n *\n * WebGL only.\n * @memberof PIXI\n */\nexport class SpriteMaskFilter extends Filter\n{\n /** @private */\n _maskSprite: IMaskTarget;\n\n /** Mask matrix */\n maskMatrix: Matrix;\n\n /**\n * @param {PIXI.Sprite} sprite - The target sprite.\n */\n constructor(sprite: IMaskTarget);\n\n /**\n * @param vertexSrc - The source of the vertex shader.\n * @param fragmentSrc - The source of the fragment shader.\n * @param uniforms - Custom uniforms to use to augment the built-in ones.\n */\n constructor(vertexSrc?: string, fragmentSrc?: string, uniforms?: Dict<any>);\n\n /** @ignore */\n constructor(vertexSrc?: string | IMaskTarget, fragmentSrc?: string, uniforms?: Dict<any>)\n {\n let sprite = null;\n\n if (typeof vertexSrc !== 'string' && fragmentSrc === undefined && uniforms === undefined)\n {\n sprite = vertexSrc as IMaskTarget;\n vertexSrc = undefined;\n fragmentSrc = undefined;\n uniforms = undefined;\n }\n\n super(vertexSrc as string || vertex, fragmentSrc || fragment, uniforms);\n\n this.maskSprite = sprite;\n this.maskMatrix = new Matrix();\n }\n\n /**\n * Sprite mask\n * @type {PIXI.DisplayObject}\n */\n get maskSprite(): IMaskTarget\n {\n return this._maskSprite;\n }\n\n set maskSprite(value: IMaskTarget)\n {\n this._maskSprite = value;\n\n if (this._maskSprite)\n {\n this._maskSprite.renderable = false;\n }\n }\n\n /**\n * Applies the filter\n * @param filterManager - The renderer to retrieve the filter from\n * @param input - The input render target.\n * @param output - The target to output to.\n * @param clearMode - Should the output be cleared before rendering to it.\n */\n apply(filterManager: FilterSystem, input: RenderTexture, output: RenderTexture, clearMode: CLEAR_MODES): void\n {\n const maskSprite = this._maskSprite as ISpriteMaskTarget;\n const tex = maskSprite._texture;\n\n if (!tex.valid)\n {\n return;\n }\n if (!tex.uvMatrix)\n {\n // margin = 0.0, let it bleed a bit, shader code becomes easier\n // assuming that atlas textures were made with 1-pixel padding\n tex.uvMatrix = new TextureMatrix(tex, 0.0);\n }\n tex.uvMatrix.update();\n\n this.uniforms.npmAlpha = tex.baseTexture.alphaMode ? 0.0 : 1.0;\n this.uniforms.mask = tex;\n // get _normalized sprite texture coords_ and convert them to _normalized atlas texture coords_ with `prepend`\n this.uniforms.otherMatrix = filterManager.calculateSpriteMatrix(this.maskMatrix, maskSprite)\n .prepend(tex.uvMatrix.mapCoord);\n this.uniforms.alpha = maskSprite.worldAlpha;\n this.uniforms.maskClamp = tex.uvMatrix.uClampFrame;\n\n filterManager.applyFilter(this, input, output, clearMode);\n }\n}\n","import { MaskData } from './MaskData';\nimport { SpriteMaskFilter } from '../filters/spriteMask/SpriteMaskFilter';\nimport { MASK_TYPES } from '@pixi/constants';\n\nimport type { ISystem } from '../ISystem';\nimport type { IMaskTarget } from './MaskData';\nimport type { Renderer } from '../Renderer';\n\n/**\n * System plugin to the renderer to manage masks.\n *\n * There are three built-in types of masking:\n * **Scissor Masking**: Scissor masking discards pixels that are outside of a rectangle called the scissor box. It is\n * the most performant as the scissor test is inexpensive. However, it can only be used when the mask is rectangular.\n * **Stencil Masking**: Stencil masking discards pixels that don't overlap with the pixels rendered into the stencil\n * buffer. It is the next fastest option as it does not require rendering into a separate framebuffer. However, it does\n * cause the mask to be rendered **twice** for each masking operation; hence, minimize the rendering cost of your masks.\n * **Sprite Mask Filtering**: Sprite mask filtering discards pixels based on the red channel of the sprite-mask's\n * texture. (Generally, the masking texture is grayscale). Using advanced techniques, you might be able to embed this\n * type of masking in a custom shader - and hence, bypassing the masking system fully for performance wins.\n *\n * The best type of masking is auto-detected when you `push` one. To use scissor masking, you must pass in a `Graphics`\n * object with just a rectangle drawn.\n *\n * ## Mask Stacks\n *\n * In the scene graph, masks can be applied recursively, i.e. a mask can be applied during a masking operation. The mask\n * stack stores the currently applied masks in order. Each {@link PIXI.BaseRenderTexture} holds its own mask stack, i.e.\n * when you switch render-textures, the old masks only applied when you switch back to rendering to the old render-target.\n * @memberof PIXI\n */\nexport class MaskSystem implements ISystem\n{\n /**\n * Flag to enable scissor masking.\n * @default true\n */\n public enableScissor: boolean;\n\n /** Pool of used sprite mask filters. */\n protected readonly alphaMaskPool: Array<SpriteMaskFilter[]>;\n\n /**\n * Current index of alpha mask pool.\n * @default 0\n * @readonly\n */\n protected alphaMaskIndex: number;\n\n /** Pool of mask data. */\n private readonly maskDataPool: Array<MaskData>;\n private maskStack: Array<MaskData>;\n private renderer: Renderer;\n\n /**\n * @param renderer - The renderer this System works for.\n */\n constructor(renderer: Renderer)\n {\n this.renderer = renderer;\n\n this.enableScissor = true;\n this.alphaMaskPool = [];\n this.maskDataPool = [];\n\n this.maskStack = [];\n this.alphaMaskIndex = 0;\n }\n\n /**\n * Changes the mask stack that is used by this System.\n * @param maskStack - The mask stack\n */\n setMaskStack(maskStack: Array<MaskData>): void\n {\n this.maskStack = maskStack;\n this.renderer.scissor.setMaskStack(maskStack);\n this.renderer.stencil.setMaskStack(maskStack);\n }\n\n /**\n * Enables the mask and appends it to the current mask stack.\n *\n * NOTE: The batch renderer should be flushed beforehand to prevent pending renders from being masked.\n * @param {PIXI.DisplayObject} target - Display Object to push the mask to\n * @param {PIXI.MaskData|PIXI.Sprite|PIXI.Graphics|PIXI.DisplayObject} maskDataOrTarget - The masking data.\n */\n push(target: IMaskTarget, maskDataOrTarget: MaskData | IMaskTarget): void\n {\n let maskData = maskDataOrTarget as MaskData;\n\n if (!maskData.isMaskData)\n {\n const d = this.maskDataPool.pop() || new MaskData();\n\n d.pooled = true;\n d.maskObject = maskDataOrTarget as IMaskTarget;\n maskData = d;\n }\n\n const maskAbove = this.maskStack.length !== 0 ? this.maskStack[this.maskStack.length - 1] : null;\n\n maskData.copyCountersOrReset(maskAbove);\n maskData._colorMask = maskAbove ? maskAbove._colorMask : 0xf;\n\n if (maskData.autoDetect)\n {\n this.detect(maskData);\n }\n\n maskData._target = target;\n\n if (maskData.type !== MASK_TYPES.SPRITE)\n {\n this.maskStack.push(maskData);\n }\n\n if (maskData.enabled)\n {\n switch (maskData.type)\n {\n case MASK_TYPES.SCISSOR:\n this.renderer.scissor.push(maskData);\n break;\n case MASK_TYPES.STENCIL:\n this.renderer.stencil.push(maskData);\n break;\n case MASK_TYPES.SPRITE:\n maskData.copyCountersOrReset(null);\n this.pushSpriteMask(maskData);\n break;\n case MASK_TYPES.COLOR:\n this.pushColorMask(maskData);\n break;\n default:\n break;\n }\n }\n\n if (maskData.type === MASK_TYPES.SPRITE)\n {\n this.maskStack.push(maskData);\n }\n }\n\n /**\n * Removes the last mask from the mask stack and doesn't return it.\n *\n * NOTE: The batch renderer should be flushed beforehand to render the masked contents before the mask is removed.\n * @param {PIXI.IMaskTarget} target - Display Object to pop the mask from\n */\n pop(target: IMaskTarget): void\n {\n const maskData = this.maskStack.pop();\n\n if (!maskData || maskData._target !== target)\n {\n // TODO: add an assert when we have it\n\n return;\n }\n\n if (maskData.enabled)\n {\n switch (maskData.type)\n {\n case MASK_TYPES.SCISSOR:\n this.renderer.scissor.pop(maskData);\n break;\n case MASK_TYPES.STENCIL:\n this.renderer.stencil.pop(maskData.maskObject);\n break;\n case MASK_TYPES.SPRITE:\n this.popSpriteMask(maskData);\n break;\n case MASK_TYPES.COLOR:\n this.popColorMask(maskData);\n break;\n default:\n break;\n }\n }\n\n maskData.reset();\n\n if (maskData.pooled)\n {\n this.maskDataPool.push(maskData);\n }\n\n if (this.maskStack.length !== 0)\n {\n const maskCurrent = this.maskStack[this.maskStack.length - 1];\n\n if (maskCurrent.type === MASK_TYPES.SPRITE && maskCurrent._filters)\n {\n maskCurrent._filters[0].maskSprite = maskCurrent.maskObject;\n }\n }\n }\n\n /**\n * Sets type of MaskData based on its maskObject.\n * @param maskData\n */\n detect(maskData: MaskData): void\n {\n const maskObject = maskData.maskObject;\n\n if (!maskObject)\n {\n maskData.type = MASK_TYPES.COLOR;\n }\n else if (maskObject.isSprite)\n {\n maskData.type = MASK_TYPES.SPRITE;\n }\n else if (this.enableScissor && this.renderer.scissor.testScissor(maskData))\n {\n maskData.type = MASK_TYPES.SCISSOR;\n }\n else\n {\n maskData.type = MASK_TYPES.STENCIL;\n }\n }\n\n /**\n * Applies the Mask and adds it to the current filter stack.\n * @param maskData - Sprite to be used as the mask.\n */\n pushSpriteMask(maskData: MaskData): void\n {\n const { maskObject } = maskData;\n const target = maskData._target;\n let alphaMaskFilter = maskData._filters;\n\n if (!alphaMaskFilter)\n {\n alphaMaskFilter = this.alphaMaskPool[this.alphaMaskIndex];\n\n if (!alphaMaskFilter)\n {\n alphaMaskFilter = this.alphaMaskPool[this.alphaMaskIndex] = [new SpriteMaskFilter()];\n }\n }\n\n const renderer = this.renderer;\n const renderTextureSystem = renderer.renderTexture;\n\n let resolution;\n let multisample;\n\n if (renderTextureSystem.current)\n {\n const renderTexture = renderTextureSystem.current;\n\n resolution = maskData.resolution || renderTexture.resolution;\n multisample = maskData.multisample ?? renderTexture.multisample;\n }\n else\n {\n resolution = maskData.resolution || renderer.resolution;\n multisample = maskData.multisample ?? renderer.multisample;\n }\n\n alphaMaskFilter[0].resolution = resolution;\n alphaMaskFilter[0].multisample = multisample;\n alphaMaskFilter[0].maskSprite = maskObject;\n\n const stashFilterArea = target.filterArea;\n\n target.filterArea = maskObject.getBounds(true);\n renderer.filter.push(target, alphaMaskFilter);\n target.filterArea = stashFilterArea;\n\n if (!maskData._filters)\n {\n this.alphaMaskIndex++;\n }\n }\n\n /**\n * Removes the last filter from the filter stack and doesn't return it.\n * @param maskData - Sprite to be used as the mask.\n */\n popSpriteMask(maskData: MaskData): void\n {\n this.renderer.filter.pop();\n\n if (maskData._filters)\n {\n maskData._filters[0].maskSprite = null;\n }\n else\n {\n this.alphaMaskIndex--;\n this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite = null;\n }\n }\n\n /**\n * Pushes the color mask.\n * @param maskData - The mask data\n */\n pushColorMask(maskData: MaskData): void\n {\n const currColorMask = maskData._colorMask;\n const nextColorMask = maskData._colorMask = currColorMask & maskData.colorMask;\n\n if (nextColorMask !== currColorMask)\n {\n this.renderer.gl.colorMask(\n (nextColorMask & 0x1) !== 0,\n (nextColorMask & 0x2) !== 0,\n (nextColorMask & 0x4) !== 0,\n (nextColorMask & 0x8) !== 0\n );\n }\n }\n\n /**\n * Pops the color mask.\n * @param maskData - The mask data\n */\n popColorMask(maskData: MaskData): void\n {\n const currColorMask = maskData._colorMask;\n const nextColorMask = this.maskStack.length > 0\n ? this.maskStack[this.maskStack.length - 1]._colorMask : 0xf;\n\n if (nextColorMask !== currColorMask)\n {\n this.renderer.gl.colorMask(\n (nextColorMask & 0x1) !== 0,\n (nextColorMask & 0x2) !== 0,\n (nextColorMask & 0x4) !== 0,\n (nextColorMask & 0x8) !== 0\n );\n }\n }\n\n destroy(): void\n {\n this.renderer = null;\n }\n}\n","import type { ISystem } from '../ISystem';\nimport type { MaskData } from './MaskData';\nimport type { Renderer } from '../Renderer';\n\n/**\n * System plugin to the renderer to manage specific types of masking operations.\n * @memberof PIXI\n */\nexport class AbstractMaskSystem implements ISystem\n{\n /**\n * The mask stack\n * @member {PIXI.MaskData[]}\n */\n protected maskStack: Array<MaskData>;\n\n /**\n * Constant for gl.enable\n * @private\n */\n protected glConst: number;\n protected renderer: Renderer;\n\n /**\n * @param renderer - The renderer this System works for.\n */\n constructor(renderer: Renderer)\n {\n this.renderer = renderer;\n\n this.maskStack = [];\n this.glConst = 0;\n }\n\n /** Gets count of masks of certain type. */\n getStackLength(): number\n {\n return this.maskStack.length;\n }\n\n /**\n * Changes the mask stack that is used by this System.\n * @param {PIXI.MaskData[]} maskStack - The mask stack\n */\n setMaskStack(maskStack: Array<MaskData>): void\n {\n const { gl } = this.renderer;\n const curStackLen = this.getStackLength();\n\n this.maskStack = maskStack;\n\n const newStackLen = this.getStackLength();\n\n if (newStackLen !== curStackLen)\n {\n if (newStackLen === 0)\n {\n gl.disable(this.glConst);\n }\n else\n {\n gl.enable(this.glConst);\n this._useCurrent();\n }\n }\n }\n\n /**\n * Setup renderer to use the current mask data.\n * @private\n */\n protected _useCurrent(): void\n {\n // OVERWRITE;\n }\n\n /** Destroys the mask stack. */\n destroy(): void\n {\n this.renderer = null;\n this.maskStack = null;\n }\n}\n","import { AbstractMaskSystem } from './AbstractMaskSystem';\n\nimport type { Renderer } from '../Renderer';\nimport type { MaskData } from './MaskData';\nimport { Matrix, Rectangle } from '@pixi/math';\nimport { settings } from '@pixi/settings';\n\nconst tempMatrix = new Matrix();\nconst rectPool: Rectangle[] = [];\n\n/**\n * System plugin to the renderer to manage scissor masking.\n *\n * Scissor masking discards pixels outside of a rectangle called the scissor box. The scissor box is in the framebuffer\n * viewport's space; however, the mask's rectangle is projected from world-space to viewport space automatically\n * by this system.\n * @memberof PIXI\n */\nexport class ScissorSystem extends AbstractMaskSystem\n{\n /**\n * @param {PIXI.Renderer} renderer - The renderer this System works for.\n */\n constructor(renderer: Renderer)\n {\n super(renderer);\n\n this.glConst = settings.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST;\n }\n\n getStackLength(): number\n {\n const maskData = this.maskStack[this.maskStack.length - 1];\n\n if (maskData)\n {\n return maskData._scissorCounter;\n }\n\n return 0;\n }\n\n /**\n * evaluates _boundsTransformed, _scissorRect for MaskData\n * @param maskData\n */\n calcScissorRect(maskData: MaskData): void\n {\n if (maskData._scissorRectLocal)\n {\n return;\n }\n\n const prevData = maskData._scissorRect;\n const { maskObject } = maskData;\n const { renderer } = this;\n const renderTextureSystem = renderer.renderTexture;\n const rect = maskObject.getBounds(true, rectPool.pop() ?? new Rectangle());\n\n this.roundFrameToPixels(rect,\n renderTextureSystem.current ? renderTextureSystem.current.resolution : renderer.resolution,\n renderTextureSystem.sourceFrame,\n renderTextureSystem.destinationFrame,\n renderer.projection.transform);\n\n if (prevData)\n {\n rect.fit(prevData);\n }\n maskData._scissorRectLocal = rect;\n }\n\n private static isMatrixRotated(matrix: Matrix)\n {\n if (!matrix)\n {\n return false;\n }\n const { a, b, c, d } = matrix;\n\n // Skip if skew/rotation present in matrix, except for multiple of 90° rotation. If rotation\n // is a multiple of 90°, then either pair of (b,c) or (a,d) will be (0,0).\n return ((Math.abs(b) > 1e-4 || Math.abs(c) > 1e-4)\n && (Math.abs(a) > 1e-4 || Math.abs(d) > 1e-4));\n }\n\n /**\n * Test, whether the object can be scissor mask with current renderer projection.\n * Calls \"calcScissorRect()\" if its true.\n * @param maskData - mask data\n * @returns whether Whether the object can be scissor mask\n */\n public testScissor(maskData: MaskData): boolean\n {\n const { maskObject } = maskData;\n\n if (!maskObject.isFastRect || !maskObject.isFastRect())\n {\n return false;\n }\n if (ScissorSystem.isMatrixRotated(maskObject.worldTransform))\n {\n return false;\n }\n if (ScissorSystem.isMatrixRotated(this.renderer.projection.transform))\n {\n return false;\n }\n\n this.calcScissorRect(maskData);\n\n const rect = maskData._scissorRectLocal;\n\n return rect.width > 0 && rect.height > 0;\n }\n\n private roundFrameToPixels(\n frame: Rectangle,\n resolution: number,\n bindingSourceFrame: Rectangle,\n bindingDestinationFrame: Rectangle,\n transform?: Matrix,\n )\n {\n if (ScissorSystem.isMatrixRotated(transform))\n {\n return;\n }\n\n transform = transform ? tempMatrix.copyFrom(transform) : tempMatrix.identity();\n\n // Get forward transform from world space to screen space\n transform\n .translate(-bindingSourceFrame.x, -bindingSourceFrame.y)\n .scale(\n bindingDestinationFrame.width / bindingSourceFrame.width,\n bindingDestinationFrame.height / bindingSourceFrame.height)\n .translate(bindingDestinationFrame.x, bindingDestinationFrame.y);\n\n // Convert frame to screen space\n (this.renderer.filter as any).transformAABB(transform, frame);\n\n frame.fit(bindingDestinationFrame);\n frame.x = Math.round(frame.x * resolution);\n frame.y = Math.round(frame.y * resolution);\n frame.width = Math.round(frame.width * resolution);\n frame.height = Math.round(frame.height * resolution);\n }\n\n /**\n * Applies the Mask and adds it to the current stencil stack.\n * @author alvin\n * @param maskData - The mask data.\n */\n push(maskData: MaskData): void\n {\n if (!maskData._scissorRectLocal)\n {\n this.calcScissorRect(maskData);\n }\n\n const { gl } = this.renderer;\n\n if (!maskData._scissorRect)\n {\n gl.enable(gl.SCISSOR_TEST);\n }\n\n maskData._scissorCounter++;\n maskData._scissorRect = maskData._scissorRectLocal;\n this._useCurrent();\n }\n\n /**\n * This should be called after a mask is popped off the mask stack. It will rebind the scissor box to be latest with the\n * last mask in the stack.\n *\n * This can also be called when you directly modify the scissor box and want to restore PixiJS state.\n * @param maskData - The mask data.\n */\n pop(maskData?: MaskData): void\n {\n const { gl } = this.renderer;\n\n if (maskData)\n {\n rectPool.push(maskData._scissorRectLocal);\n }\n\n if (this.getStackLength() > 0)\n {\n this._useCurrent();\n }\n else\n {\n gl.disable(gl.SCISSOR_TEST);\n }\n }\n\n /**\n * Setup renderer to use the current scissor data.\n * @private\n */\n _useCurrent(): void\n {\n const rect = this.maskStack[this.maskStack.length - 1]._scissorRect;\n let y: number;\n\n if (this.renderer.renderTexture.current)\n {\n y = rect.y;\n }\n else\n {\n // flipY. In future we'll have it over renderTextures as an option\n y = this.renderer.height - rect.height - rect.y;\n }\n\n this.renderer.gl.scissor(rect.x, y, rect.width, rect.height);\n }\n}\n","import { AbstractMaskSystem } from './AbstractMaskSystem';\n\nimport type { Renderer } from '../Renderer';\nimport type { IMaskTarget, MaskData } from './MaskData';\nimport { settings } from '@pixi/settings';\n\n/**\n * System plugin to the renderer to manage stencils (used for masks).\n * @memberof PIXI\n */\nexport class StencilSystem extends AbstractMaskSystem\n{\n /**\n * @param renderer - The renderer this System works for.\n */\n constructor(renderer: Renderer)\n {\n super(renderer);\n\n this.glConst = settings.ADAPTER.getWebGLRenderingContext().STENCIL_TEST;\n }\n\n getStackLength(): number\n {\n const maskData = this.maskStack[this.maskStack.length - 1];\n\n if (maskData)\n {\n return maskData._stencilCounter;\n }\n\n return 0;\n }\n\n /**\n * Applies the Mask and adds it to the current stencil stack.\n * @param maskData - The mask data\n */\n push(maskData: MaskData): void\n {\n const maskObject = maskData.maskObject;\n const { gl } = this.renderer;\n const prevMaskCount = maskData._stencilCounter;\n\n if (prevMaskCount === 0)\n {\n // force use stencil texture in current framebuffer\n this.renderer.framebuffer.forceStencil();\n gl.clearStencil(0);\n gl.clear(gl.STENCIL_BUFFER_BIT);\n gl.enable(gl.STENCIL_TEST);\n }\n\n maskData._stencilCounter++;\n\n const colorMask = maskData._colorMask;\n\n if (colorMask !== 0)\n {\n maskData._colorMask = 0;\n gl.colorMask(false, false, false, false);\n }\n\n // Increment the reference stencil value where the new mask overlaps with the old ones.\n gl.stencilFunc(gl.EQUAL, prevMaskCount, 0xFFFFFFFF);\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.INCR);\n\n maskObject.renderable = true;\n maskObject.render(this.renderer);\n this.renderer.batch.flush();\n maskObject.renderable = false;\n\n if (colorMask !== 0)\n {\n maskData._colorMask = colorMask;\n gl.colorMask(\n (colorMask & 1) !== 0,\n (colorMask & 2) !== 0,\n (colorMask & 4) !== 0,\n (colorMask & 8) !== 0\n );\n }\n\n this._useCurrent();\n }\n\n /**\n * Pops stencil mask. MaskData is already removed from stack\n * @param {PIXI.DisplayObject} maskObject - object of popped mask data\n */\n pop(maskObject: IMaskTarget): void\n {\n const gl = this.renderer.gl;\n\n if (this.getStackLength() === 0)\n {\n // the stack is empty!\n gl.disable(gl.STENCIL_TEST);\n }\n else\n {\n const maskData = this.maskStack.length !== 0 ? this.maskStack[this.maskStack.length - 1] : null;\n const colorMask = maskData ? maskData._colorMask : 0xf;\n\n if (colorMask !== 0)\n {\n maskData._colorMask = 0;\n gl.colorMask(false, false, false, false);\n }\n\n // Decrement the reference stencil value where the popped mask overlaps with the other ones\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.DECR);\n\n maskObject.renderable = true;\n maskObject.render(this.renderer);\n this.renderer.batch.flush();\n maskObject.renderable = false;\n\n if (colorMask !== 0)\n {\n maskData._colorMask = colorMask;\n gl.colorMask(\n (colorMask & 0x1) !== 0,\n (colorMask & 0x2) !== 0,\n (colorMask & 0x4) !== 0,\n (colorMask & 0x8) !== 0\n );\n }\n\n this._useCurrent();\n }\n }\n\n /**\n * Setup renderer to use the current stencil data.\n * @private\n */\n _useCurrent(): void\n {\n const gl = this.renderer.gl;\n\n gl.stencilFunc(gl.EQUAL, this.getStackLength(), 0xFFFFFFFF);\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP);\n }\n}\n","import { Matrix } from '@pixi/math';\n\nimport type { ISystem } from '../ISystem';\nimport type { Rectangle } from '@pixi/math';\nimport type { Renderer } from '../Renderer';\n\n/**\n * System plugin to the renderer to manage the projection matrix.\n *\n * The `projectionMatrix` is a global uniform provided to all shaders. It is used to transform points in world space to\n * normalized device coordinates.\n * @memberof PIXI\n */\nexport class ProjectionSystem implements ISystem\n{\n /**\n * The destination frame used to calculate the current projection matrix.\n *\n * The destination frame is the rectangle in the render-target into which contents are rendered. If rendering\n * to the screen, the origin is on the top-left. If rendering to a framebuffer, the origin is on the\n * bottom-left. This \"flipping\" phenomenon is because of WebGL convention for (shader) texture coordinates, where\n * the bottom-left corner is (0,0). It allows display-objects to map their (0,0) position in local-space (top-left)\n * to (0,0) in texture space (bottom-left). In other words, a sprite's top-left corner actually renders the\n * texture's bottom-left corner. You will also notice this when using a tool like SpectorJS to view your textures\n * at runtime.\n *\n * The destination frame's dimensions (width,height) should be equal to the source frame. This is because,\n * otherwise, the contents will be scaled to fill the destination frame. Similarly, the destination frame's (x,y)\n * coordinates are (0,0) unless you know what you're doing.\n * @readonly\n */\n public destinationFrame: Rectangle;\n\n /**\n * The source frame used to calculate the current projection matrix.\n *\n * The source frame is the rectangle in world space containing the contents to be rendered.\n * @readonly\n */\n public sourceFrame: Rectangle;\n\n /**\n * Default destination frame\n *\n * This is not used internally. It is not advised to use this feature specifically unless you know what\n * you're doing. The `update` method will default to this frame if you do not pass the destination frame.\n * @readonly\n */\n public defaultFrame: Rectangle;\n\n /**\n * Projection matrix\n *\n * This matrix can be used to transform points from world space to normalized device coordinates, and is calculated\n * from the sourceFrame → destinationFrame mapping provided.\n *\n * The renderer's `globalUniforms` keeps a reference to this, and so it is available for all shaders to use as a\n * uniform.\n * @readonly\n */\n public projectionMatrix: Matrix;\n\n /**\n * A transform to be appended to the projection matrix.\n *\n * This can be used to transform points in world-space one last time before they are outputted by the shader. You can\n * use to rotate the whole scene, for example. Remember to clear it once you've rendered everything.\n * @member {PIXI.Matrix}\n */\n public transform: Matrix;\n\n private renderer: Renderer;\n\n /** @param renderer - The renderer this System works for. */\n constructor(renderer: Renderer)\n {\n this.renderer = renderer;\n\n this.destinationFrame = null;\n this.sourceFrame = null;\n this.defaultFrame = null;\n this.projectionMatrix = new Matrix();\n this.transform = null;\n }\n\n /**\n * Updates the projection-matrix based on the sourceFrame → destinationFrame mapping provided.\n *\n * NOTE: It is expected you call `renderer.framebuffer.setViewport(destinationFrame)` after this. This is because\n * the framebuffer viewport converts shader vertex output in normalized device coordinates to window coordinates.\n *\n * NOTE-2: {@link RenderTextureSystem#bind} updates the projection-matrix when you bind a render-texture. It is expected\n * that you dirty the current bindings when calling this manually.\n * @param destinationFrame - The rectangle in the render-target to render the contents into. If rendering to the canvas,\n * the origin is on the top-left; if rendering to a render-texture, the origin is on the bottom-left.\n * @param sourceFrame - The rectangle in world space that contains the contents being rendered.\n * @param resolution - The resolution of the render-target, which is the ratio of\n * world-space (or CSS) pixels to physical pixels.\n * @param root - Whether the render-target is the screen. This is required because rendering to textures\n * is y-flipped (i.e. upside down relative to the screen).\n */\n update(destinationFrame: Rectangle, sourceFrame: Rectangle, resolution: number, root: boolean): void\n {\n this.destinationFrame = destinationFrame || this.destinationFrame || this.defaultFrame;\n this.sourceFrame = sourceFrame || this.sourceFrame || destinationFrame;\n\n // Calculate object-space to clip-space projection\n this.calculateProjection(this.destinationFrame, this.sourceFrame, resolution, root);\n\n if (this.transform)\n {\n this.projectionMatrix.append(this.transform);\n }\n\n const renderer = this.renderer;\n\n renderer.globalUniforms.uniforms.projectionMatrix = this.projectionMatrix;\n renderer.globalUniforms.update();\n\n // this will work for now\n // but would be sweet to stick and even on the global uniforms..\n if (renderer.shader.shader)\n {\n renderer.shader.syncUniformGroup(renderer.shader.shader.uniforms.globals);\n }\n }\n\n /**\n * Calculates the `projectionMatrix` to map points inside `sourceFrame` to inside `destinationFrame`.\n * @param _destinationFrame - The destination frame in the render-target.\n * @param sourceFrame - The source frame in world space.\n * @param _resolution - The render-target's resolution, i.e. ratio of CSS to physical pixels.\n * @param root - Whether rendering into the screen. Otherwise, if rendering to a framebuffer, the projection\n * is y-flipped.\n */\n calculateProjection(_destinationFrame: Rectangle, sourceFrame: Rectangle, _resolution: number, root: boolean): void\n {\n const pm = this.projectionMatrix;\n const sign = !root ? 1 : -1;\n\n pm.identity();\n\n pm.a = (1 / sourceFrame.width * 2);\n pm.d = sign * (1 / sourceFrame.height * 2);\n\n pm.tx = -1 - (sourceFrame.x * pm.a);\n pm.ty = -sign - (sourceFrame.y * pm.d);\n }\n\n /**\n * Sets the transform of the active render target to the given matrix.\n * @param _matrix - The transformation matrix\n */\n setTransform(_matrix: Matrix): void\n {\n // this._activeRenderTarget.transform = matrix;\n }\n\n destroy(): void\n {\n this.renderer = null;\n }\n}\n","import { Rectangle } from '@pixi/math';\nimport type { BUFFER_BITS } from '@pixi/constants';\n\nimport type { ISystem } from '../ISystem';\nimport type { Renderer } from '../Renderer';\nimport type { RenderTexture } from './RenderTexture';\nimport type { BaseRenderTexture } from './BaseRenderTexture';\nimport type { MaskData } from '../mask/MaskData';\nimport type { ISize } from '@pixi/math';\n\n// Temporary rectangle for assigned sourceFrame or destinationFrame\nconst tempRect = new Rectangle();\n\n// Temporary rectangle for renderTexture destinationFrame\nconst tempRect2 = new Rectangle();\n\n/* eslint-disable max-len */\n/**\n * System plugin to the renderer to manage render textures.\n *\n * Should be added after FramebufferSystem\n *\n * ### Frames\n *\n * The `RenderTextureSystem` holds a sourceFrame → destinationFrame projection. The following table explains the different\n * coordinate spaces used:\n *\n * | Frame | Description | Coordinate System |\n * | ---------------------- | ---------------------------------------------------------------- | ------------------------------------------------------- |\n * | sourceFrame | The rectangle inside of which display-objects are being rendered | **World Space**: The origin on the top-left |\n * | destinationFrame | The rectangle in the render-target (canvas or texture) into which contents should be rendered | If rendering to the canvas, this is in screen space and the origin is on the top-left. If rendering to a render-texture, this is in its base-texture's space with the origin on the bottom-left. |\n * | viewportFrame | The framebuffer viewport corresponding to the destination-frame | **Window Coordinates**: The origin is always on the bottom-left. |\n * @memberof PIXI\n */\nexport class RenderTextureSystem implements ISystem\n{\n/* eslint-enable max-len */\n\n /** The clear background color as RGBA. */\n public clearColor: number[];\n\n /**\n * List of masks for the {@link PIXI.StencilSystem}.\n * @readonly\n */\n public defaultMaskStack: Array<MaskData>;\n\n /**\n * Render texture currently bound. {@code null} if rendering to the canvas.\n * @readonly\n */\n public current: RenderTexture | null;\n\n /**\n * The source frame for the render-target's projection mapping.\n *\n * See {@link PIXI.ProjectionSystem#sourceFrame} for more details\n */\n public readonly sourceFrame: Rectangle;\n\n /**\n * The destination frame for the render-target's projection mapping.\n *\n * See {@link PIXI.Projection#destinationFrame} for more details.\n */\n public readonly destinationFrame: Rectangle;\n\n /**\n * The viewport frame for the render-target's viewport binding. This is equal to the destination-frame\n * for render-textures, while it is y-flipped when rendering to the screen (i.e. its origin is always on\n * the bottom-left).\n */\n public readonly viewportFrame: Rectangle;\n\n private renderer: Renderer;\n\n /**\n * @param renderer - The renderer this System works for.\n */\n constructor(renderer: Renderer)\n {\n this.renderer = renderer;\n\n this.clearColor = renderer._backgroundColorRgba;\n this.defaultMaskStack = [];\n this.current = null;\n this.sourceFrame = new Rectangle();\n this.destinationFrame = new Rectangle();\n this.viewportFrame = new Rectangle();\n }\n\n /**\n * Bind the current render texture.\n * @param renderTexture - RenderTexture to bind, by default its `null` - the screen.\n * @param sourceFrame - Part of world that is mapped to the renderTexture.\n * @param destinationFrame - Part of renderTexture, by default it has the same size as sourceFrame.\n */\n bind(renderTexture: RenderTexture = null, sourceFrame?: Rectangle, destinationFrame?: Rectangle): void\n {\n const renderer = this.renderer;\n\n this.current = renderTexture;\n\n let baseTexture: BaseRenderTexture;\n let framebuffer;\n let resolution;\n\n if (renderTexture)\n {\n baseTexture = renderTexture.baseTexture as BaseRenderTexture;\n\n resolution = baseTexture.resolution;\n\n if (!sourceFrame)\n {\n tempRect.width = renderTexture.frame.width;\n tempRect.height = renderTexture.frame.height;\n\n sourceFrame = tempRect;\n }\n\n if (!destinationFrame)\n {\n tempRect2.x = renderTexture.frame.x;\n tempRect2.y = renderTexture.frame.y;\n tempRect2.width = sourceFrame.width;\n tempRect2.height = sourceFrame.height;\n\n destinationFrame = tempRect2;\n }\n\n framebuffer = baseTexture.framebuffer;\n }\n else\n {\n resolution = renderer.resolution;\n\n if (!sourceFrame)\n {\n tempRect.width = renderer.screen.width;\n tempRect.height = renderer.screen.height;\n\n sourceFrame = tempRect;\n }\n\n if (!destinationFrame)\n {\n destinationFrame = tempRect;\n\n destinationFrame.width = sourceFrame.width;\n destinationFrame.height = sourceFrame.height;\n }\n }\n\n const viewportFrame = this.viewportFrame;\n\n viewportFrame.x = destinationFrame.x * resolution;\n viewportFrame.y = destinationFrame.y * resolution;\n viewportFrame.width = destinationFrame.width * resolution;\n viewportFrame.height = destinationFrame.height * resolution;\n\n if (!renderTexture)\n {\n viewportFrame.y = renderer.view.height - (viewportFrame.y + viewportFrame.height);\n }\n\n viewportFrame.ceil();\n\n this.renderer.framebuffer.bind(framebuffer, viewportFrame);\n this.renderer.projection.update(destinationFrame, sourceFrame, resolution, !framebuffer);\n\n if (renderTexture)\n {\n this.renderer.mask.setMaskStack(baseTexture.maskStack);\n }\n else\n {\n this.renderer.mask.setMaskStack(this.defaultMaskStack);\n }\n\n this.sourceFrame.copyFrom(sourceFrame);\n this.destinationFrame.copyFrom(destinationFrame);\n }\n\n /**\n * Erases the render texture and fills the drawing area with a colour.\n * @param clearColor - The color as rgba, default to use the renderer backgroundColor\n * @param [mask=BUFFER_BITS.COLOR | BUFFER_BITS.DEPTH] - Bitwise OR of masks\n * that indicate the buffers to be cleared, by default COLOR and DEPTH buffers.\n */\n clear(clearColor?: number[], mask?: BUFFER_BITS): void\n {\n if (this.current)\n {\n clearColor = clearColor || (this.current.baseTexture as BaseRenderTexture).clearColor;\n }\n else\n {\n clearColor = clearColor || this.clearColor;\n }\n\n const destinationFrame = this.destinationFrame;\n const baseFrame: ISize = this.current ? this.current.baseTexture : this.renderer.screen;\n const clearMask = destinationFrame.width !== baseFrame.width || destinationFrame.height !== baseFrame.height;\n\n if (clearMask)\n {\n let { x, y, width, height } = this.viewportFrame;\n\n x = Math.round(x);\n y = Math.round(y);\n width = Math.round(width);\n height = Math.round(height);\n\n // TODO: ScissorSystem should cache whether the scissor test is enabled or not.\n this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST);\n this.renderer.gl.scissor(x, y, width, height);\n }\n\n this.renderer.framebuffer.clear(clearColor[0], clearColor[1], clearColor[2], clearColor[3], mask);\n\n if (clearMask)\n {\n // Restore the scissor box\n this.renderer.scissor.pop();\n }\n }\n\n resize(): void // screenWidth, screenHeight)\n {\n // resize the root only!\n this.bind(null);\n }\n\n /** Resets render-texture state. */\n reset(): void\n {\n this.bind(null);\n }\n\n destroy(): void\n {\n this.renderer = null;\n }\n}\n","import type { Dict } from '@pixi/utils';\nimport { mapSize } from '../utils';\nimport type { IUniformData } from '../Program';\nimport type { UniformGroup } from '../UniformGroup';\nimport { uniformParsers } from './uniformParsers';\nimport type { Renderer } from '../../Renderer';\nimport type { Buffer } from '../../geometry/Buffer';\n\nexport type UniformsSyncCallback = (...args: any[]) => void;\n\nfunction uboUpdate(_ud: any, _uv: any, _renderer: Renderer, _syncData: any, buffer: Buffer): void\n{\n _renderer.buffer.update(buffer);\n}\n\n// cv = CachedValue\n// v = value\n// ud = uniformData\n// uv = uniformValue\n// l = location\nconst UBO_TO_SINGLE_SETTERS: Dict<string> = {\n float: `\n data[offset] = v;\n `,\n vec2: `\n data[offset] = v[0];\n data[offset+1] = v[1];\n `,\n vec3: `\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n\n `,\n vec4: `\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n data[offset+3] = v[3];\n `,\n mat2: `\n data[offset] = v[0];\n data[offset+1] = v[1];\n\n data[offset+4] = v[2];\n data[offset+5] = v[3];\n `,\n mat3: `\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n\n data[offset + 4] = v[3];\n data[offset + 5] = v[4];\n data[offset + 6] = v[5];\n\n data[offset + 8] = v[6];\n data[offset + 9] = v[7];\n data[offset + 10] = v[8];\n `,\n mat4: `\n for(var i = 0; i < 16; i++)\n {\n data[offset + i] = v[i];\n }\n `\n};\n\nconst GLSL_TO_STD40_SIZE: Dict<number> = {\n float: 4,\n vec2: 8,\n vec3: 12,\n vec4: 16,\n\n int: 4,\n ivec2: 8,\n ivec3: 12,\n ivec4: 16,\n\n uint: 4,\n uvec2: 8,\n uvec3: 12,\n uvec4: 16,\n\n bool: 4,\n bvec2: 8,\n bvec3: 12,\n bvec4: 16,\n\n mat2: 16 * 2,\n mat3: 16 * 3,\n mat4: 16 * 4,\n};\n\ninterface UBOElement\n{\n data: IUniformData\n offset: number,\n dataLen: number,\n dirty: number\n}\n\n/**\n * logic originally from here: https://github.com/sketchpunk/FunWithWebGL2/blob/master/lesson_022/Shaders.js\n * rewrote it, but this was a great starting point to get a solid understanding of whats going on :)\n * @ignore\n * @param uniformData\n */\nexport function createUBOElements(uniformData: IUniformData[]): {uboElements: UBOElement[], size: number}\n{\n const uboElements: UBOElement[] = uniformData.map((data: IUniformData) =>\n ({\n data,\n offset: 0,\n dataLen: 0,\n dirty: 0\n }));\n\n let size = 0;\n let chunkSize = 0;\n let offset = 0;\n\n for (let i = 0; i < uboElements.length; i++)\n {\n const uboElement = uboElements[i];\n\n size = GLSL_TO_STD40_SIZE[uboElement.data.type];\n\n if (uboElement.data.size > 1)\n {\n size = Math.max(size, 16) * uboElement.data.size;\n }\n\n uboElement.dataLen = size;\n\n // add some size offset..\n // must align to the nearest 16 bytes or internally nearest round size\n\n if (chunkSize % size !== 0 && chunkSize < 16)\n {\n // diff required to line up..\n const lineUpValue = (chunkSize % size) % 16;\n\n chunkSize += lineUpValue;\n offset += lineUpValue;\n }\n\n if ((chunkSize + size) > 16)\n {\n offset = Math.ceil(offset / 16) * 16;\n uboElement.offset = offset;\n offset += size;\n chunkSize = size;\n }\n else\n {\n uboElement.offset = offset;\n chunkSize += size;\n offset += size;\n }\n }\n\n offset = Math.ceil(offset / 16) * 16;\n\n return { uboElements, size: offset };\n}\n\nexport function getUBOData(uniforms: Dict<any>, uniformData: Dict<any>): any[]\n{\n const usedUniformDatas = [];\n\n // build..\n for (const i in uniforms)\n {\n if (uniformData[i])\n {\n usedUniformDatas.push(uniformData[i]);\n }\n }\n\n // sort them out by index!\n usedUniformDatas.sort((a, b) => a.index - b.index);\n\n return usedUniformDatas;\n}\n\nexport function generateUniformBufferSync(\n group: UniformGroup,\n uniformData: Dict<any>\n): {size: number, syncFunc: UniformsSyncCallback}\n{\n if (!group.autoManage)\n {\n // if the group is nott automatically managed, we don't need to generate a special function for it...\n return { size: 0, syncFunc: uboUpdate };\n }\n\n const usedUniformDatas = getUBOData(group.uniforms, uniformData);\n\n const { uboElements, size } = createUBOElements(usedUniformDatas);\n\n const funcFragments = [`\n var v = null;\n var v2 = null;\n var cv = null;\n var t = 0;\n var gl = renderer.gl\n var index = 0;\n var data = buffer.data;\n `];\n\n for (let i = 0; i < uboElements.length; i++)\n {\n const uboElement = uboElements[i];\n const uniform = group.uniforms[uboElement.data.name];\n\n const name = uboElement.data.name;\n\n let parsed = false;\n\n for (let j = 0; j < uniformParsers.length; j++)\n {\n const uniformParser = uniformParsers[j];\n\n if (uniformParser.codeUbo && uniformParser.test(uboElement.data, uniform))\n {\n funcFragments.push(\n `offset = ${uboElement.offset / 4};`,\n uniformParsers[j].codeUbo(uboElement.data.name, uniform));\n parsed = true;\n\n break;\n }\n }\n\n if (!parsed)\n {\n if (uboElement.data.size > 1)\n {\n const size = mapSize(uboElement.data.type);\n const rowSize = Math.max(GLSL_TO_STD40_SIZE[uboElement.data.type] / 16, 1);\n const elementSize = size / rowSize;\n const remainder = (4 - (elementSize % 4)) % 4;\n\n funcFragments.push(`\n cv = ud.${name}.value;\n v = uv.${name};\n offset = ${uboElement.offset / 4};\n\n t = 0;\n\n for(var i=0; i < ${uboElement.data.size * rowSize}; i++)\n {\n for(var j = 0; j < ${elementSize}; j++)\n {\n data[offset++] = v[t++];\n }\n offset += ${remainder};\n }\n\n `);\n }\n else\n {\n const template = UBO_TO_SINGLE_SETTERS[uboElement.data.type];\n\n funcFragments.push(`\n cv = ud.${name}.value;\n v = uv.${name};\n offset = ${uboElement.offset / 4};\n ${template};\n `);\n }\n }\n }\n\n funcFragments.push(`\n renderer.buffer.update(buffer);\n `);\n\n return {\n size,\n // eslint-disable-next-line no-new-func\n syncFunc: new Function(\n 'ud',\n 'uv',\n 'renderer',\n 'syncData',\n 'buffer',\n funcFragments.join('\\n')\n ) as UniformsSyncCallback\n };\n}\n","import type { Dict } from '@pixi/utils';\n\n/**\n * @private\n */\nexport class IGLUniformData\n{\n location: WebGLUniformLocation;\n value: number | boolean | Float32Array | Int32Array | Uint32Array | boolean[];\n}\n\n/**\n * Helper class to create a WebGL Program\n * @memberof PIXI\n */\nexport class GLProgram\n{\n /** The shader program. */\n public program: WebGLProgram;\n\n /**\n * Holds the uniform data which contains uniform locations\n * and current uniform values used for caching and preventing unneeded GPU commands.\n */\n public uniformData: Dict<any>;\n\n /**\n * UniformGroups holds the various upload functions for the shader. Each uniform group\n * and program have a unique upload function generated.\n */\n public uniformGroups: Dict<any>;\n\n /** A hash that stores where UBOs are bound to on the program. */\n public uniformBufferBindings: Dict<any>;\n\n /** A hash for lazily-generated uniform uploading functions. */\n public uniformSync: Dict<any>;\n\n /**\n * A place where dirty ticks are stored for groups\n * If a tick here does not match with the Higher level Programs tick, it means\n * we should re upload the data.\n */\n public uniformDirtyGroups: Dict<any>;\n\n /**\n * Makes a new Pixi program.\n * @param program - webgl program\n * @param uniformData - uniforms\n */\n constructor(program: WebGLProgram, uniformData: {[key: string]: IGLUniformData})\n {\n this.program = program;\n this.uniformData = uniformData;\n this.uniformGroups = {};\n this.uniformDirtyGroups = {};\n this.uniformBufferBindings = {};\n }\n\n /** Destroys this program. */\n destroy(): void\n {\n this.uniformData = null;\n this.uniformGroups = null;\n this.uniformDirtyGroups = null;\n this.uniformBufferBindings = null;\n this.program = null;\n }\n}\n","import type { Program } from '../Program';\nimport type { IRenderingContext } from '../../IRenderingContext';\nimport type { IGLUniformData } from '../GLProgram';\nimport { GLProgram } from '../GLProgram';\nimport { compileShader } from './compileShader';\nimport { defaultValue } from './defaultValue';\nimport { getAttributeData } from './getAttributeData';\nimport { getUniformData } from './getUniformData';\nimport { logProgramError } from './logProgramError';\n\n/**\n * generates a WebGL Program object from a high level Pixi Program.\n * @param gl - a rendering context on which to generate the program\n * @param program - the high level Pixi Program.\n */\nexport function generateProgram(gl: IRenderingContext, program: Program): GLProgram\n{\n const glVertShader = compileShader(gl, gl.VERTEX_SHADER, program.vertexSrc);\n const glFragShader = compileShader(gl, gl.FRAGMENT_SHADER, program.fragmentSrc);\n\n const webGLProgram = gl.createProgram();\n\n gl.attachShader(webGLProgram, glVertShader);\n gl.attachShader(webGLProgram, glFragShader);\n\n gl.linkProgram(webGLProgram);\n\n if (!gl.getProgramParameter(webGLProgram, gl.LINK_STATUS))\n {\n logProgramError(gl, webGLProgram, glVertShader, glFragShader);\n }\n\n program.attributeData = getAttributeData(webGLProgram, gl);\n program.uniformData = getUniformData(webGLProgram, gl);\n\n // GLSL 1.00: bind attributes sorted by name in ascending order\n // GLSL 3.00: don't change the attribute locations that where chosen by the compiler\n // or assigned by the layout specifier in the shader source code\n if (!(/^[ \\t]*#[ \\t]*version[ \\t]+300[ \\t]+es[ \\t]*$/m).test(program.vertexSrc))\n {\n const keys = Object.keys(program.attributeData);\n\n keys.sort((a, b) => (a > b) ? 1 : -1); // eslint-disable-line no-confusing-arrow\n\n for (let i = 0; i < keys.length; i++)\n {\n program.attributeData[keys[i]].location = i;\n\n gl.bindAttribLocation(webGLProgram, i, keys[i]);\n }\n\n gl.linkProgram(webGLProgram);\n }\n\n gl.deleteShader(glVertShader);\n gl.deleteShader(glFragShader);\n\n const uniformData: {[key: string]: IGLUniformData} = {};\n\n for (const i in program.uniformData)\n {\n const data = program.uniformData[i];\n\n uniformData[i] = {\n location: gl.getUniformLocation(webGLProgram, i),\n value: defaultValue(data.type, data.size),\n };\n }\n\n const glProgram = new GLProgram(webGLProgram, uniformData);\n\n return glProgram;\n}\n","import type { IAttributeData } from '../Program';\nimport { mapSize } from './mapSize';\nimport { mapType } from './mapType';\n\n/**\n * returns the attribute data from the program\n * @private\n * @param {WebGLProgram} [program] - the WebGL program\n * @param {WebGLRenderingContext} [gl] - the WebGL context\n * @returns {object} the attribute data for this program\n */\nexport function getAttributeData(program: WebGLProgram, gl: WebGLRenderingContextBase): {[key: string]: IAttributeData}\n{\n const attributes: {[key: string]: IAttributeData} = {};\n\n const totalAttributes = gl.getProgramParameter(program, gl.ACTIVE_ATTRIBUTES);\n\n for (let i = 0; i < totalAttributes; i++)\n {\n const attribData = gl.getActiveAttrib(program, i);\n\n if (attribData.name.indexOf('gl_') === 0)\n {\n continue;\n }\n\n const type = mapType(gl, attribData.type);\n const data = {\n type,\n name: attribData.name,\n size: mapSize(type),\n location: gl.getAttribLocation(program, attribData.name),\n };\n\n attributes[attribData.name] = data;\n }\n\n return attributes;\n}\n","import type { IUniformData } from '../Program';\nimport { defaultValue } from './defaultValue';\nimport { mapType } from './mapType';\n\n/**\n * returns the uniform data from the program\n * @private\n * @param program - the webgl program\n * @param gl - the WebGL context\n * @returns {object} the uniform data for this program\n */\nexport function getUniformData(program: WebGLProgram, gl: WebGLRenderingContextBase): {[key: string]: IUniformData}\n{\n const uniforms: {[key: string]: IUniformData} = {};\n\n const totalUniforms = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS);\n\n for (let i = 0; i < totalUniforms; i++)\n {\n const uniformData = gl.getActiveUniform(program, i);\n const name = uniformData.name.replace(/\\[.*?\\]$/, '');\n\n const isArray = !!(uniformData.name.match(/\\[.*?\\]$/));\n\n const type = mapType(gl, uniformData.type);\n\n uniforms[name] = {\n name,\n index: i,\n type,\n size: uniformData.size,\n isArray,\n value: defaultValue(type, uniformData.size),\n };\n }\n\n return uniforms;\n}\n","import type { GLProgram } from './GLProgram';\nimport { generateUniformsSync, unsafeEvalSupported } from './utils';\n\nimport type { ISystem } from '../ISystem';\nimport type { Renderer } from '../Renderer';\nimport type { IRenderingContext } from '../IRenderingContext';\nimport type { Shader } from './Shader';\nimport type { Program } from './Program';\nimport type { UniformGroup } from './UniformGroup';\nimport type { Dict } from '@pixi/utils';\nimport type { UniformsSyncCallback } from './utils';\nimport { generateUniformBufferSync } from './utils/generateUniformBufferSync';\n\nimport { generateProgram } from './utils/generateProgram';\n\nlet UID = 0;\n// default sync data so we don't create a new one each time!\nconst defaultSyncData = { textureCount: 0, uboCount: 0 };\n\n/**\n * System plugin to the renderer to manage shaders.\n * @memberof PIXI\n */\nexport class ShaderSystem implements ISystem\n{\n /**\n * The current WebGL rendering context.\n * @member {WebGLRenderingContext}\n */\n protected gl: IRenderingContext;\n\n public shader: Shader;\n public program: Program;\n public id: number;\n public destroyed = false;\n\n /** Cache to holds the generated functions. Stored against UniformObjects unique signature. */\n private cache: Dict<UniformsSyncCallback>;\n private _uboCache: Dict<{size: number, syncFunc: UniformsSyncCallback}>;\n private renderer: Renderer;\n\n /** @param renderer - The renderer this System works for. */\n constructor(renderer: Renderer)\n {\n this.renderer = renderer;\n\n // Validation check that this environment support `new Function`\n this.systemCheck();\n\n this.gl = null;\n\n this.shader = null;\n this.program = null;\n\n this.cache = {};\n this._uboCache = {};\n\n this.id = UID++;\n }\n\n /**\n * Overrideable function by `@pixi/unsafe-eval` to silence\n * throwing an error if platform doesn't support unsafe-evals.\n * @private\n */\n systemCheck(): void\n {\n if (!unsafeEvalSupported())\n {\n throw new Error('Current environment does not allow unsafe-eval, '\n + 'please use @pixi/unsafe-eval module to enable support.');\n }\n }\n\n protected contextChange(gl: IRenderingContext): void\n {\n this.gl = gl;\n this.reset();\n }\n\n /**\n * Changes the current shader to the one given in parameter.\n * @param shader - the new shader\n * @param dontSync - false if the shader should automatically sync its uniforms.\n * @returns the glProgram that belongs to the shader.\n */\n bind(shader: Shader, dontSync?: boolean): GLProgram\n {\n shader.uniforms.globals = this.renderer.globalUniforms;\n\n const program = shader.program;\n const glProgram = program.glPrograms[this.renderer.CONTEXT_UID] || this.generateProgram(shader);\n\n this.shader = shader;\n\n // TODO - some current Pixi plugins bypass this.. so it not safe to use yet..\n if (this.program !== program)\n {\n this.program = program;\n this.gl.useProgram(glProgram.program);\n }\n\n if (!dontSync)\n {\n defaultSyncData.textureCount = 0;\n defaultSyncData.uboCount = 0;\n\n this.syncUniformGroup(shader.uniformGroup, defaultSyncData);\n }\n\n return glProgram;\n }\n\n /**\n * Uploads the uniforms values to the currently bound shader.\n * @param uniforms - the uniforms values that be applied to the current shader\n */\n setUniforms(uniforms: Dict<any>): void\n {\n const shader = this.shader.program;\n const glProgram = shader.glPrograms[this.renderer.CONTEXT_UID];\n\n shader.syncUniforms(glProgram.uniformData, uniforms, this.renderer);\n }\n\n /* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n /**\n * Syncs uniforms on the group\n * @param group - the uniform group to sync\n * @param syncData - this is data that is passed to the sync function and any nested sync functions\n */\n syncUniformGroup(group: UniformGroup, syncData?: any): void\n {\n const glProgram = this.getGlProgram();\n\n if (!group.static || group.dirtyId !== glProgram.uniformDirtyGroups[group.id])\n {\n glProgram.uniformDirtyGroups[group.id] = group.dirtyId;\n\n this.syncUniforms(group, glProgram, syncData);\n }\n }\n\n /**\n * Overrideable by the @pixi/unsafe-eval package to use static syncUniforms instead.\n * @param group\n * @param glProgram\n * @param syncData\n */\n syncUniforms(group: UniformGroup, glProgram: GLProgram, syncData: any): void\n {\n const syncFunc = group.syncUniforms[this.shader.program.id] || this.createSyncGroups(group);\n\n syncFunc(glProgram.uniformData, group.uniforms, this.renderer, syncData);\n }\n\n createSyncGroups(group: UniformGroup): UniformsSyncCallback\n {\n const id = this.getSignature(group, this.shader.program.uniformData, 'u');\n\n if (!this.cache[id])\n {\n this.cache[id] = generateUniformsSync(group, this.shader.program.uniformData);\n }\n\n group.syncUniforms[this.shader.program.id] = this.cache[id];\n\n return group.syncUniforms[this.shader.program.id];\n }\n\n /**\n * Syncs uniform buffers\n * @param group - the uniform buffer group to sync\n * @param name - the name of the uniform buffer\n */\n syncUniformBufferGroup(group: UniformGroup, name?: string)\n {\n const glProgram = this.getGlProgram();\n\n if (!group.static || group.dirtyId !== 0 || !glProgram.uniformGroups[group.id])\n {\n group.dirtyId = 0;\n\n const syncFunc = glProgram.uniformGroups[group.id]\n || this.createSyncBufferGroup(group, glProgram, name);\n\n // TODO wrap update in a cache??\n group.buffer.update();\n\n syncFunc(glProgram.uniformData,\n group.uniforms,\n this.renderer,\n defaultSyncData,\n group.buffer\n );\n }\n\n this.renderer.buffer.bindBufferBase(group.buffer, glProgram.uniformBufferBindings[name]);\n }\n\n /**\n * Will create a function that uploads a uniform buffer using the STD140 standard.\n * The upload function will then be cached for future calls\n * If a group is manually managed, then a simple upload function is generated\n * @param group - the uniform buffer group to sync\n * @param glProgram - the gl program to attach the uniform bindings to\n * @param name - the name of the uniform buffer (must exist on the shader)\n */\n protected createSyncBufferGroup(group: UniformGroup, glProgram: GLProgram, name: string): UniformsSyncCallback\n {\n const { gl } = this.renderer;\n\n this.renderer.buffer.bind(group.buffer);\n\n // bind them...\n const uniformBlockIndex = this.gl.getUniformBlockIndex(glProgram.program, name);\n\n glProgram.uniformBufferBindings[name] = this.shader.uniformBindCount;\n\n gl.uniformBlockBinding(glProgram.program, uniformBlockIndex, this.shader.uniformBindCount);\n\n this.shader.uniformBindCount++;\n\n const id = this.getSignature(group, this.shader.program.uniformData, 'ubo');\n\n let uboData = this._uboCache[id];\n\n if (!uboData)\n {\n uboData = this._uboCache[id] = generateUniformBufferSync(group, this.shader.program.uniformData);\n }\n\n if (group.autoManage)\n {\n const data = new Float32Array(uboData.size / 4);\n\n group.buffer.update(data);\n }\n\n glProgram.uniformGroups[group.id] = uboData.syncFunc;\n\n return glProgram.uniformGroups[group.id];\n }\n\n /**\n * Takes a uniform group and data and generates a unique signature for them.\n * @param group - The uniform group to get signature of\n * @param group.uniforms\n * @param uniformData - Uniform information generated by the shader\n * @param preFix\n * @returns Unique signature of the uniform group\n */\n private getSignature(group: {uniforms: Dict<any>}, uniformData: Dict<any>, preFix: string): string\n {\n const uniforms = group.uniforms;\n\n const strings = [`${preFix}-`];\n\n for (const i in uniforms)\n {\n strings.push(i);\n\n if (uniformData[i])\n {\n strings.push(uniformData[i].type);\n }\n }\n\n return strings.join('-');\n }\n\n /**\n * Returns the underlying GLShade rof the currently bound shader.\n *\n * This can be handy for when you to have a little more control over the setting of your uniforms.\n * @returns The glProgram for the currently bound Shader for this context\n */\n getGlProgram(): GLProgram\n {\n if (this.shader)\n {\n return this.shader.program.glPrograms[this.renderer.CONTEXT_UID];\n }\n\n return null;\n }\n\n /**\n * Generates a glProgram version of the Shader provided.\n * @param shader - The shader that the glProgram will be based on.\n * @returns A shiny new glProgram!\n */\n generateProgram(shader: Shader): GLProgram\n {\n const gl = this.gl;\n const program = shader.program;\n\n const glProgram = generateProgram(gl, program);\n\n program.glPrograms[this.renderer.CONTEXT_UID] = glProgram;\n\n return glProgram;\n }\n\n /** Resets ShaderSystem state, does not affect WebGL state. */\n reset(): void\n {\n this.program = null;\n this.shader = null;\n }\n\n /** Destroys this System and removes all its textures. */\n destroy(): void\n {\n this.renderer = null;\n // TODO implement destroy method for ShaderSystem\n this.destroyed = true;\n }\n}\n","import { mapWebGLBlendModesToPixi } from './utils/mapWebGLBlendModesToPixi';\nimport { State } from './State';\nimport { BLEND_MODES } from '@pixi/constants';\n\nimport type { ISystem } from '../ISystem';\nimport type { IRenderingContext } from '../IRenderingContext';\n\nconst BLEND = 0;\nconst OFFSET = 1;\nconst CULLING = 2;\nconst DEPTH_TEST = 3;\nconst WINDING = 4;\nconst DEPTH_MASK = 5;\n\n/**\n * System plugin to the renderer to manage WebGL state machines.\n * @memberof PIXI\n */\nexport class StateSystem implements ISystem\n{\n /**\n * State ID\n * @readonly\n */\n public stateId: number;\n\n /**\n * Polygon offset\n * @readonly\n */\n public polygonOffset: number;\n\n /**\n * Blend mode\n * @default PIXI.BLEND_MODES.NONE\n * @readonly\n */\n public blendMode: BLEND_MODES;\n\n /** Whether current blend equation is different */\n protected _blendEq: boolean;\n\n /**\n * GL context\n * @member {WebGLRenderingContext}\n * @readonly\n */\n protected gl: IRenderingContext;\n\n protected blendModes: number[][];\n\n /**\n * Collection of calls\n * @member {Function[]}\n */\n protected readonly map: Array<(value: boolean) => void>;\n\n /**\n * Collection of check calls\n * @member {Function[]}\n */\n protected readonly checks: Array<(system: this, state: State) => void>;\n\n /**\n * Default WebGL State\n * @readonly\n */\n protected defaultState: State;\n\n constructor()\n {\n this.gl = null;\n\n this.stateId = 0;\n this.polygonOffset = 0;\n this.blendMode = BLEND_MODES.NONE;\n\n this._blendEq = false;\n\n // map functions for when we set state..\n this.map = [];\n this.map[BLEND] = this.setBlend;\n this.map[OFFSET] = this.setOffset;\n this.map[CULLING] = this.setCullFace;\n this.map[DEPTH_TEST] = this.setDepthTest;\n this.map[WINDING] = this.setFrontFace;\n this.map[DEPTH_MASK] = this.setDepthMask;\n\n this.checks = [];\n\n this.defaultState = new State();\n this.defaultState.blend = true;\n }\n\n contextChange(gl: IRenderingContext): void\n {\n this.gl = gl;\n\n this.blendModes = mapWebGLBlendModesToPixi(gl);\n\n this.set(this.defaultState);\n\n this.reset();\n }\n\n /**\n * Sets the current state\n * @param {*} state - The state to set.\n */\n set(state: State): void\n {\n state = state || this.defaultState;\n\n // TODO maybe to an object check? ( this.state === state )?\n if (this.stateId !== state.data)\n {\n let diff = this.stateId ^ state.data;\n let i = 0;\n\n // order from least to most common\n while (diff)\n {\n if (diff & 1)\n {\n // state change!\n this.map[i].call(this, !!(state.data & (1 << i)));\n }\n\n diff = diff >> 1;\n i++;\n }\n\n this.stateId = state.data;\n }\n\n // based on the above settings we check for specific modes..\n // for example if blend is active we check and set the blend modes\n // or of polygon offset is active we check the poly depth.\n for (let i = 0; i < this.checks.length; i++)\n {\n this.checks[i](this, state);\n }\n }\n\n /**\n * Sets the state, when previous state is unknown.\n * @param {*} state - The state to set\n */\n forceState(state: State): void\n {\n state = state || this.defaultState;\n for (let i = 0; i < this.map.length; i++)\n {\n this.map[i].call(this, !!(state.data & (1 << i)));\n }\n for (let i = 0; i < this.checks.length; i++)\n {\n this.checks[i](this, state);\n }\n\n this.stateId = state.data;\n }\n\n /**\n * Sets whether to enable or disable blending.\n * @param value - Turn on or off WebGl blending.\n */\n setBlend(value: boolean): void\n {\n this.updateCheck(StateSystem.checkBlendMode, value);\n\n this.gl[value ? 'enable' : 'disable'](this.gl.BLEND);\n }\n\n /**\n * Sets whether to enable or disable polygon offset fill.\n * @param value - Turn on or off webgl polygon offset testing.\n */\n setOffset(value: boolean): void\n {\n this.updateCheck(StateSystem.checkPolygonOffset, value);\n\n this.gl[value ? 'enable' : 'disable'](this.gl.POLYGON_OFFSET_FILL);\n }\n\n /**\n * Sets whether to enable or disable depth test.\n * @param value - Turn on or off webgl depth testing.\n */\n setDepthTest(value: boolean): void\n {\n this.gl[value ? 'enable' : 'disable'](this.gl.DEPTH_TEST);\n }\n\n /**\n * Sets whether to enable or disable depth mask.\n * @param value - Turn on or off webgl depth mask.\n */\n setDepthMask(value: boolean): void\n {\n this.gl.depthMask(value);\n }\n\n /**\n * Sets whether to enable or disable cull face.\n * @param {boolean} value - Turn on or off webgl cull face.\n */\n setCullFace(value: boolean): void\n {\n this.gl[value ? 'enable' : 'disable'](this.gl.CULL_FACE);\n }\n\n /**\n * Sets the gl front face.\n * @param {boolean} value - true is clockwise and false is counter-clockwise\n */\n setFrontFace(value: boolean): void\n {\n this.gl.frontFace(this.gl[value ? 'CW' : 'CCW']);\n }\n\n /**\n * Sets the blend mode.\n * @param {number} value - The blend mode to set to.\n */\n setBlendMode(value: number): void\n {\n if (value === this.blendMode)\n {\n return;\n }\n\n this.blendMode = value;\n\n const mode = this.blendModes[value];\n const gl = this.gl;\n\n if (mode.length === 2)\n {\n gl.blendFunc(mode[0], mode[1]);\n }\n else\n {\n gl.blendFuncSeparate(mode[0], mode[1], mode[2], mode[3]);\n }\n if (mode.length === 6)\n {\n this._blendEq = true;\n gl.blendEquationSeparate(mode[4], mode[5]);\n }\n else if (this._blendEq)\n {\n this._blendEq = false;\n gl.blendEquationSeparate(gl.FUNC_ADD, gl.FUNC_ADD);\n }\n }\n\n /**\n * Sets the polygon offset.\n * @param {number} value - the polygon offset\n * @param {number} scale - the polygon offset scale\n */\n setPolygonOffset(value: number, scale: number): void\n {\n this.gl.polygonOffset(value, scale);\n }\n\n // used\n /** Resets all the logic and disables the VAOs. */\n reset(): void\n {\n this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL, false);\n\n this.forceState(this.defaultState);\n\n this._blendEq = true;\n this.blendMode = -1;\n this.setBlendMode(0);\n }\n\n /**\n * Checks to see which updates should be checked based on which settings have been activated.\n *\n * For example, if blend is enabled then we should check the blend modes each time the state is changed\n * or if polygon fill is activated then we need to check if the polygon offset changes.\n * The idea is that we only check what we have too.\n * @param func - the checking function to add or remove\n * @param value - should the check function be added or removed.\n */\n updateCheck(func: (system: this, state: State) => void, value: boolean): void\n {\n const index = this.checks.indexOf(func);\n\n if (value && index === -1)\n {\n this.checks.push(func);\n }\n else if (!value && index !== -1)\n {\n this.checks.splice(index, 1);\n }\n }\n\n /**\n * A private little wrapper function that we call to check the blend mode.\n * @param system - the System to perform the state check on\n * @param state - the state that the blendMode will pulled from\n */\n private static checkBlendMode(system: StateSystem, state: State): void\n {\n system.setBlendMode(state.blendMode);\n }\n\n /**\n * A private little wrapper function that we call to check the polygon offset.\n * @param system - the System to perform the state check on\n * @param state - the state that the blendMode will pulled from\n */\n private static checkPolygonOffset(system: StateSystem, state: State): void\n {\n system.setPolygonOffset(1, state.polygonOffset);\n }\n\n /**\n * @ignore\n */\n destroy(): void\n {\n this.gl = null;\n }\n}\n","import { BLEND_MODES } from '@pixi/constants';\n\n/**\n * Maps gl blend combinations to WebGL.\n * @memberof PIXI\n * @function mapWebGLBlendModesToPixi\n * @private\n * @param {WebGLRenderingContext} gl - The rendering context.\n * @param {number[][]} [array=[]] - The array to output into.\n * @returns {number[][]} Mapped modes.\n */\nexport function mapWebGLBlendModesToPixi(gl: WebGLRenderingContextBase, array: number[][] = []): number[][]\n{\n // TODO - premultiply alpha would be different.\n // add a boolean for that!\n array[BLEND_MODES.NORMAL] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.ADD] = [gl.ONE, gl.ONE];\n array[BLEND_MODES.MULTIPLY] = [gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.SCREEN] = [gl.ONE, gl.ONE_MINUS_SRC_COLOR, gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.OVERLAY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.DARKEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.LIGHTEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.COLOR_DODGE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.COLOR_BURN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.HARD_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.SOFT_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.DIFFERENCE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.EXCLUSION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.HUE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.SATURATION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.COLOR] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.LUMINOSITY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.NONE] = [0, 0];\n\n // not-premultiplied blend modes\n array[BLEND_MODES.NORMAL_NPM] = [gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.ADD_NPM] = [gl.SRC_ALPHA, gl.ONE, gl.ONE, gl.ONE];\n array[BLEND_MODES.SCREEN_NPM] = [gl.SRC_ALPHA, gl.ONE_MINUS_SRC_COLOR, gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n\n // composite operations\n array[BLEND_MODES.SRC_IN] = [gl.DST_ALPHA, gl.ZERO];\n array[BLEND_MODES.SRC_OUT] = [gl.ONE_MINUS_DST_ALPHA, gl.ZERO];\n array[BLEND_MODES.SRC_ATOP] = [gl.DST_ALPHA, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.DST_OVER] = [gl.ONE_MINUS_DST_ALPHA, gl.ONE];\n array[BLEND_MODES.DST_IN] = [gl.ZERO, gl.SRC_ALPHA];\n array[BLEND_MODES.DST_OUT] = [gl.ZERO, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.DST_ATOP] = [gl.ONE_MINUS_DST_ALPHA, gl.SRC_ALPHA];\n array[BLEND_MODES.XOR] = [gl.ONE_MINUS_DST_ALPHA, gl.ONE_MINUS_SRC_ALPHA];\n\n // SUBTRACT from flash\n array[BLEND_MODES.SUBTRACT] = [gl.ONE, gl.ONE, gl.ONE, gl.ONE, gl.FUNC_REVERSE_SUBTRACT, gl.FUNC_ADD];\n\n return array;\n}\n","import { GC_MODES } from '@pixi/constants';\nimport { settings } from '@pixi/settings';\n\nimport type { ISystem } from '../ISystem';\nimport type { Renderer } from '../Renderer';\nimport type { Texture } from './Texture';\nimport type { RenderTexture } from '../renderTexture/RenderTexture';\n\nexport interface IUnloadableTexture\n{\n _texture: Texture | RenderTexture;\n children: IUnloadableTexture[];\n}\n\n/**\n * System plugin to the renderer to manage texture garbage collection on the GPU,\n * ensuring that it does not get clogged up with textures that are no longer being used.\n * @memberof PIXI\n */\nexport class TextureGCSystem implements ISystem\n{\n /**\n * Count\n * @readonly\n */\n public count: number;\n\n /**\n * Check count\n * @readonly\n */\n public checkCount: number;\n\n /**\n * Maximum idle time, in seconds\n * @see PIXI.settings.GC_MAX_IDLE\n */\n public maxIdle: number;\n\n /**\n * Maximum number of item to check\n * @see PIXI.settings.GC_MAX_CHECK_COUNT\n */\n public checkCountMax: number;\n\n /**\n * Current garbage collection mode\n * @see PIXI.settings.GC_MODE\n */\n public mode: GC_MODES;\n private renderer: Renderer;\n\n /** @param renderer - The renderer this System works for. */\n constructor(renderer: Renderer)\n {\n this.renderer = renderer;\n\n this.count = 0;\n this.checkCount = 0;\n this.maxIdle = settings.GC_MAX_IDLE;\n this.checkCountMax = settings.GC_MAX_CHECK_COUNT;\n this.mode = settings.GC_MODE;\n }\n\n /**\n * Checks to see when the last time a texture was used\n * if the texture has not been used for a specified amount of time it will be removed from the GPU\n */\n protected postrender(): void\n {\n if (!this.renderer.renderingToScreen)\n {\n return;\n }\n\n this.count++;\n\n if (this.mode === GC_MODES.MANUAL)\n {\n return;\n }\n\n this.checkCount++;\n\n if (this.checkCount > this.checkCountMax)\n {\n this.checkCount = 0;\n\n this.run();\n }\n }\n\n /**\n * Checks to see when the last time a texture was used\n * if the texture has not been used for a specified amount of time it will be removed from the GPU\n */\n run(): void\n {\n const tm = this.renderer.texture;\n const managedTextures = tm.managedTextures;\n let wasRemoved = false;\n\n for (let i = 0; i < managedTextures.length; i++)\n {\n const texture = managedTextures[i];\n\n // only supports non generated textures at the moment!\n if (!(texture as any).framebuffer && this.count - texture.touched > this.maxIdle)\n {\n tm.destroyTexture(texture, true);\n managedTextures[i] = null;\n wasRemoved = true;\n }\n }\n\n if (wasRemoved)\n {\n let j = 0;\n\n for (let i = 0; i < managedTextures.length; i++)\n {\n if (managedTextures[i] !== null)\n {\n managedTextures[j++] = managedTextures[i];\n }\n }\n\n managedTextures.length = j;\n }\n }\n\n /**\n * Removes all the textures within the specified displayObject and its children from the GPU\n * @param {PIXI.DisplayObject} displayObject - the displayObject to remove the textures from.\n */\n unload(displayObject: IUnloadableTexture): void\n {\n const tm = this.renderer.texture;\n const texture = displayObject._texture as RenderTexture;\n\n // only destroy non generated textures\n if (texture && !texture.framebuffer)\n {\n tm.destroyTexture(texture);\n }\n\n for (let i = displayObject.children.length - 1; i >= 0; i--)\n {\n this.unload(displayObject.children[i]);\n }\n }\n\n destroy(): void\n {\n this.renderer = null;\n }\n}\n","import { FORMATS, TYPES } from '@pixi/constants';\n\n/**\n * Internal texture for WebGL context.\n * @memberof PIXI\n */\nexport class GLTexture\n{\n /** The WebGL texture. */\n public texture: WebGLTexture;\n\n /** Width of texture that was used in texImage2D. */\n public width: number;\n\n /** Height of texture that was used in texImage2D. */\n public height: number;\n\n /** Whether mip levels has to be generated. */\n public mipmap: boolean;\n\n /** WrapMode copied from baseTexture. */\n public wrapMode: number;\n\n /** Type copied from baseTexture. */\n public type: number;\n\n /** Type copied from baseTexture. */\n public internalFormat: number;\n\n /** Type of sampler corresponding to this texture. See {@link PIXI.SAMPLER_TYPES} */\n public samplerType: number;\n\n /** Texture contents dirty flag. */\n dirtyId: number;\n\n /** Texture style dirty flag. */\n dirtyStyleId: number;\n\n constructor(texture: WebGLTexture)\n {\n this.texture = texture;\n this.width = -1;\n this.height = -1;\n this.dirtyId = -1;\n this.dirtyStyleId = -1;\n this.mipmap = false;\n this.wrapMode = 33071;\n this.type = TYPES.UNSIGNED_BYTE;\n this.internalFormat = FORMATS.RGBA;\n\n this.samplerType = 0;\n }\n}\n","import { mapTypeAndFormatToInternalFormat } from './utils/mapTypeAndFormatToInternalFormat';\nimport { BaseTexture } from './BaseTexture';\nimport { GLTexture } from './GLTexture';\nimport { removeItems } from '@pixi/utils';\nimport { MIPMAP_MODES, WRAP_MODES, SCALE_MODES, TYPES, SAMPLER_TYPES } from '@pixi/constants';\n\nimport type { ISystem } from '../ISystem';\nimport type { Texture } from './Texture';\nimport type { IRenderingContext } from '../IRenderingContext';\nimport type { Renderer } from '../Renderer';\n\n/**\n * System plugin to the renderer to manage textures.\n * @memberof PIXI\n */\nexport class TextureSystem implements ISystem\n{\n /**\n * Bound textures.\n * @readonly\n */\n public boundTextures: BaseTexture[];\n\n /**\n * List of managed textures.\n * @readonly\n */\n public managedTextures: Array<BaseTexture>;\n\n /** Whether glTexture with int/uint sampler type was uploaded. */\n protected hasIntegerTextures: boolean;\n protected CONTEXT_UID: number;\n protected gl: IRenderingContext;\n protected internalFormats: { [type: number]: { [format: number]: number } };\n protected webGLVersion: number;\n\n /**\n * BaseTexture value that shows that we don't know what is bound.\n * @readonly\n */\n protected unknownTexture: BaseTexture;\n\n /**\n * Did someone temper with textures state? We'll overwrite them when we need to unbind something.\n * @private\n */\n protected _unknownBoundTextures: boolean;\n\n /**\n * Current location.\n * @readonly\n */\n currentLocation: number;\n emptyTextures: {[key: number]: GLTexture};\n private renderer: Renderer;\n\n /**\n * @param renderer - The renderer this system works for.\n */\n constructor(renderer: Renderer)\n {\n this.renderer = renderer;\n\n // TODO set to max textures...\n this.boundTextures = [];\n this.currentLocation = -1;\n this.managedTextures = [];\n\n this._unknownBoundTextures = false;\n this.unknownTexture = new BaseTexture();\n\n this.hasIntegerTextures = false;\n }\n\n /** Sets up the renderer context and necessary buffers. */\n contextChange(): void\n {\n const gl = this.gl = this.renderer.gl;\n\n this.CONTEXT_UID = this.renderer.CONTEXT_UID;\n\n this.webGLVersion = this.renderer.context.webGLVersion;\n\n this.internalFormats = mapTypeAndFormatToInternalFormat(gl);\n\n const maxTextures = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);\n\n this.boundTextures.length = maxTextures;\n\n for (let i = 0; i < maxTextures; i++)\n {\n this.boundTextures[i] = null;\n }\n\n // TODO move this.. to a nice make empty textures class..\n this.emptyTextures = {};\n\n const emptyTexture2D = new GLTexture(gl.createTexture());\n\n gl.bindTexture(gl.TEXTURE_2D, emptyTexture2D.texture);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array(4));\n\n this.emptyTextures[gl.TEXTURE_2D] = emptyTexture2D;\n this.emptyTextures[gl.TEXTURE_CUBE_MAP] = new GLTexture(gl.createTexture());\n\n gl.bindTexture(gl.TEXTURE_CUBE_MAP, this.emptyTextures[gl.TEXTURE_CUBE_MAP].texture);\n\n for (let i = 0; i < 6; i++)\n {\n gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n }\n\n gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n\n for (let i = 0; i < this.boundTextures.length; i++)\n {\n this.bind(null, i);\n }\n }\n\n /**\n * Bind a texture to a specific location\n *\n * If you want to unbind something, please use `unbind(texture)` instead of `bind(null, textureLocation)`\n * @param texture - Texture to bind\n * @param [location=0] - Location to bind at\n */\n bind(texture: Texture | BaseTexture, location = 0): void\n {\n const { gl } = this;\n\n texture = texture?.castToBaseTexture();\n\n // cannot bind partial texture\n // TODO: report a warning\n if (texture && texture.valid && !texture.parentTextureArray)\n {\n texture.touched = this.renderer.textureGC.count;\n\n const glTexture = texture._glTextures[this.CONTEXT_UID] || this.initTexture(texture);\n\n if (this.boundTextures[location] !== texture)\n {\n if (this.currentLocation !== location)\n {\n this.currentLocation = location;\n gl.activeTexture(gl.TEXTURE0 + location);\n }\n\n gl.bindTexture(texture.target, glTexture.texture);\n }\n\n if (glTexture.dirtyId !== texture.dirtyId)\n {\n if (this.currentLocation !== location)\n {\n this.currentLocation = location;\n gl.activeTexture(gl.TEXTURE0 + location);\n }\n this.updateTexture(texture);\n }\n\n this.boundTextures[location] = texture;\n }\n else\n {\n if (this.currentLocation !== location)\n {\n this.currentLocation = location;\n gl.activeTexture(gl.TEXTURE0 + location);\n }\n\n gl.bindTexture(gl.TEXTURE_2D, this.emptyTextures[gl.TEXTURE_2D].texture);\n this.boundTextures[location] = null;\n }\n }\n\n /** Resets texture location and bound textures Actual `bind(null, i)` calls will be performed at next `unbind()` call */\n reset(): void\n {\n this._unknownBoundTextures = true;\n this.hasIntegerTextures = false;\n this.currentLocation = -1;\n\n for (let i = 0; i < this.boundTextures.length; i++)\n {\n this.boundTextures[i] = this.unknownTexture;\n }\n }\n\n /**\n * Unbind a texture.\n * @param texture - Texture to bind\n */\n unbind(texture?: BaseTexture): void\n {\n const { gl, boundTextures } = this;\n\n if (this._unknownBoundTextures)\n {\n this._unknownBoundTextures = false;\n // someone changed webGL state,\n // we have to be sure that our texture does not appear in multi-texture renderer samplers\n for (let i = 0; i < boundTextures.length; i++)\n {\n if (boundTextures[i] === this.unknownTexture)\n {\n this.bind(null, i);\n }\n }\n }\n\n for (let i = 0; i < boundTextures.length; i++)\n {\n if (boundTextures[i] === texture)\n {\n if (this.currentLocation !== i)\n {\n gl.activeTexture(gl.TEXTURE0 + i);\n this.currentLocation = i;\n }\n\n gl.bindTexture(texture.target, this.emptyTextures[texture.target].texture);\n boundTextures[i] = null;\n }\n }\n }\n\n /**\n * Ensures that current boundTextures all have FLOAT sampler type,\n * see {@link PIXI.SAMPLER_TYPES} for explanation.\n * @param maxTextures - number of locations to check\n */\n ensureSamplerType(maxTextures: number): void\n {\n const { boundTextures, hasIntegerTextures, CONTEXT_UID } = this;\n\n if (!hasIntegerTextures)\n {\n return;\n }\n\n for (let i = maxTextures - 1; i >= 0; --i)\n {\n const tex = boundTextures[i];\n\n if (tex)\n {\n const glTexture = tex._glTextures[CONTEXT_UID];\n\n if (glTexture.samplerType !== SAMPLER_TYPES.FLOAT)\n {\n this.renderer.texture.unbind(tex);\n }\n }\n }\n }\n\n /**\n * Initialize a texture\n * @private\n * @param texture - Texture to initialize\n */\n initTexture(texture: BaseTexture): GLTexture\n {\n const glTexture = new GLTexture(this.gl.createTexture());\n\n // guarantee an update..\n glTexture.dirtyId = -1;\n\n texture._glTextures[this.CONTEXT_UID] = glTexture;\n\n this.managedTextures.push(texture);\n texture.on('dispose', this.destroyTexture, this);\n\n return glTexture;\n }\n\n initTextureType(texture: BaseTexture, glTexture: GLTexture): void\n {\n glTexture.internalFormat = this.internalFormats[texture.type]?.[texture.format] ?? texture.format;\n\n if (this.webGLVersion === 2 && texture.type === TYPES.HALF_FLOAT)\n {\n // TYPES.HALF_FLOAT is WebGL1 HALF_FLOAT_OES\n // we have to convert it to WebGL HALF_FLOAT\n glTexture.type = this.gl.HALF_FLOAT;\n }\n else\n {\n glTexture.type = texture.type;\n }\n }\n\n /**\n * Update a texture\n * @private\n * @param {PIXI.BaseTexture} texture - Texture to initialize\n */\n updateTexture(texture: BaseTexture): void\n {\n const glTexture = texture._glTextures[this.CONTEXT_UID];\n\n if (!glTexture)\n {\n return;\n }\n\n const renderer = this.renderer;\n\n this.initTextureType(texture, glTexture);\n\n if (texture.resource && texture.resource.upload(renderer, texture, glTexture))\n {\n // texture is uploaded, dont do anything!\n if (glTexture.samplerType !== SAMPLER_TYPES.FLOAT)\n {\n this.hasIntegerTextures = true;\n }\n }\n else\n {\n // default, renderTexture-like logic\n const width = texture.realWidth;\n const height = texture.realHeight;\n const gl = renderer.gl;\n\n if (glTexture.width !== width\n || glTexture.height !== height\n || glTexture.dirtyId < 0)\n {\n glTexture.width = width;\n glTexture.height = height;\n\n gl.texImage2D(texture.target, 0,\n glTexture.internalFormat,\n width,\n height,\n 0,\n texture.format,\n glTexture.type,\n null);\n }\n }\n\n // lets only update what changes..\n if (texture.dirtyStyleId !== glTexture.dirtyStyleId)\n {\n this.updateTextureStyle(texture);\n }\n glTexture.dirtyId = texture.dirtyId;\n }\n\n /**\n * Deletes the texture from WebGL\n * @private\n * @param texture - the texture to destroy\n * @param [skipRemove=false] - Whether to skip removing the texture from the TextureManager.\n */\n destroyTexture(texture: BaseTexture | Texture, skipRemove?: boolean): void\n {\n const { gl } = this;\n\n texture = texture.castToBaseTexture();\n\n if (texture._glTextures[this.CONTEXT_UID])\n {\n this.unbind(texture);\n\n gl.deleteTexture(texture._glTextures[this.CONTEXT_UID].texture);\n texture.off('dispose', this.destroyTexture, this);\n\n delete texture._glTextures[this.CONTEXT_UID];\n\n if (!skipRemove)\n {\n const i = this.managedTextures.indexOf(texture);\n\n if (i !== -1)\n {\n removeItems(this.managedTextures, i, 1);\n }\n }\n }\n }\n\n /**\n * Update texture style such as mipmap flag\n * @private\n * @param {PIXI.BaseTexture} texture - Texture to update\n */\n updateTextureStyle(texture: BaseTexture): void\n {\n const glTexture = texture._glTextures[this.CONTEXT_UID];\n\n if (!glTexture)\n {\n return;\n }\n\n if ((texture.mipmap === MIPMAP_MODES.POW2 || this.webGLVersion !== 2) && !texture.isPowerOfTwo)\n {\n glTexture.mipmap = false;\n }\n else\n {\n glTexture.mipmap = texture.mipmap >= 1;\n }\n\n if (this.webGLVersion !== 2 && !texture.isPowerOfTwo)\n {\n glTexture.wrapMode = WRAP_MODES.CLAMP;\n }\n else\n {\n glTexture.wrapMode = texture.wrapMode;\n }\n\n if (texture.resource && texture.resource.style(this.renderer, texture, glTexture))\n {\n // style is set, dont do anything!\n }\n else\n {\n this.setStyle(texture, glTexture);\n }\n\n glTexture.dirtyStyleId = texture.dirtyStyleId;\n }\n\n /**\n * Set style for texture\n * @private\n * @param texture - Texture to update\n * @param glTexture\n */\n setStyle(texture: BaseTexture, glTexture: GLTexture): void\n {\n const gl = this.gl;\n\n if (glTexture.mipmap && texture.mipmap !== MIPMAP_MODES.ON_MANUAL)\n {\n gl.generateMipmap(texture.target);\n }\n\n gl.texParameteri(texture.target, gl.TEXTURE_WRAP_S, glTexture.wrapMode);\n gl.texParameteri(texture.target, gl.TEXTURE_WRAP_T, glTexture.wrapMode);\n\n if (glTexture.mipmap)\n {\n /* eslint-disable max-len */\n gl.texParameteri(texture.target, gl.TEXTURE_MIN_FILTER, texture.scaleMode === SCALE_MODES.LINEAR ? gl.LINEAR_MIPMAP_LINEAR : gl.NEAREST_MIPMAP_NEAREST);\n /* eslint-disable max-len */\n\n const anisotropicExt = this.renderer.context.extensions.anisotropicFiltering;\n\n if (anisotropicExt && texture.anisotropicLevel > 0 && texture.scaleMode === SCALE_MODES.LINEAR)\n {\n const level = Math.min(texture.anisotropicLevel, gl.getParameter(anisotropicExt.MAX_TEXTURE_MAX_ANISOTROPY_EXT));\n\n gl.texParameterf(texture.target, anisotropicExt.TEXTURE_MAX_ANISOTROPY_EXT, level);\n }\n }\n else\n {\n gl.texParameteri(texture.target, gl.TEXTURE_MIN_FILTER, texture.scaleMode === SCALE_MODES.LINEAR ? gl.LINEAR : gl.NEAREST);\n }\n\n gl.texParameteri(texture.target, gl.TEXTURE_MAG_FILTER, texture.scaleMode === SCALE_MODES.LINEAR ? gl.LINEAR : gl.NEAREST);\n }\n\n destroy(): void\n {\n this.renderer = null;\n }\n}\n","import { FORMATS, TYPES } from '@pixi/constants';\n\n/**\n * Returns a lookup table that maps each type-format pair to a compatible internal format.\n * @memberof PIXI\n * @function mapTypeAndFormatToInternalFormat\n * @private\n * @param {WebGLRenderingContext} gl - The rendering context.\n * @returns Lookup table.\n */\nexport function mapTypeAndFormatToInternalFormat(gl: WebGLRenderingContextBase):\n{ [type: number]: { [format: number]: number } }\n{\n let table;\n\n if ('WebGL2RenderingContext' in globalThis && gl instanceof globalThis.WebGL2RenderingContext)\n {\n table = {\n [TYPES.UNSIGNED_BYTE]: {\n [FORMATS.RGBA]: gl.RGBA8,\n [FORMATS.RGB]: gl.RGB8,\n [FORMATS.RG]: gl.RG8,\n [FORMATS.RED]: gl.R8,\n [FORMATS.RGBA_INTEGER]: gl.RGBA8UI,\n [FORMATS.RGB_INTEGER]: gl.RGB8UI,\n [FORMATS.RG_INTEGER]: gl.RG8UI,\n [FORMATS.RED_INTEGER]: gl.R8UI,\n [FORMATS.ALPHA]: gl.ALPHA,\n [FORMATS.LUMINANCE]: gl.LUMINANCE,\n [FORMATS.LUMINANCE_ALPHA]: gl.LUMINANCE_ALPHA,\n },\n [TYPES.BYTE]: {\n [FORMATS.RGBA]: gl.RGBA8_SNORM,\n [FORMATS.RGB]: gl.RGB8_SNORM,\n [FORMATS.RG]: gl.RG8_SNORM,\n [FORMATS.RED]: gl.R8_SNORM,\n [FORMATS.RGBA_INTEGER]: gl.RGBA8I,\n [FORMATS.RGB_INTEGER]: gl.RGB8I,\n [FORMATS.RG_INTEGER]: gl.RG8I,\n [FORMATS.RED_INTEGER]: gl.R8I,\n },\n [TYPES.UNSIGNED_SHORT]: {\n [FORMATS.RGBA_INTEGER]: gl.RGBA16UI,\n [FORMATS.RGB_INTEGER]: gl.RGB16UI,\n [FORMATS.RG_INTEGER]: gl.RG16UI,\n [FORMATS.RED_INTEGER]: gl.R16UI,\n [FORMATS.DEPTH_COMPONENT]: gl.DEPTH_COMPONENT16,\n },\n [TYPES.SHORT]: {\n [FORMATS.RGBA_INTEGER]: gl.RGBA16I,\n [FORMATS.RGB_INTEGER]: gl.RGB16I,\n [FORMATS.RG_INTEGER]: gl.RG16I,\n [FORMATS.RED_INTEGER]: gl.R16I,\n },\n [TYPES.UNSIGNED_INT]: {\n [FORMATS.RGBA_INTEGER]: gl.RGBA32UI,\n [FORMATS.RGB_INTEGER]: gl.RGB32UI,\n [FORMATS.RG_INTEGER]: gl.RG32UI,\n [FORMATS.RED_INTEGER]: gl.R32UI,\n [FORMATS.DEPTH_COMPONENT]: gl.DEPTH_COMPONENT24,\n },\n [TYPES.INT]: {\n [FORMATS.RGBA_INTEGER]: gl.RGBA32I,\n [FORMATS.RGB_INTEGER]: gl.RGB32I,\n [FORMATS.RG_INTEGER]: gl.RG32I,\n [FORMATS.RED_INTEGER]: gl.R32I,\n },\n [TYPES.FLOAT]: {\n [FORMATS.RGBA]: gl.RGBA32F,\n [FORMATS.RGB]: gl.RGB32F,\n [FORMATS.RG]: gl.RG32F,\n [FORMATS.RED]: gl.R32F,\n [FORMATS.DEPTH_COMPONENT]: gl.DEPTH_COMPONENT32F,\n },\n [TYPES.HALF_FLOAT]: {\n [FORMATS.RGBA]: gl.RGBA16F,\n [FORMATS.RGB]: gl.RGB16F,\n [FORMATS.RG]: gl.RG16F,\n [FORMATS.RED]: gl.R16F,\n },\n [TYPES.UNSIGNED_SHORT_5_6_5]: {\n [FORMATS.RGB]: gl.RGB565,\n },\n [TYPES.UNSIGNED_SHORT_4_4_4_4]: {\n [FORMATS.RGBA]: gl.RGBA4,\n },\n [TYPES.UNSIGNED_SHORT_5_5_5_1]: {\n [FORMATS.RGBA]: gl.RGB5_A1,\n },\n [TYPES.UNSIGNED_INT_2_10_10_10_REV]: {\n [FORMATS.RGBA]: gl.RGB10_A2,\n [FORMATS.RGBA_INTEGER]: gl.RGB10_A2UI,\n },\n [TYPES.UNSIGNED_INT_10F_11F_11F_REV]: {\n [FORMATS.RGB]: gl.R11F_G11F_B10F,\n },\n [TYPES.UNSIGNED_INT_5_9_9_9_REV]: {\n [FORMATS.RGB]: gl.RGB9_E5,\n },\n [TYPES.UNSIGNED_INT_24_8]: {\n [FORMATS.DEPTH_STENCIL]: gl.DEPTH24_STENCIL8,\n },\n [TYPES.FLOAT_32_UNSIGNED_INT_24_8_REV]: {\n [FORMATS.DEPTH_STENCIL]: gl.DEPTH32F_STENCIL8,\n },\n };\n }\n else\n {\n table = {\n [TYPES.UNSIGNED_BYTE]: {\n [FORMATS.RGBA]: gl.RGBA,\n [FORMATS.RGB]: gl.RGB,\n [FORMATS.ALPHA]: gl.ALPHA,\n [FORMATS.LUMINANCE]: gl.LUMINANCE,\n [FORMATS.LUMINANCE_ALPHA]: gl.LUMINANCE_ALPHA,\n },\n [TYPES.UNSIGNED_SHORT_5_6_5]: {\n [FORMATS.RGB]: gl.RGB,\n },\n [TYPES.UNSIGNED_SHORT_4_4_4_4]: {\n [FORMATS.RGBA]: gl.RGBA,\n },\n [TYPES.UNSIGNED_SHORT_5_5_5_1]: {\n [FORMATS.RGBA]: gl.RGBA,\n },\n };\n }\n\n return table;\n}\n","import { hex2string, hex2rgb, EventEmitter, deprecation } from '@pixi/utils';\nimport { Matrix, Rectangle } from '@pixi/math';\nimport { RENDERER_TYPE } from '@pixi/constants';\nimport { settings } from '@pixi/settings';\nimport { RenderTexture } from './renderTexture/RenderTexture';\n\nimport type { SCALE_MODES, MSAA_QUALITY } from '@pixi/constants';\nimport type { ISystemConstructor } from './ISystem';\nimport type { IRenderingContext } from './IRenderingContext';\nimport type { IRenderableContainer, IRenderableObject } from './IRenderableObject';\n\nconst tempMatrix = new Matrix();\n\nexport interface IRendererOptions extends GlobalMixins.IRendererOptions\n{\n width?: number;\n height?: number;\n view?: HTMLCanvasElement;\n useContextAlpha?: boolean | 'notMultiplied';\n /**\n * Use `backgroundAlpha` instead.\n * @deprecated\n */\n transparent?: boolean;\n autoDensity?: boolean;\n antialias?: boolean;\n resolution?: number;\n preserveDrawingBuffer?: boolean;\n clearBeforeRender?: boolean;\n backgroundColor?: number;\n backgroundAlpha?: number;\n powerPreference?: WebGLPowerPreference;\n context?: IRenderingContext;\n}\n\nexport interface IRendererPlugins\n{\n [key: string]: any;\n}\n\nexport interface IRendererRenderOptions\n{\n renderTexture?: RenderTexture;\n clear?: boolean;\n transform?: Matrix;\n skipUpdateTransform?: boolean;\n}\n\nexport interface IGenerateTextureOptions\n{\n scaleMode?: SCALE_MODES;\n resolution?: number;\n region?: Rectangle;\n multisample?: MSAA_QUALITY;\n}\n\n/**\n * The AbstractRenderer is the base for a PixiJS Renderer. It is extended by the {@link PIXI.CanvasRenderer}\n * and {@link PIXI.Renderer} which can be used for rendering a PixiJS scene.\n * @abstract\n * @class\n * @extends PIXI.utils.EventEmitter\n * @memberof PIXI\n */\nexport abstract class AbstractRenderer extends EventEmitter\n{\n public resolution: number;\n public clearBeforeRender?: boolean;\n public readonly options: IRendererOptions;\n public readonly type: RENDERER_TYPE;\n public readonly screen: Rectangle;\n public readonly view: HTMLCanvasElement;\n public readonly plugins: IRendererPlugins;\n public readonly useContextAlpha: boolean | 'notMultiplied';\n public readonly autoDensity: boolean;\n public readonly preserveDrawingBuffer: boolean;\n\n protected _backgroundColor: number;\n protected _backgroundColorString: string;\n _backgroundColorRgba: number[];\n _lastObjectRendered: IRenderableObject;\n\n /**\n * @param type - The renderer type.\n * @param [options] - The optional renderer parameters.\n * @param {number} [options.width=800] - The width of the screen.\n * @param {number} [options.height=600] - The height of the screen.\n * @param {HTMLCanvasElement} [options.view] - The canvas to use as a view, optional.\n * @param {boolean} [options.useContextAlpha=true] - Pass-through value for canvas' context `alpha` property.\n * If you want to set transparency, please use `backgroundAlpha`. This option is for cases where the\n * canvas needs to be opaque, possibly for performance reasons on some older devices.\n * @param {boolean} [options.autoDensity=false] - Resizes renderer view in CSS pixels to allow for\n * resolutions other than 1.\n * @param {boolean} [options.antialias=false] - Sets antialias\n * @param {number} [options.resolution=PIXI.settings.RESOLUTION] - The resolution / device pixel ratio of the renderer.\n * @param {boolean} [options.preserveDrawingBuffer=false] - Enables drawing buffer preservation,\n * enable this if you need to call toDataUrl on the WebGL context.\n * @param {boolean} [options.clearBeforeRender=true] - This sets if the renderer will clear the canvas or\n * not before the new render pass.\n * @param {number} [options.backgroundColor=0x000000] - The background color of the rendered area\n * (shown if not transparent).\n * @param {number} [options.backgroundAlpha=1] - Value from 0 (fully transparent) to 1 (fully opaque).\n */\n constructor(type: RENDERER_TYPE = RENDERER_TYPE.UNKNOWN, options?: IRendererOptions)\n {\n super();\n\n // Add the default render options\n options = Object.assign({}, settings.RENDER_OPTIONS, options);\n\n /**\n * The supplied constructor options.\n * @member {object}\n * @readonly\n */\n this.options = options;\n\n /**\n * The type of the renderer.\n * @member {number}\n * @default PIXI.RENDERER_TYPE.UNKNOWN\n * @see PIXI.RENDERER_TYPE\n */\n this.type = type;\n\n /**\n * Measurements of the screen. (0, 0, screenWidth, screenHeight).\n *\n * Its safe to use as filterArea or hitArea for the whole stage.\n * @member {PIXI.Rectangle}\n */\n this.screen = new Rectangle(0, 0, options.width, options.height);\n\n /**\n * The canvas element that everything is drawn to.\n * @member {HTMLCanvasElement}\n */\n this.view = options.view || settings.ADAPTER.createCanvas();\n\n /**\n * The resolution / device pixel ratio of the renderer.\n * @member {number}\n * @default PIXI.settings.RESOLUTION\n */\n this.resolution = options.resolution || settings.RESOLUTION;\n\n /**\n * Pass-thru setting for the canvas' context `alpha` property. This is typically\n * not something you need to fiddle with. If you want transparency, use `backgroundAlpha`.\n * @member {boolean}\n */\n this.useContextAlpha = options.useContextAlpha;\n\n /**\n * Whether CSS dimensions of canvas view should be resized to screen dimensions automatically.\n * @member {boolean}\n */\n this.autoDensity = !!options.autoDensity;\n\n /**\n * The value of the preserveDrawingBuffer flag affects whether or not the contents of\n * the stencil buffer is retained after rendering.\n * @member {boolean}\n */\n this.preserveDrawingBuffer = options.preserveDrawingBuffer;\n\n /**\n * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent PixiJS will use a canvas sized fillRect operation every\n * frame to set the canvas background color. If the scene is transparent PixiJS will use clearRect\n * to clear the canvas every frame. Disable this by setting this to false. For example, if\n * your game has a canvas filling background image you often don't need this set.\n * @member {boolean}\n * @default\n */\n this.clearBeforeRender = options.clearBeforeRender;\n\n /**\n * The background color as a number.\n * @member {number}\n * @protected\n */\n this._backgroundColor = 0x000000;\n\n /**\n * The background color as an [R, G, B, A] array.\n * @member {number[]}\n * @protected\n */\n this._backgroundColorRgba = [0, 0, 0, 1];\n\n /**\n * The background color as a string.\n * @member {string}\n * @protected\n */\n this._backgroundColorString = '#000000';\n\n this.backgroundColor = options.backgroundColor || this._backgroundColor; // run bg color setter\n this.backgroundAlpha = options.backgroundAlpha;\n\n // @deprecated\n if (options.transparent !== undefined)\n {\n // #if _DEBUG\n deprecation('6.0.0', 'Option transparent is deprecated, please use backgroundAlpha instead.');\n // #endif\n this.useContextAlpha = options.transparent;\n this.backgroundAlpha = options.transparent ? 0 : 1;\n }\n\n /**\n * The last root object that the renderer tried to render.\n * @member {PIXI.DisplayObject}\n * @protected\n */\n this._lastObjectRendered = null;\n\n /**\n * Collection of plugins.\n * @readonly\n * @member {object}\n */\n this.plugins = {};\n }\n\n /**\n * Initialize the plugins.\n * @protected\n * @param {object} staticMap - The dictionary of statically saved plugins.\n */\n initPlugins(staticMap: IRendererPlugins): void\n {\n for (const o in staticMap)\n {\n this.plugins[o] = new (staticMap[o])(this);\n }\n }\n\n /**\n * Same as view.width, actual number of pixels in the canvas by horizontal.\n * @member {number}\n * @readonly\n * @default 800\n */\n get width(): number\n {\n return this.view.width;\n }\n\n /**\n * Same as view.height, actual number of pixels in the canvas by vertical.\n * @member {number}\n * @readonly\n * @default 600\n */\n get height(): number\n {\n return this.view.height;\n }\n\n /**\n * Resizes the screen and canvas as close as possible to the specified width and height.\n * Canvas dimensions are multiplied by resolution and rounded to the nearest integers.\n * The new canvas dimensions divided by the resolution become the new screen dimensions.\n * @param desiredScreenWidth - The desired width of the screen.\n * @param desiredScreenHeight - The desired height of the screen.\n */\n resize(desiredScreenWidth: number, desiredScreenHeight: number): void\n {\n this.view.width = Math.round(desiredScreenWidth * this.resolution);\n this.view.height = Math.round(desiredScreenHeight * this.resolution);\n\n const screenWidth = this.view.width / this.resolution;\n const screenHeight = this.view.height / this.resolution;\n\n this.screen.width = screenWidth;\n this.screen.height = screenHeight;\n\n if (this.autoDensity)\n {\n this.view.style.width = `${screenWidth}px`;\n this.view.style.height = `${screenHeight}px`;\n }\n\n /**\n * Fired after view has been resized.\n * @event PIXI.Renderer#resize\n * @param {number} screenWidth - The new width of the screen.\n * @param {number} screenHeight - The new height of the screen.\n */\n this.emit('resize', screenWidth, screenHeight);\n }\n\n /**\n * Useful function that returns a texture of the display object that can then be used to create sprites\n * This can be quite useful if your displayObject is complicated and needs to be reused multiple times.\n * @method PIXI.AbstractRenderer#generateTexture\n * @param displayObject - The displayObject the object will be generated from.\n * @param {object} options - Generate texture options.\n * @param {PIXI.SCALE_MODES} options.scaleMode - The scale mode of the texture.\n * @param {number} options.resolution - The resolution / device pixel ratio of the texture being generated.\n * @param {PIXI.Rectangle} options.region - The region of the displayObject, that shall be rendered,\n * if no region is specified, defaults to the local bounds of the displayObject.\n * @param {PIXI.MSAA_QUALITY} options.multisample - The number of samples of the frame buffer.\n * @returns A texture of the graphics object.\n */\n generateTexture(displayObject: IRenderableObject, options?: IGenerateTextureOptions): RenderTexture;\n\n /**\n * Please use the options argument instead.\n * @method PIXI.AbstractRenderer#generateTexture\n * @deprecated Since 6.1.0\n * @param displayObject - The displayObject the object will be generated from.\n * @param scaleMode - The scale mode of the texture.\n * @param resolution - The resolution / device pixel ratio of the texture being generated.\n * @param region - The region of the displayObject, that shall be rendered,\n * if no region is specified, defaults to the local bounds of the displayObject.\n * @returns A texture of the graphics object.\n */\n generateTexture(\n displayObject: IRenderableObject,\n scaleMode?: SCALE_MODES,\n resolution?: number,\n region?: Rectangle): RenderTexture;\n\n /**\n * @ignore\n */\n generateTexture(displayObject: IRenderableObject,\n options: IGenerateTextureOptions | SCALE_MODES = {},\n resolution?: number, region?: Rectangle): RenderTexture\n {\n // @deprecated parameters spread, use options instead\n if (typeof options === 'number')\n {\n // #if _DEBUG\n deprecation('6.1.0', 'generateTexture options (scaleMode, resolution, region) are now object options.');\n // #endif\n\n options = { scaleMode: options, resolution, region };\n }\n\n const { region: manualRegion, ...textureOptions } = options;\n\n region = manualRegion || (displayObject as IRenderableContainer).getLocalBounds(null, true);\n\n // minimum texture size is 1x1, 0x0 will throw an error\n if (region.width === 0) region.width = 1;\n if (region.height === 0) region.height = 1;\n\n const renderTexture = RenderTexture.create(\n {\n width: region.width,\n height: region.height,\n ...textureOptions,\n });\n\n tempMatrix.tx = -region.x;\n tempMatrix.ty = -region.y;\n\n this.render(displayObject, {\n renderTexture,\n clear: false,\n transform: tempMatrix,\n skipUpdateTransform: !!displayObject.parent\n });\n\n return renderTexture;\n }\n\n /**\n * Adds a new system to the renderer.\n * @param ClassRef - Class reference\n * @param name - Property name for system\n * @returns Return instance of renderer\n */\n abstract addSystem(ClassRef: ISystemConstructor, name: string): this;\n\n abstract render(displayObject: IRenderableObject, options?: IRendererRenderOptions): void;\n\n /**\n * Removes everything from the renderer and optionally removes the Canvas DOM element.\n * @param [removeView=false] - Removes the Canvas element from the DOM.\n */\n destroy(removeView?: boolean): void\n {\n for (const o in this.plugins)\n {\n this.plugins[o].destroy();\n this.plugins[o] = null;\n }\n\n if (removeView && this.view.parentNode)\n {\n this.view.parentNode.removeChild(this.view);\n }\n\n const thisAny = this as any;\n\n // null-ing all objects, that's a tradition!\n\n thisAny.plugins = null;\n thisAny.type = RENDERER_TYPE.UNKNOWN;\n thisAny.view = null;\n thisAny.screen = null;\n thisAny._tempDisplayObjectParent = null;\n thisAny.options = null;\n this._backgroundColorRgba = null;\n this._backgroundColorString = null;\n this._lastObjectRendered = null;\n }\n\n /**\n * The background color to fill if not transparent\n * @member {number}\n */\n get backgroundColor(): number\n {\n return this._backgroundColor;\n }\n\n set backgroundColor(value: number)\n {\n this._backgroundColor = value;\n this._backgroundColorString = hex2string(value);\n hex2rgb(value, this._backgroundColorRgba);\n }\n\n /**\n * The background color alpha. Setting this to 0 will make the canvas transparent.\n * @member {number}\n */\n get backgroundAlpha(): number\n {\n return this._backgroundColorRgba[3];\n }\n set backgroundAlpha(value: number)\n {\n this._backgroundColorRgba[3] = value;\n }\n}\n","export class GLBuffer\n{\n buffer: WebGLBuffer;\n updateID: number;\n byteLength: number;\n refCount: number;\n\n constructor(buffer?: WebGLBuffer)\n {\n this.buffer = buffer || null;\n this.updateID = -1;\n this.byteLength = -1;\n this.refCount = 0;\n }\n}\n","import { GLBuffer } from './GLBuffer';\n\nimport type { Renderer } from '../Renderer';\nimport type { IRenderingContext } from '../IRenderingContext';\nimport type { Buffer } from './Buffer';\nimport type { ISystem } from '../ISystem';\n\n/**\n * System plugin to the renderer to manage buffers.\n *\n * WebGL uses Buffers as a way to store objects to the GPU.\n * This system makes working with them a lot easier.\n *\n * Buffers are used in three main places in WebGL\n * - geometry information\n * - Uniform information (via uniform buffer objects - a WebGL 2 only feature)\n * - Transform feedback information. (WebGL 2 only feature)\n *\n * This system will handle the binding of buffers to the GPU as well as uploading\n * them. With this system, you never need to work directly with GPU buffers, but instead work with\n * the PIXI.Buffer class.\n * @class\n * @memberof PIXI\n */\nexport class BufferSystem implements ISystem\n{\n CONTEXT_UID: number;\n gl: IRenderingContext;\n\n /** Cache for all buffers by id, used in case renderer gets destroyed or for profiling */\n readonly managedBuffers: {[key: number]: Buffer};\n\n /** Cache keeping track of the base bound buffer bases */\n readonly boundBufferBases: {[key: number]: Buffer};\n\n private renderer: Renderer;\n\n /**\n * @param {PIXI.Renderer} renderer - The renderer this System works for.\n */\n constructor(renderer: Renderer)\n {\n this.renderer = renderer;\n this.managedBuffers = {};\n this.boundBufferBases = {};\n }\n\n /**\n * @ignore\n */\n destroy(): void\n {\n this.renderer = null;\n }\n\n /** Sets up the renderer context and necessary buffers. */\n protected contextChange(): void\n {\n this.disposeAll(true);\n\n this.gl = this.renderer.gl;\n\n // TODO fill out...\n this.CONTEXT_UID = this.renderer.CONTEXT_UID;\n }\n\n /**\n * This binds specified buffer. On first run, it will create the webGL buffers for the context too\n * @param buffer - the buffer to bind to the renderer\n */\n bind(buffer: Buffer): void\n {\n const { gl, CONTEXT_UID } = this;\n\n const glBuffer = buffer._glBuffers[CONTEXT_UID] || this.createGLBuffer(buffer);\n\n gl.bindBuffer(buffer.type, glBuffer.buffer);\n }\n\n /**\n * Binds an uniform buffer to at the given index.\n *\n * A cache is used so a buffer will not be bound again if already bound.\n * @param buffer - the buffer to bind\n * @param index - the base index to bind it to.\n */\n bindBufferBase(buffer: Buffer, index: number): void\n {\n const { gl, CONTEXT_UID } = this;\n\n if (this.boundBufferBases[index] !== buffer)\n {\n const glBuffer = buffer._glBuffers[CONTEXT_UID] || this.createGLBuffer(buffer);\n\n this.boundBufferBases[index] = buffer;\n\n gl.bindBufferBase(gl.UNIFORM_BUFFER, index, glBuffer.buffer);\n }\n }\n\n /**\n * Binds a buffer whilst also binding its range.\n * This will make the buffer start from the offset supplied rather than 0 when it is read.\n * @param buffer - the buffer to bind\n * @param index - the base index to bind at, defaults to 0\n * @param offset - the offset to bind at (this is blocks of 256). 0 = 0, 1 = 256, 2 = 512 etc\n */\n bindBufferRange(buffer: Buffer, index?: number, offset?: number): void\n {\n const { gl, CONTEXT_UID } = this;\n\n offset = offset || 0;\n\n const glBuffer = buffer._glBuffers[CONTEXT_UID] || this.createGLBuffer(buffer);\n\n gl.bindBufferRange(gl.UNIFORM_BUFFER, index || 0, glBuffer.buffer, offset * 256, 256);\n }\n\n /**\n * Will ensure the data in the buffer is uploaded to the GPU.\n * @param {PIXI.Buffer} buffer - the buffer to update\n */\n update(buffer: Buffer): void\n {\n const { gl, CONTEXT_UID } = this;\n\n const glBuffer = buffer._glBuffers[CONTEXT_UID];\n\n if (buffer._updateID === glBuffer.updateID)\n {\n return;\n }\n\n glBuffer.updateID = buffer._updateID;\n\n gl.bindBuffer(buffer.type, glBuffer.buffer);\n\n if (glBuffer.byteLength >= buffer.data.byteLength)\n {\n // offset is always zero for now!\n gl.bufferSubData(buffer.type, 0, buffer.data);\n }\n else\n {\n const drawType = buffer.static ? gl.STATIC_DRAW : gl.DYNAMIC_DRAW;\n\n glBuffer.byteLength = buffer.data.byteLength;\n gl.bufferData(buffer.type, buffer.data, drawType);\n }\n }\n\n /**\n * Disposes buffer\n * @param {PIXI.Buffer} buffer - buffer with data\n * @param {boolean} [contextLost=false] - If context was lost, we suppress deleteVertexArray\n */\n dispose(buffer: Buffer, contextLost?: boolean): void\n {\n if (!this.managedBuffers[buffer.id])\n {\n return;\n }\n\n delete this.managedBuffers[buffer.id];\n\n const glBuffer = buffer._glBuffers[this.CONTEXT_UID];\n const gl = this.gl;\n\n buffer.disposeRunner.remove(this);\n\n if (!glBuffer)\n {\n return;\n }\n\n if (!contextLost)\n {\n gl.deleteBuffer(glBuffer.buffer);\n }\n\n delete buffer._glBuffers[this.CONTEXT_UID];\n }\n\n /**\n * dispose all WebGL resources of all managed buffers\n * @param {boolean} [contextLost=false] - If context was lost, we suppress `gl.delete` calls\n */\n disposeAll(contextLost?: boolean): void\n {\n const all: Array<any> = Object.keys(this.managedBuffers);\n\n for (let i = 0; i < all.length; i++)\n {\n this.dispose(this.managedBuffers[all[i]], contextLost);\n }\n }\n\n /**\n * creates and attaches a GLBuffer object tied to the current context.\n * @param buffer\n * @protected\n */\n protected createGLBuffer(buffer: Buffer): GLBuffer\n {\n const { CONTEXT_UID, gl } = this;\n\n buffer._glBuffers[CONTEXT_UID] = new GLBuffer(gl.createBuffer());\n\n this.managedBuffers[buffer.id] = buffer;\n\n buffer.disposeRunner.add(this);\n\n return buffer._glBuffers[CONTEXT_UID];\n }\n}\n","import { AbstractRenderer } from './AbstractRenderer';\nimport { sayHello, isWebGLSupported, deprecation } from '@pixi/utils';\nimport { MaskSystem } from './mask/MaskSystem';\nimport { StencilSystem } from './mask/StencilSystem';\nimport { ScissorSystem } from './mask/ScissorSystem';\nimport { FilterSystem } from './filters/FilterSystem';\nimport { FramebufferSystem } from './framebuffer/FramebufferSystem';\nimport { RenderTextureSystem } from './renderTexture/RenderTextureSystem';\nimport { TextureSystem } from './textures/TextureSystem';\nimport { ProjectionSystem } from './projection/ProjectionSystem';\nimport { StateSystem } from './state/StateSystem';\nimport { GeometrySystem } from './geometry/GeometrySystem';\nimport { ShaderSystem } from './shader/ShaderSystem';\nimport { ContextSystem } from './context/ContextSystem';\nimport { BatchSystem } from './batch/BatchSystem';\nimport { TextureGCSystem } from './textures/TextureGCSystem';\nimport { MSAA_QUALITY, RENDERER_TYPE } from '@pixi/constants';\nimport { UniformGroup } from './shader/UniformGroup';\nimport type { Rectangle } from '@pixi/math';\nimport { Matrix } from '@pixi/math';\nimport { Runner } from '@pixi/runner';\nimport { BufferSystem } from './geometry/BufferSystem';\nimport { RenderTexture } from './renderTexture/RenderTexture';\n\nimport type { SCALE_MODES } from '@pixi/constants';\nimport type { IRendererOptions, IRendererPlugins, IRendererRenderOptions,\n IGenerateTextureOptions } from './AbstractRenderer';\nimport type { ISystemConstructor } from './ISystem';\nimport type { IRenderingContext } from './IRenderingContext';\nimport type { IRenderableObject } from './IRenderableObject';\nimport { extensions, ExtensionType } from '@pixi/extensions';\n\nexport interface IRendererPluginConstructor\n{\n new (renderer: Renderer, options?: any): IRendererPlugin;\n}\n\nexport interface IRendererPlugin\n{\n destroy(): void;\n}\n\n/**\n * The Renderer draws the scene and all its content onto a WebGL enabled canvas.\n *\n * This renderer should be used for browsers that support WebGL.\n *\n * This renderer works by automatically managing WebGLBatchesm, so no need for Sprite Batches or Sprite Clouds.\n * Don't forget to add the view to your DOM or you will not see anything!\n *\n * Renderer is composed of systems that manage specific tasks. The following systems are added by default\n * whenever you create a renderer:\n *\n * | System | Description |\n * | ------------------------------------ | ----------------------------------------------------------------------------- |\n * | {@link PIXI.BatchSystem} | This manages object renderers that defer rendering until a flush. |\n * | {@link PIXI.ContextSystem} | This manages the WebGL context and extensions. |\n * | {@link PIXI.EventSystem} | This manages UI events. |\n * | {@link PIXI.FilterSystem} | This manages the filtering pipeline for post-processing effects. |\n * | {@link PIXI.FramebufferSystem} | This manages framebuffers, which are used for offscreen rendering. |\n * | {@link PIXI.GeometrySystem} | This manages geometries & buffers, which are used to draw object meshes. |\n * | {@link PIXI.MaskSystem} | This manages masking operations. |\n * | {@link PIXI.ProjectionSystem} | This manages the `projectionMatrix`, used by shaders to get NDC coordinates. |\n * | {@link PIXI.RenderTextureSystem} | This manages render-textures, which are an abstraction over framebuffers. |\n * | {@link PIXI.ScissorSystem} | This handles scissor masking, and is used internally by {@link MaskSystem} |\n * | {@link PIXI.ShaderSystem} | This manages shaders, programs that run on the GPU to calculate 'em pixels. |\n * | {@link PIXI.StateSystem} | This manages the WebGL state variables like blend mode, depth testing, etc. |\n * | {@link PIXI.StencilSystem} | This handles stencil masking, and is used internally by {@link MaskSystem} |\n * | {@link PIXI.TextureSystem} | This manages textures and their resources on the GPU. |\n * | {@link PIXI.TextureGCSystem} | This will automatically remove textures from the GPU if they are not used. |\n *\n * The breadth of the API surface provided by the renderer is contained within these systems.\n * @memberof PIXI\n */\nexport class Renderer extends AbstractRenderer\n{\n /**\n * WebGL context, set by {@link PIXI.ContextSystem this.context}.\n * @readonly\n * @member {WebGLRenderingContext}\n */\n public gl: IRenderingContext;\n\n /** Global uniforms */\n public globalUniforms: UniformGroup;\n\n /** Unique UID assigned to the renderer's WebGL context. */\n public CONTEXT_UID: number;\n\n /**\n * Flag if we are rendering to the screen vs renderTexture\n * @readonly\n * @default true\n */\n public renderingToScreen: boolean;\n\n /**\n * The number of msaa samples of the canvas.\n * @readonly\n */\n public multisample: MSAA_QUALITY;\n // systems\n\n /**\n * Mask system instance\n * @readonly\n */\n public mask: MaskSystem;\n\n /**\n * Context system instance\n * @readonly\n */\n public context: ContextSystem;\n\n /**\n * State system instance\n * @readonly\n */\n public state: StateSystem;\n\n /**\n * Shader system instance\n * @readonly\n */\n public shader: ShaderSystem;\n\n /**\n * Texture system instance\n * @readonly\n */\n public texture: TextureSystem;\n\n /**\n * Buffer system instance\n * @readonly\n */\n public buffer: BufferSystem;\n\n /**\n * Geometry system instance\n * @readonly\n */\n public geometry: GeometrySystem;\n\n /**\n * Framebuffer system instance\n * @readonly\n */\n public framebuffer: FramebufferSystem;\n\n /**\n * Scissor system instance\n * @readonly\n */\n public scissor: ScissorSystem;\n\n /**\n * Stencil system instance\n * @readonly\n */\n public stencil: StencilSystem;\n\n /**\n * Projection system instance\n * @readonly\n */\n public projection: ProjectionSystem;\n\n /**\n * Texture garbage collector system instance\n * @readonly\n */\n public textureGC: TextureGCSystem;\n\n /**\n * Filter system instance\n * @readonly\n */\n public filter: FilterSystem;\n\n /**\n * RenderTexture system instance\n * @readonly\n */\n public renderTexture: RenderTextureSystem;\n\n /**\n * Batch system instance\n * @readonly\n */\n public batch: BatchSystem;\n\n /**\n * Internal signal instances of **runner**, these\n * are assigned to each system created.\n * @see PIXI.Runner\n * @name runners\n * @private\n * @type {object}\n * @readonly\n * @property {PIXI.Runner} destroy - Destroy runner\n * @property {PIXI.Runner} contextChange - Context change runner\n * @property {PIXI.Runner} reset - Reset runner\n * @property {PIXI.Runner} update - Update runner\n * @property {PIXI.Runner} postrender - Post-render runner\n * @property {PIXI.Runner} prerender - Pre-render runner\n * @property {PIXI.Runner} resize - Resize runner\n */\n runners: {[key: string]: Runner};\n\n /**\n * Create renderer if WebGL is available. Overrideable\n * by the **@pixi/canvas-renderer** package to allow fallback.\n * throws error if WebGL is not available.\n * @param options\n * @private\n */\n static create(options?: IRendererOptions): AbstractRenderer\n {\n if (isWebGLSupported())\n {\n return new Renderer(options);\n }\n\n throw new Error('WebGL unsupported in this browser, use \"pixi.js-legacy\" for fallback canvas2d support.');\n }\n\n /**\n * @param [options] - The optional renderer parameters.\n * @param {number} [options.width=800] - The width of the screen.\n * @param {number} [options.height=600] - The height of the screen.\n * @param {HTMLCanvasElement} [options.view] - The canvas to use as a view, optional.\n * @param {boolean} [options.useContextAlpha=true] - Pass-through value for canvas' context `alpha` property.\n * If you want to set transparency, please use `backgroundAlpha`. This option is for cases where the\n * canvas needs to be opaque, possibly for performance reasons on some older devices.\n * @param {boolean} [options.autoDensity=false] - Resizes renderer view in CSS pixels to allow for\n * resolutions other than 1.\n * @param {boolean} [options.antialias=false] - Sets antialias. If not available natively then FXAA\n * antialiasing is used.\n * @param {number} [options.resolution=PIXI.settings.RESOLUTION] - The resolution / device pixel ratio of the renderer.\n * @param {boolean} [options.clearBeforeRender=true] - This sets if the renderer will clear\n * the canvas or not before the new render pass. If you wish to set this to false, you *must* set\n * preserveDrawingBuffer to `true`.\n * @param {boolean} [options.preserveDrawingBuffer=false] - Enables drawing buffer preservation,\n * enable this if you need to call toDataUrl on the WebGL context.\n * @param {number} [options.backgroundColor=0x000000] - The background color of the rendered area\n * (shown if not transparent).\n * @param {number} [options.backgroundAlpha=1] - Value from 0 (fully transparent) to 1 (fully opaque).\n * @param {string} [options.powerPreference] - Parameter passed to WebGL context, set to \"high-performance\"\n * for devices with dual graphics card.\n * @param {object} [options.context] - If WebGL context already exists, all parameters must be taken from it.\n */\n constructor(options?: IRendererOptions)\n {\n super(RENDERER_TYPE.WEBGL, options);\n\n // the options will have been modified here in the super constructor with pixi's default settings..\n options = this.options;\n\n this.gl = null;\n\n this.CONTEXT_UID = 0;\n\n this.runners = {\n destroy: new Runner('destroy'),\n contextChange: new Runner('contextChange'),\n reset: new Runner('reset'),\n update: new Runner('update'),\n postrender: new Runner('postrender'),\n prerender: new Runner('prerender'),\n resize: new Runner('resize'),\n };\n\n this.runners.contextChange.add(this);\n\n this.globalUniforms = new UniformGroup({\n projectionMatrix: new Matrix(),\n }, true);\n\n this.addSystem(MaskSystem, 'mask')\n .addSystem(ContextSystem, 'context')\n .addSystem(StateSystem, 'state')\n .addSystem(ShaderSystem, 'shader')\n .addSystem(TextureSystem, 'texture')\n .addSystem(BufferSystem, 'buffer')\n .addSystem(GeometrySystem, 'geometry')\n .addSystem(FramebufferSystem, 'framebuffer')\n .addSystem(ScissorSystem, 'scissor')\n .addSystem(StencilSystem, 'stencil')\n .addSystem(ProjectionSystem, 'projection')\n .addSystem(TextureGCSystem, 'textureGC')\n .addSystem(FilterSystem, 'filter')\n .addSystem(RenderTextureSystem, 'renderTexture')\n .addSystem(BatchSystem, 'batch');\n\n this.initPlugins(Renderer.__plugins);\n\n this.multisample = undefined;\n\n /*\n * The options passed in to create a new WebGL context.\n */\n if (options.context)\n {\n this.context.initFromContext(options.context);\n }\n else\n {\n this.context.initFromOptions({\n alpha: !!this.useContextAlpha,\n antialias: options.antialias,\n premultipliedAlpha: this.useContextAlpha && this.useContextAlpha !== 'notMultiplied',\n stencil: true,\n preserveDrawingBuffer: options.preserveDrawingBuffer,\n powerPreference: this.options.powerPreference,\n });\n }\n\n this.renderingToScreen = true;\n\n sayHello(this.context.webGLVersion === 2 ? 'WebGL 2' : 'WebGL 1');\n\n this.resize(this.options.width, this.options.height);\n }\n\n protected contextChange(): void\n {\n const gl = this.gl;\n\n let samples;\n\n if (this.context.webGLVersion === 1)\n {\n const framebuffer = gl.getParameter(gl.FRAMEBUFFER_BINDING);\n\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n\n samples = gl.getParameter(gl.SAMPLES);\n\n gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n }\n else\n {\n const framebuffer = gl.getParameter(gl.DRAW_FRAMEBUFFER_BINDING);\n\n gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, null);\n\n samples = gl.getParameter(gl.SAMPLES);\n\n gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, framebuffer);\n }\n\n if (samples >= MSAA_QUALITY.HIGH)\n {\n this.multisample = MSAA_QUALITY.HIGH;\n }\n else if (samples >= MSAA_QUALITY.MEDIUM)\n {\n this.multisample = MSAA_QUALITY.MEDIUM;\n }\n else if (samples >= MSAA_QUALITY.LOW)\n {\n this.multisample = MSAA_QUALITY.LOW;\n }\n else\n {\n this.multisample = MSAA_QUALITY.NONE;\n }\n }\n\n /**\n * Add a new system to the renderer.\n * @param ClassRef - Class reference\n * @param name - Property name for system, if not specified\n * will use a static `name` property on the class itself. This\n * name will be assigned as s property on the Renderer so make\n * sure it doesn't collide with properties on Renderer.\n * @returns Return instance of renderer\n */\n addSystem(ClassRef: ISystemConstructor, name: string): this\n {\n const system = new ClassRef(this);\n\n if ((this as any)[name])\n {\n throw new Error(`Whoops! The name \"${name}\" is already in use`);\n }\n\n (this as any)[name] = system;\n\n for (const i in this.runners)\n {\n this.runners[i].add(system);\n }\n\n /**\n * Fired after rendering finishes.\n * @event PIXI.Renderer#postrender\n */\n\n /**\n * Fired before rendering starts.\n * @event PIXI.Renderer#prerender\n */\n\n /**\n * Fired when the WebGL context is set.\n * @event PIXI.Renderer#context\n * @param {WebGLRenderingContext} gl - WebGL context.\n */\n\n return this;\n }\n\n /**\n * Renders the object to its WebGL view.\n * @param displayObject - The object to be rendered.\n * @param {object} [options] - Object to use for render options.\n * @param {PIXI.RenderTexture} [options.renderTexture] - The render texture to render to.\n * @param {boolean} [options.clear=true] - Should the canvas be cleared before the new render.\n * @param {PIXI.Matrix} [options.transform] - A transform to apply to the render texture before rendering.\n * @param {boolean} [options.skipUpdateTransform=false] - Should we skip the update transform pass?\n */\n render(displayObject: IRenderableObject, options?: IRendererRenderOptions): void;\n\n /**\n * Please use the `option` render arguments instead.\n * @deprecated Since 6.0.0\n * @param displayObject\n * @param renderTexture\n * @param clear\n * @param transform\n * @param skipUpdateTransform\n */\n render(displayObject: IRenderableObject, renderTexture?: RenderTexture,\n clear?: boolean, transform?: Matrix, skipUpdateTransform?: boolean): void;\n\n /**\n * @ignore\n */\n render(displayObject: IRenderableObject, options?: IRendererRenderOptions | RenderTexture): void\n {\n let renderTexture: RenderTexture;\n let clear: boolean;\n let transform: Matrix;\n let skipUpdateTransform: boolean;\n\n if (options)\n {\n if (options instanceof RenderTexture)\n {\n // #if _DEBUG\n deprecation('6.0.0', 'Renderer#render arguments changed, use options instead.');\n // #endif\n\n /* eslint-disable prefer-rest-params */\n renderTexture = options;\n clear = arguments[2];\n transform = arguments[3];\n skipUpdateTransform = arguments[4];\n /* eslint-enable prefer-rest-params */\n }\n else\n {\n renderTexture = options.renderTexture;\n clear = options.clear;\n transform = options.transform;\n skipUpdateTransform = options.skipUpdateTransform;\n }\n }\n\n // can be handy to know!\n this.renderingToScreen = !renderTexture;\n\n this.runners.prerender.emit();\n this.emit('prerender');\n\n // apply a transform at a GPU level\n this.projection.transform = transform;\n\n // no point rendering if our context has been blown up!\n if (this.context.isLost)\n {\n return;\n }\n\n if (!renderTexture)\n {\n this._lastObjectRendered = displayObject;\n }\n\n if (!skipUpdateTransform)\n {\n // update the scene graph\n const cacheParent = displayObject.enableTempParent();\n\n displayObject.updateTransform();\n displayObject.disableTempParent(cacheParent);\n // displayObject.hitArea = //TODO add a temp hit area\n }\n\n this.renderTexture.bind(renderTexture);\n this.batch.currentRenderer.start();\n\n if (clear !== undefined ? clear : this.clearBeforeRender)\n {\n this.renderTexture.clear();\n }\n\n displayObject.render(this);\n\n // apply transform..\n this.batch.currentRenderer.flush();\n\n if (renderTexture)\n {\n renderTexture.baseTexture.update();\n }\n\n this.runners.postrender.emit();\n\n // reset transform after render\n this.projection.transform = null;\n\n this.emit('postrender');\n }\n\n /**\n * @override\n * @ignore\n */\n generateTexture(displayObject: IRenderableObject,\n options: IGenerateTextureOptions | SCALE_MODES = {},\n resolution?: number, region?: Rectangle): RenderTexture\n {\n const renderTexture = super.generateTexture(displayObject, options as any, resolution, region);\n\n this.framebuffer.blit();\n\n return renderTexture;\n }\n\n /**\n * Resizes the WebGL view to the specified width and height.\n * @param desiredScreenWidth - The desired width of the screen.\n * @param desiredScreenHeight - The desired height of the screen.\n */\n resize(desiredScreenWidth: number, desiredScreenHeight: number): void\n {\n super.resize(desiredScreenWidth, desiredScreenHeight);\n\n this.runners.resize.emit(this.screen.height, this.screen.width);\n }\n\n /**\n * Resets the WebGL state so you can render things however you fancy!\n * @returns Returns itself.\n */\n reset(): this\n {\n this.runners.reset.emit();\n\n return this;\n }\n\n /** Clear the frame buffer. */\n clear(): void\n {\n this.renderTexture.bind();\n this.renderTexture.clear();\n }\n\n /**\n * Removes everything from the renderer (event listeners, spritebatch, etc...)\n * @param [removeView=false] - Removes the Canvas element from the DOM.\n * See: https://github.com/pixijs/pixi.js/issues/2233\n */\n destroy(removeView?: boolean): void\n {\n this.runners.destroy.emit();\n\n for (const r in this.runners)\n {\n this.runners[r].destroy();\n }\n\n // call base destroy\n super.destroy(removeView);\n\n // TODO nullify all the managers..\n this.gl = null;\n }\n\n /**\n * Please use `plugins.extract` instead.\n * @member {PIXI.Extract} extract\n * @deprecated since 6.0.0\n * @readonly\n */\n public get extract(): any\n {\n // #if _DEBUG\n deprecation('6.0.0', 'Renderer#extract has been deprecated, please use Renderer#plugins.extract instead.');\n // #endif\n\n return this.plugins.extract;\n }\n\n /**\n * Collection of installed plugins. These are included by default in PIXI, but can be excluded\n * by creating a custom build. Consult the README for more information about creating custom\n * builds and excluding plugins.\n * @readonly\n * @property {PIXI.AccessibilityManager} accessibility Support tabbing interactive elements.\n * @property {PIXI.Extract} extract Extract image data from renderer.\n * @property {PIXI.InteractionManager} interaction Handles mouse, touch and pointer events.\n * @property {PIXI.ParticleRenderer} particle Renderer for ParticleContainer objects.\n * @property {PIXI.Prepare} prepare Pre-render display objects.\n * @property {PIXI.BatchRenderer} batch Batching of Sprite, Graphics and Mesh objects.\n * @property {PIXI.TilingSpriteRenderer} tilingSprite Renderer for TilingSprite objects.\n */\n static __plugins: IRendererPlugins = {};\n\n /**\n * Use the {@link PIXI.extensions.add} API to register plugins.\n * @deprecated since 6.5.0\n * @param pluginName - The name of the plugin.\n * @param ctor - The constructor function or class for the plugin.\n */\n static registerPlugin(pluginName: string, ctor: IRendererPluginConstructor): void\n {\n // #if _DEBUG\n deprecation('6.5.0', 'Renderer.registerPlugin() has been deprecated, please use extensions.add() instead.');\n // #endif\n extensions.add({\n name: pluginName,\n type: ExtensionType.RendererPlugin,\n ref: ctor,\n });\n }\n}\n\n// Handle registration of extensions\nextensions.handleByMap(ExtensionType.RendererPlugin, Renderer.__plugins);\n","import { Renderer } from './Renderer';\nimport type { AbstractRenderer, IRendererOptions } from './AbstractRenderer';\n\nexport interface IRendererOptionsAuto extends IRendererOptions\n{\n forceCanvas?: boolean;\n}\n/**\n * This helper function will automatically detect which renderer you should be using.\n * WebGL is the preferred renderer as it is a lot faster. If WebGL is not supported by\n * the browser then this function will return a canvas renderer\n * @memberof PIXI\n * @function autoDetectRenderer\n * @param {object} [options] - The optional renderer parameters\n * @param {number} [options.width=800] - the width of the renderers view\n * @param {number} [options.height=600] - the height of the renderers view\n * @param {HTMLCanvasElement} [options.view] - the canvas to use as a view, optional\n * @param {boolean} [options.useContextAlpha=true] - Pass-through value for canvas' context `alpha` property.\n * If you want to set transparency, please use `backgroundAlpha`. This option is for cases where the\n * canvas needs to be opaque, possibly for performance reasons on some older devices.\n * @param {boolean} [options.autoDensity=false] - Resizes renderer view in CSS pixels to allow for\n * resolutions other than 1\n * @param {boolean} [options.antialias=false] - sets antialias\n * @param {boolean} [options.preserveDrawingBuffer=false] - enables drawing buffer preservation, enable this if you\n * need to call toDataUrl on the webgl context\n * @param {number} [options.backgroundColor=0x000000] - The background color of the rendered area\n * (shown if not transparent).\n * @param {number} [options.backgroundAlpha=1] - Value from 0 (fully transparent) to 1 (fully opaque).\n * @param {boolean} [options.clearBeforeRender=true] - This sets if the renderer will clear the canvas or\n * not before the new render pass.\n * @param {number} [options.resolution=PIXI.settings.RESOLUTION] - The resolution / device pixel ratio of the renderer.\n * @param {boolean} [options.forceCanvas=false] - prevents selection of WebGL renderer, even if such is present, this\n * option only is available when using **pixi.js-legacy** or **@pixi/canvas-renderer** modules, otherwise\n * it is ignored.\n * @param {string} [options.powerPreference] - Parameter passed to webgl context, set to \"high-performance\"\n * for devices with dual graphics card **webgl only**\n * @returns {PIXI.Renderer|PIXI.CanvasRenderer} Returns WebGL renderer if available, otherwise CanvasRenderer\n */\nexport function autoDetectRenderer(options?: IRendererOptionsAuto): AbstractRenderer\n{\n return Renderer.create(options);\n}\n","import type { Renderer } from './Renderer';\nimport { deprecation } from '@pixi/utils';\n\n/**\n * Interface for systems used by the {@link PIXI.Renderer}.\n * @memberof PIXI\n */\nexport interface ISystem\n{\n /** Generic destroy methods to be overridden by the subclass */\n destroy(): void;\n}\n\n/**\n * Types for system and pipe classes.\n * @ignore\n */\nexport interface ISystemConstructor<R = Renderer>\n{\n new (renderer: R): ISystem;\n}\n\n/**\n * Use the ISystem interface instead.\n * @deprecated since 6.1.0\n * @memberof PIXI\n */\nexport class System implements ISystem\n{\n /** Reference to the main renderer */\n public renderer: Renderer;\n\n /**\n * @param renderer - Reference to Renderer\n */\n constructor(renderer: Renderer)\n {\n // #if _DEBUG\n deprecation('6.1.0', 'System class is deprecated, implemement ISystem interface instead.');\n // #endif\n\n this.renderer = renderer;\n }\n\n /** Destroy and don't use after this. */\n destroy(): void\n {\n this.renderer = null;\n }\n}\n","import { DRAW_MODES } from '@pixi/constants';\n\nimport type { BLEND_MODES } from '@pixi/constants';\nimport type { BatchTextureArray } from './BatchTextureArray';\n\n/**\n * Used by the batcher to draw batches.\n * Each one of these contains all information required to draw a bound geometry.\n * @memberof PIXI\n */\nexport class BatchDrawCall\n{\n texArray: BatchTextureArray;\n type: DRAW_MODES;\n blend: BLEND_MODES;\n start: number;\n size: number;\n\n /** Data for uniforms or custom webgl state. */\n data: any;\n\n constructor()\n {\n this.texArray = null;\n this.blend = 0;\n this.type = DRAW_MODES.TRIANGLES;\n\n this.start = 0;\n this.size = 0;\n\n this.data = null;\n }\n}\n","import type { BaseTexture } from '@pixi/core';\n\n/**\n * Used by the batcher to build texture batches.\n * Holds list of textures and their respective locations.\n * @memberof PIXI\n */\nexport class BatchTextureArray\n{\n /** Inside textures array. */\n public elements: BaseTexture[];\n\n /** Respective locations for textures. */\n public ids: number[];\n\n /** Number of filled elements. */\n public count: number;\n\n constructor()\n {\n this.elements = [];\n this.ids = [];\n this.count = 0;\n }\n\n clear(): void\n {\n for (let i = 0; i < this.count; i++)\n {\n this.elements[i] = null;\n }\n this.count = 0;\n }\n}\n","import type { ITypedArray } from './Buffer';\n\n/**\n * Flexible wrapper around `ArrayBuffer` that also provides typed array views on demand.\n * @memberof PIXI\n */\nexport class ViewableBuffer\n{\n public size: number;\n\n /** Underlying `ArrayBuffer` that holds all the data and is of capacity `this.size`. */\n public rawBinaryData: ArrayBuffer;\n\n /** View on the raw binary data as a `Uint32Array`. */\n public uint32View: Uint32Array;\n\n /** View on the raw binary data as a `Float32Array`. */\n public float32View: Float32Array;\n\n private _int8View: Int8Array;\n private _uint8View: Uint8Array;\n private _int16View: Int16Array;\n private _uint16View: Uint16Array;\n private _int32View: Int32Array;\n\n /**\n * @param length - The size of the buffer in bytes.\n */\n constructor(length: number);\n\n /**\n * @param arrayBuffer - The source array buffer.\n */\n constructor(arrayBuffer: ArrayBuffer);\n\n constructor(sizeOrBuffer: number | ArrayBuffer | Uint8Array)\n {\n if (typeof sizeOrBuffer === 'number')\n {\n this.rawBinaryData = new ArrayBuffer(sizeOrBuffer);\n }\n else if (sizeOrBuffer instanceof Uint8Array)\n {\n this.rawBinaryData = sizeOrBuffer.buffer;\n }\n else\n {\n this.rawBinaryData = sizeOrBuffer;\n }\n\n this.uint32View = new Uint32Array(this.rawBinaryData);\n this.float32View = new Float32Array(this.rawBinaryData);\n }\n\n /** View on the raw binary data as a `Int8Array`. */\n get int8View(): Int8Array\n {\n if (!this._int8View)\n {\n this._int8View = new Int8Array(this.rawBinaryData);\n }\n\n return this._int8View;\n }\n\n /** View on the raw binary data as a `Uint8Array`. */\n get uint8View(): Uint8Array\n {\n if (!this._uint8View)\n {\n this._uint8View = new Uint8Array(this.rawBinaryData);\n }\n\n return this._uint8View;\n }\n\n /** View on the raw binary data as a `Int16Array`. */\n get int16View(): Int16Array\n {\n if (!this._int16View)\n {\n this._int16View = new Int16Array(this.rawBinaryData);\n }\n\n return this._int16View;\n }\n\n /** View on the raw binary data as a `Uint16Array`. */\n get uint16View(): Uint16Array\n {\n if (!this._uint16View)\n {\n this._uint16View = new Uint16Array(this.rawBinaryData);\n }\n\n return this._uint16View;\n }\n\n /** View on the raw binary data as a `Int32Array`. */\n get int32View(): Int32Array\n {\n if (!this._int32View)\n {\n this._int32View = new Int32Array(this.rawBinaryData);\n }\n\n return this._int32View;\n }\n\n /**\n * Returns the view of the given type.\n * @param type - One of `int8`, `uint8`, `int16`,\n * `uint16`, `int32`, `uint32`, and `float32`.\n * @returns - typed array of given type\n */\n view(type: string): ITypedArray\n {\n return (this as any)[`${type}View`];\n }\n\n /** Destroys all buffer references. Do not use after calling this. */\n destroy(): void\n {\n this.rawBinaryData = null;\n this._int8View = null;\n this._uint8View = null;\n this._int16View = null;\n this._uint16View = null;\n this._int32View = null;\n this.uint32View = null;\n this.float32View = null;\n }\n\n static sizeOf(type: string): number\n {\n switch (type)\n {\n case 'int8':\n case 'uint8':\n return 1;\n case 'int16':\n case 'uint16':\n return 2;\n case 'int32':\n case 'uint32':\n case 'float32':\n return 4;\n default:\n throw new Error(`${type} isn't a valid view type`);\n }\n }\n}\n","import { BatchDrawCall } from './BatchDrawCall';\nimport { BatchTextureArray } from './BatchTextureArray';\nimport { BaseTexture } from '../textures/BaseTexture';\nimport { ObjectRenderer } from './ObjectRenderer';\nimport { State } from '../state/State';\nimport { ViewableBuffer } from '../geometry/ViewableBuffer';\n\nimport { checkMaxIfStatementsInShader } from '../shader/utils/checkMaxIfStatementsInShader';\n\nimport { settings } from '@pixi/settings';\nimport { premultiplyBlendMode, premultiplyTint, nextPow2, log2 } from '@pixi/utils';\nimport { ENV } from '@pixi/constants';\n\nimport type { Renderer } from '../Renderer';\nimport type { Shader } from '../shader/Shader';\nimport type { BatchShaderGenerator } from './BatchShaderGenerator';\nimport type { BatchGeometry } from './BatchGeometry';\nimport type { Texture } from '../textures/Texture';\nimport type { BLEND_MODES } from '@pixi/constants';\n\n/**\n * Interface for elements like Sprite, Mesh etc. for batching.\n * @memberof PIXI\n */\nexport interface IBatchableElement\n{\n _texture: Texture;\n vertexData: Float32Array;\n indices: Uint16Array | Uint32Array | Array<number>;\n uvs: Float32Array;\n worldAlpha: number;\n _tintRGB: number;\n blendMode: BLEND_MODES;\n}\n\n/**\n * Renderer dedicated to drawing and batching sprites.\n *\n * This is the default batch renderer. It buffers objects\n * with texture-based geometries and renders them in\n * batches. It uploads multiple textures to the GPU to\n * reduce to the number of draw calls.\n * @memberof PIXI\n */\nexport class AbstractBatchRenderer extends ObjectRenderer\n{\n /** The WebGL state in which this renderer will work. */\n public readonly state: State;\n\n /**\n * The number of bufferable objects before a flush\n * occurs automatically.\n * @default settings.SPRITE_BATCH_SIZE * 4\n */\n public size: number;\n\n /**\n * Maximum number of textures that can be uploaded to\n * the GPU under the current context. It is initialized\n * properly in `this.contextChange`.\n * @see PIXI.AbstractBatchRenderer#contextChange\n * @readonly\n */\n public MAX_TEXTURES: number;\n\n /**\n * This is used to generate a shader that can\n * color each vertex based on a `aTextureId`\n * attribute that points to an texture in `uSampler`.\n *\n * This enables the objects with different textures\n * to be drawn in the same draw call.\n *\n * You can customize your shader by creating your\n * custom shader generator.\n */\n protected shaderGenerator: BatchShaderGenerator;\n\n /**\n * The class that represents the geometry of objects\n * that are going to be batched with this.\n * @member {object}\n * @default PIXI.BatchGeometry\n */\n protected geometryClass: typeof BatchGeometry;\n\n /**\n * Size of data being buffered per vertex in the\n * attribute buffers (in floats). By default, the\n * batch-renderer plugin uses 6:\n *\n * | aVertexPosition | 2 |\n * |-----------------|---|\n * | aTextureCoords | 2 |\n * | aColor | 1 |\n * | aTextureId | 1 |\n * @readonly\n */\n protected vertexSize: number;\n\n /** Total count of all vertices used by the currently buffered objects. */\n protected _vertexCount: number;\n\n /** Total count of all indices used by the currently buffered objects. */\n protected _indexCount: number;\n\n /**\n * Buffer of objects that are yet to be rendered.\n * @member {PIXI.DisplayObject[]}\n */\n protected _bufferedElements: Array<IBatchableElement>;\n\n /**\n * Data for texture batch builder, helps to save a bit of CPU on a pass.\n * @member {PIXI.BaseTexture[]}\n */\n protected _bufferedTextures: Array<BaseTexture>;\n\n /** Number of elements that are buffered and are waiting to be flushed. */\n protected _bufferSize: number;\n\n /**\n * This shader is generated by `this.shaderGenerator`.\n *\n * It is generated specifically to handle the required\n * number of textures being batched together.\n */\n protected _shader: Shader;\n\n /**\n * A flush may occur multiple times in a single\n * frame. On iOS devices or when\n * `settings.CAN_UPLOAD_SAME_BUFFER` is false, the\n * batch renderer does not upload data to the same\n * `WebGLBuffer` for performance reasons.\n *\n * This is the index into `packedGeometries` that points to\n * geometry holding the most recent buffers.\n */\n protected _flushId: number;\n\n /**\n * Pool of `ViewableBuffer` objects that are sorted in\n * order of increasing size. The flush method uses\n * the buffer with the least size above the amount\n * it requires. These are used for passing attributes.\n *\n * The first buffer has a size of 8; each subsequent\n * buffer has double capacity of its previous.\n * @member {PIXI.ViewableBuffer[]}\n * @see PIXI.AbstractBatchRenderer#getAttributeBuffer\n */\n protected _aBuffers: Array<ViewableBuffer>;\n\n /**\n * Pool of `Uint16Array` objects that are sorted in\n * order of increasing size. The flush method uses\n * the buffer with the least size above the amount\n * it requires. These are used for passing indices.\n *\n * The first buffer has a size of 12; each subsequent\n * buffer has double capacity of its previous.\n * @member {Uint16Array[]}\n * @see PIXI.AbstractBatchRenderer#getIndexBuffer\n */\n protected _iBuffers: Array<Uint16Array>;\n protected _dcIndex: number;\n protected _aIndex: number;\n protected _iIndex: number;\n protected _attributeBuffer: ViewableBuffer;\n protected _indexBuffer: Uint16Array;\n protected _tempBoundTextures: BaseTexture[];\n\n /**\n * Pool of `this.geometryClass` geometry objects\n * that store buffers. They are used to pass data\n * to the shader on each draw call.\n *\n * These are never re-allocated again, unless a\n * context change occurs; however, the pool may\n * be expanded if required.\n * @member {PIXI.Geometry[]}\n * @see PIXI.AbstractBatchRenderer.contextChange\n */\n private _packedGeometries: Array<BatchGeometry>;\n\n /**\n * Size of `this._packedGeometries`. It can be expanded\n * if more than `this._packedGeometryPoolSize` flushes\n * occur in a single frame.\n */\n private _packedGeometryPoolSize: number;\n\n /**\n * This will hook onto the renderer's `contextChange`\n * and `prerender` signals.\n * @param {PIXI.Renderer} renderer - The renderer this works for.\n */\n constructor(renderer: Renderer)\n {\n super(renderer);\n\n this.shaderGenerator = null;\n this.geometryClass = null;\n this.vertexSize = null;\n this.state = State.for2d();\n this.size = settings.SPRITE_BATCH_SIZE * 4;\n this._vertexCount = 0;\n this._indexCount = 0;\n this._bufferedElements = [];\n this._bufferedTextures = [];\n this._bufferSize = 0;\n this._shader = null;\n this._packedGeometries = [];\n this._packedGeometryPoolSize = 2;\n this._flushId = 0;\n this._aBuffers = {} as any;\n this._iBuffers = {} as any;\n\n this.MAX_TEXTURES = 1;\n\n this.renderer.on('prerender', this.onPrerender, this);\n renderer.runners.contextChange.add(this);\n\n this._dcIndex = 0;\n this._aIndex = 0;\n this._iIndex = 0;\n this._attributeBuffer = null;\n this._indexBuffer = null;\n this._tempBoundTextures = [];\n }\n\n /**\n * Handles the `contextChange` signal.\n *\n * It calculates `this.MAX_TEXTURES` and allocating the packed-geometry object pool.\n */\n contextChange(): void\n {\n const gl = this.renderer.gl;\n\n if (settings.PREFER_ENV === ENV.WEBGL_LEGACY)\n {\n this.MAX_TEXTURES = 1;\n }\n else\n {\n // step 1: first check max textures the GPU can handle.\n this.MAX_TEXTURES = Math.min(\n gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS),\n settings.SPRITE_MAX_TEXTURES);\n\n // step 2: check the maximum number of if statements the shader can have too..\n this.MAX_TEXTURES = checkMaxIfStatementsInShader(\n this.MAX_TEXTURES, gl);\n }\n\n this._shader = this.shaderGenerator.generateShader(this.MAX_TEXTURES);\n\n // we use the second shader as the first one depending on your browser\n // may omit aTextureId as it is not used by the shader so is optimized out.\n for (let i = 0; i < this._packedGeometryPoolSize; i++)\n {\n /* eslint-disable max-len */\n this._packedGeometries[i] = new (this.geometryClass)();\n }\n\n this.initFlushBuffers();\n }\n\n /** Makes sure that static and dynamic flush pooled objects have correct dimensions. */\n initFlushBuffers(): void\n {\n const {\n _drawCallPool,\n _textureArrayPool,\n } = AbstractBatchRenderer;\n // max draw calls\n const MAX_SPRITES = this.size / 4;\n // max texture arrays\n const MAX_TA = Math.floor(MAX_SPRITES / this.MAX_TEXTURES) + 1;\n\n while (_drawCallPool.length < MAX_SPRITES)\n {\n _drawCallPool.push(new BatchDrawCall());\n }\n while (_textureArrayPool.length < MAX_TA)\n {\n _textureArrayPool.push(new BatchTextureArray());\n }\n for (let i = 0; i < this.MAX_TEXTURES; i++)\n {\n this._tempBoundTextures[i] = null;\n }\n }\n\n /** Handles the `prerender` signal. It ensures that flushes start from the first geometry object again. */\n onPrerender(): void\n {\n this._flushId = 0;\n }\n\n /**\n * Buffers the \"batchable\" object. It need not be rendered immediately.\n * @param {PIXI.DisplayObject} element - the element to render when\n * using this renderer\n */\n render(element: IBatchableElement): void\n {\n if (!element._texture.valid)\n {\n return;\n }\n\n if (this._vertexCount + (element.vertexData.length / 2) > this.size)\n {\n this.flush();\n }\n\n this._vertexCount += element.vertexData.length / 2;\n this._indexCount += element.indices.length;\n this._bufferedTextures[this._bufferSize] = element._texture.baseTexture;\n this._bufferedElements[this._bufferSize++] = element;\n }\n\n buildTexturesAndDrawCalls(): void\n {\n const {\n _bufferedTextures: textures,\n MAX_TEXTURES,\n } = this;\n const textureArrays = AbstractBatchRenderer._textureArrayPool;\n const batch = this.renderer.batch;\n const boundTextures = this._tempBoundTextures;\n const touch = this.renderer.textureGC.count;\n\n let TICK = ++BaseTexture._globalBatch;\n let countTexArrays = 0;\n let texArray = textureArrays[0];\n let start = 0;\n\n batch.copyBoundTextures(boundTextures, MAX_TEXTURES);\n\n for (let i = 0; i < this._bufferSize; ++i)\n {\n const tex = textures[i];\n\n textures[i] = null;\n if (tex._batchEnabled === TICK)\n {\n continue;\n }\n\n if (texArray.count >= MAX_TEXTURES)\n {\n batch.boundArray(texArray, boundTextures, TICK, MAX_TEXTURES);\n this.buildDrawCalls(texArray, start, i);\n start = i;\n texArray = textureArrays[++countTexArrays];\n ++TICK;\n }\n\n tex._batchEnabled = TICK;\n tex.touched = touch;\n texArray.elements[texArray.count++] = tex;\n }\n\n if (texArray.count > 0)\n {\n batch.boundArray(texArray, boundTextures, TICK, MAX_TEXTURES);\n this.buildDrawCalls(texArray, start, this._bufferSize);\n ++countTexArrays;\n ++TICK;\n }\n\n // Clean-up\n\n for (let i = 0; i < boundTextures.length; i++)\n {\n boundTextures[i] = null;\n }\n BaseTexture._globalBatch = TICK;\n }\n\n /**\n * Populating drawcalls for rendering\n * @param texArray\n * @param start\n * @param finish\n */\n buildDrawCalls(texArray: BatchTextureArray, start: number, finish: number): void\n {\n const {\n _bufferedElements: elements,\n _attributeBuffer,\n _indexBuffer,\n vertexSize,\n } = this;\n const drawCalls = AbstractBatchRenderer._drawCallPool;\n\n let dcIndex = this._dcIndex;\n let aIndex = this._aIndex;\n let iIndex = this._iIndex;\n\n let drawCall = drawCalls[dcIndex];\n\n drawCall.start = this._iIndex;\n drawCall.texArray = texArray;\n\n for (let i = start; i < finish; ++i)\n {\n const sprite = elements[i];\n const tex = sprite._texture.baseTexture;\n const spriteBlendMode = premultiplyBlendMode[\n tex.alphaMode ? 1 : 0][sprite.blendMode];\n\n elements[i] = null;\n\n if (start < i && drawCall.blend !== spriteBlendMode)\n {\n drawCall.size = iIndex - drawCall.start;\n start = i;\n drawCall = drawCalls[++dcIndex];\n drawCall.texArray = texArray;\n drawCall.start = iIndex;\n }\n\n this.packInterleavedGeometry(sprite, _attributeBuffer, _indexBuffer, aIndex, iIndex);\n aIndex += sprite.vertexData.length / 2 * vertexSize;\n iIndex += sprite.indices.length;\n\n drawCall.blend = spriteBlendMode;\n }\n\n if (start < finish)\n {\n drawCall.size = iIndex - drawCall.start;\n ++dcIndex;\n }\n\n this._dcIndex = dcIndex;\n this._aIndex = aIndex;\n this._iIndex = iIndex;\n }\n\n /**\n * Bind textures for current rendering\n * @param texArray\n */\n bindAndClearTexArray(texArray: BatchTextureArray): void\n {\n const textureSystem = this.renderer.texture;\n\n for (let j = 0; j < texArray.count; j++)\n {\n textureSystem.bind(texArray.elements[j], texArray.ids[j]);\n texArray.elements[j] = null;\n }\n texArray.count = 0;\n }\n\n updateGeometry(): void\n {\n const {\n _packedGeometries: packedGeometries,\n _attributeBuffer: attributeBuffer,\n _indexBuffer: indexBuffer,\n } = this;\n\n if (!settings.CAN_UPLOAD_SAME_BUFFER)\n { /* Usually on iOS devices, where the browser doesn't\n like uploads to the same buffer in a single frame. */\n if (this._packedGeometryPoolSize <= this._flushId)\n {\n this._packedGeometryPoolSize++;\n packedGeometries[this._flushId] = new (this.geometryClass)();\n }\n\n packedGeometries[this._flushId]._buffer.update(attributeBuffer.rawBinaryData);\n packedGeometries[this._flushId]._indexBuffer.update(indexBuffer);\n\n this.renderer.geometry.bind(packedGeometries[this._flushId]);\n this.renderer.geometry.updateBuffers();\n this._flushId++;\n }\n else\n {\n // lets use the faster option, always use buffer number 0\n packedGeometries[this._flushId]._buffer.update(attributeBuffer.rawBinaryData);\n packedGeometries[this._flushId]._indexBuffer.update(indexBuffer);\n\n this.renderer.geometry.updateBuffers();\n }\n }\n\n drawBatches(): void\n {\n const dcCount = this._dcIndex;\n const { gl, state: stateSystem } = this.renderer;\n const drawCalls = AbstractBatchRenderer._drawCallPool;\n\n let curTexArray = null;\n\n // Upload textures and do the draw calls\n for (let i = 0; i < dcCount; i++)\n {\n const { texArray, type, size, start, blend } = drawCalls[i];\n\n if (curTexArray !== texArray)\n {\n curTexArray = texArray;\n this.bindAndClearTexArray(texArray);\n }\n\n this.state.blendMode = blend;\n stateSystem.set(this.state);\n gl.drawElements(type, size, gl.UNSIGNED_SHORT, start * 2);\n }\n }\n\n /** Renders the content _now_ and empties the current batch. */\n flush(): void\n {\n if (this._vertexCount === 0)\n {\n return;\n }\n\n this._attributeBuffer = this.getAttributeBuffer(this._vertexCount);\n this._indexBuffer = this.getIndexBuffer(this._indexCount);\n this._aIndex = 0;\n this._iIndex = 0;\n this._dcIndex = 0;\n\n this.buildTexturesAndDrawCalls();\n this.updateGeometry();\n this.drawBatches();\n\n // reset elements buffer for the next flush\n this._bufferSize = 0;\n this._vertexCount = 0;\n this._indexCount = 0;\n }\n\n /** Starts a new sprite batch. */\n start(): void\n {\n this.renderer.state.set(this.state);\n\n this.renderer.texture.ensureSamplerType(this.MAX_TEXTURES);\n\n this.renderer.shader.bind(this._shader);\n\n if (settings.CAN_UPLOAD_SAME_BUFFER)\n {\n // bind buffer #0, we don't need others\n this.renderer.geometry.bind(this._packedGeometries[this._flushId]);\n }\n }\n\n /** Stops and flushes the current batch. */\n stop(): void\n {\n this.flush();\n }\n\n /** Destroys this `AbstractBatchRenderer`. It cannot be used again. */\n destroy(): void\n {\n for (let i = 0; i < this._packedGeometryPoolSize; i++)\n {\n if (this._packedGeometries[i])\n {\n this._packedGeometries[i].destroy();\n }\n }\n\n this.renderer.off('prerender', this.onPrerender, this);\n\n this._aBuffers = null;\n this._iBuffers = null;\n this._packedGeometries = null;\n this._attributeBuffer = null;\n this._indexBuffer = null;\n\n if (this._shader)\n {\n this._shader.destroy();\n this._shader = null;\n }\n\n super.destroy();\n }\n\n /**\n * Fetches an attribute buffer from `this._aBuffers` that can hold atleast `size` floats.\n * @param size - minimum capacity required\n * @returns - buffer than can hold atleast `size` floats\n */\n getAttributeBuffer(size: number): ViewableBuffer\n {\n // 8 vertices is enough for 2 quads\n const roundedP2 = nextPow2(Math.ceil(size / 8));\n const roundedSizeIndex = log2(roundedP2);\n const roundedSize = roundedP2 * 8;\n\n if (this._aBuffers.length <= roundedSizeIndex)\n {\n this._iBuffers.length = roundedSizeIndex + 1;\n }\n\n let buffer = this._aBuffers[roundedSize];\n\n if (!buffer)\n {\n this._aBuffers[roundedSize] = buffer = new ViewableBuffer(roundedSize * this.vertexSize * 4);\n }\n\n return buffer;\n }\n\n /**\n * Fetches an index buffer from `this._iBuffers` that can\n * have at least `size` capacity.\n * @param size - minimum required capacity\n * @returns - buffer that can fit `size` indices.\n */\n getIndexBuffer(size: number): Uint16Array\n {\n // 12 indices is enough for 2 quads\n const roundedP2 = nextPow2(Math.ceil(size / 12));\n const roundedSizeIndex = log2(roundedP2);\n const roundedSize = roundedP2 * 12;\n\n if (this._iBuffers.length <= roundedSizeIndex)\n {\n this._iBuffers.length = roundedSizeIndex + 1;\n }\n\n let buffer = this._iBuffers[roundedSizeIndex];\n\n if (!buffer)\n {\n this._iBuffers[roundedSizeIndex] = buffer = new Uint16Array(roundedSize);\n }\n\n return buffer;\n }\n\n /**\n * Takes the four batching parameters of `element`, interleaves\n * and pushes them into the batching attribute/index buffers given.\n *\n * It uses these properties: `vertexData` `uvs`, `textureId` and\n * `indicies`. It also uses the \"tint\" of the base-texture, if\n * present.\n * @param {PIXI.DisplayObject} element - element being rendered\n * @param attributeBuffer - attribute buffer.\n * @param indexBuffer - index buffer\n * @param aIndex - number of floats already in the attribute buffer\n * @param iIndex - number of indices already in `indexBuffer`\n */\n packInterleavedGeometry(element: IBatchableElement, attributeBuffer: ViewableBuffer, indexBuffer: Uint16Array,\n aIndex: number, iIndex: number): void\n {\n const {\n uint32View,\n float32View,\n } = attributeBuffer;\n\n const packedVertices = aIndex / this.vertexSize;\n const uvs = element.uvs;\n const indicies = element.indices;\n const vertexData = element.vertexData;\n const textureId = element._texture.baseTexture._batchLocation;\n\n const alpha = Math.min(element.worldAlpha, 1.0);\n const argb = (alpha < 1.0\n && element._texture.baseTexture.alphaMode)\n ? premultiplyTint(element._tintRGB, alpha)\n : element._tintRGB + (alpha * 255 << 24);\n\n // lets not worry about tint! for now..\n for (let i = 0; i < vertexData.length; i += 2)\n {\n float32View[aIndex++] = vertexData[i];\n float32View[aIndex++] = vertexData[i + 1];\n float32View[aIndex++] = uvs[i];\n float32View[aIndex++] = uvs[i + 1];\n uint32View[aIndex++] = argb;\n float32View[aIndex++] = textureId;\n }\n\n for (let i = 0; i < indicies.length; i++)\n {\n indexBuffer[iIndex++] = packedVertices + indicies[i];\n }\n }\n\n /**\n * Pool of `BatchDrawCall` objects that `flush` used\n * to create \"batches\" of the objects being rendered.\n *\n * These are never re-allocated again.\n * Shared between all batch renderers because it can be only one \"flush\" working at the moment.\n * @member {PIXI.BatchDrawCall[]}\n */\n static _drawCallPool: Array<BatchDrawCall> = [];\n\n /**\n * Pool of `BatchDrawCall` objects that `flush` used\n * to create \"batches\" of the objects being rendered.\n *\n * These are never re-allocated again.\n * Shared between all batch renderers because it can be only one \"flush\" working at the moment.\n * @member {PIXI.BatchTextureArray[]}\n */\n static _textureArrayPool: Array<BatchTextureArray> = [];\n}\n","import { Shader } from '../shader/Shader';\nimport { Program } from '../shader/Program';\nimport { UniformGroup } from '../shader/UniformGroup';\nimport { Matrix } from '@pixi/math';\n\n/**\n * Helper that generates batching multi-texture shader. Use it with your new BatchRenderer\n * @memberof PIXI\n */\nexport class BatchShaderGenerator\n{\n /** Reference to the vertex shader source. */\n public vertexSrc: string;\n\n /** Reference to the fragment shader template. Must contain \"%count%\" and \"%forloop%\". */\n public fragTemplate: string;\n\n programCache: {[key: number]: Program};\n defaultGroupCache: {[key: number]: UniformGroup};\n\n /**\n * @param vertexSrc - Vertex shader\n * @param fragTemplate - Fragment shader template\n */\n constructor(vertexSrc: string, fragTemplate: string)\n {\n this.vertexSrc = vertexSrc;\n this.fragTemplate = fragTemplate;\n\n this.programCache = {};\n this.defaultGroupCache = {};\n\n if (fragTemplate.indexOf('%count%') < 0)\n {\n throw new Error('Fragment template must contain \"%count%\".');\n }\n\n if (fragTemplate.indexOf('%forloop%') < 0)\n {\n throw new Error('Fragment template must contain \"%forloop%\".');\n }\n }\n\n generateShader(maxTextures: number): Shader\n {\n if (!this.programCache[maxTextures])\n {\n const sampleValues = new Int32Array(maxTextures);\n\n for (let i = 0; i < maxTextures; i++)\n {\n sampleValues[i] = i;\n }\n\n this.defaultGroupCache[maxTextures] = UniformGroup.from({ uSamplers: sampleValues }, true);\n\n let fragmentSrc = this.fragTemplate;\n\n fragmentSrc = fragmentSrc.replace(/%count%/gi, `${maxTextures}`);\n fragmentSrc = fragmentSrc.replace(/%forloop%/gi, this.generateSampleSrc(maxTextures));\n\n this.programCache[maxTextures] = new Program(this.vertexSrc, fragmentSrc);\n }\n\n const uniforms = {\n tint: new Float32Array([1, 1, 1, 1]),\n translationMatrix: new Matrix(),\n default: this.defaultGroupCache[maxTextures],\n };\n\n return new Shader(this.programCache[maxTextures], uniforms);\n }\n\n generateSampleSrc(maxTextures: number): string\n {\n let src = '';\n\n src += '\\n';\n src += '\\n';\n\n for (let i = 0; i < maxTextures; i++)\n {\n if (i > 0)\n {\n src += '\\nelse ';\n }\n\n if (i < maxTextures - 1)\n {\n src += `if(vTextureId < ${i}.5)`;\n }\n\n src += '\\n{';\n src += `\\n\\tcolor = texture2D(uSamplers[${i}], vTextureCoord);`;\n src += '\\n}';\n }\n\n src += '\\n';\n src += '\\n';\n\n return src;\n }\n}\n","import { TYPES } from '@pixi/constants';\nimport { Geometry } from '../geometry/Geometry';\nimport { Buffer } from '../geometry/Buffer';\n\n/**\n * Geometry used to batch standard PIXI content (e.g. Mesh, Sprite, Graphics objects).\n * @memberof PIXI\n */\nexport class BatchGeometry extends Geometry\n{\n /**\n * Buffer used for position, color, texture IDs\n * @protected\n */\n _buffer: Buffer;\n\n /**\n * Index buffer data\n * @protected\n */\n _indexBuffer: Buffer;\n\n /**\n * @param {boolean} [_static=false] - Optimization flag, where `false`\n * is updated every frame, `true` doesn't change frame-to-frame.\n */\n constructor(_static = false)\n {\n super();\n\n this._buffer = new Buffer(null, _static, false);\n\n this._indexBuffer = new Buffer(null, _static, true);\n\n this.addAttribute('aVertexPosition', this._buffer, 2, false, TYPES.FLOAT)\n .addAttribute('aTextureCoord', this._buffer, 2, false, TYPES.FLOAT)\n .addAttribute('aColor', this._buffer, 4, true, TYPES.UNSIGNED_BYTE)\n .addAttribute('aTextureId', this._buffer, 1, true, TYPES.FLOAT)\n .addIndex(this._indexBuffer);\n }\n}\n","import { BatchShaderGenerator } from './BatchShaderGenerator';\nimport { BatchGeometry } from './BatchGeometry';\nimport { AbstractBatchRenderer } from './AbstractBatchRenderer';\n\nimport defaultVertex from './texture.vert';\nimport defaultFragment from './texture.frag';\n\nimport type { Renderer } from '../Renderer';\nimport type { ExtensionMetadata } from '@pixi/extensions';\nimport { ExtensionType } from '@pixi/extensions';\n\nexport interface IBatchFactoryOptions\n{\n vertex?: string;\n fragment?: string;\n geometryClass?: typeof BatchGeometry;\n vertexSize?: number;\n}\n\n/** @memberof PIXI */\nexport class BatchPluginFactory\n{\n /**\n * Create a new BatchRenderer plugin for Renderer. this convenience can provide an easy way\n * to extend BatchRenderer with all the necessary pieces.\n * @example\n * const fragment = `\n * varying vec2 vTextureCoord;\n * varying vec4 vColor;\n * varying float vTextureId;\n * uniform sampler2D uSamplers[%count%];\n *\n * void main(void){\n * vec4 color;\n * %forloop%\n * gl_FragColor = vColor * vec4(color.a - color.rgb, color.a);\n * }\n * `;\n * const InvertBatchRenderer = PIXI.BatchPluginFactory.create({ fragment });\n * PIXI.extensions.add({\n * name: 'invert',\n * ref: InvertBatchRenderer,\n * type: PIXI.ExtensionType.RendererPlugin,\n * });\n * const sprite = new PIXI.Sprite();\n * sprite.pluginName = 'invert';\n * @param {object} [options]\n * @param {string} [options.vertex=PIXI.BatchPluginFactory.defaultVertexSrc] - Vertex shader source\n * @param {string} [options.fragment=PIXI.BatchPluginFactory.defaultFragmentTemplate] - Fragment shader template\n * @param {number} [options.vertexSize=6] - Vertex size\n * @param {object} [options.geometryClass=PIXI.BatchGeometry]\n * @returns {*} New batch renderer plugin\n */\n static create(options?: IBatchFactoryOptions): typeof AbstractBatchRenderer\n {\n const { vertex, fragment, vertexSize, geometryClass } = Object.assign({\n vertex: defaultVertex,\n fragment: defaultFragment,\n geometryClass: BatchGeometry,\n vertexSize: 6,\n }, options);\n\n return class BatchPlugin extends AbstractBatchRenderer\n {\n constructor(renderer: Renderer)\n {\n super(renderer);\n\n this.shaderGenerator = new BatchShaderGenerator(vertex, fragment);\n this.geometryClass = geometryClass;\n this.vertexSize = vertexSize;\n }\n };\n }\n\n /**\n * The default vertex shader source\n * @readonly\n */\n static get defaultVertexSrc(): string\n {\n return defaultVertex;\n }\n\n /**\n * The default fragment shader source\n * @readonly\n */\n static get defaultFragmentTemplate(): string\n {\n return defaultFragment;\n }\n}\n\n// Setup the default BatchRenderer plugin, this is what\n// we'll actually export at the root level\nexport const BatchRenderer = BatchPluginFactory.create();\n\nObject.assign(BatchRenderer, {\n extension: {\n name: 'batch',\n type: ExtensionType.RendererPlugin,\n } as ExtensionMetadata,\n});\n","import { deprecation } from '@pixi/utils';\nimport * as _systems from './systems';\nimport * as _resources from './textures/resources';\n\n/**\n * @memberof PIXI\n * @namespace resources\n * @see PIXI\n * @deprecated since 6.0.0\n */\nconst resources = {};\n\nfor (const name in _resources)\n{\n Object.defineProperty(resources, name,\n {\n get()\n {\n // #if _DEBUG\n deprecation('6.0.0', `PIXI.systems.${name} has moved to PIXI.${name}`);\n // #endif\n\n return (_resources as any)[name];\n },\n });\n}\n\n/**\n * @memberof PIXI\n * @namespace systems\n * @see PIXI\n * @deprecated since 6.0.0\n */\nconst systems = {};\n\nfor (const name in _systems)\n{\n Object.defineProperty(systems, name,\n {\n get()\n {\n // #if _DEBUG\n deprecation('6.0.0', `PIXI.resources.${name} has moved to PIXI.${name}`);\n // #endif\n\n return (_systems as any)[name];\n },\n });\n}\n\nexport { resources, systems };\n","import { settings } from '@pixi/settings';\n\n/**\n * Sets the default value for the container property 'sortableChildren'.\n * If set to true, the container will sort its children by zIndex value\n * when updateTransform() is called, or manually if sortChildren() is called.\n *\n * This actually changes the order of elements in the array, so should be treated\n * as a basic solution that is not performant compared to other solutions,\n * such as @link https://github.com/pixijs/pixi-display\n *\n * Also be aware of that this may not work nicely with the addChildAt() function,\n * as the zIndex sorting may cause the child to automatically sorted to another position.\n * @static\n * @constant\n * @name SORTABLE_CHILDREN\n * @memberof PIXI.settings\n * @type {boolean}\n * @default false\n */\nsettings.SORTABLE_CHILDREN = false;\n\nexport { settings };\n","import { Rectangle } from '@pixi/math';\n\nimport type { IPointData, Transform, Matrix } from '@pixi/math';\n\n/**\n * 'Builder' pattern for bounds rectangles.\n *\n * This could be called an Axis-Aligned Bounding Box.\n * It is not an actual shape. It is a mutable thing; no 'EMPTY' or those kind of problems.\n * @memberof PIXI\n */\nexport class Bounds\n{\n /** @default Infinity */\n public minX: number;\n\n /** @default Infinity */\n public minY: number;\n\n /** @default -Infinity */\n public maxX: number;\n\n /** @default -Infinity */\n public maxY: number;\n\n public rect: Rectangle;\n\n /**\n * It is updated to _boundsID of corresponding object to keep bounds in sync with content.\n * Updated from outside, thus public modifier.\n */\n public updateID: number;\n\n constructor()\n {\n this.minX = Infinity;\n this.minY = Infinity;\n this.maxX = -Infinity;\n this.maxY = -Infinity;\n\n this.rect = null;\n this.updateID = -1;\n }\n\n /**\n * Checks if bounds are empty.\n * @returns - True if empty.\n */\n isEmpty(): boolean\n {\n return this.minX > this.maxX || this.minY > this.maxY;\n }\n\n /** Clears the bounds and resets. */\n clear(): void\n {\n this.minX = Infinity;\n this.minY = Infinity;\n this.maxX = -Infinity;\n this.maxY = -Infinity;\n }\n\n /**\n * Can return Rectangle.EMPTY constant, either construct new rectangle, either use your rectangle\n * It is not guaranteed that it will return tempRect\n * @param rect - Temporary object will be used if AABB is not empty\n * @returns - A rectangle of the bounds\n */\n getRectangle(rect?: Rectangle): Rectangle\n {\n if (this.minX > this.maxX || this.minY > this.maxY)\n {\n return Rectangle.EMPTY;\n }\n\n rect = rect || new Rectangle(0, 0, 1, 1);\n\n rect.x = this.minX;\n rect.y = this.minY;\n rect.width = this.maxX - this.minX;\n rect.height = this.maxY - this.minY;\n\n return rect;\n }\n\n /**\n * This function should be inlined when its possible.\n * @param point - The point to add.\n */\n addPoint(point: IPointData): void\n {\n this.minX = Math.min(this.minX, point.x);\n this.maxX = Math.max(this.maxX, point.x);\n this.minY = Math.min(this.minY, point.y);\n this.maxY = Math.max(this.maxY, point.y);\n }\n\n /**\n * Adds a point, after transformed. This should be inlined when its possible.\n * @param matrix\n * @param point\n */\n addPointMatrix(matrix: Matrix, point: IPointData): void\n {\n const { a, b, c, d, tx, ty } = matrix;\n\n const x = (a * point.x) + (c * point.y) + tx;\n const y = (b * point.x) + (d * point.y) + ty;\n\n this.minX = Math.min(this.minX, x);\n this.maxX = Math.max(this.maxX, x);\n this.minY = Math.min(this.minY, y);\n this.maxY = Math.max(this.maxY, y);\n }\n\n /**\n * Adds a quad, not transformed\n * @param vertices - The verts to add.\n */\n addQuad(vertices: Float32Array): void\n {\n let minX = this.minX;\n let minY = this.minY;\n let maxX = this.maxX;\n let maxY = this.maxY;\n\n let x = vertices[0];\n let y = vertices[1];\n\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n\n x = vertices[2];\n y = vertices[3];\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n\n x = vertices[4];\n y = vertices[5];\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n\n x = vertices[6];\n y = vertices[7];\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n\n this.minX = minX;\n this.minY = minY;\n this.maxX = maxX;\n this.maxY = maxY;\n }\n\n /**\n * Adds sprite frame, transformed.\n * @param transform - transform to apply\n * @param x0 - left X of frame\n * @param y0 - top Y of frame\n * @param x1 - right X of frame\n * @param y1 - bottom Y of frame\n */\n addFrame(transform: Transform, x0: number, y0: number, x1: number, y1: number): void\n {\n this.addFrameMatrix(transform.worldTransform, x0, y0, x1, y1);\n }\n\n /**\n * Adds sprite frame, multiplied by matrix\n * @param matrix - matrix to apply\n * @param x0 - left X of frame\n * @param y0 - top Y of frame\n * @param x1 - right X of frame\n * @param y1 - bottom Y of frame\n */\n addFrameMatrix(matrix: Matrix, x0: number, y0: number, x1: number, y1: number): void\n {\n const a = matrix.a;\n const b = matrix.b;\n const c = matrix.c;\n const d = matrix.d;\n const tx = matrix.tx;\n const ty = matrix.ty;\n\n let minX = this.minX;\n let minY = this.minY;\n let maxX = this.maxX;\n let maxY = this.maxY;\n\n let x = (a * x0) + (c * y0) + tx;\n let y = (b * x0) + (d * y0) + ty;\n\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n\n x = (a * x1) + (c * y0) + tx;\n y = (b * x1) + (d * y0) + ty;\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n\n x = (a * x0) + (c * y1) + tx;\n y = (b * x0) + (d * y1) + ty;\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n\n x = (a * x1) + (c * y1) + tx;\n y = (b * x1) + (d * y1) + ty;\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n\n this.minX = minX;\n this.minY = minY;\n this.maxX = maxX;\n this.maxY = maxY;\n }\n\n /**\n * Adds screen vertices from array\n * @param vertexData - calculated vertices\n * @param beginOffset - begin offset\n * @param endOffset - end offset, excluded\n */\n addVertexData(vertexData: Float32Array, beginOffset: number, endOffset: number): void\n {\n let minX = this.minX;\n let minY = this.minY;\n let maxX = this.maxX;\n let maxY = this.maxY;\n\n for (let i = beginOffset; i < endOffset; i += 2)\n {\n const x = vertexData[i];\n const y = vertexData[i + 1];\n\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n }\n\n this.minX = minX;\n this.minY = minY;\n this.maxX = maxX;\n this.maxY = maxY;\n }\n\n /**\n * Add an array of mesh vertices\n * @param transform - mesh transform\n * @param vertices - mesh coordinates in array\n * @param beginOffset - begin offset\n * @param endOffset - end offset, excluded\n */\n addVertices(transform: Transform, vertices: Float32Array, beginOffset: number, endOffset: number): void\n {\n this.addVerticesMatrix(transform.worldTransform, vertices, beginOffset, endOffset);\n }\n\n /**\n * Add an array of mesh vertices.\n * @param matrix - mesh matrix\n * @param vertices - mesh coordinates in array\n * @param beginOffset - begin offset\n * @param endOffset - end offset, excluded\n * @param padX - x padding\n * @param padY - y padding\n */\n addVerticesMatrix(matrix: Matrix, vertices: Float32Array, beginOffset: number,\n endOffset: number, padX = 0, padY = padX): void\n {\n const a = matrix.a;\n const b = matrix.b;\n const c = matrix.c;\n const d = matrix.d;\n const tx = matrix.tx;\n const ty = matrix.ty;\n\n let minX = this.minX;\n let minY = this.minY;\n let maxX = this.maxX;\n let maxY = this.maxY;\n\n for (let i = beginOffset; i < endOffset; i += 2)\n {\n const rawX = vertices[i];\n const rawY = vertices[i + 1];\n const x = (a * rawX) + (c * rawY) + tx;\n const y = (d * rawY) + (b * rawX) + ty;\n\n minX = Math.min(minX, x - padX);\n maxX = Math.max(maxX, x + padX);\n minY = Math.min(minY, y - padY);\n maxY = Math.max(maxY, y + padY);\n }\n\n this.minX = minX;\n this.minY = minY;\n this.maxX = maxX;\n this.maxY = maxY;\n }\n\n /**\n * Adds other {@link Bounds}.\n * @param bounds - The Bounds to be added\n */\n addBounds(bounds: Bounds): void\n {\n const minX = this.minX;\n const minY = this.minY;\n const maxX = this.maxX;\n const maxY = this.maxY;\n\n this.minX = bounds.minX < minX ? bounds.minX : minX;\n this.minY = bounds.minY < minY ? bounds.minY : minY;\n this.maxX = bounds.maxX > maxX ? bounds.maxX : maxX;\n this.maxY = bounds.maxY > maxY ? bounds.maxY : maxY;\n }\n\n /**\n * Adds other Bounds, masked with Bounds.\n * @param bounds - The Bounds to be added.\n * @param mask - TODO\n */\n addBoundsMask(bounds: Bounds, mask: Bounds): void\n {\n const _minX = bounds.minX > mask.minX ? bounds.minX : mask.minX;\n const _minY = bounds.minY > mask.minY ? bounds.minY : mask.minY;\n const _maxX = bounds.maxX < mask.maxX ? bounds.maxX : mask.maxX;\n const _maxY = bounds.maxY < mask.maxY ? bounds.maxY : mask.maxY;\n\n if (_minX <= _maxX && _minY <= _maxY)\n {\n const minX = this.minX;\n const minY = this.minY;\n const maxX = this.maxX;\n const maxY = this.maxY;\n\n this.minX = _minX < minX ? _minX : minX;\n this.minY = _minY < minY ? _minY : minY;\n this.maxX = _maxX > maxX ? _maxX : maxX;\n this.maxY = _maxY > maxY ? _maxY : maxY;\n }\n }\n\n /**\n * Adds other Bounds, multiplied by matrix. Bounds shouldn't be empty.\n * @param bounds - other bounds\n * @param matrix - multiplicator\n */\n addBoundsMatrix(bounds: Bounds, matrix: Matrix): void\n {\n this.addFrameMatrix(matrix, bounds.minX, bounds.minY, bounds.maxX, bounds.maxY);\n }\n\n /**\n * Adds other Bounds, masked with Rectangle.\n * @param bounds - TODO\n * @param area - TODO\n */\n addBoundsArea(bounds: Bounds, area: Rectangle): void\n {\n const _minX = bounds.minX > area.x ? bounds.minX : area.x;\n const _minY = bounds.minY > area.y ? bounds.minY : area.y;\n const _maxX = bounds.maxX < area.x + area.width ? bounds.maxX : (area.x + area.width);\n const _maxY = bounds.maxY < area.y + area.height ? bounds.maxY : (area.y + area.height);\n\n if (_minX <= _maxX && _minY <= _maxY)\n {\n const minX = this.minX;\n const minY = this.minY;\n const maxX = this.maxX;\n const maxY = this.maxY;\n\n this.minX = _minX < minX ? _minX : minX;\n this.minY = _minY < minY ? _minY : minY;\n this.maxX = _maxX > maxX ? _maxX : maxX;\n this.maxY = _maxY > maxY ? _maxY : maxY;\n }\n }\n\n /**\n * Pads bounds object, making it grow in all directions.\n * If paddingY is omitted, both paddingX and paddingY will be set to paddingX.\n * @param paddingX - The horizontal padding amount.\n * @param paddingY - The vertical padding amount.\n */\n pad(paddingX = 0, paddingY = paddingX): void\n {\n if (!this.isEmpty())\n {\n this.minX -= paddingX;\n this.maxX += paddingX;\n this.minY -= paddingY;\n this.maxY += paddingY;\n }\n }\n\n /**\n * Adds padded frame. (x0, y0) should be strictly less than (x1, y1)\n * @param x0 - left X of frame\n * @param y0 - top Y of frame\n * @param x1 - right X of frame\n * @param y1 - bottom Y of frame\n * @param padX - padding X\n * @param padY - padding Y\n */\n addFramePad(x0: number, y0: number, x1: number, y1: number, padX: number, padY: number): void\n {\n x0 -= padX;\n y0 -= padY;\n x1 += padX;\n y1 += padY;\n\n this.minX = this.minX < x0 ? this.minX : x0;\n this.maxX = this.maxX > x1 ? this.maxX : x1;\n this.minY = this.minY < y0 ? this.minY : y0;\n this.maxY = this.maxY > y1 ? this.maxY : y1;\n }\n}\n","import { DEG_TO_RAD, RAD_TO_DEG, Rectangle, Transform } from '@pixi/math';\nimport { EventEmitter } from '@pixi/utils';\nimport { Bounds } from './Bounds';\n\nimport type { Container } from './Container';\nimport type { Filter, MaskData, Renderer } from '@pixi/core';\nimport type { IPointData, ObservablePoint, Matrix, Point } from '@pixi/math';\nimport type { Dict } from '@pixi/utils';\n\nexport interface IDestroyOptions\n{\n children?: boolean;\n texture?: boolean;\n baseTexture?: boolean;\n}\n\nexport interface DisplayObject extends Omit<GlobalMixins.DisplayObject, keyof EventEmitter>, EventEmitter {}\n\n/**\n * The base class for all objects that are rendered on the screen.\n *\n * This is an abstract class and can not be used on its own; rather it should be extended.\n *\n * ## Display objects implemented in PixiJS\n *\n * | Display Object | Description |\n * | ------------------------------- | --------------------------------------------------------------------- |\n * | {@link PIXI.Container} | Adds support for `children` to DisplayObject |\n * | {@link PIXI.Graphics} | Shape-drawing display object similar to the Canvas API |\n * | {@link PIXI.Sprite} | Draws textures (i.e. images) |\n * | {@link PIXI.Text} | Draws text using the Canvas API internally |\n * | {@link PIXI.BitmapText} | More scaleable solution for text rendering, reusing glyph textures |\n * | {@link PIXI.TilingSprite} | Draws textures/images in a tiled fashion |\n * | {@link PIXI.AnimatedSprite} | Draws an animation of multiple images |\n * | {@link PIXI.Mesh} | Provides a lower-level API for drawing meshes with custom data |\n * | {@link PIXI.NineSlicePlane} | Mesh-related |\n * | {@link PIXI.SimpleMesh} | v4-compatible mesh |\n * | {@link PIXI.SimplePlane} | Mesh-related |\n * | {@link PIXI.SimpleRope} | Mesh-related |\n *\n * ## Transforms\n *\n * The [transform]{@link DisplayObject#transform} of a display object describes the projection from its\n * local coordinate space to its parent's local coordinate space. The following properties are derived\n * from the transform:\n *\n * <table>\n * <thead>\n * <tr>\n * <th>Property</th>\n * <th>Description</th>\n * </tr>\n * </thead>\n * <tbody>\n * <tr>\n * <td>[pivot]{@link PIXI.DisplayObject#pivot}</td>\n * <td>\n * Invariant under rotation, scaling, and skewing. The projection of into the parent's space of the pivot\n * is equal to position, regardless of the other three transformations. In other words, It is the center of\n * rotation, scaling, and skewing.\n * </td>\n * </tr>\n * <tr>\n * <td>[position]{@link PIXI.DisplayObject#position}</td>\n * <td>\n * Translation. This is the position of the [pivot]{@link PIXI.DisplayObject#pivot} in the parent's local\n * space. The default value of the pivot is the origin (0,0). If the top-left corner of your display object\n * is (0,0) in its local space, then the position will be its top-left corner in the parent's local space.\n * </td>\n * </tr>\n * <tr>\n * <td>[scale]{@link PIXI.DisplayObject#scale}</td>\n * <td>\n * Scaling. This will stretch (or compress) the display object's projection. The scale factors are along the\n * local coordinate axes. In other words, the display object is scaled before rotated or skewed. The center\n * of scaling is the [pivot]{@link PIXI.DisplayObject#pivot}.\n * </td>\n * </tr>\n * <tr>\n * <td>[rotation]{@link PIXI.DisplayObject#rotation}</td>\n * <td>\n * Rotation. This will rotate the display object's projection by this angle (in radians).\n * </td>\n * </tr>\n * <tr>\n * <td>[skew]{@link PIXI.DisplayObject#skew}</td>\n * <td>\n * <p>Skewing. This can be used to deform a rectangular display object into a parallelogram.</p>\n * <p>\n * In PixiJS, skew has a slightly different behaviour than the conventional meaning. It can be\n * thought of the net rotation applied to the coordinate axes (separately). For example, if \"skew.x\" is\n * ⺠and \"skew.y\" is β, then the line x = 0 will be rotated by ⺠(y = -x*cotâº) and the line y = 0 will be\n * rotated by β (y = x*tanβ). A line y = x*tanÏ´ (i.e. a line at angle Ï´ to the x-axis in local-space) will\n * be rotated by an angle between ⺠and β.\n * </p>\n * <p>\n * It can be observed that if skew is applied equally to both axes, then it will be equivalent to applying\n * a rotation. Indeed, if \"skew.x\" = -Ï´ and \"skew.y\" = Ï´, it will produce an equivalent of \"rotation\" = Ï´.\n * </p>\n * <p>\n * Another quite interesting observation is that \"skew.x\", \"skew.y\", rotation are communtative operations. Indeed,\n * because rotation is essentially a careful combination of the two.\n * </p>\n * </td>\n * </tr>\n * <tr>\n * <td>angle</td>\n * <td>Rotation. This is an alias for [rotation]{@link PIXI.DisplayObject#rotation}, but in degrees.</td>\n * </tr>\n * <tr>\n * <td>x</td>\n * <td>Translation. This is an alias for position.x!</td>\n * </tr>\n * <tr>\n * <td>y</td>\n * <td>Translation. This is an alias for position.y!</td>\n * </tr>\n * <tr>\n * <td>width</td>\n * <td>\n * Implemented in [Container]{@link PIXI.Container}. Scaling. The width property calculates scale.x by dividing\n * the \"requested\" width by the local bounding box width. It is indirectly an abstraction over scale.x, and there\n * is no concept of user-defined width.\n * </td>\n * </tr>\n * <tr>\n * <td>height</td>\n * <td>\n * Implemented in [Container]{@link PIXI.Container}. Scaling. The height property calculates scale.y by dividing\n * the \"requested\" height by the local bounding box height. It is indirectly an abstraction over scale.y, and there\n * is no concept of user-defined height.\n * </td>\n * </tr>\n * </tbody>\n * </table>\n *\n * ## Bounds\n *\n * The bounds of a display object is defined by the minimum axis-aligned rectangle in world space that can fit\n * around it. The abstract `calculateBounds` method is responsible for providing it (and it should use the\n * `worldTransform` to calculate in world space).\n *\n * There are a few additional types of bounding boxes:\n *\n * | Bounds | Description |\n * | --------------------- | ---------------------------------------------------------------------------------------- |\n * | World Bounds | This is synonymous is the regular bounds described above. See `getBounds()`. |\n * | Local Bounds | This the axis-aligned bounding box in the parent's local space. See `getLocalBounds()`. |\n * | Render Bounds | The bounds, but including extra rendering effects like filter padding. |\n * | Projected Bounds | The bounds of the projected display object onto the screen. Usually equals world bounds. |\n * | Relative Bounds | The bounds of a display object when projected onto a ancestor's (or parent's) space. |\n * | Natural Bounds | The bounds of an object in its own local space (not parent's space, like in local bounds)|\n * | Content Bounds | The natural bounds when excluding all children of a `Container`. |\n *\n * ### calculateBounds\n *\n * [Container]{@link Container} already implements `calculateBounds` in a manner that includes children.\n *\n * But for a non-Container display object, the `calculateBounds` method must be overridden in order for `getBounds` and\n * `getLocalBounds` to work. This method must write the bounds into `this._bounds`.\n *\n * Generally, the following technique works for most simple cases: take the list of points\n * forming the \"hull\" of the object (i.e. outline of the object's shape), and then add them\n * using {@link PIXI.Bounds#addPointMatrix}.\n *\n * ```js\n * calculateBounds(): void\n * {\n * const points = [...];\n *\n * for (let i = 0, j = points.length; i < j; i++)\n * {\n * this._bounds.addPointMatrix(this.worldTransform, points[i]);\n * }\n * }\n * ```\n *\n * You can optimize this for a large number of points by using {@link PIXI.Bounds#addVerticesMatrix} to pass them\n * in one array together.\n *\n * ## Alpha\n *\n * This alpha sets a display object's **relative opacity** w.r.t its parent. For example, if the alpha of a display\n * object is 0.5 and its parent's alpha is 0.5, then it will be rendered with 25% opacity (assuming alpha is not\n * applied on any ancestor further up the chain).\n *\n * The alpha with which the display object will be rendered is called the [worldAlpha]{@link PIXI.DisplayObject#worldAlpha}.\n *\n * ## Renderable vs Visible\n *\n * The `renderable` and `visible` properties can be used to prevent a display object from being rendered to the\n * screen. However, there is a subtle difference between the two. When using `renderable`, the transforms of the display\n * object (and its children subtree) will continue to be calculated. When using `visible`, the transforms will not\n * be calculated.\n *\n * It is recommended that applications use the `renderable` property for culling. See\n * [@pixi-essentials/cull]{@link https://www.npmjs.com/package/@pixi-essentials/cull} or\n * [pixi-cull]{@link https://www.npmjs.com/package/pixi-cull} for more details.\n *\n * Otherwise, to prevent an object from rendering in the general-purpose sense - `visible` is the property to use. This\n * one is also better in terms of performance.\n * @memberof PIXI\n */\nexport abstract class DisplayObject extends EventEmitter\n{\n abstract sortDirty: boolean;\n\n /** The display object container that contains this display object. */\n public parent: Container;\n\n /**\n * The multiplied alpha of the displayObject.\n * @readonly\n */\n public worldAlpha: number;\n\n /**\n * World transform and local transform of this object.\n * This will become read-only later, please do not assign anything there unless you know what are you doing.\n */\n public transform: Transform;\n\n /** The opacity of the object. */\n public alpha: number;\n\n /**\n * The visibility of the object. If false the object will not be drawn, and\n * the updateTransform function will not be called.\n *\n * Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually.\n */\n public visible: boolean;\n\n /**\n * Can this object be rendered, if false the object will not be drawn but the updateTransform\n * methods will still be called.\n *\n * Only affects recursive calls from parent. You can ask for bounds manually.\n */\n public renderable: boolean;\n\n /**\n * Should this object be rendered if the bounds of this object are out of frame?\n *\n * Culling has no effect on whether updateTransform is called.\n */\n public cullable: boolean;\n\n /**\n * If set, this shape is used for culling instead of the bounds of this object.\n * It can improve the culling performance of objects with many children.\n * The culling area is defined in local space.\n */\n public cullArea: Rectangle;\n\n /**\n * The area the filter is applied to. This is used as more of an optimization\n * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle.\n *\n * Also works as an interaction mask.\n */\n public filterArea: Rectangle;\n\n /**\n * Sets the filters for the displayObject.\n * IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer.\n * To remove filters simply set this property to `'null'`.\n */\n public filters: Filter[] | null;\n\n /** Used to fast check if a sprite is.. a sprite! */\n public isSprite: boolean;\n\n /** Does any other displayObject use this object as a mask? */\n public isMask: boolean;\n\n /**\n * Which index in the children array the display component was before the previous zIndex sort.\n * Used by containers to help sort objects with the same zIndex, by using previous array index as the decider.\n * @protected\n */\n public _lastSortedIndex: number;\n\n /**\n * The original, cached mask of the object.\n * @protected\n */\n public _mask: Container | MaskData;\n\n /** The bounds object, this is used to calculate and store the bounds of the displayObject. */\n public _bounds: Bounds;\n\n /** Local bounds object, swapped with `_bounds` when using `getLocalBounds()`. */\n public _localBounds: Bounds;\n\n /**\n * The zIndex of the displayObject.\n * A higher value will mean it will be rendered on top of other displayObjects within the same container.\n * @protected\n */\n protected _zIndex: number;\n\n /**\n * Currently enabled filters.\n * @protected\n */\n protected _enabledFilters: Filter[];\n\n /** Flags the cached bounds as dirty. */\n protected _boundsID: number;\n\n /** Cache of this display-object's bounds-rectangle. */\n protected _boundsRect: Rectangle;\n\n /** Cache of this display-object's local-bounds rectangle. */\n protected _localBoundsRect: Rectangle;\n\n /** If the object has been destroyed via destroy(). If true, it should not be used. */\n protected _destroyed: boolean;\n\n /** The number of times this object is used as a mask by another object. */\n private _maskRefCount: number;\n private tempDisplayObjectParent: TemporaryDisplayObject;\n public displayObjectUpdateTransform: () => void;\n\n /**\n * Mixes all enumerable properties and methods from a source object to DisplayObject.\n * @param source - The source of properties and methods to mix in.\n */\n static mixin(source: Dict<any>): void\n {\n // in ES8/ES2017, this would be really easy:\n // Object.defineProperties(DisplayObject.prototype, Object.getOwnPropertyDescriptors(source));\n\n // get all the enumerable property keys\n const keys = Object.keys(source);\n\n // loop through properties\n for (let i = 0; i < keys.length; ++i)\n {\n const propertyName = keys[i];\n\n // Set the property using the property descriptor - this works for accessors and normal value properties\n Object.defineProperty(\n DisplayObject.prototype,\n propertyName,\n Object.getOwnPropertyDescriptor(source, propertyName)\n );\n }\n }\n\n constructor()\n {\n super();\n\n this.tempDisplayObjectParent = null;\n\n // TODO: need to create Transform from factory\n this.transform = new Transform();\n this.alpha = 1;\n this.visible = true;\n this.renderable = true;\n this.cullable = false;\n this.cullArea = null;\n\n this.parent = null;\n this.worldAlpha = 1;\n\n this._lastSortedIndex = 0;\n this._zIndex = 0;\n\n this.filterArea = null;\n this.filters = null;\n this._enabledFilters = null;\n\n this._bounds = new Bounds();\n this._localBounds = null;\n this._boundsID = 0;\n this._boundsRect = null;\n this._localBoundsRect = null;\n this._mask = null;\n this._maskRefCount = 0;\n this._destroyed = false;\n\n this.isSprite = false;\n this.isMask = false;\n }\n\n /**\n * Fired when this DisplayObject is added to a Container.\n * @instance\n * @event added\n * @param {PIXI.Container} container - The container added to.\n */\n\n /**\n * Fired when this DisplayObject is removed from a Container.\n * @instance\n * @event removed\n * @param {PIXI.Container} container - The container removed from.\n */\n\n /**\n * Fired when this DisplayObject is destroyed. This event is emitted once\n * destroy is finished.\n * @instance\n * @event destroyed\n */\n\n /** Readonly flag for destroyed display objects. */\n get destroyed(): boolean\n {\n return this._destroyed;\n }\n\n /** Recalculates the bounds of the display object. */\n abstract calculateBounds(): void;\n\n abstract removeChild(child: DisplayObject): void;\n\n /**\n * Renders the object using the WebGL renderer.\n * @param renderer - The renderer.\n */\n abstract render(renderer: Renderer): void;\n\n /** Recursively updates transform of all objects from the root to this one internal function for toLocal() */\n protected _recursivePostUpdateTransform(): void\n {\n if (this.parent)\n {\n this.parent._recursivePostUpdateTransform();\n this.transform.updateTransform(this.parent.transform);\n }\n else\n {\n this.transform.updateTransform(this._tempDisplayObjectParent.transform);\n }\n }\n\n /** Updates the object transform for rendering. TODO - Optimization pass! */\n updateTransform(): void\n {\n this._boundsID++;\n\n this.transform.updateTransform(this.parent.transform);\n // multiply the alphas..\n this.worldAlpha = this.alpha * this.parent.worldAlpha;\n }\n\n /**\n * Calculates and returns the (world) bounds of the display object as a [Rectangle]{@link PIXI.Rectangle}.\n *\n * This method is expensive on containers with a large subtree (like the stage). This is because the bounds\n * of a container depend on its children's bounds, which recursively causes all bounds in the subtree to\n * be recalculated. The upside, however, is that calling `getBounds` once on a container will indeed update\n * the bounds of all children (the whole subtree, in fact). This side effect should be exploited by using\n * `displayObject._bounds.getRectangle()` when traversing through all the bounds in a scene graph. Otherwise,\n * calling `getBounds` on each object in a subtree will cause the total cost to increase quadratically as\n * its height increases.\n *\n * The transforms of all objects in a container's **subtree** and of all **ancestors** are updated.\n * The world bounds of all display objects in a container's **subtree** will also be recalculated.\n *\n * The `_bounds` object stores the last calculation of the bounds. You can use to entirely skip bounds\n * calculation if needed.\n *\n * ```js\n * const lastCalculatedBounds = displayObject._bounds.getRectangle(optionalRect);\n * ```\n *\n * Do know that usage of `getLocalBounds` can corrupt the `_bounds` of children (the whole subtree, actually). This\n * is a known issue that has not been solved. See [getLocalBounds]{@link PIXI.DisplayObject#getLocalBounds} for more\n * details.\n *\n * `getBounds` should be called with `skipUpdate` equal to `true` in a render() call. This is because the transforms\n * are guaranteed to be update-to-date. In fact, recalculating inside a render() call may cause corruption in certain\n * cases.\n * @param skipUpdate - Setting to `true` will stop the transforms of the scene graph from\n * being updated. This means the calculation returned MAY be out of date BUT will give you a\n * nice performance boost.\n * @param rect - Optional rectangle to store the result of the bounds calculation.\n * @returns - The minimum axis-aligned rectangle in world space that fits around this object.\n */\n getBounds(skipUpdate?: boolean, rect?: Rectangle): Rectangle\n {\n if (!skipUpdate)\n {\n if (!this.parent)\n {\n this.parent = this._tempDisplayObjectParent as Container;\n this.updateTransform();\n this.parent = null;\n }\n else\n {\n this._recursivePostUpdateTransform();\n this.updateTransform();\n }\n }\n\n if (this._bounds.updateID !== this._boundsID)\n {\n this.calculateBounds();\n this._bounds.updateID = this._boundsID;\n }\n\n if (!rect)\n {\n if (!this._boundsRect)\n {\n this._boundsRect = new Rectangle();\n }\n\n rect = this._boundsRect;\n }\n\n return this._bounds.getRectangle(rect);\n }\n\n /**\n * Retrieves the local bounds of the displayObject as a rectangle object.\n * @param rect - Optional rectangle to store the result of the bounds calculation.\n * @returns - The rectangular bounding area.\n */\n getLocalBounds(rect?: Rectangle): Rectangle\n {\n if (!rect)\n {\n if (!this._localBoundsRect)\n {\n this._localBoundsRect = new Rectangle();\n }\n\n rect = this._localBoundsRect;\n }\n\n if (!this._localBounds)\n {\n this._localBounds = new Bounds();\n }\n\n const transformRef = this.transform;\n const parentRef = this.parent;\n\n this.parent = null;\n this.transform = this._tempDisplayObjectParent.transform;\n\n const worldBounds = this._bounds;\n const worldBoundsID = this._boundsID;\n\n this._bounds = this._localBounds;\n\n const bounds = this.getBounds(false, rect);\n\n this.parent = parentRef;\n this.transform = transformRef;\n\n this._bounds = worldBounds;\n this._bounds.updateID += this._boundsID - worldBoundsID;// reflect side-effects\n\n return bounds;\n }\n\n /**\n * Calculates the global position of the display object.\n * @param position - The world origin to calculate from.\n * @param point - A Point object in which to store the value, optional\n * (otherwise will create a new Point).\n * @param skipUpdate - Should we skip the update transform.\n * @returns - A point object representing the position of this object.\n */\n toGlobal<P extends IPointData = Point>(position: IPointData, point?: P, skipUpdate = false): P\n {\n if (!skipUpdate)\n {\n this._recursivePostUpdateTransform();\n\n // this parent check is for just in case the item is a root object.\n // If it is we need to give it a temporary parent so that displayObjectUpdateTransform works correctly\n // this is mainly to avoid a parent check in the main loop. Every little helps for performance :)\n if (!this.parent)\n {\n this.parent = this._tempDisplayObjectParent as Container;\n this.displayObjectUpdateTransform();\n this.parent = null;\n }\n else\n {\n this.displayObjectUpdateTransform();\n }\n }\n\n // don't need to update the lot\n return this.worldTransform.apply<P>(position, point);\n }\n\n /**\n * Calculates the local position of the display object relative to another point.\n * @param position - The world origin to calculate from.\n * @param from - The DisplayObject to calculate the global position from.\n * @param point - A Point object in which to store the value, optional\n * (otherwise will create a new Point).\n * @param skipUpdate - Should we skip the update transform\n * @returns - A point object representing the position of this object\n */\n toLocal<P extends IPointData = Point>(position: IPointData, from?: DisplayObject, point?: P, skipUpdate?: boolean): P\n {\n if (from)\n {\n position = from.toGlobal(position, point, skipUpdate);\n }\n\n if (!skipUpdate)\n {\n this._recursivePostUpdateTransform();\n\n // this parent check is for just in case the item is a root object.\n // If it is we need to give it a temporary parent so that displayObjectUpdateTransform works correctly\n // this is mainly to avoid a parent check in the main loop. Every little helps for performance :)\n if (!this.parent)\n {\n this.parent = this._tempDisplayObjectParent as Container;\n this.displayObjectUpdateTransform();\n this.parent = null;\n }\n else\n {\n this.displayObjectUpdateTransform();\n }\n }\n\n // simply apply the matrix..\n return this.worldTransform.applyInverse<P>(position, point);\n }\n\n /**\n * Set the parent Container of this DisplayObject.\n * @param container - The Container to add this DisplayObject to.\n * @returns - The Container that this DisplayObject was added to.\n */\n setParent(container: Container): Container\n {\n if (!container || !container.addChild)\n {\n throw new Error('setParent: Argument must be a Container');\n }\n\n container.addChild(this);\n\n return container;\n }\n\n /**\n * Convenience function to set the position, scale, skew and pivot at once.\n * @param x - The X position\n * @param y - The Y position\n * @param scaleX - The X scale value\n * @param scaleY - The Y scale value\n * @param rotation - The rotation\n * @param skewX - The X skew value\n * @param skewY - The Y skew value\n * @param pivotX - The X pivot value\n * @param pivotY - The Y pivot value\n * @returns - The DisplayObject instance\n */\n setTransform(x = 0, y = 0, scaleX = 1, scaleY = 1, rotation = 0, skewX = 0, skewY = 0, pivotX = 0, pivotY = 0): this\n {\n this.position.x = x;\n this.position.y = y;\n this.scale.x = !scaleX ? 1 : scaleX;\n this.scale.y = !scaleY ? 1 : scaleY;\n this.rotation = rotation;\n this.skew.x = skewX;\n this.skew.y = skewY;\n this.pivot.x = pivotX;\n this.pivot.y = pivotY;\n\n return this;\n }\n\n /**\n * Base destroy method for generic display objects. This will automatically\n * remove the display object from its parent Container as well as remove\n * all current event listeners and internal references. Do not use a DisplayObject\n * after calling `destroy()`.\n * @param _options\n */\n destroy(_options?: IDestroyOptions | boolean): void\n {\n if (this.parent)\n {\n this.parent.removeChild(this);\n }\n this._destroyed = true;\n this.transform = null;\n\n this.parent = null;\n this._bounds = null;\n this.mask = null;\n\n this.cullArea = null;\n this.filters = null;\n this.filterArea = null;\n this.hitArea = null;\n\n this.interactive = false;\n this.interactiveChildren = false;\n\n this.emit('destroyed');\n this.removeAllListeners();\n }\n\n /**\n * @protected\n * @member {PIXI.Container}\n */\n get _tempDisplayObjectParent(): TemporaryDisplayObject\n {\n if (this.tempDisplayObjectParent === null)\n {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n this.tempDisplayObjectParent = new TemporaryDisplayObject();\n }\n\n return this.tempDisplayObjectParent;\n }\n\n /**\n * Used in Renderer, cacheAsBitmap and other places where you call an `updateTransform` on root\n *\n * ```\n * const cacheParent = elem.enableTempParent();\n * elem.updateTransform();\n * elem.disableTempParent(cacheParent);\n * ```\n * @returns - current parent\n */\n enableTempParent(): Container\n {\n const myParent = this.parent;\n\n this.parent = this._tempDisplayObjectParent as Container;\n\n return myParent;\n }\n\n /**\n * Pair method for `enableTempParent`\n * @param cacheParent - Actual parent of element\n */\n disableTempParent(cacheParent: Container): void\n {\n this.parent = cacheParent;\n }\n\n /**\n * The position of the displayObject on the x axis relative to the local coordinates of the parent.\n * An alias to position.x\n */\n get x(): number\n {\n return this.position.x;\n }\n\n set x(value: number)\n {\n this.transform.position.x = value;\n }\n\n /**\n * The position of the displayObject on the y axis relative to the local coordinates of the parent.\n * An alias to position.y\n */\n get y(): number\n {\n return this.position.y;\n }\n\n set y(value: number)\n {\n this.transform.position.y = value;\n }\n\n /**\n * Current transform of the object based on world (parent) factors.\n * @readonly\n */\n get worldTransform(): Matrix\n {\n return this.transform.worldTransform;\n }\n\n /**\n * Current transform of the object based on local factors: position, scale, other stuff.\n * @readonly\n */\n get localTransform(): Matrix\n {\n return this.transform.localTransform;\n }\n\n /**\n * The coordinate of the object relative to the local coordinates of the parent.\n * @since 4.0.0\n */\n get position(): ObservablePoint\n {\n return this.transform.position;\n }\n\n set position(value: IPointData)\n {\n this.transform.position.copyFrom(value);\n }\n\n /**\n * The scale factors of this object along the local coordinate axes.\n *\n * The default scale is (1, 1).\n * @since 4.0.0\n */\n get scale(): ObservablePoint\n {\n return this.transform.scale;\n }\n\n set scale(value: IPointData)\n {\n this.transform.scale.copyFrom(value);\n }\n\n /**\n * The center of rotation, scaling, and skewing for this display object in its local space. The `position`\n * is the projection of `pivot` in the parent's local space.\n *\n * By default, the pivot is the origin (0, 0).\n * @since 4.0.0\n */\n get pivot(): ObservablePoint\n {\n return this.transform.pivot;\n }\n\n set pivot(value: IPointData)\n {\n this.transform.pivot.copyFrom(value);\n }\n\n /**\n * The skew factor for the object in radians.\n * @since 4.0.0\n */\n get skew(): ObservablePoint\n {\n return this.transform.skew;\n }\n\n set skew(value: IPointData)\n {\n this.transform.skew.copyFrom(value);\n }\n\n /**\n * The rotation of the object in radians.\n * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.\n */\n get rotation(): number\n {\n return this.transform.rotation;\n }\n\n set rotation(value: number)\n {\n this.transform.rotation = value;\n }\n\n /**\n * The angle of the object in degrees.\n * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.\n */\n get angle(): number\n {\n return this.transform.rotation * RAD_TO_DEG;\n }\n\n set angle(value: number)\n {\n this.transform.rotation = value * DEG_TO_RAD;\n }\n\n /**\n * The zIndex of the displayObject.\n *\n * If a container has the sortableChildren property set to true, children will be automatically\n * sorted by zIndex value; a higher value will mean it will be moved towards the end of the array,\n * and thus rendered on top of other display objects within the same container.\n * @see PIXI.Container#sortableChildren\n */\n get zIndex(): number\n {\n return this._zIndex;\n }\n\n set zIndex(value: number)\n {\n this._zIndex = value;\n if (this.parent)\n {\n this.parent.sortDirty = true;\n }\n }\n\n /**\n * Indicates if the object is globally visible.\n * @readonly\n */\n get worldVisible(): boolean\n {\n let item = this as DisplayObject;\n\n do\n {\n if (!item.visible)\n {\n return false;\n }\n\n item = item.parent;\n } while (item);\n\n return true;\n }\n\n /**\n * Sets a mask for the displayObject. A mask is an object that limits the visibility of an\n * object to the shape of the mask applied to it. In PixiJS a regular mask must be a\n * {@link PIXI.Graphics} or a {@link PIXI.Sprite} object. This allows for much faster masking in canvas as it\n * utilities shape clipping. Furthermore, a mask of an object must be in the subtree of its parent.\n * Otherwise, `getLocalBounds` may calculate incorrect bounds, which makes the container's width and height wrong.\n * To remove a mask, set this property to `null`.\n *\n * For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask.\n * @example\n * const graphics = new PIXI.Graphics();\n * graphics.beginFill(0xFF3300);\n * graphics.drawRect(50, 250, 100, 100);\n * graphics.endFill();\n *\n * const sprite = new PIXI.Sprite(texture);\n * sprite.mask = graphics;\n * @todo At the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask.\n */\n get mask(): Container | MaskData | null\n {\n return this._mask;\n }\n\n set mask(value: Container | MaskData | null)\n {\n if (this._mask === value)\n {\n return;\n }\n\n if (this._mask)\n {\n const maskObject = ((this._mask as MaskData).isMaskData\n ? (this._mask as MaskData).maskObject : this._mask) as Container;\n\n if (maskObject)\n {\n maskObject._maskRefCount--;\n\n if (maskObject._maskRefCount === 0)\n {\n maskObject.renderable = true;\n maskObject.isMask = false;\n }\n }\n }\n\n this._mask = value;\n\n if (this._mask)\n {\n const maskObject = ((this._mask as MaskData).isMaskData\n ? (this._mask as MaskData).maskObject : this._mask) as Container;\n\n if (maskObject)\n {\n if (maskObject._maskRefCount === 0)\n {\n maskObject.renderable = false;\n maskObject.isMask = true;\n }\n\n maskObject._maskRefCount++;\n }\n }\n }\n}\n\n/**\n * @private\n */\nexport class TemporaryDisplayObject extends DisplayObject\n{\n calculateBounds: () => null;\n removeChild: (child: DisplayObject) => null;\n render: (renderer: Renderer) => null;\n sortDirty: boolean = null;\n}\n\n/**\n * DisplayObject default updateTransform, does not update children of container.\n * Will crash if there's no parent element.\n * @memberof PIXI.DisplayObject#\n * @method displayObjectUpdateTransform\n */\nDisplayObject.prototype.displayObjectUpdateTransform = DisplayObject.prototype.updateTransform;\n","/*!\n * @pixi/constants - v6.5.1\n * Compiled Sun, 24 Jul 2022 20:56:21 UTC\n *\n * @pixi/constants is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\n/**\n * Different types of environments for WebGL.\n * @static\n * @memberof PIXI\n * @name ENV\n * @enum {number}\n * @property {number} WEBGL_LEGACY - Used for older v1 WebGL devices. PixiJS will aim to ensure compatibility\n * with older / less advanced devices. If you experience unexplained flickering prefer this environment.\n * @property {number} WEBGL - Version 1 of WebGL\n * @property {number} WEBGL2 - Version 2 of WebGL\n */\nvar ENV;\n(function (ENV) {\n ENV[ENV[\"WEBGL_LEGACY\"] = 0] = \"WEBGL_LEGACY\";\n ENV[ENV[\"WEBGL\"] = 1] = \"WEBGL\";\n ENV[ENV[\"WEBGL2\"] = 2] = \"WEBGL2\";\n})(ENV || (ENV = {}));\n/**\n * Constant to identify the Renderer Type.\n * @static\n * @memberof PIXI\n * @name RENDERER_TYPE\n * @enum {number}\n * @property {number} UNKNOWN - Unknown render type.\n * @property {number} WEBGL - WebGL render type.\n * @property {number} CANVAS - Canvas render type.\n */\nvar RENDERER_TYPE;\n(function (RENDERER_TYPE) {\n RENDERER_TYPE[RENDERER_TYPE[\"UNKNOWN\"] = 0] = \"UNKNOWN\";\n RENDERER_TYPE[RENDERER_TYPE[\"WEBGL\"] = 1] = \"WEBGL\";\n RENDERER_TYPE[RENDERER_TYPE[\"CANVAS\"] = 2] = \"CANVAS\";\n})(RENDERER_TYPE || (RENDERER_TYPE = {}));\n/**\n * Bitwise OR of masks that indicate the buffers to be cleared.\n * @static\n * @memberof PIXI\n * @name BUFFER_BITS\n * @enum {number}\n * @property {number} COLOR - Indicates the buffers currently enabled for color writing.\n * @property {number} DEPTH - Indicates the depth buffer.\n * @property {number} STENCIL - Indicates the stencil buffer.\n */\nvar BUFFER_BITS;\n(function (BUFFER_BITS) {\n BUFFER_BITS[BUFFER_BITS[\"COLOR\"] = 16384] = \"COLOR\";\n BUFFER_BITS[BUFFER_BITS[\"DEPTH\"] = 256] = \"DEPTH\";\n BUFFER_BITS[BUFFER_BITS[\"STENCIL\"] = 1024] = \"STENCIL\";\n})(BUFFER_BITS || (BUFFER_BITS = {}));\n/**\n * Various blend modes supported by PIXI.\n *\n * IMPORTANT - The WebGL renderer only supports the NORMAL, ADD, MULTIPLY and SCREEN blend modes.\n * Anything else will silently act like NORMAL.\n * @memberof PIXI\n * @name BLEND_MODES\n * @enum {number}\n * @property {number} NORMAL -\n * @property {number} ADD -\n * @property {number} MULTIPLY -\n * @property {number} SCREEN -\n * @property {number} OVERLAY -\n * @property {number} DARKEN -\n * @property {number} LIGHTEN -\n * @property {number} COLOR_DODGE -\n * @property {number} COLOR_BURN -\n * @property {number} HARD_LIGHT -\n * @property {number} SOFT_LIGHT -\n * @property {number} DIFFERENCE -\n * @property {number} EXCLUSION -\n * @property {number} HUE -\n * @property {number} SATURATION -\n * @property {number} COLOR -\n * @property {number} LUMINOSITY -\n * @property {number} NORMAL_NPM -\n * @property {number} ADD_NPM -\n * @property {number} SCREEN_NPM -\n * @property {number} NONE -\n * @property {number} SRC_IN -\n * @property {number} SRC_OUT -\n * @property {number} SRC_ATOP -\n * @property {number} DST_OVER -\n * @property {number} DST_IN -\n * @property {number} DST_OUT -\n * @property {number} DST_ATOP -\n * @property {number} SUBTRACT -\n * @property {number} SRC_OVER -\n * @property {number} ERASE -\n * @property {number} XOR -\n */\nvar BLEND_MODES;\n(function (BLEND_MODES) {\n BLEND_MODES[BLEND_MODES[\"NORMAL\"] = 0] = \"NORMAL\";\n BLEND_MODES[BLEND_MODES[\"ADD\"] = 1] = \"ADD\";\n BLEND_MODES[BLEND_MODES[\"MULTIPLY\"] = 2] = \"MULTIPLY\";\n BLEND_MODES[BLEND_MODES[\"SCREEN\"] = 3] = \"SCREEN\";\n BLEND_MODES[BLEND_MODES[\"OVERLAY\"] = 4] = \"OVERLAY\";\n BLEND_MODES[BLEND_MODES[\"DARKEN\"] = 5] = \"DARKEN\";\n BLEND_MODES[BLEND_MODES[\"LIGHTEN\"] = 6] = \"LIGHTEN\";\n BLEND_MODES[BLEND_MODES[\"COLOR_DODGE\"] = 7] = \"COLOR_DODGE\";\n BLEND_MODES[BLEND_MODES[\"COLOR_BURN\"] = 8] = \"COLOR_BURN\";\n BLEND_MODES[BLEND_MODES[\"HARD_LIGHT\"] = 9] = \"HARD_LIGHT\";\n BLEND_MODES[BLEND_MODES[\"SOFT_LIGHT\"] = 10] = \"SOFT_LIGHT\";\n BLEND_MODES[BLEND_MODES[\"DIFFERENCE\"] = 11] = \"DIFFERENCE\";\n BLEND_MODES[BLEND_MODES[\"EXCLUSION\"] = 12] = \"EXCLUSION\";\n BLEND_MODES[BLEND_MODES[\"HUE\"] = 13] = \"HUE\";\n BLEND_MODES[BLEND_MODES[\"SATURATION\"] = 14] = \"SATURATION\";\n BLEND_MODES[BLEND_MODES[\"COLOR\"] = 15] = \"COLOR\";\n BLEND_MODES[BLEND_MODES[\"LUMINOSITY\"] = 16] = \"LUMINOSITY\";\n BLEND_MODES[BLEND_MODES[\"NORMAL_NPM\"] = 17] = \"NORMAL_NPM\";\n BLEND_MODES[BLEND_MODES[\"ADD_NPM\"] = 18] = \"ADD_NPM\";\n BLEND_MODES[BLEND_MODES[\"SCREEN_NPM\"] = 19] = \"SCREEN_NPM\";\n BLEND_MODES[BLEND_MODES[\"NONE\"] = 20] = \"NONE\";\n BLEND_MODES[BLEND_MODES[\"SRC_OVER\"] = 0] = \"SRC_OVER\";\n BLEND_MODES[BLEND_MODES[\"SRC_IN\"] = 21] = \"SRC_IN\";\n BLEND_MODES[BLEND_MODES[\"SRC_OUT\"] = 22] = \"SRC_OUT\";\n BLEND_MODES[BLEND_MODES[\"SRC_ATOP\"] = 23] = \"SRC_ATOP\";\n BLEND_MODES[BLEND_MODES[\"DST_OVER\"] = 24] = \"DST_OVER\";\n BLEND_MODES[BLEND_MODES[\"DST_IN\"] = 25] = \"DST_IN\";\n BLEND_MODES[BLEND_MODES[\"DST_OUT\"] = 26] = \"DST_OUT\";\n BLEND_MODES[BLEND_MODES[\"DST_ATOP\"] = 27] = \"DST_ATOP\";\n BLEND_MODES[BLEND_MODES[\"ERASE\"] = 26] = \"ERASE\";\n BLEND_MODES[BLEND_MODES[\"SUBTRACT\"] = 28] = \"SUBTRACT\";\n BLEND_MODES[BLEND_MODES[\"XOR\"] = 29] = \"XOR\";\n})(BLEND_MODES || (BLEND_MODES = {}));\n/**\n * Various webgl draw modes. These can be used to specify which GL drawMode to use\n * under certain situations and renderers.\n * @memberof PIXI\n * @static\n * @name DRAW_MODES\n * @enum {number}\n * @property {number} POINTS -\n * @property {number} LINES -\n * @property {number} LINE_LOOP -\n * @property {number} LINE_STRIP -\n * @property {number} TRIANGLES -\n * @property {number} TRIANGLE_STRIP -\n * @property {number} TRIANGLE_FAN -\n */\nvar DRAW_MODES;\n(function (DRAW_MODES) {\n DRAW_MODES[DRAW_MODES[\"POINTS\"] = 0] = \"POINTS\";\n DRAW_MODES[DRAW_MODES[\"LINES\"] = 1] = \"LINES\";\n DRAW_MODES[DRAW_MODES[\"LINE_LOOP\"] = 2] = \"LINE_LOOP\";\n DRAW_MODES[DRAW_MODES[\"LINE_STRIP\"] = 3] = \"LINE_STRIP\";\n DRAW_MODES[DRAW_MODES[\"TRIANGLES\"] = 4] = \"TRIANGLES\";\n DRAW_MODES[DRAW_MODES[\"TRIANGLE_STRIP\"] = 5] = \"TRIANGLE_STRIP\";\n DRAW_MODES[DRAW_MODES[\"TRIANGLE_FAN\"] = 6] = \"TRIANGLE_FAN\";\n})(DRAW_MODES || (DRAW_MODES = {}));\n/**\n * Various GL texture/resources formats.\n * @memberof PIXI\n * @static\n * @name FORMATS\n * @enum {number}\n * @property {number} [RGBA=6408] -\n * @property {number} [RGB=6407] -\n * @property {number} [RG=33319] -\n * @property {number} [RED=6403] -\n * @property {number} [RGBA_INTEGER=36249] -\n * @property {number} [RGB_INTEGER=36248] -\n * @property {number} [RG_INTEGER=33320] -\n * @property {number} [RED_INTEGER=36244] -\n * @property {number} [ALPHA=6406] -\n * @property {number} [LUMINANCE=6409] -\n * @property {number} [LUMINANCE_ALPHA=6410] -\n * @property {number} [DEPTH_COMPONENT=6402] -\n * @property {number} [DEPTH_STENCIL=34041] -\n */\nvar FORMATS;\n(function (FORMATS) {\n FORMATS[FORMATS[\"RGBA\"] = 6408] = \"RGBA\";\n FORMATS[FORMATS[\"RGB\"] = 6407] = \"RGB\";\n FORMATS[FORMATS[\"RG\"] = 33319] = \"RG\";\n FORMATS[FORMATS[\"RED\"] = 6403] = \"RED\";\n FORMATS[FORMATS[\"RGBA_INTEGER\"] = 36249] = \"RGBA_INTEGER\";\n FORMATS[FORMATS[\"RGB_INTEGER\"] = 36248] = \"RGB_INTEGER\";\n FORMATS[FORMATS[\"RG_INTEGER\"] = 33320] = \"RG_INTEGER\";\n FORMATS[FORMATS[\"RED_INTEGER\"] = 36244] = \"RED_INTEGER\";\n FORMATS[FORMATS[\"ALPHA\"] = 6406] = \"ALPHA\";\n FORMATS[FORMATS[\"LUMINANCE\"] = 6409] = \"LUMINANCE\";\n FORMATS[FORMATS[\"LUMINANCE_ALPHA\"] = 6410] = \"LUMINANCE_ALPHA\";\n FORMATS[FORMATS[\"DEPTH_COMPONENT\"] = 6402] = \"DEPTH_COMPONENT\";\n FORMATS[FORMATS[\"DEPTH_STENCIL\"] = 34041] = \"DEPTH_STENCIL\";\n})(FORMATS || (FORMATS = {}));\n/**\n * Various GL target types.\n * @memberof PIXI\n * @static\n * @name TARGETS\n * @enum {number}\n * @property {number} [TEXTURE_2D=3553] -\n * @property {number} [TEXTURE_CUBE_MAP=34067] -\n * @property {number} [TEXTURE_2D_ARRAY=35866] -\n * @property {number} [TEXTURE_CUBE_MAP_POSITIVE_X=34069] -\n * @property {number} [TEXTURE_CUBE_MAP_NEGATIVE_X=34070] -\n * @property {number} [TEXTURE_CUBE_MAP_POSITIVE_Y=34071] -\n * @property {number} [TEXTURE_CUBE_MAP_NEGATIVE_Y=34072] -\n * @property {number} [TEXTURE_CUBE_MAP_POSITIVE_Z=34073] -\n * @property {number} [TEXTURE_CUBE_MAP_NEGATIVE_Z=34074] -\n */\nvar TARGETS;\n(function (TARGETS) {\n TARGETS[TARGETS[\"TEXTURE_2D\"] = 3553] = \"TEXTURE_2D\";\n TARGETS[TARGETS[\"TEXTURE_CUBE_MAP\"] = 34067] = \"TEXTURE_CUBE_MAP\";\n TARGETS[TARGETS[\"TEXTURE_2D_ARRAY\"] = 35866] = \"TEXTURE_2D_ARRAY\";\n TARGETS[TARGETS[\"TEXTURE_CUBE_MAP_POSITIVE_X\"] = 34069] = \"TEXTURE_CUBE_MAP_POSITIVE_X\";\n TARGETS[TARGETS[\"TEXTURE_CUBE_MAP_NEGATIVE_X\"] = 34070] = \"TEXTURE_CUBE_MAP_NEGATIVE_X\";\n TARGETS[TARGETS[\"TEXTURE_CUBE_MAP_POSITIVE_Y\"] = 34071] = \"TEXTURE_CUBE_MAP_POSITIVE_Y\";\n TARGETS[TARGETS[\"TEXTURE_CUBE_MAP_NEGATIVE_Y\"] = 34072] = \"TEXTURE_CUBE_MAP_NEGATIVE_Y\";\n TARGETS[TARGETS[\"TEXTURE_CUBE_MAP_POSITIVE_Z\"] = 34073] = \"TEXTURE_CUBE_MAP_POSITIVE_Z\";\n TARGETS[TARGETS[\"TEXTURE_CUBE_MAP_NEGATIVE_Z\"] = 34074] = \"TEXTURE_CUBE_MAP_NEGATIVE_Z\";\n})(TARGETS || (TARGETS = {}));\n/**\n * Various GL data format types.\n * @memberof PIXI\n * @static\n * @name TYPES\n * @enum {number}\n * @property {number} [UNSIGNED_BYTE=5121] -\n * @property {number} [UNSIGNED_SHORT=5123] -\n * @property {number} [UNSIGNED_SHORT_5_6_5=33635] -\n * @property {number} [UNSIGNED_SHORT_4_4_4_4=32819] -\n * @property {number} [UNSIGNED_SHORT_5_5_5_1=32820] -\n * @property {number} [UNSIGNED_INT=5125] -\n * @property {number} [UNSIGNED_INT_10F_11F_11F_REV=35899] -\n * @property {number} [UNSIGNED_INT_2_10_10_10_REV=33640] -\n * @property {number} [UNSIGNED_INT_24_8=34042] -\n * @property {number} [UNSIGNED_INT_5_9_9_9_REV=35902] -\n * @property {number} [BYTE=5120] -\n * @property {number} [SHORT=5122] -\n * @property {number} [INT=5124] -\n * @property {number} [FLOAT=5126] -\n * @property {number} [FLOAT_32_UNSIGNED_INT_24_8_REV=36269] -\n * @property {number} [HALF_FLOAT=36193] -\n */\nvar TYPES;\n(function (TYPES) {\n TYPES[TYPES[\"UNSIGNED_BYTE\"] = 5121] = \"UNSIGNED_BYTE\";\n TYPES[TYPES[\"UNSIGNED_SHORT\"] = 5123] = \"UNSIGNED_SHORT\";\n TYPES[TYPES[\"UNSIGNED_SHORT_5_6_5\"] = 33635] = \"UNSIGNED_SHORT_5_6_5\";\n TYPES[TYPES[\"UNSIGNED_SHORT_4_4_4_4\"] = 32819] = \"UNSIGNED_SHORT_4_4_4_4\";\n TYPES[TYPES[\"UNSIGNED_SHORT_5_5_5_1\"] = 32820] = \"UNSIGNED_SHORT_5_5_5_1\";\n TYPES[TYPES[\"UNSIGNED_INT\"] = 5125] = \"UNSIGNED_INT\";\n TYPES[TYPES[\"UNSIGNED_INT_10F_11F_11F_REV\"] = 35899] = \"UNSIGNED_INT_10F_11F_11F_REV\";\n TYPES[TYPES[\"UNSIGNED_INT_2_10_10_10_REV\"] = 33640] = \"UNSIGNED_INT_2_10_10_10_REV\";\n TYPES[TYPES[\"UNSIGNED_INT_24_8\"] = 34042] = \"UNSIGNED_INT_24_8\";\n TYPES[TYPES[\"UNSIGNED_INT_5_9_9_9_REV\"] = 35902] = \"UNSIGNED_INT_5_9_9_9_REV\";\n TYPES[TYPES[\"BYTE\"] = 5120] = \"BYTE\";\n TYPES[TYPES[\"SHORT\"] = 5122] = \"SHORT\";\n TYPES[TYPES[\"INT\"] = 5124] = \"INT\";\n TYPES[TYPES[\"FLOAT\"] = 5126] = \"FLOAT\";\n TYPES[TYPES[\"FLOAT_32_UNSIGNED_INT_24_8_REV\"] = 36269] = \"FLOAT_32_UNSIGNED_INT_24_8_REV\";\n TYPES[TYPES[\"HALF_FLOAT\"] = 36193] = \"HALF_FLOAT\";\n})(TYPES || (TYPES = {}));\n/**\n * Various sampler types. Correspond to `sampler`, `isampler`, `usampler` GLSL types respectively.\n * WebGL1 works only with FLOAT.\n * @memberof PIXI\n * @static\n * @name SAMPLER_TYPES\n * @enum {number}\n * @property {number} [FLOAT=0] -\n * @property {number} [INT=1] -\n * @property {number} [UINT=2] -\n */\nvar SAMPLER_TYPES;\n(function (SAMPLER_TYPES) {\n SAMPLER_TYPES[SAMPLER_TYPES[\"FLOAT\"] = 0] = \"FLOAT\";\n SAMPLER_TYPES[SAMPLER_TYPES[\"INT\"] = 1] = \"INT\";\n SAMPLER_TYPES[SAMPLER_TYPES[\"UINT\"] = 2] = \"UINT\";\n})(SAMPLER_TYPES || (SAMPLER_TYPES = {}));\n/**\n * The scale modes that are supported by pixi.\n *\n * The {@link PIXI.settings.SCALE_MODE} scale mode affects the default scaling mode of future operations.\n * It can be re-assigned to either LINEAR or NEAREST, depending upon suitability.\n * @memberof PIXI\n * @static\n * @name SCALE_MODES\n * @enum {number}\n * @property {number} LINEAR Smooth scaling\n * @property {number} NEAREST Pixelating scaling\n */\nvar SCALE_MODES;\n(function (SCALE_MODES) {\n SCALE_MODES[SCALE_MODES[\"NEAREST\"] = 0] = \"NEAREST\";\n SCALE_MODES[SCALE_MODES[\"LINEAR\"] = 1] = \"LINEAR\";\n})(SCALE_MODES || (SCALE_MODES = {}));\n/**\n * The wrap modes that are supported by pixi.\n *\n * The {@link PIXI.settings.WRAP_MODE} wrap mode affects the default wrapping mode of future operations.\n * It can be re-assigned to either CLAMP or REPEAT, depending upon suitability.\n * If the texture is non power of two then clamp will be used regardless as WebGL can\n * only use REPEAT if the texture is po2.\n *\n * This property only affects WebGL.\n * @name WRAP_MODES\n * @memberof PIXI\n * @static\n * @enum {number}\n * @property {number} CLAMP - The textures uvs are clamped\n * @property {number} REPEAT - The texture uvs tile and repeat\n * @property {number} MIRRORED_REPEAT - The texture uvs tile and repeat with mirroring\n */\nvar WRAP_MODES;\n(function (WRAP_MODES) {\n WRAP_MODES[WRAP_MODES[\"CLAMP\"] = 33071] = \"CLAMP\";\n WRAP_MODES[WRAP_MODES[\"REPEAT\"] = 10497] = \"REPEAT\";\n WRAP_MODES[WRAP_MODES[\"MIRRORED_REPEAT\"] = 33648] = \"MIRRORED_REPEAT\";\n})(WRAP_MODES || (WRAP_MODES = {}));\n/**\n * Mipmap filtering modes that are supported by pixi.\n *\n * The {@link PIXI.settings.MIPMAP_TEXTURES} affects default texture filtering.\n * Mipmaps are generated for a baseTexture if its `mipmap` field is `ON`,\n * or its `POW2` and texture dimensions are powers of 2.\n * Due to platform restriction, `ON` option will work like `POW2` for webgl-1.\n *\n * This property only affects WebGL.\n * @name MIPMAP_MODES\n * @memberof PIXI\n * @static\n * @enum {number}\n * @property {number} OFF - No mipmaps\n * @property {number} POW2 - Generate mipmaps if texture dimensions are pow2\n * @property {number} ON - Always generate mipmaps\n * @property {number} ON_MANUAL - Use mipmaps, but do not auto-generate them; this is used with a resource\n * that supports buffering each level-of-detail.\n */\nvar MIPMAP_MODES;\n(function (MIPMAP_MODES) {\n MIPMAP_MODES[MIPMAP_MODES[\"OFF\"] = 0] = \"OFF\";\n MIPMAP_MODES[MIPMAP_MODES[\"POW2\"] = 1] = \"POW2\";\n MIPMAP_MODES[MIPMAP_MODES[\"ON\"] = 2] = \"ON\";\n MIPMAP_MODES[MIPMAP_MODES[\"ON_MANUAL\"] = 3] = \"ON_MANUAL\";\n})(MIPMAP_MODES || (MIPMAP_MODES = {}));\n/**\n * How to treat textures with premultiplied alpha\n * @name ALPHA_MODES\n * @memberof PIXI\n * @static\n * @enum {number}\n * @property {number} NO_PREMULTIPLIED_ALPHA - Source is not premultiplied, leave it like that.\n * Option for compressed and data textures that are created from typed arrays.\n * @property {number} PREMULTIPLY_ON_UPLOAD - Source is not premultiplied, premultiply on upload.\n * Default option, used for all loaded images.\n * @property {number} PREMULTIPLIED_ALPHA - Source is already premultiplied\n * Example: spine atlases with `_pma` suffix.\n * @property {number} NPM - Alias for NO_PREMULTIPLIED_ALPHA.\n * @property {number} UNPACK - Default option, alias for PREMULTIPLY_ON_UPLOAD.\n * @property {number} PMA - Alias for PREMULTIPLIED_ALPHA.\n */\nvar ALPHA_MODES;\n(function (ALPHA_MODES) {\n ALPHA_MODES[ALPHA_MODES[\"NPM\"] = 0] = \"NPM\";\n ALPHA_MODES[ALPHA_MODES[\"UNPACK\"] = 1] = \"UNPACK\";\n ALPHA_MODES[ALPHA_MODES[\"PMA\"] = 2] = \"PMA\";\n ALPHA_MODES[ALPHA_MODES[\"NO_PREMULTIPLIED_ALPHA\"] = 0] = \"NO_PREMULTIPLIED_ALPHA\";\n ALPHA_MODES[ALPHA_MODES[\"PREMULTIPLY_ON_UPLOAD\"] = 1] = \"PREMULTIPLY_ON_UPLOAD\";\n ALPHA_MODES[ALPHA_MODES[\"PREMULTIPLY_ALPHA\"] = 2] = \"PREMULTIPLY_ALPHA\";\n ALPHA_MODES[ALPHA_MODES[\"PREMULTIPLIED_ALPHA\"] = 2] = \"PREMULTIPLIED_ALPHA\";\n})(ALPHA_MODES || (ALPHA_MODES = {}));\n/**\n * Configure whether filter textures are cleared after binding.\n *\n * Filter textures need not be cleared if the filter does not use pixel blending. {@link CLEAR_MODES.BLIT} will detect\n * this and skip clearing as an optimization.\n * @name CLEAR_MODES\n * @memberof PIXI\n * @static\n * @enum {number}\n * @property {number} BLEND - Do not clear the filter texture. The filter's output will blend on top of the output texture.\n * @property {number} CLEAR - Always clear the filter texture.\n * @property {number} BLIT - Clear only if {@link FilterSystem.forceClear} is set or if the filter uses pixel blending.\n * @property {number} NO - Alias for BLEND, same as `false` in earlier versions\n * @property {number} YES - Alias for CLEAR, same as `true` in earlier versions\n * @property {number} AUTO - Alias for BLIT\n */\nvar CLEAR_MODES;\n(function (CLEAR_MODES) {\n CLEAR_MODES[CLEAR_MODES[\"NO\"] = 0] = \"NO\";\n CLEAR_MODES[CLEAR_MODES[\"YES\"] = 1] = \"YES\";\n CLEAR_MODES[CLEAR_MODES[\"AUTO\"] = 2] = \"AUTO\";\n CLEAR_MODES[CLEAR_MODES[\"BLEND\"] = 0] = \"BLEND\";\n CLEAR_MODES[CLEAR_MODES[\"CLEAR\"] = 1] = \"CLEAR\";\n CLEAR_MODES[CLEAR_MODES[\"BLIT\"] = 2] = \"BLIT\";\n})(CLEAR_MODES || (CLEAR_MODES = {}));\n/**\n * The gc modes that are supported by pixi.\n *\n * The {@link PIXI.settings.GC_MODE} Garbage Collection mode for PixiJS textures is AUTO\n * If set to GC_MODE, the renderer will occasionally check textures usage. If they are not\n * used for a specified period of time they will be removed from the GPU. They will of course\n * be uploaded again when they are required. This is a silent behind the scenes process that\n * should ensure that the GPU does not get filled up.\n *\n * Handy for mobile devices!\n * This property only affects WebGL.\n * @name GC_MODES\n * @enum {number}\n * @static\n * @memberof PIXI\n * @property {number} AUTO - Garbage collection will happen periodically automatically\n * @property {number} MANUAL - Garbage collection will need to be called manually\n */\nvar GC_MODES;\n(function (GC_MODES) {\n GC_MODES[GC_MODES[\"AUTO\"] = 0] = \"AUTO\";\n GC_MODES[GC_MODES[\"MANUAL\"] = 1] = \"MANUAL\";\n})(GC_MODES || (GC_MODES = {}));\n/**\n * Constants that specify float precision in shaders.\n * @name PRECISION\n * @memberof PIXI\n * @constant\n * @static\n * @enum {string}\n * @property {string} [LOW='lowp'] -\n * @property {string} [MEDIUM='mediump'] -\n * @property {string} [HIGH='highp'] -\n */\nvar PRECISION;\n(function (PRECISION) {\n PRECISION[\"LOW\"] = \"lowp\";\n PRECISION[\"MEDIUM\"] = \"mediump\";\n PRECISION[\"HIGH\"] = \"highp\";\n})(PRECISION || (PRECISION = {}));\n/**\n * Constants for mask implementations.\n * We use `type` suffix because it leads to very different behaviours\n * @name MASK_TYPES\n * @memberof PIXI\n * @static\n * @enum {number}\n * @property {number} NONE - Mask is ignored\n * @property {number} SCISSOR - Scissor mask, rectangle on screen, cheap\n * @property {number} STENCIL - Stencil mask, 1-bit, medium, works only if renderer supports stencil\n * @property {number} SPRITE - Mask that uses SpriteMaskFilter, uses temporary RenderTexture\n * @property {number} COLOR - Color mask (RGBA)\n */\nvar MASK_TYPES;\n(function (MASK_TYPES) {\n MASK_TYPES[MASK_TYPES[\"NONE\"] = 0] = \"NONE\";\n MASK_TYPES[MASK_TYPES[\"SCISSOR\"] = 1] = \"SCISSOR\";\n MASK_TYPES[MASK_TYPES[\"STENCIL\"] = 2] = \"STENCIL\";\n MASK_TYPES[MASK_TYPES[\"SPRITE\"] = 3] = \"SPRITE\";\n MASK_TYPES[MASK_TYPES[\"COLOR\"] = 4] = \"COLOR\";\n})(MASK_TYPES || (MASK_TYPES = {}));\n/**\n * Bitwise OR of masks that indicate the color channels that are rendered to.\n * @static\n * @memberof PIXI\n * @name COLOR_MASK_BITS\n * @enum {number}\n * @property {number} RED - Red channel.\n * @property {number} GREEN - Green channel\n * @property {number} BLUE - Blue channel.\n * @property {number} ALPHA - Alpha channel.\n */\nvar COLOR_MASK_BITS;\n(function (COLOR_MASK_BITS) {\n COLOR_MASK_BITS[COLOR_MASK_BITS[\"RED\"] = 1] = \"RED\";\n COLOR_MASK_BITS[COLOR_MASK_BITS[\"GREEN\"] = 2] = \"GREEN\";\n COLOR_MASK_BITS[COLOR_MASK_BITS[\"BLUE\"] = 4] = \"BLUE\";\n COLOR_MASK_BITS[COLOR_MASK_BITS[\"ALPHA\"] = 8] = \"ALPHA\";\n})(COLOR_MASK_BITS || (COLOR_MASK_BITS = {}));\n/**\n * Constants for multi-sampling antialiasing.\n * @see PIXI.Framebuffer#multisample\n * @name MSAA_QUALITY\n * @memberof PIXI\n * @static\n * @enum {number}\n * @property {number} NONE - No multisampling for this renderTexture\n * @property {number} LOW - Try 2 samples\n * @property {number} MEDIUM - Try 4 samples\n * @property {number} HIGH - Try 8 samples\n */\nvar MSAA_QUALITY;\n(function (MSAA_QUALITY) {\n MSAA_QUALITY[MSAA_QUALITY[\"NONE\"] = 0] = \"NONE\";\n MSAA_QUALITY[MSAA_QUALITY[\"LOW\"] = 2] = \"LOW\";\n MSAA_QUALITY[MSAA_QUALITY[\"MEDIUM\"] = 4] = \"MEDIUM\";\n MSAA_QUALITY[MSAA_QUALITY[\"HIGH\"] = 8] = \"HIGH\";\n})(MSAA_QUALITY || (MSAA_QUALITY = {}));\n/**\n * Constants for various buffer types in Pixi\n * @see PIXI.BUFFER_TYPE\n * @name BUFFER_TYPE\n * @memberof PIXI\n * @static\n * @enum {number}\n * @property {number} ELEMENT_ARRAY_BUFFER - buffer type for using as an index buffer\n * @property {number} ARRAY_BUFFER - buffer type for using attribute data\n * @property {number} UNIFORM_BUFFER - the buffer type is for uniform buffer objects\n */\nvar BUFFER_TYPE;\n(function (BUFFER_TYPE) {\n BUFFER_TYPE[BUFFER_TYPE[\"ELEMENT_ARRAY_BUFFER\"] = 34963] = \"ELEMENT_ARRAY_BUFFER\";\n BUFFER_TYPE[BUFFER_TYPE[\"ARRAY_BUFFER\"] = 34962] = \"ARRAY_BUFFER\";\n // NOT YET SUPPORTED\n BUFFER_TYPE[BUFFER_TYPE[\"UNIFORM_BUFFER\"] = 35345] = \"UNIFORM_BUFFER\";\n})(BUFFER_TYPE || (BUFFER_TYPE = {}));\n\nexport { ALPHA_MODES, BLEND_MODES, BUFFER_BITS, BUFFER_TYPE, CLEAR_MODES, COLOR_MASK_BITS, DRAW_MODES, ENV, FORMATS, GC_MODES, MASK_TYPES, MIPMAP_MODES, MSAA_QUALITY, PRECISION, RENDERER_TYPE, SAMPLER_TYPES, SCALE_MODES, TARGETS, TYPES, WRAP_MODES };\n//# sourceMappingURL=constants.mjs.map\n","import { settings } from '@pixi/settings';\nimport { removeItems } from '@pixi/utils';\nimport { DisplayObject } from './DisplayObject';\nimport type { Matrix, Rectangle } from '@pixi/math';\nimport { MASK_TYPES } from '@pixi/constants';\n\nimport type { MaskData, Renderer } from '@pixi/core';\nimport type { IDestroyOptions } from './DisplayObject';\n\nfunction sortChildren(a: DisplayObject, b: DisplayObject): number\n{\n if (a.zIndex === b.zIndex)\n {\n return a._lastSortedIndex - b._lastSortedIndex;\n }\n\n return a.zIndex - b.zIndex;\n}\n\nexport interface Container extends GlobalMixins.Container, DisplayObject {}\n\n/**\n * Container is a general-purpose display object that holds children. It also adds built-in support for advanced\n * rendering features like masking and filtering.\n *\n * It is the base class of all display objects that act as a container for other objects, including Graphics\n * and Sprite.\n *\n * ```js\n * import { BlurFilter } from '@pixi/filter-blur';\n * import { Container } from '@pixi/display';\n * import { Graphics } from '@pixi/graphics';\n * import { Sprite } from '@pixi/sprite';\n *\n * let container = new Container();\n * let sprite = Sprite.from(\"https://s3-us-west-2.amazonaws.com/s.cdpn.io/693612/IaUrttj.png\");\n *\n * sprite.width = 512;\n * sprite.height = 512;\n *\n * // Adds a sprite as a child to this container. As a result, the sprite will be rendered whenever the container\n * // is rendered.\n * container.addChild(sprite);\n *\n * // Blurs whatever is rendered by the container\n * container.filters = [new BlurFilter()];\n *\n * // Only the contents within a circle at the center should be rendered onto the screen.\n * container.mask = new Graphics()\n * .beginFill(0xffffff)\n * .drawCircle(sprite.width / 2, sprite.height / 2, Math.min(sprite.width, sprite.height) / 2)\n * .endFill();\n * ```\n * @memberof PIXI\n */\nexport class Container<T extends DisplayObject = DisplayObject> extends DisplayObject\n{\n /**\n * The array of children of this container.\n * @readonly\n */\n public readonly children: T[];\n\n /**\n * If set to true, the container will sort its children by zIndex value\n * when updateTransform() is called, or manually if sortChildren() is called.\n *\n * This actually changes the order of elements in the array, so should be treated\n * as a basic solution that is not performant compared to other solutions,\n * such as @link https://github.com/pixijs/pixi-display\n *\n * Also be aware of that this may not work nicely with the addChildAt() function,\n * as the zIndex sorting may cause the child to automatically sorted to another position.\n * @see PIXI.settings.SORTABLE_CHILDREN\n */\n public sortableChildren: boolean;\n\n /**\n * Should children be sorted by zIndex at the next updateTransform call.\n *\n * Will get automatically set to true if a new child is added, or if a child's zIndex changes.\n */\n public sortDirty: boolean;\n public parent: Container;\n public containerUpdateTransform: () => void;\n\n protected _width: number;\n protected _height: number;\n\n constructor()\n {\n super();\n\n this.children = [];\n this.sortableChildren = settings.SORTABLE_CHILDREN;\n this.sortDirty = false;\n\n /**\n * Fired when a DisplayObject is added to this Container.\n * @event PIXI.Container#childAdded\n * @param {PIXI.DisplayObject} child - The child added to the Container.\n * @param {PIXI.Container} container - The container that added the child.\n * @param {number} index - The children's index of the added child.\n */\n\n /**\n * Fired when a DisplayObject is removed from this Container.\n * @event PIXI.DisplayObject#removedFrom\n * @param {PIXI.DisplayObject} child - The child removed from the Container.\n * @param {PIXI.Container} container - The container that removed removed the child.\n * @param {number} index - The former children's index of the removed child\n */\n }\n\n /**\n * Overridable method that can be used by Container subclasses whenever the children array is modified.\n * @param _length\n */\n protected onChildrenChange(_length?: number): void\n {\n /* empty */\n }\n\n /**\n * Adds one or more children to the container.\n *\n * Multiple items can be added like so: `myContainer.addChild(thingOne, thingTwo, thingThree)`\n * @param {...PIXI.DisplayObject} children - The DisplayObject(s) to add to the container\n * @returns {PIXI.DisplayObject} - The first child that was added.\n */\n addChild<U extends T[]>(...children: U): U[0]\n {\n // if there is only one argument we can bypass looping through the them\n if (children.length > 1)\n {\n // loop through the array and add all children\n for (let i = 0; i < children.length; i++)\n {\n // eslint-disable-next-line prefer-rest-params\n this.addChild(children[i]);\n }\n }\n else\n {\n const child = children[0];\n // if the child has a parent then lets remove it as PixiJS objects can only exist in one place\n\n if (child.parent)\n {\n child.parent.removeChild(child);\n }\n\n child.parent = this;\n this.sortDirty = true;\n\n // ensure child transform will be recalculated\n child.transform._parentID = -1;\n\n this.children.push(child);\n\n // ensure bounds will be recalculated\n this._boundsID++;\n\n // TODO - lets either do all callbacks or all events.. not both!\n this.onChildrenChange(this.children.length - 1);\n this.emit('childAdded', child, this, this.children.length - 1);\n child.emit('added', this);\n }\n\n return children[0];\n }\n\n /**\n * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown\n * @param {PIXI.DisplayObject} child - The child to add\n * @param {number} index - The index to place the child in\n * @returns {PIXI.DisplayObject} The child that was added.\n */\n addChildAt<U extends T>(child: U, index: number): U\n {\n if (index < 0 || index > this.children.length)\n {\n throw new Error(`${child}addChildAt: The index ${index} supplied is out of bounds ${this.children.length}`);\n }\n\n if (child.parent)\n {\n child.parent.removeChild(child);\n }\n\n child.parent = this;\n this.sortDirty = true;\n\n // ensure child transform will be recalculated\n child.transform._parentID = -1;\n\n this.children.splice(index, 0, child);\n\n // ensure bounds will be recalculated\n this._boundsID++;\n\n // TODO - lets either do all callbacks or all events.. not both!\n this.onChildrenChange(index);\n child.emit('added', this);\n this.emit('childAdded', child, this, index);\n\n return child;\n }\n\n /**\n * Swaps the position of 2 Display Objects within this container.\n * @param child - First display object to swap\n * @param child2 - Second display object to swap\n */\n swapChildren(child: T, child2: T): void\n {\n if (child === child2)\n {\n return;\n }\n\n const index1 = this.getChildIndex(child);\n const index2 = this.getChildIndex(child2);\n\n this.children[index1] = child2;\n this.children[index2] = child;\n this.onChildrenChange(index1 < index2 ? index1 : index2);\n }\n\n /**\n * Returns the index position of a child DisplayObject instance\n * @param child - The DisplayObject instance to identify\n * @returns - The index position of the child display object to identify\n */\n getChildIndex(child: T): number\n {\n const index = this.children.indexOf(child);\n\n if (index === -1)\n {\n throw new Error('The supplied DisplayObject must be a child of the caller');\n }\n\n return index;\n }\n\n /**\n * Changes the position of an existing child in the display object container\n * @param child - The child DisplayObject instance for which you want to change the index number\n * @param index - The resulting index number for the child display object\n */\n setChildIndex(child: T, index: number): void\n {\n if (index < 0 || index >= this.children.length)\n {\n throw new Error(`The index ${index} supplied is out of bounds ${this.children.length}`);\n }\n\n const currentIndex = this.getChildIndex(child);\n\n removeItems(this.children, currentIndex, 1); // remove from old position\n this.children.splice(index, 0, child); // add at new position\n\n this.onChildrenChange(index);\n }\n\n /**\n * Returns the child at the specified index\n * @param index - The index to get the child at\n * @returns - The child at the given index, if any.\n */\n getChildAt(index: number): T\n {\n if (index < 0 || index >= this.children.length)\n {\n throw new Error(`getChildAt: Index (${index}) does not exist.`);\n }\n\n return this.children[index];\n }\n\n /**\n * Removes one or more children from the container.\n * @param {...PIXI.DisplayObject} children - The DisplayObject(s) to remove\n * @returns {PIXI.DisplayObject} The first child that was removed.\n */\n removeChild<U extends T[]>(...children: U): U[0]\n {\n // if there is only one argument we can bypass looping through the them\n if (children.length > 1)\n {\n // loop through the arguments property and remove all children\n for (let i = 0; i < children.length; i++)\n {\n this.removeChild(children[i]);\n }\n }\n else\n {\n const child = children[0];\n const index = this.children.indexOf(child);\n\n if (index === -1) return null;\n\n child.parent = null;\n // ensure child transform will be recalculated\n child.transform._parentID = -1;\n removeItems(this.children, index, 1);\n\n // ensure bounds will be recalculated\n this._boundsID++;\n\n // TODO - lets either do all callbacks or all events.. not both!\n this.onChildrenChange(index);\n child.emit('removed', this);\n this.emit('childRemoved', child, this, index);\n }\n\n return children[0];\n }\n\n /**\n * Removes a child from the specified index position.\n * @param index - The index to get the child from\n * @returns The child that was removed.\n */\n removeChildAt(index: number): T\n {\n const child = this.getChildAt(index);\n\n // ensure child transform will be recalculated..\n child.parent = null;\n child.transform._parentID = -1;\n removeItems(this.children, index, 1);\n\n // ensure bounds will be recalculated\n this._boundsID++;\n\n // TODO - lets either do all callbacks or all events.. not both!\n this.onChildrenChange(index);\n child.emit('removed', this);\n this.emit('childRemoved', child, this, index);\n\n return child;\n }\n\n /**\n * Removes all children from this container that are within the begin and end indexes.\n * @param beginIndex - The beginning position.\n * @param endIndex - The ending position. Default value is size of the container.\n * @returns - List of removed children\n */\n removeChildren(beginIndex = 0, endIndex = this.children.length): T[]\n {\n const begin = beginIndex;\n const end = endIndex;\n const range = end - begin;\n let removed;\n\n if (range > 0 && range <= end)\n {\n removed = this.children.splice(begin, range);\n\n for (let i = 0; i < removed.length; ++i)\n {\n removed[i].parent = null;\n if (removed[i].transform)\n {\n removed[i].transform._parentID = -1;\n }\n }\n\n this._boundsID++;\n\n this.onChildrenChange(beginIndex);\n\n for (let i = 0; i < removed.length; ++i)\n {\n removed[i].emit('removed', this);\n this.emit('childRemoved', removed[i], this, i);\n }\n\n return removed;\n }\n else if (range === 0 && this.children.length === 0)\n {\n return [];\n }\n\n throw new RangeError('removeChildren: numeric values are outside the acceptable range.');\n }\n\n /** Sorts children by zIndex. Previous order is maintained for 2 children with the same zIndex. */\n sortChildren(): void\n {\n let sortRequired = false;\n\n for (let i = 0, j = this.children.length; i < j; ++i)\n {\n const child = this.children[i];\n\n child._lastSortedIndex = i;\n\n if (!sortRequired && child.zIndex !== 0)\n {\n sortRequired = true;\n }\n }\n\n if (sortRequired && this.children.length > 1)\n {\n this.children.sort(sortChildren);\n }\n\n this.sortDirty = false;\n }\n\n /** Updates the transform on all children of this container for rendering. */\n updateTransform(): void\n {\n if (this.sortableChildren && this.sortDirty)\n {\n this.sortChildren();\n }\n\n this._boundsID++;\n\n this.transform.updateTransform(this.parent.transform);\n\n // TODO: check render flags, how to process stuff here\n this.worldAlpha = this.alpha * this.parent.worldAlpha;\n\n for (let i = 0, j = this.children.length; i < j; ++i)\n {\n const child = this.children[i];\n\n if (child.visible)\n {\n child.updateTransform();\n }\n }\n }\n\n /**\n * Recalculates the bounds of the container.\n *\n * This implementation will automatically fit the children's bounds into the calculation. Each child's bounds\n * is limited to its mask's bounds or filterArea, if any is applied.\n */\n calculateBounds(): void\n {\n this._bounds.clear();\n\n this._calculateBounds();\n\n for (let i = 0; i < this.children.length; i++)\n {\n const child = this.children[i];\n\n if (!child.visible || !child.renderable)\n {\n continue;\n }\n\n child.calculateBounds();\n\n // TODO: filter+mask, need to mask both somehow\n if (child._mask)\n {\n const maskObject = ((child._mask as MaskData).isMaskData\n ? (child._mask as MaskData).maskObject : child._mask) as Container;\n\n if (maskObject)\n {\n maskObject.calculateBounds();\n this._bounds.addBoundsMask(child._bounds, maskObject._bounds);\n }\n else\n {\n this._bounds.addBounds(child._bounds);\n }\n }\n else if (child.filterArea)\n {\n this._bounds.addBoundsArea(child._bounds, child.filterArea);\n }\n else\n {\n this._bounds.addBounds(child._bounds);\n }\n }\n\n this._bounds.updateID = this._boundsID;\n }\n\n /**\n * Retrieves the local bounds of the displayObject as a rectangle object.\n *\n * Calling `getLocalBounds` may invalidate the `_bounds` of the whole subtree below. If using it inside a render()\n * call, it is advised to call `getBounds()` immediately after to recalculate the world bounds of the subtree.\n * @param rect - Optional rectangle to store the result of the bounds calculation.\n * @param skipChildrenUpdate - Setting to `true` will stop re-calculation of children transforms,\n * it was default behaviour of pixi 4.0-5.2 and caused many problems to users.\n * @returns - The rectangular bounding area.\n */\n public getLocalBounds(rect?: Rectangle, skipChildrenUpdate = false): Rectangle\n {\n const result = super.getLocalBounds(rect);\n\n if (!skipChildrenUpdate)\n {\n for (let i = 0, j = this.children.length; i < j; ++i)\n {\n const child = this.children[i];\n\n if (child.visible)\n {\n child.updateTransform();\n }\n }\n }\n\n return result;\n }\n\n /**\n * Recalculates the content bounds of this object. This should be overriden to\n * calculate the bounds of this specific object (not including children).\n * @protected\n */\n protected _calculateBounds(): void\n {\n // FILL IN//\n }\n\n /**\n * Renders this object and its children with culling.\n * @protected\n * @param {PIXI.Renderer} renderer - The renderer\n */\n protected _renderWithCulling(renderer: Renderer): void\n {\n const sourceFrame = renderer.renderTexture.sourceFrame;\n\n // If the source frame is empty, stop rendering.\n if (!(sourceFrame.width > 0 && sourceFrame.height > 0))\n {\n return;\n }\n\n // Render the content of the container only if its bounds intersect with the source frame.\n // All filters are on the stack at this point, and the filter source frame is bound:\n // therefore, even if the bounds to non intersect the filter frame, the filter\n // is still applied and any filter padding that is in the frame is rendered correctly.\n\n let bounds: Rectangle;\n let transform: Matrix;\n\n // If cullArea is set, we use this rectangle instead of the bounds of the object. The cullArea\n // rectangle must completely contain the container and its children including filter padding.\n if (this.cullArea)\n {\n bounds = this.cullArea;\n transform = this.worldTransform;\n }\n // If the container doesn't override _render, we can skip the bounds calculation and intersection test.\n else if (this._render !== Container.prototype._render)\n {\n bounds = this.getBounds(true);\n }\n\n // Render the container if the source frame intersects the bounds.\n if (bounds && sourceFrame.intersects(bounds, transform))\n {\n this._render(renderer);\n }\n // If the bounds are defined by cullArea and do not intersect with the source frame, stop rendering.\n else if (this.cullArea)\n {\n return;\n }\n\n // Unless cullArea is set, we cannot skip the children if the bounds of the container do not intersect\n // the source frame, because the children might have filters with nonzero padding, which may intersect\n // with the source frame while the bounds do not: filter padding is not included in the bounds.\n\n // If cullArea is not set, render the children with culling temporarily enabled so that they are not rendered\n // if they are out of frame; otherwise, render the children normally.\n for (let i = 0, j = this.children.length; i < j; ++i)\n {\n const child = this.children[i];\n const childCullable = child.cullable;\n\n child.cullable = childCullable || !this.cullArea;\n child.render(renderer);\n child.cullable = childCullable;\n }\n }\n\n /**\n * Renders the object using the WebGL renderer.\n *\n * The [_render]{@link PIXI.Container#_render} method is be overriden for rendering the contents of the\n * container itself. This `render` method will invoke it, and also invoke the `render` methods of all\n * children afterward.\n *\n * If `renderable` or `visible` is false or if `worldAlpha` is not positive or if `cullable` is true and\n * the bounds of this object are out of frame, this implementation will entirely skip rendering.\n * See {@link PIXI.DisplayObject} for choosing between `renderable` or `visible`. Generally,\n * setting alpha to zero is not recommended for purely skipping rendering.\n *\n * When your scene becomes large (especially when it is larger than can be viewed in a single screen), it is\n * advised to employ **culling** to automatically skip rendering objects outside of the current screen.\n * See [cullable]{@link PIXI.DisplayObject#cullable} and [cullArea]{@link PIXI.DisplayObject#cullArea}.\n * Other culling methods might be better suited for a large number static objects; see\n * [@pixi-essentials/cull]{@link https://www.npmjs.com/package/@pixi-essentials/cull} and\n * [pixi-cull]{@link https://www.npmjs.com/package/pixi-cull}.\n *\n * The [renderAdvanced]{@link PIXI.Container#renderAdvanced} method is internally used when when masking or\n * filtering is applied on a container. This does, however, break batching and can affect performance when\n * masking and filtering is applied extensively throughout the scene graph.\n * @param renderer - The renderer\n */\n render(renderer: Renderer): void\n {\n // if the object is not visible or the alpha is 0 then no need to render this element\n if (!this.visible || this.worldAlpha <= 0 || !this.renderable)\n {\n return;\n }\n\n // do a quick check to see if this element has a mask or a filter.\n if (this._mask || (this.filters && this.filters.length))\n {\n this.renderAdvanced(renderer);\n }\n else if (this.cullable)\n {\n this._renderWithCulling(renderer);\n }\n else\n {\n this._render(renderer);\n\n for (let i = 0, j = this.children.length; i < j; ++i)\n {\n this.children[i].render(renderer);\n }\n }\n }\n\n /**\n * Render the object using the WebGL renderer and advanced features.\n * @param renderer - The renderer\n */\n protected renderAdvanced(renderer: Renderer): void\n {\n const filters = this.filters;\n const mask = this._mask as MaskData;\n\n // push filter first as we need to ensure the stencil buffer is correct for any masking\n if (filters)\n {\n if (!this._enabledFilters)\n {\n this._enabledFilters = [];\n }\n\n this._enabledFilters.length = 0;\n\n for (let i = 0; i < filters.length; i++)\n {\n if (filters[i].enabled)\n {\n this._enabledFilters.push(filters[i]);\n }\n }\n }\n\n const flush = (filters && this._enabledFilters && this._enabledFilters.length)\n || (mask && (!mask.isMaskData\n || (mask.enabled && (mask.autoDetect || mask.type !== MASK_TYPES.NONE))));\n\n if (flush)\n {\n renderer.batch.flush();\n }\n\n if (filters && this._enabledFilters && this._enabledFilters.length)\n {\n renderer.filter.push(this, this._enabledFilters);\n }\n\n if (mask)\n {\n renderer.mask.push(this, this._mask);\n }\n\n if (this.cullable)\n {\n this._renderWithCulling(renderer);\n }\n else\n {\n this._render(renderer);\n\n for (let i = 0, j = this.children.length; i < j; ++i)\n {\n this.children[i].render(renderer);\n }\n }\n\n if (flush)\n {\n renderer.batch.flush();\n }\n\n if (mask)\n {\n renderer.mask.pop(this);\n }\n\n if (filters && this._enabledFilters && this._enabledFilters.length)\n {\n renderer.filter.pop();\n }\n }\n\n /**\n * To be overridden by the subclasses.\n * @param _renderer - The renderer\n */\n protected _render(_renderer: Renderer): void // eslint-disable-line no-unused-vars\n {\n // this is where content itself gets rendered...\n }\n\n /**\n * Removes all internal references and listeners as well as removes children from the display list.\n * Do not use a Container after calling `destroy`.\n * @param options - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have their destroy\n * method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the texture of the child sprite\n * @param {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the base texture of the child sprite\n */\n destroy(options?: IDestroyOptions | boolean): void\n {\n super.destroy();\n\n this.sortDirty = false;\n\n const destroyChildren = typeof options === 'boolean' ? options : options && options.children;\n\n const oldChildren = this.removeChildren(0, this.children.length);\n\n if (destroyChildren)\n {\n for (let i = 0; i < oldChildren.length; ++i)\n {\n oldChildren[i].destroy(options);\n }\n }\n }\n\n /** The width of the Container, setting this will actually modify the scale to achieve the value set. */\n get width(): number\n {\n return this.scale.x * this.getLocalBounds().width;\n }\n\n set width(value: number)\n {\n const width = this.getLocalBounds().width;\n\n if (width !== 0)\n {\n this.scale.x = value / width;\n }\n else\n {\n this.scale.x = 1;\n }\n\n this._width = value;\n }\n\n /** The height of the Container, setting this will actually modify the scale to achieve the value set. */\n get height(): number\n {\n return this.scale.y * this.getLocalBounds().height;\n }\n\n set height(value: number)\n {\n const height = this.getLocalBounds().height;\n\n if (height !== 0)\n {\n this.scale.y = value / height;\n }\n else\n {\n this.scale.y = 1;\n }\n\n this._height = value;\n }\n}\n\n/**\n * Container default updateTransform, does update children of container.\n * Will crash if there's no parent element.\n * @memberof PIXI.Container#\n * @method containerUpdateTransform\n */\nContainer.prototype.containerUpdateTransform = Container.prototype.updateTransform;\n","/**\n * Collection of valid extension types.\n * @memberof PIXI\n * @property {string} Application - Application plugins\n * @property {string} RendererPlugin - Plugins for Renderer\n * @property {string} CanvasRendererPlugin - Plugins for CanvasRenderer\n * @property {string} Loader - Plugins to use with Loader\n * @property {string} LoadParser - Parsers for Assets loader.\n * @property {string} ResolveParser - Parsers for Assets resolvers.\n * @property {string} CacheParser - Parsers for Assets cache.\n */\nenum ExtensionType\n// eslint-disable-next-line @typescript-eslint/indent\n{\n Application = 'application',\n RendererPlugin = 'renderer-webgl-plugin',\n CanvasRendererPlugin = 'renderer-canvas-plugin',\n Loader = 'loader',\n LoadParser = 'load-parser',\n ResolveParser = 'resolve-parser',\n CacheParser = 'cache-parser',\n DetectionParser = 'detection-parser',\n}\n\ninterface ExtensionMetadataDetails\n{\n type: ExtensionType | ExtensionType[];\n name?: string;\n}\n\ntype ExtensionMetadata = ExtensionType | ExtensionMetadataDetails;\n\n/**\n * Format when registering an extension. Generally, the extension\n * should have these values as `extension` static property,\n * but you can override name or type by providing an object.\n * @memberof PIXI\n */\ninterface ExtensionFormatLoose\n{\n /** The extension type, can be multiple types */\n type: ExtensionType | ExtensionType[];\n /** Optional. Some plugins provide an API name/property, such as Renderer plugins */\n name?: string;\n /** Reference to the plugin object/class */\n ref: any;\n}\n\n/**\n * Strict extension format that is used internally for registrations.\n * @memberof PIXI\n */\ninterface ExtensionFormat extends ExtensionFormatLoose\n{\n /** The extension type, always expressed as multiple, even if a single */\n type: ExtensionType[];\n}\n\ntype ExtensionHandler = (extension: ExtensionFormat) => void;\n\n/**\n * Convert input into extension format data.\n * @ignore\n */\nconst normalizeExtension = (ext: ExtensionFormatLoose | any): ExtensionFormat =>\n{\n // Class/Object submission, use extension object\n if (typeof ext === 'function' || (typeof ext === 'object' && ext.extension))\n {\n // #if _DEBUG\n if (!ext.extension)\n {\n throw new Error('Extension class must have an extension object');\n }\n // #endif\n const metadata: ExtensionMetadataDetails = (typeof ext.extension !== 'object')\n ? { type: ext.extension }\n : ext.extension;\n\n ext = { ...metadata, ref: ext };\n }\n if (typeof ext === 'object')\n {\n ext = { ...ext };\n }\n else\n {\n throw new Error('Invalid extension type');\n }\n\n if (typeof ext.type === 'string')\n {\n ext.type = [ext.type];\n }\n\n return ext;\n};\n\n/**\n * Global registration of all PixiJS extensions. One-stop-shop for extensibility.\n * @memberof PIXI\n * @namespace extensions\n */\nconst extensions = {\n\n /** @ignore */\n _addHandlers: null as Record<ExtensionType, ExtensionHandler>,\n\n /** @ignore */\n _removeHandlers: null as Record<ExtensionType, ExtensionHandler>,\n\n /** @ignore */\n _queue: {} as Record<ExtensionType, ExtensionFormat[]>,\n\n /**\n * Remove extensions from PixiJS.\n * @param extensions - Extensions to be removed.\n * @returns {PIXI.extensions} For chaining.\n */\n remove(...extensions: Array<ExtensionFormatLoose | any>)\n {\n extensions.map(normalizeExtension).forEach((ext) =>\n {\n ext.type.forEach((type) => this._removeHandlers[type]?.(ext));\n });\n\n return this;\n },\n\n /**\n * Register new extensions with PixiJS.\n * @param extensions - The spread of extensions to add to PixiJS.\n * @returns {PIXI.extensions} For chaining.\n */\n add(...extensions: Array<ExtensionFormatLoose | any>)\n {\n // Handle any extensions either passed as class w/ data or as data\n extensions.map(normalizeExtension).forEach((ext) =>\n {\n ext.type.forEach((type) =>\n {\n const handlers = this._addHandlers;\n const queue = this._queue;\n\n if (!handlers[type])\n {\n queue[type] = queue[type] || [];\n queue[type].push(ext);\n }\n else\n {\n handlers[type](ext);\n }\n });\n });\n\n return this;\n },\n\n /**\n * Internal method to handle extensions by name.\n * @param type - The extension type.\n * @param onAdd - Function for handling when extensions are added/registered passes {@link PIXI.ExtensionFormat}.\n * @param onRemove - Function for handling when extensions are removed/unregistered passes {@link PIXI.ExtensionFormat}.\n * @returns {PIXI.extensions} For chaining.\n */\n handle(type: ExtensionType, onAdd: ExtensionHandler, onRemove: ExtensionHandler)\n {\n const addHandlers = this._addHandlers = this._addHandlers || {} as Record<ExtensionType, ExtensionHandler>;\n const removeHandlers = this._removeHandlers = this._removeHandlers || {} as Record<ExtensionType, ExtensionHandler>;\n\n // #if _DEBUG\n if (addHandlers[type] || removeHandlers[type])\n {\n throw new Error(`Extension type ${type} already has a handler`);\n }\n // #endif\n\n addHandlers[type] = onAdd;\n removeHandlers[type] = onRemove;\n\n // Process the queue\n const queue = this._queue;\n\n // Process any plugins that have been registered before the handler\n if (queue[type])\n {\n queue[type].forEach((ext) => onAdd(ext));\n delete queue[type];\n }\n\n return this;\n },\n\n /**\n * Handle a type, but using a map by `name` property.\n * @param type - Type of extension to handle.\n * @param map - The object map of named extensions.\n * @returns {PIXI.extensions} For chaining.\n */\n handleByMap(type: ExtensionType, map: Record<string, any>)\n {\n return this.handle(type,\n (extension) =>\n {\n map[extension.name] = extension.ref;\n },\n (extension) =>\n {\n delete map[extension.name];\n }\n );\n },\n\n /**\n * Handle a type, but using a list of extensions.\n * @param type - Type of extension to handle.\n * @param list - The list of extensions.\n * @returns {PIXI.extensions} For chaining.\n */\n handleByList(type: ExtensionType, list: any[])\n {\n return this.handle(\n type,\n (extension) =>\n {\n list.push(extension.ref);\n // TODO: remove me later, only added for @pixi/loaders\n if (type === ExtensionType.Loader)\n {\n extension.ref.add?.();\n }\n },\n (extension) =>\n {\n const index = list.indexOf(extension.ref);\n\n if (index !== -1)\n {\n list.splice(index, 1);\n }\n }\n );\n },\n};\n\nexport {\n extensions,\n ExtensionType,\n};\nexport type {\n ExtensionHandler,\n ExtensionMetadata,\n ExtensionFormatLoose,\n ExtensionFormat,\n};\n","/**\n * Supported line joints in `PIXI.LineStyle` for graphics.\n * @see PIXI.Graphics#lineStyle\n * @see https://graphicdesign.stackexchange.com/questions/59018/what-is-a-bevel-join-of-two-lines-exactly-illustrator\n * @name LINE_JOIN\n * @memberof PIXI\n * @static\n * @enum {string}\n * @property {string} MITER - 'miter': make a sharp corner where outer part of lines meet\n * @property {string} BEVEL - 'bevel': add a square butt at each end of line segment and fill the triangle at turn\n * @property {string} ROUND - 'round': add an arc at the joint\n */\nexport enum LINE_JOIN\n// eslint-disable-next-line @typescript-eslint/indent\n{\n MITER = 'miter',\n BEVEL = 'bevel',\n ROUND = 'round'\n}\n\n/**\n * Support line caps in `PIXI.LineStyle` for graphics.\n * @see PIXI.Graphics#lineStyle\n * @name LINE_CAP\n * @memberof PIXI\n * @static\n * @enum {string}\n * @property {string} BUTT - 'butt': don't add any cap at line ends (leaves orthogonal edges)\n * @property {string} ROUND - 'round': add semicircle at ends\n * @property {string} SQUARE - 'square': add square at end (like `BUTT` except more length at end)\n */\nexport enum LINE_CAP\n// eslint-disable-next-line @typescript-eslint/indent\n{\n BUTT = 'butt',\n ROUND = 'round',\n SQUARE = 'square'\n}\n\nexport interface IGraphicsCurvesSettings\n{\n adaptive: boolean;\n maxLength: number;\n minSegments: number;\n maxSegments: number;\n\n epsilon: number;\n\n _segmentsCount(length: number, defaultSegments?: number): number;\n}\n\n/**\n * Graphics curves resolution settings. If `adaptive` flag is set to `true`,\n * the resolution is calculated based on the curve's length to ensure better visual quality.\n * Adaptive draw works with `bezierCurveTo` and `quadraticCurveTo`.\n * @static\n * @constant\n * @memberof PIXI\n * @name GRAPHICS_CURVES\n * @type {object}\n * @property {boolean} [adaptive=true] - flag indicating if the resolution should be adaptive\n * @property {number} [maxLength=10] - maximal length of a single segment of the curve (if adaptive = false, ignored)\n * @property {number} [minSegments=8] - minimal number of segments in the curve (if adaptive = false, ignored)\n * @property {number} [maxSegments=2048] - maximal number of segments in the curve (if adaptive = false, ignored)\n */\nexport const GRAPHICS_CURVES: IGraphicsCurvesSettings = {\n adaptive: true,\n maxLength: 10,\n minSegments: 8,\n maxSegments: 2048,\n\n epsilon: 0.0001,\n\n _segmentsCount(length: number, defaultSegments = 20)\n {\n if (!this.adaptive || !length || isNaN(length))\n {\n return defaultSegments;\n }\n\n let result = Math.ceil(length / this.maxLength);\n\n if (result < this.minSegments)\n {\n result = this.minSegments;\n }\n else if (result > this.maxSegments)\n {\n result = this.maxSegments;\n }\n\n return result;\n },\n};\n","import { Texture } from '@pixi/core';\nimport type { Matrix } from '@pixi/math';\n\n/**\n * Fill style object for Graphics.\n * @memberof PIXI\n */\nexport class FillStyle\n{\n /**\n * The hex color value used when coloring the Graphics object.\n * @default 0xFFFFFF\n */\n public color = 0xFFFFFF;\n\n /** The alpha value used when filling the Graphics object. */\n public alpha = 1.0;\n\n /**\n * The texture to be used for the fill.\n * @default 0\n */\n public texture: Texture = Texture.WHITE;\n\n /**\n * The transform applied to the texture.\n * @default null\n */\n public matrix: Matrix = null;\n\n /** If the current fill is visible. */\n public visible = false;\n\n constructor()\n {\n this.reset();\n }\n\n /** Clones the object */\n public clone(): FillStyle\n {\n const obj = new FillStyle();\n\n obj.color = this.color;\n obj.alpha = this.alpha;\n obj.texture = this.texture;\n obj.matrix = this.matrix;\n obj.visible = this.visible;\n\n return obj;\n }\n\n /** Reset */\n public reset(): void\n {\n this.color = 0xFFFFFF;\n this.alpha = 1;\n this.texture = Texture.WHITE;\n this.matrix = null;\n this.visible = false;\n }\n\n /** Destroy and don't use after this. */\n public destroy(): void\n {\n this.texture = null;\n this.matrix = null;\n }\n}\n","import { earcut } from '@pixi/utils';\n\nimport type { IShapeBuildCommand } from './IShapeBuildCommand';\nimport type { Polygon } from '@pixi/math';\n\nfunction fixOrientation(points: number[], hole = false)\n{\n const m = points.length;\n\n if (m < 6)\n {\n return;\n }\n\n let area = 0;\n\n for (let i = 0, x1 = points[m - 2], y1 = points[m - 1]; i < m; i += 2)\n {\n const x2 = points[i];\n const y2 = points[i + 1];\n\n area += (x2 - x1) * (y2 + y1);\n\n x1 = x2;\n y1 = y2;\n }\n\n if ((!hole && area > 0) || (hole && area <= 0))\n {\n const n = m / 2;\n\n for (let i = n + (n % 2); i < m; i += 2)\n {\n const i1 = m - i - 2;\n const i2 = m - i - 1;\n const i3 = i;\n const i4 = i + 1;\n\n [points[i1], points[i3]] = [points[i3], points[i1]];\n [points[i2], points[i4]] = [points[i4], points[i2]];\n }\n }\n}\n/**\n * Builds a polygon to draw\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {object} webGLData - an object containing all the WebGL-specific information to create this shape\n * @param {object} webGLDataNativeLines - an object containing all the WebGL-specific information to create nativeLines\n */\nexport const buildPoly: IShapeBuildCommand = {\n\n build(graphicsData)\n {\n graphicsData.points = (graphicsData.shape as Polygon).points.slice();\n },\n\n triangulate(graphicsData, graphicsGeometry)\n {\n let points = graphicsData.points;\n const holes = graphicsData.holes;\n const verts = graphicsGeometry.points;\n const indices = graphicsGeometry.indices;\n\n if (points.length >= 6)\n {\n fixOrientation(points, false);\n\n const holeArray = [];\n // Process holes..\n\n for (let i = 0; i < holes.length; i++)\n {\n const hole = holes[i];\n\n fixOrientation(hole.points, true);\n\n holeArray.push(points.length / 2);\n points = points.concat(hole.points);\n }\n\n // sort color\n const triangles = earcut(points, holeArray, 2);\n\n if (!triangles)\n {\n return;\n }\n\n const vertPos = verts.length / 2;\n\n for (let i = 0; i < triangles.length; i += 3)\n {\n indices.push(triangles[i] + vertPos);\n indices.push(triangles[i + 1] + vertPos);\n indices.push(triangles[i + 2] + vertPos);\n }\n\n for (let i = 0; i < points.length; i++)\n {\n verts.push(points[i]);\n }\n }\n },\n};\n","// for type only\nimport { SHAPES } from '@pixi/math';\n\nimport type { Circle, Ellipse, RoundedRectangle } from '@pixi/math';\nimport type { IShapeBuildCommand } from './IShapeBuildCommand';\n\n/**\n * Builds a circle to draw\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object to draw\n * @param {object} webGLData - an object containing all the WebGL-specific information to create this shape\n * @param {object} webGLDataNativeLines - an object containing all the WebGL-specific information to create nativeLines\n */\nexport const buildCircle: IShapeBuildCommand = {\n\n build(graphicsData)\n {\n // need to convert points to a nice regular data\n const points = graphicsData.points;\n\n let x;\n let y;\n let dx;\n let dy;\n let rx;\n let ry;\n\n if (graphicsData.type === SHAPES.CIRC)\n {\n const circle = graphicsData.shape as Circle;\n\n x = circle.x;\n y = circle.y;\n rx = ry = circle.radius;\n dx = dy = 0;\n }\n else if (graphicsData.type === SHAPES.ELIP)\n {\n const ellipse = graphicsData.shape as Ellipse;\n\n x = ellipse.x;\n y = ellipse.y;\n rx = ellipse.width;\n ry = ellipse.height;\n dx = dy = 0;\n }\n else\n {\n const roundedRect = graphicsData.shape as RoundedRectangle;\n const halfWidth = roundedRect.width / 2;\n const halfHeight = roundedRect.height / 2;\n\n x = roundedRect.x + halfWidth;\n y = roundedRect.y + halfHeight;\n rx = ry = Math.max(0, Math.min(roundedRect.radius, Math.min(halfWidth, halfHeight)));\n dx = halfWidth - rx;\n dy = halfHeight - ry;\n }\n\n if (!(rx >= 0 && ry >= 0 && dx >= 0 && dy >= 0))\n {\n points.length = 0;\n\n return;\n }\n\n // Choose a number of segments such that the maximum absolute deviation from the circle is approximately 0.029\n const n = Math.ceil(2.3 * Math.sqrt(rx + ry));\n const m = (n * 8) + (dx ? 4 : 0) + (dy ? 4 : 0);\n\n points.length = m;\n\n if (m === 0)\n {\n return;\n }\n\n if (n === 0)\n {\n points.length = 8;\n points[0] = points[6] = x + dx;\n points[1] = points[3] = y + dy;\n points[2] = points[4] = x - dx;\n points[5] = points[7] = y - dy;\n\n return;\n }\n\n let j1 = 0;\n let j2 = (n * 4) + (dx ? 2 : 0) + 2;\n let j3 = j2;\n let j4 = m;\n\n {\n const x0 = dx + rx;\n const y0 = dy;\n const x1 = x + x0;\n const x2 = x - x0;\n const y1 = y + y0;\n\n points[j1++] = x1;\n points[j1++] = y1;\n points[--j2] = y1;\n points[--j2] = x2;\n\n if (dy)\n {\n const y2 = y - y0;\n\n points[j3++] = x2;\n points[j3++] = y2;\n points[--j4] = y2;\n points[--j4] = x1;\n }\n }\n\n for (let i = 1; i < n; i++)\n {\n const a = Math.PI / 2 * (i / n);\n const x0 = dx + (Math.cos(a) * rx);\n const y0 = dy + (Math.sin(a) * ry);\n const x1 = x + x0;\n const x2 = x - x0;\n const y1 = y + y0;\n const y2 = y - y0;\n\n points[j1++] = x1;\n points[j1++] = y1;\n points[--j2] = y1;\n points[--j2] = x2;\n points[j3++] = x2;\n points[j3++] = y2;\n points[--j4] = y2;\n points[--j4] = x1;\n }\n\n {\n const x0 = dx;\n const y0 = dy + ry;\n const x1 = x + x0;\n const x2 = x - x0;\n const y1 = y + y0;\n const y2 = y - y0;\n\n points[j1++] = x1;\n points[j1++] = y1;\n points[--j4] = y2;\n points[--j4] = x1;\n\n if (dx)\n {\n points[j1++] = x2;\n points[j1++] = y1;\n points[--j4] = y2;\n points[--j4] = x2;\n }\n }\n },\n\n triangulate(graphicsData, graphicsGeometry)\n {\n const points = graphicsData.points;\n const verts = graphicsGeometry.points;\n const indices = graphicsGeometry.indices;\n\n if (points.length === 0)\n {\n return;\n }\n\n let vertPos = verts.length / 2;\n const center = vertPos;\n\n let x;\n let y;\n\n if (graphicsData.type !== SHAPES.RREC)\n {\n const circle = graphicsData.shape as Circle;\n\n x = circle.x;\n y = circle.y;\n }\n else\n {\n const roundedRect = graphicsData.shape as RoundedRectangle;\n\n x = roundedRect.x + (roundedRect.width / 2);\n y = roundedRect.y + (roundedRect.height / 2);\n }\n\n const matrix = graphicsData.matrix;\n\n // Push center (special point)\n verts.push(\n graphicsData.matrix ? (matrix.a * x) + (matrix.c * y) + matrix.tx : x,\n graphicsData.matrix ? (matrix.b * x) + (matrix.d * y) + matrix.ty : y);\n\n vertPos++;\n\n verts.push(points[0], points[1]);\n\n for (let i = 2; i < points.length; i += 2)\n {\n verts.push(points[i], points[i + 1]);\n\n // add some uvs\n indices.push(vertPos++, center, vertPos);\n }\n\n indices.push(center + 1, center, vertPos);\n },\n};\n","import type { IShapeBuildCommand } from './IShapeBuildCommand';\nimport type { Rectangle } from '@pixi/math';\n\n/**\n * Builds a rectangle to draw\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {object} webGLData - an object containing all the WebGL-specific information to create this shape\n * @param {object} webGLDataNativeLines - an object containing all the WebGL-specific information to create nativeLines\n */\nexport const buildRectangle: IShapeBuildCommand = {\n\n build(graphicsData)\n {\n // --- //\n // need to convert points to a nice regular data\n //\n const rectData = graphicsData.shape as Rectangle;\n const x = rectData.x;\n const y = rectData.y;\n const width = rectData.width;\n const height = rectData.height;\n\n const points = graphicsData.points;\n\n points.length = 0;\n\n points.push(x, y,\n x + width, y,\n x + width, y + height,\n x, y + height);\n },\n\n triangulate(graphicsData, graphicsGeometry)\n {\n const points = graphicsData.points;\n const verts = graphicsGeometry.points;\n\n const vertPos = verts.length / 2;\n\n verts.push(points[0], points[1],\n points[2], points[3],\n points[6], points[7],\n points[4], points[5]);\n\n graphicsGeometry.indices.push(vertPos, vertPos + 1, vertPos + 2,\n vertPos + 1, vertPos + 2, vertPos + 3);\n },\n};\n","import { earcut } from '@pixi/utils';\n\n// for type only\nimport type { IShapeBuildCommand } from './IShapeBuildCommand';\nimport type { RoundedRectangle } from '@pixi/math';\nimport { Graphics } from '../Graphics';\nimport { buildCircle } from './buildCircle';\n\n/**\n * Calculate a single point for a quadratic bezier curve.\n * Utility function used by quadraticBezierCurve.\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {number} n1 - first number\n * @param {number} n2 - second number\n * @param {number} perc - percentage\n * @returns {number} the result\n */\nfunction getPt(n1: number, n2: number, perc: number): number\n{\n const diff = n2 - n1;\n\n return n1 + (diff * perc);\n}\n\n/**\n * Calculate the points for a quadratic bezier curve. (helper function..)\n * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {number} fromX - Origin point x\n * @param {number} fromY - Origin point x\n * @param {number} cpX - Control point x\n * @param {number} cpY - Control point y\n * @param {number} toX - Destination point x\n * @param {number} toY - Destination point y\n * @param {number[]} [out=[]] - The output array to add points into. If not passed, a new array is created.\n * @returns {number[]} an array of points\n */\nfunction quadraticBezierCurve(\n fromX: number, fromY: number,\n cpX: number, cpY: number,\n toX: number, toY: number,\n out: Array<number> = []): Array<number>\n{\n const n = 20;\n const points = out;\n\n let xa = 0;\n let ya = 0;\n let xb = 0;\n let yb = 0;\n let x = 0;\n let y = 0;\n\n for (let i = 0, j = 0; i <= n; ++i)\n {\n j = i / n;\n\n // The Green Line\n xa = getPt(fromX, cpX, j);\n ya = getPt(fromY, cpY, j);\n xb = getPt(cpX, toX, j);\n yb = getPt(cpY, toY, j);\n\n // The Black Dot\n x = getPt(xa, xb, j);\n y = getPt(ya, yb, j);\n\n // Handle case when first curve points overlaps and earcut fails to triangulate\n if (i === 0 && points[points.length - 2] === x && points[points.length - 1] === y)\n {\n continue;\n }\n\n points.push(x, y);\n }\n\n return points;\n}\n\n/**\n * Builds a rounded rectangle to draw\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {object} webGLData - an object containing all the WebGL-specific information to create this shape\n * @param {object} webGLDataNativeLines - an object containing all the WebGL-specific information to create nativeLines\n */\nexport const buildRoundedRectangle: IShapeBuildCommand = {\n\n build(graphicsData)\n {\n if (Graphics.nextRoundedRectBehavior)\n {\n buildCircle.build(graphicsData);\n\n return;\n }\n\n const rrectData = graphicsData.shape as RoundedRectangle;\n const points = graphicsData.points;\n const x = rrectData.x;\n const y = rrectData.y;\n const width = rrectData.width;\n const height = rrectData.height;\n\n // Don't allow negative radius or greater than half the smallest width\n const radius = Math.max(0, Math.min(rrectData.radius, Math.min(width, height) / 2));\n\n points.length = 0;\n\n // No radius, do a simple rectangle\n if (!radius)\n {\n points.push(x, y,\n x + width, y,\n x + width, y + height,\n x, y + height);\n }\n else\n {\n quadraticBezierCurve(x, y + radius,\n x, y,\n x + radius, y,\n points);\n quadraticBezierCurve(x + width - radius,\n y, x + width, y,\n x + width, y + radius,\n points);\n quadraticBezierCurve(x + width, y + height - radius,\n x + width, y + height,\n x + width - radius, y + height,\n points);\n quadraticBezierCurve(x + radius, y + height,\n x, y + height,\n x, y + height - radius,\n points);\n }\n },\n\n triangulate(graphicsData, graphicsGeometry)\n {\n if (Graphics.nextRoundedRectBehavior)\n {\n buildCircle.triangulate(graphicsData, graphicsGeometry);\n\n return;\n }\n\n const points = graphicsData.points;\n\n const verts = graphicsGeometry.points;\n const indices = graphicsGeometry.indices;\n\n const vecPos = verts.length / 2;\n\n const triangles = earcut(points, null, 2);\n\n for (let i = 0, j = triangles.length; i < j; i += 3)\n {\n indices.push(triangles[i] + vecPos);\n // indices.push(triangles[i] + vecPos);\n indices.push(triangles[i + 1] + vecPos);\n // indices.push(triangles[i + 2] + vecPos);\n indices.push(triangles[i + 2] + vecPos);\n }\n\n for (let i = 0, j = points.length; i < j; i++)\n {\n verts.push(points[i], points[++i]);\n }\n },\n};\n","import { Point, SHAPES } from '@pixi/math';\n\nimport type { Polygon } from '@pixi/math';\nimport type { GraphicsData } from '../GraphicsData';\nimport type { GraphicsGeometry } from '../GraphicsGeometry';\nimport { LINE_JOIN, LINE_CAP, GRAPHICS_CURVES } from '../const';\n\n/**\n * Buffers vertices to draw a square cap.\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {number} x - X-coord of end point\n * @param {number} y - Y-coord of end point\n * @param {number} nx - X-coord of line normal pointing inside\n * @param {number} ny - Y-coord of line normal pointing inside\n * @param {number} innerWeight - Weight of inner points\n * @param {number} outerWeight - Weight of outer points\n * @param {boolean} clockwise - Whether the cap is drawn clockwise\n * @param {Array<number>} verts - vertex buffer\n * @returns {number} - no. of vertices pushed\n */\nfunction square(\n x: number,\n y: number,\n nx: number,\n ny: number,\n innerWeight: number,\n outerWeight: number,\n clockwise: boolean, /* rotation for square (true at left end, false at right end) */\n verts: Array<number>\n): number\n{\n const ix = x - (nx * innerWeight);\n const iy = y - (ny * innerWeight);\n const ox = x + (nx * outerWeight);\n const oy = y + (ny * outerWeight);\n\n /* Rotate nx,ny for extension vector */\n let exx; let\n eyy;\n\n if (clockwise)\n {\n exx = ny;\n eyy = -nx;\n }\n else\n {\n exx = -ny;\n eyy = nx;\n }\n\n /* [i|0]x,y extended at cap */\n const eix = ix + exx;\n const eiy = iy + eyy;\n const eox = ox + exx;\n const eoy = oy + eyy;\n\n /* Square itself must be inserted clockwise*/\n verts.push(eix, eiy);\n verts.push(eox, eoy);\n\n return 2;\n}\n\n/**\n * Buffers vertices to draw an arc at the line joint or cap.\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {number} cx - X-coord of center\n * @param {number} cy - Y-coord of center\n * @param {number} sx - X-coord of arc start\n * @param {number} sy - Y-coord of arc start\n * @param {number} ex - X-coord of arc end\n * @param {number} ey - Y-coord of arc end\n * @param {Array<number>} verts - buffer of vertices\n * @param {boolean} clockwise - orientation of vertices\n * @returns {number} - no. of vertices pushed\n */\nfunction round(\n cx: number,\n cy: number,\n sx: number,\n sy: number,\n ex: number,\n ey: number,\n verts: Array<number>,\n clockwise: boolean, /* if not cap, then clockwise is turn of joint, otherwise rotation from angle0 to angle1 */\n): number\n{\n const cx2p0x = sx - cx;\n const cy2p0y = sy - cy;\n\n let angle0 = Math.atan2(cx2p0x, cy2p0y);\n let angle1 = Math.atan2(ex - cx, ey - cy);\n\n if (clockwise && angle0 < angle1)\n {\n angle0 += Math.PI * 2;\n }\n else if (!clockwise && angle0 > angle1)\n {\n angle1 += Math.PI * 2;\n }\n\n let startAngle = angle0;\n const angleDiff = angle1 - angle0;\n const absAngleDiff = Math.abs(angleDiff);\n\n /* if (absAngleDiff >= PI_LBOUND && absAngleDiff <= PI_UBOUND)\n {\n const r1x = cx - nxtPx;\n const r1y = cy - nxtPy;\n\n if (r1x === 0)\n {\n if (r1y > 0)\n {\n angleDiff = -angleDiff;\n }\n }\n else if (r1x >= -GRAPHICS_CURVES.epsilon)\n {\n angleDiff = -angleDiff;\n }\n }*/\n\n const radius = Math.sqrt((cx2p0x * cx2p0x) + (cy2p0y * cy2p0y));\n const segCount = ((15 * absAngleDiff * Math.sqrt(radius) / Math.PI) >> 0) + 1;\n const angleInc = angleDiff / segCount;\n\n startAngle += angleInc;\n\n if (clockwise)\n {\n verts.push(cx, cy);\n verts.push(sx, sy);\n\n for (let i = 1, angle = startAngle; i < segCount; i++, angle += angleInc)\n {\n verts.push(cx, cy);\n verts.push(cx + ((Math.sin(angle) * radius)),\n cy + ((Math.cos(angle) * radius)));\n }\n\n verts.push(cx, cy);\n verts.push(ex, ey);\n }\n else\n {\n verts.push(sx, sy);\n verts.push(cx, cy);\n\n for (let i = 1, angle = startAngle; i < segCount; i++, angle += angleInc)\n {\n verts.push(cx + ((Math.sin(angle) * radius)),\n cy + ((Math.cos(angle) * radius)));\n verts.push(cx, cy);\n }\n\n verts.push(ex, ey);\n verts.push(cx, cy);\n }\n\n return segCount * 2;\n}\n\n/**\n * Builds a line to draw using the polygon method.\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {PIXI.GraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {PIXI.GraphicsGeometry} graphicsGeometry - Geometry where to append output\n */\nfunction buildNonNativeLine(graphicsData: GraphicsData, graphicsGeometry: GraphicsGeometry): void\n{\n const shape = graphicsData.shape as Polygon;\n let points = graphicsData.points || shape.points.slice();\n const eps = graphicsGeometry.closePointEps;\n\n if (points.length === 0)\n {\n return;\n }\n // if the line width is an odd number add 0.5 to align to a whole pixel\n // commenting this out fixes #711 and #1620\n // if (graphicsData.lineWidth%2)\n // {\n // for (i = 0; i < points.length; i++)\n // {\n // points[i] += 0.5;\n // }\n // }\n\n const style = graphicsData.lineStyle;\n\n // get first and last point.. figure out the middle!\n const firstPoint = new Point(points[0], points[1]);\n const lastPoint = new Point(points[points.length - 2], points[points.length - 1]);\n const closedShape = shape.type !== SHAPES.POLY || shape.closeStroke;\n const closedPath = Math.abs(firstPoint.x - lastPoint.x) < eps\n && Math.abs(firstPoint.y - lastPoint.y) < eps;\n\n // if the first point is the last point - gonna have issues :)\n if (closedShape)\n {\n // need to clone as we are going to slightly modify the shape..\n points = points.slice();\n\n if (closedPath)\n {\n points.pop();\n points.pop();\n lastPoint.set(points[points.length - 2], points[points.length - 1]);\n }\n\n const midPointX = (firstPoint.x + lastPoint.x) * 0.5;\n const midPointY = (lastPoint.y + firstPoint.y) * 0.5;\n\n points.unshift(midPointX, midPointY);\n points.push(midPointX, midPointY);\n }\n\n const verts = graphicsGeometry.points;\n const length = points.length / 2;\n let indexCount = points.length;\n const indexStart = verts.length / 2;\n\n // Max. inner and outer width\n const width = style.width / 2;\n const widthSquared = width * width;\n const miterLimitSquared = style.miterLimit * style.miterLimit;\n\n /* Line segments of interest where (x1,y1) forms the corner. */\n let x0 = points[0];\n let y0 = points[1];\n let x1 = points[2];\n let y1 = points[3];\n let x2 = 0;\n let y2 = 0;\n\n /* perp[?](x|y) = the line normal with magnitude lineWidth. */\n let perpx = -(y0 - y1);\n let perpy = x0 - x1;\n let perp1x = 0;\n let perp1y = 0;\n\n let dist = Math.sqrt((perpx * perpx) + (perpy * perpy));\n\n perpx /= dist;\n perpy /= dist;\n perpx *= width;\n perpy *= width;\n\n const ratio = style.alignment;// 0.5;\n const innerWeight = (1 - ratio) * 2;\n const outerWeight = ratio * 2;\n\n if (!closedShape)\n {\n if (style.cap === LINE_CAP.ROUND)\n {\n indexCount += round(\n x0 - (perpx * (innerWeight - outerWeight) * 0.5),\n y0 - (perpy * (innerWeight - outerWeight) * 0.5),\n x0 - (perpx * innerWeight),\n y0 - (perpy * innerWeight),\n x0 + (perpx * outerWeight),\n y0 + (perpy * outerWeight),\n verts,\n true,\n ) + 2;\n }\n else if (style.cap === LINE_CAP.SQUARE)\n {\n indexCount += square(x0, y0, perpx, perpy, innerWeight, outerWeight, true, verts);\n }\n }\n\n // Push first point (below & above vertices)\n verts.push(\n x0 - (perpx * innerWeight),\n y0 - (perpy * innerWeight));\n verts.push(\n x0 + (perpx * outerWeight),\n y0 + (perpy * outerWeight));\n\n for (let i = 1; i < length - 1; ++i)\n {\n x0 = points[(i - 1) * 2];\n y0 = points[((i - 1) * 2) + 1];\n\n x1 = points[i * 2];\n y1 = points[(i * 2) + 1];\n\n x2 = points[(i + 1) * 2];\n y2 = points[((i + 1) * 2) + 1];\n\n perpx = -(y0 - y1);\n perpy = x0 - x1;\n\n dist = Math.sqrt((perpx * perpx) + (perpy * perpy));\n perpx /= dist;\n perpy /= dist;\n perpx *= width;\n perpy *= width;\n\n perp1x = -(y1 - y2);\n perp1y = x1 - x2;\n\n dist = Math.sqrt((perp1x * perp1x) + (perp1y * perp1y));\n perp1x /= dist;\n perp1y /= dist;\n perp1x *= width;\n perp1y *= width;\n\n /* d[x|y](0|1) = the component displacement between points p(0,1|1,2) */\n const dx0 = x1 - x0;\n const dy0 = y0 - y1;\n const dx1 = x1 - x2;\n const dy1 = y2 - y1;\n\n /* +ve if internal angle counterclockwise, -ve if internal angle clockwise. */\n const cross = (dy0 * dx1) - (dy1 * dx0);\n const clockwise = (cross < 0);\n\n /* Going nearly straight? */\n if (Math.abs(cross) < 0.1)\n {\n verts.push(\n x1 - (perpx * innerWeight),\n y1 - (perpy * innerWeight));\n verts.push(\n x1 + (perpx * outerWeight),\n y1 + (perpy * outerWeight));\n\n continue;\n }\n\n /* p[x|y] is the miter point. pdist is the distance between miter point and p1. */\n const c1 = ((-perpx + x0) * (-perpy + y1)) - ((-perpx + x1) * (-perpy + y0));\n const c2 = ((-perp1x + x2) * (-perp1y + y1)) - ((-perp1x + x1) * (-perp1y + y2));\n const px = ((dx0 * c2) - (dx1 * c1)) / cross;\n const py = ((dy1 * c1) - (dy0 * c2)) / cross;\n const pdist = ((px - x1) * (px - x1)) + ((py - y1) * (py - y1));\n\n /* Inner miter point */\n const imx = x1 + ((px - x1) * innerWeight);\n const imy = y1 + ((py - y1) * innerWeight);\n /* Outer miter point */\n const omx = x1 - ((px - x1) * outerWeight);\n const omy = y1 - ((py - y1) * outerWeight);\n\n /* Is the inside miter point too far away, creating a spike? */\n const smallerInsideSegmentSq = Math.min((dx0 * dx0) + (dy0 * dy0), (dx1 * dx1) + (dy1 * dy1));\n const insideWeight = clockwise ? innerWeight : outerWeight;\n const smallerInsideDiagonalSq = smallerInsideSegmentSq + (insideWeight * insideWeight * widthSquared);\n const insideMiterOk = pdist <= smallerInsideDiagonalSq;\n\n if (insideMiterOk)\n {\n if (style.join === LINE_JOIN.BEVEL || pdist / widthSquared > miterLimitSquared)\n {\n if (clockwise) /* rotating at inner angle */\n {\n verts.push(imx, imy);// inner miter point\n verts.push(x1 + (perpx * outerWeight), y1 + (perpy * outerWeight));// first segment's outer vertex\n verts.push(imx, imy);// inner miter point\n verts.push(x1 + (perp1x * outerWeight), y1 + (perp1y * outerWeight));// second segment's outer vertex\n }\n else /* rotating at outer angle */\n {\n verts.push(x1 - (perpx * innerWeight), y1 - (perpy * innerWeight));// first segment's inner vertex\n verts.push(omx, omy);// outer miter point\n verts.push(x1 - (perp1x * innerWeight), y1 - (perp1y * innerWeight));// second segment's outer vertex\n verts.push(omx, omy);// outer miter point\n }\n\n indexCount += 2;\n }\n else if (style.join === LINE_JOIN.ROUND)\n {\n if (clockwise) /* arc is outside */\n {\n verts.push(imx, imy);\n verts.push(x1 + (perpx * outerWeight), y1 + (perpy * outerWeight));\n\n indexCount += round(\n x1, y1,\n x1 + (perpx * outerWeight), y1 + (perpy * outerWeight),\n x1 + (perp1x * outerWeight), y1 + (perp1y * outerWeight),\n verts, true\n ) + 4;\n\n verts.push(imx, imy);\n verts.push(x1 + (perp1x * outerWeight), y1 + (perp1y * outerWeight));\n }\n else /* arc is inside */\n {\n verts.push(x1 - (perpx * innerWeight), y1 - (perpy * innerWeight));\n verts.push(omx, omy);\n\n indexCount += round(\n x1, y1,\n x1 - (perpx * innerWeight), y1 - (perpy * innerWeight),\n x1 - (perp1x * innerWeight), y1 - (perp1y * innerWeight),\n verts, false\n ) + 4;\n\n verts.push(x1 - (perp1x * innerWeight), y1 - (perp1y * innerWeight));\n verts.push(omx, omy);\n }\n }\n else\n {\n verts.push(imx, imy);\n verts.push(omx, omy);\n }\n }\n else // inside miter is NOT ok\n {\n verts.push(x1 - (perpx * innerWeight), y1 - (perpy * innerWeight)); // first segment's inner vertex\n verts.push(x1 + (perpx * outerWeight), y1 + (perpy * outerWeight)); // first segment's outer vertex\n if (style.join === LINE_JOIN.ROUND)\n {\n if (clockwise) /* arc is outside */\n {\n indexCount += round(\n x1, y1,\n x1 + (perpx * outerWeight), y1 + (perpy * outerWeight),\n x1 + (perp1x * outerWeight), y1 + (perp1y * outerWeight),\n verts, true\n ) + 2;\n }\n else /* arc is inside */\n {\n indexCount += round(\n x1, y1,\n x1 - (perpx * innerWeight), y1 - (perpy * innerWeight),\n x1 - (perp1x * innerWeight), y1 - (perp1y * innerWeight),\n verts, false\n ) + 2;\n }\n }\n else if (style.join === LINE_JOIN.MITER && pdist / widthSquared <= miterLimitSquared)\n {\n if (clockwise)\n {\n verts.push(omx, omy); // inner miter point\n verts.push(omx, omy); // inner miter point\n }\n else\n {\n verts.push(imx, imy); // outer miter point\n verts.push(imx, imy); // outer miter point\n }\n indexCount += 2;\n }\n verts.push(x1 - (perp1x * innerWeight), y1 - (perp1y * innerWeight)); // second segment's inner vertex\n verts.push(x1 + (perp1x * outerWeight), y1 + (perp1y * outerWeight)); // second segment's outer vertex\n indexCount += 2;\n }\n }\n\n x0 = points[(length - 2) * 2];\n y0 = points[((length - 2) * 2) + 1];\n\n x1 = points[(length - 1) * 2];\n y1 = points[((length - 1) * 2) + 1];\n\n perpx = -(y0 - y1);\n perpy = x0 - x1;\n\n dist = Math.sqrt((perpx * perpx) + (perpy * perpy));\n perpx /= dist;\n perpy /= dist;\n perpx *= width;\n perpy *= width;\n\n verts.push(x1 - (perpx * innerWeight), y1 - (perpy * innerWeight));\n verts.push(x1 + (perpx * outerWeight), y1 + (perpy * outerWeight));\n\n if (!closedShape)\n {\n if (style.cap === LINE_CAP.ROUND)\n {\n indexCount += round(\n x1 - (perpx * (innerWeight - outerWeight) * 0.5),\n y1 - (perpy * (innerWeight - outerWeight) * 0.5),\n x1 - (perpx * innerWeight),\n y1 - (perpy * innerWeight),\n x1 + (perpx * outerWeight),\n y1 + (perpy * outerWeight),\n verts,\n false\n ) + 2;\n }\n else if (style.cap === LINE_CAP.SQUARE)\n {\n indexCount += square(x1, y1, perpx, perpy, innerWeight, outerWeight, false, verts);\n }\n }\n\n const indices = graphicsGeometry.indices;\n const eps2 = GRAPHICS_CURVES.epsilon * GRAPHICS_CURVES.epsilon;\n\n // indices.push(indexStart);\n for (let i = indexStart; i < indexCount + indexStart - 2; ++i)\n {\n x0 = verts[(i * 2)];\n y0 = verts[(i * 2) + 1];\n\n x1 = verts[(i + 1) * 2];\n y1 = verts[((i + 1) * 2) + 1];\n\n x2 = verts[(i + 2) * 2];\n y2 = verts[((i + 2) * 2) + 1];\n\n /* Skip zero area triangles */\n if (Math.abs((x0 * (y1 - y2)) + (x1 * (y2 - y0)) + (x2 * (y0 - y1))) < eps2)\n {\n continue;\n }\n\n indices.push(i, i + 1, i + 2);\n }\n}\n\n/**\n * Builds a line to draw using the gl.drawArrays(gl.LINES) method\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {PIXI.GraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {PIXI.GraphicsGeometry} graphicsGeometry - Geometry where to append output\n */\nfunction buildNativeLine(graphicsData: GraphicsData, graphicsGeometry: GraphicsGeometry): void\n{\n let i = 0;\n\n const shape = graphicsData.shape as Polygon;\n const points = graphicsData.points || shape.points;\n const closedShape = shape.type !== SHAPES.POLY || shape.closeStroke;\n\n if (points.length === 0) return;\n\n const verts = graphicsGeometry.points;\n const indices = graphicsGeometry.indices;\n const length = points.length / 2;\n\n const startIndex = verts.length / 2;\n let currentIndex = startIndex;\n\n verts.push(points[0], points[1]);\n\n for (i = 1; i < length; i++)\n {\n verts.push(points[i * 2], points[(i * 2) + 1]);\n indices.push(currentIndex, currentIndex + 1);\n\n currentIndex++;\n }\n\n if (closedShape)\n {\n indices.push(currentIndex, startIndex);\n }\n}\n\n/**\n * Builds a line to draw\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {PIXI.GraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {PIXI.GraphicsGeometry} graphicsGeometry - Geometry where to append output\n */\nexport function buildLine(graphicsData: GraphicsData, graphicsGeometry: GraphicsGeometry): void\n{\n if (graphicsData.lineStyle.native)\n {\n buildNativeLine(graphicsData, graphicsGeometry);\n }\n else\n {\n buildNonNativeLine(graphicsData, graphicsGeometry);\n }\n}\n","import { GRAPHICS_CURVES } from '../const';\nimport { PI_2 } from '@pixi/math';\n\ninterface IArcLikeShape\n{\n cx: number;\n cy: number;\n radius: number;\n startAngle: number;\n endAngle: number;\n anticlockwise: boolean;\n}\n\n/**\n * Utilities for arc curves.\n * @private\n */\nexport class ArcUtils\n{\n /**\n * The arcTo() method creates an arc/curve between two tangents on the canvas.\n *\n * \"borrowed\" from https://code.google.com/p/fxcanvas/ - thanks google!\n * @private\n * @param x1 - The x-coordinate of the beginning of the arc\n * @param y1 - The y-coordinate of the beginning of the arc\n * @param x2 - The x-coordinate of the end of the arc\n * @param y2 - The y-coordinate of the end of the arc\n * @param radius - The radius of the arc\n * @param points -\n * @returns - If the arc length is valid, return center of circle, radius and other info otherwise `null`.\n */\n static curveTo(x1: number, y1: number, x2: number, y2: number, radius: number, points: Array<number>): IArcLikeShape\n {\n const fromX = points[points.length - 2];\n const fromY = points[points.length - 1];\n\n const a1 = fromY - y1;\n const b1 = fromX - x1;\n const a2 = y2 - y1;\n const b2 = x2 - x1;\n const mm = Math.abs((a1 * b2) - (b1 * a2));\n\n if (mm < 1.0e-8 || radius === 0)\n {\n if (points[points.length - 2] !== x1 || points[points.length - 1] !== y1)\n {\n points.push(x1, y1);\n }\n\n return null;\n }\n\n const dd = (a1 * a1) + (b1 * b1);\n const cc = (a2 * a2) + (b2 * b2);\n const tt = (a1 * a2) + (b1 * b2);\n const k1 = radius * Math.sqrt(dd) / mm;\n const k2 = radius * Math.sqrt(cc) / mm;\n const j1 = k1 * tt / dd;\n const j2 = k2 * tt / cc;\n const cx = (k1 * b2) + (k2 * b1);\n const cy = (k1 * a2) + (k2 * a1);\n const px = b1 * (k2 + j1);\n const py = a1 * (k2 + j1);\n const qx = b2 * (k1 + j2);\n const qy = a2 * (k1 + j2);\n const startAngle = Math.atan2(py - cy, px - cx);\n const endAngle = Math.atan2(qy - cy, qx - cx);\n\n return {\n cx: (cx + x1),\n cy: (cy + y1),\n radius,\n startAngle,\n endAngle,\n anticlockwise: (b1 * a2 > b2 * a1),\n };\n }\n\n /* eslint-disable max-len */\n /**\n * The arc method creates an arc/curve (used to create circles, or parts of circles).\n * @private\n * @param _startX - Start x location of arc\n * @param _startY - Start y location of arc\n * @param cx - The x-coordinate of the center of the circle\n * @param cy - The y-coordinate of the center of the circle\n * @param radius - The radius of the circle\n * @param startAngle - The starting angle, in radians (0 is at the 3 o'clock position\n * of the arc's circle)\n * @param endAngle - The ending angle, in radians\n * @param _anticlockwise - Specifies whether the drawing should be\n * counter-clockwise or clockwise. False is default, and indicates clockwise, while true\n * indicates counter-clockwise.\n * @param points - Collection of points to add to\n */\n static arc(_startX: number, _startY: number, cx: number, cy: number, radius: number,\n startAngle: number, endAngle: number, _anticlockwise: boolean, points: Array<number>): void\n {\n const sweep = endAngle - startAngle;\n const n = GRAPHICS_CURVES._segmentsCount(\n Math.abs(sweep) * radius,\n Math.ceil(Math.abs(sweep) / PI_2) * 40\n );\n\n const theta = (sweep) / (n * 2);\n const theta2 = theta * 2;\n const cTheta = Math.cos(theta);\n const sTheta = Math.sin(theta);\n const segMinus = n - 1;\n const remainder = (segMinus % 1) / segMinus;\n\n for (let i = 0; i <= segMinus; ++i)\n {\n const real = i + (remainder * i);\n const angle = ((theta) + startAngle + (theta2 * real));\n const c = Math.cos(angle);\n const s = -Math.sin(angle);\n\n points.push(\n (((cTheta * c) + (sTheta * s)) * radius) + cx,\n (((cTheta * -s) + (sTheta * c)) * radius) + cy\n );\n }\n }\n /* eslint-enable max-len */\n}\n","import { GRAPHICS_CURVES } from '../const';\n\n/**\n * Utilities for bezier curves\n * @private\n */\nexport class BezierUtils\n{\n /**\n * Calculate length of bezier curve.\n * Analytical solution is impossible, since it involves an integral that does not integrate in general.\n * Therefore numerical solution is used.\n * @private\n * @param fromX - Starting point x\n * @param fromY - Starting point y\n * @param cpX - Control point x\n * @param cpY - Control point y\n * @param cpX2 - Second Control point x\n * @param cpY2 - Second Control point y\n * @param toX - Destination point x\n * @param toY - Destination point y\n * @returns - Length of bezier curve\n */\n static curveLength(\n fromX: number, fromY: number,\n cpX: number, cpY: number,\n cpX2: number, cpY2: number,\n toX: number, toY: number): number\n {\n const n = 10;\n let result = 0.0;\n let t = 0.0;\n let t2 = 0.0;\n let t3 = 0.0;\n let nt = 0.0;\n let nt2 = 0.0;\n let nt3 = 0.0;\n let x = 0.0;\n let y = 0.0;\n let dx = 0.0;\n let dy = 0.0;\n let prevX = fromX;\n let prevY = fromY;\n\n for (let i = 1; i <= n; ++i)\n {\n t = i / n;\n t2 = t * t;\n t3 = t2 * t;\n nt = (1.0 - t);\n nt2 = nt * nt;\n nt3 = nt2 * nt;\n\n x = (nt3 * fromX) + (3.0 * nt2 * t * cpX) + (3.0 * nt * t2 * cpX2) + (t3 * toX);\n y = (nt3 * fromY) + (3.0 * nt2 * t * cpY) + (3 * nt * t2 * cpY2) + (t3 * toY);\n dx = prevX - x;\n dy = prevY - y;\n prevX = x;\n prevY = y;\n\n result += Math.sqrt((dx * dx) + (dy * dy));\n }\n\n return result;\n }\n\n /**\n * Calculate the points for a bezier curve and then draws it.\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @param cpX - Control point x\n * @param cpY - Control point y\n * @param cpX2 - Second Control point x\n * @param cpY2 - Second Control point y\n * @param toX - Destination point x\n * @param toY - Destination point y\n * @param points - Path array to push points into\n */\n static curveTo(\n cpX: number, cpY: number,\n cpX2: number, cpY2: number,\n toX: number, toY: number,\n points: Array<number>): void\n {\n const fromX = points[points.length - 2];\n const fromY = points[points.length - 1];\n\n points.length -= 2;\n\n const n = GRAPHICS_CURVES._segmentsCount(\n BezierUtils.curveLength(fromX, fromY, cpX, cpY, cpX2, cpY2, toX, toY)\n );\n\n let dt = 0;\n let dt2 = 0;\n let dt3 = 0;\n let t2 = 0;\n let t3 = 0;\n\n points.push(fromX, fromY);\n\n for (let i = 1, j = 0; i <= n; ++i)\n {\n j = i / n;\n\n dt = (1 - j);\n dt2 = dt * dt;\n dt3 = dt2 * dt;\n\n t2 = j * j;\n t3 = t2 * j;\n\n points.push(\n (dt3 * fromX) + (3 * dt2 * j * cpX) + (3 * dt * t2 * cpX2) + (t3 * toX),\n (dt3 * fromY) + (3 * dt2 * j * cpY) + (3 * dt * t2 * cpY2) + (t3 * toY)\n );\n }\n }\n}\n","import { GRAPHICS_CURVES } from '../const';\n\n/**\n * Utilities for quadratic curves.\n * @private\n */\nexport class QuadraticUtils\n{\n /**\n * Calculate length of quadratic curve\n * @see {@link http://www.malczak.linuxpl.com/blog/quadratic-bezier-curve-length/}\n * for the detailed explanation of math behind this.\n * @private\n * @param fromX - x-coordinate of curve start point\n * @param fromY - y-coordinate of curve start point\n * @param cpX - x-coordinate of curve control point\n * @param cpY - y-coordinate of curve control point\n * @param toX - x-coordinate of curve end point\n * @param toY - y-coordinate of curve end point\n * @returns - Length of quadratic curve\n */\n static curveLength(\n fromX: number, fromY: number,\n cpX: number, cpY: number,\n toX: number, toY: number): number\n {\n const ax = fromX - (2.0 * cpX) + toX;\n const ay = fromY - (2.0 * cpY) + toY;\n const bx = (2.0 * cpX) - (2.0 * fromX);\n const by = (2.0 * cpY) - (2.0 * fromY);\n const a = 4.0 * ((ax * ax) + (ay * ay));\n const b = 4.0 * ((ax * bx) + (ay * by));\n const c = (bx * bx) + (by * by);\n\n const s = 2.0 * Math.sqrt(a + b + c);\n const a2 = Math.sqrt(a);\n const a32 = 2.0 * a * a2;\n const c2 = 2.0 * Math.sqrt(c);\n const ba = b / a2;\n\n return (\n (a32 * s)\n + (a2 * b * (s - c2))\n + (\n ((4.0 * c * a) - (b * b))\n * Math.log(((2.0 * a2) + ba + s) / (ba + c2))\n )\n ) / (4.0 * a32);\n }\n\n /**\n * Calculate the points for a quadratic bezier curve and then draws it.\n * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c\n * @private\n * @param cpX - Control point x\n * @param cpY - Control point y\n * @param toX - Destination point x\n * @param toY - Destination point y\n * @param points - Points to add segments to.\n */\n static curveTo(cpX: number, cpY: number, toX: number, toY: number, points: Array<number>): void\n {\n const fromX = points[points.length - 2];\n const fromY = points[points.length - 1];\n\n const n = GRAPHICS_CURVES._segmentsCount(\n QuadraticUtils.curveLength(fromX, fromY, cpX, cpY, toX, toY)\n );\n\n let xa = 0;\n let ya = 0;\n\n for (let i = 1; i <= n; ++i)\n {\n const j = i / n;\n\n xa = fromX + ((cpX - fromX) * j);\n ya = fromY + ((cpY - fromY) * j);\n\n points.push(xa + (((cpX + ((toX - cpX) * j)) - xa) * j),\n ya + (((cpY + ((toY - cpY) * j)) - ya) * j));\n }\n }\n}\n","import type { LineStyle } from '../styles/LineStyle';\nimport type { FillStyle } from '../styles/FillStyle';\n\n/**\n * A structure to hold interim batch objects for Graphics.\n * @memberof PIXI.graphicsUtils\n */\nexport class BatchPart\n{\n public style: LineStyle | FillStyle;\n public start: number;\n public size: number;\n public attribStart: number;\n public attribSize: number;\n\n constructor()\n {\n this.reset();\n }\n\n /**\n * Begin batch part.\n * @param style\n * @param startIndex\n * @param attribStart\n */\n public begin(style: LineStyle | FillStyle, startIndex: number, attribStart: number): void\n {\n this.reset();\n this.style = style;\n this.start = startIndex;\n this.attribStart = attribStart;\n }\n\n /**\n * End batch part.\n * @param endIndex\n * @param endAttrib\n */\n public end(endIndex: number, endAttrib: number): void\n {\n this.attribSize = endAttrib - this.attribStart;\n this.size = endIndex - this.start;\n }\n\n public reset(): void\n {\n this.style = null;\n this.size = 0;\n this.start = 0;\n this.attribStart = 0;\n this.attribSize = 0;\n }\n}\n","/**\n * Generalized convenience utilities for Graphics.\n * @namespace graphicsUtils\n * @memberof PIXI\n */\n\nimport { buildPoly } from './buildPoly';\nexport { buildPoly };\n\nimport { buildCircle } from './buildCircle';\nexport { buildCircle };\n\nimport { buildRectangle } from './buildRectangle';\nexport { buildRectangle };\n\nimport { buildRoundedRectangle } from './buildRoundedRectangle';\nexport { buildRoundedRectangle };\n\nexport * from './buildLine';\nexport * from './ArcUtils';\nexport * from './BezierUtils';\nexport * from './QuadraticUtils';\nexport * from './BatchPart';\n\n// for type only\nimport type { BatchPart } from './BatchPart';\nimport { SHAPES } from '@pixi/math';\nimport type { BatchDrawCall } from '@pixi/core';\nimport type { IShapeBuildCommand } from './IShapeBuildCommand';\n\n/**\n * Map of fill commands for each shape type.\n * @memberof PIXI.graphicsUtils\n * @member {object} FILL_COMMANDS\n */\nexport const FILL_COMMANDS: Record<SHAPES, IShapeBuildCommand> = {\n [SHAPES.POLY]: buildPoly,\n [SHAPES.CIRC]: buildCircle,\n [SHAPES.ELIP]: buildCircle,\n [SHAPES.RECT]: buildRectangle,\n [SHAPES.RREC]: buildRoundedRectangle,\n};\n\n/**\n * Batch pool, stores unused batches for preventing allocations.\n * @memberof PIXI.graphicsUtils\n * @member {Array<PIXI.graphicsUtils.BatchPart>} BATCH_POOL\n */\nexport const BATCH_POOL: Array<BatchPart> = [];\n\n/**\n * Draw call pool, stores unused draw calls for preventing allocations.\n * @memberof PIXI.graphicsUtils\n * @member {Array<PIXI.BatchDrawCall>} DRAW_CALL_POOL\n */\nexport const DRAW_CALL_POOL: Array<BatchDrawCall> = [];\n","import type { Matrix, SHAPES, IShape } from '@pixi/math';\nimport type { FillStyle } from './styles/FillStyle';\nimport type { LineStyle } from './styles/LineStyle';\n\n/**\n * A class to contain data useful for Graphics objects\n * @memberof PIXI\n */\nexport class GraphicsData\n{\n /**\n * The shape object to draw.\n * @member {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle}\n */\n shape: IShape;\n\n /** The style of the line. */\n lineStyle: LineStyle;\n\n /** The style of the fill. */\n fillStyle: FillStyle;\n\n /** The transform matrix. */\n matrix: Matrix;\n\n /** The type of the shape, see the Const.Shapes file for all the existing types, */\n type: SHAPES;\n\n /** The collection of points. */\n points: number[] = [];\n\n /** The collection of holes. */\n\n holes: Array<GraphicsData> = [];\n\n /**\n * @param {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} shape - The shape object to draw.\n * @param fillStyle - the width of the line to draw\n * @param lineStyle - the color of the line to draw\n * @param matrix - Transform matrix\n */\n constructor(shape: IShape, fillStyle: FillStyle = null, lineStyle: LineStyle = null, matrix: Matrix = null)\n {\n this.shape = shape;\n this.lineStyle = lineStyle;\n this.fillStyle = fillStyle;\n this.matrix = matrix;\n this.type = shape.type;\n }\n\n /**\n * Creates a new GraphicsData object with the same values as this one.\n * @returns - Cloned GraphicsData object\n */\n public clone(): GraphicsData\n {\n return new GraphicsData(\n this.shape,\n this.fillStyle,\n this.lineStyle,\n this.matrix\n );\n }\n\n /** Destroys the Graphics data. */\n public destroy(): void\n {\n this.shape = null;\n this.holes.length = 0;\n this.holes = null;\n this.points.length = 0;\n this.points = null;\n this.lineStyle = null;\n this.fillStyle = null;\n }\n}\n","import {\n buildLine,\n buildPoly,\n BatchPart,\n FILL_COMMANDS,\n BATCH_POOL,\n DRAW_CALL_POOL,\n} from './utils';\n\nimport type {\n Texture } from '@pixi/core';\nimport {\n BatchGeometry,\n BatchDrawCall,\n BatchTextureArray,\n BaseTexture\n} from '@pixi/core';\n\nimport { DRAW_MODES, WRAP_MODES } from '@pixi/constants';\nimport { Point } from '@pixi/math';\nimport { GraphicsData } from './GraphicsData';\nimport { premultiplyTint } from '@pixi/utils';\nimport { Bounds } from '@pixi/display';\n\nimport type { Circle, Ellipse, Polygon, Rectangle, RoundedRectangle, IPointData, Matrix } from '@pixi/math';\nimport type { FillStyle } from './styles/FillStyle';\nimport type { LineStyle } from './styles/LineStyle';\n\n/*\n * Complex shape type\n * @todo Move to Math shapes\n */\ntype IShape = Circle | Ellipse | Polygon | Rectangle | RoundedRectangle;\n\nconst tmpPoint = new Point();\n\n/**\n * The Graphics class contains methods used to draw primitive shapes such as lines, circles and\n * rectangles to the display, and to color and fill them.\n *\n * GraphicsGeometry is designed to not be continually updating the geometry since it's expensive\n * to re-tesselate using **earcut**. Consider using {@link PIXI.Mesh} for this use-case, it's much faster.\n * @memberof PIXI\n */\nexport class GraphicsGeometry extends BatchGeometry\n{\n /**\n * The maximum number of points to consider an object \"batchable\",\n * able to be batched by the renderer's batch system.\n\\\n */\n public static BATCHABLE_SIZE = 100;\n\n /** Minimal distance between points that are considered different. Affects line tesselation. */\n public closePointEps = 1e-4;\n\n /** Padding to add to the bounds. */\n public boundsPadding = 0;\n\n uvsFloat32: Float32Array = null;\n indicesUint16: Uint16Array | Uint32Array = null;\n batchable = false;\n\n /** An array of points to draw, 2 numbers per point */\n points: number[] = [];\n\n /** The collection of colors */\n colors: number[] = [];\n\n /** The UVs collection */\n uvs: number[] = [];\n\n /** The indices of the vertices */\n indices: number[] = [];\n\n /** Reference to the texture IDs. */\n textureIds: number[] = [];\n\n /**\n * The collection of drawn shapes.\n * @member {PIXI.GraphicsData[]}\n */\n graphicsData: Array<GraphicsData> = [];\n\n /**\n * List of current draw calls drived from the batches.\n * @member {PIXI.BatchDrawCall[]}\n */\n drawCalls: Array<BatchDrawCall> = [];\n\n /** Batches need to regenerated if the geometry is updated. */\n batchDirty = -1;\n\n /**\n * Intermediate abstract format sent to batch system.\n * Can be converted to drawCalls or to batchable objects.\n * @member {PIXI.graphicsUtils.BatchPart[]}\n */\n batches: Array<BatchPart> = [];\n\n /** Used to detect if the graphics object has changed. */\n protected dirty = 0;\n\n /** Used to check if the cache is dirty. */\n protected cacheDirty = -1;\n\n /** Used to detect if we cleared the graphicsData. */\n protected clearDirty = 0;\n\n /** Index of the last batched shape in the stack of calls. */\n protected shapeIndex = 0;\n\n /** Cached bounds. */\n protected _bounds: Bounds = new Bounds();\n\n /** The bounds dirty flag. */\n protected boundsDirty = -1;\n\n // eslint-disable-next-line @typescript-eslint/no-useless-constructor\n constructor()\n {\n super();\n }\n\n /**\n * Get the current bounds of the graphic geometry.\n * @readonly\n */\n public get bounds(): Bounds\n {\n this.updateBatches();\n\n if (this.boundsDirty !== this.dirty)\n {\n this.boundsDirty = this.dirty;\n this.calculateBounds();\n }\n\n return this._bounds;\n }\n\n /** Call if you changed graphicsData manually. Empties all batch buffers. */\n protected invalidate(): void\n {\n this.boundsDirty = -1;\n this.dirty++;\n this.batchDirty++;\n this.shapeIndex = 0;\n\n this.points.length = 0;\n this.colors.length = 0;\n this.uvs.length = 0;\n this.indices.length = 0;\n this.textureIds.length = 0;\n\n for (let i = 0; i < this.drawCalls.length; i++)\n {\n this.drawCalls[i].texArray.clear();\n DRAW_CALL_POOL.push(this.drawCalls[i]);\n }\n\n this.drawCalls.length = 0;\n\n for (let i = 0; i < this.batches.length; i++)\n {\n const batchPart = this.batches[i];\n\n batchPart.reset();\n BATCH_POOL.push(batchPart);\n }\n\n this.batches.length = 0;\n }\n\n /**\n * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.\n * @returns - This GraphicsGeometry object. Good for chaining method calls\n */\n public clear(): GraphicsGeometry\n {\n if (this.graphicsData.length > 0)\n {\n this.invalidate();\n this.clearDirty++;\n this.graphicsData.length = 0;\n }\n\n return this;\n }\n\n /**\n * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.\n * @param {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} shape - The shape object to draw.\n * @param fillStyle - Defines style of the fill.\n * @param lineStyle - Defines style of the lines.\n * @param matrix - Transform applied to the points of the shape.\n * @returns - Returns geometry for chaining.\n */\n public drawShape(\n shape: IShape,\n fillStyle: FillStyle = null,\n lineStyle: LineStyle = null,\n matrix: Matrix = null): GraphicsGeometry\n {\n const data = new GraphicsData(shape, fillStyle, lineStyle, matrix);\n\n this.graphicsData.push(data);\n this.dirty++;\n\n return this;\n }\n\n /**\n * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.\n * @param {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} shape - The shape object to draw.\n * @param matrix - Transform applied to the points of the shape.\n * @returns - Returns geometry for chaining.\n */\n public drawHole(shape: IShape, matrix: Matrix = null): GraphicsGeometry\n {\n if (!this.graphicsData.length)\n {\n return null;\n }\n\n const data = new GraphicsData(shape, null, null, matrix);\n\n const lastShape = this.graphicsData[this.graphicsData.length - 1];\n\n data.lineStyle = lastShape.lineStyle;\n\n lastShape.holes.push(data);\n\n this.dirty++;\n\n return this;\n }\n\n /** Destroys the GraphicsGeometry object. */\n public destroy(): void\n {\n super.destroy();\n\n // destroy each of the GraphicsData objects\n for (let i = 0; i < this.graphicsData.length; ++i)\n {\n this.graphicsData[i].destroy();\n }\n\n this.points.length = 0;\n this.points = null;\n this.colors.length = 0;\n this.colors = null;\n this.uvs.length = 0;\n this.uvs = null;\n this.indices.length = 0;\n this.indices = null;\n this.indexBuffer.destroy();\n this.indexBuffer = null;\n this.graphicsData.length = 0;\n this.graphicsData = null;\n this.drawCalls.length = 0;\n this.drawCalls = null;\n this.batches.length = 0;\n this.batches = null;\n this._bounds = null;\n }\n\n /**\n * Check to see if a point is contained within this geometry.\n * @param point - Point to check if it's contained.\n * @returns {boolean} `true` if the point is contained within geometry.\n */\n public containsPoint(point: IPointData): boolean\n {\n const graphicsData = this.graphicsData;\n\n for (let i = 0; i < graphicsData.length; ++i)\n {\n const data = graphicsData[i];\n\n if (!data.fillStyle.visible)\n {\n continue;\n }\n\n // only deal with fills..\n if (data.shape)\n {\n if (data.matrix)\n {\n data.matrix.applyInverse(point, tmpPoint);\n }\n else\n {\n tmpPoint.copyFrom(point);\n }\n\n if (data.shape.contains(tmpPoint.x, tmpPoint.y))\n {\n let hitHole = false;\n\n if (data.holes)\n {\n for (let i = 0; i < data.holes.length; i++)\n {\n const hole = data.holes[i];\n\n if (hole.shape.contains(tmpPoint.x, tmpPoint.y))\n {\n hitHole = true;\n break;\n }\n }\n }\n\n if (!hitHole)\n {\n return true;\n }\n }\n }\n }\n\n return false;\n }\n\n /**\n * Generates intermediate batch data. Either gets converted to drawCalls\n * or used to convert to batch objects directly by the Graphics object.\n */\n updateBatches(): void\n {\n if (!this.graphicsData.length)\n {\n this.batchable = true;\n\n return;\n }\n\n if (!this.validateBatching())\n {\n return;\n }\n\n this.cacheDirty = this.dirty;\n\n const uvs = this.uvs;\n const graphicsData = this.graphicsData;\n\n let batchPart: BatchPart = null;\n\n let currentStyle = null;\n\n if (this.batches.length > 0)\n {\n batchPart = this.batches[this.batches.length - 1];\n currentStyle = batchPart.style;\n }\n\n for (let i = this.shapeIndex; i < graphicsData.length; i++)\n {\n this.shapeIndex++;\n\n const data = graphicsData[i];\n const fillStyle = data.fillStyle;\n const lineStyle = data.lineStyle;\n const command = FILL_COMMANDS[data.type];\n\n // build out the shapes points..\n command.build(data);\n\n if (data.matrix)\n {\n this.transformPoints(data.points, data.matrix);\n }\n\n if (fillStyle.visible || lineStyle.visible)\n {\n this.processHoles(data.holes);\n }\n\n for (let j = 0; j < 2; j++)\n {\n const style = (j === 0) ? fillStyle : lineStyle;\n\n if (!style.visible) continue;\n\n const nextTexture = style.texture.baseTexture;\n const index = this.indices.length;\n const attribIndex = this.points.length / 2;\n\n nextTexture.wrapMode = WRAP_MODES.REPEAT;\n\n if (j === 0)\n {\n this.processFill(data);\n }\n else\n {\n this.processLine(data);\n }\n\n const size = (this.points.length / 2) - attribIndex;\n\n if (size === 0) continue;\n // close batch if style is different\n if (batchPart && !this._compareStyles(currentStyle, style))\n {\n batchPart.end(index, attribIndex);\n batchPart = null;\n }\n // spawn new batch if its first batch or previous was closed\n if (!batchPart)\n {\n batchPart = BATCH_POOL.pop() || new BatchPart();\n batchPart.begin(style, index, attribIndex);\n this.batches.push(batchPart);\n currentStyle = style;\n }\n\n this.addUvs(this.points, uvs, style.texture, attribIndex, size, style.matrix);\n }\n }\n\n const index = this.indices.length;\n const attrib = this.points.length / 2;\n\n if (batchPart)\n {\n batchPart.end(index, attrib);\n }\n\n if (this.batches.length === 0)\n {\n // there are no visible styles in GraphicsData\n // its possible that someone wants Graphics just for the bounds\n this.batchable = true;\n\n return;\n }\n\n const need32 = attrib > 0xffff;\n\n // prevent allocation when length is same as buffer\n if (this.indicesUint16 && this.indices.length === this.indicesUint16.length\n && need32 === (this.indicesUint16.BYTES_PER_ELEMENT > 2))\n {\n this.indicesUint16.set(this.indices);\n }\n else\n {\n this.indicesUint16 = need32 ? new Uint32Array(this.indices) : new Uint16Array(this.indices);\n }\n\n // TODO make this a const..\n this.batchable = this.isBatchable();\n\n if (this.batchable)\n {\n this.packBatches();\n }\n else\n {\n this.buildDrawCalls();\n }\n }\n\n /**\n * Affinity check\n * @param styleA\n * @param styleB\n */\n protected _compareStyles(styleA: FillStyle | LineStyle, styleB: FillStyle | LineStyle): boolean\n {\n if (!styleA || !styleB)\n {\n return false;\n }\n\n if (styleA.texture.baseTexture !== styleB.texture.baseTexture)\n {\n return false;\n }\n\n if (styleA.color + styleA.alpha !== styleB.color + styleB.alpha)\n {\n return false;\n }\n\n if (!!(styleA as LineStyle).native !== !!(styleB as LineStyle).native)\n {\n return false;\n }\n\n return true;\n }\n\n /** Test geometry for batching process. */\n protected validateBatching(): boolean\n {\n if (this.dirty === this.cacheDirty || !this.graphicsData.length)\n {\n return false;\n }\n\n for (let i = 0, l = this.graphicsData.length; i < l; i++)\n {\n const data = this.graphicsData[i];\n const fill = data.fillStyle;\n const line = data.lineStyle;\n\n if (fill && !fill.texture.baseTexture.valid) return false;\n if (line && !line.texture.baseTexture.valid) return false;\n }\n\n return true;\n }\n\n /** Offset the indices so that it works with the batcher. */\n protected packBatches(): void\n {\n this.batchDirty++;\n this.uvsFloat32 = new Float32Array(this.uvs);\n\n const batches = this.batches;\n\n for (let i = 0, l = batches.length; i < l; i++)\n {\n const batch = batches[i];\n\n for (let j = 0; j < batch.size; j++)\n {\n const index = batch.start + j;\n\n this.indicesUint16[index] = this.indicesUint16[index] - batch.attribStart;\n }\n }\n }\n\n /**\n * Checks to see if this graphics geometry can be batched.\n * Currently it needs to be small enough and not contain any native lines.\n */\n protected isBatchable(): boolean\n {\n // prevent heavy mesh batching\n if (this.points.length > 0xffff * 2)\n {\n return false;\n }\n\n const batches = this.batches;\n\n for (let i = 0; i < batches.length; i++)\n {\n if ((batches[i].style as LineStyle).native)\n {\n return false;\n }\n }\n\n return (this.points.length < GraphicsGeometry.BATCHABLE_SIZE * 2);\n }\n\n /** Converts intermediate batches data to drawCalls. */\n protected buildDrawCalls(): void\n {\n let TICK = ++BaseTexture._globalBatch;\n\n for (let i = 0; i < this.drawCalls.length; i++)\n {\n this.drawCalls[i].texArray.clear();\n DRAW_CALL_POOL.push(this.drawCalls[i]);\n }\n\n this.drawCalls.length = 0;\n\n const colors = this.colors;\n const textureIds = this.textureIds;\n\n let currentGroup: BatchDrawCall = DRAW_CALL_POOL.pop();\n\n if (!currentGroup)\n {\n currentGroup = new BatchDrawCall();\n currentGroup.texArray = new BatchTextureArray();\n }\n currentGroup.texArray.count = 0;\n currentGroup.start = 0;\n currentGroup.size = 0;\n currentGroup.type = DRAW_MODES.TRIANGLES;\n\n let textureCount = 0;\n let currentTexture = null;\n let textureId = 0;\n let native = false;\n let drawMode = DRAW_MODES.TRIANGLES;\n\n let index = 0;\n\n this.drawCalls.push(currentGroup);\n\n // TODO - this can be simplified\n for (let i = 0; i < this.batches.length; i++)\n {\n const data = this.batches[i];\n\n // TODO add some full on MAX_TEXTURE CODE..\n const MAX_TEXTURES = 8;\n\n // Forced cast for checking `native` without errors\n const style = data.style as LineStyle;\n\n const nextTexture = style.texture.baseTexture;\n\n if (native !== !!style.native)\n {\n native = !!style.native;\n drawMode = native ? DRAW_MODES.LINES : DRAW_MODES.TRIANGLES;\n\n // force the batch to break!\n currentTexture = null;\n textureCount = MAX_TEXTURES;\n TICK++;\n }\n\n if (currentTexture !== nextTexture)\n {\n currentTexture = nextTexture;\n\n if (nextTexture._batchEnabled !== TICK)\n {\n if (textureCount === MAX_TEXTURES)\n {\n TICK++;\n\n textureCount = 0;\n\n if (currentGroup.size > 0)\n {\n currentGroup = DRAW_CALL_POOL.pop();\n if (!currentGroup)\n {\n currentGroup = new BatchDrawCall();\n currentGroup.texArray = new BatchTextureArray();\n }\n this.drawCalls.push(currentGroup);\n }\n\n currentGroup.start = index;\n currentGroup.size = 0;\n currentGroup.texArray.count = 0;\n currentGroup.type = drawMode;\n }\n\n // TODO add this to the render part..\n // Hack! Because texture has protected `touched`\n nextTexture.touched = 1;// touch;\n\n nextTexture._batchEnabled = TICK;\n nextTexture._batchLocation = textureCount;\n nextTexture.wrapMode = WRAP_MODES.REPEAT;\n\n currentGroup.texArray.elements[currentGroup.texArray.count++] = nextTexture;\n textureCount++;\n }\n }\n\n currentGroup.size += data.size;\n index += data.size;\n\n textureId = nextTexture._batchLocation;\n\n this.addColors(colors, style.color, style.alpha, data.attribSize, data.attribStart);\n this.addTextureIds(textureIds, textureId, data.attribSize, data.attribStart);\n }\n\n BaseTexture._globalBatch = TICK;\n\n // upload..\n // merge for now!\n this.packAttributes();\n }\n\n /** Packs attributes to single buffer. */\n protected packAttributes(): void\n {\n const verts = this.points;\n const uvs = this.uvs;\n const colors = this.colors;\n const textureIds = this.textureIds;\n\n // verts are 2 positions.. so we * by 3 as there are 6 properties.. then 4 cos its bytes\n const glPoints = new ArrayBuffer(verts.length * 3 * 4);\n const f32 = new Float32Array(glPoints);\n const u32 = new Uint32Array(glPoints);\n\n let p = 0;\n\n for (let i = 0; i < verts.length / 2; i++)\n {\n f32[p++] = verts[i * 2];\n f32[p++] = verts[(i * 2) + 1];\n\n f32[p++] = uvs[i * 2];\n f32[p++] = uvs[(i * 2) + 1];\n\n u32[p++] = colors[i];\n\n f32[p++] = textureIds[i];\n }\n\n this._buffer.update(glPoints);\n this._indexBuffer.update(this.indicesUint16);\n }\n\n /**\n * Process fill part of Graphics.\n * @param data\n */\n protected processFill(data: GraphicsData): void\n {\n if (data.holes.length)\n {\n buildPoly.triangulate(data, this);\n }\n else\n {\n const command = FILL_COMMANDS[data.type];\n\n command.triangulate(data, this);\n }\n }\n\n /**\n * Process line part of Graphics.\n * @param data\n */\n protected processLine(data: GraphicsData): void\n {\n buildLine(data, this);\n\n for (let i = 0; i < data.holes.length; i++)\n {\n buildLine(data.holes[i], this);\n }\n }\n\n /**\n * Process the holes data.\n * @param holes\n */\n protected processHoles(holes: Array<GraphicsData>): void\n {\n for (let i = 0; i < holes.length; i++)\n {\n const hole = holes[i];\n const command = FILL_COMMANDS[hole.type];\n\n command.build(hole);\n\n if (hole.matrix)\n {\n this.transformPoints(hole.points, hole.matrix);\n }\n }\n }\n\n /** Update the local bounds of the object. Expensive to use performance-wise. */\n protected calculateBounds(): void\n {\n const bounds = this._bounds;\n\n bounds.clear();\n bounds.addVertexData((this.points as any), 0, this.points.length);\n bounds.pad(this.boundsPadding, this.boundsPadding);\n }\n\n /**\n * Transform points using matrix.\n * @param points - Points to transform\n * @param matrix - Transform matrix\n */\n protected transformPoints(points: Array<number>, matrix: Matrix): void\n {\n for (let i = 0; i < points.length / 2; i++)\n {\n const x = points[(i * 2)];\n const y = points[(i * 2) + 1];\n\n points[(i * 2)] = (matrix.a * x) + (matrix.c * y) + matrix.tx;\n points[(i * 2) + 1] = (matrix.b * x) + (matrix.d * y) + matrix.ty;\n }\n }\n\n /**\n * Add colors.\n * @param colors - List of colors to add to\n * @param color - Color to add\n * @param alpha - Alpha to use\n * @param size - Number of colors to add\n * @param offset\n */\n protected addColors(\n colors: Array<number>,\n color: number,\n alpha: number,\n size: number,\n offset = 0): void\n {\n // TODO use the premultiply bits Ivan added\n const rgb = (color >> 16) + (color & 0xff00) + ((color & 0xff) << 16);\n\n const rgba = premultiplyTint(rgb, alpha);\n\n colors.length = Math.max(colors.length, offset + size);\n\n for (let i = 0; i < size; i++)\n {\n colors[offset + i] = rgba;\n }\n }\n\n /**\n * Add texture id that the shader/fragment wants to use.\n * @param textureIds\n * @param id\n * @param size\n * @param offset\n */\n protected addTextureIds(\n textureIds: Array<number>,\n id: number,\n size: number,\n offset = 0): void\n {\n textureIds.length = Math.max(textureIds.length, offset + size);\n\n for (let i = 0; i < size; i++)\n {\n textureIds[offset + i] = id;\n }\n }\n\n /**\n * Generates the UVs for a shape.\n * @param verts - Vertices\n * @param uvs - UVs\n * @param texture - Reference to Texture\n * @param start - Index buffer start index.\n * @param size - The size/length for index buffer.\n * @param matrix - Optional transform for all points.\n */\n protected addUvs(\n verts: Array<number>,\n uvs: Array<number>,\n texture: Texture,\n start: number,\n size: number,\n matrix: Matrix = null): void\n {\n let index = 0;\n const uvsStart = uvs.length;\n const frame = texture.frame;\n\n while (index < size)\n {\n let x = verts[(start + index) * 2];\n let y = verts[((start + index) * 2) + 1];\n\n if (matrix)\n {\n const nx = (matrix.a * x) + (matrix.c * y) + matrix.tx;\n\n y = (matrix.b * x) + (matrix.d * y) + matrix.ty;\n x = nx;\n }\n\n index++;\n\n uvs.push(x / frame.width, y / frame.height);\n }\n\n const baseTexture = texture.baseTexture;\n\n if (frame.width < baseTexture.width\n || frame.height < baseTexture.height)\n {\n this.adjustUvs(uvs, texture, uvsStart, size);\n }\n }\n\n /**\n * Modify uvs array according to position of texture region\n * Does not work with rotated or trimmed textures\n * @param uvs - array\n * @param texture - region\n * @param start - starting index for uvs\n * @param size - how many points to adjust\n */\n protected adjustUvs(uvs: Array<number>, texture: Texture, start: number, size: number): void\n {\n const baseTexture = texture.baseTexture;\n const eps = 1e-6;\n const finish = start + (size * 2);\n const frame = texture.frame;\n const scaleX = frame.width / baseTexture.width;\n const scaleY = frame.height / baseTexture.height;\n let offsetX = frame.x / frame.width;\n let offsetY = frame.y / frame.height;\n let minX = Math.floor(uvs[start] + eps);\n let minY = Math.floor(uvs[start + 1] + eps);\n\n for (let i = start + 2; i < finish; i += 2)\n {\n minX = Math.min(minX, Math.floor(uvs[i] + eps));\n minY = Math.min(minY, Math.floor(uvs[i + 1] + eps));\n }\n offsetX -= minX;\n offsetY -= minY;\n for (let i = start; i < finish; i += 2)\n {\n uvs[i] = (uvs[i] + offsetX) * scaleX;\n uvs[i + 1] = (uvs[i + 1] + offsetY) * scaleY;\n }\n }\n}\n","import { FillStyle } from './FillStyle';\nimport { LINE_JOIN, LINE_CAP } from '../const';\n\n/**\n * Represents the line style for Graphics.\n * @memberof PIXI\n */\nexport class LineStyle extends FillStyle\n{\n /** The width (thickness) of any lines drawn. */\n public width = 0;\n\n /** The alignment of any lines drawn (0.5 = middle, 1 = outer, 0 = inner). WebGL only. */\n public alignment = 0.5;\n\n /** If true the lines will be draw using LINES instead of TRIANGLE_STRIP. */\n public native = false;\n\n /**\n * Line cap style.\n * @member {PIXI.LINE_CAP}\n * @default PIXI.LINE_CAP.BUTT\n */\n public cap = LINE_CAP.BUTT;\n\n /**\n * Line join style.\n * @member {PIXI.LINE_JOIN}\n * @default PIXI.LINE_JOIN.MITER\n */\n public join = LINE_JOIN.MITER;\n\n /** Miter limit. */\n public miterLimit = 10;\n\n /** Clones the object. */\n public clone(): LineStyle\n {\n const obj = new LineStyle();\n\n obj.color = this.color;\n obj.alpha = this.alpha;\n obj.texture = this.texture;\n obj.matrix = this.matrix;\n obj.visible = this.visible;\n obj.width = this.width;\n obj.alignment = this.alignment;\n obj.native = this.native;\n obj.cap = this.cap;\n obj.join = this.join;\n obj.miterLimit = this.miterLimit;\n\n return obj;\n }\n\n /** Reset the line style to default. */\n public reset(): void\n {\n super.reset();\n\n // Override default line style color\n this.color = 0x0;\n\n this.alignment = 0.5;\n this.width = 0;\n this.native = false;\n }\n}\n","import {\n Circle,\n Ellipse,\n PI_2,\n Point,\n Polygon,\n Rectangle,\n RoundedRectangle,\n Matrix,\n SHAPES,\n} from '@pixi/math';\n\nimport type { Renderer, BatchDrawCall } from '@pixi/core';\nimport { Texture, UniformGroup, State, Shader } from '@pixi/core';\nimport { BezierUtils, QuadraticUtils, ArcUtils } from './utils';\nimport { hex2rgb } from '@pixi/utils';\nimport { GraphicsGeometry } from './GraphicsGeometry';\nimport { FillStyle } from './styles/FillStyle';\nimport { LineStyle } from './styles/LineStyle';\nimport { BLEND_MODES } from '@pixi/constants';\nimport { Container } from '@pixi/display';\n\nimport type { IShape, IPointData } from '@pixi/math';\nimport type { IDestroyOptions } from '@pixi/display';\nimport { LINE_JOIN, LINE_CAP } from './const';\n\n/** Batch element computed from Graphics geometry */\nexport interface IGraphicsBatchElement\n{\n vertexData: Float32Array;\n blendMode: BLEND_MODES;\n indices: Uint16Array | Uint32Array;\n uvs: Float32Array;\n alpha: number;\n worldAlpha: number;\n _batchRGB: number[];\n _tintRGB: number;\n _texture: Texture;\n}\n\nexport interface IFillStyleOptions\n{\n color?: number;\n alpha?: number;\n texture?: Texture;\n matrix?: Matrix;\n}\n\nexport interface ILineStyleOptions extends IFillStyleOptions\n{\n width?: number;\n alignment?: number;\n native?: boolean;\n cap?: LINE_CAP;\n join?: LINE_JOIN;\n miterLimit?: number;\n}\n\nconst temp = new Float32Array(3);\n\n// a default shaders map used by graphics..\nconst DEFAULT_SHADERS: {[key: string]: Shader} = {};\n\nexport interface Graphics extends GlobalMixins.Graphics, Container {}\n\n/**\n * The Graphics class is primarily used to render primitive shapes such as lines, circles and\n * rectangles to the display, and to color and fill them. However, you can also use a Graphics\n * object to build a list of primitives to use as a mask, or as a complex hitArea.\n *\n * Please note that due to legacy naming conventions, the behavior of some functions in this class\n * can be confusing. Each call to `drawRect()`, `drawPolygon()`, etc. actually stores that primitive\n * in the Geometry class's GraphicsGeometry object for later use in rendering or hit testing - the\n * functions do not directly draw anything to the screen. Similarly, the `clear()` function doesn't\n * change the screen, it simply resets the list of primitives, which can be useful if you want to\n * rebuild the contents of an existing Graphics object.\n *\n * Once a GraphicsGeometry list is built, you can re-use it in other Geometry objects as\n * an optimization, by passing it into a new Geometry object's constructor. Because of this\n * ability, it's important to call `destroy()` on Geometry objects once you are done with them, to\n * properly dereference each GraphicsGeometry and prevent memory leaks.\n * @memberof PIXI\n */\nexport class Graphics extends Container\n{\n /**\n * New rendering behavior for rounded rectangles: circular arcs instead of quadratic bezier curves.\n * In the next major release, we'll enable this by default.\n */\n public static nextRoundedRectBehavior = false;\n\n /**\n * Temporary point to use for containsPoint.\n * @private\n */\n static _TEMP_POINT = new Point();\n\n /**\n * Represents the vertex and fragment shaders that processes the geometry and runs on the GPU.\n * Can be shared between multiple Graphics objects.\n */\n public shader: Shader = null;\n\n /** Renderer plugin for batching */\n public pluginName = 'batch';\n\n /**\n * Current path\n * @readonly\n */\n public currentPath: Polygon = null;\n\n /** A collections of batches! These can be drawn by the renderer batch system. */\n protected batches: Array<IGraphicsBatchElement> = [];\n\n /** Update dirty for limiting calculating tints for batches. */\n protected batchTint = -1;\n\n /** Update dirty for limiting calculating batches.*/\n protected batchDirty = -1;\n\n /** Copy of the object vertex data. */\n protected vertexData: Float32Array = null;\n\n /** Current fill style. */\n protected _fillStyle: FillStyle = new FillStyle();\n\n /** Current line style. */\n protected _lineStyle: LineStyle = new LineStyle();\n\n /** Current shape transform matrix. */\n protected _matrix: Matrix = null;\n\n /** Current hole mode is enabled. */\n protected _holeMode = false;\n protected _transformID: number;\n protected _tint: number;\n\n /**\n * Represents the WebGL state the Graphics required to render, excludes shader and geometry. E.g.,\n * blend mode, culling, depth testing, direction of rendering triangles, backface, etc.\n */\n private state: State = State.for2d();\n private _geometry: GraphicsGeometry;\n\n /**\n * Includes vertex positions, face indices, normals, colors, UVs, and\n * custom attributes within buffers, reducing the cost of passing all\n * this data to the GPU. Can be shared between multiple Mesh or Graphics objects.\n * @readonly\n */\n public get geometry(): GraphicsGeometry\n {\n return this._geometry;\n }\n\n /**\n * @param geometry - Geometry to use, if omitted will create a new GraphicsGeometry instance.\n */\n constructor(geometry: GraphicsGeometry = null)\n {\n super();\n\n this._geometry = geometry || new GraphicsGeometry();\n this._geometry.refCount++;\n\n /**\n * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite.\n * This is useful if your graphics element does not change often, as it will speed up the rendering\n * of the object in exchange for taking up texture memory. It is also useful if you need the graphics\n * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if\n * you are constantly redrawing the graphics element.\n * @name cacheAsBitmap\n * @member {boolean}\n * @memberof PIXI.Graphics#\n * @default false\n */\n\n this._transformID = -1;\n\n // Set default\n this.tint = 0xFFFFFF;\n this.blendMode = BLEND_MODES.NORMAL;\n }\n\n /**\n * Creates a new Graphics object with the same values as this one.\n * Note that only the geometry of the object is cloned, not its transform (position,scale,etc)\n * @returns - A clone of the graphics object\n */\n public clone(): Graphics\n {\n this.finishPoly();\n\n return new Graphics(this._geometry);\n }\n\n /**\n * The blend mode to be applied to the graphic shape. Apply a value of\n * `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. Note that, since each\n * primitive in the GraphicsGeometry list is rendered sequentially, modes\n * such as `PIXI.BLEND_MODES.ADD` and `PIXI.BLEND_MODES.MULTIPLY` will\n * be applied per-primitive.\n * @default PIXI.BLEND_MODES.NORMAL\n */\n public set blendMode(value: BLEND_MODES)\n {\n this.state.blendMode = value;\n }\n\n public get blendMode(): BLEND_MODES\n {\n return this.state.blendMode;\n }\n\n /**\n * The tint applied to each graphic shape. This is a hex value. A value of\n * 0xFFFFFF will remove any tint effect.\n * @default 0xFFFFFF\n */\n public get tint(): number\n {\n return this._tint;\n }\n\n public set tint(value: number)\n {\n this._tint = value;\n }\n\n /**\n * The current fill style.\n * @readonly\n */\n public get fill(): FillStyle\n {\n return this._fillStyle;\n }\n\n /**\n * The current line style.\n * @readonly\n */\n public get line(): LineStyle\n {\n return this._lineStyle;\n }\n\n /**\n * Specifies the line style used for subsequent calls to Graphics methods such as the lineTo()\n * method or the drawCircle() method.\n * @param [width=0] - width of the line to draw, will update the objects stored style\n * @param [color=0x0] - color of the line to draw, will update the objects stored style\n * @param [alpha=1] - alpha of the line to draw, will update the objects stored style\n * @param [alignment=0.5] - alignment of the line to draw, (0 = inner, 0.5 = middle, 1 = outer).\n * WebGL only.\n * @param [native=false] - If true the lines will be draw using LINES instead of TRIANGLE_STRIP\n * @returns - This Graphics object. Good for chaining method calls\n */\n public lineStyle(width: number, color?: number, alpha?: number, alignment?: number, native?: boolean): this;\n\n /**\n * Specifies the line style used for subsequent calls to Graphics methods such as the lineTo()\n * method or the drawCircle() method.\n * @param options - Line style options\n * @param {number} [options.width=0] - width of the line to draw, will update the objects stored style\n * @param {number} [options.color=0x0] - color of the line to draw, will update the objects stored style\n * @param {number} [options.alpha=1] - alpha of the line to draw, will update the objects stored style\n * @param {number} [options.alignment=0.5] - alignment of the line to draw, (0 = inner, 0.5 = middle, 1 = outer).\n * WebGL only.\n * @param {boolean} [options.native=false] - If true the lines will be draw using LINES instead of TRIANGLE_STRIP\n * @param {PIXI.LINE_CAP}[options.cap=PIXI.LINE_CAP.BUTT] - line cap style\n * @param {PIXI.LINE_JOIN}[options.join=PIXI.LINE_JOIN.MITER] - line join style\n * @param {number}[options.miterLimit=10] - miter limit ratio\n * @returns {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n public lineStyle(options?: ILineStyleOptions): this;\n\n public lineStyle(options: ILineStyleOptions | number = null,\n color = 0x0, alpha = 1, alignment = 0.5, native = false): this\n {\n // Support non-object params: (width, color, alpha, alignment, native)\n if (typeof options === 'number')\n {\n options = { width: options, color, alpha, alignment, native } as ILineStyleOptions;\n }\n\n return this.lineTextureStyle(options);\n }\n\n /**\n * Like line style but support texture for line fill.\n * @param [options] - Collection of options for setting line style.\n * @param {number} [options.width=0] - width of the line to draw, will update the objects stored style\n * @param {PIXI.Texture} [options.texture=PIXI.Texture.WHITE] - Texture to use\n * @param {number} [options.color=0x0] - color of the line to draw, will update the objects stored style.\n * Default 0xFFFFFF if texture present.\n * @param {number} [options.alpha=1] - alpha of the line to draw, will update the objects stored style\n * @param {PIXI.Matrix} [options.matrix=null] - Texture matrix to transform texture\n * @param {number} [options.alignment=0.5] - alignment of the line to draw, (0 = inner, 0.5 = middle, 1 = outer).\n * WebGL only.\n * @param {boolean} [options.native=false] - If true the lines will be draw using LINES instead of TRIANGLE_STRIP\n * @param {PIXI.LINE_CAP}[options.cap=PIXI.LINE_CAP.BUTT] - line cap style\n * @param {PIXI.LINE_JOIN}[options.join=PIXI.LINE_JOIN.MITER] - line join style\n * @param {number}[options.miterLimit=10] - miter limit ratio\n * @returns {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n public lineTextureStyle(options?: ILineStyleOptions): this\n {\n // Apply defaults\n options = Object.assign({\n width: 0,\n texture: Texture.WHITE,\n color: (options && options.texture) ? 0xFFFFFF : 0x0,\n alpha: 1,\n matrix: null,\n alignment: 0.5,\n native: false,\n cap: LINE_CAP.BUTT,\n join: LINE_JOIN.MITER,\n miterLimit: 10,\n }, options);\n\n if (this.currentPath)\n {\n this.startPoly();\n }\n\n const visible = options.width > 0 && options.alpha > 0;\n\n if (!visible)\n {\n this._lineStyle.reset();\n }\n else\n {\n if (options.matrix)\n {\n options.matrix = options.matrix.clone();\n options.matrix.invert();\n }\n\n Object.assign(this._lineStyle, { visible }, options);\n }\n\n return this;\n }\n\n /**\n * Start a polygon object internally.\n * @protected\n */\n protected startPoly(): void\n {\n if (this.currentPath)\n {\n const points = this.currentPath.points;\n const len = this.currentPath.points.length;\n\n if (len > 2)\n {\n this.drawShape(this.currentPath);\n this.currentPath = new Polygon();\n this.currentPath.closeStroke = false;\n this.currentPath.points.push(points[len - 2], points[len - 1]);\n }\n }\n else\n {\n this.currentPath = new Polygon();\n this.currentPath.closeStroke = false;\n }\n }\n\n /**\n * Finish the polygon object.\n * @protected\n */\n finishPoly(): void\n {\n if (this.currentPath)\n {\n if (this.currentPath.points.length > 2)\n {\n this.drawShape(this.currentPath);\n this.currentPath = null;\n }\n else\n {\n this.currentPath.points.length = 0;\n }\n }\n }\n\n /**\n * Moves the current drawing position to x, y.\n * @param x - the X coordinate to move to\n * @param y - the Y coordinate to move to\n * @returns - This Graphics object. Good for chaining method calls\n */\n public moveTo(x: number, y: number): this\n {\n this.startPoly();\n this.currentPath.points[0] = x;\n this.currentPath.points[1] = y;\n\n return this;\n }\n\n /**\n * Draws a line using the current line style from the current drawing position to (x, y);\n * The current drawing position is then set to (x, y).\n * @param x - the X coordinate to draw to\n * @param y - the Y coordinate to draw to\n * @returns - This Graphics object. Good for chaining method calls\n */\n public lineTo(x: number, y: number): this\n {\n if (!this.currentPath)\n {\n this.moveTo(0, 0);\n }\n\n // remove duplicates..\n const points = this.currentPath.points;\n const fromX = points[points.length - 2];\n const fromY = points[points.length - 1];\n\n if (fromX !== x || fromY !== y)\n {\n points.push(x, y);\n }\n\n return this;\n }\n\n /**\n * Initialize the curve\n * @param x\n * @param y\n */\n protected _initCurve(x = 0, y = 0): void\n {\n if (this.currentPath)\n {\n if (this.currentPath.points.length === 0)\n {\n this.currentPath.points = [x, y];\n }\n }\n else\n {\n this.moveTo(x, y);\n }\n }\n\n /**\n * Calculate the points for a quadratic bezier curve and then draws it.\n * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c\n * @param cpX - Control point x\n * @param cpY - Control point y\n * @param toX - Destination point x\n * @param toY - Destination point y\n * @returns - This Graphics object. Good for chaining method calls\n */\n public quadraticCurveTo(cpX: number, cpY: number, toX: number, toY: number): this\n {\n this._initCurve();\n\n const points = this.currentPath.points;\n\n if (points.length === 0)\n {\n this.moveTo(0, 0);\n }\n\n QuadraticUtils.curveTo(cpX, cpY, toX, toY, points);\n\n return this;\n }\n\n /**\n * Calculate the points for a bezier curve and then draws it.\n * @param cpX - Control point x\n * @param cpY - Control point y\n * @param cpX2 - Second Control point x\n * @param cpY2 - Second Control point y\n * @param toX - Destination point x\n * @param toY - Destination point y\n * @returns This Graphics object. Good for chaining method calls\n */\n public bezierCurveTo(cpX: number, cpY: number, cpX2: number, cpY2: number, toX: number, toY: number): this\n {\n this._initCurve();\n\n BezierUtils.curveTo(cpX, cpY, cpX2, cpY2, toX, toY, this.currentPath.points);\n\n return this;\n }\n\n /**\n * The arcTo() method creates an arc/curve between two tangents on the canvas.\n *\n * \"borrowed\" from https://code.google.com/p/fxcanvas/ - thanks google!\n * @param x1 - The x-coordinate of the first tangent point of the arc\n * @param y1 - The y-coordinate of the first tangent point of the arc\n * @param x2 - The x-coordinate of the end of the arc\n * @param y2 - The y-coordinate of the end of the arc\n * @param radius - The radius of the arc\n * @returns - This Graphics object. Good for chaining method calls\n */\n public arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): this\n {\n this._initCurve(x1, y1);\n\n const points = this.currentPath.points;\n\n const result = ArcUtils.curveTo(x1, y1, x2, y2, radius, points);\n\n if (result)\n {\n const { cx, cy, radius, startAngle, endAngle, anticlockwise } = result;\n\n this.arc(cx, cy, radius, startAngle, endAngle, anticlockwise);\n }\n\n return this;\n }\n\n /**\n * The arc method creates an arc/curve (used to create circles, or parts of circles).\n * @param cx - The x-coordinate of the center of the circle\n * @param cy - The y-coordinate of the center of the circle\n * @param radius - The radius of the circle\n * @param startAngle - The starting angle, in radians (0 is at the 3 o'clock position\n * of the arc's circle)\n * @param endAngle - The ending angle, in radians\n * @param anticlockwise - Specifies whether the drawing should be\n * counter-clockwise or clockwise. False is default, and indicates clockwise, while true\n * indicates counter-clockwise.\n * @returns - This Graphics object. Good for chaining method calls\n */\n public arc(cx: number, cy: number, radius: number, startAngle: number, endAngle: number, anticlockwise = false): this\n {\n if (startAngle === endAngle)\n {\n return this;\n }\n\n if (!anticlockwise && endAngle <= startAngle)\n {\n endAngle += PI_2;\n }\n else if (anticlockwise && startAngle <= endAngle)\n {\n startAngle += PI_2;\n }\n\n const sweep = endAngle - startAngle;\n\n if (sweep === 0)\n {\n return this;\n }\n\n const startX = cx + (Math.cos(startAngle) * radius);\n const startY = cy + (Math.sin(startAngle) * radius);\n const eps = this._geometry.closePointEps;\n\n // If the currentPath exists, take its points. Otherwise call `moveTo` to start a path.\n let points = this.currentPath ? this.currentPath.points : null;\n\n if (points)\n {\n // TODO: make a better fix.\n\n // We check how far our start is from the last existing point\n const xDiff = Math.abs(points[points.length - 2] - startX);\n const yDiff = Math.abs(points[points.length - 1] - startY);\n\n if (xDiff < eps && yDiff < eps)\n {\n // If the point is very close, we don't add it, since this would lead to artifacts\n // during tessellation due to floating point imprecision.\n }\n else\n {\n points.push(startX, startY);\n }\n }\n else\n {\n this.moveTo(startX, startY);\n points = this.currentPath.points;\n }\n\n ArcUtils.arc(startX, startY, cx, cy, radius, startAngle, endAngle, anticlockwise, points);\n\n return this;\n }\n\n /**\n * Specifies a simple one-color fill that subsequent calls to other Graphics methods\n * (such as lineTo() or drawCircle()) use when drawing.\n * @param color - the color of the fill\n * @param alpha - the alpha of the fill\n * @returns - This Graphics object. Good for chaining method calls\n */\n public beginFill(color = 0, alpha = 1): this\n {\n return this.beginTextureFill({ texture: Texture.WHITE, color, alpha });\n }\n\n /**\n * Begin the texture fill\n * @param options - Object object.\n * @param {PIXI.Texture} [options.texture=PIXI.Texture.WHITE] - Texture to fill\n * @param {number} [options.color=0xffffff] - Background to fill behind texture\n * @param {number} [options.alpha=1] - Alpha of fill\n * @param {PIXI.Matrix} [options.matrix=null] - Transform matrix\n * @returns {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n beginTextureFill(options?: IFillStyleOptions): this\n {\n // Apply defaults\n options = Object.assign({\n texture: Texture.WHITE,\n color: 0xFFFFFF,\n alpha: 1,\n matrix: null,\n }, options) as IFillStyleOptions;\n\n if (this.currentPath)\n {\n this.startPoly();\n }\n\n const visible = options.alpha > 0;\n\n if (!visible)\n {\n this._fillStyle.reset();\n }\n else\n {\n if (options.matrix)\n {\n options.matrix = options.matrix.clone();\n options.matrix.invert();\n }\n\n Object.assign(this._fillStyle, { visible }, options);\n }\n\n return this;\n }\n\n /**\n * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method.\n * @returns - This Graphics object. Good for chaining method calls\n */\n public endFill(): this\n {\n this.finishPoly();\n\n this._fillStyle.reset();\n\n return this;\n }\n\n /**\n * Draws a rectangle shape.\n * @param x - The X coord of the top-left of the rectangle\n * @param y - The Y coord of the top-left of the rectangle\n * @param width - The width of the rectangle\n * @param height - The height of the rectangle\n * @returns - This Graphics object. Good for chaining method calls\n */\n public drawRect(x: number, y: number, width: number, height: number): this\n {\n return this.drawShape(new Rectangle(x, y, width, height));\n }\n\n /**\n * Draw a rectangle shape with rounded/beveled corners.\n * @param x - The X coord of the top-left of the rectangle\n * @param y - The Y coord of the top-left of the rectangle\n * @param width - The width of the rectangle\n * @param height - The height of the rectangle\n * @param radius - Radius of the rectangle corners\n * @returns - This Graphics object. Good for chaining method calls\n */\n public drawRoundedRect(x: number, y: number, width: number, height: number, radius: number): this\n {\n return this.drawShape(new RoundedRectangle(x, y, width, height, radius));\n }\n\n /**\n * Draws a circle.\n * @param x - The X coordinate of the center of the circle\n * @param y - The Y coordinate of the center of the circle\n * @param radius - The radius of the circle\n * @returns - This Graphics object. Good for chaining method calls\n */\n public drawCircle(x: number, y: number, radius: number): this\n {\n return this.drawShape(new Circle(x, y, radius));\n }\n\n /**\n * Draws an ellipse.\n * @param x - The X coordinate of the center of the ellipse\n * @param y - The Y coordinate of the center of the ellipse\n * @param width - The half width of the ellipse\n * @param height - The half height of the ellipse\n * @returns - This Graphics object. Good for chaining method calls\n */\n public drawEllipse(x: number, y: number, width: number, height: number): this\n {\n return this.drawShape(new Ellipse(x, y, width, height));\n }\n\n public drawPolygon(...path: Array<number> | Array<Point>): this;\n public drawPolygon(path: Array<number> | Array<Point> | Polygon): this;\n\n /**\n * Draws a polygon using the given path.\n * @param {number[]|PIXI.Point[]|PIXI.Polygon} path - The path data used to construct the polygon.\n * @returns - This Graphics object. Good for chaining method calls\n */\n public drawPolygon(...path: any[]): this\n {\n let points: Array<number> | Array<Point>;\n let closeStroke = true;// !!this._fillStyle;\n\n const poly = path[0] as Polygon;\n\n // check if data has points..\n if (poly.points)\n {\n closeStroke = poly.closeStroke;\n points = poly.points;\n }\n else\n if (Array.isArray(path[0]))\n {\n points = path[0];\n }\n else\n {\n points = path;\n }\n\n const shape = new Polygon(points);\n\n shape.closeStroke = closeStroke;\n\n this.drawShape(shape);\n\n return this;\n }\n\n /**\n * Draw any shape.\n * @param {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} shape - Shape to draw\n * @returns - This Graphics object. Good for chaining method calls\n */\n public drawShape(shape: IShape): this\n {\n if (!this._holeMode)\n {\n this._geometry.drawShape(\n shape,\n this._fillStyle.clone(),\n this._lineStyle.clone(),\n this._matrix\n );\n }\n else\n {\n this._geometry.drawHole(shape, this._matrix);\n }\n\n return this;\n }\n\n /**\n * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.\n * @returns - This Graphics object. Good for chaining method calls\n */\n public clear(): this\n {\n this._geometry.clear();\n this._lineStyle.reset();\n this._fillStyle.reset();\n\n this._boundsID++;\n this._matrix = null;\n this._holeMode = false;\n this.currentPath = null;\n\n return this;\n }\n\n /**\n * True if graphics consists of one rectangle, and thus, can be drawn like a Sprite and\n * masked with gl.scissor.\n * @returns - True if only 1 rect.\n */\n public isFastRect(): boolean\n {\n const data = this._geometry.graphicsData;\n\n return data.length === 1\n && data[0].shape.type === SHAPES.RECT\n && !data[0].matrix\n && !data[0].holes.length\n && !(data[0].lineStyle.visible && data[0].lineStyle.width);\n }\n\n /**\n * Renders the object using the WebGL renderer\n * @param renderer - The renderer\n */\n protected _render(renderer: Renderer): void\n {\n this.finishPoly();\n\n const geometry = this._geometry;\n // batch part..\n // batch it!\n\n geometry.updateBatches();\n\n if (geometry.batchable)\n {\n if (this.batchDirty !== geometry.batchDirty)\n {\n this._populateBatches();\n }\n\n this._renderBatched(renderer);\n }\n else\n {\n // no batching...\n renderer.batch.flush();\n\n this._renderDirect(renderer);\n }\n }\n\n /** Populating batches for rendering. */\n protected _populateBatches(): void\n {\n const geometry = this._geometry;\n const blendMode = this.blendMode;\n const len = geometry.batches.length;\n\n this.batchTint = -1;\n this._transformID = -1;\n this.batchDirty = geometry.batchDirty;\n this.batches.length = len;\n\n this.vertexData = new Float32Array(geometry.points);\n\n for (let i = 0; i < len; i++)\n {\n const gI = geometry.batches[i];\n const color = gI.style.color;\n const vertexData = new Float32Array(this.vertexData.buffer,\n gI.attribStart * 4 * 2,\n gI.attribSize * 2);\n\n const uvs = new Float32Array(geometry.uvsFloat32.buffer,\n gI.attribStart * 4 * 2,\n gI.attribSize * 2);\n\n const indices = new Uint16Array(geometry.indicesUint16.buffer,\n gI.start * 2,\n gI.size);\n\n const batch = {\n vertexData,\n blendMode,\n indices,\n uvs,\n _batchRGB: hex2rgb(color) as Array<number>,\n _tintRGB: color,\n _texture: gI.style.texture,\n alpha: gI.style.alpha,\n worldAlpha: 1 };\n\n this.batches[i] = batch;\n }\n }\n\n /**\n * Renders the batches using the BathedRenderer plugin\n * @param renderer - The renderer\n */\n protected _renderBatched(renderer: Renderer): void\n {\n if (!this.batches.length)\n {\n return;\n }\n\n renderer.batch.setObjectRenderer(renderer.plugins[this.pluginName]);\n\n this.calculateVertices();\n this.calculateTints();\n\n for (let i = 0, l = this.batches.length; i < l; i++)\n {\n const batch = this.batches[i];\n\n batch.worldAlpha = this.worldAlpha * batch.alpha;\n\n renderer.plugins[this.pluginName].render(batch);\n }\n }\n\n /**\n * Renders the graphics direct\n * @param renderer - The renderer\n */\n protected _renderDirect(renderer: Renderer): void\n {\n const shader = this._resolveDirectShader(renderer);\n\n const geometry = this._geometry;\n const tint = this.tint;\n const worldAlpha = this.worldAlpha;\n const uniforms = shader.uniforms;\n const drawCalls = geometry.drawCalls;\n\n // lets set the transfomr\n uniforms.translationMatrix = this.transform.worldTransform;\n\n // and then lets set the tint..\n uniforms.tint[0] = (((tint >> 16) & 0xFF) / 255) * worldAlpha;\n uniforms.tint[1] = (((tint >> 8) & 0xFF) / 255) * worldAlpha;\n uniforms.tint[2] = ((tint & 0xFF) / 255) * worldAlpha;\n uniforms.tint[3] = worldAlpha;\n\n // the first draw call, we can set the uniforms of the shader directly here.\n\n // this means that we can tack advantage of the sync function of pixi!\n // bind and sync uniforms..\n // there is a way to optimise this..\n renderer.shader.bind(shader);\n renderer.geometry.bind(geometry, shader);\n\n // set state..\n renderer.state.set(this.state);\n\n // then render the rest of them...\n for (let i = 0, l = drawCalls.length; i < l; i++)\n {\n this._renderDrawCallDirect(renderer, geometry.drawCalls[i]);\n }\n }\n\n /**\n * Renders specific DrawCall\n * @param renderer\n * @param drawCall\n */\n protected _renderDrawCallDirect(renderer: Renderer, drawCall: BatchDrawCall): void\n {\n const { texArray, type, size, start } = drawCall;\n const groupTextureCount = texArray.count;\n\n for (let j = 0; j < groupTextureCount; j++)\n {\n renderer.texture.bind(texArray.elements[j], j);\n }\n\n renderer.geometry.draw(type, size, start);\n }\n\n /**\n * Resolves shader for direct rendering\n * @param renderer - The renderer\n */\n protected _resolveDirectShader(renderer: Renderer): Shader\n {\n let shader = this.shader;\n\n const pluginName = this.pluginName;\n\n if (!shader)\n {\n // if there is no shader here, we can use the default shader.\n // and that only gets created if we actually need it..\n // but may be more than one plugins for graphics\n if (!DEFAULT_SHADERS[pluginName])\n {\n const { MAX_TEXTURES } = renderer.plugins[pluginName];\n const sampleValues = new Int32Array(MAX_TEXTURES);\n\n for (let i = 0; i < MAX_TEXTURES; i++)\n {\n sampleValues[i] = i;\n }\n\n const uniforms = {\n tint: new Float32Array([1, 1, 1, 1]),\n translationMatrix: new Matrix(),\n default: UniformGroup.from({ uSamplers: sampleValues }, true),\n };\n\n const program = renderer.plugins[pluginName]._shader.program;\n\n DEFAULT_SHADERS[pluginName] = new Shader(program, uniforms);\n }\n\n shader = DEFAULT_SHADERS[pluginName];\n }\n\n return shader;\n }\n\n /** Retrieves the bounds of the graphic shape as a rectangle object. */\n protected _calculateBounds(): void\n {\n this.finishPoly();\n\n const geometry = this._geometry;\n\n // skipping when graphics is empty, like a container\n if (!geometry.graphicsData.length)\n {\n return;\n }\n\n const { minX, minY, maxX, maxY } = geometry.bounds;\n\n this._bounds.addFrame(this.transform, minX, minY, maxX, maxY);\n }\n\n /**\n * Tests if a point is inside this graphics object\n * @param point - the point to test\n * @returns - the result of the test\n */\n public containsPoint(point: IPointData): boolean\n {\n this.worldTransform.applyInverse(point, Graphics._TEMP_POINT);\n\n return this._geometry.containsPoint(Graphics._TEMP_POINT);\n }\n\n /** Recalculate the tint by applying tint to batches using Graphics tint. */\n protected calculateTints(): void\n {\n if (this.batchTint !== this.tint)\n {\n this.batchTint = this.tint;\n\n const tintRGB = hex2rgb(this.tint, temp);\n\n for (let i = 0; i < this.batches.length; i++)\n {\n const batch = this.batches[i];\n\n const batchTint = batch._batchRGB;\n\n const r = (tintRGB[0] * batchTint[0]) * 255;\n const g = (tintRGB[1] * batchTint[1]) * 255;\n const b = (tintRGB[2] * batchTint[2]) * 255;\n\n // TODO Ivan, can this be done in one go?\n const color = (r << 16) + (g << 8) + (b | 0);\n\n batch._tintRGB = (color >> 16)\n + (color & 0xff00)\n + ((color & 0xff) << 16);\n }\n }\n }\n\n /** If there's a transform update or a change to the shape of the geometry, recalculate the vertices. */\n protected calculateVertices(): void\n {\n const wtID = this.transform._worldID;\n\n if (this._transformID === wtID)\n {\n return;\n }\n\n this._transformID = wtID;\n\n const wt = this.transform.worldTransform;\n const a = wt.a;\n const b = wt.b;\n const c = wt.c;\n const d = wt.d;\n const tx = wt.tx;\n const ty = wt.ty;\n\n const data = this._geometry.points;// batch.vertexDataOriginal;\n const vertexData = this.vertexData;\n\n let count = 0;\n\n for (let i = 0; i < data.length; i += 2)\n {\n const x = data[i];\n const y = data[i + 1];\n\n vertexData[count++] = (a * x) + (c * y) + tx;\n vertexData[count++] = (d * y) + (b * x) + ty;\n }\n }\n\n /**\n * Closes the current path.\n * @returns - Returns itself.\n */\n public closePath(): this\n {\n const currentPath = this.currentPath;\n\n if (currentPath)\n {\n // we don't need to add extra point in the end because buildLine will take care of that\n currentPath.closeStroke = true;\n // ensure that the polygon is completed, and is available for hit detection\n // (even if the graphics is not rendered yet)\n this.finishPoly();\n }\n\n return this;\n }\n\n /**\n * Apply a matrix to the positional data.\n * @param matrix - Matrix to use for transform current shape.\n * @returns - Returns itself.\n */\n public setMatrix(matrix: Matrix): this\n {\n this._matrix = matrix;\n\n return this;\n }\n\n /**\n * Begin adding holes to the last draw shape\n * IMPORTANT: holes must be fully inside a shape to work\n * Also weirdness ensues if holes overlap!\n * Ellipses, Circles, Rectangles and Rounded Rectangles cannot be holes or host for holes in CanvasRenderer,\n * please use `moveTo` `lineTo`, `quadraticCurveTo` if you rely on pixi-legacy bundle.\n * @returns - Returns itself.\n */\n public beginHole(): this\n {\n this.finishPoly();\n this._holeMode = true;\n\n return this;\n }\n\n /**\n * End adding holes to the last draw shape.\n * @returns - Returns itself.\n */\n public endHole(): this\n {\n this.finishPoly();\n this._holeMode = false;\n\n return this;\n }\n\n /**\n * Destroys the Graphics object.\n * @param options - Options parameter. A boolean will act as if all\n * options have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have\n * their destroy method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the texture of the child sprite\n * @param {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the base texture of the child sprite\n */\n public destroy(options?: IDestroyOptions | boolean): void\n {\n this._geometry.refCount--;\n if (this._geometry.refCount === 0)\n {\n this._geometry.dispose();\n }\n\n this._matrix = null;\n this.currentPath = null;\n this._lineStyle.destroy();\n this._lineStyle = null;\n this._fillStyle.destroy();\n this._fillStyle = null;\n this._geometry = null;\n this.shader = null;\n this.vertexData = null;\n this.batches.length = 0;\n this.batches = null;\n\n super.destroy(options);\n }\n}\n","import type { IPointData } from '@pixi/math';\nimport { Point } from '@pixi/math';\n\nimport type { DisplayObject } from '@pixi/display';\n\nexport type InteractivePointerEvent = PointerEvent | TouchEvent | MouseEvent;\n\n/**\n * Holds all information related to an Interaction event\n * @memberof PIXI\n */\nexport class InteractionData\n{\n /** This point stores the global coords of where the touch/mouse event happened. */\n public global: Point;\n\n /** The target Sprite that was interacted with. */\n public target: DisplayObject;\n\n /**\n * When passed to an event handler, this will be the original DOM Event that was captured\n * @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent\n * @see https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent\n * @member {MouseEvent|TouchEvent|PointerEvent}\n */\n public originalEvent: InteractivePointerEvent;\n\n /** Unique identifier for this interaction. */\n public identifier: number;\n\n /**\n * Indicates whether or not the pointer device that created the event is the primary pointer.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/isPrimary\n */\n public isPrimary: boolean;\n\n /**\n * Indicates which button was pressed on the mouse or pointer device to trigger the event.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button\n */\n public button: number;\n\n /**\n * Indicates which buttons are pressed on the mouse or pointer device when the event is triggered.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons\n */\n public buttons: number;\n\n /**\n * The width of the pointer's contact along the x-axis, measured in CSS pixels.\n * radiusX of TouchEvents will be represented by this value.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/width\n */\n public width: number;\n\n /**\n * The height of the pointer's contact along the y-axis, measured in CSS pixels.\n * radiusY of TouchEvents will be represented by this value.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/height\n */\n public height: number;\n\n /**\n * The angle, in degrees, between the pointer device and the screen.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/tiltX\n */\n public tiltX: number;\n\n /**\n * The angle, in degrees, between the pointer device and the screen.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/tiltY\n */\n public tiltY: number;\n\n /**\n * The type of pointer that triggered the event.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerType\n */\n public pointerType: string;\n\n /**\n * Pressure applied by the pointing device during the event. A Touch's force property\n * will be represented by this value.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pressure\n */\n public pressure = 0;\n\n /**\n * From TouchEvents (not PointerEvents triggered by touches), the rotationAngle of the Touch.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Touch/rotationAngle\n */\n public rotationAngle = 0;\n\n /**\n * Twist of a stylus pointer.\n * @see https://w3c.github.io/pointerevents/#pointerevent-interface\n */\n public twist = 0;\n\n /**\n * Barrel pressure on a stylus pointer.\n * @see https://w3c.github.io/pointerevents/#pointerevent-interface\n */\n public tangentialPressure = 0;\n\n constructor()\n {\n this.global = new Point();\n this.target = null;\n this.originalEvent = null;\n this.identifier = null;\n this.isPrimary = false;\n this.button = 0;\n this.buttons = 0;\n this.width = 0;\n this.height = 0;\n this.tiltX = 0;\n this.tiltY = 0;\n this.pointerType = null;\n this.pressure = 0;\n this.rotationAngle = 0;\n this.twist = 0;\n this.tangentialPressure = 0;\n }\n\n /**\n * The unique identifier of the pointer. It will be the same as `identifier`.\n * @readonly\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerId\n */\n get pointerId(): number\n {\n return this.identifier;\n }\n\n /**\n * This will return the local coordinates of the specified displayObject for this InteractionData\n * @param displayObject - The DisplayObject that you would like the local\n * coords off\n * @param point - A Point object in which to store the value, optional (otherwise\n * will create a new point)\n * @param globalPos - A Point object containing your custom global coords, optional\n * (otherwise will use the current global coords)\n * @returns - A point containing the coordinates of the InteractionData position relative\n * to the DisplayObject\n */\n public getLocalPosition<P extends IPointData = Point>(displayObject: DisplayObject, point?: P, globalPos?: IPointData): P\n {\n return displayObject.worldTransform.applyInverse<P>(globalPos || this.global, point);\n }\n\n /**\n * Copies properties from normalized event data.\n * @param {Touch|MouseEvent|PointerEvent} event - The normalized event data\n */\n public copyEvent(event: Touch | InteractivePointerEvent): void\n {\n // isPrimary should only change on touchstart/pointerdown, so we don't want to overwrite\n // it with \"false\" on later events when our shim for it on touch events might not be\n // accurate\n if ('isPrimary' in event && event.isPrimary)\n {\n this.isPrimary = true;\n }\n this.button = 'button' in event && event.button;\n // event.buttons is not available in all browsers (ie. Safari), but it does have a non-standard\n // event.which property instead, which conveys the same information.\n const buttons = 'buttons' in event && event.buttons;\n\n this.buttons = Number.isInteger(buttons) ? buttons : 'which' in event && event.which;\n this.width = 'width' in event && event.width;\n this.height = 'height' in event && event.height;\n this.tiltX = 'tiltX' in event && event.tiltX;\n this.tiltY = 'tiltY' in event && event.tiltY;\n this.pointerType = 'pointerType' in event && event.pointerType;\n this.pressure = 'pressure' in event && event.pressure;\n this.rotationAngle = 'rotationAngle' in event && event.rotationAngle;\n this.twist = ('twist' in event && event.twist) || 0;\n this.tangentialPressure = ('tangentialPressure' in event && event.tangentialPressure) || 0;\n }\n\n /** Resets the data for pooling. */\n public reset(): void\n {\n // isPrimary is the only property that we really need to reset - everything else is\n // guaranteed to be overwritten\n this.isPrimary = false;\n }\n}\n","import type { DisplayObject } from '@pixi/display';\nimport type { InteractionData } from './InteractionData';\n\nexport type InteractionCallback = (interactionEvent: InteractionEvent, displayObject: DisplayObject, hit?: boolean) => void;\n\n/**\n * Event class that mimics native DOM events.\n * @memberof PIXI\n */\nexport class InteractionEvent\n{\n /**\n * Whether this event will continue propagating in the tree.\n *\n * Remaining events for the {@link stopsPropagatingAt} object\n * will still be dispatched.\n */\n public stopped: boolean;\n\n /**\n * At which object this event stops propagating.\n * @private\n */\n public stopsPropagatingAt: DisplayObject;\n\n /**\n * Whether we already reached the element we want to\n * stop propagating at. This is important for delayed events,\n * where we start over deeper in the tree again.\n * @private\n */\n public stopPropagationHint: boolean;\n\n /**\n * The object which caused this event to be dispatched.\n * For listener callback see {@link PIXI.InteractionEvent.currentTarget}.\n */\n public target: DisplayObject;\n\n /** The object whose event listener’s callback is currently being invoked. */\n public currentTarget: DisplayObject;\n\n /** Type of the event. */\n public type: string;\n\n /** {@link InteractionData} related to this event */\n public data: InteractionData;\n\n constructor()\n {\n this.stopped = false;\n this.stopsPropagatingAt = null;\n this.stopPropagationHint = false;\n this.target = null;\n this.currentTarget = null;\n this.type = null;\n this.data = null;\n }\n\n /** Prevents event from reaching any objects other than the current object. */\n public stopPropagation(): void\n {\n this.stopped = true;\n this.stopPropagationHint = true;\n this.stopsPropagatingAt = this.currentTarget;\n }\n\n /** Resets the event. */\n public reset(): void\n {\n this.stopped = false;\n this.stopsPropagatingAt = null;\n this.stopPropagationHint = false;\n this.currentTarget = null;\n this.target = null;\n }\n}\n","export interface InteractionTrackingFlags\n{\n OVER: number;\n LEFT_DOWN: number;\n RIGHT_DOWN: number;\n NONE: number;\n}\n\n/**\n * DisplayObjects with the {@link PIXI.interactiveTarget} mixin use this class to track interactions\n * @class\n * @private\n * @memberof PIXI\n */\nexport class InteractionTrackingData\n{\n public static FLAGS: Readonly<InteractionTrackingFlags> = Object.freeze({\n NONE: 0,\n OVER: 1 << 0,\n LEFT_DOWN: 1 << 1,\n RIGHT_DOWN: 1 << 2,\n });\n\n private readonly _pointerId: number;\n private _flags: number;\n\n /**\n * @param {number} pointerId - Unique pointer id of the event\n * @private\n */\n constructor(pointerId: number)\n {\n this._pointerId = pointerId;\n this._flags = InteractionTrackingData.FLAGS.NONE;\n }\n\n /**\n *\n * @private\n * @param {number} flag - The interaction flag to set\n * @param {boolean} yn - Should the flag be set or unset\n */\n private _doSet(flag: number, yn: boolean): void\n {\n if (yn)\n {\n this._flags = this._flags | flag;\n }\n else\n {\n this._flags = this._flags & (~flag);\n }\n }\n\n /**\n * Unique pointer id of the event\n * @readonly\n * @private\n * @member {number}\n */\n get pointerId(): number\n {\n return this._pointerId;\n }\n\n /**\n * State of the tracking data, expressed as bit flags\n * @private\n * @member {number}\n */\n get flags(): number\n {\n return this._flags;\n }\n\n set flags(flags: number)\n {\n this._flags = flags;\n }\n\n /**\n * Is the tracked event inactive (not over or down)?\n * @private\n * @member {number}\n */\n get none(): boolean\n {\n return this._flags === InteractionTrackingData.FLAGS.NONE;\n }\n\n /**\n * Is the tracked event over the DisplayObject?\n * @private\n * @member {boolean}\n */\n get over(): boolean\n {\n return (this._flags & InteractionTrackingData.FLAGS.OVER) !== 0;\n }\n\n set over(yn: boolean)\n {\n this._doSet(InteractionTrackingData.FLAGS.OVER, yn);\n }\n\n /**\n * Did the right mouse button come down in the DisplayObject?\n * @private\n * @member {boolean}\n */\n get rightDown(): boolean\n {\n return (this._flags & InteractionTrackingData.FLAGS.RIGHT_DOWN) !== 0;\n }\n\n set rightDown(yn: boolean)\n {\n this._doSet(InteractionTrackingData.FLAGS.RIGHT_DOWN, yn);\n }\n\n /**\n * Did the left mouse button come down in the DisplayObject?\n * @private\n * @member {boolean}\n */\n get leftDown(): boolean\n {\n return (this._flags & InteractionTrackingData.FLAGS.LEFT_DOWN) !== 0;\n }\n\n set leftDown(yn: boolean)\n {\n this._doSet(InteractionTrackingData.FLAGS.LEFT_DOWN, yn);\n }\n}\n","import { Point } from '@pixi/math';\n\nimport type { InteractionEvent, InteractionCallback } from './InteractionEvent';\nimport type { Container, DisplayObject } from '@pixi/display';\n\n/**\n * Strategy how to search through stage tree for interactive objects\n * @memberof PIXI\n */\nexport class TreeSearch\n{\n private readonly _tempPoint: Point;\n\n constructor()\n {\n this._tempPoint = new Point();\n }\n\n /**\n * Recursive implementation for findHit\n * @private\n * @param interactionEvent - event containing the point that\n * is tested for collision\n * @param displayObject - the displayObject\n * that will be hit test (recursively crawls its children)\n * @param func - the function that will be called on each interactive object. The\n * interactionEvent, displayObject and hit will be passed to the function\n * @param hitTest - this indicates if the objects inside should be hit test against the point\n * @param interactive - Whether the displayObject is interactive\n * @returns - Returns true if the displayObject hit the point\n */\n public recursiveFindHit(interactionEvent: InteractionEvent, displayObject: DisplayObject,\n func?: InteractionCallback, hitTest?: boolean, interactive?: boolean\n ): boolean\n {\n if (!displayObject || !displayObject.visible)\n {\n return false;\n }\n\n const point = interactionEvent.data.global;\n\n // Took a little while to rework this function correctly! But now it is done and nice and optimized! ^_^\n //\n // This function will now loop through all objects and then only hit test the objects it HAS\n // to, not all of them. MUCH faster..\n // An object will be hit test if the following is true:\n //\n // 1: It is interactive.\n // 2: It belongs to a parent that is interactive AND one of the parents children have not already been hit.\n //\n // As another little optimization once an interactive object has been hit we can carry on\n // through the scenegraph, but we know that there will be no more hits! So we can avoid extra hit tests\n // A final optimization is that an object is not hit test directly if a child has already been hit.\n\n interactive = displayObject.interactive || interactive;\n\n let hit = false;\n let interactiveParent = interactive;\n\n // Flag here can set to false if the event is outside the parents hitArea or mask\n let hitTestChildren = true;\n\n // If there is a hitArea, no need to test against anything else if the pointer is not within the hitArea\n // There is also no longer a need to hitTest children.\n if (displayObject.hitArea)\n {\n if (hitTest)\n {\n displayObject.worldTransform.applyInverse(point, this._tempPoint);\n if (!displayObject.hitArea.contains(this._tempPoint.x, this._tempPoint.y))\n {\n hitTest = false;\n hitTestChildren = false;\n }\n else\n {\n hit = true;\n }\n }\n interactiveParent = false;\n }\n // If there is a mask, no need to hitTest against anything else if the pointer is not within the mask.\n // We still want to hitTestChildren, however, to ensure a mouseout can still be generated.\n // https://github.com/pixijs/pixi.js/issues/5135\n else if (displayObject._mask)\n {\n if (hitTest)\n {\n const maskObject = ((displayObject._mask as any).isMaskData\n ? (displayObject._mask as any).maskObject : displayObject._mask) as any;\n\n if (maskObject && !maskObject.containsPoint?.(point))\n {\n hitTest = false;\n }\n }\n }\n\n // ** FREE TIP **! If an object is not interactive or has no buttons in it\n // (such as a game scene!) set interactiveChildren to false for that displayObject.\n // This will allow PixiJS to completely ignore and bypass checking the displayObjects children.\n if (hitTestChildren && displayObject.interactiveChildren && (displayObject as Container).children)\n {\n const children = (displayObject as Container).children;\n\n for (let i = children.length - 1; i >= 0; i--)\n {\n const child = children[i];\n\n // time to get recursive.. if this function will return if something is hit..\n const childHit = this.recursiveFindHit(interactionEvent, child, func, hitTest, interactiveParent);\n\n if (childHit)\n {\n // its a good idea to check if a child has lost its parent.\n // this means it has been removed whilst looping so its best\n if (!child.parent)\n {\n continue;\n }\n\n // we no longer need to hit test any more objects in this container as we we\n // now know the parent has been hit\n interactiveParent = false;\n\n // If the child is interactive , that means that the object hit was actually\n // interactive and not just the child of an interactive object.\n // This means we no longer need to hit test anything else. We still need to run\n // through all objects, but we don't need to perform any hit tests.\n\n if (childHit)\n {\n if (interactionEvent.target)\n {\n hitTest = false;\n }\n hit = true;\n }\n }\n }\n }\n\n // no point running this if the item is not interactive or does not have an interactive parent.\n if (interactive)\n {\n // if we are hit testing (as in we have no hit any objects yet)\n // We also don't need to worry about hit testing if once of the displayObjects children\n // has already been hit - but only if it was interactive, otherwise we need to keep\n // looking for an interactive child, just in case we hit one\n if (hitTest && !interactionEvent.target)\n {\n // already tested against hitArea if it is defined\n if (!displayObject.hitArea && (displayObject as any).containsPoint)\n {\n if ((displayObject as any).containsPoint(point))\n {\n hit = true;\n }\n }\n }\n\n if (displayObject.interactive)\n {\n if (hit && !interactionEvent.target)\n {\n interactionEvent.target = displayObject;\n }\n\n if (func)\n {\n func(interactionEvent, displayObject, !!hit);\n }\n }\n }\n\n return hit;\n }\n\n /**\n * This function is provides a neat way of crawling through the scene graph and running a\n * specified function on all interactive objects it finds. It will also take care of hit\n * testing the interactive objects and passes the hit across in the function.\n * @private\n * @param interactionEvent - event containing the point that\n * is tested for collision\n * @param displayObject - the displayObject\n * that will be hit test (recursively crawls its children)\n * @param func - the function that will be called on each interactive object. The\n * interactionEvent, displayObject and hit will be passed to the function\n * @param hitTest - this indicates if the objects inside should be hit test against the point\n * @returns - Returns true if the displayObject hit the point\n */\n public findHit(interactionEvent: InteractionEvent, displayObject: DisplayObject,\n func?: InteractionCallback, hitTest?: boolean\n ): void\n {\n this.recursiveFindHit(interactionEvent, displayObject, func, hitTest, false);\n }\n}\n","import type { InteractionTrackingData } from './InteractionTrackingData';\n\ntype Cursor = 'auto'\n| 'default'\n| 'none'\n| 'context-menu'\n| 'help'\n| 'pointer'\n| 'progress'\n| 'wait'\n| 'cell'\n| 'crosshair'\n| 'text'\n| 'vertical-text'\n| 'alias'\n| 'copy'\n| 'move'\n| 'no-drop'\n| 'not-allowed'\n| 'e-resize'\n| 'n-resize'\n| 'ne-resize'\n| 'nw-resize'\n| 's-resize'\n| 'se-resize'\n| 'sw-resize'\n| 'w-resize'\n| 'ns-resize'\n| 'ew-resize'\n| 'nesw-resize'\n| 'col-resize'\n| 'nwse-resize'\n| 'row-resize'\n| 'all-scroll'\n| 'zoom-in'\n| 'zoom-out'\n| 'grab'\n| 'grabbing';\n\nexport interface IHitArea\n{\n contains(x: number, y: number): boolean;\n}\n\nexport interface InteractiveTarget\n{\n interactive: boolean;\n interactiveChildren: boolean;\n hitArea: IHitArea | null;\n cursor: Cursor | string;\n buttonMode: boolean;\n trackedPointers: {[x: number]: InteractionTrackingData};\n _trackedPointers: {[x: number]: InteractionTrackingData};\n}\n\n/**\n * Interface for classes that represent a hit area.\n *\n * It is implemented by the following classes:\n * - {@link PIXI.Circle}\n * - {@link PIXI.Ellipse}\n * - {@link PIXI.Polygon}\n * - {@link PIXI.RoundedRectangle}\n * @interface IHitArea\n * @memberof PIXI\n */\n\n/**\n * Checks whether the x and y coordinates given are contained within this area\n * @method\n * @name contains\n * @memberof PIXI.IHitArea#\n * @param {number} x - The X coordinate of the point to test\n * @param {number} y - The Y coordinate of the point to test\n * @returns {boolean} Whether the x/y coordinates are within this area\n */\n\n/**\n * Default property values of interactive objects\n * Used by {@link PIXI.InteractionManager} to automatically give all DisplayObjects these properties\n * @private\n * @name interactiveTarget\n * @type {object}\n * @memberof PIXI\n * @example\n * function MyObject() {}\n *\n * Object.assign(\n * DisplayObject.prototype,\n * PIXI.interactiveTarget\n * );\n */\nexport const interactiveTarget: InteractiveTarget = {\n interactive: false,\n interactiveChildren: true,\n hitArea: null,\n\n /**\n * If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive\n * Setting this changes the 'cursor' property to `'pointer'`.\n * @example\n * const sprite = new PIXI.Sprite(texture);\n * sprite.interactive = true;\n * sprite.buttonMode = true;\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n */\n get buttonMode(): boolean\n {\n return this.cursor === 'pointer';\n },\n set buttonMode(value: boolean)\n {\n if (value)\n {\n this.cursor = 'pointer';\n }\n else if (this.cursor === 'pointer')\n {\n this.cursor = null;\n }\n },\n\n /**\n * This defines what cursor mode is used when the mouse cursor\n * is hovered over the displayObject.\n * @example\n * const sprite = new PIXI.Sprite(texture);\n * sprite.interactive = true;\n * sprite.cursor = 'wait';\n * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor\n * @member {string}\n * @memberof PIXI.DisplayObject#\n */\n cursor: null,\n\n /**\n * Internal set of all active pointers, by identifier\n * @member {Map<number, InteractionTrackingData>}\n * @memberof PIXI.DisplayObject#\n * @private\n */\n get trackedPointers()\n {\n if (this._trackedPointers === undefined) this._trackedPointers = {};\n\n return this._trackedPointers;\n },\n\n /**\n * Map of all tracked pointers, by identifier. Use trackedPointers to access.\n * @private\n * @type {Map<number, InteractionTrackingData>}\n */\n _trackedPointers: undefined,\n};\n","import { Ticker, UPDATE_PRIORITY } from '@pixi/ticker';\nimport { DisplayObject, TemporaryDisplayObject } from '@pixi/display';\nimport type { InteractivePointerEvent } from './InteractionData';\nimport { InteractionData } from './InteractionData';\nimport type { InteractionCallback } from './InteractionEvent';\nimport { InteractionEvent } from './InteractionEvent';\nimport { InteractionTrackingData } from './InteractionTrackingData';\nimport { TreeSearch } from './TreeSearch';\nimport { EventEmitter } from '@pixi/utils';\nimport { interactiveTarget } from './interactiveTarget';\n\nimport type { AbstractRenderer, ExtensionMetadata } from '@pixi/core';\nimport { ExtensionType } from '@pixi/core';\nimport type { Point, IPointData } from '@pixi/math';\nimport type { Dict } from '@pixi/utils';\n\n// Mix interactiveTarget into DisplayObject.prototype\nDisplayObject.mixin(interactiveTarget);\n\nconst MOUSE_POINTER_ID = 1;\n\n// Mock interface for hitTestEvent - only used inside hitTest()\ninterface TestInteractionEvent\n{\n target: DisplayObject;\n data: {global: Point};\n}\n\n// helpers for hitTest() - only used inside hitTest()\nconst hitTestEvent: TestInteractionEvent = {\n target: null,\n data: {\n global: null,\n },\n};\n\nexport interface InteractionManagerOptions\n{\n autoPreventDefault?: boolean;\n interactionFrequency?: number;\n useSystemTicker?: boolean;\n}\n\nexport interface DelayedEvent\n{\n displayObject: DisplayObject;\n eventString: string;\n eventData: InteractionEvent;\n}\n\ninterface CrossCSSStyleDeclaration extends CSSStyleDeclaration\n{\n msContentZooming: string;\n msTouchAction: string;\n}\n\n/**\n * The interaction manager deals with mouse, touch and pointer events.\n *\n * Any DisplayObject can be interactive if its `interactive` property is set to true.\n *\n * This manager also supports multitouch.\n *\n * An instance of this class is automatically created by default, and can be found at `renderer.plugins.interaction`\n * @memberof PIXI\n */\nexport class InteractionManager extends EventEmitter\n{\n /** @ignore */\n static extension: ExtensionMetadata = {\n name: 'interaction',\n type: [\n ExtensionType.RendererPlugin,\n ExtensionType.CanvasRendererPlugin,\n ],\n };\n\n /**\n * Actively tracked InteractionData\n * @private\n * @member {Object<number, PIXI.InteractionData>}\n */\n public readonly activeInteractionData: { [key: number]: InteractionData };\n\n /** Does the device support touch events https://www.w3.org/TR/touch-events/ */\n public readonly supportsTouchEvents: boolean;\n\n /** Does the device support pointer events https://www.w3.org/Submission/pointer-events/ */\n public readonly supportsPointerEvents: boolean;\n\n /**\n * Pool of unused InteractionData\n * @private\n */\n public interactionDataPool: InteractionData[];\n\n /**\n * Internal cached let.\n * @private\n */\n public cursor: string;\n\n /**\n * Delayed pointer events. Used to guarantee correct ordering of over/out events.\n * @private\n */\n public delayedEvents: DelayedEvent[];\n\n /**\n * TreeSearch component that is used to hitTest stage tree.\n * @private\n */\n public search: TreeSearch;\n\n /** The renderer this interaction manager works for. */\n public renderer: AbstractRenderer;\n\n /**\n * Should default browser actions automatically be prevented.\n * Does not apply to pointer events for backwards compatibility\n * preventDefault on pointer events stops mouse events from firing\n * Thus, for every pointer event, there will always be either a mouse of touch event alongside it.\n * @default true\n */\n public autoPreventDefault: boolean;\n\n /**\n * Maximum frequency in milliseconds at which pointer over/out states will be checked by {@link tickerUpdate}.\n * @default 10\n */\n public interactionFrequency: number;\n\n /** The mouse data. */\n public mouse: InteractionData;\n\n /** An event data object to handle all the event tracking/dispatching. */\n public eventData: InteractionEvent;\n\n /**\n * This property determines if mousemove and touchmove events are fired only when the cursor\n * is over the object.\n * Setting to true will make things work more in line with how the DOM version works.\n * Setting to false can make things easier for things like dragging\n * It is currently set to false as this is how PixiJS used to work. This will be set to true in\n * future versions of pixi.\n * @default false\n */\n public moveWhenInside: boolean;\n\n /**\n * Dictionary of how different cursor modes are handled. Strings are handled as CSS cursor\n * values, objects are handled as dictionaries of CSS values for interactionDOMElement,\n * and functions are called instead of changing the CSS.\n * Default CSS cursor values are provided for 'default' and 'pointer' modes.\n * @member {Object<string, Object>}\n */\n public cursorStyles: Dict<string | ((mode: string) => void) | CSSStyleDeclaration>;\n\n /** The mode of the cursor that is being used. The value of this is a key from the cursorStyles dictionary. */\n public currentCursorMode: string;\n\n /**\n * The current resolution / device pixel ratio.\n * @default 1\n */\n public resolution: number;\n\n /** The DOM element to bind to. */\n protected interactionDOMElement: HTMLElement;\n\n /** Have events been attached to the dom element? */\n protected eventsAdded: boolean;\n\n /** Has the system ticker been added? */\n protected tickerAdded: boolean;\n\n /** Is the mouse hovering over the renderer? If working in worker mouse considered to be over renderer by default. */\n protected mouseOverRenderer: boolean;\n\n private _useSystemTicker: boolean;\n private _deltaTime: number;\n private _didMove: boolean;\n\n /** Used as a last rendered object in case renderer doesnt have _lastObjectRendered. */\n private _tempDisplayObject: DisplayObject;\n\n /**\n * An options object specifies characteristics about the event listener.\n * @member {Object<string, boolean>}\n */\n private readonly _eventListenerOptions: { capture: true, passive: false };\n\n /**\n * @param {PIXI.CanvasRenderer|PIXI.Renderer} renderer - A reference to the current renderer\n * @param options - The options for the manager.\n * @param {boolean} [options.autoPreventDefault=true] - Should the manager automatically prevent default browser actions.\n * @param {number} [options.interactionFrequency=10] - Maximum frequency (ms) at pointer over/out states will be checked.\n * @param {number} [options.useSystemTicker=true] - Whether to add {@link tickerUpdate} to {@link PIXI.Ticker.system}.\n */\n constructor(renderer: AbstractRenderer, options?: InteractionManagerOptions)\n {\n super();\n\n options = options || {};\n\n this.renderer = renderer;\n this.autoPreventDefault = options.autoPreventDefault !== undefined ? options.autoPreventDefault : true;\n this.interactionFrequency = options.interactionFrequency || 10;\n this.mouse = new InteractionData();\n this.mouse.identifier = MOUSE_POINTER_ID;\n\n // setting the mouse to start off far off screen will mean that mouse over does\n // not get called before we even move the mouse.\n this.mouse.global.set(-999999);\n\n this.activeInteractionData = {};\n this.activeInteractionData[MOUSE_POINTER_ID] = this.mouse;\n this.interactionDataPool = [];\n this.eventData = new InteractionEvent();\n this.interactionDOMElement = null;\n\n this.moveWhenInside = false;\n this.eventsAdded = false;\n this.tickerAdded = false;\n this.mouseOverRenderer = !('PointerEvent' in globalThis);\n this.supportsTouchEvents = 'ontouchstart' in globalThis;\n this.supportsPointerEvents = !!globalThis.PointerEvent;\n\n // this will make it so that you don't have to call bind all the time\n\n this.onPointerUp = this.onPointerUp.bind(this);\n this.processPointerUp = this.processPointerUp.bind(this);\n\n this.onPointerCancel = this.onPointerCancel.bind(this);\n this.processPointerCancel = this.processPointerCancel.bind(this);\n\n this.onPointerDown = this.onPointerDown.bind(this);\n this.processPointerDown = this.processPointerDown.bind(this);\n\n this.onPointerMove = this.onPointerMove.bind(this);\n this.processPointerMove = this.processPointerMove.bind(this);\n\n this.onPointerOut = this.onPointerOut.bind(this);\n this.processPointerOverOut = this.processPointerOverOut.bind(this);\n\n this.onPointerOver = this.onPointerOver.bind(this);\n\n this.cursorStyles = {\n default: 'inherit',\n pointer: 'pointer',\n };\n this.currentCursorMode = null;\n this.cursor = null;\n\n this.resolution = 1;\n this.delayedEvents = [];\n this.search = new TreeSearch();\n\n this._tempDisplayObject = new TemporaryDisplayObject();\n this._eventListenerOptions = { capture: true, passive: false };\n\n /**\n * Fired when a pointer device button (usually a mouse left-button) is pressed on the display\n * object.\n * @event PIXI.InteractionManager#mousedown\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is pressed\n * on the display object.\n * @event PIXI.InteractionManager#rightdown\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button (usually a mouse left-button) is released over the display\n * object.\n * @event PIXI.InteractionManager#mouseup\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is released\n * over the display object.\n * @event PIXI.InteractionManager#rightup\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button (usually a mouse left-button) is pressed and released on\n * the display object.\n * @event PIXI.InteractionManager#click\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is pressed\n * and released on the display object.\n * @event PIXI.InteractionManager#rightclick\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button (usually a mouse left-button) is released outside the\n * display object that initially registered a\n * [mousedown]{@link PIXI.InteractionManager#event:mousedown}.\n * @event PIXI.InteractionManager#mouseupoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is released\n * outside the display object that initially registered a\n * [rightdown]{@link PIXI.InteractionManager#event:rightdown}.\n * @event PIXI.InteractionManager#rightupoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device (usually a mouse) is moved while over the display object\n * @event PIXI.InteractionManager#mousemove\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device (usually a mouse) is moved onto the display object\n * @event PIXI.InteractionManager#mouseover\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device (usually a mouse) is moved off the display object\n * @event PIXI.InteractionManager#mouseout\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button is pressed on the display object.\n * @event PIXI.InteractionManager#pointerdown\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button is released over the display object.\n * Not always fired when some buttons are held down while others are released. In those cases,\n * use [mousedown]{@link PIXI.InteractionManager#event:mousedown} and\n * [mouseup]{@link PIXI.InteractionManager#event:mouseup} instead.\n * @event PIXI.InteractionManager#pointerup\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when the operating system cancels a pointer event\n * @event PIXI.InteractionManager#pointercancel\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button is pressed and released on the display object.\n * @event PIXI.InteractionManager#pointertap\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button is released outside the display object that initially\n * registered a [pointerdown]{@link PIXI.InteractionManager#event:pointerdown}.\n * @event PIXI.InteractionManager#pointerupoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device is moved while over the display object\n * @event PIXI.InteractionManager#pointermove\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device is moved onto the display object\n * @event PIXI.InteractionManager#pointerover\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device is moved off the display object\n * @event PIXI.InteractionManager#pointerout\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a touch point is placed on the display object.\n * @event PIXI.InteractionManager#touchstart\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a touch point is removed from the display object.\n * @event PIXI.InteractionManager#touchend\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when the operating system cancels a touch\n * @event PIXI.InteractionManager#touchcancel\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a touch point is placed and removed from the display object.\n * @event PIXI.InteractionManager#tap\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a touch point is removed outside of the display object that initially\n * registered a [touchstart]{@link PIXI.InteractionManager#event:touchstart}.\n * @event PIXI.InteractionManager#touchendoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a touch point is moved along the display object.\n * @event PIXI.InteractionManager#touchmove\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button (usually a mouse left-button) is pressed on the display.\n * object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#mousedown\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is pressed\n * on the display object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#rightdown\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button (usually a mouse left-button) is released over the display\n * object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#mouseup\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is released\n * over the display object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#rightup\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button (usually a mouse left-button) is pressed and released on\n * the display object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#click\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is pressed\n * and released on the display object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#rightclick\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button (usually a mouse left-button) is released outside the\n * display object that initially registered a\n * [mousedown]{@link PIXI.DisplayObject#event:mousedown}.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#mouseupoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is released\n * outside the display object that initially registered a\n * [rightdown]{@link PIXI.DisplayObject#event:rightdown}.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#rightupoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device (usually a mouse) is moved while over the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#mousemove\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device (usually a mouse) is moved onto the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#mouseover\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device (usually a mouse) is moved off the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#mouseout\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button is pressed on the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#pointerdown\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button is released over the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#pointerup\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when the operating system cancels a pointer event.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#pointercancel\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button is pressed and released on the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#pointertap\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button is released outside the display object that initially\n * registered a [pointerdown]{@link PIXI.DisplayObject#event:pointerdown}.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#pointerupoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device is moved while over the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#pointermove\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device is moved onto the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#pointerover\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device is moved off the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#pointerout\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a touch point is placed on the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#touchstart\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a touch point is removed from the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#touchend\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when the operating system cancels a touch.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#touchcancel\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a touch point is placed and removed from the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#tap\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a touch point is removed outside of the display object that initially\n * registered a [touchstart]{@link PIXI.DisplayObject#event:touchstart}.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#touchendoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a touch point is moved along the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#touchmove\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n\n this._useSystemTicker = options.useSystemTicker !== undefined ? options.useSystemTicker : true;\n\n this.setTargetElement(this.renderer.view, this.renderer.resolution);\n }\n\n /**\n * Should the InteractionManager automatically add {@link tickerUpdate} to {@link PIXI.Ticker.system}.\n * @default true\n */\n get useSystemTicker(): boolean\n {\n return this._useSystemTicker;\n }\n set useSystemTicker(useSystemTicker: boolean)\n {\n this._useSystemTicker = useSystemTicker;\n\n if (useSystemTicker)\n {\n this.addTickerListener();\n }\n else\n {\n this.removeTickerListener();\n }\n }\n\n /**\n * Last rendered object or temp object.\n * @readonly\n * @protected\n */\n get lastObjectRendered(): DisplayObject\n {\n return (this.renderer._lastObjectRendered as DisplayObject) || this._tempDisplayObject;\n }\n\n /**\n * Hit tests a point against the display tree, returning the first interactive object that is hit.\n * @param globalPoint - A point to hit test with, in global space.\n * @param root - The root display object to start from. If omitted, defaults\n * to the last rendered root of the associated renderer.\n * @returns - The hit display object, if any.\n */\n public hitTest(globalPoint: Point, root?: DisplayObject): DisplayObject\n {\n // clear the target for our hit test\n hitTestEvent.target = null;\n // assign the global point\n hitTestEvent.data.global = globalPoint;\n // ensure safety of the root\n if (!root)\n {\n root = this.lastObjectRendered;\n }\n // run the hit test\n this.processInteractive(hitTestEvent as InteractionEvent, root, null, true);\n // return our found object - it'll be null if we didn't hit anything\n\n return hitTestEvent.target;\n }\n\n /**\n * Sets the DOM element which will receive mouse/touch events. This is useful for when you have\n * other DOM elements on top of the renderers Canvas element. With this you'll be bale to delegate\n * another DOM element to receive those events.\n * @param element - the DOM element which will receive mouse and touch events.\n * @param resolution - The resolution / device pixel ratio of the new element (relative to the canvas).\n */\n public setTargetElement(element: HTMLElement, resolution = 1): void\n {\n this.removeTickerListener();\n\n this.removeEvents();\n\n this.interactionDOMElement = element;\n\n this.resolution = resolution;\n\n this.addEvents();\n\n this.addTickerListener();\n }\n\n /** Adds the ticker listener. */\n private addTickerListener(): void\n {\n if (this.tickerAdded || !this.interactionDOMElement || !this._useSystemTicker)\n {\n return;\n }\n\n Ticker.system.add(this.tickerUpdate, this, UPDATE_PRIORITY.INTERACTION);\n\n this.tickerAdded = true;\n }\n\n /** Removes the ticker listener. */\n private removeTickerListener(): void\n {\n if (!this.tickerAdded)\n {\n return;\n }\n\n Ticker.system.remove(this.tickerUpdate, this);\n\n this.tickerAdded = false;\n }\n\n /** Registers all the DOM events. */\n private addEvents(): void\n {\n if (this.eventsAdded || !this.interactionDOMElement)\n {\n return;\n }\n\n const style = this.interactionDOMElement.style as CrossCSSStyleDeclaration;\n\n if ((globalThis.navigator as any).msPointerEnabled)\n {\n style.msContentZooming = 'none';\n style.msTouchAction = 'none';\n }\n else if (this.supportsPointerEvents)\n {\n style.touchAction = 'none';\n }\n\n /*\n * These events are added first, so that if pointer events are normalized, they are fired\n * in the same order as non-normalized events. ie. pointer event 1st, mouse / touch 2nd\n */\n if (this.supportsPointerEvents)\n {\n globalThis.document.addEventListener('pointermove', this.onPointerMove, this._eventListenerOptions);\n this.interactionDOMElement.addEventListener('pointerdown', this.onPointerDown, this._eventListenerOptions);\n // pointerout is fired in addition to pointerup (for touch events) and pointercancel\n // we already handle those, so for the purposes of what we do in onPointerOut, we only\n // care about the pointerleave event\n this.interactionDOMElement.addEventListener('pointerleave', this.onPointerOut, this._eventListenerOptions);\n this.interactionDOMElement.addEventListener('pointerover', this.onPointerOver, this._eventListenerOptions);\n globalThis.addEventListener('pointercancel', this.onPointerCancel, this._eventListenerOptions);\n globalThis.addEventListener('pointerup', this.onPointerUp, this._eventListenerOptions);\n }\n else\n {\n globalThis.document.addEventListener('mousemove', this.onPointerMove, this._eventListenerOptions);\n this.interactionDOMElement.addEventListener('mousedown', this.onPointerDown, this._eventListenerOptions);\n this.interactionDOMElement.addEventListener('mouseout', this.onPointerOut, this._eventListenerOptions);\n this.interactionDOMElement.addEventListener('mouseover', this.onPointerOver, this._eventListenerOptions);\n globalThis.addEventListener('mouseup', this.onPointerUp, this._eventListenerOptions);\n }\n\n // always look directly for touch events so that we can provide original data\n // In a future version we should change this to being just a fallback and rely solely on\n // PointerEvents whenever available\n if (this.supportsTouchEvents)\n {\n this.interactionDOMElement.addEventListener('touchstart', this.onPointerDown, this._eventListenerOptions);\n this.interactionDOMElement.addEventListener('touchcancel', this.onPointerCancel, this._eventListenerOptions);\n this.interactionDOMElement.addEventListener('touchend', this.onPointerUp, this._eventListenerOptions);\n this.interactionDOMElement.addEventListener('touchmove', this.onPointerMove, this._eventListenerOptions);\n }\n\n this.eventsAdded = true;\n }\n\n /** Removes all the DOM events that were previously registered. */\n private removeEvents(): void\n {\n if (!this.eventsAdded || !this.interactionDOMElement)\n {\n return;\n }\n\n const style = this.interactionDOMElement.style as CrossCSSStyleDeclaration;\n\n if ((globalThis.navigator as any).msPointerEnabled)\n {\n style.msContentZooming = '';\n style.msTouchAction = '';\n }\n else if (this.supportsPointerEvents)\n {\n style.touchAction = '';\n }\n\n if (this.supportsPointerEvents)\n {\n globalThis.document.removeEventListener('pointermove', this.onPointerMove, this._eventListenerOptions);\n this.interactionDOMElement.removeEventListener('pointerdown', this.onPointerDown, this._eventListenerOptions);\n this.interactionDOMElement.removeEventListener('pointerleave', this.onPointerOut, this._eventListenerOptions);\n this.interactionDOMElement.removeEventListener('pointerover', this.onPointerOver, this._eventListenerOptions);\n globalThis.removeEventListener('pointercancel', this.onPointerCancel, this._eventListenerOptions);\n globalThis.removeEventListener('pointerup', this.onPointerUp, this._eventListenerOptions);\n }\n else\n {\n globalThis.document.removeEventListener('mousemove', this.onPointerMove, this._eventListenerOptions);\n this.interactionDOMElement.removeEventListener('mousedown', this.onPointerDown, this._eventListenerOptions);\n this.interactionDOMElement.removeEventListener('mouseout', this.onPointerOut, this._eventListenerOptions);\n this.interactionDOMElement.removeEventListener('mouseover', this.onPointerOver, this._eventListenerOptions);\n globalThis.removeEventListener('mouseup', this.onPointerUp, this._eventListenerOptions);\n }\n\n if (this.supportsTouchEvents)\n {\n this.interactionDOMElement.removeEventListener('touchstart', this.onPointerDown, this._eventListenerOptions);\n this.interactionDOMElement.removeEventListener('touchcancel', this.onPointerCancel, this._eventListenerOptions);\n this.interactionDOMElement.removeEventListener('touchend', this.onPointerUp, this._eventListenerOptions);\n this.interactionDOMElement.removeEventListener('touchmove', this.onPointerMove, this._eventListenerOptions);\n }\n\n this.interactionDOMElement = null;\n\n this.eventsAdded = false;\n }\n\n /**\n * Updates the state of interactive objects if at least {@link interactionFrequency}\n * milliseconds have passed since the last invocation.\n *\n * Invoked by a throttled ticker update from {@link PIXI.Ticker.system}.\n * @param deltaTime - time delta since the last call\n */\n public tickerUpdate(deltaTime: number): void\n {\n this._deltaTime += deltaTime;\n\n if (this._deltaTime < this.interactionFrequency)\n {\n return;\n }\n\n this._deltaTime = 0;\n\n this.update();\n }\n\n /** Updates the state of interactive objects. */\n public update(): void\n {\n if (!this.interactionDOMElement)\n {\n return;\n }\n\n // if the user move the mouse this check has already been done using the mouse move!\n if (this._didMove)\n {\n this._didMove = false;\n\n return;\n }\n\n this.cursor = null;\n\n // Resets the flag as set by a stopPropagation call. This flag is usually reset by a user interaction of any kind,\n // but there was a scenario of a display object moving under a static mouse cursor.\n // In this case, mouseover and mouseevents would not pass the flag test in dispatchEvent function\n for (const k in this.activeInteractionData)\n {\n // eslint-disable-next-line no-prototype-builtins\n if (this.activeInteractionData.hasOwnProperty(k))\n {\n const interactionData = this.activeInteractionData[k];\n\n if (interactionData.originalEvent && interactionData.pointerType !== 'touch')\n {\n const interactionEvent = this.configureInteractionEventForDOMEvent(\n this.eventData,\n interactionData.originalEvent as PointerEvent,\n interactionData\n );\n\n this.processInteractive(\n interactionEvent,\n this.lastObjectRendered,\n this.processPointerOverOut,\n true\n );\n }\n }\n }\n\n this.setCursorMode(this.cursor);\n }\n\n /**\n * Sets the current cursor mode, handling any callbacks or CSS style changes.\n * @param mode - cursor mode, a key from the cursorStyles dictionary\n */\n public setCursorMode(mode: string): void\n {\n mode = mode || 'default';\n let applyStyles = true;\n\n // offscreen canvas does not support setting styles, but cursor modes can be functions,\n // in order to handle pixi rendered cursors, so we can't bail\n if (globalThis.OffscreenCanvas && this.interactionDOMElement instanceof OffscreenCanvas)\n {\n applyStyles = false;\n }\n // if the mode didn't actually change, bail early\n if (this.currentCursorMode === mode)\n {\n return;\n }\n this.currentCursorMode = mode;\n const style = this.cursorStyles[mode];\n\n // only do things if there is a cursor style for it\n if (style)\n {\n switch (typeof style)\n {\n case 'string':\n // string styles are handled as cursor CSS\n if (applyStyles)\n {\n this.interactionDOMElement.style.cursor = style;\n }\n break;\n case 'function':\n // functions are just called, and passed the cursor mode\n style(mode);\n break;\n case 'object':\n // if it is an object, assume that it is a dictionary of CSS styles,\n // apply it to the interactionDOMElement\n if (applyStyles)\n {\n Object.assign(this.interactionDOMElement.style, style);\n }\n break;\n }\n }\n else if (applyStyles && typeof mode === 'string' && !Object.prototype.hasOwnProperty.call(this.cursorStyles, mode))\n {\n // if it mode is a string (not a Symbol) and cursorStyles doesn't have any entry\n // for the mode, then assume that the dev wants it to be CSS for the cursor.\n this.interactionDOMElement.style.cursor = mode;\n }\n }\n\n /**\n * Dispatches an event on the display object that was interacted with.\n * @param displayObject - the display object in question\n * @param eventString - the name of the event (e.g, mousedown)\n * @param eventData - the event data object\n */\n private dispatchEvent(displayObject: DisplayObject, eventString: string, eventData: InteractionEvent): void\n {\n // Even if the event was stopped, at least dispatch any remaining events\n // for the same display object.\n if (!eventData.stopPropagationHint || displayObject === eventData.stopsPropagatingAt)\n {\n eventData.currentTarget = displayObject;\n eventData.type = eventString;\n\n displayObject.emit(eventString, eventData);\n\n if ((displayObject as any)[eventString])\n {\n (displayObject as any)[eventString](eventData);\n }\n }\n }\n\n /**\n * Puts a event on a queue to be dispatched later. This is used to guarantee correct\n * ordering of over/out events.\n * @param displayObject - the display object in question\n * @param eventString - the name of the event (e.g, mousedown)\n * @param eventData - the event data object\n */\n private delayDispatchEvent(displayObject: DisplayObject, eventString: string, eventData: InteractionEvent): void\n {\n this.delayedEvents.push({ displayObject, eventString, eventData });\n }\n\n /**\n * Maps x and y coords from a DOM object and maps them correctly to the PixiJS view. The\n * resulting value is stored in the point. This takes into account the fact that the DOM\n * element could be scaled and positioned anywhere on the screen.\n * @param point - the point that the result will be stored in\n * @param x - the x coord of the position to map\n * @param y - the y coord of the position to map\n */\n public mapPositionToPoint(point: IPointData, x: number, y: number): void\n {\n let rect;\n\n // IE 11 fix\n if (!this.interactionDOMElement.parentElement)\n {\n rect = {\n x: 0,\n y: 0,\n width: (this.interactionDOMElement as any).width,\n height: (this.interactionDOMElement as any).height,\n left: 0,\n top: 0\n };\n }\n else\n {\n rect = this.interactionDOMElement.getBoundingClientRect();\n }\n\n const resolutionMultiplier = 1.0 / this.resolution;\n\n point.x = ((x - rect.left) * ((this.interactionDOMElement as any).width / rect.width)) * resolutionMultiplier;\n point.y = ((y - rect.top) * ((this.interactionDOMElement as any).height / rect.height)) * resolutionMultiplier;\n }\n\n /**\n * This function is provides a neat way of crawling through the scene graph and running a\n * specified function on all interactive objects it finds. It will also take care of hit\n * testing the interactive objects and passes the hit across in the function.\n * @protected\n * @param interactionEvent - event containing the point that\n * is tested for collision\n * @param displayObject - the displayObject\n * that will be hit test (recursively crawls its children)\n * @param func - the function that will be called on each interactive object. The\n * interactionEvent, displayObject and hit will be passed to the function\n * @param hitTest - indicates whether we want to calculate hits\n * or just iterate through all interactive objects\n */\n public processInteractive(interactionEvent: InteractionEvent, displayObject: DisplayObject,\n func?: InteractionCallback, hitTest?: boolean\n ): void\n {\n const hit = this.search.findHit(interactionEvent, displayObject, func, hitTest);\n\n const delayedEvents = this.delayedEvents;\n\n if (!delayedEvents.length)\n {\n return hit;\n }\n // Reset the propagation hint, because we start deeper in the tree again.\n interactionEvent.stopPropagationHint = false;\n\n const delayedLen = delayedEvents.length;\n\n this.delayedEvents = [];\n\n for (let i = 0; i < delayedLen; i++)\n {\n const { displayObject, eventString, eventData } = delayedEvents[i];\n\n // When we reach the object we wanted to stop propagating at,\n // set the propagation hint.\n if (eventData.stopsPropagatingAt === displayObject)\n {\n eventData.stopPropagationHint = true;\n }\n\n this.dispatchEvent(displayObject, eventString, eventData);\n }\n\n return hit;\n }\n\n /**\n * Is called when the pointer button is pressed down on the renderer element\n * @param originalEvent - The DOM event of a pointer button being pressed down\n */\n private onPointerDown(originalEvent: InteractivePointerEvent): void\n {\n // if we support touch events, then only use those for touch events, not pointer events\n if (this.supportsTouchEvents && (originalEvent as PointerEvent).pointerType === 'touch') return;\n\n const events = this.normalizeToPointerData(originalEvent);\n\n /*\n * No need to prevent default on natural pointer events, as there are no side effects\n * Normalized events, however, may have the double mousedown/touchstart issue on the native android browser,\n * so still need to be prevented.\n */\n\n // Guaranteed that there will be at least one event in events, and all events must have the same pointer type\n\n if (this.autoPreventDefault && (events[0] as any).isNormalized)\n {\n const cancelable = originalEvent.cancelable || !('cancelable' in originalEvent);\n\n if (cancelable)\n {\n originalEvent.preventDefault();\n }\n }\n\n const eventLen = events.length;\n\n for (let i = 0; i < eventLen; i++)\n {\n const event = events[i];\n\n const interactionData = this.getInteractionDataForPointerId(event);\n\n const interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData);\n\n interactionEvent.data.originalEvent = originalEvent;\n\n this.processInteractive(interactionEvent, this.lastObjectRendered, this.processPointerDown, true);\n\n this.emit('pointerdown', interactionEvent);\n if (event.pointerType === 'touch')\n {\n this.emit('touchstart', interactionEvent);\n }\n // emit a mouse event for \"pen\" pointers, the way a browser would emit a fallback event\n else if (event.pointerType === 'mouse' || event.pointerType === 'pen')\n {\n const isRightButton = event.button === 2;\n\n this.emit(isRightButton ? 'rightdown' : 'mousedown', this.eventData);\n }\n }\n }\n\n /**\n * Processes the result of the pointer down check and dispatches the event if need be\n * @param interactionEvent - The interaction event wrapping the DOM event\n * @param displayObject - The display object that was tested\n * @param hit - the result of the hit test on the display object\n */\n private processPointerDown(interactionEvent: InteractionEvent, displayObject: DisplayObject, hit: boolean): void\n {\n const data = interactionEvent.data;\n const id = interactionEvent.data.identifier;\n\n if (hit)\n {\n if (!displayObject.trackedPointers[id])\n {\n displayObject.trackedPointers[id] = new InteractionTrackingData(id);\n }\n this.dispatchEvent(displayObject, 'pointerdown', interactionEvent);\n\n if (data.pointerType === 'touch')\n {\n this.dispatchEvent(displayObject, 'touchstart', interactionEvent);\n }\n else if (data.pointerType === 'mouse' || data.pointerType === 'pen')\n {\n const isRightButton = data.button === 2;\n\n if (isRightButton)\n {\n displayObject.trackedPointers[id].rightDown = true;\n }\n else\n {\n displayObject.trackedPointers[id].leftDown = true;\n }\n\n this.dispatchEvent(displayObject, isRightButton ? 'rightdown' : 'mousedown', interactionEvent);\n }\n }\n }\n\n /**\n * Is called when the pointer button is released on the renderer element\n * @param originalEvent - The DOM event of a pointer button being released\n * @param cancelled - true if the pointer is cancelled\n * @param func - Function passed to {@link processInteractive}\n */\n private onPointerComplete(originalEvent: InteractivePointerEvent, cancelled: boolean, func: InteractionCallback): void\n {\n const events = this.normalizeToPointerData(originalEvent);\n\n const eventLen = events.length;\n\n // if the event wasn't targeting our canvas, then consider it to be pointerupoutside\n // in all cases (unless it was a pointercancel)\n let target = originalEvent.target;\n\n // if in shadow DOM use composedPath to access target\n if (originalEvent.composedPath && originalEvent.composedPath().length > 0)\n {\n target = originalEvent.composedPath()[0];\n }\n\n const eventAppend = target !== this.interactionDOMElement ? 'outside' : '';\n\n for (let i = 0; i < eventLen; i++)\n {\n const event = events[i];\n\n const interactionData = this.getInteractionDataForPointerId(event);\n\n const interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData);\n\n interactionEvent.data.originalEvent = originalEvent;\n\n // perform hit testing for events targeting our canvas or cancel events\n this.processInteractive(interactionEvent, this.lastObjectRendered, func, cancelled || !eventAppend);\n\n this.emit(cancelled ? 'pointercancel' : `pointerup${eventAppend}`, interactionEvent);\n\n if (event.pointerType === 'mouse' || event.pointerType === 'pen')\n {\n const isRightButton = event.button === 2;\n\n this.emit(isRightButton ? `rightup${eventAppend}` : `mouseup${eventAppend}`, interactionEvent);\n }\n else if (event.pointerType === 'touch')\n {\n this.emit(cancelled ? 'touchcancel' : `touchend${eventAppend}`, interactionEvent);\n this.releaseInteractionDataForPointerId(event.pointerId);\n }\n }\n }\n\n /**\n * Is called when the pointer button is cancelled\n * @param event - The DOM event of a pointer button being released\n */\n private onPointerCancel(event: InteractivePointerEvent): void\n {\n // if we support touch events, then only use those for touch events, not pointer events\n if (this.supportsTouchEvents && (event as PointerEvent).pointerType === 'touch') return;\n\n this.onPointerComplete(event, true, this.processPointerCancel);\n }\n\n /**\n * Processes the result of the pointer cancel check and dispatches the event if need be\n * @param interactionEvent - The interaction event wrapping the DOM event\n * @param displayObject - The display object that was tested\n */\n private processPointerCancel(interactionEvent: InteractionEvent, displayObject: DisplayObject): void\n {\n const data = interactionEvent.data;\n\n const id = interactionEvent.data.identifier;\n\n if (displayObject.trackedPointers[id] !== undefined)\n {\n delete displayObject.trackedPointers[id];\n this.dispatchEvent(displayObject, 'pointercancel', interactionEvent);\n\n if (data.pointerType === 'touch')\n {\n this.dispatchEvent(displayObject, 'touchcancel', interactionEvent);\n }\n }\n }\n\n /**\n * Is called when the pointer button is released on the renderer element\n * @param event - The DOM event of a pointer button being released\n */\n private onPointerUp(event: InteractivePointerEvent): void\n {\n // if we support touch events, then only use those for touch events, not pointer events\n if (this.supportsTouchEvents && (event as PointerEvent).pointerType === 'touch') return;\n\n this.onPointerComplete(event, false, this.processPointerUp);\n }\n\n /**\n * Processes the result of the pointer up check and dispatches the event if need be\n * @param interactionEvent - The interaction event wrapping the DOM event\n * @param displayObject - The display object that was tested\n * @param hit - the result of the hit test on the display object\n */\n private processPointerUp(interactionEvent: InteractionEvent, displayObject: DisplayObject, hit: boolean): void\n {\n const data = interactionEvent.data;\n\n const id = interactionEvent.data.identifier;\n\n const trackingData = displayObject.trackedPointers[id];\n\n const isTouch = data.pointerType === 'touch';\n\n const isMouse = (data.pointerType === 'mouse' || data.pointerType === 'pen');\n // need to track mouse down status in the mouse block so that we can emit\n // event in a later block\n let isMouseTap = false;\n\n // Mouse only\n if (isMouse)\n {\n const isRightButton = data.button === 2;\n\n const flags = InteractionTrackingData.FLAGS;\n\n const test = isRightButton ? flags.RIGHT_DOWN : flags.LEFT_DOWN;\n\n const isDown = trackingData !== undefined && (trackingData.flags & test);\n\n if (hit)\n {\n this.dispatchEvent(displayObject, isRightButton ? 'rightup' : 'mouseup', interactionEvent);\n\n if (isDown)\n {\n this.dispatchEvent(displayObject, isRightButton ? 'rightclick' : 'click', interactionEvent);\n // because we can confirm that the mousedown happened on this object, flag for later emit of pointertap\n isMouseTap = true;\n }\n }\n else if (isDown)\n {\n this.dispatchEvent(displayObject, isRightButton ? 'rightupoutside' : 'mouseupoutside', interactionEvent);\n }\n // update the down state of the tracking data\n if (trackingData)\n {\n if (isRightButton)\n {\n trackingData.rightDown = false;\n }\n else\n {\n trackingData.leftDown = false;\n }\n }\n }\n\n // Pointers and Touches, and Mouse\n if (hit)\n {\n this.dispatchEvent(displayObject, 'pointerup', interactionEvent);\n if (isTouch) this.dispatchEvent(displayObject, 'touchend', interactionEvent);\n\n if (trackingData)\n {\n // emit pointertap if not a mouse, or if the mouse block decided it was a tap\n if (!isMouse || isMouseTap)\n {\n this.dispatchEvent(displayObject, 'pointertap', interactionEvent);\n }\n if (isTouch)\n {\n this.dispatchEvent(displayObject, 'tap', interactionEvent);\n // touches are no longer over (if they ever were) when we get the touchend\n // so we should ensure that we don't keep pretending that they are\n trackingData.over = false;\n }\n }\n }\n else if (trackingData)\n {\n this.dispatchEvent(displayObject, 'pointerupoutside', interactionEvent);\n if (isTouch) this.dispatchEvent(displayObject, 'touchendoutside', interactionEvent);\n }\n // Only remove the tracking data if there is no over/down state still associated with it\n if (trackingData && trackingData.none)\n {\n delete displayObject.trackedPointers[id];\n }\n }\n\n /**\n * Is called when the pointer moves across the renderer element\n * @param originalEvent - The DOM event of a pointer moving\n */\n private onPointerMove(originalEvent: InteractivePointerEvent): void\n {\n // if we support touch events, then only use those for touch events, not pointer events\n if (this.supportsTouchEvents && (originalEvent as PointerEvent).pointerType === 'touch') return;\n\n const events = this.normalizeToPointerData(originalEvent);\n\n if (events[0].pointerType === 'mouse' || events[0].pointerType === 'pen')\n {\n this._didMove = true;\n\n this.cursor = null;\n }\n\n const eventLen = events.length;\n\n for (let i = 0; i < eventLen; i++)\n {\n const event = events[i];\n\n const interactionData = this.getInteractionDataForPointerId(event);\n\n const interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData);\n\n interactionEvent.data.originalEvent = originalEvent;\n\n this.processInteractive(interactionEvent, this.lastObjectRendered, this.processPointerMove, true);\n\n this.emit('pointermove', interactionEvent);\n if (event.pointerType === 'touch') this.emit('touchmove', interactionEvent);\n if (event.pointerType === 'mouse' || event.pointerType === 'pen') this.emit('mousemove', interactionEvent);\n }\n\n if (events[0].pointerType === 'mouse')\n {\n this.setCursorMode(this.cursor);\n\n // TODO BUG for parents interactive object (border order issue)\n }\n }\n\n /**\n * Processes the result of the pointer move check and dispatches the event if need be\n * @param interactionEvent - The interaction event wrapping the DOM event\n * @param displayObject - The display object that was tested\n * @param hit - the result of the hit test on the display object\n */\n private processPointerMove(interactionEvent: InteractionEvent, displayObject: DisplayObject, hit: boolean): void\n {\n const data = interactionEvent.data;\n\n const isTouch = data.pointerType === 'touch';\n\n const isMouse = (data.pointerType === 'mouse' || data.pointerType === 'pen');\n\n if (isMouse)\n {\n this.processPointerOverOut(interactionEvent, displayObject, hit);\n }\n\n if (!this.moveWhenInside || hit)\n {\n this.dispatchEvent(displayObject, 'pointermove', interactionEvent);\n if (isTouch) this.dispatchEvent(displayObject, 'touchmove', interactionEvent);\n if (isMouse) this.dispatchEvent(displayObject, 'mousemove', interactionEvent);\n }\n }\n\n /**\n * Is called when the pointer is moved out of the renderer element\n * @private\n * @param {PointerEvent} originalEvent - The DOM event of a pointer being moved out\n */\n private onPointerOut(originalEvent: InteractivePointerEvent): void\n {\n // if we support touch events, then only use those for touch events, not pointer events\n if (this.supportsTouchEvents && (originalEvent as PointerEvent).pointerType === 'touch') return;\n\n const events = this.normalizeToPointerData(originalEvent);\n\n // Only mouse and pointer can call onPointerOut, so events will always be length 1\n const event = events[0];\n\n if (event.pointerType === 'mouse')\n {\n this.mouseOverRenderer = false;\n this.setCursorMode(null);\n }\n\n const interactionData = this.getInteractionDataForPointerId(event);\n\n const interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData);\n\n interactionEvent.data.originalEvent = event;\n\n this.processInteractive(interactionEvent, this.lastObjectRendered, this.processPointerOverOut, false);\n\n this.emit('pointerout', interactionEvent);\n if (event.pointerType === 'mouse' || event.pointerType === 'pen')\n {\n this.emit('mouseout', interactionEvent);\n }\n else\n {\n // we can get touchleave events after touchend, so we want to make sure we don't\n // introduce memory leaks\n this.releaseInteractionDataForPointerId(interactionData.identifier);\n }\n }\n\n /**\n * Processes the result of the pointer over/out check and dispatches the event if need be.\n * @param interactionEvent - The interaction event wrapping the DOM event\n * @param displayObject - The display object that was tested\n * @param hit - the result of the hit test on the display object\n */\n private processPointerOverOut(interactionEvent: InteractionEvent, displayObject: DisplayObject, hit: boolean): void\n {\n const data = interactionEvent.data;\n\n const id = interactionEvent.data.identifier;\n\n const isMouse = (data.pointerType === 'mouse' || data.pointerType === 'pen');\n\n let trackingData = displayObject.trackedPointers[id];\n\n // if we just moused over the display object, then we need to track that state\n if (hit && !trackingData)\n {\n trackingData = displayObject.trackedPointers[id] = new InteractionTrackingData(id);\n }\n\n if (trackingData === undefined) return;\n\n if (hit && this.mouseOverRenderer)\n {\n if (!trackingData.over)\n {\n trackingData.over = true;\n this.delayDispatchEvent(displayObject, 'pointerover', interactionEvent);\n if (isMouse)\n {\n this.delayDispatchEvent(displayObject, 'mouseover', interactionEvent);\n }\n }\n\n // only change the cursor if it has not already been changed (by something deeper in the\n // display tree)\n if (isMouse && this.cursor === null)\n {\n this.cursor = displayObject.cursor;\n }\n }\n else if (trackingData.over)\n {\n trackingData.over = false;\n this.dispatchEvent(displayObject, 'pointerout', this.eventData);\n if (isMouse)\n {\n this.dispatchEvent(displayObject, 'mouseout', interactionEvent);\n }\n // if there is no mouse down information for the pointer, then it is safe to delete\n if (trackingData.none)\n {\n delete displayObject.trackedPointers[id];\n }\n }\n }\n\n /**\n * Is called when the pointer is moved into the renderer element.\n * @param originalEvent - The DOM event of a pointer button being moved into the renderer view.\n */\n private onPointerOver(originalEvent: InteractivePointerEvent): void\n {\n const events = this.normalizeToPointerData(originalEvent);\n\n // Only mouse and pointer can call onPointerOver, so events will always be length 1\n const event = events[0];\n\n const interactionData = this.getInteractionDataForPointerId(event);\n\n const interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData);\n\n interactionEvent.data.originalEvent = event;\n\n if (event.pointerType === 'mouse')\n {\n this.mouseOverRenderer = true;\n }\n\n this.emit('pointerover', interactionEvent);\n if (event.pointerType === 'mouse' || event.pointerType === 'pen')\n {\n this.emit('mouseover', interactionEvent);\n }\n }\n\n /**\n * Get InteractionData for a given pointerId. Store that data as well.\n * @param event - Normalized pointer event, output from normalizeToPointerData.\n * @returns - Interaction data for the given pointer identifier.\n */\n private getInteractionDataForPointerId(event: PointerEvent): InteractionData\n {\n const pointerId = event.pointerId;\n\n let interactionData;\n\n if (pointerId === MOUSE_POINTER_ID || event.pointerType === 'mouse')\n {\n interactionData = this.mouse;\n }\n else if (this.activeInteractionData[pointerId])\n {\n interactionData = this.activeInteractionData[pointerId];\n }\n else\n {\n interactionData = this.interactionDataPool.pop() || new InteractionData();\n interactionData.identifier = pointerId;\n this.activeInteractionData[pointerId] = interactionData;\n }\n // copy properties from the event, so that we can make sure that touch/pointer specific\n // data is available\n interactionData.copyEvent(event);\n\n return interactionData;\n }\n\n /**\n * Return unused InteractionData to the pool, for a given pointerId\n * @param pointerId - Identifier from a pointer event\n */\n private releaseInteractionDataForPointerId(pointerId: number): void\n {\n const interactionData = this.activeInteractionData[pointerId];\n\n if (interactionData)\n {\n delete this.activeInteractionData[pointerId];\n interactionData.reset();\n this.interactionDataPool.push(interactionData);\n }\n }\n\n /**\n * Configure an InteractionEvent to wrap a DOM PointerEvent and InteractionData\n * @param interactionEvent - The event to be configured\n * @param pointerEvent - The DOM event that will be paired with the InteractionEvent\n * @param interactionData - The InteractionData that will be paired\n * with the InteractionEvent\n * @returns - the interaction event that was passed in\n */\n private configureInteractionEventForDOMEvent(interactionEvent: InteractionEvent, pointerEvent: PointerEvent,\n interactionData: InteractionData\n ): InteractionEvent\n {\n interactionEvent.data = interactionData;\n\n this.mapPositionToPoint(interactionData.global, pointerEvent.clientX, pointerEvent.clientY);\n\n // Not really sure why this is happening, but it's how a previous version handled things\n if (pointerEvent.pointerType === 'touch')\n {\n (pointerEvent as any).globalX = interactionData.global.x;\n (pointerEvent as any).globalY = interactionData.global.y;\n }\n\n interactionData.originalEvent = pointerEvent;\n interactionEvent.reset();\n\n return interactionEvent;\n }\n\n /**\n * Ensures that the original event object contains all data that a regular pointer event would have\n * @param {TouchEvent|MouseEvent|PointerEvent} event - The original event data from a touch or mouse event\n * @returns - An array containing a single normalized pointer event, in the case of a pointer\n * or mouse event, or a multiple normalized pointer events if there are multiple changed touches\n */\n private normalizeToPointerData(event: InteractivePointerEvent): PointerEvent[]\n {\n const normalizedEvents = [];\n\n if (this.supportsTouchEvents && event instanceof TouchEvent)\n {\n for (let i = 0, li = event.changedTouches.length; i < li; i++)\n {\n const touch = event.changedTouches[i] as PixiTouch;\n\n if (typeof touch.button === 'undefined') touch.button = event.touches.length ? 1 : 0;\n if (typeof touch.buttons === 'undefined') touch.buttons = event.touches.length ? 1 : 0;\n if (typeof touch.isPrimary === 'undefined')\n {\n touch.isPrimary = event.touches.length === 1 && event.type === 'touchstart';\n }\n if (typeof touch.width === 'undefined') touch.width = touch.radiusX || 1;\n if (typeof touch.height === 'undefined') touch.height = touch.radiusY || 1;\n if (typeof touch.tiltX === 'undefined') touch.tiltX = 0;\n if (typeof touch.tiltY === 'undefined') touch.tiltY = 0;\n if (typeof touch.pointerType === 'undefined') touch.pointerType = 'touch';\n if (typeof touch.pointerId === 'undefined') touch.pointerId = touch.identifier || 0;\n if (typeof touch.pressure === 'undefined') touch.pressure = touch.force || 0.5;\n if (typeof touch.twist === 'undefined') touch.twist = 0;\n if (typeof touch.tangentialPressure === 'undefined') touch.tangentialPressure = 0;\n // TODO: Remove these, as layerX/Y is not a standard, is deprecated, has uneven\n // support, and the fill ins are not quite the same\n // offsetX/Y might be okay, but is not the same as clientX/Y when the canvas's top\n // left is not 0,0 on the page\n if (typeof touch.layerX === 'undefined') touch.layerX = touch.offsetX = touch.clientX;\n if (typeof touch.layerY === 'undefined') touch.layerY = touch.offsetY = touch.clientY;\n\n // mark the touch as normalized, just so that we know we did it\n touch.isNormalized = true;\n\n normalizedEvents.push(touch);\n }\n }\n // apparently PointerEvent subclasses MouseEvent, so yay\n else if (!globalThis.MouseEvent\n || (event instanceof MouseEvent && (!this.supportsPointerEvents || !(event instanceof globalThis.PointerEvent))))\n {\n const tempEvent = event as PixiPointerEvent;\n\n if (typeof tempEvent.isPrimary === 'undefined') tempEvent.isPrimary = true;\n if (typeof tempEvent.width === 'undefined') tempEvent.width = 1;\n if (typeof tempEvent.height === 'undefined') tempEvent.height = 1;\n if (typeof tempEvent.tiltX === 'undefined') tempEvent.tiltX = 0;\n if (typeof tempEvent.tiltY === 'undefined') tempEvent.tiltY = 0;\n if (typeof tempEvent.pointerType === 'undefined') tempEvent.pointerType = 'mouse';\n if (typeof tempEvent.pointerId === 'undefined') tempEvent.pointerId = MOUSE_POINTER_ID;\n if (typeof tempEvent.pressure === 'undefined') tempEvent.pressure = 0.5;\n if (typeof tempEvent.twist === 'undefined') tempEvent.twist = 0;\n if (typeof tempEvent.tangentialPressure === 'undefined') tempEvent.tangentialPressure = 0;\n\n // mark the mouse event as normalized, just so that we know we did it\n tempEvent.isNormalized = true;\n\n normalizedEvents.push(tempEvent);\n }\n else\n {\n normalizedEvents.push(event);\n }\n\n return normalizedEvents as PointerEvent[];\n }\n\n /** Destroys the interaction manager. */\n public destroy(): void\n {\n this.removeEvents();\n\n this.removeTickerListener();\n\n this.removeAllListeners();\n\n this.renderer = null;\n\n this.mouse = null;\n\n this.eventData = null;\n\n this.interactionDOMElement = null;\n\n this.onPointerDown = null;\n this.processPointerDown = null;\n\n this.onPointerUp = null;\n this.processPointerUp = null;\n\n this.onPointerCancel = null;\n this.processPointerCancel = null;\n\n this.onPointerMove = null;\n this.processPointerMove = null;\n\n this.onPointerOut = null;\n this.processPointerOverOut = null;\n\n this.onPointerOver = null;\n\n this.search = null;\n }\n}\n\ninterface PixiPointerEvent extends PointerEvent\n{\n isPrimary: boolean;\n width: number;\n height: number;\n tiltX: number;\n tiltY: number;\n pointerType: string;\n pointerId: number;\n pressure: number;\n twist: number;\n tangentialPressure: number;\n isNormalized: boolean;\n}\n\ninterface PixiTouch extends Touch\n{\n button: number;\n buttons: number;\n isPrimary: boolean;\n width: number;\n height: number;\n tiltX: number;\n tiltY: number;\n pointerType: string;\n pointerId: number;\n pressure: number;\n twist: number;\n tangentialPressure: number;\n layerX: number;\n layerY: number;\n offsetX: number;\n offsetY: number;\n isNormalized: boolean;\n}\n","/**\n * Two Pi.\n * @static\n * @member {number}\n * @memberof PIXI\n */\nexport const PI_2 = Math.PI * 2;\n\n/**\n * Conversion factor for converting radians to degrees.\n * @static\n * @member {number} RAD_TO_DEG\n * @memberof PIXI\n */\nexport const RAD_TO_DEG = 180 / Math.PI;\n\n/**\n * Conversion factor for converting degrees to radians.\n * @static\n * @member {number}\n * @memberof PIXI\n */\nexport const DEG_TO_RAD = Math.PI / 180;\n\n/**\n * Constants that identify shapes, mainly to prevent `instanceof` calls.\n * @static\n * @memberof PIXI\n * @enum {number}\n * @property {number} POLY Polygon\n * @property {number} RECT Rectangle\n * @property {number} CIRC Circle\n * @property {number} ELIP Ellipse\n * @property {number} RREC Rounded Rectangle\n */\nexport enum SHAPES\n// eslint-disable-next-line @typescript-eslint/indent\n{\n POLY = 0,\n RECT = 1,\n CIRC = 2,\n ELIP = 3,\n RREC = 4,\n}\n","import type { IPoint } from './IPoint';\nimport type { IPointData } from './IPointData';\n\nexport interface Point extends GlobalMixins.Point, IPoint {}\n\n/**\n * The Point object represents a location in a two-dimensional coordinate system, where `x` represents\n * the position on the horizontal axis and `y` represents the position on the vertical axis\n * @class\n * @memberof PIXI\n * @implements {IPoint}\n */\nexport class Point implements IPoint\n{\n /** Position of the point on the x axis */\n public x = 0;\n /** Position of the point on the y axis */\n public y = 0;\n\n /**\n * Creates a new `Point`\n * @param {number} [x=0] - position of the point on the x axis\n * @param {number} [y=0] - position of the point on the y axis\n */\n constructor(x = 0, y = 0)\n {\n this.x = x;\n this.y = y;\n }\n\n /**\n * Creates a clone of this point\n * @returns A clone of this point\n */\n clone(): Point\n {\n return new Point(this.x, this.y);\n }\n\n /**\n * Copies `x` and `y` from the given point into this point\n * @param p - The point to copy from\n * @returns The point instance itself\n */\n copyFrom(p: IPointData): this\n {\n this.set(p.x, p.y);\n\n return this;\n }\n\n /**\n * Copies this point's x and y into the given point (`p`).\n * @param p - The point to copy to. Can be any of type that is or extends `IPointData`\n * @returns The point (`p`) with values updated\n */\n copyTo<T extends IPoint>(p: T): T\n {\n p.set(this.x, this.y);\n\n return p;\n }\n\n /**\n * Accepts another point (`p`) and returns `true` if the given point is equal to this point\n * @param p - The point to check\n * @returns Returns `true` if both `x` and `y` are equal\n */\n equals(p: IPointData): boolean\n {\n return (p.x === this.x) && (p.y === this.y);\n }\n\n /**\n * Sets the point to a new `x` and `y` position.\n * If `y` is omitted, both `x` and `y` will be set to `x`.\n * @param {number} [x=0] - position of the point on the `x` axis\n * @param {number} [y=x] - position of the point on the `y` axis\n * @returns The point instance itself\n */\n set(x = 0, y = x): this\n {\n this.x = x;\n this.y = y;\n\n return this;\n }\n\n // #if _DEBUG\n toString(): string\n {\n return `[@pixi/math:Point x=${this.x} y=${this.y}]`;\n }\n // #endif\n}\n","import { SHAPES } from '../const';\nimport type { Matrix } from '../Matrix';\nimport { Point } from '../Point';\n\nconst tempPoints = [new Point(), new Point(), new Point(), new Point()];\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface Rectangle extends GlobalMixins.Rectangle {}\n\n/**\n * Size object, contains width and height\n * @memberof PIXI\n * @typedef {object} ISize\n * @property {number} width - Width component\n * @property {number} height - Height component\n */\n\n/**\n * Rectangle object is an area defined by its position, as indicated by its top-left corner\n * point (x, y) and by its width and its height.\n * @memberof PIXI\n */\nexport class Rectangle\n{\n /** @default 0 */\n public x: number;\n\n /** @default 0 */\n public y: number;\n /** @default 0 */\n public width: number;\n\n /** @default 0 */\n public height: number;\n\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n * @default PIXI.SHAPES.RECT\n * @see PIXI.SHAPES\n */\n public readonly type: SHAPES.RECT;\n\n /**\n * @param x - The X coordinate of the upper-left corner of the rectangle\n * @param y - The Y coordinate of the upper-left corner of the rectangle\n * @param width - The overall width of the rectangle\n * @param height - The overall height of the rectangle\n */\n constructor(x: string | number = 0, y: string | number = 0, width: string | number = 0, height: string | number = 0)\n {\n this.x = Number(x);\n this.y = Number(y);\n this.width = Number(width);\n this.height = Number(height);\n this.type = SHAPES.RECT;\n }\n\n /** Returns the left edge of the rectangle. */\n get left(): number\n {\n return this.x;\n }\n\n /** Returns the right edge of the rectangle. */\n get right(): number\n {\n return this.x + this.width;\n }\n\n /** Returns the top edge of the rectangle. */\n get top(): number\n {\n return this.y;\n }\n\n /** Returns the bottom edge of the rectangle. */\n get bottom(): number\n {\n return this.y + this.height;\n }\n\n /** A constant empty rectangle. */\n static get EMPTY(): Rectangle\n {\n return new Rectangle(0, 0, 0, 0);\n }\n\n /**\n * Creates a clone of this Rectangle\n * @returns a copy of the rectangle\n */\n clone(): Rectangle\n {\n return new Rectangle(this.x, this.y, this.width, this.height);\n }\n\n /**\n * Copies another rectangle to this one.\n * @param rectangle - The rectangle to copy from.\n * @returns Returns itself.\n */\n copyFrom(rectangle: Rectangle): Rectangle\n {\n this.x = rectangle.x;\n this.y = rectangle.y;\n this.width = rectangle.width;\n this.height = rectangle.height;\n\n return this;\n }\n\n /**\n * Copies this rectangle to another one.\n * @param rectangle - The rectangle to copy to.\n * @returns Returns given parameter.\n */\n copyTo(rectangle: Rectangle): Rectangle\n {\n rectangle.x = this.x;\n rectangle.y = this.y;\n rectangle.width = this.width;\n rectangle.height = this.height;\n\n return rectangle;\n }\n\n /**\n * Checks whether the x and y coordinates given are contained within this Rectangle\n * @param x - The X coordinate of the point to test\n * @param y - The Y coordinate of the point to test\n * @returns Whether the x/y coordinates are within this Rectangle\n */\n contains(x: number, y: number): boolean\n {\n if (this.width <= 0 || this.height <= 0)\n {\n return false;\n }\n\n if (x >= this.x && x < this.x + this.width)\n {\n if (y >= this.y && y < this.y + this.height)\n {\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * Determines whether the `other` Rectangle transformed by `transform` intersects with `this` Rectangle object.\n * Returns true only if the area of the intersection is >0, this means that Rectangles\n * sharing a side are not overlapping. Another side effect is that an arealess rectangle\n * (width or height equal to zero) can't intersect any other rectangle.\n * @param {Rectangle} other - The Rectangle to intersect with `this`.\n * @param {Matrix} transform - The transformation matrix of `other`.\n * @returns {boolean} A value of `true` if the transformed `other` Rectangle intersects with `this`; otherwise `false`.\n */\n intersects(other: Rectangle, transform?: Matrix): boolean\n {\n if (!transform)\n {\n const x0 = this.x < other.x ? other.x : this.x;\n const x1 = this.right > other.right ? other.right : this.right;\n\n if (x1 <= x0)\n {\n return false;\n }\n\n const y0 = this.y < other.y ? other.y : this.y;\n const y1 = this.bottom > other.bottom ? other.bottom : this.bottom;\n\n return y1 > y0;\n }\n\n const x0 = this.left;\n const x1 = this.right;\n const y0 = this.top;\n const y1 = this.bottom;\n\n if (x1 <= x0 || y1 <= y0)\n {\n return false;\n }\n\n const lt = tempPoints[0].set(other.left, other.top);\n const lb = tempPoints[1].set(other.left, other.bottom);\n const rt = tempPoints[2].set(other.right, other.top);\n const rb = tempPoints[3].set(other.right, other.bottom);\n\n if (rt.x <= lt.x || lb.y <= lt.y)\n {\n return false;\n }\n\n const s = Math.sign((transform.a * transform.d) - (transform.b * transform.c));\n\n if (s === 0)\n {\n return false;\n }\n\n transform.apply(lt, lt);\n transform.apply(lb, lb);\n transform.apply(rt, rt);\n transform.apply(rb, rb);\n\n if (Math.max(lt.x, lb.x, rt.x, rb.x) <= x0\n || Math.min(lt.x, lb.x, rt.x, rb.x) >= x1\n || Math.max(lt.y, lb.y, rt.y, rb.y) <= y0\n || Math.min(lt.y, lb.y, rt.y, rb.y) >= y1)\n {\n return false;\n }\n\n const nx = s * (lb.y - lt.y);\n const ny = s * (lt.x - lb.x);\n const n00 = (nx * x0) + (ny * y0);\n const n10 = (nx * x1) + (ny * y0);\n const n01 = (nx * x0) + (ny * y1);\n const n11 = (nx * x1) + (ny * y1);\n\n if (Math.max(n00, n10, n01, n11) <= (nx * lt.x) + (ny * lt.y)\n || Math.min(n00, n10, n01, n11) >= (nx * rb.x) + (ny * rb.y))\n {\n return false;\n }\n\n const mx = s * (lt.y - rt.y);\n const my = s * (rt.x - lt.x);\n const m00 = (mx * x0) + (my * y0);\n const m10 = (mx * x1) + (my * y0);\n const m01 = (mx * x0) + (my * y1);\n const m11 = (mx * x1) + (my * y1);\n\n if (Math.max(m00, m10, m01, m11) <= (mx * lt.x) + (my * lt.y)\n || Math.min(m00, m10, m01, m11) >= (mx * rb.x) + (my * rb.y))\n {\n return false;\n }\n\n return true;\n }\n\n /**\n * Pads the rectangle making it grow in all directions.\n * If paddingY is omitted, both paddingX and paddingY will be set to paddingX.\n * @param paddingX - The horizontal padding amount.\n * @param paddingY - The vertical padding amount.\n * @returns Returns itself.\n */\n pad(paddingX = 0, paddingY = paddingX): this\n {\n this.x -= paddingX;\n this.y -= paddingY;\n\n this.width += paddingX * 2;\n this.height += paddingY * 2;\n\n return this;\n }\n\n /**\n * Fits this rectangle around the passed one.\n * @param rectangle - The rectangle to fit.\n * @returns Returns itself.\n */\n fit(rectangle: Rectangle): this\n {\n const x1 = Math.max(this.x, rectangle.x);\n const x2 = Math.min(this.x + this.width, rectangle.x + rectangle.width);\n const y1 = Math.max(this.y, rectangle.y);\n const y2 = Math.min(this.y + this.height, rectangle.y + rectangle.height);\n\n this.x = x1;\n this.width = Math.max(x2 - x1, 0);\n this.y = y1;\n this.height = Math.max(y2 - y1, 0);\n\n return this;\n }\n\n /**\n * Enlarges rectangle that way its corners lie on grid\n * @param resolution - resolution\n * @param eps - precision\n * @returns Returns itself.\n */\n ceil(resolution = 1, eps = 0.001): this\n {\n const x2 = Math.ceil((this.x + this.width - eps) * resolution) / resolution;\n const y2 = Math.ceil((this.y + this.height - eps) * resolution) / resolution;\n\n this.x = Math.floor((this.x + eps) * resolution) / resolution;\n this.y = Math.floor((this.y + eps) * resolution) / resolution;\n\n this.width = x2 - this.x;\n this.height = y2 - this.y;\n\n return this;\n }\n\n /**\n * Enlarges this rectangle to include the passed rectangle.\n * @param rectangle - The rectangle to include.\n * @returns Returns itself.\n */\n enlarge(rectangle: Rectangle): this\n {\n const x1 = Math.min(this.x, rectangle.x);\n const x2 = Math.max(this.x + this.width, rectangle.x + rectangle.width);\n const y1 = Math.min(this.y, rectangle.y);\n const y2 = Math.max(this.y + this.height, rectangle.y + rectangle.height);\n\n this.x = x1;\n this.width = x2 - x1;\n this.y = y1;\n this.height = y2 - y1;\n\n return this;\n }\n\n // #if _DEBUG\n toString(): string\n {\n return `[@pixi/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`;\n }\n // #endif\n}\n","import { SHAPES } from './../const';\nimport { Rectangle } from './Rectangle';\n\n/**\n * The Circle object is used to help draw graphics and can also be used to specify a hit area for displayObjects.\n * @memberof PIXI\n */\nexport class Circle\n{\n /** @default 0 */\n public x: number;\n\n /** @default 0 */\n public y: number;\n\n /** @default 0 */\n public radius: number;\n\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n * @default PIXI.SHAPES.CIRC\n * @see PIXI.SHAPES\n */\n public readonly type: SHAPES.CIRC;\n\n /**\n * @param x - The X coordinate of the center of this circle\n * @param y - The Y coordinate of the center of this circle\n * @param radius - The radius of the circle\n */\n constructor(x = 0, y = 0, radius = 0)\n {\n this.x = x;\n this.y = y;\n this.radius = radius;\n\n this.type = SHAPES.CIRC;\n }\n\n /**\n * Creates a clone of this Circle instance\n * @returns A copy of the Circle\n */\n clone(): Circle\n {\n return new Circle(this.x, this.y, this.radius);\n }\n\n /**\n * Checks whether the x and y coordinates given are contained within this circle\n * @param x - The X coordinate of the point to test\n * @param y - The Y coordinate of the point to test\n * @returns Whether the x/y coordinates are within this Circle\n */\n contains(x: number, y: number): boolean\n {\n if (this.radius <= 0)\n {\n return false;\n }\n\n const r2 = this.radius * this.radius;\n let dx = (this.x - x);\n let dy = (this.y - y);\n\n dx *= dx;\n dy *= dy;\n\n return (dx + dy <= r2);\n }\n\n /**\n * Returns the framing rectangle of the circle as a Rectangle object\n * @returns The framing rectangle\n */\n getBounds(): Rectangle\n {\n return new Rectangle(this.x - this.radius, this.y - this.radius, this.radius * 2, this.radius * 2);\n }\n\n // #if _DEBUG\n toString(): string\n {\n return `[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`;\n }\n // #endif\n}\n","import { Rectangle } from './Rectangle';\nimport { SHAPES } from '../const';\n\n/**\n * The Ellipse object is used to help draw graphics and can also be used to specify a hit area for displayObjects.\n * @memberof PIXI\n */\nexport class Ellipse\n{\n /** @default 0 */\n public x: number;\n\n /** @default 0 */\n public y: number;\n\n /** @default 0 */\n public width: number;\n\n /** @default 0 */\n public height: number;\n\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n * @default PIXI.SHAPES.ELIP\n * @see PIXI.SHAPES\n */\n public readonly type: SHAPES.ELIP;\n\n /**\n * @param x - The X coordinate of the center of this ellipse\n * @param y - The Y coordinate of the center of this ellipse\n * @param halfWidth - The half width of this ellipse\n * @param halfHeight - The half height of this ellipse\n */\n constructor(x = 0, y = 0, halfWidth = 0, halfHeight = 0)\n {\n this.x = x;\n this.y = y;\n this.width = halfWidth;\n this.height = halfHeight;\n\n this.type = SHAPES.ELIP;\n }\n\n /**\n * Creates a clone of this Ellipse instance\n * @returns {PIXI.Ellipse} A copy of the ellipse\n */\n clone(): Ellipse\n {\n return new Ellipse(this.x, this.y, this.width, this.height);\n }\n\n /**\n * Checks whether the x and y coordinates given are contained within this ellipse\n * @param x - The X coordinate of the point to test\n * @param y - The Y coordinate of the point to test\n * @returns Whether the x/y coords are within this ellipse\n */\n contains(x: number, y: number): boolean\n {\n if (this.width <= 0 || this.height <= 0)\n {\n return false;\n }\n\n // normalize the coords to an ellipse with center 0,0\n let normx = ((x - this.x) / this.width);\n let normy = ((y - this.y) / this.height);\n\n normx *= normx;\n normy *= normy;\n\n return (normx + normy <= 1);\n }\n\n /**\n * Returns the framing rectangle of the ellipse as a Rectangle object\n * @returns The framing rectangle\n */\n getBounds(): Rectangle\n {\n return new Rectangle(this.x - this.width, this.y - this.height, this.width, this.height);\n }\n\n // #if _DEBUG\n toString(): string\n {\n return `[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`;\n }\n // #endif\n}\n","import { SHAPES } from '../const';\nimport type { IPointData } from '../IPointData';\n\n/**\n * A class to define a shape via user defined coordinates.\n * @memberof PIXI\n */\nexport class Polygon\n{\n /** An array of the points of this polygon. */\n public points: number[];\n\n /** `false` after moveTo, `true` after `closePath`. In all other cases it is `true`. */\n public closeStroke: boolean;\n\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n * @default PIXI.SHAPES.POLY\n * @see PIXI.SHAPES\n */\n public readonly type: SHAPES.POLY;\n\n constructor(points: IPointData[] | number[]);\n constructor(...points: IPointData[] | number[]);\n\n /**\n * @param {PIXI.IPointData[]|number[]} points - This can be an array of Points\n * that form the polygon, a flat array of numbers that will be interpreted as [x,y, x,y, ...], or\n * the arguments passed can be all the points of the polygon e.g.\n * `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the arguments passed can be flat\n * x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are Numbers.\n */\n constructor(...points: any[])\n {\n let flat: IPointData[] | number[] = Array.isArray(points[0]) ? points[0] : points;\n\n // if this is an array of points, convert it to a flat array of numbers\n if (typeof flat[0] !== 'number')\n {\n const p: number[] = [];\n\n for (let i = 0, il = flat.length; i < il; i++)\n {\n p.push((flat[i] as IPointData).x, (flat[i] as IPointData).y);\n }\n\n flat = p;\n }\n\n this.points = flat as number[];\n this.type = SHAPES.POLY;\n this.closeStroke = true;\n }\n\n /**\n * Creates a clone of this polygon.\n * @returns - A copy of the polygon.\n */\n clone(): Polygon\n {\n const points = this.points.slice();\n const polygon = new Polygon(points);\n\n polygon.closeStroke = this.closeStroke;\n\n return polygon;\n }\n\n /**\n * Checks whether the x and y coordinates passed to this function are contained within this polygon.\n * @param x - The X coordinate of the point to test.\n * @param y - The Y coordinate of the point to test.\n * @returns - Whether the x/y coordinates are within this polygon.\n */\n contains(x: number, y: number): boolean\n {\n let inside = false;\n\n // use some raycasting to test hits\n // https://github.com/substack/point-in-polygon/blob/master/index.js\n const length = this.points.length / 2;\n\n for (let i = 0, j = length - 1; i < length; j = i++)\n {\n const xi = this.points[i * 2];\n const yi = this.points[(i * 2) + 1];\n const xj = this.points[j * 2];\n const yj = this.points[(j * 2) + 1];\n const intersect = ((yi > y) !== (yj > y)) && (x < ((xj - xi) * ((y - yi) / (yj - yi))) + xi);\n\n if (intersect)\n {\n inside = !inside;\n }\n }\n\n return inside;\n }\n\n // #if _DEBUG\n toString(): string\n {\n return `[@pixi/math:Polygon`\n + `closeStroke=${this.closeStroke}`\n + `points=${this.points.reduce((pointsDesc, currentPoint) => `${pointsDesc}, ${currentPoint}`, '')}]`;\n }\n // #endif\n}\n","import { SHAPES } from '../const';\n\n/**\n * The Rounded Rectangle object is an area that has nice rounded corners, as indicated by its\n * top-left corner point (x, y) and by its width and its height and its radius.\n * @memberof PIXI\n */\nexport class RoundedRectangle\n{\n /** @default 0 */\n public x: number;\n\n /** @default 0 */\n public y: number;\n\n /** @default 0 */\n public width: number;\n\n /** @default 0 */\n public height: number;\n\n /** @default 20 */\n public radius: number;\n\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n * @default PIXI.SHAPES.RREC\n * @see PIXI.SHAPES\n */\n public readonly type: SHAPES.RREC;\n\n /**\n * @param x - The X coordinate of the upper-left corner of the rounded rectangle\n * @param y - The Y coordinate of the upper-left corner of the rounded rectangle\n * @param width - The overall width of this rounded rectangle\n * @param height - The overall height of this rounded rectangle\n * @param radius - Controls the radius of the rounded corners\n */\n constructor(x = 0, y = 0, width = 0, height = 0, radius = 20)\n {\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n this.radius = radius;\n this.type = SHAPES.RREC;\n }\n\n /**\n * Creates a clone of this Rounded Rectangle.\n * @returns - A copy of the rounded rectangle.\n */\n clone(): RoundedRectangle\n {\n return new RoundedRectangle(this.x, this.y, this.width, this.height, this.radius);\n }\n\n /**\n * Checks whether the x and y coordinates given are contained within this Rounded Rectangle\n * @param x - The X coordinate of the point to test.\n * @param y - The Y coordinate of the point to test.\n * @returns - Whether the x/y coordinates are within this Rounded Rectangle.\n */\n contains(x: number, y: number): boolean\n {\n if (this.width <= 0 || this.height <= 0)\n {\n return false;\n }\n if (x >= this.x && x <= this.x + this.width)\n {\n if (y >= this.y && y <= this.y + this.height)\n {\n const radius = Math.max(0, Math.min(this.radius, Math.min(this.width, this.height) / 2));\n\n if ((y >= this.y + radius && y <= this.y + this.height - radius)\n || (x >= this.x + radius && x <= this.x + this.width - radius))\n {\n return true;\n }\n let dx = x - (this.x + radius);\n let dy = y - (this.y + radius);\n const radius2 = radius * radius;\n\n if ((dx * dx) + (dy * dy) <= radius2)\n {\n return true;\n }\n dx = x - (this.x + this.width - radius);\n if ((dx * dx) + (dy * dy) <= radius2)\n {\n return true;\n }\n dy = y - (this.y + this.height - radius);\n if ((dx * dx) + (dy * dy) <= radius2)\n {\n return true;\n }\n dx = x - (this.x + radius);\n if ((dx * dx) + (dy * dy) <= radius2)\n {\n return true;\n }\n }\n }\n\n return false;\n }\n\n // #if _DEBUG\n toString(): string\n {\n return `[@pixi/math:RoundedRectangle x=${this.x} y=${this.y}`\n + `width=${this.width} height=${this.height} radius=${this.radius}]`;\n }\n // #endif\n}\n","import type { IPointData } from './IPointData';\nimport type { IPoint } from './IPoint';\n\nexport interface ObservablePoint extends GlobalMixins.Point, IPoint {}\n\n/**\n * The ObservablePoint object represents a location in a two-dimensional coordinate system, where `x` represents\n * the position on the horizontal axis and `y` represents the position on the vertical axis.\n *\n * An `ObservablePoint` is a point that triggers a callback when the point's position is changed.\n * @memberof PIXI\n */\nexport class ObservablePoint<T = any> implements IPoint\n{\n /** The callback function triggered when `x` and/or `y` are changed */\n public cb: (this: T) => any;\n\n /** The owner of the callback */\n public scope: any;\n\n _x: number;\n _y: number;\n\n /**\n * Creates a new `ObservablePoint`\n * @param cb - callback function triggered when `x` and/or `y` are changed\n * @param scope - owner of callback\n * @param {number} [x=0] - position of the point on the x axis\n * @param {number} [y=0] - position of the point on the y axis\n */\n constructor(cb: (this: T) => any, scope: T, x = 0, y = 0)\n {\n this._x = x;\n this._y = y;\n\n this.cb = cb;\n this.scope = scope;\n }\n\n /**\n * Creates a clone of this point.\n * The callback and scope params can be overridden otherwise they will default\n * to the clone object's values.\n * @override\n * @param cb - The callback function triggered when `x` and/or `y` are changed\n * @param scope - The owner of the callback\n * @returns a copy of this observable point\n */\n clone(cb = this.cb, scope = this.scope): ObservablePoint\n {\n return new ObservablePoint(cb, scope, this._x, this._y);\n }\n\n /**\n * Sets the point to a new `x` and `y` position.\n * If `y` is omitted, both `x` and `y` will be set to `x`.\n * @param {number} [x=0] - position of the point on the x axis\n * @param {number} [y=x] - position of the point on the y axis\n * @returns The observable point instance itself\n */\n set(x = 0, y = x): this\n {\n if (this._x !== x || this._y !== y)\n {\n this._x = x;\n this._y = y;\n this.cb.call(this.scope);\n }\n\n return this;\n }\n\n /**\n * Copies x and y from the given point (`p`)\n * @param p - The point to copy from. Can be any of type that is or extends `IPointData`\n * @returns The observable point instance itself\n */\n copyFrom(p: IPointData): this\n {\n if (this._x !== p.x || this._y !== p.y)\n {\n this._x = p.x;\n this._y = p.y;\n this.cb.call(this.scope);\n }\n\n return this;\n }\n\n /**\n * Copies this point's x and y into that of the given point (`p`)\n * @param p - The point to copy to. Can be any of type that is or extends `IPointData`\n * @returns The point (`p`) with values updated\n */\n copyTo<T extends IPoint>(p: T): T\n {\n p.set(this._x, this._y);\n\n return p;\n }\n\n /**\n * Accepts another point (`p`) and returns `true` if the given point is equal to this point\n * @param p - The point to check\n * @returns Returns `true` if both `x` and `y` are equal\n */\n equals(p: IPointData): boolean\n {\n return (p.x === this._x) && (p.y === this._y);\n }\n\n // #if _DEBUG\n toString(): string\n {\n return `[@pixi/math:ObservablePoint x=${0} y=${0} scope=${this.scope}]`;\n }\n // #endif\n\n /** Position of the observable point on the x axis. */\n get x(): number\n {\n return this._x;\n }\n\n set x(value: number)\n {\n if (this._x !== value)\n {\n this._x = value;\n this.cb.call(this.scope);\n }\n }\n\n /** Position of the observable point on the y axis. */\n get y(): number\n {\n return this._y;\n }\n\n set y(value: number)\n {\n if (this._y !== value)\n {\n this._y = value;\n this.cb.call(this.scope);\n }\n }\n}\n","import { Point } from './Point';\nimport { PI_2 } from './const';\n\nimport type { Transform } from './Transform';\nimport type { IPointData } from './IPointData';\n\n/**\n * The PixiJS Matrix as a class makes it a lot faster.\n *\n * Here is a representation of it:\n * ```js\n * | a | c | tx|\n * | b | d | ty|\n * | 0 | 0 | 1 |\n * ```\n * @memberof PIXI\n */\nexport class Matrix\n{\n /** @default 1 */\n public a: number;\n\n /** @default 0 */\n public b: number;\n\n /** @default 0 */\n public c: number;\n\n /** @default 1 */\n public d: number;\n\n /** @default 0 */\n public tx: number;\n\n /** @default 0 */\n public ty: number;\n\n public array: Float32Array | null = null;\n\n /**\n * @param a - x scale\n * @param b - y skew\n * @param c - x skew\n * @param d - y scale\n * @param tx - x translation\n * @param ty - y translation\n */\n constructor(a = 1, b = 0, c = 0, d = 1, tx = 0, ty = 0)\n {\n this.a = a;\n this.b = b;\n this.c = c;\n this.d = d;\n this.tx = tx;\n this.ty = ty;\n }\n\n /**\n * Creates a Matrix object based on the given array. The Element to Matrix mapping order is as follows:\n *\n * a = array[0]\n * b = array[1]\n * c = array[3]\n * d = array[4]\n * tx = array[2]\n * ty = array[5]\n * @param array - The array that the matrix will be populated from.\n */\n fromArray(array: number[]): void\n {\n this.a = array[0];\n this.b = array[1];\n this.c = array[3];\n this.d = array[4];\n this.tx = array[2];\n this.ty = array[5];\n }\n\n /**\n * Sets the matrix properties.\n * @param a - Matrix component\n * @param b - Matrix component\n * @param c - Matrix component\n * @param d - Matrix component\n * @param tx - Matrix component\n * @param ty - Matrix component\n * @returns This matrix. Good for chaining method calls.\n */\n set(a: number, b: number, c: number, d: number, tx: number, ty: number): this\n {\n this.a = a;\n this.b = b;\n this.c = c;\n this.d = d;\n this.tx = tx;\n this.ty = ty;\n\n return this;\n }\n\n /**\n * Creates an array from the current Matrix object.\n * @param transpose - Whether we need to transpose the matrix or not\n * @param [out=new Float32Array(9)] - If provided the array will be assigned to out\n * @returns The newly created array which contains the matrix\n */\n toArray(transpose: boolean, out?: Float32Array): Float32Array\n {\n if (!this.array)\n {\n this.array = new Float32Array(9);\n }\n\n const array = out || this.array;\n\n if (transpose)\n {\n array[0] = this.a;\n array[1] = this.b;\n array[2] = 0;\n array[3] = this.c;\n array[4] = this.d;\n array[5] = 0;\n array[6] = this.tx;\n array[7] = this.ty;\n array[8] = 1;\n }\n else\n {\n array[0] = this.a;\n array[1] = this.c;\n array[2] = this.tx;\n array[3] = this.b;\n array[4] = this.d;\n array[5] = this.ty;\n array[6] = 0;\n array[7] = 0;\n array[8] = 1;\n }\n\n return array;\n }\n\n /**\n * Get a new position with the current transformation applied.\n * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering)\n * @param pos - The origin\n * @param {PIXI.Point} [newPos] - The point that the new position is assigned to (allowed to be same as input)\n * @returns {PIXI.Point} The new point, transformed through this matrix\n */\n apply<P extends IPointData = Point>(pos: IPointData, newPos?: P): P\n {\n newPos = (newPos || new Point()) as P;\n\n const x = pos.x;\n const y = pos.y;\n\n newPos.x = (this.a * x) + (this.c * y) + this.tx;\n newPos.y = (this.b * x) + (this.d * y) + this.ty;\n\n return newPos;\n }\n\n /**\n * Get a new position with the inverse of the current transformation applied.\n * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input)\n * @param pos - The origin\n * @param {PIXI.Point} [newPos] - The point that the new position is assigned to (allowed to be same as input)\n * @returns {PIXI.Point} The new point, inverse-transformed through this matrix\n */\n applyInverse<P extends IPointData = Point>(pos: IPointData, newPos?: P): P\n {\n newPos = (newPos || new Point()) as P;\n\n const id = 1 / ((this.a * this.d) + (this.c * -this.b));\n\n const x = pos.x;\n const y = pos.y;\n\n newPos.x = (this.d * id * x) + (-this.c * id * y) + (((this.ty * this.c) - (this.tx * this.d)) * id);\n newPos.y = (this.a * id * y) + (-this.b * id * x) + (((-this.ty * this.a) + (this.tx * this.b)) * id);\n\n return newPos;\n }\n\n /**\n * Translates the matrix on the x and y.\n * @param x - How much to translate x by\n * @param y - How much to translate y by\n * @returns This matrix. Good for chaining method calls.\n */\n translate(x: number, y: number): this\n {\n this.tx += x;\n this.ty += y;\n\n return this;\n }\n\n /**\n * Applies a scale transformation to the matrix.\n * @param x - The amount to scale horizontally\n * @param y - The amount to scale vertically\n * @returns This matrix. Good for chaining method calls.\n */\n scale(x: number, y: number): this\n {\n this.a *= x;\n this.d *= y;\n this.c *= x;\n this.b *= y;\n this.tx *= x;\n this.ty *= y;\n\n return this;\n }\n\n /**\n * Applies a rotation transformation to the matrix.\n * @param angle - The angle in radians.\n * @returns This matrix. Good for chaining method calls.\n */\n rotate(angle: number): this\n {\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n\n const a1 = this.a;\n const c1 = this.c;\n const tx1 = this.tx;\n\n this.a = (a1 * cos) - (this.b * sin);\n this.b = (a1 * sin) + (this.b * cos);\n this.c = (c1 * cos) - (this.d * sin);\n this.d = (c1 * sin) + (this.d * cos);\n this.tx = (tx1 * cos) - (this.ty * sin);\n this.ty = (tx1 * sin) + (this.ty * cos);\n\n return this;\n }\n\n /**\n * Appends the given Matrix to this Matrix.\n * @param matrix - The matrix to append.\n * @returns This matrix. Good for chaining method calls.\n */\n append(matrix: Matrix): this\n {\n const a1 = this.a;\n const b1 = this.b;\n const c1 = this.c;\n const d1 = this.d;\n\n this.a = (matrix.a * a1) + (matrix.b * c1);\n this.b = (matrix.a * b1) + (matrix.b * d1);\n this.c = (matrix.c * a1) + (matrix.d * c1);\n this.d = (matrix.c * b1) + (matrix.d * d1);\n\n this.tx = (matrix.tx * a1) + (matrix.ty * c1) + this.tx;\n this.ty = (matrix.tx * b1) + (matrix.ty * d1) + this.ty;\n\n return this;\n }\n\n /**\n * Sets the matrix based on all the available properties\n * @param x - Position on the x axis\n * @param y - Position on the y axis\n * @param pivotX - Pivot on the x axis\n * @param pivotY - Pivot on the y axis\n * @param scaleX - Scale on the x axis\n * @param scaleY - Scale on the y axis\n * @param rotation - Rotation in radians\n * @param skewX - Skew on the x axis\n * @param skewY - Skew on the y axis\n * @returns This matrix. Good for chaining method calls.\n */\n setTransform(x: number, y: number, pivotX: number, pivotY: number, scaleX: number,\n scaleY: number, rotation: number, skewX: number, skewY: number): this\n {\n this.a = Math.cos(rotation + skewY) * scaleX;\n this.b = Math.sin(rotation + skewY) * scaleX;\n this.c = -Math.sin(rotation - skewX) * scaleY;\n this.d = Math.cos(rotation - skewX) * scaleY;\n\n this.tx = x - ((pivotX * this.a) + (pivotY * this.c));\n this.ty = y - ((pivotX * this.b) + (pivotY * this.d));\n\n return this;\n }\n\n /**\n * Prepends the given Matrix to this Matrix.\n * @param matrix - The matrix to prepend\n * @returns This matrix. Good for chaining method calls.\n */\n prepend(matrix: Matrix): this\n {\n const tx1 = this.tx;\n\n if (matrix.a !== 1 || matrix.b !== 0 || matrix.c !== 0 || matrix.d !== 1)\n {\n const a1 = this.a;\n const c1 = this.c;\n\n this.a = (a1 * matrix.a) + (this.b * matrix.c);\n this.b = (a1 * matrix.b) + (this.b * matrix.d);\n this.c = (c1 * matrix.a) + (this.d * matrix.c);\n this.d = (c1 * matrix.b) + (this.d * matrix.d);\n }\n\n this.tx = (tx1 * matrix.a) + (this.ty * matrix.c) + matrix.tx;\n this.ty = (tx1 * matrix.b) + (this.ty * matrix.d) + matrix.ty;\n\n return this;\n }\n\n /**\n * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform.\n * @param transform - The transform to apply the properties to.\n * @returns The transform with the newly applied properties\n */\n decompose(transform: Transform): Transform\n {\n // sort out rotation / skew..\n const a = this.a;\n const b = this.b;\n const c = this.c;\n const d = this.d;\n const pivot = transform.pivot;\n\n const skewX = -Math.atan2(-c, d);\n const skewY = Math.atan2(b, a);\n\n const delta = Math.abs(skewX + skewY);\n\n if (delta < 0.00001 || Math.abs(PI_2 - delta) < 0.00001)\n {\n transform.rotation = skewY;\n transform.skew.x = transform.skew.y = 0;\n }\n else\n {\n transform.rotation = 0;\n transform.skew.x = skewX;\n transform.skew.y = skewY;\n }\n\n // next set scale\n transform.scale.x = Math.sqrt((a * a) + (b * b));\n transform.scale.y = Math.sqrt((c * c) + (d * d));\n\n // next set position\n transform.position.x = this.tx + ((pivot.x * a) + (pivot.y * c));\n transform.position.y = this.ty + ((pivot.x * b) + (pivot.y * d));\n\n return transform;\n }\n\n /**\n * Inverts this matrix\n * @returns This matrix. Good for chaining method calls.\n */\n invert(): this\n {\n const a1 = this.a;\n const b1 = this.b;\n const c1 = this.c;\n const d1 = this.d;\n const tx1 = this.tx;\n const n = (a1 * d1) - (b1 * c1);\n\n this.a = d1 / n;\n this.b = -b1 / n;\n this.c = -c1 / n;\n this.d = a1 / n;\n this.tx = ((c1 * this.ty) - (d1 * tx1)) / n;\n this.ty = -((a1 * this.ty) - (b1 * tx1)) / n;\n\n return this;\n }\n\n /**\n * Resets this Matrix to an identity (default) matrix.\n * @returns This matrix. Good for chaining method calls.\n */\n identity(): this\n {\n this.a = 1;\n this.b = 0;\n this.c = 0;\n this.d = 1;\n this.tx = 0;\n this.ty = 0;\n\n return this;\n }\n\n /**\n * Creates a new Matrix object with the same values as this one.\n * @returns A copy of this matrix. Good for chaining method calls.\n */\n clone(): Matrix\n {\n const matrix = new Matrix();\n\n matrix.a = this.a;\n matrix.b = this.b;\n matrix.c = this.c;\n matrix.d = this.d;\n matrix.tx = this.tx;\n matrix.ty = this.ty;\n\n return matrix;\n }\n\n /**\n * Changes the values of the given matrix to be the same as the ones in this matrix\n * @param matrix - The matrix to copy to.\n * @returns The matrix given in parameter with its values updated.\n */\n copyTo(matrix: Matrix): Matrix\n {\n matrix.a = this.a;\n matrix.b = this.b;\n matrix.c = this.c;\n matrix.d = this.d;\n matrix.tx = this.tx;\n matrix.ty = this.ty;\n\n return matrix;\n }\n\n /**\n * Changes the values of the matrix to be the same as the ones in given matrix\n * @param {PIXI.Matrix} matrix - The matrix to copy from.\n * @returns {PIXI.Matrix} this\n */\n copyFrom(matrix: Matrix): this\n {\n this.a = matrix.a;\n this.b = matrix.b;\n this.c = matrix.c;\n this.d = matrix.d;\n this.tx = matrix.tx;\n this.ty = matrix.ty;\n\n return this;\n }\n\n // #if _DEBUG\n toString(): string\n {\n return `[@pixi/math:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`;\n }\n // #endif\n\n /**\n * A default (identity) matrix\n * @readonly\n */\n static get IDENTITY(): Matrix\n {\n return new Matrix();\n }\n\n /**\n * A temp matrix\n * @readonly\n */\n static get TEMP_MATRIX(): Matrix\n {\n return new Matrix();\n }\n}\n","// Your friendly neighbour https://en.wikipedia.org/wiki/Dihedral_group\n//\n// This file implements the dihedral group of order 16, also called\n// of degree 8. That's why its called groupD8.\n\nimport { Matrix } from './Matrix';\n\n/*\n * Transform matrix for operation n is:\n * | ux | vx |\n * | uy | vy |\n */\n\nconst ux = [1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1, 0, 1];\nconst uy = [0, 1, 1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1];\nconst vx = [0, -1, -1, -1, 0, 1, 1, 1, 0, 1, 1, 1, 0, -1, -1, -1];\nconst vy = [1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, 1, 1, 1, 0, -1];\n\n/**\n * [Cayley Table]{@link https://en.wikipedia.org/wiki/Cayley_table}\n * for the composition of each rotation in the dihederal group D8.\n * @type {number[][]}\n * @private\n */\nconst rotationCayley: number[][] = [];\n\n/**\n * Matrices for each `GD8Symmetry` rotation.\n * @type {PIXI.Matrix[]}\n * @private\n */\nconst rotationMatrices: Matrix[] = [];\n\n/*\n * Alias for {@code Math.sign}.\n */\nconst signum = Math.sign;\n\n/*\n * Initializes `rotationCayley` and `rotationMatrices`. It is called\n * only once below.\n */\nfunction init(): void\n{\n for (let i = 0; i < 16; i++)\n {\n const row: number[] = [];\n\n rotationCayley.push(row);\n\n for (let j = 0; j < 16; j++)\n {\n /* Multiplies rotation matrices i and j. */\n const _ux = signum((ux[i] * ux[j]) + (vx[i] * uy[j]));\n const _uy = signum((uy[i] * ux[j]) + (vy[i] * uy[j]));\n const _vx = signum((ux[i] * vx[j]) + (vx[i] * vy[j]));\n const _vy = signum((uy[i] * vx[j]) + (vy[i] * vy[j]));\n\n /* Finds rotation matrix matching the product and pushes it. */\n for (let k = 0; k < 16; k++)\n {\n if (ux[k] === _ux && uy[k] === _uy\n && vx[k] === _vx && vy[k] === _vy)\n {\n row.push(k);\n break;\n }\n }\n }\n }\n\n for (let i = 0; i < 16; i++)\n {\n const mat = new Matrix();\n\n mat.set(ux[i], uy[i], vx[i], vy[i], 0, 0);\n rotationMatrices.push(mat);\n }\n}\n\ninit();\n\ntype GD8Symmetry = number;\n/**\n * @memberof PIXI\n * @typedef {number} GD8Symmetry\n * @see PIXI.groupD8\n */\n\n/**\n * Implements the dihedral group D8, which is similar to\n * [group D4]{@link http://mathworld.wolfram.com/DihedralGroupD4.html};\n * D8 is the same but with diagonals, and it is used for texture\n * rotations.\n *\n * The directions the U- and V- axes after rotation\n * of an angle of `a: GD8Constant` are the vectors `(uX(a), uY(a))`\n * and `(vX(a), vY(a))`. These aren't necessarily unit vectors.\n *\n * **Origin:**<br>\n * This is the small part of gameofbombs.com portal system. It works.\n * @see PIXI.groupD8.E\n * @see PIXI.groupD8.SE\n * @see PIXI.groupD8.S\n * @see PIXI.groupD8.SW\n * @see PIXI.groupD8.W\n * @see PIXI.groupD8.NW\n * @see PIXI.groupD8.N\n * @see PIXI.groupD8.NE\n * @author Ivan @ivanpopelyshev\n * @namespace PIXI.groupD8\n * @memberof PIXI\n */\nexport const groupD8 = {\n /**\n * | Rotation | Direction |\n * |----------|-----------|\n * | 0° | East |\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n E: 0,\n\n /**\n * | Rotation | Direction |\n * |----------|-----------|\n * | 45°↻ | Southeast |\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n SE: 1,\n\n /**\n * | Rotation | Direction |\n * |----------|-----------|\n * | 90°↻ | South |\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n S: 2,\n\n /**\n * | Rotation | Direction |\n * |----------|-----------|\n * | 135°↻ | Southwest |\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n SW: 3,\n\n /**\n * | Rotation | Direction |\n * |----------|-----------|\n * | 180° | West |\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n W: 4,\n\n /**\n * | Rotation | Direction |\n * |-------------|--------------|\n * | -135°/225°↻ | Northwest |\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n NW: 5,\n\n /**\n * | Rotation | Direction |\n * |-------------|--------------|\n * | -90°/270°↻ | North |\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n N: 6,\n\n /**\n * | Rotation | Direction |\n * |-------------|--------------|\n * | -45°/315°↻ | Northeast |\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n NE: 7,\n\n /**\n * Reflection about Y-axis.\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n MIRROR_VERTICAL: 8,\n\n /**\n * Reflection about the main diagonal.\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n MAIN_DIAGONAL: 10,\n\n /**\n * Reflection about X-axis.\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n MIRROR_HORIZONTAL: 12,\n\n /**\n * Reflection about reverse diagonal.\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n REVERSE_DIAGONAL: 14,\n\n /**\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} ind - sprite rotation angle.\n * @returns {PIXI.GD8Symmetry} The X-component of the U-axis\n * after rotating the axes.\n */\n uX: (ind: GD8Symmetry): GD8Symmetry => ux[ind],\n\n /**\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} ind - sprite rotation angle.\n * @returns {PIXI.GD8Symmetry} The Y-component of the U-axis\n * after rotating the axes.\n */\n uY: (ind: GD8Symmetry): GD8Symmetry => uy[ind],\n\n /**\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} ind - sprite rotation angle.\n * @returns {PIXI.GD8Symmetry} The X-component of the V-axis\n * after rotating the axes.\n */\n vX: (ind: GD8Symmetry): GD8Symmetry => vx[ind],\n\n /**\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} ind - sprite rotation angle.\n * @returns {PIXI.GD8Symmetry} The Y-component of the V-axis\n * after rotating the axes.\n */\n vY: (ind: GD8Symmetry): GD8Symmetry => vy[ind],\n\n /**\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} rotation - symmetry whose opposite\n * is needed. Only rotations have opposite symmetries while\n * reflections don't.\n * @returns {PIXI.GD8Symmetry} The opposite symmetry of `rotation`\n */\n inv: (rotation: GD8Symmetry): GD8Symmetry =>\n {\n if (rotation & 8)// true only if between 8 & 15 (reflections)\n {\n return rotation & 15;// or rotation % 16\n }\n\n return (-rotation) & 7;// or (8 - rotation) % 8\n },\n\n /**\n * Composes the two D8 operations.\n *\n * Taking `^` as reflection:\n *\n * | | E=0 | S=2 | W=4 | N=6 | E^=8 | S^=10 | W^=12 | N^=14 |\n * |-------|-----|-----|-----|-----|------|-------|-------|-------|\n * | E=0 | E | S | W | N | E^ | S^ | W^ | N^ |\n * | S=2 | S | W | N | E | S^ | W^ | N^ | E^ |\n * | W=4 | W | N | E | S | W^ | N^ | E^ | S^ |\n * | N=6 | N | E | S | W | N^ | E^ | S^ | W^ |\n * | E^=8 | E^ | N^ | W^ | S^ | E | N | W | S |\n * | S^=10 | S^ | E^ | N^ | W^ | S | E | N | W |\n * | W^=12 | W^ | S^ | E^ | N^ | W | S | E | N |\n * | N^=14 | N^ | W^ | S^ | E^ | N | W | S | E |\n *\n * [This is a Cayley table]{@link https://en.wikipedia.org/wiki/Cayley_table}\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} rotationSecond - Second operation, which\n * is the row in the above cayley table.\n * @param {PIXI.GD8Symmetry} rotationFirst - First operation, which\n * is the column in the above cayley table.\n * @returns {PIXI.GD8Symmetry} Composed operation\n */\n add: (rotationSecond: GD8Symmetry, rotationFirst: GD8Symmetry): GD8Symmetry => (\n rotationCayley[rotationSecond][rotationFirst]\n ),\n\n /**\n * Reverse of `add`.\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} rotationSecond - Second operation\n * @param {PIXI.GD8Symmetry} rotationFirst - First operation\n * @returns {PIXI.GD8Symmetry} Result\n */\n sub: (rotationSecond: GD8Symmetry, rotationFirst: GD8Symmetry): GD8Symmetry => (\n rotationCayley[rotationSecond][groupD8.inv(rotationFirst)]\n ),\n\n /**\n * Adds 180 degrees to rotation, which is a commutative\n * operation.\n * @memberof PIXI.groupD8\n * @param {number} rotation - The number to rotate.\n * @returns {number} Rotated number\n */\n rotate180: (rotation: number): number => rotation ^ 4,\n\n /**\n * Checks if the rotation angle is vertical, i.e. south\n * or north. It doesn't work for reflections.\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} rotation - The number to check.\n * @returns {boolean} Whether or not the direction is vertical\n */\n isVertical: (rotation: GD8Symmetry): boolean => (rotation & 3) === 2, // rotation % 4 === 2\n\n /**\n * Approximates the vector `V(dx,dy)` into one of the\n * eight directions provided by `groupD8`.\n * @memberof PIXI.groupD8\n * @param {number} dx - X-component of the vector\n * @param {number} dy - Y-component of the vector\n * @returns {PIXI.GD8Symmetry} Approximation of the vector into\n * one of the eight symmetries.\n */\n byDirection: (dx: number, dy: number): GD8Symmetry =>\n {\n if (Math.abs(dx) * 2 <= Math.abs(dy))\n {\n if (dy >= 0)\n {\n return groupD8.S;\n }\n\n return groupD8.N;\n }\n else if (Math.abs(dy) * 2 <= Math.abs(dx))\n {\n if (dx > 0)\n {\n return groupD8.E;\n }\n\n return groupD8.W;\n }\n else if (dy > 0)\n {\n if (dx > 0)\n {\n return groupD8.SE;\n }\n\n return groupD8.SW;\n }\n else if (dx > 0)\n {\n return groupD8.NE;\n }\n\n return groupD8.NW;\n },\n\n /**\n * Helps sprite to compensate texture packer rotation.\n * @memberof PIXI.groupD8\n * @param {PIXI.Matrix} matrix - sprite world matrix\n * @param {PIXI.GD8Symmetry} rotation - The rotation factor to use.\n * @param {number} tx - sprite anchoring\n * @param {number} ty - sprite anchoring\n */\n matrixAppendRotationInv: (matrix: Matrix, rotation: GD8Symmetry, tx = 0, ty = 0): void =>\n {\n // Packer used \"rotation\", we use \"inv(rotation)\"\n const mat: Matrix = rotationMatrices[groupD8.inv(rotation)];\n\n mat.tx = tx;\n mat.ty = ty;\n matrix.append(mat);\n },\n};\n","import { ObservablePoint } from './ObservablePoint';\nimport { Matrix } from './Matrix';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface Transform extends GlobalMixins.Transform {}\n\n/**\n * Transform that takes care about its versions.\n * @memberof PIXI\n */\nexport class Transform\n{\n /** A default (identity) transform. */\n public static readonly IDENTITY = new Transform();\n\n /** The world transformation matrix. */\n public worldTransform: Matrix;\n\n /** The local transformation matrix. */\n public localTransform: Matrix;\n\n /** The coordinate of the object relative to the local coordinates of the parent. */\n public position: ObservablePoint;\n\n /** The scale factor of the object. */\n public scale: ObservablePoint;\n\n /** The pivot point of the displayObject that it rotates around. */\n public pivot: ObservablePoint;\n\n /** The skew amount, on the x and y axis. */\n public skew: ObservablePoint;\n\n /** The locally unique ID of the parent's world transform used to calculate the current world transformation matrix. */\n public _parentID: number;\n\n /** The locally unique ID of the world transform. */\n _worldID: number;\n\n /** The rotation amount. */\n protected _rotation: number;\n\n /**\n * The X-coordinate value of the normalized local X axis,\n * the first column of the local transformation matrix without a scale.\n */\n protected _cx: number;\n\n /**\n * The Y-coordinate value of the normalized local X axis,\n * the first column of the local transformation matrix without a scale.\n */\n protected _sx: number;\n\n /**\n * The X-coordinate value of the normalized local Y axis,\n * the second column of the local transformation matrix without a scale.\n */\n protected _cy: number;\n\n /**\n * The Y-coordinate value of the normalized local Y axis,\n * the second column of the local transformation matrix without a scale.\n */\n protected _sy: number;\n\n /** The locally unique ID of the local transform. */\n protected _localID: number;\n\n /** The locally unique ID of the local transform used to calculate the current local transformation matrix. */\n protected _currentLocalID: number;\n\n constructor()\n {\n this.worldTransform = new Matrix();\n this.localTransform = new Matrix();\n this.position = new ObservablePoint(this.onChange, this, 0, 0);\n this.scale = new ObservablePoint(this.onChange, this, 1, 1);\n this.pivot = new ObservablePoint(this.onChange, this, 0, 0);\n this.skew = new ObservablePoint(this.updateSkew, this, 0, 0);\n\n this._rotation = 0;\n this._cx = 1;\n this._sx = 0;\n this._cy = 0;\n this._sy = 1;\n this._localID = 0;\n this._currentLocalID = 0;\n\n this._worldID = 0;\n this._parentID = 0;\n }\n\n /** Called when a value changes. */\n protected onChange(): void\n {\n this._localID++;\n }\n\n /** Called when the skew or the rotation changes. */\n protected updateSkew(): void\n {\n this._cx = Math.cos(this._rotation + this.skew.y);\n this._sx = Math.sin(this._rotation + this.skew.y);\n this._cy = -Math.sin(this._rotation - this.skew.x); // cos, added PI/2\n this._sy = Math.cos(this._rotation - this.skew.x); // sin, added PI/2\n\n this._localID++;\n }\n\n // #if _DEBUG\n toString(): string\n {\n return `[@pixi/math:Transform `\n + `position=(${this.position.x}, ${this.position.y}) `\n + `rotation=${this.rotation} `\n + `scale=(${this.scale.x}, ${this.scale.y}) `\n + `skew=(${this.skew.x}, ${this.skew.y}) `\n + `]`;\n }\n // #endif\n\n /** Updates the local transformation matrix. */\n updateLocalTransform(): void\n {\n const lt = this.localTransform;\n\n if (this._localID !== this._currentLocalID)\n {\n // get the matrix values of the displayobject based on its transform properties..\n lt.a = this._cx * this.scale.x;\n lt.b = this._sx * this.scale.x;\n lt.c = this._cy * this.scale.y;\n lt.d = this._sy * this.scale.y;\n\n lt.tx = this.position.x - ((this.pivot.x * lt.a) + (this.pivot.y * lt.c));\n lt.ty = this.position.y - ((this.pivot.x * lt.b) + (this.pivot.y * lt.d));\n this._currentLocalID = this._localID;\n\n // force an update..\n this._parentID = -1;\n }\n }\n\n /**\n * Updates the local and the world transformation matrices.\n * @param parentTransform - The parent transform\n */\n updateTransform(parentTransform: Transform): void\n {\n const lt = this.localTransform;\n\n if (this._localID !== this._currentLocalID)\n {\n // get the matrix values of the displayobject based on its transform properties..\n lt.a = this._cx * this.scale.x;\n lt.b = this._sx * this.scale.x;\n lt.c = this._cy * this.scale.y;\n lt.d = this._sy * this.scale.y;\n\n lt.tx = this.position.x - ((this.pivot.x * lt.a) + (this.pivot.y * lt.c));\n lt.ty = this.position.y - ((this.pivot.x * lt.b) + (this.pivot.y * lt.d));\n this._currentLocalID = this._localID;\n\n // force an update..\n this._parentID = -1;\n }\n\n if (this._parentID !== parentTransform._worldID)\n {\n // concat the parent matrix with the objects transform.\n const pt = parentTransform.worldTransform;\n const wt = this.worldTransform;\n\n wt.a = (lt.a * pt.a) + (lt.b * pt.c);\n wt.b = (lt.a * pt.b) + (lt.b * pt.d);\n wt.c = (lt.c * pt.a) + (lt.d * pt.c);\n wt.d = (lt.c * pt.b) + (lt.d * pt.d);\n wt.tx = (lt.tx * pt.a) + (lt.ty * pt.c) + pt.tx;\n wt.ty = (lt.tx * pt.b) + (lt.ty * pt.d) + pt.ty;\n\n this._parentID = parentTransform._worldID;\n\n // update the id of the transform..\n this._worldID++;\n }\n }\n\n /**\n * Decomposes a matrix and sets the transforms properties based on it.\n * @param matrix - The matrix to decompose\n */\n setFromMatrix(matrix: Matrix): void\n {\n matrix.decompose(this);\n this._localID++;\n }\n\n /** The rotation of the object in radians. */\n get rotation(): number\n {\n return this._rotation;\n }\n\n set rotation(value: number)\n {\n if (this._rotation !== value)\n {\n this._rotation = value;\n this.updateSkew();\n }\n }\n}\n","export type ContextIds = '2d' | 'webgl' | 'experimental-webgl' | 'webgl2';\n\n/**\n * This interface describes all the DOM dependent calls that Pixi makes throughout its codebase\n * Implementations of this interface can be used to make sure Pixi will work in any environment\n * such as browser, web workers, and node\n */\nexport interface IAdapter\n{\n /** Returns a canvas object that can be used to create a webgl context. */\n createCanvas: (width?: number, height?: number) => HTMLCanvasElement;\n /** Returns a webgl rendering context. */\n getWebGLRenderingContext: () => typeof WebGLRenderingContext;\n /** Returns a partial implementation of the browsers window.navigator */\n getNavigator: () => { userAgent: string };\n /** Returns the current base URL For browser environments this is either the document.baseURI or window.location.href */\n getBaseUrl: () => string;\n fetch: (url: RequestInfo, options?: RequestInit) => Promise<Response>;\n}\n\nexport const BrowserAdapter = {\n /**\n * Creates a canvas element of the given size.\n * This canvas is created using the browser's native canvas element.\n * @param width - width of the canvas\n * @param height - height of the canvas\n */\n createCanvas: (width: number, height: number): HTMLCanvasElement =>\n {\n const canvas = document.createElement('canvas');\n\n canvas.width = width;\n canvas.height = height;\n\n return canvas;\n },\n getWebGLRenderingContext: () => WebGLRenderingContext,\n getNavigator: () => navigator,\n getBaseUrl: () => document.baseURI ?? window.location.href,\n fetch: (url: RequestInfo, options?: RequestInit) => fetch(url, options),\n} as IAdapter;\n","var appleIphone = /iPhone/i;\nvar appleIpod = /iPod/i;\nvar appleTablet = /iPad/i;\nvar appleUniversal = /\\biOS-universal(?:.+)Mac\\b/i;\nvar androidPhone = /\\bAndroid(?:.+)Mobile\\b/i;\nvar androidTablet = /Android/i;\nvar amazonPhone = /(?:SD4930UR|\\bSilk(?:.+)Mobile\\b)/i;\nvar amazonTablet = /Silk/i;\nvar windowsPhone = /Windows Phone/i;\nvar windowsTablet = /\\bWindows(?:.+)ARM\\b/i;\nvar otherBlackBerry = /BlackBerry/i;\nvar otherBlackBerry10 = /BB10/i;\nvar otherOpera = /Opera Mini/i;\nvar otherChrome = /\\b(CriOS|Chrome)(?:.+)Mobile/i;\nvar otherFirefox = /Mobile(?:.+)Firefox\\b/i;\nvar isAppleTabletOnIos13 = function (navigator) {\n return (typeof navigator !== 'undefined' &&\n navigator.platform === 'MacIntel' &&\n typeof navigator.maxTouchPoints === 'number' &&\n navigator.maxTouchPoints > 1 &&\n typeof MSStream === 'undefined');\n};\nfunction createMatch(userAgent) {\n return function (regex) { return regex.test(userAgent); };\n}\nexport default function isMobile(param) {\n var nav = {\n userAgent: '',\n platform: '',\n maxTouchPoints: 0\n };\n if (!param && typeof navigator !== 'undefined') {\n nav = {\n userAgent: navigator.userAgent,\n platform: navigator.platform,\n maxTouchPoints: navigator.maxTouchPoints || 0\n };\n }\n else if (typeof param === 'string') {\n nav.userAgent = param;\n }\n else if (param && param.userAgent) {\n nav = {\n userAgent: param.userAgent,\n platform: param.platform,\n maxTouchPoints: param.maxTouchPoints || 0\n };\n }\n var userAgent = nav.userAgent;\n var tmp = userAgent.split('[FBAN');\n if (typeof tmp[1] !== 'undefined') {\n userAgent = tmp[0];\n }\n tmp = userAgent.split('Twitter');\n if (typeof tmp[1] !== 'undefined') {\n userAgent = tmp[0];\n }\n var match = createMatch(userAgent);\n var result = {\n apple: {\n phone: match(appleIphone) && !match(windowsPhone),\n ipod: match(appleIpod),\n tablet: !match(appleIphone) &&\n (match(appleTablet) || isAppleTabletOnIos13(nav)) &&\n !match(windowsPhone),\n universal: match(appleUniversal),\n device: (match(appleIphone) ||\n match(appleIpod) ||\n match(appleTablet) ||\n match(appleUniversal) ||\n isAppleTabletOnIos13(nav)) &&\n !match(windowsPhone)\n },\n amazon: {\n phone: match(amazonPhone),\n tablet: !match(amazonPhone) && match(amazonTablet),\n device: match(amazonPhone) || match(amazonTablet)\n },\n android: {\n phone: (!match(windowsPhone) && match(amazonPhone)) ||\n (!match(windowsPhone) && match(androidPhone)),\n tablet: !match(windowsPhone) &&\n !match(amazonPhone) &&\n !match(androidPhone) &&\n (match(amazonTablet) || match(androidTablet)),\n device: (!match(windowsPhone) &&\n (match(amazonPhone) ||\n match(amazonTablet) ||\n match(androidPhone) ||\n match(androidTablet))) ||\n match(/\\bokhttp\\b/i)\n },\n windows: {\n phone: match(windowsPhone),\n tablet: match(windowsTablet),\n device: match(windowsPhone) || match(windowsTablet)\n },\n other: {\n blackberry: match(otherBlackBerry),\n blackberry10: match(otherBlackBerry10),\n opera: match(otherOpera),\n firefox: match(otherFirefox),\n chrome: match(otherChrome),\n device: match(otherBlackBerry) ||\n match(otherBlackBerry10) ||\n match(otherOpera) ||\n match(otherFirefox) ||\n match(otherChrome)\n },\n any: false,\n phone: false,\n tablet: false\n };\n result.any =\n result.apple.device ||\n result.android.device ||\n result.windows.device ||\n result.other.device;\n result.phone =\n result.apple.phone || result.android.phone || result.windows.phone;\n result.tablet =\n result.apple.tablet || result.android.tablet || result.windows.tablet;\n return result;\n}\n//# sourceMappingURL=isMobile.js.map","import isMobileCall from 'ismobilejs';\n\ntype isMobileResult = {\n apple: {\n phone: boolean;\n ipod: boolean;\n tablet: boolean;\n universal: boolean;\n device: boolean;\n };\n amazon: {\n phone: boolean;\n tablet: boolean;\n device: boolean;\n };\n android: {\n phone: boolean;\n tablet: boolean;\n device: boolean;\n };\n windows: {\n phone: boolean;\n tablet: boolean;\n device: boolean;\n };\n other: {\n blackberry: boolean;\n blackberry10: boolean;\n opera: boolean;\n firefox: boolean;\n chrome: boolean;\n device: boolean;\n };\n phone: boolean;\n tablet: boolean;\n any: boolean;\n};\n\nexport const isMobile: isMobileResult = isMobileCall(globalThis.navigator);\n","import type { ENV } from '@pixi/constants';\nimport { GC_MODES, MIPMAP_MODES, MSAA_QUALITY, PRECISION, SCALE_MODES, WRAP_MODES } from '@pixi/constants';\nimport type { IAdapter } from './adapter';\nimport { BrowserAdapter } from './adapter';\nimport { canUploadSameBuffer } from './utils/canUploadSameBuffer';\nimport { isMobile } from './utils/isMobile';\nimport { maxRecommendedTextures } from './utils/maxRecommendedTextures';\n\nexport interface IRenderOptions\n{\n view: HTMLCanvasElement;\n antialias: boolean;\n autoDensity: boolean;\n backgroundColor: number;\n backgroundAlpha: number;\n useContextAlpha: boolean | 'notMultiplied';\n clearBeforeRender: boolean;\n preserveDrawingBuffer: boolean;\n width: number;\n height: number;\n legacy: boolean;\n}\n\nexport interface ISettings\n{\n ADAPTER: IAdapter;\n MIPMAP_TEXTURES: MIPMAP_MODES;\n ANISOTROPIC_LEVEL: number;\n RESOLUTION: number;\n FILTER_RESOLUTION: number;\n FILTER_MULTISAMPLE: MSAA_QUALITY;\n SPRITE_MAX_TEXTURES: number;\n SPRITE_BATCH_SIZE: number;\n RENDER_OPTIONS: IRenderOptions;\n GC_MODE: GC_MODES;\n GC_MAX_IDLE: number;\n GC_MAX_CHECK_COUNT: number;\n WRAP_MODE: WRAP_MODES;\n SCALE_MODE: SCALE_MODES;\n PRECISION_VERTEX: PRECISION;\n PRECISION_FRAGMENT: PRECISION;\n CAN_UPLOAD_SAME_BUFFER: boolean;\n CREATE_IMAGE_BITMAP: boolean;\n ROUND_PIXELS: boolean;\n RETINA_PREFIX?: RegExp;\n FAIL_IF_MAJOR_PERFORMANCE_CAVEAT?: boolean;\n UPLOADS_PER_FRAME?: number;\n SORTABLE_CHILDREN?: boolean;\n PREFER_ENV?: ENV;\n STRICT_TEXTURE_CACHE?: boolean;\n MESH_CANVAS_PADDING?: number;\n TARGET_FPMS?: number;\n}\n\n/**\n * User's customizable globals for overriding the default PIXI settings, such\n * as a renderer's default resolution, framerate, float precision, etc.\n * @example\n * // Use the native window resolution as the default resolution\n * // will support high-density displays when rendering\n * PIXI.settings.RESOLUTION = window.devicePixelRatio;\n *\n * // Disable interpolation when scaling, will make texture be pixelated\n * PIXI.settings.SCALE_MODE = PIXI.SCALE_MODES.NEAREST;\n * @namespace PIXI.settings\n */\nexport const settings: ISettings = {\n\n /**\n * This adapter is used to call methods that are platform dependent.\n * For example `document.createElement` only runs on the web but fails in node environments.\n * This allows us to support more platforms by abstracting away specific implementations per platform.\n *\n * By default the adapter is set to work in the browser. However you can create your own\n * by implementing the `IAdapter` interface. See `IAdapter` for more information.\n * @name ADAPTER\n * @memberof PIXI.settings\n * @type {PIXI.IAdapter}\n * @default PIXI.BrowserAdapter\n */\n ADAPTER: BrowserAdapter,\n /**\n * If set to true WebGL will attempt make textures mimpaped by default.\n * Mipmapping will only succeed if the base texture uploaded has power of two dimensions.\n * @static\n * @name MIPMAP_TEXTURES\n * @memberof PIXI.settings\n * @type {PIXI.MIPMAP_MODES}\n * @default PIXI.MIPMAP_MODES.POW2\n */\n MIPMAP_TEXTURES: MIPMAP_MODES.POW2,\n\n /**\n * Default anisotropic filtering level of textures.\n * Usually from 0 to 16\n * @static\n * @name ANISOTROPIC_LEVEL\n * @memberof PIXI.settings\n * @type {number}\n * @default 0\n */\n ANISOTROPIC_LEVEL: 0,\n\n /**\n * Default resolution / device pixel ratio of the renderer.\n * @static\n * @name RESOLUTION\n * @memberof PIXI.settings\n * @type {number}\n * @default 1\n */\n RESOLUTION: 1,\n\n /**\n * Default filter resolution.\n * @static\n * @name FILTER_RESOLUTION\n * @memberof PIXI.settings\n * @type {number}\n * @default 1\n */\n FILTER_RESOLUTION: 1,\n\n /**\n * Default filter samples.\n * @static\n * @name FILTER_MULTISAMPLE\n * @memberof PIXI.settings\n * @type {PIXI.MSAA_QUALITY}\n * @default PIXI.MSAA_QUALITY.NONE\n */\n FILTER_MULTISAMPLE: MSAA_QUALITY.NONE,\n\n /**\n * The maximum textures that this device supports.\n * @static\n * @name SPRITE_MAX_TEXTURES\n * @memberof PIXI.settings\n * @type {number}\n * @default 32\n */\n SPRITE_MAX_TEXTURES: maxRecommendedTextures(32),\n\n // TODO: maybe change to SPRITE.BATCH_SIZE: 2000\n // TODO: maybe add PARTICLE.BATCH_SIZE: 15000\n\n /**\n * The default sprite batch size.\n *\n * The default aims to balance desktop and mobile devices.\n * @static\n * @name SPRITE_BATCH_SIZE\n * @memberof PIXI.settings\n * @type {number}\n * @default 4096\n */\n SPRITE_BATCH_SIZE: 4096,\n\n /**\n * The default render options if none are supplied to {@link PIXI.Renderer}\n * or {@link PIXI.CanvasRenderer}.\n * @static\n * @name RENDER_OPTIONS\n * @memberof PIXI.settings\n * @type {object}\n * @property {HTMLCanvasElement} [view=null] -\n * @property {boolean} [antialias=false] -\n * @property {boolean} [autoDensity=false] -\n * @property {boolean} [useContextAlpha=true] -\n * @property {number} [backgroundColor=0x000000] -\n * @property {number} [backgroundAlpha=1] -\n * @property {boolean} [clearBeforeRender=true] -\n * @property {boolean} [preserveDrawingBuffer=false] -\n * @property {number} [width=800] -\n * @property {number} [height=600] -\n * @property {boolean} [legacy=false] -\n */\n RENDER_OPTIONS: {\n view: null,\n antialias: false,\n autoDensity: false,\n backgroundColor: 0x000000,\n backgroundAlpha: 1,\n useContextAlpha: true,\n clearBeforeRender: true,\n preserveDrawingBuffer: false,\n width: 800,\n height: 600,\n legacy: false,\n },\n\n /**\n * Default Garbage Collection mode.\n * @static\n * @name GC_MODE\n * @memberof PIXI.settings\n * @type {PIXI.GC_MODES}\n * @default PIXI.GC_MODES.AUTO\n */\n GC_MODE: GC_MODES.AUTO,\n\n /**\n * Default Garbage Collection max idle.\n * @static\n * @name GC_MAX_IDLE\n * @memberof PIXI.settings\n * @type {number}\n * @default 3600\n */\n GC_MAX_IDLE: 60 * 60,\n\n /**\n * Default Garbage Collection maximum check count.\n * @static\n * @name GC_MAX_CHECK_COUNT\n * @memberof PIXI.settings\n * @type {number}\n * @default 600\n */\n GC_MAX_CHECK_COUNT: 60 * 10,\n\n /**\n * Default wrap modes that are supported by pixi.\n * @static\n * @name WRAP_MODE\n * @memberof PIXI.settings\n * @type {PIXI.WRAP_MODES}\n * @default PIXI.WRAP_MODES.CLAMP\n */\n WRAP_MODE: WRAP_MODES.CLAMP,\n\n /**\n * Default scale mode for textures.\n * @static\n * @name SCALE_MODE\n * @memberof PIXI.settings\n * @type {PIXI.SCALE_MODES}\n * @default PIXI.SCALE_MODES.LINEAR\n */\n SCALE_MODE: SCALE_MODES.LINEAR,\n\n /**\n * Default specify float precision in vertex shader.\n * @static\n * @name PRECISION_VERTEX\n * @memberof PIXI.settings\n * @type {PIXI.PRECISION}\n * @default PIXI.PRECISION.HIGH\n */\n PRECISION_VERTEX: PRECISION.HIGH,\n\n /**\n * Default specify float precision in fragment shader.\n * iOS is best set at highp due to https://github.com/pixijs/pixi.js/issues/3742\n * @static\n * @name PRECISION_FRAGMENT\n * @memberof PIXI.settings\n * @type {PIXI.PRECISION}\n * @default PIXI.PRECISION.MEDIUM\n */\n PRECISION_FRAGMENT: isMobile.apple.device ? PRECISION.HIGH : PRECISION.MEDIUM,\n\n /**\n * Can we upload the same buffer in a single frame?\n * @static\n * @name CAN_UPLOAD_SAME_BUFFER\n * @memberof PIXI.settings\n * @type {boolean}\n */\n CAN_UPLOAD_SAME_BUFFER: canUploadSameBuffer(),\n\n /**\n * Enables bitmap creation before image load. This feature is experimental.\n * @static\n * @name CREATE_IMAGE_BITMAP\n * @memberof PIXI.settings\n * @type {boolean}\n * @default false\n */\n CREATE_IMAGE_BITMAP: false,\n\n /**\n * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.\n * Advantages can include sharper image quality (like text) and faster rendering on canvas.\n * The main disadvantage is movement of objects may appear less smooth.\n * @static\n * @constant\n * @memberof PIXI.settings\n * @type {boolean}\n * @default false\n */\n ROUND_PIXELS: false,\n};\n","import { isMobile } from './isMobile';\n\n/**\n * The maximum recommended texture units to use.\n * In theory the bigger the better, and for desktop we'll use as many as we can.\n * But some mobile devices slow down if there is to many branches in the shader.\n * So in practice there seems to be a sweet spot size that varies depending on the device.\n *\n * In v4, all mobile devices were limited to 4 texture units because for this.\n * In v5, we allow all texture units to be used on modern Apple or Android devices.\n * @private\n * @param {number} max\n * @returns {number} The maximum recommended texture units to use.\n */\nexport function maxRecommendedTextures(max: number): number\n{\n let allowMax = true;\n\n if (isMobile.tablet || isMobile.phone)\n {\n if (isMobile.apple.device)\n {\n const match = (navigator.userAgent).match(/OS (\\d+)_(\\d+)?/);\n\n if (match)\n {\n const majorVersion = parseInt(match[1], 10);\n\n // Limit texture units on devices below iOS 11, which will be older hardware\n if (majorVersion < 11)\n {\n allowMax = false;\n }\n }\n }\n if (isMobile.android.device)\n {\n const match = (navigator.userAgent).match(/Android\\s([0-9.]*)/);\n\n if (match)\n {\n const majorVersion = parseInt(match[1], 10);\n\n // Limit texture units on devices below Android 7 (Nougat), which will be older hardware\n if (majorVersion < 7)\n {\n allowMax = false;\n }\n }\n }\n }\n\n return allowMax ? max : 4;\n}\n","import { isMobile } from './isMobile';\n\n/**\n * Uploading the same buffer multiple times in a single frame can cause performance issues.\n * Apparent on iOS so only check for that at the moment\n * This check may become more complex if this issue pops up elsewhere.\n * @private\n * @returns {boolean} `true` if the same buffer may be uploaded more than once.\n */\nexport function canUploadSameBuffer(): boolean\n{\n return !isMobile.apple.device;\n}\n","import { BLEND_MODES } from '@pixi/constants';\nimport { Texture } from '@pixi/core';\nimport { Bounds, Container } from '@pixi/display';\nimport { ObservablePoint, Point, Rectangle } from '@pixi/math';\nimport { settings } from '@pixi/settings';\nimport { sign } from '@pixi/utils';\n\nimport type { IBaseTextureOptions, Renderer, TextureSource } from '@pixi/core';\nimport type { IDestroyOptions } from '@pixi/display';\nimport type { IPointData } from '@pixi/math';\n\nconst tempPoint = new Point();\nconst indices = new Uint16Array([0, 1, 2, 0, 2, 3]);\n\nexport type SpriteSource = TextureSource | Texture;\n\nexport interface Sprite extends GlobalMixins.Sprite, Container {}\n\n/**\n * The Sprite object is the base for all textured objects that are rendered to the screen\n *\n * A sprite can be created directly from an image like this:\n *\n * ```js\n * let sprite = PIXI.Sprite.from('assets/image.png');\n * ```\n *\n * The more efficient way to create sprites is using a {@link PIXI.Spritesheet},\n * as swapping base textures when rendering to the screen is inefficient.\n *\n * ```js\n * PIXI.Loader.shared.add(\"assets/spritesheet.json\").load(setup);\n *\n * function setup() {\n * let sheet = PIXI.Loader.shared.resources[\"assets/spritesheet.json\"].spritesheet;\n * let sprite = new PIXI.Sprite(sheet.textures[\"image.png\"]);\n * ...\n * }\n * ```\n * @memberof PIXI\n */\nexport class Sprite extends Container\n{\n /**\n * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode.\n * @default PIXI.BLEND_MODES.NORMAL\n */\n public blendMode: BLEND_MODES;\n public indices: Uint16Array;\n\n /**\n * Plugin that is responsible for rendering this element.\n * Allows to customize the rendering process without overriding '_render' & '_renderCanvas' methods.\n * @default 'batch'\n */\n public pluginName: string;\n\n /**\n * The width of the sprite (this is initially set by the texture).\n * @protected\n */\n _width: number;\n\n /**\n * The height of the sprite (this is initially set by the texture)\n * @protected\n */\n _height: number;\n\n /**\n * The texture that the sprite is using.\n * @private\n */\n _texture: Texture;\n _textureID: number;\n\n /**\n * Cached tint value so we can tell when the tint is changed.\n * Value is used for 2d CanvasRenderer.\n * @protected\n * @default 0xFFFFFF\n */\n _cachedTint: number;\n protected _textureTrimmedID: number;\n\n /**\n * This is used to store the uvs data of the sprite, assigned at the same time\n * as the vertexData in calculateVertices().\n * @member {Float32Array}\n */\n protected uvs: Float32Array;\n\n /**\n * The anchor point defines the normalized coordinates\n * in the texture that map to the position of this\n * sprite.\n *\n * By default, this is `(0,0)` (or `texture.defaultAnchor`\n * if you have modified that), which means the position\n * `(x,y)` of this `Sprite` will be the top-left corner.\n *\n * Note: Updating `texture.defaultAnchor` after\n * constructing a `Sprite` does _not_ update its anchor.\n *\n * {@link https://docs.cocos2d-x.org/cocos2d-x/en/sprites/manipulation.html}\n * @default `this.texture.defaultAnchor`\n */\n protected _anchor: ObservablePoint;\n\n /**\n * This is used to store the vertex data of the sprite (basically a quad).\n * @member {Float32Array}\n */\n protected vertexData: Float32Array;\n\n /**\n * This is used to calculate the bounds of the object IF it is a trimmed sprite.\n * @member {Float32Array}\n */\n private vertexTrimmedData: Float32Array;\n\n /**\n * Internal roundPixels field\n * @private\n */\n private _roundPixels: boolean;\n private _transformID: number;\n private _transformTrimmedID: number;\n\n /**\n * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect.\n * @default 0xFFFFFF\n */\n private _tint: number;\n\n // Internal-only properties\n /**\n * The tint applied to the sprite. This is a RGB value. A value of 0xFFFFFF will remove any tint effect.\n * @private\n * @default 16777215\n */\n _tintRGB: number;\n\n /** @param texture - The texture for this sprite. */\n constructor(texture?: Texture)\n {\n super();\n\n this._anchor = new ObservablePoint(\n this._onAnchorUpdate,\n this,\n (texture ? texture.defaultAnchor.x : 0),\n (texture ? texture.defaultAnchor.y : 0)\n );\n\n this._texture = null;\n\n this._width = 0;\n this._height = 0;\n this._tint = null;\n this._tintRGB = null;\n\n this.tint = 0xFFFFFF;\n this.blendMode = BLEND_MODES.NORMAL;\n this._cachedTint = 0xFFFFFF;\n this.uvs = null;\n\n // call texture setter\n this.texture = texture || Texture.EMPTY;\n this.vertexData = new Float32Array(8);\n this.vertexTrimmedData = null;\n\n this._transformID = -1;\n this._textureID = -1;\n\n this._transformTrimmedID = -1;\n this._textureTrimmedID = -1;\n\n // Batchable stuff..\n // TODO could make this a mixin?\n this.indices = indices;\n\n this.pluginName = 'batch';\n\n /**\n * Used to fast check if a sprite is.. a sprite!\n * @member {boolean}\n */\n this.isSprite = true;\n this._roundPixels = settings.ROUND_PIXELS;\n }\n\n /** When the texture is updated, this event will fire to update the scale and frame. */\n protected _onTextureUpdate(): void\n {\n this._textureID = -1;\n this._textureTrimmedID = -1;\n this._cachedTint = 0xFFFFFF;\n\n // so if _width is 0 then width was not set..\n if (this._width)\n {\n this.scale.x = sign(this.scale.x) * this._width / this._texture.orig.width;\n }\n\n if (this._height)\n {\n this.scale.y = sign(this.scale.y) * this._height / this._texture.orig.height;\n }\n }\n\n /** Called when the anchor position updates. */\n private _onAnchorUpdate(): void\n {\n this._transformID = -1;\n this._transformTrimmedID = -1;\n }\n\n /** Calculates worldTransform * vertices, store it in vertexData. */\n public calculateVertices(): void\n {\n const texture = this._texture;\n\n if (this._transformID === this.transform._worldID && this._textureID === texture._updateID)\n {\n return;\n }\n\n // update texture UV here, because base texture can be changed without calling `_onTextureUpdate`\n if (this._textureID !== texture._updateID)\n {\n this.uvs = this._texture._uvs.uvsFloat32;\n }\n\n this._transformID = this.transform._worldID;\n this._textureID = texture._updateID;\n\n // set the vertex data\n\n const wt = this.transform.worldTransform;\n const a = wt.a;\n const b = wt.b;\n const c = wt.c;\n const d = wt.d;\n const tx = wt.tx;\n const ty = wt.ty;\n const vertexData = this.vertexData;\n const trim = texture.trim;\n const orig = texture.orig;\n const anchor = this._anchor;\n\n let w0 = 0;\n let w1 = 0;\n let h0 = 0;\n let h1 = 0;\n\n if (trim)\n {\n // if the sprite is trimmed and is not a tilingsprite then we need to add the extra\n // space before transforming the sprite coords.\n w1 = trim.x - (anchor._x * orig.width);\n w0 = w1 + trim.width;\n\n h1 = trim.y - (anchor._y * orig.height);\n h0 = h1 + trim.height;\n }\n else\n {\n w1 = -anchor._x * orig.width;\n w0 = w1 + orig.width;\n\n h1 = -anchor._y * orig.height;\n h0 = h1 + orig.height;\n }\n\n // xy\n vertexData[0] = (a * w1) + (c * h1) + tx;\n vertexData[1] = (d * h1) + (b * w1) + ty;\n\n // xy\n vertexData[2] = (a * w0) + (c * h1) + tx;\n vertexData[3] = (d * h1) + (b * w0) + ty;\n\n // xy\n vertexData[4] = (a * w0) + (c * h0) + tx;\n vertexData[5] = (d * h0) + (b * w0) + ty;\n\n // xy\n vertexData[6] = (a * w1) + (c * h0) + tx;\n vertexData[7] = (d * h0) + (b * w1) + ty;\n\n if (this._roundPixels)\n {\n const resolution = settings.RESOLUTION;\n\n for (let i = 0; i < vertexData.length; ++i)\n {\n vertexData[i] = Math.round((vertexData[i] * resolution | 0) / resolution);\n }\n }\n }\n\n /**\n * Calculates worldTransform * vertices for a non texture with a trim. store it in vertexTrimmedData.\n *\n * This is used to ensure that the true width and height of a trimmed texture is respected.\n */\n public calculateTrimmedVertices(): void\n {\n if (!this.vertexTrimmedData)\n {\n this.vertexTrimmedData = new Float32Array(8);\n }\n else if (this._transformTrimmedID === this.transform._worldID && this._textureTrimmedID === this._texture._updateID)\n {\n return;\n }\n\n this._transformTrimmedID = this.transform._worldID;\n this._textureTrimmedID = this._texture._updateID;\n\n // lets do some special trim code!\n const texture = this._texture;\n const vertexData = this.vertexTrimmedData;\n const orig = texture.orig;\n const anchor = this._anchor;\n\n // lets calculate the new untrimmed bounds..\n const wt = this.transform.worldTransform;\n const a = wt.a;\n const b = wt.b;\n const c = wt.c;\n const d = wt.d;\n const tx = wt.tx;\n const ty = wt.ty;\n\n const w1 = -anchor._x * orig.width;\n const w0 = w1 + orig.width;\n\n const h1 = -anchor._y * orig.height;\n const h0 = h1 + orig.height;\n\n // xy\n vertexData[0] = (a * w1) + (c * h1) + tx;\n vertexData[1] = (d * h1) + (b * w1) + ty;\n\n // xy\n vertexData[2] = (a * w0) + (c * h1) + tx;\n vertexData[3] = (d * h1) + (b * w0) + ty;\n\n // xy\n vertexData[4] = (a * w0) + (c * h0) + tx;\n vertexData[5] = (d * h0) + (b * w0) + ty;\n\n // xy\n vertexData[6] = (a * w1) + (c * h0) + tx;\n vertexData[7] = (d * h0) + (b * w1) + ty;\n }\n\n /**\n *\n * Renders the object using the WebGL renderer\n * @param renderer - The webgl renderer to use.\n */\n protected _render(renderer: Renderer): void\n {\n this.calculateVertices();\n\n renderer.batch.setObjectRenderer(renderer.plugins[this.pluginName]);\n renderer.plugins[this.pluginName].render(this);\n }\n\n /** Updates the bounds of the sprite. */\n protected _calculateBounds(): void\n {\n const trim = this._texture.trim;\n const orig = this._texture.orig;\n\n // First lets check to see if the current texture has a trim..\n if (!trim || (trim.width === orig.width && trim.height === orig.height))\n {\n // no trim! lets use the usual calculations..\n this.calculateVertices();\n this._bounds.addQuad(this.vertexData);\n }\n else\n {\n // lets calculate a special trimmed bounds...\n this.calculateTrimmedVertices();\n this._bounds.addQuad(this.vertexTrimmedData);\n }\n }\n\n /**\n * Gets the local bounds of the sprite object.\n * @param rect - Optional output rectangle.\n * @returns The bounds.\n */\n public getLocalBounds(rect?: Rectangle): Rectangle\n {\n // we can do a fast local bounds if the sprite has no children!\n if (this.children.length === 0)\n {\n if (!this._localBounds)\n {\n this._localBounds = new Bounds();\n }\n\n this._localBounds.minX = this._texture.orig.width * -this._anchor._x;\n this._localBounds.minY = this._texture.orig.height * -this._anchor._y;\n this._localBounds.maxX = this._texture.orig.width * (1 - this._anchor._x);\n this._localBounds.maxY = this._texture.orig.height * (1 - this._anchor._y);\n\n if (!rect)\n {\n if (!this._localBoundsRect)\n {\n this._localBoundsRect = new Rectangle();\n }\n\n rect = this._localBoundsRect;\n }\n\n return this._localBounds.getRectangle(rect);\n }\n\n return super.getLocalBounds.call(this, rect);\n }\n\n /**\n * Tests if a point is inside this sprite\n * @param point - the point to test\n * @returns The result of the test\n */\n public containsPoint(point: IPointData): boolean\n {\n this.worldTransform.applyInverse(point, tempPoint);\n\n const width = this._texture.orig.width;\n const height = this._texture.orig.height;\n const x1 = -width * this.anchor.x;\n let y1 = 0;\n\n if (tempPoint.x >= x1 && tempPoint.x < x1 + width)\n {\n y1 = -height * this.anchor.y;\n\n if (tempPoint.y >= y1 && tempPoint.y < y1 + height)\n {\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * Destroys this sprite and optionally its texture and children.\n * @param options - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param [options.children=false] - if set to true, all the children will have their destroy\n * method called as well. 'options' will be passed on to those calls.\n * @param [options.texture=false] - Should it destroy the current texture of the sprite as well\n * @param [options.baseTexture=false] - Should it destroy the base texture of the sprite as well\n */\n public destroy(options?: IDestroyOptions | boolean): void\n {\n super.destroy(options);\n\n this._texture.off('update', this._onTextureUpdate, this);\n\n this._anchor = null;\n\n const destroyTexture = typeof options === 'boolean' ? options : options && options.texture;\n\n if (destroyTexture)\n {\n const destroyBaseTexture = typeof options === 'boolean' ? options : options && options.baseTexture;\n\n this._texture.destroy(!!destroyBaseTexture);\n }\n\n this._texture = null;\n }\n\n // some helper functions..\n\n /**\n * Helper function that creates a new sprite based on the source you provide.\n * The source can be - frame id, image url, video url, canvas element, video element, base texture\n * @param {string|PIXI.Texture|HTMLCanvasElement|HTMLVideoElement} source - Source to create texture from\n * @param {object} [options] - See {@link PIXI.BaseTexture}'s constructor for options.\n * @returns The newly created sprite\n */\n static from(source: SpriteSource, options?: IBaseTextureOptions): Sprite\n {\n const texture = (source instanceof Texture)\n ? source\n : Texture.from(source, options);\n\n return new Sprite(texture);\n }\n\n /**\n * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.\n *\n * Advantages can include sharper image quality (like text) and faster rendering on canvas.\n * The main disadvantage is movement of objects may appear less smooth.\n *\n * To set the global default, change {@link PIXI.settings.ROUND_PIXELS}.\n * @default false\n */\n set roundPixels(value: boolean)\n {\n if (this._roundPixels !== value)\n {\n this._transformID = -1;\n }\n this._roundPixels = value;\n }\n\n get roundPixels(): boolean\n {\n return this._roundPixels;\n }\n\n /** The width of the sprite, setting this will actually modify the scale to achieve the value set. */\n get width(): number\n {\n return Math.abs(this.scale.x) * this._texture.orig.width;\n }\n\n set width(value: number)\n {\n const s = sign(this.scale.x) || 1;\n\n this.scale.x = s * value / this._texture.orig.width;\n this._width = value;\n }\n\n /** The height of the sprite, setting this will actually modify the scale to achieve the value set. */\n get height(): number\n {\n return Math.abs(this.scale.y) * this._texture.orig.height;\n }\n\n set height(value: number)\n {\n const s = sign(this.scale.y) || 1;\n\n this.scale.y = s * value / this._texture.orig.height;\n this._height = value;\n }\n\n /**\n * The anchor sets the origin point of the sprite. The default value is taken from the {@link PIXI.Texture|Texture}\n * and passed to the constructor.\n *\n * The default is `(0,0)`, this means the sprite's origin is the top left.\n *\n * Setting the anchor to `(0.5,0.5)` means the sprite's origin is centered.\n *\n * Setting the anchor to `(1,1)` would mean the sprite's origin point will be the bottom right corner.\n *\n * If you pass only single parameter, it will set both x and y to the same value as shown in the example below.\n * @example\n * const sprite = new PIXI.Sprite(texture);\n * sprite.anchor.set(0.5); // This will set the origin to center. (0.5) is same as (0.5, 0.5).\n */\n get anchor(): ObservablePoint\n {\n return this._anchor;\n }\n\n set anchor(value: ObservablePoint)\n {\n this._anchor.copyFrom(value);\n }\n\n /**\n * The tint applied to the sprite. This is a hex value.\n *\n * A value of 0xFFFFFF will remove any tint effect.\n * @default 0xFFFFFF\n */\n get tint(): number\n {\n return this._tint;\n }\n\n set tint(value: number)\n {\n this._tint = value;\n this._tintRGB = (value >> 16) + (value & 0xff00) + ((value & 0xff) << 16);\n }\n\n /** The texture that the sprite is using. */\n get texture(): Texture\n {\n return this._texture;\n }\n\n set texture(value: Texture)\n {\n if (this._texture === value)\n {\n return;\n }\n\n if (this._texture)\n {\n this._texture.off('update', this._onTextureUpdate, this);\n }\n\n this._texture = value || Texture.EMPTY;\n this._cachedTint = 0xFFFFFF;\n\n this._textureID = -1;\n this._textureTrimmedID = -1;\n\n if (value)\n {\n // wait for the texture to load\n if (value.baseTexture.valid)\n {\n this._onTextureUpdate();\n }\n else\n {\n value.once('update', this._onTextureUpdate, this);\n }\n }\n }\n}\n","/**\n * Constants that define the type of gradient on text.\n * @static\n * @constant\n * @name TEXT_GRADIENT\n * @memberof PIXI\n * @type {object}\n * @property {number} LINEAR_VERTICAL Vertical gradient\n * @property {number} LINEAR_HORIZONTAL Linear gradient\n */\nexport enum TEXT_GRADIENT\n// eslint-disable-next-line @typescript-eslint/indent\n{\n LINEAR_VERTICAL = 0,\n LINEAR_HORIZONTAL = 1\n}\n","// disabling eslint for now, going to rewrite this in v5\n/* eslint-disable */\n\nimport { TEXT_GRADIENT } from './const';\nimport { hex2string } from '@pixi/utils';\n\nexport type TextStyleAlign = 'left'|'center'|'right'|'justify';\nexport type TextStyleFill = string|string[]|number|number[]|CanvasGradient|CanvasPattern;\nexport type TextStyleFontStyle = 'normal'|'italic'|'oblique';\nexport type TextStyleFontVariant = 'normal'|'small-caps';\nexport type TextStyleFontWeight = 'normal'|'bold'|'bolder'|'lighter'|'100'|'200'|'300'|'400'|'500'|'600'|'700'|'800'|'900';\nexport type TextStyleLineJoin = 'miter'|'round'|'bevel';\nexport type TextStyleTextBaseline = 'alphabetic'|'top'|'hanging'|'middle'|'ideographic'|'bottom';\nexport type TextStyleWhiteSpace = 'normal'|'pre'|'pre-line';\n\nexport interface ITextStyle {\n align: TextStyleAlign;\n breakWords: boolean;\n dropShadow: boolean;\n dropShadowAlpha: number;\n dropShadowAngle: number;\n dropShadowBlur: number;\n dropShadowColor: string|number;\n dropShadowDistance: number;\n fill: TextStyleFill;\n fillGradientType: TEXT_GRADIENT;\n fillGradientStops: number[];\n fontFamily: string | string[];\n fontSize: number | string;\n fontStyle: TextStyleFontStyle;\n fontVariant: TextStyleFontVariant;\n fontWeight: TextStyleFontWeight;\n letterSpacing: number;\n lineHeight: number;\n lineJoin: TextStyleLineJoin;\n miterLimit: number;\n padding: number;\n stroke: string|number;\n strokeThickness: number;\n textBaseline: TextStyleTextBaseline;\n trim: boolean;\n whiteSpace: TextStyleWhiteSpace;\n wordWrap: boolean;\n wordWrapWidth: number;\n leading: number;\n}\n\nconst defaultStyle: ITextStyle = {\n align: 'left',\n breakWords: false,\n dropShadow: false,\n dropShadowAlpha: 1,\n dropShadowAngle: Math.PI / 6,\n dropShadowBlur: 0,\n dropShadowColor: 'black',\n dropShadowDistance: 5,\n fill: 'black',\n fillGradientType: TEXT_GRADIENT.LINEAR_VERTICAL,\n fillGradientStops: [],\n fontFamily: 'Arial',\n fontSize: 26,\n fontStyle: 'normal',\n fontVariant: 'normal',\n fontWeight: 'normal',\n letterSpacing: 0,\n lineHeight: 0,\n lineJoin: 'miter',\n miterLimit: 10,\n padding: 0,\n stroke: 'black',\n strokeThickness: 0,\n textBaseline: 'alphabetic',\n trim: false,\n whiteSpace: 'pre',\n wordWrap: false,\n wordWrapWidth: 100,\n leading: 0,\n};\n\nconst genericFontFamilies = [\n 'serif',\n 'sans-serif',\n 'monospace',\n 'cursive',\n 'fantasy',\n 'system-ui',\n];\n\n/**\n * A TextStyle Object contains information to decorate a Text objects.\n *\n * An instance can be shared between multiple Text objects; then changing the style will update all text objects using it.\n *\n * A tool can be used to generate a text style [here](https://pixijs.io/pixi-text-style).\n *\n * @memberof PIXI\n */\nexport class TextStyle implements ITextStyle\n{\n public styleID: number;\n\n protected _align: TextStyleAlign;\n protected _breakWords: boolean;\n protected _dropShadow: boolean;\n protected _dropShadowAlpha: number;\n protected _dropShadowAngle: number;\n protected _dropShadowBlur: number;\n protected _dropShadowColor: string|number;\n protected _dropShadowDistance: number;\n protected _fill: TextStyleFill;\n protected _fillGradientType: TEXT_GRADIENT;\n protected _fillGradientStops: number[];\n protected _fontFamily: string|string[];\n protected _fontSize: number|string;\n protected _fontStyle: TextStyleFontStyle;\n protected _fontVariant: TextStyleFontVariant;\n protected _fontWeight: TextStyleFontWeight;\n protected _letterSpacing: number;\n protected _lineHeight: number;\n protected _lineJoin: TextStyleLineJoin;\n protected _miterLimit: number;\n protected _padding: number;\n protected _stroke: string|number;\n protected _strokeThickness: number;\n protected _textBaseline: TextStyleTextBaseline;\n protected _trim: boolean;\n protected _whiteSpace: TextStyleWhiteSpace;\n protected _wordWrap: boolean;\n protected _wordWrapWidth: number;\n protected _leading: number;\n\n /**\n * @param {object} [style] - The style parameters\n * @param {string} [style.align='left'] - Alignment for multiline text ('left', 'center' or 'right'),\n * does not affect single line text\n * @param {boolean} [style.breakWords=false] - Indicates if lines can be wrapped within words, it\n * needs wordWrap to be set to true\n * @param {boolean} [style.dropShadow=false] - Set a drop shadow for the text\n * @param {number} [style.dropShadowAlpha=1] - Set alpha for the drop shadow\n * @param {number} [style.dropShadowAngle=Math.PI/6] - Set a angle of the drop shadow\n * @param {number} [style.dropShadowBlur=0] - Set a shadow blur radius\n * @param {string|number} [style.dropShadowColor='black'] - A fill style to be used on the dropshadow e.g 'red', '#00FF00'\n * @param {number} [style.dropShadowDistance=5] - Set a distance of the drop shadow\n * @param {string|string[]|number|number[]|CanvasGradient|CanvasPattern} [style.fill='black'] - A canvas\n * fillstyle that will be used on the text e.g 'red', '#00FF00'. Can be an array to create a gradient\n * eg ['#000000','#FFFFFF']\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle|MDN}\n * @param {number} [style.fillGradientType=PIXI.TEXT_GRADIENT.LINEAR_VERTICAL] - If fill is an array of colours\n * to create a gradient, this can change the type/direction of the gradient. See {@link PIXI.TEXT_GRADIENT}\n * @param {number[]} [style.fillGradientStops] - If fill is an array of colours to create a gradient, this array can set\n * the stop points (numbers between 0 and 1) for the color, overriding the default behaviour of evenly spacing them.\n * @param {string|string[]} [style.fontFamily='Arial'] - The font family\n * @param {number|string} [style.fontSize=26] - The font size (as a number it converts to px, but as a string,\n * equivalents are '26px','20pt','160%' or '1.6em')\n * @param {string} [style.fontStyle='normal'] - The font style ('normal', 'italic' or 'oblique')\n * @param {string} [style.fontVariant='normal'] - The font variant ('normal' or 'small-caps')\n * @param {string} [style.fontWeight='normal'] - The font weight ('normal', 'bold', 'bolder', 'lighter' and '100',\n * '200', '300', '400', '500', '600', '700', '800' or '900')\n * @param {number} [style.leading=0] - The space between lines\n * @param {number} [style.letterSpacing=0] - The amount of spacing between letters, default is 0\n * @param {number} [style.lineHeight] - The line height, a number that represents the vertical space that a letter uses\n * @param {string} [style.lineJoin='miter'] - The lineJoin property sets the type of corner created, it can resolve\n * spiked text issues. Possible values \"miter\" (creates a sharp corner), \"round\" (creates a round corner) or \"bevel\"\n * (creates a squared corner).\n * @param {number} [style.miterLimit=10] - The miter limit to use when using the 'miter' lineJoin mode. This can reduce\n * or increase the spikiness of rendered text.\n * @param {number} [style.padding=0] - Occasionally some fonts are cropped. Adding some padding will prevent this from\n * happening by adding padding to all sides of the text.\n * @param {string|number} [style.stroke='black'] - A canvas fillstyle that will be used on the text stroke\n * e.g 'blue', '#FCFF00'\n * @param {number} [style.strokeThickness=0] - A number that represents the thickness of the stroke.\n * Default is 0 (no stroke)\n * @param {boolean} [style.trim=false] - Trim transparent borders\n * @param {string} [style.textBaseline='alphabetic'] - The baseline of the text that is rendered.\n * @param {string} [style.whiteSpace='pre'] - Determines whether newlines & spaces are collapsed or preserved \"normal\"\n * (collapse, collapse), \"pre\" (preserve, preserve) | \"pre-line\" (preserve, collapse). It needs wordWrap to be set to true\n * @param {boolean} [style.wordWrap=false] - Indicates if word wrap should be used\n * @param {number} [style.wordWrapWidth=100] - The width at which text will wrap, it needs wordWrap to be set to true\n */\n constructor(style?: Partial<ITextStyle>)\n {\n this.styleID = 0;\n\n this.reset();\n\n deepCopyProperties(this, style, style);\n }\n\n /**\n * Creates a new TextStyle object with the same values as this one.\n * Note that the only the properties of the object are cloned.\n *\n * @return New cloned TextStyle object\n */\n public clone(): TextStyle\n {\n const clonedProperties: Partial<ITextStyle> = {};\n\n deepCopyProperties(clonedProperties, this, defaultStyle);\n\n return new TextStyle(clonedProperties);\n }\n\n /** Resets all properties to the defaults specified in TextStyle.prototype._default */\n public reset(): void\n {\n deepCopyProperties(this, defaultStyle, defaultStyle);\n }\n\n /**\n * Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text\n *\n * @member {string}\n */\n get align(): TextStyleAlign\n {\n return this._align;\n }\n set align(align: TextStyleAlign)\n {\n if (this._align !== align)\n {\n this._align = align;\n this.styleID++;\n }\n }\n\n /** Indicates if lines can be wrapped within words, it needs wordWrap to be set to true. */\n get breakWords(): boolean\n {\n return this._breakWords;\n }\n set breakWords(breakWords: boolean)\n {\n if (this._breakWords !== breakWords)\n {\n this._breakWords = breakWords;\n this.styleID++;\n }\n }\n\n /** Set a drop shadow for the text. */\n get dropShadow(): boolean\n {\n return this._dropShadow;\n }\n set dropShadow(dropShadow: boolean)\n {\n if (this._dropShadow !== dropShadow)\n {\n this._dropShadow = dropShadow;\n this.styleID++;\n }\n }\n\n /** Set alpha for the drop shadow. */\n get dropShadowAlpha(): number\n {\n return this._dropShadowAlpha;\n }\n set dropShadowAlpha(dropShadowAlpha: number)\n {\n if (this._dropShadowAlpha !== dropShadowAlpha)\n {\n this._dropShadowAlpha = dropShadowAlpha;\n this.styleID++;\n }\n }\n\n /** Set a angle of the drop shadow. */\n get dropShadowAngle(): number\n {\n return this._dropShadowAngle;\n }\n set dropShadowAngle(dropShadowAngle: number)\n {\n if (this._dropShadowAngle !== dropShadowAngle)\n {\n this._dropShadowAngle = dropShadowAngle;\n this.styleID++;\n }\n }\n\n /** Set a shadow blur radius. */\n get dropShadowBlur(): number\n {\n return this._dropShadowBlur;\n }\n set dropShadowBlur(dropShadowBlur: number)\n {\n if (this._dropShadowBlur !== dropShadowBlur)\n {\n this._dropShadowBlur = dropShadowBlur;\n this.styleID++;\n }\n }\n\n /** A fill style to be used on the dropshadow e.g 'red', '#00FF00'. */\n get dropShadowColor(): number | string\n {\n return this._dropShadowColor;\n }\n set dropShadowColor(dropShadowColor: number | string)\n {\n const outputColor = getColor(dropShadowColor);\n if (this._dropShadowColor !== outputColor)\n {\n this._dropShadowColor = outputColor;\n this.styleID++;\n }\n }\n\n /** Set a distance of the drop shadow. */\n get dropShadowDistance(): number\n {\n return this._dropShadowDistance;\n }\n set dropShadowDistance(dropShadowDistance: number)\n {\n if (this._dropShadowDistance !== dropShadowDistance)\n {\n this._dropShadowDistance = dropShadowDistance;\n this.styleID++;\n }\n }\n\n /**\n * A canvas fillstyle that will be used on the text e.g 'red', '#00FF00'.\n *\n * Can be an array to create a gradient eg ['#000000','#FFFFFF']\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle|MDN}\n *\n * @member {string|string[]|number|number[]|CanvasGradient|CanvasPattern}\n */\n get fill(): TextStyleFill\n {\n return this._fill;\n }\n set fill(fill: TextStyleFill)\n {\n // TODO: Can't have different types for getter and setter. The getter shouldn't have the number type as\n // the setter converts to string. See this thread for more details:\n // https://github.com/microsoft/TypeScript/issues/2521\n // TODO: Not sure if getColor works properly with CanvasGradient and/or CanvasPattern, can't pass in\n // without casting here.\n const outputColor = getColor(fill as any);\n if (this._fill !== outputColor)\n {\n this._fill = outputColor;\n this.styleID++;\n }\n }\n\n /**\n * If fill is an array of colours to create a gradient, this can change the type/direction of the gradient.\n *\n * @see PIXI.TEXT_GRADIENT\n */\n get fillGradientType(): TEXT_GRADIENT\n {\n return this._fillGradientType;\n }\n set fillGradientType(fillGradientType: TEXT_GRADIENT)\n {\n if (this._fillGradientType !== fillGradientType)\n {\n this._fillGradientType = fillGradientType;\n this.styleID++;\n }\n }\n\n /**\n * If fill is an array of colours to create a gradient, this array can set the stop points\n * (numbers between 0 and 1) for the color, overriding the default behaviour of evenly spacing them.\n */\n get fillGradientStops(): number[]\n {\n return this._fillGradientStops;\n }\n set fillGradientStops(fillGradientStops: number[])\n {\n if (!areArraysEqual(this._fillGradientStops,fillGradientStops))\n {\n this._fillGradientStops = fillGradientStops;\n this.styleID++;\n }\n }\n\n /** The font family. */\n get fontFamily(): string | string[]\n {\n return this._fontFamily;\n }\n set fontFamily(fontFamily: string | string[])\n {\n if (this.fontFamily !== fontFamily)\n {\n this._fontFamily = fontFamily;\n this.styleID++;\n }\n }\n\n /**\n * The font size\n * (as a number it converts to px, but as a string, equivalents are '26px','20pt','160%' or '1.6em')\n */\n get fontSize(): number | string\n {\n return this._fontSize;\n }\n set fontSize(fontSize: number | string)\n {\n if (this._fontSize !== fontSize)\n {\n this._fontSize = fontSize;\n this.styleID++;\n }\n }\n\n /**\n * The font style\n * ('normal', 'italic' or 'oblique')\n *\n * @member {string}\n */\n get fontStyle(): TextStyleFontStyle\n {\n return this._fontStyle;\n }\n set fontStyle(fontStyle: TextStyleFontStyle)\n {\n if (this._fontStyle !== fontStyle)\n {\n this._fontStyle = fontStyle;\n this.styleID++;\n }\n }\n\n /**\n * The font variant\n * ('normal' or 'small-caps')\n *\n * @member {string}\n */\n get fontVariant(): TextStyleFontVariant\n {\n return this._fontVariant;\n }\n set fontVariant(fontVariant: TextStyleFontVariant)\n {\n if (this._fontVariant !== fontVariant)\n {\n this._fontVariant = fontVariant;\n this.styleID++;\n }\n }\n\n /**\n * The font weight\n * ('normal', 'bold', 'bolder', 'lighter' and '100', '200', '300', '400', '500', '600', '700', 800' or '900')\n *\n * @member {string}\n */\n get fontWeight(): TextStyleFontWeight\n {\n return this._fontWeight;\n }\n set fontWeight(fontWeight: TextStyleFontWeight)\n {\n if (this._fontWeight !== fontWeight)\n {\n this._fontWeight = fontWeight;\n this.styleID++;\n }\n }\n\n /** The amount of spacing between letters, default is 0. */\n get letterSpacing(): number\n {\n return this._letterSpacing;\n }\n set letterSpacing(letterSpacing: number)\n {\n if (this._letterSpacing !== letterSpacing)\n {\n this._letterSpacing = letterSpacing;\n this.styleID++;\n }\n }\n\n /** The line height, a number that represents the vertical space that a letter uses. */\n get lineHeight(): number\n {\n return this._lineHeight;\n }\n set lineHeight(lineHeight: number)\n {\n if (this._lineHeight !== lineHeight)\n {\n this._lineHeight = lineHeight;\n this.styleID++;\n }\n }\n\n /** The space between lines. */\n get leading(): number\n {\n return this._leading;\n }\n set leading(leading: number)\n {\n if (this._leading !== leading)\n {\n this._leading = leading;\n this.styleID++;\n }\n }\n\n /**\n * The lineJoin property sets the type of corner created, it can resolve spiked text issues.\n * Default is 'miter' (creates a sharp corner).\n *\n * @member {string}\n */\n get lineJoin(): TextStyleLineJoin\n {\n return this._lineJoin;\n }\n set lineJoin(lineJoin: TextStyleLineJoin)\n {\n if (this._lineJoin !== lineJoin)\n {\n this._lineJoin = lineJoin;\n this.styleID++;\n }\n }\n\n /**\n * The miter limit to use when using the 'miter' lineJoin mode.\n *\n * This can reduce or increase the spikiness of rendered text.\n */\n get miterLimit(): number\n {\n return this._miterLimit;\n }\n set miterLimit(miterLimit: number)\n {\n if (this._miterLimit !== miterLimit)\n {\n this._miterLimit = miterLimit;\n this.styleID++;\n }\n }\n\n /**\n * Occasionally some fonts are cropped. Adding some padding will prevent this from happening\n * by adding padding to all sides of the text.\n */\n get padding(): number\n {\n return this._padding;\n }\n set padding(padding: number)\n {\n if (this._padding !== padding)\n {\n this._padding = padding;\n this.styleID++;\n }\n }\n\n /**\n * A canvas fillstyle that will be used on the text stroke\n * e.g 'blue', '#FCFF00'\n */\n get stroke(): string | number\n {\n return this._stroke;\n }\n set stroke(stroke: string | number)\n {\n // TODO: Can't have different types for getter and setter. The getter shouldn't have the number type as\n // the setter converts to string. See this thread for more details:\n // https://github.com/microsoft/TypeScript/issues/2521\n const outputColor = getColor(stroke);\n if (this._stroke !== outputColor)\n {\n this._stroke = outputColor;\n this.styleID++;\n }\n }\n\n /**\n * A number that represents the thickness of the stroke.\n *\n * @default 0\n */\n get strokeThickness(): number\n {\n return this._strokeThickness;\n }\n set strokeThickness(strokeThickness: number)\n {\n if (this._strokeThickness !== strokeThickness)\n {\n this._strokeThickness = strokeThickness;\n this.styleID++;\n }\n }\n\n /**\n * The baseline of the text that is rendered.\n *\n * @member {string}\n */\n get textBaseline(): TextStyleTextBaseline\n {\n return this._textBaseline;\n }\n set textBaseline(textBaseline: TextStyleTextBaseline)\n {\n if (this._textBaseline !== textBaseline)\n {\n this._textBaseline = textBaseline;\n this.styleID++;\n }\n }\n\n /** Trim transparent borders. */\n get trim(): boolean\n {\n return this._trim;\n }\n set trim(trim: boolean)\n {\n if (this._trim !== trim)\n {\n this._trim = trim;\n this.styleID++;\n }\n }\n\n /**\n * How newlines and spaces should be handled.\n * Default is 'pre' (preserve, preserve).\n *\n * value | New lines | Spaces\n * --- | --- | ---\n * 'normal' | Collapse | Collapse\n * 'pre' | Preserve | Preserve\n * 'pre-line' | Preserve | Collapse\n *\n * @member {string}\n */\n get whiteSpace(): TextStyleWhiteSpace\n {\n return this._whiteSpace;\n }\n set whiteSpace(whiteSpace: TextStyleWhiteSpace)\n {\n if (this._whiteSpace !== whiteSpace)\n {\n this._whiteSpace = whiteSpace;\n this.styleID++;\n }\n }\n\n /** Indicates if word wrap should be used. */\n get wordWrap(): boolean\n {\n return this._wordWrap;\n }\n set wordWrap(wordWrap: boolean)\n {\n if (this._wordWrap !== wordWrap)\n {\n this._wordWrap = wordWrap;\n this.styleID++;\n }\n }\n\n /** The width at which text will wrap, it needs wordWrap to be set to true. */\n get wordWrapWidth(): number\n {\n return this._wordWrapWidth;\n }\n set wordWrapWidth(wordWrapWidth: number)\n {\n if (this._wordWrapWidth !== wordWrapWidth)\n {\n this._wordWrapWidth = wordWrapWidth;\n this.styleID++;\n }\n }\n\n /**\n * Generates a font style string to use for `TextMetrics.measureFont()`.\n *\n * @return Font style string, for passing to `TextMetrics.measureFont()`\n */\n public toFontString(): string\n {\n // build canvas api font setting from individual components. Convert a numeric this.fontSize to px\n const fontSizeString = (typeof this.fontSize === 'number') ? `${this.fontSize}px` : this.fontSize;\n\n // Clean-up fontFamily property by quoting each font name\n // this will support font names with spaces\n let fontFamilies: string|string[] = this.fontFamily;\n\n if (!Array.isArray(this.fontFamily))\n {\n fontFamilies = this.fontFamily.split(',');\n }\n\n for (let i = fontFamilies.length - 1; i >= 0; i--)\n {\n // Trim any extra white-space\n let fontFamily = fontFamilies[i].trim();\n\n // Check if font already contains strings\n if (!(/([\\\"\\'])[^\\'\\\"]+\\1/).test(fontFamily) && genericFontFamilies.indexOf(fontFamily) < 0)\n {\n fontFamily = `\"${fontFamily}\"`;\n }\n (fontFamilies as string[])[i] = fontFamily;\n }\n\n return `${this.fontStyle} ${this.fontVariant} ${this.fontWeight} ${fontSizeString} ${(fontFamilies as string[]).join(',')}`;\n }\n}\n\n/**\n * Utility function to convert hexadecimal colors to strings, and simply return the color if it's a string.\n * @private\n * @param color\n * @return The color as a string.\n */\nfunction getSingleColor(color: string|number): string\n{\n if (typeof color === 'number')\n {\n return hex2string(color);\n }\n else if (typeof color === 'string')\n {\n if ( color.indexOf('0x') === 0 )\n {\n color = color.replace('0x', '#');\n }\n }\n\n return color;\n}\n\n/**\n * Utility function to convert hexadecimal colors to strings, and simply return the color if it's a string.\n * This version can also convert array of colors\n * @private\n * @param color\n * @return The color as a string.\n */\nfunction getColor(color: (string|number)[]): string[];\nfunction getColor(color: string|number): string;\nfunction getColor(color: string|number|(string|number)[]): string|string[]\n{\n if (!Array.isArray(color))\n {\n return getSingleColor(color);\n }\n else\n {\n for (let i = 0; i < color.length; ++i)\n {\n color[i] = getSingleColor(color[i]);\n }\n\n return color as string[];\n }\n}\n\n/**\n * Utility function to convert hexadecimal colors to strings, and simply return the color if it's a string.\n * This version can also convert array of colors\n * @private\n * @param array1 - First array to compare\n * @param array2 - Second array to compare\n * @return Do the arrays contain the same values in the same order\n */\nfunction areArraysEqual<T>(array1: T[], array2: T[]): boolean\n{\n if (!Array.isArray(array1) || !Array.isArray(array2))\n {\n return false;\n }\n\n if (array1.length !== array2.length)\n {\n return false;\n }\n\n for (let i = 0; i < array1.length; ++i)\n {\n if (array1[i] !== array2[i])\n {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Utility function to ensure that object properties are copied by value, and not by reference\n * @private\n * @param target - Target object to copy properties into\n * @param source - Source object for the properties to copy\n * @param propertyObj - Object containing properties names we want to loop over\n */\nfunction deepCopyProperties(target: Record<string, any>, source: Record<string, any>, propertyObj: Record<string, any>): void {\n for (const prop in propertyObj) {\n if (Array.isArray(source[prop])) {\n target[prop] = source[prop].slice();\n } else {\n target[prop] = source[prop];\n }\n }\n}\n","import { settings } from '@pixi/settings';\nimport type { TextStyle, TextStyleWhiteSpace } from './TextStyle';\n\ninterface IFontMetrics\n{\n ascent: number;\n descent: number;\n fontSize: number;\n}\n\ntype CharacterWidthCache = { [key: string]: number };\n\n/**\n * The TextMetrics object represents the measurement of a block of text with a specified style.\n *\n * ```js\n * let style = new PIXI.TextStyle({fontFamily : 'Arial', fontSize: 24, fill : 0xff1010, align : 'center'})\n * let textMetrics = PIXI.TextMetrics.measureText('Your text', style)\n * ```\n * @memberof PIXI\n */\nexport class TextMetrics\n{\n /** The text that was measured. */\n public text: string;\n\n /** The style that was measured. */\n public style: TextStyle;\n\n /** The measured width of the text. */\n public width: number;\n\n /** The measured height of the text. */\n public height: number;\n\n /** An array of lines of the text broken by new lines and wrapping is specified in style. */\n public lines: string[];\n\n /** An array of the line widths for each line matched to `lines`. */\n public lineWidths: number[];\n\n /** The measured line height for this style. */\n public lineHeight: number;\n\n /** The maximum line width for all measured lines. */\n public maxLineWidth: number;\n\n /**\n * The font properties object from TextMetrics.measureFont.\n * @type {PIXI.IFontMetrics}\n */\n public fontProperties: IFontMetrics;\n\n public static METRICS_STRING: string;\n public static BASELINE_SYMBOL: string;\n public static BASELINE_MULTIPLIER: number;\n public static HEIGHT_MULTIPLIER: number;\n\n private static __canvas: HTMLCanvasElement | OffscreenCanvas;\n private static __context: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D;\n\n // TODO: These should be protected but they're initialized outside of the class.\n public static _fonts: { [font: string]: IFontMetrics };\n public static _newlines: number[];\n public static _breakingSpaces: number[];\n\n /**\n * @param text - the text that was measured\n * @param style - the style that was measured\n * @param width - the measured width of the text\n * @param height - the measured height of the text\n * @param lines - an array of the lines of text broken by new lines and wrapping if specified in style\n * @param lineWidths - an array of the line widths for each line matched to `lines`\n * @param lineHeight - the measured line height for this style\n * @param maxLineWidth - the maximum line width for all measured lines\n * @param {PIXI.IFontMetrics} fontProperties - the font properties object from TextMetrics.measureFont\n */\n constructor(text: string, style: TextStyle, width: number, height: number, lines: string[], lineWidths: number[],\n lineHeight: number, maxLineWidth: number, fontProperties: IFontMetrics)\n {\n this.text = text;\n this.style = style;\n this.width = width;\n this.height = height;\n this.lines = lines;\n this.lineWidths = lineWidths;\n this.lineHeight = lineHeight;\n this.maxLineWidth = maxLineWidth;\n this.fontProperties = fontProperties;\n }\n\n /**\n * Measures the supplied string of text and returns a Rectangle.\n * @param text - The text to measure.\n * @param style - The text style to use for measuring\n * @param wordWrap - Override for if word-wrap should be applied to the text.\n * @param canvas - optional specification of the canvas to use for measuring.\n * @returns Measured width and height of the text.\n */\n public static measureText(\n text: string,\n style: TextStyle,\n wordWrap?: boolean,\n canvas: HTMLCanvasElement | OffscreenCanvas = TextMetrics._canvas\n ): TextMetrics\n {\n wordWrap = (wordWrap === undefined || wordWrap === null) ? style.wordWrap : wordWrap;\n const font = style.toFontString();\n const fontProperties = TextMetrics.measureFont(font);\n\n // fallback in case UA disallow canvas data extraction\n // (toDataURI, getImageData functions)\n if (fontProperties.fontSize === 0)\n {\n fontProperties.fontSize = style.fontSize as number;\n fontProperties.ascent = style.fontSize as number;\n }\n\n const context = canvas.getContext('2d');\n\n context.font = font;\n\n const outputText = wordWrap ? TextMetrics.wordWrap(text, style, canvas) : text;\n const lines = outputText.split(/(?:\\r\\n|\\r|\\n)/);\n const lineWidths = new Array<number>(lines.length);\n let maxLineWidth = 0;\n\n for (let i = 0; i < lines.length; i++)\n {\n const lineWidth = context.measureText(lines[i]).width + ((lines[i].length - 1) * style.letterSpacing);\n\n lineWidths[i] = lineWidth;\n maxLineWidth = Math.max(maxLineWidth, lineWidth);\n }\n let width = maxLineWidth + style.strokeThickness;\n\n if (style.dropShadow)\n {\n width += style.dropShadowDistance;\n }\n\n const lineHeight = style.lineHeight || fontProperties.fontSize + style.strokeThickness;\n let height = Math.max(lineHeight, fontProperties.fontSize + style.strokeThickness)\n + ((lines.length - 1) * (lineHeight + style.leading));\n\n if (style.dropShadow)\n {\n height += style.dropShadowDistance;\n }\n\n return new TextMetrics(\n text,\n style,\n width,\n height,\n lines,\n lineWidths,\n lineHeight + style.leading,\n maxLineWidth,\n fontProperties\n );\n }\n\n /**\n * Applies newlines to a string to have it optimally fit into the horizontal\n * bounds set by the Text object's wordWrapWidth property.\n * @param text - String to apply word wrapping to\n * @param style - the style to use when wrapping\n * @param canvas - optional specification of the canvas to use for measuring.\n * @returns New string with new lines applied where required\n */\n private static wordWrap(\n text: string,\n style: TextStyle,\n canvas: HTMLCanvasElement | OffscreenCanvas = TextMetrics._canvas\n ): string\n {\n const context = canvas.getContext('2d');\n\n let width = 0;\n let line = '';\n let lines = '';\n\n const cache: CharacterWidthCache = Object.create(null);\n const { letterSpacing, whiteSpace } = style;\n\n // How to handle whitespaces\n const collapseSpaces = TextMetrics.collapseSpaces(whiteSpace);\n const collapseNewlines = TextMetrics.collapseNewlines(whiteSpace);\n\n // whether or not spaces may be added to the beginning of lines\n let canPrependSpaces = !collapseSpaces;\n\n // There is letterSpacing after every char except the last one\n // t_h_i_s_' '_i_s_' '_a_n_' '_e_x_a_m_p_l_e_' '_!\n // so for convenience the above needs to be compared to width + 1 extra letterSpace\n // t_h_i_s_' '_i_s_' '_a_n_' '_e_x_a_m_p_l_e_' '_!_\n // ________________________________________________\n // And then the final space is simply no appended to each line\n const wordWrapWidth = style.wordWrapWidth + letterSpacing;\n\n // break text into words, spaces and newline chars\n const tokens = TextMetrics.tokenize(text);\n\n for (let i = 0; i < tokens.length; i++)\n {\n // get the word, space or newlineChar\n let token = tokens[i];\n\n // if word is a new line\n if (TextMetrics.isNewline(token))\n {\n // keep the new line\n if (!collapseNewlines)\n {\n lines += TextMetrics.addLine(line);\n canPrependSpaces = !collapseSpaces;\n line = '';\n width = 0;\n continue;\n }\n\n // if we should collapse new lines\n // we simply convert it into a space\n token = ' ';\n }\n\n // if we should collapse repeated whitespaces\n if (collapseSpaces)\n {\n // check both this and the last tokens for spaces\n const currIsBreakingSpace = TextMetrics.isBreakingSpace(token);\n const lastIsBreakingSpace = TextMetrics.isBreakingSpace(line[line.length - 1]);\n\n if (currIsBreakingSpace && lastIsBreakingSpace)\n {\n continue;\n }\n }\n\n // get word width from cache if possible\n const tokenWidth = TextMetrics.getFromCache(token, letterSpacing, cache, context);\n\n // word is longer than desired bounds\n if (tokenWidth > wordWrapWidth)\n {\n // if we are not already at the beginning of a line\n if (line !== '')\n {\n // start newlines for overflow words\n lines += TextMetrics.addLine(line);\n line = '';\n width = 0;\n }\n\n // break large word over multiple lines\n if (TextMetrics.canBreakWords(token, style.breakWords))\n {\n // break word into characters\n const characters = TextMetrics.wordWrapSplit(token);\n\n // loop the characters\n for (let j = 0; j < characters.length; j++)\n {\n let char = characters[j];\n\n let k = 1;\n // we are not at the end of the token\n\n while (characters[j + k])\n {\n const nextChar = characters[j + k];\n const lastChar = char[char.length - 1];\n\n // should not split chars\n if (!TextMetrics.canBreakChars(lastChar, nextChar, token, j, style.breakWords))\n {\n // combine chars & move forward one\n char += nextChar;\n }\n else\n {\n break;\n }\n\n k++;\n }\n\n j += char.length - 1;\n\n const characterWidth = TextMetrics.getFromCache(char, letterSpacing, cache, context);\n\n if (characterWidth + width > wordWrapWidth)\n {\n lines += TextMetrics.addLine(line);\n canPrependSpaces = false;\n line = '';\n width = 0;\n }\n\n line += char;\n width += characterWidth;\n }\n }\n\n // run word out of the bounds\n else\n {\n // if there are words in this line already\n // finish that line and start a new one\n if (line.length > 0)\n {\n lines += TextMetrics.addLine(line);\n line = '';\n width = 0;\n }\n\n const isLastToken = i === tokens.length - 1;\n\n // give it its own line if it's not the end\n lines += TextMetrics.addLine(token, !isLastToken);\n canPrependSpaces = false;\n line = '';\n width = 0;\n }\n }\n\n // word could fit\n else\n {\n // word won't fit because of existing words\n // start a new line\n if (tokenWidth + width > wordWrapWidth)\n {\n // if its a space we don't want it\n canPrependSpaces = false;\n\n // add a new line\n lines += TextMetrics.addLine(line);\n\n // start a new line\n line = '';\n width = 0;\n }\n\n // don't add spaces to the beginning of lines\n if (line.length > 0 || !TextMetrics.isBreakingSpace(token) || canPrependSpaces)\n {\n // add the word to the current line\n line += token;\n\n // update width counter\n width += tokenWidth;\n }\n }\n }\n\n lines += TextMetrics.addLine(line, false);\n\n return lines;\n }\n\n /**\n * Convienience function for logging each line added during the wordWrap method.\n * @param line - The line of text to add\n * @param newLine - Add new line character to end\n * @returns A formatted line\n */\n private static addLine(line: string, newLine = true): string\n {\n line = TextMetrics.trimRight(line);\n\n line = (newLine) ? `${line}\\n` : line;\n\n return line;\n }\n\n /**\n * Gets & sets the widths of calculated characters in a cache object\n * @param key - The key\n * @param letterSpacing - The letter spacing\n * @param cache - The cache\n * @param context - The canvas context\n * @returns The from cache.\n */\n private static getFromCache(key: string, letterSpacing: number, cache: CharacterWidthCache,\n context: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D): number\n {\n let width = cache[key];\n\n if (typeof width !== 'number')\n {\n const spacing = ((key.length) * letterSpacing);\n\n width = context.measureText(key).width + spacing;\n cache[key] = width;\n }\n\n return width;\n }\n\n /**\n * Determines whether we should collapse breaking spaces.\n * @param whiteSpace - The TextStyle property whiteSpace\n * @returns Should collapse\n */\n private static collapseSpaces(whiteSpace: TextStyleWhiteSpace): boolean\n {\n return (whiteSpace === 'normal' || whiteSpace === 'pre-line');\n }\n\n /**\n * Determines whether we should collapse newLine chars.\n * @param whiteSpace - The white space\n * @returns should collapse\n */\n private static collapseNewlines(whiteSpace: TextStyleWhiteSpace): boolean\n {\n return (whiteSpace === 'normal');\n }\n\n /**\n * Trims breaking whitespaces from string.\n * @param text - The text\n * @returns Trimmed string\n */\n private static trimRight(text: string): string\n {\n if (typeof text !== 'string')\n {\n return '';\n }\n\n for (let i = text.length - 1; i >= 0; i--)\n {\n const char = text[i];\n\n if (!TextMetrics.isBreakingSpace(char))\n {\n break;\n }\n\n text = text.slice(0, -1);\n }\n\n return text;\n }\n\n /**\n * Determines if char is a newline.\n * @param char - The character\n * @returns True if newline, False otherwise.\n */\n private static isNewline(char: string): boolean\n {\n if (typeof char !== 'string')\n {\n return false;\n }\n\n return (TextMetrics._newlines.indexOf(char.charCodeAt(0)) >= 0);\n }\n\n /**\n * Determines if char is a breaking whitespace.\n *\n * It allows one to determine whether char should be a breaking whitespace\n * For example certain characters in CJK langs or numbers.\n * It must return a boolean.\n * @param char - The character\n * @param [_nextChar] - The next character\n * @returns True if whitespace, False otherwise.\n */\n static isBreakingSpace(char: string, _nextChar?: string): boolean\n {\n if (typeof char !== 'string')\n {\n return false;\n }\n\n return (TextMetrics._breakingSpaces.indexOf(char.charCodeAt(0)) >= 0);\n }\n\n /**\n * Splits a string into words, breaking-spaces and newLine characters\n * @param text - The text\n * @returns A tokenized array\n */\n private static tokenize(text: string): string[]\n {\n const tokens: string[] = [];\n let token = '';\n\n if (typeof text !== 'string')\n {\n return tokens;\n }\n\n for (let i = 0; i < text.length; i++)\n {\n const char = text[i];\n const nextChar = text[i + 1];\n\n if (TextMetrics.isBreakingSpace(char, nextChar) || TextMetrics.isNewline(char))\n {\n if (token !== '')\n {\n tokens.push(token);\n token = '';\n }\n\n tokens.push(char);\n\n continue;\n }\n\n token += char;\n }\n\n if (token !== '')\n {\n tokens.push(token);\n }\n\n return tokens;\n }\n\n /**\n * Overridable helper method used internally by TextMetrics, exposed to allow customizing the class's behavior.\n *\n * It allows one to customise which words should break\n * Examples are if the token is CJK or numbers.\n * It must return a boolean.\n * @param _token - The token\n * @param breakWords - The style attr break words\n * @returns Whether to break word or not\n */\n static canBreakWords(_token: string, breakWords: boolean): boolean\n {\n return breakWords;\n }\n\n /**\n * Overridable helper method used internally by TextMetrics, exposed to allow customizing the class's behavior.\n *\n * It allows one to determine whether a pair of characters\n * should be broken by newlines\n * For example certain characters in CJK langs or numbers.\n * It must return a boolean.\n * @param _char - The character\n * @param _nextChar - The next character\n * @param _token - The token/word the characters are from\n * @param _index - The index in the token of the char\n * @param _breakWords - The style attr break words\n * @returns whether to break word or not\n */\n static canBreakChars(_char: string, _nextChar: string, _token: string, _index: number,\n _breakWords: boolean): boolean\n {\n return true;\n }\n\n /**\n * Overridable helper method used internally by TextMetrics, exposed to allow customizing the class's behavior.\n *\n * It is called when a token (usually a word) has to be split into separate pieces\n * in order to determine the point to break a word.\n * It must return an array of characters.\n * @example\n * // Correctly splits emojis, eg \"🤪🤪\" will result in two element array, each with one emoji.\n * TextMetrics.wordWrapSplit = (token) => [...token];\n * @param token - The token to split\n * @returns The characters of the token\n */\n static wordWrapSplit(token: string): string[]\n {\n return token.split('');\n }\n\n /**\n * Calculates the ascent, descent and fontSize of a given font-style\n * @param font - String representing the style of the font\n * @returns Font properties object\n */\n public static measureFont(font: string): IFontMetrics\n {\n // as this method is used for preparing assets, don't recalculate things if we don't need to\n if (TextMetrics._fonts[font])\n {\n return TextMetrics._fonts[font];\n }\n\n const properties: IFontMetrics = {\n ascent: 0,\n descent: 0,\n fontSize: 0,\n };\n\n const canvas = TextMetrics._canvas;\n const context = TextMetrics._context;\n\n context.font = font;\n\n const metricsString = TextMetrics.METRICS_STRING + TextMetrics.BASELINE_SYMBOL;\n const width = Math.ceil(context.measureText(metricsString).width);\n let baseline = Math.ceil(context.measureText(TextMetrics.BASELINE_SYMBOL).width);\n const height = Math.ceil(TextMetrics.HEIGHT_MULTIPLIER * baseline);\n\n baseline = baseline * TextMetrics.BASELINE_MULTIPLIER | 0;\n\n canvas.width = width;\n canvas.height = height;\n\n context.fillStyle = '#f00';\n context.fillRect(0, 0, width, height);\n\n context.font = font;\n\n context.textBaseline = 'alphabetic';\n context.fillStyle = '#000';\n context.fillText(metricsString, 0, baseline);\n\n const imagedata = context.getImageData(0, 0, width, height).data;\n const pixels = imagedata.length;\n const line = width * 4;\n\n let i = 0;\n let idx = 0;\n let stop = false;\n\n // ascent. scan from top to bottom until we find a non red pixel\n for (i = 0; i < baseline; ++i)\n {\n for (let j = 0; j < line; j += 4)\n {\n if (imagedata[idx + j] !== 255)\n {\n stop = true;\n break;\n }\n }\n if (!stop)\n {\n idx += line;\n }\n else\n {\n break;\n }\n }\n\n properties.ascent = baseline - i;\n\n idx = pixels - line;\n stop = false;\n\n // descent. scan from bottom to top until we find a non red pixel\n for (i = height; i > baseline; --i)\n {\n for (let j = 0; j < line; j += 4)\n {\n if (imagedata[idx + j] !== 255)\n {\n stop = true;\n break;\n }\n }\n\n if (!stop)\n {\n idx -= line;\n }\n else\n {\n break;\n }\n }\n\n properties.descent = i - baseline;\n properties.fontSize = properties.ascent + properties.descent;\n\n TextMetrics._fonts[font] = properties;\n\n return properties;\n }\n\n /**\n * Clear font metrics in metrics cache.\n * @param {string} [font] - font name. If font name not set then clear cache for all fonts.\n */\n public static clearMetrics(font = ''): void\n {\n if (font)\n {\n delete TextMetrics._fonts[font];\n }\n else\n {\n TextMetrics._fonts = {};\n }\n }\n\n /**\n * Cached canvas element for measuring text\n * TODO: this should be private, but isn't because of backward compat, will fix later.\n * @ignore\n */\n public static get _canvas(): HTMLCanvasElement | OffscreenCanvas\n {\n if (!TextMetrics.__canvas)\n {\n let canvas: HTMLCanvasElement | OffscreenCanvas;\n\n try\n {\n // OffscreenCanvas2D measureText can be up to 40% faster.\n const c = new OffscreenCanvas(0, 0);\n const context = c.getContext('2d');\n\n if (context && context.measureText)\n {\n TextMetrics.__canvas = c;\n\n return c;\n }\n\n canvas = settings.ADAPTER.createCanvas();\n }\n catch (ex)\n {\n canvas = settings.ADAPTER.createCanvas();\n }\n canvas.width = canvas.height = 10;\n TextMetrics.__canvas = canvas;\n }\n\n return TextMetrics.__canvas;\n }\n\n /**\n * TODO: this should be private, but isn't because of backward compat, will fix later.\n * @ignore\n */\n public static get _context(): CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D\n {\n if (!TextMetrics.__context)\n {\n TextMetrics.__context = TextMetrics._canvas.getContext('2d');\n }\n\n return TextMetrics.__context;\n }\n}\n\n/**\n * Internal return object for {@link PIXI.TextMetrics.measureFont `TextMetrics.measureFont`}.\n * @typedef {object} FontMetrics\n * @property {number} ascent - The ascent distance\n * @property {number} descent - The descent distance\n * @property {number} fontSize - Font size from ascent to descent\n * @memberof PIXI.TextMetrics\n * @private\n */\n\n/**\n * Cache of {@see PIXI.TextMetrics.FontMetrics} objects.\n * @memberof PIXI.TextMetrics\n * @type {object}\n * @private\n */\nTextMetrics._fonts = {};\n\n/**\n * String used for calculate font metrics.\n * These characters are all tall to help calculate the height required for text.\n * @static\n * @memberof PIXI.TextMetrics\n * @name METRICS_STRING\n * @type {string}\n * @default |ÉqÅ\n */\nTextMetrics.METRICS_STRING = '|ÉqÅ';\n\n/**\n * Baseline symbol for calculate font metrics.\n * @static\n * @memberof PIXI.TextMetrics\n * @name BASELINE_SYMBOL\n * @type {string}\n * @default M\n */\nTextMetrics.BASELINE_SYMBOL = 'M';\n\n/**\n * Baseline multiplier for calculate font metrics.\n * @static\n * @memberof PIXI.TextMetrics\n * @name BASELINE_MULTIPLIER\n * @type {number}\n * @default 1.4\n */\nTextMetrics.BASELINE_MULTIPLIER = 1.4;\n\n/**\n * Height multiplier for setting height of canvas to calculate font metrics.\n * @static\n * @memberof PIXI.TextMetrics\n * @name HEIGHT_MULTIPLIER\n * @type {number}\n * @default 2.00\n */\nTextMetrics.HEIGHT_MULTIPLIER = 2.0;\n\n/**\n * Cache of new line chars.\n * @memberof PIXI.TextMetrics\n * @type {number[]}\n * @private\n */\nTextMetrics._newlines = [\n 0x000A, // line feed\n 0x000D, // carriage return\n];\n\n/**\n * Cache of breaking spaces.\n * @memberof PIXI.TextMetrics\n * @type {number[]}\n * @private\n */\nTextMetrics._breakingSpaces = [\n 0x0009, // character tabulation\n 0x0020, // space\n 0x2000, // en quad\n 0x2001, // em quad\n 0x2002, // en space\n 0x2003, // em space\n 0x2004, // three-per-em space\n 0x2005, // four-per-em space\n 0x2006, // six-per-em space\n 0x2008, // punctuation space\n 0x2009, // thin space\n 0x200A, // hair space\n 0x205F, // medium mathematical space\n 0x3000, // ideographic space\n];\n\n/**\n * A number, or a string containing a number.\n * @memberof PIXI\n * @typedef {object} IFontMetrics\n * @property {number} ascent - Font ascent\n * @property {number} descent - Font descent\n * @property {number} fontSize - Font size\n */\n","/* eslint max-depth: [2, 8] */\nimport { Sprite } from '@pixi/sprite';\nimport { Texture } from '@pixi/core';\nimport { settings } from '@pixi/settings';\nimport { Rectangle } from '@pixi/math';\nimport { sign, trimCanvas, hex2rgb, string2hex } from '@pixi/utils';\nimport { TEXT_GRADIENT } from './const';\nimport { TextStyle } from './TextStyle';\nimport { TextMetrics } from './TextMetrics';\n\nimport type { IDestroyOptions } from '@pixi/display';\nimport type { Renderer } from '@pixi/core';\nimport type { ITextStyle } from './TextStyle';\n\nconst defaultDestroyOptions: IDestroyOptions = {\n texture: true,\n children: false,\n baseTexture: true,\n};\n\ninterface ModernContext2D extends CanvasRenderingContext2D\n{\n // for chrome less 94\n textLetterSpacing?: number;\n // for chrome greater 94\n letterSpacing?: number;\n}\n\n/**\n * A Text Object will create a line or multiple lines of text.\n *\n * The text is created using the [Canvas API](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API).\n *\n * The primary advantage of this class over BitmapText is that you have great control over the style of the text,\n * which you can change at runtime.\n *\n * The primary disadvantages is that each piece of text has it's own texture, which can use more memory.\n * When text changes, this texture has to be re-generated and re-uploaded to the GPU, taking up time.\n *\n * To split a line you can use '\\n' in your text string, or, on the `style` object,\n * change its `wordWrap` property to true and and give the `wordWrapWidth` property a value.\n *\n * A Text can be created directly from a string and a style object,\n * which can be generated [here](https://pixijs.io/pixi-text-style).\n *\n * ```js\n * let text = new PIXI.Text('This is a PixiJS text',{fontFamily : 'Arial', fontSize: 24, fill : 0xff1010, align : 'center'});\n * ```\n * @memberof PIXI\n */\nexport class Text extends Sprite\n{\n /**\n * New behavior for `lineHeight` that's meant to mimic HTML text. A value of `true` will\n * make sure the first baseline is offset by the `lineHeight` value if it is greater than `fontSize`.\n * A value of `false` will use the legacy behavior and not change the baseline of the first line.\n * In the next major release, we'll enable this by default.\n */\n public static nextLineHeightBehavior = false;\n\n /**\n * New rendering behavior for letter-spacing which uses Chrome's new native API. This will\n * lead to more accurate letter-spacing results because it does not try to manually draw\n * each character. However, this Chrome API is experimental and may not serve all cases yet.\n */\n public static experimentalLetterSpacing = false;\n\n /** The canvas element that everything is drawn to. */\n public canvas: HTMLCanvasElement;\n /** The canvas 2d context that everything is drawn with. */\n public context: ModernContext2D;\n public localStyleID: number;\n public dirty: boolean;\n\n /**\n * The resolution / device pixel ratio of the canvas.\n *\n * This is set to automatically match the renderer resolution by default, but can be overridden by setting manually.\n * @default PIXI.settings.RESOLUTION\n */\n _resolution: number;\n _autoResolution: boolean;\n\n /**\n * Private tracker for the current text.\n * @private\n */\n protected _text: string;\n\n /**\n * Private tracker for the current font.\n * @private\n */\n protected _font: string;\n\n /**\n * Private tracker for the current style.\n * @private\n */\n protected _style: TextStyle;\n\n /**\n * Private listener to track style changes.\n * @private\n */\n protected _styleListener: () => void;\n\n /**\n * Keep track if this Text object created it's own canvas\n * element (`true`) or uses the constructor argument (`false`).\n * Used to workaround a GC issues with Safari < 13 when\n * destroying Text. See `destroy` for more info.\n */\n private _ownCanvas: boolean;\n\n /**\n * @param text - The string that you would like the text to display\n * @param {object|PIXI.TextStyle} [style] - The style parameters\n * @param canvas - The canvas element for drawing text\n */\n constructor(text?: string | number, style?: Partial<ITextStyle> | TextStyle, canvas?: HTMLCanvasElement)\n {\n let ownCanvas = false;\n\n if (!canvas)\n {\n canvas = settings.ADAPTER.createCanvas();\n ownCanvas = true;\n }\n\n canvas.width = 3;\n canvas.height = 3;\n\n const texture = Texture.from(canvas);\n\n texture.orig = new Rectangle();\n texture.trim = new Rectangle();\n\n super(texture);\n\n this._ownCanvas = ownCanvas;\n this.canvas = canvas;\n this.context = canvas.getContext('2d') as CanvasRenderingContext2D;\n\n this._resolution = settings.RESOLUTION;\n this._autoResolution = true;\n this._text = null;\n this._style = null;\n this._styleListener = null;\n this._font = '';\n\n this.text = text;\n this.style = style;\n\n this.localStyleID = -1;\n }\n\n /**\n * Renders text to its canvas, and updates its texture.\n *\n * By default this is used internally to ensure the texture is correct before rendering,\n * but it can be used called externally, for example from this class to 'pre-generate' the texture from a piece of text,\n * and then shared across multiple Sprites.\n * @param respectDirty - Whether to abort updating the text if the Text isn't dirty and the function is called.\n */\n public updateText(respectDirty: boolean): void\n {\n const style = this._style;\n\n // check if style has changed..\n if (this.localStyleID !== style.styleID)\n {\n this.dirty = true;\n this.localStyleID = style.styleID;\n }\n\n if (!this.dirty && respectDirty)\n {\n return;\n }\n\n this._font = this._style.toFontString();\n\n const context = this.context;\n const measured = TextMetrics.measureText(this._text || ' ', this._style, this._style.wordWrap, this.canvas);\n const width = measured.width;\n const height = measured.height;\n const lines = measured.lines;\n const lineHeight = measured.lineHeight;\n const lineWidths = measured.lineWidths;\n const maxLineWidth = measured.maxLineWidth;\n const fontProperties = measured.fontProperties;\n\n this.canvas.width = Math.ceil(Math.ceil((Math.max(1, width) + (style.padding * 2))) * this._resolution);\n this.canvas.height = Math.ceil(Math.ceil((Math.max(1, height) + (style.padding * 2))) * this._resolution);\n\n context.scale(this._resolution, this._resolution);\n\n context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n\n context.font = this._font;\n context.lineWidth = style.strokeThickness;\n context.textBaseline = style.textBaseline;\n context.lineJoin = style.lineJoin;\n context.miterLimit = style.miterLimit;\n\n let linePositionX: number;\n let linePositionY: number;\n\n // require 2 passes if a shadow; the first to draw the drop shadow, the second to draw the text\n const passesCount = style.dropShadow ? 2 : 1;\n\n // For v4, we drew text at the colours of the drop shadow underneath the normal text. This gave the correct zIndex,\n // but features such as alpha and shadowblur did not look right at all, since we were using actual text as a shadow.\n //\n // For v5.0.0, we moved over to just use the canvas API for drop shadows, which made them look much nicer and more\n // visually please, but now because the stroke is drawn and then the fill, drop shadows would appear on both the fill\n // and the stroke; and fill drop shadows would appear over the top of the stroke.\n //\n // For v5.1.1, the new route is to revert to v4 style of drawing text first to get the drop shadows underneath normal\n // text, but instead drawing text in the correct location, we'll draw it off screen (-paddingY), and then adjust the\n // drop shadow so only that appears on screen (+paddingY). Now we'll have the correct draw order of the shadow\n // beneath the text, whilst also having the proper text shadow styling.\n for (let i = 0; i < passesCount; ++i)\n {\n const isShadowPass = style.dropShadow && i === 0;\n // we only want the drop shadow, so put text way off-screen\n const dsOffsetText = isShadowPass ? Math.ceil(Math.max(1, height) + (style.padding * 2)) : 0;\n const dsOffsetShadow = dsOffsetText * this._resolution;\n\n if (isShadowPass)\n {\n // On Safari, text with gradient and drop shadows together do not position correctly\n // if the scale of the canvas is not 1: https://bugs.webkit.org/show_bug.cgi?id=197689\n // Therefore we'll set the styles to be a plain black whilst generating this drop shadow\n context.fillStyle = 'black';\n context.strokeStyle = 'black';\n\n const dropShadowColor = style.dropShadowColor;\n const rgb = hex2rgb(typeof dropShadowColor === 'number' ? dropShadowColor : string2hex(dropShadowColor));\n const dropShadowBlur = style.dropShadowBlur * this._resolution;\n const dropShadowDistance = style.dropShadowDistance * this._resolution;\n\n context.shadowColor = `rgba(${rgb[0] * 255},${rgb[1] * 255},${rgb[2] * 255},${style.dropShadowAlpha})`;\n context.shadowBlur = dropShadowBlur;\n context.shadowOffsetX = Math.cos(style.dropShadowAngle) * dropShadowDistance;\n context.shadowOffsetY = (Math.sin(style.dropShadowAngle) * dropShadowDistance) + dsOffsetShadow;\n }\n else\n {\n // set canvas text styles\n context.fillStyle = this._generateFillStyle(style, lines, measured);\n // TODO: Can't have different types for getter and setter. The getter shouldn't have the number type as\n // the setter converts to string. See this thread for more details:\n // https://github.com/microsoft/TypeScript/issues/2521\n context.strokeStyle = style.stroke as string;\n\n context.shadowColor = 'black';\n context.shadowBlur = 0;\n context.shadowOffsetX = 0;\n context.shadowOffsetY = 0;\n }\n\n let linePositionYShift = (lineHeight - fontProperties.fontSize) / 2;\n\n if (!Text.nextLineHeightBehavior || lineHeight - fontProperties.fontSize < 0)\n {\n linePositionYShift = 0;\n }\n\n // draw lines line by line\n for (let i = 0; i < lines.length; i++)\n {\n linePositionX = style.strokeThickness / 2;\n linePositionY = ((style.strokeThickness / 2) + (i * lineHeight)) + fontProperties.ascent\n + linePositionYShift;\n\n if (style.align === 'right')\n {\n linePositionX += maxLineWidth - lineWidths[i];\n }\n else if (style.align === 'center')\n {\n linePositionX += (maxLineWidth - lineWidths[i]) / 2;\n }\n\n if (style.stroke && style.strokeThickness)\n {\n this.drawLetterSpacing(\n lines[i],\n linePositionX + style.padding,\n linePositionY + style.padding - dsOffsetText,\n true\n );\n }\n\n if (style.fill)\n {\n this.drawLetterSpacing(\n lines[i],\n linePositionX + style.padding,\n linePositionY + style.padding - dsOffsetText\n );\n }\n }\n }\n\n this.updateTexture();\n }\n\n /**\n * Render the text with letter-spacing.\n * @param text - The text to draw\n * @param x - Horizontal position to draw the text\n * @param y - Vertical position to draw the text\n * @param isStroke - Is this drawing for the outside stroke of the\n * text? If not, it's for the inside fill\n */\n private drawLetterSpacing(text: string, x: number, y: number, isStroke = false): void\n {\n const style = this._style;\n\n // letterSpacing of 0 means normal\n const letterSpacing = style.letterSpacing;\n\n // Checking that we can use moddern canvas2D api\n // https://developer.chrome.com/origintrials/#/view_trial/3585991203293757441\n // note: this is unstable API, Chrome less 94 use a `textLetterSpacing`, newest use a letterSpacing\n // eslint-disable-next-line max-len\n const supportLetterSpacing = Text.experimentalLetterSpacing\n && ('letterSpacing' in CanvasRenderingContext2D.prototype\n || 'textLetterSpacing' in CanvasRenderingContext2D.prototype);\n\n if (letterSpacing === 0 || supportLetterSpacing)\n {\n if (supportLetterSpacing)\n {\n this.context.letterSpacing = letterSpacing;\n this.context.textLetterSpacing = letterSpacing;\n }\n\n if (isStroke)\n {\n this.context.strokeText(text, x, y);\n }\n else\n {\n this.context.fillText(text, x, y);\n }\n\n return;\n }\n\n let currentPosition = x;\n\n // Using Array.from correctly splits characters whilst keeping emoji together.\n // This is not supported on IE as it requires ES6, so regular text splitting occurs.\n // This also doesn't account for emoji that are multiple emoji put together to make something else.\n // Handling all of this would require a big library itself.\n // https://medium.com/@giltayar/iterating-over-emoji-characters-the-es6-way-f06e4589516\n // https://github.com/orling/grapheme-splitter\n const stringArray = Array.from ? Array.from(text) : text.split('');\n let previousWidth = this.context.measureText(text).width;\n let currentWidth = 0;\n\n for (let i = 0; i < stringArray.length; ++i)\n {\n const currentChar = stringArray[i];\n\n if (isStroke)\n {\n this.context.strokeText(currentChar, currentPosition, y);\n }\n else\n {\n this.context.fillText(currentChar, currentPosition, y);\n }\n let textStr = '';\n\n for (let j = i + 1; j < stringArray.length; ++j)\n {\n textStr += stringArray[j];\n }\n currentWidth = this.context.measureText(textStr).width;\n currentPosition += previousWidth - currentWidth + letterSpacing;\n previousWidth = currentWidth;\n }\n }\n\n /** Updates texture size based on canvas size. */\n private updateTexture(): void\n {\n const canvas = this.canvas;\n\n if (this._style.trim)\n {\n const trimmed = trimCanvas(canvas);\n\n if (trimmed.data)\n {\n canvas.width = trimmed.width;\n canvas.height = trimmed.height;\n this.context.putImageData(trimmed.data, 0, 0);\n }\n }\n\n const texture = this._texture;\n const style = this._style;\n const padding = style.trim ? 0 : style.padding;\n const baseTexture = texture.baseTexture;\n\n texture.trim.width = texture._frame.width = canvas.width / this._resolution;\n texture.trim.height = texture._frame.height = canvas.height / this._resolution;\n texture.trim.x = -padding;\n texture.trim.y = -padding;\n\n texture.orig.width = texture._frame.width - (padding * 2);\n texture.orig.height = texture._frame.height - (padding * 2);\n\n // call sprite onTextureUpdate to update scale if _width or _height were set\n this._onTextureUpdate();\n\n baseTexture.setRealSize(canvas.width, canvas.height, this._resolution);\n\n texture.updateUvs();\n\n this.dirty = false;\n }\n\n /**\n * Renders the object using the WebGL renderer\n * @param renderer - The renderer\n */\n protected _render(renderer: Renderer): void\n {\n if (this._autoResolution && this._resolution !== renderer.resolution)\n {\n this._resolution = renderer.resolution;\n this.dirty = true;\n }\n\n this.updateText(true);\n\n super._render(renderer);\n }\n\n /** Updates the transform on all children of this container for rendering. */\n public updateTransform(): void\n {\n this.updateText(true);\n\n super.updateTransform();\n }\n\n public getBounds(skipUpdate?: boolean, rect?: Rectangle): Rectangle\n {\n this.updateText(true);\n\n if (this._textureID === -1)\n {\n // texture was updated: recalculate transforms\n skipUpdate = false;\n }\n\n return super.getBounds(skipUpdate, rect);\n }\n\n /**\n * Gets the local bounds of the text object.\n * @param rect - The output rectangle.\n * @returns The bounds.\n */\n public getLocalBounds(rect?: Rectangle): Rectangle\n {\n this.updateText(true);\n\n return super.getLocalBounds.call(this, rect);\n }\n\n /** Calculates the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. */\n protected _calculateBounds(): void\n {\n this.calculateVertices();\n // if we have already done this on THIS frame.\n this._bounds.addQuad(this.vertexData);\n }\n\n /**\n * Generates the fill style. Can automatically generate a gradient based on the fill style being an array\n * @param style - The style.\n * @param lines - The lines of text.\n * @param metrics\n * @returns The fill style\n */\n private _generateFillStyle(\n style: TextStyle, lines: string[], metrics: TextMetrics\n ): string | CanvasGradient | CanvasPattern\n {\n // TODO: Can't have different types for getter and setter. The getter shouldn't have the number type as\n // the setter converts to string. See this thread for more details:\n // https://github.com/microsoft/TypeScript/issues/2521\n const fillStyle: string | string[] | CanvasGradient | CanvasPattern = style.fill as any;\n\n if (!Array.isArray(fillStyle))\n {\n return fillStyle;\n }\n else if (fillStyle.length === 1)\n {\n return fillStyle[0];\n }\n\n // the gradient will be evenly spaced out according to how large the array is.\n // ['#FF0000', '#00FF00', '#0000FF'] would created stops at 0.25, 0.5 and 0.75\n let gradient: string[] | CanvasGradient;\n\n // a dropshadow will enlarge the canvas and result in the gradient being\n // generated with the incorrect dimensions\n const dropShadowCorrection = (style.dropShadow) ? style.dropShadowDistance : 0;\n\n // should also take padding into account, padding can offset the gradient\n const padding = style.padding || 0;\n\n const width = (this.canvas.width / this._resolution) - dropShadowCorrection - (padding * 2);\n const height = (this.canvas.height / this._resolution) - dropShadowCorrection - (padding * 2);\n\n // make a copy of the style settings, so we can manipulate them later\n const fill = fillStyle.slice();\n const fillGradientStops = style.fillGradientStops.slice();\n\n // wanting to evenly distribute the fills. So an array of 4 colours should give fills of 0.25, 0.5 and 0.75\n if (!fillGradientStops.length)\n {\n const lengthPlus1 = fill.length + 1;\n\n for (let i = 1; i < lengthPlus1; ++i)\n {\n fillGradientStops.push(i / lengthPlus1);\n }\n }\n\n // stop the bleeding of the last gradient on the line above to the top gradient of the this line\n // by hard defining the first gradient colour at point 0, and last gradient colour at point 1\n fill.unshift(fillStyle[0]);\n fillGradientStops.unshift(0);\n\n fill.push(fillStyle[fillStyle.length - 1]);\n fillGradientStops.push(1);\n\n if (style.fillGradientType === TEXT_GRADIENT.LINEAR_VERTICAL)\n {\n // start the gradient at the top center of the canvas, and end at the bottom middle of the canvas\n gradient = this.context.createLinearGradient(width / 2, padding, width / 2, height + padding);\n\n // we need to repeat the gradient so that each individual line of text has the same vertical gradient effect\n // ['#FF0000', '#00FF00', '#0000FF'] over 2 lines would create stops at 0.125, 0.25, 0.375, 0.625, 0.75, 0.875\n\n // Actual height of the text itself, not counting spacing for lineHeight/leading/dropShadow etc\n const textHeight = metrics.fontProperties.fontSize + style.strokeThickness;\n\n for (let i = 0; i < lines.length; i++)\n {\n const lastLineBottom = (metrics.lineHeight * (i - 1)) + textHeight;\n const thisLineTop = metrics.lineHeight * i;\n let thisLineGradientStart = thisLineTop;\n\n // Handle case where last & this line overlap\n if (i > 0 && lastLineBottom > thisLineTop)\n {\n thisLineGradientStart = (thisLineTop + lastLineBottom) / 2;\n }\n\n const thisLineBottom = thisLineTop + textHeight;\n const nextLineTop = metrics.lineHeight * (i + 1);\n let thisLineGradientEnd = thisLineBottom;\n\n // Handle case where this & next line overlap\n if (i + 1 < lines.length && nextLineTop < thisLineBottom)\n {\n thisLineGradientEnd = (thisLineBottom + nextLineTop) / 2;\n }\n\n // textHeight, but as a 0-1 size in global gradient stop space\n const gradStopLineHeight = (thisLineGradientEnd - thisLineGradientStart) / height;\n\n for (let j = 0; j < fill.length; j++)\n {\n // 0-1 stop point for the current line, multiplied to global space afterwards\n let lineStop = 0;\n\n if (typeof fillGradientStops[j] === 'number')\n {\n lineStop = fillGradientStops[j];\n }\n else\n {\n lineStop = j / fill.length;\n }\n\n let globalStop = Math.min(1, Math.max(0,\n (thisLineGradientStart / height) + (lineStop * gradStopLineHeight)));\n\n // There's potential for floating point precision issues at the seams between gradient repeats.\n globalStop = Number(globalStop.toFixed(5));\n gradient.addColorStop(globalStop, fill[j]);\n }\n }\n }\n else\n {\n // start the gradient at the center left of the canvas, and end at the center right of the canvas\n gradient = this.context.createLinearGradient(padding, height / 2, width + padding, height / 2);\n\n // can just evenly space out the gradients in this case, as multiple lines makes no difference\n // to an even left to right gradient\n const totalIterations = fill.length + 1;\n let currentIteration = 1;\n\n for (let i = 0; i < fill.length; i++)\n {\n let stop: number;\n\n if (typeof fillGradientStops[i] === 'number')\n {\n stop = fillGradientStops[i];\n }\n else\n {\n stop = currentIteration / totalIterations;\n }\n gradient.addColorStop(stop, fill[i]);\n currentIteration++;\n }\n }\n\n return gradient;\n }\n\n /**\n * Destroys this text object.\n *\n * Note* Unlike a Sprite, a Text object will automatically destroy its baseTexture and texture as\n * the majority of the time the texture will not be shared with any other Sprites.\n * @param options - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have their\n * destroy method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=true] - Should it destroy the current texture of the sprite as well\n * @param {boolean} [options.baseTexture=true] - Should it destroy the base texture of the sprite as well\n */\n public destroy(options?: IDestroyOptions | boolean): void\n {\n if (typeof options === 'boolean')\n {\n options = { children: options };\n }\n\n options = Object.assign({}, defaultDestroyOptions, options);\n\n super.destroy(options);\n\n // set canvas width and height to 0 to workaround memory leak in Safari < 13\n // https://stackoverflow.com/questions/52532614/total-canvas-memory-use-exceeds-the-maximum-limit-safari-12\n if (this._ownCanvas)\n {\n this.canvas.height = this.canvas.width = 0;\n }\n\n // make sure to reset the context and canvas.. dont want this hanging around in memory!\n this.context = null;\n this.canvas = null;\n\n this._style = null;\n }\n\n /** The width of the Text, setting this will actually modify the scale to achieve the value set. */\n get width(): number\n {\n this.updateText(true);\n\n return Math.abs(this.scale.x) * this._texture.orig.width;\n }\n\n set width(value: number)\n {\n this.updateText(true);\n\n const s = sign(this.scale.x) || 1;\n\n this.scale.x = s * value / this._texture.orig.width;\n this._width = value;\n }\n\n /** The height of the Text, setting this will actually modify the scale to achieve the value set. */\n get height(): number\n {\n this.updateText(true);\n\n return Math.abs(this.scale.y) * this._texture.orig.height;\n }\n\n set height(value: number)\n {\n this.updateText(true);\n\n const s = sign(this.scale.y) || 1;\n\n this.scale.y = s * value / this._texture.orig.height;\n this._height = value;\n }\n\n /**\n * Set the style of the text.\n *\n * Set up an event listener to listen for changes on the style object and mark the text as dirty.\n */\n get style(): TextStyle | Partial<ITextStyle>\n {\n // TODO: Can't have different types for getter and setter. The getter shouldn't have the ITextStyle\n // since the setter creates the TextStyle. See this thread for more details:\n // https://github.com/microsoft/TypeScript/issues/2521\n return this._style;\n }\n\n set style(style: TextStyle | Partial<ITextStyle>)\n {\n style = style || {};\n\n if (style instanceof TextStyle)\n {\n this._style = style;\n }\n else\n {\n this._style = new TextStyle(style);\n }\n\n this.localStyleID = -1;\n this.dirty = true;\n }\n\n /** Set the copy for the text object. To split a line you can use '\\n'. */\n get text(): string\n {\n return this._text;\n }\n\n set text(text: string | number)\n {\n text = String(text === null || text === undefined ? '' : text);\n\n if (this._text === text)\n {\n return;\n }\n this._text = text;\n this.dirty = true;\n }\n\n /**\n * The resolution / device pixel ratio of the canvas.\n *\n * This is set to automatically match the renderer resolution by default, but can be overridden by setting manually.\n * @default 1\n */\n get resolution(): number\n {\n return this._resolution;\n }\n\n set resolution(value: number)\n {\n this._autoResolution = false;\n\n if (this._resolution === value)\n {\n return;\n }\n\n this._resolution = value;\n this.dirty = true;\n }\n}\n","/**\n * Represents the update priorities used by internal PIXI classes when registered with\n * the {@link PIXI.Ticker} object. Higher priority items are updated first and lower\n * priority items, such as render, should go later.\n * @static\n * @constant\n * @name UPDATE_PRIORITY\n * @memberof PIXI\n * @enum {number}\n * @property {number} [INTERACTION=50] Highest priority, used for {@link PIXI.InteractionManager}\n * @property {number} [HIGH=25] High priority updating, {@link PIXI.VideoBaseTexture} and {@link PIXI.AnimatedSprite}\n * @property {number} [NORMAL=0] Default priority for ticker events, see {@link PIXI.Ticker#add}.\n * @property {number} [LOW=-25] Low priority used for {@link PIXI.Application} rendering.\n * @property {number} [UTILITY=-50] Lowest priority used for {@link PIXI.BasePrepare} utility.\n */\nexport enum UPDATE_PRIORITY\n// eslint-disable-next-line @typescript-eslint/indent\n{\n INTERACTION = 50,\n HIGH = 25,\n NORMAL = 0,\n LOW = -25,\n UTILITY = -50,\n}\n","import { settings } from '@pixi/settings';\n\n/**\n * Target frames per millisecond.\n * @static\n * @name TARGET_FPMS\n * @memberof PIXI.settings\n * @type {number}\n * @default 0.06\n */\nsettings.TARGET_FPMS = 0.06;\n\nexport { settings };\n","import type { TickerCallback } from './Ticker';\n\n/**\n * Internal class for handling the priority sorting of ticker handlers.\n * @private\n * @class\n * @memberof PIXI\n */\nexport class TickerListener<T = any>\n{\n /** The current priority. */\n public priority: number;\n /** The next item in chain. */\n public next: TickerListener = null;\n /** The previous item in chain. */\n public previous: TickerListener = null;\n\n /** The handler function to execute. */\n private fn: TickerCallback<T>;\n /** The calling to execute. */\n private context: T;\n /** If this should only execute once. */\n private once: boolean;\n /** `true` if this listener has been destroyed already. */\n private _destroyed = false;\n\n /**\n * Constructor\n * @private\n * @param fn - The listener function to be added for one update\n * @param context - The listener context\n * @param priority - The priority for emitting\n * @param once - If the handler should fire once\n */\n constructor(fn: TickerCallback<T>, context: T = null, priority = 0, once = false)\n {\n this.fn = fn;\n this.context = context;\n this.priority = priority;\n this.once = once;\n }\n\n /**\n * Simple compare function to figure out if a function and context match.\n * @private\n * @param fn - The listener function to be added for one update\n * @param context - The listener context\n * @returns `true` if the listener match the arguments\n */\n match(fn: TickerCallback<T>, context: any = null): boolean\n {\n return this.fn === fn && this.context === context;\n }\n\n /**\n * Emit by calling the current function.\n * @private\n * @param deltaTime - time since the last emit.\n * @returns Next ticker\n */\n emit(deltaTime: number): TickerListener\n {\n if (this.fn)\n {\n if (this.context)\n {\n this.fn.call(this.context, deltaTime);\n }\n else\n {\n (this as TickerListener<any>).fn(deltaTime);\n }\n }\n\n const redirect = this.next;\n\n if (this.once)\n {\n this.destroy(true);\n }\n\n // Soft-destroying should remove\n // the next reference\n if (this._destroyed)\n {\n this.next = null;\n }\n\n return redirect;\n }\n\n /**\n * Connect to the list.\n * @private\n * @param previous - Input node, previous listener\n */\n connect(previous: TickerListener): void\n {\n this.previous = previous;\n if (previous.next)\n {\n previous.next.previous = this;\n }\n this.next = previous.next;\n previous.next = this;\n }\n\n /**\n * Destroy and don't use after this.\n * @private\n * @param hard - `true` to remove the `next` reference, this\n * is considered a hard destroy. Soft destroy maintains the next reference.\n * @returns The listener to redirect while emitting or removing.\n */\n destroy(hard = false): TickerListener\n {\n this._destroyed = true;\n this.fn = null;\n this.context = null;\n\n // Disconnect, hook up next and previous\n if (this.previous)\n {\n this.previous.next = this.next;\n }\n\n if (this.next)\n {\n this.next.previous = this.previous;\n }\n\n // Redirect to the next item\n const redirect = this.next;\n\n // Remove references\n this.next = hard ? null : redirect;\n this.previous = null;\n\n return redirect;\n }\n}\n","import { settings } from './settings';\nimport { UPDATE_PRIORITY } from './const';\nimport { TickerListener } from './TickerListener';\n\nexport type TickerCallback<T> = (this: T, dt: number) => any;\n\n/**\n * A Ticker class that runs an update loop that other objects listen to.\n *\n * This class is composed around listeners meant for execution on the next requested animation frame.\n * Animation frames are requested only when necessary, e.g. When the ticker is started and the emitter has listeners.\n * @class\n * @memberof PIXI\n */\nexport class Ticker\n{\n /** The private shared ticker instance */\n private static _shared: Ticker;\n /** The private system ticker instance */\n private static _system: Ticker;\n\n /**\n * Whether or not this ticker should invoke the method\n * {@link PIXI.Ticker#start} automatically\n * when a listener is added.\n */\n public autoStart = false;\n /**\n * Scalar time value from last frame to this frame.\n * This value is capped by setting {@link PIXI.Ticker#minFPS}\n * and is scaled with {@link PIXI.Ticker#speed}.\n * **Note:** The cap may be exceeded by scaling.\n */\n public deltaTime = 1;\n /**\n * Scaler time elapsed in milliseconds from last frame to this frame.\n * This value is capped by setting {@link PIXI.Ticker#minFPS}\n * and is scaled with {@link PIXI.Ticker#speed}.\n * **Note:** The cap may be exceeded by scaling.\n * If the platform supports DOMHighResTimeStamp,\n * this value will have a precision of 1 µs.\n * Defaults to target frame time\n * @default 16.66\n */\n public deltaMS: number;\n /**\n * Time elapsed in milliseconds from last frame to this frame.\n * Opposed to what the scalar {@link PIXI.Ticker#deltaTime}\n * is based, this value is neither capped nor scaled.\n * If the platform supports DOMHighResTimeStamp,\n * this value will have a precision of 1 µs.\n * Defaults to target frame time\n * @default 16.66\n */\n public elapsedMS: number;\n /**\n * The last time {@link PIXI.Ticker#update} was invoked.\n * This value is also reset internally outside of invoking\n * update, but only when a new animation frame is requested.\n * If the platform supports DOMHighResTimeStamp,\n * this value will have a precision of 1 µs.\n */\n public lastTime = -1;\n /**\n * Factor of current {@link PIXI.Ticker#deltaTime}.\n * @example\n * // Scales ticker.deltaTime to what would be\n * // the equivalent of approximately 120 FPS\n * ticker.speed = 2;\n */\n public speed = 1;\n /**\n * Whether or not this ticker has been started.\n * `true` if {@link PIXI.Ticker#start} has been called.\n * `false` if {@link PIXI.Ticker#stop} has been called.\n * While `false`, this value may change to `true` in the\n * event of {@link PIXI.Ticker#autoStart} being `true`\n * and a listener is added.\n */\n public started = false;\n\n /** The first listener. All new listeners added are chained on this. */\n private _head: TickerListener;\n /** Internal current frame request ID */\n private _requestId: number = null;\n /**\n * Internal value managed by minFPS property setter and getter.\n * This is the maximum allowed milliseconds between updates.\n */\n private _maxElapsedMS = 100;\n /**\n * Internal value managed by minFPS property setter and getter.\n * This is the minimum allowed milliseconds between updates.\n */\n private _minElapsedMS = 0;\n /** If enabled, deleting is disabled.*/\n private _protected = false;\n /** The last time keyframe was executed. Maintains a relatively fixed interval with the previous value. */\n private _lastFrame = -1;\n /**\n * Internal tick method bound to ticker instance.\n * This is because in early 2015, Function.bind\n * is still 60% slower in high performance scenarios.\n * Also separating frame requests from update method\n * so listeners may be called at any time and with\n * any animation API, just invoke ticker.update(time).\n * @param time - Time since last tick.\n */\n private _tick: (time: number) => any;\n\n constructor()\n {\n this._head = new TickerListener(null, null, Infinity);\n this.deltaMS = 1 / settings.TARGET_FPMS;\n this.elapsedMS = 1 / settings.TARGET_FPMS;\n\n this._tick = (time: number): void =>\n {\n this._requestId = null;\n\n if (this.started)\n {\n // Invoke listeners now\n this.update(time);\n // Listener side effects may have modified ticker state.\n if (this.started && this._requestId === null && this._head.next)\n {\n this._requestId = requestAnimationFrame(this._tick);\n }\n }\n };\n }\n\n /**\n * Conditionally requests a new animation frame.\n * If a frame has not already been requested, and if the internal\n * emitter has listeners, a new frame is requested.\n * @private\n */\n private _requestIfNeeded(): void\n {\n if (this._requestId === null && this._head.next)\n {\n // ensure callbacks get correct delta\n this.lastTime = performance.now();\n this._lastFrame = this.lastTime;\n this._requestId = requestAnimationFrame(this._tick);\n }\n }\n\n /**\n * Conditionally cancels a pending animation frame.\n * @private\n */\n private _cancelIfNeeded(): void\n {\n if (this._requestId !== null)\n {\n cancelAnimationFrame(this._requestId);\n this._requestId = null;\n }\n }\n\n /**\n * Conditionally requests a new animation frame.\n * If the ticker has been started it checks if a frame has not already\n * been requested, and if the internal emitter has listeners. If these\n * conditions are met, a new frame is requested. If the ticker has not\n * been started, but autoStart is `true`, then the ticker starts now,\n * and continues with the previous conditions to request a new frame.\n * @private\n */\n private _startIfPossible(): void\n {\n if (this.started)\n {\n this._requestIfNeeded();\n }\n else if (this.autoStart)\n {\n this.start();\n }\n }\n\n /**\n * Register a handler for tick events. Calls continuously unless\n * it is removed or the ticker is stopped.\n * @param fn - The listener function to be added for updates\n * @param context - The listener context\n * @param {number} [priority=PIXI.UPDATE_PRIORITY.NORMAL] - The priority for emitting\n * @returns This instance of a ticker\n */\n add<T = any>(fn: TickerCallback<T>, context?: T, priority = UPDATE_PRIORITY.NORMAL): this\n {\n return this._addListener(new TickerListener(fn, context, priority));\n }\n\n /**\n * Add a handler for the tick event which is only execute once.\n * @param fn - The listener function to be added for one update\n * @param context - The listener context\n * @param {number} [priority=PIXI.UPDATE_PRIORITY.NORMAL] - The priority for emitting\n * @returns This instance of a ticker\n */\n addOnce<T = any>(fn: TickerCallback<T>, context?: T, priority = UPDATE_PRIORITY.NORMAL): this\n {\n return this._addListener(new TickerListener(fn, context, priority, true));\n }\n\n /**\n * Internally adds the event handler so that it can be sorted by priority.\n * Priority allows certain handler (user, AnimatedSprite, Interaction) to be run\n * before the rendering.\n * @private\n * @param listener - Current listener being added.\n * @returns This instance of a ticker\n */\n private _addListener(listener: TickerListener): this\n {\n // For attaching to head\n let current = this._head.next;\n let previous = this._head;\n\n // Add the first item\n if (!current)\n {\n listener.connect(previous);\n }\n else\n {\n // Go from highest to lowest priority\n while (current)\n {\n if (listener.priority > current.priority)\n {\n listener.connect(previous);\n break;\n }\n previous = current;\n current = current.next;\n }\n\n // Not yet connected\n if (!listener.previous)\n {\n listener.connect(previous);\n }\n }\n\n this._startIfPossible();\n\n return this;\n }\n\n /**\n * Removes any handlers matching the function and context parameters.\n * If no handlers are left after removing, then it cancels the animation frame.\n * @param fn - The listener function to be removed\n * @param context - The listener context to be removed\n * @returns This instance of a ticker\n */\n remove<T = any>(fn: TickerCallback<T>, context?: T): this\n {\n let listener = this._head.next;\n\n while (listener)\n {\n // We found a match, lets remove it\n // no break to delete all possible matches\n // incase a listener was added 2+ times\n if (listener.match(fn, context))\n {\n listener = listener.destroy();\n }\n else\n {\n listener = listener.next;\n }\n }\n\n if (!this._head.next)\n {\n this._cancelIfNeeded();\n }\n\n return this;\n }\n\n /**\n * The number of listeners on this ticker, calculated by walking through linked list\n * @readonly\n * @member {number}\n */\n get count(): number\n {\n if (!this._head)\n {\n return 0;\n }\n\n let count = 0;\n let current = this._head;\n\n while ((current = current.next))\n {\n count++;\n }\n\n return count;\n }\n\n /** Starts the ticker. If the ticker has listeners a new animation frame is requested at this point. */\n start(): void\n {\n if (!this.started)\n {\n this.started = true;\n this._requestIfNeeded();\n }\n }\n\n /** Stops the ticker. If the ticker has requested an animation frame it is canceled at this point. */\n stop(): void\n {\n if (this.started)\n {\n this.started = false;\n this._cancelIfNeeded();\n }\n }\n\n /** Destroy the ticker and don't use after this. Calling this method removes all references to internal events. */\n destroy(): void\n {\n if (!this._protected)\n {\n this.stop();\n\n let listener = this._head.next;\n\n while (listener)\n {\n listener = listener.destroy(true);\n }\n\n this._head.destroy();\n this._head = null;\n }\n }\n\n /**\n * Triggers an update. An update entails setting the\n * current {@link PIXI.Ticker#elapsedMS},\n * the current {@link PIXI.Ticker#deltaTime},\n * invoking all listeners with current deltaTime,\n * and then finally setting {@link PIXI.Ticker#lastTime}\n * with the value of currentTime that was provided.\n * This method will be called automatically by animation\n * frame callbacks if the ticker instance has been started\n * and listeners are added.\n * @param {number} [currentTime=performance.now()] - the current time of execution\n */\n update(currentTime = performance.now()): void\n {\n let elapsedMS;\n\n // If the difference in time is zero or negative, we ignore most of the work done here.\n // If there is no valid difference, then should be no reason to let anyone know about it.\n // A zero delta, is exactly that, nothing should update.\n //\n // The difference in time can be negative, and no this does not mean time traveling.\n // This can be the result of a race condition between when an animation frame is requested\n // on the current JavaScript engine event loop, and when the ticker's start method is invoked\n // (which invokes the internal _requestIfNeeded method). If a frame is requested before\n // _requestIfNeeded is invoked, then the callback for the animation frame the ticker requests,\n // can receive a time argument that can be less than the lastTime value that was set within\n // _requestIfNeeded. This difference is in microseconds, but this is enough to cause problems.\n //\n // This check covers this browser engine timing issue, as well as if consumers pass an invalid\n // currentTime value. This may happen if consumers opt-out of the autoStart, and update themselves.\n\n if (currentTime > this.lastTime)\n {\n // Save uncapped elapsedMS for measurement\n elapsedMS = this.elapsedMS = currentTime - this.lastTime;\n\n // cap the milliseconds elapsed used for deltaTime\n if (elapsedMS > this._maxElapsedMS)\n {\n elapsedMS = this._maxElapsedMS;\n }\n\n elapsedMS *= this.speed;\n\n // If not enough time has passed, exit the function.\n // Get ready for next frame by setting _lastFrame, but based on _minElapsedMS\n // adjustment to ensure a relatively stable interval.\n if (this._minElapsedMS)\n {\n const delta = currentTime - this._lastFrame | 0;\n\n if (delta < this._minElapsedMS)\n {\n return;\n }\n\n this._lastFrame = currentTime - (delta % this._minElapsedMS);\n }\n\n this.deltaMS = elapsedMS;\n this.deltaTime = this.deltaMS * settings.TARGET_FPMS;\n\n // Cache a local reference, in-case ticker is destroyed\n // during the emit, we can still check for head.next\n const head = this._head;\n\n // Invoke listeners added to internal emitter\n let listener = head.next;\n\n while (listener)\n {\n listener = listener.emit(this.deltaTime);\n }\n\n if (!head.next)\n {\n this._cancelIfNeeded();\n }\n }\n else\n {\n this.deltaTime = this.deltaMS = this.elapsedMS = 0;\n }\n\n this.lastTime = currentTime;\n }\n\n /**\n * The frames per second at which this ticker is running.\n * The default is approximately 60 in most modern browsers.\n * **Note:** This does not factor in the value of\n * {@link PIXI.Ticker#speed}, which is specific\n * to scaling {@link PIXI.Ticker#deltaTime}.\n * @member {number}\n * @readonly\n */\n get FPS(): number\n {\n return 1000 / this.elapsedMS;\n }\n\n /**\n * Manages the maximum amount of milliseconds allowed to\n * elapse between invoking {@link PIXI.Ticker#update}.\n * This value is used to cap {@link PIXI.Ticker#deltaTime},\n * but does not effect the measured value of {@link PIXI.Ticker#FPS}.\n * When setting this property it is clamped to a value between\n * `0` and `PIXI.settings.TARGET_FPMS * 1000`.\n * @member {number}\n * @default 10\n */\n get minFPS(): number\n {\n return 1000 / this._maxElapsedMS;\n }\n\n set minFPS(fps: number)\n {\n // Minimum must be below the maxFPS\n const minFPS = Math.min(this.maxFPS, fps);\n\n // Must be at least 0, but below 1 / settings.TARGET_FPMS\n const minFPMS = Math.min(Math.max(0, minFPS) / 1000, settings.TARGET_FPMS);\n\n this._maxElapsedMS = 1 / minFPMS;\n }\n\n /**\n * Manages the minimum amount of milliseconds required to\n * elapse between invoking {@link PIXI.Ticker#update}.\n * This will effect the measured value of {@link PIXI.Ticker#FPS}.\n * If it is set to `0`, then there is no limit; PixiJS will render as many frames as it can.\n * Otherwise it will be at least `minFPS`\n * @member {number}\n * @default 0\n */\n get maxFPS(): number\n {\n if (this._minElapsedMS)\n {\n return Math.round(1000 / this._minElapsedMS);\n }\n\n return 0;\n }\n\n set maxFPS(fps: number)\n {\n if (fps === 0)\n {\n this._minElapsedMS = 0;\n }\n else\n {\n // Max must be at least the minFPS\n const maxFPS = Math.max(this.minFPS, fps);\n\n this._minElapsedMS = 1 / (maxFPS / 1000);\n }\n }\n\n /**\n * The shared ticker instance used by {@link PIXI.AnimatedSprite} and by\n * {@link PIXI.VideoResource} to update animation frames / video textures.\n *\n * It may also be used by {@link PIXI.Application} if created with the `sharedTicker` option property set to true.\n *\n * The property {@link PIXI.Ticker#autoStart} is set to `true` for this instance.\n * Please follow the examples for usage, including how to opt-out of auto-starting the shared ticker.\n * @example\n * let ticker = PIXI.Ticker.shared;\n * // Set this to prevent starting this ticker when listeners are added.\n * // By default this is true only for the PIXI.Ticker.shared instance.\n * ticker.autoStart = false;\n * // FYI, call this to ensure the ticker is stopped. It should be stopped\n * // if you have not attempted to render anything yet.\n * ticker.stop();\n * // Call this when you are ready for a running shared ticker.\n * ticker.start();\n * @example\n * // You may use the shared ticker to render...\n * let renderer = PIXI.autoDetectRenderer();\n * let stage = new PIXI.Container();\n * document.body.appendChild(renderer.view);\n * ticker.add(function (time) {\n * renderer.render(stage);\n * });\n * @example\n * // Or you can just update it manually.\n * ticker.autoStart = false;\n * ticker.stop();\n * function animate(time) {\n * ticker.update(time);\n * renderer.render(stage);\n * requestAnimationFrame(animate);\n * }\n * animate(performance.now());\n * @member {PIXI.Ticker}\n * @static\n */\n static get shared(): Ticker\n {\n if (!Ticker._shared)\n {\n const shared = Ticker._shared = new Ticker();\n\n shared.autoStart = true;\n shared._protected = true;\n }\n\n return Ticker._shared;\n }\n\n /**\n * The system ticker instance used by {@link PIXI.InteractionManager} and by\n * {@link PIXI.BasePrepare} for core timing functionality that shouldn't usually need to be paused,\n * unlike the `shared` ticker which drives visual animations and rendering which may want to be paused.\n *\n * The property {@link PIXI.Ticker#autoStart} is set to `true` for this instance.\n * @member {PIXI.Ticker}\n * @static\n */\n static get system(): Ticker\n {\n if (!Ticker._system)\n {\n const system = Ticker._system = new Ticker();\n\n system.autoStart = true;\n system._protected = true;\n }\n\n return Ticker._system;\n }\n}\n","import type { ExtensionMetadata } from '@pixi/extensions';\nimport { ExtensionType } from '@pixi/extensions';\nimport { UPDATE_PRIORITY } from './const';\nimport { Ticker } from './Ticker';\n\n/**\n * Middleware for for Application Ticker.\n * @example\n * import {TickerPlugin} from '@pixi/ticker';\n * import {Application} from '@pixi/app';\n * import {extensions} from '@pixi/extensions';\n * extensions.add(TickerPlugin);\n * @class\n * @memberof PIXI\n */\nexport class TickerPlugin\n{\n /** @ignore */\n static extension: ExtensionMetadata = ExtensionType.Application;\n\n static start: () => void;\n static stop: () => void;\n static _ticker: Ticker;\n static ticker: Ticker;\n\n /**\n * Initialize the plugin with scope of application instance\n * @static\n * @private\n * @param {object} [options] - See application options\n */\n static init(options?: GlobalMixins.IApplicationOptions): void\n {\n // Set default\n options = Object.assign({\n autoStart: true,\n sharedTicker: false,\n }, options);\n\n // Create ticker setter\n Object.defineProperty(this, 'ticker',\n {\n set(ticker)\n {\n if (this._ticker)\n {\n this._ticker.remove(this.render, this);\n }\n this._ticker = ticker;\n if (ticker)\n {\n ticker.add(this.render, this, UPDATE_PRIORITY.LOW);\n }\n },\n get()\n {\n return this._ticker;\n },\n });\n\n /**\n * Convenience method for stopping the render.\n * @method\n * @memberof PIXI.Application\n * @instance\n */\n this.stop = (): void =>\n {\n this._ticker.stop();\n };\n\n /**\n * Convenience method for starting the render.\n * @method\n * @memberof PIXI.Application\n * @instance\n */\n this.start = (): void =>\n {\n this._ticker.start();\n };\n\n /**\n * Internal reference to the ticker.\n * @type {PIXI.Ticker}\n * @name _ticker\n * @memberof PIXI.Application#\n * @private\n */\n this._ticker = null;\n\n /**\n * Ticker for doing render updates.\n * @type {PIXI.Ticker}\n * @name ticker\n * @memberof PIXI.Application#\n * @default PIXI.Ticker.shared\n */\n this.ticker = options.sharedTicker ? Ticker.shared : new Ticker();\n\n // Start the rendering\n if (options.autoStart)\n {\n this.start();\n }\n }\n\n /**\n * Clean up the ticker, scoped to application.\n * @static\n * @private\n */\n static destroy(): void\n {\n if (this._ticker)\n {\n const oldTicker = this._ticker;\n\n this.ticker = null;\n oldTicker.destroy();\n }\n }\n}\n","/**\n * This file contains redeclared types for Node `url` and `querystring` modules. These modules\n * don't provide their own typings but instead are a part of the full Node typings. The purpose of\n * this file is to redeclare the required types to avoid having the whole Node types as a\n * dependency.\n */\n\nimport { parse as _parse, format as _format, resolve as _resolve } from 'url';\n\ninterface ParsedUrlQuery\n{\n [key: string]: string | string[];\n}\n\ninterface ParsedUrlQueryInput\n{\n [key: string]: unknown;\n}\n\ninterface UrlObjectCommon\n{\n auth?: string;\n hash?: string;\n host?: string;\n hostname?: string;\n href?: string;\n path?: string;\n pathname?: string;\n protocol?: string;\n search?: string;\n slashes?: boolean;\n}\n\n// Input to `url.format`\ninterface UrlObject extends UrlObjectCommon\n{\n port?: string | number;\n query?: string | null | ParsedUrlQueryInput;\n}\n\n// Output of `url.parse`\ninterface Url extends UrlObjectCommon\n{\n port?: string;\n query?: string | null | ParsedUrlQuery;\n}\n\ninterface UrlWithParsedQuery extends Url\n{\n query: ParsedUrlQuery;\n}\n\ninterface UrlWithStringQuery extends Url\n{\n query: string | null;\n}\n\ninterface URLFormatOptions\n{\n auth?: boolean;\n fragment?: boolean;\n search?: boolean;\n unicode?: boolean;\n}\n\ntype ParseFunction = {\n (urlStr: string): UrlWithStringQuery;\n (urlStr: string, parseQueryString: false | undefined, slashesDenoteHost?: boolean): UrlWithStringQuery;\n (urlStr: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery;\n (urlStr: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url;\n};\n\ntype FormatFunction = {\n (URL: URL, options?: URLFormatOptions): string;\n (urlObject: UrlObject | string): string;\n};\n\ntype ResolveFunction = {\n (from: string, to: string): string;\n};\n\nexport const url = {\n parse: _parse as ParseFunction,\n format: _format as FormatFunction,\n resolve: _resolve as ResolveFunction,\n};\n","import { settings } from '@pixi/settings';\n\n/**\n * The prefix that denotes a URL is for a retina asset.\n * @static\n * @name RETINA_PREFIX\n * @memberof PIXI.settings\n * @type {RegExp}\n * @default /@([0-9\\.]+)x/\n * @example `@2x`\n */\nsettings.RETINA_PREFIX = /@([0-9\\.]+)x/;\n\n/**\n * Should the `failIfMajorPerformanceCaveat` flag be enabled as a context option used in the `isWebGLSupported` function.\n * If set to true, a WebGL renderer can fail to be created if the browser thinks there could be performance issues when\n * using WebGL.\n *\n * In PixiJS v6 this has changed from true to false by default, to allow WebGL to work in as many scenarios as possible.\n * However, some users may have a poor experience, for example, if a user has a gpu or driver version blacklisted by the\n * browser.\n *\n * If your application requires high performance rendering, you may wish to set this to false.\n * We recommend one of two options if you decide to set this flag to false:\n *\n * 1: Use the `pixi.js-legacy` package, which includes a Canvas renderer as a fallback in case high performance WebGL is\n * not supported.\n *\n * 2: Call `isWebGLSupported` (which if found in the PIXI.utils package) in your code before attempting to create a PixiJS\n * renderer, and show an error message to the user if the function returns false, explaining that their device & browser\n * combination does not support high performance WebGL.\n * This is a much better strategy than trying to create a PixiJS renderer and finding it then fails.\n * @static\n * @name FAIL_IF_MAJOR_PERFORMANCE_CAVEAT\n * @memberof PIXI.settings\n * @type {boolean}\n * @default false\n */\nsettings.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT = false;\n\nexport { settings };\n","import { settings } from '@pixi/settings';\n\nlet saidHello = false;\nconst VERSION = '$_VERSION';\n\n/**\n * Skips the hello message of renderers that are created after this is run.\n * @function skipHello\n * @memberof PIXI.utils\n */\nexport function skipHello(): void\n{\n saidHello = true;\n}\n\n/**\n * Logs out the version and renderer information for this running instance of PIXI.\n * If you don't want to see this message you can run `PIXI.utils.skipHello()` before\n * creating your renderer. Keep in mind that doing that will forever make you a jerk face.\n * @static\n * @function sayHello\n * @memberof PIXI.utils\n * @param {string} type - The string renderer type to log.\n */\nexport function sayHello(type: string): void\n{\n if (saidHello)\n {\n return;\n }\n\n if (settings.ADAPTER.getNavigator().userAgent.toLowerCase().indexOf('chrome') > -1)\n {\n const args = [\n `\\n %c %c %c PixiJS ${VERSION} - ✰ ${type} ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \\n\\n`,\n 'background: #ff66a5; padding:5px 0;',\n 'background: #ff66a5; padding:5px 0;',\n 'color: #ff66a5; background: #030307; padding:5px 0;',\n 'background: #ff66a5; padding:5px 0;',\n 'background: #ffc3dc; padding:5px 0;',\n 'background: #ff66a5; padding:5px 0;',\n 'color: #ff2424; background: #fff; padding:5px 0;',\n 'color: #ff2424; background: #fff; padding:5px 0;',\n 'color: #ff2424; background: #fff; padding:5px 0;',\n ];\n\n globalThis.console.log(...args);\n }\n else if (globalThis.console)\n {\n globalThis.console.log(`PixiJS ${VERSION} - ${type} - http://www.pixijs.com/`);\n }\n\n saidHello = true;\n}\n","import { settings } from '../settings';\n\nlet supported: boolean | undefined;\n\n/**\n * Helper for checking for WebGL support.\n * @memberof PIXI.utils\n * @function isWebGLSupported\n * @returns {boolean} Is WebGL supported.\n */\nexport function isWebGLSupported(): boolean\n{\n if (typeof supported === 'undefined')\n {\n supported = (function supported(): boolean\n {\n const contextOptions = {\n stencil: true,\n failIfMajorPerformanceCaveat: settings.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT,\n };\n\n try\n {\n if (!settings.ADAPTER.getWebGLRenderingContext())\n {\n return false;\n }\n\n const canvas = settings.ADAPTER.createCanvas();\n let gl = (\n canvas.getContext('webgl', contextOptions)\n || canvas.getContext('experimental-webgl', contextOptions)\n ) as WebGLRenderingContext;\n\n const success = !!(gl && gl.getContextAttributes().stencil);\n\n if (gl)\n {\n const loseContext = gl.getExtension('WEBGL_lose_context');\n\n if (loseContext)\n {\n loseContext.loseContext();\n }\n }\n\n gl = null;\n\n return success;\n }\n catch (e)\n {\n return false;\n }\n })();\n }\n\n return supported;\n}\n","import { default as cssColorNames } from 'css-color-names';\n\n/**\n * Converts a hexadecimal color number to an [R, G, B] array of normalized floats (numbers from 0.0 to 1.0).\n * @example\n * PIXI.utils.hex2rgb(0xffffff); // returns [1, 1, 1]\n * @memberof PIXI.utils\n * @function hex2rgb\n * @param {number} hex - The hexadecimal number to convert\n * @param {number[]} [out=[]] - If supplied, this array will be used rather than returning a new one\n * @returns {number[]} An array representing the [R, G, B] of the color where all values are floats.\n */\nexport function hex2rgb(hex: number, out: Array<number> | Float32Array = []): Array<number> | Float32Array\n{\n out[0] = ((hex >> 16) & 0xFF) / 255;\n out[1] = ((hex >> 8) & 0xFF) / 255;\n out[2] = (hex & 0xFF) / 255;\n\n return out;\n}\n\n/**\n * Converts a hexadecimal color number to a string.\n * @example\n * PIXI.utils.hex2string(0xffffff); // returns \"#ffffff\"\n * @memberof PIXI.utils\n * @function hex2string\n * @param {number} hex - Number in hex (e.g., `0xffffff`)\n * @returns {string} The string color (e.g., `\"#ffffff\"`).\n */\nexport function hex2string(hex: number): string\n{\n let hexString = hex.toString(16);\n\n hexString = '000000'.substring(0, 6 - hexString.length) + hexString;\n\n return `#${hexString}`;\n}\n\n/**\n * Converts a string to a hexadecimal color number.\n * It can handle:\n * hex strings starting with #: \"#ffffff\"\n * hex strings starting with 0x: \"0xffffff\"\n * hex strings without prefix: \"ffffff\"\n * css colors: \"black\"\n * @example\n * PIXI.utils.string2hex(\"#ffffff\"); // returns 0xffffff\n * @memberof PIXI.utils\n * @function string2hex\n * @param {string} string - The string color (e.g., `\"#ffffff\"`)\n * @returns {number} Number in hexadecimal.\n */\nexport function string2hex(string: string): number\n{\n if (typeof string === 'string')\n {\n string = (cssColorNames as {[key: string]: string})[string.toLowerCase()] || string;\n\n if (string[0] === '#')\n {\n string = string.slice(1);\n }\n }\n\n return parseInt(string, 16);\n}\n\n/**\n * Converts a color as an [R, G, B] array of normalized floats to a hexadecimal number.\n * @example\n * PIXI.utils.rgb2hex([1, 1, 1]); // returns 0xffffff\n * @memberof PIXI.utils\n * @function rgb2hex\n * @param {number[]} rgb - Array of numbers where all values are normalized floats from 0.0 to 1.0.\n * @returns {number} Number in hexadecimal.\n */\nexport function rgb2hex(rgb: number[] | Float32Array): number\n{\n return (((rgb[0] * 255) << 16) + ((rgb[1] * 255) << 8) + (rgb[2] * 255 | 0));\n}\n","import { BLEND_MODES } from '@pixi/constants';\n\n/**\n * Corrects PixiJS blend, takes premultiplied alpha into account\n * @memberof PIXI.utils\n * @function mapPremultipliedBlendModes\n * @private\n * @returns {Array<number[]>} Mapped modes.\n */\nfunction mapPremultipliedBlendModes(): number[][]\n{\n const pm = [];\n const npm = [];\n\n for (let i = 0; i < 32; i++)\n {\n pm[i] = i;\n npm[i] = i;\n }\n\n pm[BLEND_MODES.NORMAL_NPM] = BLEND_MODES.NORMAL;\n pm[BLEND_MODES.ADD_NPM] = BLEND_MODES.ADD;\n pm[BLEND_MODES.SCREEN_NPM] = BLEND_MODES.SCREEN;\n\n npm[BLEND_MODES.NORMAL] = BLEND_MODES.NORMAL_NPM;\n npm[BLEND_MODES.ADD] = BLEND_MODES.ADD_NPM;\n npm[BLEND_MODES.SCREEN] = BLEND_MODES.SCREEN_NPM;\n\n const array: number[][] = [];\n\n array.push(npm);\n array.push(pm);\n\n return array;\n}\n\n/**\n * maps premultiply flag and blendMode to adjusted blendMode\n * @memberof PIXI.utils\n * @constant premultiplyBlendMode\n * @type {Array<number[]>}\n */\nexport const premultiplyBlendMode = mapPremultipliedBlendModes();\n\n/**\n * changes blendMode according to texture format\n * @memberof PIXI.utils\n * @function correctBlendMode\n * @param {number} blendMode - supposed blend mode\n * @param {boolean} premultiplied - whether source is premultiplied\n * @returns {number} true blend mode for this texture\n */\nexport function correctBlendMode(blendMode: number, premultiplied: boolean): number\n{\n return premultiplyBlendMode[premultiplied ? 1 : 0][blendMode];\n}\n\n/**\n * combines rgb and alpha to out array\n * @memberof PIXI.utils\n * @function premultiplyRgba\n * @param {Float32Array|number[]} rgb - input rgb\n * @param {number} alpha - alpha param\n * @param {Float32Array} [out] - output\n * @param {boolean} [premultiply=true] - do premultiply it\n * @returns {Float32Array} vec4 rgba\n */\nexport function premultiplyRgba(\n rgb: Float32Array | number[],\n alpha: number,\n out?: Float32Array,\n premultiply?: boolean\n): Float32Array\n{\n out = out || new Float32Array(4);\n if (premultiply || premultiply === undefined)\n {\n out[0] = rgb[0] * alpha;\n out[1] = rgb[1] * alpha;\n out[2] = rgb[2] * alpha;\n }\n else\n {\n out[0] = rgb[0];\n out[1] = rgb[1];\n out[2] = rgb[2];\n }\n out[3] = alpha;\n\n return out;\n}\n\n/**\n * premultiplies tint\n * @memberof PIXI.utils\n * @function premultiplyTint\n * @param {number} tint - integer RGB\n * @param {number} alpha - floating point alpha (0.0-1.0)\n * @returns {number} tint multiplied by alpha\n */\nexport function premultiplyTint(tint: number, alpha: number): number\n{\n if (alpha === 1.0)\n {\n return (alpha * 255 << 24) + tint;\n }\n if (alpha === 0.0)\n {\n return 0;\n }\n let R = ((tint >> 16) & 0xFF);\n let G = ((tint >> 8) & 0xFF);\n let B = (tint & 0xFF);\n\n R = ((R * alpha) + 0.5) | 0;\n G = ((G * alpha) + 0.5) | 0;\n B = ((B * alpha) + 0.5) | 0;\n\n return (alpha * 255 << 24) + (R << 16) + (G << 8) + B;\n}\n\n/**\n * converts integer tint and float alpha to vec4 form, premultiplies by default\n * @memberof PIXI.utils\n * @function premultiplyTintToRgba\n * @param {number} tint - input tint\n * @param {number} alpha - alpha param\n * @param {Float32Array} [out] - output\n * @param {boolean} [premultiply=true] - do premultiply it\n * @returns {Float32Array} vec4 rgba\n */\nexport function premultiplyTintToRgba(tint: number, alpha: number, out: Float32Array, premultiply?: boolean): Float32Array\n{\n out = out || new Float32Array(4);\n out[0] = ((tint >> 16) & 0xFF) / 255.0;\n out[1] = ((tint >> 8) & 0xFF) / 255.0;\n out[2] = (tint & 0xFF) / 255.0;\n if (premultiply || premultiply === undefined)\n {\n out[0] *= alpha;\n out[1] *= alpha;\n out[2] *= alpha;\n }\n out[3] = alpha;\n\n return out;\n}\n","import type { ITypedArray } from '@pixi/core';\n\nexport function getBufferType(\n array: ITypedArray\n): 'Float32Array' | 'Uint32Array' | 'Int32Array' | 'Uint16Array' | 'Uint8Array' | null\n{\n if (array.BYTES_PER_ELEMENT === 4)\n {\n if (array instanceof Float32Array)\n {\n return 'Float32Array';\n }\n else if (array instanceof Uint32Array)\n {\n return 'Uint32Array';\n }\n\n return 'Int32Array';\n }\n else if (array.BYTES_PER_ELEMENT === 2)\n {\n if (array instanceof Uint16Array)\n {\n return 'Uint16Array';\n }\n }\n else if (array.BYTES_PER_ELEMENT === 1)\n {\n if (array instanceof Uint8Array)\n {\n return 'Uint8Array';\n }\n }\n\n // TODO map out the rest of the array elements!\n return null;\n}\n","import { getBufferType } from './getBufferType';\n\n/* eslint-disable object-shorthand */\nconst map = { Float32Array: Float32Array, Uint32Array: Uint32Array, Int32Array: Int32Array, Uint8Array: Uint8Array };\n\ntype PackedArray = Float32Array | Uint32Array | Int32Array | Uint8Array;\n\nexport function interleaveTypedArrays(arrays: PackedArray[], sizes: number[]): Float32Array\n{\n let outSize = 0;\n let stride = 0;\n const views: {[key: string]: PackedArray} = {};\n\n for (let i = 0; i < arrays.length; i++)\n {\n stride += sizes[i];\n outSize += arrays[i].length;\n }\n\n const buffer = new ArrayBuffer(outSize * 4);\n\n let out = null;\n let littleOffset = 0;\n\n for (let i = 0; i < arrays.length; i++)\n {\n const size = sizes[i];\n const array = arrays[i];\n\n /*\n @todo This is unsafe casting but consistent with how the code worked previously. Should it stay this way\n or should and `getBufferTypeUnsafe` function be exposed that throws an Error if unsupported type is passed?\n */\n const type = getBufferType(array) as keyof typeof map;\n\n if (!views[type])\n {\n views[type] = new map[type](buffer);\n }\n\n out = views[type];\n\n for (let j = 0; j < array.length; j++)\n {\n const indexStart = ((j / size | 0) * stride) + littleOffset;\n const index = j % size;\n\n out[indexStart + index] = array[j];\n }\n\n littleOffset += size;\n }\n\n return new Float32Array(buffer);\n}\n","// Taken from the bit-twiddle package\n\n/**\n * Rounds to next power of two.\n * @function nextPow2\n * @memberof PIXI.utils\n * @param {number} v - input value\n * @returns {number} - next rounded power of two\n */\nexport function nextPow2(v: number): number\n{\n v += v === 0 ? 1 : 0;\n --v;\n v |= v >>> 1;\n v |= v >>> 2;\n v |= v >>> 4;\n v |= v >>> 8;\n v |= v >>> 16;\n\n return v + 1;\n}\n\n/**\n * Checks if a number is a power of two.\n * @function isPow2\n * @memberof PIXI.utils\n * @param {number} v - input value\n * @returns {boolean} `true` if value is power of two\n */\nexport function isPow2(v: number): boolean\n{\n return !(v & (v - 1)) && (!!v);\n}\n\n/**\n * Computes ceil of log base 2\n * @function log2\n * @memberof PIXI.utils\n * @param {number} v - input value\n * @returns {number} logarithm base 2\n */\nexport function log2(v: number): number\n{\n let r = (v > 0xFFFF ? 1 : 0) << 4;\n\n v >>>= r;\n\n let shift = (v > 0xFF ? 1 : 0) << 3;\n\n v >>>= shift; r |= shift;\n shift = (v > 0xF ? 1 : 0) << 2;\n v >>>= shift; r |= shift;\n shift = (v > 0x3 ? 1 : 0) << 1;\n v >>>= shift; r |= shift;\n\n return r | (v >> 1);\n}\n","/**\n * Remove items from a javascript array without generating garbage\n * @function removeItems\n * @memberof PIXI.utils\n * @param {Array<any>} arr - Array to remove elements from\n * @param {number} startIdx - starting index\n * @param {number} removeCount - how many to remove\n */\nexport function removeItems(arr: any[], startIdx: number, removeCount: number): void\n{\n const length = arr.length;\n let i;\n\n if (startIdx >= length || removeCount === 0)\n {\n return;\n }\n\n removeCount = (startIdx + removeCount > length ? length - startIdx : removeCount);\n\n const len = length - removeCount;\n\n for (i = startIdx; i < len; ++i)\n {\n arr[i] = arr[i + removeCount];\n }\n\n arr.length = len;\n}\n","/**\n * Returns sign of number\n * @memberof PIXI.utils\n * @function sign\n * @param {number} n - the number to check the sign of\n * @returns {number} 0 if `n` is 0, -1 if `n` is negative, 1 if `n` is positive\n */\nexport function sign(n: number): -1 | 0 | 1\n{\n if (n === 0) return 0;\n\n return n < 0 ? -1 : 1;\n}\n","let nextUid = 0;\n\n/**\n * Gets the next unique identifier\n * @memberof PIXI.utils\n * @function uid\n * @returns {number} The next unique identifier to use.\n */\nexport function uid(): number\n{\n return ++nextUid;\n}\n","import type { Dict } from '../types';\n\n// A map of warning messages already fired\nconst warnings: Dict<boolean> = {};\n\n/**\n * Helper for warning developers about deprecated features & settings.\n * A stack track for warnings is given; useful for tracking-down where\n * deprecated methods/properties/classes are being used within the code.\n * @memberof PIXI.utils\n * @function deprecation\n * @param {string} version - The version where the feature became deprecated\n * @param {string} message - Message should include what is deprecated, where, and the new solution\n * @param {number} [ignoreDepth=3] - The number of steps to ignore at the top of the error stack\n * this is mostly to ignore internal deprecation calls.\n */\nexport function deprecation(version: string, message: string, ignoreDepth = 3): void\n{\n // Ignore duplicat\n if (warnings[message])\n {\n return;\n }\n\n /* eslint-disable no-console */\n let stack = new Error().stack;\n\n // Handle IE < 10 and Safari < 6\n if (typeof stack === 'undefined')\n {\n console.warn('PixiJS Deprecation Warning: ', `${message}\\nDeprecated since v${version}`);\n }\n else\n {\n // chop off the stack trace which includes PixiJS internal calls\n stack = stack.split('\\n').splice(ignoreDepth).join('\\n');\n\n if (console.groupCollapsed)\n {\n console.groupCollapsed(\n '%cPixiJS Deprecation Warning: %c%s',\n 'color:#614108;background:#fffbe6',\n 'font-weight:normal;color:#614108;background:#fffbe6',\n `${message}\\nDeprecated since v${version}`\n );\n console.warn(stack);\n console.groupEnd();\n }\n else\n {\n console.warn('PixiJS Deprecation Warning: ', `${message}\\nDeprecated since v${version}`);\n console.warn(stack);\n }\n }\n /* eslint-enable no-console */\n\n warnings[message] = true;\n}\n","import type { Program, Texture, BaseTexture } from '@pixi/core';\n\n/**\n * @todo Describe property usage\n * @static\n * @name ProgramCache\n * @memberof PIXI.utils\n * @type {object}\n */\nexport const ProgramCache: {[key: string]: Program} = {};\n\n/**\n * @todo Describe property usage\n * @static\n * @name TextureCache\n * @memberof PIXI.utils\n * @type {object}\n */\nexport const TextureCache: {[key: string]: Texture} = Object.create(null);\n\n/**\n * @todo Describe property usage\n * @static\n * @name BaseTextureCache\n * @memberof PIXI.utils\n * @type {object}\n */\nexport const BaseTextureCache: {[key: string]: BaseTexture} = Object.create(null);\n\n/**\n * Destroys all texture in the cache\n * @memberof PIXI.utils\n * @function destroyTextureCache\n */\nexport function destroyTextureCache(): void\n{\n let key;\n\n for (key in TextureCache)\n {\n TextureCache[key].destroy();\n }\n for (key in BaseTextureCache)\n {\n BaseTextureCache[key].destroy();\n }\n}\n\n/**\n * Removes all textures from cache, but does not destroy them\n * @memberof PIXI.utils\n * @function clearTextureCache\n */\nexport function clearTextureCache(): void\n{\n let key;\n\n for (key in TextureCache)\n {\n delete TextureCache[key];\n }\n for (key in BaseTextureCache)\n {\n delete BaseTextureCache[key];\n }\n}\n","import { settings } from '@pixi/settings';\n\n/**\n * Creates a Canvas element of the given size to be used as a target for rendering to.\n * @class\n * @memberof PIXI.utils\n */\nexport class CanvasRenderTarget\n{\n /** The Canvas object that belongs to this CanvasRenderTarget. */\n public canvas: HTMLCanvasElement;\n\n /** A CanvasRenderingContext2D object representing a two-dimensional rendering context. */\n public context: CanvasRenderingContext2D;\n\n /**\n * The resolution / device pixel ratio of the canvas\n * @default 1\n */\n public resolution: number;\n\n /**\n * @param width - the width for the newly created canvas\n * @param height - the height for the newly created canvas\n * @param {number} [resolution=PIXI.settings.RESOLUTION] - The resolution / device pixel ratio of the canvas\n */\n constructor(width: number, height: number, resolution?: number)\n {\n this.canvas = settings.ADAPTER.createCanvas();\n\n this.context = this.canvas.getContext('2d');\n\n this.resolution = resolution || settings.RESOLUTION;\n\n this.resize(width, height);\n }\n\n /**\n * Clears the canvas that was created by the CanvasRenderTarget class.\n * @private\n */\n clear(): void\n {\n this.context.setTransform(1, 0, 0, 1, 0, 0);\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n }\n\n /**\n * Resizes the canvas to the specified width and height.\n * @param desiredWidth - the desired width of the canvas\n * @param desiredHeight - the desired height of the canvas\n */\n resize(desiredWidth: number, desiredHeight: number): void\n {\n this.canvas.width = Math.round(desiredWidth * this.resolution);\n this.canvas.height = Math.round(desiredHeight * this.resolution);\n }\n\n /** Destroys this canvas. */\n destroy(): void\n {\n this.context = null;\n this.canvas = null;\n }\n\n /**\n * The width of the canvas buffer in pixels.\n * @member {number}\n */\n get width(): number\n {\n return this.canvas.width;\n }\n\n set width(val: number)\n {\n this.canvas.width = Math.round(val);\n }\n\n /**\n * The height of the canvas buffer in pixels.\n * @member {number}\n */\n get height(): number\n {\n return this.canvas.height;\n }\n\n set height(val: number)\n {\n this.canvas.height = Math.round(val);\n }\n}\n","interface Inset\n{\n top?: number;\n left?: number;\n right?: number;\n bottom?: number;\n}\n\n/**\n * Trim transparent borders from a canvas\n * @memberof PIXI.utils\n * @function trimCanvas\n * @param {HTMLCanvasElement} canvas - the canvas to trim\n * @returns {object} Trim data\n */\nexport function trimCanvas(canvas: HTMLCanvasElement): {width: number; height: number; data?: ImageData}\n{\n // https://gist.github.com/remy/784508\n\n let width = canvas.width;\n let height = canvas.height;\n\n const context = canvas.getContext('2d');\n const imageData = context.getImageData(0, 0, width, height);\n const pixels = imageData.data;\n const len = pixels.length;\n\n const bound: Inset = {\n top: null,\n left: null,\n right: null,\n bottom: null,\n };\n let data = null;\n let i;\n let x;\n let y;\n\n for (i = 0; i < len; i += 4)\n {\n if (pixels[i + 3] !== 0)\n {\n x = (i / 4) % width;\n y = ~~((i / 4) / width);\n\n if (bound.top === null)\n {\n bound.top = y;\n }\n\n if (bound.left === null)\n {\n bound.left = x;\n }\n else if (x < bound.left)\n {\n bound.left = x;\n }\n\n if (bound.right === null)\n {\n bound.right = x + 1;\n }\n else if (bound.right < x)\n {\n bound.right = x + 1;\n }\n\n if (bound.bottom === null)\n {\n bound.bottom = y;\n }\n else if (bound.bottom < y)\n {\n bound.bottom = y;\n }\n }\n }\n\n if (bound.top !== null)\n {\n width = bound.right - bound.left;\n height = bound.bottom - bound.top + 1;\n data = context.getImageData(bound.left, bound.top, width, height);\n }\n\n return {\n height,\n width,\n data,\n };\n}\n","/**\n * Regexp for data URI.\n * Based on: {@link https://github.com/ragingwind/data-uri-regex}\n * @static\n * @constant {RegExp|string} DATA_URI\n * @memberof PIXI\n * @example data:image/png;base64\n */\nexport const DATA_URI = /^\\s*data:(?:([\\w-]+)\\/([\\w+.-]+))?(?:;charset=([\\w-]+))?(?:;(base64))?,(.*)/i;\n","import { url as _url } from '../url';\n\nlet tempAnchor: HTMLAnchorElement | undefined;\n\n/**\n * Sets the `crossOrigin` property for this resource based on if the url\n * for this resource is cross-origin. If crossOrigin was manually set, this\n * function does nothing.\n * Nipped from the resource loader!\n * @ignore\n * @param {string} url - The url to test.\n * @param {object} [loc=window.location] - The location object to test against.\n * @returns {string} The crossOrigin value to use (or empty string for none).\n */\nexport function determineCrossOrigin(url: string, loc: Location = globalThis.location): string\n{\n // data: and javascript: urls are considered same-origin\n if (url.indexOf('data:') === 0)\n {\n return '';\n }\n\n // default is window.location\n loc = loc || globalThis.location;\n\n if (!tempAnchor)\n {\n tempAnchor = document.createElement('a');\n }\n\n // let the browser determine the full href for the url of this resource and then\n // parse with the node url lib, we can't use the properties of the anchor element\n // because they don't work in IE9 :(\n tempAnchor.href = url;\n const parsedUrl = _url.parse(tempAnchor.href);\n\n const samePort = (!parsedUrl.port && loc.port === '') || (parsedUrl.port === loc.port);\n\n // if cross origin\n if (parsedUrl.hostname !== loc.hostname || !samePort || parsedUrl.protocol !== loc.protocol)\n {\n return 'anonymous';\n }\n\n return '';\n}\n","import { settings } from '../settings';\n\n/**\n * get the resolution / device pixel ratio of an asset by looking for the prefix\n * used by spritesheets and image urls\n * @memberof PIXI.utils\n * @function getResolutionOfUrl\n * @param {string} url - the image path\n * @param {number} [defaultValue=1] - the defaultValue if no filename prefix is set.\n * @returns {number} resolution / device pixel ratio of an asset\n */\nexport function getResolutionOfUrl(url: string, defaultValue?: number): number\n{\n const resolution = settings.RETINA_PREFIX.exec(url);\n\n if (resolution)\n {\n return parseFloat(resolution[1]);\n }\n\n return defaultValue !== undefined ? defaultValue : 1;\n}\n"],"names":["createSvgIcon","_jsx","d","getAccordionDetailsUtilityClass","slot","generateUtilityClass","generateUtilityClasses","_excluded","AccordionDetailsRoot","styled","name","overridesResolver","props","styles","root","_ref","theme","padding","spacing","React","inProps","ref","useThemeProps","className","other","_objectWithoutPropertiesLoose","ownerState","classes","composeClasses","useUtilityClasses","_extends","clsx","getAccordionSummaryUtilityClass","AccordionSummaryRoot","ButtonBase","transition","duration","transitions","shortest","display","minHeight","create","accordionSummaryClasses","backgroundColor","palette","action","focus","opacity","disabledOpacity","cursor","disableGutters","AccordionSummaryContent","content","_ref2","flexGrow","margin","AccordionSummaryExpandIconWrapper","expandIconWrapper","_ref3","color","active","transform","children","expandIcon","focusVisibleClassName","onClick","disabled","expanded","toggle","AccordionContext","slots","focusVisible","_jsxs","focusRipple","disableRipple","component","event","getAccordionUtilityClass","AccordionRoot","Paper","accordionClasses","region","square","rounded","gutters","position","overflowAnchor","left","top","right","height","divider","marginTop","marginBottom","disabledBackground","borderRadius","borderTopLeftRadius","shape","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","childrenProp","defaultExpanded","expandedProp","onChange","TransitionComponent","Collapse","TransitionProps","setExpandedState","useControlled","controlled","default","state","handleChange","summary","contextValue","value","in","timeout","id","role","getFormGroupUtilityClass","FormGroupRoot","row","flexDirection","flexWrap","_excluded2","stylesOrCreator","options","arguments","length","undefined","Component","defaultTheme","withTheme","stylesOptions","classNamePrefix","useStyles","makeStyles","displayName","WithStyles","defaultProps","more","useTheme","params","components","output","propName","getThemeProps","hoistNonReactStatics","isMergeableObject","isNonNullObject","stringValue","Object","prototype","toString","call","$$typeof","REACT_ELEMENT_TYPE","isReactElement","isSpecial","Symbol","for","cloneUnlessOtherwiseSpecified","clone","deepmerge","val","Array","isArray","defaultArrayMerge","target","source","concat","map","element","getKeys","keys","getOwnPropertySymbols","filter","symbol","propertyIsEnumerable","getEnumerableOwnPropertySymbols","propertyIsOnObject","object","property","_","mergeObject","destination","forEach","key","hasOwnProperty","propertyIsUnsafe","customMerge","getMergeFunction","arrayMerge","sourceIsArray","all","array","Error","reduce","prev","next","deepmerge_1","module","exports","earcut","data","holeIndices","dim","minX","minY","maxX","maxY","x","y","invSize","hasHoles","outerLen","outerNode","linkedList","triangles","i","len","list","queue","steiner","push","getLeftmost","sort","compareX","eliminateHole","eliminateHoles","Math","max","earcutLinked","start","end","clockwise","last","signedArea","insertNode","equals","removeNode","filterPoints","again","p","area","ear","pass","z","zOrder","prevZ","nextZ","q","e","tail","numMerges","pSize","qSize","inSize","sortLinked","indexCurve","stop","isEarHashed","isEar","cureLocalIntersections","splitEarcut","a","b","c","ax","bx","cx","ay","by","cy","x0","y0","x1","y1","pointInTriangle","minZ","maxZ","n","intersects","locallyInside","isValidDiagonal","splitPolygon","hole","bridge","m","hx","hy","qx","Infinity","tan","mx","my","tanMin","abs","sectorContainsSector","findHoleBridge","bridgeReverse","leftmost","px","py","intersectsPolygon","inside","middleInside","r","p1","p2","q1","q2","o1","sign","o2","o3","o4","onSegment","min","num","a2","Node","b2","an","bp","this","sum","j","deviation","polygonArea","trianglesArea","flatten","result","vertices","holes","dimensions","holeIndex","has","prefix","Events","EE","fn","context","once","addListener","emitter","TypeError","listener","evt","_events","_eventsCount","clearEvent","EventEmitter","__proto__","eventNames","events","names","slice","listeners","handlers","l","ee","listenerCount","emit","a1","a3","a4","a5","args","removeListener","apply","on","removeAllListeners","off","prefixed","canUseDOM","window","document","createElement","ExecutionEnvironment","canUseWorkers","Worker","canUseEventListeners","addEventListener","attachEvent","canUseViewport","screen","define","equal","constructor","RegExp","flags","valueOf","Plugin","parent","paused","destroy","down","_e","move","up","wheel","update","_delta","resize","reset","pause","resume","penner","factory","linear","t","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","easeInSine","cos","PI","easeOutSine","sin","easeInOutSine","easeInExpo","pow","easeOutExpo","easeInOutExpo","easeInCirc","sqrt","easeOutCirc","easeInOutCirc","easeInElastic","s","asin","easeOutElastic","easeInOutElastic","easeInBack","easeOutBack","easeInOutBack","easeInBounce","easeOutBounce","easeInOutBounce","commonjsGlobal","ease","defaults","DEFAULT_ANIMATE_OPTIONS","removeOnInterrupt","time","Animate","__init","startWidth","__init2","startHeight","__init3","deltaWidth","__init4","deltaHeight","__init5","width","__init6","__init7","assign","setupPosition","setupZoom","startX","center","startY","deltaX","deltaY","keepCenter","scale","screenWidth","scaleX","scaleY","screenHeight","screenWidthInWorldPixels","screenHeightInWorldPixels","plugins","remove","complete","fitWidth","fitHeight","moveCenter","callbackOnComplete","elapsed","originalZoom","Point","originalWidth","originalHeight","viewport","original","type","percent","_optionalChain$1","ops","lastAccessLHS","op","_len","_key","DEFAULT_BOUNCE_OPTIONS","sides","friction","underflow","bounceBox","Bounce","bottom","indexOf","clamp","toLowerCase","underflowX","underflowY","isActive","toX","toY","bounce","delta","calcUnderflowX","screenWorldWidth","calcUnderflowY","screenWorldHeight","oob","box","worldWidth","worldHeight","topLeft","bottomRight","decelerate","get","percentChangeX","_2","percentChangeY","_3","_4","drag","pinch","_5","_6","DEFAULT_CLAMP_OPTIONS","direction","Clamp","parseUnderflow","noUnderflow","moved","DEFAULT_CLAMP_ZOOM_OPTIONS","minWidth","maxWidth","maxHeight","minScale","maxScale","ClampZoom","worldScreenWidth","worldScreenHeight","optsMinScale","optsMaxScale","set","DEFAULT_DECELERATE_OPTIONS","minSpeed","TP","Decelerate","saved","timeSinceRelease","count","input","performance","now","splice","save","activate","ti","tf","k","lnk","log","DEFAULT_DRAG_OPTIONS","pressDrag","wheelScroll","reverse","clampWheel","factor","mouseButtons","keyToPress","ignoreKeyToPressOnTouch","lineHeight","wheelSwapAxes","Drag","xDirection","yDirection","keyIsPressed","handleKeyPresses","codes","includes","code","buttons","mouse","checkButtons","isMouse","pointerType","button","checkKeyPress","global","current","pointerId","distX","distY","checkThreshold","newPoint","world","toWorld","touches","pointer","wheelZoom","ctrlKey","step","deltaMode","deltas","passiveWheel","preventDefault","stopPropagation","DEFAULT_FOLLOW_OPTIONS","speed","acceleration","radius","Follow","velocity","angle","atan2","distance","decelerationDistance","changeX","changeY","MOUSE_EDGES_OPTIONS","noDecelerate","allowButtons","MouseEdges","radiusSquared","horizontal","vertical","identifier","toScreen","round","decelerateHorizontal","decelerateVertical","Number","DEFAULT_PINCH_OPTIONS","noDrag","axis","Pinch","pinching","isAxisX","isAxisY","pointers","first","second","oldPoint","point","toLocal","dist","change","toGlobal","lastCenter","DEFAULT_SNAP_OPTIONS","interrupt","removeOnComplete","forceStart","Snap","snapStart","snapping","corner","finished","moveCorner","DEFAULT_SNAP_ZOOM_OPTIONS","noMove","SnapZoom","xIndependent","yIndependent","xScale","yScale","container","createSnapping","startWorldScreenWidth","startWorldScreenHeight","endWorldScreenWidth","endWorldScreenHeight","oldCenter","DEFAULT_WHEEL_OPTIONS","smooth","trackpadPinch","Wheel","smoothing","smoothingCenter","smoothingCount","getPointerPosition","dx","dy","dz","deltaZ","InputManager","addListeners","interactive","forceHitArea","hitArea","Rectangle","wheelFunction","handleWheel","divWheel","passive","isMouseDown","removeEventListener","worldVisible","clickedAvailable","clear","threshold","interaction","mapPositionToPoint","clientX","clientY","useDivWheelForInputManager","rect","getBoundingClientRect","interactionDOMElement","touch","_optionalChain","_len2","_key2","PLUGIN_ORDER","PluginManager","add","plugin","index","ignorePaused","removeAll","_7","_8","_9","_10","_11","DEFAULT_VIEWPORT_OPTIONS","innerWidth","innerHeight","noTicker","disableOnContextMenu","ticker","Ticker","Viewport","Container","_disableOnContextMenu","body","_worldWidth","_worldHeight","tickerFunction","elapsedMS","lastViewport","moving","zooming","_hitAreaDefault","_dirty","dirty","getVisibleBounds","_len3","_key3","newX","newY","_len4","_key4","findFitWidth","findFitHeight","findFit","findCover","noClamp","clampZoom","fitWorld","fit","setZoom","zoomPercent","zoom","scaled","snapZoom","OOB","cornerPoint","_forceHitArea","snap","follow","animate","mouseEdges","_pause","ensureVisible","resizeToFit","obj","prop","qs","sep","eq","regexp","split","maxKeys","kstr","vstr","v","replace","idx","substr","decodeURIComponent","stringifyPrimitive","isFinite","ks","encodeURIComponent","join","decode","parse","encode","stringify","f","ownerDocument","defaultView","self","o","pageX","pageXOffset","pageY","pageYOffset","h","onMove","onKey","g","nativeEvent","changedTouches","which","keyCode","C","E","H","u","onTouchStart","onMouseDown","onKeyDown","tabIndex","Boolean","style","parseInt","N","w","floor","B","K","hue","L","hsva","A","T","toHsva","fromHsva","F","P","R","Map","V","innerHTML","__webpack_nonce__","setAttribute","head","appendChild","$","colorModel","defaultColor","G","J","Ee","He","onBlur","escape","validate","format","process","spellCheck","Me","Ne","alpha","exec","DOM_PROPERTIES_TO_CHECK","objectTypes","primitiveTypes","getObjectType","objectTypeName","test","isObjectOfType","isOfType","is","plainFunction","tagType","arrayOf","predicate","function","every","asyncGeneratorFunction","asyncFunction","bigint","boolean","date","defined","domElement","plainObject","nodeType","string","nodeName","empty","size","error","generator","iterable","throw","generatorFunction","instanceOf","instance","class_","getPrototypeOf","nullOrUndefined","iterator","nan","isNaN","null","number","numericString","oneOf","primitive","promise","propertyOf","weakMap","weakSet","compareNumbers","previousData","actual","previous","nested","changed","compareValues","primary","secondary","isEqualPredicate","some","hasExtraKeys","isSameType","hasValue","entries","hasEntry","checkEquality","getIterables","_a","_i","canHaveLength","includesOrEqualsTo","previousValue","find","acc","treeChanges","hasActual","hasPrevious","leftComparator","rightComparator","added","changedFrom","changedTo","decreased","emptied","_b","filled","increased","removed","isBrowser","navigator","timeoutDuration","longerTimeoutBrowsers","userAgent","debounce","Promise","called","resolve","then","scheduled","isFunction","functionToCheck","getStyleComputedProperty","css","getComputedStyle","getParentNode","parentNode","host","getScrollParent","overflow","_getStyleComputedProp","overflowX","overflowY","getReferenceNode","reference","referenceNode","isIE11","MSInputMethodContext","documentMode","isIE10","isIE","version","getOffsetParent","documentElement","noOffsetParent","offsetParent","nextElementSibling","getRoot","node","findCommonOffsetParent","element1","element2","order","compareDocumentPosition","DOCUMENT_POSITION_FOLLOWING","range","createRange","setStart","setEnd","commonAncestorContainer","contains","firstElementChild","isOffsetContainer","element1root","getScroll","upperSide","html","scrollingElement","getBordersSize","sideA","sideB","parseFloat","getSize","computedStyle","getWindowSizes","getClientRect","offsets","scrollTop","scrollLeft","sizes","clientWidth","clientHeight","horizScrollbar","offsetWidth","vertScrollbar","offsetHeight","getOffsetRectRelativeToArbitraryNode","fixedPosition","isHTML","childrenRect","parentRect","scrollParent","borderTopWidth","borderLeftWidth","marginLeft","subtract","modifier","includeScroll","isFixed","getFixedPositionOffsetParent","parentElement","el","getBoundaries","popper","boundariesElement","boundaries","excludeScroll","relativeOffset","getViewportOffsetRectRelativeToArtbitraryNode","boundariesNode","_getWindowSizes","isPaddingNumber","computeAutoPlacement","placement","refRect","rects","sortedAreas","filteredAreas","computedPlacement","variation","getReferenceOffsets","getOuterSizes","marginRight","getOppositePlacement","hash","matched","getPopperOffsets","referenceOffsets","popperRect","popperOffsets","isHoriz","mainSide","secondarySide","measurement","secondaryMeasurement","arr","check","runModifiers","modifiers","ends","findIndex","cur","match","warn","enabled","isDestroyed","positionFixed","flip","originalPlacement","isCreated","onUpdate","onCreate","isModifierEnabled","modifierName","getSupportedPropertyName","prefixes","upperProp","charAt","toUpperCase","toCheck","removeAttribute","willChange","disableEventListeners","removeOnDestroy","removeChild","getWindow","attachToScrollParents","callback","scrollParents","isBody","setupEventListeners","updateBound","scrollElement","eventsEnabled","enableEventListeners","scheduleUpdate","isNumeric","setStyles","unit","isFirefox","isModifierRequired","requestingName","requestedName","requesting","isRequired","_requesting","requested","placements","validPlacements","counter","BEHAVIORS","parseOffset","offset","basePlacement","useHeight","fragments","frag","trim","search","splitRegex","mergeWithPrevious","str","toValue","index2","shiftvariation","_data$offsets","isVertical","side","shiftOffsets","transformProp","popperStyles","priority","escapeWithReference","opSide","arrowElement","querySelector","sideCapitalized","altSide","arrowElementSize","popperMarginSide","popperBorderSide","sideValue","arrow","defineProperty","_data$offsets$arrow","flipped","placementOpposite","flipOrder","behavior","refOffsets","overlapsRef","overflowsLeft","overflowsRight","overflowsTop","overflowsBottom","overflowsBoundaries","flippedVariationByRef","flipVariations","flippedVariationByContent","flipVariationsByContent","flippedVariation","getOppositeVariation","subtractLength","bound","hide","attributes","legacyGpuAccelerationOption","gpuAcceleration","offsetParentRect","shouldRound","noRound","referenceWidth","popperWidth","isVariation","horizontalToInteger","verticalToInteger","getRoundedOffsets","devicePixelRatio","prefixedProperty","invertTop","invertLeft","arrowStyles","modifierOptions","Defaults","Popper","requestAnimationFrame","_this","bind","jquery","onLoad","Utils","PopperUtils","isRegex","isObject","isUndefined","isNull","equalArray","_c","__values","_d","done","_f","equalMap","Set","equalSet","ArrayBuffer","isView","byteLength","view1","DataView","buffer","view2","getUint8","equalArrayBuffer","leftKeys","rightKeys","arguments_","ownKeys","enumerableOnly","symbols","sym","getOwnPropertyDescriptor","enumerable","_objectSpread2","_defineProperty","getOwnPropertyDescriptors","defineProperties","_classCallCheck","Constructor","_defineProperties","descriptor","configurable","writable","_createClass","protoProps","staticProps","_inherits","subClass","superClass","_setPrototypeOf","_getPrototypeOf","setPrototypeOf","_objectWithoutProperties","excluded","sourceKeys","sourceSymbolKeys","_assertThisInitialized","ReferenceError","_createSuper","Derived","hasNativeReflectConstruct","Reflect","construct","sham","Proxy","_isNativeReflectConstruct","Super","NewTarget","_possibleConstructorReturn","DEFAULTS","preventOverflow","STATUS","INIT","IDLE","OPENING","OPEN","CLOSING","ERROR","isReact16","ReactDOM","isMobile","title","_ref$warn","_ref$debug","debug","logFn","console","groupCollapsed","groupEnd","noop","ReactFloaterPortal","_React$Component","_super","appendNode","renderPortal","_this$props","zIndex","_this$props2","setRef","_this$props3","hasChildren","renderReact16","PropTypes","FloaterArrow","pointerEvents","startsWith","points","setArrowRef","_styles$arrow","spread","parentStyle","xmlns","fill","_excluded$1","FloaterCloseBtn","handleClick","viewBox","preserveAspectRatio","propTypes","FloaterContainer","footer","open","positionWrapper","showCloseButton","close","Floater","disableAnimation","hideArrow","status","floater","floaterCentered","floaterClosing","floaterOpening","floaterWithAnimation","floaterWithComponent","closeFn","setFloaterRef","ReactFloaterWrapper","handleMouseEnter","handleMouseLeave","setChildRef","setWrapperRef","refProp","onMouseEnter","onMouseLeave","defaultOptions","POSITIONING_PROPS","ReactFloater","arrowRef","childRef","floaterRef","wrapperRef","wrapperPopper","setState","newStatus","_this$state","clearTimeout","eventDelayTimeout","eventDelay","_this$state2","setTimeout","currentPlacement","needsUpdate","wrapperOptions","statusWrapper","_isMounted","hasMounted","_this$props5","hasTarget","isControlled","initPopper","prevProps","prevState","forceStatus","_this$props6","autoOpen","_treeChanges","changeWrapperPosition","cb","_nextCB","capture","handleTransitionEnd","rebuildPopper","_this2","_this$props7","disableFlip","getPopper","flipBehavior","_this$options","offsetOptions","rest","_this2$floaterRef","isConnected","wrapperOffset","_this3","floaterRefInterval","setInterval","_this3$floaterRef","clearInterval","nextStatus","ReactFloaterDebug","_this$props8","disableHoverToClick","wrapperStyles","_this4","_this$state3","nextStyles","wrapper","wrapperPosition","visibility","borderBottom","fontSize","paddingBottom","paddingRight","border","outline","WebkitAppearance","borderTop","paddingTop","getStyles","targetStyles","_this$state4","_this$props9","wrapperInPortal","wrapperAsChildren","isRequiredIf","ACTIONS","START","STOP","RESET","PREV","NEXT","GO","CLOSE","SKIP","UPDATE","EVENTS","TOUR_START","STEP_BEFORE","BEACON","TOOLTIP","STEP_AFTER","TOUR_END","TOUR_STATUS","TARGET_NOT_FOUND","LIFECYCLE","READY","COMPLETE","WAITING","RUNNING","PAUSED","SKIPPED","FINISHED","createPortal","getBrowser","browser","opera","InstallTrigger","chrome","getText","recurse","child","hexToRGB","hex","properHex","hideBeacon","disableBeacon","isEqual","hasReactElement","isValidElement","hasUndefined","isSameNode","isLegacy","defaultState","lifecycle","validKeys","createStore","store","Store","_ref$continuous","continuous","stepIndex","_ref$steps","steps","_steps","_this$getState","getState","getNextState","nextIndex","_this$getState2","advance","_this$getState3","_this$getState4","_this$getState5","getSteps","_this$getState6","_this$getState8","restart","setSteps","nextState","initial","_state$nextState","hasUpdatedState","force","_this$getState11","newIndex","oldState","JSON","go","info","skip","scrollDoc","getDocumentHeight","_document","scrollHeight","getElement","skipFix","forListener","hasCustomScrollParent","hasPosition","HTMLElement","getTopOffset","offsetTop","getScrollTo","hasCustomOffsetParent","checkType","componentName","location","propFullName","componentNameSafe","propFullNameSafe","chainedCheckType","createChainableTypeChecker","propValue","isValidElementType","ownProps","Element","ForwardRef","typeOf","arrowColor","beaconSize","overlayColor","primaryColor","spotlightShadow","textColor","buttonBase","spotlight","floaterProps","locale","back","getTourProps","sharedTourProps","getMergedStep","mergedStep","mergedStyles","stepStyles","overlay","defaultStyles","beacon","beaconInner","animation","beaconOuter","boxSizing","transformOrigin","tooltip","tooltipContainer","textAlign","tooltipTitle","tooltipContent","tooltipFooter","alignItems","justifyContent","tooltipFooterSpacer","flex","buttonNext","buttonBack","buttonClose","buttonSkip","mixBlendMode","overlayLegacy","overlayLegacyCenter","spotlightLegacy","boxShadow","floaterStyles","disableScrollParentFix","spotlightPadding","placementBeacon","validateStep","validateSteps","Scope","_element","canHaveFocus","getAttribute","isVisible","querySelectorAll","canBeTabbed","_this$options$keyCode","interceptTab","elements","findValidTabElements","shiftKey","activeElement","noSize","getPropertyValue","isHidden","handleKeyDown","checkFocus","selector","setFocus","JoyrideBeacon","beaconComponent","getElementsByTagName","nonce","createTextNode","shouldFocus","getElementById","onClickOrHover","setBeaconRef","BeaconComponent","JoyrideSpotlight","_excluded$2","JoyrideOverlay","mouseOverSpotlight","isScrolling","showSpotlight","_this$spotlightStyles","spotlightStyles","offsetY","offsetX","inSpotlight","updateState","scrollTimeout","resizeTimeout","forceUpdate","disableScrolling","handleResize","spotlightClicks","handleScroll","handleMouseMove","elementRect","isFixedTarget","hasScrollParent","parentTop","getElementPosition","_this$props4","disableOverlay","disableOverlayClose","onClickOverlay","baseStyles","stylesOverlay","safarOverlay","JoyrideTooltipCloseBtn","JoyrideTooltipContainer","backProps","closeProps","isLastStep","primaryProps","skipProps","tooltipProps","hideBackButton","hideCloseButton","hideFooter","showProgress","showSkipButton","_step$locale","JoyrideTooltip","helpers","setTooltipRef","primaryText","handleClickBack","handleClickClose","handleClickPrimary","handleClickSkip","tooltipComponent","cleanStep","renderProps","getElementsProps","TooltipComponent","JoyridePortal","renderReact15","JoyrideStep","removeScope","setPopper","beaconPopper","tooltipPopper","skipBeacon","hasStoreChanged","hasStarted","elementExists","hasRenderedTarget","_getComputedStyle","isElementVisible","scope","shouldScroll","handleClickOverlay","isPositioned","handleClickHoverBeacon","Joyride","getHelpers","run","syncState","intKey","Event","disableCloseOnEsc","scrollToFirstStep","initStore","handleKeyboard","prevSteps","prevStepIndex","_this$store","changedProps","_treeChanges2","stepsChanged","stepIndexChanged","nextAction","callbackData","prevStep","_prevStep","scrollToStep","scrollOffset","scrollDuration","hasCustomScroll","scrollY","_this$beaconPopper","_this$tooltipPopper","_placement","_popper","reject","limit","scroll","message","scrollTo","guardAgainstInvalidArgTypes","propIsRequired","propExists","missingPropError","E_NOSCROLL","E_CANCELLED","ms","Date","make","to","opts","from","inOutSine","cancelled","timestamp","eased","regex","parents","ps","SVGElement","freeGlobal","punycode","maxInt","base","regexPunycode","regexNonASCII","regexSeparators","errors","stringFromCharCode","String","fromCharCode","RangeError","mapDomain","parts","ucs2decode","extra","charCodeAt","ucs2encode","digitToBasic","digit","flag","adapt","numPoints","firstTime","baseMinusTMin","out","basic","oldi","baseMinusT","codePoint","inputLength","bias","lastIndexOf","handledCPCount","basicLength","currentValue","handledCPCountPlusOne","qMinusT","require","util","Url","protocol","slashes","auth","port","hostname","query","pathname","path","href","urlParse","relative","isString","protocolPattern","portPattern","simplePathPattern","unwise","autoEscape","nonHostChars","hostEndingChars","hostnamePartPattern","hostnamePartStart","unsafeProtocol","hostlessProtocol","slashedProtocol","querystring","url","parseQueryString","slashesDenoteHost","queryIndex","splitter","uSplit","simplePath","proto","lowerProto","atSign","hostEnd","hec","parseHost","ipv6Hostname","hostparts","part","newpart","validParts","notHost","bit","unshift","toASCII","ae","esc","qm","resolveObject","rel","tkeys","tk","tkey","rkeys","rk","rkey","relPath","shift","isSourceAbs","isRelAbs","mustEndAbs","removeAllDots","srcPath","psychotic","pop","isNullOrUndefined","authInHost","hasTrailingSlash","isAbsolute","arg","_renderer","renderer","visible","worldAlpha","renderable","_mask","maskManager","pushMask","_renderCanvas","renderCanvas","popMask","DisplayObject","canvasRenderer","PolygonUtils","offsetPolygon","offsetPoints","isPolygonClockwise","v1x","v1y","norm1x","norm1y","pij1","pij2","v2x","v2y","norm2x","norm2y","pjk1","pjk2","intersectPoint","findIntersection","x2","y2","x3","y3","x4","y4","denominator","numeratorA","uA","polygon","CanvasGraphicsRenderer","_svgMatrix","_tempMatrix","Matrix","_calcCanvasStyle","tint","res","texture","baseTexture","Texture","valid","canvasUtils","setPatternTransform","matrix","render","graphics","worldTransform","setContextTransform","setBlendMode","blendMode","contextFillStyle","contextStrokeStyle","graphicsData","geometry","tintR","tintG","tintB","fillStyle","lineStyle","fillColor","lineColor","copyTo","append","fillTint","lineTint","lineWidth","lineCap","cap","lineJoin","miterLimit","SHAPES","beginPath","tempShape","outerArea","innerArea","holesDirection","moveTo","lineTo","closeStroke","closePath","globalAlpha","paintPolygonStroke","fillRect","alignmentOffset","alignment","strokeStyle","strokeRect","arc","stroke","drawShapeOverStroke","paintEllipse","kappa","sW","sH","sX","sY","sOx","sOy","sXe","sYe","sXm","sYm","bezierCurveTo","paintRoundedRectangle","sRx","sRy","sWidth","sHeight","radiusOffset","sRadius","sMaxRadius","quadraticCurveTo","ox","oy","xe","ye","xm","ym","clip","restore","rx","ry","maxRadius","pattern","svg","createElementNS","createSVGMatrix","setTransform","tx","ty","inverse","extension","ExtensionType","tempMatrix","Graphics","scaleMode","resolution","bounds","getLocalBounds","canvasBuffer","RenderTexture","CanvasRenderer","updateLocalTransform","localTransform","invert","renderTexture","_canvasRenderTarget","canvas","setResolution","isMask","finishPoly","extendStatics","CanvasMaskManager","_foundShapes","maskData","maskObject","foundShapes","recursiveFindShapes","renderGraphicsShape","invalidateBlendMode","createColoredCanvas","getContext","canUseNewCanvasBlendModes","magenta","yellow","globalCompositeOperation","drawImage","imageData","getImageData","RENDERER_TYPE","refresh","smoothProperty","blendModes","BLEND_MODES","renderingToScreen","_activeBlendMode","_projTransform","_outerBlend","rootContext","view","useContextAlpha","imageSmoothingEnabled","rc","webkitImageSmoothingEnabled","mozImageSmoothingEnabled","oImageSmoothingEnabled","msImageSmoothingEnabled","initPlugins","__plugins","sayHello","__","__extends","addSystem","displayObject","skipUpdateTransform","BaseRenderTexture","deprecation","rootResolution","castToBaseTexture","CanvasRenderTarget","resource","CanvasResource","_lastObjectRendered","cacheParent","enableTempParent","updateTransform","disableTempParent","clearBeforeRender","clearRect","backgroundAlpha","_backgroundColorString","clearColor","hex2string","rgb2hex","realWidth","realHeight","tempContext","roundPixels","localResolution","mat","proj","copyFrom","prepend","readyForOuterBlend","outerBlend","removeView","desiredScreenWidth","desiredScreenHeight","settings","SCALE_MODES","registerPlugin","pluginName","ctor","extensions","AbstractRenderer","getTintedCanvas","sprite","stringColor","roundColor","tintCache","cachedCanvas","tintId","_updateID","tintMethod","convertTintToImage","tintImage","Image","src","toDataURL","getTintedPattern","patternCache","createPattern","tintWithMultiply","crop","_frame","ceil","getDrawableSource","tintWithOverlay","tintWithPerPixel","rgbValues","hex2rgb","pixelData","pixels","putImageData","cacheStepsPerColorChannel","canUseMultiply","parentCreate","Renderer","forceCanvas","err","BaseTexture","bitmap","canvasRenderWorldTransform","CanvasSpriteRenderer","_texture","sourceWidth","sourceHeight","destWidth","destHeight","wt","orig","smoothingEnabled","anchor","rotate","groupD8","_cachedTint","_tintedCanvas","Sprite","ENV","BUFFER_BITS","DRAW_MODES","FORMATS","TARGETS","TYPES","SAMPLER_TYPES","WRAP_MODES","MIPMAP_MODES","ALPHA_MODES","CLEAR_MODES","GC_MODES","PRECISION","MASK_TYPES","COLOR_MASK_BITS","MSAA_QUALITY","BUFFER_TYPE","Runner","items","_name","_aliasCount","a0","a6","a7","ensureNonAliasedItems","item","dispatch","INSTALLED","autoDetectResource","ResourcePlugin","__assign","arguments$1","Resource","_width","_height","destroyed","internal","onResize","onError","unbind","load","_baseTexture","_glTexture","dispose","_source","_extension","BufferResource","upload","glTexture","gl","pixelStorei","UNPACK_PREMULTIPLY_ALPHA_WEBGL","alphaMode","texSubImage2D","texImage2D","internalFormat","Float32Array","Uint8Array","Uint32Array","defaultBufferOptions","mipmap","anisotropicLevel","wrapMode","resourceOptions","_mipmap","_wrapMode","_scaleMode","uid","touched","isPowerOfTwo","_refreshPOT","_glTextures","dirtyId","dirtyStyleId","cacheId","textureCacheIds","_batchEnabled","_batchLocation","parentTextureArray","setResource","setStyle","setSize","desiredWidth","desiredHeight","setRealSize","isPow2","oldResolution","BaseTextureCache","TextureCache","removeFromCache","strict","isFrame","_pixiId","pixiIdPrefix","addToCache","fromBuffer","baseTextureFromCache","_globalBatch","AbstractMultiResource","itemDirtyIds","partTexture","_load","initFromArray","resources","addBaseTextureAt","addResourceAt","promises","ArrayResource","urls","texImage3D","TEXTURE_2D_ARRAY","texSubImage3D","BaseImageResource","sourceAny","naturalWidth","videoWidth","naturalHeight","videoHeight","noSubImage","crossOrigin","crossorigin","determineCrossOrigin","HTMLImageElement","HTMLVideoElement","readyState","TEXTURE_2D","OffscreenCanvas","globalThis","HTMLCanvasElement","CubeResource","autoLoad","linkBaseTexture","SIDES","ImageResource","imageElement","_process","preserveBitmap","createBitmap","createImageBitmap","completed","onload","onerror","cors","fetch","mode","blob","premultiplyAlpha","glTextures","otherTex","SVGResource","sourceBase64","_overrideWidth","_overrideHeight","_resolve","_crossorigin","SVG_XML","btoa","unescape","_loadSvg","tempImage","svgWidth","svgHeight","svgString","sizeMatch","SVG_SIZE","VideoResource","videoElement","firstSrc","sourceElement","mime","baseSrc","ext","MIME_TYPES","_autoUpdate","_isConnectedToTicker","_updateFPS","updateFPS","_msToNextUpdate","autoPlay","_onCanPlay","_onError","_deltaTime","playbackRate","HAVE_ENOUGH_DATA","HAVE_FUTURE_DATA","_onPlayStart","_onPlayStop","_isSourceReady","_isSourcePlaying","currentTime","ended","autoUpdate","play","ogv","mov","m4v","ImageBitmapResource","ImageBitmap","DepthResource","Framebuffer","stencil","depth","dirtyFormat","dirtySize","depthTexture","colorTextures","glFramebuffers","disposeRunner","multisample","addColorTexture","addDepthTexture","enableDepth","enableStencil","destroyDepthTexture","framebuffer","maskStack","filterStack","TextureUvs","uvsFloat32","frame","baseFrame","tw","th","w2","h2","cX","cY","DEFAULT_UVS","removeAllHandlers","tex","noFrame","_uvs","uvMatrix","_rotate","defaultAnchor","onBaseTextureUpdated","updateUvs","destroyBase","clonedFrame","clonedOrig","clonedTexture","getResolutionOfUrl","fromURL","fromLoader","imageUrl","textureFromCache","xNotFit","yNotFit","relationship","errorX","errorY","_EMPTY","_WHITE","baseRenderTexture","filterFrame","filterPoolKey","resizeBaseTexture","RenderTexturePool","textureOptions","texturePool","enableFullScreen","_pixelsWidth","_pixelsHeight","createTexture","getOptimalTexture","nextPow2","getFilterTexture","filterTexture","returnTexture","returnFilterTexture","destroyTextures","textures","setScreenSize","SCREEN_KEY","Attribute","normalized","stride","UID$4","Buffer","_static","_glBuffers","static","map$1","Int32Array","byteSizeMap$1","UID$3","Uint16Array","Geometry","buffers","indexBuffer","glVertexArrayObjects","instanced","instanceCount","refCount","addAttribute","ids","bufferIndex","getBuffer","addIndex","getIndex","interleave","arrays","interleavedBuffer","attribute","outSize","views","littleOffset","getBufferType","interleaveTypedArrays","attrib","merge","geometries","geometryOut","offset2","bufferIndexToCount","indexBufferData","Quad","QuadUv","uvs","vertexBuffer","uvBuffer","targetTextureFrame","destinationFrame","invalidate","UID$2","UniformGroup","uniforms","isStatic","isUbo","group","syncUniforms","ubo","autoManage","_ubo","uboFrom","FilterState","legacy","sourceFrame","bindingSourceFrame","bindingDestinationFrame","filters","tempPoints","tempMatrix$2","FilterSystem","defaultFilterStack","statePool","quad","quadUv","tempRect","activeState","globalUniforms","outputFrame","inputSize","inputPixel","inputClamp","filterArea","filterClamp","forceClear","useMaxPadding","renderTextureSystem","autoFit","getBounds","pad","sourceFrameProjected","projection","transformAABB","roundFrame","getOptimalFilterTexture","lastState","blit","flop","bindAndClear","clearMode","stateSystem","autoClear","stateId","applyFilter","uSampler","filterGlobals","shader","program","attributeData","aTextureCoord","draw","calculateSpriteMatrix","outputMatrix","mappedMatrix","translate","swap","emptyPool","lt","lb","rt","rb","identity","ObjectRenderer","flush","_object","BatchSystem","emptyRenderer","currentRenderer","setObjectRenderer","objectRenderer","copyBoundTextures","maxTextures","boundTextures","boundArray","texArray","batchId","loc","CONTEXT_UID_COUNTER","ContextSystem","webGLVersion","supports","uint32Indices","handleContextLost","handleContextRestored","isContextLost","contextChange","CONTEXT_UID","getExtension","restoreContext","initFromContext","validateContext","runners","initFromOptions","createContext","getExtensions","common","anisotropicFiltering","floatTextureLinear","s3tc","s3tc_sRGB","etc","etc1","pvrtc","atc","astc","drawBuffers","loseContext","vertexArrayObject","uint32ElementIndex","floatTexture","textureHalfFloat","textureHalfFloatLinear","colorBufferFloat","useProgram","postrender","getContextAttributes","isWebGl2","WebGL2RenderingContext","hasuint32","GLFramebuffer","msaaBuffer","blitFramebuffer","mipLevel","tempRectangle","FramebufferSystem","managedFramebuffers","unknownFramebuffer","msaaSamples","hasMRT","writeDepthTexture","disposeAll","nativeDrawBuffersExtension_1","nativeDepthTextureExtension","activeTextures","drawBuffersWEBGL","getInternalformatParameter","RENDERBUFFER","RGBA8","SAMPLES","fbo","initFramebuffer","bindFramebuffer","FRAMEBUFFER","updateFramebuffer","resizeFramebuffer","mipWidth","mipHeight","setViewport","mask","createFramebuffer","detectSamples","bindRenderbuffer","renderbufferStorageMultisample","DEPTH24_STENCIL8","renderbufferStorage","DEPTH_STENCIL","parentTexture","canMultisampleFramebuffer","createRenderbuffer","framebufferRenderbuffer","COLOR_ATTACHMENT0","deleteRenderbuffer","framebufferTexture2D","DEPTH_ATTACHMENT","DEPTH_STENCIL_ATTACHMENT","samples","sourcePixels","destPixels","colorTexture","sameSize","READ_FRAMEBUFFER","COLOR_BUFFER_BIT","NEAREST","LINEAR","disposeFramebuffer","contextLost","deleteFramebuffer","forceStencil","byteSizeMap","GeometrySystem","_activeGeometry","_activeVao","hasVao","hasInstance","canUseUInt32ElementIndex","managedGeometries","nativeVaoExtension_1","createVertexArray","createVertexArrayOES","bindVertexArray","vao","bindVertexArrayOES","deleteVertexArray","deleteVertexArrayOES","instanceExt_1","vertexAttribDivisor","vertexAttribDivisorANGLE","drawElementsInstanced","drawElementsInstancedANGLE","drawArraysInstanced","drawArraysInstancedANGLE","vaos","incRefCount","initGeometryVao","activateVao","updateBuffers","bufferSystem","checkCompatibility","geometryAttributes","shaderAttributes","getSignature","attribs","strings","glPrograms","generateProgram","signature","vaoObjectHash","tempStride","tempStart","attribSize","disposeGeometry","buf","vaoId","lastBuffer","glBuffer","enableVertexAttribArray","vertexAttribPointer","FLOAT","byteSize","BYTES_PER_ELEMENT","glType","UNSIGNED_SHORT","UNSIGNED_INT","drawElements","drawArrays","MaskData","autoDetect","pooled","isMaskData","colorMask","_filters","_stencilCounter","_scissorCounter","_scissorRect","_scissorRectLocal","_colorMask","_target","copyCountersOrReset","maskAbove","compileShader","createShader","shaderSource","logPrettyShaderError","shaderSrc","getShaderSource","line","shaderLog","getShaderInfoLog","splitShader","dedupe","lineNumbers","logArgs","fragmentSourceToLog","booleanArray","defaultValue","maxFragmentPrecision","unknownContext","getMaxFragmentPrecision","getTestContext","getShaderPrecisionFormat","shaderFragment","FRAGMENT_SHADER","HIGH_FLOAT","precision","setPrecision","requestedPrecision","maxSupportedPrecision","substring","GLSL_TO_SIZE","float","vec2","vec3","vec4","int","ivec2","ivec3","ivec4","uint","uvec2","uvec3","uvec4","bool","bvec2","bvec3","bvec4","mat2","mat3","mat4","sampler2D","mapSize","GL_TABLE","GL_TO_GLSL_TYPES","FLOAT_VEC2","FLOAT_VEC3","FLOAT_VEC4","INT","INT_VEC2","INT_VEC3","INT_VEC4","UNSIGNED_INT_VEC2","UNSIGNED_INT_VEC3","UNSIGNED_INT_VEC4","BOOL","BOOL_VEC2","BOOL_VEC3","BOOL_VEC4","FLOAT_MAT2","FLOAT_MAT3","FLOAT_MAT4","SAMPLER_2D","INT_SAMPLER_2D","UNSIGNED_INT_SAMPLER_2D","SAMPLER_CUBE","INT_SAMPLER_CUBE","UNSIGNED_INT_SAMPLER_CUBE","SAMPLER_2D_ARRAY","INT_SAMPLER_2D_ARRAY","UNSIGNED_INT_SAMPLER_2D_ARRAY","mapType","typeNames","tn","uniformParsers","uniform","codeUbo","GLSL_TO_SINGLE_SETTERS_CACHED","samplerCube","sampler2DArray","GLSL_TO_ARRAY_SETTERS","unsafeEval","fragTemplate","generateIfTestSrc","maxIfs","UID$1","nameCache","Program","vertexSrc","fragmentSrc","defaultVertexSrc","defaultFragmentSrc","ProgramCache","Shader","uniformBindCount","uniformGroup","checkUniformExists","State","polygonOffset","blend","depthMask","_blendMode","_polygonOffset","clockwiseFrontFace","culling","for2d","depthTest","Filter","filterManager","_currentState","_resolution","tempMat","TextureMatrix","clampMargin","mapCoord","uClampFrame","uClampOffset","_textureID","clampOffset","isSimple","multiplyUvs","texBase","SpriteMaskFilter","maskSprite","maskMatrix","_maskSprite","npmAlpha","otherMatrix","maskClamp","MaskSystem","enableScissor","alphaMaskPool","maskDataPool","alphaMaskIndex","setMaskStack","scissor","maskDataOrTarget","detect","pushSpriteMask","pushColorMask","popSpriteMask","popColorMask","maskCurrent","isSprite","testScissor","alphaMaskFilter","stashFilterArea","currColorMask","nextColorMask","AbstractMaskSystem","glConst","getStackLength","curStackLen","newStackLen","disable","enable","_useCurrent","tempMatrix$1","rectPool","ScissorSystem","SCISSOR_TEST","calcScissorRect","prevData","roundFrameToPixels","isMatrixRotated","isFastRect","StencilSystem","STENCIL_TEST","prevMaskCount","clearStencil","STENCIL_BUFFER_BIT","stencilFunc","EQUAL","stencilOp","KEEP","INCR","batch","DECR","ProjectionSystem","defaultFrame","projectionMatrix","calculateProjection","syncUniformGroup","globals","_destinationFrame","pm","_matrix","tempRect2","RenderTextureSystem","_backgroundColorRgba","defaultMaskStack","viewportFrame","clearMask","uboUpdate","_ud","_uv","_syncData","UBO_TO_SINGLE_SETTERS","GLSL_TO_STD40_SIZE","generateUniformBufferSync","uniformData","syncFunc","usedUniformDatas","getUBOData","uboElements","dataLen","chunkSize","uboElement","lineUpValue","createUBOElements","funcFragments","parsed","uniformParser","size_1","rowSize","elementSize","remainder","template","Function","GLProgram","uniformGroups","uniformDirtyGroups","uniformBufferBindings","glVertShader","VERTEX_SHADER","glFragShader","webGLProgram","createProgram","attachShader","linkProgram","getProgramParameter","LINK_STATUS","vertexShader","fragmentShader","getShaderParameter","COMPILE_STATUS","getProgramInfoLog","logProgramError","totalAttributes","ACTIVE_ATTRIBUTES","attribData","getActiveAttrib","getAttribLocation","getAttributeData","totalUniforms","ACTIVE_UNIFORMS","getActiveUniform","getUniformData","bindAttribLocation","deleteShader","getUniformLocation","UID","defaultSyncData","textureCount","uboCount","ShaderSystem","systemCheck","cache","_uboCache","func","unsafeEvalSupported","dontSync","glProgram","setUniforms","syncData","getGlProgram","createSyncGroups","generateUniformsSync","syncUniformBufferGroup","createSyncBufferGroup","bindBufferBase","uniformBlockIndex","getUniformBlockIndex","uniformBlockBinding","uboData","preFix","StateSystem","_blendEq","setBlend","setOffset","setCullFace","setDepthTest","setFrontFace","setDepthMask","checks","ONE","ONE_MINUS_SRC_ALPHA","DST_COLOR","ONE_MINUS_SRC_COLOR","SRC_ALPHA","DST_ALPHA","ZERO","ONE_MINUS_DST_ALPHA","FUNC_REVERSE_SUBTRACT","FUNC_ADD","mapWebGLBlendModesToPixi","diff","forceState","updateCheck","checkBlendMode","BLEND","checkPolygonOffset","POLYGON_OFFSET_FILL","DEPTH_TEST","CULL_FACE","frontFace","blendFunc","blendFuncSeparate","blendEquationSeparate","setPolygonOffset","UNPACK_FLIP_Y_WEBGL","system","TextureGCSystem","checkCount","maxIdle","checkCountMax","tm","managedTextures","wasRemoved","destroyTexture","unload","GLTexture","samplerType","TextureSystem","currentLocation","_unknownBoundTextures","unknownTexture","hasIntegerTextures","internalFormats","table","RGB8","RG8","R8","RGBA8UI","RGB8UI","RG8UI","R8UI","ALPHA","LUMINANCE","LUMINANCE_ALPHA","RGBA8_SNORM","RGB8_SNORM","RG8_SNORM","R8_SNORM","RGBA8I","RGB8I","RG8I","R8I","RGBA16UI","RGB16UI","RG16UI","R16UI","DEPTH_COMPONENT16","RGBA16I","RGB16I","RG16I","R16I","RGBA32UI","RGB32UI","RG32UI","R32UI","DEPTH_COMPONENT24","_g","RGBA32I","RGB32I","RG32I","R32I","_h","RGBA32F","RGB32F","RG32F","R32F","DEPTH_COMPONENT32F","_j","RGBA16F","RGB16F","RG16F","R16F","_k","RGB565","_l","RGBA4","_m","RGB5_A1","_o","RGB10_A2","RGB10_A2UI","_p","R11F_G11F_B10F","_q","RGB9_E5","_r","_s","DEPTH32F_STENCIL8","_t","_u","RGBA","RGB","_v","_w","_x","mapTypeAndFormatToInternalFormat","getParameter","MAX_TEXTURE_IMAGE_UNITS","emptyTextures","emptyTexture2D","bindTexture","UNSIGNED_BYTE","TEXTURE_CUBE_MAP","TEXTURE_CUBE_MAP_POSITIVE_X","texParameteri","TEXTURE_MAG_FILTER","TEXTURE_MIN_FILTER","textureGC","initTexture","activeTexture","TEXTURE0","updateTexture","ensureSamplerType","initTextureType","HALF_FLOAT","updateTextureStyle","skipRemove","deleteTexture","removeItems","generateMipmap","TEXTURE_WRAP_S","TEXTURE_WRAP_T","LINEAR_MIPMAP_LINEAR","NEAREST_MIPMAP_NEAREST","anisotropicExt","level","MAX_TEXTURE_MAX_ANISOTROPY_EXT","texParameterf","TEXTURE_MAX_ANISOTROPY_EXT","autoDensity","preserveDrawingBuffer","_backgroundColor","transparent","staticMap","generateTexture","manualRegion","__rest","thisAny","_tempDisplayObjectParent","GLBuffer","updateID","BufferSystem","managedBuffers","boundBufferBases","createGLBuffer","bindBuffer","UNIFORM_BUFFER","bindBufferRange","bufferSubData","drawType","STATIC_DRAW","DYNAMIC_DRAW","bufferData","deleteBuffer","createBuffer","prerender","antialias","premultipliedAlpha","powerPreference","isWebGLSupported","FRAMEBUFFER_BINDING","DRAW_FRAMEBUFFER_BINDING","DRAW_FRAMEBUFFER","ClassRef","isLost","extract","extensions$1","autoDetectRenderer","System","BatchDrawCall","BatchTextureArray","ViewableBuffer","sizeOrBuffer","rawBinaryData","uint32View","float32View","_int8View","Int8Array","_uint8View","_int16View","Int16Array","_uint16View","_int32View","sizeOf","AbstractBatchRenderer","shaderGenerator","geometryClass","vertexSize","_vertexCount","_indexCount","_bufferedElements","_bufferedTextures","_bufferSize","_shader","_packedGeometries","_packedGeometryPoolSize","_flushId","_aBuffers","_iBuffers","MAX_TEXTURES","onPrerender","_dcIndex","_aIndex","_iIndex","_attributeBuffer","_indexBuffer","_tempBoundTextures","checkMaxIfStatementsInShader","generateShader","initFlushBuffers","_drawCallPool","_textureArrayPool","MAX_SPRITES","MAX_TA","vertexData","indices","buildTexturesAndDrawCalls","textureArrays","TICK","countTexArrays","buildDrawCalls","finish","drawCalls","dcIndex","aIndex","iIndex","drawCall","spriteBlendMode","premultiplyBlendMode","packInterleavedGeometry","bindAndClearTexArray","textureSystem","updateGeometry","packedGeometries","attributeBuffer","_buffer","drawBatches","dcCount","curTexArray","getAttributeBuffer","getIndexBuffer","roundedP2","roundedSizeIndex","log2","roundedSize","packedVertices","indicies","textureId","argb","premultiplyTint","_tintRGB","BatchShaderGenerator","programCache","defaultGroupCache","sampleValues","uSamplers","generateSampleSrc","translationMatrix","BatchGeometry","BatchPluginFactory","vertex","defaultVertex","fragment","defaultFragment","BatchPlugin","BatchRenderer","_resources","systems","_systems","Bounds","isEmpty","getRectangle","addPoint","addPointMatrix","addQuad","addFrame","addFrameMatrix","addVertexData","beginOffset","endOffset","addVertices","addVerticesMatrix","padX","padY","rawX","rawY","addBounds","addBoundsMask","_minX","_minY","_maxX","_maxY","addBoundsMatrix","addBoundsArea","paddingX","paddingY","addFramePad","tempDisplayObjectParent","Transform","cullable","cullArea","_lastSortedIndex","_zIndex","_enabledFilters","_bounds","_localBounds","_boundsID","_boundsRect","_localBoundsRect","_maskRefCount","_destroyed","mixin","propertyName","_recursivePostUpdateTransform","skipUpdate","calculateBounds","transformRef","parentRef","worldBounds","worldBoundsID","displayObjectUpdateTransform","applyInverse","setParent","addChild","rotation","skewX","skewY","pivotX","pivotY","skew","pivot","_options","interactiveChildren","TemporaryDisplayObject","myParent","RAD_TO_DEG","DEG_TO_RAD","sortDirty","sortChildren","sortableChildren","onChildrenChange","_length","_parentID","addChildAt","swapChildren","child2","index1","getChildIndex","setChildIndex","currentIndex","getChildAt","removeChildAt","removeChildren","beginIndex","endIndex","begin","sortRequired","_calculateBounds","skipChildrenUpdate","_renderWithCulling","_render","childCullable","renderAdvanced","NONE","destroyChildren","oldChildren","containerUpdateTransform","normalizeExtension","metadata","_addHandlers","_removeHandlers","_queue","handle","onAdd","onRemove","addHandlers","removeHandlers","handleByMap","handleByList","Loader","LINE_JOIN","LINE_CAP","GRAPHICS_CURVES","adaptive","maxLength","minSegments","maxSegments","epsilon","_segmentsCount","defaultSegments","FillStyle","fixOrientation","i1","i2","i3","i4","buildPoly","build","triangulate","graphicsGeometry","verts","holeArray","vertPos","buildCircle","circle","ellipse","roundedRect","halfWidth","halfHeight","j1","j2","j3","j4","buildRectangle","rectData","getPt","n1","n2","perc","quadraticBezierCurve","fromX","fromY","cpX","cpY","xa","ya","xb","yb","buildRoundedRectangle","nextRoundedRectBehavior","rrectData","vecPos","nx","ny","innerWeight","outerWeight","exx","eyy","eix","eiy","eox","eoy","sx","sy","ex","ey","cx2p0x","cy2p0y","angle0","angle1","startAngle","angleDiff","absAngleDiff","segCount","angleInc","buildLine","native","closedShape","startIndex","buildNativeLine","eps","closePointEps","firstPoint","lastPoint","closedPath","midPointX","midPointY","indexCount","indexStart","widthSquared","miterLimitSquared","perpx","perpy","perp1x","perp1y","ratio","ROUND","SQUARE","dx0","dy0","dx1","dy1","cross","c1","c2","pdist","imx","imy","omx","omy","insideWeight","BEVEL","MITER","eps2","buildNonNativeLine","ArcUtils","curveTo","b1","mm","dd","cc","tt","k1","k2","qy","endAngle","anticlockwise","_startX","_startY","_anticlockwise","sweep","PI_2","theta","theta2","cTheta","sTheta","segMinus","BezierUtils","curveLength","cpX2","cpY2","t2","t3","nt","nt2","nt3","prevX","prevY","dt","dt2","dt3","QuadraticUtils","a32","ba","BatchPart","attribStart","endAttrib","FILL_COMMANDS","BATCH_POOL","DRAW_CALL_POOL","GraphicsData","tmpPoint","GraphicsGeometry","boundsPadding","indicesUint16","batchable","colors","textureIds","batchDirty","batches","cacheDirty","clearDirty","shapeIndex","boundsDirty","updateBatches","batchPart","drawShape","drawHole","lastShape","containsPoint","hitHole","i_1","validateBatching","currentStyle","transformPoints","processHoles","nextTexture","index_1","attribIndex","processFill","processLine","_compareStyles","addUvs","need32","isBatchable","packBatches","styleA","styleB","BATCHABLE_SIZE","currentGroup","currentTexture","drawMode","addColors","addTextureIds","packAttributes","glPoints","f32","u32","rgb","rgba","uvsStart","adjustUvs","LineStyle","BUTT","temp","DEFAULT_SHADERS","currentPath","batchTint","_fillStyle","_lineStyle","_holeMode","_geometry","_transformID","_tint","lineTextureStyle","startPoly","Polygon","_initCurve","arcTo","radius_1","xDiff","yDiff","beginFill","beginTextureFill","endFill","drawRect","drawRoundedRect","RoundedRectangle","drawCircle","Circle","drawEllipse","Ellipse","drawPolygon","poly","_populateBatches","_renderBatched","_renderDirect","gI","_batchRGB","calculateVertices","calculateTints","_resolveDirectShader","_renderDrawCallDirect","groupTextureCount","_TEMP_POINT","tintRGB","wtID","_worldID","setMatrix","beginHole","endHole","InteractionData","pressure","rotationAngle","twist","tangentialPressure","originalEvent","isPrimary","tiltX","tiltY","getLocalPosition","globalPos","copyEvent","isInteger","InteractionEvent","stopped","stopsPropagatingAt","stopPropagationHint","currentTarget","InteractionTrackingData","_pointerId","_flags","FLAGS","_doSet","yn","OVER","RIGHT_DOWN","LEFT_DOWN","freeze","TreeSearch","_tempPoint","recursiveFindHit","interactionEvent","hitTest","hit","interactiveParent","hitTestChildren","childHit","findHit","interactiveTarget","buttonMode","trackedPointers","_trackedPointers","hitTestEvent","InteractionManager","autoPreventDefault","interactionFrequency","activeInteractionData","interactionDataPool","eventData","moveWhenInside","eventsAdded","tickerAdded","mouseOverRenderer","supportsTouchEvents","supportsPointerEvents","PointerEvent","onPointerUp","processPointerUp","onPointerCancel","processPointerCancel","onPointerDown","processPointerDown","onPointerMove","processPointerMove","onPointerOut","processPointerOverOut","onPointerOver","cursorStyles","currentCursorMode","delayedEvents","_tempDisplayObject","_eventListenerOptions","_useSystemTicker","useSystemTicker","setTargetElement","addTickerListener","removeTickerListener","globalPoint","lastObjectRendered","processInteractive","removeEvents","addEvents","tickerUpdate","UPDATE_PRIORITY","msPointerEnabled","msContentZooming","msTouchAction","touchAction","deltaTime","_didMove","interactionData","configureInteractionEventForDOMEvent","setCursorMode","applyStyles","dispatchEvent","eventString","delayDispatchEvent","resolutionMultiplier","delayedLen","displayObject_1","normalizeToPointerData","isNormalized","cancelable","eventLen","getInteractionDataForPointerId","isRightButton","rightDown","leftDown","onPointerComplete","composedPath","eventAppend","releaseInteractionDataForPointerId","trackingData","isTouch","isMouseTap","isDown","over","none","pointerEvent","globalX","globalY","normalizedEvents","TouchEvent","li","radiusX","radiusY","layerX","layerY","MouseEvent","tempEvent","RECT","rectangle","x0_1","y0_1","n00","n10","n01","n11","m00","m10","m01","m11","enlarge","CIRC","r2","ELIP","normx","normy","flat","il","POLY","xi","yi","xj","yj","pointsDesc","currentPoint","RREC","radius2","ObservablePoint","_y","fromArray","toArray","transpose","pos","newPos","tx1","d1","decompose","ux","uy","vx","vy","rotationCayley","rotationMatrices","signum","_ux","_uy","_vx","_vy","init","SE","S","SW","W","NW","NE","MIRROR_VERTICAL","MAIN_DIAGONAL","MIRROR_HORIZONTAL","REVERSE_DIAGONAL","uX","ind","uY","vX","vY","inv","rotationSecond","rotationFirst","sub","rotate180","byDirection","matrixAppendRotationInv","updateSkew","_rotation","_cx","_sx","_cy","_sy","_localID","_currentLocalID","parentTransform","pt","setFromMatrix","IDENTITY","BrowserAdapter","createCanvas","getWebGLRenderingContext","WebGLRenderingContext","getNavigator","getBaseUrl","baseURI","appleIphone","appleIpod","appleTablet","appleUniversal","androidPhone","androidTablet","amazonPhone","amazonTablet","windowsPhone","windowsTablet","otherBlackBerry","otherBlackBerry10","otherOpera","otherChrome","otherFirefox","isAppleTabletOnIos13","platform","maxTouchPoints","MSStream","param","nav","tmp","createMatch","apple","phone","ipod","tablet","universal","device","amazon","android","windows","blackberry","blackberry10","firefox","any","isMobile$1","ADAPTER","MIPMAP_TEXTURES","POW2","ANISOTROPIC_LEVEL","RESOLUTION","FILTER_RESOLUTION","FILTER_MULTISAMPLE","SPRITE_MAX_TEXTURES","allowMax","maxRecommendedTextures","SPRITE_BATCH_SIZE","RENDER_OPTIONS","GC_MODE","AUTO","GC_MAX_IDLE","GC_MAX_CHECK_COUNT","WRAP_MODE","CLAMP","SCALE_MODE","PRECISION_VERTEX","HIGH","PRECISION_FRAGMENT","MEDIUM","CAN_UPLOAD_SAME_BUFFER","CREATE_IMAGE_BITMAP","ROUND_PIXELS","tempPoint","_anchor","_onAnchorUpdate","vertexTrimmedData","_transformTrimmedID","_textureTrimmedID","_roundPixels","_onTextureUpdate","w0","w1","h0","h1","calculateTrimmedVertices","destroyBaseTexture","TEXT_GRADIENT","defaultStyle","align","breakWords","dropShadow","dropShadowAlpha","dropShadowAngle","dropShadowBlur","dropShadowColor","dropShadowDistance","fillGradientType","LINEAR_VERTICAL","fillGradientStops","fontFamily","fontStyle","fontVariant","fontWeight","letterSpacing","strokeThickness","textBaseline","whiteSpace","wordWrap","wordWrapWidth","leading","genericFontFamilies","TextStyle","styleID","deepCopyProperties","clonedProperties","_align","_breakWords","_dropShadow","_dropShadowAlpha","_dropShadowAngle","_dropShadowBlur","_dropShadowColor","outputColor","getColor","_dropShadowDistance","_fill","_fillGradientType","_fillGradientStops","array1","array2","areArraysEqual","_fontFamily","_fontSize","_fontStyle","_fontVariant","_fontWeight","_letterSpacing","_lineHeight","_leading","_lineJoin","_miterLimit","_padding","_stroke","_strokeThickness","_textBaseline","_trim","_whiteSpace","_wordWrap","_wordWrapWidth","toFontString","fontSizeString","fontFamilies","getSingleColor","propertyObj","TextMetrics","text","lines","lineWidths","maxLineWidth","fontProperties","measureText","_canvas","font","measureFont","ascent","collapseSpaces","collapseNewlines","canPrependSpaces","tokens","tokenize","token","isNewline","addLine","currIsBreakingSpace","isBreakingSpace","lastIsBreakingSpace","tokenWidth","getFromCache","canBreakWords","characters","wordWrapSplit","char","nextChar","lastChar","canBreakChars","characterWidth","isLastToken","newLine","trimRight","_newlines","_nextChar","_breakingSpaces","_token","_char","_index","_fonts","properties","descent","_context","metricsString","METRICS_STRING","BASELINE_SYMBOL","baseline","HEIGHT_MULTIPLIER","BASELINE_MULTIPLIER","fillText","imagedata","clearMetrics","__canvas","__context","defaultDestroyOptions","Text","ownCanvas","_ownCanvas","_autoResolution","_text","_style","_styleListener","_font","localStyleID","updateText","respectDirty","linePositionX","linePositionY","measured","passesCount","isShadowPass","dsOffsetText","dsOffsetShadow","string2hex","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","_generateFillStyle","linePositionYShift","nextLineHeightBehavior","drawLetterSpacing","isStroke","supportLetterSpacing","experimentalLetterSpacing","CanvasRenderingContext2D","textLetterSpacing","strokeText","currentPosition","stringArray","previousWidth","currentWidth","currentChar","textStr","trimmed","trimCanvas","metrics","gradient","dropShadowCorrection","lengthPlus1","createLinearGradient","textHeight","lastLineBottom","thisLineTop","thisLineGradientStart","thisLineBottom","nextLineTop","thisLineGradientEnd","gradStopLineHeight","lineStop","globalStop","toFixed","addColorStop","totalIterations","currentIteration","TickerListener","redirect","connect","hard","autoStart","lastTime","started","_requestId","_maxElapsedMS","_minElapsedMS","_protected","_lastFrame","_head","deltaMS","_tick","_requestIfNeeded","_cancelIfNeeded","cancelAnimationFrame","_startIfPossible","NORMAL","_addListener","addOnce","fps","minFPS","maxFPS","minFPMS","_shared","shared","_system","TickerPlugin","sharedTicker","_ticker","LOW","oldTicker","supported","saidHello","VERSION","contextOptions","failIfMajorPerformanceCaveat","success","hexString","cssColorNames","npm","mapPremultipliedBlendModes","startIdx","removeCount","nextUid","warnings","ignoreDepth","stack","tempAnchor","url$1","parsedUrl","samePort"],"sourceRoot":""}